mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat: add skill installer (#279)
* feat: add skill installer with install/uninstall and settings UI * feat: refactor skill installer with extracted SkillLibraryList component * feat: simplify SkillsEditor, extract SkillLibraryList * feat: refactor skill installer components and add github utility
This commit is contained in:
1 parent
24d34f28a3
commit
6e80cdfb8c
24 files changed
+2381
-577
No files matched your search
@@ -43,3 +43,33 @@ export interface SkillFileInfo {
|
||||
repoId?: number
|
||||
repoName?: string
|
||||
}
|
||||
|
||||
export const InstallSkillFromGithubRequestSchema = z.object({
|
||||
sourceType: z.literal('github'),
|
||||
url: z.string().url(),
|
||||
scope: SkillScopeSchema,
|
||||
repoId: z.number().optional(),
|
||||
overwrite: z.boolean().optional(),
|
||||
})
|
||||
export type InstallSkillFromGithubRequest = z.infer<typeof InstallSkillFromGithubRequestSchema>
|
||||
|
||||
export const InstallSkillUploadManifestEntrySchema = z.object({
|
||||
fieldName: z.string().min(1),
|
||||
relativePath: z.string().min(1),
|
||||
})
|
||||
export type InstallSkillUploadManifestEntry = z.infer<typeof InstallSkillUploadManifestEntrySchema>
|
||||
|
||||
export const InstallSkillUploadRequestSchema = z.object({
|
||||
sourceType: z.literal('upload'),
|
||||
scope: SkillScopeSchema,
|
||||
repoId: z.number().optional(),
|
||||
overwrite: z.boolean().optional(),
|
||||
})
|
||||
export type InstallSkillUploadRequest = z.infer<typeof InstallSkillUploadRequestSchema>
|
||||
|
||||
export interface InstallSkillResponse {
|
||||
skill: SkillFileInfo
|
||||
overwritten: boolean
|
||||
sourceType: 'github' | 'upload'
|
||||
filesInstalled: string[]
|
||||
}
|
||||
@@ -127,6 +127,10 @@ export type {
|
||||
CreateSkillRequest,
|
||||
UpdateSkillRequest,
|
||||
SkillFileInfo,
|
||||
InstallSkillFromGithubRequest,
|
||||
InstallSkillUploadRequest,
|
||||
InstallSkillUploadManifestEntry,
|
||||
InstallSkillResponse,
|
||||
} from '../schemas/skills'
|
||||
export {
|
||||
SKILL_NAME_REGEX,
|
||||
@@ -135,4 +139,7 @@ export {
|
||||
SkillFrontmatterSchema,
|
||||
CreateSkillRequestSchema,
|
||||
UpdateSkillRequestSchema,
|
||||
InstallSkillFromGithubRequestSchema,
|
||||
InstallSkillUploadRequestSchema,
|
||||
InstallSkillUploadManifestEntrySchema,
|
||||
} from '../schemas/skills'
|
||||
Reference in new issue
Block a user