@@ -4,32 +4,25 @@ import type { ProjectInfo } from '../types.ts';
44import { getProjectOverview } from '../utils/project-overview.ts' ;
55
66/**
7- * The prompt variants that ship to real users. Running `npx storybook ai setup`
8- * without environment variable overrides uses either of these prompts .
7+ * The single prompt variant that ships to real users. Running
8+ * `npx storybook ai setup` without any overrides always produces this prompt .
99 */
1010import * as currentlyUsedPrompt from './optimized-tests.ts' ;
1111export const DEFAULT_PROMPT_NAME : PromptName = 'optimized-tests' ;
1212
13- import * as extensivePrompt from './pattern-copy-play.ts' ;
14- export const EXTENSIVE_PROMPT_NAME : PromptName = 'pattern-copy-play' ;
15-
1613/**
1714 * Main prompt used currently in `npx storybook ai setup` command. If you promote a new prompt to be default, move this to the FORMERLY_USED_PROMPTS object below.
1815 */
19- const BUNDLED_PROMPTS : Record < string , ( projectInfo : ProjectInfo ) => string > = {
16+ const CURRENTLY_USED_PROMPT : Record < string , ( projectInfo : ProjectInfo ) => string > = {
2017 [ DEFAULT_PROMPT_NAME ] : currentlyUsedPrompt . instructions ,
21- [ EXTENSIVE_PROMPT_NAME ] : extensivePrompt . instructions ,
2218} ;
2319
2420/**
2521 * Names of variants registered behind `EVAL_SETUP_PROMPT`. Loaded on demand
2622 * from sibling files so the bundler can code|-split them away from the
2723 * default-only path that real users hit.
2824 */
29- const DYNAMICALLY_IMPORTED_PROMPTS : Record <
30- string ,
31- ( ) => Promise < ( projectInfo : ProjectInfo ) => string >
32- > = {
25+ const FORMERLY_USED_PROMPTS : Record < string , ( ) => Promise < ( projectInfo : ProjectInfo ) => string > > = {
3326 monorepo : async ( ) => ( await import ( './monorepo.ts' ) ) . instructions ,
3427 'optimized-tests' : async ( ) => ( await import ( './optimized-tests.ts' ) ) . instructions ,
3528 'relaxed-limits' : async ( ) => ( await import ( './relaxed-limits.ts' ) ) . instructions ,
@@ -43,8 +36,8 @@ export type PromptName = string;
4336
4437/** Names available to the eval harness — defaults plus experimental variants. */
4538export const PROMPT_NAMES : PromptName [ ] = [
46- ...Object . keys ( BUNDLED_PROMPTS ) ,
47- ...Object . keys ( DYNAMICALLY_IMPORTED_PROMPTS ) ,
39+ ...Object . keys ( CURRENTLY_USED_PROMPT ) ,
40+ ...Object . keys ( FORMERLY_USED_PROMPTS ) ,
4841] ;
4942
5043/**
@@ -55,36 +48,32 @@ export const PROMPT_NAMES: PromptName[] = [
5548 */
5649const EVAL_SETUP_PROMPT_ENV = 'EVAL_SETUP_PROMPT' ;
5750
58- function resolvePromptName ( extensive ?: boolean ) : PromptName {
51+ function resolvePromptName ( ) : PromptName {
5952 const requested = process . env [ EVAL_SETUP_PROMPT_ENV ] ?. trim ( ) ;
6053 if (
6154 requested &&
62- ( Object . hasOwn ( BUNDLED_PROMPTS , requested ) ||
63- Object . hasOwn ( DYNAMICALLY_IMPORTED_PROMPTS , requested ) )
55+ ( Object . hasOwn ( CURRENTLY_USED_PROMPT , requested ) ||
56+ Object . hasOwn ( FORMERLY_USED_PROMPTS , requested ) )
6457 ) {
6558 return requested ;
6659 }
67- return extensive ? EXTENSIVE_PROMPT_NAME : DEFAULT_PROMPT_NAME ;
60+ return DEFAULT_PROMPT_NAME ;
6861}
6962
7063export async function getAiSetupPrompt (
71- projectInfo : ProjectInfo ,
72- extensive ?: boolean
64+ projectInfo : ProjectInfo
7365) : Promise < { content : string ; name : PromptName } > {
74- const name = resolvePromptName ( extensive ) ;
75- const builder = BUNDLED_PROMPTS [ name ] ?? ( await DYNAMICALLY_IMPORTED_PROMPTS [ name ] ( ) ) ;
66+ const name = resolvePromptName ( ) ;
67+ const builder = CURRENTLY_USED_PROMPT [ name ] ?? ( await FORMERLY_USED_PROMPTS [ name ] ( ) ) ;
7668
7769 return { content : builder ( projectInfo ) , name } ;
7870}
7971
80- export async function getAiSetupMarkdownOutput (
81- projectInfo : ProjectInfo ,
82- extensive ?: boolean
83- ) : Promise < {
72+ export async function getAiSetupMarkdownOutput ( projectInfo : ProjectInfo ) : Promise < {
8473 markdown : string ;
8574 prompt : PromptName ;
8675} > {
87- const { content, name } = await getAiSetupPrompt ( projectInfo , extensive ) ;
76+ const { content, name } = await getAiSetupPrompt ( projectInfo ) ;
8877
8978 return {
9079 markdown : dedent `
0 commit comments