mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
feat: add assistant mode, SSE streaming, and OpenCode server integration (#214)
This commit is contained in:
1 parent
3cc24288a6
commit
c3d6549f01
133 files changed
+7284
-6293
No files matched your search
@@ -21,9 +21,6 @@ const skillFormSchema = z.object({
|
||||
description: z.string().min(1, 'Description is required').max(1024, 'Description must be 1024 characters or less'),
|
||||
body: z.string().min(1, 'Skill body is required'),
|
||||
scope: z.enum(['global', 'project']),
|
||||
license: z.string().optional(),
|
||||
compatibility: z.string().optional(),
|
||||
metadata: z.record(z.string(), z.string()).optional(),
|
||||
})
|
||||
|
||||
type SkillFormValues = z.infer<typeof skillFormSchema>
|
||||
@@ -51,9 +48,6 @@ export function SkillDialog({ open, onOpenChange, onSubmit, editingSkill }: Skil
|
||||
description: skill?.description || '',
|
||||
body: skill?.body || '',
|
||||
scope: skill?.scope || 'global',
|
||||
license: skill?.license || '',
|
||||
compatibility: skill?.compatibility || '',
|
||||
metadata: skill?.metadata || {},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +78,6 @@ export function SkillDialog({ open, onOpenChange, onSubmit, editingSkill }: Skil
|
||||
repoId: editingSkill.scope === 'project' ? editingSkill.repoId : undefined,
|
||||
description: values.description,
|
||||
body: values.body,
|
||||
license: values.license || undefined,
|
||||
compatibility: values.compatibility || undefined,
|
||||
metadata: Object.keys(values.metadata || {}).length > 0 ? values.metadata : undefined,
|
||||
})
|
||||
} else {
|
||||
onSubmit({
|
||||
@@ -95,9 +86,6 @@ export function SkillDialog({ open, onOpenChange, onSubmit, editingSkill }: Skil
|
||||
body: values.body,
|
||||
scope: values.scope,
|
||||
repoId: values.scope === 'project' ? selectedRepoId : undefined,
|
||||
license: values.license || undefined,
|
||||
compatibility: values.compatibility || undefined,
|
||||
metadata: Object.keys(values.metadata || {}).length > 0 ? values.metadata : undefined,
|
||||
})
|
||||
}
|
||||
form.reset()
|
||||
@@ -204,68 +192,28 @@ export function SkillDialog({ open, onOpenChange, onSubmit, editingSkill }: Skil
|
||||
/>
|
||||
|
||||
{scope === 'project' && (
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="metadata"
|
||||
render={() => (
|
||||
<FormItem>
|
||||
<FormLabel>Repository</FormLabel>
|
||||
<FormControl>
|
||||
<Select
|
||||
value={selectedRepoId?.toString()}
|
||||
onValueChange={(value) => setSelectedRepoId(value ? parseInt(value, 10) : undefined)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select repository" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{repos.map((repo) => (
|
||||
<SelectItem key={repo.id} value={repo.id.toString()}>
|
||||
{repo.localPath}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<FormItem>
|
||||
<FormLabel>Repository</FormLabel>
|
||||
<FormControl>
|
||||
<Select
|
||||
value={selectedRepoId?.toString()}
|
||||
onValueChange={(value) => setSelectedRepoId(value ? parseInt(value, 10) : undefined)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue placeholder="Select repository" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{repos.map((repo) => (
|
||||
<SelectItem key={repo.id} value={repo.id.toString()}>
|
||||
{repo.localPath}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="license"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>License (Optional)</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
placeholder="MIT"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="compatibility"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Compatibility (Optional)</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
{...field}
|
||||
placeholder="opencode"
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user