mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-24 21:38:18 +00:00
47 lines
990 B
TypeScript
47 lines
990 B
TypeScript
import { z } from 'zod'
|
|
|
|
export interface SkillEnvironmentVariable {
|
|
name: string
|
|
default?: string
|
|
}
|
|
|
|
export interface SkillConfig {
|
|
environmentVariables: SkillEnvironmentVariable[]
|
|
}
|
|
|
|
export interface SkillInfo {
|
|
id: string
|
|
name: string
|
|
description: string | null
|
|
config: SkillConfig | null
|
|
assetId: string
|
|
hash: string
|
|
createdAt: string
|
|
updatedAt: string
|
|
}
|
|
|
|
export const upsertSkillRequestSchema = z.object({
|
|
assetId: z.string().optional(),
|
|
githubUrl: z.string().optional(),
|
|
override: z.boolean().optional(),
|
|
})
|
|
|
|
export type UpsertSkillRequest = z.infer<typeof upsertSkillRequestSchema>
|
|
|
|
export const updateSkillConfigRequestSchema = z.object({
|
|
config: z.object({
|
|
environmentVariables: z.array(
|
|
z.object({
|
|
name: z.string(),
|
|
default: z.string().optional(),
|
|
}),
|
|
),
|
|
}),
|
|
})
|
|
|
|
export type UpdateSkillConfigRequest = z.infer<typeof updateSkillConfigRequestSchema>
|
|
|
|
export interface ListSkillsResponse {
|
|
skills: SkillInfo[]
|
|
}
|