skillverse 0.1.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/.prettierrc +10 -0
- package/README.md +369 -0
- package/client/README.md +73 -0
- package/client/eslint.config.js +23 -0
- package/client/index.html +13 -0
- package/client/package.json +41 -0
- package/client/postcss.config.js +6 -0
- package/client/public/vite.svg +1 -0
- package/client/src/App.css +42 -0
- package/client/src/App.tsx +26 -0
- package/client/src/assets/react.svg +1 -0
- package/client/src/components/AddSkillDialog.tsx +249 -0
- package/client/src/components/Layout.tsx +134 -0
- package/client/src/components/LinkWorkspaceDialog.tsx +196 -0
- package/client/src/components/LoadingSpinner.tsx +57 -0
- package/client/src/components/SkillCard.tsx +269 -0
- package/client/src/components/Toast.tsx +44 -0
- package/client/src/components/Tooltip.tsx +132 -0
- package/client/src/index.css +168 -0
- package/client/src/lib/api.ts +196 -0
- package/client/src/main.tsx +10 -0
- package/client/src/pages/Dashboard.tsx +209 -0
- package/client/src/pages/Marketplace.tsx +282 -0
- package/client/src/pages/Settings.tsx +136 -0
- package/client/src/pages/SkillLibrary.tsx +163 -0
- package/client/src/pages/Workspaces.tsx +662 -0
- package/client/src/stores/appStore.ts +222 -0
- package/client/tailwind.config.js +82 -0
- package/client/tsconfig.app.json +28 -0
- package/client/tsconfig.json +7 -0
- package/client/tsconfig.node.json +26 -0
- package/client/vite.config.ts +26 -0
- package/package.json +34 -0
- package/registry/.env.example +5 -0
- package/registry/Dockerfile +42 -0
- package/registry/docker-compose.yml +33 -0
- package/registry/package.json +37 -0
- package/registry/prisma/schema.prisma +59 -0
- package/registry/src/index.ts +34 -0
- package/registry/src/lib/db.ts +3 -0
- package/registry/src/middleware/errorHandler.ts +35 -0
- package/registry/src/routes/auth.ts +152 -0
- package/registry/src/routes/skills.ts +295 -0
- package/registry/tsconfig.json +23 -0
- package/server/.env.example +11 -0
- package/server/package.json +60 -0
- package/server/prisma/schema.prisma +73 -0
- package/server/public/assets/index-BsYtpZSa.css +1 -0
- package/server/public/assets/index-Dfr_6UV8.js +20 -0
- package/server/public/index.html +14 -0
- package/server/public/vite.svg +1 -0
- package/server/src/bin.ts +428 -0
- package/server/src/config.ts +39 -0
- package/server/src/index.ts +112 -0
- package/server/src/lib/db.ts +14 -0
- package/server/src/middleware/errorHandler.ts +40 -0
- package/server/src/middleware/logger.ts +12 -0
- package/server/src/routes/dashboard.ts +102 -0
- package/server/src/routes/marketplace.ts +273 -0
- package/server/src/routes/skills.ts +294 -0
- package/server/src/routes/workspaces.ts +168 -0
- package/server/src/services/bundleService.ts +123 -0
- package/server/src/services/skillService.ts +722 -0
- package/server/src/services/workspaceService.ts +521 -0
- package/server/src/verify-sync.ts +91 -0
- package/server/tsconfig.json +19 -0
- package/server/tsup.config.ts +18 -0
- package/shared/package.json +21 -0
- package/shared/pnpm-lock.yaml +24 -0
- package/shared/src/index.ts +169 -0
- package/shared/tsconfig.json +10 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Skill types
|
|
2
|
+
export interface Skill {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
source: 'git' | 'local';
|
|
6
|
+
sourceUrl?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
commitHash?: string;
|
|
9
|
+
repoUrl?: string;
|
|
10
|
+
updateAvailable: boolean;
|
|
11
|
+
lastUpdateCheck?: Date;
|
|
12
|
+
installDate: Date;
|
|
13
|
+
metadata?: Record<string, any>;
|
|
14
|
+
linkedWorkspaces?: SkillWorkspace[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface CreateSkillFromGitDto {
|
|
18
|
+
gitUrl: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CreateSkillFromLocalDto {
|
|
23
|
+
name: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface UpdateSkillDto {
|
|
28
|
+
name?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
metadata?: Record<string, any>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Workspace types
|
|
34
|
+
export interface Workspace {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
path: string;
|
|
38
|
+
type: WorkspaceType;
|
|
39
|
+
scope: WorkspaceScope;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
isPathValid?: boolean; // runtime computed, not stored in DB
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type WorkspaceType = 'vscode' | 'cursor' | 'claude-desktop' | 'codex' | 'antigravity' | 'custom';
|
|
45
|
+
export type WorkspaceScope = 'project' | 'global';
|
|
46
|
+
|
|
47
|
+
// 各编辑器类型对应的 skills 子目录
|
|
48
|
+
export const WORKSPACE_SKILLS_PATHS: Record<WorkspaceType, { project: string; global: string }> = {
|
|
49
|
+
vscode: {
|
|
50
|
+
project: '.github/skills',
|
|
51
|
+
global: '~/.copilot/skills'
|
|
52
|
+
},
|
|
53
|
+
cursor: {
|
|
54
|
+
project: '.cursor/skills',
|
|
55
|
+
global: '~/.cursor/skills'
|
|
56
|
+
},
|
|
57
|
+
'claude-desktop': {
|
|
58
|
+
project: '.claude/skills',
|
|
59
|
+
global: '~/.claude/skills'
|
|
60
|
+
},
|
|
61
|
+
codex: {
|
|
62
|
+
project: '.codex/skills',
|
|
63
|
+
global: '~/.codex/skills'
|
|
64
|
+
},
|
|
65
|
+
antigravity: {
|
|
66
|
+
project: '.agent/skills',
|
|
67
|
+
global: '~/.agent/skills'
|
|
68
|
+
},
|
|
69
|
+
custom: {
|
|
70
|
+
project: 'skills',
|
|
71
|
+
global: ''
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export interface CreateWorkspaceDto {
|
|
76
|
+
name: string;
|
|
77
|
+
projectPath: string; // 项目根目录(project scope)或空(global scope)
|
|
78
|
+
type: WorkspaceType;
|
|
79
|
+
scope: WorkspaceScope;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface UpdateWorkspaceDto {
|
|
83
|
+
name?: string;
|
|
84
|
+
path?: string;
|
|
85
|
+
type?: WorkspaceType;
|
|
86
|
+
scope?: WorkspaceScope;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Skill-Workspace link types
|
|
90
|
+
export interface SkillWorkspace {
|
|
91
|
+
id: string;
|
|
92
|
+
skillId: string;
|
|
93
|
+
workspaceId: string;
|
|
94
|
+
linkedAt: Date;
|
|
95
|
+
skill?: Skill;
|
|
96
|
+
workspace?: Workspace;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface LinkSkillToWorkspaceDto {
|
|
100
|
+
skillId: string;
|
|
101
|
+
workspaceId: string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Marketplace types
|
|
105
|
+
export interface MarketplaceSkill {
|
|
106
|
+
id: string;
|
|
107
|
+
skillId: string;
|
|
108
|
+
publisherId?: string;
|
|
109
|
+
publisherName?: string;
|
|
110
|
+
publishDate: Date;
|
|
111
|
+
downloads: number;
|
|
112
|
+
skill: Skill;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface PublishSkillDto {
|
|
116
|
+
skillId: string;
|
|
117
|
+
publisherName?: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// API Response types
|
|
121
|
+
export interface ApiResponse<T = any> {
|
|
122
|
+
success: boolean;
|
|
123
|
+
data?: T;
|
|
124
|
+
error?: string;
|
|
125
|
+
code?: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface UpdateCheckResponse {
|
|
129
|
+
hasUpdate: boolean;
|
|
130
|
+
currentHash: string | null;
|
|
131
|
+
remoteHash: string | null;
|
|
132
|
+
message?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface PaginatedResponse<T> {
|
|
136
|
+
items: T[];
|
|
137
|
+
total: number;
|
|
138
|
+
page: number;
|
|
139
|
+
pageSize: number;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Error types
|
|
143
|
+
export const ErrorCode = {
|
|
144
|
+
VALIDATION_ERROR: 'VALIDATION_ERROR',
|
|
145
|
+
NOT_FOUND: 'NOT_FOUND',
|
|
146
|
+
ALREADY_EXISTS: 'ALREADY_EXISTS',
|
|
147
|
+
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
148
|
+
GIT_ERROR: 'GIT_ERROR',
|
|
149
|
+
FILE_SYSTEM_ERROR: 'FILE_SYSTEM_ERROR',
|
|
150
|
+
PERMISSION_ERROR: 'PERMISSION_ERROR',
|
|
151
|
+
SYMLINK_ERROR: 'SYMLINK_ERROR',
|
|
152
|
+
} as const;
|
|
153
|
+
|
|
154
|
+
export type ErrorCode = typeof ErrorCode[keyof typeof ErrorCode];
|
|
155
|
+
|
|
156
|
+
export interface ApiError {
|
|
157
|
+
code: ErrorCode;
|
|
158
|
+
message: string;
|
|
159
|
+
details?: any;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Statistics types
|
|
163
|
+
export interface DashboardStats {
|
|
164
|
+
totalSkills: number;
|
|
165
|
+
totalWorkspaces: number;
|
|
166
|
+
totalLinks: number;
|
|
167
|
+
marketplaceSkills: number;
|
|
168
|
+
recentSkills: Skill[];
|
|
169
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"lib": [
|
|
5
|
+
"ES2022"
|
|
6
|
+
],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"allowJs": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"declarationMap": true,
|
|
17
|
+
"sourceMap": true
|
|
18
|
+
},
|
|
19
|
+
"exclude": [
|
|
20
|
+
"node_modules",
|
|
21
|
+
"dist",
|
|
22
|
+
"build",
|
|
23
|
+
"client"
|
|
24
|
+
]
|
|
25
|
+
}
|