Chat: offer the session's Claude Code skills and slash commands in the palette
The server reads the commands Claude Code's initialize response lists (bundled, user, project, plugin and claude.ai-synced skills plus CLI commands, with descriptions and argument hints), drops terminal-only ones, and serves them per chat over a new chat_commands request without waiting for a CLI start. The composer palette lists them after the recorded commands; choosing one inserts "/<name> " and sending passes it to the harness as an ordinary prompt. Codex, OpenCode and Pi chats reply with an empty list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,21 @@ class ChatRepository {
|
||||
return value is List ? _maps(value) : const [];
|
||||
}
|
||||
|
||||
/// The slash commands and skills the session's harness offers
|
||||
/// (`chat_commands`), in the server's order. A harness without any replies
|
||||
/// with no list, which is an empty catalog.
|
||||
Future<List<JsonMap>> commands(String sessionId) async {
|
||||
final session = sessionId.trim();
|
||||
if (session.isEmpty) {
|
||||
throw ArgumentError('Select a chat session first.');
|
||||
}
|
||||
final reply = await gateway.call('chat_commands', {
|
||||
'chat_query': {'session_id': session},
|
||||
});
|
||||
final value = reply['chat_commands'];
|
||||
return value is List ? _maps(value) : const [];
|
||||
}
|
||||
|
||||
Future<JsonMap> selectModel(String sessionId, String provider, String model) {
|
||||
final session = sessionId.trim();
|
||||
if (session.isEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user