Beam: remove /beam, it's not really a command

This commit is contained in:
Enrico Ros
2024-12-09 17:19:54 -08:00
parent 70764e9ca2
commit 6e8a25bc23
4 changed files with 12 additions and 28 deletions
-16
View File
@@ -1,16 +0,0 @@
import { ChatBeamIcon } from '~/common/components/icons/ChatBeamIcon';
import type { ICommandsProvider } from './ICommandsProvider';
export const CommandsBeam: ICommandsProvider = {
id: 'cmd-mode-beam',
rank: 9,
getCommands: () => [{
primary: '/beam',
arguments: ['prompt'],
description: 'Combine the smarts of models',
Icon: ChatBeamIcon,
}],
};
+1 -3
View File
@@ -1,14 +1,13 @@
import { ChatCommand, ICommandsProvider } from './ICommandsProvider';
import { CommandsAlter } from './CommandsAlter';
import { CommandsBeam } from './CommandsBeam';
import { CommandsBrowse } from './CommandsBrowse';
import { CommandsDraw } from './CommandsDraw';
import { CommandsHelp } from './CommandsHelp';
import { CommandsReact } from './CommandsReact';
export type CommandsProviderId = 'cmd-ass-browse' | 'cmd-ass-t2i' | 'cmd-chat-alter' | 'cmd-help' | 'cmd-mode-beam' | 'cmd-mode-react';
export type CommandsProviderId = 'cmd-ass-browse' | 'cmd-ass-t2i' | 'cmd-chat-alter' | 'cmd-help' | 'cmd-mode-react';
type TextCommandPiece =
| { type: 'nocmd'; value: string; }
@@ -20,7 +19,6 @@ const ChatCommandsProviders: Record<CommandsProviderId, ICommandsProvider> = {
'cmd-ass-t2i': CommandsDraw,
'cmd-chat-alter': CommandsAlter,
'cmd-help': CommandsHelp,
'cmd-mode-beam': CommandsBeam,
'cmd-mode-react': CommandsReact,
};
@@ -666,9 +666,9 @@ export function Composer(props: {
!llmAttachmentDraftsCollection.canAttachAllFragments ? 'warning'
: undefined;
// stable randomization of the /verb, between '/draw', '/react', '/beam', '/browse'
// stable randomization of the /verb, between '/draw', '/react', '/browse'
const placeholderAction = React.useMemo(() => {
const actions = ['/react', '/beam'];
const actions: string[] = ['/react'];
if (props.capabilityHasT2I) actions.push('/draw');
if (hasComposerBrowseCapability) actions.push('/browse');
return actions[Math.floor(Math.random() * actions.length)];
@@ -58,13 +58,15 @@ export async function _handleExecuteCommand(lastMessageId: DMessageId, lastMessa
cHandler.messageAppendAssistantText(`Available Chat Commands:\n${helpPrettyChatCommands()}`, 'help');
return true;
case 'cmd-mode-beam':
if (isErrorNoArgs || !userText)
return false;
// remove '/beam ', as we want to be a user chat message
cHandler.messageFragmentReplace(lastMessageId, lastMessageFirstFragment.fId, createTextContentFragment(userText), true);
cHandler.beamInvoke(cHandler.historyViewHead('cmd-mode-beam'), [], null);
return true;
// NOTE 12/9/2024: removed this as /beam should not be a command, but it's already a chat mode, e.g. can't be headless executed.
// the following code is here for reference/historical reasons
// case 'cmd-mode-beam':
// if (isErrorNoArgs || !userText)
// return false;
// // remove '/beam ', as we want to be a user chat message
// cHandler.messageFragmentReplace(lastMessageId, lastMessageFirstFragment.fId, createTextContentFragment(userText), true);
// cHandler.beamInvoke(cHandler.historyViewHead('cmd-mode-beam'), [], null);
// return true;
case 'cmd-mode-react':
// create a temporary copy of the message,