feat: add HoloLake folder import and official assistant
This commit is contained in:
parent
46bdd0ca73
commit
a360982a9b
12 changed files with 507 additions and 76 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* AgentChat — 人格体对话组件
|
||||
* AgentChat — HoloLake 助手组件
|
||||
*
|
||||
* 与光湖人格体对话,Agent 直接操作 Git 引擎管理知识库。
|
||||
* 通过受控工具协助用户管理 Git 驱动的知识库。
|
||||
* 支持:对话、工具调用展示、对话历史、清空对话。
|
||||
*/
|
||||
|
||||
|
|
@ -215,8 +215,8 @@ export default function AgentChat({ apiBase, onDocSelect }: Props) {
|
|||
<div className="agent-info">
|
||||
<div className="agent-avatar">🌊</div>
|
||||
<div className="agent-meta">
|
||||
<h3>{status?.name || '光湖人格体'}</h3>
|
||||
<span className="agent-role">{status?.role || '知识库管理者'}</span>
|
||||
<h3>{status?.name || 'HoloLake 助手'}</h3>
|
||||
<span className="agent-role">{status?.role || '知识工作助手'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="agent-actions">
|
||||
|
|
@ -274,8 +274,8 @@ export default function AgentChat({ apiBase, onDocSelect }: Props) {
|
|||
{messages.length === 0 && (
|
||||
<div className="agent-welcome">
|
||||
<div className="welcome-icon">🌊</div>
|
||||
<h2>光湖人格体</h2>
|
||||
<p>{status?.operational ? '我是知识库的 AI Agent,可以调用工具管理文档。' : '知识库功能已运行;Agent 需要配置模型后才会回应,不会用模拟回复冒充。'}</p>
|
||||
<h2>HoloLake 助手</h2>
|
||||
<p>{status?.operational ? '可以检索、整理和编辑当前知识库,并为操作保留版本记录。' : '知识库已运行;配置模型后即可使用智能整理功能。'}</p>
|
||||
<p className="welcome-hint">试试说:</p>
|
||||
<div className="welcome-suggestions">
|
||||
<button onClick={() => { setInput('帮我列出所有文档'); inputRef.current?.focus(); }}>
|
||||
|
|
@ -355,7 +355,7 @@ export default function AgentChat({ apiBase, onDocSelect }: Props) {
|
|||
<textarea
|
||||
ref={inputRef}
|
||||
className="agent-input"
|
||||
placeholder="和人格体对话…"
|
||||
placeholder="向 HoloLake 助手提问…"
|
||||
value={input}
|
||||
onChange={e => setInput(e.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ function TreeNode({
|
|||
className={`kb-tree-item kb-tree-folder-header ${expanded ? 'expanded' : ''}`}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
>
|
||||
<span className="kb-tree-icon">{expanded ? '📂' : '📁'}</span>
|
||||
<span className={`kb-tree-chevron ${expanded ? 'expanded' : ''}`}>›</span>
|
||||
<span className="kb-tree-folder-icon" aria-hidden="true" />
|
||||
<span className="kb-tree-name">{node.name}</span>
|
||||
<button
|
||||
className="kb-tree-add"
|
||||
|
|
@ -80,7 +81,7 @@ function TreeNode({
|
|||
className={`kb-tree-item kb-tree-doc ${isActive ? 'active' : ''}`}
|
||||
onClick={() => onSelect(node.path)}
|
||||
>
|
||||
<span className="kb-tree-icon">📄</span>
|
||||
<span className="kb-tree-doc-icon" aria-hidden="true" />
|
||||
<span className="kb-tree-name">{node.name}</span>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -40,9 +40,10 @@ export function Editor({ doc, onSave }: Props) {
|
|||
|
||||
return (
|
||||
<div className="kb-editor">
|
||||
<div className="kb-page-symbol" aria-hidden="true">◇</div>
|
||||
{/* 元信息栏 */}
|
||||
<div className="kb-editor-meta">
|
||||
<span className="kb-editor-path">{doc.meta.id}</span>
|
||||
<span className="kb-editor-path">HoloLake / {doc.meta.id}</span>
|
||||
<span className="kb-editor-date">
|
||||
更新于 {new Date(doc.meta.updatedAt).toLocaleString('zh-CN')}
|
||||
</span>
|
||||
|
|
@ -71,7 +72,7 @@ export function Editor({ doc, onSave }: Props) {
|
|||
<button className="kb-btn-secondary" onClick={handleCancel}>取消</button>
|
||||
</>
|
||||
) : (
|
||||
<button className="kb-btn-primary" onClick={() => setEditing(true)}>编辑</button>
|
||||
<button className="kb-btn-primary" onClick={() => setEditing(true)}>编辑页面</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue