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:
+9
-2
@@ -70,7 +70,8 @@ def user_message(text):
|
||||
append({"type": "user", "uuid": "user-%d" % state["turn"], "timestamp": stamp(),
|
||||
"message": {"role": "user", "content": [{"type": "text", "text": text}]}})
|
||||
send({"type": "system", "subtype": "init", "session_id": state["session"],
|
||||
"model": "claude-test", "permissionMode": "default", "cwd": os.getcwd()})
|
||||
"model": "claude-test", "permissionMode": "default", "cwd": os.getcwd(),
|
||||
"terminal_slash_commands": ["color"]})
|
||||
message_id = "msg_fake_%d" % state["turn"]
|
||||
if "gate" in text:
|
||||
gated(message_id)
|
||||
@@ -218,7 +219,13 @@ def handle(line):
|
||||
"supportsEffort": True, "supportedEffortLevels": ["low", "medium", "high", "max"]},
|
||||
{"value": "haiku", "displayName": "Haiku", "description": "Haiku model"},
|
||||
],
|
||||
"commands": [], "agents": [],
|
||||
"commands": [
|
||||
{"name": "code-review", "description": "Review the current diff", "argumentHint": "[low|high] [<pr#>]"},
|
||||
{"name": "probe-skill", "description": "Probe skill (user)", "argumentHint": ""},
|
||||
{"name": "color", "description": "Set the prompt bar color", "argumentHint": "[red|blue]"},
|
||||
{"name": "__remote-workflow", "description": "internal", "argumentHint": ""},
|
||||
{"name": "code-review", "description": "duplicate", "argumentHint": ""},
|
||||
], "agents": [],
|
||||
"account": {"email": "fixture@example.invalid", "organization": "Fixture Org",
|
||||
"subscriptionType": "max", "apiProvider": "firstParty"},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user