feat(memory): release Mnemo project bridge and schema2 recovery
Official contracts and Windows source CI / windows-source (push) Has been cancelled

This commit is contained in:
Agent Workbench Dev
2026-11-11 03:03:43 +08:00
parent f7705d9634
commit e306f40cae
76 changed files with 10475 additions and 127 deletions
+65
View File
@@ -0,0 +1,65 @@
import { useEffect, useState } from 'react';
import type { FormEvent } from 'react';
import type { ProjectMemory } from './types';
import { api } from './api';
type Review = Pick<ProjectMemory, 'id' | 'title' | 'content' | 'source' | 'sourceFingerprint' | 'expiresAt' | 'experience'>;
type Source = { memoryId: string; title: string; state: string; sequence: number; version: string | null; review: Review; confirmationDigest: string; syncStatus: string;
requestKey: string | null; confirmation: { by: string; at: string } | null; receipt: { receiptId: string; currentState: string } | null; issue: { message: string } | null };
type View = { producerId: string; projectId: string; connection: { enabled: boolean; baseUrl: string; bindingId: string; revision: number; hasToken: boolean; selectionLimit: number }; sources: Source[]; rule: string };
const states: Record<string, string> = { not_shared: '未共享', current: '已确认', candidate: '候选 · 未确认', unverified: '需重新核对', expired: '已到期', archived: '已归档', withdrawn: '已撤回', deleted: '永久删除' };
const syncStates: Record<string, string> = { prepared: '待核对原键', unknown: '同步结果未知', committed: '已收到提交回执', rejected: '服务未接受', not_sent: '未发送' };
export function MnemoBridgePanel({ projectId, memories }: { projectId: string; memories: ProjectMemory[] }) {
const [view, setView] = useState<View | null>(null), [error, setError] = useState(''), [notice, setNotice] = useState(''), [busy, setBusy] = useState(false);
const [draft, setDraft] = useState({ baseUrl: '', bindingId: '', token: '', enabled: false, selectionLimit: 50 });
const [selected, setSelected] = useState(''), [confirmed, setConfirmed] = useState(false);
const route = '/projects/' + projectId + '/memory-bridge';
const accept = (value: View) => { setView(value); setDraft({ baseUrl: value.connection.baseUrl, bindingId: value.connection.bindingId, token: '', enabled: value.connection.enabled, selectionLimit: value.connection.selectionLimit }); };
useEffect(() => { let alive = true; setView(null); setSelected(''); setConfirmed(false); setError('');
api<View>(route).then(value => { if (alive) accept(value); }).catch(cause => { if (alive) setError(cause.message); }); return () => { alive = false; };
}, [route, memories]);
const perform = async (path: string, input: unknown, message: string) => {
setBusy(true); setError(''); setNotice('');
try { const value = await api<View>(route + path, input); accept(value); setNotice(message); setConfirmed(false); }
catch (cause) { setError(cause instanceof Error ? cause.message : '操作未完成,请核对原回执。'); }
finally { setBusy(false); }
};
const save = (event: FormEvent) => { event.preventDefault(); if (!view) return;
void perform('/configure', { enabled: draft.enabled, expectedRevision: view.connection.revision, selectionLimit: draft.selectionLimit,
...(draft.baseUrl ? { baseUrl: draft.baseUrl } : {}), ...(draft.bindingId ? { bindingId: draft.bindingId } : {}), ...(draft.token ? { token: draft.token } : {}) }, '设置已保存;只会共享逐条确认的来源。');
};
// The review and digest come from one server snapshot. A separately loaded
// local-memory list can be older and must never supply the confirmed text.
const source = view?.sources.find(row => row.memoryId === selected), memory = source?.review;
return <section className="mnemo-bridge" aria-label="Mnemo 项目记忆桥">
<details><summary>Mnemo 项目记忆桥 <span>{view?.connection.enabled ? view.connection.hasToken ? '本次已连接' : '需重新授权' : '默认关闭'}</span></summary>
<p>让本项目已确认的记忆通过 Mnemo 用于后续请求。仅共享选中的完整修订;候选不会进入模型请求。</p>
{error && <p className="memory-error" role="alert">{error}</p>}{notice && <p className="memory-notice" role="status">{notice}</p>}
{view && <><p className="mnemo-identity">生产者 <code>{view.producerId}</code><br />项目 <code>{view.projectId}</code></p>
<form onSubmit={save}><div className="memory-form-grid">
<label>Mnemo 根地址<input type="url" value={draft.baseUrl} onChange={e => setDraft({ ...draft, baseUrl: e.target.value })} placeholder="https://memory.example.com" autoComplete="off" /></label>
<label>项目绑定 ID<input value={draft.bindingId} onChange={e => setDraft({ ...draft, bindingId: e.target.value })} autoComplete="off" /></label>
<label>每次选入的桥记忆条数<input type="number" min={1} max={50} value={draft.selectionLimit} onChange={e => setDraft({ ...draft, selectionLimit: Number(e.target.value) })} /><small>仅用于可选桥;不改变模型额度和本地全文。</small></label>
<label className="memory-full">本次项目凭据<input type="password" value={draft.token} onChange={e => setDraft({ ...draft, token: e.target.value })} autoComplete="new-password" placeholder={view.connection.hasToken ? '当前宿主已有凭据;留空保持' : '填写新授权返回的项目凭据'} /></label>
</div><div className="memory-editor-footer"><label><input type="checkbox" checked={draft.enabled} onChange={e => setDraft({ ...draft, enabled: e.target.checked })} /> 启用本项目记忆桥</label><button className="button secondary" disabled={busy}>保存连接</button></div></form>
<p className="experience-hint">凭据只留在本次宿主内存中;重启或恢复后需重新授权。连接失败不改变模型额度、历史或工程权限。</p>
<div className="mnemo-sources">{view.sources.map(row => <button type="button" key={row.memoryId} className={'mnemo-source' + (selected === row.memoryId ? ' is-selected' : '')} onClick={() => { setSelected(row.memoryId); setConfirmed(false); }}>
<strong>{row.title}</strong><span>{states[row.state] ?? row.state} · 修订 {row.sequence} · {syncStates[row.syncStatus] ?? row.syncStatus}</span></button>)}</div>
{source && memory && <div className="mnemo-review" aria-label="核对完整来源修订"><h4>{source.title}</h4><p className="memory-content">{memory.content}</p>
<p className="experience-hint">来源 <code>{source.memoryId}</code> · 工程 <code>{memory.sourceFingerprint}</code></p>
<p>来源:{memory.source.path || memory.source.label || memory.source.kind} · 到期:{memory.expiresAt ? new Date(memory.expiresAt).toLocaleString('zh-CN') : '未设置'}</p>
<details><summary>查看完整来源修订与摘要</summary><p>修订摘要 <code>{source.confirmationDigest}</code></p><pre>{JSON.stringify(memory, null, 2)}</pre></details>
{source.confirmation && <p>确认时间:{new Date(source.confirmation.at).toLocaleString('zh-CN')}</p>}
{source.issue && <p className="memory-error" role="alert">{source.issue.message}</p>}
{source.requestKey && <details><summary>原同步回执</summary><code>{source.requestKey}</code><p>{syncStates[source.syncStatus] ?? source.syncStatus} · {source.receipt?.currentState ?? '当前状态未知'}</p></details>}
<label className="mnemo-confirm"><input type="checkbox" checked={confirmed} onChange={e => setConfirmed(e.target.checked)} /> 我已核对以上完整来源修订</label>
<div className="experience-actions">{(['candidate', 'confirm', 'withdraw', 'delete'] as const).map(action => <button type="button" className={action === 'confirm' ? 'button primary' : 'button secondary'} key={action}
disabled={busy || !confirmed || !view.connection.hasToken || source.state === 'deleted'} onClick={() => void perform('/sources/' + source.memoryId,
{ action, confirmed: true, expectedDigest: source.confirmationDigest }, '操作已记录,请查看该来源的提交回执。')}>{({ candidate: '提交候选', confirm: '确认并共享', withdraw: '撤回共享', delete: '永久删除桥来源' })[action]}</button>)}
{source.requestKey && <button type="button" className="text-button" disabled={busy || !view.connection.hasToken} onClick={() => void perform('/lookup', { memoryId: source.memoryId }, '已核对原键;未重送同步或模型请求。')}>查询原键</button>}</div>
<p className="experience-hint">永久删除后,该来源不能通过续期或恢复重新共享。本地原记忆与旧请求工件保留。</p>
</div>}</>}
</details>
</section>;
}
+18
View File
@@ -0,0 +1,18 @@
import type { ContextPlan } from './types';
export type MnemoReceipt = Pick<ContextPlan, 'id' | 'runId' | 'mnemoRecallArtifactId' | 'mnemoMemoryArtifactId' | 'mnemoRecallContextDigest' | 'mnemoSelectedContextDigest' | 'mnemoSelectedRefs' | 'mnemoIssue' | 'mnemoDispatches'>;
const status: Record<string, string> = { not_dispatched: '未发送远端记忆', validated_not_submitted: '已核对,尚未提交', submitted_unconfirmed: '已提交,响应待核对', response_received: '已收到响应', unknown: '结果未知', failed: '请求失败' };
export function MnemoPlanReceipt({ plan, onOpenArtifact }: { plan: MnemoReceipt; onOpenArtifact?: (id: string) => void }) {
if (!plan.mnemoRecallArtifactId && !plan.mnemoIssue) return null;
return <details className="mnemo-plan-receipt"><summary>Mnemo 记忆来源 · {plan.mnemoSelectedRefs?.length ?? 0} 条选入</summary>
<p>Run <code>{plan.runId}</code><br />请求计划 <code>{plan.id}</code></p>
{plan.mnemoIssue && <p role="status">{plan.mnemoIssue.message}</p>}
<p>召回摘要 <code>{plan.mnemoRecallContextDigest ?? '无召回'}</code><br />选入摘要 <code>{plan.mnemoSelectedContextDigest ?? '无选入'}</code></p>
{plan.mnemoSelectedRefs?.map(ref => <p key={ref.sourceId}><code>{ref.sourceId}</code> · 来源序号 {ref.sequence} · 远端修订 {ref.revision}</p>)}
{plan.mnemoDispatches?.map(attempt => <div key={attempt.wireAttemptId}><p>{status[attempt.status] ?? attempt.status} · <code>{attempt.wireAttemptId}</code></p>
{attempt.issue && <p>{attempt.issue.message}</p>}{attempt.wireRequestSha256 && <p>实际发送 SHA <code>{attempt.wireRequestSha256}</code></p>}
{onOpenArtifact && <button type="button" className="text-button" onClick={() => onOpenArtifact(attempt.validationArtifactId)}>查看本次发送前核对</button>}</div>)}
{!!onOpenArtifact && plan.mnemoRecallArtifactId && <button type="button" className="text-button" onClick={() => onOpenArtifact(plan.mnemoRecallArtifactId!)}>查看完整召回回执</button>}
{!!onOpenArtifact && plan.mnemoMemoryArtifactId && <button type="button" className="text-button" onClick={() => onOpenArtifact(plan.mnemoMemoryArtifactId!)}>查看整条选入记忆</button>}
<p>核对仅证明当时时刻匹配,不授予执行权限。跨系统校验与模型发送不保证原子性。</p>
</details>;
}
+2
View File
@@ -1,6 +1,7 @@
.project-memory{display:flex;flex-direction:column;min-height:0;background:#f8fafc;color:#15283f;padding:24px 28px;overflow:auto}.memory-overview{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding-bottom:18px;border-bottom:1px solid #cbd5df}.memory-eyebrow{display:flex;align-items:center;gap:7px;color:#2560a3;letter-spacing:.13em;font-size:10px;font-weight:700}.memory-overview h3{font-size:22px;margin:8px 0 5px}.memory-overview p{color:#5b6d83;font-size:12px;line-height:1.8}.memory-summary{display:flex;gap:16px;flex-wrap:wrap;padding:13px 0;color:#5d7088;font-size:12px}.memory-summary strong{color:#15283f;font-size:16px;margin-right:4px}.memory-summary code{color:#33577f}.memory-list{display:grid;gap:11px}.memory-card{padding:17px 18px;background:#fff;border:1px solid #cbd6e2;border-left:3px solid #2f806e;border-radius:6px}.memory-card.memory-expired{border-left-color:#b4772b;background:#fffaf0}.memory-card.memory-archived{border-left-color:#8b9aaa;background:#f4f7fa;opacity:.82}.memory-card-heading{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.memory-card-heading h4{font-size:14px;flex:1;min-width:130px}.memory-card-heading time{font-size:11px;color:#74859a}.memory-state{padding:3px 7px;border:1px solid #b9d9cb;border-radius:4px;color:#216d5f;background:#e6f3ee;font-size:10px;font-weight:650}.memory-expired .memory-state{color:#8b5c12;background:#fff4d9;border-color:#e6d09d}.memory-archived .memory-state{color:#67788d;background:#e9eef3;border-color:#d1dbe4}.memory-content{font-size:13px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere;margin-top:11px;color:#233b55}.memory-meta{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:12px;color:#6a7d92;font-size:11px}.memory-meta code{font-size:10px;color:#7b8ca1}.memory-tag{padding:3px 6px;background:#edf3f8;color:#4e6884;border-radius:3px}.memory-warning{display:flex;align-items:flex-start;gap:6px;color:#8b5c12;font-size:11px;line-height:1.7;margin-top:11px}.memory-card>.text-button{padding:8px 0;margin-top:8px}.memory-notice,.memory-error{display:flex;gap:7px;align-items:flex-start;padding:11px 13px;margin:15px 0 0;border-radius:5px;font-size:12px;line-height:1.7}.memory-notice{color:#216d5f;background:#e6f3ee;border:1px solid #b9d9cb}.memory-error{color:#a7353e;background:#fff0f0;border:1px solid #e8bac0}.memory-empty{display:grid;place-items:center;padding:38px 20px;margin:7px 0 17px;background:#fff;border:1px dashed #b5c6d7;border-radius:7px;color:#61738a;text-align:center}.memory-empty svg{color:#6c87a5;margin-bottom:10px}.memory-empty strong{color:#314b68;font-size:14px}.memory-empty p{font-size:12px;line-height:1.8;margin-top:7px;max-width:480px}.memory-editor{padding:19px 20px;margin-top:18px;border:1px solid #b2c6da;border-top:3px solid #2560a3;border-radius:7px;background:#fff}.memory-editor-heading{display:flex;align-items:flex-start;justify-content:space-between;color:#2560a3}.memory-editor-heading h4{font-size:15px;color:#15283f}.memory-editor-heading p{font-size:11px;color:#687a90;margin-top:5px;line-height:1.7}.memory-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px}.memory-form-grid label{display:flex;flex-direction:column;gap:7px;color:#4e637d;font-size:11px}.memory-form-grid input,.memory-form-grid textarea{border:1px solid #b9c8d6;border-radius:5px;padding:9px 10px;min-height:38px;font:inherit;color:#15283f;resize:vertical}.memory-form-grid input:focus,.memory-form-grid textarea:focus{outline:2px solid #2560a333;border-color:#2560a3}.memory-full{grid-column:1/-1}.memory-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;margin-top:14px}.memory-editor-footer>span{display:flex;align-items:center;gap:6px;color:#67798e;font-size:11px}.memory-editor-footer svg{color:#2f806e}.project-memory button{min-height:36px}
@media(max-width:620px){.project-memory{padding:18px 15px}.memory-overview{flex-direction:column}.memory-form-grid{grid-template-columns:1fr}.memory-full{grid-column:auto}.memory-editor{padding:17px 14px}.memory-card{padding:15px 13px}.memory-card-heading time{width:100%}}
.memory-unverified .memory-state{color:#8a5b16;background:#fff7df;border-color:#ead39a}.memory-scope-warning{margin:14px 0;padding:12px 14px;line-height:1.7}
.mnemo-bridge{padding:16px 0;margin-bottom:14px;border-bottom:1px solid var(--orven-border,#cbd6e2);font-size:12px;line-height:1.8}.mnemo-bridge summary{cursor:pointer;min-height:40px;font-weight:600}.mnemo-bridge summary>span{margin-left:12px;font-weight:400;color:var(--orven-muted,#5b6d83)}.mnemo-bridge code,.mnemo-plan-receipt code{overflow-wrap:anywhere;font-size:11px}.mnemo-identity{margin:10px 0;color:var(--orven-muted,#5b6d83)}.mnemo-sources{margin-top:18px;border-top:1px solid var(--orven-border,#cbd6e2)}.mnemo-source{display:flex;flex-direction:column;width:100%;text-align:left;gap:4px;padding:12px 10px;border:0;border-bottom:1px solid var(--orven-border,#cbd6e2);background:transparent;color:inherit}.mnemo-source>span{font-size:11px;color:var(--orven-muted,#5b6d83)}.mnemo-source.is-selected{background:var(--orven-surface-faint,#edf3f8);box-shadow:inset 3px 0 var(--accent,#456652)}.mnemo-review{padding:16px 10px}.mnemo-confirm{display:flex;align-items:center;gap:8px;margin-top:16px;min-height:44px}.mnemo-review .memory-content{max-height:360px;overflow:auto}.mnemo-plan-receipt{flex-basis:100%;min-width:0;max-width:100%;padding:12px 0;font-size:12px;line-height:1.8}.mnemo-plan-receipt summary{min-height:40px;cursor:pointer}.mnemo-plan-receipt p{overflow-wrap:anywhere}
.experience-source{padding:18px 0 22px;margin-bottom:18px;border-bottom:1px solid var(--orven-border,#cbd6e2)}
.experience-source h4{font-size:14px;font-weight:600;color:var(--orven-ink,#15283f)}
.experience-source p,.experience-boundary{font-size:12px;line-height:1.8;color:var(--orven-text,#4e637d)}
@@ -31,3 +32,4 @@
.experience-counterexamples{border-left:2px solid var(--orven-border-strong,#b9c8d6);padding-left:12px;font-size:12px;line-height:1.8;margin-top:14px}
.experience-counterexamples small{display:block;color:var(--orven-muted,#5b6d83)}
@media(max-width:620px){.experience-source-picker{align-items:stretch;flex-direction:column}.experience-source-picker .button{justify-content:center}.experience-provenance li{align-items:flex-start;flex-wrap:wrap}.experience-scope>div,.experience-provenance dl>div{grid-template-columns:1fr;gap:2px}.experience-actions{gap:10px}.experience-actions .button,.experience-actions .text-button{min-height:40px}}
.mnemo-review pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:360px;overflow:auto;font:11px/1.8 var(--font-mono,monospace);padding:10px;background:var(--orven-surface-faint,#edf3f8)}
+2
View File
@@ -4,6 +4,7 @@ import { Archive, Brain, CircleHelp, LoaderCircle, Plus, RefreshCw, ShieldCheck
import type { ExperienceSourceView, Project, ProjectMemory, ProjectMemoryView, Session } from './types';
import { api } from './api';
import { ExperienceDraftControls } from './ExperienceDraftControls';
import { MnemoBridgePanel } from './MnemoBridgePanel';
import './ProjectMemory.css';
const statusLabel: Record<string, string> = { current: '当前', unverified: '扫描不完整', expired: '已过期', archived: '已归档' };
@@ -64,6 +65,7 @@ export function ProjectMemoryPanel({ project, session, onSelectSession }: { proj
{notice && <p className="memory-notice" role="status"><ShieldCheck size={14} />{notice}</p>}
{error && <p className="memory-error" role="alert">{error}</p>}
{view && <div className="memory-summary"><span><strong>{view.summary.current}</strong> 条当前可用</span><span><strong>{view.summary.drafts ?? 0}</strong> 条经验草稿</span>{(view.summary.unverified ?? 0) > 0 && <span><strong>{view.summary.unverified}</strong> 条未能验证</span>}<span><strong>{view.summary.expired}</strong> 条需重新核对</span><span>源码 <code>{view.sourceFingerprint.slice(0, 12)}</code></span></div>}
{view && <MnemoBridgePanel key={project.id} projectId={project.id} memories={memories} />}
<section className="experience-source" aria-label="从工程证据生成草稿"><div><h4>从工程证据生成草稿</h4><p>选择当前会话已有的交付报告、检查或工具结果。保留原失败和未知结果,不调用模型。</p></div>
{sourceError && <p className="memory-error" role="alert">{sourceError}</p>}
<div className="experience-source-picker"><label>经验来源<select aria-label="经验来源" value={sourceId} onChange={event => setSourceId(event.target.value)} disabled={loading || working || !sources}><option value="">选择已有来源…</option>{sources?.sources.map(source => <option key={source.kind + ':' + source.id} value={source.kind + ':' + source.id}>{source.label} · {source.id.slice(0, 8)}</option>)}</select></label><button type="button" className="button secondary" disabled={working || loading || !sourceId || !sources} onClick={() => void createExperience()}><Plus size={14} />生成经验草稿</button></div>
+2
View File
@@ -4,6 +4,7 @@ import { api } from './api';
import { Modal } from './components';
import { ModelUsageDetails } from './ModelUsageDetails';
import type { ContextHistory, ContextHistoryGroup, ContextPlan, Session } from './types';
import { MnemoPlanReceipt } from './MnemoPlanReceipt';
import { ModelRequestDetails } from './ModelRequestDetails';
import { ModelProviderStateDetails } from './ModelProviderStateDetails';
@@ -74,6 +75,7 @@ export function RequestContextPanel({ session, runId, openArtifact, onError }: {
{plan.workingSetArtifactId && <button type="button" className="text-button" onClick={() => openArtifact(plan.workingSetArtifactId!)}><BrainCircuit size={13} />查看工作依据</button>}
{plan.latestToolsArtifactId && <button type="button" className="text-button" onClick={() => openArtifact(plan.latestToolsArtifactId!)}><FileText size={13} />查看最近工具反馈</button>}
{plan.projectMemoryArtifactId && <button type="button" className="text-button" onClick={() => openArtifact(plan.projectMemoryArtifactId!)}><BrainCircuit size={13} />查看本次项目记忆</button>}
<MnemoPlanReceipt plan={plan} onOpenArtifact={openArtifact} />
{plan.skillCatalogArtifactId && <button type="button" className="text-button" onClick={() => openArtifact(plan.skillCatalogArtifactId!)}><FileText size={13} />查看本次技能目录</button>}
{!!plan.archivedGroups && <button type="button" className="text-button" onClick={() => setHistoryId(plan.id)}><Archive size={13} />检索完整历史</button>}</div>
{historyId && <HistoryModal key={session.id + ':' + historyId} sessionId={session.id} planId={historyId} onError={onError}
+1
View File
@@ -12,6 +12,7 @@ export interface CompanionStatus {
export interface MobileBrief { id: string; projectId: string; taskId?: string; runId?: string; title: string; status: string; revision: number; eventSeq: number; updatedAt: string }
export interface MobileUsage { totalTokens: number; unknownRequests: number; estimatedUnknownTokens: number }
export interface MobileTask extends MobileBrief {
memoryReceipts?: import('./MnemoPlanReceipt').MnemoReceipt[];
browserObservations?:{id:string;tabId:string;url:string;title:string;createdAt:string;revision:string;scope:{complete:boolean};screenshotSha256:string}[];
inputAttachments?: import('./types').InputAttachment[];
budgetPause?: import('./types').BudgetPause|null;
+2
View File
@@ -7,6 +7,7 @@ import { useRecordPages } from '../useRecordPages';
import type { RecordPage } from '../types';
import { mobileApi, MobileError, verifiedText, verifyDigest } from './api';
import { MobileInputImage } from './MobileInputImage';
import { MnemoPlanReceipt } from '../MnemoPlanReceipt';
import './file-results.css';
import { BRAND, OrvenMark } from '../brand';
import { AppearancePanel } from '../AppearancePanel';
@@ -133,6 +134,7 @@ export function MobileApp({ initialToken }: { initialToken: string }) {
<div className="mobile-task-title"><span className="mobile-eyebrow">{projectName(selectedTask.projectId)}</span><h1>{selectedTask.title}</h1><div><span className={'mobile-state state-' + selectedTask.status}>{stateLabel(selectedTask.status)}</span><span>修订 {selectedTask.revision}</span></div><details className="mobile-goal"><summary>完整任务目标</summary><p>{selectedTask.task?.goal ?? '此会话尚未创建执行任务。'}</p></details><details><summary>原任务与运行</summary><code>Task {selectedTask.taskId ?? '未开始'}<br />Run {selectedTask.runId ?? '未开始'}</code></details></div>
{receipt && <p className="mobile-receipt" role="status">{receipt}</p>}
{selectedTask.inputAttachments?.map(image=><MobileInputImage key={image.id} sessionId={selectedTask.id} image={image} onError={cause=>{if(cause instanceof MobileError&&[401,403].includes(cause.status))revoke(cause.message);else setError(cause instanceof Error?cause.message:'截图读取失败。');}}/>)}
{selectedTask.memoryReceipts?.map(plan => <MnemoPlanReceipt key={plan.id} plan={plan} />)}
{selectedTask.budgetPause&&<aside className="mobile-unknown"><strong>原任务因预算暂停</strong><p>必需输入 {selectedTask.budgetPause.requiredInputTokens?.toLocaleString()??'旧记录未分解'};可用输入 {selectedTask.budgetPause.inputBudget?.toLocaleString()??'未记录'} tokens。请在电脑核对预算并预览续接,原工具结果保留。</p></aside>}
{!!selectedTask.progress.unknown.length && <div className="mobile-unknown"><strong>{selectedTask.progress.unknown.length} 项工具结果需要核对</strong><p>请在电脑核对原输入和实际结果。刷新、重连和手机审批均不会自动重新执行。</p>{selectedTask.progress.unknown.map(item => <code key={item.id}>{item.tool} · {stateLabel(item.state)}</code>)}</div>}
{selectedTask.browserObservations?.slice(-1).map(observation=><MobileBrowserObservation key={observation.id} sessionId={selectedTask.id} observation={observation} onError={cause=>{if(cause instanceof MobileError&&[401,403].includes(cause.status))revoke(cause.message);else setError(cause instanceof Error?cause.message:'原网页截图读取失败。');}}/>)}
+1
View File
@@ -4,3 +4,4 @@
.mobile-file-results p { margin: 8px 0; }
.mobile-file-results code { font-size: 11px; overflow-wrap: anywhere; word-break: break-word; }
.mobile-file-results details summary { min-height: 42px; display: flex; align-items: center; cursor: pointer; }
.mnemo-plan-receipt{font-size:13px;line-height:1.8;max-width:100%;min-width:0;padding:12px 0;border-bottom:1px solid var(--orven-border,#cbd6e2)}.mnemo-plan-receipt summary{cursor:pointer;min-height:44px;font-weight:600}.mnemo-plan-receipt code,.mnemo-plan-receipt p{overflow-wrap:anywhere;font-size:12px}
+4
View File
@@ -202,6 +202,10 @@ export interface ContextPlan {
workingSetViewVersion?: number; workingRetentionTokens?: number;
latestToolsArtifactId?: string | null; latestToolsSha256?: string | null; latestToolsEntries?: number;
projectMemoryArtifactId?: string | null; projectMemorySha256?: string | null; projectMemoryEntries?: number;
mnemoRecallArtifactId?: string | null; mnemoMemoryArtifactId?: string | null; mnemoRecallContextDigest?: string | null; mnemoSelectedContextDigest?: string;
mnemoSelectedRefs?: { sourceId: string; sequence: number; sourceDigest: string; memoryId: string; revision: number }[];
mnemoIssue?: { code: string; message: string } | null;
mnemoDispatches?: { wireAttemptId: string; validationArtifactId: string; validationSha256: string; status: string; wireRequestSha256?: string; modelAttemptId?: string; issue: { code: string; message: string } | null }[];
skillCatalogArtifactId?: string | null; skillCatalogSha256?: string | null; skillCatalogEntries?: number;
actualUsage: TokenUsage | null; requestAttempts: number; error?: string;
historyPolicy?: 'preserve' | 'compact'; contextLayout?: string;