@vibe-forge/client 0.2.0-alpha.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/LICENSE +21 -0
- package/cli.cjs +6 -0
- package/index.html +27 -0
- package/package.json +42 -0
- package/src/App.tsx +174 -0
- package/src/api.ts +241 -0
- package/src/components/ArchiveView.scss +168 -0
- package/src/components/ArchiveView.tsx +299 -0
- package/src/components/AutomationView/AutomationView.scss +26 -0
- package/src/components/AutomationView/RuleFormPanel.scss +129 -0
- package/src/components/AutomationView/RuleFormPanel.tsx +257 -0
- package/src/components/AutomationView/RuleSidebar.scss +219 -0
- package/src/components/AutomationView/RuleSidebar.tsx +258 -0
- package/src/components/AutomationView/RunHistoryPanel.scss +286 -0
- package/src/components/AutomationView/RunHistoryPanel.tsx +320 -0
- package/src/components/AutomationView/TaskList.scss +128 -0
- package/src/components/AutomationView/TaskList.tsx +79 -0
- package/src/components/AutomationView/TriggerList.scss +153 -0
- package/src/components/AutomationView/TriggerList.tsx +217 -0
- package/src/components/AutomationView/index.tsx +228 -0
- package/src/components/AutomationView/types.ts +21 -0
- package/src/components/Chat.scss +89 -0
- package/src/components/Chat.tsx +92 -0
- package/src/components/ConfigView.scss +185 -0
- package/src/components/ConfigView.tsx +258 -0
- package/src/components/NavRail.scss +71 -0
- package/src/components/NavRail.tsx +188 -0
- package/src/components/Sidebar.scss +112 -0
- package/src/components/Sidebar.tsx +291 -0
- package/src/components/chat/ChatHeader.scss +401 -0
- package/src/components/chat/ChatHeader.tsx +342 -0
- package/src/components/chat/ChatHistoryView.tsx +122 -0
- package/src/components/chat/ChatSettingsView.tsx +22 -0
- package/src/components/chat/ChatTimelineView.scss +53 -0
- package/src/components/chat/ChatTimelineView.tsx +158 -0
- package/src/components/chat/CodeBlock.scss +87 -0
- package/src/components/chat/CodeBlock.tsx +179 -0
- package/src/components/chat/CompletionMenu.scss +70 -0
- package/src/components/chat/CompletionMenu.tsx +58 -0
- package/src/components/chat/CurrentTodoList.scss +217 -0
- package/src/components/chat/CurrentTodoList.tsx +103 -0
- package/src/components/chat/MarkdownContent.tsx +43 -0
- package/src/components/chat/MessageFooter.tsx +48 -0
- package/src/components/chat/MessageItem.scss +251 -0
- package/src/components/chat/MessageItem.tsx +78 -0
- package/src/components/chat/NewSessionGuide.scss +186 -0
- package/src/components/chat/NewSessionGuide.tsx +167 -0
- package/src/components/chat/Sender.scss +367 -0
- package/src/components/chat/Sender.tsx +541 -0
- package/src/components/chat/SessionTimelinePanel/EventList.scss +58 -0
- package/src/components/chat/SessionTimelinePanel/EventList.tsx +212 -0
- package/src/components/chat/SessionTimelinePanel/gantt.ts +177 -0
- package/src/components/chat/SessionTimelinePanel/git-graph.ts +518 -0
- package/src/components/chat/SessionTimelinePanel/index.scss +28 -0
- package/src/components/chat/SessionTimelinePanel/index.tsx +121 -0
- package/src/components/chat/SessionTimelinePanel/mermaid.ts +4 -0
- package/src/components/chat/SessionTimelinePanel/types.ts +64 -0
- package/src/components/chat/SessionTimelinePanel/utils.ts +20 -0
- package/src/components/chat/ThinkingStatus.scss +70 -0
- package/src/components/chat/ThinkingStatus.tsx +13 -0
- package/src/components/chat/ToolCallBox.scss +137 -0
- package/src/components/chat/ToolCallBox.tsx +55 -0
- package/src/components/chat/ToolGroup.scss +154 -0
- package/src/components/chat/ToolGroup.tsx +102 -0
- package/src/components/chat/ToolRenderer.tsx +45 -0
- package/src/components/chat/messageUtils.ts +171 -0
- package/src/components/chat/safeSerialize.ts +84 -0
- package/src/components/chat/tools/DefaultTool.tsx +63 -0
- package/src/components/chat/tools/adapter-claude/BashTool.scss +71 -0
- package/src/components/chat/tools/adapter-claude/BashTool.tsx +82 -0
- package/src/components/chat/tools/adapter-claude/GlobTool.scss +88 -0
- package/src/components/chat/tools/adapter-claude/GlobTool.tsx +85 -0
- package/src/components/chat/tools/adapter-claude/GrepTool.scss +96 -0
- package/src/components/chat/tools/adapter-claude/GrepTool.tsx +114 -0
- package/src/components/chat/tools/adapter-claude/LSTool.scss +85 -0
- package/src/components/chat/tools/adapter-claude/LSTool.tsx +94 -0
- package/src/components/chat/tools/adapter-claude/ReadTool.scss +57 -0
- package/src/components/chat/tools/adapter-claude/ReadTool.tsx +87 -0
- package/src/components/chat/tools/adapter-claude/TodoTool.scss +78 -0
- package/src/components/chat/tools/adapter-claude/TodoTool.tsx +60 -0
- package/src/components/chat/tools/adapter-claude/WriteTool.scss +92 -0
- package/src/components/chat/tools/adapter-claude/WriteTool.tsx +86 -0
- package/src/components/chat/tools/adapter-claude/components/FileList.scss +65 -0
- package/src/components/chat/tools/adapter-claude/components/FileList.tsx +185 -0
- package/src/components/chat/tools/adapter-claude/index.ts +28 -0
- package/src/components/chat/tools/defineToolRender.ts +28 -0
- package/src/components/chat/tools/task/GetTaskInfoTool.scss +50 -0
- package/src/components/chat/tools/task/GetTaskInfoTool.tsx +88 -0
- package/src/components/chat/tools/task/ListTasksTool.scss +56 -0
- package/src/components/chat/tools/task/ListTasksTool.tsx +83 -0
- package/src/components/chat/tools/task/StartTasksTool.scss +56 -0
- package/src/components/chat/tools/task/StartTasksTool.tsx +96 -0
- package/src/components/chat/tools/task/components/TaskToolCard.scss +127 -0
- package/src/components/chat/tools/task/components/TaskToolCard.tsx +177 -0
- package/src/components/chat/tools/task/index.ts +15 -0
- package/src/components/chat/useChatModels.tsx +206 -0
- package/src/components/chat/useChatSession.ts +370 -0
- package/src/components/config/ConfigAboutSection.scss +111 -0
- package/src/components/config/ConfigAboutSection.tsx +86 -0
- package/src/components/config/ConfigDisplayValue.scss +22 -0
- package/src/components/config/ConfigDisplayValue.tsx +62 -0
- package/src/components/config/ConfigEditors.scss +65 -0
- package/src/components/config/ConfigEditors.tsx +98 -0
- package/src/components/config/ConfigFieldRow.scss +97 -0
- package/src/components/config/ConfigFieldRow.tsx +36 -0
- package/src/components/config/ConfigSectionForm.scss +94 -0
- package/src/components/config/ConfigSectionForm.tsx +436 -0
- package/src/components/config/ConfigSectionPanel.tsx +67 -0
- package/src/components/config/ConfigShortcutInput.scss +11 -0
- package/src/components/config/ConfigShortcutInput.tsx +52 -0
- package/src/components/config/ConfigSourceSwitch.tsx +57 -0
- package/src/components/config/configSchema.ts +319 -0
- package/src/components/config/configUtils.ts +83 -0
- package/src/components/config/index.tsx +5 -0
- package/src/components/config/recordEditors/BooleanRecordEditor.scss +1 -0
- package/src/components/config/recordEditors/BooleanRecordEditor.tsx +75 -0
- package/src/components/config/recordEditors/KeyValueEditor.scss +1 -0
- package/src/components/config/recordEditors/KeyValueEditor.tsx +97 -0
- package/src/components/config/recordEditors/McpServersRecordEditor.scss +1 -0
- package/src/components/config/recordEditors/McpServersRecordEditor.tsx +258 -0
- package/src/components/config/recordEditors/ModelServicesRecordEditor.scss +1 -0
- package/src/components/config/recordEditors/ModelServicesRecordEditor.tsx +233 -0
- package/src/components/config/recordEditors/RecordEditors.scss +117 -0
- package/src/components/config/recordEditors/RecordJsonEditor.scss +1 -0
- package/src/components/config/recordEditors/RecordJsonEditor.tsx +113 -0
- package/src/components/config/recordEditors/index.tsx +5 -0
- package/src/components/knowledge-base/KnowledgeBaseView.scss +19 -0
- package/src/components/knowledge-base/KnowledgeBaseView.tsx +186 -0
- package/src/components/knowledge-base/components/ActionButton.scss +5 -0
- package/src/components/knowledge-base/components/ActionButton.tsx +9 -0
- package/src/components/knowledge-base/components/EmptyState.scss +19 -0
- package/src/components/knowledge-base/components/EmptyState.tsx +42 -0
- package/src/components/knowledge-base/components/EntitiesTab.scss +5 -0
- package/src/components/knowledge-base/components/EntitiesTab.tsx +80 -0
- package/src/components/knowledge-base/components/EntityItem.scss +82 -0
- package/src/components/knowledge-base/components/EntityItem.tsx +79 -0
- package/src/components/knowledge-base/components/EntityList.scss +5 -0
- package/src/components/knowledge-base/components/EntityList.tsx +70 -0
- package/src/components/knowledge-base/components/FilterBar.scss +21 -0
- package/src/components/knowledge-base/components/FilterBar.tsx +51 -0
- package/src/components/knowledge-base/components/FlowsTab.scss +5 -0
- package/src/components/knowledge-base/components/FlowsTab.tsx +80 -0
- package/src/components/knowledge-base/components/KnowledgeBaseHeader.scss +27 -0
- package/src/components/knowledge-base/components/KnowledgeBaseHeader.tsx +29 -0
- package/src/components/knowledge-base/components/KnowledgeList.scss +19 -0
- package/src/components/knowledge-base/components/KnowledgeList.tsx +19 -0
- package/src/components/knowledge-base/components/LoadingState.scss +5 -0
- package/src/components/knowledge-base/components/LoadingState.tsx +11 -0
- package/src/components/knowledge-base/components/MetaList.scss +19 -0
- package/src/components/knowledge-base/components/MetaList.tsx +18 -0
- package/src/components/knowledge-base/components/RulesTab.scss +5 -0
- package/src/components/knowledge-base/components/RulesTab.tsx +49 -0
- package/src/components/knowledge-base/components/SectionHeader.scss +22 -0
- package/src/components/knowledge-base/components/SectionHeader.tsx +21 -0
- package/src/components/knowledge-base/components/SkillsTab.scss +5 -0
- package/src/components/knowledge-base/components/SkillsTab.tsx +49 -0
- package/src/components/knowledge-base/components/SpecItem.scss +138 -0
- package/src/components/knowledge-base/components/SpecItem.tsx +131 -0
- package/src/components/knowledge-base/components/SpecList.scss +5 -0
- package/src/components/knowledge-base/components/SpecList.tsx +70 -0
- package/src/components/knowledge-base/components/TabContent.scss +8 -0
- package/src/components/knowledge-base/components/TabContent.tsx +17 -0
- package/src/components/knowledge-base/components/TabLabel.scss +10 -0
- package/src/components/knowledge-base/components/TabLabel.tsx +15 -0
- package/src/components/knowledge-base/index.tsx +1 -0
- package/src/components/sidebar/SessionItem.scss +256 -0
- package/src/components/sidebar/SessionItem.tsx +265 -0
- package/src/components/sidebar/SessionList.scss +92 -0
- package/src/components/sidebar/SessionList.tsx +166 -0
- package/src/components/sidebar/SidebarHeader.scss +79 -0
- package/src/components/sidebar/SidebarHeader.tsx +128 -0
- package/src/connectionManager.ts +172 -0
- package/src/hooks/useGlobalShortcut.ts +26 -0
- package/src/hooks/useQueryParams.ts +54 -0
- package/src/i18n.ts +22 -0
- package/src/main.tsx +41 -0
- package/src/resources/locales/en.json +765 -0
- package/src/resources/locales/zh.json +766 -0
- package/src/store/index.ts +23 -0
- package/src/styles/global.scss +100 -0
- package/src/utils/shortcutUtils.ts +88 -0
- package/src/vite-env.d.ts +12 -0
- package/src/ws.ts +33 -0
- package/vite.config.ts +26 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import './EntityList.scss'
|
|
2
|
+
|
|
3
|
+
import { List } from 'antd'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
|
|
6
|
+
import type { EntitySummary } from '#~/api.js'
|
|
7
|
+
import { EmptyState } from './EmptyState'
|
|
8
|
+
import { EntityItem } from './EntityItem'
|
|
9
|
+
import { KnowledgeList } from './KnowledgeList'
|
|
10
|
+
import { LoadingState } from './LoadingState'
|
|
11
|
+
|
|
12
|
+
type EntityListProps = {
|
|
13
|
+
isLoading: boolean
|
|
14
|
+
entities: EntitySummary[]
|
|
15
|
+
filteredEntities: EntitySummary[]
|
|
16
|
+
onCreate: () => void
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function EntityList({
|
|
20
|
+
isLoading,
|
|
21
|
+
entities,
|
|
22
|
+
filteredEntities,
|
|
23
|
+
onCreate
|
|
24
|
+
}: EntityListProps) {
|
|
25
|
+
const { t } = useTranslation()
|
|
26
|
+
|
|
27
|
+
if (isLoading) {
|
|
28
|
+
return (
|
|
29
|
+
<div className='knowledge-base-view__entity-list'>
|
|
30
|
+
<LoadingState />
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (entities.length === 0) {
|
|
36
|
+
return (
|
|
37
|
+
<div className='knowledge-base-view__entity-list'>
|
|
38
|
+
<EmptyState
|
|
39
|
+
description={t('knowledge.entities.empty')}
|
|
40
|
+
actionLabel={t('knowledge.entities.create')}
|
|
41
|
+
onAction={onCreate}
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (filteredEntities.length === 0) {
|
|
48
|
+
return (
|
|
49
|
+
<div className='knowledge-base-view__entity-list'>
|
|
50
|
+
<EmptyState
|
|
51
|
+
description={t('knowledge.filters.noResults')}
|
|
52
|
+
variant='simple'
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div className='knowledge-base-view__entity-list'>
|
|
60
|
+
<KnowledgeList
|
|
61
|
+
data={filteredEntities}
|
|
62
|
+
renderItem={(entity) => (
|
|
63
|
+
<List.Item className='knowledge-base-view__list-item'>
|
|
64
|
+
<EntityItem entity={entity} />
|
|
65
|
+
</List.Item>
|
|
66
|
+
)}
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.knowledge-base-view__filters {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.knowledge-base-view__filter-input {
|
|
9
|
+
flex: 1;
|
|
10
|
+
min-width: 220px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.knowledge-base-view__filter-select {
|
|
14
|
+
min-width: 220px;
|
|
15
|
+
flex: 0 1 280px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.knowledge-base-view__filter-icon {
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
color: var(--sub-text-color);
|
|
21
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import './FilterBar.scss'
|
|
2
|
+
|
|
3
|
+
import { Input, Select } from 'antd'
|
|
4
|
+
|
|
5
|
+
type FilterOption = {
|
|
6
|
+
label: string
|
|
7
|
+
value: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type FilterBarProps = {
|
|
11
|
+
query: string
|
|
12
|
+
tagOptions: FilterOption[]
|
|
13
|
+
tagFilter: string[]
|
|
14
|
+
searchPlaceholder: string
|
|
15
|
+
tagsPlaceholder: string
|
|
16
|
+
onQueryChange: (value: string) => void
|
|
17
|
+
onTagFilterChange: (value: string[]) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function FilterBar({
|
|
21
|
+
query,
|
|
22
|
+
tagOptions,
|
|
23
|
+
tagFilter,
|
|
24
|
+
searchPlaceholder,
|
|
25
|
+
tagsPlaceholder,
|
|
26
|
+
onQueryChange,
|
|
27
|
+
onTagFilterChange
|
|
28
|
+
}: FilterBarProps) {
|
|
29
|
+
return (
|
|
30
|
+
<div className='knowledge-base-view__filters'>
|
|
31
|
+
<Input
|
|
32
|
+
className='knowledge-base-view__filter-input'
|
|
33
|
+
prefix={<span className='material-symbols-rounded knowledge-base-view__filter-icon'>search</span>}
|
|
34
|
+
placeholder={searchPlaceholder}
|
|
35
|
+
allowClear
|
|
36
|
+
value={query}
|
|
37
|
+
onChange={(e) => onQueryChange(e.target.value)}
|
|
38
|
+
/>
|
|
39
|
+
<Select
|
|
40
|
+
className='knowledge-base-view__filter-select'
|
|
41
|
+
mode='multiple'
|
|
42
|
+
placeholder={tagsPlaceholder}
|
|
43
|
+
options={tagOptions}
|
|
44
|
+
value={tagFilter}
|
|
45
|
+
onChange={onTagFilterChange}
|
|
46
|
+
maxTagCount='responsive'
|
|
47
|
+
disabled={tagOptions.length === 0}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import './FlowsTab.scss'
|
|
2
|
+
|
|
3
|
+
import { Space } from 'antd'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
|
|
6
|
+
import type { SpecSummary } from '#~/api.js'
|
|
7
|
+
import { ActionButton } from './ActionButton'
|
|
8
|
+
import { FilterBar } from './FilterBar'
|
|
9
|
+
import { SectionHeader } from './SectionHeader'
|
|
10
|
+
import { SpecList } from './SpecList'
|
|
11
|
+
import { TabContent } from './TabContent'
|
|
12
|
+
|
|
13
|
+
type FlowsTabProps = {
|
|
14
|
+
specs: SpecSummary[]
|
|
15
|
+
filteredSpecs: SpecSummary[]
|
|
16
|
+
isLoading: boolean
|
|
17
|
+
query: string
|
|
18
|
+
tagOptions: Array<{ label: string; value: string }>
|
|
19
|
+
tagFilter: string[]
|
|
20
|
+
onQueryChange: (value: string) => void
|
|
21
|
+
onTagFilterChange: (value: string[]) => void
|
|
22
|
+
onCreate: () => void
|
|
23
|
+
onImport: () => void
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function FlowsTab({
|
|
27
|
+
specs,
|
|
28
|
+
filteredSpecs,
|
|
29
|
+
isLoading,
|
|
30
|
+
query,
|
|
31
|
+
tagOptions,
|
|
32
|
+
tagFilter,
|
|
33
|
+
onQueryChange,
|
|
34
|
+
onTagFilterChange,
|
|
35
|
+
onCreate,
|
|
36
|
+
onImport
|
|
37
|
+
}: FlowsTabProps) {
|
|
38
|
+
const { t } = useTranslation()
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<TabContent className='knowledge-base-view__flows-tab'>
|
|
42
|
+
<SectionHeader
|
|
43
|
+
title={t('knowledge.flows.title')}
|
|
44
|
+
description={t('knowledge.flows.desc')}
|
|
45
|
+
actions={
|
|
46
|
+
<Space>
|
|
47
|
+
<ActionButton
|
|
48
|
+
icon={<span className='material-symbols-rounded'>download</span>}
|
|
49
|
+
onClick={onImport}
|
|
50
|
+
>
|
|
51
|
+
{t('knowledge.actions.import')}
|
|
52
|
+
</ActionButton>
|
|
53
|
+
<ActionButton
|
|
54
|
+
type='primary'
|
|
55
|
+
icon={<span className='material-symbols-rounded'>add_circle</span>}
|
|
56
|
+
onClick={onCreate}
|
|
57
|
+
>
|
|
58
|
+
{t('knowledge.flows.create')}
|
|
59
|
+
</ActionButton>
|
|
60
|
+
</Space>
|
|
61
|
+
}
|
|
62
|
+
/>
|
|
63
|
+
<FilterBar
|
|
64
|
+
query={query}
|
|
65
|
+
tagOptions={tagOptions}
|
|
66
|
+
tagFilter={tagFilter}
|
|
67
|
+
searchPlaceholder={t('knowledge.filters.search')}
|
|
68
|
+
tagsPlaceholder={t('knowledge.filters.tags')}
|
|
69
|
+
onQueryChange={onQueryChange}
|
|
70
|
+
onTagFilterChange={onTagFilterChange}
|
|
71
|
+
/>
|
|
72
|
+
<SpecList
|
|
73
|
+
isLoading={isLoading}
|
|
74
|
+
specs={specs}
|
|
75
|
+
filteredSpecs={filteredSpecs}
|
|
76
|
+
onCreate={onCreate}
|
|
77
|
+
/>
|
|
78
|
+
</TabContent>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.knowledge-base-view__header {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.knowledge-base-view__title {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.knowledge-base-view__title-icon {
|
|
15
|
+
font-size: 24px;
|
|
16
|
+
&.material-symbols-rounded {
|
|
17
|
+
font-variation-settings: 'FILL' 1;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.knowledge-base-view__title-text {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
gap: 4px;
|
|
25
|
+
font-size: 18px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './KnowledgeBaseHeader.scss'
|
|
2
|
+
|
|
3
|
+
import { useTranslation } from 'react-i18next'
|
|
4
|
+
|
|
5
|
+
import { ActionButton } from './ActionButton'
|
|
6
|
+
|
|
7
|
+
interface KnowledgeBaseHeaderProps {
|
|
8
|
+
onRefresh: () => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function KnowledgeBaseHeader({ onRefresh }: KnowledgeBaseHeaderProps) {
|
|
12
|
+
const { t } = useTranslation()
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className='knowledge-base-view__header'>
|
|
16
|
+
<div className='knowledge-base-view__title'>
|
|
17
|
+
<div className='knowledge-base-view__title-text'>
|
|
18
|
+
{t('knowledge.title')}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<ActionButton
|
|
22
|
+
icon={<span className='material-symbols-rounded'>refresh</span>}
|
|
23
|
+
onClick={onRefresh}
|
|
24
|
+
>
|
|
25
|
+
{t('knowledge.actions.refresh')}
|
|
26
|
+
</ActionButton>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.knowledge-base-view__list {
|
|
2
|
+
border: 1px solid var(--border-color);
|
|
3
|
+
border-radius: 12px;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
background: var(--bg-color);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.knowledge-base-view__list .ant-list-item {
|
|
9
|
+
padding: 0;
|
|
10
|
+
align-items: stretch;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.knowledge-base-view__list .ant-list-item + .ant-list-item {
|
|
14
|
+
border-top: 1px solid var(--border-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.knowledge-base-view__list-item {
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import './KnowledgeList.scss'
|
|
2
|
+
|
|
3
|
+
import { List } from 'antd'
|
|
4
|
+
import type { ReactNode } from 'react'
|
|
5
|
+
|
|
6
|
+
type KnowledgeListProps<T> = {
|
|
7
|
+
data: T[]
|
|
8
|
+
renderItem: (item: T) => ReactNode
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function KnowledgeList<T>({ data, renderItem }: KnowledgeListProps<T>) {
|
|
12
|
+
return (
|
|
13
|
+
<List
|
|
14
|
+
className='knowledge-base-view__list'
|
|
15
|
+
dataSource={data}
|
|
16
|
+
renderItem={(item) => renderItem(item)}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.knowledge-base-view__meta-list {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 6px;
|
|
5
|
+
padding: 4px 0;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.knowledge-base-view__meta-item {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
font-size: 12px;
|
|
13
|
+
color: var(--text-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.knowledge-base-view__meta-item-icon {
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
color: var(--sub-text-color);
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './MetaList.scss'
|
|
2
|
+
|
|
3
|
+
type MetaListProps = {
|
|
4
|
+
items: string[]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function MetaList({ items }: MetaListProps) {
|
|
8
|
+
return (
|
|
9
|
+
<div className='knowledge-base-view__meta-list'>
|
|
10
|
+
{items.map(item => (
|
|
11
|
+
<div key={item} className='knowledge-base-view__meta-item'>
|
|
12
|
+
<span className='material-symbols-rounded knowledge-base-view__meta-item-icon'>check_circle</span>
|
|
13
|
+
<span>{item}</span>
|
|
14
|
+
</div>
|
|
15
|
+
))}
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import './RulesTab.scss'
|
|
2
|
+
|
|
3
|
+
import { Space } from 'antd'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
|
|
6
|
+
import { ActionButton } from './ActionButton'
|
|
7
|
+
import { EmptyState } from './EmptyState'
|
|
8
|
+
import { SectionHeader } from './SectionHeader'
|
|
9
|
+
import { TabContent } from './TabContent'
|
|
10
|
+
|
|
11
|
+
type RulesTabProps = {
|
|
12
|
+
onCreate: () => void
|
|
13
|
+
onImport: () => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function RulesTab({ onCreate, onImport }: RulesTabProps) {
|
|
17
|
+
const { t } = useTranslation()
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<TabContent className='knowledge-base-view__rules-tab'>
|
|
21
|
+
<SectionHeader
|
|
22
|
+
title={t('knowledge.rules.title')}
|
|
23
|
+
description={t('knowledge.rules.desc')}
|
|
24
|
+
actions={(
|
|
25
|
+
<Space>
|
|
26
|
+
<ActionButton
|
|
27
|
+
icon={<span className='material-symbols-rounded'>download</span>}
|
|
28
|
+
onClick={onImport}
|
|
29
|
+
>
|
|
30
|
+
{t('knowledge.actions.import')}
|
|
31
|
+
</ActionButton>
|
|
32
|
+
<ActionButton
|
|
33
|
+
type='primary'
|
|
34
|
+
icon={<span className='material-symbols-rounded'>add_circle</span>}
|
|
35
|
+
onClick={onCreate}
|
|
36
|
+
>
|
|
37
|
+
{t('knowledge.rules.create')}
|
|
38
|
+
</ActionButton>
|
|
39
|
+
</Space>
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
<EmptyState
|
|
43
|
+
description={t('knowledge.rules.empty')}
|
|
44
|
+
actionLabel={t('knowledge.rules.create')}
|
|
45
|
+
onAction={onCreate}
|
|
46
|
+
/>
|
|
47
|
+
</TabContent>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.knowledge-base-view__section-header {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: flex-start;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
gap: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.knowledge-base-view__section-info {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: 4px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.knowledge-base-view__section-title {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
font-weight: 600;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.knowledge-base-view__section-desc {
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
color: var(--sub-text-color);
|
|
22
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import './SectionHeader.scss'
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from 'react'
|
|
4
|
+
|
|
5
|
+
type SectionHeaderProps = {
|
|
6
|
+
title: string
|
|
7
|
+
description: string
|
|
8
|
+
actions?: ReactNode
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function SectionHeader({ title, description, actions }: SectionHeaderProps) {
|
|
12
|
+
return (
|
|
13
|
+
<div className='knowledge-base-view__section-header'>
|
|
14
|
+
<div className='knowledge-base-view__section-info'>
|
|
15
|
+
<div className='knowledge-base-view__section-title'>{title}</div>
|
|
16
|
+
<div className='knowledge-base-view__section-desc'>{description}</div>
|
|
17
|
+
</div>
|
|
18
|
+
{actions}
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import './SkillsTab.scss'
|
|
2
|
+
|
|
3
|
+
import { Space } from 'antd'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
|
|
6
|
+
import { ActionButton } from './ActionButton'
|
|
7
|
+
import { EmptyState } from './EmptyState'
|
|
8
|
+
import { SectionHeader } from './SectionHeader'
|
|
9
|
+
import { TabContent } from './TabContent'
|
|
10
|
+
|
|
11
|
+
type SkillsTabProps = {
|
|
12
|
+
onCreate: () => void
|
|
13
|
+
onImport: () => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function SkillsTab({ onCreate, onImport }: SkillsTabProps) {
|
|
17
|
+
const { t } = useTranslation()
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<TabContent className='knowledge-base-view__skills-tab'>
|
|
21
|
+
<SectionHeader
|
|
22
|
+
title={t('knowledge.skills.title')}
|
|
23
|
+
description={t('knowledge.skills.desc')}
|
|
24
|
+
actions={(
|
|
25
|
+
<Space>
|
|
26
|
+
<ActionButton
|
|
27
|
+
icon={<span className='material-symbols-rounded'>download</span>}
|
|
28
|
+
onClick={onImport}
|
|
29
|
+
>
|
|
30
|
+
{t('knowledge.actions.import')}
|
|
31
|
+
</ActionButton>
|
|
32
|
+
<ActionButton
|
|
33
|
+
type='primary'
|
|
34
|
+
icon={<span className='material-symbols-rounded'>add_circle</span>}
|
|
35
|
+
onClick={onCreate}
|
|
36
|
+
>
|
|
37
|
+
{t('knowledge.skills.create')}
|
|
38
|
+
</ActionButton>
|
|
39
|
+
</Space>
|
|
40
|
+
)}
|
|
41
|
+
/>
|
|
42
|
+
<EmptyState
|
|
43
|
+
description={t('knowledge.skills.empty')}
|
|
44
|
+
actionLabel={t('knowledge.skills.create')}
|
|
45
|
+
onAction={onCreate}
|
|
46
|
+
/>
|
|
47
|
+
</TabContent>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
.knowledge-base-view__item {
|
|
2
|
+
width: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
padding: 12px 16px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.knowledge-base-view__item-row {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
gap: 16px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.knowledge-base-view__item-main {
|
|
16
|
+
flex: 1;
|
|
17
|
+
min-width: 0;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.knowledge-base-view__item-title {
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: 8px;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.knowledge-base-view__item-icon {
|
|
31
|
+
font-size: 18px;
|
|
32
|
+
color: var(--sub-text-color);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.knowledge-base-view__item-desc {
|
|
36
|
+
font-size: 12px;
|
|
37
|
+
color: var(--sub-text-color);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.knowledge-base-view__item-meta {
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 8px;
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.knowledge-base-view__meta-pills {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: 6px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.knowledge-base-view__meta-pill {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
gap: 4px;
|
|
57
|
+
padding: 0 8px;
|
|
58
|
+
height: 28px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.knowledge-base-view__meta-pill-icon {
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
color: var(--sub-text-color);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.knowledge-base-view__params {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
gap: 8px;
|
|
70
|
+
margin-top: 6px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.knowledge-base-view__param {
|
|
74
|
+
display: inline-flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 6px;
|
|
77
|
+
padding: 4px 8px;
|
|
78
|
+
border-radius: 8px;
|
|
79
|
+
background: var(--tag-bg);
|
|
80
|
+
border: 1px solid var(--border-color);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.knowledge-base-view__param-icon {
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
color: var(--sub-text-color);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.knowledge-base-view__param-text {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
gap: 2px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.knowledge-base-view__param-name {
|
|
95
|
+
font-size: 12px;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
color: var(--text-color);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.knowledge-base-view__param-desc {
|
|
101
|
+
font-size: 11px;
|
|
102
|
+
color: var(--sub-text-color);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.knowledge-base-view__tag-list {
|
|
106
|
+
display: flex;
|
|
107
|
+
flex-wrap: wrap;
|
|
108
|
+
gap: 6px;
|
|
109
|
+
margin-top: 6px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.knowledge-base-view__tag {
|
|
113
|
+
display: inline-flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: 4px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.knowledge-base-view__tag-icon {
|
|
119
|
+
font-size: 12px;
|
|
120
|
+
color: var(--sub-text-color);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.knowledge-base-view__detail {
|
|
124
|
+
border-radius: 10px;
|
|
125
|
+
border: 1px solid var(--border-color);
|
|
126
|
+
background: var(--code-bg);
|
|
127
|
+
padding: 12px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.knowledge-base-view__markdown {
|
|
131
|
+
font-size: 12px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.knowledge-base-view__icon-button {
|
|
135
|
+
display: inline-flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: center;
|
|
138
|
+
}
|