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:
teernisse
2026-02-26 15:53:45 -05:00
parent 2926645b10
commit c7db46191c
7 changed files with 266 additions and 7 deletions

View File

@@ -2,8 +2,10 @@
export const API_STATE = '/api/state';
export const API_STREAM = '/api/stream';
export const API_DISMISS = '/api/dismiss/';
export const API_DISMISS_DEAD = '/api/dismiss-dead';
export const API_RESPOND = '/api/respond/';
export const API_CONVERSATION = '/api/conversation/';
export const API_SKILLS = '/api/skills';
export const POLL_MS = 3000;
export const API_TIMEOUT_MS = 10000;
@@ -18,3 +20,16 @@ export async function fetchWithTimeout(url, options = {}, timeoutMs = API_TIMEOU
clearTimeout(timeoutId);
}
}
// Fetch autocomplete skills config for an agent type
export async function fetchSkills(agent) {
const url = `${API_SKILLS}?agent=${encodeURIComponent(agent)}`;
try {
const response = await fetch(url);
if (!response.ok) return null;
return response.json();
} catch {
// Network error or other failure - graceful degradation
return null;
}
}