feat: introduce Orven brand and task-focused workspace
This commit is contained in:
+68
-31
@@ -26,6 +26,9 @@ import { desktop } from './desktop';
|
||||
import { AttachmentComposer,InputImage } from './InputAttachments';
|
||||
import { BudgetPausePanel } from './BudgetPausePanel';
|
||||
import { PermissionModeControl } from './PermissionModeControl';
|
||||
import { BRAND, OrvenMark } from './brand';
|
||||
import { WorkbenchTools } from './WorkbenchTools';
|
||||
import type { WorkbenchAction } from './WorkbenchTools';
|
||||
|
||||
const activeStates = ['running', 'awaiting_approval', 'stopping'];
|
||||
const activeMcpStates = ['queued', 'connecting', 'discovering', 'calling', 'closing', 'stopping'];
|
||||
@@ -72,6 +75,9 @@ export default function App() {
|
||||
const [inspectorWidth,setInspectorWidth]=useState<number|null>(null),[inspectorResizing,setInspectorResizing]=useState(false);
|
||||
const inspectorDrag=useRef<{x:number;width:number}|null>(null);
|
||||
const [sidebarOpen, setSidebarOpen] = useState(() => window.innerWidth > 620);
|
||||
const [sidebarView, setSidebarView] = useState<'sessions' | 'files'>('sessions');
|
||||
const [inspectorOpen, setInspectorOpen] = useState(false);
|
||||
const [toolsOpen, setToolsOpen] = useState(false);
|
||||
const [narrow, setNarrow] = useState(() => window.innerWidth <= 940);
|
||||
const [viewportWidth,setViewportWidth]=useState(()=>window.innerWidth);
|
||||
const [mobile, setMobile] = useState(() => window.innerWidth <= 620);
|
||||
@@ -192,6 +198,7 @@ export default function App() {
|
||||
});
|
||||
}
|
||||
function showInspector(next: 'file' | 'changes' | 'trace' | 'task' | 'index' | 'browse') {
|
||||
setInspectorOpen(true);
|
||||
setTab(next);
|
||||
if (window.innerWidth <= 940) setWide(true);
|
||||
if (window.innerWidth <= 620) setSidebarOpen(false);
|
||||
@@ -520,7 +527,8 @@ export default function App() {
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
const handler = (event: KeyboardEvent) => {
|
||||
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') { event.preventDefault(); setSidebarOpen(true); setWide(false); requestAnimationFrame(() => filterRef.current?.focus()); }
|
||||
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'k') { event.preventDefault(); setToolsOpen(value => !value); }
|
||||
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === 'p' && !document.querySelector('[role="dialog"][aria-modal="true"]')) { event.preventDefault(); setSidebarOpen(true); setSidebarView('files'); setWide(false); requestAnimationFrame(() => filterRef.current?.focus()); }
|
||||
if (event.key === 'Escape' && !event.defaultPrevented && !document.querySelector('[role="dialog"][aria-modal="true"]')) { if (window.innerWidth <= 940) setWide(false); if (window.innerWidth <= 620) setSidebarOpen(false); }
|
||||
};
|
||||
window.addEventListener('keydown', handler); return () => window.removeEventListener('keydown', handler);
|
||||
@@ -546,51 +554,75 @@ export default function App() {
|
||||
const sidebarWidth=sidebarOpen?(viewportWidth>=1700?260:viewportWidth<=1120?210:242):0;
|
||||
const maximumInspector=Math.max(310,Math.min(1000,viewportWidth-sidebarWidth-320));
|
||||
const resizeInspector=(width:number)=>setInspectorWidth(Math.max(310,Math.min(maximumInspector,width)));
|
||||
const actions: WorkbenchAction[] = [
|
||||
{ id: 'files', label: '项目文件', description: '浏览目录,打开文件或查看源码', group: '工作空间', icon: FolderOpen, run: () => { setSidebarOpen(true); setSidebarView('files'); setWide(false); requestAnimationFrame(() => filterRef.current?.focus()); } },
|
||||
{ id: 'changes', label: '查看改动', description: '审查文件差异与应用结果', group: '工作空间', icon: GitBranch, run: () => showInspector('changes') },
|
||||
{ id: 'task', label: '查看任务记录', description: '目标、检查、交付与历史运行', group: '工作空间', icon: ClipboardCheck, run: () => showInspector('task') },
|
||||
{ id: 'trace', label: '查看执行轨迹', description: '查看工具参数、原始输出和用时', group: '工作空间', icon: SquareTerminal, run: () => showInspector('trace') },
|
||||
{ id: 'index', label: '代码索引', description: '按符号、路径和导入查找实现', group: '工作空间', icon: Search, run: () => showInspector('index') },
|
||||
{ id: 'browse', label: '浏览与预览', description: '打开网页,查看项目运行结果', group: '工作空间', icon: Link2, run: () => showInspector('browse') },
|
||||
{ id: 'memory', label: '项目记忆', description: '保留项目事实、约定和关键决策', group: '能力与研究', icon: Brain, disabled: !selectedProject || restrictedWorker, reason: '请先选择可编辑的项目', run: () => setMemoryOpen(true) },
|
||||
{ id: 'skills', label: '项目技能', description: '管理技能来源、版本和启用状态', group: '能力与研究', icon: BookOpenText, disabled: !selectedProject || restrictedWorker, reason: '请先选择可编辑的项目', run: () => setSkillsOpen(true) },
|
||||
{ id: 'mcp', label: '项目 MCP 工具', description: '连接本地工具,扩展工作台能力', group: '能力与研究', icon: Puzzle, disabled: !selectedProject || restrictedWorker, reason: '请先选择可编辑的项目', run: () => setMcpOpen(true) },
|
||||
{ id: 'workers', label: '隔离协作', description: '在独立工作区分配任务并审查成果', group: '能力与研究', icon: GitBranch, disabled: !session, reason: '新建任务后可使用', run: () => setWorkersOpen(true) },
|
||||
{ id: 'evaluation', label: '工程评测', description: '比较实现、检查与交付结果', group: '能力与研究', icon: ClipboardCheck, disabled: !session || restrictedWorker, reason: '请先选择主任务', run: () => setEvaluationsOpen(true) },
|
||||
{ id: 'engine', label: '本地代理引擎', description: '连接已有引擎,查看所属运行记录', group: '能力与研究', icon: Link2, disabled: !session || restrictedWorker && !session.execution?.workers?.some(value => value.engine), reason: '请先选择可用任务', run: () => setEngineOpen(true) },
|
||||
{ id: 'rea', label: 'REA 工件研究', description: '研究应用工件,核对分析证据', group: '能力与研究', icon: BookOpenText, disabled: !selectedProject || creatingSession || restrictedWorker, reason: '请先选择可编辑的项目', run: () => void openRea() },
|
||||
{ id: 'research', label: '机制研究与设计', description: '阅读已有研究报告与机制说明', group: '能力与研究', icon: BookOpenText, run: () => void openResearch() },
|
||||
{ id: 'models', label: '模型中心', description: '选择模型、管理连接和模型池', group: '设置与连接', icon: ModelServer, run: () => setModelCenterOpen(true) },
|
||||
{ id: 'diagnostics', label: '运行诊断', description: '检查连接、终端与最近错误', group: '设置与连接', icon: Activity, run: () => void openDiagnostics() },
|
||||
{ id: 'companion', label: '手机连接', description: '在手机上查看和接续电脑任务', group: '设置与连接', icon: Link2, run: () => setCompanionOpen(true) },
|
||||
...(desktop ? [{ id: 'desktop', label: '桌面宿主', description: '查看窗口、后台任务与本地宿主', group: '设置与连接', icon: SquareTerminal, run: () => setDesktopOpen(true) }] : []),
|
||||
{ id: 'version', label: '版本与更新', description: '查看 Orven 当前版本和更新记录', group: '设置与连接', icon: RotateCw, run: () => setInstallationOpen(true) },
|
||||
{ id: 'export', label: '导出会话', description: '下载当前任务的完整会话记录', group: '工作空间', icon: ArrowDownToLine, disabled: !session, reason: '选择会话后可导出', run: () => { if (session) void exportSession(session.id).catch(failure); } },
|
||||
];
|
||||
return (
|
||||
<div className={'workbench ' + (sidebarOpen ? '' : 'sidebar-hidden ') + (wide ? 'inspector-wide ' : '')+(inspectorResizing?'inspector-resizing':'')}
|
||||
style={!narrow&&inspectorWidth!==null?{gridTemplateColumns:sidebarWidth+'px minmax(310px,1fr) '+Math.min(maximumInspector,inspectorWidth)+'px'}:undefined}>
|
||||
<div className={'workbench orven-workbench ' + (sidebarOpen ? '' : 'sidebar-hidden ') + (inspectorOpen ? 'inspector-open ' : 'inspector-closed ') + (wide ? 'inspector-wide ' : '')+(inspectorResizing?'inspector-resizing':'')}
|
||||
style={!narrow&&inspectorOpen&&inspectorWidth!==null?{gridTemplateColumns:sidebarWidth+'px minmax(310px,1fr) '+Math.min(maximumInspector,inspectorWidth)+'px'}:undefined}>
|
||||
<aside className="project-sidebar">
|
||||
<div className="brand"><span className="brand-mark">AW</span><div><strong>Agent Workbench</strong><span>本地编程工作台 · 正式版</span></div><IconButton label="收起项目栏" onClick={() => setSidebarOpen(false)}><PanelLeftClose size={16} /></IconButton></div>
|
||||
<div className="brand"><span className="brand-mark"><OrvenMark size={27} /></span><div><strong>{BRAND.name}</strong><span>{BRAND.category}</span></div><IconButton label="收起项目栏" onClick={() => setSidebarOpen(false)}><PanelLeftClose size={17} /></IconButton></div>
|
||||
<div className="project-selector"><span className="field-eyebrow">当前项目</span><div className="project-select-row"><FolderOpen size={17} /><select aria-label="当前项目" value={projectId} onChange={event => chooseProject(event.target.value)}>{projects.map(project => <option key={project.id} value={project.id}>{project.name}{project.id === exampleId ? '(示例)' : ''}</option>)}{!projects.length && <option value="">选择一个项目</option>}</select><IconButton label="打开项目" onClick={() => setProjectOpen(true)}><Plus size={15} /></IconButton></div>{selectedProject && <span className="project-root" title={selectedProject.root}>{selectedProject.root}</span>}{projectId === exampleId && <span className="example-tag">当前为自带示例,可打开自己的项目开始开发</span>}</div>
|
||||
<div className="sidebar-section sessions-section"><div className="section-label"><span>任务会话</span><IconButton label="新建任务" disabled={creatingSession || restrictedWorker} onClick={() => newSession().catch(failure)}><Plus size={15} /></IconButton></div>
|
||||
<button type="button" className="new-task-button" disabled={creatingSession || restrictedWorker} onClick={() => newSession().catch(failure)}><Plus size={15} />新建任务<span>↵</span></button>
|
||||
<div className="session-list">{projectSessions.slice(0, 15).map(item => <div key={item.id} className={'session-item ' + (item.id === sessionId ? 'selected' : '')}>
|
||||
<button type="button" className="new-task-button" disabled={creatingSession || restrictedWorker} onClick={() => { setSidebarView('sessions'); void newSession().catch(failure); }}><Plus size={17} />新建任务<ArrowUp size={14} /></button>
|
||||
<div className="sidebar-view-tabs" role="tablist" aria-label="项目导航" onKeyDown={event => { if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) { event.preventDefault(); const next = event.key === 'Home' ? 'sessions' : event.key === 'End' ? 'files' : sidebarView === 'sessions' ? 'files' : 'sessions'; setSidebarView(next); document.getElementById(next + '-tab')?.focus(); } }}><button id="sessions-tab" role="tab" tabIndex={sidebarView === 'sessions' ? 0 : -1} aria-selected={sidebarView === 'sessions'} aria-controls="sessions-panel" onClick={() => setSidebarView('sessions')}><MessageSquare size={14} />会话<span>{projectSessions.length}</span></button><button id="files-tab" role="tab" tabIndex={sidebarView === 'files' ? 0 : -1} aria-selected={sidebarView === 'files'} aria-controls="files-panel" onClick={() => setSidebarView('files')}><Folder size={14} />文件<span>{files.filter(file => file.kind === 'file').length}</span></button></div>
|
||||
<div id="sessions-panel" role="tabpanel" aria-labelledby="sessions-tab" hidden={sidebarView !== 'sessions'} className="sidebar-section sessions-section"><div className="section-label"><span>最近会话</span></div>
|
||||
<div className="session-list">{projectSessions.map(item => <div key={item.id} className={'session-item ' + (item.id === sessionId ? 'selected' : '')}>
|
||||
<button type="button" className="session-select" onClick={() => chooseSession(item.id)}><MessageSquare size={14} /><span>{item.title}</span>{item.changeCount > 0 && <b>{item.changeCount}</b>}</button>
|
||||
{!activeStates.includes(item.status) && <IconButton label={'归档会话 ' + item.title} onClick={() => api('/sessions/' + item.id + '/archive', {}).then(() => { if (item.id === selectedSessionRef.current) selectSession(''); }).catch(failure)}><Trash2 size={12} /></IconButton>}
|
||||
</div>)}{!projectSessions.length && <p className="sidebar-hint">开始一个任务,过程会自动保存。</p>}</div>
|
||||
</div>)}{!projectSessions.length && <div className="sidebar-empty"><MessageSquare size={23} strokeWidth={1.4} /><strong>留给下一个想法</strong><p>新建任务后,对话和执行记录<br />会保存在这里。</p></div>}</div>
|
||||
</div>
|
||||
<div className="sidebar-section file-section"><div className="section-label"><span>项目文件 <b>{files.filter(file => file.kind === 'file').length}</b></span><IconButton label="刷新文件" onClick={() => refreshFiles().catch(failure)}><Folder size={14} /></IconButton></div>
|
||||
<div className="file-filter"><Search size={14} /><input ref={filterRef} value={filter} onChange={event => setFilter(event.target.value)} placeholder="筛选文件" aria-label="筛选文件" /><kbd>⌃ K</kbd></div>
|
||||
<div id="files-panel" role="tabpanel" aria-labelledby="files-tab" hidden={sidebarView !== 'files'} className="sidebar-section file-section"><div className="section-label"><span>项目文件</span><IconButton label="刷新文件" onClick={() => refreshFiles().catch(failure)}><RotateCw size={14} /></IconButton></div>
|
||||
<div className="file-filter"><Search size={14} /><input ref={filterRef} value={filter} onChange={event => setFilter(event.target.value)} placeholder="筛选文件" aria-label="筛选文件" /><kbd>⌃ P</kbd></div>
|
||||
<div className="file-tree">{visibleFiles.map(file => <button key={file.path} type="button" title={file.path} className={'tree-row ' + (openFile?.path === file.path ? 'selected' : '')} style={{ paddingLeft: 10 + Math.min(file.path.split('/').length - 1, 6) * 13 }} onClick={() => {
|
||||
if (file.kind === 'directory') setCollapsed(previous => { const next = new Set(previous); if (next.has(file.path)) next.delete(file.path); else next.add(file.path); return next; }); else loadFile(file.path);
|
||||
}}>{file.kind === 'directory' ? <><span className="tree-chevron">{collapsed.has(file.path) ? <ChevronRight size={11} /> : <ChevronDown size={11} />}</span><Folder size={14} /></> : <><span className="tree-chevron" /><File size={13} /></>}<span>{filter ? file.path : file.name}</span></button>)}{filter && !visibleFiles.length && <p className="sidebar-hint">没有匹配的文件。</p>}</div>
|
||||
</div>
|
||||
<div className="sidebar-footer"><button onClick={openResearch}><BookOpenText size={16} />机制研究与设计<ChevronRight size={13} /></button><button onClick={() => setMemoryOpen(true)} disabled={!selectedProject || restrictedWorker}><Brain size={16} />项目记忆<ChevronRight size={13} /></button><button onClick={() => openDiagnostics()}><Activity size={16} />运行诊断<ChevronRight size={13} /></button><button className="model-sidebar-entry" onClick={() => setModelCenterOpen(true)} aria-label="选择与管理模型"><ModelServer size={16} /><span>模型与连接<small>{config.mode === 'demo' ? '尚未选择模型' : modelSelection.name || config.model || '选择模型'}</small></span><ChevronRight size={13} /></button><div className={'connection ' + (ready ? 'connected' : '')}><span />{ready ? '本地服务已连接' : '正在连接本地服务'}<button className="version-entry" aria-label="版本与更新" onClick={() => setInstallationOpen(true)}>v{version}</button></div></div>
|
||||
<div className="sidebar-footer"><button onClick={() => setMemoryOpen(true)} disabled={!selectedProject || restrictedWorker}><Brain size={17} />项目记忆<ChevronRight size={13} /></button><button onClick={() => setToolsOpen(true)}><Settings2 size={17} />工具与设置<kbd>⌃ K</kbd></button><button className="model-sidebar-entry" onClick={() => setModelCenterOpen(true)} aria-label="选择与管理模型"><ModelServer size={17} /><span>模型与连接<small>{config.mode === 'demo' ? '连接模型,开始协作' : modelSelection.name || config.model || '选择模型'}</small></span><ChevronRight size={13} /></button><div className={'connection ' + (ready ? 'connected' : '')}><span />{ready ? '本地服务已连接' : '正在连接本地服务'}<button className="version-entry" aria-label="版本与更新" onClick={() => setInstallationOpen(true)}>v{version}</button></div></div>
|
||||
</aside>
|
||||
<main className="task-pane">
|
||||
<header className="work-header"><div className="work-title">{(!sidebarOpen || mobile) && <IconButton label="展开项目栏" onClick={() => setSidebarOpen(true)}><PanelLeftOpen size={18} /></IconButton>}<span className="header-symbol"><Code2 size={17} /></span><div><span className="header-breadcrumb">{selectedProject?.name || '工作空间'} <ChevronRight size={12} /> 任务</span><h1>{session?.title || '让任务走到完成'}</h1></div></div>
|
||||
<div className="model-launch"><button className="button secondary" onClick={() => setCompanionOpen(true)} aria-label="手机连接"><Link2 size={16} /><span>手机连接</span></button>{desktop && <button className="button secondary desktop-launch" onClick={() => setDesktopOpen(true)} aria-label="桌面宿主"><SquareTerminal size={16} /><span>桌面宿主</span></button>}<button className="button secondary" onClick={() => setModelCenterOpen(true)} aria-label="打开模型中心"><ModelServer size={16} /><span>模型中心</span></button><button className="model-button" aria-label="切换当前模型" title="选择模型、模型池或添加连接" onClick={() => setModelCenterOpen(true)}><span className="model-light" />{config.mode === 'demo' ? '选择模型' : modelSelection.name || config.model || '选择模型'}<ChevronDown size={13} /></button></div>
|
||||
<header className="work-header"><div className="work-title">{(!sidebarOpen || mobile) && <IconButton label="展开项目栏" onClick={() => setSidebarOpen(true)}><PanelLeftOpen size={18} /></IconButton>}<div><span className="header-breadcrumb">{selectedProject?.name || '工作空间'} <ChevronRight size={12} /> 工作区</span><h1>{session?.title || '新任务'}</h1></div></div>
|
||||
<div className="model-launch"><button className="header-tools" onClick={() => setToolsOpen(true)} aria-label="打开工具箱"><Settings2 size={16} /><span>工具箱</span><kbd>⌃ K</kbd></button><button className="inspector-toggle" aria-label="文件与成果" aria-pressed={inspectorOpen && (!narrow || wide)} onClick={() => { if (inspectorOpen && (!narrow || wide)) { setInspectorOpen(false); setWide(false); } else showInspector(tab); }}><FileCode2 size={16} /><span>文件与成果</span></button></div>
|
||||
</header>
|
||||
<div className="task-toolbar"><span className="task-local"><GitBranch size={13} />本地项目</span>{session ? <Status value={session.status} /> : <span className="subtle">等待新任务</span>}<div className="toolbar-actions">
|
||||
<IconButton label="运行诊断" onClick={() => openDiagnostics()}><Activity size={15} /></IconButton>
|
||||
<IconButton label="项目技能" onClick={() => setSkillsOpen(true)} disabled={!selectedProject || restrictedWorker}><BookOpenText size={15} /></IconButton>
|
||||
<IconButton label="项目MCP工具" onClick={() => setMcpOpen(true)} disabled={!selectedProject || restrictedWorker}><Puzzle size={15} /></IconButton>
|
||||
<IconButton label="查看任务记录" onClick={() => showInspector('task')}><ClipboardCheck size={15} /></IconButton>
|
||||
<IconButton label="隔离协作" onClick={() => setWorkersOpen(true)} disabled={!session}><GitBranch size={15} /></IconButton>
|
||||
<IconButton label="工程评测" onClick={() => setEvaluationsOpen(true)} disabled={!session || restrictedWorker}><ClipboardCheck size={15} /></IconButton>
|
||||
<IconButton label="本地代理引擎" onClick={() => setEngineOpen(true)} disabled={!session || restrictedWorker && !session.execution?.workers?.some(value => value.engine)}><Link2 size={15} /></IconButton>
|
||||
<IconButton label="REA 工件研究" onClick={() => void openRea()} disabled={!selectedProject || creatingSession || restrictedWorker}><BookOpenText size={15} /></IconButton>
|
||||
{narrow && <><IconButton label="查看文件" onClick={() => showInspector('file')}><FileCode2 size={16} /></IconButton><IconButton label="查看改动" onClick={() => showInspector('changes')}><GitBranch size={16} /></IconButton><IconButton label="查看执行轨迹" onClick={() => showInspector('trace')}><SquareTerminal size={16} /></IconButton></>}
|
||||
<div className="task-toolbar"><span className="task-local"><span className="local-dot" />本地工作空间</span>{session ? <Status value={session.status} /> : <span className="subtle">准备就绪</span>}<div className="toolbar-actions">
|
||||
<button className="text-button" aria-label="查看任务记录" onClick={() => showInspector('task')}><ClipboardCheck size={14} />任务记录</button>
|
||||
{pending.length > 0 && <button className="text-button review-toolbar" onClick={() => { setChangeId(pending[0].id); showInspector('changes'); }}><FileCode2 size={13} />审核 {pending.length} 项</button>}
|
||||
{session && <><IconButton label="导出会话" onClick={() => exportSession(session.id).catch(failure)}><ArrowDownToLine size={15} /></IconButton>
|
||||
{!isRunning && pending.length === 0 && ['failed', 'paused'].includes(session.status) && <button className="text-button" disabled={resuming} onClick={() => resumeSession()}><RotateCw size={13} />{session.status === 'failed' && session.failure?.source === 'model_connection' ? '重试模型请求' : '继续任务'}</button>}</>}
|
||||
{session && !isRunning && pending.length === 0 && ['failed', 'paused'].includes(session.status) && <button className="text-button" disabled={resuming} onClick={() => resumeSession()}><RotateCw size={13} />{session.status === 'failed' && session.failure?.source === 'model_connection' ? '重试模型请求' : '继续任务'}</button>}
|
||||
</div></div>
|
||||
<section ref={conversationRef} className="conversation" aria-label="任务对话">
|
||||
{!session?.messages.length && !session?.events.length ? <div className="welcome"><span className="welcome-label"><span />从项目到结果</span><h2>读懂项目。<br />把每一步做好。</h2><p>给出一个任务,读取依据、工具执行和文件改动会在这里连成完整过程。</p><div className="starter-prompts">{['了解这个项目,并提出一项改进', '查找关键实现,解释调用关系', '检查项目,并准备可审查的修改'].map((prompt, index) => <button key={prompt} onClick={() => { setComposer(prompt); composerRef.current?.focus(); }}><span>{index === 0 ? <FolderOpen size={17} /> : index === 1 ? <Link2 size={17} /> : <FileCode2 size={17} />}</span>{prompt}<ArrowRight size={14} /></button>)}</div><div className="welcome-note"><ShieldCheck size={16} /><span>{config.executionMode === 'unrestricted' ? '文件改动直接应用,可查看差异和回滚。命令按所选权限执行。' : '当前使用自定义额度;命令按所选权限执行。'}</span></div></div> : <div className="conversation-entries">
|
||||
{!session?.messages.length && !session?.events.length ? <div className="welcome orven-welcome">
|
||||
<div className="welcome-signature"><OrvenMark size={34} /><span>{BRAND.name}<small>{BRAND.slogan}</small></span></div>
|
||||
<h2>今天,想实现什么?</h2><p>一个新想法,一个待解决的问题。<br />带上你的项目,我们一起把它做出来。</p>
|
||||
<div className="welcome-project"><span className="welcome-project-icon"><FolderOpen size={20} /></span><div><strong>{selectedProject?.name || '从你的项目开始'}{projectId === exampleId && <span>示例项目</span>}</strong><small>{projectId === exampleId ? '先在示例里探索,或打开你自己的项目。' : selectedProject?.root || '打开本机文件夹,让 Orven 理解项目上下文。'}</small></div><button aria-label="打开自己的项目" onClick={() => setProjectOpen(true)}>打开项目<ArrowUp size={14} /></button></div>
|
||||
<div className="starter-heading">也可以从这里开始</div><div className="starter-prompts">{[
|
||||
{ title: '读懂项目', detail: '梳理结构与关键实现', prompt: '了解这个项目,梳理项目结构、技术栈和关键实现,并说明可以从哪里开始。', icon: FolderOpen },
|
||||
{ title: '一起解决问题', detail: '定位原因,准备修改', prompt: '检查这个项目,找出一个值得修复的问题,说明原因并准备可审查的修改。', icon: Code2 },
|
||||
{ title: '把改动做扎实', detail: '审查代码,核对检查', prompt: '审查这个项目的代码与现有检查,找出缺少验证的关键路径,并提出具体改进。', icon: ClipboardCheck },
|
||||
].map(item => <button key={item.title} onClick={() => { setComposer(item.prompt); composerRef.current?.focus(); }}><span className="starter-icon"><item.icon size={19} strokeWidth={1.7} /></span><span><strong>{item.title}</strong><small>{item.detail}</small></span><ArrowRight size={15} /></button>)}</div>
|
||||
{config.mode === 'demo' && <button className="welcome-connect" onClick={() => setModelCenterOpen(true)}><ModelServer size={16} /><span>连接你的模型,让 Orven 开始协作</span><ArrowRight size={15} /></button>}
|
||||
</div> : <div className="conversation-entries">
|
||||
{session?.recoveryNotice && <div className="recovery-note"><ShieldCheck size={16} /><div><strong>已恢复会话记录</strong><p>{session.recoveryNotice}</p></div></div>}
|
||||
{entries.map(entry => 'message' in entry && entry.message ? <div key={entry.id} className={'message message-' + entry.message.role}><span className="message-avatar">{entry.message.role === 'user' ? '你' : entry.message.role === 'assistant' ? 'AW' : '·'}</span><div className="message-body"><div className="message-label">{entry.message.role === 'user' ? '你的任务' : entry.message.role === 'assistant' ? session?.executionMode === 'demo' ? '演示执行器' : '编程助手' : '工作台'}<time>{new Date(entry.date).toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' })}</time></div><div className="message-text">{entry.message.role === 'system' && failureForMessage(entry.message)
|
||||
{entries.map(entry => 'message' in entry && entry.message ? <div key={entry.id} className={'message message-' + entry.message.role}><span className="message-avatar">{entry.message.role === 'user' ? '你' : entry.message.role === 'assistant' ? <OrvenMark size={20} /> : '·'}</span><div className="message-body"><div className="message-label">{entry.message.role === 'user' ? '你的任务' : entry.message.role === 'assistant' ? session?.executionMode === 'demo' ? '演示执行器' : BRAND.name : '工作台'}<time>{new Date(entry.date).toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit' })}</time></div><div className="message-text">{entry.message.role === 'system' && failureForMessage(entry.message)
|
||||
? <FailureCard failure={failureForMessage(entry.message)!} onDiagnose={() => openDiagnostics()} onRetry={session?.status === 'failed' && session?.failure?.messageId === entry.message.id ? () => resumeSession() : undefined} busy={resuming || isRunning} />
|
||||
: entry.message.role === 'assistant' ? <ResearchContent content={entry.message.content} /> : entry.message.content}</div>{entry.message.attachmentIds?.map(id=>{const image=session?.inputAttachments?.find(value=>value.id===id);return image&&session?<InputImage key={id} sessionId={session.id} image={image} onError={failure}/>:null;})}</div></div> : 'event' in entry && entry.event ? <div key={entry.id} className="inline-event">{['tool', 'model'].includes(entry.event.kind) ? <><ToolRow event={entry.event} onSelect={() => { setEventId(entry.event!.id); showInspector('trace'); }} /><ModelStreamPreview event={entry.event} /></> : <div className={'system-event event-' + entry.event.phase}><span />{entry.event.label}{entry.event.output && <p>{entry.event.output}</p>}</div>}</div> : null)}
|
||||
: entry.message.role === 'assistant' ? <ResearchContent content={entry.message.content} /> : entry.message.content}</div>{entry.message.attachmentIds?.map(id=>{const image=session?.inputAttachments?.find(value=>value.id===id);return image&&session?<InputImage key={id} sessionId={session.id} image={image} onError={failure}/>:null;})}</div></div> : 'event' in entry && entry.event ? <div key={entry.id} className="inline-event">{['tool', 'model'].includes(entry.event.kind) ? <><ToolRow event={entry.event} onSelect={() => { setEventId(entry.event!.id); showInspector('trace'); }} /><ModelStreamPreview event={entry.event} /></> : <div className={'system-event event-' + entry.event.phase}><span />{entry.event.label}{entry.event.output && <details className="system-event-output"><summary>查看详情</summary><pre>{entry.event.output}</pre></details>}</div>}</div> : null)}
|
||||
{isRunning && !approval && <div className="working-note"><LoaderCircle size={14} className="spin" /><span>{session?.executionMode === 'demo' ? '正在执行演示流程' : '正在处理任务'}</span></div>}
|
||||
</div>}
|
||||
{session&&<BudgetPausePanel key={session.id+session.execution?.run?.id} session={session} config={config} onSession={acceptSession} onRecovery={()=>setWorkersOpen(true)}/>}
|
||||
@@ -602,15 +634,19 @@ export default function App() {
|
||||
{canContinueReview && <button type="button" aria-label="继续原任务" className="review-callout" disabled={resuming} onClick={continueReviewed}><ClipboardCheck size={17} /><span><strong>继续原任务</strong><small>改动已应用,保留原目标、范围和检查约定继续处理。</small></span><ArrowRight size={17} /></button>}
|
||||
<div ref={chatEnd} />
|
||||
</section>
|
||||
<footer className="composer-wrap"><div className="composer-permissions"><PermissionModeControl value={config.approvalMode ?? 'ask'} disabled={permissionSaving || !ready} onChange={mode => void savePermission(mode)} /><small>{permissionSaving ? '正在保存…' : '选择自动保存 · 可随时切换'}</small></div><form className="composer" onSubmit={event => { event.preventDefault(); submit(); }}><AttachmentComposer session={session} selectedIds={imageSelection.sessionId===session?.id?imageSelection.ids:[]} onSelection={(id,ids)=>setImageSelection({sessionId:id,ids})} onEnsureSession={newSession} onSession={acceptSession} onError={failure} disabled={isRunning||sending||creatingSession||!ready||restrictedWorker} routeName={config.mode === 'demo' ? '尚未选择模型' : modelSelection.name || config.model} onModels={()=>setModelCenterOpen(true)}/><textarea ref={composerRef} aria-label="任务内容" placeholder="描述项目任务,或询问工作台的执行状态与报错…" value={composer} onChange={event => setComposer(event.target.value)} onKeyDown={event => { if ((event.ctrlKey || event.metaKey) && event.key === 'Enter') { event.preventDefault(); submit(); } }} maxLength={config.executionMode === 'unrestricted' ? undefined : 20000} rows={3} /><div className="composer-bottom"><span><Folder size={13} />{selectedProject?.name || '选择项目'}<span className="composer-divider" />{config.mode === 'demo' ? '选择模型开始开发' : modelSelection.name || config.model}</span>{isRunning ? <button type="button" className="stop-button" onClick={() => session && api('/sessions/' + session.id + '/stop', {}).catch(failure)}><Square size={13} />停止</button> : <button type="submit" className="send-button" aria-label="发送任务" disabled={!composer.trim() || sending || creatingSession || !ready || !!(sessionId && !session)}>{sending ? <LoaderCircle size={17} className="spin" /> : <ArrowUp size={18} />}</button>}</div></form><div className="composer-footnote"><span>Ctrl + Enter 发送 · 会话自动保存</span><span>{session?.estimatedTokens ? '上下文估算 ' + session.estimatedTokens.toLocaleString() + ' tokens' : '改动与执行结果可追溯'}</span></div></footer>
|
||||
<footer className="composer-wrap"><form className="composer" onSubmit={event => { event.preventDefault(); submit(); }}>
|
||||
<textarea ref={composerRef} aria-label="任务内容" placeholder="把想法交给 Orven,或描述你遇到的问题…" value={composer} onChange={event => setComposer(event.target.value)} onKeyDown={event => { if (!event.nativeEvent.isComposing && (event.ctrlKey || event.metaKey) && event.key === 'Enter') { event.preventDefault(); submit(); } }} maxLength={config.executionMode === 'unrestricted' ? undefined : 20000} rows={3} />
|
||||
<AttachmentComposer session={session} selectedIds={imageSelection.sessionId===session?.id?imageSelection.ids:[]} onSelection={(id,ids)=>setImageSelection({sessionId:id,ids})} onEnsureSession={newSession} onSession={acceptSession} onError={failure} disabled={isRunning||sending||creatingSession||!ready||restrictedWorker} routeName={config.mode === 'demo' ? '尚未选择模型' : modelSelection.name || config.model} onModels={()=>setModelCenterOpen(true)}/>
|
||||
<div className="composer-bottom"><div className="composer-options"><button type="button" className="composer-model" aria-label="切换当前模型" title="选择模型、模型池或添加连接" onClick={() => setModelCenterOpen(true)}><span className={'model-light ' + (config.mode === 'demo' ? 'model-unset' : '')} /><span>{config.mode === 'demo' ? '选择模型' : modelSelection.name || config.model || '选择模型'}</span><ChevronDown size={13} /></button><span className="composer-divider" /><PermissionModeControl value={config.approvalMode ?? 'ask'} disabled={permissionSaving || !ready} onChange={mode => void savePermission(mode)} /></div>{isRunning ? <button type="button" className="stop-button" onClick={() => session && api('/sessions/' + session.id + '/stop', {}).catch(failure)}><Square size={13} />停止</button> : <button type="submit" className="send-button" aria-label="发送任务" disabled={!composer.trim() || sending || creatingSession || !ready || !!(sessionId && !session)}>{sending ? <LoaderCircle size={17} className="spin" /> : <ArrowUp size={18} />}</button>}</div>
|
||||
</form><div className="composer-footnote"><span>Ctrl + Enter 发送 · 会话自动保存</span><span>{permissionSaving ? '正在保存权限…' : session?.estimatedTokens ? '上下文估算 ' + session.estimatedTokens.toLocaleString() + ' tokens' : '执行有记录,改动可回看'}</span></div></footer>
|
||||
</main>
|
||||
{((mobile && sidebarOpen) || (narrow && wide)) && <button type="button" className="panel-scrim" aria-label="关闭侧边面板" onClick={() => { setSidebarOpen(false); setWide(false); }} />}
|
||||
<aside className="inspector">
|
||||
<aside className="inspector" aria-label="文件与成果区" inert={!inspectorOpen || narrow && !wide}>
|
||||
{!narrow&&<div className="inspector-resize-handle" role="separator" aria-label="调整检视区宽度" aria-orientation="vertical" tabIndex={0} aria-valuemin={310} aria-valuemax={maximumInspector} aria-valuenow={inspectorWidth??undefined}
|
||||
onPointerDown={event=>{if(event.button!==0)return;event.preventDefault();inspectorDrag.current={x:event.clientX,width:event.currentTarget.parentElement!.getBoundingClientRect().width};event.currentTarget.setPointerCapture(event.pointerId);setInspectorResizing(true);}}
|
||||
onDoubleClick={()=>setInspectorWidth(null)}
|
||||
onKeyDown={event=>{const width=event.currentTarget.parentElement!.getBoundingClientRect().width;if(event.key==='ArrowLeft'||event.key==='ArrowRight'){event.preventDefault();resizeInspector(width+(event.key==='ArrowLeft'?32:-32));}else if(event.key==='Home'){event.preventDefault();resizeInspector(310);}else if(event.key==='End'){event.preventDefault();resizeInspector(maximumInspector);}}}/>}
|
||||
<div className="inspector-tabs"><button className={tab === 'file' ? 'selected' : ''} onClick={() => setTab('file')}><FileCode2 size={14} />文件</button><button className={tab === 'changes' ? 'selected' : ''} onClick={() => setTab('changes')}><GitBranch size={14} />改动{pending.length > 0 && <b>{pending.length}</b>}</button><button className={tab === 'trace' ? 'selected' : ''} onClick={() => setTab('trace')}><SquareTerminal size={14} />轨迹</button><button className={tab === 'task' ? 'selected' : ''} onClick={() => setTab('task')}><ClipboardCheck size={14} />任务</button><button className={tab === 'index' ? 'selected' : ''} onClick={() => setTab('index')}><Search size={14} />索引</button><button className={tab === 'browse' ? 'selected' : ''} onClick={() => setTab('browse')}><Link2 size={14} />浏览</button><IconButton label={narrow ? '关闭检视区' : wide ? '缩小检视区' : '放大检视区'} onClick={() => setWide(previous => !previous)}>{narrow ? <X size={16} /> : wide ? <Minimize2 size={14} /> : <Maximize2 size={14} />}</IconButton></div>
|
||||
<div className="inspector-tabs"><button className={tab === 'file' ? 'selected' : ''} onClick={() => setTab('file')}><FileCode2 size={14} />文件</button><button className={tab === 'changes' ? 'selected' : ''} onClick={() => setTab('changes')}><GitBranch size={14} />改动{pending.length > 0 && <b>{pending.length}</b>}</button><button className={tab === 'trace' ? 'selected' : ''} onClick={() => setTab('trace')}><SquareTerminal size={14} />轨迹</button><button className={tab === 'task' ? 'selected' : ''} onClick={() => setTab('task')}><ClipboardCheck size={14} />任务</button><button className={tab === 'index' ? 'selected' : ''} onClick={() => setTab('index')}><Search size={14} />索引</button><button className={tab === 'browse' ? 'selected' : ''} onClick={() => setTab('browse')}><Link2 size={14} />浏览</button><IconButton label="关闭检视区" onClick={() => { setInspectorOpen(false); setWide(false); }}><X size={16} /></IconButton></div>
|
||||
{tab === 'file' && (fileLoading ? <div className="loading-inspector"><LoaderCircle className="spin" size={24} />正在读取文件</div> : openFile ? <div className="file-inspector"><div className="file-heading"><FileCode2 size={15} /><span title={openFile.path}>{openFile.path}</span>{/\.html?$/i.test(openFile.path) && <div className="file-mode-switch" role="group" aria-label="文件显示方式"><button type="button" aria-pressed={fileMode === 'preview'} disabled={editing} onClick={() => setFileMode('preview')}>预览</button><button type="button" aria-pressed={fileMode === 'source'} onClick={() => { setFileMode('source'); setEditing(false); }}>源码</button></div>}<IconButton label="复制文件内容" onClick={() => navigator.clipboard.writeText(openFile.content).then(() => notify('已复制文件内容。')).catch(failure)}><Copy size={14} /></IconButton><IconButton label={editing ? '取消编辑' : '编辑文件'} onClick={() => { setFileMode('source'); setEditing(previous => !previous); setDraft(openFile.content); }}><Pencil size={14} /></IconButton></div><div className="file-details"><span>{lineCount} 行 · {openFile.bytes.toLocaleString()} B{fileLine ? ' · 定位第 ' + fileLine + ' 行' : ''}</span><span className="code-utility">{openFile.sha256.slice(0, 10)}</span></div>{fileNotice && <div className="file-index-notice" role="status">{fileNotice}</div>}{editing ? <><textarea className="code-editor" aria-label="编辑文件内容" spellCheck={false} value={draft} onChange={event => setDraft(event.target.value)} /><div className="editor-actions"><button className="button primary" onClick={saveDraft} disabled={draft === openFile.content || draftSaving}><GitBranch size={14} />保存为提案</button></div></> : fileMode === 'preview' && /\.html?$/i.test(openFile.path) ? <HtmlFilePreview key={projectId + ':' + openFile.path} projectId={projectId} path={openFile.path} /> : <div className="code-view" ref={codeViewRef}>{openFile.content.split('\n').map((line, index) => <div key={index} data-line={index + 1} className={fileLine === index + 1 ? 'code-line-target' : ''}><span>{index + 1}</span><code>{line.replace(/\r$/, '') || ' '}</code></div>)}</div>}</div> : <EmptyInspector kind="file" />)}
|
||||
{tab === 'changes' && (session ? <ChangesInspector session={session} selectedChange={selectedChange} busy={!!changeBusy} isRunning={isRunning} onSelect={setChangeId} onAction={changeAction} onSession={acceptSession} onError={failureFor(session)} onFilesChanged={refreshBatchFiles} /> : <EmptyInspector kind="changes" />)}
|
||||
{tab === 'trace' && (session?.events.length ? <div className="trace-inspector"><div className="trace-caption"><span>完整执行记录</span><span>{toolEvents.length} 次工具调用</span></div><div className="trace-list">{session.events.map(event => <ToolRow key={event.id} event={event} selected={selectedEvent?.id === event.id} onSelect={() => setEventId(event.id)} />)}</div>{selectedEvent && <div className="event-details"><div className="event-detail-heading"><strong>{selectedEvent.label}</strong><Status value={selectedEvent.phase} /></div>{selectedEvent.input && <><h4>输入</h4><pre>{JSON.stringify(selectedEvent.input, null, 2)}</pre></>}<h4>结果</h4><pre>{selectedEvent.output || (selectedEvent.phase === 'waiting' ? '等待确认后执行。' : '正在等待工具结果。')}</pre>{selectedEvent.durationMs !== undefined && <p className="subtle">耗时 {(selectedEvent.durationMs / 1000).toFixed(2)} 秒,包含确认等待。</p>}</div>}</div> : <EmptyInspector kind="trace" />)}
|
||||
@@ -619,6 +655,7 @@ export default function App() {
|
||||
{selectedProject && <CodeIndexPanel key={selectedProject.id} project={selectedProject} active={tab === 'index'} onOpen={(path, line, expectedSha256) => void loadFile(path, { line, expectedSha256 })} />}
|
||||
<div className="inspector-footer"><ShieldCheck size={13} /><span>{tab === 'changes' ? '应用前会核对文件基线' : tab === 'trace' ? '中断调用保留待核实状态' : tab === 'task' ? '任务目标、检查与结果持久保存' : tab === 'index' ? '结果绑定当前项目及文件 SHA256' : '读取范围限定在当前项目'}</span></div>
|
||||
</aside>
|
||||
{toolsOpen && <Modal title="工具箱" description="项目的上下文、能力和连接,都在这里。" onClose={() => setToolsOpen(false)}><WorkbenchTools actions={actions} onClose={() => setToolsOpen(false)} /></Modal>}
|
||||
{installationOpen && <Modal title="版本与更新" description="核对本机版本、真实更新阶段与原始结果。" onClose={() => setInstallationOpen(false)}><InstallationStatus /></Modal>}
|
||||
{projectOpen && <Modal title="打开项目" description="选择这台电脑上的项目文件夹,或输入完整路径。" onClose={() => { if (!projectBusy) { setProjectOpen(false); setDirectoryPickerOpen(false); setProjectError(''); } }}><form onSubmit={event => { event.preventDefault(); if (!directoryPickerOpen) void openProject(); }}><label className="form-field">项目文件夹<input autoFocus value={projectInput} disabled={projectBusy} onChange={event => { setProjectInput(event.target.value); setProjectError(''); }} placeholder="C:\Projects\my-app" aria-label="项目文件夹路径" /></label>{projectError && <p className="local-files-error" role="alert">{projectError}</p>}{directoryPickerOpen && <ProjectDirectoryPicker initialPath={projectInput.trim()} onChoose={value => { setProjectInput(value); setProjectError(''); setDirectoryPickerOpen(false); }} onCancel={() => setDirectoryPickerOpen(false)} />}<div className="modal-actions"><button type="button" className="button secondary" disabled={pickingProject || projectBusy} onClick={() => desktop ? void pickDesktopProject() : setDirectoryPickerOpen(value => !value)}><FolderOpen size={15} />选择文件夹</button>{exampleId && <button type="button" className="button secondary" disabled={projectBusy} onClick={() => { chooseProject(exampleId); setProjectOpen(false); setDirectoryPickerOpen(false); }}>打开示例项目</button>}<button type="submit" className="button primary" disabled={!projectInput.trim() || projectBusy || directoryPickerOpen}>{projectBusy ? <LoaderCircle className="spin" size={15} /> : <FolderOpen size={15} />}{projectBusy ? '正在打开…' : '打开项目'}</button></div></form></Modal>}
|
||||
{companionOpen && <Modal title="手机连接" description="指定项目和权限,连接到同一个Windows执行宿主。" onClose={() => setCompanionOpen(false)} wide><CompanionPanel projects={projects} selectedProjectId={selectedProject?.id ?? ''} /></Modal>}
|
||||
|
||||
@@ -104,7 +104,7 @@ export function DeliveryPanel({ session, busy, onSession, onError, openArtifact
|
||||
<div className="delivery-route" aria-label="交付步骤"><span className={hasApplied && !pending ? 'done' : ''}>文件已审查</span><i>→</i><span className={task?.verification.status === 'passed' ? 'done' : ''}>实际检查</span><i>→</i><span className={jobs.some(job => job.status === 'completed') ? 'done' : ''}>本地提交</span></div>
|
||||
{waitingPlan && <div className="delivery-attention delivery-review-boundary" aria-label="等待Git确认"><strong>Git预览已保存,等待确认</strong><p>{waitingPlan.paths.length} 个文件 · {waitingPlan.baseline.branch} · HEAD {waitingPlan.baseline.head.slice(0, 12)}</p><p>任务已暂停请求模型。审查现有预览后确认提交,或撤回预览再继续。</p><div className="delivery-report-actions"><button type="button" className="button primary" disabled={busy || running || submitting || waitingPlan.status !== 'planned'} onClick={() => setConfirm(waitingPlan)}>查看待确认预览</button><button type="button" className="button secondary" disabled={busy || running || unresolved || submitting} onClick={discard}>撤回预览</button></div>{waitingPlan.status === 'accepted' && <p>这份预览已尝试执行;请核对原结果,确认未提交后重新预览。</p>}</div>}
|
||||
<label className="form-field delivery-message">提交说明<textarea aria-label="提交说明" rows={2} value={message} maxLength={1600} disabled={busy || running} onChange={event => setMessage(event.target.value)} /></label>
|
||||
<details className="delivery-author"><summary>Git署名</summary><p>默认采用项目Git署名;尚未配置时使用 Agent Workbench 本地身份。预览会展示实际署名。</p><label className="form-field">提交者姓名<input value={authorName} disabled={busy || running} onChange={event => setAuthorName(event.target.value)} placeholder="采用默认署名" autoComplete="off" /></label><label className="form-field">提交者邮箱<input type="email" value={authorEmail} disabled={busy || running} onChange={event => setAuthorEmail(event.target.value)} placeholder="采用默认邮箱" autoComplete="off" /></label></details>
|
||||
<details className="delivery-author"><summary>Git署名</summary><p>默认采用项目 Git 署名;尚未配置时使用本地默认署名。预览会展示实际署名。</p><label className="form-field">提交者姓名<input value={authorName} disabled={busy || running} onChange={event => setAuthorName(event.target.value)} placeholder="采用默认署名" autoComplete="off" /></label><label className="form-field">提交者邮箱<input type="email" value={authorEmail} disabled={busy || running} onChange={event => setAuthorEmail(event.target.value)} placeholder="采用默认邮箱" autoComplete="off" /></label></details>
|
||||
<button type="button" className="button primary" aria-label="预览Git提交" disabled={!task || !hasApplied || pending || busy || running || unresolved || planning || !message.trim()} onClick={prepare}>{planning ? <LoaderCircle size={14} className="spin" /> : <GitCommitHorizontal size={14} />}预览Git提交</button>
|
||||
{existingOnly ? <p className="record-footnote">本任务沿用已有成果,无新增修改,不创建空提交。可生成报告核对成果与原检查。</p> : (!hasApplied || pending) && <p className="record-footnote">应用本任务的文件提案后,可以准备Git提交。</p>}
|
||||
{jobs.slice().reverse().map(job => <div key={job.id} className={'delivery-job ' + (job.requiresVerification ? 'delivery-attention' : '')}>
|
||||
|
||||
@@ -7,7 +7,7 @@ export function DiagnosticsPanel({ value, busy, onRefresh }: { value: RuntimeDia
|
||||
if (!value) return <div className="diagnostic-loading"><LoaderCircle size={20} className="spin" />{busy ? '正在读取本机执行记录…' : '诊断记录暂时不可用,请刷新重试。'}<button type="button" className="button secondary" disabled={busy} onClick={onRefresh}>刷新</button></div>;
|
||||
const failure = value.session?.lastFailure;
|
||||
return <div className="diagnostic-panel">
|
||||
<div className="diagnostic-intro"><Activity size={18} /><div><strong>Agent Workbench {value.version}</strong><p>依据本机保存的执行记录检查当前状态。</p></div><button type="button" className="button secondary" onClick={onRefresh} disabled={busy}><RotateCw size={13} className={busy ? 'spin' : ''} />刷新</button></div>
|
||||
<div className="diagnostic-intro"><Activity size={18} /><div><strong>Orven {value.version}</strong><p>依据本机保存的执行记录检查当前状态。</p></div><button type="button" className="button secondary" onClick={onRefresh} disabled={busy}><RotateCw size={13} className={busy ? 'spin' : ''} />刷新</button></div>
|
||||
<div className="diagnostic-grid"><section><h3>运行环境</h3><dl><dt>终端</dt><dd>{value.environment.shell}</dd><dt>Node.js</dt><dd>{value.environment.node}</dd><dt>输入与输出</dt><dd>{value.environment.encoding}</dd></dl><p className="diagnostic-note">{value.environment.shellSyntax}</p></section>
|
||||
<section><h3>模型连接</h3><dl><dt>模式</dt><dd>{value.connection.mode === 'demo' ? '离线演示' : '兼容模型服务'}</dd><dt>模型</dt><dd>{value.connection.model || '未配置'}</dd><dt>服务地址</dt><dd>{value.connection.endpoint}</dd><dt>凭据状态</dt><dd>{value.connection.hasKey ? '本次运行已配置' : '未配置'}</dd></dl>{value.connection.lastRequest && <p className="diagnostic-note">最近请求:{value.connection.lastRequest.status === 'completed' ? '成功' : value.connection.lastRequest.status === 'retrying' ? '重试中' : value.connection.lastRequest.status === 'interrupted' ? '已停止' : '失败'} · {value.connection.lastRequest.attempts ?? 1} 次</p>}</section></div>
|
||||
{value.session && <section className="diagnostic-session"><div className="diagnostic-section-heading"><h3>当前项目与会话</h3><Status value={value.session.session.status} /></div><strong>{value.session.project.name}</strong><p className="diagnostic-path">{value.session.project.root}</p><p className="diagnostic-note">{value.session.changes.filter(change => change.status === 'applied').length} 项已应用 · {value.session.changes.filter(change => ['pending', 'conflict'].includes(change.status)).length} 项待处理</p></section>}
|
||||
|
||||
@@ -97,14 +97,14 @@ export function ModelCenter({ onConfig, busy, runModel }: { onConfig: (value: Co
|
||||
const locked = working || busy;
|
||||
const passthrough = !runtimeConfig || runtimeConfig.executionMode === 'unrestricted' || runtimeConfig.capacityMode === 'passthrough';
|
||||
return <section className="model-center" aria-label="模型控制台" aria-busy={working}>
|
||||
<div className="mc-overview"><div><span className="mc-eyebrow">MODEL CONTROL</span><h2>选择模型,继续开发。</h2><p>连接、模型池和实际请求使用同一个入口。</p></div><div className="mc-current"><Route size={18} /><span>新任务默认<strong>{runtimeConfig?.mode === 'demo' ? '尚未选择' : selectionName || '正在读取'}</strong></span><span className="mc-count">{view?.waiting ?? 0} 等待</span></div></div>
|
||||
<div className="mc-overview"><div><span className="mc-eyebrow">ORVEN / MODELS</span><h2>选择模型,继续开发。</h2><p>接入你信任的模型,为项目选择合适的能力。</p></div><div className="mc-current"><Route size={18} /><span>新任务默认<strong>{runtimeConfig?.mode === 'demo' ? '尚未选择' : selectionName || '正在读取'}</strong></span><span className="mc-count">{view?.waiting ?? 0} 等待</span></div></div>
|
||||
<nav ref={tabsRef} className="mc-tabs" aria-label="模型中心分类">{[['connections', '模型连接', Server], ['network', '连接诊断', Activity], ['pools', '模型池', Layers3], ['budgets', '运行预算', Settings2], ['waits', '等待时限', Settings2], ['attempts', '请求账本', Route], ['imports', '配置导入', Settings2], ['credentials', '凭据保存', KeyRound], ['operations', '运行巡检', Activity]].map(([id, title, Icon]) => {
|
||||
const Symbol = Icon as typeof Server; return <button key={id as string} type="button" aria-current={tab === id ? 'page' : undefined} onClick={() => { setTab(id as string); setNotice(''); }}><Symbol size={16} />{title as string}</button>;
|
||||
})}<button className="mc-refresh" type="button" disabled={working} onClick={() => void act(refresh)} aria-label="刷新模型中心"><RefreshCw size={16} /></button></nav>
|
||||
{notice && <div className="mc-notice" role="status">{notice}{noticeFailure && <ModelErrorDetails failure={noticeFailure} />}</div>}
|
||||
{busy && <p className="mc-notice">有任务正在执行;连接可停用,其他配置请在任务结束后修改。</p>}
|
||||
{!view ? <p className="mc-empty">正在读取实际连接状态…</p> : <div className="mc-content">
|
||||
<section className="mc-route-control" aria-label="默认模型选择">
|
||||
{tab === 'connections' && <> <section className="mc-route-control" aria-label="默认模型选择">
|
||||
<div className="mc-route-heading"><div><h3>新任务默认模型</h3><p>选择已保存的连接,或使用模型池调度。切换本身不请求模型。</p></div><button className="button secondary" disabled={locked} onClick={addConnection}><Plus size={15} />添加模型</button></div>
|
||||
<label className="mc-route-select">当前选择<select aria-label="新任务默认模型" disabled={locked || !runtimeConfig} value={runtimeConfig?.mode === 'demo' || !connections.some(value => value.id === selected?.id) && selected?.type !== 'pool' ? '' : selected?.type + ':' + selected?.id} onChange={event => void selectRoute(event.target.value)}>
|
||||
<option value="" disabled>选择模型或添加连接</option>
|
||||
@@ -113,7 +113,7 @@ export function ModelCenter({ onConfig, busy, runModel }: { onConfig: (value: Co
|
||||
</select></label>
|
||||
<div className="mc-route-detail">{runtimeConfig?.mode === 'demo' ? '请从上游获取模型,或选择已配置的连接开始开发。' : selected?.type === 'pool' ? '模型池按成员配置调度;每次实际连接和返回型号保存在请求账本。' : (() => { const connection = connections.find(c => c.id === selected?.id); return connection ? `${protocolLabel(connection.protocol)} · ${previewUrl(connection)} · 请求 ${connection.model || '未配置'}` : '请选择可用连接。'; })()}</div>
|
||||
{runModel && <div className="mc-run-model"><strong>当前会话最近运行</strong><span>{runModel.mode === 'demo' ? '离线演示' : runModel.routing?.members?.length ? runModel.routing.members.map(member => member.name + ' · ' + member.model).join(';') : runModel.model}</span><small>这是该次运行封存的请求配置;实际返回型号请看请求账本。更改默认选择不会改写旧记录。</small></div>}
|
||||
</section>
|
||||
</section></>}
|
||||
{tab === 'budgets' && runtimeConfig && <ModelBudgetSettings key={JSON.stringify(runtimeConfig)} value={runtimeConfig} disabled={locked} onSave={input => void act(async () => { await api('/model-center/runtime-budgets', input); if (alive.current) setNotice('运行预算已保存,当前模型选择保持。'); })} />}
|
||||
{tab === 'waits' && <ModelWaitSettings key={JSON.stringify(view.waitSettings)} value={view.waitSettings} disabled={locked} onSave={value => void act(async () => {
|
||||
const result = await api<{ config: Config }>('/model-center/wait-settings', value);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { useMemo, useRef, useState } from 'react';
|
||||
import type { ComponentType } from 'react';
|
||||
import type { LucideProps } from 'lucide-react';
|
||||
import { ArrowUpRight, Search } from 'lucide-react';
|
||||
|
||||
export type WorkbenchAction = { id: string; label: string; description: string; group: string; icon: ComponentType<LucideProps>; run: () => void; disabled?: boolean; reason?: string };
|
||||
|
||||
export function WorkbenchTools({ actions, onClose }: { actions: WorkbenchAction[]; onClose: () => void }) {
|
||||
const [query, setQuery] = useState('');
|
||||
const list = useRef<HTMLDivElement>(null);
|
||||
const filtered = useMemo(() => actions.filter(action => (action.label + action.description + action.group).toLocaleLowerCase().includes(query.trim().toLocaleLowerCase())), [actions, query]);
|
||||
return <div className="workbench-tools">
|
||||
<div className="tools-search"><Search size={18} /><input autoFocus data-autofocus aria-label="搜索工作台工具" value={query} onChange={event => setQuery(event.target.value)} placeholder="搜索工具、文件或任务操作…" onKeyDown={event => {
|
||||
if (event.key === 'ArrowDown') { event.preventDefault(); list.current?.querySelector<HTMLButtonElement>('button:not(:disabled)')?.focus(); }
|
||||
if (event.key === 'Enter') { const first = filtered.find(action => !action.disabled); if (first) { onClose(); first.run(); } }
|
||||
}} /><kbd>Esc</kbd></div>
|
||||
<div className="tools-results" ref={list} onKeyDown={event => {
|
||||
if (!['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key)) return;
|
||||
const buttons = Array.from(list.current?.querySelectorAll<HTMLButtonElement>('button:not(:disabled)') ?? []);
|
||||
if (!buttons.length) return;
|
||||
event.preventDefault(); const index = buttons.indexOf(document.activeElement as HTMLButtonElement);
|
||||
buttons[event.key === 'Home' ? 0 : event.key === 'End' ? buttons.length - 1 : (index + (event.key === 'ArrowDown' ? 1 : -1) + buttons.length) % buttons.length]?.focus();
|
||||
}}>
|
||||
{[...new Set(filtered.map(action => action.group))].map(group => <section key={group}><h3>{group}</h3>{filtered.filter(action => action.group === group).map(action => <button key={action.id} aria-label={action.label} disabled={action.disabled} title={action.disabled ? action.reason : action.description} onClick={() => { onClose(); action.run(); }}><span className="tools-action-icon"><action.icon size={18} /></span><span><strong>{action.label}</strong><small>{action.disabled ? action.reason || '当前不可用' : action.description}</small></span><ArrowUpRight size={15} /></button>)}</section>)}
|
||||
{!filtered.length && <div className="tools-empty"><Search size={23} /><strong>没有找到“{query}”</strong><p>试试“模型”“文件”或“研究”。</p><button type="button" className="text-button" onClick={() => setQuery('')}>清除搜索</button></div>}
|
||||
</div>
|
||||
<div className="tools-footnote"><span>↑ ↓ 选择工具 · Enter 打开</span><span>Ctrl K 随时唤起</span></div>
|
||||
</div>;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export const BRAND = {
|
||||
name: 'Orven',
|
||||
chineseName: '奥文',
|
||||
category: 'AI 开发工作台',
|
||||
slogan: '从想法,到运行。',
|
||||
description: '理解你的项目,和你一起研究问题、编写代码,把想法变成可以运行的成果。',
|
||||
} as const;
|
||||
|
||||
/** An open orbit and its forward stroke: a project taking shape and moving on. */
|
||||
export function OrvenMark({ className = '', size = 32 }: { className?: string; size?: number }) {
|
||||
return <svg className={'orven-mark ' + className} width={size} height={size} viewBox="0 0 40 40" fill="none" aria-hidden="true">
|
||||
<path d="M30.7 12.3a13.2 13.2 0 1 0 1.7 12.6" stroke="currentColor" strokeWidth="5.2" strokeLinecap="round" />
|
||||
<path d="m21.5 20 6.2 6.2L36 17.9" stroke="currentColor" strokeWidth="5.2" strokeLinecap="round" strokeLinejoin="round" />
|
||||
</svg>;
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export function Modal({ title, description, children, onClose, wide = false }: {
|
||||
const close = useRef(onClose); close.current = onClose;
|
||||
useEffect(() => {
|
||||
const previous = document.activeElement as HTMLElement | null;
|
||||
panel.current?.querySelector<HTMLElement>('input, select, textarea, button')?.focus();
|
||||
(panel.current?.querySelector<HTMLElement>('[data-autofocus]') ?? panel.current?.querySelector<HTMLElement>('input:not(:disabled), select:not(:disabled), textarea:not(:disabled)') ?? panel.current?.querySelector<HTMLElement>('button:not(:disabled)'))?.focus();
|
||||
const handle = (event: KeyboardEvent) => {
|
||||
const dialogs = document.querySelectorAll('[role="dialog"][aria-modal="true"]');
|
||||
if (dialogs[dialogs.length - 1] !== panel.current) return;
|
||||
@@ -119,7 +119,7 @@ export function EmptyInspector({ kind }: { kind: 'file' | 'changes' | 'trace' })
|
||||
const Icon = kind === 'file' ? FileCode2 : kind === 'changes' ? Check : SquareTerminal;
|
||||
return <div className="empty-inspector"><span className="empty-inspector-symbol"><Icon size={25} strokeWidth={1.5} /></span>
|
||||
<h3>{kind === 'file' ? '查看项目文件' : kind === 'changes' ? '这里展示待审查改动' : '执行过程会记录在这里'}</h3>
|
||||
<p>{kind === 'file' ? '从左侧打开文件,或让助手先读取项目。' : kind === 'changes' ? '助手提出修改后,可以查看完整差异,再决定是否应用。' : '每次工具调用都会保留参数、结果和完成状态。'}</p>
|
||||
<p>{kind === 'file' ? '切换左侧「文件」,打开源码;也可以让 Orven 先读取项目。' : kind === 'changes' ? '有文件改动后,在这里核对差异与应用结果。' : '每次工具调用都会保留参数、结果和完成状态。'}</p>
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
import './styles.css';
|
||||
import './control-console.css';
|
||||
import './orven.css';
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(<React.StrictMode><App /></React.StrictMode>);
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { CompanionDevice, MobileBrief, MobileTask } from '../companion-type
|
||||
import { mobileApi, MobileError, verifiedText, verifyDigest } from './api';
|
||||
import { MobileInputImage } from './MobileInputImage';
|
||||
import './file-results.css';
|
||||
import { BRAND, OrvenMark } from '../brand';
|
||||
|
||||
const stateLabel = (state: string) => ({ idle: '未开始', waiting: '等待审批', validating: '校验中', queued: '排队中', executing: '执行中', error: '错误', running: '执行中', awaiting_approval: '等待审批', stopping: '正在停止', completed: '已完成', needs_review: '待审查', failed: '失败', interrupted: '已中断', cancelled: '已停止', paused: '已暂停', unknown: '需核对', completed_with_changes: '待审查', passed: '通过', pending: '待处理', applied: '已应用', denied: '已拒绝', approved: '已批准', conflict: '有冲突', unverified: '需核对', stale: '已变化' } as Record<string, string>)[state] ?? state;
|
||||
const time = (value: string) => new Date(value).toLocaleString('zh-CN', { month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||
@@ -108,7 +109,7 @@ export function MobileApp({ initialToken }: { initialToken: string }) {
|
||||
const projectName = (id: string) => projects.find(value => value.id === id)?.name ?? '原项目';
|
||||
const selectedTask = task?.id === selected ? task : null;
|
||||
return <div className="mobile-app">
|
||||
<header className="mobile-header"><span className="mobile-mark"><Terminal size={20} /></span><div><strong>Agent Workbench</strong><span>手机伴随端 · Windows 执行宿主</span></div><button aria-label="刷新任务" disabled={!!busy} onClick={() => void refresh()}><RefreshCw size={19} /></button></header>
|
||||
<header className="mobile-header"><span className="mobile-mark"><OrvenMark size={24} /></span><div><strong>{BRAND.name}</strong><span>手机伴随端 · 接续你的工作</span></div><button aria-label="刷新任务" disabled={!!busy} onClick={() => void refresh()}><RefreshCw size={19} /></button></header>
|
||||
{me && <div className={'mobile-connection ' + (fresh ? '' : 'disconnected')}>{fresh ? <Wifi size={14} /> : <WifiOff size={14} />}<span>{fresh ? '已同步 · ' + time(lastSync) : '连接中断 · 当前内容可能已过期'}</span><span>{me.device.permissions.approve ? '可审批' : '观察'}</span></div>}
|
||||
{error && <div className="mobile-error" role="alert"><strong>{fresh ? '操作未完成' : connectionRequired ? '需要连接' : '连接待恢复'}</strong><p>{error}</p>{me && <button onClick={() => void refresh()} disabled={!!busy}>重新同步</button>}</div>}
|
||||
{me?.operations?.some(value => value.status === 'unknown') && <div className="mobile-unknown"><strong>手机操作回执需要核对</strong><p>有原审批或停止操作没有完整回执,请在电脑核对;手机不会自动重放。</p>{me.operations.filter(value => value.status === 'unknown').map(value => <code key={value.requestId}>Task {value.taskId} · {value.action === 'stop' ? '停止' : '审批'}</code>)}</div>}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { StrictMode } from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { MobileApp } from './MobileApp';
|
||||
import './mobile.css';
|
||||
import './orven-mobile.css';
|
||||
|
||||
const fragment = new URLSearchParams(location.hash.slice(1));
|
||||
const token = fragment.get('pair') ?? '';
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
:root { color: #37333f; background: #f5f5f8; --ink: #37333f; --muted: #716979; --line: #e5dfed; --green: #277859; }
|
||||
button, input, select { border-color: #dcd2e7; border-radius: 8px; }
|
||||
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline-color: #6253b5; }
|
||||
.mobile-app { background: #fff; }
|
||||
.mobile-header { background: #fff; color: #37333f; border-bottom: 1px solid #e6dfed; }
|
||||
.mobile-mark { border: 0; background: #f2edf9; color: #6253b5; border-radius: 10px; }
|
||||
.mobile-header strong { font-size: 24px; letter-spacing: -.6px; }
|
||||
.mobile-header div > span { color: #716979; font-size: 10px; }
|
||||
.mobile-header button { color: #716979; }
|
||||
.mobile-primary { background: #6253b5; border-color: #6253b5; border-radius: 8px; }
|
||||
.mobile-pair-heading > svg { color: #80708d; }
|
||||
.mobile-pair-heading h1 { color: #4b4155; font-weight: 600; }
|
||||
.mobile-pair-heading p, .mobile-pair-help p { color: #716979; }
|
||||
.mobile-pair-help { background: #f8f5fc; border-color: #e7dcef; color: #867093; border-radius: 10px; }
|
||||
.mobile-projects, .mobile-session, .mobile-task-title, .mobile-document { border-color: #e5dfed; }
|
||||
.mobile-tabs { background: #faf8fd; border-color: #e4d9ef; }
|
||||
.mobile-tabs button.active, .mobile-tabs button[aria-selected="true"] { color: #6253b5; border-color: #6253b5; background: #f1eaf9; }
|
||||
.mobile-error { color: #8b4255; background: #fff4f7; border-color: #eed6e1; }
|
||||
.mobile-error button { color: #8b4255; border-color: #dcbac9; }
|
||||
.mobile-stream { background: #f7f2fc; border-left-color: #a58abb; }
|
||||
@@ -0,0 +1,466 @@
|
||||
/* Orven: a quiet engineering workspace. Shared tokens also theme tool panels. */
|
||||
:root {
|
||||
font-family: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
|
||||
font-size: 14px;
|
||||
color: #37333f;
|
||||
background: #f9f9fb;
|
||||
font-synthesis: none;
|
||||
--ink: #25262d;
|
||||
--muted: #686a76;
|
||||
--line: #e4e4eb;
|
||||
--paper: #ffffff;
|
||||
--teal: #6253b5;
|
||||
--blue: #6253b5;
|
||||
--accent: #6253b5;
|
||||
--accent-soft: #efecf9;
|
||||
--surface: #f6f6f9;
|
||||
--success: #277859;
|
||||
--danger: #ad3f48;
|
||||
}
|
||||
::selection { background: #e1dcf4; color: #37333f; }
|
||||
button, input, select, textarea { -webkit-tap-highlight-color: transparent; }
|
||||
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role="separator"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
||||
button:disabled { opacity: .48; }
|
||||
button { touch-action: manipulation; }
|
||||
[hidden] { display: none !important; }
|
||||
* { scrollbar-width: thin; scrollbar-color: #d0ced9 transparent; }
|
||||
.icon-button { color: var(--muted); width: 32px; height: 32px; border-radius: 7px; }
|
||||
.icon-button:hover { background: #eeedf3; color: var(--ink); }
|
||||
.button { min-height: 36px; height: auto; padding: 8px 13px; border-radius: 7px; font-size: 12px; font-weight: 600; }
|
||||
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
|
||||
.button.primary:hover:not(:disabled) { background: #51439c; }
|
||||
.button.secondary { background: #fff; border: 1px solid #dcdce5; color: #57515f; }
|
||||
.button.secondary:hover:not(:disabled) { background: #f5f4f9; border-color: #c7c2dc; }
|
||||
.text-button { color: #57515f; border-radius: 6px; font-size: 12px; }
|
||||
.text-button:hover { background: #eeecf5; color: var(--accent); }
|
||||
|
||||
/* Project context stays in a continuous navigation surface. */
|
||||
.orven-workbench { grid-template-columns: 242px minmax(320px, 1fr) 430px; max-width: none; background: #fff; }
|
||||
.orven-workbench.inspector-closed { grid-template-columns: 242px minmax(0, 1fr) 0; }
|
||||
.orven-workbench.sidebar-hidden { grid-template-columns: 0 minmax(320px, 1fr) 430px; }
|
||||
.orven-workbench.sidebar-hidden.inspector-closed { grid-template-columns: 0 minmax(0, 1fr) 0; }
|
||||
.orven-workbench.inspector-wide { grid-template-columns: 242px minmax(310px, 1fr) min(48vw, 760px); }
|
||||
.orven-workbench.inspector-closed .inspector { display: none; }
|
||||
.project-sidebar { background: #f5f5f8; color: #57515f; border-color: var(--line); }
|
||||
.brand { height: 84px; min-height: 84px; padding: 0 20px; border: 0; gap: 10px; }
|
||||
.brand-mark { width: 35px; height: 39px; background: transparent; box-shadow: none; color: var(--accent); border: 0; }
|
||||
.brand strong { font: 650 26px/1.05 "Segoe UI Variable", "Segoe UI", sans-serif; letter-spacing: -1.1px; color: #37333f; }
|
||||
.brand div > span { color: #57515f; font-size: 10px; letter-spacing: .1px; margin-top: 6px; }
|
||||
.brand > .icon-button { margin-left: auto; width: 28px; color: #57515f; }
|
||||
.project-selector { margin: 4px 14px 0; padding: 12px 12px 14px; border: 1px solid #e1e0e9; background: #fafafc; border-radius: 9px; }
|
||||
.field-eyebrow { color: #57515f; font-size: 11px; font-weight: 500; letter-spacing: .1px; }
|
||||
.project-select-row { color: #57515f; gap: 8px; margin: 7px 0 4px; }
|
||||
.project-select-row select { color: #37333f; font-size: 13px; font-weight: 600; padding: 3px 0; }
|
||||
.project-select-row select option { color: #37333f; background: white; }
|
||||
.project-root { color: #57515f; font-size: 10px; line-height: 1.7; }
|
||||
.example-tag { display: block; font-size: 10px; color: #57515f; line-height: 1.7; margin-top: 7px; }
|
||||
.project-sidebar > .new-task-button { flex-shrink: 0; width: calc(100% - 28px); margin: 18px 14px 16px; height: 40px; background: #fff; color: #57515f; border: 1px solid #d9d5e5; border-radius: 8px; font-size: 13px; font-weight: 600; padding: 0 12px; box-shadow: 0 1px 2px #30234a04; }
|
||||
.new-task-button > svg:last-child { margin-left: auto; color: #57515f; transform: rotate(45deg); }
|
||||
.new-task-button:hover { background: #f1eef9; border-color: #c4bbdc; }
|
||||
.sidebar-view-tabs { display: flex; align-items: center; margin: 0 16px 0; border-bottom: 1px solid #dedde6; flex-shrink: 0; gap: 17px; }
|
||||
.sidebar-view-tabs button { display: flex; align-items: center; gap: 6px; min-height: 37px; border-bottom: 2px solid transparent; color: #57515f; padding: 0 2px; font-size: 12px; }
|
||||
.sidebar-view-tabs button[aria-selected="true"] { border-color: var(--accent); color: #57515f; font-weight: 600; }
|
||||
.sidebar-view-tabs button > span { color: #57515f; background: #e9e7ee; border-radius: 4px; font-size: 10px; min-width: 18px; padding: 1px 4px; text-align: center; }
|
||||
.sidebar-section { padding: 16px 12px; }
|
||||
.sessions-section { flex: 1; display: flex; flex-direction: column; min-height: 60px; border: 0; overflow: hidden; }
|
||||
.section-label { font-weight: 500; color: #57515f; font-size: 11px; margin: 0 4px 7px; }
|
||||
.session-list { margin: 0; max-height: none; min-height: 0; overflow: auto; flex: 1; }
|
||||
.session-item { border-radius: 6px; margin: 2px 0; }
|
||||
.session-select { padding: 11px 10px; font-size: 12px; color: #57515f; min-height: 39px; }
|
||||
.session-item.selected { background: #e9e5f3; }
|
||||
.session-item.selected .session-select { color: #57515f; }
|
||||
.session-item:hover { background: #eeecf3; }
|
||||
.session-select > svg { color: #57515f; }
|
||||
.session-select > b { color: #57515f; background: #fff; }
|
||||
.sidebar-empty { padding: 27px 6px; text-align: center; color: #57515f; }
|
||||
.sidebar-empty > svg { margin-bottom: 12px; color: #57515f; }
|
||||
.sidebar-empty strong { display: block; color: #57515f; font-size: 12px; font-weight: 500; }
|
||||
.sidebar-empty p { margin-top: 8px; color: #57515f; font-size: 11px; line-height: 1.8; }
|
||||
.file-section { flex: 1; padding-top: 13px; }
|
||||
.file-filter { border: 1px solid #dfdce7; background: #fcfbfe; height: 33px; border-radius: 6px; color: #57515f; margin: 0 3px 9px; }
|
||||
.file-filter input { font-size: 12px; color: #37333f; }
|
||||
.file-filter input::placeholder, .file-filter kbd { color: #57515f; }
|
||||
.tree-row { height: 32px; color: #57515f; font-size: 12px; }
|
||||
.tree-row svg { color: #57515f; }
|
||||
.tree-row:hover { background: #eeebf3; }
|
||||
.tree-row.selected { background: #e8e3f2; color: #57515f; }
|
||||
.tree-row.selected svg { color: #57515f; }
|
||||
.sidebar-footer { padding: 10px 12px 12px; border-color: #e1dfe8; background: #f5f5f8; }
|
||||
.sidebar-footer > button { min-height: 38px; color: #57515f; font-size: 12px; border-radius: 6px; padding: 9px 9px; }
|
||||
.sidebar-footer > button:hover { background: #eae7f1; }
|
||||
.sidebar-footer > button > svg:last-child { color: #57515f; }
|
||||
.sidebar-footer > button > kbd { margin-left: auto; color: #57515f; font-size: 10px; }
|
||||
.sidebar-footer > .model-sidebar-entry { margin-top: 4px; padding: 11px 9px; }
|
||||
.model-sidebar-entry small { color: #57515f; margin-top: 3px; font-size: 10px; }
|
||||
.connection { border-top: 1px solid #e1dfe8; margin: 7px 5px 0; padding: 13px 0 1px; color: #57515f; font-size: 10px; }
|
||||
.connection.connected > span { background: #3e8c6d; }
|
||||
.version-entry { color: #57515f; font-size: 10px; }
|
||||
|
||||
/* The conversation is the default work surface; results open alongside it. */
|
||||
.task-pane { background: #fff; min-height: 0; container-type: inline-size; }
|
||||
.work-header { min-height: 76px; height: 76px; padding: 0 32px; gap: 18px; border-color: #eeeef2; }
|
||||
.work-title { flex: 1; gap: 12px; }
|
||||
.work-title > div { min-width: 0; }
|
||||
.header-breadcrumb { color: #57515f; font-size: 11px; margin-bottom: 6px; }
|
||||
.work-title h1 { font: 600 15px/1.4 "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", sans-serif; color: #37333f; max-width: 570px; }
|
||||
.model-launch { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
|
||||
.header-tools, .inspector-toggle { display: flex; gap: 7px; align-items: center; min-height: 34px; border-radius: 7px; padding: 7px 10px; color: #57515f; font-size: 12px; white-space: nowrap; }
|
||||
.header-tools:hover, .inspector-toggle:hover { background: #f3f1f8; }
|
||||
.header-tools kbd { margin-left: 8px; color: #57515f; font-size: 10px; }
|
||||
.inspector-toggle { border: 1px solid #e2deeb; color: #57515f; }
|
||||
.inspector-toggle[aria-pressed="true"] { color: var(--accent); background: #f2eff9; border-color: #d5cdea; }
|
||||
.task-toolbar { height: 43px; min-height: 43px; padding: 0 30px; gap: 12px; border: 0; background: #fff; color: #57515f; }
|
||||
.task-local { color: #57515f; font-size: 11px; gap: 7px; }
|
||||
.local-dot { width: 5px; height: 5px; background: #7a998a; border-radius: 50%; }
|
||||
.task-toolbar .subtle { font-size: 11px; color: #57515f; }
|
||||
.toolbar-actions { gap: 5px; }
|
||||
.toolbar-actions .text-button { color: #57515f; font-size: 11px; }
|
||||
.status { font-size: 10px; border-radius: 4px; font-weight: 500; }
|
||||
.status-idle { color: #57515f; background: #f0edf5; }
|
||||
.status-running, .status-retrying { color: #57515f; background: #f0eafa; }
|
||||
.status-completed, .status-passed, .status-applied { color: #28664f; background: #eaf4ee; }
|
||||
.status-failed, .status-conflict { color: #a43d48; background: #fff0f1; }
|
||||
.conversation { padding: 28px 38px 22px; }
|
||||
.conversation-entries { max-width: 800px; margin: 0 auto; }
|
||||
.message { gap: 13px; margin-bottom: 27px; }
|
||||
.message-avatar { width: 30px; height: 30px; border-radius: 8px; color: #57515f; background: #f0ebf8; border: 0; font-size: 11px; }
|
||||
.message-user .message-avatar { color: #57515f; background: #f0edf3; }
|
||||
.message-label { color: #57515f; font-size: 12px; font-weight: 600; margin-bottom: 9px; }
|
||||
.message-label time { color: #57515f; font-size: 10px; font-weight: 400; }
|
||||
.message-text, .message-text .research-content { font-size: 14px; color: #37333f; line-height: 1.9; }
|
||||
.message-text .research-content h2, .message-text .research-content h3, .message-text .research-content h4 { color: #37333f; }
|
||||
.message-text .research-content code { background: #f3f0f7; color: #57515f; }
|
||||
.message-system .message-text { color: #57515f; }
|
||||
.inline-event { margin-left: 43px; }
|
||||
.tool-row { min-height: 43px; border: 1px solid #e6e1ed; border-radius: 7px; background: #faf9fc; }
|
||||
.tool-name > strong { color: #57515f; font-size: 12px; }
|
||||
.tool-name > span, .tool-end { color: #57515f; font-size: 11px; }
|
||||
.tool-symbol { background: #f1edf7; color: #57515f; }
|
||||
.tool-completed .tool-symbol { color: #4f7b64; background: #eaf4ee; }
|
||||
.working-note { color: #57515f; font-size: 12px; }
|
||||
.system-event { color: #57515f; }
|
||||
.system-event-output { margin: 4px 0 0; color: #716979; }
|
||||
.system-event-output summary { cursor: pointer; display: list-item; font-size: 10px; padding: 3px 0; width: fit-content; }
|
||||
.system-event-output pre { color: #57515f; background: #f8f6fb; border: 1px solid #e7e0ee; border-radius: 6px; padding: 10px; margin: 6px 0; max-height: 220px; overflow: auto; font-size: 11px; line-height: 1.8; }
|
||||
.model-stream-preview { border-left-color: #aaa0c7; background: #f8f6fc; color: #57515f; }
|
||||
.model-stream-preview span, .model-stream-preview p { color: #57515f; }
|
||||
|
||||
/* First task: useful project context and three concrete starting points. */
|
||||
.orven-welcome { max-width: 740px; width: 100%; margin: clamp(12px, 4vh, 48px) auto 16px; padding: 0; }
|
||||
.welcome-signature { display: flex; align-items: center; gap: 12px; margin-bottom: 33px; color: var(--accent); }
|
||||
.welcome-signature > span { font-size: 23px; font-weight: 600; letter-spacing: -.7px; color: #37333f; }
|
||||
.welcome-signature small { display: block; margin-top: 4px; color: #57515f; font-size: 11px; font-weight: 400; letter-spacing: .4px; }
|
||||
.orven-welcome h2 { color: #37333f; font: 600 clamp(25px, 2.4vw, 34px)/1.4 "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", sans-serif; letter-spacing: -.9px; margin: 0 0 14px; }
|
||||
.orven-welcome > p { color: #57515f; font-size: 14px; line-height: 1.9; margin: 0; }
|
||||
.welcome-project { display: flex; gap: 12px; align-items: center; padding: 18px 0; margin-top: 28px; border-bottom: 1px solid #e9e5ee; }
|
||||
.welcome-project-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: #f3f0f8; color: #57515f; }
|
||||
.welcome-project > div { min-width: 0; flex: 1; }
|
||||
.welcome-project strong { font-size: 13px; font-weight: 600; color: #57515f; display: flex; gap: 8px; align-items: center; }
|
||||
.welcome-project strong > span { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 400; color: #57515f; background: #f1edf7; }
|
||||
.welcome-project small { display: block; color: #57515f; font-size: 11px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.welcome-project > button { display: flex; align-items: center; gap: 7px; min-height: 36px; font-size: 12px; color: #57515f; padding: 6px 10px; border: 1px solid #e3dce9; border-radius: 6px; white-space: nowrap; }
|
||||
.welcome-project > button > svg { transform: rotate(45deg); }
|
||||
.welcome-project > button:hover { background: #f4f0fa; }
|
||||
.starter-heading { font-size: 11px; color: #57515f; margin: 24px 0 12px; }
|
||||
.orven-welcome .starter-prompts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin: 0; width: 100%; max-width: none; }
|
||||
.orven-welcome .starter-prompts > button { min-height: 87px; padding: 15px 12px; border: 1px solid #e7e1ed; border-radius: 8px; background: #fff; display: flex; align-items: center; gap: 10px; box-shadow: none; }
|
||||
.orven-welcome .starter-prompts > button:hover { background: #faf8fd; border-color: #c9bbdb; }
|
||||
.orven-welcome .starter-prompts .starter-icon { display: flex; width: 25px; height: 30px; align-items: center; justify-content: flex-start; background: none; color: #57515f; border-radius: 0; }
|
||||
.orven-welcome .starter-prompts > button > span:nth-child(2) { flex: 1; min-width: 0; display: block; background: none; width: auto; height: auto; }
|
||||
.starter-prompts strong { display: block; color: #57515f; font-size: 12px; font-weight: 500; white-space: nowrap; }
|
||||
.starter-prompts small { display: block; color: #57515f; font-size: 10px; margin-top: 6px; white-space: nowrap; }
|
||||
.orven-welcome .starter-prompts > button > svg { color: #57515f; margin: 0; width: 12px; }
|
||||
.welcome-connect { display: flex; width: 100%; align-items: center; gap: 9px; margin-top: 22px; padding: 4px 0; min-height: 32px; color: #57515f; font-size: 11px; text-align: left; }
|
||||
.welcome-connect > svg:last-child { margin-left: auto; }
|
||||
.welcome-connect:hover { color: var(--accent); }
|
||||
|
||||
/* Input and execution controls share one stable, reachable footer. */
|
||||
.composer-wrap { background: white; border: 0; padding: 14px max(30px, calc((100% - 800px) / 2)) 17px; }
|
||||
.composer { display: flex; flex-direction: column; background: #fff; border: 1px solid #dcd4e6; border-radius: 12px; box-shadow: 0 4px 20px #39214805; overflow: visible; }
|
||||
.composer:focus-within { border-color: #ab94c7; box-shadow: 0 0 0 3px #b9a6d015; }
|
||||
.composer textarea { min-height: 90px; padding: 17px 19px 7px; color: #37333f; font-size: 14px; line-height: 1.8; }
|
||||
.composer textarea::placeholder { color: #57515f; }
|
||||
.composer .input-composer { border: 0; padding: 0 11px; }
|
||||
.input-composer-tools { gap: 8px; }
|
||||
.input-composer-tools > span { color: #57515f; font-size: 10px; }
|
||||
.input-add { color: #57515f; font-size: 11px; padding: 5px 7px; }
|
||||
.input-add:hover { background: #f3eef8; }
|
||||
.input-route { color: #57515f; }
|
||||
.composer-bottom { min-height: 52px; padding: 8px 13px 11px; gap: 10px; }
|
||||
.composer-options { display: flex; align-items: center; min-width: 0; gap: 8px; }
|
||||
.composer-model { display: flex; align-items: center; gap: 7px; padding: 6px; min-width: 0; font-size: 11px; color: #57515f; border-radius: 5px; }
|
||||
.composer-model > span:nth-child(2) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 190px; }
|
||||
.composer-model:hover { background: #f5effa; }
|
||||
.model-light { background: #609577; width: 6px; height: 6px; }
|
||||
.model-light.model-unset { background: #aa96b5; }
|
||||
.composer-divider { height: 14px; width: 1px; background: #e5ddea; flex-shrink: 0; }
|
||||
.composer .permission-mode { border: 0; padding: 4px; color: #57515f; background: none; gap: 4px; min-width: 0; }
|
||||
.composer .permission-mode select { color: #57515f; font-size: 11px; min-height: 28px; max-width: 145px; }
|
||||
.composer .send-button { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); border-radius: 8px; color: #fff; flex-shrink: 0; }
|
||||
.composer .send-button:disabled { opacity: 1; color: #57515f; background: #efebf4; }
|
||||
.composer .send-button:hover:not(:disabled) { background: #50419d; }
|
||||
.stop-button { background: #fbf0f2; color: #a04a60; border: 1px solid #ecd5de; border-radius: 6px; padding: 8px 10px; font-size: 12px; }
|
||||
.composer-footnote { display: flex; justify-content: space-between; gap: 10px; color: #57515f; padding: 10px 2px 0; font-size: 10px; }
|
||||
|
||||
/* A practical review pane, with legible source and semantic diff colors. */
|
||||
.inspector { background: #faf9fc; border-color: var(--line); min-height: 0; }
|
||||
.inspector-tabs { gap: 2px; padding: 0 9px; height: 54px; background: #faf9fc; border-color: #e7e1ec; }
|
||||
.inspector-tabs > button:not(.icon-button) { font-size: 11px; color: #57515f; gap: 4px; padding: 0 7px; }
|
||||
.inspector-tabs > button.selected { color: var(--accent); border-bottom-color: var(--accent); }
|
||||
.inspector-tabs > button > b { color: #57515f; background: #eae2f4; }
|
||||
.inspector-tabs > .icon-button { width: 28px; }
|
||||
.inspector-footer { color: #57515f; border-color: #e8e1ed; font-size: 10px; padding: 11px 10px; }
|
||||
.empty-inspector { max-width: 320px; padding: 32px 27px; }
|
||||
.empty-inspector-symbol { width: 52px; height: 52px; border-radius: 12px; color: #57515f; border: 1px solid #e7deef; background: #f4eff9; margin-bottom: 21px; }
|
||||
.empty-inspector h3 { color: #57515f; font-size: 13px; font-weight: 500; margin-bottom: 10px; }
|
||||
.empty-inspector p { color: #57515f; font-size: 12px; line-height: 1.8; }
|
||||
.file-heading, .file-details { background: #faf8fd; border-color: #e9e1f0; color: #57515f; font-size: 11px; }
|
||||
.code-view { background: #fff; font-size: 12px; line-height: 1.9; }
|
||||
.code-view code { color: #57515f; }
|
||||
.code-view > div > span { color: #57515f; font-size: 11px; }
|
||||
.code-editor { color: #37333f; background: #fff; font-size: 12px; }
|
||||
.change-list, .change-summary, .change-actions, .event-details { border-color: #e6dfed; }
|
||||
.change-list > button { color: #57515f; font-size: 12px; }
|
||||
.change-list > button:hover, .change-list > button.selected { background: #eee7f6; }
|
||||
.change-summary strong { color: #57515f; font-size: 12px; }
|
||||
.change-summary > p, .diff-caption, .trace-caption, .event-details h4 { color: #57515f; border-color: #e9e0f1; }
|
||||
.diff-view { background: #fff; }
|
||||
.diff-line { color: #57515f; font-size: 12px; }
|
||||
.diff-line.diff-added { background: #edf6f0; color: #38654b; }
|
||||
.diff-line.diff-removed { background: #fceff1; color: #9a4252; }
|
||||
.line-number { color: #57515f; }
|
||||
.event-detail-heading strong { color: #57515f; font-size: 12px; }
|
||||
.event-details pre { color: #57515f; background: #f5effa; border-color: #e9dff2; }
|
||||
.inspector-resize-handle:hover, .inspector-resizing .inspector-resize-handle { background: #9980bb; }
|
||||
|
||||
/* Existing capabilities keep their own layouts and share this surface system. */
|
||||
.modal-backdrop { background: #20172f55; backdrop-filter: blur(2px); }
|
||||
.modal { color: #57515f; background: #fff; border: 1px solid #e1d7ea; border-radius: 14px; box-shadow: 0 24px 100px #25153730; padding: 26px; }
|
||||
.modal-heading h2 { font: 600 20px/1.4 "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", sans-serif; color: #37333f; letter-spacing: -.4px; }
|
||||
.modal-heading p { color: #57515f; font-size: 12px; line-height: 1.8; }
|
||||
.modal-heading > .icon-button { color: #57515f; }
|
||||
.modal .form-field { color: #716979; font-size: 12px; }
|
||||
.modal .form-field input, .modal .form-field select, .modal .form-field textarea { color: #57515f; border-color: #dfd1e9; background: #fff; border-radius: 7px; min-height: 40px; }
|
||||
.modal .form-field input::placeholder { color: #57515f; }
|
||||
.modal .subtle, .modal .mc-help { color: #57515f; }
|
||||
.modal :is(.skill-center, .mcp-panel, .worker-console, .evaluation-console, .project-memory, .engine-panel, .rea-panel, .diagnostic-panel) { color: #57515f; font-size: 13px; }
|
||||
.modal :is(.skill-heading, .mcp-heading, .worker-console-heading, .evaluation-heading, .memory-overview, .engine-heading, .rea-heading) h2 { color: #37333f; font-size: 22px; font-weight: 600; letter-spacing: -.5px; }
|
||||
.modal :is(.skill-heading, .mcp-heading, .worker-console-heading, .evaluation-heading, .memory-overview, .engine-heading, .rea-heading) p { color: #716979; font-size: 12px; line-height: 1.9; }
|
||||
.modal :is(.skill-kicker, .mcp-kicker, .worker-eyebrow, .evaluation-kicker, .memory-eyebrow, .engine-eyebrow, .rea-eyebrow) { color: #716979; font-size: 10px; }
|
||||
.modal :is(.skill-status-bar, .mcp-status-bar, .memory-summary) { color: #716979; border-color: #e4deeb; background: #faf8fc; padding: 12px; border-radius: 6px; }
|
||||
.modal :is(.skill-register, .mcp-register, .worker-plan-form, .worker-budget-form, .evaluation-form, .memory-editor, .engine-connection, .rea-registration) { background: #f8f6fb; border: 1px solid #e2daeb; border-radius: 10px; padding: 20px; }
|
||||
.modal :is(.skill-register-heading, .mcp-register-heading, .memory-editor-heading) { color: #57515f; }
|
||||
.modal :is(.skill-empty, .mcp-empty, .memory-empty, .engine-empty, .rea-empty, .rea-empty-result) { color: #716979; border: 1px solid #e5deee; background: #fff; border-radius: 10px; padding: 30px 20px; }
|
||||
.modal :is(.skill-empty, .mcp-empty, .memory-empty, .engine-empty, .rea-empty, .rea-empty-result) > svg { color: #8d7c9e; }
|
||||
.modal :is(.skill-empty, .mcp-empty, .memory-empty, .engine-empty, .rea-empty, .rea-empty-result) strong { color: #57515f; }
|
||||
.modal :is(.skill-form-grid, .mcp-form-grid, .memory-form-grid, .evaluation-form, .worker-plan-form) label { color: #57515f; font-size: 12px; }
|
||||
.modal input:not([type="checkbox"]):not([type="radio"]), .modal select, .modal textarea { border-color: #d8cde4; border-radius: 7px; color: #57515f; }
|
||||
.modal input[type="checkbox"], .modal input[type="radio"] { accent-color: var(--accent); }
|
||||
.modal :is(input, textarea)::placeholder { color: #81708b; }
|
||||
.modal :is(.mcp-boundary, .worker-boundary, .memory-scope-warning) { color: #716979; border-color: #e4d9ee; background: #f7f2fc; border-radius: 7px; }
|
||||
.modal :is(.skill-source, .mcp-source, .engine-scope, .rea-hint, .skill-path, .memory-meta, .worker-scope, .worker-note, .evaluation-note) { color: #716979; }
|
||||
.modal .diagnostic-intro strong, .modal .diagnostic-grid h3 { color: #57515f; }
|
||||
.modal .diagnostic-grid section { border-color: #e3dbea; background: #faf8fd; border-radius: 8px; }
|
||||
.modal .diagnostic-grid dt, .modal .diagnostic-grid dd { color: #716979; }
|
||||
.change-set-bar { background: #f8f5fc; border-color: #e7ddf0; color: #625275; }
|
||||
.review-callout { background: #f4f0fa; border-color: #dfd4ed; color: #57515f; border-radius: 9px; }
|
||||
.review-callout small { color: #57515f; }
|
||||
.recovery-note { background: #f7f3fc; border-color: #dfd3ef; color: #716979; }
|
||||
.recovery-note p { color: #57515f; }
|
||||
.approval-card { background: #fffcf4; border: 1px solid #eadbb5; border-left: 3px solid #caa355; border-radius: 9px; box-shadow: none; }
|
||||
.approval-heading strong { color: #82622c; font-size: 13px; }
|
||||
.approval-heading p, .approval-scope { color: #57515f; font-size: 12px; }
|
||||
.approval-card > pre { background: #f8f3e8; border-color: #ede2cb; color: #57515f; font-size: 12px; }
|
||||
.approval-actions .button.primary { background: #a77d33; border-color: #a77d33; }
|
||||
.failure-card { background: #fff9fa; border-color: #efdae2; border-left: 3px solid #c56d8d; border-radius: 9px; }
|
||||
.failure-heading > strong { color: #a04c6c; }
|
||||
.failure-heading, .failure-card p { color: #9b6783; }
|
||||
.toast { background: #44334f; color: #fff; border-color: #65506f; border-radius: 9px; }
|
||||
.toast .icon-button { color: #57515f; }
|
||||
|
||||
/* Model management is a connected work surface, not a separate admin theme. */
|
||||
.modal:has(.model-center) { border-radius: 13px; border-color: #ded3ea; }
|
||||
.modal:has(.model-center) > .modal-heading { background: white; border-color: #e7ddef; padding: 23px 28px 20px; }
|
||||
.modal:has(.model-center) > .modal-heading h2 { color: #57515f; font-size: 20px; font-weight: 600; }
|
||||
.modal:has(.model-center) > .modal-heading p { color: #57515f; }
|
||||
.model-center { color: #57515f; background: #faf7fd; }
|
||||
.mc-overview { background: #f5effa; border-color: #e5d9ee; padding: 24px 28px; }
|
||||
.mc-eyebrow { color: #57515f; letter-spacing: .1em; }
|
||||
.mc-overview h2 { color: #57515f; font-size: 23px; font-weight: 600; letter-spacing: -.5px; }
|
||||
.mc-overview p, .mc-section-title p { color: #57515f; font-size: 12px; }
|
||||
.mc-current { border-color: #e1d2ec; border-radius: 9px; box-shadow: none; }
|
||||
.mc-current > span, .mc-current strong { color: #716979; }
|
||||
.mc-tabs { background: #fff; border-color: #e5d9ef; }
|
||||
.mc-tabs button { color: #57515f; border-bottom-width: 2px; font-size: 12px; font-weight: 500; }
|
||||
.mc-tabs button[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
|
||||
.mc-tabs button:hover { background: #f8f1fc; }
|
||||
.mc-content { padding-top: 25px; }
|
||||
.mc-section-title h3 { color: #57515f; font-size: 16px; font-weight: 600; }
|
||||
.mc-connection, .mc-pool, .mc-checks article, .mc-import-source { border-color: #e6d9f0; border-radius: 10px; box-shadow: none; }
|
||||
.mc-card-heading h4, .mc-pool h4 { color: #57515f; }
|
||||
.mc-card-heading > div > span, .mc-connection dt, .mc-pool p { color: #716979; }
|
||||
.mc-connection dd { color: #716979; }
|
||||
.mc-service-icon { color: #716979; background: #f4eafa; border-color: #e5cff4; border-radius: 10px; }
|
||||
.mc-connection footer { border-color: #eedff7; }
|
||||
.mc-capabilities span { border-color: #ead9f6; color: #716979; }
|
||||
.mc-editor { border-color: #ddc6ee; border-top-color: var(--accent); border-radius: 10px; }
|
||||
.mc-form-grid label { color: #716979; }
|
||||
.mc-form-grid input, .mc-form-grid select { color: #57515f; border-color: #dfc6ef; border-radius: 7px; }
|
||||
.mc-checkbox { color: #716979; }
|
||||
.mc-checkbox input { accent-color: var(--accent); }
|
||||
.mc-empty { color: #716979; border-style: solid; border-color: #e9d9f4; background: #fff; border-radius: 10px; padding: 35px 24px; }
|
||||
.mc-icon-action, .mc-probe { color: #716979; }
|
||||
.mc-route-control { background: #fff; border: 1px solid #e1dce9; border-left: 1px solid #e1dce9; border-radius: 9px; color: #57515f; }
|
||||
.mc-route-heading h3 { color: #514b5c; font-size: 13px; font-weight: 600; }
|
||||
.mc-route-heading p, .mc-route-detail { color: #716979; font-size: 11px; }
|
||||
.mc-route-select { color: #716979; }
|
||||
.mc-route-select select { color: #57515f; border-color: #d8d0e3; border-radius: 7px; }
|
||||
@media (min-width: 941px) {
|
||||
.model-center { display: grid; grid-template-columns: 178px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); flex: 1; }
|
||||
.mc-overview { grid-column: 1 / -1; padding: 23px 28px; background: #f7f5fa; }
|
||||
.mc-overview h2 { font-size: 22px; margin-block: 7px; }
|
||||
.mc-tabs { grid-column: 1; grid-row: 2; border-bottom: 0; border-right: 1px solid #e5dfee; padding: 15px 10px; gap: 3px; display: flex; flex-direction: column; overflow-y: auto; background: #faf9fc; }
|
||||
.mc-tabs button { min-height: 41px; padding: 10px 13px; border: 0; border-radius: 6px; font-size: 12px; flex-shrink: 0; }
|
||||
.mc-tabs button[aria-current] { background: #ebe5f5; color: #6253b5; }
|
||||
.mc-tabs .mc-refresh { margin: auto 0 0; justify-content: flex-start; }
|
||||
.mc-tabs .mc-refresh::after { content: '刷新连接状态'; font-size: 11px; }
|
||||
.mc-content { grid-column: 2; grid-row: 2; background: #fff; padding: 24px 26px; }
|
||||
.mc-notice { grid-column: 2; grid-row: 2; z-index: 1; align-self: start; box-shadow: 0 5px 20px #58405c12; }
|
||||
.model-center:has(> .mc-notice) .mc-content { padding-top: 96px; }
|
||||
.model-center > .mc-empty { grid-column: 2; grid-row: 2; align-self: start; margin: 24px; }
|
||||
.mc-connections { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
/* Searchable tool discovery uses words and keyboard navigation. */
|
||||
.modal:has(.workbench-tools) { width: 640px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: min(780px, 90dvh); }
|
||||
.modal:has(.workbench-tools) > .modal-heading { padding: 22px 24px 16px; margin: 0; flex-shrink: 0; }
|
||||
.workbench-tools { display: flex; flex-direction: column; min-height: 0; }
|
||||
.tools-search { display: flex; align-items: center; gap: 11px; padding: 12px 22px; border-block: 1px solid #e8e3ef; background: #faf8fd; color: #57515f; flex-shrink: 0; }
|
||||
.tools-search input { border: 0; background: none; min-width: 0; flex: 1; font-size: 13px; color: #57515f; height: 30px; }
|
||||
.tools-search input::placeholder { color: #57515f; }
|
||||
.tools-search kbd { font-size: 10px; color: #57515f; border: 1px solid #e6d7f0; padding: 3px 5px; border-radius: 4px; }
|
||||
.tools-results { padding: 9px 12px 16px; overflow: auto; min-height: 0; }
|
||||
.tools-results section h3 { font-size: 11px; font-weight: 500; color: #716979; padding: 17px 12px 7px; }
|
||||
.tools-results section > button { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px; min-height: 65px; border-radius: 8px; text-align: left; }
|
||||
.tools-results section > button:hover, .tools-results section > button:focus-visible { background: #f6eefb; }
|
||||
.tools-action-icon { display: grid; place-items: center; width: 34px; height: 34px; color: #716979; background: #f5edf9; border-radius: 7px; }
|
||||
.tools-results button > span:nth-child(2) { min-width: 0; flex: 1; }
|
||||
.tools-results strong { display: block; font-size: 13px; color: #57515f; font-weight: 500; }
|
||||
.tools-results small { display: block; font-size: 11px; color: #716979; margin-top: 4px; }
|
||||
.tools-results button > svg { color: #57515f; }
|
||||
.tools-results button:disabled { opacity: .65; }
|
||||
.tools-results button:disabled strong { color: #57515f; }
|
||||
.tools-empty { padding: 40px 15px; color: #716979; text-align: center; }
|
||||
.tools-empty strong { margin: 13px 0 8px; }
|
||||
.tools-empty p { font-size: 12px; margin-bottom: 12px; }
|
||||
.tools-footnote { display: flex; justify-content: space-between; gap: 10px; padding: 13px 24px; border-top: 1px solid #eaddf3; color: #57515f; font-size: 10px; flex-shrink: 0; }
|
||||
|
||||
@media (min-width: 1700px) {
|
||||
.orven-workbench, .orven-workbench.inspector-wide { grid-template-columns: 260px minmax(430px, 1fr) 470px; }
|
||||
.orven-workbench.inspector-closed { grid-template-columns: 260px minmax(0, 1fr) 0; }
|
||||
.orven-workbench.sidebar-hidden { grid-template-columns: 0 minmax(430px, 1fr) 470px; }
|
||||
.orven-workbench.sidebar-hidden.inspector-closed { grid-template-columns: 0 minmax(0, 1fr) 0; }
|
||||
}
|
||||
@media (max-width: 1120px) and (min-width: 941px) {
|
||||
.orven-workbench, .orven-workbench.inspector-wide { grid-template-columns: 210px minmax(310px, 1fr) 360px; }
|
||||
.orven-workbench.inspector-closed { grid-template-columns: 210px minmax(0, 1fr) 0; }
|
||||
.orven-workbench.sidebar-hidden { grid-template-columns: 0 minmax(310px, 1fr) 360px; }
|
||||
.orven-workbench.sidebar-hidden.inspector-closed { grid-template-columns: 0 minmax(0, 1fr) 0; }
|
||||
.brand { padding-inline: 14px; }
|
||||
.project-selector { margin-inline: 10px; padding: 10px; }
|
||||
}
|
||||
@container (max-width: 740px) {
|
||||
.work-header { padding-inline: 22px; }
|
||||
.conversation { padding: 20px 26px; }
|
||||
.orven-welcome { margin-top: 15px; }
|
||||
.welcome-signature { margin-bottom: 24px; }
|
||||
.orven-welcome h2 { font-size: 28px; }
|
||||
.orven-welcome .starter-prompts { grid-template-columns: 1fr; gap: 8px; }
|
||||
.orven-welcome .starter-prompts > button { min-height: 57px; padding: 10px 14px; }
|
||||
.starter-prompts small { display: inline; margin-left: 14px; font-size: 11px; }
|
||||
.starter-prompts strong { display: inline; }
|
||||
.starter-heading { margin-top: 20px; }
|
||||
.welcome-project { margin-top: 18px; }
|
||||
.welcome-connect { margin-top: 13px; }
|
||||
.composer-wrap { padding-inline: 24px; }
|
||||
.header-tools kbd { display: none; }
|
||||
}
|
||||
@container (max-width: 510px) {
|
||||
.work-header { padding-inline: 15px; }
|
||||
.model-launch { gap: 4px; }
|
||||
.header-tools { padding-inline: 7px; }
|
||||
.header-tools > span, .inspector-toggle > span { display: none; }
|
||||
.inspector-toggle { width: 34px; padding: 8px; }
|
||||
.conversation { padding: 15px 20px; }
|
||||
.orven-welcome h2 { font-size: 26px; }
|
||||
.welcome-signature { margin-bottom: 24px; }
|
||||
.welcome-project small { max-width: 210px; }
|
||||
.starter-prompts small { margin-left: 10px; font-size: 10px; }
|
||||
.composer-wrap { padding-inline: 16px; }
|
||||
.composer-model > span:nth-child(2) { max-width: 120px; }
|
||||
.composer-options { gap: 4px; }
|
||||
.composer-footnote > span:last-child { display: none; }
|
||||
}
|
||||
@media (max-width: 940px) {
|
||||
.orven-workbench, .orven-workbench.inspector-closed, .orven-workbench.inspector-wide { grid-template-columns: 210px minmax(0, 1fr); }
|
||||
.orven-workbench.sidebar-hidden, .orven-workbench.sidebar-hidden.inspector-closed, .orven-workbench.sidebar-hidden.inspector-wide { grid-template-columns: 0 minmax(0, 1fr); }
|
||||
.orven-workbench.inspector-wide.inspector-open .inspector { display: flex; width: min(600px, 90vw); z-index: 23; box-shadow: -10px 0 45px #30164417; }
|
||||
.orven-workbench.inspector-closed .inspector { display: none; }
|
||||
.panel-scrim { background: #24163044; backdrop-filter: none; }
|
||||
}
|
||||
@media (max-width: 620px) {
|
||||
.orven-workbench, .orven-workbench.inspector-closed, .orven-workbench.sidebar-hidden, .orven-workbench.sidebar-hidden.inspector-closed, .orven-workbench.inspector-wide { grid-template-columns: 0 minmax(0, 1fr); }
|
||||
.orven-workbench:not(.sidebar-hidden) .project-sidebar { width: min(290px, 86vw); }
|
||||
.work-header { height: 66px; min-height: 66px; }
|
||||
.work-title h1 { font-size: 14px; }
|
||||
.header-breadcrumb { font-size: 10px; }
|
||||
.task-toolbar { padding: 0 17px; height: 39px; min-height: 39px; gap: 9px; }
|
||||
.task-toolbar .text-button { min-height: 35px; }
|
||||
.orven-welcome { margin-top: 14px; }
|
||||
.welcome-signature { margin-bottom: 24px; }
|
||||
.welcome-signature > span { font-size: 22px; }
|
||||
.orven-welcome > p { font-size: 13px; }
|
||||
.welcome-project { gap: 9px; padding-block: 14px; }
|
||||
.welcome-project-icon { width: 33px; height: 35px; }
|
||||
.welcome-project > button { font-size: 11px; padding: 5px 7px; }
|
||||
.welcome-project small { max-width: 175px; font-size: 10px; }
|
||||
.starter-heading { margin-top: 16px; }
|
||||
.orven-welcome .starter-prompts > button { min-height: 51px; }
|
||||
.welcome-connect { font-size: 10px; }
|
||||
.composer-wrap { padding: 10px 13px 12px; }
|
||||
.composer textarea { min-height: 78px; max-height: 140px; padding: 13px 14px 4px; font-size: 16px; }
|
||||
.composer-bottom { padding: 5px 9px 9px; min-height: 46px; }
|
||||
.composer .permission-mode select { font-size: 10px; max-width: 111px; }
|
||||
.composer .permission-mode > svg { width: 12px; }
|
||||
.composer .input-composer { padding-inline: 7px; }
|
||||
.input-composer-tools > span { font-size: 9px; }
|
||||
.composer-model { font-size: 10px; }
|
||||
.composer-model > span:nth-child(2) { max-width: 100px; }
|
||||
.composer-footnote { font-size: 9px; padding-top: 8px; }
|
||||
.message-text, .message-text .research-content { font-size: 13px; }
|
||||
.modal-backdrop { padding: 12px; }
|
||||
.modal { border-radius: 12px; max-height: calc(100dvh - 24px); padding: 21px 18px; }
|
||||
.modal-wide { height: calc(100dvh - 24px); }
|
||||
.modal-heading p { font-size: 11px; }
|
||||
.modal:has(.workbench-tools) { max-height: calc(100dvh - 24px); }
|
||||
.tools-search { padding-inline: 16px; }
|
||||
.tools-results { padding-inline: 7px; }
|
||||
.tools-footnote { padding-inline: 16px; font-size: 9px; }
|
||||
.tools-results section > button { min-height: 64px; }
|
||||
.modal:has(.model-center) { width: calc(100vw - 24px); height: calc(100dvh - 24px); }
|
||||
.modal:has(.model-center) > .modal-heading { padding: 19px 18px 15px; }
|
||||
.mc-overview, .mc-content { padding: 18px; }
|
||||
.mc-overview { gap: 14px; }
|
||||
.mc-overview h2 { font-size: 20px; }
|
||||
.mc-tabs { padding-inline: 8px; }
|
||||
.mc-tabs button { min-height: 46px; padding-inline: 12px; }
|
||||
}
|
||||
@media (max-height: 800px) and (min-width: 621px) {
|
||||
.orven-welcome { margin-top: 8px; }
|
||||
.welcome-signature { margin-bottom: 20px; }
|
||||
.welcome-project { margin-top: 16px; }
|
||||
.orven-welcome .starter-prompts > button { min-height: 68px; }
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
|
||||
}
|
||||
@@ -81,6 +81,6 @@ internal static class Launcher {
|
||||
Regex allowed = new Regex("^(path|pathext|systemroot|systemdrive|windir|comspec|temp|tmp|userprofile|homedrive|homepath|appdata|localappdata|programfiles(?:\\(x86\\))?|commonprogramfiles(?:\\(x86\\))?|lang|lc_all|AGENT_WORKBENCH_(?:DEEPSEEK_ROOT|PURGE_ROOT|PYTHON_PATH|TEST_PYTHON))$", RegexOptions.IgnoreCase);
|
||||
foreach (string key in keys) if (!allowed.IsMatch(key)) launch.EnvironmentVariables.Remove(key);
|
||||
using (Process child = Process.Start(launch)) { if (uninstall) { child.WaitForExit(); return child.ExitCode; } } return 0;
|
||||
} catch (Exception error) { if (!hidden) MessageBox.Show(error.Message, "Agent Workbench 无法打开", MessageBoxButtons.OK, MessageBoxIcon.Error); return 1; }
|
||||
} catch (Exception error) { if (!hidden) MessageBox.Show(error.Message, "Orven 无法打开", MessageBoxButtons.OK, MessageBoxIcon.Error); return 1; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[Setup]
|
||||
AppId={{E914E883-46F9-4B82-B27F-BDB2B40DCC90}
|
||||
AppName=Agent Workbench
|
||||
AppName=Orven
|
||||
AppVersion={#Version}
|
||||
DefaultDirName={localappdata}\Programs\AgentWorkbench
|
||||
DefaultGroupName=Agent Workbench
|
||||
DefaultGroupName=Orven
|
||||
PrivilegesRequired=lowest
|
||||
ArchitecturesAllowed=x64compatible
|
||||
ArchitecturesInstallIn64BitMode=x64compatible
|
||||
@@ -28,14 +28,14 @@ Source: "{#PortableRoot}\*"; DestDir: "{app}\versions\{#VersionDirectory}"; Flag
|
||||
Source: "{#PortableRoot}\AgentWorkbench.exe"; DestDir: "{app}"; Flags: onlyifdoesntexist
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\Agent Workbench"; Filename: "{app}\AgentWorkbench.exe"
|
||||
Name: "{userdesktop}\Agent Workbench"; Filename: "{app}\AgentWorkbench.exe"; Tasks: desktopicon
|
||||
Name: "{group}\Orven"; Filename: "{app}\AgentWorkbench.exe"
|
||||
Name: "{userdesktop}\Orven"; Filename: "{app}\AgentWorkbench.exe"; Tasks: desktopicon
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "创建桌面快捷方式"; Flags: unchecked
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\AgentWorkbench.exe"; Description: "打开 Agent Workbench"; Flags: nowait postinstall skipifsilent; Check: WasActivated
|
||||
Filename: "{app}\AgentWorkbench.exe"; Description: "打开 Orven"; Flags: nowait postinstall skipifsilent; Check: WasActivated
|
||||
|
||||
[Code]
|
||||
var DataRoot: String; Port: String; StageOnly: Boolean; Activated: Boolean; ActivationFailed: Boolean;
|
||||
@@ -79,7 +79,7 @@ begin
|
||||
' --operation-id ' + Quoted(OperationId) + ' --expected-manifest-sha256 {#ManifestSha256}';
|
||||
if Candidate then Parameters := Parameters + ' --candidate-root ' + Quoted(ExpandConstant('{app}\versions\{#VersionDirectory}'));
|
||||
if StageOnly then Parameters := Parameters + ' --stage-only';
|
||||
if ManagerPage = nil then ManagerPage := CreateOutputProgressPage('Agent Workbench 版本更新', '核对原版本、当前阶段与实际结果');
|
||||
if ManagerPage = nil then ManagerPage := CreateOutputProgressPage('Orven 版本更新', '核对原版本、当前阶段与实际结果');
|
||||
ManagerPage.SetText('准备核对安装操作', '操作记录:' + ExpandConstant('{app}') + '\.installation\progress-' + OperationId + '.json');
|
||||
ManagerPage.ProgressBar.Visible := False;
|
||||
if Command <> 'cancel' then ManagerPage.Show;
|
||||
|
||||
@@ -18,7 +18,7 @@ const dataRoot = path.resolve(options['--data-root'] || path.join(process.env.LO
|
||||
const port = Number(options['--port'] || 4318);
|
||||
assertLocalTree(dataRoot, { missing: true }); fs.mkdirSync(dataRoot, { recursive: true });
|
||||
const profile = ownedChild(dataRoot, '.desktop-profile', { missing: true }); fs.mkdirSync(profile, { recursive: true }); protectUserDirectory(profile); app.setPath('userData', profile);
|
||||
app.setAppUserModelId('local.agent-workbench'); app.setName('Agent Workbench');
|
||||
app.setAppUserModelId('local.agent-workbench'); app.setName('Orven');
|
||||
let window, controller, bridge, browsingView, windowId, windowOwner, quitting = false;
|
||||
const retained = app.requestSingleInstanceLock({ appRoot, dataRoot, port });
|
||||
if (!retained) app.quit();
|
||||
@@ -41,8 +41,8 @@ else {
|
||||
windowId = randomUUID(); windowOwner = { windowId, pid: process.pid, createdAt: observed.createdAt, instanceId: host.identity.instanceId, runtimeIdentity: host.identity.runtimeIdentity };
|
||||
await controller.api('/host/windows/register', { method: 'POST', input: windowOwner });
|
||||
const preload = path.join(appRoot, 'dist-desktop/preload.cjs');
|
||||
window = new BrowserWindow({ title: 'Agent Workbench', width: 1440, height: 1000, minWidth: 390, minHeight: 600,
|
||||
show: false, backgroundColor: '#edf2f7', icon: path.join(appRoot, 'public/workbench-icon.png'),
|
||||
window = new BrowserWindow({ title: 'Orven · AI 开发工作台', width: 1440, height: 1000, minWidth: 390, minHeight: 600,
|
||||
show: false, backgroundColor: '#ffffff', icon: path.join(appRoot, 'public/workbench-icon.png'),
|
||||
webPreferences: { preload, sandbox: true, contextIsolation: true, nodeIntegration: false, webSecurity: true, allowRunningInsecureContent: false } });
|
||||
window.webContents.setWindowOpenHandler(() => ({ action: 'deny' }));
|
||||
window.webContents.on('will-navigate', details => { if (!desktopOrigin(details.url, controller.url)) details.preventDefault(); });
|
||||
@@ -71,5 +71,5 @@ else {
|
||||
console.log(JSON.stringify({ app: 'agent-workbench-desktop', ready: true, pid: process.pid, hostPid: host.identity.pid,
|
||||
instanceId: host.identity.instanceId, appRoot, dataRoot, url: host.url }));
|
||||
}).catch(error => { console.error(JSON.stringify({ app: 'agent-workbench-desktop', ready: false, message: error.message }));
|
||||
if (!options.hidden) dialog.showErrorBox('Agent Workbench 无法打开', error.message); app.exit(1); });
|
||||
if (!options.hidden) dialog.showErrorBox('Orven 无法打开', error.message); app.exit(1); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user