feat: chat uploads, vision turn isolation, and MindSpace agent improvements

Add chat file/image upload UX, attachment proxying, vision thumbnails, and per-turn image scoping so agents only use the current upload. Extend MindSpace asset context, billing token state, OA/scenario verify scripts, and related runtime config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-11 00:23:01 +08:00
parent e3063ea806
commit 32fb2cdeaf
51 changed files with 4588 additions and 186 deletions
+30
View File
@@ -296,3 +296,33 @@ test('buildSelectedAssetGreeting adapts wording to asset kind', () => {
/这份报告/,
);
});
test('buildMindSpaceChatContext reconciles stale category itemCount with loaded assets', () => {
const staleCategory = { ...sampleCategory, itemCount: 0 };
const asset = {
id: 'asset-1',
displayName: 'report.xlsx',
mimeType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
workspaceRelativePath: 'oa/report.xlsx',
};
const context = buildMindSpaceChatContext({
space: {
...sampleSpace,
categories: [{ ...sampleCategory, itemCount: 0 }],
},
selectedCategory: staleCategory,
selectedPageId: null,
pages: [],
assets: [asset],
selectedAssets: [asset],
route: '/space?category=oa',
h5ApiBase: 'http://127.0.0.1:8081',
agentSessionId: 'session-1',
});
assert.equal(context.category?.itemCount, 1);
const prefix = buildContextPrefix(context);
assert.match(prefix, /OA 工作区(oa,共 1 项)/);
assert.match(prefix, /已落盘 `oa\/report\.xlsx`/);
assert.match(prefix, /数据表汇总校验/);
});