MCPcopy Create free account
hub / github.com/apache/maka / renderWelcomeBlock

Function renderWelcomeBlock

packages/cli/src/pi-transcript.ts:1702–1731  ·  view source on GitHub ↗
(width: number, locale: UiLocale)

Source from the content-addressed store, hash-verified

1700const MAKA_WORDMARK_WIDTH = Math.max(...MAKA_WORDMARK_LINES.map((line) => line.length));
1701
1702function renderWelcomeBlock(width: number, locale: UiLocale): string[] {
1703 // The branded home greets with the maka wordmark, a short localized tagline,
1704 // and the command-center entry points (direct input, /session,
1705 // /model, /setup) so a fresh session shows the main actions without typing
1706 // `/`. The active model and connection live in the statusline, so the
1707 // welcome does not repeat them.
1708 const copy = getTuiPrimaryGuidance(locale).welcome;
1709 const hints: [string, string][] = [
1710 ['/session', copy.session],
1711 ['/model', copy.model],
1712 ['/setup', copy.setup],
1713 ];
1714 const keyWidth = Math.max(...hints.map(([key]) => key.length));
1715 const lines: string[] = [];
1716 if (width < MAKA_WORDMARK_WIDTH) {
1717 lines.push(fitLine(ansi.accent('maka'), width));
1718 } else {
1719 for (const line of MAKA_WORDMARK_LINES) {
1720 lines.push(fitLine(ansi.accent(line), width));
1721 }
1722 }
1723 lines.push('');
1724 lines.push(fitLine(ansi.dim(copy.tagline), width));
1725 lines.push('');
1726 lines.push(fitLine(` ${copy.start}`, width));
1727 for (const [key, description] of hints) {
1728 lines.push(fitLine(ansi.dim(` ${key.padEnd(keyWidth)} ${description}`), width));
1729 }
1730 return lines;
1731}
1732
1733function renderSandboxBoundaryPrompt(
1734 request: SandboxBoundaryRequestEvent,

Callers 1

renderMakaPiTranscriptFunction · 0.85

Calls 3

getTuiPrimaryGuidanceFunction · 0.85
fitLineFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected