feat(dashboard): add skill autocomplete server-side enumeration and client wiring
- Add SkillsMixin with _enumerate_claude_skills and _enumerate_codex_skills - Claude: reads ~/.claude/skills/, parses YAML frontmatter for descriptions - Codex: reads curated cache + ~/.codex/skills/ user directory - Add /api/skills?agent= endpoint to HttpMixin - Add fetchSkills() API helper in dashboard - Wire autocomplete config through Modal -> SessionCard -> SimpleInput - Add getTriggerInfo() for detecting trigger at valid positions Closes: bd-3q1, bd-sv1, bd-3eu, bd-g9t, bd-30p, bd-1ba, bd-2n7, bd-3s3 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,29 @@
|
||||
import { html, useState, useEffect, useCallback } from '../lib/preact.js';
|
||||
import { SessionCard } from './SessionCard.js';
|
||||
import { fetchSkills } from '../utils/api.js';
|
||||
|
||||
export function Modal({ session, conversations, onClose, onRespond, onFetchConversation, onDismiss }) {
|
||||
const [closing, setClosing] = useState(false);
|
||||
const [autocompleteConfig, setAutocompleteConfig] = useState(null);
|
||||
|
||||
// Reset closing state when session changes
|
||||
useEffect(() => {
|
||||
setClosing(false);
|
||||
}, [session?.session_id]);
|
||||
|
||||
// Load autocomplete skills when agent type changes
|
||||
useEffect(() => {
|
||||
if (!session) {
|
||||
setAutocompleteConfig(null);
|
||||
return;
|
||||
}
|
||||
|
||||
const agent = session.agent || 'claude';
|
||||
fetchSkills(agent)
|
||||
.then(config => setAutocompleteConfig(config))
|
||||
.catch(() => setAutocompleteConfig(null));
|
||||
}, [session?.agent]);
|
||||
|
||||
// Animated close handler
|
||||
const handleClose = useCallback(() => {
|
||||
setClosing(true);
|
||||
@@ -54,6 +69,7 @@ export function Modal({ session, conversations, onClose, onRespond, onFetchConve
|
||||
onRespond=${onRespond}
|
||||
onDismiss=${onDismiss}
|
||||
enlarged=${true}
|
||||
autocompleteConfig=${autocompleteConfig}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user