nexus-shell 0.2.11 → 0.2.12

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.
@@ -17,7 +17,23 @@ interface ChatState {
17
17
  }) => void;
18
18
  clearMessages: () => void;
19
19
  setSlashCommands: (commands: ISlashCommandConfig[]) => void;
20
+ /**
21
+ * Add a command, replacing any existing one with the same `command` word.
22
+ *
23
+ * Registering is idempotent so that a component registering in an effect is
24
+ * safe to mount twice — which React does in StrictMode, and again on every
25
+ * remount. Appending blindly would leave the same command listed two or three
26
+ * times in the suggestion list.
27
+ */
20
28
  registerSlashCommand: (command: ISlashCommandConfig) => void;
29
+ /**
30
+ * Remove a command by its `command` word. Unknown words are ignored.
31
+ *
32
+ * The counterpart to {@link ChatState.registerSlashCommand}, so a component
33
+ * that registers on mount can clean up on unmount and stop offering a command
34
+ * whose handler is gone.
35
+ */
36
+ unregisterSlashCommand: (command: string) => void;
21
37
  }
22
38
  /**
23
39
  * Shell-level store for the chat pane's transcript and slash commands.