Add MindSpace page live edit, chat skills, and H5 deploy tooling.

Introduce page edit sessions with draft preview and patch API, chat skill picker, user memory profile, h5ApiBase resolution, voice WAV transport, and scripts for 105/g2 deployment and Plaza local dev.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
John
2026-06-15 22:09:38 -07:00
parent 3cd322ccfe
commit 6ee6fd64dd
94 changed files with 7015 additions and 2136 deletions
+46 -6
View File
@@ -1,5 +1,7 @@
import { useEffect } from 'react';
import { useChat } from '../context/ChatProvider';
import { INSUFFICIENT_BALANCE_NOTICE } from '../hooks/useTKMindChat';
import type { PageEditSubChatBridge } from '../hooks/usePageEditSubChat';
import type { MindSpaceChatContext, MindSpaceSaveCategory, PortalUser } from '../types';
import { formatContextChip } from '../utils/mindspaceChatContext';
import { ChatPanel } from './ChatPanel';
@@ -12,6 +14,9 @@ export function SpaceChatPanel({
onClose,
onOpenFullChat,
onPageSaved,
chatBridge,
hideOpenFullChat = false,
title = 'TKMind',
}: {
open: boolean;
context: MindSpaceChatContext;
@@ -23,7 +28,12 @@ export function SpaceChatPanel({
pageId?: string;
categoryCode?: MindSpaceSaveCategory;
}) => void;
chatBridge?: PageEditSubChatBridge;
hideOpenFullChat?: boolean;
title?: string;
}) {
const mainChat = useChat();
const chat = chatBridge ?? mainChat;
const {
session,
messages,
@@ -33,8 +43,11 @@ export function SpaceChatPanel({
stop,
approveTool,
error,
notice,
dismissNotice,
openRecharge,
retryConnect,
} = useChat();
} = chat;
useEffect(() => {
if (!open) return;
@@ -55,22 +68,44 @@ export function SpaceChatPanel({
<div className="space-chat-panel-brand">
<TKMindAvatar size="sm" />
<div>
<strong>TKMind</strong>
<strong>{title}</strong>
<span className="space-chat-context-chip" title={context.route}>
{contextLabel}
</span>
</div>
</div>
<div className="space-chat-panel-actions">
<button type="button" className="ghost-btn" onClick={onOpenFullChat}>
打开完整聊天
</button>
{!hideOpenFullChat ? (
<button type="button" className="ghost-btn" onClick={onOpenFullChat}>
打开完整聊天
</button>
) : null}
<button type="button" className="space-chat-panel-close" onClick={onClose} aria-label="关闭">
×
</button>
</div>
</header>
{notice && (
<div className="space-chat-panel-error space-chat-panel-notice">
<span>{notice}</span>
{notice === INSUFFICIENT_BALANCE_NOTICE ? (
<>
<button type="button" onClick={() => openRecharge(false)}>
去充值
</button>
<button type="button" onClick={dismissNotice}>
知道了
</button>
</>
) : (
<button type="button" onClick={dismissNotice}>
知道了
</button>
)}
</div>
)}
{error && (
<div className="space-chat-panel-error">
<span>{error}</span>
@@ -87,10 +122,15 @@ export function SpaceChatPanel({
chatState={chatState}
pendingTool={pendingTool}
session={session}
onSubmit={(text) => submit(text, { mindspaceContext: context })}
onSubmit={(text) =>
chatBridge
? void submit(text, context)
: void submit(text, { mindspaceContext: context })
}
onStop={stop}
onApproveTool={approveTool}
onPageSaved={onPageSaved}
onClose={onClose}
/>
</div>
);