tweakcc 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.js +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,6 +54,8 @@ node dist/index.js
|
|
|
54
54
|
|
|
55
55
|
- [**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.
|
|
56
56
|
- [**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.
|
|
57
|
+
- [**CCometixLine**](https://github.com/Haleclipse/CCometixLine) - A high-performance Claude Code statusline tool written in Rust with Git integration, usage tracking, interactive TUI configuration, and Claude Code enhancement utilities.
|
|
58
|
+
- [**cc-statuslines**](https://github.com/chongdashu/cc-statusline) - Transform your Claude Code experience with a beautiful, informative statusline. One command. Three questions. Custom statusline.
|
|
57
59
|
|
|
58
60
|
## FAQ
|
|
59
61
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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{Command as a}from"commander";import{Fragment as o,createContext as s,useCallback as c,useContext as l,useEffect as u,useState as d}from"react";import f from"ink-link";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import*as g from"node:path";import _ from"node:path";import*as v from"node:os";import{globbySync as y}from"globby";import*as b from"node:fs";import*as x from"node:child_process";import*as S from"node:crypto";import C from"figlet";import*as w from"node:fs/promises";import T from"node:fs/promises";import E from"chalk";function D({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)}),m(e,{flexDirection:`column`,children:n.map((n,r)=>m(e,{children:h(t,{children:[h(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&&h(t,{dimColor:!0,bold:!1,children:[` \x1B[0;2m`,`- `,n.desc]})]})},r))})}let O=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 k={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}},A=g.join(v.homedir(),`.tweakcc`),j=g.join(A,`config.json`),M=g.join(A,`cli.js.backup`),N=()=>{let e=[],t=process.platform==`win32`?v.homedir().replace(/\\/g,`/`):v.homedir(),n=`node_modules/@anthropic-ai/claude-code`;return e.push(`${v.homedir()}/.claude/local/${n}`),{}.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(...y(`${{}.NODENV_ROOT}/versions/*/lib/${n}`)),{}.NVS_HOME&&e.push(...y(`${{}.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(...y(`${t}/AppData/Roaming/nvm/*/${n}}`)),e.push(`${t}/AppData/Local/Yarn/config/global/${n}`),e.push(...y(`${t}/AppData/Local/pnpm/global/*/${n}`)),e.push(...y(`${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(...y(`${t}/AppData/Roaming/pnpm-global/*/${n}`)),e.push(`${t}/.bun/install/global/${n}`),e.push(...y(`${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/lib/${n}`),e.push(`${t}/.npm-packages/lib/${n}`),e.push(`${t}/.npm/lib/${n}`),e.push(`${t}/npm/lib/${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(...y(`${t}/.pnpm-global/*/${n}`)),e.push(`${t}/pnpm-global/${n}`),e.push(...y(`${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(...y(`/usr/local/n/versions/node/*/lib/${n}`)),e.push(`${t}/n/versions/node/{version}/lib/${n}`),e.push(...y(`${t}/.volta/tools/image/node/*/lib/${n}`)),e.push(...y(`${t}/.fnm/node-versions/*/installation/lib/${n}`)),e.push(...y(`/usr/local/nvm/versions/node/*/lib/${n}`)),e.push(...y(`${t}/.nvm/versions/node/*/lib/${n}`)),e.push(...y(`${t}/.nodenv/versions/*/lib/${n}`)),e.push(...y(`${t}/.nvs/*/lib/${n}`))),process.platform==`win32`?e.map(e=>e.replace(/\//g,`\\`)):e},P=N(),F=({children:e,...n})=>h(t,{bold:!0,backgroundColor:`#ffd500`,color:`#000`,...n,children:[` `,e,` `]});var I=F;const L=[{name:O.THEMES,desc:`Modify Claude Code's built-in themes or create your own`},{name:O.LAUNCH_TEXT,desc:`Change the "CLAUDE CODE" banner text that's shown when you sign in to Claude Code`},{name:O.THINKING_VERBS,desc:`Customize the list of verbs that Claude Code uses when it's working`},{name:O.THINKING_STYLE,desc:`Choose custom spinners`}],R=[{name:O.RESTORE_ORIGINAL,desc:`Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)`},{name:O.OPEN_CONFIG,desc:`Opens your tweakcc config file (${j})`},{name:O.OPEN_CLI,desc:`Opens Claude Code's cli.js file`},{name:O.EXIT,desc:`Bye!`}];function z({onSubmit:n,notification:r}){let i=[...l($).changesApplied?[]:[{name:O.APPLY_CHANGES,desc:`Required: Updates Claude Code's cli.js in-place with your changes`,selectedStyles:{color:`green`}}],...L,...R],[a,o]=d(0);return h(e,{flexDirection:`column`,children:[m(e,{marginBottom:1,children:m(I,{children:`Tweak Claude Code`})}),m(e,{marginBottom:1,children:h(t,{color:`gray`,children:[m(t,{bold:!0,children:`Customize your Claude Code installation.`}),` `,m(t,{dimColor:!0,children:`Settings will be saved to a JSON file.`})]})}),m(e,{marginBottom:1,children:h(t,{color:`yellow`,children:[`⭐ `,m(t,{bold:!0,children:`Star the repo at `}),m(f,{url:`https://github.com/Piebald-AI/tweakcc`,fallback:!1,children:m(t,{bold:!0,color:`cyan`,children:`https://github.com/Piebald-AI/tweakcc`})}),m(t,{bold:!0,children:` if you find this useful!`}),` ⭐`]})}),r&&m(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:m(t,{color:r?.type===`success`?`green`:r?.type===`error`?`red`:r?.type===`info`?`blue`:`yellow`,children:r?.message})}),m(D,{items:i,selectedIndex:a,onSelect:o,onSubmit:e=>n(e)})]})}function B({theme:n}){return h(e,{flexDirection:`column`,paddingLeft:1,children:[m(e,{marginBottom:1,children:h(t,{bold:!0,children:[`Preview: `,n.name]})}),m(e,{borderStyle:`single`,borderColor:`gray`,paddingX:1,children:h(e,{flexDirection:`column`,children:[m(t,{children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[`│ `,m(t,{color:n.colors.secondaryText,children:`1`}),` `,h(t,{color:n.colors.text,children:[`function greet() `,`{`]}),` `,`│`]}),h(t,{children:[`│ `,m(t,{color:n.colors.secondaryText,children:`2`}),` `,h(t,{backgroundColor:n.colors.diffRemoved,color:n.colors.text,children:[`- console.log("`,m(t,{backgroundColor:n.colors.diffRemovedWord,children:`Hello, World!`}),`");`]}),` `,`│`]}),h(t,{children:[`│ `,m(t,{color:n.colors.secondaryText,children:`2`}),` `,h(t,{backgroundColor:n.colors.diffAdded,color:n.colors.text,children:[`+ console.log("`,m(t,{backgroundColor:n.colors.diffAddedWord,children:`Hello, Claude!`}),`");`]}),` `,`│`]}),m(t,{color:n.colors.warning,children:`╭─────────────────────────────────────────────╮`}),h(t,{color:n.colors.warning,children:[`│ Do you trust the files in this folder?`,` `,`│`]}),h(t,{children:[m(t,{color:n.colors.warning,children:`│ `}),m(t,{dimColor:!0,children:`Enter to confirm · Esc to exit`}),h(t,{color:n.colors.warning,children:[` `,`│`]})]}),m(t,{color:n.colors.claude,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.claude,children:`│ `}),m(t,{color:n.colors.claude,children:`✻`}),m(t,{children:` Welcome to Tweak Claude Code!`}),h(t,{color:n.colors.claude,children:[` `,`│`]})]}),h(t,{children:[m(t,{color:n.colors.claude,children:`│`}),h(t,{color:n.colors.secondaryText,italic:!0,children:[` `,`/help for help, /status for your current set`]}),m(t,{color:n.colors.claude,children:`│`})]}),h(t,{color:n.colors.success,children:[`Login successful. Press `,m(t,{bold:!0,children:`Enter`}),` to continue…`]}),m(t,{color:n.colors.bashBorder,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.bashBorder,children:`│ !`}),h(t,{children:[` ls`,` `]}),m(t,{color:n.colors.bashBorder,children:`│`})]}),m(t,{color:n.colors.planMode,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.planMode,children:`│ `}),m(t,{color:n.colors.permission,children:`Ready to code?`}),h(t,{color:n.colors.planMode,children:[` `,`│`]})]}),h(t,{children:[m(t,{color:n.colors.planMode,children:`│ `}),m(t,{children:`Here is Claude's plan:`}),h(t,{color:n.colors.planMode,children:[` `,`│`]})]}),m(t,{color:n.colors.secondaryBorder,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.secondaryBorder,children:`│`}),` `,h(t,{color:n.colors.secondaryText,children:[`> Try “refactor <filepath>”`,` `,`│`]})]}),m(t,{color:n.colors.permission,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[h(t,{color:n.colors.permission,children:[`│ `,m(t,{bold:!0,children:`Permissions:`})]}),` `,h(t,{backgroundColor:n.colors.permission,color:n.colors.inverseText,bold:!0,children:[` `,`Allow`,` `]}),` `,`Deny`,` `,`Workspace`,` `,m(t,{color:n.colors.permission,children:`│`})]}),m(t,{color:n.colors.secondaryText,children:`> list the dir`}),h(t,{children:[m(t,{color:n.colors.error,children:`●`}),m(t,{children:` Update(__init__.py)`})]}),h(t,{children:[m(t,{children:` ⎿ `}),m(t,{color:n.colors.error,children:`User rejected update to __init__.py`})]}),h(t,{children:[` `,m(t,{color:n.colors.secondaryText,children:`1`}),` `,h(t,{backgroundColor:n.colors.diffRemovedDimmed,color:n.colors.text,children:[`- import`,` `,m(t,{backgroundColor:n.colors.diffRemovedWordDimmed,color:n.colors.text,children:`os`})]})]}),h(t,{children:[` `,m(t,{color:n.colors.secondaryText,children:`2`}),` `,h(t,{backgroundColor:n.colors.diffAddedDimmed,color:n.colors.text,children:[`+ import`,` `,m(t,{backgroundColor:n.colors.diffAddedWordDimmed,color:n.colors.text,children:`random`})]})]}),h(t,{children:[m(t,{color:n.colors.success,children:`●`}),m(t,{children:` List(.)`})]}),m(t,{children:` ⎿ Listed 123 paths (ctrl+r to expand)`}),h(t,{children:[m(t,{color:n.colors.secondaryText,children:`●`}),m(t,{children:` The directory `}),m(t,{color:n.colors.permission,children:`C:\\Users\\user`}),m(t,{children:` contains **123** files.`})]}),h(t,{children:[h(t,{color:n.colors.claude,children:[`✻ Th`,m(t,{color:n.colors.claudeShimmer,children:`ink`}),`ing…`,` `]}),m(t,{color:n.colors.secondaryText,children:`(10s · ↑ 456 tokens · esc to interrupt)`})]}),h(t,{children:[h(t,{color:n.colors.autoAccept,children:[`⏵⏵ auto-accept edits on`,` `]}),m(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),h(t,{children:[m(t,{color:n.colors.planMode,children:`⏸ plan mode on `}),m(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),m(t,{children:m(t,{color:n.colors.ide,children:`◯ IDE connected ⧉ 44 lines selected`})})]})})]})}function V({colorKey:e,theme:n,bold:r=!1}){let i=n.colors[e];return e===`inverseText`?m(t,{color:i,backgroundColor:n.colors.permission,bold:r,children:e}):e.startsWith(`diff`)?m(t,{backgroundColor:i,bold:r,color:n.colors.text,children:e}):m(t,{color:i,bold:r,children:e})}let H=!1;const U=()=>H,W=()=>{H=!0};function G(){try{let e=g.join(v.homedir(),`.claude.json`),t=JSON.parse(b.readFileSync(e,`utf8`));return t.theme||`dark`}catch{}return`dark`}function ee(e){if(process.platform===`win32`)x.spawn(`explorer`,[`/select,`,e],{detached:!0,stdio:`ignore`}).unref();else if(process.platform===`darwin`)x.spawn(`open`,[`-R`,e],{detached:!0,stdio:`ignore`}).unref();else{let t=g.dirname(e);x.spawn(`xdg-open`,[t],{detached:!0,stdio:`ignore`}).unref()}}function K(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 q(e){if(!K(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}async function te(e,t=`sha256`,n=64*1024){return new Promise((r,i)=>{let a=S.createHash(t),o=b.createReadStream(e,{highWaterMark:n});o.on(`data`,e=>{a.update(e)}),o.on(`end`,()=>{r(a.digest(`hex`))}),o.on(`error`,e=>{i(e)})})}function ne({initialValue:n,onColorChange:i,onExit:a,onCancel:s,colorKey:c,theme:l}){let f=J(n)||{h:0,s:50,l:50},g=re(n)||{r:128,g:128,b:128},[_,v]=d(f),[y,b]=d(g),[x,S]=d(`hsl`),[C,w]=d(`h`),[T,E]=d(!1);u(()=>{let e=J(n),t=re(n);e&&t&&(E(!0),v(e),b(t),E(!1))},[n]),u(()=>{if(!T){let e=`rgb(${y.r},${y.g},${y.b})`;i(e)}},[_,y,T]);let D=e=>{if(K(e)){let t=q(e),n=J(t),r=re(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)a();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],[f,p,h]=n[s],g=Math.round(l+(f-l)*c),_=Math.round(u+(p-u)*c),v=Math.round(d+(h-d)*c);e.push(m(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(m(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(m(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(m(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(m(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(m(t,{backgroundColor:`rgb(${y.r},${y.g},${r})`,children:` `},n))}return e},z=(e,t)=>Math.round(e/t*39);return h(e,{flexDirection:`column`,borderStyle:`single`,borderColor:`white`,padding:1,children:[h(e,{flexDirection:`column`,children:[m(t,{bold:!0,children:`Color Picker`}),h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{color:`gray`,dimColor:!0,children:`←→ to adjust (shift/ctrl/cmd +10)`}),m(t,{color:`gray`,dimColor:!0,children:`↑↓ to change bar`}),m(t,{color:`gray`,dimColor:!0,children:`ctrl+a to switch rgb/hsl`}),m(t,{color:`gray`,dimColor:!0,children:`paste color from clipboard`}),m(t,{color:`gray`,dimColor:!0,children:`enter to exit (auto-saved)`}),m(t,{color:`gray`,dimColor:!0,children:`esc to cancel changes`})]})]}),x===`hsl`?h(p,{children:[h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`h`?`yellow`:`white`,children:[C===`h`?`❯ `:` `,`Hue (`,_.h,`°):`]})}),m(e,{children:j().map((e,n)=>m(o,{children:n===z(_.h,360)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`s`?`yellow`:`white`,children:[C===`s`?`❯ `:` `,`Saturation (`,_.s,`%):`]})}),m(e,{children:M().map((e,n)=>m(o,{children:n===z(_.s,100)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`l`?`yellow`:`white`,children:[C===`l`?`❯ `:` `,`Lightness (`,_.l,`%):`]})}),m(e,{children:N().map((e,n)=>m(o,{children:n===z(_.l,100)?m(t,{children:`|`}):e},n))})]})]}):h(p,{children:[h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`r`?`yellow`:`white`,children:[C===`r`?`❯ `:` `,`Red (`,y.r,`):`]})}),m(e,{children:I().map((e,n)=>m(o,{children:n===z(y.r,255)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`g`?`yellow`:`white`,children:[C===`g`?`❯ `:` `,`Green (`,y.g,`):`]})}),m(e,{children:L().map((e,n)=>m(o,{children:n===z(y.g,255)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`b`?`yellow`:`white`,children:[C===`b`?`❯ `:` `,`Blue (`,y.b,`):`]})}),m(e,{children:R().map((e,n)=>m(o,{children:n===z(y.b,255)?m(t,{children:`|`}):e},n))})]})]}),h(e,{marginBottom:1,children:[m(t,{children:`Current: `}),m(t,{backgroundColor:P(),children:` `})]}),h(e,{flexDirection:`row`,justifyContent:`space-between`,children:[h(e,{flexDirection:`column`,children:[m(t,{dimColor:!0,children:`Hex `}),c?.startsWith(`diff`)?m(t,{backgroundColor:P(),color:l?.colors?.text||`white`,bold:!0,children:F(y.r,y.g,y.b)}):c===`inverseText`?m(t,{color:P(),backgroundColor:l?.colors?.permission,bold:!0,children:F(y.r,y.g,y.b)}):m(t,{color:P(),bold:!0,children:F(y.r,y.g,y.b)})]}),h(e,{flexDirection:`column`,children:[m(t,{dimColor:!0,children:`RGB `}),c?.startsWith(`diff`)?m(t,{backgroundColor:P(),color:l?.colors?.text||`white`,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):c===`inverseText`?m(t,{color:P(),backgroundColor:l?.colors?.permission,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):m(t,{color:P(),bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`})]}),h(e,{flexDirection:`column`,children:[m(t,{dimColor:!0,children:`HSL `}),c?.startsWith(`diff`)?m(t,{backgroundColor:P(),color:l?.colors?.text||`white`,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):c===`inverseText`?m(t,{color:P(),backgroundColor:l?.colors?.permission,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):m(t,{color:P(),bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`})]})]})]})}function re(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 J(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 ie({onBack:n,themeId:i}){let{settings:{themes:a},updateSettings:o}=l($),[s,u]=d(i),f=a.find(e=>e.id===s)||a[0],[g,_]=d(`rgb`),[v,y]=d(0),[b,x]=d(null),[S,C]=d(null),[w,T]=d(``),[E,D]=d(``),O=c(e=>{o(t=>{let n=t.themes.findIndex(e=>e.id===s);n!==-1&&e(t.themes[n])})},[s,o]),k=e=>{if(v>=2&&K(e)){let t=q(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(f.name),D(f.name);else if(v===1)C(`id`),T(f.id),D(f.id);else{let e=v-2,t=A[e],n=f.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=s;u(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(f.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}},M=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]||``},N=Math.max(...A.map(e=>e.length));return h(e,{children:[h(e,{flexDirection:`column`,width:`50%`,children:[m(e,{children:h(I,{children:[`Editing theme “`,f.name,`” (`,f.id,`)`]})}),b===null&&S===null?h(p,{children:[h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{dimColor:!0,children:`enter to edit theme name, id, or color`}),m(t,{dimColor:!0,children:`ctrl+a to toggle rgb, hex, hsl`}),m(t,{dimColor:!0,children:`paste color from clipboard (when on color)`}),m(t,{dimColor:!0,children:`esc to go back`})]}),v<2?h(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:`yellow`,flexDirection:`column`,paddingLeft:1,children:[m(t,{bold:!0,children:v===0?`Theme Name`:`Theme ID`}),m(t,{children:v===0?`The display name for this theme`:"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):h(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:f.colors[A[v-2]],flexDirection:`column`,paddingLeft:1,children:[m(V,{colorKey:A[v-2],theme:f,bold:!0}),m(t,{children:M(A[v-2])})]}),h(e,{flexDirection:`column`,children:[h(e,{children:[m(t,{color:v===0?`yellow`:`white`,children:v===0?`❯ `:` `}),m(t,{bold:!0,children:`Name: `}),m(t,{children:f.name})]}),h(e,{marginBottom:1,children:[m(t,{color:v===1?`yellow`:`white`,children:v===1?`❯ `:` `}),m(t,{bold:!0,children:`ID: `}),m(t,{children:f.id})]}),A.map((n,r)=>{let i=r+2;return h(e,{children:[m(t,{color:v===i?`yellow`:`white`,children:v===i?`❯ `:` `}),m(e,{width:N+2,children:m(t,{children:m(V,{colorKey:n,theme:f,bold:!0})})}),m(t,{color:f.colors[n],children:j(f.colors[n],g)})]},n)})]})]}):S?h(e,{flexDirection:`column`,marginTop:1,children:[h(t,{children:[`Editing `,S===`name`?`theme name`:`theme ID`,`:`]}),m(e,{borderStyle:`round`,borderColor:`yellow`,paddingX:1,children:m(t,{children:w})}),m(t,{dimColor:!0,children:`enter to save, esc to cancel`})]}):m(ne,{initialValue:E,colorKey:A[b],theme:f,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(``)}})]}),m(e,{width:`50%`,children:m(B,{theme:f})})]})}function ae(e){return e.map(e=>`${e.name} (${e.id})`)}function oe({onBack:n}){let{settings:{themes:i},updateSettings:a}=l($),[o,s]=d(0),[c,u]=d(null),[f,p]=d(!0),g=()=>{let e=i[0]||k.themes[0],t={colors:{...e.colors},name:`New Custom Theme`,id:`custom-${Date.now()}`};a(e=>{e.themes.push(t)}),u(t.id),p(!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=[...k.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&&(u(e.id),p(!1))}else if(e===`n`)g();else if(e===`d`){let e=i[o];e&&_(e.id)}else t.ctrl&&e===`r`&&v()},{isActive:f}),c)return m(ie,{themeId:c,onBack:()=>{u(null),p(!0)}});let y=ae(i),b=i.find(e=>y[o]?.includes(`(${e.id})`))||i[0];return i.length===0?m(e,{children:h(e,{flexDirection:`column`,width:`100%`,children:[m(I,{children:`Themes`}),h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{dimColor:!0,children:`n to create a new theme`}),m(t,{dimColor:!0,children:`esc to go back`})]}),m(t,{children:`No themes available!`})]})}):h(e,{children:[h(e,{flexDirection:`column`,width:`50%`,children:[m(I,{children:`Themes`}),h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{dimColor:!0,children:`n to create a new theme`}),m(t,{dimColor:!0,children:`d to delete a theme`}),m(t,{dimColor:!0,children:`ctrl+r to delete all themes and restore built-in`}),m(t,{dimColor:!0,children:`enter to edit theme`}),m(t,{dimColor:!0,children:`esc to go back`})]}),m(e,{flexDirection:`column`,children:y.map((e,n)=>h(t,{color:o===n?`yellow`:void 0,children:[o===n?`❯ `:` `,e]},n))})]}),m(e,{width:`50%`,children:m(B,{theme:b})})]})}let se=[`ANSI Shadow`];function ce({onBack:n}){let{stdout:a}=i(),o=a?.columns||120,{settings:{launchText:{method:s,figletText:c,figletFont:f,customText:g},themes:_},updateSettings:v}=l($),y=s===`figlet`?[`method`,`text`,`font`]:[`method`,`text`],[b,x]=d(0),S=y[b],[w,T]=d(s===`figlet`?0:1),[E,D]=d(se),[O,k]=d(se),[A,j]=d(``),[M,N]=d(!1),[P,F]=d(0),[L,R]=d(``),[z,B]=d(50),[V,H]=d(!1),[U,W]=d(s===`figlet`?c:g),ee=G(),K=_.find(e=>e.id===ee)||_.find(e=>e.id===`dark`),q=K?.colors.claude||`rgb(215,119,87)`;u(()=>{C.fonts((e,t)=>{if(!e&&t){let e=t.sort();D(e),k(e),se=e;let n=e.indexOf(f);F(n>=0?n:e.indexOf(`ANSI Shadow`)||0)}})},[]),u(()=>{te()},[s,c,f,g,U,V]);let te=()=>{if(s===`figlet`)try{let e=V?U:c,t=C.textSync(e.replace(`
|
|
2
|
+
import{Box as e,Text as t,render as n,useInput as r,useStdout as i}from"ink";import{Command as a}from"commander";import{Fragment as o,createContext as s,useCallback as c,useContext as l,useEffect as u,useState as d}from"react";import f from"ink-link";import{Fragment as p,jsx as m,jsxs as h}from"react/jsx-runtime";import*as g from"node:path";import _ from"node:path";import*as v from"node:os";import{globbySync as y}from"globby";import*as b from"node:fs";import*as x from"node:child_process";import*as S from"node:crypto";import C from"figlet";import*as w from"node:fs/promises";import T from"node:fs/promises";import E from"chalk";function D({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)}),m(e,{flexDirection:`column`,children:n.map((n,r)=>m(e,{children:h(t,{children:[h(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&&h(t,{dimColor:!0,bold:!1,children:[` \x1B[0;2m`,`- `,n.desc]})]})},r))})}let O=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 k={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}},A=g.join(v.homedir(),`.tweakcc`),j=g.join(A,`config.json`),M=g.join(A,`cli.js.backup`),N=()=>{let e=[],t=process.platform==`win32`?v.homedir().replace(/\\/g,`/`):v.homedir(),n=`node_modules/@anthropic-ai/claude-code`;return e.push(`${v.homedir()}/.claude/local/${n}`),{}.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(...y(`${{}.NODENV_ROOT}/versions/*/lib/${n}`)),{}.NVS_HOME&&e.push(...y(`${{}.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(...y(`${t}/AppData/Roaming/nvm/*/${n}}`)),e.push(`${t}/AppData/Local/Yarn/config/global/${n}`),e.push(...y(`${t}/AppData/Local/pnpm/global/*/${n}`)),e.push(...y(`${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(...y(`${t}/AppData/Roaming/pnpm-global/*/${n}`)),e.push(`${t}/.bun/install/global/${n}`),e.push(...y(`${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/lib/${n}`),e.push(`${t}/.npm-packages/lib/${n}`),e.push(`${t}/.npm/lib/${n}`),e.push(`${t}/npm/lib/${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(...y(`${t}/.pnpm-global/*/${n}`)),e.push(`${t}/pnpm-global/${n}`),e.push(...y(`${t}/pnpm-global/*/${n}`)),e.push(`${t}/.local/share/pnpm/global/${n}`),e.push(...y(`${t}/.local/share/pnpm/global/*/${n}`)),e.push(`${t}/.bun/install/global/${n}`),e.push(...y(`/usr/local/n/versions/node/*/lib/${n}`)),e.push(...y(`${t}/n/versions/node/*/lib/${n}`)),e.push(`${t}/n/lib/${n}`),e.push(...y(`${t}/.volta/tools/image/node/*/lib/${n}`)),e.push(...y(`${t}/.fnm/node-versions/*/installation/lib/${n}`)),e.push(...y(`/usr/local/nvm/versions/node/*/lib/${n}`)),e.push(...y(`${t}/.nvm/versions/node/*/lib/${n}`)),e.push(...y(`${t}/.nodenv/versions/*/lib/${n}`)),e.push(...y(`${t}/.nvs/*/lib/${n}`))),process.platform==`win32`?e.map(e=>e.replace(/\//g,`\\`)):e},P=N(),F=({children:e,...n})=>h(t,{bold:!0,backgroundColor:`#ffd500`,color:`#000`,...n,children:[` `,e,` `]});var I=F;const L=[{name:O.THEMES,desc:`Modify Claude Code's built-in themes or create your own`},{name:O.LAUNCH_TEXT,desc:`Change the "CLAUDE CODE" banner text that's shown when you sign in to Claude Code`},{name:O.THINKING_VERBS,desc:`Customize the list of verbs that Claude Code uses when it's working`},{name:O.THINKING_STYLE,desc:`Choose custom spinners`}],R=[{name:O.RESTORE_ORIGINAL,desc:`Reverts your Claude Code install to its original state (your customizations are remembered and can be reapplied)`},{name:O.OPEN_CONFIG,desc:`Opens your tweakcc config file (${j})`},{name:O.OPEN_CLI,desc:`Opens Claude Code's cli.js file`},{name:O.EXIT,desc:`Bye!`}];function z({onSubmit:n,notification:r}){let i=[...l($).changesApplied?[]:[{name:O.APPLY_CHANGES,desc:`Required: Updates Claude Code's cli.js in-place with your changes`,selectedStyles:{color:`green`}}],...L,...R],[a,o]=d(0);return h(e,{flexDirection:`column`,children:[m(e,{marginBottom:1,children:m(I,{children:`Tweak Claude Code`})}),m(e,{marginBottom:1,children:h(t,{color:`gray`,children:[m(t,{bold:!0,children:`Customize your Claude Code installation.`}),` `,m(t,{dimColor:!0,children:`Settings will be saved to a JSON file.`})]})}),m(e,{marginBottom:1,children:h(t,{color:`yellow`,children:[`⭐ `,m(t,{bold:!0,children:`Star the repo at `}),m(f,{url:`https://github.com/Piebald-AI/tweakcc`,fallback:!1,children:m(t,{bold:!0,color:`cyan`,children:`https://github.com/Piebald-AI/tweakcc`})}),m(t,{bold:!0,children:` if you find this useful!`}),` ⭐`]})}),r&&m(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:m(t,{color:r?.type===`success`?`green`:r?.type===`error`?`red`:r?.type===`info`?`blue`:`yellow`,children:r?.message})}),m(D,{items:i,selectedIndex:a,onSelect:o,onSubmit:e=>n(e)})]})}function B({theme:n}){return h(e,{flexDirection:`column`,paddingLeft:1,children:[m(e,{marginBottom:1,children:h(t,{bold:!0,children:[`Preview: `,n.name]})}),m(e,{borderStyle:`single`,borderColor:`gray`,paddingX:1,children:h(e,{flexDirection:`column`,children:[m(t,{children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[`│ `,m(t,{color:n.colors.secondaryText,children:`1`}),` `,h(t,{color:n.colors.text,children:[`function greet() `,`{`]}),` `,`│`]}),h(t,{children:[`│ `,m(t,{color:n.colors.secondaryText,children:`2`}),` `,h(t,{backgroundColor:n.colors.diffRemoved,color:n.colors.text,children:[`- console.log("`,m(t,{backgroundColor:n.colors.diffRemovedWord,children:`Hello, World!`}),`");`]}),` `,`│`]}),h(t,{children:[`│ `,m(t,{color:n.colors.secondaryText,children:`2`}),` `,h(t,{backgroundColor:n.colors.diffAdded,color:n.colors.text,children:[`+ console.log("`,m(t,{backgroundColor:n.colors.diffAddedWord,children:`Hello, Claude!`}),`");`]}),` `,`│`]}),m(t,{color:n.colors.warning,children:`╭─────────────────────────────────────────────╮`}),h(t,{color:n.colors.warning,children:[`│ Do you trust the files in this folder?`,` `,`│`]}),h(t,{children:[m(t,{color:n.colors.warning,children:`│ `}),m(t,{dimColor:!0,children:`Enter to confirm · Esc to exit`}),h(t,{color:n.colors.warning,children:[` `,`│`]})]}),m(t,{color:n.colors.claude,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.claude,children:`│ `}),m(t,{color:n.colors.claude,children:`✻`}),m(t,{children:` Welcome to Tweak Claude Code!`}),h(t,{color:n.colors.claude,children:[` `,`│`]})]}),h(t,{children:[m(t,{color:n.colors.claude,children:`│`}),h(t,{color:n.colors.secondaryText,italic:!0,children:[` `,`/help for help, /status for your current set`]}),m(t,{color:n.colors.claude,children:`│`})]}),h(t,{color:n.colors.success,children:[`Login successful. Press `,m(t,{bold:!0,children:`Enter`}),` to continue…`]}),m(t,{color:n.colors.bashBorder,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.bashBorder,children:`│ !`}),h(t,{children:[` ls`,` `]}),m(t,{color:n.colors.bashBorder,children:`│`})]}),m(t,{color:n.colors.planMode,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.planMode,children:`│ `}),m(t,{color:n.colors.permission,children:`Ready to code?`}),h(t,{color:n.colors.planMode,children:[` `,`│`]})]}),h(t,{children:[m(t,{color:n.colors.planMode,children:`│ `}),m(t,{children:`Here is Claude's plan:`}),h(t,{color:n.colors.planMode,children:[` `,`│`]})]}),m(t,{color:n.colors.secondaryBorder,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[m(t,{color:n.colors.secondaryBorder,children:`│`}),` `,h(t,{color:n.colors.secondaryText,children:[`> Try “refactor <filepath>”`,` `,`│`]})]}),m(t,{color:n.colors.permission,children:`╭─────────────────────────────────────────────╮`}),h(t,{children:[h(t,{color:n.colors.permission,children:[`│ `,m(t,{bold:!0,children:`Permissions:`})]}),` `,h(t,{backgroundColor:n.colors.permission,color:n.colors.inverseText,bold:!0,children:[` `,`Allow`,` `]}),` `,`Deny`,` `,`Workspace`,` `,m(t,{color:n.colors.permission,children:`│`})]}),m(t,{color:n.colors.secondaryText,children:`> list the dir`}),h(t,{children:[m(t,{color:n.colors.error,children:`●`}),m(t,{children:` Update(__init__.py)`})]}),h(t,{children:[m(t,{children:` ⎿ `}),m(t,{color:n.colors.error,children:`User rejected update to __init__.py`})]}),h(t,{children:[` `,m(t,{color:n.colors.secondaryText,children:`1`}),` `,h(t,{backgroundColor:n.colors.diffRemovedDimmed,color:n.colors.text,children:[`- import`,` `,m(t,{backgroundColor:n.colors.diffRemovedWordDimmed,color:n.colors.text,children:`os`})]})]}),h(t,{children:[` `,m(t,{color:n.colors.secondaryText,children:`2`}),` `,h(t,{backgroundColor:n.colors.diffAddedDimmed,color:n.colors.text,children:[`+ import`,` `,m(t,{backgroundColor:n.colors.diffAddedWordDimmed,color:n.colors.text,children:`random`})]})]}),h(t,{children:[m(t,{color:n.colors.success,children:`●`}),m(t,{children:` List(.)`})]}),m(t,{children:` ⎿ Listed 123 paths (ctrl+r to expand)`}),h(t,{children:[m(t,{color:n.colors.secondaryText,children:`●`}),m(t,{children:` The directory `}),m(t,{color:n.colors.permission,children:`C:\\Users\\user`}),m(t,{children:` contains **123** files.`})]}),h(t,{children:[h(t,{color:n.colors.claude,children:[`✻ Th`,m(t,{color:n.colors.claudeShimmer,children:`ink`}),`ing…`,` `]}),m(t,{color:n.colors.secondaryText,children:`(10s · ↑ 456 tokens · esc to interrupt)`})]}),h(t,{children:[h(t,{color:n.colors.autoAccept,children:[`⏵⏵ auto-accept edits on`,` `]}),m(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),h(t,{children:[m(t,{color:n.colors.planMode,children:`⏸ plan mode on `}),m(t,{color:n.colors.secondaryText,dimColor:!0,children:`(shift+tab to cycle)`})]}),m(t,{children:m(t,{color:n.colors.ide,children:`◯ IDE connected ⧉ 44 lines selected`})})]})})]})}function V({colorKey:e,theme:n,bold:r=!1}){let i=n.colors[e];return e===`inverseText`?m(t,{color:i,backgroundColor:n.colors.permission,bold:r,children:e}):e.startsWith(`diff`)?m(t,{backgroundColor:i,bold:r,color:n.colors.text,children:e}):m(t,{color:i,bold:r,children:e})}let H=!1;const U=()=>H,W=()=>{H=!0};function G(){try{let e=g.join(v.homedir(),`.claude.json`),t=JSON.parse(b.readFileSync(e,`utf8`));return t.theme||`dark`}catch{}return`dark`}function ee(e){if(process.platform===`win32`)x.spawn(`explorer`,[`/select,`,e],{detached:!0,stdio:`ignore`}).unref();else if(process.platform===`darwin`)x.spawn(`open`,[`-R`,e],{detached:!0,stdio:`ignore`}).unref();else{let t=g.dirname(e);x.spawn(`xdg-open`,[t],{detached:!0,stdio:`ignore`}).unref()}}function K(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 q(e){if(!K(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}async function te(e,t=`sha256`,n=64*1024){return new Promise((r,i)=>{let a=S.createHash(t),o=b.createReadStream(e,{highWaterMark:n});o.on(`data`,e=>{a.update(e)}),o.on(`end`,()=>{r(a.digest(`hex`))}),o.on(`error`,e=>{i(e)})})}function ne({initialValue:n,onColorChange:i,onExit:a,onCancel:s,colorKey:c,theme:l}){let f=J(n)||{h:0,s:50,l:50},g=re(n)||{r:128,g:128,b:128},[_,v]=d(f),[y,b]=d(g),[x,S]=d(`hsl`),[C,w]=d(`h`),[T,E]=d(!1);u(()=>{let e=J(n),t=re(n);e&&t&&(E(!0),v(e),b(t),E(!1))},[n]),u(()=>{if(!T){let e=`rgb(${y.r},${y.g},${y.b})`;i(e)}},[_,y,T]);let D=e=>{if(K(e)){let t=q(e),n=J(t),r=re(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)a();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],[f,p,h]=n[s],g=Math.round(l+(f-l)*c),_=Math.round(u+(p-u)*c),v=Math.round(d+(h-d)*c);e.push(m(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(m(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(m(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(m(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(m(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(m(t,{backgroundColor:`rgb(${y.r},${y.g},${r})`,children:` `},n))}return e},z=(e,t)=>Math.round(e/t*39);return h(e,{flexDirection:`column`,borderStyle:`single`,borderColor:`white`,padding:1,children:[h(e,{flexDirection:`column`,children:[m(t,{bold:!0,children:`Color Picker`}),h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{color:`gray`,dimColor:!0,children:`←→ to adjust (shift/ctrl/cmd +10)`}),m(t,{color:`gray`,dimColor:!0,children:`↑↓ to change bar`}),m(t,{color:`gray`,dimColor:!0,children:`ctrl+a to switch rgb/hsl`}),m(t,{color:`gray`,dimColor:!0,children:`paste color from clipboard`}),m(t,{color:`gray`,dimColor:!0,children:`enter to exit (auto-saved)`}),m(t,{color:`gray`,dimColor:!0,children:`esc to cancel changes`})]})]}),x===`hsl`?h(p,{children:[h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`h`?`yellow`:`white`,children:[C===`h`?`❯ `:` `,`Hue (`,_.h,`°):`]})}),m(e,{children:j().map((e,n)=>m(o,{children:n===z(_.h,360)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`s`?`yellow`:`white`,children:[C===`s`?`❯ `:` `,`Saturation (`,_.s,`%):`]})}),m(e,{children:M().map((e,n)=>m(o,{children:n===z(_.s,100)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`l`?`yellow`:`white`,children:[C===`l`?`❯ `:` `,`Lightness (`,_.l,`%):`]})}),m(e,{children:N().map((e,n)=>m(o,{children:n===z(_.l,100)?m(t,{children:`|`}):e},n))})]})]}):h(p,{children:[h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`r`?`yellow`:`white`,children:[C===`r`?`❯ `:` `,`Red (`,y.r,`):`]})}),m(e,{children:I().map((e,n)=>m(o,{children:n===z(y.r,255)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`g`?`yellow`:`white`,children:[C===`g`?`❯ `:` `,`Green (`,y.g,`):`]})}),m(e,{children:L().map((e,n)=>m(o,{children:n===z(y.g,255)?m(t,{children:`|`}):e},n))})]}),h(e,{marginBottom:1,children:[m(e,{width:25,children:h(t,{color:C===`b`?`yellow`:`white`,children:[C===`b`?`❯ `:` `,`Blue (`,y.b,`):`]})}),m(e,{children:R().map((e,n)=>m(o,{children:n===z(y.b,255)?m(t,{children:`|`}):e},n))})]})]}),h(e,{marginBottom:1,children:[m(t,{children:`Current: `}),m(t,{backgroundColor:P(),children:` `})]}),h(e,{flexDirection:`row`,justifyContent:`space-between`,children:[h(e,{flexDirection:`column`,children:[m(t,{dimColor:!0,children:`Hex `}),c?.startsWith(`diff`)?m(t,{backgroundColor:P(),color:l?.colors?.text||`white`,bold:!0,children:F(y.r,y.g,y.b)}):c===`inverseText`?m(t,{color:P(),backgroundColor:l?.colors?.permission,bold:!0,children:F(y.r,y.g,y.b)}):m(t,{color:P(),bold:!0,children:F(y.r,y.g,y.b)})]}),h(e,{flexDirection:`column`,children:[m(t,{dimColor:!0,children:`RGB `}),c?.startsWith(`diff`)?m(t,{backgroundColor:P(),color:l?.colors?.text||`white`,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):c===`inverseText`?m(t,{color:P(),backgroundColor:l?.colors?.permission,bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`}):m(t,{color:P(),bold:!0,children:`rgb(${y.r}, ${y.g}, ${y.b})`})]}),h(e,{flexDirection:`column`,children:[m(t,{dimColor:!0,children:`HSL `}),c?.startsWith(`diff`)?m(t,{backgroundColor:P(),color:l?.colors?.text||`white`,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):c===`inverseText`?m(t,{color:P(),backgroundColor:l?.colors?.permission,bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`}):m(t,{color:P(),bold:!0,children:`hsl(${_.h}, ${_.s}%, ${_.l}%)`})]})]})]})}function re(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 J(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 ie({onBack:n,themeId:i}){let{settings:{themes:a},updateSettings:o}=l($),[s,u]=d(i),f=a.find(e=>e.id===s)||a[0],[g,_]=d(`rgb`),[v,y]=d(0),[b,x]=d(null),[S,C]=d(null),[w,T]=d(``),[E,D]=d(``),O=c(e=>{o(t=>{let n=t.themes.findIndex(e=>e.id===s);n!==-1&&e(t.themes[n])})},[s,o]),k=e=>{if(v>=2&&K(e)){let t=q(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(f.name),D(f.name);else if(v===1)C(`id`),T(f.id),D(f.id);else{let e=v-2,t=A[e],n=f.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=s;u(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(f.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}},M=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]||``},N=Math.max(...A.map(e=>e.length));return h(e,{children:[h(e,{flexDirection:`column`,width:`50%`,children:[m(e,{children:h(I,{children:[`Editing theme “`,f.name,`” (`,f.id,`)`]})}),b===null&&S===null?h(p,{children:[h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{dimColor:!0,children:`enter to edit theme name, id, or color`}),m(t,{dimColor:!0,children:`ctrl+a to toggle rgb, hex, hsl`}),m(t,{dimColor:!0,children:`paste color from clipboard (when on color)`}),m(t,{dimColor:!0,children:`esc to go back`})]}),v<2?h(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:`yellow`,flexDirection:`column`,paddingLeft:1,children:[m(t,{bold:!0,children:v===0?`Theme Name`:`Theme ID`}),m(t,{children:v===0?`The display name for this theme`:"Unique identifier for this theme; used in `.claude.json` to select the theme."})]}):h(e,{marginBottom:1,borderStyle:`single`,borderTop:!1,borderBottom:!1,borderRight:!1,borderColor:f.colors[A[v-2]],flexDirection:`column`,paddingLeft:1,children:[m(V,{colorKey:A[v-2],theme:f,bold:!0}),m(t,{children:M(A[v-2])})]}),h(e,{flexDirection:`column`,children:[h(e,{children:[m(t,{color:v===0?`yellow`:`white`,children:v===0?`❯ `:` `}),m(t,{bold:!0,children:`Name: `}),m(t,{children:f.name})]}),h(e,{marginBottom:1,children:[m(t,{color:v===1?`yellow`:`white`,children:v===1?`❯ `:` `}),m(t,{bold:!0,children:`ID: `}),m(t,{children:f.id})]}),A.map((n,r)=>{let i=r+2;return h(e,{children:[m(t,{color:v===i?`yellow`:`white`,children:v===i?`❯ `:` `}),m(e,{width:N+2,children:m(t,{children:m(V,{colorKey:n,theme:f,bold:!0})})}),m(t,{color:f.colors[n],children:j(f.colors[n],g)})]},n)})]})]}):S?h(e,{flexDirection:`column`,marginTop:1,children:[h(t,{children:[`Editing `,S===`name`?`theme name`:`theme ID`,`:`]}),m(e,{borderStyle:`round`,borderColor:`yellow`,paddingX:1,children:m(t,{children:w})}),m(t,{dimColor:!0,children:`enter to save, esc to cancel`})]}):m(ne,{initialValue:E,colorKey:A[b],theme:f,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(``)}})]}),m(e,{width:`50%`,children:m(B,{theme:f})})]})}function ae(e){return e.map(e=>`${e.name} (${e.id})`)}function oe({onBack:n}){let{settings:{themes:i},updateSettings:a}=l($),[o,s]=d(0),[c,u]=d(null),[f,p]=d(!0),g=()=>{let e=i[0]||k.themes[0],t={colors:{...e.colors},name:`New Custom Theme`,id:`custom-${Date.now()}`};a(e=>{e.themes.push(t)}),u(t.id),p(!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=[...k.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&&(u(e.id),p(!1))}else if(e===`n`)g();else if(e===`d`){let e=i[o];e&&_(e.id)}else t.ctrl&&e===`r`&&v()},{isActive:f}),c)return m(ie,{themeId:c,onBack:()=>{u(null),p(!0)}});let y=ae(i),b=i.find(e=>y[o]?.includes(`(${e.id})`))||i[0];return i.length===0?m(e,{children:h(e,{flexDirection:`column`,width:`100%`,children:[m(I,{children:`Themes`}),h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{dimColor:!0,children:`n to create a new theme`}),m(t,{dimColor:!0,children:`esc to go back`})]}),m(t,{children:`No themes available!`})]})}):h(e,{children:[h(e,{flexDirection:`column`,width:`50%`,children:[m(I,{children:`Themes`}),h(e,{marginBottom:1,flexDirection:`column`,children:[m(t,{dimColor:!0,children:`n to create a new theme`}),m(t,{dimColor:!0,children:`d to delete a theme`}),m(t,{dimColor:!0,children:`ctrl+r to delete all themes and restore built-in`}),m(t,{dimColor:!0,children:`enter to edit theme`}),m(t,{dimColor:!0,children:`esc to go back`})]}),m(e,{flexDirection:`column`,children:y.map((e,n)=>h(t,{color:o===n?`yellow`:void 0,children:[o===n?`❯ `:` `,e]},n))})]}),m(e,{width:`50%`,children:m(B,{theme:b})})]})}let se=[`ANSI Shadow`];function ce({onBack:n}){let{stdout:a}=i(),o=a?.columns||120,{settings:{launchText:{method:s,figletText:c,figletFont:f,customText:g},themes:_},updateSettings:v}=l($),y=s===`figlet`?[`method`,`text`,`font`]:[`method`,`text`],[b,x]=d(0),S=y[b],[w,T]=d(s===`figlet`?0:1),[E,D]=d(se),[O,k]=d(se),[A,j]=d(``),[M,N]=d(!1),[P,F]=d(0),[L,R]=d(``),[z,B]=d(50),[V,H]=d(!1),[U,W]=d(s===`figlet`?c:g),ee=G(),K=_.find(e=>e.id===ee)||_.find(e=>e.id===`dark`),q=K?.colors.claude||`rgb(215,119,87)`;u(()=>{C.fonts((e,t)=>{if(!e&&t){let e=t.sort();D(e),k(e),se=e;let n=e.indexOf(f);F(n>=0?n:e.indexOf(`ANSI Shadow`)||0)}})},[]),u(()=>{te()},[s,c,f,g,U,V]);let te=()=>{if(s===`figlet`)try{let e=V?U:c,t=C.textSync(e.replace(`
|
|
3
3
|
`,` `),{font:f}),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
5
|
`);R(a);let s=Math.max(...i.map(e=>e.length)),l=Math.min(75,Math.max(50,Math.ceil(s/o*100)));B(l+5)}catch{R(`Error generating figlet text`),B(50)}else{let e=Math.floor(o*.6),t=V?U:g,n=t.split(`
|
|
@@ -18,10 +18,10 @@ import{Box as e,Text as t,render as n,useInput as r,useStdout as i}from"ink";imp
|
|
|
18
18
|
╚██████╗╚██████╔╝██████╔╝███████╗
|
|
19
19
|
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝`);return t===-1?null:{startIndex:t-1,endIndex:t+495+1}}function be(e,t){let n=ye(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 xe(e){let t=/" Welcome to ",[$\w]+\.createElement\([^,]+,\{bold:!0\},"Claude Code"\),"!"/,n=e.match(t);if(n&&n.index!==void 0){let e=n[0].indexOf(`"Claude Code"`);if(e!==-1)return{startIndex:n.index+e,endIndex:n.index+e+13}}return null}function Se(e,t){let n=xe(e);if(!n)return console.error(`patch: welcome message: failed to find location`),null;let r=`"${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,identifiers:[n[1].trim()]},objArr:{startIndex:a.index,endIndex:a.index+a[0].length},obj:{startIndex:o.index,endIndex:o.index+o[0].length}}}const we=(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.identifiers?.[0]}){\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},Te=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},Ee=(e,t)=>{let n=Te(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},De=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}},Oe=(e,t)=>{let n=De(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},ke=e=>{let t=/[\w$]+\(\(\)=>\{if\(![\w$]+\)\{[\w$]+\(\d+\);return\}[\w$]+\(\([^)]+\)=>[^)]+\+1\)\},\d+\)/,n=e.match(t);if(!n||n.index===void 0)return console.error(`patch: spinner no-freeze: failed to find wholeMatch`),null;let r=/if\(![\w$]+\)\{[\w$]+\(\d+\);return\}/,i=n[0].match(r);if(!i||i.index===void 0)return console.error(`patch: spinner no-freeze: failed to find freeze condition`),null;let a=n.index+i.index,o=a+i[0].length;return{startIndex:a,endIndex:o}},Ae=e=>{let t=ke(e);if(!t)return null;let n=e.slice(0,t.startIndex)+e.slice(t.endIndex);return Q(e,n,``,t.startIndex,t.endIndex),n},je=e=>{let t=/([$\w]+)=\{words:\[(?:"[^"{}()]+ing",)+"[^"{}()]+ing"\]\}/s,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker verbs: failed to find verbsMatch`),null):{startIndex:n.index,endIndex:n.index+n[0].length,identifiers:[n[1]]}},Me=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):{startIndex:n.index,endIndex:n.index+n[0].length,identifiers:[n[1]]}},Ne=(e,t)=>{let n=je(e);if(!n)return null;let r=n,i=r.identifiers?.[0],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=Me(o);if(!s)return null;let c=s,l=c.identifiers?.[0],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},Pe=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+600),i=/([$\w]+)(=\(([^;]{1,200}?)\)\+"…")/,a=r.match(i);return!a||a.index==null?(console.error(`patch: thinker format: failed to find formatMatch`),null):{startIndex:n.index+a.index+a[1].length,endIndex:n.index+a.index+a[1].length+a[2].length,identifiers:[a[3]]}},Fe=(e,t)=>{let n=Pe(e);if(!n)return null;let r=n,i=t.replace(/\\/g,`\\\\`).replace(/`/g,"\\`"),a=r.identifiers?.[0],o="`"+i.replace(/\{\}/g,"${"+a+`}`)+"`",s=`=${o}`,c=e.slice(0,r.startIndex)+s+e.slice(r.endIndex);return Q(e,c,s,r.startIndex,r.endIndex),c},Ie=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,identifiers:[n[1]]}},Le=(e,t)=>{let n=Ie(e);if(!n)return null;let r=n.identifiers?.[0],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},Re=e=>{let t=/\{flexWrap:"wrap",height:1,width:2\}/,n=e.match(t);return!n||n.index==null?(console.error(`patch: thinker symbol width: failed to find match`),null):{startIndex:n.index,endIndex:n.index+n[0].length}},ze=(e,t)=>{let n=Re(e);if(!n)return null;let r=`{flexWrap:"wrap",height:1,width:${t}}`,i=e.slice(0,n.startIndex)+r+e.slice(n.endIndex);return Q(e,i,r,n.startIndex,n.endIndex),i};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),c=e.slice(a,r),l=e.slice(r,i),u=e.slice(i,o),d=t.slice(a,r),f=t.slice(r,r+n.length),p=t.slice(r+n.length,s);U()&&(console.log(`
|
|
20
20
|
--- Diff ---`),console.log(`OLD:`,c+`\x1b[31m${l}\x1b[0m`+u),console.log(`NEW:`,d+`\x1b[32m${f}\x1b[0m`+p),console.log(`--- End Diff ---
|
|
21
|
-
`))}const Be=e=>{let t=/createElement\([$\w]+,\{[^}]+spinnerTip[^}]+overrideMessage[^}]+\}/,n=e.match(t);if(!n||n.index===void 0)return console.error(`patch: verbose: failed to find createElement with spinnerTip and overrideMessage`),null;let r=n[0],i=/verbose:[^,}]+/,a=r.match(i);if(!a||a.index===void 0)return console.error(`patch: verbose: failed to find verbose property`),null;let o=n.index+a.index,s=o+a[0].length;return{startIndex:o,endIndex:s}},Ve=e=>{let t=Be(e);if(!t)return null;let n=`verbose:true`,r=e.slice(0,t.startIndex)+n+e.slice(t.endIndex);return Q(e,r,n,t.startIndex,t.endIndex),r},He=async(e,t)=>{await me(t);let n=await w.readFile(t.cliPath,{encoding:`utf8`}),r=null;if(e.settings.themes&&e.settings.themes.length>0&&(r=we(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=>C.text(t.figletText.replace(`
|
|
22
|
-
`,` `),t.figletFont,(t,n)=>{t?(console.error(`patch: figlet: failed to generate text`,t),e(``)):e(n||``)}))),(r=be(n,i))&&(n=r);let a=t.method===`custom`?t.customText:t.figletText;a&&(r=Se(n,a))&&(n=r)}return e.settings.thinkingVerbs&&((r=Ne(n,e.settings.thinkingVerbs.verbs))&&(n=r),(r=Fe(n,e.settings.thinkingVerbs.format))&&(n=r)),(r=Ee(n,e.settings.thinkingStyle.phases))&&(n=r),(r=Oe(n,e.settings.thinkingStyle.updateInterval))&&(n=r),(r=ze(n,Math.max(...e.settings.thinkingStyle.phases.map(e=>e.length))+1))&&(n=r),(r=Le(n,e.settings.thinkingStyle.reverseMirror))&&(n=r),(r=Ve(n))&&(n=r),(r=Ae(n))&&(n=r),await w.writeFile(t.cliPath,n),await Z(e=>{e.changesApplied=!0})},$=s({settings:k,updateSettings:e=>{},changesApplied:!1});function
|
|
21
|
+
`))}const Be=e=>{let t=/createElement\([$\w]+,\{[^}]+spinnerTip[^}]+overrideMessage[^}]+\}/,n=e.match(t);if(!n||n.index===void 0)return console.error(`patch: verbose: failed to find createElement with spinnerTip and overrideMessage`),null;let r=n[0],i=/verbose:[^,}]+/,a=r.match(i);if(!a||a.index===void 0)return console.error(`patch: verbose: failed to find verbose property`),null;let o=n.index+a.index,s=o+a[0].length;return{startIndex:o,endIndex:s}},Ve=e=>{let t=Be(e);if(!t)return null;let n=`verbose:true`,r=e.slice(0,t.startIndex)+n+e.slice(t.endIndex);return Q(e,r,n,t.startIndex,t.endIndex),r},He=e=>{let t=/function ([$\w]+)\(([$\w]*)\)\{((?:if\([$\w]+\.includes\("\[1m\]"\)\)return 1e6;)?return 200000)\}/,n=e.match(t);return!n||n.index===void 0?(console.error(`patch: context limit: failed to find match`),null):{startIndex:n.index,endIndex:n.index+n[0].length,identifiers:[n[1],n[2],n[3]]}},Ue=e=>{let t=He(e);if(!t)return null;let n=t.identifiers?.[0],r=t.identifiers?.[1],i=t.identifiers?.[2],a=`function ${n}(${r}){if(process.env.CLAUDE_CODE_CONTEXT_LIMIT)return Number(process.env.CLAUDE_CODE_CONTEXT_LIMIT);${i}}`,o=e.slice(0,t.startIndex)+a+e.slice(t.endIndex);return Q(e,o,a,t.startIndex,t.endIndex),o},We=async(e,t)=>{await me(t);let n=await w.readFile(t.cliPath,{encoding:`utf8`}),r=null;if(e.settings.themes&&e.settings.themes.length>0&&(r=we(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=>C.text(t.figletText.replace(`
|
|
22
|
+
`,` `),t.figletFont,(t,n)=>{t?(console.error(`patch: figlet: failed to generate text`,t),e(``)):e(n||``)}))),(r=be(n,i))&&(n=r);let a=t.method===`custom`?t.customText:t.figletText;a&&(r=Se(n,a))&&(n=r)}return e.settings.thinkingVerbs&&((r=Ne(n,e.settings.thinkingVerbs.verbs))&&(n=r),(r=Fe(n,e.settings.thinkingVerbs.format))&&(n=r)),(r=Ee(n,e.settings.thinkingStyle.phases))&&(n=r),(r=Oe(n,e.settings.thinkingStyle.updateInterval))&&(n=r),(r=ze(n,Math.max(...e.settings.thinkingStyle.phases.map(e=>e.length))+1))&&(n=r),(r=Le(n,e.settings.thinkingStyle.reverseMirror))&&(n=r),(r=Ve(n))&&(n=r),(r=Ae(n))&&(n=r),(r=Ue(n))&&(n=r),await w.writeFile(t.cliPath,n),await Z(e=>{e.changesApplied=!0})},$=s({settings:k,updateSettings:e=>{},changesApplied:!1});function Ge({startupCheckInfo:t}){let[n,i]=d({settings:k,changesApplied:!1,ccVersion:``,lastModified:``,ccInstallationDir:null});u(()=>{let e=async()=>{i(await fe())};e()},[]);let a=c(e=>{let t=JSON.parse(JSON.stringify(n.settings));e(t),i(e=>({...e,settings:t,changesApplied:!1})),Z(e=>{e.settings=t,e.changesApplied=!1})},[n.settings]),[o,s]=d(null),[l,f]=d(null);u(()=>{t.wasUpdated&&t.oldVersion&&(f({message:`Your Claude Code installation was updated from ${t.oldVersion} to ${t.newVersion}, and the patching was likely overwritten
|
|
23
23
|
(However, your customization are still remembered in ${j}.)
|
|
24
|
-
Please reapply your changes below.`,type:`warning`}),a(()=>{}))},[]),r((e,t)=>{(t.ctrl&&e===`c`||(e===`q`||t.escape)&&!o)&&process.exit(0)});let p=e=>{switch(f(null),e){case O.THEMES:case O.LAUNCH_TEXT:case O.THINKING_VERBS:case O.THINKING_STYLE:s(e);break;case O.APPLY_CHANGES:t.ccInstInfo&&(f({message:`Applying patches...`,type:`info`}),
|
|
24
|
+
Please reapply your changes below.`,type:`warning`}),a(()=>{}))},[]),r((e,t)=>{(t.ctrl&&e===`c`||(e===`q`||t.escape)&&!o)&&process.exit(0)});let p=e=>{switch(f(null),e){case O.THEMES:case O.LAUNCH_TEXT:case O.THINKING_VERBS:case O.THINKING_STYLE:s(e);break;case O.APPLY_CHANGES:t.ccInstInfo&&(f({message:`Applying patches...`,type:`info`}),We(n,t.ccInstInfo).then(e=>{i(e),f({message:`Customization patches applied successfully!`,type:`success`})}));break;case O.RESTORE_ORIGINAL:t.ccInstInfo&&me(t.ccInstInfo).then(()=>{f({message:`Original Claude Code restored successfully!`,type:`success`}),a(()=>{})});break;case O.OPEN_CONFIG:ee(j);break;case O.OPEN_CLI:t.ccInstInfo&&ee(t.ccInstInfo.cliPath);break;case O.EXIT:process.exit(0)}},h=()=>{s(null)};return m($.Provider,{value:{settings:n.settings,updateSettings:a,changesApplied:n.changesApplied},children:m(e,{flexDirection:`column`,children:o===null?m(z,{onSubmit:p,notification:l}):o===O.THEMES?m(oe,{onBack:h}):o===O.LAUNCH_TEXT?m(ce,{onBack:h}):o===O.THINKING_VERBS?m(le,{onBack:h}):o===O.THINKING_STYLE?m(ue,{onBack:h}):null})})}const Ke=async()=>{let e=new a;e.name(`tweakcc`).description(`Command-line tool to customize your Claude Code theme colors, thinking verbs and more.`).version(`1.3.0`).option(`-d, --debug`,`enable debug mode`).option(`-a, --apply`,`apply saved customizations without interactive UI`),e.parse();let t=e.opts();if(t.debug&&W(),t.apply){console.log(E.cyan(`🔧 Applying saved customizations to Claude Code...`));try{let e=await fe();(!e.settings||Object.keys(e.settings).length===0)&&(console.error(E.red(`❌ No saved customizations found in `+j)),process.exit(1));let t=await ve();(!t||!t.ccInstInfo)&&(console.error(E.red(`❌ Cannot find Claude Code's cli.js`)),console.error(E.yellow(`Searched at the following locations:`)),P.forEach(e=>console.error(E.gray(` - `+e))),process.exit(1)),console.log(E.gray(`📁 Found Claude Code at: ${t.ccInstInfo.cliPath}`)),console.log(E.gray(`📦 Version: ${t.ccInstInfo.version}`)),console.log(E.gray(`✓ Backup handled by startup check`)),console.log(E.cyan(`🎨 Applying customizations...`));try{await We(e,t.ccInstInfo),console.log(E.green(`✅ Customizations applied successfully!`)),console.log(E.gray(`💾 Configuration saved at: ${j}`))}catch(e){console.error(E.red(`❌ Failed to apply patches:`)),console.error(E.red(e instanceof Error?e.message:String(e))),e instanceof Error&&e.message.includes(`patch:`)&&(console.log(E.yellow(`⚠️ Some patches failed to apply, but the file was updated.`)),console.log(E.yellow(` This may happen if Claude Code was updated.`)),console.log(E.gray(` Run tweakcc interactively to review and update your customizations.`)))}process.exit(0)}catch(e){console.error(E.red(`❌ Unexpected error:`)),console.error(E.red(e instanceof Error?e.message:String(e))),process.exit(1)}}let r=await ve();r?n(m(Ge,{startupCheckInfo:r})):(console.error(`\x1b[31mCannot find Claude Code's cli.js -- do you have Claude Code installed?
|
|
25
25
|
|
|
26
26
|
Searched at the following locations:
|
|
27
27
|
${P.map(e=>`- `+e).join(`
|
|
@@ -41,4 +41,4 @@ Notes:
|
|
|
41
41
|
|
|
42
42
|
- Don't specify the path to your Claude Code executable's directory. It needs to be the path
|
|
43
43
|
to the folder that contains **cli.js**.
|
|
44
|
-
\x1b[0m`),process.exit(1))};
|
|
44
|
+
\x1b[0m`),process.exit(1))};Ke();
|