tweakcc 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +30 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ $ pnpm dlx tweakcc
|
|
|
58
58
|
2. **`$XDG_CONFIG_HOME/tweakcc`** - If `~/.tweakcc/` doesn't exist and `$XDG_CONFIG_HOME` is set
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
`tweakcc` is verified to work with Claude Code **2.0.
|
|
61
|
+
`tweakcc` is verified to work with Claude Code **2.0.31.**
|
|
62
62
|
|
|
63
63
|
## Running
|
|
64
64
|
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Box as u,Text as l,render as Bn,useInput as ge,useStdout as kn}from"ink";import{Command as Tn}from"commander";import X from"chalk";import Re,{Fragment as Se,createContext as On,useCallback as gn,useContext as pe,useEffect as ae,useState as T}from"react";import En from"ink-link";import{Fragment as ce,jsx as o,jsxs as g}from"react/jsx-runtime";import*as ie from"node:path";import Qe from"node:path";import*as xe from"node:os";import*as Me from"node:fs";import{globbySync as An}from"globby";import Dn from"node:process";import*as re from"node:fs/promises";import ue from"node:fs/promises";import*as ye from"node:child_process";import*as hn from"node:crypto";import He from"figlet";import ke from"gray-matter";function Ln({items:e,selectedIndex:t,onSelect:n,onSubmit:r}){return ge((i,s)=>{s.upArrow?n(t>0?t-1:e.length-1):s.downArrow?n(t<e.length-1?t+1:0):s.return&&r(e[t].name)}),o(u,{flexDirection:"column",children:e.map((i,s)=>o(u,{children:g(l,{children:[g(l,{bold:s===t,color:s===t?"cyan":void 0,...s===t?i.selectedStyles??{}:i.styles??{},children:[s===t?"❯ ":" ",i.name]}),i.desc&&s===t&&g(l,{dimColor:!0,bold:!1,children:[" \x1B[0;2m","- ",i.desc]})]})},s))})}let J=function(e){return e.APPLY_CHANGES="*Apply customizations to cli.js",e.THEMES="Themes",e.LAUNCH_TEXT="Launch text",e.THINKING_VERBS="Thinking verbs",e.THINKING_STYLE="Thinking style",e.USER_MESSAGE_DISPLAY="User message display",e.INPUT_BOX="Input box",e.VIEW_SYSTEM_PROMPTS="View system prompts",e.RESTORE_ORIGINAL="Restore original Claude Code (preserves tweakcc.json)",e.OPEN_CONFIG="Open tweakcc.json",e.OPEN_CLI="Open Claude Code's cli.js",e.EXIT="Exit",e}({});const q={themes:[{name:"Dark mode",id:"dark",colors:{autoAccept:"rgb(175,135,255)",bashBorder:"rgb(253,93,177)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(235,159,127)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(147,165,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(177,195,255)",permission:"rgb(177,185,249)",permissionShimmer:"rgb(207,215,255)",planMode:"rgb(72,150,140)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",subtle:"rgb(80,80,80)",suggestion:"rgb(177,185,249)",remember:"rgb(177,185,249)",background:"rgb(0,204,204)",success:"rgb(78,186,101)",error:"rgb(255,107,128)",warning:"rgb(255,193,7)",warningShimmer:"rgb(255,223,57)",diffAdded:"rgb(34,92,43)",diffRemoved:"rgb(122,41,54)",diffAddedDimmed:"rgb(71,88,74)",diffRemovedDimmed:"rgb(105,72,77)",diffAddedWord:"rgb(56,166,96)",diffRemovedWord:"rgb(179,89,107)",diffAddedWordDimmed:"rgb(46,107,58)",diffRemovedWordDimmed:"rgb(139,57,69)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(177,185,249)",rate_limit_empty:"rgb(80,83,112)"}},{name:"Light mode",id:"light",colors:{autoAccept:"rgb(135,0,255)",bashBorder:"rgb(255,0,135)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(245,149,117)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(87,105,247)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(117,135,255)",permission:"rgb(87,105,247)",permissionShimmer:"rgb(137,155,255)",planMode:"rgb(0,102,102)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",subtle:"rgb(175,175,175)",suggestion:"rgb(87,105,247)",remember:"rgb(0,0,255)",background:"rgb(0,153,153)",success:"rgb(44,122,57)",error:"rgb(171,43,63)",warning:"rgb(150,108,30)",warningShimmer:"rgb(200,158,80)",diffAdded:"rgb(105,219,124)",diffRemoved:"rgb(255,168,180)",diffAddedDimmed:"rgb(199,225,203)",diffRemovedDimmed:"rgb(253,210,216)",diffAddedWord:"rgb(47,157,68)",diffRemovedWord:"rgb(209,69,75)",diffAddedWordDimmed:"rgb(144,194,156)",diffRemovedWordDimmed:"rgb(232,165,173)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(240, 240, 240)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(87,105,247)",rate_limit_empty:"rgb(39,47,111)"}},{name:"Light mode (ANSI colors only)",id:"light-ansi",colors:{autoAccept:"ansi:magenta",bashBorder:"ansi:magenta",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blue",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blue",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyan",ide:"ansi:blueBright",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:black",inverseText:"ansi:white",inactive:"ansi:blackBright",subtle:"ansi:blackBright",suggestion:"ansi:blue",remember:"ansi:blue",background:"ansi:cyan",success:"ansi:green",error:"ansi:red",warning:"ansi:yellow",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",diffAddedWordDimmed:"ansi:green",diffRemovedWordDimmed:"ansi:red",red_FOR_SUBAGENTS_ONLY:"ansi:red",blue_FOR_SUBAGENTS_ONLY:"ansi:blue",green_FOR_SUBAGENTS_ONLY:"ansi:green",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellow",purple_FOR_SUBAGENTS_ONLY:"ansi:magenta",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyan",professionalBlue:"ansi:blueBright",rainbow_red:"ansi:red",rainbow_orange:"ansi:redBright",rainbow_yellow:"ansi:yellow",rainbow_green:"ansi:green",rainbow_blue:"ansi:cyan",rainbow_indigo:"ansi:blue",rainbow_violet:"ansi:magenta",rainbow_red_shimmer:"ansi:redBright",rainbow_orange_shimmer:"ansi:yellow",rainbow_yellow_shimmer:"ansi:yellowBright",rainbow_green_shimmer:"ansi:greenBright",rainbow_blue_shimmer:"ansi:cyanBright",rainbow_indigo_shimmer:"ansi:blueBright",rainbow_violet_shimmer:"ansi:magentaBright",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:white",bashMessageBackgroundColor:"ansi:whiteBright",memoryBackgroundColor:"ansi:white",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:black"}},{name:"Dark mode (ANSI colors only)",id:"dark-ansi",colors:{autoAccept:"ansi:magentaBright",bashBorder:"ansi:magentaBright",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blueBright",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blueBright",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyanBright",ide:"ansi:blue",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:whiteBright",inverseText:"ansi:black",inactive:"ansi:white",subtle:"ansi:white",suggestion:"ansi:blueBright",remember:"ansi:blueBright",background:"ansi:cyanBright",success:"ansi:greenBright",error:"ansi:redBright",warning:"ansi:yellowBright",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",diffAddedWordDimmed:"ansi:green",diffRemovedWordDimmed:"ansi:red",red_FOR_SUBAGENTS_ONLY:"ansi:redBright",blue_FOR_SUBAGENTS_ONLY:"ansi:blueBright",green_FOR_SUBAGENTS_ONLY:"ansi:greenBright",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellowBright",purple_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyanBright",professionalBlue:"rgb(106,155,204)",rainbow_red:"ansi:red",rainbow_orange:"ansi:redBright",rainbow_yellow:"ansi:yellow",rainbow_green:"ansi:green",rainbow_blue:"ansi:cyan",rainbow_indigo:"ansi:blue",rainbow_violet:"ansi:magenta",rainbow_red_shimmer:"ansi:redBright",rainbow_orange_shimmer:"ansi:yellow",rainbow_yellow_shimmer:"ansi:yellowBright",rainbow_green_shimmer:"ansi:greenBright",rainbow_blue_shimmer:"ansi:cyanBright",rainbow_indigo_shimmer:"ansi:blueBright",rainbow_violet_shimmer:"ansi:magentaBright",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:blackBright",bashMessageBackgroundColor:"ansi:black",memoryBackgroundColor:"ansi:blackBright",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:white"}},{name:"Light mode (colorblind-friendly)",id:"light-daltonized",colors:{autoAccept:"rgb(135,0,255)",bashBorder:"rgb(0,102,204)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(51,102,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(101,152,255)",permission:"rgb(51,102,255)",permissionShimmer:"rgb(101,152,255)",planMode:"rgb(51,102,102)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",subtle:"rgb(175,175,175)",suggestion:"rgb(51,102,255)",remember:"rgb(51,102,255)",background:"rgb(0,153,153)",success:"rgb(0,102,153)",error:"rgb(204,0,0)",warning:"rgb(255,153,0)",warningShimmer:"rgb(255,183,50)",diffAdded:"rgb(153,204,255)",diffRemoved:"rgb(255,204,204)",diffAddedDimmed:"rgb(209,231,253)",diffRemovedDimmed:"rgb(255,233,233)",diffAddedWord:"rgb(51,102,204)",diffRemovedWord:"rgb(153,51,51)",diffAddedWordDimmed:"rgb(102,153,204)",diffRemovedWordDimmed:"rgb(204,153,153)",red_FOR_SUBAGENTS_ONLY:"rgb(204,0,0)",blue_FOR_SUBAGENTS_ONLY:"rgb(0,102,204)",green_FOR_SUBAGENTS_ONLY:"rgb(0,204,0)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,204,0)",purple_FOR_SUBAGENTS_ONLY:"rgb(128,0,128)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,128,0)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,102,178)",cyan_FOR_SUBAGENTS_ONLY:"rgb(0,178,178)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(220, 220, 220)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(51,102,255)",rate_limit_empty:"rgb(23,46,114)"}},{name:"Dark mode (colorblind-friendly)",id:"dark-daltonized",colors:{autoAccept:"rgb(175,135,255)",bashBorder:"rgb(51,153,255)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(153,204,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(183,224,255)",permission:"rgb(153,204,255)",permissionShimmer:"rgb(183,224,255)",planMode:"rgb(102,153,153)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",subtle:"rgb(80,80,80)",suggestion:"rgb(153,204,255)",remember:"rgb(153,204,255)",background:"rgb(0,204,204)",success:"rgb(51,153,255)",error:"rgb(255,102,102)",warning:"rgb(255,204,0)",warningShimmer:"rgb(255,234,50)",diffAdded:"rgb(0,68,102)",diffRemoved:"rgb(102,0,0)",diffAddedDimmed:"rgb(62,81,91)",diffRemovedDimmed:"rgb(62,44,44)",diffAddedWord:"rgb(0,119,179)",diffRemovedWord:"rgb(179,0,0)",diffAddedWordDimmed:"rgb(26,99,128)",diffRemovedWordDimmed:"rgb(128,21,21)",red_FOR_SUBAGENTS_ONLY:"rgb(255,102,102)",blue_FOR_SUBAGENTS_ONLY:"rgb(102,178,255)",green_FOR_SUBAGENTS_ONLY:"rgb(102,255,102)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,255,102)",purple_FOR_SUBAGENTS_ONLY:"rgb(178,102,255)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,178,102)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,153,204)",cyan_FOR_SUBAGENTS_ONLY:"rgb(102,204,204)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(153,204,255)",rate_limit_empty:"rgb(69,92,115)"}}],launchText:{method:"figlet",figletText:"Claude Code",figletFont:"ANSI Shadow",customText:""},thinkingVerbs:{format:"{}… ",verbs:["Accomplishing","Actioning","Actualizing","Baking","Booping","Brewing","Calculating","Cerebrating","Channelling","Churning","Clauding","Coalescing","Cogitating","Combobulating","Computing","Concocting","Conjuring","Considering","Contemplating","Cooking","Crafting","Creating","Crunching","Deciphering","Deliberating","Determining","Discombobulating","Divining","Doing","Effecting","Elucidating","Enchanting","Envisioning","Finagling","Flibbertigibbeting","Forging","Forming","Frolicking","Generating","Germinating","Hatching","Herding","Honking","Ideating","Imagining","Incubating","Inferring","Manifesting","Marinating","Meandering","Moseying","Mulling","Musing","Mustering","Noodling","Percolating","Perusing","Philosophising","Pondering","Pontificating","Processing","Puttering","Puzzling","Reticulating","Ruminating","Scheming","Schlepping","Shimmying","Simmering","Smooshing","Spelunking","Spinning","Stewing","Sussing","Synthesizing","Thinking","Tinkering","Transmuting","Unfurling","Unravelling","Vibing","Wandering","Whirring","Wibbling","Wizarding","Working","Wrangling","Alchemizing","Animating","Architecting","Bamboozling","Beaming","Befuddling","Bewitching","Billowing","Bippity-bopping","Blanching","Boogieing","Boondoggling","Bootstrapping","Burrowing","Caching","Canoodling","Caramelizing","Cascading","Catapulting","Channeling","Choreographing","Compiling","Composing","Crystallizing","Cultivating","Deploying","Dilly-dallying","Discombobulating","Distilling","Doodling","Drizzling","Ebbing","Embellishing","Ensorcelling","Evaporating","Fermenting","Fiddle-faddling","Finagling","Flambéing","Flowing","Flummoxing","Fluttering","Frosting","Gallivanting","Galloping","Garnishing","Germinating","Gitifying","Grooving","Gusting","Harmonizing","Hashing","Hexing","Hibernating","Higgledy-piggleding","Hornswoggling","Hullaballooing","Hyperspacing","Illustrating","Improvising","Incanting","Indexing","Infusing","Ionizing","Jazzercising","Jiggery-pokerying","Jitterbugging","Julienning","Kerfuffling","Kneading","Leavening","Levitating","Linting","Lollygagging","Malarkeying","Metamorphosing","Migrating","Minifying","Misting","Moonwalking","Mystifying","Nebulizing","Nesting","Nucleating","Optimizing","Orbiting","Orchestrating","Osmosing","Parsing","Perambulating","Photosynthesizing","Pipelining","Poaching","Pollinating","Pouncing","Precipitating","Prestidigitating","Proofing","Propagating","Prowling","Quantumizing","Querying","Razzle-dazzling","Razzmatazzing","Recombobulating","Reducing","Refactoring","Rippling","Roosting","Sautéing","Scampering","Scurrying","Seasoning","Serializing","Shenaniganing","Skedaddling","Sketching","Skullduggering","Slithering","Sock-hopping","Spellbinding","Sprouting","Storyboarding","Sublimating","Swirling","Swooping","Symbioting","Syncopating","Teleporting","Tempering","Thaumaturging","Thundering","Tomfoolering","Topsy-turvying","Transfiguring","Transpiling","Twisting","Undulating","Validating","Vaporizing","Waddling","Warping","Whatchamacalliting","Whirlpooling","Whisking","Willy-nillying","Zesting","Zigzagging"]},thinkingStyle:{updateInterval:120,phases:process.env.TERM==="xterm-ghostty"?["·","✢","✳","✶","✻","*"]:process.platform==="darwin"?["·","✢","✳","✶","✻","✽"]:["·","✢","*","✶","✻","✽"],reverseMirror:!0},userMessageDisplay:{prefix:{format:">",styling:[],foreground_color:"rgb(0,0,0)",background_color:"rgb(0,0,0)"},message:{format:"{}",styling:[],foreground_color:"rgb(0,0,0)",background_color:"rgb(0,0,0)"}},inputBox:{removeBorder:!1}},Pn=()=>{const e=ie.join(xe.homedir(),".tweakcc"),t=process.env.XDG_CONFIG_HOME;try{if(Me.existsSync(e))return e}catch{}return t?ie.join(t,"tweakcc"):e},be=Pn(),de=ie.join(be,"config.json"),_e=ie.join(be,"cli.js.backup"),me=ie.join(be,"system-prompts"),en=ie.join(be,"prompt-data-cache"),Rn=()=>{const e=[],t=process.platform=="win32"?xe.homedir().replace(/\\/g,"/"):xe.homedir(),n="node_modules/@anthropic-ai/claude-code",r=(i,s=!1)=>{if(s){const a=An(i,{onlyFiles:!1});e.push({pattern:i,isGlob:!0,expandedPaths:a})}else e.push({pattern:i,isGlob:!1,expandedPaths:[i]})};return r(`${xe.homedir()}/.claude/local/${n}`),process.env.NPM_PREFIX&&r(`${process.env.NPM_PREFIX}/lib/${n}`),process.env.N_PREFIX&&r(`${process.env.N_PREFIX}/lib/${n}`),process.env.VOLTA_HOME&&r(`${process.env.VOLTA_HOME}/lib/${n}`),process.env.FNM_DIR&&r(`${process.env.FNM_DIR}/lib/${n}`),process.env.NVM_DIR&&r(`${process.env.NVM_DIR}/lib/${n}`),process.env.NODENV_ROOT&&r(`${process.env.NODENV_ROOT}/versions/*/lib/${n}`,!0),process.env.NVS_HOME&&r(`${process.env.NVS_HOME}/node/*/*/lib/${n}`,!0),process.env.ASDF_DATA_DIR&&r(`${process.env.ASDF_DATA_DIR}/installs/nodejs/*/lib/${n}`,!0),process.platform=="win32"?(r(`${t}/AppData/Local/Volta/tools/image/packages/@anthropic-ai/claude-code/${n}`),r(`${t}/AppData/Roaming/npm/${n}`),r(`${t}/AppData/Roaming/nvm/*/${n}`,!0),r(`${t}/AppData/Local/Yarn/config/global/${n}`),r(`${t}/AppData/Local/pnpm/global/*/${n}`,!0),r(`C:/nvm4w/nodejs/${n}`),r(`${t}/n/versions/node/*/lib/${n}`,!0),r(`${t}/AppData/Roaming/Yarn/config/global/${n}`),r(`${t}/AppData/Roaming/pnpm-global/${n}`),r(`${t}/AppData/Roaming/pnpm-global/*/${n}`,!0),r(`${t}/.bun/install/global/${n}`),r(`${t}/AppData/Local/fnm_multishells/*/node_modules/${n}`,!0)):(process.platform=="darwin"&&(r(`${t}/Library/${n}`),r(`/opt/local/lib/${n}`)),r(`${t}/.local/lib/${n}`),r(`${t}/.local/share/${n}`),r(`${t}/.npm-global/lib/${n}`),r(`${t}/.npm-packages/lib/${n}`),r(`${t}/.npm/lib/${n}`),r(`${t}/npm/lib/${n}`),r(`/etc/${n}`),r(`/lib/${n}`),r(`/opt/node/lib/${n}`),r(`/usr/lib/${n}`),r(`/usr/local/lib/${n}`),r(`/usr/share/${n}`),r(`/var/lib/${n}`),r(`/opt/homebrew/lib/${n}`),r(`${t}/.linuxbrew/lib/${n}`),r(`${t}/.config/yarn/global/${n}`),r(`${t}/.yarn/global/${n}`),r(`${t}/.bun/install/global/${n}`),r(`${t}/.pnpm-global/${n}`),r(`${t}/.pnpm-global/*/${n}`,!0),r(`${t}/pnpm-global/${n}`),r(`${t}/pnpm-global/*/${n}`,!0),r(`${t}/.local/share/pnpm/global/${n}`),r(`${t}/.local/share/pnpm/global/*/${n}`,!0),r(`${t}/.bun/install/global/${n}`),r(`/usr/local/n/versions/node/*/lib/${n}`,!0),r(`${t}/n/versions/node/*/lib/${n}`,!0),r(`${t}/n/lib/${n}`),r(`${t}/.volta/tools/image/node/*/lib/${n}`,!0),r(`${t}/.fnm/node-versions/*/installation/lib/${n}`,!0),r(`${t}/.local/state/fnm_multishells/*/lib/${n}`,!0),r(`/usr/local/nvm/versions/node/*/lib/${n}`,!0),r(`${t}/.nvm/versions/node/*/lib/${n}`,!0),r(`${t}/.nodenv/versions/*/lib/${n}`,!0),r(`${t}/.nvs/*/lib/${n}`,!0),r(`${t}/.asdf/installs/nodejs/*/lib/${n}`,!0)),process.platform=="win32"&&e.forEach(i=>{i.pattern=i.pattern.replace(/\//g,"\\"),i.expandedPaths=i.expandedPaths.map(s=>s.replace(/\//g,"\\"))}),e},Ge=Rn(),nn=Ge.flatMap(e=>e.expandedPaths),Fn=({children:e,...t})=>g(l,{bold:!0,backgroundColor:"#ffd500",color:"#000",...t,children:[" ",e," "]});var fe=Fn;const Vn=[{name:J.THEMES,desc:"Modify Claude Code's built-in themes or create your own"},{name:J.LAUNCH_TEXT,desc:`Change the "CLAUDE CODE" banner text that's shown when you sign in to Claude Code`},{name:J.THINKING_VERBS,desc:"Customize the list of verbs that Claude Code uses when it's working"},{name:J.THINKING_STYLE,desc:"Choose custom spinners"},{name:J.USER_MESSAGE_DISPLAY,desc:"Customize how user messages are displayed"},{name:J.INPUT_BOX,desc:"Customize the input box appearance (e.g., remove border)"},{name:J.VIEW_SYSTEM_PROMPTS,desc:"Opens the system prompts directory where you can customize Claude Code's system prompts"}],jn=[{name:J.RESTORE_ORIGINAL,desc:"Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)"},{name:J.OPEN_CONFIG,desc:`Opens your tweakcc config file (${de})`},{name:J.OPEN_CLI,desc:"Opens Claude Code's cli.js file"},{name:J.EXIT,desc:"Bye!"}];function Un({onSubmit:e,notification:t}){const n=[...pe(he).changesApplied?[]:[{name:J.APPLY_CHANGES,desc:"Required: Updates Claude Code's cli.js in-place with your changes",selectedStyles:{color:"green"}}],...Vn,...jn],[r,i]=T(0);return g(u,{flexDirection:"column",children:[o(u,{marginBottom:1,children:o(fe,{children:"Tweak Claude Code"})}),o(u,{marginBottom:1,children:g(l,{color:"gray",children:[o(l,{bold:!0,children:"Customize your Claude Code installation."})," ",o(l,{dimColor:!0,children:"Settings will be saved to a JSON file."})]})}),o(u,{marginBottom:1,children:g(l,{color:"yellow",children:["⭐ ",o(l,{bold:!0,children:"Star the repo at "}),o(En,{url:"https://github.com/Piebald-AI/tweakcc",fallback:!1,children:o(l,{bold:!0,color:"cyan",children:"https://github.com/Piebald-AI/tweakcc"})}),o(l,{bold:!0,children:" if you find this useful!"})," ⭐"]})}),t&&o(u,{marginBottom:1,borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderStyle:"bold",borderColor:t?.type==="success"?"green":t?.type==="error"?"red":t?.type==="info"?"blue":"yellow",paddingLeft:1,flexDirection:"column",children:o(l,{color:t?.type==="success"?"green":t?.type==="error"?"red":t?.type==="info"?"blue":"yellow",children:t?.message})}),o(Ln,{items:n,selectedIndex:r,onSelect:i,onSubmit:s=>e(s)})]})}async function ze(e){const t=ie.join(en,`prompts-${e}.json`);try{const r=await re.readFile(t,"utf-8");return JSON.parse(r)}catch{}const n=`https://raw.githubusercontent.com/Piebald-AI/tweakcc/refs/heads/main/data/prompts/prompts-${e}.json`;try{const r=await fetch(n);if(!r.ok){let s;throw r.status===429?s="Rate limit exceeded. GitHub has temporarily blocked requests. Please wait a few minutes and try again.":r.status===404?s=`Prompts file not found for Claude Code v${e}. This version was released within the past day or so and will be supported within a few hours.`:r.status>=500?s=`GitHub server error (${r.status}). Please try again later.`:s=`HTTP ${r.status}: ${r.statusText}`,new Error(s)}const i=await r.json();try{await re.mkdir(en,{recursive:!0}),await re.writeFile(t,JSON.stringify(i,null,2),"utf-8")}catch(s){console.warn(`Failed to write to cache to ${t}: ${s}`)}return i}catch(r){if(r instanceof Error){if(r.message.includes("Rate limit")||r.message.includes("not found")||r.message.includes("server error")||r.message.includes("HTTP"))throw r;const i=`Failed to download prompts for version ${e}: ${r.message}`;throw new Error(i)}throw r}}const Hn="modulepreload",Gn=function(e){return"/"+e},rn={},Yn=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let d=function(m){return Promise.all(m.map(f=>Promise.resolve(f).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");i=d(n.map(m=>{if(m=Gn(m,r),m in rn)return;rn[m]=!0;const f=m.endsWith(".css"),S=f?'[rel="stylesheet"]':"";if(!!r)for(let $=a.length-1;$>=0;$--){const M=a[$];if(M.href===m&&(!f||M.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${S}`))return;const C=document.createElement("link");if(C.rel=f?"stylesheet":Hn,f||(C.as="script"),C.crossOrigin="",C.href=m,h&&C.setAttribute("nonce",h),document.head.appendChild(C),f)return new Promise(($,M)=>{C.addEventListener("load",$),C.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})},un=ie.join(be,"systemPromptOriginalHashes.json"),mn=ie.join(be,"systemPromptAppliedHashes.json"),fn=(e,t)=>`${e}-${t}`,Ee=e=>hn.createHash("md5").update(e.trim(),"utf8").digest("hex"),pn=async()=>{try{const e=await re.readFile(un,"utf8");return JSON.parse(e)}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")return{};throw e}},Wn=async e=>{await re.mkdir(be,{recursive:!0});const t={},n=Object.keys(e).sort();for(const r of n)t[r]=e[r];await re.writeFile(un,JSON.stringify(t,null,2),"utf8")},zn=async e=>{const t=await pn();let n=0;for(const r of e.prompts){const i=fn(r.id,r.version);if(!t[i]){const s=Te(r.pieces,r.identifiers,r.identifierMap),a=Ee(s);t[i]=a,n++}}return await Wn(t),n},Jn=async(e,t)=>{const n=await pn(),r=fn(e,t);return n[r]},Je=async()=>{try{const e=await re.readFile(mn,"utf8");return JSON.parse(e)}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")return{};throw e}},bn=async e=>{await re.mkdir(be,{recursive:!0});const t={},n=Object.keys(e).sort();for(const r of n)t[r]=e[r];await re.writeFile(mn,JSON.stringify(t,null,2),"utf8")},Xn=async(e,t)=>{const n=await Je();n[e]=t,await bn(n)},Kn=async()=>{const e=await Je(),t={};for(const n of Object.keys(e))t[n]=null;await bn(t)},qn=async e=>{try{const t=await Je();if(Object.keys(t).length===0)return!1;const r=(await re.readdir(e)).filter(i=>i.endsWith(".md"));for(const i of r){const s=i.replace(".md",""),a=t[s];if(a===void 0||a===null)continue;const c=ie.join(e,i),h=await re.readFile(c,"utf8"),m=(await Yn(()=>import("gray-matter"),[])).default(h,{delimiters:["<!--","-->"]});if(Ee(m.content)!==a)return!0}return!1}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return!1;throw t}},wn=e=>{const t=ke(e,{delimiters:["<!--","-->"]}),{name:n,description:r,ccVersion:i,variables:s}=t.data;return{name:n||"",description:r||"",ccVersion:i||"",variables:s||[],content:t.content.trim()}},tn=(e,t)=>{const n=t||Te(e.pieces,e.identifiers,e.identifierMap),r=Object.keys(e.identifierMap).length>0?[...new Set(Object.values(e.identifierMap))]:void 0,i={name:e.name,description:e.description,ccVersion:e.version};return r&&r.length>0&&(i.variables=r),ke.stringify(n,i,{delimiters:["<!--","-->"]})},Te=(e,t,n)=>{let r="";for(let i=0;i<e.length;i++)if(r+=e[i],i<t.length){const s=t[i],a=n[String(s)]||`UNKNOWN_${s}`;r+=a}return r},Zn=(e,t)=>{const n=e.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<Math.max(n.length,r.length);i++){const s=n[i]||0,a=r[i]||0;if(s<a)return-1;if(s>a)return 1}return 0},Ne=e=>ie.join(me,`${e}.md`),Qn=async e=>{try{return await re.access(Ne(e)),!0}catch{return!1}},er=async e=>{const t=Ne(e),n=await re.readFile(t,"utf-8");return wn(n)},Ye=async(e,t)=>{const n=Ne(e);await re.writeFile(n,t,"utf-8")},nr=async(e,t)=>{const n=Ne(e),r=await re.readFile(n,"utf-8"),i=ke(r,{delimiters:["<!--","-->"]}),s=Object.keys(t).length>0?[...new Set(Object.values(t))]:void 0,a={name:i.data.name,description:i.data.description,ccVersion:i.data.ccVersion};s&&s.length>0&&(a.variables=s);const c=ke.stringify(i.content,a,{delimiters:["<!--","-->"]});await Ye(e,c)},rr=(e,t)=>{const n=$=>$.split(/(\s+)/),r=n(e),i=n(t),s=r.length,a=i.length,c=Array(s+1).fill(0).map(()=>Array(a+1).fill(0));for(let $=1;$<=s;$++)for(let M=1;M<=a;M++)r[$-1]===i[M-1]?c[$][M]=c[$-1][M-1]+1:c[$][M]=Math.max(c[$-1][M],c[$][M-1]);const h=Array(s).fill(!1),d=Array(a).fill(!1);let m=s,f=a;for(;m>0||f>0;)m>0&&f>0&&r[m-1]===i[f-1]?(m--,f--):f>0&&(m===0||c[m][f-1]>=c[m-1][f])?(d[f-1]=!0,f--):m>0&&(h[m-1]=!0,m--);const S=$=>$.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");let v="";for(let $=0;$<r.length;$++){const M=S(r[$]);v+=h[$]?`<mark>${M}</mark>`:M}let C="";for(let $=0;$<i.length;$++){const M=S(i[$]);C+=d[$]?`<mark>${M}</mark>`:M}return{oldHtml:v,newHtml:C}},on=(e,t)=>{const n=e.length,r=t.length,i=Array(n+1).fill(0).map(()=>Array(r+1).fill(0));for(let d=1;d<=n;d++)for(let m=1;m<=r;m++)e[d-1]===t[m-1]?i[d][m]=i[d-1][m-1]+1:i[d][m]=Math.max(i[d-1][m],i[d][m-1]);const s=[];let a=n,c=r;const h=[];for(;a>0||c>0;)a>0&&c>0&&e[a-1]===t[c-1]?(h.unshift({type:"unchanged",line:e[a-1],oldLineNo:a,newLineNo:c}),a--,c--):c>0&&(a===0||i[a][c-1]>=i[a-1][c])?(h.unshift({type:"added",line:t[c-1],newLineNo:c}),c--):a>0&&(h.unshift({type:"removed",line:e[a-1],oldLineNo:a}),a--);for(let d=0;d<h.length;d++){const m=h[d],f=h[d+1];if(m.type==="removed"&&f?.type==="added"){const S=rr(m.line,f.line);s.push({type:"modified",line:m.line,oldLineNo:m.oldLineNo,newLineNo:f.newLineNo,oldHtml:S.oldHtml,newHtml:S.newHtml}),d++}else s.push(m)}return s},tr=async(e,t,n,r,i,s,a,c)=>{const h=n.split(`
|
|
3
|
-
`),d=
|
|
2
|
+
import{Box as u,Text as l,render as Mr,useInput as ge,useStdout as Br}from"ink";import{Command as kr}from"commander";import X from"chalk";import Pe,{Fragment as _e,createContext as Or,useCallback as dr,useContext as be,useEffect as ae,useState as O}from"react";import Tr from"ink-link";import{Fragment as ce,jsx as o,jsxs as g}from"react/jsx-runtime";import*as ie from"node:path";import Qe from"node:path";import*as xe from"node:os";import*as Ne from"node:fs";import{globbySync as Er}from"globby";import Ar from"node:process";import*as ne from"node:fs/promises";import ue from"node:fs/promises";import*as Se from"node:child_process";import*as gr from"node:crypto";import Ge from"figlet";import ke from"gray-matter";function Dr({items:e,selectedIndex:t,onSelect:r,onSubmit:n}){return ge((i,s)=>{s.upArrow?r(t>0?t-1:e.length-1):s.downArrow?r(t<e.length-1?t+1:0):s.return&&n(e[t].name)}),o(u,{flexDirection:"column",children:e.map((i,s)=>o(u,{children:g(l,{children:[g(l,{bold:s===t,color:s===t?"cyan":void 0,...s===t?i.selectedStyles??{}:i.styles??{},children:[s===t?"❯ ":" ",i.name]}),i.desc&&s===t&&g(l,{dimColor:!0,bold:!1,children:[" \x1B[0;2m","- ",i.desc]})]})},s))})}let J=function(e){return e.APPLY_CHANGES="*Apply customizations to cli.js",e.THEMES="Themes",e.LAUNCH_TEXT="Launch text",e.THINKING_VERBS="Thinking verbs",e.THINKING_STYLE="Thinking style",e.USER_MESSAGE_DISPLAY="User message display",e.INPUT_BOX="Input box",e.VIEW_SYSTEM_PROMPTS="View system prompts",e.RESTORE_ORIGINAL="Restore original Claude Code (preserves tweakcc.json)",e.OPEN_CONFIG="Open tweakcc.json",e.OPEN_CLI="Open Claude Code's cli.js",e.EXIT="Exit",e}({});const q={themes:[{name:"Dark mode",id:"dark",colors:{autoAccept:"rgb(175,135,255)",bashBorder:"rgb(253,93,177)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(235,159,127)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(147,165,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(177,195,255)",permission:"rgb(177,185,249)",permissionShimmer:"rgb(207,215,255)",planMode:"rgb(72,150,140)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",subtle:"rgb(80,80,80)",suggestion:"rgb(177,185,249)",remember:"rgb(177,185,249)",background:"rgb(0,204,204)",success:"rgb(78,186,101)",error:"rgb(255,107,128)",warning:"rgb(255,193,7)",warningShimmer:"rgb(255,223,57)",diffAdded:"rgb(34,92,43)",diffRemoved:"rgb(122,41,54)",diffAddedDimmed:"rgb(71,88,74)",diffRemovedDimmed:"rgb(105,72,77)",diffAddedWord:"rgb(56,166,96)",diffRemovedWord:"rgb(179,89,107)",diffAddedWordDimmed:"rgb(46,107,58)",diffRemovedWordDimmed:"rgb(139,57,69)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(177,185,249)",rate_limit_empty:"rgb(80,83,112)"}},{name:"Light mode",id:"light",colors:{autoAccept:"rgb(135,0,255)",bashBorder:"rgb(255,0,135)",claude:"rgb(215,119,87)",claudeShimmer:"rgb(245,149,117)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(87,105,247)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(117,135,255)",permission:"rgb(87,105,247)",permissionShimmer:"rgb(137,155,255)",planMode:"rgb(0,102,102)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",subtle:"rgb(175,175,175)",suggestion:"rgb(87,105,247)",remember:"rgb(0,0,255)",background:"rgb(0,153,153)",success:"rgb(44,122,57)",error:"rgb(171,43,63)",warning:"rgb(150,108,30)",warningShimmer:"rgb(200,158,80)",diffAdded:"rgb(105,219,124)",diffRemoved:"rgb(255,168,180)",diffAddedDimmed:"rgb(199,225,203)",diffRemovedDimmed:"rgb(253,210,216)",diffAddedWord:"rgb(47,157,68)",diffRemovedWord:"rgb(209,69,75)",diffAddedWordDimmed:"rgb(144,194,156)",diffRemovedWordDimmed:"rgb(232,165,173)",red_FOR_SUBAGENTS_ONLY:"rgb(220,38,38)",blue_FOR_SUBAGENTS_ONLY:"rgb(37,99,235)",green_FOR_SUBAGENTS_ONLY:"rgb(22,163,74)",yellow_FOR_SUBAGENTS_ONLY:"rgb(202,138,4)",purple_FOR_SUBAGENTS_ONLY:"rgb(147,51,234)",orange_FOR_SUBAGENTS_ONLY:"rgb(234,88,12)",pink_FOR_SUBAGENTS_ONLY:"rgb(219,39,119)",cyan_FOR_SUBAGENTS_ONLY:"rgb(8,145,178)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(240, 240, 240)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(87,105,247)",rate_limit_empty:"rgb(39,47,111)"}},{name:"Light mode (ANSI colors only)",id:"light-ansi",colors:{autoAccept:"ansi:magenta",bashBorder:"ansi:magenta",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blue",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blue",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyan",ide:"ansi:blueBright",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:black",inverseText:"ansi:white",inactive:"ansi:blackBright",subtle:"ansi:blackBright",suggestion:"ansi:blue",remember:"ansi:blue",background:"ansi:cyan",success:"ansi:green",error:"ansi:red",warning:"ansi:yellow",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",diffAddedWordDimmed:"ansi:green",diffRemovedWordDimmed:"ansi:red",red_FOR_SUBAGENTS_ONLY:"ansi:red",blue_FOR_SUBAGENTS_ONLY:"ansi:blue",green_FOR_SUBAGENTS_ONLY:"ansi:green",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellow",purple_FOR_SUBAGENTS_ONLY:"ansi:magenta",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyan",professionalBlue:"ansi:blueBright",rainbow_red:"ansi:red",rainbow_orange:"ansi:redBright",rainbow_yellow:"ansi:yellow",rainbow_green:"ansi:green",rainbow_blue:"ansi:cyan",rainbow_indigo:"ansi:blue",rainbow_violet:"ansi:magenta",rainbow_red_shimmer:"ansi:redBright",rainbow_orange_shimmer:"ansi:yellow",rainbow_yellow_shimmer:"ansi:yellowBright",rainbow_green_shimmer:"ansi:greenBright",rainbow_blue_shimmer:"ansi:cyanBright",rainbow_indigo_shimmer:"ansi:blueBright",rainbow_violet_shimmer:"ansi:magentaBright",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:white",bashMessageBackgroundColor:"ansi:whiteBright",memoryBackgroundColor:"ansi:white",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:black"}},{name:"Dark mode (ANSI colors only)",id:"dark-ansi",colors:{autoAccept:"ansi:magentaBright",bashBorder:"ansi:magentaBright",claude:"ansi:redBright",claudeShimmer:"ansi:yellowBright",claudeBlue_FOR_SYSTEM_SPINNER:"ansi:blueBright",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"ansi:blueBright",permission:"ansi:blueBright",permissionShimmer:"ansi:blueBright",planMode:"ansi:cyanBright",ide:"ansi:blue",promptBorder:"ansi:white",promptBorderShimmer:"ansi:whiteBright",text:"ansi:whiteBright",inverseText:"ansi:black",inactive:"ansi:white",subtle:"ansi:white",suggestion:"ansi:blueBright",remember:"ansi:blueBright",background:"ansi:cyanBright",success:"ansi:greenBright",error:"ansi:redBright",warning:"ansi:yellowBright",warningShimmer:"ansi:yellowBright",diffAdded:"ansi:green",diffRemoved:"ansi:red",diffAddedDimmed:"ansi:green",diffRemovedDimmed:"ansi:red",diffAddedWord:"ansi:greenBright",diffRemovedWord:"ansi:redBright",diffAddedWordDimmed:"ansi:green",diffRemovedWordDimmed:"ansi:red",red_FOR_SUBAGENTS_ONLY:"ansi:redBright",blue_FOR_SUBAGENTS_ONLY:"ansi:blueBright",green_FOR_SUBAGENTS_ONLY:"ansi:greenBright",yellow_FOR_SUBAGENTS_ONLY:"ansi:yellowBright",purple_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",orange_FOR_SUBAGENTS_ONLY:"ansi:redBright",pink_FOR_SUBAGENTS_ONLY:"ansi:magentaBright",cyan_FOR_SUBAGENTS_ONLY:"ansi:cyanBright",professionalBlue:"rgb(106,155,204)",rainbow_red:"ansi:red",rainbow_orange:"ansi:redBright",rainbow_yellow:"ansi:yellow",rainbow_green:"ansi:green",rainbow_blue:"ansi:cyan",rainbow_indigo:"ansi:blue",rainbow_violet:"ansi:magenta",rainbow_red_shimmer:"ansi:redBright",rainbow_orange_shimmer:"ansi:yellow",rainbow_yellow_shimmer:"ansi:yellowBright",rainbow_green_shimmer:"ansi:greenBright",rainbow_blue_shimmer:"ansi:cyanBright",rainbow_indigo_shimmer:"ansi:blueBright",rainbow_violet_shimmer:"ansi:magentaBright",clawd_body:"ansi:redBright",clawd_background:"ansi:black",userMessageBackground:"ansi:blackBright",bashMessageBackgroundColor:"ansi:black",memoryBackgroundColor:"ansi:blackBright",rate_limit_fill:"ansi:yellow",rate_limit_empty:"ansi:white"}},{name:"Light mode (colorblind-friendly)",id:"light-daltonized",colors:{autoAccept:"rgb(135,0,255)",bashBorder:"rgb(0,102,204)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(51,102,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(101,152,255)",permission:"rgb(51,102,255)",permissionShimmer:"rgb(101,152,255)",planMode:"rgb(51,102,102)",ide:"rgb(71,130,200)",promptBorder:"rgb(153,153,153)",promptBorderShimmer:"rgb(183,183,183)",text:"rgb(0,0,0)",inverseText:"rgb(255,255,255)",inactive:"rgb(102,102,102)",subtle:"rgb(175,175,175)",suggestion:"rgb(51,102,255)",remember:"rgb(51,102,255)",background:"rgb(0,153,153)",success:"rgb(0,102,153)",error:"rgb(204,0,0)",warning:"rgb(255,153,0)",warningShimmer:"rgb(255,183,50)",diffAdded:"rgb(153,204,255)",diffRemoved:"rgb(255,204,204)",diffAddedDimmed:"rgb(209,231,253)",diffRemovedDimmed:"rgb(255,233,233)",diffAddedWord:"rgb(51,102,204)",diffRemovedWord:"rgb(153,51,51)",diffAddedWordDimmed:"rgb(102,153,204)",diffRemovedWordDimmed:"rgb(204,153,153)",red_FOR_SUBAGENTS_ONLY:"rgb(204,0,0)",blue_FOR_SUBAGENTS_ONLY:"rgb(0,102,204)",green_FOR_SUBAGENTS_ONLY:"rgb(0,204,0)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,204,0)",purple_FOR_SUBAGENTS_ONLY:"rgb(128,0,128)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,128,0)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,102,178)",cyan_FOR_SUBAGENTS_ONLY:"rgb(0,178,178)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(220, 220, 220)",bashMessageBackgroundColor:"rgb(250, 245, 250)",memoryBackgroundColor:"rgb(230, 245, 250)",rate_limit_fill:"rgb(51,102,255)",rate_limit_empty:"rgb(23,46,114)"}},{name:"Dark mode (colorblind-friendly)",id:"dark-daltonized",colors:{autoAccept:"rgb(175,135,255)",bashBorder:"rgb(51,153,255)",claude:"rgb(255,153,51)",claudeShimmer:"rgb(255,183,101)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(153,204,255)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(183,224,255)",permission:"rgb(153,204,255)",permissionShimmer:"rgb(183,224,255)",planMode:"rgb(102,153,153)",ide:"rgb(71,130,200)",promptBorder:"rgb(136,136,136)",promptBorderShimmer:"rgb(166,166,166)",text:"rgb(255,255,255)",inverseText:"rgb(0,0,0)",inactive:"rgb(153,153,153)",subtle:"rgb(80,80,80)",suggestion:"rgb(153,204,255)",remember:"rgb(153,204,255)",background:"rgb(0,204,204)",success:"rgb(51,153,255)",error:"rgb(255,102,102)",warning:"rgb(255,204,0)",warningShimmer:"rgb(255,234,50)",diffAdded:"rgb(0,68,102)",diffRemoved:"rgb(102,0,0)",diffAddedDimmed:"rgb(62,81,91)",diffRemovedDimmed:"rgb(62,44,44)",diffAddedWord:"rgb(0,119,179)",diffRemovedWord:"rgb(179,0,0)",diffAddedWordDimmed:"rgb(26,99,128)",diffRemovedWordDimmed:"rgb(128,21,21)",red_FOR_SUBAGENTS_ONLY:"rgb(255,102,102)",blue_FOR_SUBAGENTS_ONLY:"rgb(102,178,255)",green_FOR_SUBAGENTS_ONLY:"rgb(102,255,102)",yellow_FOR_SUBAGENTS_ONLY:"rgb(255,255,102)",purple_FOR_SUBAGENTS_ONLY:"rgb(178,102,255)",orange_FOR_SUBAGENTS_ONLY:"rgb(255,178,102)",pink_FOR_SUBAGENTS_ONLY:"rgb(255,153,204)",cyan_FOR_SUBAGENTS_ONLY:"rgb(102,204,204)",professionalBlue:"rgb(106,155,204)",rainbow_red:"rgb(235,95,87)",rainbow_orange:"rgb(245,139,87)",rainbow_yellow:"rgb(250,195,95)",rainbow_green:"rgb(145,200,130)",rainbow_blue:"rgb(130,170,220)",rainbow_indigo:"rgb(155,130,200)",rainbow_violet:"rgb(200,130,180)",rainbow_red_shimmer:"rgb(250,155,147)",rainbow_orange_shimmer:"rgb(255,185,137)",rainbow_yellow_shimmer:"rgb(255,225,155)",rainbow_green_shimmer:"rgb(185,230,180)",rainbow_blue_shimmer:"rgb(180,205,240)",rainbow_indigo_shimmer:"rgb(195,180,230)",rainbow_violet_shimmer:"rgb(230,180,210)",clawd_body:"rgb(215,119,87)",clawd_background:"rgb(0,0,0)",userMessageBackground:"rgb(55, 55, 55)",bashMessageBackgroundColor:"rgb(65, 60, 65)",memoryBackgroundColor:"rgb(55, 65, 70)",rate_limit_fill:"rgb(153,204,255)",rate_limit_empty:"rgb(69,92,115)"}},{name:"Monochrome",id:"monochrome",colors:{autoAccept:"rgb(200,200,200)",bashBorder:"rgb(180,180,180)",claude:"rgb(255,255,255)",claudeShimmer:"rgb(230,230,230)",claudeBlue_FOR_SYSTEM_SPINNER:"rgb(200,200,200)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"rgb(220,220,220)",permission:"rgb(200,200,200)",permissionShimmer:"rgb(220,220,220)",planMode:"rgb(180,180,180)",ide:"rgb(190,190,190)",promptBorder:"rgb(160,160,160)",promptBorderShimmer:"rgb(180,180,180)",text:"rgb(255,255,255)",inverseText:"rgb(40,40,40)",inactive:"rgb(120,120,120)",subtle:"rgb(100,100,100)",suggestion:"rgb(200,200,200)",remember:"rgb(200,200,200)",background:"rgb(180,180,180)",success:"rgb(220,220,220)",error:"rgb(180,180,180)",warning:"rgb(200,200,200)",warningShimmer:"rgb(220,220,220)",diffAdded:"rgb(90,90,90)",diffRemoved:"rgb(60,60,60)",diffAddedDimmed:"rgb(110,110,110)",diffRemovedDimmed:"rgb(80,80,80)",diffAddedWord:"rgb(200,200,200)",diffRemovedWord:"rgb(80,80,80)",diffAddedWordDimmed:"rgb(160,160,160)",diffRemovedWordDimmed:"rgb(70,70,70)",red_FOR_SUBAGENTS_ONLY:"rgb(200,200,200)",blue_FOR_SUBAGENTS_ONLY:"rgb(180,180,180)",green_FOR_SUBAGENTS_ONLY:"rgb(210,210,210)",yellow_FOR_SUBAGENTS_ONLY:"rgb(190,190,190)",purple_FOR_SUBAGENTS_ONLY:"rgb(170,170,170)",orange_FOR_SUBAGENTS_ONLY:"rgb(195,195,195)",pink_FOR_SUBAGENTS_ONLY:"rgb(205,205,205)",cyan_FOR_SUBAGENTS_ONLY:"rgb(185,185,185)",professionalBlue:"rgb(190,190,190)",rainbow_red:"rgb(240,240,240)",rainbow_orange:"rgb(230,230,230)",rainbow_yellow:"rgb(220,220,220)",rainbow_green:"rgb(210,210,210)",rainbow_blue:"rgb(200,200,200)",rainbow_indigo:"rgb(190,190,190)",rainbow_violet:"rgb(180,180,180)",rainbow_red_shimmer:"rgb(255,255,255)",rainbow_orange_shimmer:"rgb(245,245,245)",rainbow_yellow_shimmer:"rgb(235,235,235)",rainbow_green_shimmer:"rgb(225,225,225)",rainbow_blue_shimmer:"rgb(215,215,215)",rainbow_indigo_shimmer:"rgb(205,205,205)",rainbow_violet_shimmer:"rgb(195,195,195)",clawd_body:"rgb(255,255,255)",clawd_background:"rgb(40,40,40)",userMessageBackground:"rgb(70,70,70)",bashMessageBackgroundColor:"rgb(65,65,65)",memoryBackgroundColor:"rgb(75,75,75)",rate_limit_fill:"rgb(200,200,200)",rate_limit_empty:"rgb(90,90,90)"}}],launchText:{method:"figlet",figletText:"Claude Code",figletFont:"ANSI Shadow",customText:""},thinkingVerbs:{format:"{}… ",verbs:["Accomplishing","Actioning","Actualizing","Baking","Booping","Brewing","Calculating","Cerebrating","Channelling","Churning","Clauding","Coalescing","Cogitating","Combobulating","Computing","Concocting","Conjuring","Considering","Contemplating","Cooking","Crafting","Creating","Crunching","Deciphering","Deliberating","Determining","Discombobulating","Divining","Doing","Effecting","Elucidating","Enchanting","Envisioning","Finagling","Flibbertigibbeting","Forging","Forming","Frolicking","Generating","Germinating","Hatching","Herding","Honking","Ideating","Imagining","Incubating","Inferring","Manifesting","Marinating","Meandering","Moseying","Mulling","Musing","Mustering","Noodling","Percolating","Perusing","Philosophising","Pondering","Pontificating","Processing","Puttering","Puzzling","Reticulating","Ruminating","Scheming","Schlepping","Shimmying","Simmering","Smooshing","Spelunking","Spinning","Stewing","Sussing","Synthesizing","Thinking","Tinkering","Transmuting","Unfurling","Unravelling","Vibing","Wandering","Whirring","Wibbling","Wizarding","Working","Wrangling","Alchemizing","Animating","Architecting","Bamboozling","Beaming","Befuddling","Bewitching","Billowing","Bippity-bopping","Blanching","Boogieing","Boondoggling","Bootstrapping","Burrowing","Caching","Canoodling","Caramelizing","Cascading","Catapulting","Channeling","Choreographing","Compiling","Composing","Crystallizing","Cultivating","Deploying","Dilly-dallying","Discombobulating","Distilling","Doodling","Drizzling","Ebbing","Embellishing","Ensorcelling","Evaporating","Fermenting","Fiddle-faddling","Finagling","Flambéing","Flowing","Flummoxing","Fluttering","Frosting","Gallivanting","Galloping","Garnishing","Germinating","Gitifying","Grooving","Gusting","Harmonizing","Hashing","Hexing","Hibernating","Higgledy-piggleding","Hornswoggling","Hullaballooing","Hyperspacing","Illustrating","Improvising","Incanting","Indexing","Infusing","Ionizing","Jazzercising","Jiggery-pokerying","Jitterbugging","Julienning","Kerfuffling","Kneading","Leavening","Levitating","Linting","Lollygagging","Malarkeying","Metamorphosing","Migrating","Minifying","Misting","Moonwalking","Mystifying","Nebulizing","Nesting","Nucleating","Optimizing","Orbiting","Orchestrating","Osmosing","Parsing","Perambulating","Photosynthesizing","Pipelining","Poaching","Pollinating","Pouncing","Precipitating","Prestidigitating","Proofing","Propagating","Prowling","Quantumizing","Querying","Razzle-dazzling","Razzmatazzing","Recombobulating","Reducing","Refactoring","Rippling","Roosting","Sautéing","Scampering","Scurrying","Seasoning","Serializing","Shenaniganing","Skedaddling","Sketching","Skullduggering","Slithering","Sock-hopping","Spellbinding","Sprouting","Storyboarding","Sublimating","Swirling","Swooping","Symbioting","Syncopating","Teleporting","Tempering","Thaumaturging","Thundering","Tomfoolering","Topsy-turvying","Transfiguring","Transpiling","Twisting","Undulating","Validating","Vaporizing","Waddling","Warping","Whatchamacalliting","Whirlpooling","Whisking","Willy-nillying","Zesting","Zigzagging"]},thinkingStyle:{updateInterval:120,phases:process.env.TERM==="xterm-ghostty"?["·","✢","✳","✶","✻","*"]:process.platform==="darwin"?["·","✢","✳","✶","✻","✽"]:["·","✢","*","✶","✻","✽"],reverseMirror:!0},userMessageDisplay:{prefix:{format:">",styling:[],foreground_color:"rgb(0,0,0)",background_color:"rgb(0,0,0)"},message:{format:"{}",styling:[],foreground_color:"rgb(0,0,0)",background_color:"rgb(0,0,0)"}},inputBox:{removeBorder:!1}},Lr=()=>{const e=ie.join(xe.homedir(),".tweakcc"),t=process.env.XDG_CONFIG_HOME;try{if(Ne.existsSync(e))return e}catch{}return t?ie.join(t,"tweakcc"):e},pe=Lr(),de=ie.join(pe,"config.json"),ye=ie.join(pe,"cli.js.backup"),me=ie.join(pe,"system-prompts"),er=ie.join(pe,"prompt-data-cache"),Rr=()=>{const e=[],t=process.platform=="win32"?xe.homedir().replace(/\\/g,"/"):xe.homedir(),r="node_modules/@anthropic-ai/claude-code",n=(i,s=!1)=>{if(s){const a=Er(i,{onlyFiles:!1});e.push({pattern:i,isGlob:!0,expandedPaths:a})}else e.push({pattern:i,isGlob:!1,expandedPaths:[i]})};return n(`${xe.homedir()}/.claude/local/${r}`),process.env.NPM_PREFIX&&n(`${process.env.NPM_PREFIX}/lib/${r}`),process.env.N_PREFIX&&n(`${process.env.N_PREFIX}/lib/${r}`),process.env.VOLTA_HOME&&n(`${process.env.VOLTA_HOME}/lib/${r}`),process.env.FNM_DIR&&n(`${process.env.FNM_DIR}/lib/${r}`),process.env.NVM_DIR&&n(`${process.env.NVM_DIR}/lib/${r}`),process.env.NODENV_ROOT&&n(`${process.env.NODENV_ROOT}/versions/*/lib/${r}`,!0),process.env.NVS_HOME&&n(`${process.env.NVS_HOME}/node/*/*/lib/${r}`,!0),process.env.ASDF_DATA_DIR&&n(`${process.env.ASDF_DATA_DIR}/installs/nodejs/*/lib/${r}`,!0),process.platform=="win32"?(n(`${t}/AppData/Local/Volta/tools/image/packages/@anthropic-ai/claude-code/${r}`),n(`${t}/AppData/Roaming/npm/${r}`),n(`${t}/AppData/Roaming/nvm/*/${r}`,!0),n(`${t}/AppData/Local/Yarn/config/global/${r}`),n(`${t}/AppData/Local/pnpm/global/*/${r}`,!0),n(`C:/nvm4w/nodejs/${r}`),n(`${t}/n/versions/node/*/lib/${r}`,!0),n(`${t}/AppData/Roaming/Yarn/config/global/${r}`),n(`${t}/AppData/Roaming/pnpm-global/${r}`),n(`${t}/AppData/Roaming/pnpm-global/*/${r}`,!0),n(`${t}/.bun/install/global/${r}`),n(`${t}/AppData/Local/fnm_multishells/*/node_modules/${r}`,!0)):(process.platform=="darwin"&&(n(`${t}/Library/${r}`),n(`/opt/local/lib/${r}`)),n(`${t}/.local/lib/${r}`),n(`${t}/.local/share/${r}`),n(`${t}/.npm-global/lib/${r}`),n(`${t}/.npm-packages/lib/${r}`),n(`${t}/.npm/lib/${r}`),n(`${t}/npm/lib/${r}`),n(`/etc/${r}`),n(`/lib/${r}`),n(`/opt/node/lib/${r}`),n(`/usr/lib/${r}`),n(`/usr/local/lib/${r}`),n(`/usr/share/${r}`),n(`/var/lib/${r}`),n(`/opt/homebrew/lib/${r}`),n(`${t}/.linuxbrew/lib/${r}`),n(`${t}/.config/yarn/global/${r}`),n(`${t}/.yarn/global/${r}`),n(`${t}/.bun/install/global/${r}`),n(`${t}/.pnpm-global/${r}`),n(`${t}/.pnpm-global/*/${r}`,!0),n(`${t}/pnpm-global/${r}`),n(`${t}/pnpm-global/*/${r}`,!0),n(`${t}/.local/share/pnpm/global/${r}`),n(`${t}/.local/share/pnpm/global/*/${r}`,!0),n(`${t}/.bun/install/global/${r}`),n(`/usr/local/n/versions/node/*/lib/${r}`,!0),n(`${t}/n/versions/node/*/lib/${r}`,!0),n(`${t}/n/lib/${r}`),n(`${t}/.volta/tools/image/node/*/lib/${r}`,!0),n(`${t}/.fnm/node-versions/*/installation/lib/${r}`,!0),n(`${t}/.local/state/fnm_multishells/*/lib/${r}`,!0),n(`/usr/local/nvm/versions/node/*/lib/${r}`,!0),n(`${t}/.nvm/versions/node/*/lib/${r}`,!0),n(`${t}/.nodenv/versions/*/lib/${r}`,!0),n(`${t}/.nvs/*/lib/${r}`,!0),n(`${t}/.asdf/installs/nodejs/*/lib/${r}`,!0)),process.platform=="win32"&&e.forEach(i=>{i.pattern=i.pattern.replace(/\//g,"\\"),i.expandedPaths=i.expandedPaths.map(s=>s.replace(/\//g,"\\"))}),e},He=Rr(),rr=He.flatMap(e=>e.expandedPaths),Pr=({children:e,...t})=>g(l,{bold:!0,backgroundColor:"#ffd500",color:"#000",...t,children:[" ",e," "]});var fe=Pr;const Fr=[{name:J.THEMES,desc:"Modify Claude Code's built-in themes or create your own"},{name:J.LAUNCH_TEXT,desc:`Change the "CLAUDE CODE" banner text that's shown when you sign in to Claude Code`},{name:J.THINKING_VERBS,desc:"Customize the list of verbs that Claude Code uses when it's working"},{name:J.THINKING_STYLE,desc:"Choose custom spinners"},{name:J.USER_MESSAGE_DISPLAY,desc:"Customize how user messages are displayed"},{name:J.INPUT_BOX,desc:"Customize the input box appearance (e.g., remove border)"},{name:J.VIEW_SYSTEM_PROMPTS,desc:"Opens the system prompts directory where you can customize Claude Code's system prompts"}],Vr=[{name:J.RESTORE_ORIGINAL,desc:"Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)"},{name:J.OPEN_CONFIG,desc:`Opens your tweakcc config file (${de})`},{name:J.OPEN_CLI,desc:"Opens Claude Code's cli.js file"},{name:J.EXIT,desc:"Bye!"}];function Ur({onSubmit:e,notification:t}){const r=[...be(he).changesApplied?[]:[{name:J.APPLY_CHANGES,desc:"Required: Updates Claude Code's cli.js in-place with your changes",selectedStyles:{color:"green"}}],...Fr,...Vr],[n,i]=O(0);return g(u,{flexDirection:"column",children:[o(u,{marginBottom:1,children:o(fe,{children:"Tweak Claude Code"})}),o(u,{marginBottom:1,children:g(l,{color:"gray",children:[o(l,{bold:!0,children:"Customize your Claude Code installation."})," ",o(l,{dimColor:!0,children:"Settings will be saved to a JSON file."})]})}),o(u,{marginBottom:1,children:g(l,{color:"yellow",children:["⭐ ",o(l,{bold:!0,children:"Star the repo at "}),o(Tr,{url:"https://github.com/Piebald-AI/tweakcc",fallback:!1,children:o(l,{bold:!0,color:"cyan",children:"https://github.com/Piebald-AI/tweakcc"})}),o(l,{bold:!0,children:" if you find this useful!"})," ⭐"]})}),t&&o(u,{marginBottom:1,borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderStyle:"bold",borderColor:t?.type==="success"?"green":t?.type==="error"?"red":t?.type==="info"?"blue":"yellow",paddingLeft:1,flexDirection:"column",children:o(l,{color:t?.type==="success"?"green":t?.type==="error"?"red":t?.type==="info"?"blue":"yellow",children:t?.message})}),o(Dr,{items:r,selectedIndex:n,onSelect:i,onSubmit:s=>e(s)})]})}async function ze(e){const t=ie.join(er,`prompts-${e}.json`);try{const n=await ne.readFile(t,"utf-8");return JSON.parse(n)}catch{}const r=`https://raw.githubusercontent.com/Piebald-AI/tweakcc/refs/heads/main/data/prompts/prompts-${e}.json`;try{const n=await fetch(r);if(!n.ok){let s;throw n.status===429?s="Rate limit exceeded. GitHub has temporarily blocked requests. Please wait a few minutes and try again.":n.status===404?s=`Prompts file not found for Claude Code v${e}. This version was released within the past day or so and will be supported within a few hours.`:n.status>=500?s=`GitHub server error (${n.status}). Please try again later.`:s=`HTTP ${n.status}: ${n.statusText}`,new Error(s)}const i=await n.json();try{await ne.mkdir(er,{recursive:!0}),await ne.writeFile(t,JSON.stringify(i,null,2),"utf-8")}catch(s){console.warn(`Failed to write to cache to ${t}: ${s}`)}return i}catch(n){if(n instanceof Error){if(n.message.includes("Rate limit")||n.message.includes("not found")||n.message.includes("server error")||n.message.includes("HTTP"))throw n;const i=`Failed to download prompts for version ${e}: ${n.message}`;throw new Error(i)}throw n}}const jr="modulepreload",Gr=function(e){return"/"+e},nr={},Hr=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(f=>Promise.resolve(f).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),h=c?.nonce||c?.getAttribute("nonce");i=d(r.map(m=>{if(m=Gr(m,n),m in nr)return;nr[m]=!0;const f=m.endsWith(".css"),_=f?'[rel="stylesheet"]':"";if(!!n)for(let $=a.length-1;$>=0;$--){const N=a[$];if(N.href===m&&(!f||N.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${_}`))return;const C=document.createElement("link");if(C.rel=f?"stylesheet":jr,f||(C.as="script"),C.crossOrigin="",C.href=m,h&&C.setAttribute("nonce",h),document.head.appendChild(C),f)return new Promise(($,N)=>{C.addEventListener("load",$),C.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${m}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})},hr=ie.join(pe,"systemPromptOriginalHashes.json"),ur=ie.join(pe,"systemPromptAppliedHashes.json"),mr=(e,t)=>`${e}-${t}`,Ee=e=>gr.createHash("md5").update(e.trim(),"utf8").digest("hex"),fr=async()=>{try{const e=await ne.readFile(hr,"utf8");return JSON.parse(e)}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")return{};throw e}},Yr=async e=>{await ne.mkdir(pe,{recursive:!0});const t={},r=Object.keys(e).sort();for(const n of r)t[n]=e[n];await ne.writeFile(hr,JSON.stringify(t,null,2),"utf8")},Wr=async e=>{const t=await fr();let r=0;for(const n of e.prompts){const i=mr(n.id,n.version);if(!t[i]){const s=Oe(n.pieces,n.identifiers,n.identifierMap),a=Ee(s);t[i]=a,r++}}return await Yr(t),r},zr=async(e,t)=>{const r=await fr(),n=mr(e,t);return r[n]},Je=async()=>{try{const e=await ne.readFile(ur,"utf8");return JSON.parse(e)}catch(e){if(e instanceof Error&&"code"in e&&e.code==="ENOENT")return{};throw e}},br=async e=>{await ne.mkdir(pe,{recursive:!0});const t={},r=Object.keys(e).sort();for(const n of r)t[n]=e[n];await ne.writeFile(ur,JSON.stringify(t,null,2),"utf8")},Jr=async(e,t)=>{const r=await Je();r[e]=t,await br(r)},Xr=async()=>{const e=await Je(),t={};for(const r of Object.keys(e))t[r]=null;await br(t)},Kr=async e=>{try{const t=await Je();if(Object.keys(t).length===0)return!1;const n=(await ne.readdir(e)).filter(i=>i.endsWith(".md"));for(const i of n){const s=i.replace(".md",""),a=t[s];if(a===void 0||a===null)continue;const c=ie.join(e,i),h=await ne.readFile(c,"utf8"),m=(await Hr(()=>import("gray-matter"),[])).default(h,{delimiters:["<!--","-->"]});if(Ee(m.content)!==a)return!0}return!1}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return!1;throw t}},pr=e=>{const t=ke(e,{delimiters:["<!--","-->"]}),{name:r,description:n,ccVersion:i,variables:s}=t.data;return{name:r||"",description:n||"",ccVersion:i||"",variables:s||[],content:t.content.trim()}},tr=(e,t)=>{const r=t||Oe(e.pieces,e.identifiers,e.identifierMap),n=Object.keys(e.identifierMap).length>0?[...new Set(Object.values(e.identifierMap))]:void 0,i={name:e.name,description:e.description,ccVersion:e.version};return n&&n.length>0&&(i.variables=n),ke.stringify(r,i,{delimiters:["<!--","-->"]})},Oe=(e,t,r)=>{let n="";for(let i=0;i<e.length;i++)if(n+=e[i],i<t.length){const s=t[i],a=r[String(s)]||`UNKNOWN_${s}`;n+=a}return n},qr=(e,t)=>{const r=e.split(".").map(Number),n=t.split(".").map(Number);for(let i=0;i<Math.max(r.length,n.length);i++){const s=r[i]||0,a=n[i]||0;if(s<a)return-1;if(s>a)return 1}return 0},Me=e=>ie.join(me,`${e}.md`),Zr=async e=>{try{return await ne.access(Me(e)),!0}catch{return!1}},Qr=async e=>{const t=Me(e),r=await ne.readFile(t,"utf-8");return pr(r)},Ye=async(e,t)=>{const r=Me(e);await ne.writeFile(r,t,"utf-8")},en=async(e,t)=>{const r=Me(e),n=await ne.readFile(r,"utf-8"),i=ke(n,{delimiters:["<!--","-->"]}),s=Object.keys(t).length>0?[...new Set(Object.values(t))]:void 0,a={name:i.data.name,description:i.data.description,ccVersion:i.data.ccVersion};s&&s.length>0&&(a.variables=s);const c=ke.stringify(i.content,a,{delimiters:["<!--","-->"]});await Ye(e,c)},rn=(e,t)=>{const r=$=>$.split(/(\s+)/),n=r(e),i=r(t),s=n.length,a=i.length,c=Array(s+1).fill(0).map(()=>Array(a+1).fill(0));for(let $=1;$<=s;$++)for(let N=1;N<=a;N++)n[$-1]===i[N-1]?c[$][N]=c[$-1][N-1]+1:c[$][N]=Math.max(c[$-1][N],c[$][N-1]);const h=Array(s).fill(!1),d=Array(a).fill(!1);let m=s,f=a;for(;m>0||f>0;)m>0&&f>0&&n[m-1]===i[f-1]?(m--,f--):f>0&&(m===0||c[m][f-1]>=c[m-1][f])?(d[f-1]=!0,f--):m>0&&(h[m-1]=!0,m--);const _=$=>$.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");let v="";for(let $=0;$<n.length;$++){const N=_(n[$]);v+=h[$]?`<mark>${N}</mark>`:N}let C="";for(let $=0;$<i.length;$++){const N=_(i[$]);C+=d[$]?`<mark>${N}</mark>`:N}return{oldHtml:v,newHtml:C}},or=(e,t)=>{const r=e.length,n=t.length,i=Array(r+1).fill(0).map(()=>Array(n+1).fill(0));for(let d=1;d<=r;d++)for(let m=1;m<=n;m++)e[d-1]===t[m-1]?i[d][m]=i[d-1][m-1]+1:i[d][m]=Math.max(i[d-1][m],i[d][m-1]);const s=[];let a=r,c=n;const h=[];for(;a>0||c>0;)a>0&&c>0&&e[a-1]===t[c-1]?(h.unshift({type:"unchanged",line:e[a-1],oldLineNo:a,newLineNo:c}),a--,c--):c>0&&(a===0||i[a][c-1]>=i[a-1][c])?(h.unshift({type:"added",line:t[c-1],newLineNo:c}),c--):a>0&&(h.unshift({type:"removed",line:e[a-1],oldLineNo:a}),a--);for(let d=0;d<h.length;d++){const m=h[d],f=h[d+1];if(m.type==="removed"&&f?.type==="added"){const _=rn(m.line,f.line);s.push({type:"modified",line:m.line,oldLineNo:m.oldLineNo,newLineNo:f.newLineNo,oldHtml:_.oldHtml,newHtml:_.newHtml}),d++}else s.push(m)}return s},nn=async(e,t,r,n,i,s,a,c)=>{const h=r.split(`
|
|
3
|
+
`),d=n.split(`
|
|
4
4
|
`),m=i.split(`
|
|
5
|
-
`),f=B=>B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),
|
|
5
|
+
`),f=B=>B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),_=or(h,d),v=or(h,m);let C="";for(const B of _){const Y=f(B.line);if(B.type==="modified"){const U=B.oldLineNo?String(B.oldLineNo).padStart(4," "):" ",V=B.newLineNo?String(B.newLineNo).padStart(4," "):" ";C+=`<div class="line removed"><span class="line-num">${U}</span><span class="prefix">- </span>${B.oldHtml}</div>
|
|
6
6
|
`,C+=`<div class="line added"><span class="line-num">${V}</span><span class="prefix">+ </span>${B.newHtml}</div>
|
|
7
|
-
`}else if(B.type==="removed"){const
|
|
8
|
-
`}else if(B.type==="added"){const
|
|
9
|
-
`}else{const
|
|
10
|
-
`}}let $="";for(const B of v){const Y=f(B.line);if(B.type==="modified"){const
|
|
7
|
+
`}else if(B.type==="removed"){const U=B.oldLineNo?String(B.oldLineNo).padStart(4," "):" ";C+=`<div class="line removed"><span class="line-num">${U}</span><span class="prefix">- </span>${Y}</div>
|
|
8
|
+
`}else if(B.type==="added"){const U=B.newLineNo?String(B.newLineNo).padStart(4," "):" ";C+=`<div class="line added"><span class="line-num">${U}</span><span class="prefix">+ </span>${Y}</div>
|
|
9
|
+
`}else{const U=B.oldLineNo?String(B.oldLineNo).padStart(4," "):" ",V=B.newLineNo?String(B.newLineNo).padStart(4," "):" ";C+=`<div class="line unchanged"><span class="line-num">${U} ${V}</span><span class="prefix"> </span>${Y}</div>
|
|
10
|
+
`}}let $="";for(const B of v){const Y=f(B.line);if(B.type==="modified"){const U=B.oldLineNo?String(B.oldLineNo).padStart(4," "):" ",V=B.newLineNo?String(B.newLineNo).padStart(4," "):" ";$+=`<div class="line removed"><span class="line-num">${U}</span><span class="prefix">- </span>${B.oldHtml}</div>
|
|
11
11
|
`,$+=`<div class="line added"><span class="line-num">${V}</span><span class="prefix">+ </span>${B.newHtml}</div>
|
|
12
|
-
`}else if(B.type==="removed"){const
|
|
13
|
-
`}else if(B.type==="added"){const
|
|
14
|
-
`}else{const
|
|
15
|
-
`}}const
|
|
12
|
+
`}else if(B.type==="removed"){const U=B.oldLineNo?String(B.oldLineNo).padStart(4," "):" ";$+=`<div class="line removed"><span class="line-num">${U}</span><span class="prefix">- </span>${Y}</div>
|
|
13
|
+
`}else if(B.type==="added"){const U=B.newLineNo?String(B.newLineNo).padStart(4," "):" ";$+=`<div class="line added"><span class="line-num">${U}</span><span class="prefix">+ </span>${Y}</div>
|
|
14
|
+
`}else{const U=B.oldLineNo?String(B.oldLineNo).padStart(4," "):" ",V=B.newLineNo?String(B.newLineNo).padStart(4," "):" ";$+=`<div class="line unchanged"><span class="line-num">${U} ${V}</span><span class="prefix"> </span>${Y}</div>
|
|
15
|
+
`}}const N=`<!DOCTYPE html>
|
|
16
16
|
<html>
|
|
17
17
|
<head>
|
|
18
18
|
<meta charset="UTF-8">
|
|
@@ -173,10 +173,10 @@ ${$} </div>
|
|
|
173
173
|
</div>
|
|
174
174
|
</div>
|
|
175
175
|
</body>
|
|
176
|
-
</html>`,F=ie.join(me,`${e}.diff.html`);return await
|
|
176
|
+
</html>`,F=ie.join(me,`${e}.diff.html`);return await ne.writeFile(F,N,"utf-8"),F},tn=async e=>{const t={id:e.id,name:e.name,description:e.description,action:"skipped",newVersion:e.version};if(!await Zr(e.id)){const i=tr(e);return await Ye(e.id,i),t.action="created",t}const n=await Qr(e.id);if(t.oldVersion=n.ccVersion,await en(e.id,e.identifierMap),n.ccVersion&&e.version){const i=qr(n.ccVersion,e.version);if(i===0)return t.action="skipped",t;if(i!=0){const s=await zr(e.id,n.ccVersion),a=Ee(n.content);if(!s||s!==a){t.action="conflict";let h=n.content;try{const v=(await ze(n.ccVersion)).prompts.find(C=>C.id===e.id);v&&(h=Oe(v.pieces,v.identifiers,v.identifierMap))}catch{console.log(X.yellow(`Warning: Could not fetch old version ${n.ccVersion} for comparison. Using current file as baseline.`))}const d=Oe(e.pieces,e.identifiers,e.identifierMap),m=Me(e.id),f=await nn(e.id,e.name,h,n.content,d,n.ccVersion,e.version,m);t.diffHtmlPath=f}else{const h=tr(e);await Ye(e.id,h),t.action="updated"}}}return t},on=async e=>{const t={ccVersion:e,results:[]},r=await ze(e);await Wr(r),await ne.mkdir(me,{recursive:!0});for(const n of r.prompts)try{const i=await tn(n);t.results.push(i)}catch(i){throw console.log(X.red(`Failed to sync prompt ${n.id}:`)),i}return t};let Te=null,We=null;const ir=async e=>{try{return Te=await ze(e),We=e,{success:!0}}catch(t){return Te=null,We=null,t instanceof Error?{success:!1,errorMessage:t.message}:{success:!1,errorMessage:"Unknown error occurred while downloading system prompts"}}},sn=(e,t)=>{let r="";for(let n=0;n<e.length;n++){const s=e[n].replace(/<<CCVERSION>>/g,t).replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r+=s,n<e.length-1&&(r+="([\\w$]+)")}return r},ln=(e,t,r,n,i)=>{const s={};for(let h=0;h<n.length;h++){const d=n[h],m=String(t[h]),f=r[m];f&&(s[f]=d)}let a=e;const c=Object.entries(s).sort((h,d)=>d[0].length-h[0].length);for(const[h,d]of c){const m=new RegExp(`\\b${h}\\b`,"g");a=a.replace(m,d)}return a=a.replace(/<<CCVERSION>>/g,i),a},an=async e=>{if(!Te||We!==e)return[];const t=Te,r=[];for(const n of t.prompts){const i=sn(n.pieces,e),s=ie.join(me,`${n.id}.md`);let a;try{a=await ne.readFile(s,"utf8")}catch(d){console.error(`Failed to read markdown file ${s}:`,d);continue}const c=pr(a),h=d=>{const m=d.slice(1);return ln(c.content,n.identifiers,n.identifierMap,m,e)};r.push({promptId:n.id,prompt:c,regex:i,getInterpolatedContent:h})}return r},cn=e=>{const t=e.results.filter(s=>s.action==="created"),r=e.results.filter(s=>s.action==="updated"),n=e.results.filter(s=>s.action==="conflict"),i=e.results.filter(s=>s.action==="skipped");if((t.length>0||r.length>0||n.length>0)&&i.length>0&&(console.log(X.dim(`Skipped ${i.length} up-to-date file(s)`)),console.log()),t.length>0){console.log(X.bold.green(`Created ${t.length} new prompt file(s):`));for(const s of t)console.log(X.green(` ${me}/${s.id}.md`)),console.log(X.green.dim(` ${s.description}`));console.log()}if(r.length>0){console.log(X.bold.blue(`Updated ${r.length} system prompt file(s):`));for(const s of r)s.oldVersion?console.log(X.blue(` ${s.id}.md (${s.oldVersion} → ${s.newVersion})`)):console.log(X.blue(` ${s.id}.md (→ ${s.newVersion})`));console.log()}if(n.length>0){console.log(X.bold.yellow(`WARNING: Conflicts detected for ${n.length} system prompt file(s)`));for(const s of n)console.log(X.yellow(` ${s.id}.md (${s.oldVersion} → ${s.newVersion})`)),console.log(X.yellow(` Open the diff in your browser: ${s.diffHtmlPath}`));console.log()}if(t.length>0&&(console.log(X.green.bold("New prompt files have been created; either more are now supported by tweakcc or Anthropic has added new ones.")),console.log(X.green(`You can now customize the markdown files at ${me} in a text editor.`)),console.log(X.green('Then run tweakcc and select "apply" or use tweakcc --apply to update your system prompts')),console.log()),n.length>0){console.log(),console.log("Review conflicts:"),console.log(" 1. Open the diff HTML files in your browser"),console.log(" 2. Verify your customizations are still appropriate"),console.log(" 3. Update your markdown files if needed"),console.log(X.bold.cyan(" 4. Important: Update the ccVersion in your markdown files to the latest version of each prompt:"));for(const s of n)console.log(X.yellow(` ${s.id}.md → `)+X.bold.magenta(s.newVersion));console.log(" 5. Delete the diff HTML files"),console.log()}},wr=async()=>{await ue.mkdir(pe,{recursive:!0}),await ue.mkdir(me,{recursive:!0})};let $e={settings:q,changesApplied:!1,ccVersion:"",lastModified:"",ccInstallationDir:null};const Xe=async()=>{const e={ccVersion:"",ccInstallationDir:null,lastModified:new Date().toISOString(),changesApplied:!0,settings:q};try{oe()&&console.log(`Reading config at ${de}`);const t=await ue.readFile(de,"utf8"),r={...e,...JSON.parse(t)},n=r?.settings?.thinkingVerbs;n?.punctuation&&(n.format="{}"+n.punctuation,delete n.punctuation),r.settings.inputBox||(r.settings.inputBox=q.inputBox);for(const s of q.themes){const a=r?.settings?.themes.find(c=>c.id===s.id||c.name===s.name);if(a){for(const[c,h]of Object.entries(s))c!=="colors"&&!Object.hasOwn(a,c)&&(a[c]=h);a.colors||(a.colors={});for(const[c,h]of Object.entries(s.colors))Object.hasOwn(a.colors,c)||(a.colors[c]=h)}}for(const s of r?.settings?.themes||[]){if(q.themes.some(h=>h.id===s.id||h.name===s.name))continue;const c=q.themes[0];s.colors||(s.colors={});for(const[h,d]of Object.entries(c.colors))Object.hasOwn(s.colors,h)||(s.colors[h]=d)}return r?.settings?.userMessageDisplay||(r.settings=r.settings||q,r.settings.userMessageDisplay=q.userMessageDisplay),await Kr(me)&&(r.changesApplied=!1),$e=r,r}catch(t){if(t instanceof Error&&"code"in t&&t.code==="ENOENT")return e;throw t}},Ae=async e=>(oe()&&console.log(`Updating config at ${de}`),e($e),$e.lastModified=new Date().toISOString(),await dn($e),$e),dn=async e=>{try{e.lastModified=new Date().toISOString(),await wr(),await ue.writeFile(de,JSON.stringify(e,null,2))}catch(t){throw console.error("Error saving config:",t),t}},xr=async e=>{oe()&&console.log(`Restoring cli.js from backup to ${e.cliPath}`);const t=await ue.readFile(ye);return await Cr(e.cliPath,t,"restore"),await Xr(),await Ae(r=>{r.changesApplied=!1}),!0},gn=async e=>{e.ccInstallationDir&&rr.unshift(e.ccInstallationDir);for(const t of rr)try{oe()&&console.log(`Searching for Claude Code cli.js file at ${t}`);const r=Qe.join(t,"cli.js");if(!await _r(r))continue;oe()&&(console.log(`Found Claude Code cli.js file at ${t}; checking hash...`),console.log(`SHA256 hash: ${await rt(r)}`));const n=Qe.join(t,"package.json");let i;try{i=JSON.parse(await ue.readFile(n,"utf8"))}catch(s){if(!(s instanceof Error&&"code"in s&&s.code==="ENOENT"))throw s}return{cliPath:r,packageJsonPath:n,version:i?.version}}catch(r){if(r instanceof Error&&"code"in r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))continue;throw r}return null},sr=async e=>{await wr(),oe()&&console.log(`Backing up cli.js to ${ye}`),await ue.copyFile(e.cliPath,ye),await Ae(t=>{t.changesApplied=!1,t.ccVersion=e.version})};async function _r(e){try{return await ue.stat(e),!0}catch(t){if(t instanceof Error&&"code"in t&&(t.code==="ENOENT"||t.code==="ENOTDIR"))return!1;throw t}}async function lr(){const e=await Xe(),t=await gn(e);if(!t)return null;if(t.version)try{const s=await on(t.version);cn(s)}catch{}const r=t.version,n=e.ccVersion;let i=!1;return await _r(ye)||(oe()&&console.log(`startupCheck: ${ye} not found; backing up cli.js`),await sr(t),i=!0),r!==n?(i||(oe()&&console.log(`startupCheck: real version (${r}) != backed up version (${n}); backing up cli.js`),await ue.unlink(ye),await sr(t)),{wasUpdated:!0,oldVersion:n,newVersion:r,ccInstInfo:t}):{wasUpdated:!1,oldVersion:null,newVersion:null,ccInstInfo:t}}const hn=e=>{const t=[],r=/visibleOptionCount:[\w$]+=(\d+)/g;let n;for(;(n=r.exec(e))!==null;){const i=n.index+n[0].indexOf("=")+1;t.push({startIndex:i,endIndex:i+n[1].length})}return t},un=(e,t)=>{const r=hn(e);if(r.length===0)return null;const n=r.sort((s,a)=>a.startIndex-s.startIndex);let i=e;for(const s of n){const a=t.toString(),c=i.slice(0,s.startIndex)+a+i.slice(s.endIndex);Q(i,c,a,s.startIndex,s.endIndex),i=c}return i};function mn(e){const t=/switch\s*\(([^)]+)\)\s*\{[^}]*case\s*["']light["'][^}]+\}/s,r=e.match(t);if(!r||r.index==null)return console.error("patch: themes: failed to find switchMatch"),null;const n=/\[(?:\{label:"(?:Dark|Light).+?",value:".+?"\},?)+\]/,i=/return\{(?:[$\w]+?:"(?:Dark|Light).+?",?)+\}/,s=e.match(n),a=e.match(i);return!s||s.index==null?(console.error("patch: themes: failed to find objArrMatch"),null):!a||a.index==null?(console.error("patch: themes: failed to find objMatch"),null):{switchStatement:{startIndex:r.index,endIndex:r.index+r[0].length,identifiers:[r[1].trim()]},objArr:{startIndex:s.index,endIndex:s.index+s[0].length},obj:{startIndex:a.index,endIndex:a.index+a[0].length}}}const fn=(e,t)=>{const r=mn(e);if(!r)return null;if(t.length===0)return e;let n=e;const i="return"+JSON.stringify(Object.fromEntries(t.map(c=>[c.id,c.name])));n=n.slice(0,r.obj.startIndex)+i+n.slice(r.obj.endIndex),Q(e,n,i,r.obj.startIndex,r.obj.endIndex),e=n;const s=JSON.stringify(t.map(c=>({label:c.name,value:c.id})));n=n.slice(0,r.objArr.startIndex)+s+n.slice(r.objArr.endIndex),Q(e,n,s,r.objArr.startIndex,r.objArr.endIndex),e=n;let a=`switch(${r.switchStatement.identifiers?.[0]}){
|
|
177
177
|
`;return t.forEach(c=>{a+=`case"${c.id}":return${JSON.stringify(c.colors)};
|
|
178
178
|
`}),a+=`default:return${JSON.stringify(t[0].colors)};
|
|
179
|
-
}`,
|
|
179
|
+
}`,n=n.slice(0,r.switchStatement.startIndex)+a+n.slice(r.switchStatement.endIndex),Q(e,n,a,r.switchStatement.startIndex,r.switchStatement.endIndex),n},bn=e=>{const t=/function ([$\w]+)\(([$\w]*)\)\{((?:if\([$\w]+\.includes\("\[1m\]"\)\)return 1e6;)?return 200000)\}/,r=e.match(t);return!r||r.index===void 0?(console.error("patch: context limit: failed to find match"),null):r.index+r[0].indexOf("{")+1},pn=e=>{const t=bn(e);if(!t)return null;const r="if(process.env.CLAUDE_CODE_CONTEXT_LIMIT)return Number(process.env.CLAUDE_CODE_CONTEXT_LIMIT);",n=e.slice(0,t)+r+e.slice(t);return Q(e,n,r,t,t),n},wn=e=>{const t=e.indexOf('bash:"bashBorder"');if(t===-1)return console.error("patch: input border: failed to find bash pattern"),null;const r=e.slice(t,t+500),n=/borderStyle:"[^"]*"/,i=r.match(n);return!i||i.index===void 0?(console.error("patch: input border: failed to find border style pattern"),null):{startIndex:t+i.index,endIndex:t+i.index+i[0].length}},xn=(e,t)=>{const r=wn(e);if(!r)return null;if(t){const n="borderColor:undefined",i=e.slice(0,r.startIndex)+n+e.slice(r.endIndex);return Q(e,i,n,r.startIndex,r.endIndex),i}else return e};function _n(e){const t=` ██████╗██╗ █████╗ ██╗ ██╗██████╗ ███████╗
|
|
180
180
|
██╔════╝██║ ██╔══██╗██║ ██║██╔══██╗██╔════╝
|
|
181
181
|
██║ ██║ ███████║██║ ██║██║ ██║█████╗
|
|
182
182
|
██║ ██║ ██╔══██║██║ ██║██║ ██║██╔══╝
|
|
@@ -187,27 +187,27 @@ ${$} </div>
|
|
|
187
187
|
██║ ██║ ██║██║ ██║█████╗
|
|
188
188
|
██║ ██║ ██║██║ ██║██╔══╝
|
|
189
189
|
╚██████╗╚██████╔╝██████╔╝███████╗
|
|
190
|
-
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝`,
|
|
191
|
-
Found match for prompt: ${i.name}`),console.log(` Match location: index ${h.index}, length ${h[0].length}`),console.log(` Original content (first 100 chars): ${h[0].substring(0,100)}...`),console.log(` Replacement content (first 100 chars): ${d.substring(0,100)}...`),console.log(` Captured variables: ${h.slice(1).join(", ")}`),console.log(` Content identical: ${h[0]===d}`));const m=e,f=h.index,
|
|
192
|
-
Debug info for ${i.name}:`),console.log(` Regex pattern (first 200 chars): ${s.substring(0,200)}...`),console.log(" Trying to match pattern in cli.js...");const d=e.match(new RegExp(s.substring(0,100)));console.log(` Partial match result: ${d?"found partial":"no match"}`)}}return e},Q=(e,t,n,
|
|
193
|
-
--- Diff ---`),console.log("OLD:",h+`\x1B[31m${d}\x1B[0m`+m),console.log("NEW:",f+`\x1B[32m${
|
|
194
|
-
`))},
|
|
195
|
-
`," "),i.figletFont,(c,h)=>{c?(console.error("patch: figlet: failed to generate text",c),a("")):a(h||"")}))),(r=yr(n,s))&&(n=r)}return e.settings.thinkingVerbs&&((r=Lr(n,e.settings.thinkingVerbs.verbs))&&(n=r),(r=Cr(n,e.settings.thinkingVerbs.format))&&(n=r)),(r=Br(n,e.settings.thinkingStyle.phases))&&(n=r),(r=Tr(n,e.settings.thinkingStyle.updateInterval))&&(n=r),(r=Er(n,Math.max(...e.settings.thinkingStyle.phases.map(i=>i.length))+1))&&(n=r),(r=Mr(n,e.settings.thinkingStyle.reverseMirror))&&(n=r),e.settings.userMessageDisplay&&(r=Rr(n,e.settings.userMessageDisplay.prefix.format,e.settings.userMessageDisplay.prefix.foreground_color,e.settings.userMessageDisplay.prefix.background_color,e.settings.userMessageDisplay.prefix.styling.includes("bold"),e.settings.userMessageDisplay.prefix.styling.includes("italic"),e.settings.userMessageDisplay.prefix.styling.includes("underline"),e.settings.userMessageDisplay.prefix.styling.includes("strikethrough"),e.settings.userMessageDisplay.prefix.styling.includes("inverse"),e.settings.userMessageDisplay.message.foreground_color,e.settings.userMessageDisplay.message.background_color,e.settings.userMessageDisplay.message.styling.includes("bold"),e.settings.userMessageDisplay.message.styling.includes("italic"),e.settings.userMessageDisplay.message.styling.includes("underline"),e.settings.userMessageDisplay.message.styling.includes("strikethrough"),e.settings.userMessageDisplay.message.styling.includes("inverse")))&&(n=r),e.settings.inputBox&&typeof e.settings.inputBox.removeBorder=="boolean"&&(r=xr(n,e.settings.inputBox.removeBorder))&&(n=r),(r=Vr(n))&&(n=r),(r=vr(n))&&(n=r),(r=br(n))&&(n=r),(r=Kr(n))&&(n=r),(r=ur(n,25))&&(n=r),(r=Ur(n))&&(n=r),(r=Gr(n,"2.0.2"))&&(n=r),await $n(t.cliPath,n,"patch"),await Ae(i=>{i.changesApplied=!0})},De=[{label:"Opus 4.1",slug:"opus-4.1",internal:"claude-opus-4-1-20250805"},{label:"Opus 4",slug:"opus-4",internal:"claude-opus-4-20250514"},{label:"Sonnet 4",slug:"sonnet-4",internal:"claude-sonnet-4-20250514"},{label:"Sonnet 3.7",slug:"sonnet-3.7",internal:"claude-3-7-sonnet-20250219"},{label:"Sonnet 3.5 (October)",slug:"sonnet-3.5-october",internal:"claude-3-5-sonnet-20241022"},{label:"Sonnet 3.5 (June)",slug:"sonnet-3.5-june",internal:"claude-3-5-sonnet-20240620"},{label:"Haiku 3.5",slug:"haiku-3.5",internal:"claude-3-5-haiku-20241022"},{label:"Haiku 3",slug:"haiku-3",internal:"claude-3-haiku-20240307"},{label:"Opus 3",slug:"opus-3",internal:"claude-3-opus-20240229"}],Wr=e=>{const t=e.indexOf("Switch between Claude models");if(t===-1)return null;const n=Math.max(0,t-600),r=t,s=e.slice(n,r).match(/\[[$\w]+,\s*[$\w]+\]\s*=\s*[$\w]+\.useState\([^)]*\)\s*,\s*([$\w]+)=/);if(!s||s.index===void 0)return null;let c=n+s.index;for(;c<e.length&&e[c]!==";";)c++;if(c>=e.length)return null;const h=c+1,d=s[1];return{insertionIndex:h,optionsVar:d}},zr=e=>{const t=Wr(e);if(!t)return null;const{insertionIndex:n,optionsVar:r}=t,i=De.map(a=>{const c=JSON.stringify(a.label),h=JSON.stringify(a.slug);return`${r}.push({value:${h},label:${c}});`}).join(""),s=e.slice(0,n)+i+e.slice(n);return Q(e,s,i,n,n),s},Jr=e=>{const t=e.match(/"sonnet\[1m\]"/);if(!t||t.index===void 0)return null;let r=t.index;for(;r>=0&&e[r]!=="[";)r--;if(r<0)return null;let i=r-1;for(;i>=0&&/\s/.test(e[i]);)i--;if(i<0||e[i]!=="=")return null;let s=r,a=0,c=-1;for(;s<e.length;){const C=e[s];if(C==="["&&a++,C==="]"&&(a--,a===0)){c=s;break}s++}if(c===-1)return null;const h=e.slice(r,c+1);let d;try{d=JSON.parse(h)}catch{return null}const m=De.map(C=>C.slug),f=new Set(d);for(const C of m)f.add(C);const S=JSON.stringify(Array.from(f)),v=e.slice(0,r)+S+e.slice(c+1);return Q(e,v,S,r,c+1),v},Xr=e=>{const n=e.indexOf('case"sonnet[1m]"');if(n===-1)return null;let r=n;for(;r>=0&&e[r]!=="{";)r--;if(r<0)return null;let i=n;for(;i<e.length&&e[i]!=="}";)i++;if(i>=e.length)return null;const s=e.slice(r,i+1),a=De.map(S=>`case${JSON.stringify(S.slug)}:return${JSON.stringify(S.internal)};`).join(""),c=s.slice(0,-1),d=(/;\s*$/.test(c)?"":";")+a,m=c+d+"}",f=e.slice(0,r)+m+e.slice(i+1);return Q(e,f,a,r+s.length-1,r+s.length-1),f},Kr=e=>{let t=e;const n=Jr(t);n&&(t=n);const r=Xr(t);r&&(t=r);const i=zr(t);return i&&(t=i),t===e?null:t};let In=!1;const oe=()=>In,qr=()=>{In=!0};function Le(){try{const e=ie.join(xe.homedir(),".claude.json");return JSON.parse(Me.readFileSync(e,"utf8")).theme||"dark"}catch{}return"dark"}function Zr(){try{const e=ie.join(xe.homedir(),".claude",".credentials.json");switch(JSON.parse(Me.readFileSync(e,"utf8"))?.claudeAiOauth?.subscriptionType||"unknown"){case"enterprise":return"Claude Enterprise";case"team":return"Claude Team";case"max":return"Claude Max";case"pro":return"Claude Pro"}}catch{}return"Claude API"}function Qr(){try{const e=ie.join(xe.homedir(),".claude","settings.json"),n=JSON.parse(Me.readFileSync(e,"utf8"))?.model||"default";if(n==="opus")return"Opus 4.1";const r=De.find(i=>i.slug===n);if(r)return r.label}catch{}return"Sonnet 4.5"}function et(e){process.platform==="win32"?ye.spawn("explorer",[e],{detached:!0,stdio:"ignore"}).unref():process.platform==="darwin"?ye.spawn("open",[e],{detached:!0,stdio:"ignore"}).unref():ye.spawn("xdg-open",[e],{detached:!0,stdio:"ignore"}).unref()}function cn(e){if(process.platform==="win32")ye.spawn("explorer",["/select,",e],{detached:!0,stdio:"ignore"}).unref();else if(process.platform==="darwin")ye.spawn("open",["-R",e],{detached:!0,stdio:"ignore"}).unref();else{const t=ie.dirname(e);ye.spawn("xdg-open",[t],{detached:!0,stdio:"ignore"}).unref()}}function Ke(e){if(!e||typeof e!="string")return!1;const t=e.trim();if(/^#([a-fA-F0-9]{3}|[a-fA-F0-9]{6})$/.test(t))return!0;if(/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/.test(t)){const n=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(n){const[,r,i,s]=n;return parseInt(r)<=255&&parseInt(i)<=255&&parseInt(s)<=255}}if(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(t)){const n=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(n){const[,r,i,s]=n;return parseInt(r)<=360&&parseInt(i)<=100&&parseInt(s)<=100}}return!1}function Cn(e){if(!Ke(e))return e;const t=e.trim();if(t.startsWith("rgb("))return t;if(t.startsWith("#")){let n=t.slice(1);n.length===3&&(n=n.split("").map(a=>a+a).join(""));const r=parseInt(n.slice(0,2),16),i=parseInt(n.slice(2,4),16),s=parseInt(n.slice(4,6),16);return`rgb(${r},${i},${s})`}if(t.startsWith("hsl(")){const n=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(n){const r=parseInt(n[1])/360,i=parseInt(n[2])/100,s=parseInt(n[3])/100,a=(S,v,C)=>(C<0&&(C+=1),C>1&&(C-=1),C<1/6?S+(v-S)*6*C:C<1/2?v:C<2/3?S+(v-S)*(2/3-C)*6:S),c=s<.5?s*(1+i):s+i-s*i,h=2*s-c,d=Math.round(a(h,c,r+1/3)*255),m=Math.round(a(h,c,r)*255),f=Math.round(a(h,c,r-1/3)*255);return`rgb(${d},${m},${f})`}}return e}async function nt(e,t="sha256",n=64*1024){return new Promise((r,i)=>{const s=hn.createHash(t),a=Me.createReadStream(e,{highWaterMark:n});a.on("data",c=>{s.update(c)}),a.on("end",()=>{r(s.digest("hex"))}),a.on("error",c=>{i(c)})})}const dn=(e,t,n,r,i,s,a,c)=>{let h=e;return t&&(h+=`.rgb(${t})`),n&&n!=="transparent"&&(h+=`.bgRgb(${n})`),r&&(h+=".bold"),i&&(h+=".italic"),s&&(h+=".underline"),a&&(h+=".strikethrough"),c&&(h+=".inverse"),h};async function $n(e,t,n="replace"){let r=493;try{r=(await re.stat(e)).mode,oe()&&console.log(`[${n}] Original file mode for ${e}: ${(r&parseInt("777",8)).toString(8)}`)}catch(i){oe()&&console.log(`[${n}] Could not stat ${e} (error: ${i}), using default mode 755`)}try{await re.unlink(e),oe()&&console.log(`[${n}] Unlinked ${e} to break hard links`)}catch(i){oe()&&console.log(`[${n}] Could not unlink ${e}: ${i}`)}await re.writeFile(e,t),await re.chmod(e,r),oe()&&console.log(`[${n}] Restored permissions to ${(r&parseInt("777",8)).toString(8)}`)}function R({color:e,backgroundColor:t,bold:n,dimColor:r,children:i}){const s=e?.startsWith("ansi:"),a=t?.startsWith("ansi:");if(s||a){if(Re.Children.toArray(i).some(f=>Re.isValidElement(f)))return o(l,{children:i});let h=X;if(s){const f=e.slice(5);h=h[f]||h}if(a){const f=t.slice(5),S=f.startsWith("bg")?f:`bg${f.charAt(0).toUpperCase()}${f.slice(1)}`;h=h[S]||h}n&&(h=h.bold),r&&(h=h.dim);const m=Re.Children.toArray(i).map(f=>typeof f=="string"||typeof f=="number"?String(f):"").join("");return o(l,{children:h(m)})}return o(l,{color:e,backgroundColor:t,bold:n,dimColor:r,children:i})}function rt({text:e,nonShimmerColors:t,shimmerColors:n,shimmerWidth:r=3,updateDuration:i=50,restartPoint:s=10}){const[a,c]=T(0);return ae(()=>{const h=setInterval(()=>{c(d=>{const m=d+1;return m>=e.length+s?-r:m})},i);return()=>clearInterval(h)},[e.length,s,i]),t.length!==n.length?(console.error("UltrathinkRainbowShimmer: nonShimmerColors and shimmerColors must have the same length"),o(l,{children:e})):o(l,{children:e.split("").map((h,d)=>{const m=d>=a&&d<a+r&&a<e.length,f=d%t.length,S=m?n[f]:t[f];return o(l,{color:S,children:h},d)})})}const tt=Dn.cwd();function Mn({theme:e}){const{ccVersion:t}=pe(he);return g(u,{flexDirection:"column",paddingLeft:1,children:[o(u,{marginBottom:1,children:g(l,{bold:!0,children:["Preview: ",e.name]})}),o(u,{borderStyle:"single",borderColor:"gray",paddingX:1,children:g(u,{flexDirection:"column",children:[g(u,{flexDirection:"column",children:[g(l,{children:[o(R,{color:e.colors.clawd_body,children:" ▐"}),o(l,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:"▛███▜"}),g(l,{children:[o(R,{color:e.colors.clawd_body,children:"▌ "})," ",o(l,{bold:!0,children:"Claude Code"})," ",t?`v${t}`:"v2.0.14"]})]}),g(l,{children:[o(R,{color:e.colors.clawd_body,children:"▝▜"}),o(l,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:"█████"}),o(R,{color:e.colors.clawd_body,children:"▛▘"})," ",Qr()," · ",Zr()]}),g(R,{color:e.colors.clawd_body,children:[" ","▘▘ ▝▝"," ",tt]}),g(l,{children:[g(R,{color:e.colors.success,children:["Login successful. Press"," "]}),o(R,{bold:!0,color:e.colors.success,children:"Enter"}),g(R,{color:e.colors.success,children:[" ","to continue…"]})]})]}),o(l,{children:"╭─────────────────────────────────────────────╮"}),g(l,{children:["│ 1 function greet() ","{"," ","│"]}),g(l,{children:["│ 2"," ",o(R,{backgroundColor:e.colors.diffRemoved,color:e.colors.text,children:'- console.log("'}),o(R,{backgroundColor:e.colors.diffRemovedWord,children:"Hello, World!"}),o(R,{backgroundColor:e.colors.diffRemoved,children:'");'})," ","│"]}),g(l,{children:["│ 2"," ",o(R,{backgroundColor:e.colors.diffAdded,color:e.colors.text,children:'+ console.log("'}),o(R,{backgroundColor:e.colors.diffAddedWord,children:"Hello, Claude!"}),o(R,{backgroundColor:e.colors.diffAdded,children:'");'})," ","│"]}),o(R,{color:e.colors.warning,children:"╭─────────────────────────────────────────────╮"}),g(R,{color:e.colors.warning,children:["│ Do you trust the files in this folder?"," ","│"]}),g(l,{children:[o(R,{color:e.colors.warning,children:"│ "}),o(l,{dimColor:!0,children:"Enter to confirm · Esc to exit"}),g(R,{color:e.colors.warning,children:[" ","│"]})]}),o(R,{color:e.colors.bashBorder,children:"───────────────────────────────────────────────"}),g(l,{children:[o(R,{color:e.colors.bashBorder,children:"!"}),o(l,{children:" ls"})]}),o(R,{color:e.colors.promptBorder,children:"───────────────────────────────────────────────"}),o(l,{children:g(l,{children:["> list the dir"," ",o(rt,{text:"ultrathink",nonShimmerColors:[e.colors.rainbow_red,e.colors.rainbow_orange,e.colors.rainbow_yellow,e.colors.rainbow_green,e.colors.rainbow_blue,e.colors.rainbow_indigo,e.colors.rainbow_violet],shimmerColors:[e.colors.rainbow_red_shimmer,e.colors.rainbow_orange_shimmer,e.colors.rainbow_yellow_shimmer,e.colors.rainbow_green_shimmer,e.colors.rainbow_blue_shimmer,e.colors.rainbow_indigo_shimmer,e.colors.rainbow_violet_shimmer],shimmerWidth:3,updateDuration:50,restartPoint:10})]})}),o(R,{color:e.colors.planMode,children:"╭─────────────────────────────────────────────╮"}),g(l,{children:[o(R,{color:e.colors.planMode,children:"│ "}),g(R,{color:e.colors.permission,children:["Ready to code?"," "]}),o(l,{children:"Here is Claude's plan:"}),g(R,{color:e.colors.planMode,children:[" ","│"]})]}),o(R,{color:e.colors.permission,children:"╭─────────────────────────────────────────────╮"}),g(l,{children:[o(R,{color:e.colors.permission,children:"│ "}),o(l,{bold:!0,children:"Permissions:"})," ",g(R,{backgroundColor:e.colors.permission,color:e.colors.inverseText,bold:!0,children:[" ","Allow"," "]})," ","Deny"," ","Workspace"," ",o(R,{color:e.colors.permission,children:"│"})]}),o(l,{children:"> list the dir"}),g(l,{children:[o(R,{color:e.colors.error,children:"●"}),o(l,{children:" Update(__init__.py)"})]}),g(l,{children:[o(l,{children:" ⎿ "}),o(R,{color:e.colors.error,children:"User rejected update to __init__.py"})]}),g(l,{children:[" ","1"," ",g(R,{backgroundColor:e.colors.diffRemovedDimmed,children:["- import"," "]}),o(R,{backgroundColor:e.colors.diffRemovedWordDimmed,children:"os"})]}),g(l,{children:[" ","2"," ",g(R,{backgroundColor:e.colors.diffAddedDimmed,children:["+ import"," "]}),o(R,{backgroundColor:e.colors.diffAddedWordDimmed,children:"random"})]}),g(l,{children:[o(R,{color:e.colors.success,children:"●"}),o(l,{children:" List(.)"})]}),g(l,{children:[o(l,{children:"●"}),o(l,{children:" The directory "}),o(R,{color:e.colors.permission,children:"C:\\Users\\user"}),g(l,{children:[" ","contains ",o(l,{bold:!0,children:"123"})," files."]})]}),g(l,{children:[o(R,{color:e.colors.claude,children:"✻ Th"}),o(R,{color:e.colors.claudeShimmer,children:"ink"}),o(R,{color:e.colors.claude,children:"ing… "}),o(l,{children:"(esc to interrupt)"})]}),o(l,{children:o(R,{color:e.colors.autoAccept,children:"⏵⏵ auto-accept edits on (shift+tab to cycle)"})}),o(l,{children:o(R,{color:e.colors.planMode,children:"⏸ plan mode on (shift+tab to cycle)"})}),o(l,{children:o(R,{color:e.colors.ide,children:"◯ IDE connected ⧉ 44 lines selected"})})]})})]})}function Fe({colorKey:e,theme:t,bold:n=!1}){const r=t.colors[e];return e==="inverseText"?o(R,{color:r,backgroundColor:t.colors.permission,bold:n,children:e}):e.startsWith("diff")?o(R,{backgroundColor:r,bold:n,color:t.colors.text,children:e}):o(R,{color:r,bold:n,children:e})}function Nn({initialValue:e,onColorChange:t,onExit:n,colorKey:r,theme:i}){const s=je(e)||{h:0,s:50,l:50},a=Ve(e)||{r:128,g:128,b:128},[c,h]=T(s),[d,m]=T(a),[f,S]=T("hsl"),[v,C]=T("h"),[$,M]=T(!1),[F,B]=T(!1);ae(()=>{const x=je(e),w=Ve(e);x&&w&&(M(!0),h(x),m(w),M(!1))},[e]),ae(()=>{if(!$&&F){const x=`rgb(${d.r},${d.g},${d.b})`;t(x)}},[c,d,$,F]),ae(()=>{B(!0)},[]);const Y=x=>{if(Ke(x)){const w=Cn(x),b=je(w),k=Ve(w);b&&k&&(M(!0),h(b),m(k),M(!1))}};ge((x,w)=>{if(x.length>1&&!w.ctrl&&!w.meta){Y(x);return}if(w.return)n();else if(w.escape)n();else if(w.ctrl&&x==="a")S(b=>b==="hsl"?"rgb":"hsl"),C(b=>f==="hsl"?b==="h"?"r":b==="s"?"g":"b":b==="r"?"h":b==="g"?"s":"l");else if(w.upArrow)C(f==="hsl"?b=>b==="h"?"l":b==="s"?"h":"s":b=>b==="r"?"b":b==="g"?"r":"g");else if(w.downArrow||w.tab)C(f==="hsl"?b=>b==="h"?"s":b==="s"?"l":"h":b=>b==="r"?"g":b==="g"?"b":"r");else if(w.leftArrow){const b=w.shift||w.ctrl||w.meta?-10:-1;j(b)}else if(w.rightArrow){const b=w.shift||w.ctrl||w.meta?10:1;j(b)}});const j=x=>{M(!0),f==="hsl"?h(w=>{const b={...w};v==="h"?b.h=Math.max(0,Math.min(359,w.h+x)):v==="s"?b.s=Math.max(0,Math.min(100,w.s+x)):v==="l"&&(b.l=Math.max(0,Math.min(100,w.l+x)));const[k,p,y]=te(b.h,b.s,b.l);return m({r:k,g:p,b:y}),b}):m(w=>{const b={...w};v==="r"?b.r=Math.max(0,Math.min(255,w.r+x)):v==="g"?b.g=Math.max(0,Math.min(255,w.g+x)):v==="b"&&(b.b=Math.max(0,Math.min(255,w.b+x)));const k=V(b.r,b.g,b.b);return h(k),b}),M(!1)},V=(x,w,b)=>{const k=x/255,p=w/255,y=b/255,O=Math.max(k,p,y),_=Math.min(k,p,y),L=O-_,ne=(O+_)/2;let le=0;L!==0&&(le=ne>.5?L/(2-O-_):L/(O+_));let se=0;return L!==0&&(O===k?se=((p-y)/L+(p<y?6:0))/6:O===p?se=((y-k)/L+2)/6:se=((k-p)/L+4)/6),{h:Math.round(se*360),s:Math.round(le*100),l:Math.round(ne*100)}},te=(x,w,b)=>{x/=360,w/=100,b/=100;const k=(1-Math.abs(2*b-1))*w,p=k*(1-Math.abs(x*6%2-1)),y=b-k/2;let O=0,_=0,L=0;return 0<=x&&x<1/6?(O=k,_=p,L=0):1/6<=x&&x<2/6?(O=p,_=k,L=0):2/6<=x&&x<3/6?(O=0,_=k,L=p):3/6<=x&&x<4/6?(O=0,_=p,L=k):4/6<=x&&x<5/6?(O=p,_=0,L=k):5/6<=x&&x<1&&(O=k,_=0,L=p),[Math.round((O+y)*255),Math.round((_+y)*255),Math.round((L+y)*255)]},z=()=>{const x=[],w=[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[127,0,255],[255,0,255],[255,0,127],[255,0,0]];for(let b=0;b<40;b++){const p=b/39*(w.length-1),y=Math.floor(p),O=Math.ceil(p),_=p-y,[L,ne,le]=w[y],[se,P,E]=w[O],D=Math.round(L+(se-L)*_),K=Math.round(ne+(P-ne)*_),W=Math.round(le+(E-le)*_);x.push(o(l,{backgroundColor:`rgb(${D},${K},${W})`,children:" "},b))}return x},Z=()=>{const x=[];for(let w=0;w<40;w++){const b=w/39*100,[k,p,y]=te(c.h,b,c.l);x.push(o(l,{backgroundColor:`rgb(${k},${p},${y})`,children:" "},w))}return x},A=()=>{const x=[];for(let w=0;w<40;w++){const b=w/39*100,[k,p,y]=te(c.h,c.s,b);x.push(o(l,{backgroundColor:`rgb(${k},${p},${y})`,children:" "},w))}return x},N=()=>{const[x,w,b]=te(c.h,c.s,c.l);return`rgb(${x},${w},${b})`},I=(x,w,b)=>{const k=p=>p.toString(16).padStart(2,"0");return`#${k(x)}${k(w)}${k(b)}`},U=()=>{const x=[];for(let w=0;w<40;w++){const b=Math.round(w/39*255);x.push(o(l,{backgroundColor:`rgb(${b},${d.g},${d.b})`,children:" "},w))}return x},H=()=>{const x=[];for(let w=0;w<40;w++){const b=Math.round(w/39*255);x.push(o(l,{backgroundColor:`rgb(${d.r},${b},${d.b})`,children:" "},w))}return x},ee=()=>{const x=[];for(let w=0;w<40;w++){const b=Math.round(w/39*255);x.push(o(l,{backgroundColor:`rgb(${d.r},${d.g},${b})`,children:" "},w))}return x},G=(x,w)=>Math.round(x/w*39);return g(u,{flexDirection:"column",borderStyle:"single",borderColor:"white",padding:1,children:[g(u,{flexDirection:"column",children:[o(l,{bold:!0,children:"Color Picker"}),g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{color:"gray",dimColor:!0,children:"←→ to adjust (shift/ctrl/cmd +10)"}),o(l,{color:"gray",dimColor:!0,children:"↑↓ to change bar"}),o(l,{color:"gray",dimColor:!0,children:"ctrl+a to switch rgb/hsl"}),o(l,{color:"gray",dimColor:!0,children:"paste color from clipboard"}),o(l,{color:"gray",dimColor:!0,children:"enter to exit (auto-saved)"}),o(l,{color:"gray",dimColor:!0,children:"esc to save and exit"})]})]}),f==="hsl"?g(ce,{children:[g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="h"?"yellow":"white",children:[v==="h"?"❯ ":" ","Hue (",c.h,"°):"]})}),o(u,{children:z().map((x,w)=>o(Se,{children:w===G(c.h,360)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="s"?"yellow":"white",children:[v==="s"?"❯ ":" ","Saturation (",c.s,"%):"]})}),o(u,{children:Z().map((x,w)=>o(Se,{children:w===G(c.s,100)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="l"?"yellow":"white",children:[v==="l"?"❯ ":" ","Lightness (",c.l,"%):"]})}),o(u,{children:A().map((x,w)=>o(Se,{children:w===G(c.l,100)?o(l,{children:"|"}):x},w))})]})]}):g(ce,{children:[g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="r"?"yellow":"white",children:[v==="r"?"❯ ":" ","Red (",d.r,"):"]})}),o(u,{children:U().map((x,w)=>o(Se,{children:w===G(d.r,255)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="g"?"yellow":"white",children:[v==="g"?"❯ ":" ","Green (",d.g,"):"]})}),o(u,{children:H().map((x,w)=>o(Se,{children:w===G(d.g,255)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="b"?"yellow":"white",children:[v==="b"?"❯ ":" ","Blue (",d.b,"):"]})}),o(u,{children:ee().map((x,w)=>o(Se,{children:w===G(d.b,255)?o(l,{children:"|"}):x},w))})]})]}),g(u,{marginBottom:1,children:[o(l,{children:"Current: "}),o(l,{backgroundColor:N(),children:" "})]}),g(u,{flexDirection:"row",justifyContent:"space-between",children:[g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:"Hex "}),r?.startsWith("diff")?o(l,{backgroundColor:N(),color:i?.colors?.text||"white",bold:!0,children:I(d.r,d.g,d.b)}):r==="inverseText"?o(l,{color:N(),backgroundColor:i?.colors?.permission,bold:!0,children:I(d.r,d.g,d.b)}):o(l,{color:N(),bold:!0,children:I(d.r,d.g,d.b)})]}),g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:"RGB "}),r?.startsWith("diff")?o(l,{backgroundColor:N(),color:i?.colors?.text||"white",bold:!0,children:`rgb(${d.r}, ${d.g}, ${d.b})`}):r==="inverseText"?o(l,{color:N(),backgroundColor:i?.colors?.permission,bold:!0,children:`rgb(${d.r}, ${d.g}, ${d.b})`}):o(l,{color:N(),bold:!0,children:`rgb(${d.r}, ${d.g}, ${d.b})`})]}),g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:"HSL "}),r?.startsWith("diff")?o(l,{backgroundColor:N(),color:i?.colors?.text||"white",bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):r==="inverseText"?o(l,{color:N(),backgroundColor:i?.colors?.permission,bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):o(l,{color:N(),bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`})]})]})]})}function Ve(e){const t=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(t)return{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3])};const n=e.match(/^#([a-fA-F0-9]{6})$/);if(n){const r=n[1];return{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16)}}return null}function je(e){const t=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(t)return{h:parseInt(t[1]),s:parseInt(t[2]),l:parseInt(t[3])};const n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(n){const i=parseInt(n[1])/255,s=parseInt(n[2])/255,a=parseInt(n[3])/255,c=Math.max(i,s,a),h=Math.min(i,s,a),d=c-h,m=(c+h)/2;let f=0;d!==0&&(f=m>.5?d/(2-c-h):d/(c+h));let S=0;return d!==0&&(c===i?S=((s-a)/d+(s<a?6:0))/6:c===s?S=((a-i)/d+2)/6:S=((i-s)/d+4)/6),{h:Math.round(S*360),s:Math.round(f*100),l:Math.round(m*100)}}const r=e.match(/^#([a-fA-F0-9]{6})$/);if(r){const i=r[1],s=parseInt(i.substr(0,2),16)/255,a=parseInt(i.substr(2,2),16)/255,c=parseInt(i.substr(4,2),16)/255,h=Math.max(s,a,c),d=Math.min(s,a,c),m=h-d,f=(h+d)/2;let S=0;m!==0&&(S=f>.5?m/(2-h-d):m/(h+d));let v=0;return m!==0&&(h===s?v=((a-c)/m+(a<c?6:0))/6:h===a?v=((c-s)/m+2)/6:v=((s-a)/m+4)/6),{h:Math.round(v*360),s:Math.round(S*100),l:Math.round(f*100)}}return{h:0,s:50,l:50}}function ot({onBack:e,themeId:t}){const{settings:{themes:n},updateSettings:r}=pe(he),[i,s]=T(t),a=n.find(A=>A.id===i)||n[0],[c,h]=T("rgb"),[d,m]=T(0),[f,S]=T(null),[v,C]=T(null),[$,M]=T(""),[F,B]=T(""),Y=gn(A=>{r(N=>{const I=N.themes.findIndex(U=>U.id===i);I!==-1&&A(N.themes[I])})},[i,r]),j=A=>{if(d>=2&&Ke(A)){const N=Cn(A),I=d-2,U=V[I];Y(H=>{H.colors[U]=N})}};ge((A,N)=>{if(f===null&&v===null){if(A.length>1&&!N.ctrl&&!N.meta){j(A);return}if(N.escape)e();else if(N.ctrl&&A==="a")h(I=>I==="rgb"?"hex":I==="hex"?"hsl":"rgb");else if(N.upArrow)m(I=>Math.max(0,I-1));else if(N.downArrow)m(I=>Math.min(V.length+1,I+1));else if(N.return)if(d===0)C("name"),M(a.name),B(a.name);else if(d===1)C("id"),M(a.id),B(a.id);else{const I=d-2,U=V[I],H=a.colors[U];S(I),M(H),B(H)}}else if(f!==null)N.ctrl&&A==="a"&&h(I=>I==="rgb"?"hex":I==="hex"?"hsl":"rgb");else if(v!==null)if(N.return){if(v==="id"){const I=i;s($),r(U=>{const H=U.themes.findIndex(ee=>ee.id===I);H!==-1&&(U.themes[H].id=$)})}else Y(I=>{I.name=$});C(null),M(""),B("")}else N.escape?(C(null),M(""),B("")):N.backspace||N.delete?M(I=>I.slice(0,-1)):A&&M(I=>I+A)});const V=Object.keys(a.colors),te=(A,N)=>{const I=A.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(!I)return A;const U=parseInt(I[1]),H=parseInt(I[2]),ee=parseInt(I[3]);switch(N){case"hex":{const G=x=>x.toString(16).padStart(2,"0");return`#${G(U)}${G(H)}${G(ee)}`}case"hsl":{const G=U/255,x=H/255,w=ee/255,b=Math.max(G,x,w),k=Math.min(G,x,w),p=b-k,y=(b+k)/2;let O=0;p!==0&&(O=y>.5?p/(2-b-k):p/(b+k));let _=0;return p!==0&&(b===G?_=((x-w)/p+(x<w?6:0))/6:b===x?_=((w-G)/p+2)/6:_=((G-x)/p+4)/6),`hsl(${Math.round(_*360)}, ${Math.round(O*100)}%, ${Math.round(y*100)}%)`}case"rgb":default:return A}},z=A=>({autoAccept:"Auto-accept mode indicator",bashBorder:"Bash command border",claude:"Claude branding color. Used for the Claude logo, the welcome message, and the thinking text.",claudeShimmer:"Color used for the shimmering effect on the thinking verb.",claudeBlue_FOR_SYSTEM_SPINNER:"System spinner color (blue variant)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"System spinner shimmer color (blue variant)",permission:"Permission prompt color",permissionShimmer:"Permission prompt shimmer color",planMode:"Plan mode indicator",ide:"Color used for IDE-related messages.",promptBorder:"Input prompt border color",promptBorderShimmer:"Input prompt border shimmer color",text:"Code color. Used in diffs.",inverseText:"Inverse text color. Used for the text of tabs, where the background is filled in.",inactive:"Inactive/dimmed text. Used for line numbers and less prominent text.",subtle:"Subtle text. Used for help text and secondary information.",suggestion:"Suggestion text color. Used for suggestions for theme names and various other things.",remember:"Remember/note color. Used for various text relating to memories.",background:"Background color for certain UI elements",success:"Success indicator. Used for the bullet on successful tool calls, and various success messages (such as sign in successful).",error:"Error indicator",warning:"Warning indicator",warningShimmer:"Warning shimmer color",diffAdded:"Added diff background",diffRemoved:"Removed diff background",diffAddedDimmed:"Added diff background (dimmed)",diffRemovedDimmed:"Removed diff background (dimmed)",diffAddedWord:"Added word highlight",diffRemovedWord:"Removed word highlight",diffAddedWordDimmed:"Added word highlight (dimmed)",diffRemovedWordDimmed:"Removed word highlight (dimmed)",red_FOR_SUBAGENTS_ONLY:"Red color for sub agents",blue_FOR_SUBAGENTS_ONLY:"Blue color for sub agents",green_FOR_SUBAGENTS_ONLY:"Green color for sub agents",yellow_FOR_SUBAGENTS_ONLY:"Yellow color for sub agents",purple_FOR_SUBAGENTS_ONLY:"Purple color for sub agents",orange_FOR_SUBAGENTS_ONLY:"Orange color for sub agents",pink_FOR_SUBAGENTS_ONLY:"Pink color for sub agents",cyan_FOR_SUBAGENTS_ONLY:"Cyan color for sub agents",professionalBlue:"Professional blue color for business contexts?",rainbow_red:'"ultrathink" rainbow - red',rainbow_orange:'"ultrathink" rainbow - orange',rainbow_yellow:'"ultrathink" rainbow - yellow',rainbow_green:'"ultrathink" rainbow - green',rainbow_blue:'"ultrathink" rainbow - blue',rainbow_indigo:'"ultrathink" rainbow - indigo',rainbow_violet:'"ultrathink" rainbow - violet',rainbow_red_shimmer:'"ultrathink" rainbow (shimmer) - red',rainbow_orange_shimmer:'"ultrathink" rainbow (shimmer) - orange',rainbow_yellow_shimmer:'"ultrathink" rainbow (shimmer) - yellow',rainbow_green_shimmer:'"ultrathink" rainbow (shimmer) - green',rainbow_blue_shimmer:'"ultrathink" rainbow (shimmer) - blue',rainbow_indigo_shimmer:'"ultrathink" rainbow (shimmer) - indigo',rainbow_violet_shimmer:'"ultrathink" rainbow (shimmer) - violet',clawd_body:'"Clawd" character body color',clawd_background:'"Clawd" character background color',userMessageBackground:"Background color for user messages",bashMessageBackgroundColor:"Background color for bash command output",memoryBackgroundColor:"Background color for memory/context information",rate_limit_fill:"Rate limit indicator fill color",rate_limit_empty:"Rate limit indicator empty/background color"})[A]||"",Z=Math.max(...V.map(A=>A.length));return g(u,{children:[g(u,{flexDirection:"column",width:"50%",children:[o(u,{children:g(fe,{children:["Editing theme “",a.name,"” (",a.id,")"]})}),f===null&&v===null?g(ce,{children:[g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{dimColor:!0,children:"enter to edit theme name, id, or color"}),o(l,{dimColor:!0,children:"ctrl+a to toggle rgb, hex, hsl"}),o(l,{dimColor:!0,children:"paste color from clipboard (when on color)"}),o(l,{dimColor:!0,children:"esc to go back"})]}),d<2?g(u,{marginBottom:1,borderStyle:"single",borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:"yellow",flexDirection:"column",paddingLeft:1,children:[o(l,{bold:!0,children:d===0?"Theme Name":"Theme ID"}),o(l,{children:d===0?"The display name for this theme":"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):g(u,{marginBottom:1,borderStyle:"single",borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:a.colors[V[d-2]],flexDirection:"column",paddingLeft:1,children:[o(Fe,{colorKey:V[d-2],theme:a,bold:!0}),o(l,{children:z(V[d-2])})]}),g(u,{flexDirection:"column",children:[g(u,{children:[o(l,{color:d===0?"yellow":"white",children:d===0?"❯ ":" "}),o(l,{bold:!0,children:"Name: "}),o(l,{children:a.name})]}),g(u,{marginBottom:1,children:[o(l,{color:d===1?"yellow":"white",children:d===1?"❯ ":" "}),o(l,{bold:!0,children:"ID: "}),o(l,{children:a.id})]}),(()=>{if(d<2){const G=V.slice(0,20);return g(ce,{children:[G.map((x,w)=>{const b=w+2;return g(u,{children:[o(l,{color:d===b?"yellow":"white",children:d===b?"❯ ":" "}),o(u,{width:Z+2,children:o(l,{children:o(Fe,{colorKey:x,theme:a,bold:!0})})}),o(R,{color:a.colors[x],children:te(a.colors[x],c)})]},x)}),V.length>20&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",V.length-20," more below"]})]})}const N=d-2,I=Math.max(0,N-Math.floor(20/2)),U=Math.min(V.length,I+20),H=Math.max(0,U-20),ee=V.slice(H,U);return g(ce,{children:[H>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",H," more above"]}),ee.map((G,x)=>{const b=H+x+2;return g(u,{children:[o(l,{color:d===b?"yellow":"white",children:d===b?"❯ ":" "}),o(u,{width:Z+2,children:o(l,{children:o(Fe,{colorKey:G,theme:a,bold:!0})})}),o(R,{color:a.colors[G],children:te(a.colors[G],c)})]},G)}),U<V.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",V.length-U," more below"]})]})})()]})]}):v?g(u,{flexDirection:"column",marginTop:1,children:[g(l,{children:["Editing ",v==="name"?"theme name":"theme ID",":"]}),o(u,{borderStyle:"round",borderColor:"yellow",paddingX:1,children:o(l,{children:$})}),o(l,{dimColor:!0,children:"enter to save, esc to cancel"})]}):o(Nn,{initialValue:F,colorKey:V[f],theme:a,onColorChange:A=>{M(A),Y(N=>{N.colors[V[f]]=A})},onExit:()=>{Y(A=>{A.colors[V[f]]=$}),S(null),M(""),B("")}})]}),o(u,{width:"50%",children:o(Mn,{theme:a})})]})}function it(e){return e.map(t=>`${t.name} (${t.id})`)}function st({onBack:e}){const{settings:{themes:t},updateSettings:n}=pe(he),[r,i]=T(0),[s,a]=T(null),[c,h]=T(!0),d=()=>{const $={colors:{...(t[0]||q.themes[0]).colors},name:"New Custom Theme",id:`custom-${Date.now()}`};n(M=>{M.themes.push($)}),a($.id),h(!1)},m=C=>{t.length<=1||(n($=>{$.themes=$.themes.filter(M=>M.id!==C)}),r>=t.length-1&&i(Math.max(0,t.length-2)))},f=()=>{n(C=>{C.themes=[...q.themes]}),i(0)};if(ge((C,$)=>{if($.escape)e();else if($.upArrow)i(M=>Math.max(0,M-1));else if($.downArrow)i(M=>Math.min(t.length-1,M+1));else if($.return){const M=t[r];M&&(a(M.id),h(!1))}else if(C==="n")d();else if(C==="d"){const M=t[r];M&&m(M.id)}else $.ctrl&&C==="r"&&f()},{isActive:c}),s)return o(ot,{themeId:s,onBack:()=>{a(null),h(!0)}});const S=it(t),v=t.find(C=>S[r]?.includes(`(${C.id})`))||t[0];return t.length===0?o(u,{children:g(u,{flexDirection:"column",width:"100%",children:[o(fe,{children:"Themes"}),g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{dimColor:!0,children:"n to create a new theme"}),o(l,{dimColor:!0,children:"esc to go back"})]}),o(l,{children:"No themes available!"})]})}):g(u,{children:[g(u,{flexDirection:"column",width:"50%",children:[o(fe,{children:"Themes"}),g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{dimColor:!0,children:"n to create a new theme"}),o(l,{dimColor:!0,children:"d to delete a theme"}),o(l,{dimColor:!0,children:"ctrl+r to delete all themes and restore built-in"}),o(l,{dimColor:!0,children:"enter to edit theme"}),o(l,{dimColor:!0,children:"esc to go back"})]}),o(u,{flexDirection:"column",children:S.map((C,$)=>g(l,{color:r===$?"yellow":void 0,children:[r===$?"❯ ":" ",C]},$))})]}),o(u,{width:"50%",children:o(Mn,{theme:v})})]})}let Ue=["ANSI Shadow"];function lt({onBack:e}){const{stdout:t}=kn(),n=t?.columns||120,{settings:{launchText:{method:r,figletText:i,figletFont:s,customText:a},themes:c},updateSettings:h}=pe(he),d=r==="figlet"?["method","text","font"]:["method","text"],[m,f]=T(0),S=d[m],[v,C]=T(r==="figlet"?0:1),[$,M]=T(Ue),[F,B]=T(Ue),[Y,j]=T(""),[V,te]=T(!1),[z,Z]=T(0),[A,N]=T(""),[I,U]=T(50),[H,ee]=T(!1),[G,x]=T(r==="figlet"?i:a),w=Le(),k=(c.find(y=>y.id===w)||c.find(y=>y.id==="dark"))?.colors.claude||"rgb(215,119,87)";ae(()=>{He.fonts((y,O)=>{if(!y&&O){const _=O.sort();M(_),B(_),Ue=_;const L=_.indexOf(s);Z(L>=0?L:_.indexOf("ANSI Shadow")||0)}})},[]),ae(()=>{p()},[r,i,s,a,G,H]);const p=()=>{if(r==="figlet")try{const y=H?G:i,O=He.textSync(y.replace(`
|
|
196
|
-
`," "),{font:s}),
|
|
197
|
-
`).map(E=>E.length>
|
|
198
|
-
`);
|
|
199
|
-
`).map(
|
|
200
|
-
`);
|
|
201
|
-
`).map((y,O)=>o(l,{color:k,children:y},O)),o(u,{marginTop:1,children:o(l,{wrap:"truncate-end",children:"Claude Code can now be used with your Claude subscription or billed based on API usage through your Console account."})})]})]})]})}function at({onBack:e}){const{settings:{thinkingVerbs:{format:t,verbs:n},themes:r},updateSettings:i}=pe(he),s=["format","verbs"],[a,c]=T(0),h=s[a],[d,m]=T(0),[f,S]=T(!1),[v,C]=T(""),[$,M]=T(!1),[F,B]=T(!1),[Y,j]=T(t),V=Le(),z=(r.find(A=>A.id===V)||r.find(A=>A.id==="dark"))?.colors.claude||"rgb(215,119,87)";ge((A,N)=>{if(F){N.return?(i(I=>{I.thinkingVerbs.format=Y}),B(!1)):N.escape?(j(t),B(!1)):N.backspace||N.delete?j(I=>I.slice(0,-1)):A&&j(I=>I+A);return}if(f||$){N.return&&v.trim()?($?(i(I=>{I.thinkingVerbs.verbs.push(v.trim())}),M(!1)):(i(I=>{I.thinkingVerbs.verbs[d]=v.trim()}),S(!1)),C("")):N.escape?(C(""),S(!1),M(!1)):N.backspace||N.delete?C(I=>I.slice(0,-1)):A&&C(I=>I+A);return}N.escape?e():N.return?h==="format"&&(j(t),B(!0)):N.tab?N.shift?c(I=>I===0?s.length-1:I-1):c(I=>I===s.length-1?0:I+1):N.upArrow?h==="verbs"&&n.length>0&&m(I=>I>0?I-1:n.length-1):N.downArrow?h==="verbs"&&n.length>0&&m(I=>I<n.length-1?I+1:0):A==="e"&&h==="verbs"?n.length>0&&(C(n[d]),S(!0)):A==="d"&&h==="verbs"?n.length>1&&(i(I=>{I.thinkingVerbs.verbs=I.thinkingVerbs.verbs.filter((U,H)=>H!==d)}),d>=n.length-1&&m(Math.max(0,n.length-2))):A==="n"&&h==="verbs"?(M(!0),C("")):N.ctrl&&A==="r"&&h==="verbs"&&(i(I=>{I.thinkingVerbs.verbs=[...q.thinkingVerbs.verbs]}),m(0))});const Z=50;return g(u,{children:[g(u,{flexDirection:"column",width:`${100-Z}%`,children:[g(u,{marginBottom:1,flexDirection:"column",children:[o(fe,{children:"Thinking Verbs"}),g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:h==="format"?"enter to edit format":"changes auto-saved"}),o(l,{dimColor:!0,children:"esc to go back"}),o(l,{dimColor:!0,children:"tab to switch sections"})]})]}),o(u,{marginBottom:1,children:o(l,{dimColor:!0,children:"Customize the verbs shown during generation and their format."})}),g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:h==="format"?"yellow":void 0,children:h==="format"?"❯ ":" "}),o(l,{bold:!0,color:h==="format"?"yellow":void 0,children:"Format"})]}),h==="format"&&(F?g(l,{dimColor:!0,children:[" ","enter to save"]}):g(l,{dimColor:!0,children:[" ","enter to edit"]}))]}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:F?"yellow":"gray",children:o(l,{children:F?Y:t})})}),o(u,{children:g(l,{children:[o(l,{color:h==="verbs"?"yellow":void 0,children:h==="verbs"?"❯ ":" "}),o(l,{bold:!0,color:h==="verbs"?"yellow":void 0,children:"Verbs"})]})}),h==="verbs"&&o(u,{flexDirection:"column",children:g(l,{dimColor:!0,children:[" ","e to edit · d to delete · n to add new · ctrl+r to reset"]})}),o(u,{marginLeft:2,marginBottom:1,children:g(u,{flexDirection:"column",children:[(()=>{const N=Math.max(0,d-Math.floor(4)),I=Math.min(n.length,N+8),U=Math.max(0,I-8),H=n.slice(U,I);return g(ce,{children:[U>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",U," more above"]}),H.map((ee,G)=>{const x=U+G;return g(l,{color:h==="verbs"&&x===d?"cyan":void 0,children:[h==="verbs"&&x===d?"❯ ":" ",ee]},x)}),I<n.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",n.length-I," more below"]})]})})(),$&&g(u,{alignItems:"center",children:[o(l,{color:"yellow",children:"❯ "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:v})})]}),f&&g(u,{marginTop:1,alignItems:"center",children:[o(l,{children:"Editing: "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:v})})]})]})})]}),g(u,{width:`${Z}%`,flexDirection:"column",children:[o(u,{marginBottom:1,children:o(l,{bold:!0,children:"Preview"})}),o(u,{borderStyle:"single",borderColor:"gray",padding:1,flexDirection:"column",children:g(l,{children:[g(l,{color:z,children:["✻ ",t.replace(/\{\}/g,n[d])," "]}),o(l,{children:"(esc to interrupt)"})]})})]})]})}const we=[{name:"Default",phases:q.thinkingStyle.phases,reverseMirror:q.thinkingStyle.reverseMirror},{name:"Basic",phases:["|","/","-","\\"],reverseMirror:!1},{name:"Braille",phases:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],reverseMirror:!1},{name:"Circle",phases:["◐","◓","◑","◒"],reverseMirror:!1},{name:"Wave",phases:["▁","▃","▄","▅","▆","▇","█"],reverseMirror:!0},{name:"Glow",phases:["░","▒","▓","█"],reverseMirror:!0},{name:"Partial block",phases:["▏","▎","▍","▌","▋","▊","▉","█"],reverseMirror:!0},{name:"Clock",phases:["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"],reverseMirror:!1},{name:"Globe",phases:["🌍","🌎","🌏"],reverseMirror:!1},{name:"Arc",phases:["◜","◠","◝","◞","◡","◟"],reverseMirror:!1},{name:"Triangle",phases:["◤","◥","◢","◣"],reverseMirror:!1},{name:"Bouncing",phases:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"],reverseMirror:!1},{name:"Dots",phases:[".","..","..."],reverseMirror:!1},{name:"Colors",phases:["🔴","🟠","🟡","🟢","🔵","🟣"],reverseMirror:!1}];function ct({onBack:e}){const{settings:{thinkingStyle:{phases:t,updateInterval:n,reverseMirror:r},themes:i},updateSettings:s}=pe(he),a=["reverseMirror","updateInterval","phases","presets"],[c,h]=T(0),d=a[c],[m,f]=T(0),[S,v]=T(0),[C,$]=T(!1),[M,F]=T(""),[B,Y]=T(!1),[j,V]=T(!1),[te,z]=T(n.toString()),[Z,A]=T(0),N=Le(),U=(i.find(b=>b.id===N)||i.find(b=>b.id==="dark"))?.colors.claude||"rgb(215,119,87)";ae(()=>{if(t.length>0){const b=r?[...t,...[...t].reverse().slice(1,-1)]:t,k=setInterval(()=>{A(p=>(p+1)%b.length)},n);return()=>clearInterval(k)}},[t,n,r]),ge((b,k)=>{if(j){if(k.return){const p=parseInt(te);!isNaN(p)&&p>0&&s(y=>{y.thinkingStyle.updateInterval=p}),V(!1)}else k.escape?(z(n.toString()),V(!1)):k.backspace||k.delete?z(p=>p.slice(0,-1)):b&&b.match(/^[0-9]$/)&&z(p=>p+b);return}if(C||B){if(k.return&&M.length){const p=B?[...t,M]:t.map((y,O)=>O===m?M:y);s(y=>{y.thinkingStyle.phases=p}),$(!1),F("")}else k.escape?(F(""),$(!1),Y(!1)):k.backspace||k.delete?F(p=>p.slice(0,-1)):b&&F(p=>p+b);return}if(k.escape)e();else if(k.return)if(d==="updateInterval")z(n.toString()),V(!0);else if(d==="presets"){const p=we[S];s(y=>{y.thinkingStyle.phases=[...p.phases],y.thinkingStyle.reverseMirror=p.reverseMirror})}else d==="reverseMirror"&&s(p=>{p.thinkingStyle.reverseMirror=!p.thinkingStyle.reverseMirror});else if(k.tab)k.shift?h(p=>p===0?a.length-1:p-1):h(p=>p===a.length-1?0:p+1);else if(k.upArrow)d==="phases"&&t.length>0?f(p=>p>0?p-1:t.length-1):d==="presets"&&v(p=>p>0?p-1:we.length-1);else if(k.downArrow)d==="phases"&&t.length>0?f(p=>p<t.length-1?p+1:0):d==="presets"&&v(p=>p<we.length-1?p+1:0);else if(b===" ")d==="reverseMirror"&&s(p=>{p.thinkingStyle.reverseMirror=!p.thinkingStyle.reverseMirror});else if(b==="e"&&d==="phases")t.length>0&&(F(t[m]),$(!0));else if(b==="a"&&d==="phases")Y(!0),F("");else if(b==="d"&&d==="phases")t.length>1&&(s(p=>{p.thinkingStyle.phases=t.filter((y,O)=>O!==m)}),m>=t.length&&f(Math.max(0,t.length-1)));else if(b==="w"&&d==="phases"){if(m>0){const p=[...t];[p[m-1],p[m]]=[p[m],p[m-1]],s(y=>{y.thinkingStyle.phases=p}),f(y=>y-1)}}else if(b==="s"&&d==="phases"){if(m<t.length-1){const p=[...t];[p[m],p[m+1]]=[p[m+1],p[m]],s(y=>{y.thinkingStyle.phases=p}),f(y=>y+1)}}else k.ctrl&&b==="r"&&(s(p=>{p.thinkingStyle=q.thinkingStyle}),f(0),v(0))});const H=r?"●":"○",ee=50,x=r?[...t,...[...t].reverse().slice(1,-1)]:t,w=x.length>0?x[Z]:"·";return o(u,{children:g(u,{flexDirection:"column",width:"100%",children:[g(u,{flexDirection:"row",width:"100%",children:[g(u,{marginBottom:1,flexDirection:"column",width:`${100-ee}%`,children:[o(fe,{children:"Thinking style"}),g(u,{flexDirection:"column",children:[g(l,{dimColor:!0,children:["enter to"," ",d==="updateInterval"?"edit interval":d==="presets"?"apply preset":"save"]}),o(l,{dimColor:!0,children:"esc to go back"}),o(l,{dimColor:!0,children:"tab to switch sections"})]})]}),g(u,{width:`${ee}%`,flexDirection:"column",children:[o(u,{children:o(l,{bold:!0,children:"Preview"})}),g(u,{borderStyle:"single",borderColor:"gray",paddingX:1,flexDirection:"row",children:[o(u,{width:(w?.length??0)+1,children:o(l,{color:U,children:w})}),g(l,{children:[o(l,{color:U,children:"Thinking… "}),o(l,{children:"(esc to interrupt)"})]})]})]})]}),g(u,{flexDirection:"row",gap:4,children:[g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:d==="reverseMirror"?"yellow":void 0,children:d==="reverseMirror"?"❯ ":" "}),o(l,{bold:!0,color:d==="reverseMirror"?"yellow":void 0,children:"Reverse-mirror phases"})]}),d==="reverseMirror"&&g(l,{dimColor:!0,children:[" ","space to toggle"]}),o(u,{marginLeft:2,marginBottom:1,children:g(l,{children:[H," ",r?"Enabled":"Disabled"]})})]}),g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:d==="updateInterval"?"yellow":void 0,children:d==="updateInterval"?"❯ ":" "}),o(l,{bold:!0,color:d==="updateInterval"?"yellow":void 0,children:"Update interval (ms)"})]}),d==="updateInterval"&&(j?g(l,{dimColor:!0,children:[" ","enter to save"]}):g(l,{dimColor:!0,children:[" ","enter to edit"]})),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:j?"yellow":"gray",children:o(l,{children:j?te:n})})})]})]}),o(u,{children:g(l,{children:[o(l,{color:d==="phases"?"yellow":void 0,children:d==="phases"?"❯ ":" "}),o(l,{bold:!0,color:d==="phases"?"yellow":void 0,children:"Phases"})]})}),d==="phases"&&o(u,{marginBottom:1,flexDirection:"column",children:g(l,{dimColor:!0,children:[" ","[e]dit"," ","[a]dd"," ","[d]elete"," ","[w]move up"," ","[s]move down"]})}),o(u,{marginLeft:2,marginBottom:1,children:g(u,{flexDirection:"column",children:[(()=>{const k=Math.max(0,m-Math.floor(4)),p=Math.min(t.length,k+8),y=Math.max(0,p-8),O=t.slice(y,p);return g(ce,{children:[y>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",y," more above"]}),O.map((_,L)=>{const ne=y+L;return g(l,{color:d==="phases"&&ne===m?"cyan":void 0,children:[d==="phases"&&ne===m?"❯ ":" ",_]},ne)}),p<t.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",t.length-p," more below"]})]})})(),B&&g(u,{children:[o(l,{color:"yellow",children:"❯ "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:M})})]}),C&&g(u,{marginTop:1,children:[o(l,{children:"Editing: "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:M})})]})]})}),o(u,{children:g(l,{children:[o(l,{color:d==="presets"?"yellow":void 0,children:d==="presets"?"❯ ":" "}),o(l,{bold:!0,color:d==="presets"?"yellow":void 0,children:"Presets"})]})}),d==="presets"&&g(l,{dimColor:!0,children:[" ","Selecting one will overwrite your choice of phases"]}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{flexDirection:"column",children:(()=>{const k=Math.max(0,S-Math.floor(4)),p=Math.min(we.length,k+8),y=Math.max(0,p-8),O=we.slice(y,p);return g(ce,{children:[y>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",y," more above"]}),O.map((_,L)=>{const ne=y+L;return g(l,{color:d==="presets"&&ne===S?"cyan":void 0,children:[d==="presets"&&ne===S?"❯ ":" ",_.name," ",_.phases.join("")]},ne)}),p<we.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",we.length-p," more below"]})]})})()})}),o(u,{marginTop:1,children:o(l,{dimColor:!0,children:"ctrl+r to reset all settings to default"})})]})})}const Ce=[{label:"bold",value:"bold"},{label:"italic",value:"italic"},{label:"underline",value:"underline"},{label:"strikethrough",value:"strikethrough"},{label:"inverse",value:"inverse"}];function dt({onBack:e}){const{settings:t,updateSettings:n}=pe(he),[r,i]=T("prefix"),[s,a]=T(0),[c,h]=T(!1),[d,m]=T(()=>t.userMessageDisplay.prefix.format),[f,S]=T(0),[v,C]=T(()=>[...t.userMessageDisplay.prefix.styling]),[$,M]=T(()=>t.userMessageDisplay.prefix.foreground_color),[F,B]=T(()=>t.userMessageDisplay.prefix.background_color),[Y,j]=T(0),[V,te]=T(0),[z,Z]=T(()=>[...t.userMessageDisplay.message.styling]),[A,N]=T(()=>t.userMessageDisplay.message.foreground_color),[I,U]=T(()=>t.userMessageDisplay.message.background_color),[H,ee]=T(null),[G,x]=T(""),w=Le(),b=t.themes?.find(P=>P.id===w)||t.themes?.[0],k=["format","styling","foreground","background"],p=["styling","foreground","background"],y=k[s],O=p[Y],_=(P,E)=>{n(D=>{const K=P==="prefix"?D.userMessageDisplay.prefix:D.userMessageDisplay.message;E(K)})},L=P=>{n(E=>{P==="prefix"?E.userMessageDisplay.prefix={...q.userMessageDisplay.prefix}:E.userMessageDisplay.message={...q.userMessageDisplay.message}}),P==="prefix"?(m(q.userMessageDisplay.prefix.format),C([...q.userMessageDisplay.prefix.styling]),M(q.userMessageDisplay.prefix.foreground_color),B(q.userMessageDisplay.prefix.background_color)):(Z([...q.userMessageDisplay.message.styling]),N(q.userMessageDisplay.message.foreground_color),U(q.userMessageDisplay.message.background_color))};ae(()=>{const P=t.userMessageDisplay.prefix;m(P.format),C([...P.styling]),M(P.foreground_color),B(P.background_color);const E=t.userMessageDisplay.message;Z([...E.styling]),N(E.foreground_color),U(E.background_color)},[]),ge((P,E)=>{if(c){if(E.return)_("prefix",D=>{D.format=d}),h(!1);else if(E.escape){const D=t.userMessageDisplay.prefix;m(D.format),h(!1)}else E.backspace||E.delete?m(D=>D.slice(0,-1)):P&&m(D=>D+P);return}if(H===null){if(E.escape)e();else if(E.ctrl&&P==="r")L(r);else if(E.leftArrow||E.rightArrow)i(D=>D==="prefix"?"message":"prefix");else if(E.tab)r==="prefix"?E.shift?a(D=>D===0?k.length-1:D-1):a(D=>D===k.length-1?0:D+1):E.shift?j(D=>D===0?p.length-1:D-1):j(D=>D===p.length-1?0:D+1);else if(E.return)r==="prefix"?y==="format"?h(!0):y==="foreground"?(x($),ee({column:"prefix",type:"foreground"})):y==="background"&&(x(F),ee({column:"prefix",type:"background"})):O==="foreground"?(x(A),ee({column:"message",type:"foreground"})):O==="background"&&(x(I),ee({column:"message",type:"background"}));else if(E.upArrow)r==="prefix"&&y==="styling"?S(D=>Math.max(0,D-1)):r==="message"&&O==="styling"&&te(D=>Math.max(0,D-1));else if(E.downArrow)r==="prefix"&&y==="styling"?S(D=>Math.min(Ce.length-1,D+1)):r==="message"&&O==="styling"&&te(D=>Math.min(Ce.length-1,D+1));else if(P===" "){if(r==="prefix"&&y==="styling"){const D=Ce[f].value,K=v.indexOf(D)>=0?v.filter(W=>W!==D):[...v,D];C(K),_("prefix",W=>{W.styling=[...K]})}else if(r==="message"&&O==="styling"){const D=Ce[V].value,K=z.indexOf(D)>=0?z.filter(W=>W!==D):[...z,D];Z(K),_("message",W=>{W.styling=[...K]})}}}});const ne=(P,E,D=!0)=>{const K=D?E==="prefix"?v:z:[],W=D?E==="prefix"?$:A:"rgb(255,255,255)",ve=D?E==="prefix"?F:I:"rgb(0,0,0)",Ie=W==="rgb(0,0,0)"&&ve==="rgb(0,0,0)",Be=K.length>0;return Ie&&!Be?o(l,{children:P}):o(l,{bold:K.includes("bold"),italic:K.includes("italic"),underline:K.includes("underline"),strikethrough:K.includes("strikethrough"),inverse:K.includes("inverse"),color:Ie?void 0:W,backgroundColor:Ie?void 0:ve,children:P})},le=(P=!0)=>g(l,{children:[d&&g(ce,{children:[ne(d,"prefix",P)," "]}),ne("list the dir","message",P)]}),se=P=>{const E=r===P,W=(P==="prefix"?k:p)[P==="prefix"?s:Y],ve=P==="prefix"?f:V,Ie=P==="prefix"?v:z,Be=P==="prefix"?$:A,qe=P==="prefix"?F:I;return g(u,{flexDirection:"column",width:"45%",borderStyle:E?"round":"single",borderColor:E?"yellow":"gray",padding:1,children:[o(u,{marginBottom:1,children:g(l,{bold:!0,color:E?"yellow":void 0,children:[P.charAt(0).toUpperCase()+P.slice(1)," ","Configuration"]})}),P==="prefix"&&g(ce,{children:[o(u,{children:g(l,{color:E&&W==="format"?"yellow":void 0,bold:E&&W==="format",children:[E&&W==="format"?"❯ ":" ","Prefix Text"]})}),E&&W==="format"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:c?"enter to save":"enter to edit (appears before message)"})}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:c?"yellow":"gray",children:o(l,{children:d})})})]}),o(u,{children:g(l,{color:E&&W==="styling"?"yellow":void 0,bold:E&&W==="styling",children:[E&&W==="styling"?"❯ ":" ","Styling"]})}),E&&W==="styling"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:"up/down to navigate · space to toggle"})}),o(u,{marginLeft:2,marginBottom:1,flexDirection:"column",children:Ce.map((Pe,Ze)=>o(u,{children:g(l,{color:E&&W==="styling"&&ve===Ze?"cyan":void 0,children:[E&&W==="styling"&&ve===Ze?"❯ ":" ",Ie.includes(Pe.value)?"●":"○"," ",Pe.label]})},Pe.value))}),o(u,{children:g(l,{color:E&&W==="foreground"?"yellow":void 0,bold:E&&W==="foreground",children:[E&&W==="foreground"?"❯ ":" ","Foreground color"]})}),E&&W==="foreground"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:"enter to open color picker"})}),o(u,{marginLeft:2,marginBottom:1,children:o(l,{color:Be,children:Be})}),o(u,{children:g(l,{color:E&&W==="background"?"yellow":void 0,bold:E&&W==="background",children:[E&&W==="background"?"❯ ":" ","Background color"]})}),E&&W==="background"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:"enter to open color picker"})}),o(u,{marginLeft:2,children:o(l,{backgroundColor:qe,children:qe})})]})};if(H){const{column:P,type:E}=H;return o(Nn,{initialValue:G,theme:b,onColorChange:D=>{P==="prefix"?E==="foreground"?(M(D),_("prefix",K=>{K.foreground_color=D})):(B(D),_("prefix",K=>{K.background_color=D})):E==="foreground"?(N(D),_("message",K=>{K.foreground_color=D})):(U(D),_("message",K=>{K.background_color=D}))},onExit:()=>{ee(null),x("")}})}return g(u,{flexDirection:"column",children:[o(fe,{children:"Customize how user messages are displayed"}),g(u,{flexDirection:"column",marginBottom:1,children:[o(l,{dimColor:!0,children:"left/right arrows to switch columns · tab to navigate options"}),o(l,{dimColor:!0,children:"enter to edit · ctrl+r to reset active column · esc to go back"})]}),g(u,{flexDirection:"row",gap:1,children:[se("prefix"),se("message")]}),o(u,{borderStyle:"round",padding:1,marginTop:1,children:g(u,{flexDirection:"column",children:[o(u,{marginBottom:1,children:o(l,{bold:!0,children:"Preview"})}),g(u,{flexDirection:"row",gap:2,children:[g(u,{flexDirection:"column",width:"50%",children:[o(u,{marginBottom:1,children:o(l,{underline:!0,children:"Before (Claude Code default):"})}),o(u,{marginLeft:1,marginTop:1,children:g(l,{children:[o(l,{color:b?.colors?.inactive||"#888888",children:"●"}),o(l,{children:" The directory "}),o(l,{color:b?.colors?.permission||"#00ff00",children:"C:\\Users\\user"}),o(l,{children:" contains "}),o(l,{bold:!0,children:"123"}),o(l,{children:" files."})]})})]}),g(u,{flexDirection:"column",width:"50%",children:[o(u,{marginBottom:1,children:o(l,{underline:!0,children:"After (Your customization):"})}),o(u,{marginLeft:1,children:le(!0)}),o(u,{marginLeft:1,marginTop:1,children:g(l,{children:[o(l,{color:b?.colors?.inactive||"#888888",children:"●"}),o(l,{children:" The directory "}),o(l,{color:b?.colors?.permission||"#00ff00",children:"C:\\Users\\user"}),o(l,{children:" contains "}),o(l,{bold:!0,children:"123"}),o(l,{children:" files."})]})})]})]})]})})]})}function gt({onSubmit:e}){const{settings:t,updateSettings:n}=pe(he),[r,i]=T(0),s=()=>{n(c=>{c.inputBox||(c.inputBox={removeBorder:!1}),c.inputBox.removeBorder=!c.inputBox.removeBorder})};ge((c,h)=>{h.return||h.escape?e():c===" "&&r===0&&s()});const a=t.inputBox?.removeBorder?"☑":"☐";return g(u,{flexDirection:"column",children:[o(u,{marginBottom:1,children:o(fe,{children:"Input Box Settings"})}),o(u,{marginBottom:1,children:g(l,{color:"gray",children:[o(l,{bold:!0,children:"Customize the appearance of the Claude Code input box."})," ",o(l,{dimColor:!0,children:"Press space to toggle settings, enter to go back."})]})}),o(u,{children:g(l,{children:[o(l,{color:r===0?"cyan":void 0,children:r===0?"❯ ":" "}),o(l,{bold:!0,color:r===0?"cyan":void 0,children:"Remove border"})]})}),r===0&&o(u,{marginBottom:1,flexDirection:"column",children:g(l,{dimColor:!0,children:[" ","space to toggle"]})}),o(u,{marginLeft:2,marginBottom:1,children:g(l,{children:[a," ",t.inputBox?.removeBorder?"Enabled":"Disabled"]})}),o(u,{marginBottom:1,children:o(l,{color:"gray",dimColor:!0,children:"When enabled, removes the rounded border around the input box for a cleaner look."})})]})}const he=On({settings:q,updateSettings:e=>{},changesApplied:!1,ccVersion:""});function ht({startupCheckInfo:e}){const[t,n]=T({settings:q,changesApplied:!1,ccVersion:"",lastModified:"",ccInstallationDir:null});ae(()=>{(async()=>{n(await Xe())})()},[]);const r=gn(m=>{const f=JSON.parse(JSON.stringify(t.settings));m(f),n(S=>({...S,settings:f,changesApplied:!1})),Ae(S=>{S.settings=f,S.changesApplied=!1})},[t.settings]),[i,s]=T(null),[a,c]=T(null);ae(()=>{e.wasUpdated&&e.oldVersion&&(c({message:`Your Claude Code installation was updated from ${e.oldVersion} to ${e.newVersion}, and the patching was likely overwritten
|
|
190
|
+
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝`,r=e.indexOf(t);return r!==-1?{startIndex:r-1,endIndex:r+t.length+1}:null}function Sn(e,t){const r=_n(e);if(!r)return e;const n=JSON.stringify(t),i=e.slice(0,r.startIndex)+n+e.slice(r.endIndex);return Q(e,i,n,r.startIndex,r.endIndex),i}const yn=e=>{const t=/\b[$\w]+\(\(\)=>\{if\(![$\w]+\)\{[$\w]+\(\d+\);return\}[$\w]+\(\([^)]+\)=>[^)]+\+1\)\},\d+\)/,r=e.match(t);if(!r||r.index===void 0)return console.error("patch: spinner no-freeze: failed to find wholeMatch"),null;const n=/if\(![$\w]+\)\{[$\w]+\(\d+\);return\}/,i=r[0].match(n);if(!i||i.index===void 0)return console.error("patch: spinner no-freeze: failed to find freeze condition"),null;const s=r.index+i.index,a=s+i[0].length;return{startIndex:s,endIndex:a}},vn=e=>{const t=yn(e);if(!t)return null;const r=e.slice(0,t.startIndex)+e.slice(t.endIndex);return Q(e,r,"",t.startIndex,t.endIndex),r},In=e=>{const t=/spinnerTip:[$\w]+,(?:[$\w]+:[$\w]+,)*overrideMessage:[$\w]+,.{300}/,r=e.match(t);if(!r||r.index==null)return console.error("patch: thinker format: failed to find approxAreaMatch"),null;const n=e.slice(r.index,r.index+600),i=/([$\w]+)(=\(([^;]{1,200}?)\)\+"…")/,s=n.match(i);return!s||s.index==null?(console.error("patch: thinker format: failed to find formatMatch"),null):{startIndex:r.index+s.index+s[1].length,endIndex:r.index+s.index+s[1].length+s[2].length,identifiers:[s[3]]}},Cn=(e,t)=>{const r=In(e);if(!r)return null;const n=r,i=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),s=n.identifiers?.[0],c=`=${"`"+i.replace(/\{\}/g,"${"+s+"}")+"`"}`,h=e.slice(0,n.startIndex)+c+e.slice(n.endIndex);return Q(e,h,c,n.startIndex,n.endIndex),h},$n=e=>{const t=/=\s*\[\.\.\.([$\w]+),\s*\.\.\.?\[\.\.\.\1\]\.reverse\(\)\]/,r=e.match(t);return!r||r.index==null?(console.error("patch: thinker symbol mirror option: failed to find match"),null):{startIndex:r.index,endIndex:r.index+r[0].length,identifiers:[r[1]]}},Nn=(e,t)=>{const r=$n(e);if(!r)return null;const n=r.identifiers?.[0],i=t?`=[...${n},...[...${n}].reverse()]`:`=[...${n}]`,s=e.slice(0,r.startIndex)+i+e.slice(r.endIndex);return Q(e,s,i,r.startIndex,r.endIndex),s},Mn=e=>{const t=[],r=/\["[·✢*✳✶✻✽]",\s*(?:"[·✢*✳✶✻✽]",?\s*)+\]/g;let n;for(;(n=r.exec(e))!==null;)t.push({startIndex:n.index,endIndex:n.index+n[0].length});return t},Bn=(e,t)=>{const r=Mn(e);if(r.length===0)return null;const n=JSON.stringify(t),i=r.sort((a,c)=>c.startIndex-a.startIndex);let s=e;for(let a=0;a<i.length;a++){const c=s.slice(0,i[a].startIndex)+n+s.slice(i[a].endIndex);Q(s,c,n,i[a].startIndex,i[a].endIndex),s=c}return s},kn=e=>{const t=/[, ][$\w]+\(\(\)=>\{if\(![$\w]+\)\{[$\w]+\(\d+\);return\}[$\w]+\(\([^)]+\)=>[^)]+\+1\)\},(\d+)\)/,r=e.match(t);if(!r||r.index==null)return console.error("patch: thinker symbol speed: failed to find match"),null;const n=r[0],i=r[1],s=n.lastIndexOf(i),a=r.index+s,c=a+i.length;return{startIndex:a,endIndex:c}},On=(e,t)=>{const r=kn(e);if(!r)return null;const n=JSON.stringify(t),i=e.slice(0,r.startIndex)+n+e.slice(r.endIndex);return Q(e,i,n,r.startIndex,r.endIndex),i},Tn=e=>{const t=/\{flexWrap:"wrap",height:1,width:2\}/,r=e.match(t);return!r||r.index==null?(console.error("patch: thinker symbol width: failed to find match"),null):{startIndex:r.index,endIndex:r.index+r[0].length}},En=(e,t)=>{const r=Tn(e);if(!r)return null;const n=`{flexWrap:"wrap",height:1,width:${t}}`,i=e.slice(0,r.startIndex)+n+e.slice(r.endIndex);return Q(e,i,n,r.startIndex,r.endIndex),i},An=e=>{const t=/[, ]([$\w]+)=\{words:\[(?:"[^"{}()]+ing",)+"[^"{}()]+ing"\]\}/s,r=e.match(t);return!r||r.index==null?(console.error("patch: thinker verbs: failed to find verbsMatch"),null):{startIndex:r.index+1,endIndex:r.index+r[0].length,identifiers:[r[1]]}},Dn=e=>{const t=/function ([$\w]+)\(\)\{return [$\w]+\("tengu_spinner_words",[$\w]+\)\.words\}/,r=e.match(t);return!r||r.index==null?(console.error("patch: thinker verbs: failed to find match"),null):{startIndex:r.index,endIndex:r.index+r[0].length,identifiers:[r[1]]}},Ln=(e,t)=>{const r=An(e);if(!r)return null;const n=r,i=n.identifiers?.[0],s=`${i}=${JSON.stringify({words:t})}`,a=e.slice(0,n.startIndex)+s+e.slice(n.endIndex);Q(e,a,s,n.startIndex,n.endIndex);const c=Dn(a);if(!c)return null;const h=c,m=`function ${h.identifiers?.[0]}(){return ${i}.words}`,f=a.slice(0,h.startIndex)+m+a.slice(h.endIndex);return Q(a,f,m,h.startIndex,h.endIndex),f},Rn=e=>{const t=e.indexOf("No content found in user prompt message")-700;if(t===-1)return console.error("patch: userMessageDisplay: failed to find error message"),null;const r=Math.min(e.length,t+700),n=e.slice(t,r),i=/("> "),([$\w]+)/,s=n.match(i);if(!s)return{prefixLocation:null,messageLocation:null};const a=t+n.indexOf(s[1]),c=a+s[1].length,h=c+1,d=h+s[2].length;return{prefixLocation:{startIndex:a,endIndex:c},messageLocation:{startIndex:h,endIndex:d}}},Pn=(e,t,r,n,i=!1,s=!1,a=!1,c=!1,h=!1,d,m,f=!1,_=!1,v=!1,C=!1,$=!1)=>{const N=Rn(e);if(!N)return console.error("patch: userMessageDisplay: getUserMessageDisplayLocation returned null"),null;if(!N.prefixLocation)return console.error("patch: userMessageDisplay: failed to find prefix location"),null;if(!N.messageLocation)return console.error("patch: userMessageDisplay: failed to find message location"),null;const F=Sr(e);if(!F)return console.error("patch: userMessageDisplay: failed to find chalk variable"),null;const B=[],Y=r==="rgb(0,0,0)"&&n==="rgb(0,0,0)",V=!Y||(i||s||a||c||h),te=d==="rgb(0,0,0)"&&m==="rgb(0,0,0)",Z=!te||(f||_||v||C||$);if(V){const M=cr(F,Y?null:r.match(/\d+/g)?.join(",")||null,Y?null:n.match(/\d+/g)?.join(",")||null,i,s,a,c,h);B.push({startIndex:N.prefixLocation.startIndex,endIndex:N.prefixLocation.endIndex,newContent:`${M}("${t}")+" "`})}if(Z){const M=cr(F,te?null:d.match(/\d+/g)?.join(",")||null,te?null:m.match(/\d+/g)?.join(",")||null,f,_,v,C,$);B.push({startIndex:N.messageLocation.startIndex,endIndex:N.messageLocation.endIndex,newContent:e.slice(N.messageLocation.startIndex,N.messageLocation.endIndex).replace(/([$\w]+)/,`${M}($1)`)})}B.sort((M,I)=>I.startIndex-M.startIndex);let A=e;for(const M of B){const I=A;A=A.slice(0,M.startIndex)+M.newContent+A.slice(M.endIndex),Q(I,A,M.newContent,M.startIndex,M.endIndex)}return A},Fn=e=>{const t=/createElement\([$\w]+,\{[^}]+spinnerTip[^}]+overrideMessage[^}]+\}/,r=e.match(t);if(!r||r.index===void 0)return console.error("patch: verbose: failed to find createElement with spinnerTip and overrideMessage"),null;const n=r[0],i=/verbose:[^,}]+/,s=n.match(i);if(!s||s.index===void 0)return console.error("patch: verbose: failed to find verbose property"),null;const a=r.index+s.index,c=a+s[0].length;return{startIndex:a,endIndex:c}},Vn=e=>{const t=Fn(e);if(!t)return null;const r="verbose:true",n=e.slice(0,t.startIndex)+r+e.slice(t.endIndex);return Q(e,n,r,t.startIndex,t.endIndex),n},Un=e=>{const r=e.indexOf("subscription, no need to monitor cost");if(r===-1)return console.error("patch: ignoreMaxSubscription: phrase not found"),null;const n=Math.max(0,r-60),i=r,s=e.slice(n,i),a=/if\(([$\w]+)\(\)\)/g;let c=null;for(const m of s.matchAll(a))c=m;if(!c||c.index===void 0)return console.error("patch: ignoreMaxSubscription: could not match if(<id>()) nearby"),null;const h=n+c.index,d=h+c[0].length;return{startIndex:h,endIndex:d}},jn=e=>{const t=Un(e);if(!t)return null;const r="if(!1)",n=e.slice(0,t.startIndex)+r+e.slice(t.endIndex);return Q(e,n,r,t.startIndex,t.endIndex),n},Gn=e=>{const t=/\}\.VERSION\} \(Claude Code\)/,r=e.match(t);if(!r||r.index===void 0)return null;const n=/,([$\w]+)\.createElement\(([$\w]+),null,\1\.createElement\(([$\w]+),\{dimColor:!0\}," L "\),\1\.createElement\(\3,null,"Session ID: ",[$\w]+\(\)\)\)/,i=e.match(n);if(!i||i.index===void 0)return null;const s=i.index+i[0].length;return{versionLocation:{startIndex:r.index,endIndex:r.index+r[0].length},sessionIdLocation:{startIndex:s,endIndex:s,identifiers:[i[1],i[2],i[3]]}}},Hn=(e,t)=>{const r=Gn(e);if(!r)return null;const{versionLocation:n,sessionIdLocation:i}=r,a=`${e.slice(n.startIndex,n.endIndex)}\\n${t} (tweakcc)`,c=e.slice(0,n.startIndex)+a+e.slice(n.endIndex);Q(e,c,a,n.startIndex,n.endIndex);const[h,d,m]=i.identifiers,f=Sr(e);if(!f)return console.error("patch: versionOutput: failed to find chalk variable"),null;const _=`,${h}.createElement(${d},null,${h}.createElement(${m},{dimColor:!0}," L "),${h}.createElement(${m},null,${f}.rgb(235, 109, 13).bold("tweakcc: v${t}")))`,v=e.slice(0,i.startIndex)+_+e.slice(i.endIndex);return Q(e,v,_,i.startIndex,i.endIndex),v},Yn=async(e,t)=>{const r=await an(t);oe()&&console.log(`Loaded ${r.length} system prompts with regexes`);for(const{promptId:n,prompt:i,regex:s,getInterpolatedContent:a}of r){const c=new RegExp(s,"s"),h=e.match(c);if(h&&h.index!==void 0){const d=a(h);oe()&&(console.log(`
|
|
191
|
+
Found match for prompt: ${i.name}`),console.log(` Match location: index ${h.index}, length ${h[0].length}`),console.log(` Original content (first 100 chars): ${h[0].substring(0,100)}...`),console.log(` Replacement content (first 100 chars): ${d.substring(0,100)}...`),console.log(` Captured variables: ${h.slice(1).join(", ")}`),console.log(` Content identical: ${h[0]===d}`));const m=e,f=h.index,_=h[0].length;e=e.replace(c,d);const v=Ee(i.content);await Jr(n,v),oe()&&Q(m,e,d,f,f+_)}else if(console.log(X.yellow(`Could not find system prompt "${i.name}" in cli.js (using regex /${s}/)`)),oe()){console.log(`
|
|
192
|
+
Debug info for ${i.name}:`),console.log(` Regex pattern (first 200 chars): ${s.substring(0,200)}...`),console.log(" Trying to match pattern in cli.js...");const d=e.match(new RegExp(s.substring(0,100)));console.log(` Partial match result: ${d?"found partial":"no match"}`)}}return e},Q=(e,t,r,n,i)=>{const s=Math.max(0,n-20),a=Math.min(e.length,i+20),c=Math.min(t.length,n+r.length+20),h=e.slice(s,n),d=e.slice(n,i),m=e.slice(i,a),f=t.slice(s,n),_=t.slice(n,n+r.length),v=t.slice(n+r.length,c);oe()&&d!==_&&(console.log(`
|
|
193
|
+
--- Diff ---`),console.log("OLD:",h+`\x1B[31m${d}\x1B[0m`+m),console.log("NEW:",f+`\x1B[32m${_}\x1B[0m`+v),console.log(`--- End Diff ---
|
|
194
|
+
`))},Sr=e=>{const t=/\b([$\w]+)(?:\.(?:cyan|gray|green|red|yellow|ansi256|bgAnsi256|bgHex|bgRgb|hex|rgb|bold|dim|inverse|italic|strikethrough|underline)\b)+\(/g,r=Array.from(e.matchAll(t)),n={};for(const a of r){const c=a[1];n[c]=(n[c]||0)+1}let i,s=0;for(const[a,c]of Object.entries(n))c>s&&(s=c,i=a);return i},yr=async(e,t)=>{await xr(t);let r=await ne.readFile(t.cliPath,{encoding:"utf8"});r=await Yn(r,t.version);let n=null;if(e.settings.themes&&e.settings.themes.length>0&&(n=fn(r,e.settings.themes))&&(r=n),e.settings.launchText){const i=e.settings.launchText;let s="";i.method==="custom"&&i.customText?s=i.customText:i.method==="figlet"&&i.figletText&&(s=await new Promise(a=>Ge.text(i.figletText.replace(`
|
|
195
|
+
`," "),i.figletFont,(c,h)=>{c?(console.error("patch: figlet: failed to generate text",c),a("")):a(h||"")}))),(n=Sn(r,s))&&(r=n)}return e.settings.thinkingVerbs&&((n=Ln(r,e.settings.thinkingVerbs.verbs))&&(r=n),(n=Cn(r,e.settings.thinkingVerbs.format))&&(r=n)),(n=Bn(r,e.settings.thinkingStyle.phases))&&(r=n),(n=On(r,e.settings.thinkingStyle.updateInterval))&&(r=n),(n=En(r,Math.max(...e.settings.thinkingStyle.phases.map(i=>i.length))+1))&&(r=n),(n=Nn(r,e.settings.thinkingStyle.reverseMirror))&&(r=n),e.settings.userMessageDisplay&&(n=Pn(r,e.settings.userMessageDisplay.prefix.format,e.settings.userMessageDisplay.prefix.foreground_color,e.settings.userMessageDisplay.prefix.background_color,e.settings.userMessageDisplay.prefix.styling.includes("bold"),e.settings.userMessageDisplay.prefix.styling.includes("italic"),e.settings.userMessageDisplay.prefix.styling.includes("underline"),e.settings.userMessageDisplay.prefix.styling.includes("strikethrough"),e.settings.userMessageDisplay.prefix.styling.includes("inverse"),e.settings.userMessageDisplay.message.foreground_color,e.settings.userMessageDisplay.message.background_color,e.settings.userMessageDisplay.message.styling.includes("bold"),e.settings.userMessageDisplay.message.styling.includes("italic"),e.settings.userMessageDisplay.message.styling.includes("underline"),e.settings.userMessageDisplay.message.styling.includes("strikethrough"),e.settings.userMessageDisplay.message.styling.includes("inverse")))&&(r=n),e.settings.inputBox&&typeof e.settings.inputBox.removeBorder=="boolean"&&(n=xn(r,e.settings.inputBox.removeBorder))&&(r=n),(n=Vn(r))&&(r=n),(n=vn(r))&&(r=n),(n=pn(r))&&(r=n),(n=Kn(r))&&(r=n),(n=un(r,25))&&(r=n),(n=jn(r))&&(r=n),(n=Hn(r,"2.0.3"))&&(r=n),await Cr(t.cliPath,r,"patch"),await Ae(i=>{i.changesApplied=!0})},De=[{label:"Opus 4.1",slug:"opus-4.1",internal:"claude-opus-4-1-20250805"},{label:"Opus 4",slug:"opus-4",internal:"claude-opus-4-20250514"},{label:"Sonnet 4",slug:"sonnet-4",internal:"claude-sonnet-4-20250514"},{label:"Sonnet 3.7",slug:"sonnet-3.7",internal:"claude-3-7-sonnet-20250219"},{label:"Sonnet 3.5 (October)",slug:"sonnet-3.5-october",internal:"claude-3-5-sonnet-20241022"},{label:"Sonnet 3.5 (June)",slug:"sonnet-3.5-june",internal:"claude-3-5-sonnet-20240620"},{label:"Haiku 3.5",slug:"haiku-3.5",internal:"claude-3-5-haiku-20241022"},{label:"Haiku 3",slug:"haiku-3",internal:"claude-3-haiku-20240307"},{label:"Opus 3",slug:"opus-3",internal:"claude-3-opus-20240229"}],Wn=e=>{const t=e.indexOf("Switch between Claude models");if(t===-1)return null;const r=Math.max(0,t-600),n=t,s=e.slice(r,n).match(/\[[$\w]+,\s*[$\w]+\]\s*=\s*[$\w]+\.useState\([^)]*\)\s*,\s*([$\w]+)=/);if(!s||s.index===void 0)return null;let c=r+s.index;for(;c<e.length&&e[c]!==";";)c++;if(c>=e.length)return null;const h=c+1,d=s[1];return{insertionIndex:h,optionsVar:d}},zn=e=>{const t=Wn(e);if(!t)return null;const{insertionIndex:r,optionsVar:n}=t,i=De.map(a=>{const c=JSON.stringify(a.label),h=JSON.stringify(a.slug);return`${n}.push({value:${h},label:${c}});`}).join(""),s=e.slice(0,r)+i+e.slice(r);return Q(e,s,i,r,r),s},Jn=e=>{const t=e.match(/"sonnet\[1m\]"/);if(!t||t.index===void 0)return null;let n=t.index;for(;n>=0&&e[n]!=="[";)n--;if(n<0)return null;let i=n-1;for(;i>=0&&/\s/.test(e[i]);)i--;if(i<0||e[i]!=="=")return null;let s=n,a=0,c=-1;for(;s<e.length;){const C=e[s];if(C==="["&&a++,C==="]"&&(a--,a===0)){c=s;break}s++}if(c===-1)return null;const h=e.slice(n,c+1);let d;try{d=JSON.parse(h)}catch{return null}const m=De.map(C=>C.slug),f=new Set(d);for(const C of m)f.add(C);const _=JSON.stringify(Array.from(f)),v=e.slice(0,n)+_+e.slice(c+1);return Q(e,v,_,n,c+1),v},Xn=e=>{const r=e.indexOf('case"sonnet[1m]"');if(r===-1)return null;let n=r;for(;n>=0&&e[n]!=="{";)n--;if(n<0)return null;let i=r;for(;i<e.length&&e[i]!=="}";)i++;if(i>=e.length)return null;const s=e.slice(n,i+1),a=De.map(_=>`case${JSON.stringify(_.slug)}:return${JSON.stringify(_.internal)};`).join(""),c=s.slice(0,-1),d=(/;\s*$/.test(c)?"":";")+a,m=c+d+"}",f=e.slice(0,n)+m+e.slice(i+1);return Q(e,f,a,n+s.length-1,n+s.length-1),f},Kn=e=>{let t=e;const r=Jn(t);r&&(t=r);const n=Xn(t);n&&(t=n);const i=zn(t);return i&&(t=i),t===e?null:t};let vr=!1;const oe=()=>vr,qn=()=>{vr=!0};function Le(){try{const e=ie.join(xe.homedir(),".claude.json");return JSON.parse(Ne.readFileSync(e,"utf8")).theme||"dark"}catch{}return"dark"}function Zn(){try{const e=ie.join(xe.homedir(),".claude",".credentials.json");switch(JSON.parse(Ne.readFileSync(e,"utf8"))?.claudeAiOauth?.subscriptionType||"unknown"){case"enterprise":return"Claude Enterprise";case"team":return"Claude Team";case"max":return"Claude Max";case"pro":return"Claude Pro"}}catch{}return"Claude API"}function Qn(){try{const e=ie.join(xe.homedir(),".claude","settings.json"),r=JSON.parse(Ne.readFileSync(e,"utf8"))?.model||"default";if(r==="opus")return"Opus 4.1";const n=De.find(i=>i.slug===r);if(n)return n.label}catch{}return"Sonnet 4.5"}function et(e){process.platform==="win32"?Se.spawn("explorer",[e],{detached:!0,stdio:"ignore"}).unref():process.platform==="darwin"?Se.spawn("open",[e],{detached:!0,stdio:"ignore"}).unref():Se.spawn("xdg-open",[e],{detached:!0,stdio:"ignore"}).unref()}function ar(e){if(process.platform==="win32")Se.spawn("explorer",["/select,",e],{detached:!0,stdio:"ignore"}).unref();else if(process.platform==="darwin")Se.spawn("open",["-R",e],{detached:!0,stdio:"ignore"}).unref();else{const t=ie.dirname(e);Se.spawn("xdg-open",[t],{detached:!0,stdio:"ignore"}).unref()}}function Ke(e){if(!e||typeof e!="string")return!1;const t=e.trim();if(/^#([a-fA-F0-9]{3}|[a-fA-F0-9]{6})$/.test(t))return!0;if(/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/.test(t)){const r=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(r){const[,n,i,s]=r;return parseInt(n)<=255&&parseInt(i)<=255&&parseInt(s)<=255}}if(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(t)){const r=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(r){const[,n,i,s]=r;return parseInt(n)<=360&&parseInt(i)<=100&&parseInt(s)<=100}}return!1}function Ir(e){if(!Ke(e))return e;const t=e.trim();if(t.startsWith("rgb("))return t;if(t.startsWith("#")){let r=t.slice(1);r.length===3&&(r=r.split("").map(a=>a+a).join(""));const n=parseInt(r.slice(0,2),16),i=parseInt(r.slice(2,4),16),s=parseInt(r.slice(4,6),16);return`rgb(${n},${i},${s})`}if(t.startsWith("hsl(")){const r=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(r){const n=parseInt(r[1])/360,i=parseInt(r[2])/100,s=parseInt(r[3])/100,a=(_,v,C)=>(C<0&&(C+=1),C>1&&(C-=1),C<1/6?_+(v-_)*6*C:C<1/2?v:C<2/3?_+(v-_)*(2/3-C)*6:_),c=s<.5?s*(1+i):s+i-s*i,h=2*s-c,d=Math.round(a(h,c,n+1/3)*255),m=Math.round(a(h,c,n)*255),f=Math.round(a(h,c,n-1/3)*255);return`rgb(${d},${m},${f})`}}return e}async function rt(e,t="sha256",r=64*1024){return new Promise((n,i)=>{const s=gr.createHash(t),a=Ne.createReadStream(e,{highWaterMark:r});a.on("data",c=>{s.update(c)}),a.on("end",()=>{n(s.digest("hex"))}),a.on("error",c=>{i(c)})})}const cr=(e,t,r,n,i,s,a,c)=>{let h=e;return t&&(h+=`.rgb(${t})`),r&&r!=="transparent"&&(h+=`.bgRgb(${r})`),n&&(h+=".bold"),i&&(h+=".italic"),s&&(h+=".underline"),a&&(h+=".strikethrough"),c&&(h+=".inverse"),h};async function Cr(e,t,r="replace"){let n=493;try{n=(await ne.stat(e)).mode,oe()&&console.log(`[${r}] Original file mode for ${e}: ${(n&parseInt("777",8)).toString(8)}`)}catch(i){oe()&&console.log(`[${r}] Could not stat ${e} (error: ${i}), using default mode 755`)}try{await ne.unlink(e),oe()&&console.log(`[${r}] Unlinked ${e} to break hard links`)}catch(i){oe()&&console.log(`[${r}] Could not unlink ${e}: ${i}`)}await ne.writeFile(e,t),await ne.chmod(e,n),oe()&&console.log(`[${r}] Restored permissions to ${(n&parseInt("777",8)).toString(8)}`)}function P({color:e,backgroundColor:t,bold:r,dimColor:n,children:i}){const s=e?.startsWith("ansi:"),a=t?.startsWith("ansi:");if(s||a){if(Pe.Children.toArray(i).some(f=>Pe.isValidElement(f)))return o(l,{children:i});let h=X;if(s){const f=e.slice(5);h=h[f]||h}if(a){const f=t.slice(5),_=f.startsWith("bg")?f:`bg${f.charAt(0).toUpperCase()}${f.slice(1)}`;h=h[_]||h}r&&(h=h.bold),n&&(h=h.dim);const m=Pe.Children.toArray(i).map(f=>typeof f=="string"||typeof f=="number"?String(f):"").join("");return o(l,{children:h(m)})}return o(l,{color:e,backgroundColor:t,bold:r,dimColor:n,children:i})}function nt({text:e,nonShimmerColors:t,shimmerColors:r,shimmerWidth:n=3,updateDuration:i=50,restartPoint:s=10}){const[a,c]=O(0);return ae(()=>{const h=setInterval(()=>{c(d=>{const m=d+1;return m>=e.length+s?-n:m})},i);return()=>clearInterval(h)},[e.length,s,i]),t.length!==r.length?(console.error("UltrathinkRainbowShimmer: nonShimmerColors and shimmerColors must have the same length"),o(l,{children:e})):o(l,{children:e.split("").map((h,d)=>{const m=d>=a&&d<a+n&&a<e.length,f=d%t.length,_=m?r[f]:t[f];return o(l,{color:_,children:h},d)})})}const tt=Ar.cwd();function $r({theme:e}){const{ccVersion:t}=be(he);return g(u,{flexDirection:"column",paddingLeft:1,children:[o(u,{marginBottom:1,children:g(l,{bold:!0,children:["Preview: ",e.name]})}),o(u,{borderStyle:"single",borderColor:"gray",paddingX:1,children:g(u,{flexDirection:"column",children:[g(u,{flexDirection:"column",children:[g(l,{children:[o(P,{color:e.colors.clawd_body,children:" ▐"}),o(l,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:"▛███▜"}),g(l,{children:[o(P,{color:e.colors.clawd_body,children:"▌ "})," ",o(l,{bold:!0,children:"Claude Code"})," ",t?`v${t}`:"v2.0.14"]})]}),g(l,{children:[o(P,{color:e.colors.clawd_body,children:"▝▜"}),o(l,{color:e.colors.clawd_body,backgroundColor:e.colors.clawd_background,children:"█████"}),o(P,{color:e.colors.clawd_body,children:"▛▘"})," ",Qn()," · ",Zn()]}),g(P,{color:e.colors.clawd_body,children:[" ","▘▘ ▝▝"," ",tt]}),g(l,{children:[g(P,{color:e.colors.success,children:["Login successful. Press"," "]}),o(P,{bold:!0,color:e.colors.success,children:"Enter"}),g(P,{color:e.colors.success,children:[" ","to continue…"]})]})]}),o(l,{children:"╭─────────────────────────────────────────────╮"}),g(l,{children:["│ 1 function greet() ","{"," ","│"]}),g(l,{children:["│ 2"," ",o(P,{backgroundColor:e.colors.diffRemoved,color:e.colors.text,children:'- console.log("'}),o(P,{backgroundColor:e.colors.diffRemovedWord,children:"Hello, World!"}),o(P,{backgroundColor:e.colors.diffRemoved,children:'");'})," ","│"]}),g(l,{children:["│ 2"," ",o(P,{backgroundColor:e.colors.diffAdded,color:e.colors.text,children:'+ console.log("'}),o(P,{backgroundColor:e.colors.diffAddedWord,children:"Hello, Claude!"}),o(P,{backgroundColor:e.colors.diffAdded,children:'");'})," ","│"]}),o(P,{color:e.colors.warning,children:"╭─────────────────────────────────────────────╮"}),g(P,{color:e.colors.warning,children:["│ Do you trust the files in this folder?"," ","│"]}),g(l,{children:[o(P,{color:e.colors.warning,children:"│ "}),o(l,{dimColor:!0,children:"Enter to confirm · Esc to exit"}),g(P,{color:e.colors.warning,children:[" ","│"]})]}),o(P,{color:e.colors.bashBorder,children:"───────────────────────────────────────────────"}),g(l,{children:[o(P,{color:e.colors.bashBorder,children:"!"}),o(l,{children:" ls"})]}),o(P,{color:e.colors.promptBorder,children:"───────────────────────────────────────────────"}),o(l,{children:g(l,{children:["> list the dir"," ",o(nt,{text:"ultrathink",nonShimmerColors:[e.colors.rainbow_red,e.colors.rainbow_orange,e.colors.rainbow_yellow,e.colors.rainbow_green,e.colors.rainbow_blue,e.colors.rainbow_indigo,e.colors.rainbow_violet],shimmerColors:[e.colors.rainbow_red_shimmer,e.colors.rainbow_orange_shimmer,e.colors.rainbow_yellow_shimmer,e.colors.rainbow_green_shimmer,e.colors.rainbow_blue_shimmer,e.colors.rainbow_indigo_shimmer,e.colors.rainbow_violet_shimmer],shimmerWidth:3,updateDuration:50,restartPoint:10})]})}),o(P,{color:e.colors.planMode,children:"╭─────────────────────────────────────────────╮"}),g(l,{children:[o(P,{color:e.colors.planMode,children:"│ "}),g(P,{color:e.colors.permission,children:["Ready to code?"," "]}),o(l,{children:"Here is Claude's plan:"}),g(P,{color:e.colors.planMode,children:[" ","│"]})]}),o(P,{color:e.colors.permission,children:"╭─────────────────────────────────────────────╮"}),g(l,{children:[o(P,{color:e.colors.permission,children:"│ "}),o(l,{bold:!0,children:"Permissions:"})," ",g(P,{backgroundColor:e.colors.permission,color:e.colors.inverseText,bold:!0,children:[" ","Allow"," "]})," ","Deny"," ","Workspace"," ",o(P,{color:e.colors.permission,children:"│"})]}),o(l,{children:"> list the dir"}),g(l,{children:[o(P,{color:e.colors.error,children:"●"}),o(l,{children:" Update(__init__.py)"})]}),g(l,{children:[o(l,{children:" ⎿ "}),o(P,{color:e.colors.error,children:"User rejected update to __init__.py"})]}),g(l,{children:[" ","1"," ",g(P,{backgroundColor:e.colors.diffRemovedDimmed,children:["- import"," "]}),o(P,{backgroundColor:e.colors.diffRemovedWordDimmed,children:"os"})]}),g(l,{children:[" ","2"," ",g(P,{backgroundColor:e.colors.diffAddedDimmed,children:["+ import"," "]}),o(P,{backgroundColor:e.colors.diffAddedWordDimmed,children:"random"})]}),g(l,{children:[o(P,{color:e.colors.success,children:"●"}),o(l,{children:" List(.)"})]}),g(l,{children:[o(l,{children:"●"}),o(l,{children:" The directory "}),o(P,{color:e.colors.permission,children:"C:\\Users\\user"}),g(l,{children:[" ","contains ",o(l,{bold:!0,children:"123"})," files."]})]}),g(l,{children:[o(P,{color:e.colors.claude,children:"✻ Th"}),o(P,{color:e.colors.claudeShimmer,children:"ink"}),o(P,{color:e.colors.claude,children:"ing… "}),o(l,{children:"(esc to interrupt)"})]}),o(l,{children:o(P,{color:e.colors.autoAccept,children:"⏵⏵ auto-accept edits on (shift+tab to cycle)"})}),o(l,{children:o(P,{color:e.colors.planMode,children:"⏸ plan mode on (shift+tab to cycle)"})}),o(l,{children:o(P,{color:e.colors.ide,children:"◯ IDE connected ⧉ 44 lines selected"})})]})})]})}function Fe({colorKey:e,theme:t,bold:r=!1}){const n=t.colors[e];return e==="inverseText"?o(P,{color:n,backgroundColor:t.colors.permission,bold:r,children:e}):e.startsWith("diff")?o(P,{backgroundColor:n,bold:r,color:t.colors.text,children:e}):o(P,{color:n,bold:r,children:e})}function Nr({initialValue:e,onColorChange:t,onExit:r,colorKey:n,theme:i}){const s=Ue(e)||{h:0,s:50,l:50},a=Ve(e)||{r:128,g:128,b:128},[c,h]=O(s),[d,m]=O(a),[f,_]=O("hsl"),[v,C]=O("h"),[$,N]=O(!1),[F,B]=O(!1);ae(()=>{const x=Ue(e),w=Ve(e);x&&w&&(N(!0),h(x),m(w),N(!1))},[e]),ae(()=>{if(!$&&F){const x=`rgb(${d.r},${d.g},${d.b})`;t(x)}},[c,d,$,F]),ae(()=>{B(!0)},[]);const Y=x=>{if(Ke(x)){const w=Ir(x),p=Ue(w),k=Ve(w);p&&k&&(N(!0),h(p),m(k),N(!1))}};ge((x,w)=>{if(x.length>1&&!w.ctrl&&!w.meta){Y(x);return}if(w.return)r();else if(w.escape)r();else if(w.ctrl&&x==="a")_(p=>p==="hsl"?"rgb":"hsl"),C(p=>f==="hsl"?p==="h"?"r":p==="s"?"g":"b":p==="r"?"h":p==="g"?"s":"l");else if(w.upArrow)C(f==="hsl"?p=>p==="h"?"l":p==="s"?"h":"s":p=>p==="r"?"b":p==="g"?"r":"g");else if(w.downArrow||w.tab)C(f==="hsl"?p=>p==="h"?"s":p==="s"?"l":"h":p=>p==="r"?"g":p==="g"?"b":"r");else if(w.leftArrow){const p=w.shift||w.ctrl||w.meta?-10:-1;U(p)}else if(w.rightArrow){const p=w.shift||w.ctrl||w.meta?10:1;U(p)}});const U=x=>{N(!0),f==="hsl"?h(w=>{const p={...w};v==="h"?p.h=Math.max(0,Math.min(359,w.h+x)):v==="s"?p.s=Math.max(0,Math.min(100,w.s+x)):v==="l"&&(p.l=Math.max(0,Math.min(100,w.l+x)));const[k,b,S]=te(p.h,p.s,p.l);return m({r:k,g:b,b:S}),p}):m(w=>{const p={...w};v==="r"?p.r=Math.max(0,Math.min(255,w.r+x)):v==="g"?p.g=Math.max(0,Math.min(255,w.g+x)):v==="b"&&(p.b=Math.max(0,Math.min(255,w.b+x)));const k=V(p.r,p.g,p.b);return h(k),p}),N(!1)},V=(x,w,p)=>{const k=x/255,b=w/255,S=p/255,T=Math.max(k,b,S),y=Math.min(k,b,S),L=T-y,re=(T+y)/2;let le=0;L!==0&&(le=re>.5?L/(2-T-y):L/(T+y));let se=0;return L!==0&&(T===k?se=((b-S)/L+(b<S?6:0))/6:T===b?se=((S-k)/L+2)/6:se=((k-b)/L+4)/6),{h:Math.round(se*360),s:Math.round(le*100),l:Math.round(re*100)}},te=(x,w,p)=>{x/=360,w/=100,p/=100;const k=(1-Math.abs(2*p-1))*w,b=k*(1-Math.abs(x*6%2-1)),S=p-k/2;let T=0,y=0,L=0;return 0<=x&&x<1/6?(T=k,y=b,L=0):1/6<=x&&x<2/6?(T=b,y=k,L=0):2/6<=x&&x<3/6?(T=0,y=k,L=b):3/6<=x&&x<4/6?(T=0,y=b,L=k):4/6<=x&&x<5/6?(T=b,y=0,L=k):5/6<=x&&x<1&&(T=k,y=0,L=b),[Math.round((T+S)*255),Math.round((y+S)*255),Math.round((L+S)*255)]},z=()=>{const x=[],w=[[255,0,0],[255,127,0],[255,255,0],[127,255,0],[0,255,0],[0,255,127],[0,255,255],[0,127,255],[0,0,255],[127,0,255],[255,0,255],[255,0,127],[255,0,0]];for(let p=0;p<40;p++){const b=p/39*(w.length-1),S=Math.floor(b),T=Math.ceil(b),y=b-S,[L,re,le]=w[S],[se,R,E]=w[T],D=Math.round(L+(se-L)*y),K=Math.round(re+(R-re)*y),W=Math.round(le+(E-le)*y);x.push(o(l,{backgroundColor:`rgb(${D},${K},${W})`,children:" "},p))}return x},Z=()=>{const x=[];for(let w=0;w<40;w++){const p=w/39*100,[k,b,S]=te(c.h,p,c.l);x.push(o(l,{backgroundColor:`rgb(${k},${b},${S})`,children:" "},w))}return x},A=()=>{const x=[];for(let w=0;w<40;w++){const p=w/39*100,[k,b,S]=te(c.h,c.s,p);x.push(o(l,{backgroundColor:`rgb(${k},${b},${S})`,children:" "},w))}return x},M=()=>{const[x,w,p]=te(c.h,c.s,c.l);return`rgb(${x},${w},${p})`},I=(x,w,p)=>{const k=b=>b.toString(16).padStart(2,"0");return`#${k(x)}${k(w)}${k(p)}`},j=()=>{const x=[];for(let w=0;w<40;w++){const p=Math.round(w/39*255);x.push(o(l,{backgroundColor:`rgb(${p},${d.g},${d.b})`,children:" "},w))}return x},G=()=>{const x=[];for(let w=0;w<40;w++){const p=Math.round(w/39*255);x.push(o(l,{backgroundColor:`rgb(${d.r},${p},${d.b})`,children:" "},w))}return x},ee=()=>{const x=[];for(let w=0;w<40;w++){const p=Math.round(w/39*255);x.push(o(l,{backgroundColor:`rgb(${d.r},${d.g},${p})`,children:" "},w))}return x},H=(x,w)=>Math.round(x/w*39);return g(u,{flexDirection:"column",borderStyle:"single",borderColor:"white",padding:1,children:[g(u,{flexDirection:"column",children:[o(l,{bold:!0,children:"Color Picker"}),g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{color:"gray",dimColor:!0,children:"←→ to adjust (shift/ctrl/cmd +10)"}),o(l,{color:"gray",dimColor:!0,children:"↑↓ to change bar"}),o(l,{color:"gray",dimColor:!0,children:"ctrl+a to switch rgb/hsl"}),o(l,{color:"gray",dimColor:!0,children:"paste color from clipboard"}),o(l,{color:"gray",dimColor:!0,children:"enter to exit (auto-saved)"}),o(l,{color:"gray",dimColor:!0,children:"esc to save and exit"})]})]}),f==="hsl"?g(ce,{children:[g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="h"?"yellow":"white",children:[v==="h"?"❯ ":" ","Hue (",c.h,"°):"]})}),o(u,{children:z().map((x,w)=>o(_e,{children:w===H(c.h,360)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="s"?"yellow":"white",children:[v==="s"?"❯ ":" ","Saturation (",c.s,"%):"]})}),o(u,{children:Z().map((x,w)=>o(_e,{children:w===H(c.s,100)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="l"?"yellow":"white",children:[v==="l"?"❯ ":" ","Lightness (",c.l,"%):"]})}),o(u,{children:A().map((x,w)=>o(_e,{children:w===H(c.l,100)?o(l,{children:"|"}):x},w))})]})]}):g(ce,{children:[g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="r"?"yellow":"white",children:[v==="r"?"❯ ":" ","Red (",d.r,"):"]})}),o(u,{children:j().map((x,w)=>o(_e,{children:w===H(d.r,255)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="g"?"yellow":"white",children:[v==="g"?"❯ ":" ","Green (",d.g,"):"]})}),o(u,{children:G().map((x,w)=>o(_e,{children:w===H(d.g,255)?o(l,{children:"|"}):x},w))})]}),g(u,{marginBottom:1,children:[o(u,{width:25,children:g(l,{color:v==="b"?"yellow":"white",children:[v==="b"?"❯ ":" ","Blue (",d.b,"):"]})}),o(u,{children:ee().map((x,w)=>o(_e,{children:w===H(d.b,255)?o(l,{children:"|"}):x},w))})]})]}),g(u,{marginBottom:1,children:[o(l,{children:"Current: "}),o(l,{backgroundColor:M(),children:" "})]}),g(u,{flexDirection:"row",justifyContent:"space-between",children:[g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:"Hex "}),n?.startsWith("diff")?o(l,{backgroundColor:M(),color:i?.colors?.text||"white",bold:!0,children:I(d.r,d.g,d.b)}):n==="inverseText"?o(l,{color:M(),backgroundColor:i?.colors?.permission,bold:!0,children:I(d.r,d.g,d.b)}):o(l,{color:M(),bold:!0,children:I(d.r,d.g,d.b)})]}),g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:"RGB "}),n?.startsWith("diff")?o(l,{backgroundColor:M(),color:i?.colors?.text||"white",bold:!0,children:`rgb(${d.r}, ${d.g}, ${d.b})`}):n==="inverseText"?o(l,{color:M(),backgroundColor:i?.colors?.permission,bold:!0,children:`rgb(${d.r}, ${d.g}, ${d.b})`}):o(l,{color:M(),bold:!0,children:`rgb(${d.r}, ${d.g}, ${d.b})`})]}),g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:"HSL "}),n?.startsWith("diff")?o(l,{backgroundColor:M(),color:i?.colors?.text||"white",bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):n==="inverseText"?o(l,{color:M(),backgroundColor:i?.colors?.permission,bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`}):o(l,{color:M(),bold:!0,children:`hsl(${c.h}, ${c.s}%, ${c.l}%)`})]})]})]})}function Ve(e){const t=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(t)return{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3])};const r=e.match(/^#([a-fA-F0-9]{6})$/);if(r){const n=r[1];return{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16)}}return null}function Ue(e){const t=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(t)return{h:parseInt(t[1]),s:parseInt(t[2]),l:parseInt(t[3])};const r=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(r){const i=parseInt(r[1])/255,s=parseInt(r[2])/255,a=parseInt(r[3])/255,c=Math.max(i,s,a),h=Math.min(i,s,a),d=c-h,m=(c+h)/2;let f=0;d!==0&&(f=m>.5?d/(2-c-h):d/(c+h));let _=0;return d!==0&&(c===i?_=((s-a)/d+(s<a?6:0))/6:c===s?_=((a-i)/d+2)/6:_=((i-s)/d+4)/6),{h:Math.round(_*360),s:Math.round(f*100),l:Math.round(m*100)}}const n=e.match(/^#([a-fA-F0-9]{6})$/);if(n){const i=n[1],s=parseInt(i.substr(0,2),16)/255,a=parseInt(i.substr(2,2),16)/255,c=parseInt(i.substr(4,2),16)/255,h=Math.max(s,a,c),d=Math.min(s,a,c),m=h-d,f=(h+d)/2;let _=0;m!==0&&(_=f>.5?m/(2-h-d):m/(h+d));let v=0;return m!==0&&(h===s?v=((a-c)/m+(a<c?6:0))/6:h===a?v=((c-s)/m+2)/6:v=((s-a)/m+4)/6),{h:Math.round(v*360),s:Math.round(_*100),l:Math.round(f*100)}}return{h:0,s:50,l:50}}function ot({onBack:e,themeId:t}){const{settings:{themes:r},updateSettings:n}=be(he),[i,s]=O(t),a=r.find(A=>A.id===i)||r[0],[c,h]=O("rgb"),[d,m]=O(0),[f,_]=O(null),[v,C]=O(null),[$,N]=O(""),[F,B]=O(""),Y=dr(A=>{n(M=>{const I=M.themes.findIndex(j=>j.id===i);I!==-1&&A(M.themes[I])})},[i,n]),U=A=>{if(d>=2&&Ke(A)){const M=Ir(A),I=d-2,j=V[I];Y(G=>{G.colors[j]=M})}};ge((A,M)=>{if(f===null&&v===null){if(A.length>1&&!M.ctrl&&!M.meta){U(A);return}if(M.escape)e();else if(M.ctrl&&A==="a")h(I=>I==="rgb"?"hex":I==="hex"?"hsl":"rgb");else if(M.upArrow)m(I=>Math.max(0,I-1));else if(M.downArrow)m(I=>Math.min(V.length+1,I+1));else if(M.return)if(d===0)C("name"),N(a.name),B(a.name);else if(d===1)C("id"),N(a.id),B(a.id);else{const I=d-2,j=V[I],G=a.colors[j];_(I),N(G),B(G)}}else if(f!==null)M.ctrl&&A==="a"&&h(I=>I==="rgb"?"hex":I==="hex"?"hsl":"rgb");else if(v!==null)if(M.return){if(v==="id"){const I=i;s($),n(j=>{const G=j.themes.findIndex(ee=>ee.id===I);G!==-1&&(j.themes[G].id=$)})}else Y(I=>{I.name=$});C(null),N(""),B("")}else M.escape?(C(null),N(""),B("")):M.backspace||M.delete?N(I=>I.slice(0,-1)):A&&N(I=>I+A)});const V=Object.keys(a.colors),te=(A,M)=>{const I=A.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(!I)return A;const j=parseInt(I[1]),G=parseInt(I[2]),ee=parseInt(I[3]);switch(M){case"hex":{const H=x=>x.toString(16).padStart(2,"0");return`#${H(j)}${H(G)}${H(ee)}`}case"hsl":{const H=j/255,x=G/255,w=ee/255,p=Math.max(H,x,w),k=Math.min(H,x,w),b=p-k,S=(p+k)/2;let T=0;b!==0&&(T=S>.5?b/(2-p-k):b/(p+k));let y=0;return b!==0&&(p===H?y=((x-w)/b+(x<w?6:0))/6:p===x?y=((w-H)/b+2)/6:y=((H-x)/b+4)/6),`hsl(${Math.round(y*360)}, ${Math.round(T*100)}%, ${Math.round(S*100)}%)`}case"rgb":default:return A}},z=A=>({autoAccept:"Auto-accept mode indicator",bashBorder:"Bash command border",claude:"Claude branding color. Used for the Claude logo, the welcome message, and the thinking text.",claudeShimmer:"Color used for the shimmering effect on the thinking verb.",claudeBlue_FOR_SYSTEM_SPINNER:"System spinner color (blue variant)",claudeBlueShimmer_FOR_SYSTEM_SPINNER:"System spinner shimmer color (blue variant)",permission:"Permission prompt color",permissionShimmer:"Permission prompt shimmer color",planMode:"Plan mode indicator",ide:"Color used for IDE-related messages.",promptBorder:"Input prompt border color",promptBorderShimmer:"Input prompt border shimmer color",text:"Code color. Used in diffs.",inverseText:"Inverse text color. Used for the text of tabs, where the background is filled in.",inactive:"Inactive/dimmed text. Used for line numbers and less prominent text.",subtle:"Subtle text. Used for help text and secondary information.",suggestion:"Suggestion text color. Used for suggestions for theme names and various other things.",remember:"Remember/note color. Used for various text relating to memories.",background:"Background color for certain UI elements",success:"Success indicator. Used for the bullet on successful tool calls, and various success messages (such as sign in successful).",error:"Error indicator",warning:"Warning indicator",warningShimmer:"Warning shimmer color",diffAdded:"Added diff background",diffRemoved:"Removed diff background",diffAddedDimmed:"Added diff background (dimmed)",diffRemovedDimmed:"Removed diff background (dimmed)",diffAddedWord:"Added word highlight",diffRemovedWord:"Removed word highlight",diffAddedWordDimmed:"Added word highlight (dimmed)",diffRemovedWordDimmed:"Removed word highlight (dimmed)",red_FOR_SUBAGENTS_ONLY:"Red color for sub agents",blue_FOR_SUBAGENTS_ONLY:"Blue color for sub agents",green_FOR_SUBAGENTS_ONLY:"Green color for sub agents",yellow_FOR_SUBAGENTS_ONLY:"Yellow color for sub agents",purple_FOR_SUBAGENTS_ONLY:"Purple color for sub agents",orange_FOR_SUBAGENTS_ONLY:"Orange color for sub agents",pink_FOR_SUBAGENTS_ONLY:"Pink color for sub agents",cyan_FOR_SUBAGENTS_ONLY:"Cyan color for sub agents",professionalBlue:"Professional blue color for business contexts?",rainbow_red:'"ultrathink" rainbow - red',rainbow_orange:'"ultrathink" rainbow - orange',rainbow_yellow:'"ultrathink" rainbow - yellow',rainbow_green:'"ultrathink" rainbow - green',rainbow_blue:'"ultrathink" rainbow - blue',rainbow_indigo:'"ultrathink" rainbow - indigo',rainbow_violet:'"ultrathink" rainbow - violet',rainbow_red_shimmer:'"ultrathink" rainbow (shimmer) - red',rainbow_orange_shimmer:'"ultrathink" rainbow (shimmer) - orange',rainbow_yellow_shimmer:'"ultrathink" rainbow (shimmer) - yellow',rainbow_green_shimmer:'"ultrathink" rainbow (shimmer) - green',rainbow_blue_shimmer:'"ultrathink" rainbow (shimmer) - blue',rainbow_indigo_shimmer:'"ultrathink" rainbow (shimmer) - indigo',rainbow_violet_shimmer:'"ultrathink" rainbow (shimmer) - violet',clawd_body:'"Clawd" character body color',clawd_background:'"Clawd" character background color',userMessageBackground:"Background color for user messages",bashMessageBackgroundColor:"Background color for bash command output",memoryBackgroundColor:"Background color for memory/context information",rate_limit_fill:"Rate limit indicator fill color",rate_limit_empty:"Rate limit indicator empty/background color"})[A]||"",Z=Math.max(...V.map(A=>A.length));return g(u,{children:[g(u,{flexDirection:"column",width:"50%",children:[o(u,{children:g(fe,{children:["Editing theme “",a.name,"” (",a.id,")"]})}),f===null&&v===null?g(ce,{children:[g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{dimColor:!0,children:"enter to edit theme name, id, or color"}),o(l,{dimColor:!0,children:"ctrl+a to toggle rgb, hex, hsl"}),o(l,{dimColor:!0,children:"paste color from clipboard (when on color)"}),o(l,{dimColor:!0,children:"esc to go back"})]}),d<2?g(u,{marginBottom:1,borderStyle:"single",borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:"yellow",flexDirection:"column",paddingLeft:1,children:[o(l,{bold:!0,children:d===0?"Theme Name":"Theme ID"}),o(l,{children:d===0?"The display name for this theme":"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):g(u,{marginBottom:1,borderStyle:"single",borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:a.colors[V[d-2]],flexDirection:"column",paddingLeft:1,children:[o(Fe,{colorKey:V[d-2],theme:a,bold:!0}),o(l,{children:z(V[d-2])})]}),g(u,{flexDirection:"column",children:[g(u,{children:[o(l,{color:d===0?"yellow":"white",children:d===0?"❯ ":" "}),o(l,{bold:!0,children:"Name: "}),o(l,{children:a.name})]}),g(u,{marginBottom:1,children:[o(l,{color:d===1?"yellow":"white",children:d===1?"❯ ":" "}),o(l,{bold:!0,children:"ID: "}),o(l,{children:a.id})]}),(()=>{if(d<2){const H=V.slice(0,20);return g(ce,{children:[H.map((x,w)=>{const p=w+2;return g(u,{children:[o(l,{color:d===p?"yellow":"white",children:d===p?"❯ ":" "}),o(u,{width:Z+2,children:o(l,{children:o(Fe,{colorKey:x,theme:a,bold:!0})})}),o(P,{color:a.colors[x],children:te(a.colors[x],c)})]},x)}),V.length>20&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",V.length-20," more below"]})]})}const M=d-2,I=Math.max(0,M-Math.floor(20/2)),j=Math.min(V.length,I+20),G=Math.max(0,j-20),ee=V.slice(G,j);return g(ce,{children:[G>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",G," more above"]}),ee.map((H,x)=>{const p=G+x+2;return g(u,{children:[o(l,{color:d===p?"yellow":"white",children:d===p?"❯ ":" "}),o(u,{width:Z+2,children:o(l,{children:o(Fe,{colorKey:H,theme:a,bold:!0})})}),o(P,{color:a.colors[H],children:te(a.colors[H],c)})]},H)}),j<V.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",V.length-j," more below"]})]})})()]})]}):v?g(u,{flexDirection:"column",marginTop:1,children:[g(l,{children:["Editing ",v==="name"?"theme name":"theme ID",":"]}),o(u,{borderStyle:"round",borderColor:"yellow",paddingX:1,children:o(l,{children:$})}),o(l,{dimColor:!0,children:"enter to save, esc to cancel"})]}):o(Nr,{initialValue:F,colorKey:V[f],theme:a,onColorChange:A=>{N(A),Y(M=>{M.colors[V[f]]=A})},onExit:()=>{Y(A=>{A.colors[V[f]]=$}),_(null),N(""),B("")}})]}),o(u,{width:"50%",children:o($r,{theme:a})})]})}function it(e){return e.map(t=>`${t.name} (${t.id})`)}function st({onBack:e}){const{settings:{themes:t},updateSettings:r}=be(he),[n,i]=O(0),[s,a]=O(null),[c,h]=O(!0),d=()=>{const $={colors:{...(t[0]||q.themes[0]).colors},name:"New Custom Theme",id:`custom-${Date.now()}`};r(N=>{N.themes.push($)}),a($.id),h(!1)},m=C=>{t.length<=1||(r($=>{$.themes=$.themes.filter(N=>N.id!==C)}),n>=t.length-1&&i(Math.max(0,t.length-2)))},f=()=>{r(C=>{C.themes=[...q.themes]}),i(0)};if(ge((C,$)=>{if($.escape)e();else if($.upArrow)i(N=>Math.max(0,N-1));else if($.downArrow)i(N=>Math.min(t.length-1,N+1));else if($.return){const N=t[n];N&&(a(N.id),h(!1))}else if(C==="n")d();else if(C==="d"){const N=t[n];N&&m(N.id)}else $.ctrl&&C==="r"&&f()},{isActive:c}),s)return o(ot,{themeId:s,onBack:()=>{a(null),h(!0)}});const _=it(t),v=t.find(C=>_[n]?.includes(`(${C.id})`))||t[0];return t.length===0?o(u,{children:g(u,{flexDirection:"column",width:"100%",children:[o(fe,{children:"Themes"}),g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{dimColor:!0,children:"n to create a new theme"}),o(l,{dimColor:!0,children:"esc to go back"})]}),o(l,{children:"No themes available!"})]})}):g(u,{children:[g(u,{flexDirection:"column",width:"50%",children:[o(fe,{children:"Themes"}),g(u,{marginBottom:1,flexDirection:"column",children:[o(l,{dimColor:!0,children:"n to create a new theme"}),o(l,{dimColor:!0,children:"d to delete a theme"}),o(l,{dimColor:!0,children:"ctrl+r to delete all themes and restore built-in"}),o(l,{dimColor:!0,children:"enter to edit theme"}),o(l,{dimColor:!0,children:"esc to go back"})]}),o(u,{flexDirection:"column",children:_.map((C,$)=>g(l,{color:n===$?"yellow":void 0,children:[n===$?"❯ ":" ",C]},$))})]}),o(u,{width:"50%",children:o($r,{theme:v})})]})}let je=["ANSI Shadow"];function lt({onBack:e}){const{stdout:t}=Br(),r=t?.columns||120,{settings:{launchText:{method:n,figletText:i,figletFont:s,customText:a},themes:c},updateSettings:h}=be(he),d=n==="figlet"?["method","text","font"]:["method","text"],[m,f]=O(0),_=d[m],[v,C]=O(n==="figlet"?0:1),[$,N]=O(je),[F,B]=O(je),[Y,U]=O(""),[V,te]=O(!1),[z,Z]=O(0),[A,M]=O(""),[I,j]=O(50),[G,ee]=O(!1),[H,x]=O(n==="figlet"?i:a),w=Le(),k=(c.find(S=>S.id===w)||c.find(S=>S.id==="dark"))?.colors.claude||"rgb(215,119,87)";ae(()=>{Ge.fonts((S,T)=>{if(!S&&T){const y=T.sort();N(y),B(y),je=y;const L=y.indexOf(s);Z(L>=0?L:y.indexOf("ANSI Shadow")||0)}})},[]),ae(()=>{b()},[n,i,s,a,H,G]);const b=()=>{if(n==="figlet")try{const S=G?H:i,T=Ge.textSync(S.replace(`
|
|
196
|
+
`," "),{font:s}),y=Math.floor(r*.7),re=T.split(`
|
|
197
|
+
`).map(E=>E.length>y?E.substring(0,y-3)+"…":E),le=re.join(`
|
|
198
|
+
`);M(le);const se=Math.max(...re.map(E=>E.length)),R=Math.min(75,Math.max(50,Math.ceil(se/r*100)));j(R+5)}catch{M("Error generating figlet text"),j(50)}else{const S=Math.floor(r*.6),L=(G?H:a).split(`
|
|
199
|
+
`).map(R=>R.length>S?R.substring(0,S-3)+"...":R),re=L.join(`
|
|
200
|
+
`);M(re);const le=Math.max(...L.map(R=>R.length)),se=Math.min(75,Math.max(50,Math.ceil(le/r*100)));j(se+5)}};return ae(()=>{if(Y){const S=$.filter(T=>T.toLowerCase().includes(Y.toLowerCase()));B(S),Z(0)}else{B($);const S=$.indexOf(s);Z(S>=0?S:0)}},[Y,$]),ae(()=>{if(!V){const S=F.indexOf(s);S>=0&&Z(S)}},[s,F,V]),ge((S,T)=>{if(G){T.return?(h(n==="figlet"?y=>{y.launchText.figletText=H}:y=>{y.launchText.customText=H}),ee(!1)):T.escape?(x(n==="figlet"?i:a),ee(!1)):T.backspace||T.delete?x(y=>y.slice(0,-1)):S&&x(y=>y+S);return}if(V){if(T.return)F.length>0&&h(y=>{y.launchText.figletFont=F[z]}),te(!1),U("");else if(T.escape)te(!1),U("");else if(T.backspace||T.delete)U(y=>y.slice(0,-1));else if(T.upArrow){const y=z>0?z-1:F.length-1;Z(y),F.length>0&&h(L=>{L.launchText.figletFont=F[y]})}else if(T.downArrow){const y=z<F.length-1?z+1:0;Z(y),F.length>0&&h(L=>{L.launchText.figletFont=F[y]})}else S&&S.match(/^[a-zA-Z0-9\s\-_]$/)&&U(y=>y+S);return}if(T.escape)e();else if(T.return)_==="text"&&(x(n==="figlet"?i:a),ee(!0));else if(T.tab)T.shift?f(y=>y===0?d.length-1:y-1):f(y=>y===d.length-1?0:y+1);else if(T.upArrow){if(_==="method"){const y=v>0?v-1:1;C(y),h(L=>{L.launchText.method=y===0?"figlet":"custom"})}else if(_==="font"&&n==="figlet"){const y=z>0?z-1:F.length-1;Z(y),h(L=>{L.launchText.figletFont=F[y]})}}else if(T.downArrow){if(_==="method"){const y=v<1?v+1:0;C(y),h(L=>{L.launchText.method=y===0?"figlet":"custom"})}else if(_==="font"&&n==="figlet"){const y=z<F.length-1?z+1:0;Z(y),h(L=>{L.launchText.figletFont=F[y]})}}else S&&_==="font"&&n==="figlet"&&S.match(/^[a-zA-Z0-9]$/)&&(te(!0),U(S))}),g(u,{children:[g(u,{flexDirection:"column",width:`${100-I}%`,children:[g(u,{marginBottom:1,flexDirection:"column",children:[o(fe,{children:"Setup banner"}),g(u,{flexDirection:"column",children:[g(l,{dimColor:!0,children:["enter to ",_==="text"?"edit text":"save"]}),o(l,{dimColor:!0,children:"esc to go back"}),o(l,{dimColor:!0,children:"tab to switch sections"})]})]}),o(u,{children:g(l,{children:[o(l,{color:_==="method"?"yellow":void 0,children:_==="method"?"❯ ":" "}),o(l,{bold:!0,color:_==="method"?"yellow":void 0,children:"Method"})]})}),_==="method"&&g(l,{dimColor:!0,children:[" ","select one of ",F.length," Figlet fonts or enter your own text"]}),o(u,{marginLeft:2,marginBottom:1,children:g(u,{flexDirection:"column",children:[g(l,{color:v===0?"cyan":"white",children:[v===0?"❯ ":" ","Figlet"]}),g(l,{color:v===1?"cyan":"white",children:[v===1?"❯ ":" ","Custom"]})]})}),g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:_==="text"?"yellow":void 0,children:_==="text"?"❯ ":" "}),o(l,{bold:!0,color:_==="text"?"yellow":void 0,children:"Text"})]}),_==="text"&&(G?g(l,{dimColor:!0,children:[" ","esc to save"]}):g(l,{dimColor:!0,children:[" ","enter to edit"]}))]}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:G?"yellow":"gray",children:o(l,{children:G?H:n==="figlet"?i:a})})}),n==="figlet"&&g(ce,{children:[o(u,{children:g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:_==="font"?"yellow":void 0,children:_==="font"?"❯ ":" "}),o(l,{bold:!0,color:_==="font"?"yellow":void 0,children:"Font"})]}),_==="font"&&g(l,{dimColor:!0,children:[" ","type to filter"]}),o(l,{children:V&&g(l,{color:"gray",dimColor:!0,children:[" ","(filtering: “",Y,"”)"]})})]})}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{flexDirection:"column",children:(()=>{const T=Math.max(0,z-Math.floor(4)),y=Math.min(F.length,T+8),L=Math.max(0,y-8),re=F.slice(L,y);return g(ce,{children:[L>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",L," more above"]}),re.map((le,se)=>{const R=L+se;return g(l,{color:z===R?"cyan":void 0,children:[z===R?"❯ ":" ",le]},le)}),y<F.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",F.length-y," more below"]})]})})()})})]})]}),g(u,{width:`${I}%`,flexDirection:"column",children:[o(u,{marginBottom:1,children:o(l,{bold:!0,children:"Preview"})}),g(u,{borderStyle:"single",borderColor:"gray",padding:1,flexDirection:"column",children:[g(u,{flexDirection:"column",marginBottom:1,children:[o(l,{color:k,children:"╭──────────────────────────╮"}),g(l,{children:[o(l,{color:k,children:"│ ✻"})," Welcome to Claude Code"," ",o(l,{color:k,children:"│"})]}),o(l,{color:k,children:"╰──────────────────────────╯"})]}),A.split(`
|
|
201
|
+
`).map((S,T)=>o(l,{color:k,children:S},T)),o(u,{marginTop:1,children:o(l,{wrap:"truncate-end",children:"Claude Code can now be used with your Claude subscription or billed based on API usage through your Console account."})})]})]})]})}function at({onBack:e}){const{settings:{thinkingVerbs:{format:t,verbs:r},themes:n},updateSettings:i}=be(he),s=["format","verbs"],[a,c]=O(0),h=s[a],[d,m]=O(0),[f,_]=O(!1),[v,C]=O(""),[$,N]=O(!1),[F,B]=O(!1),[Y,U]=O(t),V=Le(),z=(n.find(A=>A.id===V)||n.find(A=>A.id==="dark"))?.colors.claude||"rgb(215,119,87)";ge((A,M)=>{if(F){M.return?(i(I=>{I.thinkingVerbs.format=Y}),B(!1)):M.escape?(U(t),B(!1)):M.backspace||M.delete?U(I=>I.slice(0,-1)):A&&U(I=>I+A);return}if(f||$){M.return&&v.trim()?($?(i(I=>{I.thinkingVerbs.verbs.push(v.trim())}),N(!1)):(i(I=>{I.thinkingVerbs.verbs[d]=v.trim()}),_(!1)),C("")):M.escape?(C(""),_(!1),N(!1)):M.backspace||M.delete?C(I=>I.slice(0,-1)):A&&C(I=>I+A);return}M.escape?e():M.return?h==="format"&&(U(t),B(!0)):M.tab?M.shift?c(I=>I===0?s.length-1:I-1):c(I=>I===s.length-1?0:I+1):M.upArrow?h==="verbs"&&r.length>0&&m(I=>I>0?I-1:r.length-1):M.downArrow?h==="verbs"&&r.length>0&&m(I=>I<r.length-1?I+1:0):A==="e"&&h==="verbs"?r.length>0&&(C(r[d]),_(!0)):A==="d"&&h==="verbs"?r.length>1&&(i(I=>{I.thinkingVerbs.verbs=I.thinkingVerbs.verbs.filter((j,G)=>G!==d)}),d>=r.length-1&&m(Math.max(0,r.length-2))):A==="n"&&h==="verbs"?(N(!0),C("")):M.ctrl&&A==="r"&&h==="verbs"&&(i(I=>{I.thinkingVerbs.verbs=[...q.thinkingVerbs.verbs]}),m(0))});const Z=50;return g(u,{children:[g(u,{flexDirection:"column",width:`${100-Z}%`,children:[g(u,{marginBottom:1,flexDirection:"column",children:[o(fe,{children:"Thinking Verbs"}),g(u,{flexDirection:"column",children:[o(l,{dimColor:!0,children:h==="format"?"enter to edit format":"changes auto-saved"}),o(l,{dimColor:!0,children:"esc to go back"}),o(l,{dimColor:!0,children:"tab to switch sections"})]})]}),o(u,{marginBottom:1,children:o(l,{dimColor:!0,children:"Customize the verbs shown during generation and their format."})}),g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:h==="format"?"yellow":void 0,children:h==="format"?"❯ ":" "}),o(l,{bold:!0,color:h==="format"?"yellow":void 0,children:"Format"})]}),h==="format"&&(F?g(l,{dimColor:!0,children:[" ","enter to save"]}):g(l,{dimColor:!0,children:[" ","enter to edit"]}))]}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:F?"yellow":"gray",children:o(l,{children:F?Y:t})})}),o(u,{children:g(l,{children:[o(l,{color:h==="verbs"?"yellow":void 0,children:h==="verbs"?"❯ ":" "}),o(l,{bold:!0,color:h==="verbs"?"yellow":void 0,children:"Verbs"})]})}),h==="verbs"&&o(u,{flexDirection:"column",children:g(l,{dimColor:!0,children:[" ","e to edit · d to delete · n to add new · ctrl+r to reset"]})}),o(u,{marginLeft:2,marginBottom:1,children:g(u,{flexDirection:"column",children:[(()=>{const M=Math.max(0,d-Math.floor(4)),I=Math.min(r.length,M+8),j=Math.max(0,I-8),G=r.slice(j,I);return g(ce,{children:[j>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",j," more above"]}),G.map((ee,H)=>{const x=j+H;return g(l,{color:h==="verbs"&&x===d?"cyan":void 0,children:[h==="verbs"&&x===d?"❯ ":" ",ee]},x)}),I<r.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",r.length-I," more below"]})]})})(),$&&g(u,{alignItems:"center",children:[o(l,{color:"yellow",children:"❯ "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:v})})]}),f&&g(u,{marginTop:1,alignItems:"center",children:[o(l,{children:"Editing: "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:v})})]})]})})]}),g(u,{width:`${Z}%`,flexDirection:"column",children:[o(u,{marginBottom:1,children:o(l,{bold:!0,children:"Preview"})}),o(u,{borderStyle:"single",borderColor:"gray",padding:1,flexDirection:"column",children:g(l,{children:[g(l,{color:z,children:["✻ ",t.replace(/\{\}/g,r[d])," "]}),o(l,{children:"(esc to interrupt)"})]})})]})]})}const we=[{name:"Default",phases:q.thinkingStyle.phases,reverseMirror:q.thinkingStyle.reverseMirror},{name:"Basic",phases:["|","/","-","\\"],reverseMirror:!1},{name:"Braille",phases:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"],reverseMirror:!1},{name:"Circle",phases:["◐","◓","◑","◒"],reverseMirror:!1},{name:"Wave",phases:["▁","▃","▄","▅","▆","▇","█"],reverseMirror:!0},{name:"Glow",phases:["░","▒","▓","█"],reverseMirror:!0},{name:"Partial block",phases:["▏","▎","▍","▌","▋","▊","▉","█"],reverseMirror:!0},{name:"Clock",phases:["🕛","🕐","🕑","🕒","🕓","🕔","🕕","🕖","🕗","🕘","🕙","🕚"],reverseMirror:!1},{name:"Globe",phases:["🌍","🌎","🌏"],reverseMirror:!1},{name:"Arc",phases:["◜","◠","◝","◞","◡","◟"],reverseMirror:!1},{name:"Triangle",phases:["◤","◥","◢","◣"],reverseMirror:!1},{name:"Bouncing",phases:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"],reverseMirror:!1},{name:"Dots",phases:[".","..","..."],reverseMirror:!1},{name:"Colors",phases:["🔴","🟠","🟡","🟢","🔵","🟣"],reverseMirror:!1}];function ct({onBack:e}){const{settings:{thinkingStyle:{phases:t,updateInterval:r,reverseMirror:n},themes:i},updateSettings:s}=be(he),a=["reverseMirror","updateInterval","phases","presets"],[c,h]=O(0),d=a[c],[m,f]=O(0),[_,v]=O(0),[C,$]=O(!1),[N,F]=O(""),[B,Y]=O(!1),[U,V]=O(!1),[te,z]=O(r.toString()),[Z,A]=O(0),M=Le(),j=(i.find(p=>p.id===M)||i.find(p=>p.id==="dark"))?.colors.claude||"rgb(215,119,87)";ae(()=>{if(t.length>0){const p=n?[...t,...[...t].reverse().slice(1,-1)]:t,k=setInterval(()=>{A(b=>(b+1)%p.length)},r);return()=>clearInterval(k)}},[t,r,n]),ge((p,k)=>{if(U){if(k.return){const b=parseInt(te);!isNaN(b)&&b>0&&s(S=>{S.thinkingStyle.updateInterval=b}),V(!1)}else k.escape?(z(r.toString()),V(!1)):k.backspace||k.delete?z(b=>b.slice(0,-1)):p&&p.match(/^[0-9]$/)&&z(b=>b+p);return}if(C||B){if(k.return&&N.length){const b=B?[...t,N]:t.map((S,T)=>T===m?N:S);s(S=>{S.thinkingStyle.phases=b}),$(!1),F("")}else k.escape?(F(""),$(!1),Y(!1)):k.backspace||k.delete?F(b=>b.slice(0,-1)):p&&F(b=>b+p);return}if(k.escape)e();else if(k.return)if(d==="updateInterval")z(r.toString()),V(!0);else if(d==="presets"){const b=we[_];s(S=>{S.thinkingStyle.phases=[...b.phases],S.thinkingStyle.reverseMirror=b.reverseMirror})}else d==="reverseMirror"&&s(b=>{b.thinkingStyle.reverseMirror=!b.thinkingStyle.reverseMirror});else if(k.tab)k.shift?h(b=>b===0?a.length-1:b-1):h(b=>b===a.length-1?0:b+1);else if(k.upArrow)d==="phases"&&t.length>0?f(b=>b>0?b-1:t.length-1):d==="presets"&&v(b=>b>0?b-1:we.length-1);else if(k.downArrow)d==="phases"&&t.length>0?f(b=>b<t.length-1?b+1:0):d==="presets"&&v(b=>b<we.length-1?b+1:0);else if(p===" ")d==="reverseMirror"&&s(b=>{b.thinkingStyle.reverseMirror=!b.thinkingStyle.reverseMirror});else if(p==="e"&&d==="phases")t.length>0&&(F(t[m]),$(!0));else if(p==="a"&&d==="phases")Y(!0),F("");else if(p==="d"&&d==="phases")t.length>1&&(s(b=>{b.thinkingStyle.phases=t.filter((S,T)=>T!==m)}),m>=t.length&&f(Math.max(0,t.length-1)));else if(p==="w"&&d==="phases"){if(m>0){const b=[...t];[b[m-1],b[m]]=[b[m],b[m-1]],s(S=>{S.thinkingStyle.phases=b}),f(S=>S-1)}}else if(p==="s"&&d==="phases"){if(m<t.length-1){const b=[...t];[b[m],b[m+1]]=[b[m+1],b[m]],s(S=>{S.thinkingStyle.phases=b}),f(S=>S+1)}}else k.ctrl&&p==="r"&&(s(b=>{b.thinkingStyle=q.thinkingStyle}),f(0),v(0))});const G=n?"●":"○",ee=50,x=n?[...t,...[...t].reverse().slice(1,-1)]:t,w=x.length>0?x[Z]:"·";return o(u,{children:g(u,{flexDirection:"column",width:"100%",children:[g(u,{flexDirection:"row",width:"100%",children:[g(u,{marginBottom:1,flexDirection:"column",width:`${100-ee}%`,children:[o(fe,{children:"Thinking style"}),g(u,{flexDirection:"column",children:[g(l,{dimColor:!0,children:["enter to"," ",d==="updateInterval"?"edit interval":d==="presets"?"apply preset":"save"]}),o(l,{dimColor:!0,children:"esc to go back"}),o(l,{dimColor:!0,children:"tab to switch sections"})]})]}),g(u,{width:`${ee}%`,flexDirection:"column",children:[o(u,{children:o(l,{bold:!0,children:"Preview"})}),g(u,{borderStyle:"single",borderColor:"gray",paddingX:1,flexDirection:"row",children:[o(u,{width:(w?.length??0)+1,children:o(l,{color:j,children:w})}),g(l,{children:[o(l,{color:j,children:"Thinking… "}),o(l,{children:"(esc to interrupt)"})]})]})]})]}),g(u,{flexDirection:"row",gap:4,children:[g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:d==="reverseMirror"?"yellow":void 0,children:d==="reverseMirror"?"❯ ":" "}),o(l,{bold:!0,color:d==="reverseMirror"?"yellow":void 0,children:"Reverse-mirror phases"})]}),d==="reverseMirror"&&g(l,{dimColor:!0,children:[" ","space to toggle"]}),o(u,{marginLeft:2,marginBottom:1,children:g(l,{children:[G," ",n?"Enabled":"Disabled"]})})]}),g(u,{flexDirection:"column",children:[g(l,{children:[o(l,{color:d==="updateInterval"?"yellow":void 0,children:d==="updateInterval"?"❯ ":" "}),o(l,{bold:!0,color:d==="updateInterval"?"yellow":void 0,children:"Update interval (ms)"})]}),d==="updateInterval"&&(U?g(l,{dimColor:!0,children:[" ","enter to save"]}):g(l,{dimColor:!0,children:[" ","enter to edit"]})),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:U?"yellow":"gray",children:o(l,{children:U?te:r})})})]})]}),o(u,{children:g(l,{children:[o(l,{color:d==="phases"?"yellow":void 0,children:d==="phases"?"❯ ":" "}),o(l,{bold:!0,color:d==="phases"?"yellow":void 0,children:"Phases"})]})}),d==="phases"&&o(u,{marginBottom:1,flexDirection:"column",children:g(l,{dimColor:!0,children:[" ","[e]dit"," ","[a]dd"," ","[d]elete"," ","[w]move up"," ","[s]move down"]})}),o(u,{marginLeft:2,marginBottom:1,children:g(u,{flexDirection:"column",children:[(()=>{const k=Math.max(0,m-Math.floor(4)),b=Math.min(t.length,k+8),S=Math.max(0,b-8),T=t.slice(S,b);return g(ce,{children:[S>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",S," more above"]}),T.map((y,L)=>{const re=S+L;return g(l,{color:d==="phases"&&re===m?"cyan":void 0,children:[d==="phases"&&re===m?"❯ ":" ",y]},re)}),b<t.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",t.length-b," more below"]})]})})(),B&&g(u,{children:[o(l,{color:"yellow",children:"❯ "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:N})})]}),C&&g(u,{marginTop:1,children:[o(l,{children:"Editing: "}),o(u,{borderStyle:"round",borderColor:"yellow",children:o(l,{children:N})})]})]})}),o(u,{children:g(l,{children:[o(l,{color:d==="presets"?"yellow":void 0,children:d==="presets"?"❯ ":" "}),o(l,{bold:!0,color:d==="presets"?"yellow":void 0,children:"Presets"})]})}),d==="presets"&&g(l,{dimColor:!0,children:[" ","Selecting one will overwrite your choice of phases"]}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{flexDirection:"column",children:(()=>{const k=Math.max(0,_-Math.floor(4)),b=Math.min(we.length,k+8),S=Math.max(0,b-8),T=we.slice(S,b);return g(ce,{children:[S>0&&g(l,{color:"gray",dimColor:!0,children:[" ","↑ ",S," more above"]}),T.map((y,L)=>{const re=S+L;return g(l,{color:d==="presets"&&re===_?"cyan":void 0,children:[d==="presets"&&re===_?"❯ ":" ",y.name," ",y.phases.join("")]},re)}),b<we.length&&g(l,{color:"gray",dimColor:!0,children:[" ","↓ ",we.length-b," more below"]})]})})()})}),o(u,{marginTop:1,children:o(l,{dimColor:!0,children:"ctrl+r to reset all settings to default"})})]})})}const Ce=[{label:"bold",value:"bold"},{label:"italic",value:"italic"},{label:"underline",value:"underline"},{label:"strikethrough",value:"strikethrough"},{label:"inverse",value:"inverse"}];function dt({onBack:e}){const{settings:t,updateSettings:r}=be(he),[n,i]=O("prefix"),[s,a]=O(0),[c,h]=O(!1),[d,m]=O(()=>t.userMessageDisplay.prefix.format),[f,_]=O(0),[v,C]=O(()=>[...t.userMessageDisplay.prefix.styling]),[$,N]=O(()=>t.userMessageDisplay.prefix.foreground_color),[F,B]=O(()=>t.userMessageDisplay.prefix.background_color),[Y,U]=O(0),[V,te]=O(0),[z,Z]=O(()=>[...t.userMessageDisplay.message.styling]),[A,M]=O(()=>t.userMessageDisplay.message.foreground_color),[I,j]=O(()=>t.userMessageDisplay.message.background_color),[G,ee]=O(null),[H,x]=O(""),w=Le(),p=t.themes?.find(R=>R.id===w)||t.themes?.[0],k=["format","styling","foreground","background"],b=["styling","foreground","background"],S=k[s],T=b[Y],y=(R,E)=>{r(D=>{const K=R==="prefix"?D.userMessageDisplay.prefix:D.userMessageDisplay.message;E(K)})},L=R=>{r(E=>{R==="prefix"?E.userMessageDisplay.prefix={...q.userMessageDisplay.prefix}:E.userMessageDisplay.message={...q.userMessageDisplay.message}}),R==="prefix"?(m(q.userMessageDisplay.prefix.format),C([...q.userMessageDisplay.prefix.styling]),N(q.userMessageDisplay.prefix.foreground_color),B(q.userMessageDisplay.prefix.background_color)):(Z([...q.userMessageDisplay.message.styling]),M(q.userMessageDisplay.message.foreground_color),j(q.userMessageDisplay.message.background_color))};ae(()=>{const R=t.userMessageDisplay.prefix;m(R.format),C([...R.styling]),N(R.foreground_color),B(R.background_color);const E=t.userMessageDisplay.message;Z([...E.styling]),M(E.foreground_color),j(E.background_color)},[]),ge((R,E)=>{if(c){if(E.return)y("prefix",D=>{D.format=d}),h(!1);else if(E.escape){const D=t.userMessageDisplay.prefix;m(D.format),h(!1)}else E.backspace||E.delete?m(D=>D.slice(0,-1)):R&&m(D=>D+R);return}if(G===null){if(E.escape)e();else if(E.ctrl&&R==="r")L(n);else if(E.leftArrow||E.rightArrow)i(D=>D==="prefix"?"message":"prefix");else if(E.tab)n==="prefix"?E.shift?a(D=>D===0?k.length-1:D-1):a(D=>D===k.length-1?0:D+1):E.shift?U(D=>D===0?b.length-1:D-1):U(D=>D===b.length-1?0:D+1);else if(E.return)n==="prefix"?S==="format"?h(!0):S==="foreground"?(x($),ee({column:"prefix",type:"foreground"})):S==="background"&&(x(F),ee({column:"prefix",type:"background"})):T==="foreground"?(x(A),ee({column:"message",type:"foreground"})):T==="background"&&(x(I),ee({column:"message",type:"background"}));else if(E.upArrow)n==="prefix"&&S==="styling"?_(D=>Math.max(0,D-1)):n==="message"&&T==="styling"&&te(D=>Math.max(0,D-1));else if(E.downArrow)n==="prefix"&&S==="styling"?_(D=>Math.min(Ce.length-1,D+1)):n==="message"&&T==="styling"&&te(D=>Math.min(Ce.length-1,D+1));else if(R===" "){if(n==="prefix"&&S==="styling"){const D=Ce[f].value,K=v.indexOf(D)>=0?v.filter(W=>W!==D):[...v,D];C(K),y("prefix",W=>{W.styling=[...K]})}else if(n==="message"&&T==="styling"){const D=Ce[V].value,K=z.indexOf(D)>=0?z.filter(W=>W!==D):[...z,D];Z(K),y("message",W=>{W.styling=[...K]})}}}});const re=(R,E,D=!0)=>{const K=D?E==="prefix"?v:z:[],W=D?E==="prefix"?$:A:"rgb(255,255,255)",ve=D?E==="prefix"?F:I:"rgb(0,0,0)",Ie=W==="rgb(0,0,0)"&&ve==="rgb(0,0,0)",Be=K.length>0;return Ie&&!Be?o(l,{children:R}):o(l,{bold:K.includes("bold"),italic:K.includes("italic"),underline:K.includes("underline"),strikethrough:K.includes("strikethrough"),inverse:K.includes("inverse"),color:Ie?void 0:W,backgroundColor:Ie?void 0:ve,children:R})},le=(R=!0)=>g(l,{children:[d&&g(ce,{children:[re(d,"prefix",R)," "]}),re("list the dir","message",R)]}),se=R=>{const E=n===R,W=(R==="prefix"?k:b)[R==="prefix"?s:Y],ve=R==="prefix"?f:V,Ie=R==="prefix"?v:z,Be=R==="prefix"?$:A,qe=R==="prefix"?F:I;return g(u,{flexDirection:"column",width:"45%",borderStyle:E?"round":"single",borderColor:E?"yellow":"gray",padding:1,children:[o(u,{marginBottom:1,children:g(l,{bold:!0,color:E?"yellow":void 0,children:[R.charAt(0).toUpperCase()+R.slice(1)," ","Configuration"]})}),R==="prefix"&&g(ce,{children:[o(u,{children:g(l,{color:E&&W==="format"?"yellow":void 0,bold:E&&W==="format",children:[E&&W==="format"?"❯ ":" ","Prefix Text"]})}),E&&W==="format"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:c?"enter to save":"enter to edit (appears before message)"})}),o(u,{marginLeft:2,marginBottom:1,children:o(u,{borderStyle:"round",borderColor:c?"yellow":"gray",children:o(l,{children:d})})})]}),o(u,{children:g(l,{color:E&&W==="styling"?"yellow":void 0,bold:E&&W==="styling",children:[E&&W==="styling"?"❯ ":" ","Styling"]})}),E&&W==="styling"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:"up/down to navigate · space to toggle"})}),o(u,{marginLeft:2,marginBottom:1,flexDirection:"column",children:Ce.map((Re,Ze)=>o(u,{children:g(l,{color:E&&W==="styling"&&ve===Ze?"cyan":void 0,children:[E&&W==="styling"&&ve===Ze?"❯ ":" ",Ie.includes(Re.value)?"●":"○"," ",Re.label]})},Re.value))}),o(u,{children:g(l,{color:E&&W==="foreground"?"yellow":void 0,bold:E&&W==="foreground",children:[E&&W==="foreground"?"❯ ":" ","Foreground color"]})}),E&&W==="foreground"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:"enter to open color picker"})}),o(u,{marginLeft:2,marginBottom:1,children:o(l,{color:Be,children:Be})}),o(u,{children:g(l,{color:E&&W==="background"?"yellow":void 0,bold:E&&W==="background",children:[E&&W==="background"?"❯ ":" ","Background color"]})}),E&&W==="background"&&o(u,{marginLeft:2,children:o(l,{dimColor:!0,children:"enter to open color picker"})}),o(u,{marginLeft:2,children:o(l,{backgroundColor:qe,children:qe})})]})};if(G){const{column:R,type:E}=G;return o(Nr,{initialValue:H,theme:p,onColorChange:D=>{R==="prefix"?E==="foreground"?(N(D),y("prefix",K=>{K.foreground_color=D})):(B(D),y("prefix",K=>{K.background_color=D})):E==="foreground"?(M(D),y("message",K=>{K.foreground_color=D})):(j(D),y("message",K=>{K.background_color=D}))},onExit:()=>{ee(null),x("")}})}return g(u,{flexDirection:"column",children:[o(fe,{children:"Customize how user messages are displayed"}),g(u,{flexDirection:"column",marginBottom:1,children:[o(l,{dimColor:!0,children:"left/right arrows to switch columns · tab to navigate options"}),o(l,{dimColor:!0,children:"enter to edit · ctrl+r to reset active column · esc to go back"})]}),g(u,{flexDirection:"row",gap:1,children:[se("prefix"),se("message")]}),o(u,{borderStyle:"round",padding:1,marginTop:1,children:g(u,{flexDirection:"column",children:[o(u,{marginBottom:1,children:o(l,{bold:!0,children:"Preview"})}),g(u,{flexDirection:"row",gap:2,children:[g(u,{flexDirection:"column",width:"50%",children:[o(u,{marginBottom:1,children:o(l,{underline:!0,children:"Before (Claude Code default):"})}),o(u,{marginLeft:1,marginTop:1,children:g(l,{children:[o(l,{color:p?.colors?.inactive||"#888888",children:"●"}),o(l,{children:" The directory "}),o(l,{color:p?.colors?.permission||"#00ff00",children:"C:\\Users\\user"}),o(l,{children:" contains "}),o(l,{bold:!0,children:"123"}),o(l,{children:" files."})]})})]}),g(u,{flexDirection:"column",width:"50%",children:[o(u,{marginBottom:1,children:o(l,{underline:!0,children:"After (Your customization):"})}),o(u,{marginLeft:1,children:le(!0)}),o(u,{marginLeft:1,marginTop:1,children:g(l,{children:[o(l,{color:p?.colors?.inactive||"#888888",children:"●"}),o(l,{children:" The directory "}),o(l,{color:p?.colors?.permission||"#00ff00",children:"C:\\Users\\user"}),o(l,{children:" contains "}),o(l,{bold:!0,children:"123"}),o(l,{children:" files."})]})})]})]})]})})]})}function gt({onSubmit:e}){const{settings:t,updateSettings:r}=be(he),[n,i]=O(0),s=()=>{r(c=>{c.inputBox||(c.inputBox={removeBorder:!1}),c.inputBox.removeBorder=!c.inputBox.removeBorder})};ge((c,h)=>{h.return||h.escape?e():c===" "&&n===0&&s()});const a=t.inputBox?.removeBorder?"☑":"☐";return g(u,{flexDirection:"column",children:[o(u,{marginBottom:1,children:o(fe,{children:"Input Box Settings"})}),o(u,{marginBottom:1,children:g(l,{color:"gray",children:[o(l,{bold:!0,children:"Customize the appearance of the Claude Code input box."})," ",o(l,{dimColor:!0,children:"Press space to toggle settings, enter to go back."})]})}),o(u,{children:g(l,{children:[o(l,{color:n===0?"cyan":void 0,children:n===0?"❯ ":" "}),o(l,{bold:!0,color:n===0?"cyan":void 0,children:"Remove border"})]})}),n===0&&o(u,{marginBottom:1,flexDirection:"column",children:g(l,{dimColor:!0,children:[" ","space to toggle"]})}),o(u,{marginLeft:2,marginBottom:1,children:g(l,{children:[a," ",t.inputBox?.removeBorder?"Enabled":"Disabled"]})}),o(u,{marginBottom:1,children:o(l,{color:"gray",dimColor:!0,children:"When enabled, removes the rounded border around the input box for a cleaner look."})})]})}const he=Or({settings:q,updateSettings:e=>{},changesApplied:!1,ccVersion:""});function ht({startupCheckInfo:e}){const[t,r]=O({settings:q,changesApplied:!1,ccVersion:"",lastModified:"",ccInstallationDir:null});ae(()=>{(async()=>{r(await Xe())})()},[]);const n=dr(m=>{const f=JSON.parse(JSON.stringify(t.settings));m(f),r(_=>({..._,settings:f,changesApplied:!1})),Ae(_=>{_.settings=f,_.changesApplied=!1})},[t.settings]),[i,s]=O(null),[a,c]=O(null);ae(()=>{e.wasUpdated&&e.oldVersion&&(c({message:`Your Claude Code installation was updated from ${e.oldVersion} to ${e.newVersion}, and the patching was likely overwritten
|
|
202
202
|
(However, your customization are still remembered in ${de}.)
|
|
203
|
-
Please reapply your changes below.`,type:"warning"}),
|
|
203
|
+
Please reapply your changes below.`,type:"warning"}),n(()=>{}))},[]),ge((m,f)=>{(f.ctrl&&m==="c"||(m==="q"||f.escape)&&!i)&&process.exit(0)},{isActive:!i});const h=m=>{switch(c(null),m){case J.APPLY_CHANGES:e.ccInstInfo&&(c({message:"Applying patches...",type:"info"}),yr(t,e.ccInstInfo).then(f=>{r(f),c({message:"Customization patches applied successfully!",type:"success"})}));break;case J.THEMES:case J.LAUNCH_TEXT:case J.THINKING_VERBS:case J.THINKING_STYLE:case J.USER_MESSAGE_DISPLAY:case J.INPUT_BOX:s(m);break;case J.VIEW_SYSTEM_PROMPTS:et(me);break;case J.RESTORE_ORIGINAL:e.ccInstInfo&&xr(e.ccInstInfo).then(()=>{c({message:"Original Claude Code restored successfully!",type:"success"}),n(()=>{})});break;case J.OPEN_CONFIG:ar(de);break;case J.OPEN_CLI:e.ccInstInfo&&ar(e.ccInstInfo.cliPath);break;case J.EXIT:process.exit(0)}},d=()=>{s(null)};return o(he.Provider,{value:{settings:t.settings,updateSettings:n,changesApplied:t.changesApplied,ccVersion:e.ccInstInfo?.version||""},children:o(u,{flexDirection:"column",children:i===null?o(Ur,{onSubmit:h,notification:a}):i===J.THEMES?o(st,{onBack:d}):i===J.LAUNCH_TEXT?o(lt,{onBack:d}):i===J.THINKING_VERBS?o(at,{onBack:d}):i===J.THINKING_STYLE?o(ct,{onBack:d}):i===J.USER_MESSAGE_DISPLAY?o(dt,{onBack:d}):i===J.INPUT_BOX?o(gt,{onSubmit:d}):null})})}const ut=async()=>{const e=new kr;e.name("tweakcc").description("Command-line tool to customize your Claude Code theme colors, thinking verbs and more.").version("2.0.3").option("-d, --debug","enable debug mode").option("-a, --apply","apply saved customizations without interactive UI"),e.parse();const t=e.opts();if(t.debug&&qn(),t.apply){console.log("Applying saved customizations to Claude Code..."),console.log(`Configuration saved at: ${de}`);const n=await Xe();(!n.settings||Object.keys(n.settings).length===0)&&(console.error("No saved customizations found in "+de),process.exit(1));const i=await lr();(!i||!i.ccInstInfo)&&(console.error("Cannot find Claude Code's cli.js"),console.error("Searched at the following locations:"),He.forEach(a=>{a.isGlob?a.expandedPaths.length===0?console.error(` - ${a.pattern} (no matches)`):(console.error(` - ${a.pattern}`),a.expandedPaths.forEach(c=>{console.error(` - ${c}`)})):console.error(` - ${a.pattern}`)}),process.exit(1)),console.log(`Found Claude Code at: ${i.ccInstInfo.cliPath}`),console.log(`Version: ${i.ccInstInfo.version}`),console.log("Loading system prompts...");const s=await ir(i.ccInstInfo.version);s.success||(console.log(X.red(`
|
|
204
204
|
✖ Error downloading system prompts:`)),console.log(X.red(` ${s.errorMessage}`)),console.log(X.yellow(`
|
|
205
|
-
⚠ System prompts not available - skipping system prompt customizations`))),console.log("Applying customizations..."),await
|
|
206
|
-
✖ Error downloading system prompts:`)),console.log(X.red(` ${
|
|
207
|
-
`))),
|
|
205
|
+
⚠ System prompts not available - skipping system prompt customizations`))),console.log("Applying customizations..."),await yr(n,i.ccInstInfo),console.log("Customizations applied successfully!"),process.exit(0)}const r=await lr();if(r){const n=await ir(r.ccInstInfo.version);n.success||(console.log(X.red(`
|
|
206
|
+
✖ Error downloading system prompts:`)),console.log(X.red(` ${n.errorMessage}`)),console.log(X.yellow(`⚠ System prompts not available - system prompt customizations will be skipped
|
|
207
|
+
`))),Mr(o(ht,{startupCheckInfo:r}))}else console.error(`Cannot find Claude Code's cli.js -- do you have Claude Code installed?
|
|
208
208
|
|
|
209
209
|
Searched at the following locations:
|
|
210
|
-
${
|
|
210
|
+
${He.map(i=>{if(i.isGlob){if(i.expandedPaths.length===0)return`- ${i.pattern} (no matches)`;{const s=[`- ${i.pattern}`];return i.expandedPaths.forEach(a=>{s.push(` - ${a}`)}),s.join(`
|
|
211
211
|
`)}}else return`- ${i.pattern}`}).join(`
|
|
212
212
|
`)}
|
|
213
213
|
|