feat(mindspace): 公开页分享组件、workspace 路径与 Plaza 发布增强

- 新增 public share widget 与 workspace relative path 解析
- 增强 publications/chat-plaza 发布链路与缩略图 demo
- 补充 schema、cover 检查脚本与回归测试

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-05 23:14:41 +08:00
parent 69be1e5293
commit e2ad3bf62b
39 changed files with 2184 additions and 256 deletions
+38
View File
@@ -0,0 +1,38 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import {
resolveAssetWorkspaceRelativePath,
resolvePageWorkspaceRelativePath,
} from './mindspace-workspace-path.mjs';
test('resolvePageWorkspaceRelativePath normalizes html workspace paths', () => {
assert.equal(
resolvePageWorkspaceRelativePath({ relative_path: 'demo.html' }),
'public/demo.html',
);
assert.equal(resolvePageWorkspaceRelativePath({ relative_path: 'public/demo.html' }), 'public/demo.html');
assert.equal(resolvePageWorkspaceRelativePath(null), null);
});
test('resolveAssetWorkspaceRelativePath prefers explicit public image paths', () => {
assert.equal(
resolveAssetWorkspaceRelativePath({
explicitPath: 'public/images/2026-07-05/hero.png',
}),
'public/images/2026-07-05/hero.png',
);
assert.equal(
resolveAssetWorkspaceRelativePath({
categoryCode: 'public',
originalFilename: 'report.docx',
}),
'public/report.docx',
);
assert.equal(
resolveAssetWorkspaceRelativePath({
categoryCode: 'draft',
originalFilename: 'notes.md',
}),
null,
);
});