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:
@@ -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, /数据表汇总校验/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user