tweakcc 1.0.3 โ†’ 1.1.1

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.
Files changed (3) hide show
  1. package/README.md +41 -40
  2. package/dist/index.js +28 -22
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,24 +1,42 @@
1
- # tweakcc
1
+ # ๐ŸŽจ tweakcc
2
2
 
3
+ [![tweakcc on npm](https://img.shields.io/npm/v/tweakcc?color=yellow")](https://www.npmjs.com/package/tweakcc)
3
4
  [![Mentioned in Awesome Claude Code](https://awesome.re/mentioned-badge.svg)](https://github.com/hesreallyhim/awesome-claude-code)
4
5
 
5
- Customize your Claude Code installations styles.
6
+ `tweakcc` is a lightweight, interactive CLI tool that lets you personalize your Claude Code interface.
6
7
 
8
+ - Create **custom themes** with a graphical HSL/RGB color picker
9
+ - Add custom **thinking verbs** that will show while Claude's working
10
+ - Pick from over **70+ spinning/thinking animations** from [`cli-spinners`](https://github.com/sindresorhus/cli-spinners)
11
+ - (WIP) Apply **custom styling** to the markdown elements in Claude's responses like code, bold, headers, etc
12
+ - Style the **user messages in the chat history** beyond the default plain gray text
13
+ - Change the "CLAUDE CODE" banner text to your own text with your own [figlet](http://www.figlet.org/) fonts
14
+ - Supports Claude Code installed on **Windows, macOS, and Linux**, using npm, yarn, pnpm, bun, Homebrew, nvm, fnm, n, volta, nvs, and nodenv, or a custom location
15
+
16
+ Run without installation:
17
+
18
+ ```bash
19
+ $ npx tweakcc
20
+
21
+ # Or use pnpm:
22
+ $ pnpm dlx tweakcc
7
23
  ```
8
- npx tweakcc
9
- ```
10
24
 
11
- Create custom themes, change the list of verbs shown during generation, change the spinner animation, and the banner text shown when you sign in. More options are coming soon, such as adding elements to the footer, customizing the generation status line, and modifying prompts used in generation.
25
+ Demo:
26
+
27
+ <img alt="Animated GIF demonstrating launching tweakcc, creating a new theme, changing its colors, applying the customimations, launching Claude Code, and selecting and trying out the new theme" src="./assets/themes-demo.gif" width="600">
12
28
 
13
- tweakcc works by patching the Claude Code's minified `cli.js` file. When you update your Claude Code installation, your customizations will be overwritten, but they're remembered in your `~/.tweakcc/config.js` configuration file, so they can be reapplied by just rerunning the tool.
29
+ ## How it works
14
30
 
15
- Works with Claude Code 1.0.72.
31
+ `tweakcc` works by patching the Claude Code's minified `cli.js` file. When you update your Claude Code installation, your customizations will be overwritten, but they're remembered in your `~/.tweakcc/config.js` configuration file, so they can be reapplied by just rerunning the tool.
32
+
33
+ Works with Claude Code 1.0.83.
16
34
 
17
35
  ## Running
18
36
 
19
- Use `npx tweakcc` or build and run it locally:
37
+ Run with installing it with `npx tweakcc`. Or build and run it locally:
20
38
 
21
- ```
39
+ ```bash
22
40
  git clone https://github.com/Piebald-AI/tweakcc.git
23
41
  cd tweakcc
24
42
  pnpm i
@@ -26,49 +44,32 @@ pnpm build
26
44
  node dist/index.js
27
45
  ```
28
46
 
29
- ## Demo
30
-
31
- Edit themes:
32
-
33
- <img alt="tweakcc theme edit view" src="https://raw.githubusercontent.com/Piebald-AI/tweakcc/main/assets/theme_1.png" width="600">
34
-
35
- Built-in color picker:
36
-
37
- <img alt="tweakcc theme color edit view" src="https://raw.githubusercontent.com/Piebald-AI/tweakcc/main/assets/theme_2.png" width="600">
38
-
39
- Edit the thinking spinner:
40
-
41
- <img alt="tweakcc thinking styles edit view" src="https://raw.githubusercontent.com/Piebald-AI/tweakcc/main/assets/thinking_styles.png" width="600">
42
-
43
- Apply your changes:
44
-
45
- <img alt="tweakcc launch screen" src="https://raw.githubusercontent.com/Piebald-AI/tweakcc/main/assets/startup.png" width="600">
46
-
47
- Run Claude Code!
48
-
49
- <img alt="Customized Claude Code demo" src="https://raw.githubusercontent.com/Piebald-AI/tweakcc/main/assets/claude_demo.png" width="600">
50
-
51
47
  ## Related projects
52
48
 
53
- [**ccstatusline**](https://github.com/sirmalloc/ccstatusline) - A highly customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics in your terminal.
49
+ - [**ccstatusline**](https://github.com/sirmalloc/ccstatusline) - Highly customizable status line formatter for Claude Code CLI that displays model info, git branch, token usage, and other metrics in your terminal.
50
+ - [**claude-powerline**](https://github.com/Owloops/claude-powerline) - Vim-style powerline statusline for Claude Code with real-time usage tracking, git integration, and custom themes.
54
51
 
55
52
  ## FAQ
56
53
 
57
- ### How can I customize my Claude Code theme?
54
+ #### How can I customize my Claude Code theme?
55
+
56
+ Run `npx tweakcc`, go to `Themes`, and modify existing themes or create a new one. Then go back to the main menu and choose `Apply customizations to cli.js`.
57
+
58
+ #### Why isn't all the text in Claude Code is getting its color changed?
58
59
 
59
- Run `npx tweakcc`, go to `Themes`, and modify existing themes or create new ones. Then go back to the main menu and choose `Apply customizations to cli.js`.
60
+ Some of the text Claude Code outputs has no coloring information at all, and unfortunately, that text is rendered using your terminal's default text foreground color and can't be customized.
60
61
 
61
- ### Why isn't all the text in Claude Code is getting its color changed?
62
+ #### Is there a way to disable colored output in Claude Code altogether?
62
63
 
63
- Some of the text Claude Code outputs has no coloring information at and is rendered using your terminal's default text foreground color.
64
+ Yes! You can use the [`FORCE_COLOR`](https://force-color.org/) environment variable, a convention which many CLI tools including Claude Code respect. Set it to `0` to disable colors entirely in Claude Code.
64
65
 
65
- ### How can I disable color altogether?
66
+ #### Why isn't my new theme being applied?
66
67
 
67
- You can use the [`FORCE_COLOR`](https://force-color.org/) environment variable, a convention which many CLI tools including Claude Code respect. Set it to `0` to disable colors entirely in Claude Code.
68
+ Could you have have forgotten to actually set Claude Code's theme to your new theme? Run `claude` and then use `/theme` to switch to your new theme if so.
68
69
 
69
- ### Why isn't my new theme being applied?
70
+ #### `tweakcc` vs. `tweakcn`...?
70
71
 
71
- You may have forgotten to actually set Claude Code's theme to your new theme. Run `claude` and then use `/theme` to switch to your new theme.
72
+ [`tweakcn`](https://github.com/jnsahaj/tweakcn), though similarly named, is unrelated to `tweakcc` or Claude Code. It's a tool for editing your [shadcn/ui](https://github.com/shadcn-ui/ui) themes. Check it out!
72
73
 
73
74
  ## License
74
75
 
package/dist/index.js CHANGED
@@ -1,25 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import{Box as e,Text as t,render as n,useInput as r,useStdout as i}from"ink";import{Fragment as a,createContext as o,useCallback as s,useContext as c,useEffect as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import*as m from"node:path";import h from"node:path";import*as g from"node:os";import*as _ from"node:fs";import*as v from"node:child_process";import y from"figlet";import*as b from"node:fs/promises";import x from"node:fs/promises";function S({items:n,selectedIndex:i,onSelect:a,onSubmit:o}){return r((e,t)=>{t.upArrow?a(i>0?i-1:n.length-1):t.downArrow?a(i<n.length-1?i+1:0):t.return&&o(n[i].name)}),f(e,{flexDirection:`column`,children:n.map((n,r)=>f(e,{children:p(t,{children:[p(t,{bold:r===i,color:r===i?`cyan`:void 0,...r===i?n.selectedStyles??{}:n.styles??{},children:[r===i?`โฏ `:` `,n.name]}),n.desc&&r===i&&p(t,{dimColor:!0,bold:!1,children:[` \x1B[0;2m`,`- `,n.desc]})]})},r))})}let C=function(e){return e.THEMES=`Themes`,e.LAUNCH_TEXT=`Launch text`,e.THINKING_VERBS=`Thinking verbs`,e.THINKING_STYLE=`Thinking style`,e.APPLY_CHANGES=`*Apply customizations to cli.js`,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 w={themes:[{name:`Dark mode`,id:`dark`,colors:{autoAccept:`rgb(175,135,255)`,bashBorder:`rgb(253,93,177)`,claude:`rgb(215,119,87)`,permission:`rgb(177,185,249)`,planMode:`rgb(72,150,140)`,secondaryBorder:`rgb(136,136,136)`,text:`rgb(255,255,255)`,inverseText:`rgb(0,0,0)`,secondaryText:`rgb(153,153,153)`,suggestion:`rgb(177,185,249)`,remember:`rgb(177,185,249)`,success:`rgb(78,186,101)`,error:`rgb(255,107,128)`,warning:`rgb(255,193,7)`,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)`}},{name:`Light mode`,id:`light`,colors:{autoAccept:`rgb(135,0,255)`,bashBorder:`rgb(255,0,135)`,claude:`rgb(215,119,87)`,permission:`rgb(87,105,247)`,planMode:`rgb(0,102,102)`,secondaryBorder:`rgb(153,153,153)`,text:`rgb(0,0,0)`,inverseText:`rgb(255,255,255)`,secondaryText:`rgb(102,102,102)`,suggestion:`rgb(87,105,247)`,remember:`rgb(0,0,255)`,success:`rgb(44,122,57)`,error:`rgb(171,43,63)`,warning:`rgb(150,108,30)`,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)`}},{name:`Light mode (ANSI colors only)`,id:`light-ansi`,colors:{autoAccept:`#cd00cd`,bashBorder:`#cd00cd`,claude:`#cdcd00`,permission:`#0000ee`,planMode:`#00cdcd`,secondaryBorder:`#e5e5e5`,text:`#000000`,inverseText:`#ffffff`,secondaryText:`#7f7f7f`,suggestion:`#0000ee`,remember:`#0000ee`,success:`#00cd00`,error:`#cd0000`,warning:`#cdcd00`,diffAdded:`#00cd00`,diffRemoved:`#cd0000`,diffAddedDimmed:`#00cd00`,diffRemovedDimmed:`#cd0000`,diffAddedWord:`#00ff00`,diffRemovedWord:`#ff0000`,diffAddedWordDimmed:`#00cd00`,diffRemovedWordDimmed:`#cd0000`}},{name:`Dark mode (ANSI colors only)`,id:`dark-ansi`,colors:{autoAccept:`#ff00ff`,bashBorder:`#ff00ff`,claude:`#cdcd00`,permission:`#5c5cff`,planMode:`#00ffff`,secondaryBorder:`#e5e5e5`,text:`#ffffff`,inverseText:`#000000`,secondaryText:`#e5e5e5`,suggestion:`#5c5cff`,remember:`#5c5cff`,success:`#00ff00`,error:`#ff0000`,warning:`#ffff00`,diffAdded:`#00cd00`,diffRemoved:`#cd0000`,diffAddedDimmed:`#00cd00`,diffRemovedDimmed:`#cd0000`,diffAddedWord:`#00ff00`,diffRemovedWord:`#ff0000`,diffAddedWordDimmed:`#00cd00`,diffRemovedWordDimmed:`#cd0000`}},{name:`Light mode (colorblind-friendly)`,id:`light-daltonized`,colors:{autoAccept:`rgb(135,0,255)`,bashBorder:`rgb(0,102,204)`,claude:`rgb(255,153,51)`,permission:`rgb(51,102,255)`,planMode:`rgb(51,102,102)`,secondaryBorder:`rgb(153,153,153)`,text:`rgb(0,0,0)`,inverseText:`rgb(255,255,255)`,secondaryText:`rgb(102,102,102)`,suggestion:`rgb(51,102,255)`,remember:`rgb(51,102,255)`,success:`rgb(0,102,153)`,error:`rgb(204,0,0)`,warning:`rgb(255,153,0)`,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)`}},{name:`Dark mode (colorblind-friendly)`,id:`dark-daltonized`,colors:{autoAccept:`rgb(175,135,255)`,bashBorder:`rgb(51,153,255)`,claude:`rgb(255,153,51)`,permission:`rgb(153,204,255)`,planMode:`rgb(102,153,153)`,secondaryBorder:`rgb(136,136,136)`,text:`rgb(255,255,255)`,inverseText:`rgb(0,0,0)`,secondaryText:`rgb(153,153,153)`,suggestion:`rgb(153,204,255)`,remember:`rgb(153,204,255)`,success:`rgb(51,153,255)`,error:`rgb(255,102,102)`,warning:`rgb(255,204,0)`,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)`}}],launchText:{method:`figlet`,figletText:`Claude Code`,figletFont:`ANSI Shadow`,customText:``},thinkingVerbs:{punctuation:`โ€ฆ `,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.Hustling.Ideating.Imagining.Incubating.Inferring.Jiving.Manifesting.Marinating.Meandering.Moseying.Mulling.Musing.Mustering.Noodling.Percolating.Perusing.Philosophising.Pondering.Pontificating.Processing.Puttering.Puzzling.Reticulating.Ruminating.Scheming.Schlepping.Shimmying.Shucking.Simmering.Smooshing.Spelunking.Spinning.Stewing.Sussing.Synthesizing.Thinking.Tinkering.Transmuting.Unfurling.Unravelling.Vibing.Wandering.Whirring.Wibbling.Wizarding.Working.Wrangling`.split(`.`)},thinkingStyle:{updateInterval:120,phases:{}.TERM===`xterm-ghostty`?[`ยท`,`โœข`,`โœณ`,`โœถ`,`โœป`,`*`]:process.platform===`darwin`?[`ยท`,`โœข`,`โœณ`,`โœถ`,`โœป`,`โœฝ`]:[`ยท`,`โœข`,`*`,`โœถ`,`โœป`,`โœฝ`],reverseMirror:!0}},T=m.join(g.homedir(),`.tweakcc`),E=m.join(T,`config.json`),D=m.join(T,`cli.js.backup`),O=[m.join(g.homedir(),`AppData`,`Local`,`Volta`,`tools`,`image`,`packages`,`@anthropic-ai`,`claude-code`,`node_modules`,`@anthropic-ai`,`claude-code`),m.join(g.homedir(),`AppData`,`Roaming`,`npm`,`node_modules`,`@anthropic-ai`,`claude-code`),m.join(g.homedir(),`AppData`,`Local`,`Yarn`,`config`,`global`,`node_modules`,`@anthropic-ai`,`claude-code`),m.join(g.homedir(),`AppData`,`Local`,`pnpm`,`global`,`5`,`node_modules`,`@anthropic-ai`,`claude-code`)];({}).N_PREFIX&&O.push(m.join({}.N_PREFIX,`lib`,`node_modules`,`@anthropic-ai`,`claude-code`));try{let e=m.join(g.homedir(),`.nvm`,`versions`,`node`);if(_.existsSync(e)){let t=_.readdirSync(e);for(let n of t)O.push(m.join(e,n,`lib`,`node_modules`,`@anthropic-ai`,`claude-code`))}}catch{console.log(`Could not add NVM paths to search list`)}process.platform!=`win32`&&(O.push(m.join(`/usr`,`local`,`lib`,`node_modules`,`@anthropic-ai`,`claude-code`)),O.push(m.join(`/opt`,`homebrew`,`lib`,`node_modules`,`@anthropic-ai`,`claude-code`)));const k=[{name:C.THEMES,desc:`Modify Claude Code's built-in themes or create your own`},{name:C.LAUNCH_TEXT,desc:`Change the "CLAUDE CODE" banner text that's shown when you sign in to Claude Code`},{name:C.THINKING_VERBS,desc:`Customize the list of verbs that Claude Code uses when it's working`},{name:C.THINKING_STYLE,desc:`Choose custom spinners`}],A=[{name:C.RESTORE_ORIGINAL,desc:`Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)`},{name:C.OPEN_CONFIG,desc:`Opens your tweack cc config file (${E})`},{name:C.OPEN_CLI,desc:`Opens Claude Code's cli.js file`},{name:C.EXIT,desc:`Bye!`}];function j({onSubmit:n,notification:r}){let i=[...c($).changesApplied?[]:[{name:C.APPLY_CHANGES,desc:`Required: Updates Claude Code's cli.js in-place with your changes`,selectedStyles:{color:`green`}}],...k,...A],[a,o]=u(0);return p(e,{flexDirection:`column`,children:[f(e,{marginBottom:1,children:p(t,{bold:!0,backgroundColor:`#ffd500`,color:`black`,children:[` `,`Tweak Claude Code`,` `]})}),f(e,{marginBottom:1,children:p(t,{color:`gray`,children:[f(t,{bold:!0,children:`Customize your Claude Code installation.`}),` `,f(t,{dimColor:!0,children:`Settings will be saved to a JSON file.`})]})}),r&&f(e,{marginBottom:1,borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderStyle:`bold`,borderColor:r?.type===`success`?`green`:r?.type===`error`?`red`:r?.type===`info`?`blue`:`yellow`,paddingLeft:1,flexDirection:`column`,children:f(t,{color:r?.type===`success`?`green`:r?.type===`error`?`red`:r?.type===`info`?`blue`:`yellow`,children:r?.message})}),f(S,{items:i,selectedIndex:a,onSelect:o,onSubmit:e=>n(e)})]})}function M({theme:n}){return p(e,{flexDirection:`column`,paddingLeft:1,children:[f(e,{marginBottom:1,children:p(t,{bold:!0,children:[`Preview: `,n.name]})}),f(e,{borderStyle:`single`,borderColor:`gray`,padding:1,children:p(e,{flexDirection:`column`,children:[f(t,{children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[`โ”‚ `,f(t,{color:n.colors.secondaryText,children:`1`}),` `,p(t,{color:n.colors.text,children:[`function greet() `,`{`]}),` `,`โ”‚`]}),p(t,{children:[`โ”‚ `,f(t,{color:n.colors.secondaryText,children:`2`}),` `,p(t,{backgroundColor:n.colors.diffRemoved,color:n.colors.text,children:[`- console.log("`,f(t,{backgroundColor:n.colors.diffRemovedWord,children:`Hello, World!`}),`");`]}),` `,`โ”‚`]}),p(t,{children:[`โ”‚ `,f(t,{color:n.colors.secondaryText,children:`2`}),` `,p(t,{backgroundColor:n.colors.diffAdded,color:n.colors.text,children:[`+ console.log("`,f(t,{backgroundColor:n.colors.diffAddedWord,children:`Hello, Claude!`}),`");`]}),` `,`โ”‚`]}),f(t,{color:n.colors.warning,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{color:n.colors.warning,children:[`โ”‚ Do you trust the files in this folder?`,` `,`โ”‚`]}),p(t,{children:[f(t,{color:n.colors.warning,children:`โ”‚ `}),f(t,{dimColor:!0,children:`Enter to confirm ยท Esc to exit`}),p(t,{color:n.colors.warning,children:[` `,`โ”‚`]})]}),f(t,{color:n.colors.claude,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.claude,children:`โ”‚ `}),f(t,{color:n.colors.claude,children:`โœป`}),f(t,{children:` Welcome to Tweak Claude Code!`}),p(t,{color:n.colors.claude,children:[` `,`โ”‚`]})]}),p(t,{children:[f(t,{color:n.colors.claude,children:`โ”‚`}),p(t,{color:n.colors.secondaryText,italic:!0,children:[` `,`/help for help, /status for your current set`]}),f(t,{color:n.colors.claude,children:`โ”‚`})]}),p(t,{color:n.colors.success,children:[`Login successful. Press `,f(t,{bold:!0,children:`Enter`}),` to continueโ€ฆ`]}),f(t,{color:n.colors.bashBorder,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.bashBorder,children:`โ”‚ !`}),p(t,{children:[` ls`,` `]}),f(t,{color:n.colors.bashBorder,children:`โ”‚`})]}),f(t,{color:n.colors.planMode,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.planMode,children:`โ”‚ `}),f(t,{color:n.colors.permission,children:`Ready to code?`}),p(t,{color:n.colors.planMode,children:[` `,`โ”‚`]})]}),p(t,{children:[f(t,{color:n.colors.planMode,children:`โ”‚ `}),f(t,{children:`Here is Claude's plan:`}),p(t,{color:n.colors.planMode,children:[` `,`โ”‚`]})]}),f(t,{color:n.colors.secondaryBorder,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.secondaryBorder,children:`โ”‚`}),` `,p(t,{color:n.colors.secondaryText,children:[`> Try โ€œrefactor <filepath>โ€`,` `,`โ”‚`]})]}),f(t,{color:n.colors.permission,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[p(t,{color:n.colors.permission,children:[`โ”‚ `,f(t,{bold:!0,children:`Permissions:`})]}),` `,p(t,{backgroundColor:n.colors.permission,color:n.colors.inverseText,bold:!0,children:[` `,`Allow`,` `]}),` `,`Deny`,` `,`Workspace`,` `,f(t,{color:n.colors.permission,children:`โ”‚`})]}),f(t,{color:n.colors.secondaryText,children:`> list the dir`}),p(t,{children:[f(t,{color:n.colors.error,children:`โ—`}),f(t,{children:` Update(__init__.py)`})]}),p(t,{children:[f(t,{children:` โŽฟ `}),f(t,{color:n.colors.error,children:`User rejected update to __init__.py`})]}),p(t,{children:[` `,f(t,{color:n.colors.secondaryText,children:`1`}),` `,p(t,{backgroundColor:n.colors.diffRemovedDimmed,color:n.colors.text,children:[`- import`,` `,f(t,{backgroundColor:n.colors.diffRemovedWordDimmed,color:n.colors.text,children:`os`})]})]}),p(t,{children:[` `,f(t,{color:n.colors.secondaryText,children:`2`}),` `,p(t,{backgroundColor:n.colors.diffAddedDimmed,color:n.colors.text,children:[`+ import`,` `,f(t,{backgroundColor:n.colors.diffAddedWordDimmed,color:n.colors.text,children:`random`})]})]}),p(t,{children:[f(t,{color:n.colors.success,children:`โ—`}),f(t,{children:` List(.)`})]}),f(t,{children:` โŽฟ Listed 123 paths (ctrl+r to expand)`}),p(t,{children:[f(t,{color:n.colors.secondaryText,children:`โ—`}),f(t,{children:` The directory `}),f(t,{color:n.colors.permission,children:`C:\\Users\\user`}),f(t,{children:` contains **123** files.`})]}),p(t,{children:[f(t,{color:n.colors.claude,children:`โœป Thinkingโ€ฆ `}),f(t,{color:n.colors.secondaryText,children:`(10s ยท โ†‘ 456 tokens ยท esc to interrupt)`})]}),p(t,{children:[p(t,{color:n.colors.autoAccept,children:[`โตโต auto-accept edits on`,` `]}),f(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),p(t,{children:[f(t,{color:n.colors.planMode,children:`โธ plan mode on `}),f(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]})]})})]})}function N({colorKey:e,theme:n,bold:r=!1}){let i=n.colors[e];return e===`inverseText`?f(t,{color:i,backgroundColor:n.colors.permission,bold:r,children:e}):e.startsWith(`diff`)?f(t,{backgroundColor:i,bold:r,color:n.colors.text,children:e}):f(t,{color:i,bold:r,children:e})}function P(){try{let e=m.join(g.homedir(),`.claude.json`),t=JSON.parse(_.readFileSync(e,`utf8`));return t.theme||`dark`}catch{}return`dark`}function F(e){if(process.platform===`win32`)v.spawn(`explorer`,[`/select,`,e],{detached:!0,stdio:`ignore`}).unref();else if(process.platform===`darwin`)v.spawn(`open`,[`-R`,e],{detached:!0,stdio:`ignore`}).unref();else{let t=m.dirname(e);v.spawn(`xdg-open`,[t],{detached:!0,stdio:`ignore`}).unref()}}function I(e){if(!e||typeof e!=`string`)return!1;let 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)){let e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(e){let[,t,n,r]=e;return parseInt(t)<=255&&parseInt(n)<=255&&parseInt(r)<=255}}if(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(t)){let e=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(e){let[,t,n,r]=e;return parseInt(t)<=360&&parseInt(n)<=100&&parseInt(r)<=100}}return!1}function L(e){if(!I(e))return e;let t=e.trim();if(t.startsWith(`rgb(`))return t;if(t.startsWith(`#`)){let e=t.slice(1);e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return`rgb(${n},${r},${i})`}if(t.startsWith(`hsl(`)){let e=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(e){let t=parseInt(e[1])/360,n=parseInt(e[2])/100,r=parseInt(e[3])/100,i=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),a=r<.5?r*(1+n):r+n-r*n,o=2*r-a,s=Math.round(i(o,a,t+1/3)*255),c=Math.round(i(o,a,t)*255),l=Math.round(i(o,a,t-1/3)*255);return`rgb(${s},${c},${l})`}}return e}function R({initialValue:n,onColorChange:i,onExit:o,onCancel:s,colorKey:c,theme:m}){let h=B(n)||{h:0,s:50,l:50},g=z(n)||{r:128,g:128,b:128},[_,v]=u(h),[y,b]=u(g),[x,S]=u(`hsl`),[C,w]=u(`h`),[T,E]=u(!1);l(()=>{let e=B(n),t=z(n);e&&t&&(E(!0),v(e),b(t),E(!1))},[n]),l(()=>{if(!T){let e=`rgb(${y.r},${y.g},${y.b})`;i(e)}},[_,y,T]);let D=e=>{if(I(e)){let t=L(e),n=B(t),r=z(t);n&&r&&(E(!0),v(n),b(r),E(!1))}};r((e,t)=>{if(e.length>1&&!t.ctrl&&!t.meta){D(e);return}if(t.return)o();else if(t.escape)s();else if(t.ctrl&&e===`a`)S(e=>e===`hsl`?`rgb`:`hsl`),w(e=>x===`hsl`?e===`h`?`r`:e===`s`?`g`:`b`:e===`r`?`h`:e===`g`?`s`:`l`);else if(t.upArrow)w(x===`hsl`?e=>e===`h`?`l`:e===`s`?`h`:`s`:e=>e===`r`?`b`:e===`g`?`r`:`g`);else if(t.downArrow||t.tab)w(x===`hsl`?e=>e===`h`?`s`:e===`s`?`l`:`h`:e=>e===`r`?`g`:e===`g`?`b`:`r`);else if(t.leftArrow){let e=t.shift||t.ctrl||t.meta?-10:-1;O(e)}else if(t.rightArrow){let e=t.shift||t.ctrl||t.meta?10:1;O(e)}});let O=e=>{E(!0),x===`hsl`?v(t=>{let n={...t};C===`h`?n.h=Math.max(0,Math.min(359,t.h+e)):C===`s`?n.s=Math.max(0,Math.min(100,t.s+e)):C===`l`&&(n.l=Math.max(0,Math.min(100,t.l+e)));let[r,i,a]=A(n.h,n.s,n.l);return b({r,g:i,b:a}),n}):b(t=>{let n={...t};C===`r`?n.r=Math.max(0,Math.min(255,t.r+e)):C===`g`?n.g=Math.max(0,Math.min(255,t.g+e)):C===`b`&&(n.b=Math.max(0,Math.min(255,t.b+e)));let r=k(n.r,n.g,n.b);return v(r),n}),E(!1)},k=(e,t,n)=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===r?((i-a)/c+(i<a?6:0))/6:o===i?((a-r)/c+2)/6:((r-i)/c+4)/6),{h:Math.round(d*360),s:Math.round(u*100),l:Math.round(l*100)}},A=(e,t,n)=>{e/=360,t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e*6%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<1/6?(o=r,s=i,c=0):1/6<=e&&e<2/6?(o=i,s=r,c=0):2/6<=e&&e<3/6?(o=0,s=r,c=i):3/6<=e&&e<4/6?(o=0,s=i,c=r):4/6<=e&&e<5/6?(o=i,s=0,c=r):5/6<=e&&e<1&&(o=r,s=0,c=i),[Math.round((o+a)*255),Math.round((s+a)*255),Math.round((c+a)*255)]},j=()=>{let e=[],n=[[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 r=0;r<40;r++){let i=r/39,a=i*(n.length-1),o=Math.floor(a),s=Math.ceil(a),c=a-o,[l,u,d]=n[o],[p,m,h]=n[s],g=Math.round(l+(p-l)*c),_=Math.round(u+(m-u)*c),v=Math.round(d+(h-d)*c);e.push(f(t,{backgroundColor:`rgb(${g},${_},${v})`,children:` `},r))}return e},M=()=>{let e=[];for(let n=0;n<40;n++){let r=n/39*100,[i,a,o]=A(_.h,r,_.l);e.push(f(t,{backgroundColor:`rgb(${i},${a},${o})`,children:` `},n))}return e},N=()=>{let e=[];for(let n=0;n<40;n++){let r=n/39*100,[i,a,o]=A(_.h,_.s,r);e.push(f(t,{backgroundColor:`rgb(${i},${a},${o})`,children:` `},n))}return e},P=()=>{let[e,t,n]=A(_.h,_.s,_.l);return`rgb(${e},${t},${n})`},F=(e,t,n)=>{let r=e=>e.toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`},R=()=>{let e=[];for(let n=0;n<40;n++){let r=Math.round(n/39*255);e.push(f(t,{backgroundColor:`rgb(${r},${y.g},${y.b})`,children:` `},n))}return e},V=()=>{let e=[];for(let n=0;n<40;n++){let r=Math.round(n/39*255);e.push(f(t,{backgroundColor:`rgb(${y.r},${r},${y.b})`,children:` `},n))}return e},H=()=>{let e=[];for(let n=0;n<40;n++){let r=Math.round(n/39*255);e.push(f(t,{backgroundColor:`rgb(${y.r},${y.g},${r})`,children:` `},n))}return e},U=(e,t)=>Math.round(e/t*39);return p(e,{flexDirection:`column`,borderStyle:`single`,borderColor:`white`,padding:1,children:[p(e,{flexDirection:`column`,children:[f(t,{bold:!0,children:`Color Picker`}),p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{color:`gray`,dimColor:!0,children:`โ†โ†’ to adjust (shift/ctrl/cmd +10)`}),f(t,{color:`gray`,dimColor:!0,children:`โ†‘โ†“ to change bar`}),f(t,{color:`gray`,dimColor:!0,children:`ctrl+a to switch rgb/hsl`}),f(t,{color:`gray`,dimColor:!0,children:`paste color from clipboard`}),f(t,{color:`gray`,dimColor:!0,children:`enter to exit (auto-saved)`}),f(t,{color:`gray`,dimColor:!0,children:`esc to cancel changes`})]})]}),x===`hsl`?p(d,{children:[p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`h`?`yellow`:`white`,children:[C===`h`?`โฏ `:` `,`Hue (`,_.h,`ยฐ):`]})}),f(e,{children:j().map((e,n)=>f(a,{children:n===U(_.h,360)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`s`?`yellow`:`white`,children:[C===`s`?`โฏ `:` `,`Saturation (`,_.s,`%):`]})}),f(e,{children:M().map((e,n)=>f(a,{children:n===U(_.s,100)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`l`?`yellow`:`white`,children:[C===`l`?`โฏ `:` `,`Lightness (`,_.l,`%):`]})}),f(e,{children:N().map((e,n)=>f(a,{children:n===U(_.l,100)?f(t,{children:`|`}):e},n))})]})]}):p(d,{children:[p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`r`?`yellow`:`white`,children:[C===`r`?`โฏ `:` `,`Red (`,y.r,`):`]})}),f(e,{children:R().map((e,n)=>f(a,{children:n===U(y.r,255)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`g`?`yellow`:`white`,children:[C===`g`?`โฏ `:` `,`Green (`,y.g,`):`]})}),f(e,{children:V().map((e,n)=>f(a,{children:n===U(y.g,255)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`b`?`yellow`:`white`,children:[C===`b`?`โฏ `:` `,`Blue (`,y.b,`):`]})}),f(e,{children:H().map((e,n)=>f(a,{children:n===U(y.b,255)?f(t,{children:`|`}):e},n))})]})]}),p(e,{marginBottom:1,children:[f(t,{children:`Current: `}),f(t,{backgroundColor:P(),children:` `})]}),p(e,{flexDirection:`row`,justifyContent:`space-between`,children:[p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:`Hex `}),c?.startsWith(`diff`)?f(t,{backgroundColor:P(),color:m?.colors?.text||`white`,bold:!0,children:F(y.r,y.g,y.b)}):c===`inverseText`?f(t,{color:P(),backgroundColor:m?.colors?.permission,bold:!0,children:F(y.r,y.g,y.b)}):f(t,{color:P(),bold:!0,children:F(y.r,y.g,y.b)})]}),p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:`RGB `}),c?.startsWith(`diff`)?f(t,{backgroundColor:P(),color:m?.colors?.text||`white`,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):c===`inverseText`?f(t,{color:P(),backgroundColor:m?.colors?.permission,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):f(t,{color:P(),bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`})]}),p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:`HSL `}),c?.startsWith(`diff`)?f(t,{backgroundColor:P(),color:m?.colors?.text||`white`,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):c===`inverseText`?f(t,{color:P(),backgroundColor:m?.colors?.permission,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):f(t,{color:P(),bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`})]})]})]})}function z(e){let t=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(t)return{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3])};let n=e.match(/^#([a-fA-F0-9]{6})$/);if(n){let e=n[1];return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16)}}return null}function B(e){let t=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(t)return{h:parseInt(t[1]),s:parseInt(t[2]),l:parseInt(t[3])};let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(n){let e=parseInt(n[1])/255,t=parseInt(n[2])/255,r=parseInt(n[3])/255,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a,s=(i+a)/2,c=0;o!==0&&(c=s>.5?o/(2-i-a):o/(i+a));let l=0;return o!==0&&(l=i===e?((t-r)/o+(t<r?6:0))/6:i===t?((r-e)/o+2)/6:((e-t)/o+4)/6),{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(s*100)}}let r=e.match(/^#([a-fA-F0-9]{6})$/);if(r){let e=r[1],t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,i=parseInt(e.substr(4,2),16)/255,a=Math.max(t,n,i),o=Math.min(t,n,i),s=a-o,c=(a+o)/2,l=0;s!==0&&(l=c>.5?s/(2-a-o):s/(a+o));let u=0;return s!==0&&(u=a===t?((n-i)/s+(n<i?6:0))/6:a===n?((i-t)/s+2)/6:((t-n)/s+4)/6),{h:Math.round(u*360),s:Math.round(l*100),l:Math.round(c*100)}}return{h:0,s:50,l:50}}function V({onBack:n,themeId:i}){let{settings:{themes:a},updateSettings:o}=c($),[l,m]=u(i),h=a.find(e=>e.id===l)||a[0],[g,_]=u(`rgb`),[v,y]=u(0),[b,x]=u(null),[S,C]=u(null),[w,T]=u(``),[E,D]=u(``),O=s(e=>{o(t=>{let n=t.themes.findIndex(e=>e.id===l);n!==-1&&e(t.themes[n])})},[l,o]),k=e=>{if(v>=2&&I(e)){let t=L(e),n=v-2,r=A[n];O(e=>{e.colors[r]=t})}};r((e,t)=>{if(b===null&&S===null){if(e.length>1&&!t.ctrl&&!t.meta){k(e);return}if(t.escape)n();else if(t.ctrl&&e===`a`)_(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(t.upArrow)y(e=>Math.max(0,e-1));else if(t.downArrow)y(e=>Math.min(A.length+1,e+1));else if(t.return)if(v===0)C(`name`),T(h.name),D(h.name);else if(v===1)C(`id`),T(h.id),D(h.id);else{let e=v-2,t=A[e],n=h.colors[t];x(e),T(n),D(n)}}else if(b!==null)t.ctrl&&e===`a`&&_(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(S!==null)if(t.return){if(S===`id`){let e=l;m(w),o(t=>{let n=t.themes.findIndex(t=>t.id===e);n!==-1&&(t.themes[n].id=w)})}else O(e=>{e.name=w});C(null),T(``),D(``)}else t.escape?(C(null),T(``),D(``)):t.backspace||t.delete?T(e=>e.slice(0,-1)):e&&T(t=>t+e)});let A=Object.keys(h.colors),j=(e,t)=>{let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(!n)return e;let r=parseInt(n[1]),i=parseInt(n[2]),a=parseInt(n[3]);switch(t){case`hex`:{let e=e=>e.toString(16).padStart(2,`0`);return`#${e(r)}${e(i)}${e(a)}`}case`hsl`:{let e=r/255,t=i/255,n=a/255,o=Math.max(e,t,n),s=Math.min(e,t,n),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===e?((t-n)/c+(t<n?6:0))/6:o===t?((n-e)/c+2)/6:((e-t)/c+4)/6),`hsl(${Math.round(d*360)}, ${Math.round(u*100)}%, ${Math.round(l*100)}%)`}case`rgb`:default:return e}},P=e=>{let t={claude:`Claude branding color. Used for the Claude logo, the welcome message, and the thinking text.`,text:`Code color. Used in diffs.`,inverseText:`Inverse text color. Used for the text of tabs, where the background is filled in.`,secondaryText:`Secondary/dimmed text. Used for keyboard shortcuts and other help text.`,secondaryBorder:`Secondary border color. Used for various boxes.`,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.`,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`,autoAccept:`Auto-accept mode indicator`,bashBorder:`Bash command border`,permission:`Permission prompt color`,planMode:`Plan mode indicator`,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)`};return t[e]||``},F=Math.max(...A.map(e=>e.length));return p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[f(e,{children:p(t,{backgroundColor:`#ffd500`,color:`black`,bold:!0,children:[` `,`Editing theme โ€œ`,h.name,`โ€ (`,h.id,`)`,` `]})}),b===null&&S===null?p(d,{children:[p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{dimColor:!0,children:`enter to edit theme name, id, or color`}),f(t,{dimColor:!0,children:`ctrl+a to toggle rgb, hex, hsl`}),f(t,{dimColor:!0,children:`paste color from clipboard (when on color)`}),f(t,{dimColor:!0,children:`esc to go back`})]}),v<2?p(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:`yellow`,flexDirection:`column`,paddingLeft:1,children:[f(t,{bold:!0,children:v===0?`Theme Name`:`Theme ID`}),f(t,{children:v===0?`The display name for this theme`:"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):p(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:h.colors[A[v-2]],flexDirection:`column`,paddingLeft:1,children:[f(N,{colorKey:A[v-2],theme:h,bold:!0}),f(t,{children:P(A[v-2])})]}),p(e,{flexDirection:`column`,children:[p(e,{children:[f(t,{color:v===0?`yellow`:`white`,children:v===0?`โฏ `:` `}),f(t,{bold:!0,children:`Name: `}),f(t,{children:h.name})]}),p(e,{marginBottom:1,children:[f(t,{color:v===1?`yellow`:`white`,children:v===1?`โฏ `:` `}),f(t,{bold:!0,children:`ID: `}),f(t,{children:h.id})]}),A.map((n,r)=>{let i=r+2;return p(e,{children:[f(t,{color:v===i?`yellow`:`white`,children:v===i?`โฏ `:` `}),f(e,{width:F+2,children:f(t,{children:f(N,{colorKey:n,theme:h,bold:!0})})}),f(t,{color:h.colors[n],children:j(h.colors[n],g)})]},n)})]})]}):S?p(e,{flexDirection:`column`,marginTop:1,children:[p(t,{children:[`Editing `,S===`name`?`theme name`:`theme ID`,`:`]}),f(e,{borderStyle:`round`,borderColor:`yellow`,paddingX:1,children:f(t,{children:w})}),f(t,{dimColor:!0,children:`enter to save, esc to cancel`})]}):f(R,{initialValue:E,colorKey:A[b],theme:h,onColorChange:e=>{T(e),O(t=>{t.colors[A[b]]=e})},onExit:()=>{O(e=>{e.colors[A[b]]=w}),x(null),T(``),D(``)},onCancel:()=>{O(e=>{e.colors[A[b]]=E}),x(null),T(``),D(``)}})]}),f(e,{width:`50%`,children:f(M,{theme:h})})]})}function H(e){return e.map(e=>`${e.name} (${e.id})`)}function U({onBack:n}){let{settings:{themes:i},updateSettings:a}=c($),[o,s]=u(0),[l,d]=u(null),[m,h]=u(!0),g=()=>{let e=i[0]||w.themes[0],t={colors:{...e.colors},name:`New Custom Theme`,id:`custom-${Date.now()}`};a(e=>{e.themes.push(t)}),d(t.id),h(!1)},_=e=>{i.length<=1||(a(t=>{t.themes=t.themes.filter(t=>t.id!==e)}),o>=i.length-1&&s(Math.max(0,i.length-2)))},v=()=>{a(e=>{e.themes=[...w.themes]}),s(0)};if(r((e,t)=>{if(t.escape)n();else if(t.upArrow)s(e=>Math.max(0,e-1));else if(t.downArrow)s(e=>Math.min(i.length-1,e+1));else if(t.return){let e=i[o];e&&(d(e.id),h(!1))}else if(e===`n`)g();else if(e===`d`){let e=i[o];e&&_(e.id)}else t.ctrl&&e===`r`&&v()},{isActive:m}),l)return f(V,{themeId:l,onBack:()=>{d(null),h(!0)}});let y=H(i),b=i.find(e=>y[o]?.includes(`(${e.id})`))||i[0];return i.length===0?f(e,{children:p(e,{flexDirection:`column`,width:`100%`,children:[p(t,{bold:!0,backgroundColor:`#ffd500`,color:`black`,children:[` `,`Themes`,` `]}),p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{dimColor:!0,children:`n to create a new theme`}),f(t,{dimColor:!0,children:`esc to go back`})]}),f(t,{children:`No themes available!`})]})}):p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[p(t,{bold:!0,backgroundColor:`#ffd500`,color:`black`,children:[` `,`Themes`,` `]}),p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{dimColor:!0,children:`n to create a new theme`}),f(t,{dimColor:!0,children:`d to delete a theme`}),f(t,{dimColor:!0,children:`ctrl+r to delete all themes and restore built-in`}),f(t,{dimColor:!0,children:`enter to edit theme`}),f(t,{dimColor:!0,children:`esc to go back`})]}),f(e,{flexDirection:`column`,children:y.map((e,n)=>p(t,{color:o===n?`yellow`:void 0,children:[o===n?`โฏ `:` `,e]},n))})]}),f(e,{width:`50%`,children:f(M,{theme:b})})]})}let W=[`ANSI Shadow`];function G({onBack:n}){let{stdout:a}=i(),o=a?.columns||120,{settings:{launchText:{method:s,figletText:m,figletFont:h,customText:g},themes:_},updateSettings:v}=c($),b=s===`figlet`?[`method`,`text`,`font`]:[`method`,`text`],[x,S]=u(0),C=b[x],[w,T]=u(s===`figlet`?0:1),[E,D]=u(W),[O,k]=u(W),[A,j]=u(``),[M,N]=u(!1),[F,I]=u(0),[L,R]=u(``),[z,B]=u(50),[V,H]=u(!1),[U,G]=u(s===`figlet`?m:g),ee=P(),K=_.find(e=>e.id===ee)||_.find(e=>e.id===`dark`),q=K?.colors.claude||`rgb(215,119,87)`;l(()=>{y.fonts((e,t)=>{if(!e&&t){let e=t.sort();D(e),k(e),W=e;let n=e.indexOf(h);I(n>=0?n:e.indexOf(`ANSI Shadow`)||0)}})},[]),l(()=>{J()},[s,m,h,g,U,V]);let J=()=>{if(s===`figlet`)try{let e=V?U:m,t=y.textSync(e.replace(`
2
+ import{Box as e,Text as t,render as n,useInput as r,useStdout as i}from"ink";import{Fragment as a,createContext as o,useCallback as s,useContext as c,useEffect as l,useState as u}from"react";import{Fragment as d,jsx as f,jsxs as p}from"react/jsx-runtime";import*as m from"node:path";import h from"node:path";import*as g from"node:os";import{globbySync as _}from"globby";import*as v from"node:fs";import*as y from"node:child_process";import b from"figlet";import*as x from"node:fs/promises";import S from"node:fs/promises";function C({items:n,selectedIndex:i,onSelect:a,onSubmit:o}){return r((e,t)=>{t.upArrow?a(i>0?i-1:n.length-1):t.downArrow?a(i<n.length-1?i+1:0):t.return&&o(n[i].name)}),f(e,{flexDirection:`column`,children:n.map((n,r)=>f(e,{children:p(t,{children:[p(t,{bold:r===i,color:r===i?`cyan`:void 0,...r===i?n.selectedStyles??{}:n.styles??{},children:[r===i?`โฏ `:` `,n.name]}),n.desc&&r===i&&p(t,{dimColor:!0,bold:!1,children:[` \x1B[0;2m`,`- `,n.desc]})]})},r))})}let w=function(e){return e.THEMES=`Themes`,e.LAUNCH_TEXT=`Launch text`,e.THINKING_VERBS=`Thinking verbs`,e.THINKING_STYLE=`Thinking style`,e.APPLY_CHANGES=`*Apply customizations to cli.js`,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 T={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)`,permission:`rgb(177,185,249)`,planMode:`rgb(72,150,140)`,ide:`rgb(71,130,200)`,secondaryBorder:`rgb(136,136,136)`,text:`rgb(255,255,255)`,inverseText:`rgb(0,0,0)`,secondaryText:`rgb(153,153,153)`,suggestion:`rgb(177,185,249)`,remember:`rgb(177,185,249)`,success:`rgb(78,186,101)`,error:`rgb(255,107,128)`,warning:`rgb(255,193,7)`,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)`}},{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)`,permission:`rgb(87,105,247)`,planMode:`rgb(0,102,102)`,ide:`rgb(71,130,200)`,secondaryBorder:`rgb(153,153,153)`,text:`rgb(0,0,0)`,inverseText:`rgb(255,255,255)`,secondaryText:`rgb(102,102,102)`,suggestion:`rgb(87,105,247)`,remember:`rgb(0,0,255)`,success:`rgb(44,122,57)`,error:`rgb(171,43,63)`,warning:`rgb(150,108,30)`,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)`}},{name:`Light mode (ANSI colors only)`,id:`light-ansi`,colors:{autoAccept:`#cd00cd`,bashBorder:`#cd00cd`,claude:`#cdcd00`,claudeShimmer:`#ffff00`,permission:`#0000ee`,planMode:`#00cdcd`,ide:`#4782C8`,secondaryBorder:`#e5e5e5`,text:`#000000`,inverseText:`#ffffff`,secondaryText:`#7f7f7f`,suggestion:`#0000ee`,remember:`#0000ee`,success:`#00cd00`,error:`#cd0000`,warning:`#cdcd00`,diffAdded:`#00cd00`,diffRemoved:`#cd0000`,diffAddedDimmed:`#00cd00`,diffRemovedDimmed:`#cd0000`,diffAddedWord:`#00ff00`,diffRemovedWord:`#ff0000`,diffAddedWordDimmed:`#00cd00`,diffRemovedWordDimmed:`#cd0000`,red_FOR_SUBAGENTS_ONLY:`#cd0000`,blue_FOR_SUBAGENTS_ONLY:`#0000cd`,green_FOR_SUBAGENTS_ONLY:`#00cd00`,yellow_FOR_SUBAGENTS_ONLY:`#cdcd00`,purple_FOR_SUBAGENTS_ONLY:`#cd00cd`,orange_FOR_SUBAGENTS_ONLY:`#cd8500`,pink_FOR_SUBAGENTS_ONLY:`#ff1493`,cyan_FOR_SUBAGENTS_ONLY:`#00cdcd`}},{name:`Dark mode (ANSI colors only)`,id:`dark-ansi`,colors:{autoAccept:`#ff00ff`,bashBorder:`#ff00ff`,claude:`#cdcd00`,claudeShimmer:`#ffff00`,permission:`#5c5cff`,planMode:`#00ffff`,ide:`#4782c8`,secondaryBorder:`#e5e5e5`,text:`#ffffff`,inverseText:`#000000`,secondaryText:`#e5e5e5`,suggestion:`#5c5cff`,remember:`#5c5cff`,success:`#00ff00`,error:`#ff0000`,warning:`#ffff00`,diffAdded:`#00cd00`,diffRemoved:`#cd0000`,diffAddedDimmed:`#00cd00`,diffRemovedDimmed:`#cd0000`,diffAddedWord:`#00ff00`,diffRemovedWord:`#ff0000`,diffAddedWordDimmed:`#00cd00`,diffRemovedWordDimmed:`#cd0000`,red_FOR_SUBAGENTS_ONLY:`#ff0000`,blue_FOR_SUBAGENTS_ONLY:`#0000ff`,green_FOR_SUBAGENTS_ONLY:`#00ff00`,yellow_FOR_SUBAGENTS_ONLY:`#ffff00`,purple_FOR_SUBAGENTS_ONLY:`#ff00ff`,orange_FOR_SUBAGENTS_ONLY:`#ff8700`,pink_FOR_SUBAGENTS_ONLY:`#ff69b4`,cyan_FOR_SUBAGENTS_ONLY:`#00ffff`}},{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)`,permission:`rgb(51,102,255)`,planMode:`rgb(51,102,102)`,ide:`rgb(71,130,200)`,secondaryBorder:`rgb(153,153,153)`,text:`rgb(0,0,0)`,inverseText:`rgb(255,255,255)`,secondaryText:`rgb(102,102,102)`,suggestion:`rgb(51,102,255)`,remember:`rgb(51,102,255)`,success:`rgb(0,102,153)`,error:`rgb(204,0,0)`,warning:`rgb(255,153,0)`,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)`}},{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)`,permission:`rgb(153,204,255)`,planMode:`rgb(102,153,153)`,ide:`rgb(71,130,200)`,secondaryBorder:`rgb(136,136,136)`,text:`rgb(255,255,255)`,inverseText:`rgb(0,0,0)`,secondaryText:`rgb(153,153,153)`,suggestion:`rgb(153,204,255)`,remember:`rgb(153,204,255)`,success:`rgb(51,153,255)`,error:`rgb(255,102,102)`,warning:`rgb(255,204,0)`,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)`}}],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`.split(`.`)},thinkingStyle:{updateInterval:120,phases:{}.TERM===`xterm-ghostty`?[`ยท`,`โœข`,`โœณ`,`โœถ`,`โœป`,`*`]:process.platform===`darwin`?[`ยท`,`โœข`,`โœณ`,`โœถ`,`โœป`,`โœฝ`]:[`ยท`,`โœข`,`*`,`โœถ`,`โœป`,`โœฝ`],reverseMirror:!0}},E=m.join(g.homedir(),`.tweakcc`),D=m.join(E,`config.json`),O=m.join(E,`cli.js.backup`),k=()=>{let e=[],t=process.platform==`win32`?g.homedir().replace(/\\/g,`/`):g.homedir(),n=`node_modules/@anthropic-ai/claude-code`;return{}.N_PREFIX&&e.push(`${{}.N_PREFIX}/lib/${n}`),{}.VOLTA_HOME&&e.push(`${{}.VOLTA_HOME}/lib/${n}`),{}.FNM_DIR&&e.push(`${{}.FNM_DIR}/lib/${n}`),{}.NVM_DIR&&e.push(`${{}.NVM_DIR}/lib/${n}`),{}.NODENV_ROOT&&e.push(..._(`${{}.NODENV_ROOT}/versions/*/lib/${n}`)),{}.NVS_HOME&&e.push(..._(`${{}.NVS_HOME}/node/*/*/lib/${n}`)),process.platform==`win32`?(e.push(`${t}/AppData/Local/Volta/tools/image/packages/@anthropic-ai/claude-code/${n}`),e.push(`${t}/AppData/Roaming/npm/${n}`),e.push(..._(`${t}/AppData/Roaming/nvm/*/${n}}`)),e.push(`${t}/AppData/Local/Yarn/config/global/${n}`),e.push(..._(`${t}/AppData/Local/pnpm/global/*/${n}`)),e.push(..._(`${t}/n/versions/node/*/lib/${n}`)),e.push(`${t}/AppData/Roaming/Yarn/config/global/${n}`),e.push(`${t}/AppData/Roaming/pnpm-global/${n}`),e.push(..._(`${t}/AppData/Roaming/pnpm-global/*/${n}`)),e.push(`${t}/.bun/install/global/${n}`),e.push(..._(`${t}/AppData/Local/fnm_multishells/*/node_modules/${n}`))):(process.platform==`darwin`&&(e.push(`${t}/Library/${n}`),e.push(`/opt/local/lib/${n}`)),e.push(`${t}/.local/lib/${n}`),e.push(`${t}/.local/share/${n}`),e.push(`${t}/.npm-global/${n}`),e.push(`${t}/.npm/${n}`),e.push(`${t}/npm/${n}`),e.push(`/etc/${n}`),e.push(`/lib/${n}`),e.push(`/opt/node/lib/${n}`),e.push(`/usr/lib/${n}`),e.push(`/usr/local/lib/${n}`),e.push(`/usr/share/${n}`),e.push(`/var/lib/${n}`),e.push(`/opt/homebrew/lib/${n}`),e.push(`${t}/.config/yarn/global/${n}`),e.push(`${t}/.yarn/global/${n}`),e.push(`${t}/.bun/install/global/${n}`),e.push(`${t}/.pnpm-global/${n}`),e.push(..._(`${t}/.pnpm-global/*/${n}`)),e.push(`${t}/pnpm-global/${n}`),e.push(..._(`${t}/pnpm-global/*/${n}`)),e.push(`${t}/.local/share/pnpm/global/${n}`),e.push(`${t}/.local/share/pnpm/global/*/${n}`),e.push(`${t}/.bun/install/global/${n}`),e.push(..._(`/usr/local/n/versions/node/*/lib/${n}`)),e.push(`${t}/n/versions/node/{version}/lib/${n}`),e.push(..._(`${t}/.volta/tools/image/node/*/lib/${n}`)),e.push(..._(`${t}/.fnm/node-versions/*/installation/lib/${n}`)),e.push(..._(`/usr/local/nvm/versions/node/*/lib/${n}`)),e.push(..._(`${t}/.nvm/versions/node/*/lib/${n}`)),e.push(..._(`${t}/.nodenv/versions/*/lib/${n}`)),e.push(..._(`${t}/.nvs/*/lib/${n}`))),process.platform==`win32`?e.map(e=>e.replace(/\//g,`\\`)):e},A=k(),j=({children:e,...n})=>p(t,{bold:!0,backgroundColor:`#ffd500`,color:`#000`,...n,children:[` `,e,` `]});var M=j;const N=[{name:w.THEMES,desc:`Modify Claude Code's built-in themes or create your own`},{name:w.LAUNCH_TEXT,desc:`Change the "CLAUDE CODE" banner text that's shown when you sign in to Claude Code`},{name:w.THINKING_VERBS,desc:`Customize the list of verbs that Claude Code uses when it's working`},{name:w.THINKING_STYLE,desc:`Choose custom spinners`}],P=[{name:w.RESTORE_ORIGINAL,desc:`Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)`},{name:w.OPEN_CONFIG,desc:`Opens your tweakcc config file (${D})`},{name:w.OPEN_CLI,desc:`Opens Claude Code's cli.js file`},{name:w.EXIT,desc:`Bye!`}];function F({onSubmit:n,notification:r}){let i=[...c($).changesApplied?[]:[{name:w.APPLY_CHANGES,desc:`Required: Updates Claude Code's cli.js in-place with your changes`,selectedStyles:{color:`green`}}],...N,...P],[a,o]=u(0);return p(e,{flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(M,{children:`Tweak Claude Code`})}),f(e,{marginBottom:1,children:p(t,{color:`gray`,children:[f(t,{bold:!0,children:`Customize your Claude Code installation.`}),` `,f(t,{dimColor:!0,children:`Settings will be saved to a JSON file.`})]})}),r&&f(e,{marginBottom:1,borderLeft:!0,borderRight:!1,borderTop:!1,borderBottom:!1,borderStyle:`bold`,borderColor:r?.type===`success`?`green`:r?.type===`error`?`red`:r?.type===`info`?`blue`:`yellow`,paddingLeft:1,flexDirection:`column`,children:f(t,{color:r?.type===`success`?`green`:r?.type===`error`?`red`:r?.type===`info`?`blue`:`yellow`,children:r?.message})}),f(C,{items:i,selectedIndex:a,onSelect:o,onSubmit:e=>n(e)})]})}function I({theme:n}){return p(e,{flexDirection:`column`,paddingLeft:1,children:[f(e,{marginBottom:1,children:p(t,{bold:!0,children:[`Preview: `,n.name]})}),f(e,{borderStyle:`single`,borderColor:`gray`,paddingX:1,children:p(e,{flexDirection:`column`,children:[f(t,{children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[`โ”‚ `,f(t,{color:n.colors.secondaryText,children:`1`}),` `,p(t,{color:n.colors.text,children:[`function greet() `,`{`]}),` `,`โ”‚`]}),p(t,{children:[`โ”‚ `,f(t,{color:n.colors.secondaryText,children:`2`}),` `,p(t,{backgroundColor:n.colors.diffRemoved,color:n.colors.text,children:[`- console.log("`,f(t,{backgroundColor:n.colors.diffRemovedWord,children:`Hello, World!`}),`");`]}),` `,`โ”‚`]}),p(t,{children:[`โ”‚ `,f(t,{color:n.colors.secondaryText,children:`2`}),` `,p(t,{backgroundColor:n.colors.diffAdded,color:n.colors.text,children:[`+ console.log("`,f(t,{backgroundColor:n.colors.diffAddedWord,children:`Hello, Claude!`}),`");`]}),` `,`โ”‚`]}),f(t,{color:n.colors.warning,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{color:n.colors.warning,children:[`โ”‚ Do you trust the files in this folder?`,` `,`โ”‚`]}),p(t,{children:[f(t,{color:n.colors.warning,children:`โ”‚ `}),f(t,{dimColor:!0,children:`Enter to confirm ยท Esc to exit`}),p(t,{color:n.colors.warning,children:[` `,`โ”‚`]})]}),f(t,{color:n.colors.claude,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.claude,children:`โ”‚ `}),f(t,{color:n.colors.claude,children:`โœป`}),f(t,{children:` Welcome to Tweak Claude Code!`}),p(t,{color:n.colors.claude,children:[` `,`โ”‚`]})]}),p(t,{children:[f(t,{color:n.colors.claude,children:`โ”‚`}),p(t,{color:n.colors.secondaryText,italic:!0,children:[` `,`/help for help, /status for your current set`]}),f(t,{color:n.colors.claude,children:`โ”‚`})]}),p(t,{color:n.colors.success,children:[`Login successful. Press `,f(t,{bold:!0,children:`Enter`}),` to continueโ€ฆ`]}),f(t,{color:n.colors.bashBorder,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.bashBorder,children:`โ”‚ !`}),p(t,{children:[` ls`,` `]}),f(t,{color:n.colors.bashBorder,children:`โ”‚`})]}),f(t,{color:n.colors.planMode,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.planMode,children:`โ”‚ `}),f(t,{color:n.colors.permission,children:`Ready to code?`}),p(t,{color:n.colors.planMode,children:[` `,`โ”‚`]})]}),p(t,{children:[f(t,{color:n.colors.planMode,children:`โ”‚ `}),f(t,{children:`Here is Claude's plan:`}),p(t,{color:n.colors.planMode,children:[` `,`โ”‚`]})]}),f(t,{color:n.colors.secondaryBorder,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:n.colors.secondaryBorder,children:`โ”‚`}),` `,p(t,{color:n.colors.secondaryText,children:[`> Try โ€œrefactor <filepath>โ€`,` `,`โ”‚`]})]}),f(t,{color:n.colors.permission,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[p(t,{color:n.colors.permission,children:[`โ”‚ `,f(t,{bold:!0,children:`Permissions:`})]}),` `,p(t,{backgroundColor:n.colors.permission,color:n.colors.inverseText,bold:!0,children:[` `,`Allow`,` `]}),` `,`Deny`,` `,`Workspace`,` `,f(t,{color:n.colors.permission,children:`โ”‚`})]}),f(t,{color:n.colors.secondaryText,children:`> list the dir`}),p(t,{children:[f(t,{color:n.colors.error,children:`โ—`}),f(t,{children:` Update(__init__.py)`})]}),p(t,{children:[f(t,{children:` โŽฟ `}),f(t,{color:n.colors.error,children:`User rejected update to __init__.py`})]}),p(t,{children:[` `,f(t,{color:n.colors.secondaryText,children:`1`}),` `,p(t,{backgroundColor:n.colors.diffRemovedDimmed,color:n.colors.text,children:[`- import`,` `,f(t,{backgroundColor:n.colors.diffRemovedWordDimmed,color:n.colors.text,children:`os`})]})]}),p(t,{children:[` `,f(t,{color:n.colors.secondaryText,children:`2`}),` `,p(t,{backgroundColor:n.colors.diffAddedDimmed,color:n.colors.text,children:[`+ import`,` `,f(t,{backgroundColor:n.colors.diffAddedWordDimmed,color:n.colors.text,children:`random`})]})]}),p(t,{children:[f(t,{color:n.colors.success,children:`โ—`}),f(t,{children:` List(.)`})]}),f(t,{children:` โŽฟ Listed 123 paths (ctrl+r to expand)`}),p(t,{children:[f(t,{color:n.colors.secondaryText,children:`โ—`}),f(t,{children:` The directory `}),f(t,{color:n.colors.permission,children:`C:\\Users\\user`}),f(t,{children:` contains **123** files.`})]}),p(t,{children:[p(t,{color:n.colors.claude,children:[`โœป Th`,f(t,{color:n.colors.claudeShimmer,children:`ink`}),`ingโ€ฆ`,` `]}),f(t,{color:n.colors.secondaryText,children:`(10s ยท โ†‘ 456 tokens ยท esc to interrupt)`})]}),p(t,{children:[p(t,{color:n.colors.autoAccept,children:[`โตโต auto-accept edits on`,` `]}),f(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),p(t,{children:[f(t,{color:n.colors.planMode,children:`โธ plan mode on `}),f(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),f(t,{children:f(t,{color:n.colors.ide,children:`โ—ฏ IDE connected โง‰ 44 lines selected`})}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.red_FOR_SUBAGENTS_ONLY,children:`code-reviewer`}),f(t,{children:`(Reviewing unstaged changes)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.orange_FOR_SUBAGENTS_ONLY,children:`performance`}),f(t,{children:`(Optimizing hot loop performance)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.yellow_FOR_SUBAGENTS_ONLY,children:`security-auditor`}),f(t,{children:`(Auditing codebase)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.green_FOR_SUBAGENTS_ONLY,children:`test-runner`}),f(t,{children:`(Running integration tests)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.blue_FOR_SUBAGENTS_ONLY,children:`tech-lead`}),f(t,{children:`(Planning next steps)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.cyan_FOR_SUBAGENTS_ONLY,children:`database-admin`}),f(t,{children:`(Running DB migrations)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.purple_FOR_SUBAGENTS_ONLY,children:`documentation`}),f(t,{children:`(Generating docs)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{backgroundColor:n.colors.pink_FOR_SUBAGENTS_ONLY,children:`ui-designer`}),f(t,{children:`(Designing new preview panel)`})]}),p(t,{children:[f(t,{bold:!0,color:n.colors.secondaryText,children:`โ—`}),` `,f(t,{bold:!0,inverse:!0,children:`general`}),f(t,{children:`(Reviewing architecture)`})]})]})})]})}function L({colorKey:e,theme:n,bold:r=!1}){let i=n.colors[e];return e===`inverseText`?f(t,{color:i,backgroundColor:n.colors.permission,bold:r,children:e}):e.startsWith(`diff`)?f(t,{backgroundColor:i,bold:r,color:n.colors.text,children:e}):f(t,{color:i,bold:r,children:e})}function R(){try{let e=m.join(g.homedir(),`.claude.json`),t=JSON.parse(v.readFileSync(e,`utf8`));return t.theme||`dark`}catch{}return`dark`}function z(e){if(process.platform===`win32`)y.spawn(`explorer`,[`/select,`,e],{detached:!0,stdio:`ignore`}).unref();else if(process.platform===`darwin`)y.spawn(`open`,[`-R`,e],{detached:!0,stdio:`ignore`}).unref();else{let t=m.dirname(e);y.spawn(`xdg-open`,[t],{detached:!0,stdio:`ignore`}).unref()}}function B(e){if(!e||typeof e!=`string`)return!1;let 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)){let e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(e){let[,t,n,r]=e;return parseInt(t)<=255&&parseInt(n)<=255&&parseInt(r)<=255}}if(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/.test(t)){let e=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(e){let[,t,n,r]=e;return parseInt(t)<=360&&parseInt(n)<=100&&parseInt(r)<=100}}return!1}function V(e){if(!B(e))return e;let t=e.trim();if(t.startsWith(`rgb(`))return t;if(t.startsWith(`#`)){let e=t.slice(1);e.length===3&&(e=e.split(``).map(e=>e+e).join(``));let n=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),i=parseInt(e.slice(4,6),16);return`rgb(${n},${r},${i})`}if(t.startsWith(`hsl(`)){let e=t.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(e){let t=parseInt(e[1])/360,n=parseInt(e[2])/100,r=parseInt(e[3])/100,i=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),a=r<.5?r*(1+n):r+n-r*n,o=2*r-a,s=Math.round(i(o,a,t+1/3)*255),c=Math.round(i(o,a,t)*255),l=Math.round(i(o,a,t-1/3)*255);return`rgb(${s},${c},${l})`}}return e}function H({initialValue:n,onColorChange:i,onExit:o,onCancel:s,colorKey:c,theme:m}){let h=W(n)||{h:0,s:50,l:50},g=U(n)||{r:128,g:128,b:128},[_,v]=u(h),[y,b]=u(g),[x,S]=u(`hsl`),[C,w]=u(`h`),[T,E]=u(!1);l(()=>{let e=W(n),t=U(n);e&&t&&(E(!0),v(e),b(t),E(!1))},[n]),l(()=>{if(!T){let e=`rgb(${y.r},${y.g},${y.b})`;i(e)}},[_,y,T]);let D=e=>{if(B(e)){let t=V(e),n=W(t),r=U(t);n&&r&&(E(!0),v(n),b(r),E(!1))}};r((e,t)=>{if(e.length>1&&!t.ctrl&&!t.meta){D(e);return}if(t.return)o();else if(t.escape)s();else if(t.ctrl&&e===`a`)S(e=>e===`hsl`?`rgb`:`hsl`),w(e=>x===`hsl`?e===`h`?`r`:e===`s`?`g`:`b`:e===`r`?`h`:e===`g`?`s`:`l`);else if(t.upArrow)w(x===`hsl`?e=>e===`h`?`l`:e===`s`?`h`:`s`:e=>e===`r`?`b`:e===`g`?`r`:`g`);else if(t.downArrow||t.tab)w(x===`hsl`?e=>e===`h`?`s`:e===`s`?`l`:`h`:e=>e===`r`?`g`:e===`g`?`b`:`r`);else if(t.leftArrow){let e=t.shift||t.ctrl||t.meta?-10:-1;O(e)}else if(t.rightArrow){let e=t.shift||t.ctrl||t.meta?10:1;O(e)}});let O=e=>{E(!0),x===`hsl`?v(t=>{let n={...t};C===`h`?n.h=Math.max(0,Math.min(359,t.h+e)):C===`s`?n.s=Math.max(0,Math.min(100,t.s+e)):C===`l`&&(n.l=Math.max(0,Math.min(100,t.l+e)));let[r,i,a]=A(n.h,n.s,n.l);return b({r,g:i,b:a}),n}):b(t=>{let n={...t};C===`r`?n.r=Math.max(0,Math.min(255,t.r+e)):C===`g`?n.g=Math.max(0,Math.min(255,t.g+e)):C===`b`&&(n.b=Math.max(0,Math.min(255,t.b+e)));let r=k(n.r,n.g,n.b);return v(r),n}),E(!1)},k=(e,t,n)=>{let r=e/255,i=t/255,a=n/255,o=Math.max(r,i,a),s=Math.min(r,i,a),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===r?((i-a)/c+(i<a?6:0))/6:o===i?((a-r)/c+2)/6:((r-i)/c+4)/6),{h:Math.round(d*360),s:Math.round(u*100),l:Math.round(l*100)}},A=(e,t,n)=>{e/=360,t/=100,n/=100;let r=(1-Math.abs(2*n-1))*t,i=r*(1-Math.abs(e*6%2-1)),a=n-r/2,o=0,s=0,c=0;return 0<=e&&e<1/6?(o=r,s=i,c=0):1/6<=e&&e<2/6?(o=i,s=r,c=0):2/6<=e&&e<3/6?(o=0,s=r,c=i):3/6<=e&&e<4/6?(o=0,s=i,c=r):4/6<=e&&e<5/6?(o=i,s=0,c=r):5/6<=e&&e<1&&(o=r,s=0,c=i),[Math.round((o+a)*255),Math.round((s+a)*255),Math.round((c+a)*255)]},j=()=>{let e=[],n=[[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 r=0;r<40;r++){let i=r/39,a=i*(n.length-1),o=Math.floor(a),s=Math.ceil(a),c=a-o,[l,u,d]=n[o],[p,m,h]=n[s],g=Math.round(l+(p-l)*c),_=Math.round(u+(m-u)*c),v=Math.round(d+(h-d)*c);e.push(f(t,{backgroundColor:`rgb(${g},${_},${v})`,children:` `},r))}return e},M=()=>{let e=[];for(let n=0;n<40;n++){let r=n/39*100,[i,a,o]=A(_.h,r,_.l);e.push(f(t,{backgroundColor:`rgb(${i},${a},${o})`,children:` `},n))}return e},N=()=>{let e=[];for(let n=0;n<40;n++){let r=n/39*100,[i,a,o]=A(_.h,_.s,r);e.push(f(t,{backgroundColor:`rgb(${i},${a},${o})`,children:` `},n))}return e},P=()=>{let[e,t,n]=A(_.h,_.s,_.l);return`rgb(${e},${t},${n})`},F=(e,t,n)=>{let r=e=>e.toString(16).padStart(2,`0`);return`#${r(e)}${r(t)}${r(n)}`},I=()=>{let e=[];for(let n=0;n<40;n++){let r=Math.round(n/39*255);e.push(f(t,{backgroundColor:`rgb(${r},${y.g},${y.b})`,children:` `},n))}return e},L=()=>{let e=[];for(let n=0;n<40;n++){let r=Math.round(n/39*255);e.push(f(t,{backgroundColor:`rgb(${y.r},${r},${y.b})`,children:` `},n))}return e},R=()=>{let e=[];for(let n=0;n<40;n++){let r=Math.round(n/39*255);e.push(f(t,{backgroundColor:`rgb(${y.r},${y.g},${r})`,children:` `},n))}return e},z=(e,t)=>Math.round(e/t*39);return p(e,{flexDirection:`column`,borderStyle:`single`,borderColor:`white`,padding:1,children:[p(e,{flexDirection:`column`,children:[f(t,{bold:!0,children:`Color Picker`}),p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{color:`gray`,dimColor:!0,children:`โ†โ†’ to adjust (shift/ctrl/cmd +10)`}),f(t,{color:`gray`,dimColor:!0,children:`โ†‘โ†“ to change bar`}),f(t,{color:`gray`,dimColor:!0,children:`ctrl+a to switch rgb/hsl`}),f(t,{color:`gray`,dimColor:!0,children:`paste color from clipboard`}),f(t,{color:`gray`,dimColor:!0,children:`enter to exit (auto-saved)`}),f(t,{color:`gray`,dimColor:!0,children:`esc to cancel changes`})]})]}),x===`hsl`?p(d,{children:[p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`h`?`yellow`:`white`,children:[C===`h`?`โฏ `:` `,`Hue (`,_.h,`ยฐ):`]})}),f(e,{children:j().map((e,n)=>f(a,{children:n===z(_.h,360)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`s`?`yellow`:`white`,children:[C===`s`?`โฏ `:` `,`Saturation (`,_.s,`%):`]})}),f(e,{children:M().map((e,n)=>f(a,{children:n===z(_.s,100)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`l`?`yellow`:`white`,children:[C===`l`?`โฏ `:` `,`Lightness (`,_.l,`%):`]})}),f(e,{children:N().map((e,n)=>f(a,{children:n===z(_.l,100)?f(t,{children:`|`}):e},n))})]})]}):p(d,{children:[p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`r`?`yellow`:`white`,children:[C===`r`?`โฏ `:` `,`Red (`,y.r,`):`]})}),f(e,{children:I().map((e,n)=>f(a,{children:n===z(y.r,255)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`g`?`yellow`:`white`,children:[C===`g`?`โฏ `:` `,`Green (`,y.g,`):`]})}),f(e,{children:L().map((e,n)=>f(a,{children:n===z(y.g,255)?f(t,{children:`|`}):e},n))})]}),p(e,{marginBottom:1,children:[f(e,{width:25,children:p(t,{color:C===`b`?`yellow`:`white`,children:[C===`b`?`โฏ `:` `,`Blue (`,y.b,`):`]})}),f(e,{children:R().map((e,n)=>f(a,{children:n===z(y.b,255)?f(t,{children:`|`}):e},n))})]})]}),p(e,{marginBottom:1,children:[f(t,{children:`Current: `}),f(t,{backgroundColor:P(),children:` `})]}),p(e,{flexDirection:`row`,justifyContent:`space-between`,children:[p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:`Hex `}),c?.startsWith(`diff`)?f(t,{backgroundColor:P(),color:m?.colors?.text||`white`,bold:!0,children:F(y.r,y.g,y.b)}):c===`inverseText`?f(t,{color:P(),backgroundColor:m?.colors?.permission,bold:!0,children:F(y.r,y.g,y.b)}):f(t,{color:P(),bold:!0,children:F(y.r,y.g,y.b)})]}),p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:`RGB `}),c?.startsWith(`diff`)?f(t,{backgroundColor:P(),color:m?.colors?.text||`white`,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):c===`inverseText`?f(t,{color:P(),backgroundColor:m?.colors?.permission,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):f(t,{color:P(),bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`})]}),p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:`HSL `}),c?.startsWith(`diff`)?f(t,{backgroundColor:P(),color:m?.colors?.text||`white`,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):c===`inverseText`?f(t,{color:P(),backgroundColor:m?.colors?.permission,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):f(t,{color:P(),bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`})]})]})]})}function U(e){let t=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(t)return{r:parseInt(t[1]),g:parseInt(t[2]),b:parseInt(t[3])};let n=e.match(/^#([a-fA-F0-9]{6})$/);if(n){let e=n[1];return{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16)}}return null}function W(e){let t=e.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);if(t)return{h:parseInt(t[1]),s:parseInt(t[2]),l:parseInt(t[3])};let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(n){let e=parseInt(n[1])/255,t=parseInt(n[2])/255,r=parseInt(n[3])/255,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a,s=(i+a)/2,c=0;o!==0&&(c=s>.5?o/(2-i-a):o/(i+a));let l=0;return o!==0&&(l=i===e?((t-r)/o+(t<r?6:0))/6:i===t?((r-e)/o+2)/6:((e-t)/o+4)/6),{h:Math.round(l*360),s:Math.round(c*100),l:Math.round(s*100)}}let r=e.match(/^#([a-fA-F0-9]{6})$/);if(r){let e=r[1],t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,i=parseInt(e.substr(4,2),16)/255,a=Math.max(t,n,i),o=Math.min(t,n,i),s=a-o,c=(a+o)/2,l=0;s!==0&&(l=c>.5?s/(2-a-o):s/(a+o));let u=0;return s!==0&&(u=a===t?((n-i)/s+(n<i?6:0))/6:a===n?((i-t)/s+2)/6:((t-n)/s+4)/6),{h:Math.round(u*360),s:Math.round(l*100),l:Math.round(c*100)}}return{h:0,s:50,l:50}}function G({onBack:n,themeId:i}){let{settings:{themes:a},updateSettings:o}=c($),[l,m]=u(i),h=a.find(e=>e.id===l)||a[0],[g,_]=u(`rgb`),[v,y]=u(0),[b,x]=u(null),[S,C]=u(null),[w,T]=u(``),[E,D]=u(``),O=s(e=>{o(t=>{let n=t.themes.findIndex(e=>e.id===l);n!==-1&&e(t.themes[n])})},[l,o]),k=e=>{if(v>=2&&B(e)){let t=V(e),n=v-2,r=A[n];O(e=>{e.colors[r]=t})}};r((e,t)=>{if(b===null&&S===null){if(e.length>1&&!t.ctrl&&!t.meta){k(e);return}if(t.escape)n();else if(t.ctrl&&e===`a`)_(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(t.upArrow)y(e=>Math.max(0,e-1));else if(t.downArrow)y(e=>Math.min(A.length+1,e+1));else if(t.return)if(v===0)C(`name`),T(h.name),D(h.name);else if(v===1)C(`id`),T(h.id),D(h.id);else{let e=v-2,t=A[e],n=h.colors[t];x(e),T(n),D(n)}}else if(b!==null)t.ctrl&&e===`a`&&_(e=>e===`rgb`?`hex`:e===`hex`?`hsl`:`rgb`);else if(S!==null)if(t.return){if(S===`id`){let e=l;m(w),o(t=>{let n=t.themes.findIndex(t=>t.id===e);n!==-1&&(t.themes[n].id=w)})}else O(e=>{e.name=w});C(null),T(``),D(``)}else t.escape?(C(null),T(``),D(``)):t.backspace||t.delete?T(e=>e.slice(0,-1)):e&&T(t=>t+e)});let A=Object.keys(h.colors),j=(e,t)=>{let n=e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(!n)return e;let r=parseInt(n[1]),i=parseInt(n[2]),a=parseInt(n[3]);switch(t){case`hex`:{let e=e=>e.toString(16).padStart(2,`0`);return`#${e(r)}${e(i)}${e(a)}`}case`hsl`:{let e=r/255,t=i/255,n=a/255,o=Math.max(e,t,n),s=Math.min(e,t,n),c=o-s,l=(o+s)/2,u=0;c!==0&&(u=l>.5?c/(2-o-s):c/(o+s));let d=0;return c!==0&&(d=o===e?((t-n)/c+(t<n?6:0))/6:o===t?((n-e)/c+2)/6:((e-t)/c+4)/6),`hsl(${Math.round(d*360)}, ${Math.round(u*100)}%, ${Math.round(l*100)}%)`}case`rgb`:default:return e}},N=e=>{let t={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.`,text:`Code color. Used in diffs.`,inverseText:`Inverse text color. Used for the text of tabs, where the background is filled in.`,secondaryText:`Secondary/dimmed text. Used for keyboard shortcuts and other help text.`,secondaryBorder:`Secondary border color. Used for various boxes.`,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.`,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`,autoAccept:`Auto-accept mode indicator`,bashBorder:`Bash command border`,permission:`Permission prompt color`,planMode:`Plan mode indicator`,ide:`Color used for IDE-related messages.`,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`};return t[e]||``},P=Math.max(...A.map(e=>e.length));return p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[f(e,{children:p(M,{children:[`Editing theme โ€œ`,h.name,`โ€ (`,h.id,`)`]})}),b===null&&S===null?p(d,{children:[p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{dimColor:!0,children:`enter to edit theme name, id, or color`}),f(t,{dimColor:!0,children:`ctrl+a to toggle rgb, hex, hsl`}),f(t,{dimColor:!0,children:`paste color from clipboard (when on color)`}),f(t,{dimColor:!0,children:`esc to go back`})]}),v<2?p(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:`yellow`,flexDirection:`column`,paddingLeft:1,children:[f(t,{bold:!0,children:v===0?`Theme Name`:`Theme ID`}),f(t,{children:v===0?`The display name for this theme`:"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):p(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:h.colors[A[v-2]],flexDirection:`column`,paddingLeft:1,children:[f(L,{colorKey:A[v-2],theme:h,bold:!0}),f(t,{children:N(A[v-2])})]}),p(e,{flexDirection:`column`,children:[p(e,{children:[f(t,{color:v===0?`yellow`:`white`,children:v===0?`โฏ `:` `}),f(t,{bold:!0,children:`Name: `}),f(t,{children:h.name})]}),p(e,{marginBottom:1,children:[f(t,{color:v===1?`yellow`:`white`,children:v===1?`โฏ `:` `}),f(t,{bold:!0,children:`ID: `}),f(t,{children:h.id})]}),A.map((n,r)=>{let i=r+2;return p(e,{children:[f(t,{color:v===i?`yellow`:`white`,children:v===i?`โฏ `:` `}),f(e,{width:P+2,children:f(t,{children:f(L,{colorKey:n,theme:h,bold:!0})})}),f(t,{color:h.colors[n],children:j(h.colors[n],g)})]},n)})]})]}):S?p(e,{flexDirection:`column`,marginTop:1,children:[p(t,{children:[`Editing `,S===`name`?`theme name`:`theme ID`,`:`]}),f(e,{borderStyle:`round`,borderColor:`yellow`,paddingX:1,children:f(t,{children:w})}),f(t,{dimColor:!0,children:`enter to save, esc to cancel`})]}):f(H,{initialValue:E,colorKey:A[b],theme:h,onColorChange:e=>{T(e),O(t=>{t.colors[A[b]]=e})},onExit:()=>{O(e=>{e.colors[A[b]]=w}),x(null),T(``),D(``)},onCancel:()=>{O(e=>{e.colors[A[b]]=E}),x(null),T(``),D(``)}})]}),f(e,{width:`50%`,children:f(I,{theme:h})})]})}function K(e){return e.map(e=>`${e.name} (${e.id})`)}function ee({onBack:n}){let{settings:{themes:i},updateSettings:a}=c($),[o,s]=u(0),[l,d]=u(null),[m,h]=u(!0),g=()=>{let e=i[0]||T.themes[0],t={colors:{...e.colors},name:`New Custom Theme`,id:`custom-${Date.now()}`};a(e=>{e.themes.push(t)}),d(t.id),h(!1)},_=e=>{i.length<=1||(a(t=>{t.themes=t.themes.filter(t=>t.id!==e)}),o>=i.length-1&&s(Math.max(0,i.length-2)))},v=()=>{a(e=>{e.themes=[...T.themes]}),s(0)};if(r((e,t)=>{if(t.escape)n();else if(t.upArrow)s(e=>Math.max(0,e-1));else if(t.downArrow)s(e=>Math.min(i.length-1,e+1));else if(t.return){let e=i[o];e&&(d(e.id),h(!1))}else if(e===`n`)g();else if(e===`d`){let e=i[o];e&&_(e.id)}else t.ctrl&&e===`r`&&v()},{isActive:m}),l)return f(G,{themeId:l,onBack:()=>{d(null),h(!0)}});let y=K(i),b=i.find(e=>y[o]?.includes(`(${e.id})`))||i[0];return i.length===0?f(e,{children:p(e,{flexDirection:`column`,width:`100%`,children:[f(M,{children:`Themes`}),p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{dimColor:!0,children:`n to create a new theme`}),f(t,{dimColor:!0,children:`esc to go back`})]}),f(t,{children:`No themes available!`})]})}):p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[f(M,{children:`Themes`}),p(e,{marginBottom:1,flexDirection:`column`,children:[f(t,{dimColor:!0,children:`n to create a new theme`}),f(t,{dimColor:!0,children:`d to delete a theme`}),f(t,{dimColor:!0,children:`ctrl+r to delete all themes and restore built-in`}),f(t,{dimColor:!0,children:`enter to edit theme`}),f(t,{dimColor:!0,children:`esc to go back`})]}),f(e,{flexDirection:`column`,children:y.map((e,n)=>p(t,{color:o===n?`yellow`:void 0,children:[o===n?`โฏ `:` `,e]},n))})]}),f(e,{width:`50%`,children:f(I,{theme:b})})]})}let q=[`ANSI Shadow`];function J({onBack:n}){let{stdout:a}=i(),o=a?.columns||120,{settings:{launchText:{method:s,figletText:m,figletFont:h,customText:g},themes:_},updateSettings:v}=c($),y=s===`figlet`?[`method`,`text`,`font`]:[`method`,`text`],[x,S]=u(0),C=y[x],[w,T]=u(s===`figlet`?0:1),[E,D]=u(q),[O,k]=u(q),[A,j]=u(``),[N,P]=u(!1),[F,I]=u(0),[L,z]=u(``),[B,V]=u(50),[H,U]=u(!1),[W,G]=u(s===`figlet`?m:g),K=R(),ee=_.find(e=>e.id===K)||_.find(e=>e.id===`dark`),J=ee?.colors.claude||`rgb(215,119,87)`;l(()=>{b.fonts((e,t)=>{if(!e&&t){let e=t.sort();D(e),k(e),q=e;let n=e.indexOf(h);I(n>=0?n:e.indexOf(`ANSI Shadow`)||0)}})},[]),l(()=>{te()},[s,m,h,g,W,H]);let te=()=>{if(s===`figlet`)try{let e=H?W:m,t=b.textSync(e.replace(`
3
3
  `,` `),{font:h}),n=Math.floor(o*.7),r=t.split(`
4
4
  `),i=r.map(e=>e.length>n?e.substring(0,n-3)+`โ€ฆ`:e),a=i.join(`
5
- `);R(a);let s=Math.max(...i.map(e=>e.length)),c=Math.min(75,Math.max(50,Math.ceil(s/o*100)));B(c+5)}catch{R(`Error generating figlet text`),B(50)}else{let e=Math.floor(o*.6),t=V?U:g,n=t.split(`
5
+ `);z(a);let s=Math.max(...i.map(e=>e.length)),c=Math.min(75,Math.max(50,Math.ceil(s/o*100)));V(c+5)}catch{z(`Error generating figlet text`),V(50)}else{let e=Math.floor(o*.6),t=H?W:g,n=t.split(`
6
6
  `),r=n.map(t=>t.length>e?t.substring(0,e-3)+`...`:t),i=r.join(`
7
- `);R(i);let a=Math.max(...r.map(e=>e.length)),s=Math.min(75,Math.max(50,Math.ceil(a/o*100)));B(s+5)}};return l(()=>{if(A){let e=E.filter(e=>e.toLowerCase().includes(A.toLowerCase()));k(e),I(0)}else{k(E);let e=E.indexOf(h);I(e>=0?e:0)}},[A,E]),l(()=>{if(!M){let e=O.indexOf(h);e>=0&&I(e)}},[h,O,M]),r((e,t)=>{if(V){t.return?(v(s===`figlet`?e=>{e.launchText.figletText=U}:e=>{e.launchText.customText=U}),H(!1)):t.escape?(G(s===`figlet`?m:g),H(!1)):t.backspace||t.delete?G(e=>e.slice(0,-1)):e&&G(t=>t+e);return}if(M){if(t.return)O.length>0&&v(e=>{e.launchText.figletFont=O[F]}),N(!1),j(``);else if(t.escape)N(!1),j(``);else if(t.backspace||t.delete)j(e=>e.slice(0,-1));else if(t.upArrow){let e=F>0?F-1:O.length-1;I(e),O.length>0&&v(t=>{t.launchText.figletFont=O[e]})}else if(t.downArrow){let e=F<O.length-1?F+1:0;I(e),O.length>0&&v(t=>{t.launchText.figletFont=O[e]})}else e&&e.match(/^[a-zA-Z0-9\s\-_]$/)&&j(t=>t+e);return}if(t.escape)n();else if(t.return)C===`text`&&(G(s===`figlet`?m:g),H(!0));else if(t.tab)t.shift?S(e=>e===0?b.length-1:e-1):S(e=>e===b.length-1?0:e+1);else if(t.upArrow){if(C===`method`){let e=w>0?w-1:1;T(e),v(t=>{t.launchText.method=e===0?`figlet`:`custom`})}else if(C===`font`&&s===`figlet`){let e=F>0?F-1:O.length-1;I(e),v(t=>{t.launchText.figletFont=O[e]})}}else if(t.downArrow){if(C===`method`){let e=w<1?w+1:0;T(e),v(t=>{t.launchText.method=e===0?`figlet`:`custom`})}else if(C===`font`&&s===`figlet`){let e=F<O.length-1?F+1:0;I(e),v(t=>{t.launchText.figletFont=O[e]})}}else e&&C===`font`&&s===`figlet`&&e.match(/^[a-zA-Z0-9]$/)&&(N(!0),j(e))}),p(e,{children:[p(e,{flexDirection:`column`,width:`${100-z}%`,children:[p(e,{marginBottom:1,flexDirection:`column`,children:[p(t,{bold:!0,backgroundColor:`#ffd500`,color:`black`,children:[` `,`Setup banner`,` `]}),f(e,{children:p(t,{dimColor:!0,children:[`enter to `,C===`text`?`edit text`:`save`]})}),f(e,{children:f(t,{dimColor:!0,children:`esc to go back`})})]}),f(e,{children:p(t,{children:[f(t,{color:C===`method`?`yellow`:void 0,children:C===`method`?`โฏ `:` `}),f(t,{bold:!0,color:C===`method`?`yellow`:void 0,children:`Method`})]})}),C===`method`&&p(t,{dimColor:!0,children:[` `,`select one of `,O.length,` Figlet fonts or enter your own text`]}),f(e,{marginLeft:2,marginBottom:1,children:p(e,{flexDirection:`column`,children:[p(t,{color:w===0?`cyan`:`white`,children:[w===0?`โฏ `:` `,`Figlet`]}),p(t,{color:w===1?`cyan`:`white`,children:[w===1?`โฏ `:` `,`Custom`]})]})}),p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:C===`text`?`yellow`:void 0,children:C===`text`?`โฏ `:` `}),f(t,{bold:!0,color:C===`text`?`yellow`:void 0,children:`Text`})]}),C===`text`&&(V?p(t,{dimColor:!0,children:[` `,`esc to save`]}):p(t,{dimColor:!0,children:[` `,`enter to edit`]}))]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{borderStyle:`round`,borderColor:V?`yellow`:`gray`,children:f(t,{children:V?U:s===`figlet`?m:g})})}),s===`figlet`&&p(d,{children:[f(e,{children:p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:C===`font`?`yellow`:void 0,children:C===`font`?`โฏ `:` `}),f(t,{bold:!0,color:C===`font`?`yellow`:void 0,children:`Font`})]}),C===`font`&&p(t,{dimColor:!0,children:[` `,`type to filter`]}),f(t,{children:M&&p(t,{color:`gray`,dimColor:!0,children:[` `,`(filtering: โ€œ`,A,`โ€)`]})})]})}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{flexDirection:`column`,children:(()=>{let e=Math.max(0,F-4),n=Math.min(O.length,e+8),r=Math.max(0,n-8),i=O.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),i.map((e,n)=>{let i=r+n;return p(t,{color:F===i?`cyan`:void 0,children:[F===i?`โฏ `:` `,e]},e)}),n<O.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,O.length-n,` more below`]})]})})()})})]})]}),p(e,{width:`${z}%`,flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(t,{bold:!0,children:`Preview`})}),p(e,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:[p(e,{flexDirection:`column`,marginBottom:1,children:[f(t,{color:q,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:q,children:`โ”‚ โœป`}),` Welcome to Claude Code`,` `,f(t,{color:q,children:`โ”‚`})]}),f(t,{color:q,children:`โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ`})]}),L.split(`
8
- `).map((e,n)=>f(t,{color:q,children:e},n)),f(e,{marginTop:1,children:f(t,{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 ee({onBack:n}){let{settings:{thinkingVerbs:{punctuation:i,verbs:a},themes:o},updateSettings:s}=c($),l=[`punctuation`,`verbs`],[m,h]=u(0),g=l[m],[_,v]=u(0),[y,b]=u(!1),[x,S]=u(``),[C,T]=u(!1),[E,D]=u(!1),[O,k]=u(i),A=P(),j=o.find(e=>e.id===A)||o.find(e=>e.id===`dark`),M=j?.colors.claude||`rgb(215,119,87)`;return r((e,t)=>{if(E){t.return?(s(e=>{e.thinkingVerbs.punctuation=O}),D(!1)):t.escape?(k(i),D(!1)):t.backspace||t.delete?k(e=>e.slice(0,-1)):e&&k(t=>t+e);return}if(y||C){t.return&&x.trim()?(C?(s(e=>{e.thinkingVerbs.verbs.push(x.trim())}),T(!1)):(s(e=>{e.thinkingVerbs.verbs[_]=x.trim()}),b(!1)),S(``)):t.escape?(S(``),b(!1),T(!1)):t.backspace||t.delete?S(e=>e.slice(0,-1)):e&&S(t=>t+e);return}t.escape?n():t.return?g===`punctuation`&&(k(i),D(!0)):t.tab?t.shift?h(e=>e===0?l.length-1:e-1):h(e=>e===l.length-1?0:e+1):t.upArrow?g===`verbs`&&a.length>0&&v(e=>e>0?e-1:a.length-1):t.downArrow?g===`verbs`&&a.length>0&&v(e=>e<a.length-1?e+1:0):e===`e`&&g===`verbs`?a.length>0&&(S(a[_]),b(!0)):e===`d`&&g===`verbs`?a.length>1&&(s(e=>{e.thinkingVerbs.verbs=e.thinkingVerbs.verbs.filter((e,t)=>t!==_)}),_>=a.length-1&&v(Math.max(0,a.length-2))):e===`n`&&g===`verbs`?(T(!0),S(``)):t.ctrl&&e===`r`&&g===`verbs`&&(s(e=>{e.thinkingVerbs.verbs=[...w.thinkingVerbs.verbs]}),v(0))}),p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[p(e,{marginBottom:1,flexDirection:`column`,children:[p(t,{bold:!0,backgroundColor:`#ffd500`,color:`black`,children:[` `,`Thinking verbs`,` `]}),f(e,{children:f(t,{dimColor:!0,children:g===`punctuation`?`enter to edit punctuation`:`changes auto-saved`})}),f(e,{children:f(t,{dimColor:!0,children:`esc to go back`})})]}),f(e,{marginBottom:1,children:f(t,{dimColor:!0,children:`Customize the verbs shown during generation with custom punctuation.`})}),p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:g===`punctuation`?`yellow`:void 0,children:g===`punctuation`?`โฏ `:` `}),f(t,{bold:!0,color:g===`punctuation`?`yellow`:void 0,children:`Punctuation`})]}),g===`punctuation`&&(E?p(t,{dimColor:!0,children:[` `,`enter to save`]}):p(t,{dimColor:!0,children:[` `,`enter to edit`]}))]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{borderStyle:`round`,borderColor:E?`yellow`:`gray`,children:f(t,{children:E?O:i})})}),f(e,{children:p(t,{children:[f(t,{color:g===`verbs`?`yellow`:void 0,children:g===`verbs`?`โฏ `:` `}),f(t,{bold:!0,color:g===`verbs`?`yellow`:void 0,children:`Verbs`})]})}),g===`verbs`&&f(e,{flexDirection:`column`,children:p(t,{dimColor:!0,children:[` `,`e to edit ยท d to delete ยท n to add new ยท ctrl+r to reset`]})}),f(e,{marginLeft:2,marginBottom:1,children:p(e,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,_-4),n=Math.min(a.length,e+8),r=Math.max(0,n-8),i=a.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),i.map((e,n)=>{let i=r+n;return p(t,{color:g===`verbs`&&i===_?`cyan`:void 0,children:[g===`verbs`&&i===_?`โฏ `:` `,e]},i)}),n<a.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,a.length-n,` more below`]})]})})(),C&&p(e,{alignItems:`center`,children:[f(t,{color:`yellow`,children:`โฏ `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:x})})]}),y&&p(e,{marginTop:1,alignItems:`center`,children:[f(t,{children:`Editing: `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:x})})]})]})})]}),p(e,{width:`50%`,flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(t,{bold:!0,children:`Preview`})}),f(e,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:p(t,{children:[p(t,{color:M,children:[`โœป `,a[_],i,` `]}),f(t,{color:j?.colors.secondaryText,children:`(10s ยท โ†‘ 456 tokens ยท esc to interrupt)`})]})})]})]})}const K=[{name:`Default`,phases:w.thinkingStyle.phases,reverseMirror:w.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 q({onBack:n}){let{settings:{thinkingStyle:{phases:i,updateInterval:a,reverseMirror:o},themes:s},updateSettings:m}=c($),h=[`reverseMirror`,`updateInterval`,`phases`,`presets`],[g,_]=u(0),v=h[g],[y,b]=u(0),[x,S]=u(0),[C,T]=u(!1),[E,D]=u(``),[O,k]=u(!1),[A,j]=u(!1),[M,N]=u(a.toString()),[F,I]=u(0),L=P(),R=s.find(e=>e.id===L)||s.find(e=>e.id===`dark`),z=R?.colors.claude||`rgb(215,119,87)`;l(()=>{if(i.length>0){let e=o?[...i,...[...i].reverse().slice(1,-1)]:i,t=setInterval(()=>{I(t=>(t+1)%e.length)},a);return()=>clearInterval(t)}},[i,a,o]),r((e,t)=>{if(A){if(t.return){let e=parseInt(M);!isNaN(e)&&e>0&&m(t=>{t.thinkingStyle.updateInterval=e}),j(!1)}else t.escape?(N(a.toString()),j(!1)):t.backspace||t.delete?N(e=>e.slice(0,-1)):e&&e.match(/^[0-9]$/)&&N(t=>t+e);return}if(C||O){if(t.return&&E.trim()){let e=O?[...i,E.trim()]:i.map((e,t)=>t===y?E.trim():e);m(t=>{t.thinkingStyle.phases=e}),T(!1),D(``)}else t.escape?(D(``),T(!1),k(!1)):t.backspace||t.delete?D(e=>e.slice(0,-1)):e&&D(t=>t+e);return}if(t.escape)n();else if(t.return)if(v===`updateInterval`)N(a.toString()),j(!0);else if(v===`presets`){let e=K[x];m(t=>{t.thinkingStyle.phases=[...e.phases],t.thinkingStyle.reverseMirror=e.reverseMirror})}else v===`reverseMirror`&&m(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(t.tab)t.shift?_(e=>e===0?h.length-1:e-1):_(e=>e===h.length-1?0:e+1);else if(t.upArrow)v===`phases`&&i.length>0?b(e=>e>0?e-1:i.length-1):v===`presets`&&S(e=>e>0?e-1:K.length-1);else if(t.downArrow)v===`phases`&&i.length>0?b(e=>e<i.length-1?e+1:0):v===`presets`&&S(e=>e<K.length-1?e+1:0);else if(e===` `)v===`reverseMirror`&&m(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(e===`e`&&v===`phases`)i.length>0&&(D(i[y]),T(!0));else if(e===`a`&&v===`phases`)k(!0),D(``);else if(e===`d`&&v===`phases`)i.length>1&&(m(e=>{e.thinkingStyle.phases=i.filter((e,t)=>t!==y)}),y>=i.length&&b(Math.max(0,i.length-1)));else if(e===`w`&&v===`phases`){if(y>0){let e=[...i];[e[y-1],e[y]]=[e[y],e[y-1]],m(t=>{t.thinkingStyle.phases=e}),b(e=>e-1)}}else if(e===`s`&&v===`phases`){if(y<i.length-1){let e=[...i];[e[y],e[y+1]]=[e[y+1],e[y]],m(t=>{t.thinkingStyle.phases=e}),b(e=>e+1)}}else t.ctrl&&e===`r`&&(m(e=>{e.thinkingStyle=w.thinkingStyle}),b(0),S(0))});let B=o?`x`:` `,V=()=>o?[...i,...[...i].reverse().slice(1,-1)]:i,H=V(),U=H.length>0?H[F]:`ยท`;return p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[p(e,{marginBottom:1,flexDirection:`column`,children:[p(t,{bold:!0,backgroundColor:`#ffd500`,color:`black`,children:[` `,`Thinking style`,` `]}),f(e,{children:p(t,{dimColor:!0,children:[`enter to`,` `,v===`updateInterval`?`edit interval`:v===`presets`?`apply preset`:`save`]})}),f(e,{children:f(t,{dimColor:!0,children:`esc to go back`})})]}),f(e,{children:p(t,{children:[f(t,{color:v===`reverseMirror`?`yellow`:void 0,children:v===`reverseMirror`?`โฏ `:` `}),f(t,{bold:!0,color:v===`reverseMirror`?`yellow`:void 0,children:`Reverse-mirror phases`})]})}),v===`reverseMirror`&&p(t,{dimColor:!0,children:[` `,`space to toggle`]}),f(e,{marginLeft:2,marginBottom:1,children:p(t,{children:[`[`,B,`] `,o?`Enabled`:`Disabled`]})}),p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:v===`updateInterval`?`yellow`:void 0,children:v===`updateInterval`?`โฏ `:` `}),f(t,{bold:!0,color:v===`updateInterval`?`yellow`:void 0,children:`Update interval (ms)`})]}),v===`updateInterval`&&(A?p(t,{dimColor:!0,children:[` `,`enter to save`]}):p(t,{dimColor:!0,children:[` `,`enter to edit`]}))]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{borderStyle:`round`,borderColor:A?`yellow`:`gray`,children:f(t,{children:A?M:a})})}),f(e,{children:p(t,{children:[f(t,{color:v===`phases`?`yellow`:void 0,children:v===`phases`?`โฏ `:` `}),f(t,{bold:!0,color:v===`phases`?`yellow`:void 0,children:`Phases`})]})}),v===`phases`&&f(e,{marginBottom:1,flexDirection:`column`,children:p(t,{dimColor:!0,children:[` `,`e to edit ยท a to add ยท d to delete ยท w to move up ยท s to move down`]})}),f(e,{marginLeft:2,marginBottom:1,children:p(e,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,y-4),n=Math.min(i.length,e+8),r=Math.max(0,n-8),a=i.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),a.map((e,n)=>{let i=r+n;return p(t,{color:v===`phases`&&i===y?`cyan`:void 0,children:[v===`phases`&&i===y?`โฏ `:` `,e]},i)}),n<i.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,i.length-n,` more below`]})]})})(),O&&p(e,{children:[f(t,{color:`yellow`,children:`โฏ `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:E})})]}),C&&p(e,{marginTop:1,children:[f(t,{children:`Editing: `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:E})})]})]})}),f(e,{children:p(t,{children:[f(t,{color:v===`presets`?`yellow`:void 0,children:v===`presets`?`โฏ `:` `}),f(t,{bold:!0,color:v===`presets`?`yellow`:void 0,children:`Presets`})]})}),v===`presets`&&p(t,{dimColor:!0,children:[` `,`Selecting one will overwrite your choice of phases`]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{flexDirection:`column`,children:(()=>{let e=Math.max(0,x-4),n=Math.min(K.length,e+8),r=Math.max(0,n-8),i=K.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),i.map((e,n)=>{let i=r+n;return p(t,{color:v===`presets`&&i===x?`cyan`:void 0,children:[v===`presets`&&i===x?`โฏ `:` `,e.name,` `,e.phases.join(``)]},i)}),n<K.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,K.length-n,` more below`]})]})})()})}),f(e,{marginTop:1,children:f(t,{dimColor:!0,children:`ctrl+r to reset all settings to default`})})]}),p(e,{width:`50%`,flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(t,{bold:!0,children:`Preview`})}),p(e,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:[p(t,{children:[p(t,{color:z,children:[U,` Thinkingโ€ฆ `]}),f(t,{color:R?.colors.secondaryText,children:`(10s ยท โ†‘ 456 tokens ยท esc to interrupt)`})]}),p(e,{marginTop:1,flexDirection:`column`,children:[p(t,{dimColor:!0,children:[`Phases: `,i.join(``)]}),p(t,{dimColor:!0,children:[`Reverse-mirror: `,o?`Yes`:`No`]}),p(t,{dimColor:!0,children:[`Update interval: `,a,`ms`]})]})]})]})]})}const J=async()=>{await x.mkdir(T,{recursive:!0})},Y=async()=>{let e={ccVersion:``,ccInstallationDir:null,lastModified:new Date().toISOString(),changesApplied:!0,settings:w};try{let t=await x.readFile(E,`utf8`);return{...e,...JSON.parse(t)}}catch(t){if(t instanceof Error&&`code`in t&&t.code===`ENOENT`)return e;throw t}},X=async e=>{let t=await Y();return e(t),t.lastModified=new Date().toISOString(),await te(t),t},te=async e=>{try{e.lastModified=new Date().toISOString(),await J(),await x.writeFile(E,JSON.stringify(e,null,2))}catch(e){throw console.error(`Error saving config:`,e),e}},ne=async e=>(await x.copyFile(D,e.cliPath),await X(e=>{e.changesApplied=!1}),!0),re=async e=>{e.ccInstallationDir&&O.unshift(e.ccInstallationDir);for(let e of O)try{let t=h.join(e,`cli.js`),n=h.join(e,`package.json`),r=JSON.parse(await x.readFile(n,`utf8`));return{cliPath:t,packageJsonPath:n,version:r.version}}catch{continue}console.clear(),console.error(`\x1b[31mCannot find Claude Code's cli.js -- do you have Claude Code installed?
9
-
10
- Searched at the following locations:
11
- ${O.map(e=>`- `+e).join(`
12
- `)}
13
-
14
- If you have it installed but it's in a location not listed above, please open an issue at
15
- https://github.com/piebald-ai/tweakcc/issues and tell us where you have it--we'll add that
16
- location to our search list and release an update today! Or you can specify the path to its
17
- \`cli.js\` file in ${E}:
18
- {
19
- "ccInstallationDir": "${process.platform==`win32`?`C:\\absolute\\path\\to\\@anthropic-ai\\claude-code`:`/absolute/path/to/@anthropic-ai/claude-code`}"
20
- }
21
- (Note: don't include cli.js in the path.)\x1b[0m
22
- `),process.exit(1)},Z=async e=>{await J(),await x.copyFile(e.cliPath,D),await X(t=>{t.changesApplied=!1,t.ccVersion=e.version})};async function ie(e){try{return await x.stat(e),!0}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return!1;throw e}}async function ae(){let e=await Y(),t=await re(e),n=t.version,r=e.ccVersion;return await ie(D)||await Z(t),n===r?{wasUpdated:!1,oldVersion:null,newVersion:null,ccInstInfo:t}:(await x.unlink(D),await Z(t),{wasUpdated:!0,oldVersion:r,newVersion:n,ccInstInfo:t})}function oe(e){let t=e.indexOf(` โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
7
+ `);z(i);let a=Math.max(...r.map(e=>e.length)),s=Math.min(75,Math.max(50,Math.ceil(a/o*100)));V(s+5)}};return l(()=>{if(A){let e=E.filter(e=>e.toLowerCase().includes(A.toLowerCase()));k(e),I(0)}else{k(E);let e=E.indexOf(h);I(e>=0?e:0)}},[A,E]),l(()=>{if(!N){let e=O.indexOf(h);e>=0&&I(e)}},[h,O,N]),r((e,t)=>{if(H){t.return?(v(s===`figlet`?e=>{e.launchText.figletText=W}:e=>{e.launchText.customText=W}),U(!1)):t.escape?(G(s===`figlet`?m:g),U(!1)):t.backspace||t.delete?G(e=>e.slice(0,-1)):e&&G(t=>t+e);return}if(N){if(t.return)O.length>0&&v(e=>{e.launchText.figletFont=O[F]}),P(!1),j(``);else if(t.escape)P(!1),j(``);else if(t.backspace||t.delete)j(e=>e.slice(0,-1));else if(t.upArrow){let e=F>0?F-1:O.length-1;I(e),O.length>0&&v(t=>{t.launchText.figletFont=O[e]})}else if(t.downArrow){let e=F<O.length-1?F+1:0;I(e),O.length>0&&v(t=>{t.launchText.figletFont=O[e]})}else e&&e.match(/^[a-zA-Z0-9\s\-_]$/)&&j(t=>t+e);return}if(t.escape)n();else if(t.return)C===`text`&&(G(s===`figlet`?m:g),U(!0));else if(t.tab)t.shift?S(e=>e===0?y.length-1:e-1):S(e=>e===y.length-1?0:e+1);else if(t.upArrow){if(C===`method`){let e=w>0?w-1:1;T(e),v(t=>{t.launchText.method=e===0?`figlet`:`custom`})}else if(C===`font`&&s===`figlet`){let e=F>0?F-1:O.length-1;I(e),v(t=>{t.launchText.figletFont=O[e]})}}else if(t.downArrow){if(C===`method`){let e=w<1?w+1:0;T(e),v(t=>{t.launchText.method=e===0?`figlet`:`custom`})}else if(C===`font`&&s===`figlet`){let e=F<O.length-1?F+1:0;I(e),v(t=>{t.launchText.figletFont=O[e]})}}else e&&C===`font`&&s===`figlet`&&e.match(/^[a-zA-Z0-9]$/)&&(P(!0),j(e))}),p(e,{children:[p(e,{flexDirection:`column`,width:`${100-B}%`,children:[p(e,{marginBottom:1,flexDirection:`column`,children:[f(M,{children:`Setup banner`}),p(e,{flexDirection:`column`,children:[p(t,{dimColor:!0,children:[`enter to `,C===`text`?`edit text`:`save`]}),f(t,{dimColor:!0,children:`esc to go back`}),f(t,{dimColor:!0,children:`tab to switch sections`})]})]}),f(e,{children:p(t,{children:[f(t,{color:C===`method`?`yellow`:void 0,children:C===`method`?`โฏ `:` `}),f(t,{bold:!0,color:C===`method`?`yellow`:void 0,children:`Method`})]})}),C===`method`&&p(t,{dimColor:!0,children:[` `,`select one of `,O.length,` Figlet fonts or enter your own text`]}),f(e,{marginLeft:2,marginBottom:1,children:p(e,{flexDirection:`column`,children:[p(t,{color:w===0?`cyan`:`white`,children:[w===0?`โฏ `:` `,`Figlet`]}),p(t,{color:w===1?`cyan`:`white`,children:[w===1?`โฏ `:` `,`Custom`]})]})}),p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:C===`text`?`yellow`:void 0,children:C===`text`?`โฏ `:` `}),f(t,{bold:!0,color:C===`text`?`yellow`:void 0,children:`Text`})]}),C===`text`&&(H?p(t,{dimColor:!0,children:[` `,`esc to save`]}):p(t,{dimColor:!0,children:[` `,`enter to edit`]}))]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{borderStyle:`round`,borderColor:H?`yellow`:`gray`,children:f(t,{children:H?W:s===`figlet`?m:g})})}),s===`figlet`&&p(d,{children:[f(e,{children:p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:C===`font`?`yellow`:void 0,children:C===`font`?`โฏ `:` `}),f(t,{bold:!0,color:C===`font`?`yellow`:void 0,children:`Font`})]}),C===`font`&&p(t,{dimColor:!0,children:[` `,`type to filter`]}),f(t,{children:N&&p(t,{color:`gray`,dimColor:!0,children:[` `,`(filtering: โ€œ`,A,`โ€)`]})})]})}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{flexDirection:`column`,children:(()=>{let e=Math.max(0,F-4),n=Math.min(O.length,e+8),r=Math.max(0,n-8),i=O.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),i.map((e,n)=>{let i=r+n;return p(t,{color:F===i?`cyan`:void 0,children:[F===i?`โฏ `:` `,e]},e)}),n<O.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,O.length-n,` more below`]})]})})()})})]})]}),p(e,{width:`${B}%`,flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(t,{bold:!0,children:`Preview`})}),p(e,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:[p(e,{flexDirection:`column`,marginBottom:1,children:[f(t,{color:J,children:`โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ`}),p(t,{children:[f(t,{color:J,children:`โ”‚ โœป`}),` Welcome to Claude Code`,` `,f(t,{color:J,children:`โ”‚`})]}),f(t,{color:J,children:`โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ`})]}),L.split(`
8
+ `).map((e,n)=>f(t,{color:J,children:e},n)),f(e,{marginTop:1,children:f(t,{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 te({onBack:n}){let{settings:{thinkingVerbs:{format:i,verbs:a},themes:o},updateSettings:s}=c($),l=[`format`,`verbs`],[m,h]=u(0),g=l[m],[_,v]=u(0),[y,b]=u(!1),[x,S]=u(``),[C,w]=u(!1),[E,D]=u(!1),[O,k]=u(i),A=R(),j=o.find(e=>e.id===A)||o.find(e=>e.id===`dark`),N=j?.colors.claude||`rgb(215,119,87)`;return r((e,t)=>{if(E){t.return?(s(e=>{e.thinkingVerbs.format=O}),D(!1)):t.escape?(k(i),D(!1)):t.backspace||t.delete?k(e=>e.slice(0,-1)):e&&k(t=>t+e);return}if(y||C){t.return&&x.trim()?(C?(s(e=>{e.thinkingVerbs.verbs.push(x.trim())}),w(!1)):(s(e=>{e.thinkingVerbs.verbs[_]=x.trim()}),b(!1)),S(``)):t.escape?(S(``),b(!1),w(!1)):t.backspace||t.delete?S(e=>e.slice(0,-1)):e&&S(t=>t+e);return}t.escape?n():t.return?g===`format`&&(k(i),D(!0)):t.tab?t.shift?h(e=>e===0?l.length-1:e-1):h(e=>e===l.length-1?0:e+1):t.upArrow?g===`verbs`&&a.length>0&&v(e=>e>0?e-1:a.length-1):t.downArrow?g===`verbs`&&a.length>0&&v(e=>e<a.length-1?e+1:0):e===`e`&&g===`verbs`?a.length>0&&(S(a[_]),b(!0)):e===`d`&&g===`verbs`?a.length>1&&(s(e=>{e.thinkingVerbs.verbs=e.thinkingVerbs.verbs.filter((e,t)=>t!==_)}),_>=a.length-1&&v(Math.max(0,a.length-2))):e===`n`&&g===`verbs`?(w(!0),S(``)):t.ctrl&&e===`r`&&g===`verbs`&&(s(e=>{e.thinkingVerbs.verbs=[...T.thinkingVerbs.verbs]}),v(0))}),p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[p(e,{marginBottom:1,flexDirection:`column`,children:[f(M,{children:`Thinking Verbs`}),p(e,{flexDirection:`column`,children:[f(t,{dimColor:!0,children:g===`format`?`enter to edit format`:`changes auto-saved`}),f(t,{dimColor:!0,children:`esc to go back`}),f(t,{dimColor:!0,children:`tab to switch sections`})]})]}),f(e,{marginBottom:1,children:f(t,{dimColor:!0,children:`Customize the verbs shown during generation and their format.`})}),p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:g===`format`?`yellow`:void 0,children:g===`format`?`โฏ `:` `}),f(t,{bold:!0,color:g===`format`?`yellow`:void 0,children:`Format`})]}),g===`format`&&(E?p(t,{dimColor:!0,children:[` `,`enter to save`]}):p(t,{dimColor:!0,children:[` `,`enter to edit`]}))]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{borderStyle:`round`,borderColor:E?`yellow`:`gray`,children:f(t,{children:E?O:i})})}),f(e,{children:p(t,{children:[f(t,{color:g===`verbs`?`yellow`:void 0,children:g===`verbs`?`โฏ `:` `}),f(t,{bold:!0,color:g===`verbs`?`yellow`:void 0,children:`Verbs`})]})}),g===`verbs`&&f(e,{flexDirection:`column`,children:p(t,{dimColor:!0,children:[` `,`e to edit ยท d to delete ยท n to add new ยท ctrl+r to reset`]})}),f(e,{marginLeft:2,marginBottom:1,children:p(e,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,_-4),n=Math.min(a.length,e+8),r=Math.max(0,n-8),i=a.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),i.map((e,n)=>{let i=r+n;return p(t,{color:g===`verbs`&&i===_?`cyan`:void 0,children:[g===`verbs`&&i===_?`โฏ `:` `,e]},i)}),n<a.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,a.length-n,` more below`]})]})})(),C&&p(e,{alignItems:`center`,children:[f(t,{color:`yellow`,children:`โฏ `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:x})})]}),y&&p(e,{marginTop:1,alignItems:`center`,children:[f(t,{children:`Editing: `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:x})})]})]})})]}),p(e,{width:`50%`,flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(t,{bold:!0,children:`Preview`})}),f(e,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:p(t,{children:[p(t,{color:N,children:[`โœป `,i.replace(/\{\}/g,a[_]),` `]}),f(t,{color:j?.colors.secondaryText,children:`(10s ยท โ†‘ 456 tokens ยท esc to interrupt)`})]})})]})]})}const Y=[{name:`Default`,phases:T.thinkingStyle.phases,reverseMirror:T.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 ne({onBack:n}){let{settings:{thinkingStyle:{phases:i,updateInterval:a,reverseMirror:o},themes:s},updateSettings:m}=c($),h=[`reverseMirror`,`updateInterval`,`phases`,`presets`],[g,_]=u(0),v=h[g],[y,b]=u(0),[x,S]=u(0),[C,w]=u(!1),[E,D]=u(``),[O,k]=u(!1),[A,j]=u(!1),[N,P]=u(a.toString()),[F,I]=u(0),L=R(),z=s.find(e=>e.id===L)||s.find(e=>e.id===`dark`),B=z?.colors.claude||`rgb(215,119,87)`;l(()=>{if(i.length>0){let e=o?[...i,...[...i].reverse().slice(1,-1)]:i,t=setInterval(()=>{I(t=>(t+1)%e.length)},a);return()=>clearInterval(t)}},[i,a,o]),r((e,t)=>{if(A){if(t.return){let e=parseInt(N);!isNaN(e)&&e>0&&m(t=>{t.thinkingStyle.updateInterval=e}),j(!1)}else t.escape?(P(a.toString()),j(!1)):t.backspace||t.delete?P(e=>e.slice(0,-1)):e&&e.match(/^[0-9]$/)&&P(t=>t+e);return}if(C||O){if(t.return&&E.trim()){let e=O?[...i,E.trim()]:i.map((e,t)=>t===y?E.trim():e);m(t=>{t.thinkingStyle.phases=e}),w(!1),D(``)}else t.escape?(D(``),w(!1),k(!1)):t.backspace||t.delete?D(e=>e.slice(0,-1)):e&&D(t=>t+e);return}if(t.escape)n();else if(t.return)if(v===`updateInterval`)P(a.toString()),j(!0);else if(v===`presets`){let e=Y[x];m(t=>{t.thinkingStyle.phases=[...e.phases],t.thinkingStyle.reverseMirror=e.reverseMirror})}else v===`reverseMirror`&&m(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(t.tab)t.shift?_(e=>e===0?h.length-1:e-1):_(e=>e===h.length-1?0:e+1);else if(t.upArrow)v===`phases`&&i.length>0?b(e=>e>0?e-1:i.length-1):v===`presets`&&S(e=>e>0?e-1:Y.length-1);else if(t.downArrow)v===`phases`&&i.length>0?b(e=>e<i.length-1?e+1:0):v===`presets`&&S(e=>e<Y.length-1?e+1:0);else if(e===` `)v===`reverseMirror`&&m(e=>{e.thinkingStyle.reverseMirror=!e.thinkingStyle.reverseMirror});else if(e===`e`&&v===`phases`)i.length>0&&(D(i[y]),w(!0));else if(e===`a`&&v===`phases`)k(!0),D(``);else if(e===`d`&&v===`phases`)i.length>1&&(m(e=>{e.thinkingStyle.phases=i.filter((e,t)=>t!==y)}),y>=i.length&&b(Math.max(0,i.length-1)));else if(e===`w`&&v===`phases`){if(y>0){let e=[...i];[e[y-1],e[y]]=[e[y],e[y-1]],m(t=>{t.thinkingStyle.phases=e}),b(e=>e-1)}}else if(e===`s`&&v===`phases`){if(y<i.length-1){let e=[...i];[e[y],e[y+1]]=[e[y+1],e[y]],m(t=>{t.thinkingStyle.phases=e}),b(e=>e+1)}}else t.ctrl&&e===`r`&&(m(e=>{e.thinkingStyle=T.thinkingStyle}),b(0),S(0))});let V=o?`x`:` `,H=()=>o?[...i,...[...i].reverse().slice(1,-1)]:i,U=H(),W=U.length>0?U[F]:`ยท`;return p(e,{children:[p(e,{flexDirection:`column`,width:`50%`,children:[p(e,{marginBottom:1,flexDirection:`column`,children:[f(M,{children:`Thinking style`}),p(e,{flexDirection:`column`,children:[p(t,{dimColor:!0,children:[`enter to`,` `,v===`updateInterval`?`edit interval`:v===`presets`?`apply preset`:`save`]}),f(t,{dimColor:!0,children:`esc to go back`}),f(t,{dimColor:!0,children:`tab to switch sections`})]})]}),f(e,{children:p(t,{children:[f(t,{color:v===`reverseMirror`?`yellow`:void 0,children:v===`reverseMirror`?`โฏ `:` `}),f(t,{bold:!0,color:v===`reverseMirror`?`yellow`:void 0,children:`Reverse-mirror phases`})]})}),v===`reverseMirror`&&p(t,{dimColor:!0,children:[` `,`space to toggle`]}),f(e,{marginLeft:2,marginBottom:1,children:p(t,{children:[`[`,V,`] `,o?`Enabled`:`Disabled`]})}),p(e,{flexDirection:`column`,children:[p(t,{children:[f(t,{color:v===`updateInterval`?`yellow`:void 0,children:v===`updateInterval`?`โฏ `:` `}),f(t,{bold:!0,color:v===`updateInterval`?`yellow`:void 0,children:`Update interval (ms)`})]}),v===`updateInterval`&&(A?p(t,{dimColor:!0,children:[` `,`enter to save`]}):p(t,{dimColor:!0,children:[` `,`enter to edit`]}))]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{borderStyle:`round`,borderColor:A?`yellow`:`gray`,children:f(t,{children:A?N:a})})}),f(e,{children:p(t,{children:[f(t,{color:v===`phases`?`yellow`:void 0,children:v===`phases`?`โฏ `:` `}),f(t,{bold:!0,color:v===`phases`?`yellow`:void 0,children:`Phases`})]})}),v===`phases`&&f(e,{marginBottom:1,flexDirection:`column`,children:p(t,{dimColor:!0,children:[` `,`e to edit ยท a to add ยท d to delete ยท w to move up ยท s to move down`]})}),f(e,{marginLeft:2,marginBottom:1,children:p(e,{flexDirection:`column`,children:[(()=>{let e=Math.max(0,y-4),n=Math.min(i.length,e+8),r=Math.max(0,n-8),a=i.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),a.map((e,n)=>{let i=r+n;return p(t,{color:v===`phases`&&i===y?`cyan`:void 0,children:[v===`phases`&&i===y?`โฏ `:` `,e]},i)}),n<i.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,i.length-n,` more below`]})]})})(),O&&p(e,{children:[f(t,{color:`yellow`,children:`โฏ `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:E})})]}),C&&p(e,{marginTop:1,children:[f(t,{children:`Editing: `}),f(e,{borderStyle:`round`,borderColor:`yellow`,children:f(t,{children:E})})]})]})}),f(e,{children:p(t,{children:[f(t,{color:v===`presets`?`yellow`:void 0,children:v===`presets`?`โฏ `:` `}),f(t,{bold:!0,color:v===`presets`?`yellow`:void 0,children:`Presets`})]})}),v===`presets`&&p(t,{dimColor:!0,children:[` `,`Selecting one will overwrite your choice of phases`]}),f(e,{marginLeft:2,marginBottom:1,children:f(e,{flexDirection:`column`,children:(()=>{let e=Math.max(0,x-4),n=Math.min(Y.length,e+8),r=Math.max(0,n-8),i=Y.slice(r,n);return p(d,{children:[r>0&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†‘ `,r,` more above`]}),i.map((e,n)=>{let i=r+n;return p(t,{color:v===`presets`&&i===x?`cyan`:void 0,children:[v===`presets`&&i===x?`โฏ `:` `,e.name,` `,e.phases.join(``)]},i)}),n<Y.length&&p(t,{color:`gray`,dimColor:!0,children:[` `,`โ†“ `,Y.length-n,` more below`]})]})})()})}),f(e,{marginTop:1,children:f(t,{dimColor:!0,children:`ctrl+r to reset all settings to default`})})]}),p(e,{width:`50%`,flexDirection:`column`,children:[f(e,{marginBottom:1,children:f(t,{bold:!0,children:`Preview`})}),p(e,{borderStyle:`single`,borderColor:`gray`,padding:1,flexDirection:`column`,children:[p(t,{children:[p(t,{color:B,children:[W,` Thinkingโ€ฆ `]}),f(t,{color:z?.colors.secondaryText,children:`(10s ยท โ†‘ 456 tokens ยท esc to interrupt)`})]}),p(e,{marginTop:1,flexDirection:`column`,children:[p(t,{dimColor:!0,children:[`Phases: `,i.join(``)]}),p(t,{dimColor:!0,children:[`Reverse-mirror: `,o?`Yes`:`No`]}),p(t,{dimColor:!0,children:[`Update interval: `,a,`ms`]})]})]})]})]})}const re=async()=>{await S.mkdir(E,{recursive:!0})},ie=async()=>{let e={ccVersion:``,ccInstallationDir:null,lastModified:new Date().toISOString(),changesApplied:!0,settings:T};try{let t=await S.readFile(D,`utf8`),n={...e,...JSON.parse(t)},r=n?.settings?.thinkingVerbs;r?.punctuation&&(r.format=`{}`+r.punctuation,delete r.punctuation);for(let e of T.themes){let t=n?.settings?.themes.find(t=>t.id===e.id||t.name===e.name);if(t)for(let[n,r]of Object.entries(e))Object.hasOwn(t,n)||(t[n]=r)}return n}catch(t){if(t instanceof Error&&`code`in t&&t.code===`ENOENT`)return e;throw t}},X={settings:T,changesApplied:!1,ccVersion:``,lastModified:``,ccInstallationDir:null},Z=async e=>(e(X),X.lastModified=new Date().toISOString(),await ae(X),X),ae=async e=>{try{e.lastModified=new Date().toISOString(),await re(),await S.writeFile(D,JSON.stringify(e,null,2))}catch(e){throw console.error(`Error saving config:`,e),e}},oe=async e=>(await S.copyFile(O,e.cliPath),await Z(e=>{e.changesApplied=!1}),!0),se=async e=>{e.ccInstallationDir&&A.unshift(e.ccInstallationDir);for(let e of A)try{let t=h.join(e,`cli.js`),n=h.join(e,`package.json`),r=JSON.parse(await S.readFile(n,`utf8`));return{cliPath:t,packageJsonPath:n,version:r.version}}catch{continue}return null},ce=async e=>{await re(),await S.copyFile(e.cliPath,O),await Z(t=>{t.changesApplied=!1,t.ccVersion=e.version})};async function le(e){try{return await S.stat(e),!0}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return!1;throw e}}async function ue(){let e=await ie(),t=await se(e);if(!t)return null;let n=t.version,r=e.ccVersion;return await le(O)||await ce(t),r&&n!==r?(await S.unlink(O),await ce(t),{wasUpdated:!0,oldVersion:r,newVersion:n,ccInstInfo:t}):{wasUpdated:!1,oldVersion:null,newVersion:null,ccInstInfo:t}}function de(e){let t=e.indexOf(` โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•— โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•— โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
23
9
  โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•—โ–ˆโ–ˆโ•”โ•โ•โ•โ•โ•
24
10
  โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
25
11
  โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•”โ•โ•โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
@@ -30,7 +16,27 @@ location to our search list and release an update today! Or you can specify the
30
16
  โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
31
17
  โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•‘ โ–ˆโ–ˆโ•‘โ–ˆโ–ˆโ•”โ•โ•โ•
32
18
  โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—โ•šโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•”โ•โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ•—
33
- โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•`);return t===-1?null:{startIndex:t-1,endIndex:t+495+1}}function se(e,t){let n=oe(e);if(!n)return e;let r=JSON.stringify(t),i=e.slice(0,n.startIndex)+r+e.slice(n.endIndex);return Q(e,i,r,n.startIndex,n.endIndex),i}function ce(e){let t=/switch\s*\(([^)]+)\)\s*\{[^}]*case\s*["']light["'][^}]+\}/s,n=e.match(t);if(!n||n.index==null)return console.error(`patch: themes: failed to find switchMatch`),null;let r=/\[(?:\{label:"(?:Dark|Light).+?",value:".+?"\},?)+\]/,i=/return\{(?:[\w$]+?:"(?:Dark|Light).+?",?)+\}/,a=e.match(r),o=e.match(i);return!a||a.index==null?(console.error(`patch: themes: failed to find objArrMatch`),null):!o||o.index==null?(console.error(`patch: themes: failed to find objMatch`),null):{switchStatement:{startIndex:n.index,endIndex:n.index+n[0].length,variableName:n[1].trim()},objArr:{startIndex:a.index,endIndex:a.index+a[0].length},obj:{startIndex:o.index,endIndex:o.index+o[0].length}}}const le=(e,t)=>{let n=ce(e);if(!n)return null;if(t.length===0)return e;let r=e,i=`return`+JSON.stringify(Object.fromEntries(t.map(e=>[e.id,e.name])));r=r.slice(0,n.obj.startIndex)+i+r.slice(n.obj.endIndex),Q(e,r,i,n.obj.startIndex,n.obj.endIndex),e=r;let a=JSON.stringify(t.map(e=>({label:e.name,value:e.id})));r=r.slice(0,n.objArr.startIndex)+a+r.slice(n.objArr.endIndex),Q(e,r,a,n.objArr.startIndex,n.objArr.endIndex),e=r;let o=`switch(${n.switchStatement.variableName}){\n`;return t.forEach(e=>{o+=`case"${e.id}":return${JSON.stringify(e.colors)};\n`}),o+=`default:return${JSON.stringify(t[0].colors)};\n}`,r=r.slice(0,n.switchStatement.startIndex)+o+r.slice(n.switchStatement.endIndex),Q(e,r,o,n.switchStatement.startIndex,n.switchStatement.endIndex),r},ue=e=>{let t=[],n=/\["[ยทโœข*โœณโœถโœปโœฝ]",\s*(?:"[ยทโœข*โœณโœถโœปโœฝ]",?\s*)+\]/g,r;for(;(r=n.exec(e))!==null;)t.push({startIndex:r.index,endIndex:r.index+r[0].length});return t},de=(e,t)=>{let n=ue(e);if(n.length===0)return null;let r=JSON.stringify(t),i=n.sort((e,t)=>t.startIndex-e.startIndex),a=e;for(let e=0;e<i.length;e++){let t=a.slice(0,i[e].startIndex)+r+a.slice(i[e].endIndex);Q(a,t,r,i[e].startIndex,i[e].endIndex),a=t}return a},fe=e=>{let t=/[\w$]+\(\(\)=>\{if\(![\w$]+\)\{[\w$]+\(\d+\);return\}[\w$]+\(\([^)]+\)=>[^)]+\+1\)\},(\d+)\)/,n=e.match(t);if(!n||n.index==null)return console.error(`patch: thinker symbol speed: failed to find match`),null;let r=n[0],i=n[1],a=r.lastIndexOf(i),o=n.index+a,s=o+i.length;return{startIndex:o,endIndex:s}},pe=(e,t)=>{let n=fe(e);if(!n)return null;let r=JSON.stringify(t),i=e.slice(0,n.startIndex)+r+e.slice(n.endIndex);return Q(e,i,r,n.startIndex,n.endIndex),i},me=e=>{let t=/=\[\s*(?:"[A-Z][a-z]+ing",?\s*)+\]/s,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker verbs: failed to find okayMatch`),null):{okayVerbs:{startIndex:n.index,endIndex:n.index+n[0].length}}},he=(e,t)=>{let n=me(e);if(!n)return null;let r=`=`+JSON.stringify(t),i=e.slice(0,n.okayVerbs.startIndex)+r+e.slice(n.okayVerbs.endIndex);return Q(e,i,r,n.okayVerbs.startIndex,n.okayVerbs.endIndex),i},ge=e=>{let t=/[\w$]+\.createElement\([\w$]+,\{color:[\w$]+\},[\w$]+,"โ€ฆ "\)/,n=e.match(t);if(!n||n.index==null)return console.error(`patch: thinker punctuation: failed to find match`),null;let r=n.index+n[0].indexOf(`"โ€ฆ "`),i=r+4;return{startIndex:r,endIndex:i}},_e=(e,t)=>{let n=ge(e);if(!n)return null;let r=JSON.stringify(t),i=e.slice(0,n.startIndex)+r+e.slice(n.endIndex);return Q(e,i,r,n.startIndex,n.endIndex),i},ve=e=>{let t=/=\s*\[\.\.\.(\w+),\s*\.\.\.?\[\.\.\.\1\]\.reverse\(\)\]/,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker symbol mirror option: failed to find match`),null):{startIndex:n.index,endIndex:n.index+n[0].length,variableName:n[1]}},ye=(e,t)=>{let n=ve(e);if(!n)return null;let r=n.variableName,i=t?`=[...${r},...[...${r}].reverse()]`:`=[...${r}]`,a=e.slice(0,n.startIndex)+i+e.slice(n.endIndex);return Q(e,a,i,n.startIndex,n.endIndex),a};function Q(e,t,n,r,i){let a=Math.max(0,r-20),o=Math.min(e.length,i+20),s=Math.min(t.length,r+n.length+20);e.slice(a,r),e.slice(r,i),e.slice(i,o),t.slice(a,r),t.slice(r,r+n.length),t.slice(r+n.length,s)}const be=async(e,t)=>{await ne(t);let n=await b.readFile(t.cliPath,{encoding:`utf8`}),r=null;if(e.settings.themes&&e.settings.themes.length>0&&(r=le(n,e.settings.themes))&&(n=r),e.settings.launchText){let t=e.settings.launchText,i=``;t.method===`custom`&&t.customText?i=t.customText:t.method===`figlet`&&t.figletText&&(i=await new Promise(e=>y.text(t.figletText.replace(`
34
- `,` `),t.figletFont,(t,n)=>{t?(console.error(`patch: figlet: failed to generate text`,t),e(``)):e(n||``)}))),(r=se(n,i))&&(n=r)}return e.settings.thinkingVerbs&&((r=he(n,e.settings.thinkingVerbs.verbs))&&(n=r),(r=_e(n,e.settings.thinkingVerbs.punctuation))&&(n=r)),(r=de(n,e.settings.thinkingStyle.phases))&&(n=r),(r=pe(n,e.settings.thinkingStyle.updateInterval))&&(n=r),(r=ye(n,e.settings.thinkingStyle.reverseMirror))&&(n=r),await b.writeFile(t.cliPath,n),await X(e=>{e.changesApplied=!0})},$=o({settings:w,updateSettings:e=>{},changesApplied:!1});function xe(){let[t,n]=u({settings:w,changesApplied:!1,ccVersion:``,lastModified:``,ccInstallationDir:null});l(()=>{let e=async()=>{n(await Y())};e()},[]);let i=s(e=>{e(t.settings),X(e=>{e.settings=t.settings,e.changesApplied=!1}).then(e=>{n(e)})},[t]),[a,o]=u(null),[c,d]=u(null),[p,m]=u(null);l(()=>{let e=async()=>{let e=await ae();m(e.ccInstInfo),e.wasUpdated&&(d({message:`Your Claude Code installation was updated from ${e.oldVersion} to ${e.newVersion}, and the patching was likely overwritten
35
- (However, your customization are still remembered in ${E}.)
36
- Please reapply your changes below.`,type:`warning`}),i(()=>{}))};e()},[]),r((e,t)=>{(t.ctrl&&e===`c`||(e===`q`||t.escape)&&!a)&&process.exit(0)});let h=e=>{switch(d(null),e){case C.THEMES:case C.LAUNCH_TEXT:case C.THINKING_VERBS:case C.THINKING_STYLE:o(e);break;case C.APPLY_CHANGES:p&&(d({message:`Applying patches...`,type:`info`}),be(t,p).then(e=>{n(e),d({message:`Customization patches applied successfully!`,type:`success`})}));break;case C.RESTORE_ORIGINAL:p&&ne(p).then(()=>{d({message:`Original Claude Code restored successfully!`,type:`success`}),i(()=>{})});break;case C.OPEN_CONFIG:F(E);break;case C.OPEN_CLI:p&&F(p.cliPath);break;case C.EXIT:process.exit(0)}},g=()=>{o(null)};return f($.Provider,{value:{settings:t.settings,updateSettings:i,changesApplied:t.changesApplied},children:f(e,{flexDirection:`column`,children:a===null?f(j,{onSubmit:h,notification:c}):a===C.THEMES?f(U,{onBack:g}):a===C.LAUNCH_TEXT?f(G,{onBack:g}):a===C.THINKING_VERBS?f(ee,{onBack:g}):a===C.THINKING_STYLE?f(q,{onBack:g}):null})})}n(f(xe,{}));
19
+ โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ• โ•šโ•โ•โ•โ•โ•โ•โ•`);return t===-1?null:{startIndex:t-1,endIndex:t+495+1}}function fe(e,t){let n=de(e);if(!n)return e;let r=JSON.stringify(t),i=e.slice(0,n.startIndex)+r+e.slice(n.endIndex);return Q(e,i,r,n.startIndex,n.endIndex),i}function pe(e){let t=/switch\s*\(([^)]+)\)\s*\{[^}]*case\s*["']light["'][^}]+\}/s,n=e.match(t);if(!n||n.index==null)return console.error(`patch: themes: failed to find switchMatch`),null;let r=/\[(?:\{label:"(?:Dark|Light).+?",value:".+?"\},?)+\]/,i=/return\{(?:[\w$]+?:"(?:Dark|Light).+?",?)+\}/,a=e.match(r),o=e.match(i);return!a||a.index==null?(console.error(`patch: themes: failed to find objArrMatch`),null):!o||o.index==null?(console.error(`patch: themes: failed to find objMatch`),null):{switchStatement:{startIndex:n.index,endIndex:n.index+n[0].length,variableName:n[1].trim()},objArr:{startIndex:a.index,endIndex:a.index+a[0].length},obj:{startIndex:o.index,endIndex:o.index+o[0].length}}}const me=(e,t)=>{let n=pe(e);if(!n)return null;if(t.length===0)return e;let r=e,i=`return`+JSON.stringify(Object.fromEntries(t.map(e=>[e.id,e.name])));r=r.slice(0,n.obj.startIndex)+i+r.slice(n.obj.endIndex),Q(e,r,i,n.obj.startIndex,n.obj.endIndex),e=r;let a=JSON.stringify(t.map(e=>({label:e.name,value:e.id})));r=r.slice(0,n.objArr.startIndex)+a+r.slice(n.objArr.endIndex),Q(e,r,a,n.objArr.startIndex,n.objArr.endIndex),e=r;let o=`switch(${n.switchStatement.variableName}){\n`;return t.forEach(e=>{o+=`case"${e.id}":return${JSON.stringify(e.colors)};\n`}),o+=`default:return${JSON.stringify(t[0].colors)};\n}`,r=r.slice(0,n.switchStatement.startIndex)+o+r.slice(n.switchStatement.endIndex),Q(e,r,o,n.switchStatement.startIndex,n.switchStatement.endIndex),r},he=e=>{let t=[],n=/\["[ยทโœข*โœณโœถโœปโœฝ]",\s*(?:"[ยทโœข*โœณโœถโœปโœฝ]",?\s*)+\]/g,r;for(;(r=n.exec(e))!==null;)t.push({startIndex:r.index,endIndex:r.index+r[0].length});return t},ge=(e,t)=>{let n=he(e);if(n.length===0)return null;let r=JSON.stringify(t),i=n.sort((e,t)=>t.startIndex-e.startIndex),a=e;for(let e=0;e<i.length;e++){let t=a.slice(0,i[e].startIndex)+r+a.slice(i[e].endIndex);Q(a,t,r,i[e].startIndex,i[e].endIndex),a=t}return a},_e=e=>{let t=/[\w$]+\(\(\)=>\{if\(![\w$]+\)\{[\w$]+\(\d+\);return\}[\w$]+\(\([^)]+\)=>[^)]+\+1\)\},(\d+)\)/,n=e.match(t);if(!n||n.index==null)return console.error(`patch: thinker symbol speed: failed to find match`),null;let r=n[0],i=n[1],a=r.lastIndexOf(i),o=n.index+a,s=o+i.length;return{startIndex:o,endIndex:s}},ve=(e,t)=>{let n=_e(e);if(!n)return null;let r=JSON.stringify(t),i=e.slice(0,n.startIndex)+r+e.slice(n.endIndex);return Q(e,i,r,n.startIndex,n.endIndex),i},ye=e=>{let t=/\b([$\w]+)=\{words:\[(?:"[^"{}()]+ing",)+"[^"{}()]+ing"\]\}/s,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker verbs: failed to find verbsMatch`),null):{verbsLocation:{startIndex:n.index,endIndex:n.index+n[0].length},varName:n[1]}},be=e=>{let t=/function (\w+)\(\)\{return \w+\("tengu_spinner_words",\w+\)\.words\}/,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker verbs: failed to find match`),null):{useLocation:{startIndex:n.index,endIndex:n.index+n[0].length},funcName:n[1]}},xe=(e,t)=>{let n=ye(e);if(!n)return null;let{verbsLocation:r,varName:i}=n,a=`${i}=${JSON.stringify({words:t})}`,o=e.slice(0,r.startIndex)+a+e.slice(r.endIndex);Q(e,o,a,r.startIndex,r.endIndex);let s=be(o);if(!s)return null;let{useLocation:c,funcName:l}=s,u=`function ${l}(){return ${i}.words}`,d=o.slice(0,c.startIndex)+u+o.slice(c.endIndex);return Q(o,d,u,c.startIndex,c.endIndex),d},Se=e=>{let t=/spinnerTip:\w+,(?:\w+:\w+,)*overrideMessage:\w+,.{300}/,n=e.match(t);if(!n||n.index==null)return console.error(`patch: thinker format: failed to find approxAreaMatch`),null;let r=e.slice(n.index,n.index+300),i=/[$\w]+=([^=]+?)\+"โ€ฆ"/,a=r.match(i);if(!a||a.index==null)return console.error(`patch: thinker format: failed to find formatMatch`),null;let o=r.indexOf(`=`,a.index)+1;return{fmtLocation:{startIndex:n.index+o,endIndex:n.index+a.index+a[0].length},curVerb:a[1]}},Ce=(e,t)=>{let n=Se(e);if(!n)return null;let{fmtLocation:r,curVerb:i}=n,a="`"+t.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\{\}/g,"${"+i+`}`)+"`",o=e.slice(0,r.startIndex)+a+e.slice(r.endIndex);return Q(e,o,a,r.startIndex,r.endIndex),o},we=e=>{let t=/=\s*\[\.\.\.(\w+),\s*\.\.\.?\[\.\.\.\1\]\.reverse\(\)\]/,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker symbol mirror option: failed to find match`),null):{startIndex:n.index,endIndex:n.index+n[0].length,variableName:n[1]}},Te=(e,t)=>{let n=we(e);if(!n)return null;let r=n.variableName,i=t?`=[...${r},...[...${r}].reverse()]`:`=[...${r}]`,a=e.slice(0,n.startIndex)+i+e.slice(n.endIndex);return Q(e,a,i,n.startIndex,n.endIndex),a};function Q(e,t,n,r,i){let a=Math.max(0,r-20),o=Math.min(e.length,i+20),s=Math.min(t.length,r+n.length+20);e.slice(a,r),e.slice(r,i),e.slice(i,o),t.slice(a,r),t.slice(r,r+n.length),t.slice(r+n.length,s)}const Ee=async(e,t)=>{await oe(t);let n=await x.readFile(t.cliPath,{encoding:`utf8`}),r=null;if(e.settings.themes&&e.settings.themes.length>0&&(r=me(n,e.settings.themes))&&(n=r),e.settings.launchText){let t=e.settings.launchText,i=``;t.method===`custom`&&t.customText?i=t.customText:t.method===`figlet`&&t.figletText&&(i=await new Promise(e=>b.text(t.figletText.replace(`
20
+ `,` `),t.figletFont,(t,n)=>{t?(console.error(`patch: figlet: failed to generate text`,t),e(``)):e(n||``)}))),(r=fe(n,i))&&(n=r)}return e.settings.thinkingVerbs&&((r=xe(n,e.settings.thinkingVerbs.verbs))&&(n=r),(r=Ce(n,e.settings.thinkingVerbs.format))&&(n=r)),(r=ge(n,e.settings.thinkingStyle.phases))&&(n=r),(r=ve(n,e.settings.thinkingStyle.updateInterval))&&(n=r),(r=Te(n,e.settings.thinkingStyle.reverseMirror))&&(n=r),await x.writeFile(t.cliPath,n),await Z(e=>{e.changesApplied=!0})},$=o({settings:T,updateSettings:e=>{},changesApplied:!1});function De({startupCheckInfo:t}){let[n,i]=u({settings:T,changesApplied:!1,ccVersion:``,lastModified:``,ccInstallationDir:null});l(()=>{let e=async()=>{i(await ie())};e()},[]);let a=s(e=>{e(n.settings),Z(e=>{e.settings=n.settings,e.changesApplied=!1}).then(e=>{i(e)})},[n]),[o,c]=u(null),[d,p]=u(null);l(()=>{t.wasUpdated&&(p({message:`Your Claude Code installation was updated from ${t.oldVersion} to ${t.newVersion}, and the patching was likely overwritten
21
+ (However, your customization are still remembered in ${D}.)
22
+ Please reapply your changes below.`,type:`warning`}),a(()=>{}))},[]),r((e,t)=>{(t.ctrl&&e===`c`||(e===`q`||t.escape)&&!o)&&process.exit(0)});let m=e=>{switch(p(null),e){case w.THEMES:case w.LAUNCH_TEXT:case w.THINKING_VERBS:case w.THINKING_STYLE:c(e);break;case w.APPLY_CHANGES:t.ccInstInfo&&(p({message:`Applying patches...`,type:`info`}),Ee(n,t.ccInstInfo).then(e=>{i(e),p({message:`Customization patches applied successfully!`,type:`success`})}));break;case w.RESTORE_ORIGINAL:t.ccInstInfo&&oe(t.ccInstInfo).then(()=>{p({message:`Original Claude Code restored successfully!`,type:`success`}),a(()=>{})});break;case w.OPEN_CONFIG:z(D);break;case w.OPEN_CLI:t.ccInstInfo&&z(t.ccInstInfo.cliPath);break;case w.EXIT:process.exit(0)}},h=()=>{c(null)};return f($.Provider,{value:{settings:n.settings,updateSettings:a,changesApplied:n.changesApplied},children:f(e,{flexDirection:`column`,children:o===null?f(F,{onSubmit:m,notification:d}):o===w.THEMES?f(ee,{onBack:h}):o===w.LAUNCH_TEXT?f(J,{onBack:h}):o===w.THINKING_VERBS?f(te,{onBack:h}):o===w.THINKING_STYLE?f(ne,{onBack:h}):null})})}const Oe=async()=>{let e=await ue();e?n(f(De,{startupCheckInfo:e})):(console.error(`\x1b[31mCannot find Claude Code's cli.js -- do you have Claude Code installed?
23
+
24
+ Searched at the following locations:
25
+ ${A.map(e=>`- `+e).join(`
26
+ `)}
27
+
28
+ If you have it installed but it's in a location not listed above, please open an issue at
29
+ https://github.com/piebald-ai/tweakcc/issues and tell us where you have it--we'll add that
30
+ location to our search list and release an update today! Or you can specify the path to its
31
+ \`cli.js\` file in ${D}:
32
+
33
+ {
34
+ "ccInstallationDir": "${process.platform==`win32`?`C:\\\\absolute\\\\path\\\\to\\\\node_modules\\\\@anthropic-ai\\\\claude-code`:`/absolute/path/to/node_modules/+@anthropic-ai/claude-code`}"
35
+ }
36
+
37
+ Notes:
38
+ - Don't include cli.js in the path.
39
+
40
+ - Don't specify the path to your Claude Code executable's directory. It needs to be the path
41
+ to the folder that contains **cli.js**.
42
+ \x1b[0m`),process.exit(1))};Oe();
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "tweakcc",
3
- "version": "1.0.3",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
- "description": "Command-line tool to customize your Claude Code installation",
5
+ "description": "Command-line tool to customize your Claude Code theme colors, thinking verbs and more.",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
8
  "tweakcc": "./dist/index.js"
@@ -51,6 +51,7 @@
51
51
  "@types/figlet": "^1.7.0",
52
52
  "chalk": "^5.5.0",
53
53
  "figlet": "^1.8.2",
54
+ "globby": "^14.1.0",
54
55
  "ink": "^6.1.0",
55
56
  "react": "^19.1.1"
56
57
  },