mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:20:43 +00:00
feat(ui): overhaul settings and slash command UX (#67819) thanks @BunsDev
Co-authored-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
ChatCommandDefinition,
|
||||
CommandCategory,
|
||||
CommandScope,
|
||||
CommandTier,
|
||||
} from "./commands-registry.types.js";
|
||||
import { listThinkingLevels } from "./thinking.js";
|
||||
|
||||
@@ -20,6 +21,8 @@ type DefineChatCommandInput = {
|
||||
textAliases?: string[];
|
||||
scope?: CommandScope;
|
||||
category?: CommandCategory;
|
||||
/** Progressive disclosure tier. Defaults to "standard". */
|
||||
tier?: CommandTier;
|
||||
};
|
||||
|
||||
export function defineChatCommand(command: DefineChatCommandInput): ChatCommandDefinition {
|
||||
@@ -42,6 +45,7 @@ export function defineChatCommand(command: DefineChatCommandInput): ChatCommandD
|
||||
textAliases: aliases,
|
||||
scope,
|
||||
category: command.category,
|
||||
tier: command.tier,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -129,6 +133,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Show available commands.",
|
||||
textAlias: "/help",
|
||||
category: "status",
|
||||
tier: "essential",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "commands",
|
||||
@@ -136,6 +141,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "List all slash commands.",
|
||||
textAlias: "/commands",
|
||||
category: "status",
|
||||
tier: "power",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "tools",
|
||||
@@ -152,6 +158,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
},
|
||||
],
|
||||
argsMenu: "auto",
|
||||
tier: "standard",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "skill",
|
||||
@@ -159,6 +166,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Run a skill by name.",
|
||||
textAlias: "/skill",
|
||||
category: "tools",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "name",
|
||||
@@ -180,6 +188,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Show current status.",
|
||||
textAlias: "/status",
|
||||
category: "status",
|
||||
tier: "essential",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "tasks",
|
||||
@@ -187,6 +196,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "List background tasks for this session.",
|
||||
textAlias: "/tasks",
|
||||
category: "status",
|
||||
tier: "standard",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "allowlist",
|
||||
@@ -195,6 +205,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
acceptsArgs: true,
|
||||
scope: "text",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "approve",
|
||||
@@ -203,6 +214,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAlias: "/approve",
|
||||
acceptsArgs: true,
|
||||
category: "management",
|
||||
tier: "power",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "context",
|
||||
@@ -211,6 +223,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAlias: "/context",
|
||||
acceptsArgs: true,
|
||||
category: "status",
|
||||
tier: "standard",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "btw",
|
||||
@@ -219,6 +232,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAlias: "/btw",
|
||||
acceptsArgs: true,
|
||||
category: "tools",
|
||||
tier: "standard",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "export-session",
|
||||
@@ -227,6 +241,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAliases: ["/export-session", "/export"],
|
||||
acceptsArgs: true,
|
||||
category: "status",
|
||||
tier: "essential",
|
||||
args: [
|
||||
{
|
||||
name: "path",
|
||||
@@ -242,6 +257,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Control text-to-speech (TTS).",
|
||||
textAlias: "/tts",
|
||||
category: "media",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -285,6 +301,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Show your sender id.",
|
||||
textAlias: "/whoami",
|
||||
category: "status",
|
||||
tier: "power",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "session",
|
||||
@@ -292,6 +309,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Manage session-level settings (for example /session idle).",
|
||||
textAlias: "/session",
|
||||
category: "session",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -314,6 +332,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "List, kill, log, spawn, or steer subagent runs for this session.",
|
||||
textAlias: "/subagents",
|
||||
category: "management",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -341,6 +360,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Manage ACP sessions and runtime options.",
|
||||
textAlias: "/acp",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -382,6 +402,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
"Bind this thread (Discord) or topic/conversation (Telegram) to a session target.",
|
||||
textAlias: "/focus",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "target",
|
||||
@@ -397,6 +418,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Remove the current thread (Discord) or topic/conversation (Telegram) binding.",
|
||||
textAlias: "/unfocus",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "agents",
|
||||
@@ -404,6 +426,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "List thread-bound agents for this session.",
|
||||
textAlias: "/agents",
|
||||
category: "management",
|
||||
tier: "standard",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "kill",
|
||||
@@ -411,6 +434,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Kill a running subagent (or all).",
|
||||
textAlias: "/kill",
|
||||
category: "management",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "target",
|
||||
@@ -426,6 +450,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Send guidance to a running subagent.",
|
||||
textAlias: "/steer",
|
||||
category: "management",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "target",
|
||||
@@ -446,6 +471,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Show or set config values.",
|
||||
textAlias: "/config",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -474,6 +500,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Show or set OpenClaw MCP servers.",
|
||||
textAlias: "/mcp",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -502,6 +529,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "List, show, enable, or disable plugins.",
|
||||
textAliases: ["/plugins", "/plugin"],
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -524,6 +552,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Set runtime debug overrides.",
|
||||
textAlias: "/debug",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "action",
|
||||
@@ -552,6 +581,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Usage footer or cost summary.",
|
||||
textAlias: "/usage",
|
||||
category: "options",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -568,6 +598,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Stop the current run.",
|
||||
textAlias: "/stop",
|
||||
category: "session",
|
||||
tier: "essential",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "restart",
|
||||
@@ -575,6 +606,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Restart OpenClaw.",
|
||||
textAlias: "/restart",
|
||||
category: "tools",
|
||||
tier: "power",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "activation",
|
||||
@@ -582,6 +614,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Set group activation mode.",
|
||||
textAlias: "/activation",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -598,6 +631,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Set send policy.",
|
||||
textAlias: "/send",
|
||||
category: "management",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -615,6 +649,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAlias: "/reset",
|
||||
acceptsArgs: true,
|
||||
category: "session",
|
||||
tier: "essential",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "new",
|
||||
@@ -623,6 +658,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAlias: "/new",
|
||||
acceptsArgs: true,
|
||||
category: "session",
|
||||
tier: "essential",
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "compact",
|
||||
@@ -630,6 +666,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Compact the session context.",
|
||||
textAlias: "/compact",
|
||||
category: "session",
|
||||
tier: "essential",
|
||||
args: [
|
||||
{
|
||||
name: "instructions",
|
||||
@@ -645,6 +682,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Set thinking level.",
|
||||
textAlias: "/think",
|
||||
category: "options",
|
||||
tier: "essential",
|
||||
args: [
|
||||
{
|
||||
name: "level",
|
||||
@@ -661,6 +699,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Toggle verbose mode.",
|
||||
textAlias: "/verbose",
|
||||
category: "options",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -677,6 +716,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Toggle plugin trace lines.",
|
||||
textAlias: "/trace",
|
||||
category: "options",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -693,6 +733,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Toggle fast mode.",
|
||||
textAlias: "/fast",
|
||||
category: "options",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -709,6 +750,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Toggle reasoning visibility.",
|
||||
textAlias: "/reasoning",
|
||||
category: "options",
|
||||
tier: "standard",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -725,6 +767,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Toggle elevated mode.",
|
||||
textAlias: "/elevated",
|
||||
category: "options",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -741,6 +784,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Set exec defaults for this session.",
|
||||
textAlias: "/exec",
|
||||
category: "options",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "host",
|
||||
@@ -775,6 +819,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Show or set the model.",
|
||||
textAlias: "/model",
|
||||
category: "options",
|
||||
tier: "essential",
|
||||
args: [
|
||||
{
|
||||
name: "model",
|
||||
@@ -788,6 +833,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
nativeName: "models",
|
||||
description: "List model providers or provider models.",
|
||||
textAlias: "/models",
|
||||
tier: "standard",
|
||||
argsParsing: "none",
|
||||
acceptsArgs: true,
|
||||
category: "options",
|
||||
@@ -798,6 +844,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
description: "Adjust queue settings.",
|
||||
textAlias: "/queue",
|
||||
category: "options",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "mode",
|
||||
@@ -831,6 +878,7 @@ export function buildBuiltinChatCommands(): ChatCommandDefinition[] {
|
||||
textAlias: "/bash",
|
||||
scope: "text",
|
||||
category: "tools",
|
||||
tier: "power",
|
||||
args: [
|
||||
{
|
||||
name: "command",
|
||||
|
||||
@@ -50,6 +50,7 @@ export type {
|
||||
CommandDetection,
|
||||
CommandNormalizeOptions,
|
||||
CommandScope,
|
||||
CommandTier,
|
||||
NativeCommandSpec,
|
||||
ShouldHandleTextCommandsParams,
|
||||
} from "./commands-registry.types.js";
|
||||
|
||||
@@ -5,6 +5,14 @@ export type { CommandArgValue, CommandArgValues, CommandArgs } from "./commands-
|
||||
|
||||
export type CommandScope = "text" | "native" | "both";
|
||||
|
||||
/**
|
||||
* Controls progressive disclosure of commands in the UI.
|
||||
* - "essential": Always visible (~10 core commands)
|
||||
* - "standard": Shown on expand / "Show more" (~15 commands)
|
||||
* - "power": Only surfaced via search or explicit filter (~15 commands)
|
||||
*/
|
||||
export type CommandTier = "essential" | "standard" | "power";
|
||||
|
||||
export type CommandCategory =
|
||||
| "session"
|
||||
| "options"
|
||||
@@ -57,6 +65,8 @@ export type ChatCommandDefinition = {
|
||||
argsMenu?: CommandArgMenuSpec | "auto";
|
||||
scope: CommandScope;
|
||||
category?: CommandCategory;
|
||||
/** Progressive disclosure tier. Defaults to "standard" when omitted. */
|
||||
tier?: CommandTier;
|
||||
};
|
||||
|
||||
export type NativeCommandSpec = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isPlainObject } from "../utils.js";
|
||||
import { isPlainObject } from "../infra/plain-object.js";
|
||||
import { isBlockedObjectKey } from "./prototype-keys.js";
|
||||
|
||||
type PlainObject = Record<string, unknown>;
|
||||
|
||||
Reference in New Issue
Block a user