@vibe-forge/client 0.4.0 → 0.6.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/AGENTS.md +37 -0
- package/cli.cjs +1 -0
- package/dist/assets/{arc-DgIxeTMg.js → arc-CMAHd5G3.js} +1 -1
- package/dist/assets/{blockDiagram-c4efeb88-CEAob3X9.js → blockDiagram-c4efeb88-DKww-VCP.js} +1 -1
- package/dist/assets/{c4Diagram-c83219d4-DwIxpDKd.js → c4Diagram-c83219d4-DKrjVHyY.js} +1 -1
- package/dist/assets/channel-Bi4g8rj9.js +1 -0
- package/dist/assets/{classDiagram-beda092f-Cz1q8u_0.js → classDiagram-beda092f-BXx5rdo3.js} +1 -1
- package/dist/assets/{classDiagram-v2-2358418a-CImgTuwd.js → classDiagram-v2-2358418a-CnR3WLsr.js} +1 -1
- package/dist/assets/clone-DPrpP2ky.js +1 -0
- package/dist/assets/{createText-1719965b-C1_HJcCc.js → createText-1719965b-CmOsl1W7.js} +1 -1
- package/dist/assets/{edges-96097737-BU8qStzd.js → edges-96097737-CQeQgpjD.js} +1 -1
- package/dist/assets/{erDiagram-0228fc6a-DNA1Fz2L.js → erDiagram-0228fc6a-ZUNB-ucF.js} +1 -1
- package/dist/assets/{flowDb-c6c81e3f-DjiCStMN.js → flowDb-c6c81e3f-DuuKeSLX.js} +1 -1
- package/dist/assets/{flowDiagram-50d868cf-CSDi0-RD.js → flowDiagram-50d868cf-Bc6n85yR.js} +1 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-BZqaeqoh.js +1 -0
- package/dist/assets/{flowchart-elk-definition-6af322e1-DrhIMas7.js → flowchart-elk-definition-6af322e1-cAG5afW9.js} +1 -1
- package/dist/assets/{ganttDiagram-a2739b55-CTZnUP5z.js → ganttDiagram-a2739b55-Dp6xhY5I.js} +1 -1
- package/dist/assets/{gitGraphDiagram-82fe8481-COOW7jTi.js → gitGraphDiagram-82fe8481-MlIIRBdG.js} +1 -1
- package/dist/assets/{graph-CIkpD4Kx.js → graph-D7Es8jZ-.js} +1 -1
- package/dist/assets/{index-5325376f-aVVRRTIu.js → index-5325376f-DC18ottv.js} +1 -1
- package/dist/assets/index-D37AbgPQ.js +545 -0
- package/dist/assets/{index-D1giUI7r.css → index-fcJ9v94I.css} +1 -1
- package/dist/assets/{infoDiagram-8eee0895-DQpZ1LVD.js → infoDiagram-8eee0895-CXk21kFp.js} +1 -1
- package/dist/assets/{journeyDiagram-c64418c1-DoKguIuk.js → journeyDiagram-c64418c1-899BKBHL.js} +1 -1
- package/dist/assets/{layout-Tnmha8Nh.js → layout-DLaxdy48.js} +1 -1
- package/dist/assets/{line-BQR2SOyl.js → line-_lw5YbRM.js} +1 -1
- package/dist/assets/{linear-DlG0eemV.js → linear-D5iu84ui.js} +1 -1
- package/dist/assets/{mermaid.core-BnwYO0He.js → mermaid.core-C6sW3GFM.js} +4 -4
- package/dist/assets/{mindmap-definition-8da855dc-BllYwDID.js → mindmap-definition-8da855dc-BS9Xy9KN.js} +1 -1
- package/dist/assets/{pieDiagram-a8764435-DwCkhPVc.js → pieDiagram-a8764435-DZt9cEgs.js} +1 -1
- package/dist/assets/{quadrantDiagram-1e28029f-c40GKTU0.js → quadrantDiagram-1e28029f-BTIeHOgn.js} +1 -1
- package/dist/assets/{requirementDiagram-08caed73-DnQp2Tk6.js → requirementDiagram-08caed73-BHJAKD2g.js} +1 -1
- package/dist/assets/{sankeyDiagram-a04cb91d-CnJrs13b.js → sankeyDiagram-a04cb91d-DnAkVOK8.js} +1 -1
- package/dist/assets/{sequenceDiagram-c5b8d532-1YBwnpKu.js → sequenceDiagram-c5b8d532-92tE3oFv.js} +1 -1
- package/dist/assets/{stateDiagram-1ecb1508-BFBxQ6Fh.js → stateDiagram-1ecb1508-DG0ObiMg.js} +1 -1
- package/dist/assets/{stateDiagram-v2-c2b004d7-Dmechvv2.js → stateDiagram-v2-c2b004d7-BKoJx2ci.js} +1 -1
- package/dist/assets/{styles-b4e223ce-DWWfWX8O.js → styles-b4e223ce-Ba6G4ri9.js} +1 -1
- package/dist/assets/{styles-ca3715f6-CKKvZxaU.js → styles-ca3715f6-Bn6RIIVW.js} +1 -1
- package/dist/assets/{styles-d45a18b0-dKMOUh9p.js → styles-d45a18b0-_dELBUI6.js} +1 -1
- package/dist/assets/{svgDrawCommon-b86b1483-CBgjChPM.js → svgDrawCommon-b86b1483-CRK-ZoIs.js} +1 -1
- package/dist/assets/{timeline-definition-faaaa080-NCt-HHmb.js → timeline-definition-faaaa080-DvQ_RA_i.js} +1 -1
- package/dist/assets/{xychartDiagram-f5964ef8-BJhXS4dG.js → xychartDiagram-f5964ef8-CJxeDLfg.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +10 -7
- package/src/App.tsx +20 -168
- package/src/api/base.ts +116 -7
- package/src/api/sessions.ts +3 -1
- package/src/api.ts +3 -1
- package/src/components/ArchiveView.tsx +5 -5
- package/src/components/ConfigView.tsx +28 -28
- package/src/components/{AutomationView → automation-view}/index.tsx +10 -9
- package/src/components/{BenchmarkView → benchmark-view}/index.tsx +5 -4
- package/src/components/chat/ChatHeader.tsx +6 -6
- package/src/components/chat/ChatHistoryView.tsx +74 -16
- package/src/components/chat/ChatTimelineView.tsx +3 -3
- package/src/components/chat/CurrentTodoList.scss +56 -27
- package/src/components/chat/{Sender → sender}/Sender.scss +278 -85
- package/src/components/chat/{Sender → sender}/Sender.tsx +125 -41
- package/src/components/chat/tools/core/ToolGroup.tsx +1 -1
- package/src/components/config/ConfigSectionForm.tsx +1 -1
- package/src/components/config/ConfigSourceSwitch.tsx +12 -34
- package/src/components/config/channelDefinitions.ts +2 -2
- package/src/components/layout/AppShell.scss +19 -0
- package/src/components/layout/AppShell.tsx +45 -0
- package/src/components/sidebar/SessionItem.scss +17 -0
- package/src/components/sidebar/SessionItem.tsx +21 -13
- package/src/hooks/chat/model-selector.ts +150 -0
- package/src/hooks/chat/use-chat-adapter.ts +93 -0
- package/src/hooks/chat/use-chat-models.tsx +126 -57
- package/src/hooks/chat/use-chat-permission-mode.ts +14 -10
- package/src/hooks/chat/use-chat-session-actions.ts +22 -13
- package/src/hooks/chat/use-chat-session-messages.ts +62 -10
- package/src/hooks/chat/use-chat-session.ts +49 -2
- package/src/hooks/use-app-preferences.ts +41 -0
- package/src/hooks/use-session-subscription.ts +101 -0
- package/src/hooks/use-sidebar-navigation.ts +35 -0
- package/src/resources/adapters.ts +20 -0
- package/src/resources/locales/en.json +6 -0
- package/src/resources/locales/zh.json +6 -0
- package/src/routes/AppRoutes.tsx +22 -0
- package/src/routes/ArchiveRoute.tsx +5 -0
- package/src/routes/AutomationRoute.tsx +5 -0
- package/src/routes/BenchmarkRoute.tsx +5 -0
- package/src/{components/Chat.scss → routes/ChatRoute.scss} +35 -0
- package/src/routes/ChatRoute.tsx +132 -0
- package/src/routes/ConfigRoute.tsx +5 -0
- package/src/routes/KnowledgeRoute.tsx +5 -0
- package/dist/assets/channel-DhtnrNJ6.js +0 -1
- package/dist/assets/clone-7bHB6YkC.js +0 -1
- package/dist/assets/flowDiagram-v2-4f6560a1-_13Sz5Wh.js +0 -1
- package/dist/assets/index-DRSI_ZIL.js +0 -514
- package/src/components/Chat.tsx +0 -100
- package/src/components/{AutomationView → automation-view}/RuleFormPanel.scss +0 -0
- package/src/components/{AutomationView → automation-view}/RuleFormPanel.tsx +0 -0
- package/src/components/{AutomationView → automation-view}/RuleSidebar.scss +0 -0
- package/src/components/{AutomationView → automation-view}/RuleSidebar.tsx +0 -0
- package/src/components/{AutomationView → automation-view}/RunHistoryPanel.scss +0 -0
- package/src/components/{AutomationView → automation-view}/RunHistoryPanel.tsx +0 -0
- package/src/components/{AutomationView → automation-view}/TaskList.scss +0 -0
- package/src/components/{AutomationView → automation-view}/TaskList.tsx +0 -0
- package/src/components/{AutomationView → automation-view}/TriggerList.scss +0 -0
- package/src/components/{AutomationView → automation-view}/TriggerList.tsx +0 -0
- package/src/components/{AutomationView/AutomationView.scss → automation-view/index.scss} +0 -0
- package/src/components/{AutomationView → automation-view}/types.ts +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/BenchmarkCasePanel.scss +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/BenchmarkCasePanel.tsx +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/BenchmarkSidebar.scss +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/BenchmarkSidebar.tsx +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/BenchmarkView.scss +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/types.ts +0 -0
- package/src/components/{BenchmarkView → benchmark-view}/utils.ts +0 -0
- package/src/components/chat/{Messages → messages}/MessageFooter.tsx +0 -0
- package/src/components/chat/{Messages → messages}/MessageItem.scss +0 -0
- package/src/components/chat/{Messages → messages}/MessageItem.tsx +0 -0
- package/src/components/chat/{Messages → messages}/message-utils.ts +0 -0
- package/src/components/chat/{Sender → sender}/CompletionMenu.scss +0 -0
- package/src/components/chat/{Sender → sender}/CompletionMenu.tsx +0 -0
- package/src/components/chat/{Sender → sender}/ThinkingStatus.scss +0 -0
- package/src/components/chat/{Sender → sender}/ThinkingStatus.tsx +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/EventList.scss +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/EventList.tsx +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/gantt.ts +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/git-graph.ts +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/index.scss +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/index.tsx +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/mermaid.ts +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/types.ts +0 -0
- package/src/components/chat/{SessionTimelinePanel → session-timeline-panel}/utils.ts +0 -0
- package/src/components/config/{recordEditors → record-editors}/BooleanRecordEditor.scss +0 -0
- package/src/components/config/{recordEditors → record-editors}/BooleanRecordEditor.tsx +0 -0
- package/src/components/config/{recordEditors → record-editors}/ChannelRecordEditor.scss +0 -0
- package/src/components/config/{recordEditors → record-editors}/ChannelRecordEditor.tsx +33 -33
- /package/src/components/config/{recordEditors → record-editors}/KeyValueEditor.scss +0 -0
- /package/src/components/config/{recordEditors → record-editors}/KeyValueEditor.tsx +0 -0
- /package/src/components/config/{recordEditors → record-editors}/McpServersRecordEditor.scss +0 -0
- /package/src/components/config/{recordEditors → record-editors}/McpServersRecordEditor.tsx +0 -0
- /package/src/components/config/{recordEditors → record-editors}/ModelServicesRecordEditor.scss +0 -0
- /package/src/components/config/{recordEditors → record-editors}/ModelServicesRecordEditor.tsx +0 -0
- /package/src/components/config/{recordEditors → record-editors}/RecordEditors.scss +0 -0
- /package/src/components/config/{recordEditors → record-editors}/RecordJsonEditor.scss +0 -0
- /package/src/components/config/{recordEditors → record-editors}/RecordJsonEditor.tsx +0 -0
- /package/src/components/config/{recordEditors → record-editors}/index.tsx +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import './ChatRoute.scss'
|
|
2
|
+
|
|
3
|
+
import { Button, Empty } from 'antd'
|
|
4
|
+
import { useTranslation } from 'react-i18next'
|
|
5
|
+
import { useNavigate, useParams } from 'react-router-dom'
|
|
6
|
+
import useSWR from 'swr'
|
|
7
|
+
|
|
8
|
+
import type { Session } from '@vibe-forge/core'
|
|
9
|
+
|
|
10
|
+
import { listSessions } from '#~/api'
|
|
11
|
+
import { ChatHeader } from '#~/components/chat/ChatHeader.js'
|
|
12
|
+
import { ChatHistoryView } from '#~/components/chat/ChatHistoryView.js'
|
|
13
|
+
import { ChatSettingsView } from '#~/components/chat/ChatSettingsView.js'
|
|
14
|
+
import { ChatTimelineView } from '#~/components/chat/ChatTimelineView.js'
|
|
15
|
+
import { useChatSession } from '#~/hooks/chat/use-chat-session'
|
|
16
|
+
|
|
17
|
+
export function ChatRoute() {
|
|
18
|
+
const { t } = useTranslation()
|
|
19
|
+
const { sessionId } = useParams()
|
|
20
|
+
const navigate = useNavigate()
|
|
21
|
+
const { data: sessionsRes, isLoading } = useSWR<{ sessions: Session[] }>(
|
|
22
|
+
sessionId ? '/api/sessions' : null,
|
|
23
|
+
() => listSessions('active')
|
|
24
|
+
)
|
|
25
|
+
const session = sessionId == null ? undefined : sessionsRes?.sessions.find(item => item.id === sessionId)
|
|
26
|
+
|
|
27
|
+
if (sessionId != null && isLoading) {
|
|
28
|
+
return null
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (sessionId != null && session == null) {
|
|
32
|
+
return (
|
|
33
|
+
<div className='chat-route__empty-state'>
|
|
34
|
+
<Empty description={t('common.sessionNotFound')} />
|
|
35
|
+
<Button type='primary' onClick={() => void navigate('/')}>{t('common.backToHome')}</Button>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return <ChatRouteView session={session} />
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function ChatRouteView({
|
|
44
|
+
session
|
|
45
|
+
}: {
|
|
46
|
+
session?: Session
|
|
47
|
+
}) {
|
|
48
|
+
const {
|
|
49
|
+
messages,
|
|
50
|
+
sessionInfo,
|
|
51
|
+
interactionRequest,
|
|
52
|
+
isReady,
|
|
53
|
+
connectionError,
|
|
54
|
+
retryConnection,
|
|
55
|
+
activeView,
|
|
56
|
+
setActiveView,
|
|
57
|
+
handleInteractionResponse,
|
|
58
|
+
setMessages,
|
|
59
|
+
placeholder,
|
|
60
|
+
modelOptions,
|
|
61
|
+
selectedModel,
|
|
62
|
+
modelForQuery,
|
|
63
|
+
setSelectedModel,
|
|
64
|
+
permissionMode,
|
|
65
|
+
setPermissionMode,
|
|
66
|
+
permissionModeOptions,
|
|
67
|
+
selectedAdapter,
|
|
68
|
+
setSelectedAdapter,
|
|
69
|
+
adapterOptions,
|
|
70
|
+
hasAvailableModels,
|
|
71
|
+
modelUnavailable
|
|
72
|
+
} = useChatSession({ session })
|
|
73
|
+
const isEmptyNewSession = !session?.id && messages.length === 0
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div className={`chat-container ${isReady ? 'ready' : ''} ${isEmptyNewSession ? 'is-new-session' : ''}`}>
|
|
77
|
+
{session?.id && (
|
|
78
|
+
<ChatHeader
|
|
79
|
+
sessionInfo={sessionInfo}
|
|
80
|
+
sessionId={session.id}
|
|
81
|
+
sessionTitle={session.title}
|
|
82
|
+
isStarred={session.isStarred}
|
|
83
|
+
isArchived={session.isArchived}
|
|
84
|
+
tags={session.tags}
|
|
85
|
+
lastMessage={session.lastMessage}
|
|
86
|
+
lastUserMessage={session.lastUserMessage}
|
|
87
|
+
activeView={activeView}
|
|
88
|
+
onViewChange={setActiveView}
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
91
|
+
|
|
92
|
+
{activeView === 'history' && (
|
|
93
|
+
<ChatHistoryView
|
|
94
|
+
isReady={isReady}
|
|
95
|
+
messages={messages}
|
|
96
|
+
session={session}
|
|
97
|
+
sessionInfo={sessionInfo}
|
|
98
|
+
connectionError={connectionError}
|
|
99
|
+
onRetryConnection={retryConnection}
|
|
100
|
+
interactionRequest={interactionRequest}
|
|
101
|
+
onInteractionResponse={handleInteractionResponse}
|
|
102
|
+
setMessages={setMessages}
|
|
103
|
+
onClearMessages={() => setMessages([])}
|
|
104
|
+
placeholder={placeholder}
|
|
105
|
+
modelOptions={modelOptions}
|
|
106
|
+
selectedModel={selectedModel}
|
|
107
|
+
modelForQuery={modelForQuery}
|
|
108
|
+
onModelChange={setSelectedModel}
|
|
109
|
+
permissionMode={permissionMode}
|
|
110
|
+
permissionModeOptions={permissionModeOptions}
|
|
111
|
+
onPermissionModeChange={setPermissionMode}
|
|
112
|
+
selectedAdapter={selectedAdapter}
|
|
113
|
+
adapterOptions={adapterOptions}
|
|
114
|
+
onAdapterChange={setSelectedAdapter}
|
|
115
|
+
modelUnavailable={modelUnavailable}
|
|
116
|
+
hasAvailableModels={hasAvailableModels}
|
|
117
|
+
/>
|
|
118
|
+
)}
|
|
119
|
+
|
|
120
|
+
{activeView === 'timeline' && (
|
|
121
|
+
<ChatTimelineView messages={messages} />
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
{activeView === 'settings' && session?.id && (
|
|
125
|
+
<ChatSettingsView
|
|
126
|
+
session={session}
|
|
127
|
+
onClose={() => setActiveView('history')}
|
|
128
|
+
/>
|
|
129
|
+
)}
|
|
130
|
+
</div>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{al as o,am as n}from"./mermaid.core-BnwYO0He.js";const l=(a,r)=>o.lang.round(n.parse(a)[r]);export{l as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./graph-CIkpD4Kx.js";var a=4;function n(o){return r(o,a)}export{n as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as o,p as e}from"./flowDb-c6c81e3f-DjiCStMN.js";import{f as a,g as t}from"./styles-d45a18b0-dKMOUh9p.js";import{ar as i}from"./mermaid.core-BnwYO0He.js";import"./graph-CIkpD4Kx.js";import"./layout-Tnmha8Nh.js";import"./index-DRSI_ZIL.js";import"./index-5325376f-aVVRRTIu.js";import"./clone-7bHB6YkC.js";import"./edges-96097737-BU8qStzd.js";import"./createText-1719965b-C1_HJcCc.js";import"./line-BQR2SOyl.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";import"./channel-DhtnrNJ6.js";const n={parser:e,db:o,renderer:t,styles:a,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}}),t.setConf(r.flowchart),o.clear(),o.setGen("gen-2")}};export{n as diagram};
|