MCPcopy Index your code
hub / github.com/Noumena-Network/code / onDone

Function onDone

src/utils/processUserInput/processSlashCommand.tsx:629–682  ·  view source on GitHub ↗
(result?: string, options?: {
              display?: CommandResultDisplay;
              shouldQuery?: boolean;
              metaMessages?: string[];
              nextInput?: string;
              submitNextInput?: boolean;
            })

Source from the content-addressed store, hash-verified

627 return new Promise<SlashCommandResult>(resolve => {
628 let doneWasCalled = false;
629 const onDone = (result?: string, options?: {
630 display?: CommandResultDisplay;
631 shouldQuery?: boolean;
632 metaMessages?: string[];
633 nextInput?: string;
634 submitNextInput?: boolean;
635 }) => {
636 doneWasCalled = true;
637 // If display is 'skip', don't add any messages to the conversation
638 if (options?.display === 'skip') {
639 void resolve({
640 messages: [],
641 shouldQuery: false,
642 command,
643 nextInput: options?.nextInput,
644 submitNextInput: options?.submitNextInput
645 });
646 return;
647 }
648
649 // Meta messages are model-visible but hidden from the user
650 const metaMessages = (options?.metaMessages ?? []).map((content: string) => createUserMessage({
651 content,
652 isMeta: true
653 }));
654
655 // In fullscreen the command just showed as a centered modal
656 // pane — the transient notification is enough feedback. The
657 // "❯ /config" + "⎿ dismissed" transcript entries are
658 // type:system subtype:local_command (user-visible but NOT sent
659 // to the model), so skipping them doesn't affect model context.
660 // Outside fullscreen keep them so scrollback shows what ran.
661 // Only skip "<Name> dismissed" modal-close notifications —
662 // commands that early-exit before showing a modal (/ultraplan
663 // usage, /rename, /proactive) use display:system for actual
664 // output that must reach the transcript.
665 const skipTranscript = isFullscreenEnvEnabled() && typeof result === 'string' && result.endsWith(' dismissed');
666 void resolve({
667 messages: options?.display === 'system' ? skipTranscript ? metaMessages : [createCommandInputMessage(formatCommandInput(command, args)), createCommandInputMessage(`<local-command-stdout>${result}</local-command-stdout>`), ...metaMessages] : [createUserMessage({
668 content: prepareUserContent({
669 inputString: formatCommandInput(command, args),
670 precedingInputBlocks
671 })
672 }), result ? createUserMessage({
673 content: `<local-command-stdout>${result}</local-command-stdout>`
674 }) : createUserMessage({
675 content: `<local-command-stdout>${NO_CONTENT_MESSAGE}</local-command-stdout>`
676 }), ...metaMessages],
677 shouldQuery: options?.shouldQuery ?? false,
678 command,
679 nextInput: options?.nextInput,
680 submitNextInput: options?.submitNextInput
681 });
682 };
683 void command.load().then(mod => mod.call(onDone, {
684 ...context,
685 canUseTool

Callers 5

It2SetupPromptFunction · 0.50
renderInitialPromptFunction · 0.50
renderInstallFailedFunction · 0.50
renderFailedFunction · 0.50

Calls 6

isFullscreenEnvEnabledFunction · 0.85
formatCommandInputFunction · 0.85
prepareUserContentFunction · 0.85
resolveFunction · 0.50
createUserMessageFunction · 0.50

Tested by

no test coverage detected