mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 04:17:27 +00:00
Discord: add native exec options
This commit is contained in:
@@ -6,6 +6,7 @@ Docs: https://docs.openclaw.ai
|
||||
|
||||
### Changes
|
||||
|
||||
- Discord: expose native `/exec` command options (host/security/ask/node) so Discord slash commands get autocomplete and structured inputs. Thanks @thewilloftheshadow.
|
||||
- Cron/Gateway: separate per-job webhook delivery (`delivery.mode = "webhook"`) from announce delivery, enforce valid HTTP(S) webhook URLs, and keep a temporary legacy `notify + cron.webhook` fallback for stored jobs. (#17901) Thanks @advaitpaliwal.
|
||||
- iOS/Talk: add a `Voice Directive Hint` toggle for Talk Mode prompts so users can disable ElevenLabs voice-switching instructions to save tokens when not needed. (#18250) Thanks @zeulewan.
|
||||
- iOS/Talk: add a `Background Listening` toggle that keeps Talk Mode active while the app is backgrounded (off by default for battery safety). Thanks @zeulewan.
|
||||
|
||||
@@ -90,8 +90,30 @@ const formatQueueArgs: CommandArgsFormatter = (values) => {
|
||||
return parts.length > 0 ? parts.join(" ") : undefined;
|
||||
};
|
||||
|
||||
const formatExecArgs: CommandArgsFormatter = (values) => {
|
||||
const host = normalizeArgValue(values.host);
|
||||
const security = normalizeArgValue(values.security);
|
||||
const ask = normalizeArgValue(values.ask);
|
||||
const node = normalizeArgValue(values.node);
|
||||
const parts: string[] = [];
|
||||
if (host) {
|
||||
parts.push(`host=${host}`);
|
||||
}
|
||||
if (security) {
|
||||
parts.push(`security=${security}`);
|
||||
}
|
||||
if (ask) {
|
||||
parts.push(`ask=${ask}`);
|
||||
}
|
||||
if (node) {
|
||||
parts.push(`node=${node}`);
|
||||
}
|
||||
return parts.length > 0 ? parts.join(" ") : undefined;
|
||||
};
|
||||
|
||||
export const COMMAND_ARG_FORMATTERS: Record<string, CommandArgsFormatter> = {
|
||||
config: formatConfigArgs,
|
||||
debug: formatDebugArgs,
|
||||
queue: formatQueueArgs,
|
||||
exec: formatExecArgs,
|
||||
};
|
||||
|
||||
@@ -529,12 +529,31 @@ function buildChatCommands(): ChatCommandDefinition[] {
|
||||
category: "options",
|
||||
args: [
|
||||
{
|
||||
name: "options",
|
||||
description: "host=... security=... ask=... node=...",
|
||||
name: "host",
|
||||
description: "sandbox, gateway, or node",
|
||||
type: "string",
|
||||
choices: ["sandbox", "gateway", "node"],
|
||||
},
|
||||
{
|
||||
name: "security",
|
||||
description: "deny, allowlist, or full",
|
||||
type: "string",
|
||||
choices: ["deny", "allowlist", "full"],
|
||||
},
|
||||
{
|
||||
name: "ask",
|
||||
description: "off, on-miss, or always",
|
||||
type: "string",
|
||||
choices: ["off", "on-miss", "always"],
|
||||
},
|
||||
{
|
||||
name: "node",
|
||||
description: "Node id or name",
|
||||
type: "string",
|
||||
},
|
||||
],
|
||||
argsParsing: "none",
|
||||
formatArgs: COMMAND_ARG_FORMATTERS.exec,
|
||||
}),
|
||||
defineChatCommand({
|
||||
key: "model",
|
||||
|
||||
Reference in New Issue
Block a user