(result?: string, options?: {
display?: CommandResultDisplay;
shouldQuery?: boolean;
metaMessages?: string[];
nextInput?: string;
submitNextInput?: boolean;
})
| 553 | return new Promise<SlashCommandResult>(resolve => { |
| 554 | let doneWasCalled = false; |
| 555 | const onDone = (result?: string, options?: { |
| 556 | display?: CommandResultDisplay; |
| 557 | shouldQuery?: boolean; |
| 558 | metaMessages?: string[]; |
| 559 | nextInput?: string; |
| 560 | submitNextInput?: boolean; |
| 561 | }) => { |
| 562 | doneWasCalled = true; |
| 563 | // If display is 'skip', don't add any messages to the conversation |
| 564 | if (options?.display === 'skip') { |
| 565 | void resolve({ |
| 566 | messages: [], |
| 567 | shouldQuery: false, |
| 568 | command, |
| 569 | nextInput: options?.nextInput, |
| 570 | submitNextInput: options?.submitNextInput |
| 571 | }); |
| 572 | return; |
| 573 | } |
| 574 | |
| 575 | // Meta messages are model-visible but hidden from the user |
| 576 | const metaMessages = (options?.metaMessages ?? []).map((content: string) => createUserMessage({ |
| 577 | content, |
| 578 | isMeta: true |
| 579 | })); |
| 580 | |
| 581 | // In fullscreen the command just showed as a centered modal |
| 582 | // pane — the transient notification is enough feedback. The |
| 583 | // "❯ /config" + "⎿ dismissed" transcript entries are |
| 584 | // type:system subtype:local_command (user-visible but NOT sent |
| 585 | // to the model), so skipping them doesn't affect model context. |
| 586 | // Outside fullscreen keep them so scrollback shows what ran. |
| 587 | // Only skip "<Name> dismissed" modal-close notifications — |
| 588 | // commands that early-exit before showing a modal (/ultraplan |
| 589 | // usage, /rename, /proactive) use display:system for actual |
| 590 | // output that must reach the transcript. |
| 591 | const skipTranscript = isFullscreenEnvEnabled() && typeof result === 'string' && result.endsWith(' dismissed'); |
| 592 | void resolve({ |
| 593 | messages: options?.display === 'system' ? skipTranscript ? metaMessages : [createCommandInputMessage(formatCommandInput(command, args)), createCommandInputMessage(`<local-command-stdout>${result}</local-command-stdout>`), ...metaMessages] : [createUserMessage({ |
| 594 | content: prepareUserContent({ |
| 595 | inputString: formatCommandInput(command, args), |
| 596 | precedingInputBlocks |
| 597 | }) |
| 598 | }), result ? createUserMessage({ |
| 599 | content: `<local-command-stdout>${result}</local-command-stdout>` |
| 600 | }) : createUserMessage({ |
| 601 | content: `<local-command-stdout>${NO_CONTENT_MESSAGE}</local-command-stdout>` |
| 602 | }), ...metaMessages], |
| 603 | shouldQuery: options?.shouldQuery ?? false, |
| 604 | command, |
| 605 | nextInput: options?.nextInput, |
| 606 | submitNextInput: options?.submitNextInput |
| 607 | }); |
| 608 | }; |
| 609 | void command.load().then(mod => mod.call(onDone, { |
| 610 | ...context, |
| 611 | canUseTool |
no test coverage detected