@elizaos/plugin-commands 2.0.0-alpha.4 → 2.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -151,7 +151,9 @@ var DEFAULT_COMMANDS = [
151
151
  scope: "both",
152
152
  category: "session",
153
153
  acceptsArgs: true,
154
- args: [{ name: "instructions", description: "Optional compaction instructions" }]
154
+ args: [
155
+ { name: "instructions", description: "Optional compaction instructions" }
156
+ ]
155
157
  },
156
158
  {
157
159
  key: "think",
@@ -161,7 +163,9 @@ var DEFAULT_COMMANDS = [
161
163
  scope: "both",
162
164
  category: "options",
163
165
  acceptsArgs: true,
164
- args: [{ name: "level", description: "off, minimal, low, medium, high, xhigh" }]
166
+ args: [
167
+ { name: "level", description: "off, minimal, low, medium, high, xhigh" }
168
+ ]
165
169
  },
166
170
  {
167
171
  key: "verbose",
@@ -413,7 +417,7 @@ function startsWithCommand(text) {
413
417
  if (normalized === alias) {
414
418
  return command;
415
419
  }
416
- if (normalized.startsWith(`${alias} `) || normalized.startsWith(`${alias}:`)) {
420
+ if (normalized.startsWith(alias + " ") || normalized.startsWith(alias + ":")) {
417
421
  return command;
418
422
  }
419
423
  }
@@ -457,7 +461,7 @@ function parseCommand(text, definition) {
457
461
  matchedAlias = alias;
458
462
  break;
459
463
  }
460
- if (trimmed.toLowerCase().startsWith(`${normalized} `) || trimmed.toLowerCase().startsWith(`${normalized}:`)) {
464
+ if (trimmed.toLowerCase().startsWith(normalized + " ") || trimmed.toLowerCase().startsWith(normalized + ":")) {
461
465
  matchedAlias = alias;
462
466
  break;
463
467
  }
@@ -568,12 +572,12 @@ var commandsListAction = {
568
572
  name: "COMMANDS_LIST",
569
573
  description: "List all available commands with their aliases. Only activates for /commands or /cmds slash commands.",
570
574
  similes: ["/commands", "/cmds"],
571
- async validate(_runtime, message) {
575
+ async validate(runtime, message) {
572
576
  const text = message.content?.text ?? "";
573
577
  const detection = detectCommand(text);
574
578
  return detection.isCommand && detection.command?.key === "commands";
575
579
  },
576
- async handler(_runtime, _message, _state, _options, callback) {
580
+ async handler(runtime, message, state, options, callback) {
577
581
  const commands = getEnabledCommands();
578
582
  const lines = [`**Commands (${commands.length}):**
579
583
  `];
@@ -647,12 +651,12 @@ var helpAction = {
647
651
  name: "HELP_COMMAND",
648
652
  description: "Show available commands and their descriptions. Only activates for /help, /h, or /? slash commands.",
649
653
  similes: ["/help", "/h", "/?"],
650
- async validate(_runtime, message) {
654
+ async validate(runtime, message) {
651
655
  const text = message.content?.text ?? "";
652
656
  const detection = detectCommand(text);
653
657
  return detection.isCommand && detection.command?.key === "help";
654
658
  },
655
- async handler(_runtime, _message, _state, _options, callback) {
659
+ async handler(runtime, message, state, options, callback) {
656
660
  const commands = getEnabledCommands();
657
661
  const helpText = formatCommandList(commands);
658
662
  await callback?.({ text: helpText });
@@ -716,12 +720,12 @@ var modelsAction = {
716
720
  name: "MODELS_COMMAND",
717
721
  description: "List available AI models and providers. Only activates for /models slash command.",
718
722
  similes: ["/models"],
719
- async validate(_runtime, message) {
723
+ async validate(runtime, message) {
720
724
  const text = message.content?.text ?? "";
721
725
  const detection = detectCommand(text);
722
726
  return detection.isCommand && detection.command?.key === "models";
723
727
  },
724
- async handler(runtime, _message, _state, _options, callback) {
728
+ async handler(runtime, message, state, options, callback) {
725
729
  const lines = [`**Available Models:**
726
730
  `];
727
731
  try {
@@ -822,12 +826,12 @@ var statusAction = {
822
826
  name: "STATUS_COMMAND",
823
827
  description: "Show session directive settings via /status slash command. Only activates for /status or /s prefix.",
824
828
  similes: ["/status", "/s"],
825
- async validate(_runtime, message) {
829
+ async validate(runtime, message) {
826
830
  const text = message.content?.text ?? "";
827
831
  const detection = detectCommand(text);
828
832
  return detection.isCommand && detection.command?.key === "status";
829
833
  },
830
- async handler(runtime, message, _state, _options, callback) {
834
+ async handler(runtime, message, state, options, callback) {
831
835
  const statusText = await buildStatusReport(runtime, message.roomId);
832
836
  await callback?.({ text: statusText });
833
837
  return {
@@ -860,12 +864,12 @@ var stopAction = {
860
864
  name: "STOP_COMMAND",
861
865
  description: "Stop current operation or abort running tasks. Triggered by /stop, /abort, or /cancel slash commands only.",
862
866
  similes: ["/stop", "/abort", "/cancel"],
863
- async validate(_runtime, message) {
867
+ async validate(runtime, message) {
864
868
  const text = message.content?.text ?? "";
865
869
  const detection = detectCommand(text);
866
870
  return detection.isCommand && ["stop", "abort", "cancel"].includes(detection.command?.key ?? "");
867
871
  },
868
- async handler(runtime, message, _state, _options, callback) {
872
+ async handler(runtime, message, state, options, callback) {
869
873
  try {
870
874
  await runtime.emitEvent(import_core2.EventType.HOOK_COMMAND_STOP, {
871
875
  runtime,
@@ -973,7 +977,13 @@ var commandsPlugin = {
973
977
  name: "commands",
974
978
  description: "Chat command system with /help, /status, /reset, etc.",
975
979
  providers: [commandRegistryProvider],
976
- actions: [helpAction, statusAction, stopAction, modelsAction, commandsListAction],
980
+ actions: [
981
+ helpAction,
982
+ statusAction,
983
+ stopAction,
984
+ modelsAction,
985
+ commandsListAction
986
+ ],
977
987
  config: {
978
988
  COMMANDS_ENABLED: "true",
979
989
  COMMANDS_CONFIG_ENABLED: "false",
@@ -1144,4 +1154,4 @@ var commandsPlugin = {
1144
1154
  };
1145
1155
  var src_default = commandsPlugin;
1146
1156
 
1147
- //# debugId=6FF2A15CEA611B5664756E2164756E21
1157
+ //# debugId=C959FE7FE395530C64756E2164756E21
@@ -2,16 +2,16 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../src/registry.ts", "../../src/parser.ts", "../../src/actions/commands-list.ts", "../../src/actions/help.ts", "../../src/actions/models.ts", "../../src/actions/status.ts", "../../src/actions/stop.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * Plugin Commands - Chat command system for Eliza agents\n *\n * Provides a slash-command system with:\n * - /help, /status, /commands for information\n * - /stop, /reset, /compact for session control\n * - /think, /verbose, /model for options\n * - /allowlist, /approve for management\n * - /tts for media\n * - /bash for tools (elevated)\n *\n * INTEGRATION NOTES:\n * - Commands are registered as Actions with strict validate() that only\n * matches slash-prefixed messages (e.g. /help, !stop). This prevents\n * conflicts with bootstrap actions (STATUS, IGNORE) and messaging plugins.\n * - Similes use ONLY slash-command forms (no natural language) so the LLM\n * won't accidentally route \"I need help\" to HELP_COMMAND instead of REPLY.\n * - The registry is scoped per runtime to prevent cross-agent state leaks.\n * - The COMMAND_REGISTRY provider includes the command list in the LLM context\n * ONLY when the message is a command, reducing prompt noise for normal messages.\n */\n\nimport {\n type IAgentRuntime,\n logger,\n type Memory,\n type Plugin,\n type Provider,\n type ProviderResult,\n type State,\n} from \"@elizaos/core\";\n// Import actions\nimport { commandsListAction } from \"./actions/commands-list\";\nimport { helpAction } from \"./actions/help\";\nimport { modelsAction } from \"./actions/models\";\nimport { statusAction } from \"./actions/status\";\nimport { stopAction } from \"./actions/stop\";\nimport { detectCommand, hasCommand, normalizeCommandBody } from \"./parser\";\nimport {\n findCommandByAlias,\n findCommandByKey,\n getCommandsByCategory,\n getEnabledCommands,\n initForRuntime,\n registerCommand,\n unregisterCommand,\n useRuntime,\n} from \"./registry\";\nimport type { CommandContext, CommandDefinition, CommandResult } from \"./types\";\n\nexport * from \"./parser\";\nexport * from \"./registry\";\n// Re-export everything\nexport * from \"./types\";\n\n/**\n * Provider that exposes available commands to the LLM context.\n *\n * Only injects the full command list when the message looks like a command.\n * For normal messages, returns a minimal hint so the LLM knows commands\n * exist but doesn't get a wall of command documentation in its context.\n */\nexport const commandRegistryProvider: Provider = {\n name: \"COMMAND_REGISTRY\",\n description: \"Available chat commands and their descriptions\",\n dynamic: true,\n\n async get(runtime: IAgentRuntime, message: Memory, _state: State): Promise<ProviderResult> {\n // Scope to the correct runtime's command store\n useRuntime(runtime.agentId);\n\n const text = message.content?.text ?? \"\";\n const isCommand = hasCommand(text);\n const commands = getEnabledCommands();\n\n if (isCommand) {\n // Full command context for command messages — helps the LLM select\n // the right action\n const commandList = commands.map((cmd) => {\n const auth = cmd.requiresAuth ? \" (requires auth)\" : \"\";\n return `- ${cmd.textAliases[0]}: ${cmd.description}${auth}`;\n });\n\n return {\n text: `The user sent a slash command. Available commands:\\n${commandList.join(\"\\n\")}\\n\\nIMPORTANT: This is a slash command — respond by executing the matching command action, not with conversational text.`,\n values: {\n commandCount: commands.length,\n isCommand: true,\n hasElevatedCommands: commands.some((c) => c.requiresElevated),\n },\n data: { commands, isCommand: true },\n };\n }\n\n // Minimal context for non-command messages — don't pollute the prompt\n return {\n text: \"\",\n values: {\n commandCount: commands.length,\n isCommand: false,\n },\n data: { isCommand: false },\n };\n },\n};\n\n/**\n * Format command result for display\n */\nexport function formatCommandResult(result: CommandResult): string {\n if (result.error) {\n return `Error: ${result.error}`;\n }\n return result.reply ?? \"Command executed\";\n}\n\n/**\n * Check if a sender is authorized\n */\nexport function isAuthorized(context: CommandContext, command: CommandDefinition): boolean {\n if (!command.requiresAuth) {\n return true;\n }\n return context.isAuthorized;\n}\n\n/**\n * Check if a sender has elevated permissions\n */\nexport function isElevated(context: CommandContext, command: CommandDefinition): boolean {\n if (!command.requiresElevated) {\n return true;\n }\n return context.isElevated;\n}\n\n/**\n * Plugin Commands\n *\n * Provides chat commands as Eliza actions. Commands are detected\n * by their text aliases (e.g., /help, /status) and executed as actions.\n *\n * Design decisions for messaging integration:\n * 1. Actions use strict validate() — only true for slash-prefixed messages\n * 2. Similes are slash-only — no natural language to prevent LLM misrouting\n * 3. Provider is context-aware — full docs for commands, empty for normal msgs\n * 4. Registry is scoped per agentId — no cross-agent contamination\n * 5. Events use proper EventType enums — not raw strings\n */\nexport const commandsPlugin: Plugin = {\n name: \"commands\",\n description: \"Chat command system with /help, /status, /reset, etc.\",\n\n providers: [commandRegistryProvider],\n\n actions: [helpAction, statusAction, stopAction, modelsAction, commandsListAction],\n\n config: {\n COMMANDS_ENABLED: \"true\",\n COMMANDS_CONFIG_ENABLED: \"false\",\n COMMANDS_DEBUG_ENABLED: \"false\",\n COMMANDS_BASH_ENABLED: \"false\",\n COMMANDS_RESTART_ENABLED: \"true\",\n },\n\n tests: [\n {\n name: \"command-detection\",\n tests: [\n {\n name: \"Detect command prefix\",\n fn: async (_runtime: IAgentRuntime) => {\n if (!hasCommand(\"/help\")) {\n throw new Error(\"Should detect /help command\");\n }\n if (!hasCommand(\"/status test\")) {\n throw new Error(\"Should detect /status with args\");\n }\n if (hasCommand(\"hello world\")) {\n throw new Error(\"Should not detect plain text as command\");\n }\n logger.success(\"Command prefix detection works correctly\");\n },\n },\n {\n name: \"Parse command with args\",\n fn: async (_runtime: IAgentRuntime) => {\n const detection = detectCommand(\"/think:high\");\n if (!detection.isCommand) {\n throw new Error(\"Should detect think command\");\n }\n if (detection.command?.key !== \"think\") {\n throw new Error(`Expected key 'think', got '${detection.command?.key}'`);\n }\n if (detection.command?.args[0] !== \"high\") {\n throw new Error(`Expected arg 'high', got '${detection.command?.args[0]}'`);\n }\n logger.success(\"Command argument parsing works correctly\");\n },\n },\n {\n name: \"Normalize command body\",\n fn: async (_runtime: IAgentRuntime) => {\n const normalized1 = normalizeCommandBody(\"/status: test\");\n if (normalized1 !== \"/status test\") {\n throw new Error(`Expected '/status test', got '${normalized1}'`);\n }\n\n const normalized2 = normalizeCommandBody(\"@bot /help\", \"bot\");\n if (normalized2 !== \"/help\") {\n throw new Error(`Expected '/help', got '${normalized2}'`);\n }\n\n logger.success(\"Command normalization works correctly\");\n },\n },\n {\n name: \"Find command by alias\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByAlias(\"/h\");\n if (!cmd) {\n throw new Error(\"Should find help command by /h alias\");\n }\n if (cmd.key !== \"help\") {\n throw new Error(`Expected key 'help', got '${cmd.key}'`);\n }\n logger.success(\"Command alias lookup works correctly\");\n },\n },\n {\n name: \"Find command by key\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByKey(\"status\");\n if (!cmd) {\n throw new Error(\"Should find status command by key\");\n }\n if (cmd.key !== \"status\") {\n throw new Error(`Expected key 'status', got '${cmd.key}'`);\n }\n logger.success(\"Command key lookup works correctly\");\n },\n },\n ],\n },\n {\n name: \"command-registry\",\n tests: [\n {\n name: \"Get enabled commands\",\n fn: async (_runtime: IAgentRuntime) => {\n const commands = getEnabledCommands();\n if (commands.length === 0) {\n throw new Error(\"Should have enabled commands\");\n }\n // Check some expected commands exist\n const cmdHelp = commands.some((c) => c.key === \"help\");\n const cmdStatus = commands.some((c) => c.key === \"status\");\n if (!cmdHelp || !cmdStatus) {\n throw new Error(\"Should have help and status commands\");\n }\n logger.success(\"Command registry works correctly\");\n },\n },\n {\n name: \"Register custom command\",\n fn: async (_runtime: IAgentRuntime) => {\n const customCmd: CommandDefinition = {\n key: \"test-custom\",\n description: \"Test custom command\",\n textAliases: [\"/test-custom\", \"/tc\"],\n scope: \"text\",\n };\n\n registerCommand(customCmd);\n const found = findCommandByKey(\"test-custom\");\n if (!found) {\n throw new Error(\"Should find registered custom command\");\n }\n\n unregisterCommand(\"test-custom\");\n const notFound = findCommandByKey(\"test-custom\");\n if (notFound) {\n throw new Error(\"Should not find unregistered command\");\n }\n\n logger.success(\"Custom command registration works correctly\");\n },\n },\n {\n name: \"Get commands by category\",\n fn: async (_runtime: IAgentRuntime) => {\n const statusCommands = getCommandsByCategory(\"status\");\n if (statusCommands.length === 0) {\n throw new Error(\"Should have status category commands\");\n }\n const allStatus = statusCommands.every((c) => c.category === \"status\");\n if (!allStatus) {\n throw new Error(\"All returned commands should be in status category\");\n }\n logger.success(\"Command categorization works correctly\");\n },\n },\n ],\n },\n ],\n\n async init(config, runtime) {\n logger.log(\"[plugin-commands] Initializing command system\");\n\n // Initialize an isolated command store for this runtime\n // This prevents cross-agent contamination in multi-agent deployments\n initForRuntime(runtime.agentId);\n\n // Configure command enablement from config\n const configEnabled = config.COMMANDS_CONFIG_ENABLED === \"true\";\n const debugEnabled = config.COMMANDS_DEBUG_ENABLED === \"true\";\n const bashEnabled = config.COMMANDS_BASH_ENABLED === \"true\";\n const restartEnabled = config.COMMANDS_RESTART_ENABLED !== \"false\";\n\n // Update command enabled states (now on the isolated copy)\n const configCmd = findCommandByKey(\"config\");\n if (configCmd) {\n configCmd.enabled = configEnabled;\n }\n\n const debugCmd = findCommandByKey(\"debug\");\n if (debugCmd) {\n debugCmd.enabled = debugEnabled;\n }\n\n const bashCmd = findCommandByKey(\"bash\");\n if (bashCmd) {\n bashCmd.enabled = bashEnabled;\n }\n\n const restartCmd = findCommandByKey(\"restart\");\n if (restartCmd) {\n restartCmd.enabled = restartEnabled;\n }\n\n const enabledCount = getEnabledCommands().length;\n logger.log(`[plugin-commands] ${enabledCount} commands enabled for agent ${runtime.agentId}`);\n },\n};\n\nexport default commandsPlugin;\n",
6
- "/**\n * Command registry - defines all available chat commands\n *\n * IMPORTANT: The registry uses module-level state for convenience, but\n * provides `cloneCommands()` and `resetCommands()` so that `init()` can\n * work on isolated copies per runtime. The `init()` function in the main\n * plugin file should clone before mutating to avoid cross-agent contamination.\n */\n\nimport type { CommandDefinition } from \"./types\";\n\n// Default command definitions (frozen reference — never mutate these directly)\nconst DEFAULT_COMMANDS: ReadonlyArray<CommandDefinition> = [\n // Status commands\n {\n key: \"help\",\n nativeName: \"help\",\n description: \"Show available commands\",\n textAliases: [\"/help\", \"/h\", \"/?\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"commands\",\n nativeName: \"commands\",\n description: \"List all commands\",\n textAliases: [\"/commands\", \"/cmds\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"status\",\n nativeName: \"status\",\n description: \"Show current session status\",\n textAliases: [\"/status\", \"/s\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"context\",\n nativeName: \"context\",\n description: \"Show current context information\",\n textAliases: [\"/context\", \"/ctx\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: true,\n args: [{ name: \"mode\", description: \"Output mode (list, detail, json)\" }],\n },\n {\n key: \"whoami\",\n nativeName: \"whoami\",\n description: \"Show your identity information\",\n textAliases: [\"/whoami\", \"/who\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n\n // Session commands\n {\n key: \"stop\",\n nativeName: \"stop\",\n description: \"Stop current operation\",\n textAliases: [\"/stop\", \"/abort\", \"/cancel\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"restart\",\n nativeName: \"restart\",\n description: \"Restart the session\",\n textAliases: [\"/restart\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"reset\",\n nativeName: \"reset\",\n description: \"Reset session state\",\n textAliases: [\"/reset\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"new\",\n nativeName: \"new\",\n description: \"Start a new conversation\",\n textAliases: [\"/new\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"compact\",\n nativeName: \"compact\",\n description: \"Compact conversation history\",\n textAliases: [\"/compact\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: true,\n args: [{ name: \"instructions\", description: \"Optional compaction instructions\" }],\n },\n\n // Options commands\n {\n key: \"think\",\n nativeName: \"think\",\n description: \"Set thinking level\",\n textAliases: [\"/think\", \"/thinking\", \"/t\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, minimal, low, medium, high, xhigh\" }],\n },\n {\n key: \"verbose\",\n nativeName: \"verbose\",\n description: \"Set verbose output level\",\n textAliases: [\"/verbose\", \"/v\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, full\" }],\n },\n {\n key: \"reasoning\",\n nativeName: \"reasoning\",\n description: \"Set reasoning visibility\",\n textAliases: [\"/reasoning\", \"/reason\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, stream\" }],\n },\n {\n key: \"elevated\",\n nativeName: \"elevated\",\n description: \"Set elevated permission mode\",\n textAliases: [\"/elevated\", \"/elev\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, ask, full\" }],\n requiresAuth: true,\n },\n {\n key: \"model\",\n nativeName: \"model\",\n description: \"Set or show current model\",\n textAliases: [\"/model\", \"/m\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"model\", description: \"provider/model or alias\" }],\n },\n {\n key: \"models\",\n nativeName: \"models\",\n description: \"List available models\",\n textAliases: [\"/models\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"usage\",\n nativeName: \"usage\",\n description: \"Show token usage\",\n textAliases: [\"/usage\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"queue\",\n nativeName: \"queue\",\n description: \"Set queue mode\",\n textAliases: [\"/queue\", \"/q\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [\n {\n name: \"mode\",\n description: \"steer, followup, collect, interrupt, or options\",\n },\n ],\n },\n\n // Management commands\n {\n key: \"allowlist\",\n nativeName: \"allowlist\",\n description: \"Manage sender allowlist\",\n textAliases: [\"/allowlist\", \"/allow\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"action\", description: \"list, add, remove\" },\n { name: \"value\", description: \"sender to add/remove\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"approve\",\n nativeName: \"approve\",\n description: \"Approve or deny a pending action\",\n textAliases: [\"/approve\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"id\", description: \"Approval ID\", required: true },\n { name: \"action\", description: \"allow-once, allow-always, deny\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"subagents\",\n nativeName: \"subagents\",\n description: \"Manage subagents\",\n textAliases: [\"/subagents\", \"/sub\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [{ name: \"action\", description: \"list, stop, log, info, send\" }],\n requiresAuth: true,\n },\n {\n key: \"config\",\n nativeName: \"config\",\n description: \"View or set configuration\",\n textAliases: [\"/config\", \"/cfg\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"key\", description: \"Configuration key\" },\n { name: \"value\", description: \"Value to set\" },\n ],\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n {\n key: \"debug\",\n nativeName: \"debug\",\n description: \"Debug information\",\n textAliases: [\"/debug\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n\n // Media commands\n {\n key: \"tts\",\n nativeName: \"tts\",\n description: \"Text-to-speech settings\",\n textAliases: [\"/tts\", \"/voice\"],\n scope: \"both\",\n category: \"media\",\n acceptsArgs: true,\n args: [\n {\n name: \"action\",\n description: \"on, off, status, provider, limit, audio\",\n },\n ],\n },\n\n // Tools commands\n {\n key: \"bash\",\n nativeName: \"bash\",\n description: \"Execute shell command\",\n textAliases: [\"/bash\", \"/sh\", \"/!\"],\n scope: \"text\",\n category: \"tools\",\n acceptsArgs: true,\n args: [\n {\n name: \"command\",\n description: \"Shell command to execute\",\n captureRemaining: true,\n },\n ],\n requiresAuth: true,\n requiresElevated: true,\n },\n];\n\n// ── Per-runtime command storage ──────────────────────────────────────────\n// Each agent runtime gets its own isolated command set via `initForRuntime()`.\n// The module-level state is used as a fallback for convenience (tests, etc.).\n//\n// Why a WeakMap? Agent runtimes may be created/destroyed; we don't want to\n// leak memory by holding strong references to disposed runtimes.\n\ninterface CommandStore {\n commands: CommandDefinition[];\n aliasMap: Map<string, CommandDefinition> | null;\n}\n\n/** Per-runtime stores keyed by agentId */\nconst runtimeStores = new Map<string, CommandStore>();\n/** Fallback store for when no runtime context is set */\nconst fallbackStore: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n};\n/** Currently active store (set during init, reset on test teardown) */\nlet activeStore: CommandStore = fallbackStore;\n\n/**\n * Initialize an isolated command store for a specific runtime.\n * Called from plugin init() to prevent cross-agent contamination.\n */\nexport function initForRuntime(agentId: string): void {\n const store: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n };\n runtimeStores.set(agentId, store);\n activeStore = store;\n}\n\n/**\n * Set the active command store for a given runtime.\n * Providers and actions should call this before accessing commands.\n */\nexport function useRuntime(agentId: string): void {\n const store = runtimeStores.get(agentId);\n if (store) {\n activeStore = store;\n }\n}\n\n/**\n * Get all registered commands\n */\nexport function getCommands(): CommandDefinition[] {\n return [...activeStore.commands];\n}\n\n/**\n * Get enabled commands\n */\nexport function getEnabledCommands(): CommandDefinition[] {\n return activeStore.commands.filter((cmd) => cmd.enabled !== false);\n}\n\n/**\n * Get commands by category\n */\nexport function getCommandsByCategory(category: string): CommandDefinition[] {\n return activeStore.commands.filter((cmd) => cmd.category === category && cmd.enabled !== false);\n}\n\n/**\n * Register a custom command\n */\nexport function registerCommand(command: CommandDefinition): void {\n // Remove existing command with same key\n activeStore.commands = activeStore.commands.filter((c) => c.key !== command.key);\n activeStore.commands.push(command);\n activeStore.aliasMap = null; // Invalidate cache\n}\n\n/**\n * Register multiple commands\n */\nexport function registerCommands(newCommands: CommandDefinition[]): void {\n for (const command of newCommands) {\n registerCommand(command);\n }\n}\n\n/**\n * Unregister a command\n */\nexport function unregisterCommand(key: string): void {\n activeStore.commands = activeStore.commands.filter((c) => c.key !== key);\n activeStore.aliasMap = null;\n}\n\n/**\n * Reset to default commands (for the active store)\n */\nexport function resetCommands(): void {\n activeStore.commands = DEFAULT_COMMANDS.map((c) => ({ ...c }));\n activeStore.aliasMap = null;\n}\n\n/**\n * Build and cache alias map for the active store\n */\nfunction getAliasMap(): Map<string, CommandDefinition> {\n if (activeStore.aliasMap) return activeStore.aliasMap;\n\n activeStore.aliasMap = new Map();\n for (const command of activeStore.commands) {\n if (command.enabled === false) continue;\n\n for (const alias of command.textAliases) {\n const normalized = alias.toLowerCase().trim();\n if (!activeStore.aliasMap.has(normalized)) {\n activeStore.aliasMap.set(normalized, command);\n }\n }\n }\n return activeStore.aliasMap;\n}\n\n/**\n * Find command by alias\n */\nexport function findCommandByAlias(alias: string): CommandDefinition | undefined {\n const map = getAliasMap();\n return map.get(alias.toLowerCase().trim());\n}\n\n/**\n * Find command by key\n */\nexport function findCommandByKey(key: string): CommandDefinition | undefined {\n return activeStore.commands.find((c) => c.key === key);\n}\n\n/**\n * Check if text starts with any command alias\n */\nexport function startsWithCommand(text: string): CommandDefinition | undefined {\n const map = getAliasMap();\n const normalized = text.toLowerCase().trim();\n\n // Check exact match first\n for (const [alias, command] of map) {\n if (normalized === alias) {\n return command;\n }\n if (normalized.startsWith(`${alias} `) || normalized.startsWith(`${alias}:`)) {\n return command;\n }\n }\n\n return undefined;\n}\n",
7
- "/**\n * Command parser - detects and parses commands from message text\n */\n\nimport { startsWithCommand } from \"./registry\";\nimport type { CommandDefinition, CommandDetectionResult, ParsedCommand } from \"./types\";\n\nconst escapeRegExp = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Check if text contains a command\n */\nexport function hasCommand(text: string): boolean {\n if (!text) return false;\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) return false;\n return Boolean(startsWithCommand(trimmed));\n}\n\n/**\n * Detect command in text\n */\nexport function detectCommand(text: string): CommandDetectionResult {\n if (!text) {\n return { isCommand: false };\n }\n\n const trimmed = text.trim();\n\n // Quick check for command prefix\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) {\n return { isCommand: false };\n }\n\n const command = startsWithCommand(trimmed);\n if (!command) {\n return { isCommand: false };\n }\n\n const parsed = parseCommand(trimmed, command);\n if (!parsed) {\n return { isCommand: false };\n }\n\n return { isCommand: true, command: parsed };\n}\n\n/**\n * Parse a command from text\n */\nexport function parseCommand(text: string, definition: CommandDefinition): ParsedCommand | null {\n const trimmed = text.trim();\n\n // Find the matching alias\n let matchedAlias: string | null = null;\n for (const alias of definition.textAliases) {\n const normalized = alias.toLowerCase();\n if (trimmed.toLowerCase() === normalized) {\n matchedAlias = alias;\n break;\n }\n if (\n trimmed.toLowerCase().startsWith(`${normalized} `) ||\n trimmed.toLowerCase().startsWith(`${normalized}:`)\n ) {\n matchedAlias = alias;\n break;\n }\n }\n\n if (!matchedAlias) {\n return null;\n }\n\n // Extract arguments\n let rawArgs = trimmed.slice(matchedAlias.length).trim();\n\n // Handle colon separator (e.g., /think:high)\n if (rawArgs.startsWith(\":\")) {\n rawArgs = rawArgs.slice(1).trim();\n }\n\n // Parse arguments\n const args = parseArgs(rawArgs, definition);\n\n return {\n key: definition.key,\n canonical: definition.textAliases[0] ?? `/${definition.key}`,\n args,\n rawArgs: rawArgs || undefined,\n };\n}\n\n/**\n * Parse arguments based on command definition\n */\nfunction parseArgs(rawArgs: string, definition: CommandDefinition): string[] {\n if (!rawArgs || !definition.acceptsArgs) {\n return [];\n }\n\n const parsing = definition.argsParsing ?? \"positional\";\n\n if (parsing === \"none\") {\n // Return entire string as single argument\n return rawArgs ? [rawArgs] : [];\n }\n\n // Positional parsing\n const args: string[] = [];\n const argDefs = definition.args ?? [];\n\n // Split by whitespace, respecting quotes\n const tokens = tokenize(rawArgs);\n\n for (let i = 0; i < tokens.length; i++) {\n const argDef = argDefs[i];\n\n // If this arg captures remaining, join all remaining tokens\n if (argDef?.captureRemaining) {\n args.push(tokens.slice(i).join(\" \"));\n break;\n }\n\n args.push(tokens[i]);\n }\n\n return args;\n}\n\n/**\n * Tokenize argument string, respecting quotes\n */\nfunction tokenize(input: string): string[] {\n const tokens: string[] = [];\n let current = \"\";\n let inQuote = false;\n let quoteChar = \"\";\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n\n if (inQuote) {\n if (char === quoteChar) {\n inQuote = false;\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n } else if (char === '\"' || char === \"'\") {\n inQuote = true;\n quoteChar = char;\n } else if (/\\s/.test(char)) {\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n }\n\n if (current) {\n tokens.push(current);\n }\n\n return tokens;\n}\n\n/**\n * Normalize command body (handle bot mentions, colon syntax, etc.)\n */\nexport function normalizeCommandBody(text: string, botMention?: string): string {\n let normalized = text.trim();\n\n // Remove bot mention prefix (e.g., \"@bot /status\" -> \"/status\")\n if (botMention) {\n const mentionPattern = new RegExp(`^@${escapeRegExp(botMention)}\\\\s*`, \"i\");\n normalized = normalized.replace(mentionPattern, \"\");\n }\n\n // Handle colon in command (e.g., \"/command: args\" -> \"/command args\")\n normalized = normalized.replace(/^(\\/\\w+):\\s*/, \"$1 \");\n\n return normalized.trim();\n}\n\n/**\n * Check if text is a command-only message (no other content)\n */\nexport function isCommandOnly(text: string): boolean {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return false;\n }\n\n // If there's no rawArgs, it's command-only\n if (!detection.command.rawArgs) {\n return true;\n }\n\n // Check if rawArgs is just whitespace\n return detection.command.rawArgs.trim().length === 0;\n}\n\n/**\n * Get command and remaining text\n */\nexport function extractCommand(\n text: string\n): { command: ParsedCommand; remainingText: string } | null {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return null;\n }\n\n const { command } = detection;\n\n // For commands that don't accept args, remaining text is everything after the command\n if (!command.rawArgs) {\n return { command, remainingText: \"\" };\n }\n\n return { command, remainingText: command.rawArgs };\n}\n",
8
- "/**\n * Commands list action\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\nimport { getEnabledCommands } from \"../registry\";\n\nexport const commandsListAction: Action = {\n name: \"COMMANDS_LIST\",\n description:\n \"List all available commands with their aliases. Only activates for /commands or /cmds slash commands.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/commands\", \"/cmds\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"commands\";\n },\n\n async handler(_runtime: IAgentRuntime, _message: Memory, _state, _options, callback) {\n const commands = getEnabledCommands();\n const lines: string[] = [`**Commands (${commands.length}):**\\n`];\n\n for (const cmd of commands) {\n const aliases = cmd.textAliases.join(\", \");\n const authNote = cmd.requiresAuth ? \" [auth]\" : \"\";\n const elevatedNote = cmd.requiresElevated ? \" [elevated]\" : \"\";\n lines.push(`• **${cmd.key}**: ${aliases}${authNote}${elevatedNote}`);\n }\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/commands\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Commands (15):**\\n\\n• **help**: /help, /h, /?\\n• **status**: /status, /s...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
9
- "/**\n * Help command action\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\nimport { getEnabledCommands } from \"../registry\";\n\n/**\n * Format command list for help display\n */\nfunction formatCommandList(commands: ReturnType<typeof getEnabledCommands>): string {\n const lines: string[] = [\"**Available Commands:**\\n\"];\n\n const categories = [\n { key: \"status\", name: \"Status\" },\n { key: \"session\", name: \"Session\" },\n { key: \"options\", name: \"Options\" },\n { key: \"management\", name: \"Management\" },\n { key: \"media\", name: \"Media\" },\n { key: \"tools\", name: \"Tools\" },\n ];\n\n for (const cat of categories) {\n const catCommands = commands.filter((c) => c.category === cat.key);\n if (catCommands.length === 0) continue;\n\n lines.push(`\\n**${cat.name}:**`);\n for (const cmd of catCommands) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n // Add uncategorized commands\n const uncategorized = commands.filter((c) => !c.category);\n if (uncategorized.length > 0) {\n lines.push(\"\\n**Other:**\");\n for (const cmd of uncategorized) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const helpAction: Action = {\n name: \"HELP_COMMAND\",\n description:\n \"Show available commands and their descriptions. Only activates for /help, /h, or /? slash commands.\",\n // Only slash-command similes — \"help\" or \"show help\" as natural language\n // should be handled by the LLM's normal response, not this action\n similes: [\"/help\", \"/h\", \"/?\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"help\";\n },\n\n async handler(_runtime: IAgentRuntime, _message: Memory, _state, _options, callback) {\n const commands = getEnabledCommands();\n const helpText = formatCommandList(commands);\n\n await callback?.({ text: helpText });\n\n return {\n success: true,\n text: helpText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/help\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/?\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
10
- "/**\n * Models command action\n *\n * Queries the runtime for actually registered model handlers instead of\n * using a hardcoded list. Falls back to listing registered model types\n * when detailed model info is not available.\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { logger, ModelType } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\n/**\n * Describe a ModelType value in a user-friendly way\n */\nfunction describeModelType(modelType: string): string {\n const descriptions: Record<string, string> = {\n [ModelType.TEXT_SMALL]: \"Text (Small)\",\n [ModelType.TEXT_LARGE]: \"Text (Large)\",\n [ModelType.TEXT_REASONING_SMALL]: \"Reasoning (Small)\",\n [ModelType.TEXT_REASONING_LARGE]: \"Reasoning (Large)\",\n [ModelType.TEXT_COMPLETION]: \"Text Completion\",\n [ModelType.TEXT_EMBEDDING]: \"Embedding\",\n [ModelType.IMAGE]: \"Image Generation\",\n [ModelType.IMAGE_DESCRIPTION]: \"Image Description\",\n [ModelType.TRANSCRIPTION]: \"Transcription\",\n [ModelType.TEXT_TO_SPEECH]: \"Text-to-Speech\",\n [ModelType.AUDIO]: \"Audio\",\n [ModelType.VIDEO]: \"Video\",\n [ModelType.OBJECT_SMALL]: \"Object (Small)\",\n [ModelType.OBJECT_LARGE]: \"Object (Large)\",\n [ModelType.RESEARCH]: \"Research\",\n };\n return descriptions[modelType] ?? modelType;\n}\n\nexport const modelsAction: Action = {\n name: \"MODELS_COMMAND\",\n description: \"List available AI models and providers. Only activates for /models slash command.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/models\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"models\";\n },\n\n async handler(runtime: IAgentRuntime, _message: Memory, _state, _options, callback) {\n const lines: string[] = [\"**Available Models:**\\n\"];\n\n // Query runtime for registered model handlers\n try {\n const registeredTypes: string[] = [];\n const seen = new Set<string>();\n\n // Check each ModelType to see if a handler is registered.\n // Deduplicate since ModelType has legacy aliases (SMALL, MEDIUM, LARGE)\n // that map to the same underlying values.\n for (const modelType of Object.values(ModelType)) {\n if (seen.has(modelType)) continue;\n seen.add(modelType);\n try {\n // runtime.getModel() returns the handler or undefined\n const handler = runtime.getModel(modelType);\n if (handler) {\n registeredTypes.push(modelType);\n }\n } catch {\n // Model type not registered\n }\n }\n\n if (registeredTypes.length > 0) {\n lines.push(\"**Registered Model Types:**\");\n for (const modelType of registeredTypes) {\n lines.push(`• ${describeModelType(modelType)} (\\`${modelType}\\`)`);\n }\n } else {\n lines.push(\"No model handlers are currently registered.\");\n }\n\n // Show current model settings if available\n const modelProvider = runtime.getSetting(\"MODEL_PROVIDER\");\n const modelName = runtime.getSetting(\"MODEL_NAME\");\n if (modelProvider || modelName) {\n lines.push(\"\\n**Current Configuration:**\");\n if (modelProvider) lines.push(`• Provider: ${modelProvider}`);\n if (modelName) lines.push(`• Model: ${modelName}`);\n }\n } catch (err) {\n logger.warn({ src: \"plugin-commands\", err }, \"Error querying runtime models\");\n lines.push(\"Unable to query available models.\");\n }\n\n lines.push(\"\\n\\n_Use /model <provider/model> to switch models._\");\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/models\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Models:**\\n\\n**Registered Model Types:**\\n• Text (Large) (`text_large`)\\n• Text (Small) (`text_small`)...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
11
- "/**\n * Status command action\n *\n * This is the SLASH COMMAND version (/status, /s). It is distinct from the\n * bootstrap STATUS action which handles natural language like \"what's your status?\".\n *\n * Key differences:\n * - This action ONLY activates for /status or /s slash commands (validate checks prefix)\n * - Bootstrap STATUS handles conversational requests about agent state\n * - This action shows directive/session settings; bootstrap STATUS shows tasks/room info\n * - No natural language similes to prevent conflict with bootstrap STATUS\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\ninterface DirectiveModelState {\n provider?: string;\n model?: string;\n}\n\ninterface DirectiveSessionState {\n thinking: string | boolean;\n verbose: boolean | string;\n reasoning: boolean | string;\n elevated: boolean | string;\n model?: DirectiveModelState;\n}\n\ninterface DirectiveParserService {\n getSessionState?: (roomId: string) => DirectiveSessionState | undefined;\n}\n\n/**\n * Build status report including directive state\n */\nasync function buildStatusReport(runtime: IAgentRuntime, roomId: string): Promise<string> {\n const lines: string[] = [\"**Session Status:**\\n\"];\n\n // Agent info\n lines.push(`**Agent:** ${runtime.character.name ?? runtime.agentId}`);\n lines.push(`**Room:** ${roomId}`);\n\n // Try to get directive state from plugin-directives if available\n try {\n const directiveService = runtime.getService<DirectiveParserService>(\"directive-parser\");\n if (directiveService) {\n const state = directiveService.getSessionState?.(roomId);\n if (state) {\n lines.push(`\\n**Directives:**`);\n lines.push(`• Thinking: ${state.thinking}`);\n lines.push(`• Verbose: ${state.verbose}`);\n lines.push(`• Reasoning: ${state.reasoning}`);\n lines.push(`• Elevated: ${state.elevated}`);\n if (state.model?.provider || state.model?.model) {\n const modelStr = state.model.provider\n ? `${state.model.provider}/${state.model.model}`\n : state.model.model;\n lines.push(`• Model: ${modelStr}`);\n }\n }\n }\n } catch {\n // Directive plugin not available\n }\n\n // Get pending tasks count for context\n try {\n const tasks = await runtime.getTasks({ roomId });\n if (tasks.length > 0) {\n lines.push(`\\n**Tasks:** ${tasks.length} pending`);\n }\n } catch {\n // Task retrieval may not be available\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const statusAction: Action = {\n // Deliberately distinct from bootstrap's \"STATUS\" action name\n // Normalized: \"statuscommand\" vs \"status\" — no exact match collision\n name: \"STATUS_COMMAND\",\n description:\n \"Show session directive settings via /status slash command. Only activates for /status or /s prefix.\",\n // Only slash-command similes — no natural language to avoid stealing\n // from bootstrap STATUS which handles \"what's your status?\" etc.\n similes: [\"/status\", \"/s\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"status\";\n },\n\n async handler(runtime: IAgentRuntime, message: Memory, _state, _options, callback) {\n const statusText = await buildStatusReport(runtime, message.roomId);\n\n await callback?.({ text: statusText });\n\n return {\n success: true,\n text: statusText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/status\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Session Status:**\\n\\n**Agent:** Eliza\\n**Room:** room-456\\n\\n**Directives:**\\n• Thinking: low...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
12
- "/**\n * Stop command action\n *\n * Uses EventType.HOOK_COMMAND_STOP from @elizaos/core for proper integration\n * with the messaging pipeline and hook system.\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { EventType, logger } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\nexport const stopAction: Action = {\n name: \"STOP_COMMAND\",\n description:\n \"Stop current operation or abort running tasks. Triggered by /stop, /abort, or /cancel slash commands only.\",\n // Only use slash-command similes to avoid matching natural language\n // like \"stop talking\" or \"cancel that\" which should go to bootstrap IGNORE\n similes: [\"/stop\", \"/abort\", \"/cancel\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n const detection = detectCommand(text);\n return (\n detection.isCommand && [\"stop\", \"abort\", \"cancel\"].includes(detection.command?.key ?? \"\")\n );\n },\n\n async handler(runtime: IAgentRuntime, message: Memory, _state, _options, callback) {\n // Emit the proper hook event for the stop command.\n // HookCommandPayload extends HookEventPayload which requires sessionKey,\n // messages, timestamp, context. The runtime injects itself automatically.\n try {\n await runtime.emitEvent(EventType.HOOK_COMMAND_STOP, {\n runtime,\n sessionKey: message.roomId,\n messages: [],\n timestamp: new Date(),\n context: {\n entityId: message.entityId,\n source: message.content?.source,\n },\n command: \"stop\" as const,\n senderId: message.entityId,\n commandSource: message.content?.source,\n });\n } catch (err) {\n logger.warn({ src: \"plugin-commands\", err }, \"Failed to emit HOOK_COMMAND_STOP event\");\n }\n\n const replyText = \"✓ Stop requested. Current operations will be cancelled.\";\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/stop\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/abort\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n"
5
+ "/**\n * Plugin Commands - Chat command system for Eliza agents\n *\n * Provides a slash-command system with:\n * - /help, /status, /commands for information\n * - /stop, /reset, /compact for session control\n * - /think, /verbose, /model for options\n * - /allowlist, /approve for management\n * - /tts for media\n * - /bash for tools (elevated)\n *\n * INTEGRATION NOTES:\n * - Commands are registered as Actions with strict validate() that only\n * matches slash-prefixed messages (e.g. /help, !stop). This prevents\n * conflicts with bootstrap actions (STATUS, IGNORE) and messaging plugins.\n * - Similes use ONLY slash-command forms (no natural language) so the LLM\n * won't accidentally route \"I need help\" to HELP_COMMAND instead of REPLY.\n * - The registry is scoped per runtime to prevent cross-agent state leaks.\n * - The COMMAND_REGISTRY provider includes the command list in the LLM context\n * ONLY when the message is a command, reducing prompt noise for normal messages.\n */\n\nimport {\n type IAgentRuntime,\n type Plugin,\n type Provider,\n type ProviderResult,\n type State,\n type Memory,\n logger,\n} from \"@elizaos/core\";\n\nimport {\n detectCommand,\n hasCommand,\n normalizeCommandBody,\n parseCommand,\n} from \"./parser\";\nimport {\n findCommandByAlias,\n findCommandByKey,\n getCommands,\n getCommandsByCategory,\n getEnabledCommands,\n initForRuntime,\n registerCommand,\n registerCommands,\n resetCommands,\n startsWithCommand,\n unregisterCommand,\n useRuntime,\n} from \"./registry\";\nimport type {\n CommandContext,\n CommandDefinition,\n CommandDetectionResult,\n CommandResult,\n ParsedCommand,\n ResolvedCommand,\n} from \"./types\";\n\n// Import actions\nimport { commandsListAction } from \"./actions/commands-list\";\nimport { helpAction } from \"./actions/help\";\nimport { modelsAction } from \"./actions/models\";\nimport { statusAction } from \"./actions/status\";\nimport { stopAction } from \"./actions/stop\";\n\n// Re-export everything\nexport * from \"./types\";\nexport * from \"./registry\";\nexport * from \"./parser\";\n\n/**\n * Provider that exposes available commands to the LLM context.\n *\n * Only injects the full command list when the message looks like a command.\n * For normal messages, returns a minimal hint so the LLM knows commands\n * exist but doesn't get a wall of command documentation in its context.\n */\nexport const commandRegistryProvider: Provider = {\n name: \"COMMAND_REGISTRY\",\n description: \"Available chat commands and their descriptions\",\n dynamic: true,\n\n async get(\n runtime: IAgentRuntime,\n message: Memory,\n _state: State,\n ): Promise<ProviderResult> {\n // Scope to the correct runtime's command store\n useRuntime(runtime.agentId);\n\n const text = message.content?.text ?? \"\";\n const isCommand = hasCommand(text);\n const commands = getEnabledCommands();\n\n if (isCommand) {\n // Full command context for command messages — helps the LLM select\n // the right action\n const commandList = commands.map((cmd) => {\n const auth = cmd.requiresAuth ? \" (requires auth)\" : \"\";\n return `- ${cmd.textAliases[0]}: ${cmd.description}${auth}`;\n });\n\n return {\n text: `The user sent a slash command. Available commands:\\n${commandList.join(\"\\n\")}\\n\\nIMPORTANT: This is a slash command — respond by executing the matching command action, not with conversational text.`,\n values: {\n commandCount: commands.length,\n isCommand: true,\n hasElevatedCommands: commands.some((c) => c.requiresElevated),\n },\n data: { commands, isCommand: true },\n };\n }\n\n // Minimal context for non-command messages — don't pollute the prompt\n return {\n text: \"\",\n values: {\n commandCount: commands.length,\n isCommand: false,\n },\n data: { isCommand: false },\n };\n },\n};\n\n/**\n * Format command result for display\n */\nexport function formatCommandResult(result: CommandResult): string {\n if (result.error) {\n return `Error: ${result.error}`;\n }\n return result.reply ?? \"Command executed\";\n}\n\n/**\n * Check if a sender is authorized\n */\nexport function isAuthorized(\n context: CommandContext,\n command: CommandDefinition,\n): boolean {\n if (!command.requiresAuth) {\n return true;\n }\n return context.isAuthorized;\n}\n\n/**\n * Check if a sender has elevated permissions\n */\nexport function isElevated(\n context: CommandContext,\n command: CommandDefinition,\n): boolean {\n if (!command.requiresElevated) {\n return true;\n }\n return context.isElevated;\n}\n\n/**\n * Plugin Commands\n *\n * Provides chat commands as Eliza actions. Commands are detected\n * by their text aliases (e.g., /help, /status) and executed as actions.\n *\n * Design decisions for messaging integration:\n * 1. Actions use strict validate() — only true for slash-prefixed messages\n * 2. Similes are slash-only — no natural language to prevent LLM misrouting\n * 3. Provider is context-aware — full docs for commands, empty for normal msgs\n * 4. Registry is scoped per agentId — no cross-agent contamination\n * 5. Events use proper EventType enums — not raw strings\n */\nexport const commandsPlugin: Plugin = {\n name: \"commands\",\n description: \"Chat command system with /help, /status, /reset, etc.\",\n\n providers: [commandRegistryProvider],\n\n actions: [\n helpAction,\n statusAction,\n stopAction,\n modelsAction,\n commandsListAction,\n ],\n\n config: {\n COMMANDS_ENABLED: \"true\",\n COMMANDS_CONFIG_ENABLED: \"false\",\n COMMANDS_DEBUG_ENABLED: \"false\",\n COMMANDS_BASH_ENABLED: \"false\",\n COMMANDS_RESTART_ENABLED: \"true\",\n },\n\n tests: [\n {\n name: \"command-detection\",\n tests: [\n {\n name: \"Detect command prefix\",\n fn: async (_runtime: IAgentRuntime) => {\n if (!hasCommand(\"/help\")) {\n throw new Error(\"Should detect /help command\");\n }\n if (!hasCommand(\"/status test\")) {\n throw new Error(\"Should detect /status with args\");\n }\n if (hasCommand(\"hello world\")) {\n throw new Error(\"Should not detect plain text as command\");\n }\n logger.success(\"Command prefix detection works correctly\");\n },\n },\n {\n name: \"Parse command with args\",\n fn: async (_runtime: IAgentRuntime) => {\n const detection = detectCommand(\"/think:high\");\n if (!detection.isCommand) {\n throw new Error(\"Should detect think command\");\n }\n if (detection.command?.key !== \"think\") {\n throw new Error(\n `Expected key 'think', got '${detection.command?.key}'`,\n );\n }\n if (detection.command?.args[0] !== \"high\") {\n throw new Error(\n `Expected arg 'high', got '${detection.command?.args[0]}'`,\n );\n }\n logger.success(\"Command argument parsing works correctly\");\n },\n },\n {\n name: \"Normalize command body\",\n fn: async (_runtime: IAgentRuntime) => {\n const normalized1 = normalizeCommandBody(\"/status: test\");\n if (normalized1 !== \"/status test\") {\n throw new Error(`Expected '/status test', got '${normalized1}'`);\n }\n\n const normalized2 = normalizeCommandBody(\"@bot /help\", \"bot\");\n if (normalized2 !== \"/help\") {\n throw new Error(`Expected '/help', got '${normalized2}'`);\n }\n\n logger.success(\"Command normalization works correctly\");\n },\n },\n {\n name: \"Find command by alias\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByAlias(\"/h\");\n if (!cmd) {\n throw new Error(\"Should find help command by /h alias\");\n }\n if (cmd.key !== \"help\") {\n throw new Error(`Expected key 'help', got '${cmd.key}'`);\n }\n logger.success(\"Command alias lookup works correctly\");\n },\n },\n {\n name: \"Find command by key\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByKey(\"status\");\n if (!cmd) {\n throw new Error(\"Should find status command by key\");\n }\n if (cmd.key !== \"status\") {\n throw new Error(`Expected key 'status', got '${cmd.key}'`);\n }\n logger.success(\"Command key lookup works correctly\");\n },\n },\n ],\n },\n {\n name: \"command-registry\",\n tests: [\n {\n name: \"Get enabled commands\",\n fn: async (_runtime: IAgentRuntime) => {\n const commands = getEnabledCommands();\n if (commands.length === 0) {\n throw new Error(\"Should have enabled commands\");\n }\n // Check some expected commands exist\n const cmdHelp = commands.some((c) => c.key === \"help\");\n const cmdStatus = commands.some((c) => c.key === \"status\");\n if (!cmdHelp || !cmdStatus) {\n throw new Error(\"Should have help and status commands\");\n }\n logger.success(\"Command registry works correctly\");\n },\n },\n {\n name: \"Register custom command\",\n fn: async (_runtime: IAgentRuntime) => {\n const customCmd: CommandDefinition = {\n key: \"test-custom\",\n description: \"Test custom command\",\n textAliases: [\"/test-custom\", \"/tc\"],\n scope: \"text\",\n };\n\n registerCommand(customCmd);\n const found = findCommandByKey(\"test-custom\");\n if (!found) {\n throw new Error(\"Should find registered custom command\");\n }\n\n unregisterCommand(\"test-custom\");\n const notFound = findCommandByKey(\"test-custom\");\n if (notFound) {\n throw new Error(\"Should not find unregistered command\");\n }\n\n logger.success(\"Custom command registration works correctly\");\n },\n },\n {\n name: \"Get commands by category\",\n fn: async (_runtime: IAgentRuntime) => {\n const statusCommands = getCommandsByCategory(\"status\");\n if (statusCommands.length === 0) {\n throw new Error(\"Should have status category commands\");\n }\n const allStatus = statusCommands.every(\n (c) => c.category === \"status\",\n );\n if (!allStatus) {\n throw new Error(\n \"All returned commands should be in status category\",\n );\n }\n logger.success(\"Command categorization works correctly\");\n },\n },\n ],\n },\n ],\n\n async init(config, runtime) {\n logger.log(\"[plugin-commands] Initializing command system\");\n\n // Initialize an isolated command store for this runtime\n // This prevents cross-agent contamination in multi-agent deployments\n initForRuntime(runtime.agentId);\n\n // Configure command enablement from config\n const configEnabled = config.COMMANDS_CONFIG_ENABLED === \"true\";\n const debugEnabled = config.COMMANDS_DEBUG_ENABLED === \"true\";\n const bashEnabled = config.COMMANDS_BASH_ENABLED === \"true\";\n const restartEnabled = config.COMMANDS_RESTART_ENABLED !== \"false\";\n\n // Update command enabled states (now on the isolated copy)\n const configCmd = findCommandByKey(\"config\");\n if (configCmd) {\n configCmd.enabled = configEnabled;\n }\n\n const debugCmd = findCommandByKey(\"debug\");\n if (debugCmd) {\n debugCmd.enabled = debugEnabled;\n }\n\n const bashCmd = findCommandByKey(\"bash\");\n if (bashCmd) {\n bashCmd.enabled = bashEnabled;\n }\n\n const restartCmd = findCommandByKey(\"restart\");\n if (restartCmd) {\n restartCmd.enabled = restartEnabled;\n }\n\n const enabledCount = getEnabledCommands().length;\n logger.log(\n `[plugin-commands] ${enabledCount} commands enabled for agent ${runtime.agentId}`,\n );\n },\n};\n\nexport default commandsPlugin;\n",
6
+ "/**\n * Command registry - defines all available chat commands\n *\n * IMPORTANT: The registry uses module-level state for convenience, but\n * provides `cloneCommands()` and `resetCommands()` so that `init()` can\n * work on isolated copies per runtime. The `init()` function in the main\n * plugin file should clone before mutating to avoid cross-agent contamination.\n */\n\nimport type { CommandDefinition } from \"./types\";\n\n// Default command definitions (frozen reference — never mutate these directly)\nconst DEFAULT_COMMANDS: ReadonlyArray<CommandDefinition> = [\n // Status commands\n {\n key: \"help\",\n nativeName: \"help\",\n description: \"Show available commands\",\n textAliases: [\"/help\", \"/h\", \"/?\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"commands\",\n nativeName: \"commands\",\n description: \"List all commands\",\n textAliases: [\"/commands\", \"/cmds\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"status\",\n nativeName: \"status\",\n description: \"Show current session status\",\n textAliases: [\"/status\", \"/s\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"context\",\n nativeName: \"context\",\n description: \"Show current context information\",\n textAliases: [\"/context\", \"/ctx\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: true,\n args: [{ name: \"mode\", description: \"Output mode (list, detail, json)\" }],\n },\n {\n key: \"whoami\",\n nativeName: \"whoami\",\n description: \"Show your identity information\",\n textAliases: [\"/whoami\", \"/who\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n\n // Session commands\n {\n key: \"stop\",\n nativeName: \"stop\",\n description: \"Stop current operation\",\n textAliases: [\"/stop\", \"/abort\", \"/cancel\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"restart\",\n nativeName: \"restart\",\n description: \"Restart the session\",\n textAliases: [\"/restart\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"reset\",\n nativeName: \"reset\",\n description: \"Reset session state\",\n textAliases: [\"/reset\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"new\",\n nativeName: \"new\",\n description: \"Start a new conversation\",\n textAliases: [\"/new\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"compact\",\n nativeName: \"compact\",\n description: \"Compact conversation history\",\n textAliases: [\"/compact\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: true,\n args: [\n { name: \"instructions\", description: \"Optional compaction instructions\" },\n ],\n },\n\n // Options commands\n {\n key: \"think\",\n nativeName: \"think\",\n description: \"Set thinking level\",\n textAliases: [\"/think\", \"/thinking\", \"/t\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [\n { name: \"level\", description: \"off, minimal, low, medium, high, xhigh\" },\n ],\n },\n {\n key: \"verbose\",\n nativeName: \"verbose\",\n description: \"Set verbose output level\",\n textAliases: [\"/verbose\", \"/v\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, full\" }],\n },\n {\n key: \"reasoning\",\n nativeName: \"reasoning\",\n description: \"Set reasoning visibility\",\n textAliases: [\"/reasoning\", \"/reason\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, stream\" }],\n },\n {\n key: \"elevated\",\n nativeName: \"elevated\",\n description: \"Set elevated permission mode\",\n textAliases: [\"/elevated\", \"/elev\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, ask, full\" }],\n requiresAuth: true,\n },\n {\n key: \"model\",\n nativeName: \"model\",\n description: \"Set or show current model\",\n textAliases: [\"/model\", \"/m\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"model\", description: \"provider/model or alias\" }],\n },\n {\n key: \"models\",\n nativeName: \"models\",\n description: \"List available models\",\n textAliases: [\"/models\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"usage\",\n nativeName: \"usage\",\n description: \"Show token usage\",\n textAliases: [\"/usage\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"queue\",\n nativeName: \"queue\",\n description: \"Set queue mode\",\n textAliases: [\"/queue\", \"/q\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [\n {\n name: \"mode\",\n description: \"steer, followup, collect, interrupt, or options\",\n },\n ],\n },\n\n // Management commands\n {\n key: \"allowlist\",\n nativeName: \"allowlist\",\n description: \"Manage sender allowlist\",\n textAliases: [\"/allowlist\", \"/allow\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"action\", description: \"list, add, remove\" },\n { name: \"value\", description: \"sender to add/remove\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"approve\",\n nativeName: \"approve\",\n description: \"Approve or deny a pending action\",\n textAliases: [\"/approve\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"id\", description: \"Approval ID\", required: true },\n { name: \"action\", description: \"allow-once, allow-always, deny\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"subagents\",\n nativeName: \"subagents\",\n description: \"Manage subagents\",\n textAliases: [\"/subagents\", \"/sub\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [{ name: \"action\", description: \"list, stop, log, info, send\" }],\n requiresAuth: true,\n },\n {\n key: \"config\",\n nativeName: \"config\",\n description: \"View or set configuration\",\n textAliases: [\"/config\", \"/cfg\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"key\", description: \"Configuration key\" },\n { name: \"value\", description: \"Value to set\" },\n ],\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n {\n key: \"debug\",\n nativeName: \"debug\",\n description: \"Debug information\",\n textAliases: [\"/debug\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n\n // Media commands\n {\n key: \"tts\",\n nativeName: \"tts\",\n description: \"Text-to-speech settings\",\n textAliases: [\"/tts\", \"/voice\"],\n scope: \"both\",\n category: \"media\",\n acceptsArgs: true,\n args: [\n {\n name: \"action\",\n description: \"on, off, status, provider, limit, audio\",\n },\n ],\n },\n\n // Tools commands\n {\n key: \"bash\",\n nativeName: \"bash\",\n description: \"Execute shell command\",\n textAliases: [\"/bash\", \"/sh\", \"/!\"],\n scope: \"text\",\n category: \"tools\",\n acceptsArgs: true,\n args: [\n {\n name: \"command\",\n description: \"Shell command to execute\",\n captureRemaining: true,\n },\n ],\n requiresAuth: true,\n requiresElevated: true,\n },\n];\n\n// ── Per-runtime command storage ──────────────────────────────────────────\n// Each agent runtime gets its own isolated command set via `initForRuntime()`.\n// The module-level state is used as a fallback for convenience (tests, etc.).\n//\n// Why a WeakMap? Agent runtimes may be created/destroyed; we don't want to\n// leak memory by holding strong references to disposed runtimes.\n\ninterface CommandStore {\n commands: CommandDefinition[];\n aliasMap: Map<string, CommandDefinition> | null;\n}\n\n/** Per-runtime stores keyed by agentId */\nconst runtimeStores = new Map<string, CommandStore>();\n/** Fallback store for when no runtime context is set */\nlet fallbackStore: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n};\n/** Currently active store (set during init, reset on test teardown) */\nlet activeStore: CommandStore = fallbackStore;\n\n/**\n * Initialize an isolated command store for a specific runtime.\n * Called from plugin init() to prevent cross-agent contamination.\n */\nexport function initForRuntime(agentId: string): void {\n const store: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n };\n runtimeStores.set(agentId, store);\n activeStore = store;\n}\n\n/**\n * Set the active command store for a given runtime.\n * Providers and actions should call this before accessing commands.\n */\nexport function useRuntime(agentId: string): void {\n const store = runtimeStores.get(agentId);\n if (store) {\n activeStore = store;\n }\n}\n\n/**\n * Get all registered commands\n */\nexport function getCommands(): CommandDefinition[] {\n return [...activeStore.commands];\n}\n\n/**\n * Get enabled commands\n */\nexport function getEnabledCommands(): CommandDefinition[] {\n return activeStore.commands.filter((cmd) => cmd.enabled !== false);\n}\n\n/**\n * Get commands by category\n */\nexport function getCommandsByCategory(category: string): CommandDefinition[] {\n return activeStore.commands.filter(\n (cmd) => cmd.category === category && cmd.enabled !== false,\n );\n}\n\n/**\n * Register a custom command\n */\nexport function registerCommand(command: CommandDefinition): void {\n // Remove existing command with same key\n activeStore.commands = activeStore.commands.filter(\n (c) => c.key !== command.key,\n );\n activeStore.commands.push(command);\n activeStore.aliasMap = null; // Invalidate cache\n}\n\n/**\n * Register multiple commands\n */\nexport function registerCommands(newCommands: CommandDefinition[]): void {\n for (const command of newCommands) {\n registerCommand(command);\n }\n}\n\n/**\n * Unregister a command\n */\nexport function unregisterCommand(key: string): void {\n activeStore.commands = activeStore.commands.filter((c) => c.key !== key);\n activeStore.aliasMap = null;\n}\n\n/**\n * Reset to default commands (for the active store)\n */\nexport function resetCommands(): void {\n activeStore.commands = DEFAULT_COMMANDS.map((c) => ({ ...c }));\n activeStore.aliasMap = null;\n}\n\n/**\n * Build and cache alias map for the active store\n */\nfunction getAliasMap(): Map<string, CommandDefinition> {\n if (activeStore.aliasMap) return activeStore.aliasMap;\n\n activeStore.aliasMap = new Map();\n for (const command of activeStore.commands) {\n if (command.enabled === false) continue;\n\n for (const alias of command.textAliases) {\n const normalized = alias.toLowerCase().trim();\n if (!activeStore.aliasMap.has(normalized)) {\n activeStore.aliasMap.set(normalized, command);\n }\n }\n }\n return activeStore.aliasMap;\n}\n\n/**\n * Find command by alias\n */\nexport function findCommandByAlias(\n alias: string,\n): CommandDefinition | undefined {\n const map = getAliasMap();\n return map.get(alias.toLowerCase().trim());\n}\n\n/**\n * Find command by key\n */\nexport function findCommandByKey(key: string): CommandDefinition | undefined {\n return activeStore.commands.find((c) => c.key === key);\n}\n\n/**\n * Check if text starts with any command alias\n */\nexport function startsWithCommand(text: string): CommandDefinition | undefined {\n const map = getAliasMap();\n const normalized = text.toLowerCase().trim();\n\n // Check exact match first\n for (const [alias, command] of map) {\n if (normalized === alias) {\n return command;\n }\n if (\n normalized.startsWith(alias + \" \") ||\n normalized.startsWith(alias + \":\")\n ) {\n return command;\n }\n }\n\n return undefined;\n}\n",
7
+ "/**\n * Command parser - detects and parses commands from message text\n */\n\nimport type {\n CommandDefinition,\n CommandDetectionResult,\n ParsedCommand,\n} from \"./types\";\nimport { findCommandByAlias, startsWithCommand } from \"./registry\";\n\nconst escapeRegExp = (value: string) =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Check if text contains a command\n */\nexport function hasCommand(text: string): boolean {\n if (!text) return false;\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) return false;\n return Boolean(startsWithCommand(trimmed));\n}\n\n/**\n * Detect command in text\n */\nexport function detectCommand(text: string): CommandDetectionResult {\n if (!text) {\n return { isCommand: false };\n }\n\n const trimmed = text.trim();\n\n // Quick check for command prefix\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) {\n return { isCommand: false };\n }\n\n const command = startsWithCommand(trimmed);\n if (!command) {\n return { isCommand: false };\n }\n\n const parsed = parseCommand(trimmed, command);\n if (!parsed) {\n return { isCommand: false };\n }\n\n return { isCommand: true, command: parsed };\n}\n\n/**\n * Parse a command from text\n */\nexport function parseCommand(\n text: string,\n definition: CommandDefinition,\n): ParsedCommand | null {\n const trimmed = text.trim();\n\n // Find the matching alias\n let matchedAlias: string | null = null;\n for (const alias of definition.textAliases) {\n const normalized = alias.toLowerCase();\n if (trimmed.toLowerCase() === normalized) {\n matchedAlias = alias;\n break;\n }\n if (\n trimmed.toLowerCase().startsWith(normalized + \" \") ||\n trimmed.toLowerCase().startsWith(normalized + \":\")\n ) {\n matchedAlias = alias;\n break;\n }\n }\n\n if (!matchedAlias) {\n return null;\n }\n\n // Extract arguments\n let rawArgs = trimmed.slice(matchedAlias.length).trim();\n\n // Handle colon separator (e.g., /think:high)\n if (rawArgs.startsWith(\":\")) {\n rawArgs = rawArgs.slice(1).trim();\n }\n\n // Parse arguments\n const args = parseArgs(rawArgs, definition);\n\n return {\n key: definition.key,\n canonical: definition.textAliases[0] ?? `/${definition.key}`,\n args,\n rawArgs: rawArgs || undefined,\n };\n}\n\n/**\n * Parse arguments based on command definition\n */\nfunction parseArgs(rawArgs: string, definition: CommandDefinition): string[] {\n if (!rawArgs || !definition.acceptsArgs) {\n return [];\n }\n\n const parsing = definition.argsParsing ?? \"positional\";\n\n if (parsing === \"none\") {\n // Return entire string as single argument\n return rawArgs ? [rawArgs] : [];\n }\n\n // Positional parsing\n const args: string[] = [];\n const argDefs = definition.args ?? [];\n\n // Split by whitespace, respecting quotes\n const tokens = tokenize(rawArgs);\n\n for (let i = 0; i < tokens.length; i++) {\n const argDef = argDefs[i];\n\n // If this arg captures remaining, join all remaining tokens\n if (argDef?.captureRemaining) {\n args.push(tokens.slice(i).join(\" \"));\n break;\n }\n\n args.push(tokens[i]);\n }\n\n return args;\n}\n\n/**\n * Tokenize argument string, respecting quotes\n */\nfunction tokenize(input: string): string[] {\n const tokens: string[] = [];\n let current = \"\";\n let inQuote = false;\n let quoteChar = \"\";\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n\n if (inQuote) {\n if (char === quoteChar) {\n inQuote = false;\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n } else if (char === '\"' || char === \"'\") {\n inQuote = true;\n quoteChar = char;\n } else if (/\\s/.test(char)) {\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n }\n\n if (current) {\n tokens.push(current);\n }\n\n return tokens;\n}\n\n/**\n * Normalize command body (handle bot mentions, colon syntax, etc.)\n */\nexport function normalizeCommandBody(\n text: string,\n botMention?: string,\n): string {\n let normalized = text.trim();\n\n // Remove bot mention prefix (e.g., \"@bot /status\" -> \"/status\")\n if (botMention) {\n const mentionPattern = new RegExp(`^@${escapeRegExp(botMention)}\\\\s*`, \"i\");\n normalized = normalized.replace(mentionPattern, \"\");\n }\n\n // Handle colon in command (e.g., \"/command: args\" -> \"/command args\")\n normalized = normalized.replace(/^(\\/\\w+):\\s*/, \"$1 \");\n\n return normalized.trim();\n}\n\n/**\n * Check if text is a command-only message (no other content)\n */\nexport function isCommandOnly(text: string): boolean {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return false;\n }\n\n // If there's no rawArgs, it's command-only\n if (!detection.command.rawArgs) {\n return true;\n }\n\n // Check if rawArgs is just whitespace\n return detection.command.rawArgs.trim().length === 0;\n}\n\n/**\n * Get command and remaining text\n */\nexport function extractCommand(\n text: string,\n): { command: ParsedCommand; remainingText: string } | null {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return null;\n }\n\n const { command } = detection;\n\n // For commands that don't accept args, remaining text is everything after the command\n if (!command.rawArgs) {\n return { command, remainingText: \"\" };\n }\n\n return { command, remainingText: command.rawArgs };\n}\n",
8
+ "/**\n * Commands list action\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { getEnabledCommands } from \"../registry\";\nimport { detectCommand } from \"../parser\";\n\nexport const commandsListAction: Action = {\n name: \"COMMANDS_LIST\",\n description:\n \"List all available commands with their aliases. Only activates for /commands or /cmds slash commands.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/commands\", \"/cmds\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"commands\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const commands = getEnabledCommands();\n const lines: string[] = [`**Commands (${commands.length}):**\\n`];\n\n for (const cmd of commands) {\n const aliases = cmd.textAliases.join(\", \");\n const authNote = cmd.requiresAuth ? \" [auth]\" : \"\";\n const elevatedNote = cmd.requiresElevated ? \" [elevated]\" : \"\";\n lines.push(`• **${cmd.key}**: ${aliases}${authNote}${elevatedNote}`);\n }\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/commands\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Commands (15):**\\n\\n• **help**: /help, /h, /?\\n• **status**: /status, /s...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
9
+ "/**\n * Help command action\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { getCommandsByCategory, getEnabledCommands } from \"../registry\";\nimport { detectCommand } from \"../parser\";\n\n/**\n * Format command list for help display\n */\nfunction formatCommandList(\n commands: ReturnType<typeof getEnabledCommands>,\n): string {\n const lines: string[] = [\"**Available Commands:**\\n\"];\n\n const categories = [\n { key: \"status\", name: \"Status\" },\n { key: \"session\", name: \"Session\" },\n { key: \"options\", name: \"Options\" },\n { key: \"management\", name: \"Management\" },\n { key: \"media\", name: \"Media\" },\n { key: \"tools\", name: \"Tools\" },\n ];\n\n for (const cat of categories) {\n const catCommands = commands.filter((c) => c.category === cat.key);\n if (catCommands.length === 0) continue;\n\n lines.push(`\\n**${cat.name}:**`);\n for (const cmd of catCommands) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n // Add uncategorized commands\n const uncategorized = commands.filter((c) => !c.category);\n if (uncategorized.length > 0) {\n lines.push(\"\\n**Other:**\");\n for (const cmd of uncategorized) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const helpAction: Action = {\n name: \"HELP_COMMAND\",\n description:\n \"Show available commands and their descriptions. Only activates for /help, /h, or /? slash commands.\",\n // Only slash-command similes — \"help\" or \"show help\" as natural language\n // should be handled by the LLM's normal response, not this action\n similes: [\"/help\", \"/h\", \"/?\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"help\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const commands = getEnabledCommands();\n const helpText = formatCommandList(commands);\n\n await callback?.({ text: helpText });\n\n return {\n success: true,\n text: helpText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/help\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/?\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
10
+ "/**\n * Models command action\n *\n * Queries the runtime for actually registered model handlers instead of\n * using a hardcoded list. Falls back to listing registered model types\n * when detailed model info is not available.\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { ModelType, logger } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\n/**\n * Describe a ModelType value in a user-friendly way\n */\nfunction describeModelType(modelType: string): string {\n const descriptions: Record<string, string> = {\n [ModelType.TEXT_SMALL]: \"Text (Small)\",\n [ModelType.TEXT_LARGE]: \"Text (Large)\",\n [ModelType.TEXT_REASONING_SMALL]: \"Reasoning (Small)\",\n [ModelType.TEXT_REASONING_LARGE]: \"Reasoning (Large)\",\n [ModelType.TEXT_COMPLETION]: \"Text Completion\",\n [ModelType.TEXT_EMBEDDING]: \"Embedding\",\n [ModelType.IMAGE]: \"Image Generation\",\n [ModelType.IMAGE_DESCRIPTION]: \"Image Description\",\n [ModelType.TRANSCRIPTION]: \"Transcription\",\n [ModelType.TEXT_TO_SPEECH]: \"Text-to-Speech\",\n [ModelType.AUDIO]: \"Audio\",\n [ModelType.VIDEO]: \"Video\",\n [ModelType.OBJECT_SMALL]: \"Object (Small)\",\n [ModelType.OBJECT_LARGE]: \"Object (Large)\",\n [ModelType.RESEARCH]: \"Research\",\n };\n return descriptions[modelType] ?? modelType;\n}\n\nexport const modelsAction: Action = {\n name: \"MODELS_COMMAND\",\n description:\n \"List available AI models and providers. Only activates for /models slash command.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/models\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"models\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const lines: string[] = [\"**Available Models:**\\n\"];\n\n // Query runtime for registered model handlers\n try {\n const registeredTypes: string[] = [];\n const seen = new Set<string>();\n\n // Check each ModelType to see if a handler is registered.\n // Deduplicate since ModelType has legacy aliases (SMALL, MEDIUM, LARGE)\n // that map to the same underlying values.\n for (const modelType of Object.values(ModelType)) {\n if (seen.has(modelType)) continue;\n seen.add(modelType);\n try {\n // runtime.getModel() returns the handler or undefined\n const handler = runtime.getModel(modelType);\n if (handler) {\n registeredTypes.push(modelType);\n }\n } catch {\n // Model type not registered\n }\n }\n\n if (registeredTypes.length > 0) {\n lines.push(\"**Registered Model Types:**\");\n for (const modelType of registeredTypes) {\n lines.push(`• ${describeModelType(modelType)} (\\`${modelType}\\`)`);\n }\n } else {\n lines.push(\"No model handlers are currently registered.\");\n }\n\n // Show current model settings if available\n const modelProvider = runtime.getSetting(\"MODEL_PROVIDER\");\n const modelName = runtime.getSetting(\"MODEL_NAME\");\n if (modelProvider || modelName) {\n lines.push(\"\\n**Current Configuration:**\");\n if (modelProvider) lines.push(`• Provider: ${modelProvider}`);\n if (modelName) lines.push(`• Model: ${modelName}`);\n }\n } catch (err) {\n logger.warn(\n { src: \"plugin-commands\", err },\n \"Error querying runtime models\",\n );\n lines.push(\"Unable to query available models.\");\n }\n\n lines.push(\"\\n\\n_Use /model <provider/model> to switch models._\");\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/models\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Models:**\\n\\n**Registered Model Types:**\\n• Text (Large) (`text_large`)\\n• Text (Small) (`text_small`)...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
11
+ "/**\n * Status command action\n *\n * This is the SLASH COMMAND version (/status, /s). It is distinct from the\n * bootstrap STATUS action which handles natural language like \"what's your status?\".\n *\n * Key differences:\n * - This action ONLY activates for /status or /s slash commands (validate checks prefix)\n * - Bootstrap STATUS handles conversational requests about agent state\n * - This action shows directive/session settings; bootstrap STATUS shows tasks/room info\n * - No natural language similes to prevent conflict with bootstrap STATUS\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\ninterface DirectiveModelState {\n provider?: string;\n model?: string;\n}\n\ninterface DirectiveSessionState {\n thinking: string | boolean;\n verbose: boolean | string;\n reasoning: boolean | string;\n elevated: boolean | string;\n model?: DirectiveModelState;\n}\n\ninterface DirectiveParserService {\n getSessionState?: (roomId: string) => DirectiveSessionState | undefined;\n}\n\n/**\n * Build status report including directive state\n */\nasync function buildStatusReport(\n runtime: IAgentRuntime,\n roomId: string,\n): Promise<string> {\n const lines: string[] = [\"**Session Status:**\\n\"];\n\n // Agent info\n lines.push(`**Agent:** ${runtime.character.name ?? runtime.agentId}`);\n lines.push(`**Room:** ${roomId}`);\n\n // Try to get directive state from plugin-directives if available\n try {\n const directiveService =\n runtime.getService<DirectiveParserService>(\"directive-parser\");\n if (directiveService) {\n const state = directiveService.getSessionState?.(roomId);\n if (state) {\n lines.push(`\\n**Directives:**`);\n lines.push(`• Thinking: ${state.thinking}`);\n lines.push(`• Verbose: ${state.verbose}`);\n lines.push(`• Reasoning: ${state.reasoning}`);\n lines.push(`• Elevated: ${state.elevated}`);\n if (state.model?.provider || state.model?.model) {\n const modelStr = state.model.provider\n ? `${state.model.provider}/${state.model.model}`\n : state.model.model;\n lines.push(`• Model: ${modelStr}`);\n }\n }\n }\n } catch {\n // Directive plugin not available\n }\n\n // Get pending tasks count for context\n try {\n const tasks = await runtime.getTasks({ roomId });\n if (tasks.length > 0) {\n lines.push(`\\n**Tasks:** ${tasks.length} pending`);\n }\n } catch {\n // Task retrieval may not be available\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const statusAction: Action = {\n // Deliberately distinct from bootstrap's \"STATUS\" action name\n // Normalized: \"statuscommand\" vs \"status\" — no exact match collision\n name: \"STATUS_COMMAND\",\n description:\n \"Show session directive settings via /status slash command. Only activates for /status or /s prefix.\",\n // Only slash-command similes — no natural language to avoid stealing\n // from bootstrap STATUS which handles \"what's your status?\" etc.\n similes: [\"/status\", \"/s\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"status\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const statusText = await buildStatusReport(runtime, message.roomId);\n\n await callback?.({ text: statusText });\n\n return {\n success: true,\n text: statusText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/status\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Session Status:**\\n\\n**Agent:** Eliza\\n**Room:** room-456\\n\\n**Directives:**\\n• Thinking: low...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
12
+ "/**\n * Stop command action\n *\n * Uses EventType.HOOK_COMMAND_STOP from @elizaos/core for proper integration\n * with the messaging pipeline and hook system.\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { EventType, logger } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\nexport const stopAction: Action = {\n name: \"STOP_COMMAND\",\n description:\n \"Stop current operation or abort running tasks. Triggered by /stop, /abort, or /cancel slash commands only.\",\n // Only use slash-command similes to avoid matching natural language\n // like \"stop talking\" or \"cancel that\" which should go to bootstrap IGNORE\n similes: [\"/stop\", \"/abort\", \"/cancel\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n const detection = detectCommand(text);\n return (\n detection.isCommand &&\n [\"stop\", \"abort\", \"cancel\"].includes(detection.command?.key ?? \"\")\n );\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n // Emit the proper hook event for the stop command.\n // HookCommandPayload extends HookEventPayload which requires sessionKey,\n // messages, timestamp, context. The runtime injects itself automatically.\n try {\n await runtime.emitEvent(EventType.HOOK_COMMAND_STOP, {\n runtime,\n sessionKey: message.roomId,\n messages: [],\n timestamp: new Date(),\n context: {\n entityId: message.entityId,\n source: message.content?.source,\n },\n command: \"stop\" as const,\n senderId: message.entityId,\n commandSource: message.content?.source,\n });\n } catch (err) {\n logger.warn(\n { src: \"plugin-commands\", err },\n \"Failed to emit HOOK_COMMAND_STOP event\",\n );\n }\n\n const replyText = \"✓ Stop requested. Current operations will be cancelled.\";\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/stop\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/abort\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n"
13
13
  ],
14
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,IARP;;;ACVA,IAAM,mBAAqD;AAAA,EAEzD;AAAA,IACE,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa,CAAC,SAAS,MAAM,IAAI;AAAA,IACjC,OAAO;AAAA,IACP,UAAU;AAAA,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zD,MAAM,eAAe,OAAO,2BAA2B;AAAA,IACvD,MAAM,cAAc,OAAO,0BAA0B;AAAA,IACrD,MAAM,iBAAiB,OAAO,6BAA6B;AAAA,IAG3D,MAAM,YAAY,iBAAiB,QAAQ;AAAA,IAC3C,IAAI,WAAW;AAAA,MACb,UAAU,UAAU;AAAA,IACtB;AAAA,IAEA,MAAM,WAAW,iBAAiB,OAAO;AAAA,IACzC,IAAI,UAAU;AAAA,MACZ,SAAS,UAAU;AAAA,IACrB;AAAA,IAEA,MAAM,UAAU,iBAAiB,MAAM;AAAA,IACvC,IAAI,SAAS;AAAA,MACX,QAAQ,UAAU;AAAA,IACpB;AAAA,IAEA,MAAM,aAAa,iBAAiB,SAAS;AAAA,IAC7C,IAAI,YAAY;AAAA,MACd,WAAW,UAAU;AAAA,IACvB;AAAA,IAEA,MAAM,eAAe,mBAAmB,EAAE;AAAA,IAC1C,oBAAO,IACL,qBAAqB,2CAA2C,QAAQ,SAC1E;AAAA;AAEJ;AAEA,IAAe;",
15
+ "debugId": "C959FE7FE395530C64756E2164756E21",
16
16
  "names": []
17
17
  }
package/dist/index.js CHANGED
@@ -97,7 +97,9 @@ var DEFAULT_COMMANDS = [
97
97
  scope: "both",
98
98
  category: "session",
99
99
  acceptsArgs: true,
100
- args: [{ name: "instructions", description: "Optional compaction instructions" }]
100
+ args: [
101
+ { name: "instructions", description: "Optional compaction instructions" }
102
+ ]
101
103
  },
102
104
  {
103
105
  key: "think",
@@ -107,7 +109,9 @@ var DEFAULT_COMMANDS = [
107
109
  scope: "both",
108
110
  category: "options",
109
111
  acceptsArgs: true,
110
- args: [{ name: "level", description: "off, minimal, low, medium, high, xhigh" }]
112
+ args: [
113
+ { name: "level", description: "off, minimal, low, medium, high, xhigh" }
114
+ ]
111
115
  },
112
116
  {
113
117
  key: "verbose",
@@ -359,7 +363,7 @@ function startsWithCommand(text) {
359
363
  if (normalized === alias) {
360
364
  return command;
361
365
  }
362
- if (normalized.startsWith(`${alias} `) || normalized.startsWith(`${alias}:`)) {
366
+ if (normalized.startsWith(alias + " ") || normalized.startsWith(alias + ":")) {
363
367
  return command;
364
368
  }
365
369
  }
@@ -403,7 +407,7 @@ function parseCommand(text, definition) {
403
407
  matchedAlias = alias;
404
408
  break;
405
409
  }
406
- if (trimmed.toLowerCase().startsWith(`${normalized} `) || trimmed.toLowerCase().startsWith(`${normalized}:`)) {
410
+ if (trimmed.toLowerCase().startsWith(normalized + " ") || trimmed.toLowerCase().startsWith(normalized + ":")) {
407
411
  matchedAlias = alias;
408
412
  break;
409
413
  }
@@ -514,12 +518,12 @@ var commandsListAction = {
514
518
  name: "COMMANDS_LIST",
515
519
  description: "List all available commands with their aliases. Only activates for /commands or /cmds slash commands.",
516
520
  similes: ["/commands", "/cmds"],
517
- async validate(_runtime, message) {
521
+ async validate(runtime, message) {
518
522
  const text = message.content?.text ?? "";
519
523
  const detection = detectCommand(text);
520
524
  return detection.isCommand && detection.command?.key === "commands";
521
525
  },
522
- async handler(_runtime, _message, _state, _options, callback) {
526
+ async handler(runtime, message, state, options, callback) {
523
527
  const commands = getEnabledCommands();
524
528
  const lines = [`**Commands (${commands.length}):**
525
529
  `];
@@ -593,12 +597,12 @@ var helpAction = {
593
597
  name: "HELP_COMMAND",
594
598
  description: "Show available commands and their descriptions. Only activates for /help, /h, or /? slash commands.",
595
599
  similes: ["/help", "/h", "/?"],
596
- async validate(_runtime, message) {
600
+ async validate(runtime, message) {
597
601
  const text = message.content?.text ?? "";
598
602
  const detection = detectCommand(text);
599
603
  return detection.isCommand && detection.command?.key === "help";
600
604
  },
601
- async handler(_runtime, _message, _state, _options, callback) {
605
+ async handler(runtime, message, state, options, callback) {
602
606
  const commands = getEnabledCommands();
603
607
  const helpText = formatCommandList(commands);
604
608
  await callback?.({ text: helpText });
@@ -637,7 +641,7 @@ var helpAction = {
637
641
  };
638
642
 
639
643
  // src/actions/models.ts
640
- import { logger, ModelType } from "@elizaos/core";
644
+ import { ModelType, logger } from "@elizaos/core";
641
645
  function describeModelType(modelType) {
642
646
  const descriptions = {
643
647
  [ModelType.TEXT_SMALL]: "Text (Small)",
@@ -662,12 +666,12 @@ var modelsAction = {
662
666
  name: "MODELS_COMMAND",
663
667
  description: "List available AI models and providers. Only activates for /models slash command.",
664
668
  similes: ["/models"],
665
- async validate(_runtime, message) {
669
+ async validate(runtime, message) {
666
670
  const text = message.content?.text ?? "";
667
671
  const detection = detectCommand(text);
668
672
  return detection.isCommand && detection.command?.key === "models";
669
673
  },
670
- async handler(runtime, _message, _state, _options, callback) {
674
+ async handler(runtime, message, state, options, callback) {
671
675
  const lines = [`**Available Models:**
672
676
  `];
673
677
  try {
@@ -768,12 +772,12 @@ var statusAction = {
768
772
  name: "STATUS_COMMAND",
769
773
  description: "Show session directive settings via /status slash command. Only activates for /status or /s prefix.",
770
774
  similes: ["/status", "/s"],
771
- async validate(_runtime, message) {
775
+ async validate(runtime, message) {
772
776
  const text = message.content?.text ?? "";
773
777
  const detection = detectCommand(text);
774
778
  return detection.isCommand && detection.command?.key === "status";
775
779
  },
776
- async handler(runtime, message, _state, _options, callback) {
780
+ async handler(runtime, message, state, options, callback) {
777
781
  const statusText = await buildStatusReport(runtime, message.roomId);
778
782
  await callback?.({ text: statusText });
779
783
  return {
@@ -806,12 +810,12 @@ var stopAction = {
806
810
  name: "STOP_COMMAND",
807
811
  description: "Stop current operation or abort running tasks. Triggered by /stop, /abort, or /cancel slash commands only.",
808
812
  similes: ["/stop", "/abort", "/cancel"],
809
- async validate(_runtime, message) {
813
+ async validate(runtime, message) {
810
814
  const text = message.content?.text ?? "";
811
815
  const detection = detectCommand(text);
812
816
  return detection.isCommand && ["stop", "abort", "cancel"].includes(detection.command?.key ?? "");
813
817
  },
814
- async handler(runtime, message, _state, _options, callback) {
818
+ async handler(runtime, message, state, options, callback) {
815
819
  try {
816
820
  await runtime.emitEvent(EventType.HOOK_COMMAND_STOP, {
817
821
  runtime,
@@ -919,7 +923,13 @@ var commandsPlugin = {
919
923
  name: "commands",
920
924
  description: "Chat command system with /help, /status, /reset, etc.",
921
925
  providers: [commandRegistryProvider],
922
- actions: [helpAction, statusAction, stopAction, modelsAction, commandsListAction],
926
+ actions: [
927
+ helpAction,
928
+ statusAction,
929
+ stopAction,
930
+ modelsAction,
931
+ commandsListAction
932
+ ],
923
933
  config: {
924
934
  COMMANDS_ENABLED: "true",
925
935
  COMMANDS_CONFIG_ENABLED: "false",
@@ -1116,4 +1126,4 @@ export {
1116
1126
  commandRegistryProvider
1117
1127
  };
1118
1128
 
1119
- //# debugId=0433499C9EE6AF7764756E2164756E21
1129
+ //# debugId=C6086C11EDA7A75E64756E2164756E21
package/dist/index.js.map CHANGED
@@ -2,16 +2,16 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/registry.ts", "../src/parser.ts", "../src/actions/commands-list.ts", "../src/actions/help.ts", "../src/actions/models.ts", "../src/actions/status.ts", "../src/actions/stop.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * Plugin Commands - Chat command system for Eliza agents\n *\n * Provides a slash-command system with:\n * - /help, /status, /commands for information\n * - /stop, /reset, /compact for session control\n * - /think, /verbose, /model for options\n * - /allowlist, /approve for management\n * - /tts for media\n * - /bash for tools (elevated)\n *\n * INTEGRATION NOTES:\n * - Commands are registered as Actions with strict validate() that only\n * matches slash-prefixed messages (e.g. /help, !stop). This prevents\n * conflicts with bootstrap actions (STATUS, IGNORE) and messaging plugins.\n * - Similes use ONLY slash-command forms (no natural language) so the LLM\n * won't accidentally route \"I need help\" to HELP_COMMAND instead of REPLY.\n * - The registry is scoped per runtime to prevent cross-agent state leaks.\n * - The COMMAND_REGISTRY provider includes the command list in the LLM context\n * ONLY when the message is a command, reducing prompt noise for normal messages.\n */\n\nimport {\n type IAgentRuntime,\n logger,\n type Memory,\n type Plugin,\n type Provider,\n type ProviderResult,\n type State,\n} from \"@elizaos/core\";\n// Import actions\nimport { commandsListAction } from \"./actions/commands-list\";\nimport { helpAction } from \"./actions/help\";\nimport { modelsAction } from \"./actions/models\";\nimport { statusAction } from \"./actions/status\";\nimport { stopAction } from \"./actions/stop\";\nimport { detectCommand, hasCommand, normalizeCommandBody } from \"./parser\";\nimport {\n findCommandByAlias,\n findCommandByKey,\n getCommandsByCategory,\n getEnabledCommands,\n initForRuntime,\n registerCommand,\n unregisterCommand,\n useRuntime,\n} from \"./registry\";\nimport type { CommandContext, CommandDefinition, CommandResult } from \"./types\";\n\nexport * from \"./parser\";\nexport * from \"./registry\";\n// Re-export everything\nexport * from \"./types\";\n\n/**\n * Provider that exposes available commands to the LLM context.\n *\n * Only injects the full command list when the message looks like a command.\n * For normal messages, returns a minimal hint so the LLM knows commands\n * exist but doesn't get a wall of command documentation in its context.\n */\nexport const commandRegistryProvider: Provider = {\n name: \"COMMAND_REGISTRY\",\n description: \"Available chat commands and their descriptions\",\n dynamic: true,\n\n async get(runtime: IAgentRuntime, message: Memory, _state: State): Promise<ProviderResult> {\n // Scope to the correct runtime's command store\n useRuntime(runtime.agentId);\n\n const text = message.content?.text ?? \"\";\n const isCommand = hasCommand(text);\n const commands = getEnabledCommands();\n\n if (isCommand) {\n // Full command context for command messages — helps the LLM select\n // the right action\n const commandList = commands.map((cmd) => {\n const auth = cmd.requiresAuth ? \" (requires auth)\" : \"\";\n return `- ${cmd.textAliases[0]}: ${cmd.description}${auth}`;\n });\n\n return {\n text: `The user sent a slash command. Available commands:\\n${commandList.join(\"\\n\")}\\n\\nIMPORTANT: This is a slash command — respond by executing the matching command action, not with conversational text.`,\n values: {\n commandCount: commands.length,\n isCommand: true,\n hasElevatedCommands: commands.some((c) => c.requiresElevated),\n },\n data: { commands, isCommand: true },\n };\n }\n\n // Minimal context for non-command messages — don't pollute the prompt\n return {\n text: \"\",\n values: {\n commandCount: commands.length,\n isCommand: false,\n },\n data: { isCommand: false },\n };\n },\n};\n\n/**\n * Format command result for display\n */\nexport function formatCommandResult(result: CommandResult): string {\n if (result.error) {\n return `Error: ${result.error}`;\n }\n return result.reply ?? \"Command executed\";\n}\n\n/**\n * Check if a sender is authorized\n */\nexport function isAuthorized(context: CommandContext, command: CommandDefinition): boolean {\n if (!command.requiresAuth) {\n return true;\n }\n return context.isAuthorized;\n}\n\n/**\n * Check if a sender has elevated permissions\n */\nexport function isElevated(context: CommandContext, command: CommandDefinition): boolean {\n if (!command.requiresElevated) {\n return true;\n }\n return context.isElevated;\n}\n\n/**\n * Plugin Commands\n *\n * Provides chat commands as Eliza actions. Commands are detected\n * by their text aliases (e.g., /help, /status) and executed as actions.\n *\n * Design decisions for messaging integration:\n * 1. Actions use strict validate() — only true for slash-prefixed messages\n * 2. Similes are slash-only — no natural language to prevent LLM misrouting\n * 3. Provider is context-aware — full docs for commands, empty for normal msgs\n * 4. Registry is scoped per agentId — no cross-agent contamination\n * 5. Events use proper EventType enums — not raw strings\n */\nexport const commandsPlugin: Plugin = {\n name: \"commands\",\n description: \"Chat command system with /help, /status, /reset, etc.\",\n\n providers: [commandRegistryProvider],\n\n actions: [helpAction, statusAction, stopAction, modelsAction, commandsListAction],\n\n config: {\n COMMANDS_ENABLED: \"true\",\n COMMANDS_CONFIG_ENABLED: \"false\",\n COMMANDS_DEBUG_ENABLED: \"false\",\n COMMANDS_BASH_ENABLED: \"false\",\n COMMANDS_RESTART_ENABLED: \"true\",\n },\n\n tests: [\n {\n name: \"command-detection\",\n tests: [\n {\n name: \"Detect command prefix\",\n fn: async (_runtime: IAgentRuntime) => {\n if (!hasCommand(\"/help\")) {\n throw new Error(\"Should detect /help command\");\n }\n if (!hasCommand(\"/status test\")) {\n throw new Error(\"Should detect /status with args\");\n }\n if (hasCommand(\"hello world\")) {\n throw new Error(\"Should not detect plain text as command\");\n }\n logger.success(\"Command prefix detection works correctly\");\n },\n },\n {\n name: \"Parse command with args\",\n fn: async (_runtime: IAgentRuntime) => {\n const detection = detectCommand(\"/think:high\");\n if (!detection.isCommand) {\n throw new Error(\"Should detect think command\");\n }\n if (detection.command?.key !== \"think\") {\n throw new Error(`Expected key 'think', got '${detection.command?.key}'`);\n }\n if (detection.command?.args[0] !== \"high\") {\n throw new Error(`Expected arg 'high', got '${detection.command?.args[0]}'`);\n }\n logger.success(\"Command argument parsing works correctly\");\n },\n },\n {\n name: \"Normalize command body\",\n fn: async (_runtime: IAgentRuntime) => {\n const normalized1 = normalizeCommandBody(\"/status: test\");\n if (normalized1 !== \"/status test\") {\n throw new Error(`Expected '/status test', got '${normalized1}'`);\n }\n\n const normalized2 = normalizeCommandBody(\"@bot /help\", \"bot\");\n if (normalized2 !== \"/help\") {\n throw new Error(`Expected '/help', got '${normalized2}'`);\n }\n\n logger.success(\"Command normalization works correctly\");\n },\n },\n {\n name: \"Find command by alias\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByAlias(\"/h\");\n if (!cmd) {\n throw new Error(\"Should find help command by /h alias\");\n }\n if (cmd.key !== \"help\") {\n throw new Error(`Expected key 'help', got '${cmd.key}'`);\n }\n logger.success(\"Command alias lookup works correctly\");\n },\n },\n {\n name: \"Find command by key\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByKey(\"status\");\n if (!cmd) {\n throw new Error(\"Should find status command by key\");\n }\n if (cmd.key !== \"status\") {\n throw new Error(`Expected key 'status', got '${cmd.key}'`);\n }\n logger.success(\"Command key lookup works correctly\");\n },\n },\n ],\n },\n {\n name: \"command-registry\",\n tests: [\n {\n name: \"Get enabled commands\",\n fn: async (_runtime: IAgentRuntime) => {\n const commands = getEnabledCommands();\n if (commands.length === 0) {\n throw new Error(\"Should have enabled commands\");\n }\n // Check some expected commands exist\n const cmdHelp = commands.some((c) => c.key === \"help\");\n const cmdStatus = commands.some((c) => c.key === \"status\");\n if (!cmdHelp || !cmdStatus) {\n throw new Error(\"Should have help and status commands\");\n }\n logger.success(\"Command registry works correctly\");\n },\n },\n {\n name: \"Register custom command\",\n fn: async (_runtime: IAgentRuntime) => {\n const customCmd: CommandDefinition = {\n key: \"test-custom\",\n description: \"Test custom command\",\n textAliases: [\"/test-custom\", \"/tc\"],\n scope: \"text\",\n };\n\n registerCommand(customCmd);\n const found = findCommandByKey(\"test-custom\");\n if (!found) {\n throw new Error(\"Should find registered custom command\");\n }\n\n unregisterCommand(\"test-custom\");\n const notFound = findCommandByKey(\"test-custom\");\n if (notFound) {\n throw new Error(\"Should not find unregistered command\");\n }\n\n logger.success(\"Custom command registration works correctly\");\n },\n },\n {\n name: \"Get commands by category\",\n fn: async (_runtime: IAgentRuntime) => {\n const statusCommands = getCommandsByCategory(\"status\");\n if (statusCommands.length === 0) {\n throw new Error(\"Should have status category commands\");\n }\n const allStatus = statusCommands.every((c) => c.category === \"status\");\n if (!allStatus) {\n throw new Error(\"All returned commands should be in status category\");\n }\n logger.success(\"Command categorization works correctly\");\n },\n },\n ],\n },\n ],\n\n async init(config, runtime) {\n logger.log(\"[plugin-commands] Initializing command system\");\n\n // Initialize an isolated command store for this runtime\n // This prevents cross-agent contamination in multi-agent deployments\n initForRuntime(runtime.agentId);\n\n // Configure command enablement from config\n const configEnabled = config.COMMANDS_CONFIG_ENABLED === \"true\";\n const debugEnabled = config.COMMANDS_DEBUG_ENABLED === \"true\";\n const bashEnabled = config.COMMANDS_BASH_ENABLED === \"true\";\n const restartEnabled = config.COMMANDS_RESTART_ENABLED !== \"false\";\n\n // Update command enabled states (now on the isolated copy)\n const configCmd = findCommandByKey(\"config\");\n if (configCmd) {\n configCmd.enabled = configEnabled;\n }\n\n const debugCmd = findCommandByKey(\"debug\");\n if (debugCmd) {\n debugCmd.enabled = debugEnabled;\n }\n\n const bashCmd = findCommandByKey(\"bash\");\n if (bashCmd) {\n bashCmd.enabled = bashEnabled;\n }\n\n const restartCmd = findCommandByKey(\"restart\");\n if (restartCmd) {\n restartCmd.enabled = restartEnabled;\n }\n\n const enabledCount = getEnabledCommands().length;\n logger.log(`[plugin-commands] ${enabledCount} commands enabled for agent ${runtime.agentId}`);\n },\n};\n\nexport default commandsPlugin;\n",
6
- "/**\n * Command registry - defines all available chat commands\n *\n * IMPORTANT: The registry uses module-level state for convenience, but\n * provides `cloneCommands()` and `resetCommands()` so that `init()` can\n * work on isolated copies per runtime. The `init()` function in the main\n * plugin file should clone before mutating to avoid cross-agent contamination.\n */\n\nimport type { CommandDefinition } from \"./types\";\n\n// Default command definitions (frozen reference — never mutate these directly)\nconst DEFAULT_COMMANDS: ReadonlyArray<CommandDefinition> = [\n // Status commands\n {\n key: \"help\",\n nativeName: \"help\",\n description: \"Show available commands\",\n textAliases: [\"/help\", \"/h\", \"/?\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"commands\",\n nativeName: \"commands\",\n description: \"List all commands\",\n textAliases: [\"/commands\", \"/cmds\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"status\",\n nativeName: \"status\",\n description: \"Show current session status\",\n textAliases: [\"/status\", \"/s\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"context\",\n nativeName: \"context\",\n description: \"Show current context information\",\n textAliases: [\"/context\", \"/ctx\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: true,\n args: [{ name: \"mode\", description: \"Output mode (list, detail, json)\" }],\n },\n {\n key: \"whoami\",\n nativeName: \"whoami\",\n description: \"Show your identity information\",\n textAliases: [\"/whoami\", \"/who\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n\n // Session commands\n {\n key: \"stop\",\n nativeName: \"stop\",\n description: \"Stop current operation\",\n textAliases: [\"/stop\", \"/abort\", \"/cancel\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"restart\",\n nativeName: \"restart\",\n description: \"Restart the session\",\n textAliases: [\"/restart\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"reset\",\n nativeName: \"reset\",\n description: \"Reset session state\",\n textAliases: [\"/reset\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"new\",\n nativeName: \"new\",\n description: \"Start a new conversation\",\n textAliases: [\"/new\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"compact\",\n nativeName: \"compact\",\n description: \"Compact conversation history\",\n textAliases: [\"/compact\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: true,\n args: [{ name: \"instructions\", description: \"Optional compaction instructions\" }],\n },\n\n // Options commands\n {\n key: \"think\",\n nativeName: \"think\",\n description: \"Set thinking level\",\n textAliases: [\"/think\", \"/thinking\", \"/t\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, minimal, low, medium, high, xhigh\" }],\n },\n {\n key: \"verbose\",\n nativeName: \"verbose\",\n description: \"Set verbose output level\",\n textAliases: [\"/verbose\", \"/v\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, full\" }],\n },\n {\n key: \"reasoning\",\n nativeName: \"reasoning\",\n description: \"Set reasoning visibility\",\n textAliases: [\"/reasoning\", \"/reason\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, stream\" }],\n },\n {\n key: \"elevated\",\n nativeName: \"elevated\",\n description: \"Set elevated permission mode\",\n textAliases: [\"/elevated\", \"/elev\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, ask, full\" }],\n requiresAuth: true,\n },\n {\n key: \"model\",\n nativeName: \"model\",\n description: \"Set or show current model\",\n textAliases: [\"/model\", \"/m\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"model\", description: \"provider/model or alias\" }],\n },\n {\n key: \"models\",\n nativeName: \"models\",\n description: \"List available models\",\n textAliases: [\"/models\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"usage\",\n nativeName: \"usage\",\n description: \"Show token usage\",\n textAliases: [\"/usage\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"queue\",\n nativeName: \"queue\",\n description: \"Set queue mode\",\n textAliases: [\"/queue\", \"/q\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [\n {\n name: \"mode\",\n description: \"steer, followup, collect, interrupt, or options\",\n },\n ],\n },\n\n // Management commands\n {\n key: \"allowlist\",\n nativeName: \"allowlist\",\n description: \"Manage sender allowlist\",\n textAliases: [\"/allowlist\", \"/allow\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"action\", description: \"list, add, remove\" },\n { name: \"value\", description: \"sender to add/remove\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"approve\",\n nativeName: \"approve\",\n description: \"Approve or deny a pending action\",\n textAliases: [\"/approve\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"id\", description: \"Approval ID\", required: true },\n { name: \"action\", description: \"allow-once, allow-always, deny\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"subagents\",\n nativeName: \"subagents\",\n description: \"Manage subagents\",\n textAliases: [\"/subagents\", \"/sub\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [{ name: \"action\", description: \"list, stop, log, info, send\" }],\n requiresAuth: true,\n },\n {\n key: \"config\",\n nativeName: \"config\",\n description: \"View or set configuration\",\n textAliases: [\"/config\", \"/cfg\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"key\", description: \"Configuration key\" },\n { name: \"value\", description: \"Value to set\" },\n ],\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n {\n key: \"debug\",\n nativeName: \"debug\",\n description: \"Debug information\",\n textAliases: [\"/debug\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n\n // Media commands\n {\n key: \"tts\",\n nativeName: \"tts\",\n description: \"Text-to-speech settings\",\n textAliases: [\"/tts\", \"/voice\"],\n scope: \"both\",\n category: \"media\",\n acceptsArgs: true,\n args: [\n {\n name: \"action\",\n description: \"on, off, status, provider, limit, audio\",\n },\n ],\n },\n\n // Tools commands\n {\n key: \"bash\",\n nativeName: \"bash\",\n description: \"Execute shell command\",\n textAliases: [\"/bash\", \"/sh\", \"/!\"],\n scope: \"text\",\n category: \"tools\",\n acceptsArgs: true,\n args: [\n {\n name: \"command\",\n description: \"Shell command to execute\",\n captureRemaining: true,\n },\n ],\n requiresAuth: true,\n requiresElevated: true,\n },\n];\n\n// ── Per-runtime command storage ──────────────────────────────────────────\n// Each agent runtime gets its own isolated command set via `initForRuntime()`.\n// The module-level state is used as a fallback for convenience (tests, etc.).\n//\n// Why a WeakMap? Agent runtimes may be created/destroyed; we don't want to\n// leak memory by holding strong references to disposed runtimes.\n\ninterface CommandStore {\n commands: CommandDefinition[];\n aliasMap: Map<string, CommandDefinition> | null;\n}\n\n/** Per-runtime stores keyed by agentId */\nconst runtimeStores = new Map<string, CommandStore>();\n/** Fallback store for when no runtime context is set */\nconst fallbackStore: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n};\n/** Currently active store (set during init, reset on test teardown) */\nlet activeStore: CommandStore = fallbackStore;\n\n/**\n * Initialize an isolated command store for a specific runtime.\n * Called from plugin init() to prevent cross-agent contamination.\n */\nexport function initForRuntime(agentId: string): void {\n const store: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n };\n runtimeStores.set(agentId, store);\n activeStore = store;\n}\n\n/**\n * Set the active command store for a given runtime.\n * Providers and actions should call this before accessing commands.\n */\nexport function useRuntime(agentId: string): void {\n const store = runtimeStores.get(agentId);\n if (store) {\n activeStore = store;\n }\n}\n\n/**\n * Get all registered commands\n */\nexport function getCommands(): CommandDefinition[] {\n return [...activeStore.commands];\n}\n\n/**\n * Get enabled commands\n */\nexport function getEnabledCommands(): CommandDefinition[] {\n return activeStore.commands.filter((cmd) => cmd.enabled !== false);\n}\n\n/**\n * Get commands by category\n */\nexport function getCommandsByCategory(category: string): CommandDefinition[] {\n return activeStore.commands.filter((cmd) => cmd.category === category && cmd.enabled !== false);\n}\n\n/**\n * Register a custom command\n */\nexport function registerCommand(command: CommandDefinition): void {\n // Remove existing command with same key\n activeStore.commands = activeStore.commands.filter((c) => c.key !== command.key);\n activeStore.commands.push(command);\n activeStore.aliasMap = null; // Invalidate cache\n}\n\n/**\n * Register multiple commands\n */\nexport function registerCommands(newCommands: CommandDefinition[]): void {\n for (const command of newCommands) {\n registerCommand(command);\n }\n}\n\n/**\n * Unregister a command\n */\nexport function unregisterCommand(key: string): void {\n activeStore.commands = activeStore.commands.filter((c) => c.key !== key);\n activeStore.aliasMap = null;\n}\n\n/**\n * Reset to default commands (for the active store)\n */\nexport function resetCommands(): void {\n activeStore.commands = DEFAULT_COMMANDS.map((c) => ({ ...c }));\n activeStore.aliasMap = null;\n}\n\n/**\n * Build and cache alias map for the active store\n */\nfunction getAliasMap(): Map<string, CommandDefinition> {\n if (activeStore.aliasMap) return activeStore.aliasMap;\n\n activeStore.aliasMap = new Map();\n for (const command of activeStore.commands) {\n if (command.enabled === false) continue;\n\n for (const alias of command.textAliases) {\n const normalized = alias.toLowerCase().trim();\n if (!activeStore.aliasMap.has(normalized)) {\n activeStore.aliasMap.set(normalized, command);\n }\n }\n }\n return activeStore.aliasMap;\n}\n\n/**\n * Find command by alias\n */\nexport function findCommandByAlias(alias: string): CommandDefinition | undefined {\n const map = getAliasMap();\n return map.get(alias.toLowerCase().trim());\n}\n\n/**\n * Find command by key\n */\nexport function findCommandByKey(key: string): CommandDefinition | undefined {\n return activeStore.commands.find((c) => c.key === key);\n}\n\n/**\n * Check if text starts with any command alias\n */\nexport function startsWithCommand(text: string): CommandDefinition | undefined {\n const map = getAliasMap();\n const normalized = text.toLowerCase().trim();\n\n // Check exact match first\n for (const [alias, command] of map) {\n if (normalized === alias) {\n return command;\n }\n if (normalized.startsWith(`${alias} `) || normalized.startsWith(`${alias}:`)) {\n return command;\n }\n }\n\n return undefined;\n}\n",
7
- "/**\n * Command parser - detects and parses commands from message text\n */\n\nimport { startsWithCommand } from \"./registry\";\nimport type { CommandDefinition, CommandDetectionResult, ParsedCommand } from \"./types\";\n\nconst escapeRegExp = (value: string) => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Check if text contains a command\n */\nexport function hasCommand(text: string): boolean {\n if (!text) return false;\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) return false;\n return Boolean(startsWithCommand(trimmed));\n}\n\n/**\n * Detect command in text\n */\nexport function detectCommand(text: string): CommandDetectionResult {\n if (!text) {\n return { isCommand: false };\n }\n\n const trimmed = text.trim();\n\n // Quick check for command prefix\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) {\n return { isCommand: false };\n }\n\n const command = startsWithCommand(trimmed);\n if (!command) {\n return { isCommand: false };\n }\n\n const parsed = parseCommand(trimmed, command);\n if (!parsed) {\n return { isCommand: false };\n }\n\n return { isCommand: true, command: parsed };\n}\n\n/**\n * Parse a command from text\n */\nexport function parseCommand(text: string, definition: CommandDefinition): ParsedCommand | null {\n const trimmed = text.trim();\n\n // Find the matching alias\n let matchedAlias: string | null = null;\n for (const alias of definition.textAliases) {\n const normalized = alias.toLowerCase();\n if (trimmed.toLowerCase() === normalized) {\n matchedAlias = alias;\n break;\n }\n if (\n trimmed.toLowerCase().startsWith(`${normalized} `) ||\n trimmed.toLowerCase().startsWith(`${normalized}:`)\n ) {\n matchedAlias = alias;\n break;\n }\n }\n\n if (!matchedAlias) {\n return null;\n }\n\n // Extract arguments\n let rawArgs = trimmed.slice(matchedAlias.length).trim();\n\n // Handle colon separator (e.g., /think:high)\n if (rawArgs.startsWith(\":\")) {\n rawArgs = rawArgs.slice(1).trim();\n }\n\n // Parse arguments\n const args = parseArgs(rawArgs, definition);\n\n return {\n key: definition.key,\n canonical: definition.textAliases[0] ?? `/${definition.key}`,\n args,\n rawArgs: rawArgs || undefined,\n };\n}\n\n/**\n * Parse arguments based on command definition\n */\nfunction parseArgs(rawArgs: string, definition: CommandDefinition): string[] {\n if (!rawArgs || !definition.acceptsArgs) {\n return [];\n }\n\n const parsing = definition.argsParsing ?? \"positional\";\n\n if (parsing === \"none\") {\n // Return entire string as single argument\n return rawArgs ? [rawArgs] : [];\n }\n\n // Positional parsing\n const args: string[] = [];\n const argDefs = definition.args ?? [];\n\n // Split by whitespace, respecting quotes\n const tokens = tokenize(rawArgs);\n\n for (let i = 0; i < tokens.length; i++) {\n const argDef = argDefs[i];\n\n // If this arg captures remaining, join all remaining tokens\n if (argDef?.captureRemaining) {\n args.push(tokens.slice(i).join(\" \"));\n break;\n }\n\n args.push(tokens[i]);\n }\n\n return args;\n}\n\n/**\n * Tokenize argument string, respecting quotes\n */\nfunction tokenize(input: string): string[] {\n const tokens: string[] = [];\n let current = \"\";\n let inQuote = false;\n let quoteChar = \"\";\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n\n if (inQuote) {\n if (char === quoteChar) {\n inQuote = false;\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n } else if (char === '\"' || char === \"'\") {\n inQuote = true;\n quoteChar = char;\n } else if (/\\s/.test(char)) {\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n }\n\n if (current) {\n tokens.push(current);\n }\n\n return tokens;\n}\n\n/**\n * Normalize command body (handle bot mentions, colon syntax, etc.)\n */\nexport function normalizeCommandBody(text: string, botMention?: string): string {\n let normalized = text.trim();\n\n // Remove bot mention prefix (e.g., \"@bot /status\" -> \"/status\")\n if (botMention) {\n const mentionPattern = new RegExp(`^@${escapeRegExp(botMention)}\\\\s*`, \"i\");\n normalized = normalized.replace(mentionPattern, \"\");\n }\n\n // Handle colon in command (e.g., \"/command: args\" -> \"/command args\")\n normalized = normalized.replace(/^(\\/\\w+):\\s*/, \"$1 \");\n\n return normalized.trim();\n}\n\n/**\n * Check if text is a command-only message (no other content)\n */\nexport function isCommandOnly(text: string): boolean {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return false;\n }\n\n // If there's no rawArgs, it's command-only\n if (!detection.command.rawArgs) {\n return true;\n }\n\n // Check if rawArgs is just whitespace\n return detection.command.rawArgs.trim().length === 0;\n}\n\n/**\n * Get command and remaining text\n */\nexport function extractCommand(\n text: string\n): { command: ParsedCommand; remainingText: string } | null {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return null;\n }\n\n const { command } = detection;\n\n // For commands that don't accept args, remaining text is everything after the command\n if (!command.rawArgs) {\n return { command, remainingText: \"\" };\n }\n\n return { command, remainingText: command.rawArgs };\n}\n",
8
- "/**\n * Commands list action\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\nimport { getEnabledCommands } from \"../registry\";\n\nexport const commandsListAction: Action = {\n name: \"COMMANDS_LIST\",\n description:\n \"List all available commands with their aliases. Only activates for /commands or /cmds slash commands.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/commands\", \"/cmds\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"commands\";\n },\n\n async handler(_runtime: IAgentRuntime, _message: Memory, _state, _options, callback) {\n const commands = getEnabledCommands();\n const lines: string[] = [`**Commands (${commands.length}):**\\n`];\n\n for (const cmd of commands) {\n const aliases = cmd.textAliases.join(\", \");\n const authNote = cmd.requiresAuth ? \" [auth]\" : \"\";\n const elevatedNote = cmd.requiresElevated ? \" [elevated]\" : \"\";\n lines.push(`• **${cmd.key}**: ${aliases}${authNote}${elevatedNote}`);\n }\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/commands\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Commands (15):**\\n\\n• **help**: /help, /h, /?\\n• **status**: /status, /s...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
9
- "/**\n * Help command action\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\nimport { getEnabledCommands } from \"../registry\";\n\n/**\n * Format command list for help display\n */\nfunction formatCommandList(commands: ReturnType<typeof getEnabledCommands>): string {\n const lines: string[] = [\"**Available Commands:**\\n\"];\n\n const categories = [\n { key: \"status\", name: \"Status\" },\n { key: \"session\", name: \"Session\" },\n { key: \"options\", name: \"Options\" },\n { key: \"management\", name: \"Management\" },\n { key: \"media\", name: \"Media\" },\n { key: \"tools\", name: \"Tools\" },\n ];\n\n for (const cat of categories) {\n const catCommands = commands.filter((c) => c.category === cat.key);\n if (catCommands.length === 0) continue;\n\n lines.push(`\\n**${cat.name}:**`);\n for (const cmd of catCommands) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n // Add uncategorized commands\n const uncategorized = commands.filter((c) => !c.category);\n if (uncategorized.length > 0) {\n lines.push(\"\\n**Other:**\");\n for (const cmd of uncategorized) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const helpAction: Action = {\n name: \"HELP_COMMAND\",\n description:\n \"Show available commands and their descriptions. Only activates for /help, /h, or /? slash commands.\",\n // Only slash-command similes — \"help\" or \"show help\" as natural language\n // should be handled by the LLM's normal response, not this action\n similes: [\"/help\", \"/h\", \"/?\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"help\";\n },\n\n async handler(_runtime: IAgentRuntime, _message: Memory, _state, _options, callback) {\n const commands = getEnabledCommands();\n const helpText = formatCommandList(commands);\n\n await callback?.({ text: helpText });\n\n return {\n success: true,\n text: helpText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/help\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/?\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
10
- "/**\n * Models command action\n *\n * Queries the runtime for actually registered model handlers instead of\n * using a hardcoded list. Falls back to listing registered model types\n * when detailed model info is not available.\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { logger, ModelType } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\n/**\n * Describe a ModelType value in a user-friendly way\n */\nfunction describeModelType(modelType: string): string {\n const descriptions: Record<string, string> = {\n [ModelType.TEXT_SMALL]: \"Text (Small)\",\n [ModelType.TEXT_LARGE]: \"Text (Large)\",\n [ModelType.TEXT_REASONING_SMALL]: \"Reasoning (Small)\",\n [ModelType.TEXT_REASONING_LARGE]: \"Reasoning (Large)\",\n [ModelType.TEXT_COMPLETION]: \"Text Completion\",\n [ModelType.TEXT_EMBEDDING]: \"Embedding\",\n [ModelType.IMAGE]: \"Image Generation\",\n [ModelType.IMAGE_DESCRIPTION]: \"Image Description\",\n [ModelType.TRANSCRIPTION]: \"Transcription\",\n [ModelType.TEXT_TO_SPEECH]: \"Text-to-Speech\",\n [ModelType.AUDIO]: \"Audio\",\n [ModelType.VIDEO]: \"Video\",\n [ModelType.OBJECT_SMALL]: \"Object (Small)\",\n [ModelType.OBJECT_LARGE]: \"Object (Large)\",\n [ModelType.RESEARCH]: \"Research\",\n };\n return descriptions[modelType] ?? modelType;\n}\n\nexport const modelsAction: Action = {\n name: \"MODELS_COMMAND\",\n description: \"List available AI models and providers. Only activates for /models slash command.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/models\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"models\";\n },\n\n async handler(runtime: IAgentRuntime, _message: Memory, _state, _options, callback) {\n const lines: string[] = [\"**Available Models:**\\n\"];\n\n // Query runtime for registered model handlers\n try {\n const registeredTypes: string[] = [];\n const seen = new Set<string>();\n\n // Check each ModelType to see if a handler is registered.\n // Deduplicate since ModelType has legacy aliases (SMALL, MEDIUM, LARGE)\n // that map to the same underlying values.\n for (const modelType of Object.values(ModelType)) {\n if (seen.has(modelType)) continue;\n seen.add(modelType);\n try {\n // runtime.getModel() returns the handler or undefined\n const handler = runtime.getModel(modelType);\n if (handler) {\n registeredTypes.push(modelType);\n }\n } catch {\n // Model type not registered\n }\n }\n\n if (registeredTypes.length > 0) {\n lines.push(\"**Registered Model Types:**\");\n for (const modelType of registeredTypes) {\n lines.push(`• ${describeModelType(modelType)} (\\`${modelType}\\`)`);\n }\n } else {\n lines.push(\"No model handlers are currently registered.\");\n }\n\n // Show current model settings if available\n const modelProvider = runtime.getSetting(\"MODEL_PROVIDER\");\n const modelName = runtime.getSetting(\"MODEL_NAME\");\n if (modelProvider || modelName) {\n lines.push(\"\\n**Current Configuration:**\");\n if (modelProvider) lines.push(`• Provider: ${modelProvider}`);\n if (modelName) lines.push(`• Model: ${modelName}`);\n }\n } catch (err) {\n logger.warn({ src: \"plugin-commands\", err }, \"Error querying runtime models\");\n lines.push(\"Unable to query available models.\");\n }\n\n lines.push(\"\\n\\n_Use /model <provider/model> to switch models._\");\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/models\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Models:**\\n\\n**Registered Model Types:**\\n• Text (Large) (`text_large`)\\n• Text (Small) (`text_small`)...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
11
- "/**\n * Status command action\n *\n * This is the SLASH COMMAND version (/status, /s). It is distinct from the\n * bootstrap STATUS action which handles natural language like \"what's your status?\".\n *\n * Key differences:\n * - This action ONLY activates for /status or /s slash commands (validate checks prefix)\n * - Bootstrap STATUS handles conversational requests about agent state\n * - This action shows directive/session settings; bootstrap STATUS shows tasks/room info\n * - No natural language similes to prevent conflict with bootstrap STATUS\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\ninterface DirectiveModelState {\n provider?: string;\n model?: string;\n}\n\ninterface DirectiveSessionState {\n thinking: string | boolean;\n verbose: boolean | string;\n reasoning: boolean | string;\n elevated: boolean | string;\n model?: DirectiveModelState;\n}\n\ninterface DirectiveParserService {\n getSessionState?: (roomId: string) => DirectiveSessionState | undefined;\n}\n\n/**\n * Build status report including directive state\n */\nasync function buildStatusReport(runtime: IAgentRuntime, roomId: string): Promise<string> {\n const lines: string[] = [\"**Session Status:**\\n\"];\n\n // Agent info\n lines.push(`**Agent:** ${runtime.character.name ?? runtime.agentId}`);\n lines.push(`**Room:** ${roomId}`);\n\n // Try to get directive state from plugin-directives if available\n try {\n const directiveService = runtime.getService<DirectiveParserService>(\"directive-parser\");\n if (directiveService) {\n const state = directiveService.getSessionState?.(roomId);\n if (state) {\n lines.push(`\\n**Directives:**`);\n lines.push(`• Thinking: ${state.thinking}`);\n lines.push(`• Verbose: ${state.verbose}`);\n lines.push(`• Reasoning: ${state.reasoning}`);\n lines.push(`• Elevated: ${state.elevated}`);\n if (state.model?.provider || state.model?.model) {\n const modelStr = state.model.provider\n ? `${state.model.provider}/${state.model.model}`\n : state.model.model;\n lines.push(`• Model: ${modelStr}`);\n }\n }\n }\n } catch {\n // Directive plugin not available\n }\n\n // Get pending tasks count for context\n try {\n const tasks = await runtime.getTasks({ roomId });\n if (tasks.length > 0) {\n lines.push(`\\n**Tasks:** ${tasks.length} pending`);\n }\n } catch {\n // Task retrieval may not be available\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const statusAction: Action = {\n // Deliberately distinct from bootstrap's \"STATUS\" action name\n // Normalized: \"statuscommand\" vs \"status\" — no exact match collision\n name: \"STATUS_COMMAND\",\n description:\n \"Show session directive settings via /status slash command. Only activates for /status or /s prefix.\",\n // Only slash-command similes — no natural language to avoid stealing\n // from bootstrap STATUS which handles \"what's your status?\" etc.\n similes: [\"/status\", \"/s\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"status\";\n },\n\n async handler(runtime: IAgentRuntime, message: Memory, _state, _options, callback) {\n const statusText = await buildStatusReport(runtime, message.roomId);\n\n await callback?.({ text: statusText });\n\n return {\n success: true,\n text: statusText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/status\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Session Status:**\\n\\n**Agent:** Eliza\\n**Room:** room-456\\n\\n**Directives:**\\n• Thinking: low...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
12
- "/**\n * Stop command action\n *\n * Uses EventType.HOOK_COMMAND_STOP from @elizaos/core for proper integration\n * with the messaging pipeline and hook system.\n */\n\nimport type { Action, ActionExample, IAgentRuntime, Memory } from \"@elizaos/core\";\nimport { EventType, logger } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\nexport const stopAction: Action = {\n name: \"STOP_COMMAND\",\n description:\n \"Stop current operation or abort running tasks. Triggered by /stop, /abort, or /cancel slash commands only.\",\n // Only use slash-command similes to avoid matching natural language\n // like \"stop talking\" or \"cancel that\" which should go to bootstrap IGNORE\n similes: [\"/stop\", \"/abort\", \"/cancel\"],\n\n async validate(_runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n const detection = detectCommand(text);\n return (\n detection.isCommand && [\"stop\", \"abort\", \"cancel\"].includes(detection.command?.key ?? \"\")\n );\n },\n\n async handler(runtime: IAgentRuntime, message: Memory, _state, _options, callback) {\n // Emit the proper hook event for the stop command.\n // HookCommandPayload extends HookEventPayload which requires sessionKey,\n // messages, timestamp, context. The runtime injects itself automatically.\n try {\n await runtime.emitEvent(EventType.HOOK_COMMAND_STOP, {\n runtime,\n sessionKey: message.roomId,\n messages: [],\n timestamp: new Date(),\n context: {\n entityId: message.entityId,\n source: message.content?.source,\n },\n command: \"stop\" as const,\n senderId: message.entityId,\n commandSource: message.content?.source,\n });\n } catch (err) {\n logger.warn({ src: \"plugin-commands\", err }, \"Failed to emit HOOK_COMMAND_STOP event\");\n }\n\n const replyText = \"✓ Stop requested. Current operations will be cancelled.\";\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/stop\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/abort\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n"
5
+ "/**\n * Plugin Commands - Chat command system for Eliza agents\n *\n * Provides a slash-command system with:\n * - /help, /status, /commands for information\n * - /stop, /reset, /compact for session control\n * - /think, /verbose, /model for options\n * - /allowlist, /approve for management\n * - /tts for media\n * - /bash for tools (elevated)\n *\n * INTEGRATION NOTES:\n * - Commands are registered as Actions with strict validate() that only\n * matches slash-prefixed messages (e.g. /help, !stop). This prevents\n * conflicts with bootstrap actions (STATUS, IGNORE) and messaging plugins.\n * - Similes use ONLY slash-command forms (no natural language) so the LLM\n * won't accidentally route \"I need help\" to HELP_COMMAND instead of REPLY.\n * - The registry is scoped per runtime to prevent cross-agent state leaks.\n * - The COMMAND_REGISTRY provider includes the command list in the LLM context\n * ONLY when the message is a command, reducing prompt noise for normal messages.\n */\n\nimport {\n type IAgentRuntime,\n type Plugin,\n type Provider,\n type ProviderResult,\n type State,\n type Memory,\n logger,\n} from \"@elizaos/core\";\n\nimport {\n detectCommand,\n hasCommand,\n normalizeCommandBody,\n parseCommand,\n} from \"./parser\";\nimport {\n findCommandByAlias,\n findCommandByKey,\n getCommands,\n getCommandsByCategory,\n getEnabledCommands,\n initForRuntime,\n registerCommand,\n registerCommands,\n resetCommands,\n startsWithCommand,\n unregisterCommand,\n useRuntime,\n} from \"./registry\";\nimport type {\n CommandContext,\n CommandDefinition,\n CommandDetectionResult,\n CommandResult,\n ParsedCommand,\n ResolvedCommand,\n} from \"./types\";\n\n// Import actions\nimport { commandsListAction } from \"./actions/commands-list\";\nimport { helpAction } from \"./actions/help\";\nimport { modelsAction } from \"./actions/models\";\nimport { statusAction } from \"./actions/status\";\nimport { stopAction } from \"./actions/stop\";\n\n// Re-export everything\nexport * from \"./types\";\nexport * from \"./registry\";\nexport * from \"./parser\";\n\n/**\n * Provider that exposes available commands to the LLM context.\n *\n * Only injects the full command list when the message looks like a command.\n * For normal messages, returns a minimal hint so the LLM knows commands\n * exist but doesn't get a wall of command documentation in its context.\n */\nexport const commandRegistryProvider: Provider = {\n name: \"COMMAND_REGISTRY\",\n description: \"Available chat commands and their descriptions\",\n dynamic: true,\n\n async get(\n runtime: IAgentRuntime,\n message: Memory,\n _state: State,\n ): Promise<ProviderResult> {\n // Scope to the correct runtime's command store\n useRuntime(runtime.agentId);\n\n const text = message.content?.text ?? \"\";\n const isCommand = hasCommand(text);\n const commands = getEnabledCommands();\n\n if (isCommand) {\n // Full command context for command messages — helps the LLM select\n // the right action\n const commandList = commands.map((cmd) => {\n const auth = cmd.requiresAuth ? \" (requires auth)\" : \"\";\n return `- ${cmd.textAliases[0]}: ${cmd.description}${auth}`;\n });\n\n return {\n text: `The user sent a slash command. Available commands:\\n${commandList.join(\"\\n\")}\\n\\nIMPORTANT: This is a slash command — respond by executing the matching command action, not with conversational text.`,\n values: {\n commandCount: commands.length,\n isCommand: true,\n hasElevatedCommands: commands.some((c) => c.requiresElevated),\n },\n data: { commands, isCommand: true },\n };\n }\n\n // Minimal context for non-command messages — don't pollute the prompt\n return {\n text: \"\",\n values: {\n commandCount: commands.length,\n isCommand: false,\n },\n data: { isCommand: false },\n };\n },\n};\n\n/**\n * Format command result for display\n */\nexport function formatCommandResult(result: CommandResult): string {\n if (result.error) {\n return `Error: ${result.error}`;\n }\n return result.reply ?? \"Command executed\";\n}\n\n/**\n * Check if a sender is authorized\n */\nexport function isAuthorized(\n context: CommandContext,\n command: CommandDefinition,\n): boolean {\n if (!command.requiresAuth) {\n return true;\n }\n return context.isAuthorized;\n}\n\n/**\n * Check if a sender has elevated permissions\n */\nexport function isElevated(\n context: CommandContext,\n command: CommandDefinition,\n): boolean {\n if (!command.requiresElevated) {\n return true;\n }\n return context.isElevated;\n}\n\n/**\n * Plugin Commands\n *\n * Provides chat commands as Eliza actions. Commands are detected\n * by their text aliases (e.g., /help, /status) and executed as actions.\n *\n * Design decisions for messaging integration:\n * 1. Actions use strict validate() — only true for slash-prefixed messages\n * 2. Similes are slash-only — no natural language to prevent LLM misrouting\n * 3. Provider is context-aware — full docs for commands, empty for normal msgs\n * 4. Registry is scoped per agentId — no cross-agent contamination\n * 5. Events use proper EventType enums — not raw strings\n */\nexport const commandsPlugin: Plugin = {\n name: \"commands\",\n description: \"Chat command system with /help, /status, /reset, etc.\",\n\n providers: [commandRegistryProvider],\n\n actions: [\n helpAction,\n statusAction,\n stopAction,\n modelsAction,\n commandsListAction,\n ],\n\n config: {\n COMMANDS_ENABLED: \"true\",\n COMMANDS_CONFIG_ENABLED: \"false\",\n COMMANDS_DEBUG_ENABLED: \"false\",\n COMMANDS_BASH_ENABLED: \"false\",\n COMMANDS_RESTART_ENABLED: \"true\",\n },\n\n tests: [\n {\n name: \"command-detection\",\n tests: [\n {\n name: \"Detect command prefix\",\n fn: async (_runtime: IAgentRuntime) => {\n if (!hasCommand(\"/help\")) {\n throw new Error(\"Should detect /help command\");\n }\n if (!hasCommand(\"/status test\")) {\n throw new Error(\"Should detect /status with args\");\n }\n if (hasCommand(\"hello world\")) {\n throw new Error(\"Should not detect plain text as command\");\n }\n logger.success(\"Command prefix detection works correctly\");\n },\n },\n {\n name: \"Parse command with args\",\n fn: async (_runtime: IAgentRuntime) => {\n const detection = detectCommand(\"/think:high\");\n if (!detection.isCommand) {\n throw new Error(\"Should detect think command\");\n }\n if (detection.command?.key !== \"think\") {\n throw new Error(\n `Expected key 'think', got '${detection.command?.key}'`,\n );\n }\n if (detection.command?.args[0] !== \"high\") {\n throw new Error(\n `Expected arg 'high', got '${detection.command?.args[0]}'`,\n );\n }\n logger.success(\"Command argument parsing works correctly\");\n },\n },\n {\n name: \"Normalize command body\",\n fn: async (_runtime: IAgentRuntime) => {\n const normalized1 = normalizeCommandBody(\"/status: test\");\n if (normalized1 !== \"/status test\") {\n throw new Error(`Expected '/status test', got '${normalized1}'`);\n }\n\n const normalized2 = normalizeCommandBody(\"@bot /help\", \"bot\");\n if (normalized2 !== \"/help\") {\n throw new Error(`Expected '/help', got '${normalized2}'`);\n }\n\n logger.success(\"Command normalization works correctly\");\n },\n },\n {\n name: \"Find command by alias\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByAlias(\"/h\");\n if (!cmd) {\n throw new Error(\"Should find help command by /h alias\");\n }\n if (cmd.key !== \"help\") {\n throw new Error(`Expected key 'help', got '${cmd.key}'`);\n }\n logger.success(\"Command alias lookup works correctly\");\n },\n },\n {\n name: \"Find command by key\",\n fn: async (_runtime: IAgentRuntime) => {\n const cmd = findCommandByKey(\"status\");\n if (!cmd) {\n throw new Error(\"Should find status command by key\");\n }\n if (cmd.key !== \"status\") {\n throw new Error(`Expected key 'status', got '${cmd.key}'`);\n }\n logger.success(\"Command key lookup works correctly\");\n },\n },\n ],\n },\n {\n name: \"command-registry\",\n tests: [\n {\n name: \"Get enabled commands\",\n fn: async (_runtime: IAgentRuntime) => {\n const commands = getEnabledCommands();\n if (commands.length === 0) {\n throw new Error(\"Should have enabled commands\");\n }\n // Check some expected commands exist\n const cmdHelp = commands.some((c) => c.key === \"help\");\n const cmdStatus = commands.some((c) => c.key === \"status\");\n if (!cmdHelp || !cmdStatus) {\n throw new Error(\"Should have help and status commands\");\n }\n logger.success(\"Command registry works correctly\");\n },\n },\n {\n name: \"Register custom command\",\n fn: async (_runtime: IAgentRuntime) => {\n const customCmd: CommandDefinition = {\n key: \"test-custom\",\n description: \"Test custom command\",\n textAliases: [\"/test-custom\", \"/tc\"],\n scope: \"text\",\n };\n\n registerCommand(customCmd);\n const found = findCommandByKey(\"test-custom\");\n if (!found) {\n throw new Error(\"Should find registered custom command\");\n }\n\n unregisterCommand(\"test-custom\");\n const notFound = findCommandByKey(\"test-custom\");\n if (notFound) {\n throw new Error(\"Should not find unregistered command\");\n }\n\n logger.success(\"Custom command registration works correctly\");\n },\n },\n {\n name: \"Get commands by category\",\n fn: async (_runtime: IAgentRuntime) => {\n const statusCommands = getCommandsByCategory(\"status\");\n if (statusCommands.length === 0) {\n throw new Error(\"Should have status category commands\");\n }\n const allStatus = statusCommands.every(\n (c) => c.category === \"status\",\n );\n if (!allStatus) {\n throw new Error(\n \"All returned commands should be in status category\",\n );\n }\n logger.success(\"Command categorization works correctly\");\n },\n },\n ],\n },\n ],\n\n async init(config, runtime) {\n logger.log(\"[plugin-commands] Initializing command system\");\n\n // Initialize an isolated command store for this runtime\n // This prevents cross-agent contamination in multi-agent deployments\n initForRuntime(runtime.agentId);\n\n // Configure command enablement from config\n const configEnabled = config.COMMANDS_CONFIG_ENABLED === \"true\";\n const debugEnabled = config.COMMANDS_DEBUG_ENABLED === \"true\";\n const bashEnabled = config.COMMANDS_BASH_ENABLED === \"true\";\n const restartEnabled = config.COMMANDS_RESTART_ENABLED !== \"false\";\n\n // Update command enabled states (now on the isolated copy)\n const configCmd = findCommandByKey(\"config\");\n if (configCmd) {\n configCmd.enabled = configEnabled;\n }\n\n const debugCmd = findCommandByKey(\"debug\");\n if (debugCmd) {\n debugCmd.enabled = debugEnabled;\n }\n\n const bashCmd = findCommandByKey(\"bash\");\n if (bashCmd) {\n bashCmd.enabled = bashEnabled;\n }\n\n const restartCmd = findCommandByKey(\"restart\");\n if (restartCmd) {\n restartCmd.enabled = restartEnabled;\n }\n\n const enabledCount = getEnabledCommands().length;\n logger.log(\n `[plugin-commands] ${enabledCount} commands enabled for agent ${runtime.agentId}`,\n );\n },\n};\n\nexport default commandsPlugin;\n",
6
+ "/**\n * Command registry - defines all available chat commands\n *\n * IMPORTANT: The registry uses module-level state for convenience, but\n * provides `cloneCommands()` and `resetCommands()` so that `init()` can\n * work on isolated copies per runtime. The `init()` function in the main\n * plugin file should clone before mutating to avoid cross-agent contamination.\n */\n\nimport type { CommandDefinition } from \"./types\";\n\n// Default command definitions (frozen reference — never mutate these directly)\nconst DEFAULT_COMMANDS: ReadonlyArray<CommandDefinition> = [\n // Status commands\n {\n key: \"help\",\n nativeName: \"help\",\n description: \"Show available commands\",\n textAliases: [\"/help\", \"/h\", \"/?\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"commands\",\n nativeName: \"commands\",\n description: \"List all commands\",\n textAliases: [\"/commands\", \"/cmds\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"status\",\n nativeName: \"status\",\n description: \"Show current session status\",\n textAliases: [\"/status\", \"/s\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n {\n key: \"context\",\n nativeName: \"context\",\n description: \"Show current context information\",\n textAliases: [\"/context\", \"/ctx\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: true,\n args: [{ name: \"mode\", description: \"Output mode (list, detail, json)\" }],\n },\n {\n key: \"whoami\",\n nativeName: \"whoami\",\n description: \"Show your identity information\",\n textAliases: [\"/whoami\", \"/who\"],\n scope: \"both\",\n category: \"status\",\n acceptsArgs: false,\n },\n\n // Session commands\n {\n key: \"stop\",\n nativeName: \"stop\",\n description: \"Stop current operation\",\n textAliases: [\"/stop\", \"/abort\", \"/cancel\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"restart\",\n nativeName: \"restart\",\n description: \"Restart the session\",\n textAliases: [\"/restart\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"reset\",\n nativeName: \"reset\",\n description: \"Reset session state\",\n textAliases: [\"/reset\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n requiresAuth: true,\n },\n {\n key: \"new\",\n nativeName: \"new\",\n description: \"Start a new conversation\",\n textAliases: [\"/new\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: false,\n },\n {\n key: \"compact\",\n nativeName: \"compact\",\n description: \"Compact conversation history\",\n textAliases: [\"/compact\"],\n scope: \"both\",\n category: \"session\",\n acceptsArgs: true,\n args: [\n { name: \"instructions\", description: \"Optional compaction instructions\" },\n ],\n },\n\n // Options commands\n {\n key: \"think\",\n nativeName: \"think\",\n description: \"Set thinking level\",\n textAliases: [\"/think\", \"/thinking\", \"/t\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [\n { name: \"level\", description: \"off, minimal, low, medium, high, xhigh\" },\n ],\n },\n {\n key: \"verbose\",\n nativeName: \"verbose\",\n description: \"Set verbose output level\",\n textAliases: [\"/verbose\", \"/v\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, full\" }],\n },\n {\n key: \"reasoning\",\n nativeName: \"reasoning\",\n description: \"Set reasoning visibility\",\n textAliases: [\"/reasoning\", \"/reason\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, stream\" }],\n },\n {\n key: \"elevated\",\n nativeName: \"elevated\",\n description: \"Set elevated permission mode\",\n textAliases: [\"/elevated\", \"/elev\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"level\", description: \"off, on, ask, full\" }],\n requiresAuth: true,\n },\n {\n key: \"model\",\n nativeName: \"model\",\n description: \"Set or show current model\",\n textAliases: [\"/model\", \"/m\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [{ name: \"model\", description: \"provider/model or alias\" }],\n },\n {\n key: \"models\",\n nativeName: \"models\",\n description: \"List available models\",\n textAliases: [\"/models\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"usage\",\n nativeName: \"usage\",\n description: \"Show token usage\",\n textAliases: [\"/usage\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: false,\n },\n {\n key: \"queue\",\n nativeName: \"queue\",\n description: \"Set queue mode\",\n textAliases: [\"/queue\", \"/q\"],\n scope: \"both\",\n category: \"options\",\n acceptsArgs: true,\n args: [\n {\n name: \"mode\",\n description: \"steer, followup, collect, interrupt, or options\",\n },\n ],\n },\n\n // Management commands\n {\n key: \"allowlist\",\n nativeName: \"allowlist\",\n description: \"Manage sender allowlist\",\n textAliases: [\"/allowlist\", \"/allow\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"action\", description: \"list, add, remove\" },\n { name: \"value\", description: \"sender to add/remove\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"approve\",\n nativeName: \"approve\",\n description: \"Approve or deny a pending action\",\n textAliases: [\"/approve\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"id\", description: \"Approval ID\", required: true },\n { name: \"action\", description: \"allow-once, allow-always, deny\" },\n ],\n requiresAuth: true,\n },\n {\n key: \"subagents\",\n nativeName: \"subagents\",\n description: \"Manage subagents\",\n textAliases: [\"/subagents\", \"/sub\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [{ name: \"action\", description: \"list, stop, log, info, send\" }],\n requiresAuth: true,\n },\n {\n key: \"config\",\n nativeName: \"config\",\n description: \"View or set configuration\",\n textAliases: [\"/config\", \"/cfg\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n args: [\n { name: \"key\", description: \"Configuration key\" },\n { name: \"value\", description: \"Value to set\" },\n ],\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n {\n key: \"debug\",\n nativeName: \"debug\",\n description: \"Debug information\",\n textAliases: [\"/debug\"],\n scope: \"both\",\n category: \"management\",\n acceptsArgs: true,\n requiresAuth: true,\n enabled: false, // Disabled by default\n },\n\n // Media commands\n {\n key: \"tts\",\n nativeName: \"tts\",\n description: \"Text-to-speech settings\",\n textAliases: [\"/tts\", \"/voice\"],\n scope: \"both\",\n category: \"media\",\n acceptsArgs: true,\n args: [\n {\n name: \"action\",\n description: \"on, off, status, provider, limit, audio\",\n },\n ],\n },\n\n // Tools commands\n {\n key: \"bash\",\n nativeName: \"bash\",\n description: \"Execute shell command\",\n textAliases: [\"/bash\", \"/sh\", \"/!\"],\n scope: \"text\",\n category: \"tools\",\n acceptsArgs: true,\n args: [\n {\n name: \"command\",\n description: \"Shell command to execute\",\n captureRemaining: true,\n },\n ],\n requiresAuth: true,\n requiresElevated: true,\n },\n];\n\n// ── Per-runtime command storage ──────────────────────────────────────────\n// Each agent runtime gets its own isolated command set via `initForRuntime()`.\n// The module-level state is used as a fallback for convenience (tests, etc.).\n//\n// Why a WeakMap? Agent runtimes may be created/destroyed; we don't want to\n// leak memory by holding strong references to disposed runtimes.\n\ninterface CommandStore {\n commands: CommandDefinition[];\n aliasMap: Map<string, CommandDefinition> | null;\n}\n\n/** Per-runtime stores keyed by agentId */\nconst runtimeStores = new Map<string, CommandStore>();\n/** Fallback store for when no runtime context is set */\nlet fallbackStore: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n};\n/** Currently active store (set during init, reset on test teardown) */\nlet activeStore: CommandStore = fallbackStore;\n\n/**\n * Initialize an isolated command store for a specific runtime.\n * Called from plugin init() to prevent cross-agent contamination.\n */\nexport function initForRuntime(agentId: string): void {\n const store: CommandStore = {\n commands: DEFAULT_COMMANDS.map((c) => ({ ...c })),\n aliasMap: null,\n };\n runtimeStores.set(agentId, store);\n activeStore = store;\n}\n\n/**\n * Set the active command store for a given runtime.\n * Providers and actions should call this before accessing commands.\n */\nexport function useRuntime(agentId: string): void {\n const store = runtimeStores.get(agentId);\n if (store) {\n activeStore = store;\n }\n}\n\n/**\n * Get all registered commands\n */\nexport function getCommands(): CommandDefinition[] {\n return [...activeStore.commands];\n}\n\n/**\n * Get enabled commands\n */\nexport function getEnabledCommands(): CommandDefinition[] {\n return activeStore.commands.filter((cmd) => cmd.enabled !== false);\n}\n\n/**\n * Get commands by category\n */\nexport function getCommandsByCategory(category: string): CommandDefinition[] {\n return activeStore.commands.filter(\n (cmd) => cmd.category === category && cmd.enabled !== false,\n );\n}\n\n/**\n * Register a custom command\n */\nexport function registerCommand(command: CommandDefinition): void {\n // Remove existing command with same key\n activeStore.commands = activeStore.commands.filter(\n (c) => c.key !== command.key,\n );\n activeStore.commands.push(command);\n activeStore.aliasMap = null; // Invalidate cache\n}\n\n/**\n * Register multiple commands\n */\nexport function registerCommands(newCommands: CommandDefinition[]): void {\n for (const command of newCommands) {\n registerCommand(command);\n }\n}\n\n/**\n * Unregister a command\n */\nexport function unregisterCommand(key: string): void {\n activeStore.commands = activeStore.commands.filter((c) => c.key !== key);\n activeStore.aliasMap = null;\n}\n\n/**\n * Reset to default commands (for the active store)\n */\nexport function resetCommands(): void {\n activeStore.commands = DEFAULT_COMMANDS.map((c) => ({ ...c }));\n activeStore.aliasMap = null;\n}\n\n/**\n * Build and cache alias map for the active store\n */\nfunction getAliasMap(): Map<string, CommandDefinition> {\n if (activeStore.aliasMap) return activeStore.aliasMap;\n\n activeStore.aliasMap = new Map();\n for (const command of activeStore.commands) {\n if (command.enabled === false) continue;\n\n for (const alias of command.textAliases) {\n const normalized = alias.toLowerCase().trim();\n if (!activeStore.aliasMap.has(normalized)) {\n activeStore.aliasMap.set(normalized, command);\n }\n }\n }\n return activeStore.aliasMap;\n}\n\n/**\n * Find command by alias\n */\nexport function findCommandByAlias(\n alias: string,\n): CommandDefinition | undefined {\n const map = getAliasMap();\n return map.get(alias.toLowerCase().trim());\n}\n\n/**\n * Find command by key\n */\nexport function findCommandByKey(key: string): CommandDefinition | undefined {\n return activeStore.commands.find((c) => c.key === key);\n}\n\n/**\n * Check if text starts with any command alias\n */\nexport function startsWithCommand(text: string): CommandDefinition | undefined {\n const map = getAliasMap();\n const normalized = text.toLowerCase().trim();\n\n // Check exact match first\n for (const [alias, command] of map) {\n if (normalized === alias) {\n return command;\n }\n if (\n normalized.startsWith(alias + \" \") ||\n normalized.startsWith(alias + \":\")\n ) {\n return command;\n }\n }\n\n return undefined;\n}\n",
7
+ "/**\n * Command parser - detects and parses commands from message text\n */\n\nimport type {\n CommandDefinition,\n CommandDetectionResult,\n ParsedCommand,\n} from \"./types\";\nimport { findCommandByAlias, startsWithCommand } from \"./registry\";\n\nconst escapeRegExp = (value: string) =>\n value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\n/**\n * Check if text contains a command\n */\nexport function hasCommand(text: string): boolean {\n if (!text) return false;\n const trimmed = text.trim();\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) return false;\n return Boolean(startsWithCommand(trimmed));\n}\n\n/**\n * Detect command in text\n */\nexport function detectCommand(text: string): CommandDetectionResult {\n if (!text) {\n return { isCommand: false };\n }\n\n const trimmed = text.trim();\n\n // Quick check for command prefix\n if (!trimmed.startsWith(\"/\") && !trimmed.startsWith(\"!\")) {\n return { isCommand: false };\n }\n\n const command = startsWithCommand(trimmed);\n if (!command) {\n return { isCommand: false };\n }\n\n const parsed = parseCommand(trimmed, command);\n if (!parsed) {\n return { isCommand: false };\n }\n\n return { isCommand: true, command: parsed };\n}\n\n/**\n * Parse a command from text\n */\nexport function parseCommand(\n text: string,\n definition: CommandDefinition,\n): ParsedCommand | null {\n const trimmed = text.trim();\n\n // Find the matching alias\n let matchedAlias: string | null = null;\n for (const alias of definition.textAliases) {\n const normalized = alias.toLowerCase();\n if (trimmed.toLowerCase() === normalized) {\n matchedAlias = alias;\n break;\n }\n if (\n trimmed.toLowerCase().startsWith(normalized + \" \") ||\n trimmed.toLowerCase().startsWith(normalized + \":\")\n ) {\n matchedAlias = alias;\n break;\n }\n }\n\n if (!matchedAlias) {\n return null;\n }\n\n // Extract arguments\n let rawArgs = trimmed.slice(matchedAlias.length).trim();\n\n // Handle colon separator (e.g., /think:high)\n if (rawArgs.startsWith(\":\")) {\n rawArgs = rawArgs.slice(1).trim();\n }\n\n // Parse arguments\n const args = parseArgs(rawArgs, definition);\n\n return {\n key: definition.key,\n canonical: definition.textAliases[0] ?? `/${definition.key}`,\n args,\n rawArgs: rawArgs || undefined,\n };\n}\n\n/**\n * Parse arguments based on command definition\n */\nfunction parseArgs(rawArgs: string, definition: CommandDefinition): string[] {\n if (!rawArgs || !definition.acceptsArgs) {\n return [];\n }\n\n const parsing = definition.argsParsing ?? \"positional\";\n\n if (parsing === \"none\") {\n // Return entire string as single argument\n return rawArgs ? [rawArgs] : [];\n }\n\n // Positional parsing\n const args: string[] = [];\n const argDefs = definition.args ?? [];\n\n // Split by whitespace, respecting quotes\n const tokens = tokenize(rawArgs);\n\n for (let i = 0; i < tokens.length; i++) {\n const argDef = argDefs[i];\n\n // If this arg captures remaining, join all remaining tokens\n if (argDef?.captureRemaining) {\n args.push(tokens.slice(i).join(\" \"));\n break;\n }\n\n args.push(tokens[i]);\n }\n\n return args;\n}\n\n/**\n * Tokenize argument string, respecting quotes\n */\nfunction tokenize(input: string): string[] {\n const tokens: string[] = [];\n let current = \"\";\n let inQuote = false;\n let quoteChar = \"\";\n\n for (let i = 0; i < input.length; i++) {\n const char = input[i];\n\n if (inQuote) {\n if (char === quoteChar) {\n inQuote = false;\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n } else if (char === '\"' || char === \"'\") {\n inQuote = true;\n quoteChar = char;\n } else if (/\\s/.test(char)) {\n if (current) {\n tokens.push(current);\n current = \"\";\n }\n } else {\n current += char;\n }\n }\n\n if (current) {\n tokens.push(current);\n }\n\n return tokens;\n}\n\n/**\n * Normalize command body (handle bot mentions, colon syntax, etc.)\n */\nexport function normalizeCommandBody(\n text: string,\n botMention?: string,\n): string {\n let normalized = text.trim();\n\n // Remove bot mention prefix (e.g., \"@bot /status\" -> \"/status\")\n if (botMention) {\n const mentionPattern = new RegExp(`^@${escapeRegExp(botMention)}\\\\s*`, \"i\");\n normalized = normalized.replace(mentionPattern, \"\");\n }\n\n // Handle colon in command (e.g., \"/command: args\" -> \"/command args\")\n normalized = normalized.replace(/^(\\/\\w+):\\s*/, \"$1 \");\n\n return normalized.trim();\n}\n\n/**\n * Check if text is a command-only message (no other content)\n */\nexport function isCommandOnly(text: string): boolean {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return false;\n }\n\n // If there's no rawArgs, it's command-only\n if (!detection.command.rawArgs) {\n return true;\n }\n\n // Check if rawArgs is just whitespace\n return detection.command.rawArgs.trim().length === 0;\n}\n\n/**\n * Get command and remaining text\n */\nexport function extractCommand(\n text: string,\n): { command: ParsedCommand; remainingText: string } | null {\n const detection = detectCommand(text);\n if (!detection.isCommand || !detection.command) {\n return null;\n }\n\n const { command } = detection;\n\n // For commands that don't accept args, remaining text is everything after the command\n if (!command.rawArgs) {\n return { command, remainingText: \"\" };\n }\n\n return { command, remainingText: command.rawArgs };\n}\n",
8
+ "/**\n * Commands list action\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { getEnabledCommands } from \"../registry\";\nimport { detectCommand } from \"../parser\";\n\nexport const commandsListAction: Action = {\n name: \"COMMANDS_LIST\",\n description:\n \"List all available commands with their aliases. Only activates for /commands or /cmds slash commands.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/commands\", \"/cmds\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"commands\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const commands = getEnabledCommands();\n const lines: string[] = [`**Commands (${commands.length}):**\\n`];\n\n for (const cmd of commands) {\n const aliases = cmd.textAliases.join(\", \");\n const authNote = cmd.requiresAuth ? \" [auth]\" : \"\";\n const elevatedNote = cmd.requiresElevated ? \" [elevated]\" : \"\";\n lines.push(`• **${cmd.key}**: ${aliases}${authNote}${elevatedNote}`);\n }\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/commands\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Commands (15):**\\n\\n• **help**: /help, /h, /?\\n• **status**: /status, /s...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
9
+ "/**\n * Help command action\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { getCommandsByCategory, getEnabledCommands } from \"../registry\";\nimport { detectCommand } from \"../parser\";\n\n/**\n * Format command list for help display\n */\nfunction formatCommandList(\n commands: ReturnType<typeof getEnabledCommands>,\n): string {\n const lines: string[] = [\"**Available Commands:**\\n\"];\n\n const categories = [\n { key: \"status\", name: \"Status\" },\n { key: \"session\", name: \"Session\" },\n { key: \"options\", name: \"Options\" },\n { key: \"management\", name: \"Management\" },\n { key: \"media\", name: \"Media\" },\n { key: \"tools\", name: \"Tools\" },\n ];\n\n for (const cat of categories) {\n const catCommands = commands.filter((c) => c.category === cat.key);\n if (catCommands.length === 0) continue;\n\n lines.push(`\\n**${cat.name}:**`);\n for (const cmd of catCommands) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n // Add uncategorized commands\n const uncategorized = commands.filter((c) => !c.category);\n if (uncategorized.length > 0) {\n lines.push(\"\\n**Other:**\");\n for (const cmd of uncategorized) {\n const aliases = cmd.textAliases.slice(0, 2).join(\", \");\n lines.push(`• ${aliases} - ${cmd.description}`);\n }\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const helpAction: Action = {\n name: \"HELP_COMMAND\",\n description:\n \"Show available commands and their descriptions. Only activates for /help, /h, or /? slash commands.\",\n // Only slash-command similes — \"help\" or \"show help\" as natural language\n // should be handled by the LLM's normal response, not this action\n similes: [\"/help\", \"/h\", \"/?\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"help\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const commands = getEnabledCommands();\n const helpText = formatCommandList(commands);\n\n await callback?.({ text: helpText });\n\n return {\n success: true,\n text: helpText,\n data: { commandCount: commands.length },\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/help\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/?\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Commands:**\\n\\n**Status:**\\n• /help - Show available commands...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
10
+ "/**\n * Models command action\n *\n * Queries the runtime for actually registered model handlers instead of\n * using a hardcoded list. Falls back to listing registered model types\n * when detailed model info is not available.\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { ModelType, logger } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\n/**\n * Describe a ModelType value in a user-friendly way\n */\nfunction describeModelType(modelType: string): string {\n const descriptions: Record<string, string> = {\n [ModelType.TEXT_SMALL]: \"Text (Small)\",\n [ModelType.TEXT_LARGE]: \"Text (Large)\",\n [ModelType.TEXT_REASONING_SMALL]: \"Reasoning (Small)\",\n [ModelType.TEXT_REASONING_LARGE]: \"Reasoning (Large)\",\n [ModelType.TEXT_COMPLETION]: \"Text Completion\",\n [ModelType.TEXT_EMBEDDING]: \"Embedding\",\n [ModelType.IMAGE]: \"Image Generation\",\n [ModelType.IMAGE_DESCRIPTION]: \"Image Description\",\n [ModelType.TRANSCRIPTION]: \"Transcription\",\n [ModelType.TEXT_TO_SPEECH]: \"Text-to-Speech\",\n [ModelType.AUDIO]: \"Audio\",\n [ModelType.VIDEO]: \"Video\",\n [ModelType.OBJECT_SMALL]: \"Object (Small)\",\n [ModelType.OBJECT_LARGE]: \"Object (Large)\",\n [ModelType.RESEARCH]: \"Research\",\n };\n return descriptions[modelType] ?? modelType;\n}\n\nexport const modelsAction: Action = {\n name: \"MODELS_COMMAND\",\n description:\n \"List available AI models and providers. Only activates for /models slash command.\",\n // Only slash-command similes to avoid matching natural language\n similes: [\"/models\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"models\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const lines: string[] = [\"**Available Models:**\\n\"];\n\n // Query runtime for registered model handlers\n try {\n const registeredTypes: string[] = [];\n const seen = new Set<string>();\n\n // Check each ModelType to see if a handler is registered.\n // Deduplicate since ModelType has legacy aliases (SMALL, MEDIUM, LARGE)\n // that map to the same underlying values.\n for (const modelType of Object.values(ModelType)) {\n if (seen.has(modelType)) continue;\n seen.add(modelType);\n try {\n // runtime.getModel() returns the handler or undefined\n const handler = runtime.getModel(modelType);\n if (handler) {\n registeredTypes.push(modelType);\n }\n } catch {\n // Model type not registered\n }\n }\n\n if (registeredTypes.length > 0) {\n lines.push(\"**Registered Model Types:**\");\n for (const modelType of registeredTypes) {\n lines.push(`• ${describeModelType(modelType)} (\\`${modelType}\\`)`);\n }\n } else {\n lines.push(\"No model handlers are currently registered.\");\n }\n\n // Show current model settings if available\n const modelProvider = runtime.getSetting(\"MODEL_PROVIDER\");\n const modelName = runtime.getSetting(\"MODEL_NAME\");\n if (modelProvider || modelName) {\n lines.push(\"\\n**Current Configuration:**\");\n if (modelProvider) lines.push(`• Provider: ${modelProvider}`);\n if (modelName) lines.push(`• Model: ${modelName}`);\n }\n } catch (err) {\n logger.warn(\n { src: \"plugin-commands\", err },\n \"Error querying runtime models\",\n );\n lines.push(\"Unable to query available models.\");\n }\n\n lines.push(\"\\n\\n_Use /model <provider/model> to switch models._\");\n\n const replyText = lines.join(\"\\n\");\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/models\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Available Models:**\\n\\n**Registered Model Types:**\\n• Text (Large) (`text_large`)\\n• Text (Small) (`text_small`)...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
11
+ "/**\n * Status command action\n *\n * This is the SLASH COMMAND version (/status, /s). It is distinct from the\n * bootstrap STATUS action which handles natural language like \"what's your status?\".\n *\n * Key differences:\n * - This action ONLY activates for /status or /s slash commands (validate checks prefix)\n * - Bootstrap STATUS handles conversational requests about agent state\n * - This action shows directive/session settings; bootstrap STATUS shows tasks/room info\n * - No natural language similes to prevent conflict with bootstrap STATUS\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\ninterface DirectiveModelState {\n provider?: string;\n model?: string;\n}\n\ninterface DirectiveSessionState {\n thinking: string | boolean;\n verbose: boolean | string;\n reasoning: boolean | string;\n elevated: boolean | string;\n model?: DirectiveModelState;\n}\n\ninterface DirectiveParserService {\n getSessionState?: (roomId: string) => DirectiveSessionState | undefined;\n}\n\n/**\n * Build status report including directive state\n */\nasync function buildStatusReport(\n runtime: IAgentRuntime,\n roomId: string,\n): Promise<string> {\n const lines: string[] = [\"**Session Status:**\\n\"];\n\n // Agent info\n lines.push(`**Agent:** ${runtime.character.name ?? runtime.agentId}`);\n lines.push(`**Room:** ${roomId}`);\n\n // Try to get directive state from plugin-directives if available\n try {\n const directiveService =\n runtime.getService<DirectiveParserService>(\"directive-parser\");\n if (directiveService) {\n const state = directiveService.getSessionState?.(roomId);\n if (state) {\n lines.push(`\\n**Directives:**`);\n lines.push(`• Thinking: ${state.thinking}`);\n lines.push(`• Verbose: ${state.verbose}`);\n lines.push(`• Reasoning: ${state.reasoning}`);\n lines.push(`• Elevated: ${state.elevated}`);\n if (state.model?.provider || state.model?.model) {\n const modelStr = state.model.provider\n ? `${state.model.provider}/${state.model.model}`\n : state.model.model;\n lines.push(`• Model: ${modelStr}`);\n }\n }\n }\n } catch {\n // Directive plugin not available\n }\n\n // Get pending tasks count for context\n try {\n const tasks = await runtime.getTasks({ roomId });\n if (tasks.length > 0) {\n lines.push(`\\n**Tasks:** ${tasks.length} pending`);\n }\n } catch {\n // Task retrieval may not be available\n }\n\n return lines.join(\"\\n\");\n}\n\nexport const statusAction: Action = {\n // Deliberately distinct from bootstrap's \"STATUS\" action name\n // Normalized: \"statuscommand\" vs \"status\" — no exact match collision\n name: \"STATUS_COMMAND\",\n description:\n \"Show session directive settings via /status slash command. Only activates for /status or /s prefix.\",\n // Only slash-command similes — no natural language to avoid stealing\n // from bootstrap STATUS which handles \"what's your status?\" etc.\n similes: [\"/status\", \"/s\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n // Strict: only activate for slash commands, never natural language\n const detection = detectCommand(text);\n return detection.isCommand && detection.command?.key === \"status\";\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n const statusText = await buildStatusReport(runtime, message.roomId);\n\n await callback?.({ text: statusText });\n\n return {\n success: true,\n text: statusText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/status\" } },\n {\n user: \"assistant\",\n content: {\n text: \"**Session Status:**\\n\\n**Agent:** Eliza\\n**Room:** room-456\\n\\n**Directives:**\\n• Thinking: low...\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n",
12
+ "/**\n * Stop command action\n *\n * Uses EventType.HOOK_COMMAND_STOP from @elizaos/core for proper integration\n * with the messaging pipeline and hook system.\n */\n\nimport type {\n Action,\n ActionExample,\n IAgentRuntime,\n Memory,\n} from \"@elizaos/core\";\nimport { EventType, logger } from \"@elizaos/core\";\nimport { detectCommand } from \"../parser\";\n\nexport const stopAction: Action = {\n name: \"STOP_COMMAND\",\n description:\n \"Stop current operation or abort running tasks. Triggered by /stop, /abort, or /cancel slash commands only.\",\n // Only use slash-command similes to avoid matching natural language\n // like \"stop talking\" or \"cancel that\" which should go to bootstrap IGNORE\n similes: [\"/stop\", \"/abort\", \"/cancel\"],\n\n async validate(runtime: IAgentRuntime, message: Memory): Promise<boolean> {\n const text = message.content?.text ?? \"\";\n const detection = detectCommand(text);\n return (\n detection.isCommand &&\n [\"stop\", \"abort\", \"cancel\"].includes(detection.command?.key ?? \"\")\n );\n },\n\n async handler(\n runtime: IAgentRuntime,\n message: Memory,\n state,\n options,\n callback,\n ) {\n // Emit the proper hook event for the stop command.\n // HookCommandPayload extends HookEventPayload which requires sessionKey,\n // messages, timestamp, context. The runtime injects itself automatically.\n try {\n await runtime.emitEvent(EventType.HOOK_COMMAND_STOP, {\n runtime,\n sessionKey: message.roomId,\n messages: [],\n timestamp: new Date(),\n context: {\n entityId: message.entityId,\n source: message.content?.source,\n },\n command: \"stop\" as const,\n senderId: message.entityId,\n commandSource: message.content?.source,\n });\n } catch (err) {\n logger.warn(\n { src: \"plugin-commands\", err },\n \"Failed to emit HOOK_COMMAND_STOP event\",\n );\n }\n\n const replyText = \"✓ Stop requested. Current operations will be cancelled.\";\n await callback?.({ text: replyText });\n\n return {\n success: true,\n text: replyText,\n };\n },\n\n examples: [\n [\n { user: \"user\", content: { text: \"/stop\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n [\n { user: \"user\", content: { text: \"/abort\" } },\n {\n user: \"assistant\",\n content: {\n text: \"✓ Stop requested. Current operations will be cancelled.\",\n },\n },\n ],\n ] as ActionExample[][],\n};\n"
13
13
  ],
14
- "mappings": ";AAsBA;AAAA,YAEE;AAAA;;;ACZF,IAAM,mBAAqD;AAAA,EAEzD;AAAA,IACE,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa,CAAC,SAAS,MAAM,IAAI;AAAA,IACjC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa,CAAC,aAAa,OAAO;AAAA,IAClC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa,CAAC,WAAW,IAAI;AAAA,IAC7B,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,KAAK;AAAA,IACL,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,aAAa,CAAC,YAAY,MAAM;AAAA,IAChC,OAAO;AAAA,IACP,UAAU;AAAA,IACV,aAAa;AAAA,IACb,MAAM,CAAC,EAAE,MAAM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
16
16
  "names": []
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-commands",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.5",
4
4
  "type": "module",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/index.js",