@allbluecn/shared 0.3.13 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config-CcbSbJoC.js +6344 -0
- package/dist/constants/perf.d.ts +6 -0
- package/dist/constants/perf.js +6 -0
- package/dist/constants-C3hGP_ru.d.ts +33 -0
- package/dist/i18n/client.d.ts +5 -0
- package/dist/i18n/client.js +34 -0
- package/dist/i18n/config.d.ts +6270 -0
- package/dist/i18n/config.js +2 -0
- package/dist/i18n/detect.d.ts +5 -0
- package/dist/i18n/detect.js +35 -0
- package/dist/i18n/server.d.ts +6 -0
- package/dist/i18n/server.js +19 -0
- package/dist/i18n/types.d.ts +3 -0
- package/dist/i18n/types.js +0 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +14 -0
- package/dist/infrastructure/ai/adapter.d.ts +8 -0
- package/dist/infrastructure/ai/adapter.js +32 -0
- package/dist/infrastructure/ai/cli-detector.d.ts +6 -0
- package/dist/infrastructure/ai/cli-detector.js +121 -0
- package/dist/infrastructure/ip-location.d.ts +9 -0
- package/dist/infrastructure/ip-location.js +48 -0
- package/dist/infrastructure/references/engine.d.ts +7 -0
- package/dist/infrastructure/references/engine.js +64 -0
- package/dist/infrastructure/ua-parser.d.ts +20 -0
- package/dist/infrastructure/ua-parser.js +69 -0
- package/dist/interfaces/ai.d.ts +27 -0
- package/dist/interfaces/ai.js +0 -0
- package/dist/interfaces/avatar.d.ts +6 -0
- package/dist/interfaces/avatar.js +0 -0
- package/dist/interfaces/module.d.ts +45 -0
- package/dist/interfaces/module.js +0 -0
- package/dist/interfaces/references.d.ts +27 -0
- package/dist/interfaces/references.js +0 -0
- package/dist/interfaces/transport.d.ts +11 -0
- package/dist/interfaces/transport.js +0 -0
- package/dist/lib/annotation-template.d.ts +9 -0
- package/dist/lib/annotation-template.js +14 -0
- package/dist/lib/comment-utils.d.ts +7 -0
- package/dist/lib/comment-utils.js +27 -0
- package/dist/lib/datetime.d.ts +25 -0
- package/dist/lib/datetime.js +73 -0
- package/dist/lib/desktop-detect.d.ts +13 -0
- package/dist/lib/desktop-detect.js +23 -0
- package/dist/lib/outline-utils.d.ts +6 -0
- package/dist/lib/outline-utils.js +46 -0
- package/dist/lib/pacer.d.ts +45 -0
- package/dist/lib/pacer.js +70 -0
- package/dist/lib/prd/stack-layout.d.ts +18 -0
- package/dist/lib/prd/stack-layout.js +24 -0
- package/dist/lib/prd-tree-utils.d.ts +21 -0
- package/dist/lib/prd-tree-utils.js +62 -0
- package/dist/lib/prototype-registry.d.ts +2 -0
- package/dist/lib/prototype-registry.js +2 -0
- package/dist/lib/query-client-seam.d.ts +6 -0
- package/dist/lib/query-client-seam.js +11 -0
- package/dist/lib/share-events.d.ts +7 -0
- package/dist/lib/share-events.js +47 -0
- package/dist/lib/sidebar-utils.d.ts +4 -0
- package/dist/lib/sidebar-utils.js +7 -0
- package/dist/lib/stores/prd-canvas-store.d.ts +16 -0
- package/dist/lib/stores/prd-canvas-store.js +42 -0
- package/dist/lib/tag-colors.d.ts +12 -0
- package/dist/lib/tag-colors.js +74 -0
- package/dist/lib/time-format.d.ts +4 -0
- package/dist/lib/time-format.js +20 -0
- package/dist/modules/ai-providers/constants.d.ts +2 -0
- package/dist/modules/ai-providers/constants.js +125 -0
- package/dist/modules/ai-providers/index.d.ts +4 -0
- package/dist/modules/ai-providers/index.js +4 -0
- package/dist/modules/ai-providers/seed-data.d.ts +2 -0
- package/dist/modules/ai-providers/seed-data.js +408 -0
- package/dist/modules/ai-providers/types.d.ts +2 -0
- package/dist/modules/ai-providers/types.js +10 -0
- package/dist/modules/billing/feature-registry.d.ts +72 -0
- package/dist/modules/billing/feature-registry.js +67 -0
- package/dist/modules/billing/plan-features-schema.d.ts +6 -0
- package/dist/modules/billing/plan-features-schema.js +6 -0
- package/dist/modules/billing/resource-registry.d.ts +59 -0
- package/dist/modules/billing/resource-registry.js +47 -0
- package/dist/modules/definitions/plugin.module.d.ts +5 -0
- package/dist/modules/definitions/plugin.module.js +24 -0
- package/dist/modules/definitions/prd.module.d.ts +5 -0
- package/dist/modules/definitions/prd.module.js +26 -0
- package/dist/modules/definitions/prototype.module.d.ts +5 -0
- package/dist/modules/definitions/prototype.module.js +20 -0
- package/dist/modules/dependencies/index.d.ts +92 -0
- package/dist/modules/dependencies/index.js +334 -0
- package/dist/modules/register-defaults.d.ts +4 -0
- package/dist/modules/register-defaults.js +12 -0
- package/dist/modules/registry.d.ts +17 -0
- package/dist/modules/registry.js +27 -0
- package/dist/seed-data-BK0cl93n.d.ts +6 -0
- package/dist/server-seam.d.ts +19 -0
- package/dist/server-seam.js +11 -0
- package/dist/types/outline.d.ts +10 -0
- package/dist/types/outline.js +0 -0
- package/dist/types/prd.d.ts +48 -0
- package/dist/types/prd.js +37 -0
- package/dist/types/prototype.d.ts +2 -0
- package/dist/types/prototype.js +2 -0
- package/dist/types-dopOMFRC.d.ts +61 -0
- package/dist/virtual.d.ts +1 -0
- package/package.json +133 -37
- package/src/constants/perf.ts +0 -21
- package/src/i18n/client.ts +0 -32
- package/src/i18n/config.ts +0 -104
- package/src/i18n/detect.ts +0 -43
- package/src/i18n/locales/en/agents.json +0 -134
- package/src/i18n/locales/en/apps.json +0 -6
- package/src/i18n/locales/en/auth.json +0 -88
- package/src/i18n/locales/en/billing.json +0 -78
- package/src/i18n/locales/en/chat.json +0 -194
- package/src/i18n/locales/en/common.json +0 -203
- package/src/i18n/locales/en/dashboard.json +0 -38
- package/src/i18n/locales/en/design.json +0 -70
- package/src/i18n/locales/en/desktop.json +0 -35
- package/src/i18n/locales/en/display.json +0 -37
- package/src/i18n/locales/en/editor.json +0 -304
- package/src/i18n/locales/en/enterprise.json +0 -1
- package/src/i18n/locales/en/invite.json +0 -11
- package/src/i18n/locales/en/knowledge.json +0 -451
- package/src/i18n/locales/en/mindmap.json +0 -28
- package/src/i18n/locales/en/prd.json +0 -43
- package/src/i18n/locales/en/projects.json +0 -133
- package/src/i18n/locales/en/settings.json +0 -375
- package/src/i18n/locales/en/share.json +0 -20
- package/src/i18n/locales/en/story.json +0 -785
- package/src/i18n/locales/en/tags.json +0 -42
- package/src/i18n/locales/en/workspace.json +0 -90
- package/src/i18n/locales/zh/agents.json +0 -134
- package/src/i18n/locales/zh/apps.json +0 -6
- package/src/i18n/locales/zh/auth.json +0 -88
- package/src/i18n/locales/zh/billing.json +0 -78
- package/src/i18n/locales/zh/chat.json +0 -194
- package/src/i18n/locales/zh/common.json +0 -203
- package/src/i18n/locales/zh/dashboard.json +0 -38
- package/src/i18n/locales/zh/design.json +0 -70
- package/src/i18n/locales/zh/desktop.json +0 -35
- package/src/i18n/locales/zh/display.json +0 -37
- package/src/i18n/locales/zh/editor.json +0 -304
- package/src/i18n/locales/zh/enterprise.json +0 -1
- package/src/i18n/locales/zh/invite.json +0 -11
- package/src/i18n/locales/zh/knowledge.json +0 -451
- package/src/i18n/locales/zh/mindmap.json +0 -28
- package/src/i18n/locales/zh/prd.json +0 -43
- package/src/i18n/locales/zh/projects.json +0 -133
- package/src/i18n/locales/zh/settings.json +0 -375
- package/src/i18n/locales/zh/share.json +0 -20
- package/src/i18n/locales/zh/story.json +0 -785
- package/src/i18n/locales/zh/tags.json +0 -42
- package/src/i18n/locales/zh/workspace.json +0 -90
- package/src/i18n/server.ts +0 -18
- package/src/i18n/types.ts +0 -5
- package/src/index.ts +0 -90
- package/src/infrastructure/ai/adapter.ts +0 -59
- package/src/infrastructure/ai/cli-detector.ts +0 -64
- package/src/infrastructure/ip-location.ts +0 -76
- package/src/infrastructure/references/engine.ts +0 -104
- package/src/infrastructure/ua-parser.ts +0 -107
- package/src/interfaces/ai.ts +0 -38
- package/src/interfaces/avatar.ts +0 -22
- package/src/interfaces/module.ts +0 -60
- package/src/interfaces/references.ts +0 -44
- package/src/interfaces/transport.ts +0 -26
- package/src/lib/annotation-template.ts +0 -33
- package/src/lib/comment-utils.ts +0 -47
- package/src/lib/datetime.ts +0 -115
- package/src/lib/desktop-detect.ts +0 -27
- package/src/lib/outline-utils.ts +0 -57
- package/src/lib/pacer.ts +0 -96
- package/src/lib/prd/stack-layout.ts +0 -53
- package/src/lib/prd-tree-utils.ts +0 -94
- package/src/lib/prototype-registry.ts +0 -24
- package/src/lib/query-client-seam.ts +0 -14
- package/src/lib/share-events.ts +0 -78
- package/src/lib/sidebar-utils.ts +0 -21
- package/src/lib/stores/prd-canvas-store.ts +0 -69
- package/src/lib/tag-colors.ts +0 -35
- package/src/lib/time-format.ts +0 -50
- package/src/modules/ai-providers/constants.ts +0 -79
- package/src/modules/ai-providers/index.ts +0 -21
- package/src/modules/ai-providers/seed-data.ts +0 -222
- package/src/modules/ai-providers/types.ts +0 -95
- package/src/modules/billing/feature-registry.ts +0 -63
- package/src/modules/billing/plan-features-schema.ts +0 -11
- package/src/modules/billing/resource-registry.ts +0 -80
- package/src/modules/definitions/plugin.module.ts +0 -38
- package/src/modules/definitions/prd.module.ts +0 -45
- package/src/modules/definitions/prototype.module.ts +0 -38
- package/src/modules/dependencies/index.ts +0 -186
- package/src/modules/register-defaults.ts +0 -27
- package/src/modules/registry.ts +0 -53
- package/src/server-seam.ts +0 -51
- package/src/types/outline.ts +0 -26
- package/src/types/prd.ts +0 -90
- package/src/types/prototype.ts +0 -12
- package/src/virtual.d.ts +0 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//#region src/modules/billing/feature-registry.d.ts
|
|
2
|
+
interface FeatureMeta {
|
|
3
|
+
/** oss = 开源免费;paid = 付费;enterprise = 企业版专属 */
|
|
4
|
+
tier: 'oss' | 'paid' | 'enterprise';
|
|
5
|
+
/** 该功能依赖的 proModule 服务名;null = 开源代码自带(仅权益门控) */
|
|
6
|
+
module: 'billing' | 'hostedAi' | 'sso' | 'audit' | 'permissions' | 'license' | 'versionHistory' | 'automation' | 'templates' | 'analytics' | 'globalSearch' | 'compliance' | null;
|
|
7
|
+
}
|
|
8
|
+
declare const FeatureRegistry: {
|
|
9
|
+
readonly byokAi: {
|
|
10
|
+
readonly tier: 'oss';
|
|
11
|
+
readonly module: null;
|
|
12
|
+
};
|
|
13
|
+
readonly hostedAi: {
|
|
14
|
+
readonly tier: 'paid';
|
|
15
|
+
readonly module: 'hostedAi';
|
|
16
|
+
};
|
|
17
|
+
readonly multiProvider: {
|
|
18
|
+
readonly tier: 'paid';
|
|
19
|
+
readonly module: null;
|
|
20
|
+
};
|
|
21
|
+
readonly largePageSize: {
|
|
22
|
+
readonly tier: 'paid';
|
|
23
|
+
readonly module: null;
|
|
24
|
+
};
|
|
25
|
+
readonly versionHistory: {
|
|
26
|
+
readonly tier: 'paid';
|
|
27
|
+
readonly module: 'versionHistory';
|
|
28
|
+
};
|
|
29
|
+
readonly automation: {
|
|
30
|
+
readonly tier: 'paid';
|
|
31
|
+
readonly module: 'automation';
|
|
32
|
+
};
|
|
33
|
+
readonly templates: {
|
|
34
|
+
readonly tier: 'paid';
|
|
35
|
+
readonly module: 'templates';
|
|
36
|
+
};
|
|
37
|
+
readonly globalSearch: {
|
|
38
|
+
readonly tier: 'paid';
|
|
39
|
+
readonly module: 'globalSearch';
|
|
40
|
+
};
|
|
41
|
+
readonly analytics: {
|
|
42
|
+
readonly tier: 'enterprise';
|
|
43
|
+
readonly module: 'analytics';
|
|
44
|
+
};
|
|
45
|
+
readonly sso: {
|
|
46
|
+
readonly tier: 'enterprise';
|
|
47
|
+
readonly module: 'sso';
|
|
48
|
+
};
|
|
49
|
+
readonly audit: {
|
|
50
|
+
readonly tier: 'enterprise';
|
|
51
|
+
readonly module: 'audit';
|
|
52
|
+
};
|
|
53
|
+
readonly advancedPermissions: {
|
|
54
|
+
readonly tier: 'enterprise';
|
|
55
|
+
readonly module: 'permissions';
|
|
56
|
+
};
|
|
57
|
+
readonly compliance: {
|
|
58
|
+
readonly tier: 'enterprise';
|
|
59
|
+
readonly module: 'compliance';
|
|
60
|
+
};
|
|
61
|
+
readonly customAgents: {
|
|
62
|
+
readonly tier: 'paid';
|
|
63
|
+
readonly module: null;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
type FeatureKey = keyof typeof FeatureRegistry;
|
|
67
|
+
declare const FEATURE_KEYS: FeatureKey[];
|
|
68
|
+
/** OSS 部署(billing 模块缺失)的基础白名单——唯一允许「无订阅即放行」的集合 */
|
|
69
|
+
declare const OSS_BASE_FEATURES: readonly FeatureKey[];
|
|
70
|
+
declare function isOssFeature(key: FeatureKey): boolean;
|
|
71
|
+
//#endregion
|
|
72
|
+
export { FEATURE_KEYS, FeatureKey, FeatureMeta, FeatureRegistry, OSS_BASE_FEATURES, isOssFeature };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
//#region src/modules/billing/feature-registry.ts
|
|
2
|
+
const FeatureRegistry = {
|
|
3
|
+
byokAi: {
|
|
4
|
+
tier: "oss",
|
|
5
|
+
module: null
|
|
6
|
+
},
|
|
7
|
+
hostedAi: {
|
|
8
|
+
tier: "paid",
|
|
9
|
+
module: "hostedAi"
|
|
10
|
+
},
|
|
11
|
+
multiProvider: {
|
|
12
|
+
tier: "paid",
|
|
13
|
+
module: null
|
|
14
|
+
},
|
|
15
|
+
largePageSize: {
|
|
16
|
+
tier: "paid",
|
|
17
|
+
module: null
|
|
18
|
+
},
|
|
19
|
+
versionHistory: {
|
|
20
|
+
tier: "paid",
|
|
21
|
+
module: "versionHistory"
|
|
22
|
+
},
|
|
23
|
+
automation: {
|
|
24
|
+
tier: "paid",
|
|
25
|
+
module: "automation"
|
|
26
|
+
},
|
|
27
|
+
templates: {
|
|
28
|
+
tier: "paid",
|
|
29
|
+
module: "templates"
|
|
30
|
+
},
|
|
31
|
+
globalSearch: {
|
|
32
|
+
tier: "paid",
|
|
33
|
+
module: "globalSearch"
|
|
34
|
+
},
|
|
35
|
+
analytics: {
|
|
36
|
+
tier: "enterprise",
|
|
37
|
+
module: "analytics"
|
|
38
|
+
},
|
|
39
|
+
sso: {
|
|
40
|
+
tier: "enterprise",
|
|
41
|
+
module: "sso"
|
|
42
|
+
},
|
|
43
|
+
audit: {
|
|
44
|
+
tier: "enterprise",
|
|
45
|
+
module: "audit"
|
|
46
|
+
},
|
|
47
|
+
advancedPermissions: {
|
|
48
|
+
tier: "enterprise",
|
|
49
|
+
module: "permissions"
|
|
50
|
+
},
|
|
51
|
+
compliance: {
|
|
52
|
+
tier: "enterprise",
|
|
53
|
+
module: "compliance"
|
|
54
|
+
},
|
|
55
|
+
customAgents: {
|
|
56
|
+
tier: "paid",
|
|
57
|
+
module: null
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const FEATURE_KEYS = Object.keys(FeatureRegistry);
|
|
61
|
+
/** OSS 部署(billing 模块缺失)的基础白名单——唯一允许「无订阅即放行」的集合 */
|
|
62
|
+
const OSS_BASE_FEATURES = ["byokAi", "customAgents"];
|
|
63
|
+
function isOssFeature(key) {
|
|
64
|
+
return FeatureRegistry[key].tier === "oss";
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { FEATURE_KEYS, FeatureRegistry, OSS_BASE_FEATURES, isOssFeature };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/modules/billing/plan-features-schema.d.ts
|
|
3
|
+
declare const PlanFeaturesSchema: z.ZodRecord<z.ZodEnum<["advancedPermissions" | "analytics" | "audit" | "automation" | "byokAi" | "compliance" | "customAgents" | "globalSearch" | "hostedAi" | "largePageSize" | "multiProvider" | "sso" | "templates" | "versionHistory", ...("advancedPermissions" | "analytics" | "audit" | "automation" | "byokAi" | "compliance" | "customAgents" | "globalSearch" | "hostedAi" | "largePageSize" | "multiProvider" | "sso" | "templates" | "versionHistory")[]]>, z.ZodBoolean>;
|
|
4
|
+
type PlanFeatures = z.infer<typeof PlanFeaturesSchema>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { PlanFeatures, PlanFeaturesSchema };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//#region src/modules/billing/resource-registry.d.ts
|
|
2
|
+
interface ResourceMeta {
|
|
3
|
+
tier: 'paid' | 'enterprise';
|
|
4
|
+
unit: string;
|
|
5
|
+
purchasable: boolean | 'custom';
|
|
6
|
+
step: number;
|
|
7
|
+
/** 降购下限约束:seats 不允许降到当前活跃成员数以下 */
|
|
8
|
+
floor?: 'activeMembers';
|
|
9
|
+
}
|
|
10
|
+
declare const ResourceRegistry: {
|
|
11
|
+
readonly seats: {
|
|
12
|
+
/** 成员席位池(billing 加购语义不变);访客池见 guestSeats */
|
|
13
|
+
readonly tier: 'paid';
|
|
14
|
+
readonly unit: 'per-seat';
|
|
15
|
+
readonly purchasable: true;
|
|
16
|
+
readonly step: 1;
|
|
17
|
+
readonly floor: 'activeMembers';
|
|
18
|
+
};
|
|
19
|
+
readonly guestSeats: {
|
|
20
|
+
readonly tier: 'paid';
|
|
21
|
+
readonly unit: 'guest-seats';
|
|
22
|
+
readonly purchasable: false;
|
|
23
|
+
readonly step: 1;
|
|
24
|
+
};
|
|
25
|
+
readonly aiQuotaMonthly: {
|
|
26
|
+
readonly tier: 'paid';
|
|
27
|
+
readonly unit: 'requests/month';
|
|
28
|
+
readonly purchasable: false;
|
|
29
|
+
readonly step: 1;
|
|
30
|
+
};
|
|
31
|
+
readonly agentQuota: {
|
|
32
|
+
readonly tier: 'paid';
|
|
33
|
+
readonly unit: 'agents';
|
|
34
|
+
readonly purchasable: false;
|
|
35
|
+
readonly step: 1;
|
|
36
|
+
};
|
|
37
|
+
readonly skillQuota: {
|
|
38
|
+
readonly tier: 'paid';
|
|
39
|
+
readonly unit: 'skills';
|
|
40
|
+
readonly purchasable: false;
|
|
41
|
+
readonly step: 1;
|
|
42
|
+
};
|
|
43
|
+
readonly workspaces: {
|
|
44
|
+
readonly tier: 'paid';
|
|
45
|
+
readonly unit: 'workspaces';
|
|
46
|
+
readonly purchasable: false;
|
|
47
|
+
readonly step: 1;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
type ResourceKey = keyof typeof ResourceRegistry;
|
|
51
|
+
declare const RESOURCE_KEYS: ResourceKey[];
|
|
52
|
+
interface ResourceSnapshot {
|
|
53
|
+
limit: number | 'unlimited';
|
|
54
|
+
usage: number;
|
|
55
|
+
}
|
|
56
|
+
type ResourceSnapshots = Record<ResourceKey, ResourceSnapshot>;
|
|
57
|
+
declare function isResourceDefined(key: string): key is ResourceKey;
|
|
58
|
+
//#endregion
|
|
59
|
+
export { RESOURCE_KEYS, ResourceKey, ResourceMeta, ResourceRegistry, ResourceSnapshot, ResourceSnapshots, isResourceDefined };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//#region src/modules/billing/resource-registry.ts
|
|
2
|
+
const ResourceRegistry = {
|
|
3
|
+
seats: {
|
|
4
|
+
/** 成员席位池(billing 加购语义不变);访客池见 guestSeats */
|
|
5
|
+
tier: "paid",
|
|
6
|
+
unit: "per-seat",
|
|
7
|
+
purchasable: true,
|
|
8
|
+
step: 1,
|
|
9
|
+
floor: "activeMembers"
|
|
10
|
+
},
|
|
11
|
+
guestSeats: {
|
|
12
|
+
tier: "paid",
|
|
13
|
+
unit: "guest-seats",
|
|
14
|
+
purchasable: false,
|
|
15
|
+
step: 1
|
|
16
|
+
},
|
|
17
|
+
aiQuotaMonthly: {
|
|
18
|
+
tier: "paid",
|
|
19
|
+
unit: "requests/month",
|
|
20
|
+
purchasable: false,
|
|
21
|
+
step: 1
|
|
22
|
+
},
|
|
23
|
+
agentQuota: {
|
|
24
|
+
tier: "paid",
|
|
25
|
+
unit: "agents",
|
|
26
|
+
purchasable: false,
|
|
27
|
+
step: 1
|
|
28
|
+
},
|
|
29
|
+
skillQuota: {
|
|
30
|
+
tier: "paid",
|
|
31
|
+
unit: "skills",
|
|
32
|
+
purchasable: false,
|
|
33
|
+
step: 1
|
|
34
|
+
},
|
|
35
|
+
workspaces: {
|
|
36
|
+
tier: "paid",
|
|
37
|
+
unit: "workspaces",
|
|
38
|
+
purchasable: false,
|
|
39
|
+
step: 1
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const RESOURCE_KEYS = Object.keys(ResourceRegistry);
|
|
43
|
+
function isResourceDefined(key) {
|
|
44
|
+
return key in ResourceRegistry;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { RESOURCE_KEYS, ResourceRegistry, isResourceDefined };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/modules/definitions/plugin.module.ts
|
|
2
|
+
const pluginModule = {
|
|
3
|
+
id: "anyhub",
|
|
4
|
+
name: "应用市场",
|
|
5
|
+
icon: "blocks",
|
|
6
|
+
workspaceRoute: "/apps/anyhub",
|
|
7
|
+
entities: [{
|
|
8
|
+
type: "anyhubApp",
|
|
9
|
+
table: "anyhub_apps",
|
|
10
|
+
searchFields: [
|
|
11
|
+
"name",
|
|
12
|
+
"displayName",
|
|
13
|
+
"description"
|
|
14
|
+
],
|
|
15
|
+
displayFields: ["displayName"]
|
|
16
|
+
}],
|
|
17
|
+
aiCommands: [],
|
|
18
|
+
referenceDisplay: (type, data) => ({
|
|
19
|
+
title: data.displayName || data.name || "Untitled App",
|
|
20
|
+
url: `/apps/anyhub`
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { pluginModule };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/modules/definitions/prd.module.ts
|
|
2
|
+
const prdModule = {
|
|
3
|
+
id: "prd",
|
|
4
|
+
name: "PRD",
|
|
5
|
+
icon: "file-text",
|
|
6
|
+
workspaceRoute: "/prd",
|
|
7
|
+
entities: [{
|
|
8
|
+
type: "prd_document",
|
|
9
|
+
table: "prd_documents",
|
|
10
|
+
searchFields: ["title", "description"],
|
|
11
|
+
displayFields: ["title", "status"]
|
|
12
|
+
}, {
|
|
13
|
+
type: "prd_page",
|
|
14
|
+
table: "prd_pages",
|
|
15
|
+
searchFields: ["title", "content"],
|
|
16
|
+
displayFields: ["title"]
|
|
17
|
+
}],
|
|
18
|
+
aiCommands: [],
|
|
19
|
+
referenceDisplay: (type, data) => ({
|
|
20
|
+
title: data.title || "Untitled PRD",
|
|
21
|
+
status: data.status,
|
|
22
|
+
url: `/prd/${data.id}`
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { prdModule };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/modules/definitions/prototype.module.ts
|
|
2
|
+
const prototypeModule = {
|
|
3
|
+
id: "prototype",
|
|
4
|
+
name: "原型",
|
|
5
|
+
icon: "pen-tool",
|
|
6
|
+
workspaceRoute: "/plugin-anything",
|
|
7
|
+
entities: [{
|
|
8
|
+
type: "prototype_component",
|
|
9
|
+
table: "plugin_installations",
|
|
10
|
+
searchFields: ["name", "description"],
|
|
11
|
+
displayFields: ["name"]
|
|
12
|
+
}],
|
|
13
|
+
aiCommands: [],
|
|
14
|
+
referenceDisplay: (type, data) => ({
|
|
15
|
+
title: data.name || "Untitled Prototype",
|
|
16
|
+
url: `/plugin-anything`
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { prototypeModule };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
//#region src/modules/dependencies/index.d.ts
|
|
2
|
+
/** 依赖分类 */
|
|
3
|
+
type DependencyCategory = 'framework' | 'ui' | 'editor' | 'ai' | 'state' | 'auth' | 'tool' | 'other';
|
|
4
|
+
/** 优先级 */
|
|
5
|
+
type DependencyPriority = 'high' | 'normal' | 'low';
|
|
6
|
+
/** 版本状态(前端展示用,由 serverFn 计算) */
|
|
7
|
+
type VersionStatus = 'latest' | 'patch' | 'minor' | 'major' | 'unknown';
|
|
8
|
+
/** 依赖分类元信息 */
|
|
9
|
+
declare const DEPENDENCY_CATEGORIES: Array<{
|
|
10
|
+
value: DependencyCategory;
|
|
11
|
+
label: string;
|
|
12
|
+
description: string;
|
|
13
|
+
}>;
|
|
14
|
+
declare const DEPENDENCY_PRIORITIES: Array<{
|
|
15
|
+
value: DependencyPriority;
|
|
16
|
+
label: string;
|
|
17
|
+
}>;
|
|
18
|
+
/** monorepo 中某个 app 的使用情况 */
|
|
19
|
+
interface DependencyUsage {
|
|
20
|
+
/** 相对路径,如 "apps/web" */
|
|
21
|
+
app: string;
|
|
22
|
+
/** 该 app 的 package.json 中声明的版本(semver range,如 "^3.23.6") */
|
|
23
|
+
declaredRange: string;
|
|
24
|
+
}
|
|
25
|
+
/** DB 行 + 实时聚合数据(列表页主结构) */
|
|
26
|
+
interface ThirdPartyDependencyRow {
|
|
27
|
+
id: string;
|
|
28
|
+
/** npm 包名 */
|
|
29
|
+
name: string;
|
|
30
|
+
/** 展示名(默认取 name) */
|
|
31
|
+
displayName: string;
|
|
32
|
+
/** 依赖用途说明 */
|
|
33
|
+
description: string | null;
|
|
34
|
+
/** 官网 / 仓库地址 */
|
|
35
|
+
homepage: string | null;
|
|
36
|
+
/** npm 包页面地址 */
|
|
37
|
+
npmUrl: string;
|
|
38
|
+
category: DependencyCategory;
|
|
39
|
+
isWatched: boolean;
|
|
40
|
+
priority: DependencyPriority;
|
|
41
|
+
/** 项目中实际使用的版本信息(聚合 monorepo,来自 package.json,不缓存) */
|
|
42
|
+
usages: DependencyUsage[];
|
|
43
|
+
/** 当前使用版本(取 usages 中第一个 semver clean 值,便于表格直接展示) */
|
|
44
|
+
currentVersion: string | null;
|
|
45
|
+
/** 缓存的 npm registry latest 版本 */
|
|
46
|
+
latestVersion: string | null;
|
|
47
|
+
/** 最新版本的更新日志(GitHub Releases,markdown 原文) */
|
|
48
|
+
latestChangelog: string | null;
|
|
49
|
+
/** 最后同步时间(ISO) */
|
|
50
|
+
lastSyncAt: string | null;
|
|
51
|
+
/** 版本状态(由 currentVersion / latestVersion 比较得出) */
|
|
52
|
+
versionStatus: VersionStatus;
|
|
53
|
+
notes: string | null;
|
|
54
|
+
sortOrder: number;
|
|
55
|
+
updatedAt: string;
|
|
56
|
+
}
|
|
57
|
+
/** 编辑表单 payload */
|
|
58
|
+
interface UpdateDependencyInput {
|
|
59
|
+
displayName?: string;
|
|
60
|
+
description?: string | null;
|
|
61
|
+
homepage?: string | null;
|
|
62
|
+
category?: DependencyCategory;
|
|
63
|
+
isWatched?: boolean;
|
|
64
|
+
priority?: DependencyPriority;
|
|
65
|
+
notes?: string | null;
|
|
66
|
+
sortOrder?: number;
|
|
67
|
+
}
|
|
68
|
+
/** 单个包同步结果 */
|
|
69
|
+
interface SyncDependencyResult {
|
|
70
|
+
name: string;
|
|
71
|
+
success: boolean;
|
|
72
|
+
latestVersion?: string;
|
|
73
|
+
homepage?: string | null;
|
|
74
|
+
changelog?: string | null;
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 预设关注列表(首次启动 seed 用)。
|
|
79
|
+
* 只放核心关注包;其余 monorepo 依赖在 list 时动态归入「全部依赖」分组。
|
|
80
|
+
* homepage 取官网或 GitHub 仓库,npmUrl 由 name 推导(不存表)。
|
|
81
|
+
*/
|
|
82
|
+
interface DependencySeed {
|
|
83
|
+
name: string;
|
|
84
|
+
displayName: string;
|
|
85
|
+
description: string;
|
|
86
|
+
homepage: string;
|
|
87
|
+
category: DependencyCategory;
|
|
88
|
+
priority: DependencyPriority;
|
|
89
|
+
}
|
|
90
|
+
declare const DEFAULT_WATCHED_DEPENDENCIES: DependencySeed[];
|
|
91
|
+
//#endregion
|
|
92
|
+
export { DEFAULT_WATCHED_DEPENDENCIES, DEPENDENCY_CATEGORIES, DEPENDENCY_PRIORITIES, DependencyCategory, DependencyPriority, DependencySeed, DependencyUsage, SyncDependencyResult, ThirdPartyDependencyRow, UpdateDependencyInput, VersionStatus };
|