singularity-forge/src/logo.ts
Claude 679b3177a8 refactor(cli): slim down top-level src/ — dedup, unused fallbacks, onboarding
Pure deletion/deduplication pass on top-level src/*.ts. External behavior
unchanged; all targeted unit tests still pass.

cli.ts (−170 net lines)
  - Adopt canonical validateConfiguredModel from startup-model-validation.ts;
    delete the drifted local copy with hardcoded model fallbacks.
  - Import CliFlags + parseCliArgs from cli-web-branch.ts instead of keeping
    a second, 90%-identical parser; pass cliFlags directly into
    runWebCliBranch instead of re-parsing process.argv.
  - Extract 3 helpers for verbatim duplicates:
      * printNonTtyErrorAndExit (TTY gate, 2 call sites)
      * printExtensionErrors (extension load errors, 2 call sites)
      * reapplyValidatedModelOnFallback (post-createAgentSession fix, 2 sites)
  - Factor runHeadlessFromAuto helper shared by the `gsd auto` shorthand
    and the auto-piped-stdout redirect.
  - Collapse ensureRtkBootstrap from hand-rolled _done flag to a
    promise-memoized doRtkBootstrap.
  - Drop redundant validateConfiguredModel pre-createAgentSession calls
    (the post-createAgentSession call is the correct one per #2626).
  - Delete dead --version/-v and --help/-h fast paths (loader.ts already
    handles these before cli.ts is imported).

cli-web-branch.ts
  - Unify CliFlags with worktree, 'mcp' mode, and _selectedSessionPath.
  - Drop unused help?/version? flags (loader.ts intercepts them).

onboarding.ts
  - Add runStep<T>() helper with shared cancel/warn handling; collapse 4
    near-identical try/catch blocks around runLlmStep, runWebSearchStep,
    runRemoteQuestionsStep, runToolKeysStep.
  - Delete trivial isCancelError helper (inlined as p.isCancel).
  - Rewrite loadPico() adapter to build PicoModule from chalk so we can
    drop the redundant picocolors dependency.

package.json / package-lock.json
  - Remove picocolors direct dep (chalk remains the single color library).
2026-04-14 01:51:22 +00:00

27 lines
1.1 KiB
TypeScript

/**
* Shared GSD block-letter ASCII logo.
*
* Single source of truth — imported by:
* - scripts/postinstall.js (via dist/logo.js)
* - src/loader.ts (via ./logo.js)
*/
/** Raw logo lines — no ANSI codes, no leading newline. */
export const GSD_LOGO: readonly string[] = [
' ██████╗ ███████╗██████╗ ',
' ██╔════╝ ██╔════╝██╔══██╗',
' ██║ ███╗███████╗██║ ██║',
' ██║ ██║╚════██║██║ ██║',
' ╚██████╔╝███████║██████╔╝',
' ╚═════╝ ╚══════╝╚═════╝ ',
]
/**
* Render the logo block with a color function applied to each line.
*
* @param color — e.g. `(s) => `\x1b[36m${s}\x1b[0m`` or chalk.cyan
* @returns Ready-to-write string with leading/trailing newlines.
*/
export function renderLogo(color: (s: string) => string): string {
return '\n' + GSD_LOGO.map(color).join('\n') + '\n'
}