Initial commit: Memind H5 portal with MindSpace, Plaza, and agent jobs.

Track application source and tests; exclude local env, user workspaces, and runtime data via .gitignore.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
John
2026-06-15 15:04:43 -07:00
commit 2e14873f2d
272 changed files with 64133 additions and 0 deletions
+181
View File
@@ -0,0 +1,181 @@
import type { MindSpace, MindSpaceAsset, MindSpacePage, PortalUser } from '../types';
export const PREVIEW_USER: PortalUser = {
id: 'preview-user',
username: 'preview',
slug: 'preview',
email: 'preview@tkmind.local',
displayName: '预览用户',
role: 'user',
status: 'active',
planType: 'free',
workspaceRoot: '/preview',
balanceCents: 1280,
totalCreditCents: 5000,
tokensUsed: 0,
};
export const PREVIEW_SPACE: MindSpace = {
id: 'preview-space',
userId: PREVIEW_USER.id,
name: '我的空间',
status: 'active',
quota: {
quotaBytes: 5 * 1024 * 1024,
usedBytes: 1.2 * 1024 * 1024,
reservedBytes: 0,
availableBytes: 3.8 * 1024 * 1024,
maxFileBytes: 2 * 1024 * 1024,
publicPageLimit: 3,
publicPageUsed: 1,
aiDailyLimit: 20,
aiDailyUsed: 6,
monthlyViewLimit: 1000,
monthlyViewUsed: 42,
},
categories: [
{
id: 'cat-oa',
code: 'oa',
name: 'OA 工作区',
visibilityPolicy: 'private',
aiAccessPolicy: 'allowed',
publishPolicy: 'review',
isSystem: true,
sortOrder: 1,
itemCount: 4,
},
{
id: 'cat-private',
code: 'private',
name: '私人区',
visibilityPolicy: 'private',
aiAccessPolicy: 'allowed',
publishPolicy: 'blocked',
isSystem: true,
sortOrder: 2,
itemCount: 2,
},
{
id: 'cat-public',
code: 'public',
name: '公开区',
visibilityPolicy: 'public',
aiAccessPolicy: 'allowed',
publishPolicy: 'allowed',
isSystem: true,
sortOrder: 3,
itemCount: 3,
},
{
id: 'cat-draft',
code: 'draft',
name: '页面草稿',
visibilityPolicy: 'private',
aiAccessPolicy: 'allowed',
publishPolicy: 'review',
isSystem: true,
sortOrder: 4,
itemCount: 2,
},
{
id: 'cat-archive',
code: 'archive',
name: '归档',
visibilityPolicy: 'private',
aiAccessPolicy: 'denied',
publishPolicy: 'blocked',
isSystem: true,
sortOrder: 5,
itemCount: 0,
},
],
createdAt: Date.now() - 86_400_000,
updatedAt: Date.now(),
};
export const PREVIEW_PAGES: MindSpacePage[] = [
{
id: 'page-1',
categoryId: 'cat-draft',
categoryCode: 'draft',
sourceSessionId: null,
sourceMessageId: null,
sourceAssetId: null,
title: '2026 市场趋势分析',
summary: '基于上传资料生成的分析报告草稿',
pageType: 'report',
templateId: 'report',
status: 'draft',
visibility: 'private',
currentVersionId: 'page-1-v2',
versionNo: 2,
contentFormat: 'markdown',
createdAt: Date.now() - 172_800_000,
updatedAt: Date.now() - 43_200_000,
},
{
id: 'page-2',
categoryId: 'cat-draft',
categoryCode: 'draft',
sourceSessionId: null,
sourceMessageId: null,
sourceAssetId: null,
title: '马来西亚旅游攻略',
summary: 'HTML 静态页预览示例',
pageType: 'html',
templateId: 'editorial',
status: 'ready',
visibility: 'private',
currentVersionId: 'page-2-v1',
versionNo: 1,
contentFormat: 'html',
createdAt: Date.now() - 259_200_000,
updatedAt: Date.now() - 86_400_000,
},
];
export const PREVIEW_ASSETS: Record<string, MindSpaceAsset[]> = {
oa: [
{
id: 'asset-1',
categoryId: 'cat-oa',
categoryCode: 'oa',
assetType: 'document',
mimeType: 'application/pdf',
filename: 'quarterly-report.pdf',
displayName: '季度经营报告.pdf',
sizeBytes: 482_112,
checksum: 'preview',
riskLevel: 'none',
visibility: 'private',
status: 'ready',
scanStatus: 'passed',
sourceType: 'upload',
createdAt: Date.now() - 604_800_000,
updatedAt: Date.now() - 604_800_000,
},
{
id: 'asset-2',
categoryId: 'cat-oa',
categoryCode: 'oa',
assetType: 'spreadsheet',
mimeType: 'text/csv',
filename: 'sales-data.csv',
displayName: '销售数据.csv',
sizeBytes: 28_672,
checksum: 'preview',
riskLevel: 'low',
visibility: 'private',
status: 'ready',
scanStatus: 'passed',
sourceType: 'upload',
createdAt: Date.now() - 302_400_000,
updatedAt: Date.now() - 302_400_000,
},
],
private: [],
public: [],
draft: [],
archive: [],
};