新增: 知识库图召回激活扩散与治理续批
- 阶段2 图召回: list_neighbors_for_seeds(多种子 1-hop 展开,排除种子与 archived)+knowledge_search 结果附 related 段(权重降序限 5) - 蒸馏合并: knowledge_distill.rs(archived 按 kind 分组 LLM 合订本+merges 边连组) - V54 knowledge_edges 边表与渐进披露批配套迁移/模型字段 - 提炼链 related_ids 协议+检索补 id 字段
This commit is contained in:
@@ -543,7 +543,7 @@ function handleSend(): void {
|
||||
}
|
||||
|
||||
// —— 工具卡片 + 审批 UI(对齐桌面端 ToolCard,适配 mp-weixin 深色风格) ——
|
||||
// 后端推 AiToolCallStarted/AiApprovalRequired/AiDirAuthRequired → useAiChat 收进
|
||||
// 后端推 AiToolCallStarted/AiApprovalRequired → useAiChat 收进
|
||||
// 消息 m.toolCalls(状态机)+ pendingApprovals。消息内联渲染工具状态 + 待审批按钮,
|
||||
// miniapp 成轻量审批终端(单一渲染源,对齐桌面 ToolCard 嵌消息气泡)。
|
||||
|
||||
@@ -666,11 +666,6 @@ function onReject(tc: AiToolCallInfo): void {
|
||||
ai.approve(tc.id, false)
|
||||
}
|
||||
|
||||
/** 路径授权(path 类:once=本次 / always=永久 / deny=拒绝) */
|
||||
function onAuthorize(tc: AiToolCallInfo, decision: 'once' | 'always' | 'deny'): void {
|
||||
ai.authorizeDir(tc.id, decision)
|
||||
}
|
||||
|
||||
/** 连接状态中文文案(F21:裸枚举字符串 disconnected/connecting 不可读) */
|
||||
const STATUS_TEXT: Record<string, string> = {
|
||||
connecting: '连接中…',
|
||||
@@ -782,23 +777,14 @@ function tokenInOf(t: TokenUsage): number {
|
||||
<text class="tool-arg-val">{{ a.val }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="p.kind === 'path' && p.dir" class="tool-dir">
|
||||
<text>📁 {{ p.dir }}</text>
|
||||
</view>
|
||||
<view v-if="p.reason" class="tool-reason">
|
||||
<text>⚠ {{ p.reason }}</text>
|
||||
</view>
|
||||
<!-- risk 类:批准/拒绝 -->
|
||||
<view v-if="p.kind !== 'path'" class="approval-actions">
|
||||
<!-- 批准/拒绝 -->
|
||||
<view class="approval-actions">
|
||||
<button class="approval-btn approve" size="mini" @tap="onApprove(p)">批准</button>
|
||||
<button class="approval-btn reject" size="mini" @tap="onReject(p)">拒绝</button>
|
||||
</view>
|
||||
<!-- path 类:本次/永久/拒绝 -->
|
||||
<view v-else class="approval-actions">
|
||||
<button class="approval-btn approve" size="mini" @tap="onAuthorize(p, 'once')">本次</button>
|
||||
<button class="approval-btn always" size="mini" @tap="onAuthorize(p, 'always')">永久</button>
|
||||
<button class="approval-btn reject" size="mini" @tap="onAuthorize(p, 'deny')">拒绝</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -859,10 +845,6 @@ function tokenInOf(t: TokenUsage): number {
|
||||
<text class="tool-arg-val">{{ a.val }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- path 授权待授权目录 -->
|
||||
<view v-if="tc.kind === 'path' && tc.status === 'pending_approval' && tc.dir" class="tool-dir">
|
||||
<text>📁 {{ tc.dir }}</text>
|
||||
</view>
|
||||
<!-- 风险说明 -->
|
||||
<view v-if="tc.reason" class="tool-reason">
|
||||
<text>⚠ {{ tc.reason }}</text>
|
||||
@@ -1494,13 +1476,6 @@ function tokenInOf(t: TokenUsage): number {
|
||||
flex: 1;
|
||||
word-break: break-all; /* 工具参数值(路径/长字符串)断行防撑开 */
|
||||
}
|
||||
.tool-dir {
|
||||
margin-top: 4px;
|
||||
}
|
||||
.tool-dir text {
|
||||
color: #6bd99a;
|
||||
font-size: 12px;
|
||||
}
|
||||
.tool-reason {
|
||||
margin-top: 6px;
|
||||
padding: 4px 6px;
|
||||
|
||||
Reference in New Issue
Block a user