klaudius 0.24.2 → 0.25.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.
@@ -1,9 +1,18 @@
1
- import{a as S,f as ge,g as he,i as pe,l as me,m as ye,n as fe,p as be}from"./chunk-R2LC3ZRY.js";import{useEffect as Sa,useMemo as va,useRef as de,useState as K}from"react";import{Box as I,Text as E,useApp as ka,useInput as Aa}from"ink";var Le=[{country:"the United Kingdom",code:"GB",language:"English",langCode:"en",aliases:["uk","united kingdom","great britain","britain","england","scotland","wales","northern ireland"]},{country:"Ireland",code:"IE",language:"English",langCode:"en"},{country:"France",code:"FR",language:"French",langCode:"fr"},{country:"Germany",code:"DE",language:"German",langCode:"de",aliases:["deutschland"]},{country:"Austria",code:"AT",language:"German",langCode:"de",aliases:["\xF6sterreich","osterreich"]},{country:"Switzerland",code:"CH",language:"German",langCode:"de",aliases:["schweiz","suisse","svizzera"]},{country:"Liechtenstein",code:"LI",language:"German",langCode:"de"},{country:"Luxembourg",code:"LU",language:"French",langCode:"fr",aliases:["l\xEBtzebuerg"]},{country:"the Netherlands",code:"NL",language:"Dutch",langCode:"nl",aliases:["netherlands","holland","nederland"]},{country:"Belgium",code:"BE",language:"Dutch",langCode:"nl",aliases:["belgi\xEB","belgique"]},{country:"Monaco",code:"MC",language:"French",langCode:"fr"},{country:"Andorra",code:"AD",language:"Catalan",langCode:"ca"},{country:"Italy",code:"IT",language:"Italian",langCode:"it",aliases:["italia"]},{country:"Spain",code:"ES",language:"Spanish",langCode:"es",aliases:["espa\xF1a","espana"]},{country:"Portugal",code:"PT",language:"Portuguese",langCode:"pt"},{country:"Malta",code:"MT",language:"English",langCode:"en"},{country:"San Marino",code:"SM",language:"Italian",langCode:"it"},{country:"Vatican City",code:"VA",language:"Italian",langCode:"it",aliases:["the vatican","holy see"]},{country:"Sweden",code:"SE",language:"Swedish",langCode:"sv",aliases:["sverige"]},{country:"Norway",code:"NO",language:"Norwegian",langCode:"no",aliases:["norge"]},{country:"Denmark",code:"DK",language:"Danish",langCode:"da",aliases:["danmark"]},{country:"Finland",code:"FI",language:"Finnish",langCode:"fi",aliases:["suomi"]},{country:"Iceland",code:"IS",language:"Icelandic",langCode:"is",aliases:["\xEDsland"]},{country:"Poland",code:"PL",language:"Polish",langCode:"pl",aliases:["polska"]},{country:"Czech Republic",code:"CZ",language:"Czech",langCode:"cs",aliases:["czechia","\u010Desko"]},{country:"Slovakia",code:"SK",language:"Slovak",langCode:"sk",aliases:["slovensko"]},{country:"Hungary",code:"HU",language:"Hungarian",langCode:"hu",aliases:["magyarorsz\xE1g"]},{country:"Slovenia",code:"SI",language:"Slovenian",langCode:"sl",aliases:["slovenija"]},{country:"Croatia",code:"HR",language:"Croatian",langCode:"hr",aliases:["hrvatska"]},{country:"Bosnia and Herzegovina",code:"BA",language:"Bosnian",langCode:"bs",aliases:["bosnia"]},{country:"Serbia",code:"RS",language:"Serbian",langCode:"sr",aliases:["srbija"]},{country:"Montenegro",code:"ME",language:"Montenegrin",langCode:"sr",aliases:["crna gora"]},{country:"Kosovo",code:"XK",language:"Albanian",langCode:"sq"},{country:"North Macedonia",code:"MK",language:"Macedonian",langCode:"mk",aliases:["macedonia"]},{country:"Albania",code:"AL",language:"Albanian",langCode:"sq",aliases:["shqip\xEBria"]},{country:"Bulgaria",code:"BG",language:"Bulgarian",langCode:"bg"},{country:"Romania",code:"RO",language:"Romanian",langCode:"ro",aliases:["rom\xE2nia"]},{country:"Moldova",code:"MD",language:"Romanian",langCode:"ro"},{country:"Greece",code:"GR",language:"Greek",langCode:"el",aliases:["\u03B5\u03BB\u03BB\u03AC\u03B4\u03B1"]},{country:"Cyprus",code:"CY",language:"Greek",langCode:"el"},{country:"Russia",code:"RU",language:"Russian",langCode:"ru",aliases:["\u0440\u043E\u0441\u0441\u0438\u044F"]},{country:"Ukraine",code:"UA",language:"Ukrainian",langCode:"uk",aliases:["\u0443\u043A\u0440\u0430\u0457\u043D\u0430"]},{country:"Belarus",code:"BY",language:"Belarusian",langCode:"be"},{country:"Estonia",code:"EE",language:"Estonian",langCode:"et",aliases:["eesti"]},{country:"Latvia",code:"LV",language:"Latvian",langCode:"lv",aliases:["latvija"]},{country:"Lithuania",code:"LT",language:"Lithuanian",langCode:"lt",aliases:["lietuva"]},{country:"Turkey",code:"TR",language:"Turkish",langCode:"tr",aliases:["t\xFCrkiye","turkiye"]},{country:"Armenia",code:"AM",language:"Armenian",langCode:"hy"},{country:"Azerbaijan",code:"AZ",language:"Azerbaijani",langCode:"az",aliases:["az\u0259rbaycan"]},{country:"Georgia",code:"GE",language:"Georgian",langCode:"ka",aliases:["\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD"]},{country:"Israel",code:"IL",language:"Hebrew",langCode:"he"},{country:"Palestine",code:"PS",language:"Arabic",langCode:"ar"},{country:"Lebanon",code:"LB",language:"Arabic",langCode:"ar"},{country:"Syria",code:"SY",language:"Arabic",langCode:"ar"},{country:"Jordan",code:"JO",language:"Arabic",langCode:"ar"},{country:"Iraq",code:"IQ",language:"Arabic",langCode:"ar"},{country:"Iran",code:"IR",language:"Persian",langCode:"fa",aliases:["islamic republic of iran"]},{country:"Saudi Arabia",code:"SA",language:"Arabic",langCode:"ar"},{country:"Yemen",code:"YE",language:"Arabic",langCode:"ar"},{country:"Oman",code:"OM",language:"Arabic",langCode:"ar"},{country:"the United Arab Emirates",code:"AE",language:"English",langCode:"en",aliases:["uae","united arab emirates","dubai","abu dhabi"]},{country:"Qatar",code:"QA",language:"Arabic",langCode:"ar"},{country:"Bahrain",code:"BH",language:"Arabic",langCode:"ar"},{country:"Kuwait",code:"KW",language:"Arabic",langCode:"ar"},{country:"Kazakhstan",code:"KZ",language:"Kazakh",langCode:"kk"},{country:"Uzbekistan",code:"UZ",language:"Uzbek",langCode:"uz"},{country:"Kyrgyzstan",code:"KG",language:"Kyrgyz",langCode:"ky"},{country:"Turkmenistan",code:"TM",language:"Turkmen",langCode:"tk"},{country:"Tajikistan",code:"TJ",language:"Tajik",langCode:"tg"},{country:"Afghanistan",code:"AF",language:"Persian",langCode:"fa"},{country:"India",code:"IN",language:"English",langCode:"en"},{country:"Pakistan",code:"PK",language:"English",langCode:"en"},{country:"Bangladesh",code:"BD",language:"Bengali",langCode:"bn"},{country:"Sri Lanka",code:"LK",language:"English",langCode:"en"},{country:"Nepal",code:"NP",language:"Nepali",langCode:"ne"},{country:"Bhutan",code:"BT",language:"English",langCode:"en"},{country:"the Maldives",code:"MV",language:"English",langCode:"en",aliases:["maldives"]},{country:"China",code:"CN",language:"Chinese",langCode:"zh",aliases:["\u4E2D\u56FD","people's republic of china","prc"]},{country:"Hong Kong",code:"HK",language:"English",langCode:"en",aliases:["hk"]},{country:"Macao",code:"MO",language:"Chinese",langCode:"zh",aliases:["macau"]},{country:"Taiwan",code:"TW",language:"Chinese",langCode:"zh",aliases:["\u53F0\u7063","republic of china"]},{country:"Japan",code:"JP",language:"Japanese",langCode:"ja",aliases:["\u65E5\u672C"]},{country:"South Korea",code:"KR",language:"Korean",langCode:"ko",aliases:["korea","republic of korea"]},{country:"North Korea",code:"KP",language:"Korean",langCode:"ko",aliases:["dprk"]},{country:"Mongolia",code:"MN",language:"Mongolian",langCode:"mn"},{country:"Thailand",code:"TH",language:"Thai",langCode:"th"},{country:"Vietnam",code:"VN",language:"Vietnamese",langCode:"vi",aliases:["viet nam"]},{country:"Cambodia",code:"KH",language:"Khmer",langCode:"km"},{country:"Laos",code:"LA",language:"Lao",langCode:"lo"},{country:"Myanmar",code:"MM",language:"Burmese",langCode:"my",aliases:["burma"]},{country:"Malaysia",code:"MY",language:"Malay",langCode:"ms"},{country:"Singapore",code:"SG",language:"English",langCode:"en"},{country:"Brunei",code:"BN",language:"Malay",langCode:"ms",aliases:["brunei darussalam"]},{country:"Indonesia",code:"ID",language:"Indonesian",langCode:"id"},{country:"the Philippines",code:"PH",language:"English",langCode:"en",aliases:["philippines"]},{country:"Timor-Leste",code:"TL",language:"Portuguese",langCode:"pt",aliases:["east timor"]},{country:"the United States",code:"US",language:"English",langCode:"en",aliases:["us","usa","united states","united states of america","america","states"]},{country:"Canada",code:"CA",language:"English",langCode:"en"},{country:"Mexico",code:"MX",language:"Spanish",langCode:"es",aliases:["m\xE9xico"]},{country:"Guatemala",code:"GT",language:"Spanish",langCode:"es"},{country:"Belize",code:"BZ",language:"English",langCode:"en"},{country:"El Salvador",code:"SV",language:"Spanish",langCode:"es"},{country:"Honduras",code:"HN",language:"Spanish",langCode:"es"},{country:"Nicaragua",code:"NI",language:"Spanish",langCode:"es"},{country:"Costa Rica",code:"CR",language:"Spanish",langCode:"es"},{country:"Panama",code:"PA",language:"Spanish",langCode:"es",aliases:["panam\xE1"]},{country:"Cuba",code:"CU",language:"Spanish",langCode:"es"},{country:"the Dominican Republic",code:"DO",language:"Spanish",langCode:"es",aliases:["dominican republic"]},{country:"Haiti",code:"HT",language:"French",langCode:"fr"},{country:"Jamaica",code:"JM",language:"English",langCode:"en"},{country:"the Bahamas",code:"BS",language:"English",langCode:"en",aliases:["bahamas"]},{country:"Trinidad and Tobago",code:"TT",language:"English",langCode:"en"},{country:"Barbados",code:"BB",language:"English",langCode:"en"},{country:"Saint Lucia",code:"LC",language:"English",langCode:"en"},{country:"Saint Vincent and the Grenadines",code:"VC",language:"English",langCode:"en"},{country:"Grenada",code:"GD",language:"English",langCode:"en"},{country:"Dominica",code:"DM",language:"English",langCode:"en"},{country:"Saint Kitts and Nevis",code:"KN",language:"English",langCode:"en"},{country:"Antigua and Barbuda",code:"AG",language:"English",langCode:"en"},{country:"Puerto Rico",code:"PR",language:"Spanish",langCode:"es"},{country:"Brazil",code:"BR",language:"Portuguese",langCode:"pt",aliases:["brasil"]},{country:"Argentina",code:"AR",language:"Spanish",langCode:"es"},{country:"Colombia",code:"CO",language:"Spanish",langCode:"es"},{country:"Chile",code:"CL",language:"Spanish",langCode:"es"},{country:"Peru",code:"PE",language:"Spanish",langCode:"es",aliases:["per\xFA"]},{country:"Venezuela",code:"VE",language:"Spanish",langCode:"es"},{country:"Ecuador",code:"EC",language:"Spanish",langCode:"es"},{country:"Bolivia",code:"BO",language:"Spanish",langCode:"es"},{country:"Paraguay",code:"PY",language:"Spanish",langCode:"es"},{country:"Uruguay",code:"UY",language:"Spanish",langCode:"es"},{country:"Guyana",code:"GY",language:"English",langCode:"en"},{country:"Suriname",code:"SR",language:"Dutch",langCode:"nl"},{country:"Australia",code:"AU",language:"English",langCode:"en",aliases:["aus","oz"]},{country:"New Zealand",code:"NZ",language:"English",langCode:"en",aliases:["nz","aotearoa"]},{country:"Fiji",code:"FJ",language:"English",langCode:"en"},{country:"Papua New Guinea",code:"PG",language:"English",langCode:"en",aliases:["png"]},{country:"Samoa",code:"WS",language:"English",langCode:"en"},{country:"Tonga",code:"TO",language:"English",langCode:"en"},{country:"Vanuatu",code:"VU",language:"English",langCode:"en"},{country:"Solomon Islands",code:"SB",language:"English",langCode:"en"},{country:"Kiribati",code:"KI",language:"English",langCode:"en"},{country:"Tuvalu",code:"TV",language:"English",langCode:"en"},{country:"Nauru",code:"NR",language:"English",langCode:"en"},{country:"Palau",code:"PW",language:"English",langCode:"en"},{country:"the Marshall Islands",code:"MH",language:"English",langCode:"en",aliases:["marshall islands"]},{country:"Micronesia",code:"FM",language:"English",langCode:"en",aliases:["federated states of micronesia"]},{country:"Egypt",code:"EG",language:"Arabic",langCode:"ar"},{country:"Libya",code:"LY",language:"Arabic",langCode:"ar"},{country:"Tunisia",code:"TN",language:"Arabic",langCode:"ar"},{country:"Algeria",code:"DZ",language:"Arabic",langCode:"ar"},{country:"Morocco",code:"MA",language:"Arabic",langCode:"ar",aliases:["maroc"]},{country:"Sudan",code:"SD",language:"Arabic",langCode:"ar"},{country:"South Sudan",code:"SS",language:"English",langCode:"en"},{country:"Mauritania",code:"MR",language:"Arabic",langCode:"ar"},{country:"Nigeria",code:"NG",language:"English",langCode:"en"},{country:"Ghana",code:"GH",language:"English",langCode:"en"},{country:"Senegal",code:"SN",language:"French",langCode:"fr",aliases:["s\xE9n\xE9gal"]},{country:"C\xF4te d'Ivoire",code:"CI",language:"French",langCode:"fr",aliases:["ivory coast"]},{country:"Mali",code:"ML",language:"French",langCode:"fr"},{country:"Burkina Faso",code:"BF",language:"French",langCode:"fr"},{country:"Niger",code:"NE",language:"French",langCode:"fr"},{country:"Guinea",code:"GN",language:"French",langCode:"fr",aliases:["guin\xE9e"]},{country:"Guinea-Bissau",code:"GW",language:"Portuguese",langCode:"pt"},{country:"Sierra Leone",code:"SL",language:"English",langCode:"en"},{country:"Liberia",code:"LR",language:"English",langCode:"en"},{country:"the Gambia",code:"GM",language:"English",langCode:"en",aliases:["gambia"]},{country:"Cabo Verde",code:"CV",language:"Portuguese",langCode:"pt",aliases:["cape verde"]},{country:"Togo",code:"TG",language:"French",langCode:"fr"},{country:"Benin",code:"BJ",language:"French",langCode:"fr",aliases:["b\xE9nin"]},{country:"Cameroon",code:"CM",language:"French",langCode:"fr",aliases:["cameroun"]},{country:"the Central African Republic",code:"CF",language:"French",langCode:"fr",aliases:["central african republic","car"]},{country:"Chad",code:"TD",language:"French",langCode:"fr",aliases:["tchad"]},{country:"Equatorial Guinea",code:"GQ",language:"Spanish",langCode:"es"},{country:"Gabon",code:"GA",language:"French",langCode:"fr"},{country:"the Republic of the Congo",code:"CG",language:"French",langCode:"fr",aliases:["congo","republic of the congo","congo-brazzaville"]},{country:"the Democratic Republic of the Congo",code:"CD",language:"French",langCode:"fr",aliases:["dr congo","drc","democratic republic of the congo","congo-kinshasa","zaire"]},{country:"S\xE3o Tom\xE9 and Pr\xEDncipe",code:"ST",language:"Portuguese",langCode:"pt",aliases:["sao tome and principe","sao tome"]},{country:"Ethiopia",code:"ET",language:"Amharic",langCode:"am"},{country:"Eritrea",code:"ER",language:"Tigrinya",langCode:"ti"},{country:"Djibouti",code:"DJ",language:"French",langCode:"fr"},{country:"Somalia",code:"SO",language:"Somali",langCode:"so"},{country:"Kenya",code:"KE",language:"English",langCode:"en"},{country:"Uganda",code:"UG",language:"English",langCode:"en"},{country:"Tanzania",code:"TZ",language:"English",langCode:"en",aliases:["united republic of tanzania"]},{country:"Rwanda",code:"RW",language:"English",langCode:"en"},{country:"Burundi",code:"BI",language:"French",langCode:"fr"},{country:"Madagascar",code:"MG",language:"French",langCode:"fr"},{country:"Mauritius",code:"MU",language:"English",langCode:"en"},{country:"the Seychelles",code:"SC",language:"English",langCode:"en",aliases:["seychelles"]},{country:"Comoros",code:"KM",language:"French",langCode:"fr"},{country:"South Africa",code:"ZA",language:"English",langCode:"en",aliases:["sa"]},{country:"Namibia",code:"NA",language:"English",langCode:"en"},{country:"Botswana",code:"BW",language:"English",langCode:"en"},{country:"Zimbabwe",code:"ZW",language:"English",langCode:"en"},{country:"Zambia",code:"ZM",language:"English",langCode:"en"},{country:"Malawi",code:"MW",language:"English",langCode:"en"},{country:"Mozambique",code:"MZ",language:"Portuguese",langCode:"pt",aliases:["mo\xE7ambique"]},{country:"Angola",code:"AO",language:"Portuguese",langCode:"pt"},{country:"Lesotho",code:"LS",language:"English",langCode:"en"},{country:"Eswatini",code:"SZ",language:"English",langCode:"en",aliases:["swaziland"]}],Ve=[{language:"English",code:"en"},{language:"Italian",code:"it",aliases:["italiano"]},{language:"Spanish",code:"es",aliases:["espa\xF1ol","espanol","castellano"]},{language:"French",code:"fr",aliases:["fran\xE7ais","francais"]},{language:"German",code:"de",aliases:["deutsch"]},{language:"Portuguese",code:"pt",aliases:["portugu\xEAs","portugues"]},{language:"Dutch",code:"nl",aliases:["nederlands","flemish"]},{language:"Swedish",code:"sv",aliases:["svenska"]},{language:"Norwegian",code:"no",aliases:["norsk"]},{language:"Danish",code:"da",aliases:["dansk"]},{language:"Icelandic",code:"is",aliases:["\xEDslenska"]},{language:"Catalan",code:"ca",aliases:["catal\xE0"]},{language:"Romanian",code:"ro",aliases:["rom\xE2n\u0103","romana"]},{language:"Polish",code:"pl",aliases:["polski"]},{language:"Czech",code:"cs",aliases:["\u010De\u0161tina","cestina"]},{language:"Slovak",code:"sk",aliases:["sloven\u010Dina"]},{language:"Slovenian",code:"sl",aliases:["sloven\u0161\u010Dina"]},{language:"Croatian",code:"hr",aliases:["hrvatski"]},{language:"Bosnian",code:"bs",aliases:["bosanski"]},{language:"Serbian",code:"sr",aliases:["\u0441\u0440\u043F\u0441\u043A\u0438"]},{language:"Montenegrin",code:"sr",aliases:["crnogorski"]},{language:"Macedonian",code:"mk",aliases:["\u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438"]},{language:"Bulgarian",code:"bg",aliases:["\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"]},{language:"Russian",code:"ru",aliases:["\u0440\u0443\u0441\u0441\u043A\u0438\u0439"]},{language:"Ukrainian",code:"uk",aliases:["\u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"]},{language:"Belarusian",code:"be",aliases:["\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F"]},{language:"Latvian",code:"lv",aliases:["latvie\u0161u"]},{language:"Lithuanian",code:"lt",aliases:["lietuvi\u0173"]},{language:"Greek",code:"el",aliases:["\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC","ellinik\xE1"]},{language:"Albanian",code:"sq",aliases:["shqip"]},{language:"Armenian",code:"hy",aliases:["\u0570\u0561\u0575\u0565\u0580\u0565\u0576"]},{language:"Persian",code:"fa",aliases:["farsi","dari","\u0641\u0627\u0631\u0633\u06CC"]},{language:"Hindi",code:"hi",aliases:["\u0939\u093F\u0928\u094D\u0926\u0940"]},{language:"Urdu",code:"ur",aliases:["\u0627\u0631\u062F\u0648"]},{language:"Bengali",code:"bn",aliases:["bangla","\u09AC\u09BE\u0982\u09B2\u09BE"]},{language:"Nepali",code:"ne",aliases:["\u0928\u0947\u092A\u093E\u0932\u0940"]},{language:"Sinhala",code:"si",aliases:["\u0DC3\u0DD2\u0D82\u0DC4\u0DBD","sinhalese"]},{language:"Finnish",code:"fi",aliases:["suomi"]},{language:"Estonian",code:"et",aliases:["eesti"]},{language:"Hungarian",code:"hu",aliases:["magyar"]},{language:"Turkish",code:"tr",aliases:["t\xFCrk\xE7e","turkce"]},{language:"Azerbaijani",code:"az",aliases:["az\u0259rbaycan dili","azeri"]},{language:"Kazakh",code:"kk",aliases:["\u049B\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"]},{language:"Uzbek",code:"uz",aliases:["o'zbek"]},{language:"Kyrgyz",code:"ky",aliases:["\u043A\u044B\u0440\u0433\u044B\u0437\u0447\u0430"]},{language:"Turkmen",code:"tk",aliases:["t\xFCrkmen\xE7e"]},{language:"Arabic",code:"ar",aliases:["\u0627\u0644\u0639\u0631\u0628\u064A\u0629"]},{language:"Hebrew",code:"he",aliases:["\u05E2\u05D1\u05E8\u05D9\u05EA","ivrit"]},{language:"Amharic",code:"am",aliases:["\u12A0\u121B\u122D\u129B"]},{language:"Tigrinya",code:"ti",aliases:["\u1275\u130D\u122D\u129B"]},{language:"Chinese",code:"zh",aliases:["mandarin","\u4E2D\u6587","\u6C49\u8BED","putonghua"]},{language:"Japanese",code:"ja",aliases:["\u65E5\u672C\u8A9E","nihongo"]},{language:"Korean",code:"ko",aliases:["\uD55C\uAD6D\uC5B4"]},{language:"Thai",code:"th",aliases:["\u0E44\u0E17\u0E22"]},{language:"Vietnamese",code:"vi",aliases:["ti\u1EBFng vi\u1EC7t"]},{language:"Khmer",code:"km",aliases:["\u1781\u17D2\u1798\u17C2\u179A","cambodian"]},{language:"Lao",code:"lo",aliases:["\u0EA5\u0EB2\u0EA7"]},{language:"Burmese",code:"my",aliases:["\u1019\u103C\u1014\u103A\u1019\u102C","myanmar"]},{language:"Dzongkha",code:"dz",aliases:["\u0F62\u0FAB\u0F7C\u0F44\u0F0B\u0F41"]},{language:"Mongolian",code:"mn",aliases:["\u043C\u043E\u043D\u0433\u043E\u043B"]},{language:"Georgian",code:"ka",aliases:["\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8"]},{language:"Tajik",code:"tg",aliases:["\u0442\u043E\u04B7\u0438\u043A\u04E3"]},{language:"Malay",code:"ms",aliases:["bahasa malaysia","bahasa melayu"]},{language:"Indonesian",code:"id",aliases:["bahasa indonesia"]},{language:"Filipino",code:"fil",aliases:["tagalog","pilipino"]},{language:"Swahili",code:"sw",aliases:["kiswahili"]},{language:"Somali",code:"so",aliases:["af soomaali"]},{language:"Yoruba",code:"yo",aliases:["yor\xF9b\xE1"]},{language:"Hausa",code:"ha",aliases:["harshen hausa"]},{language:"Zulu",code:"zu",aliases:["isizulu"]},{language:"Afrikaans",code:"af"}];function R(e){return e.trim().toLowerCase()}function we(e){if(!e)return;let a=R(e);for(let t of Le)if(R(t.country)===a||t.aliases?.some(n=>R(n)===a))return t}function Ce(e){if(!e)return;let a=R(e);for(let t of Ve)if(R(t.language)===a||t.aliases?.some(n=>R(n)===a))return t}var F=class extends Error{constructor(){super("user pressed back"),this.name="BackSignal"}},W=class extends Error{constructor(){super("user cancelled"),this.name="CancelSignal"}},Fe="Include the country code with a + (e.g. +12025550123 for US, +447123456789 for UK)",Se=e=>/^\+\d{8,15}$/.test(e)?void 0:Fe,ve=e=>/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(e)?void 0:"Enter a valid email",B=e=>a=>a.trim().length===0?`${e} is required`:void 0,Ue=/[\u2022\u2023\u2024\u2027\u00B7\u2219\u22C5\u25CF\u25CB\u25AA\u25AB\u204E\u2217\uFE61\u25E6\u2218]/,De="That looks like the masked \u2022\u2022\u2022\u2022\u2022 value your screen shows, not the token itself. Click the reveal/copy icon next to it and paste the real value (letters and numbers).",ae=e=>Ue.test(e)?De:void 0,ze=e=>a=>ae(a)??(a.trim().length===0?`${e} is required`:void 0),Ge=e=>{let a=e.replace(/\s+/g,"");return a.length===0?"Personal access token is required":ae(a)??(/^sbp_[A-Za-z0-9._~+\/=-]{20,}$/.test(a)?void 0:"Doesn't look like a valid token \u2014 it should be 'sbp_' followed by letters and numbers.")},He="one-off, no monthly fees",ke="per month";function H(e){if(!e)return!0;let a=e.trim();if(a==="")return!0;let t=a.replace(/[^\d.]/g,"");if(t==="")return/^\s*free\s*$/i.test(a);let n=parseFloat(t);return!isNaN(n)&&n===0}var We={id:"ai-agent",title:"AI coding agent",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>(t({title:"Which AI coding agent do you use?",body:`Klaudius works with two AI coding agents in your terminal \u2014 Claude Code
1
+ import{a as S,d as ge,e as he,g as pe,j as me,k as ye,l as fe,n as be,p as we}from"./chunk-PQNY54D6.js";import{useEffect as ka,useMemo as Pa,useRef as de,useState as K}from"react";import{Box as I,Text as E,useApp as Aa,useInput as Ia}from"ink";var Ve=[{country:"the United Kingdom",code:"GB",language:"English",langCode:"en",aliases:["uk","united kingdom","great britain","britain","england","scotland","wales","northern ireland"]},{country:"Ireland",code:"IE",language:"English",langCode:"en"},{country:"France",code:"FR",language:"French",langCode:"fr"},{country:"Germany",code:"DE",language:"German",langCode:"de",aliases:["deutschland"]},{country:"Austria",code:"AT",language:"German",langCode:"de",aliases:["\xF6sterreich","osterreich"]},{country:"Switzerland",code:"CH",language:"German",langCode:"de",aliases:["schweiz","suisse","svizzera"]},{country:"Liechtenstein",code:"LI",language:"German",langCode:"de"},{country:"Luxembourg",code:"LU",language:"French",langCode:"fr",aliases:["l\xEBtzebuerg"]},{country:"the Netherlands",code:"NL",language:"Dutch",langCode:"nl",aliases:["netherlands","holland","nederland"]},{country:"Belgium",code:"BE",language:"Dutch",langCode:"nl",aliases:["belgi\xEB","belgique"]},{country:"Monaco",code:"MC",language:"French",langCode:"fr"},{country:"Andorra",code:"AD",language:"Catalan",langCode:"ca"},{country:"Italy",code:"IT",language:"Italian",langCode:"it",aliases:["italia"]},{country:"Spain",code:"ES",language:"Spanish",langCode:"es",aliases:["espa\xF1a","espana"]},{country:"Portugal",code:"PT",language:"Portuguese",langCode:"pt"},{country:"Malta",code:"MT",language:"English",langCode:"en"},{country:"San Marino",code:"SM",language:"Italian",langCode:"it"},{country:"Vatican City",code:"VA",language:"Italian",langCode:"it",aliases:["the vatican","holy see"]},{country:"Sweden",code:"SE",language:"Swedish",langCode:"sv",aliases:["sverige"]},{country:"Norway",code:"NO",language:"Norwegian",langCode:"no",aliases:["norge"]},{country:"Denmark",code:"DK",language:"Danish",langCode:"da",aliases:["danmark"]},{country:"Finland",code:"FI",language:"Finnish",langCode:"fi",aliases:["suomi"]},{country:"Iceland",code:"IS",language:"Icelandic",langCode:"is",aliases:["\xEDsland"]},{country:"Poland",code:"PL",language:"Polish",langCode:"pl",aliases:["polska"]},{country:"Czech Republic",code:"CZ",language:"Czech",langCode:"cs",aliases:["czechia","\u010Desko"]},{country:"Slovakia",code:"SK",language:"Slovak",langCode:"sk",aliases:["slovensko"]},{country:"Hungary",code:"HU",language:"Hungarian",langCode:"hu",aliases:["magyarorsz\xE1g"]},{country:"Slovenia",code:"SI",language:"Slovenian",langCode:"sl",aliases:["slovenija"]},{country:"Croatia",code:"HR",language:"Croatian",langCode:"hr",aliases:["hrvatska"]},{country:"Bosnia and Herzegovina",code:"BA",language:"Bosnian",langCode:"bs",aliases:["bosnia"]},{country:"Serbia",code:"RS",language:"Serbian",langCode:"sr",aliases:["srbija"]},{country:"Montenegro",code:"ME",language:"Montenegrin",langCode:"sr",aliases:["crna gora"]},{country:"Kosovo",code:"XK",language:"Albanian",langCode:"sq"},{country:"North Macedonia",code:"MK",language:"Macedonian",langCode:"mk",aliases:["macedonia"]},{country:"Albania",code:"AL",language:"Albanian",langCode:"sq",aliases:["shqip\xEBria"]},{country:"Bulgaria",code:"BG",language:"Bulgarian",langCode:"bg"},{country:"Romania",code:"RO",language:"Romanian",langCode:"ro",aliases:["rom\xE2nia"]},{country:"Moldova",code:"MD",language:"Romanian",langCode:"ro"},{country:"Greece",code:"GR",language:"Greek",langCode:"el",aliases:["\u03B5\u03BB\u03BB\u03AC\u03B4\u03B1"]},{country:"Cyprus",code:"CY",language:"Greek",langCode:"el"},{country:"Russia",code:"RU",language:"Russian",langCode:"ru",aliases:["\u0440\u043E\u0441\u0441\u0438\u044F"]},{country:"Ukraine",code:"UA",language:"Ukrainian",langCode:"uk",aliases:["\u0443\u043A\u0440\u0430\u0457\u043D\u0430"]},{country:"Belarus",code:"BY",language:"Belarusian",langCode:"be"},{country:"Estonia",code:"EE",language:"Estonian",langCode:"et",aliases:["eesti"]},{country:"Latvia",code:"LV",language:"Latvian",langCode:"lv",aliases:["latvija"]},{country:"Lithuania",code:"LT",language:"Lithuanian",langCode:"lt",aliases:["lietuva"]},{country:"Turkey",code:"TR",language:"Turkish",langCode:"tr",aliases:["t\xFCrkiye","turkiye"]},{country:"Armenia",code:"AM",language:"Armenian",langCode:"hy"},{country:"Azerbaijan",code:"AZ",language:"Azerbaijani",langCode:"az",aliases:["az\u0259rbaycan"]},{country:"Georgia",code:"GE",language:"Georgian",langCode:"ka",aliases:["\u10E1\u10D0\u10E5\u10D0\u10E0\u10D7\u10D5\u10D4\u10DA\u10DD"]},{country:"Israel",code:"IL",language:"Hebrew",langCode:"he"},{country:"Palestine",code:"PS",language:"Arabic",langCode:"ar"},{country:"Lebanon",code:"LB",language:"Arabic",langCode:"ar"},{country:"Syria",code:"SY",language:"Arabic",langCode:"ar"},{country:"Jordan",code:"JO",language:"Arabic",langCode:"ar"},{country:"Iraq",code:"IQ",language:"Arabic",langCode:"ar"},{country:"Iran",code:"IR",language:"Persian",langCode:"fa",aliases:["islamic republic of iran"]},{country:"Saudi Arabia",code:"SA",language:"Arabic",langCode:"ar"},{country:"Yemen",code:"YE",language:"Arabic",langCode:"ar"},{country:"Oman",code:"OM",language:"Arabic",langCode:"ar"},{country:"the United Arab Emirates",code:"AE",language:"English",langCode:"en",aliases:["uae","united arab emirates","dubai","abu dhabi"]},{country:"Qatar",code:"QA",language:"Arabic",langCode:"ar"},{country:"Bahrain",code:"BH",language:"Arabic",langCode:"ar"},{country:"Kuwait",code:"KW",language:"Arabic",langCode:"ar"},{country:"Kazakhstan",code:"KZ",language:"Kazakh",langCode:"kk"},{country:"Uzbekistan",code:"UZ",language:"Uzbek",langCode:"uz"},{country:"Kyrgyzstan",code:"KG",language:"Kyrgyz",langCode:"ky"},{country:"Turkmenistan",code:"TM",language:"Turkmen",langCode:"tk"},{country:"Tajikistan",code:"TJ",language:"Tajik",langCode:"tg"},{country:"Afghanistan",code:"AF",language:"Persian",langCode:"fa"},{country:"India",code:"IN",language:"English",langCode:"en"},{country:"Pakistan",code:"PK",language:"English",langCode:"en"},{country:"Bangladesh",code:"BD",language:"Bengali",langCode:"bn"},{country:"Sri Lanka",code:"LK",language:"English",langCode:"en"},{country:"Nepal",code:"NP",language:"Nepali",langCode:"ne"},{country:"Bhutan",code:"BT",language:"English",langCode:"en"},{country:"the Maldives",code:"MV",language:"English",langCode:"en",aliases:["maldives"]},{country:"China",code:"CN",language:"Chinese",langCode:"zh",aliases:["\u4E2D\u56FD","people's republic of china","prc"]},{country:"Hong Kong",code:"HK",language:"English",langCode:"en",aliases:["hk"]},{country:"Macao",code:"MO",language:"Chinese",langCode:"zh",aliases:["macau"]},{country:"Taiwan",code:"TW",language:"Chinese",langCode:"zh",aliases:["\u53F0\u7063","republic of china"]},{country:"Japan",code:"JP",language:"Japanese",langCode:"ja",aliases:["\u65E5\u672C"]},{country:"South Korea",code:"KR",language:"Korean",langCode:"ko",aliases:["korea","republic of korea"]},{country:"North Korea",code:"KP",language:"Korean",langCode:"ko",aliases:["dprk"]},{country:"Mongolia",code:"MN",language:"Mongolian",langCode:"mn"},{country:"Thailand",code:"TH",language:"Thai",langCode:"th"},{country:"Vietnam",code:"VN",language:"Vietnamese",langCode:"vi",aliases:["viet nam"]},{country:"Cambodia",code:"KH",language:"Khmer",langCode:"km"},{country:"Laos",code:"LA",language:"Lao",langCode:"lo"},{country:"Myanmar",code:"MM",language:"Burmese",langCode:"my",aliases:["burma"]},{country:"Malaysia",code:"MY",language:"Malay",langCode:"ms"},{country:"Singapore",code:"SG",language:"English",langCode:"en"},{country:"Brunei",code:"BN",language:"Malay",langCode:"ms",aliases:["brunei darussalam"]},{country:"Indonesia",code:"ID",language:"Indonesian",langCode:"id"},{country:"the Philippines",code:"PH",language:"English",langCode:"en",aliases:["philippines"]},{country:"Timor-Leste",code:"TL",language:"Portuguese",langCode:"pt",aliases:["east timor"]},{country:"the United States",code:"US",language:"English",langCode:"en",aliases:["us","usa","united states","united states of america","america","states"]},{country:"Canada",code:"CA",language:"English",langCode:"en"},{country:"Mexico",code:"MX",language:"Spanish",langCode:"es",aliases:["m\xE9xico"]},{country:"Guatemala",code:"GT",language:"Spanish",langCode:"es"},{country:"Belize",code:"BZ",language:"English",langCode:"en"},{country:"El Salvador",code:"SV",language:"Spanish",langCode:"es"},{country:"Honduras",code:"HN",language:"Spanish",langCode:"es"},{country:"Nicaragua",code:"NI",language:"Spanish",langCode:"es"},{country:"Costa Rica",code:"CR",language:"Spanish",langCode:"es"},{country:"Panama",code:"PA",language:"Spanish",langCode:"es",aliases:["panam\xE1"]},{country:"Cuba",code:"CU",language:"Spanish",langCode:"es"},{country:"the Dominican Republic",code:"DO",language:"Spanish",langCode:"es",aliases:["dominican republic"]},{country:"Haiti",code:"HT",language:"French",langCode:"fr"},{country:"Jamaica",code:"JM",language:"English",langCode:"en"},{country:"the Bahamas",code:"BS",language:"English",langCode:"en",aliases:["bahamas"]},{country:"Trinidad and Tobago",code:"TT",language:"English",langCode:"en"},{country:"Barbados",code:"BB",language:"English",langCode:"en"},{country:"Saint Lucia",code:"LC",language:"English",langCode:"en"},{country:"Saint Vincent and the Grenadines",code:"VC",language:"English",langCode:"en"},{country:"Grenada",code:"GD",language:"English",langCode:"en"},{country:"Dominica",code:"DM",language:"English",langCode:"en"},{country:"Saint Kitts and Nevis",code:"KN",language:"English",langCode:"en"},{country:"Antigua and Barbuda",code:"AG",language:"English",langCode:"en"},{country:"Puerto Rico",code:"PR",language:"Spanish",langCode:"es"},{country:"Brazil",code:"BR",language:"Portuguese",langCode:"pt",aliases:["brasil"]},{country:"Argentina",code:"AR",language:"Spanish",langCode:"es"},{country:"Colombia",code:"CO",language:"Spanish",langCode:"es"},{country:"Chile",code:"CL",language:"Spanish",langCode:"es"},{country:"Peru",code:"PE",language:"Spanish",langCode:"es",aliases:["per\xFA"]},{country:"Venezuela",code:"VE",language:"Spanish",langCode:"es"},{country:"Ecuador",code:"EC",language:"Spanish",langCode:"es"},{country:"Bolivia",code:"BO",language:"Spanish",langCode:"es"},{country:"Paraguay",code:"PY",language:"Spanish",langCode:"es"},{country:"Uruguay",code:"UY",language:"Spanish",langCode:"es"},{country:"Guyana",code:"GY",language:"English",langCode:"en"},{country:"Suriname",code:"SR",language:"Dutch",langCode:"nl"},{country:"Australia",code:"AU",language:"English",langCode:"en",aliases:["aus","oz"]},{country:"New Zealand",code:"NZ",language:"English",langCode:"en",aliases:["nz","aotearoa"]},{country:"Fiji",code:"FJ",language:"English",langCode:"en"},{country:"Papua New Guinea",code:"PG",language:"English",langCode:"en",aliases:["png"]},{country:"Samoa",code:"WS",language:"English",langCode:"en"},{country:"Tonga",code:"TO",language:"English",langCode:"en"},{country:"Vanuatu",code:"VU",language:"English",langCode:"en"},{country:"Solomon Islands",code:"SB",language:"English",langCode:"en"},{country:"Kiribati",code:"KI",language:"English",langCode:"en"},{country:"Tuvalu",code:"TV",language:"English",langCode:"en"},{country:"Nauru",code:"NR",language:"English",langCode:"en"},{country:"Palau",code:"PW",language:"English",langCode:"en"},{country:"the Marshall Islands",code:"MH",language:"English",langCode:"en",aliases:["marshall islands"]},{country:"Micronesia",code:"FM",language:"English",langCode:"en",aliases:["federated states of micronesia"]},{country:"Egypt",code:"EG",language:"Arabic",langCode:"ar"},{country:"Libya",code:"LY",language:"Arabic",langCode:"ar"},{country:"Tunisia",code:"TN",language:"Arabic",langCode:"ar"},{country:"Algeria",code:"DZ",language:"Arabic",langCode:"ar"},{country:"Morocco",code:"MA",language:"Arabic",langCode:"ar",aliases:["maroc"]},{country:"Sudan",code:"SD",language:"Arabic",langCode:"ar"},{country:"South Sudan",code:"SS",language:"English",langCode:"en"},{country:"Mauritania",code:"MR",language:"Arabic",langCode:"ar"},{country:"Nigeria",code:"NG",language:"English",langCode:"en"},{country:"Ghana",code:"GH",language:"English",langCode:"en"},{country:"Senegal",code:"SN",language:"French",langCode:"fr",aliases:["s\xE9n\xE9gal"]},{country:"C\xF4te d'Ivoire",code:"CI",language:"French",langCode:"fr",aliases:["ivory coast"]},{country:"Mali",code:"ML",language:"French",langCode:"fr"},{country:"Burkina Faso",code:"BF",language:"French",langCode:"fr"},{country:"Niger",code:"NE",language:"French",langCode:"fr"},{country:"Guinea",code:"GN",language:"French",langCode:"fr",aliases:["guin\xE9e"]},{country:"Guinea-Bissau",code:"GW",language:"Portuguese",langCode:"pt"},{country:"Sierra Leone",code:"SL",language:"English",langCode:"en"},{country:"Liberia",code:"LR",language:"English",langCode:"en"},{country:"the Gambia",code:"GM",language:"English",langCode:"en",aliases:["gambia"]},{country:"Cabo Verde",code:"CV",language:"Portuguese",langCode:"pt",aliases:["cape verde"]},{country:"Togo",code:"TG",language:"French",langCode:"fr"},{country:"Benin",code:"BJ",language:"French",langCode:"fr",aliases:["b\xE9nin"]},{country:"Cameroon",code:"CM",language:"French",langCode:"fr",aliases:["cameroun"]},{country:"the Central African Republic",code:"CF",language:"French",langCode:"fr",aliases:["central african republic","car"]},{country:"Chad",code:"TD",language:"French",langCode:"fr",aliases:["tchad"]},{country:"Equatorial Guinea",code:"GQ",language:"Spanish",langCode:"es"},{country:"Gabon",code:"GA",language:"French",langCode:"fr"},{country:"the Republic of the Congo",code:"CG",language:"French",langCode:"fr",aliases:["congo","republic of the congo","congo-brazzaville"]},{country:"the Democratic Republic of the Congo",code:"CD",language:"French",langCode:"fr",aliases:["dr congo","drc","democratic republic of the congo","congo-kinshasa","zaire"]},{country:"S\xE3o Tom\xE9 and Pr\xEDncipe",code:"ST",language:"Portuguese",langCode:"pt",aliases:["sao tome and principe","sao tome"]},{country:"Ethiopia",code:"ET",language:"Amharic",langCode:"am"},{country:"Eritrea",code:"ER",language:"Tigrinya",langCode:"ti"},{country:"Djibouti",code:"DJ",language:"French",langCode:"fr"},{country:"Somalia",code:"SO",language:"Somali",langCode:"so"},{country:"Kenya",code:"KE",language:"English",langCode:"en"},{country:"Uganda",code:"UG",language:"English",langCode:"en"},{country:"Tanzania",code:"TZ",language:"English",langCode:"en",aliases:["united republic of tanzania"]},{country:"Rwanda",code:"RW",language:"English",langCode:"en"},{country:"Burundi",code:"BI",language:"French",langCode:"fr"},{country:"Madagascar",code:"MG",language:"French",langCode:"fr"},{country:"Mauritius",code:"MU",language:"English",langCode:"en"},{country:"the Seychelles",code:"SC",language:"English",langCode:"en",aliases:["seychelles"]},{country:"Comoros",code:"KM",language:"French",langCode:"fr"},{country:"South Africa",code:"ZA",language:"English",langCode:"en",aliases:["sa"]},{country:"Namibia",code:"NA",language:"English",langCode:"en"},{country:"Botswana",code:"BW",language:"English",langCode:"en"},{country:"Zimbabwe",code:"ZW",language:"English",langCode:"en"},{country:"Zambia",code:"ZM",language:"English",langCode:"en"},{country:"Malawi",code:"MW",language:"English",langCode:"en"},{country:"Mozambique",code:"MZ",language:"Portuguese",langCode:"pt",aliases:["mo\xE7ambique"]},{country:"Angola",code:"AO",language:"Portuguese",langCode:"pt"},{country:"Lesotho",code:"LS",language:"English",langCode:"en"},{country:"Eswatini",code:"SZ",language:"English",langCode:"en",aliases:["swaziland"]}],Fe=[{language:"English",code:"en"},{language:"Italian",code:"it",aliases:["italiano"]},{language:"Spanish",code:"es",aliases:["espa\xF1ol","espanol","castellano"]},{language:"French",code:"fr",aliases:["fran\xE7ais","francais"]},{language:"German",code:"de",aliases:["deutsch"]},{language:"Portuguese",code:"pt",aliases:["portugu\xEAs","portugues"]},{language:"Dutch",code:"nl",aliases:["nederlands","flemish"]},{language:"Swedish",code:"sv",aliases:["svenska"]},{language:"Norwegian",code:"no",aliases:["norsk"]},{language:"Danish",code:"da",aliases:["dansk"]},{language:"Icelandic",code:"is",aliases:["\xEDslenska"]},{language:"Catalan",code:"ca",aliases:["catal\xE0"]},{language:"Romanian",code:"ro",aliases:["rom\xE2n\u0103","romana"]},{language:"Polish",code:"pl",aliases:["polski"]},{language:"Czech",code:"cs",aliases:["\u010De\u0161tina","cestina"]},{language:"Slovak",code:"sk",aliases:["sloven\u010Dina"]},{language:"Slovenian",code:"sl",aliases:["sloven\u0161\u010Dina"]},{language:"Croatian",code:"hr",aliases:["hrvatski"]},{language:"Bosnian",code:"bs",aliases:["bosanski"]},{language:"Serbian",code:"sr",aliases:["\u0441\u0440\u043F\u0441\u043A\u0438"]},{language:"Montenegrin",code:"sr",aliases:["crnogorski"]},{language:"Macedonian",code:"mk",aliases:["\u043C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438"]},{language:"Bulgarian",code:"bg",aliases:["\u0431\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438"]},{language:"Russian",code:"ru",aliases:["\u0440\u0443\u0441\u0441\u043A\u0438\u0439"]},{language:"Ukrainian",code:"uk",aliases:["\u0443\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430"]},{language:"Belarusian",code:"be",aliases:["\u0431\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F"]},{language:"Latvian",code:"lv",aliases:["latvie\u0161u"]},{language:"Lithuanian",code:"lt",aliases:["lietuvi\u0173"]},{language:"Greek",code:"el",aliases:["\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC","ellinik\xE1"]},{language:"Albanian",code:"sq",aliases:["shqip"]},{language:"Armenian",code:"hy",aliases:["\u0570\u0561\u0575\u0565\u0580\u0565\u0576"]},{language:"Persian",code:"fa",aliases:["farsi","dari","\u0641\u0627\u0631\u0633\u06CC"]},{language:"Hindi",code:"hi",aliases:["\u0939\u093F\u0928\u094D\u0926\u0940"]},{language:"Urdu",code:"ur",aliases:["\u0627\u0631\u062F\u0648"]},{language:"Bengali",code:"bn",aliases:["bangla","\u09AC\u09BE\u0982\u09B2\u09BE"]},{language:"Nepali",code:"ne",aliases:["\u0928\u0947\u092A\u093E\u0932\u0940"]},{language:"Sinhala",code:"si",aliases:["\u0DC3\u0DD2\u0D82\u0DC4\u0DBD","sinhalese"]},{language:"Finnish",code:"fi",aliases:["suomi"]},{language:"Estonian",code:"et",aliases:["eesti"]},{language:"Hungarian",code:"hu",aliases:["magyar"]},{language:"Turkish",code:"tr",aliases:["t\xFCrk\xE7e","turkce"]},{language:"Azerbaijani",code:"az",aliases:["az\u0259rbaycan dili","azeri"]},{language:"Kazakh",code:"kk",aliases:["\u049B\u0430\u0437\u0430\u049B \u0442\u0456\u043B\u0456"]},{language:"Uzbek",code:"uz",aliases:["o'zbek"]},{language:"Kyrgyz",code:"ky",aliases:["\u043A\u044B\u0440\u0433\u044B\u0437\u0447\u0430"]},{language:"Turkmen",code:"tk",aliases:["t\xFCrkmen\xE7e"]},{language:"Arabic",code:"ar",aliases:["\u0627\u0644\u0639\u0631\u0628\u064A\u0629"]},{language:"Hebrew",code:"he",aliases:["\u05E2\u05D1\u05E8\u05D9\u05EA","ivrit"]},{language:"Amharic",code:"am",aliases:["\u12A0\u121B\u122D\u129B"]},{language:"Tigrinya",code:"ti",aliases:["\u1275\u130D\u122D\u129B"]},{language:"Chinese",code:"zh",aliases:["mandarin","\u4E2D\u6587","\u6C49\u8BED","putonghua"]},{language:"Japanese",code:"ja",aliases:["\u65E5\u672C\u8A9E","nihongo"]},{language:"Korean",code:"ko",aliases:["\uD55C\uAD6D\uC5B4"]},{language:"Thai",code:"th",aliases:["\u0E44\u0E17\u0E22"]},{language:"Vietnamese",code:"vi",aliases:["ti\u1EBFng vi\u1EC7t"]},{language:"Khmer",code:"km",aliases:["\u1781\u17D2\u1798\u17C2\u179A","cambodian"]},{language:"Lao",code:"lo",aliases:["\u0EA5\u0EB2\u0EA7"]},{language:"Burmese",code:"my",aliases:["\u1019\u103C\u1014\u103A\u1019\u102C","myanmar"]},{language:"Dzongkha",code:"dz",aliases:["\u0F62\u0FAB\u0F7C\u0F44\u0F0B\u0F41"]},{language:"Mongolian",code:"mn",aliases:["\u043C\u043E\u043D\u0433\u043E\u043B"]},{language:"Georgian",code:"ka",aliases:["\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8"]},{language:"Tajik",code:"tg",aliases:["\u0442\u043E\u04B7\u0438\u043A\u04E3"]},{language:"Malay",code:"ms",aliases:["bahasa malaysia","bahasa melayu"]},{language:"Indonesian",code:"id",aliases:["bahasa indonesia"]},{language:"Filipino",code:"fil",aliases:["tagalog","pilipino"]},{language:"Swahili",code:"sw",aliases:["kiswahili"]},{language:"Somali",code:"so",aliases:["af soomaali"]},{language:"Yoruba",code:"yo",aliases:["yor\xF9b\xE1"]},{language:"Hausa",code:"ha",aliases:["harshen hausa"]},{language:"Zulu",code:"zu",aliases:["isizulu"]},{language:"Afrikaans",code:"af"}];function R(e){return e.trim().toLowerCase()}function Ce(e){if(!e)return;let a=R(e);for(let t of Ve)if(R(t.country)===a||t.aliases?.some(n=>R(n)===a))return t}function Se(e){if(!e)return;let a=R(e);for(let t of Fe)if(R(t.language)===a||t.aliases?.some(n=>R(n)===a))return t}var F=class extends Error{constructor(){super("user pressed back"),this.name="BackSignal"}},W=class extends Error{constructor(){super("user cancelled"),this.name="CancelSignal"}},Ue="Include the country code with a + (e.g. +12025550123 for US, +447123456789 for UK)",ve=e=>/^\+\d{8,15}$/.test(e)?void 0:Ue,ke=e=>/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(e)?void 0:"Enter a valid email",B=e=>a=>a.trim().length===0?`${e} is required`:void 0,De=/[\u2022\u2023\u2024\u2027\u00B7\u2219\u22C5\u25CF\u25CB\u25AA\u25AB\u204E\u2217\uFE61\u25E6\u2218]/,Ge="That looks like the masked \u2022\u2022\u2022\u2022\u2022 value your screen shows, not the token itself. Click the reveal/copy icon next to it and paste the real value (letters and numbers).",ae=e=>De.test(e)?Ge:void 0,ze=e=>a=>ae(a)??(a.trim().length===0?`${e} is required`:void 0),He=e=>{let a=e.replace(/\s+/g,"");return a.length===0?"Personal access token is required":ae(a)??(/^sbp_[A-Za-z0-9._~+\/=-]{20,}$/.test(a)?void 0:"Doesn't look like a valid token \u2014 it should be 'sbp_' followed by letters and numbers.")},We="one-off, no monthly fees",Pe="per month";function H(e){if(!e)return!0;let a=e.trim();if(a==="")return!0;let t=a.replace(/[^\d.]/g,"");if(t==="")return/^\s*free\s*$/i.test(a);let n=parseFloat(t);return!isNaN(n)&&n===0}var _e={id:"ai-agent",title:"AI coding agent",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>(t({title:"Which AI coding agent do you use?",body:`Klaudius works with two AI coding agents in your terminal \u2014 Claude Code
2
2
  (Anthropic) or Codex (OpenAI). Pick whichever you already pay for.
3
3
 
4
4
  This choice only changes which agent runs the pipeline. Everything else \u2014
5
5
  the businesses found, the websites built, the outreach sent \u2014 is identical
6
- either way. You can switch later by re-running init in a fresh folder.`}),{aiAgent:await a({type:"select",message:"Which AI coding agent will drive Klaudius?",initialValue:e.aiAgent??"claude-code",options:[{value:"claude-code",label:"Claude Code (Anthropic)"},{value:"codex",label:"Codex (OpenAI)"}]})})},_e={id:"location",title:"Location & language",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Which country are you finding businesses in?",body:`Klaudius searches for businesses in this country, writes outreach in
6
+ either way. You can switch later by re-running init in a fresh folder.`}),{aiAgent:await a({type:"select",message:"Which AI coding agent will drive Klaudius?",initialValue:e.aiAgent??"claude-code",options:[{value:"claude-code",label:"Claude Code (Anthropic)"},{value:"codex",label:"Codex (OpenAI)"}]})})},$e={id:"ai-plan",title:"Subscription plan",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>{let n=e.aiAgent==="codex",r=n?"Codex":"Claude Code",s=n?"ChatGPT":"Claude";t({title:`Which ${s} plan are you on?`,body:`Klaudius tunes the pipeline to your plan's usage limits.
7
+
8
+ `+(n?`ChatGPT Plus: QA pass off and the Terra model pinned, so each run fits
9
+ the plan's usage window. Pro and above: full pipeline, QA pass included.
10
+
11
+ `:`Claude Pro: QA pass off, so each run fits the plan's usage window.
12
+ Max and above: full pipeline, QA pass included.
13
+
14
+ `)+`Not locked in \u2014 QA_PHASE lives in .env; flip it any time,
15
+ or re-run configure if you change plan.`});let o=n?[{value:"codex-plus",label:"ChatGPT Plus (QA pass off, Terra model)"},{value:"codex-pro",label:"ChatGPT Pro (full pipeline)"},{value:"codex-other",label:"Other \u2014 Business, Enterprise or API key (full pipeline)"}]:[{value:"claude-pro",label:"Claude Pro (QA pass off)"},{value:"claude-max-5x",label:"Claude Max 5x (full pipeline)"},{value:"claude-max-20x",label:"Claude Max 20x (full pipeline)"},{value:"claude-other",label:"Other \u2014 Team, Enterprise or API key (full pipeline)"}],d=o.some(i=>i.value===e.aiPlan)?e.aiPlan:void 0,c=await a({type:"select",message:`Which ${s} plan will ${r} run on?`,initialValue:d??o[0].value,options:o}),u=c===e.aiPlan&&e.qaPhase!==void 0?e.qaPhase:we(c);return{aiPlan:c,qaPhase:u}}},je={id:"location",title:"Location & language",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Which country are you finding businesses in?",body:`Klaudius searches for businesses in this country, writes outreach in
7
16
  this country's language, and builds sites in this country's language.
8
17
  This is the country your customers are in \u2014 not necessarily where
9
18
  you live.
@@ -14,12 +23,12 @@ businesses, pick United Kingdom here.
14
23
  You can run the pipeline against more than one country from the same
15
24
  install (\`/find Barcelona\` from a UK install works fine), but
16
25
  starting with one market makes it easier to learn that market's
17
- outreach rhythm.`});let n="__other__",r=[{value:"the United Kingdom",label:"United Kingdom"},{value:"the United States",label:"United States"},{value:"Italy",label:"Italy"},{value:"Spain",label:"Spain"},{value:"France",label:"France"},{value:"Germany",label:"Germany"},{value:"Ireland",label:"Ireland"},{value:"the Netherlands",label:"Netherlands"},{value:"Belgium",label:"Belgium"},{value:"Portugal",label:"Portugal"},{value:"Switzerland",label:"Switzerland"},{value:"Austria",label:"Austria"},{value:"Canada",label:"Canada"},{value:"Australia",label:"Australia"},{value:"New Zealand",label:"New Zealand"},{value:"Mexico",label:"Mexico"},{value:"Brazil",label:"Brazil"},{value:"Sweden",label:"Sweden"},{value:"Poland",label:"Poland"},{value:n,label:"Other (type it in)"}],s=e.country??"",o=r.some(m=>m.value===s),d=await a({type:"select",message:"Which country's businesses will Klaudius search for?",initialValue:o?s:s?n:"the United Kingdom",options:r}),i;d===n?i=await a({type:"text",message:"Type the country name (any common form is fine)",placeholder:"e.g. South Africa, Greece, Brazil",initialValue:o?"":s,validate:m=>m.trim().length===0?"Country is required":void 0,note:{title:"Free-form country",body:`We'll match what you type against our country lookup (covers all
26
+ outreach rhythm.`});let n="__other__",r=[{value:"the United Kingdom",label:"United Kingdom"},{value:"the United States",label:"United States"},{value:"Italy",label:"Italy"},{value:"Spain",label:"Spain"},{value:"France",label:"France"},{value:"Germany",label:"Germany"},{value:"Ireland",label:"Ireland"},{value:"the Netherlands",label:"Netherlands"},{value:"Belgium",label:"Belgium"},{value:"Portugal",label:"Portugal"},{value:"Switzerland",label:"Switzerland"},{value:"Austria",label:"Austria"},{value:"Canada",label:"Canada"},{value:"Australia",label:"Australia"},{value:"New Zealand",label:"New Zealand"},{value:"Mexico",label:"Mexico"},{value:"Brazil",label:"Brazil"},{value:"Sweden",label:"Sweden"},{value:"Poland",label:"Poland"},{value:n,label:"Other (type it in)"}],s=e.country??"",o=r.some(m=>m.value===s),c=await a({type:"select",message:"Which country's businesses will Klaudius search for?",initialValue:o?s:s?n:"the United Kingdom",options:r}),l;c===n?l=await a({type:"text",message:"Type the country name (any common form is fine)",placeholder:"e.g. South Africa, Greece, Brazil",initialValue:o?"":s,validate:m=>m.trim().length===0?"Country is required":void 0,note:{title:"Free-form country",body:`We'll match what you type against our country lookup (covers all
18
27
  ISO 3166 sovereign states + common territories like Hong Kong and
19
28
  Puerto Rico). If we don't recognise the name, we'll ask you to type
20
29
  the 2-letter ISO country code directly on the next prompt \u2014 the
21
30
  same code Google Places uses for region biasing. Aliases like 'uk',
22
- 'usa', 'italia', 'maroc' all match.`}}):i=d;let u=we(i),l;u?l=u.code:l=(await a({type:"text",message:`What's the 2-letter ISO country code for ${i}?`,placeholder:"e.g. ID for Indonesia, ZA for South Africa, JO for Jordan",initialValue:e.countryCode??"",validate:m=>{let v=m.trim().toUpperCase();if(!/^[A-Z]{2}$/.test(v))return"Must be exactly 2 letters (ISO 3166-1 alpha-2 format)"},note:{title:`ISO code for ${i}`,body:`We didn't recognise "${i}" in our country lookup, so we need the
31
+ 'usa', 'italia', 'maroc' all match.`}}):l=c;let u=Ce(l),i;u?i=u.code:i=(await a({type:"text",message:`What's the 2-letter ISO country code for ${l}?`,placeholder:"e.g. ID for Indonesia, ZA for South Africa, JO for Jordan",initialValue:e.countryCode??"",validate:m=>{let v=m.trim().toUpperCase();if(!/^[A-Z]{2}$/.test(v))return"Must be exactly 2 letters (ISO 3166-1 alpha-2 format)"},note:{title:`ISO code for ${l}`,body:`We didn't recognise "${l}" in our country lookup, so we need the
23
32
  2-letter ISO 3166-1 alpha-2 code directly. Google Places uses this
24
33
  for region biasing on every search.
25
34
 
@@ -29,13 +38,13 @@ Quick reference for less common markets:
29
38
  Indonesia \u2192 ID Vietnam \u2192 VN Thailand \u2192 TH Egypt \u2192 EG
30
39
  Kenya \u2192 KE Nigeria \u2192 NG Pakistan \u2192 PK Iran \u2192 IR
31
40
  Saudi Arabia \u2192 SA Russia \u2192 RU Ukraine \u2192 UA Israel \u2192 IL`}})).trim().toUpperCase();let h=e.language??u?.language??"English",g=await a({type:"text",message:"What language should outreach + websites be written in?",placeholder:"e.g. Italian, Spanish, English",initialValue:h,validate:m=>m.trim().length===0?"Language is required":void 0,note:{title:"Outreach + website language",body:u?`Defaulting to ${h} (the usual operator-facing language
32
- for ${i}). Edit this if you'd rather write in something else \u2014
41
+ for ${l}). Edit this if you'd rather write in something else \u2014
33
42
  e.g. an English-speaking operator running on Spain might pick "Spanish"
34
43
  to localise everything, or might pick "English" to keep their own voice.
35
44
  Klaudius will use this language for every outreach message it sends and
36
45
  every website it builds.`:`Pick the language you want every outreach message and every built
37
46
  website to be written in. If we don't recognise the language name
38
- we'll ask for the ISO language code on the next prompt.`}}),k=Ce(g),p;return k?p=k.code:p=(await a({type:"text",message:`What's the ISO language code for ${g}?`,placeholder:"e.g. id for Indonesian, sw for Swahili, fil for Filipino",initialValue:e.languageCode??"",validate:m=>{let v=m.trim().toLowerCase();if(!/^[a-z]{2,3}$/.test(v))return"Must be 2 or 3 lowercase letters (ISO 639-1 or BCP 47 code)"},note:{title:`ISO code for ${g}`,body:`We didn't recognise "${g}" in our language lookup, so we need
47
+ we'll ask for the ISO language code on the next prompt.`}}),k=Se(g),p;return k?p=k.code:p=(await a({type:"text",message:`What's the ISO language code for ${g}?`,placeholder:"e.g. id for Indonesian, sw for Swahili, fil for Filipino",initialValue:e.languageCode??"",validate:m=>{let v=m.trim().toLowerCase();if(!/^[a-z]{2,3}$/.test(v))return"Must be 2 or 3 lowercase letters (ISO 639-1 or BCP 47 code)"},note:{title:`ISO code for ${g}`,body:`We didn't recognise "${g}" in our language lookup, so we need
39
48
  the ISO language code directly. Google Places uses this for response
40
49
  language, and it becomes the <html lang="..."> value on every built
41
50
  site.
@@ -43,7 +52,7 @@ site.
43
52
  Most languages have a 2-letter ISO 639-1 code. A few (Filipino \u2192
44
53
  "fil") use the 3-letter ISO 639-3 / BCP 47 code instead.
45
54
 
46
- Full list: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes`}})).trim().toLowerCase(),{country:u?u.country:i.trim(),countryCode:l,language:k?k.language:g.trim(),languageCode:p}}},$e={id:"pipeline-modes",title:"Lead streams",isApplicable:()=>!0,execute:async(e,{prompt:a})=>{let t=await a({type:"multiselect",message:"Which extra lead streams should the pipeline target?",options:[{value:"rescue",label:"Rescue - businesses whose existing website is dead or broken"},{value:"booking",label:"Booking - businesses whose only web presence is a booking-platform page (Fresha, Booksy, Square...)"}],initialValue:e.pipelineModes?e.pipelineModes.filter(o=>o!=="classic").join(","):"rescue,booking",note:{title:"Lead streams",body:`Klaudius always targets businesses with NO website (the classic
55
+ Full list: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes`}})).trim().toLowerCase(),{country:u?u.country:l.trim(),countryCode:i,language:k?k.language:g.trim(),languageCode:p}}},qe={id:"pipeline-modes",title:"Lead streams",isApplicable:()=>!0,execute:async(e,{prompt:a})=>{let t=await a({type:"multiselect",message:"Which extra lead streams should the pipeline target?",options:[{value:"rescue",label:"Rescue - businesses whose existing website is dead or broken"},{value:"booking",label:"Booking - businesses whose only web presence is a booking-platform page (Fresha, Booksy, Square...)"}],initialValue:e.pipelineModes?e.pipelineModes.filter(o=>o!=="classic").join(","):"rescue,booking",note:{title:"Lead streams",body:`Klaudius always targets businesses with NO website (the classic
47
56
  stream) - that one is always on. Rescue ADDS businesses whose
48
57
  existing site is verifiably broken: dead domain, hosting
49
58
  placeholder, security errors, doesn't work on phones. Booking
@@ -52,7 +61,7 @@ points at a booking platform instead of a real website - they
52
61
  already pay for booking software, and the site built for them
53
62
  gets a complete booking system of its own. Both streams are
54
63
  gated by bundled checkers, not judgment. Change any time by
55
- asking your agent or re-running npx klaudius configure.`}}),n=new Set(["rescue","booking"]),r=String(t).split(",").map(o=>o.trim()).filter(o=>n.has(o)),s=(e.pipelineModes??[]).filter(o=>o!=="classic"&&!n.has(o));return{pipelineModes:[...new Set(["classic",...r,...s])]}}},je={id:"pricing",title:"Pricing",isApplicable:()=>!0,execute:async(e,{prompt:a})=>{let t=e.pricingTerms===ke,n=t?"":e.pricing??"$999",r=e.pricingMonthly??(t?e.pricing??"":""),s=await a({type:"text",message:"What's the upfront fee you'll charge clients per site?",placeholder:"e.g. $999, \xA3799, \u20AC899 \u2014 or 0 for monthly-only billing",initialValue:n,note:{title:"Upfront fee",body:`The one-time amount charged when a client signs up. Type 0 (or
64
+ asking your agent or re-running npx klaudius configure.`}}),n=new Set(["rescue","booking"]),r=String(t).split(",").map(o=>o.trim()).filter(o=>n.has(o)),s=(e.pipelineModes??[]).filter(o=>o!=="classic"&&!n.has(o));return{pipelineModes:[...new Set(["classic",...r,...s])]}}},Ye={id:"pricing",title:"Pricing",isApplicable:()=>!0,execute:async(e,{prompt:a})=>{let t=e.pricingTerms===Pe,n=t?"":e.pricing??"$999",r=e.pricingMonthly??(t?e.pricing??"":""),s=await a({type:"text",message:"What's the upfront fee you'll charge clients per site?",placeholder:"e.g. $999, \xA3799, \u20AC899 \u2014 or 0 for monthly-only billing",initialValue:n,note:{title:"Upfront fee",body:`The one-time amount charged when a client signs up. Type 0 (or
56
65
  leave blank) if you only want to charge a monthly fee. You can
57
66
  also add a recurring monthly fee on the next prompt \u2014 combining
58
67
  the two is fine (e.g. $499 upfront + $49/month).
@@ -60,9 +69,9 @@ the two is fine (e.g. $499 upfront + $49/month).
60
69
  Use the currency that matches your clients' region. Klaudius
61
70
  uses this string verbatim throughout outreach.`}}),o=await a({type:"text",message:"What's the monthly fee? (optional \u2014 leave blank for one-off only)",placeholder:"e.g. $49, \xA339, \u20AC45 \u2014 or blank for none",initialValue:r,validate:h=>{if(H(s)&&H(h))return"Set an upfront fee, a monthly fee, or both \u2014 they can't both be zero."},note:{title:"Monthly fee (optional)",body:`Leave blank to charge a one-off fee only. Fill it in to charge
62
71
  a recurring monthly fee \u2014 either on its own (if upfront was 0)
63
- or alongside the upfront fee.`}}),c=H(s),d=H(o),i,u,l;return c&&!d?(i=o.trim(),u=ke,l=o.trim()):!c&&d?(i=s.trim(),u=He,l=void 0):(i=s.trim(),u=`upfront, then ${o.trim()}/month`,l=o.trim()),{pricing:i,pricingTerms:u,pricingMonthly:l}}},qe={id:"outreach-enabled",title:"Automated outreach",isApplicable:()=>!0,execute:async(e,{prompt:a})=>({outreachEnabled:await a({type:"confirm",message:"Use Klaudius's automated outreach features?",initialValue:e.outreachEnabled??!0,note:{title:"Automated outreach features",body:`After finding candidates and building websites for them, Klaudius can
72
+ or alongside the upfront fee.`}}),d=H(s),c=H(o),l,u,i;return d&&!c?(l=o.trim(),u=Pe,i=o.trim()):!d&&c?(l=s.trim(),u=We,i=void 0):(l=s.trim(),u=`upfront, then ${o.trim()}/month`,i=o.trim()),{pricing:l,pricingTerms:u,pricingMonthly:i}}},Ze={id:"outreach-enabled",title:"Automated outreach",isApplicable:()=>!0,execute:async(e,{prompt:a})=>({outreachEnabled:await a({type:"confirm",message:"Use Klaudius's automated outreach features?",initialValue:e.outreachEnabled??!0,note:{title:"Automated outreach features",body:`After finding candidates and building websites for them, Klaudius can
64
73
  run outreach to them automatically (email, SMS, or WhatsApp).
65
- If you'd rather handle outreach manually, you can skip this here.`}})})},Ye={id:"operator-name",title:"Sign-off name",isApplicable:e=>e.outreachEnabled===!0,execute:async(e,{prompt:a})=>({name:await a({type:"text",message:"What name should sign off your outreach messages?",placeholder:"e.g. Mike Smith \u2014 or your business name if you'd rather",initialValue:e.name??e.emailFromName??"",validate:B("Name"),note:{title:"Sign-off name",body:`Klaudius signs off every outreach message and follow-up with this
74
+ If you'd rather handle outreach manually, you can skip this here.`}})})},Je={id:"operator-name",title:"Sign-off name",isApplicable:e=>e.outreachEnabled===!0,execute:async(e,{prompt:a})=>({name:await a({type:"text",message:"What name should sign off your outreach messages?",placeholder:"e.g. Mike Smith \u2014 or your business name if you'd rather",initialValue:e.name??e.emailFromName??"",validate:B("Name"),note:{title:"Sign-off name",body:`Klaudius signs off every outreach message and follow-up with this
66
75
  name \u2014 e.g. "Cordiali saluti, Marco" in Italian, "Best, Mike" in
67
76
  English. Use your first name, your full name, or your business name \u2014
68
77
  whatever you want clients to see as the sender.
@@ -70,7 +79,7 @@ whatever you want clients to see as the sender.
70
79
  Klaudius composes the actual sign-off line at message time, picking
71
80
  natural phrasing for your language. If you'd rather pin an exact
72
81
  sign-off string instead, ask Klaudius to set it up for you once the
73
- wizard's done.`}}),signature:e.signature})},Ze={id:"channels",title:"Outreach channels & priority",isApplicable:e=>e.outreachEnabled===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Outreach channels & priority",body:`Different businesses have different contact methods publicly available \u2014 some
82
+ wizard's done.`}}),signature:e.signature})},Qe={id:"channels",title:"Outreach channels & priority",isApplicable:e=>e.outreachEnabled===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Outreach channels & priority",body:`Different businesses have different contact methods publicly available \u2014 some
74
83
  list only an email, others only a phone number, others use WhatsApp as their
75
84
  primary channel. Klaudius lets you opt into multiple channels so it can reach
76
85
  more candidates, and you set a priority order for when a candidate has
@@ -84,7 +93,7 @@ candidate \u2014 so opting into multiple channels also gives you fallback covera
84
93
  when one channel doesn't work.
85
94
 
86
95
  You'll be asked to pick your first-choice channel now, then optionally a
87
- second and third. The order matters: it's the order Klaudius tries.`});let n={email:"Email",sms:"SMS (iMessage or Twilio, configured next)",whatsapp:"WhatsApp (Baileys / phone-linked device)"},r=["email","sms","whatsapp"],s=e.outreachPriority??[],o=[],c=await a({type:"select",message:"Which channel should Klaudius try FIRST for each candidate?",initialValue:s[0]??"email",options:r.map(d=>({value:d,label:n[d]}))});for(o.push(c);o.length<r.length;){let d=r.filter(g=>!o.includes(g)),i=o.length===1?"second":"third",u=o[o.length-1],l=n[u].replace(/\s*\(.*\)$/,"").toLowerCase(),h=await a({type:"select",message:`Should Klaudius use another channel as ${i} priority (for candidates where ${l} isn't viable or fails)?`,initialValue:s[o.length]??"no",options:[...d.map(g=>({value:g,label:`Yes \u2014 also use ${n[g]}`})),{value:"no",label:"No, that's all"}]});if(h==="no")break;o.push(h)}return{outreachChannels:o,outreachPriority:o}}},Je={id:"email",title:"Email setup",isApplicable:e=>e.outreachChannels?.includes("email")===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Email setup",body:`Klaudius needs an email account to send outreach FROM. This is the
96
+ second and third. The order matters: it's the order Klaudius tries.`});let n={email:"Email",sms:"SMS (iMessage or Twilio, configured next)",whatsapp:"WhatsApp (Baileys / phone-linked device)"},r=["email","sms","whatsapp"],s=e.outreachPriority??[],o=[],d=await a({type:"select",message:"Which channel should Klaudius try FIRST for each candidate?",initialValue:s[0]??"email",options:r.map(c=>({value:c,label:n[c]}))});for(o.push(d);o.length<r.length;){let c=r.filter(g=>!o.includes(g)),l=o.length===1?"second":"third",u=o[o.length-1],i=n[u].replace(/\s*\(.*\)$/,"").toLowerCase(),h=await a({type:"select",message:`Should Klaudius use another channel as ${l} priority (for candidates where ${i} isn't viable or fails)?`,initialValue:s[o.length]??"no",options:[...c.map(g=>({value:g,label:`Yes \u2014 also use ${n[g]}`})),{value:"no",label:"No, that's all"}]});if(h==="no")break;o.push(h)}return{outreachChannels:o,outreachPriority:o}}},Xe={id:"email",title:"Email setup",isApplicable:e=>e.outreachChannels?.includes("email")===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Email setup",body:`Klaudius needs an email account to send outreach FROM. This is the
88
97
  address candidates will see as the sender. Use a domain you control
89
98
  (your own, your business's) \u2014 not your personal address.`});let n=await a({type:"select",message:"Who hosts the email account you'll send outreach from?",initialValue:e.emailProvider??"gmail",options:[{value:"gmail",label:"Gmail"},{value:"fastmail",label:"Fastmail"},{value:"outlook",label:"Outlook / Office 365"},{value:"zoho",label:"Zoho Mail"},{value:"ionos",label:"IONOS"},{value:"titan",label:"Titan (123 Reg, Hostinger, Name.com\u2026)"},{value:"custom",label:"Custom / other (enter SMTP/IMAP details manually)"}]}),r=n!=="custom"?ge[n]:void 0;if(r?.oauthOnly){t({title:"How Outlook / Microsoft 365 connects",body:`Microsoft no longer allows password-based access to its mailboxes
90
99
  (app passwords included \u2014 Microsoft retired them), so there's no
@@ -94,7 +103,7 @@ Instead, at the end of setup you'll sign in to Microsoft ONCE in
94
103
  your browser and approve Klaudius reading and sending your mail.
95
104
  Your password never passes through Klaudius, and you can revoke
96
105
  the access any time at https://account.microsoft.com (or, for
97
- work accounts, https://myapps.microsoft.com).`});let p=await a({type:"text",message:"Outlook / Microsoft 365 address to send outreach from",placeholder:"you@yourbusiness.com",initialValue:e.emailAddress??"",validate:ve}),m=r;return{emailProvider:n,emailAuth:"oauth-microsoft",emailAddress:p,emailPassword:e.emailPassword??"",emailFromName:e.name,emailSmtpHost:m.smtpHost,emailSmtpPort:m.smtpPort,emailImapHost:m.imapHost,emailImapPort:m.imapPort,emailSentFolder:m.sentFolder,emailInboxFolder:m.inboxFolder}}let s=await a({type:"text",message:"Email address to send outreach from",placeholder:"you@yourbusiness.com",initialValue:e.emailAddress??"",validate:ve}),o=r?.appPasswordHelp??he,c=r?.usesAccountPassword??!1,d=await a({type:"password",message:c?"Paste your mailbox password":"Paste the app password",initialValue:e.emailPassword??"",validate:B(c?"Mailbox password":"App password"),note:{title:c?"Mailbox password":"App password",body:(r&&!c?`An app password is a separate, single-purpose password that your
106
+ work accounts, https://myapps.microsoft.com).`});let p=await a({type:"text",message:"Outlook / Microsoft 365 address to send outreach from",placeholder:"you@yourbusiness.com",initialValue:e.emailAddress??"",validate:ke}),m=r;return{emailProvider:n,emailAuth:"oauth-microsoft",emailAddress:p,emailPassword:e.emailPassword??"",emailFromName:e.name,emailSmtpHost:m.smtpHost,emailSmtpPort:m.smtpPort,emailImapHost:m.imapHost,emailImapPort:m.imapPort,emailSentFolder:m.sentFolder,emailInboxFolder:m.inboxFolder}}let s=await a({type:"text",message:"Email address to send outreach from",placeholder:"you@yourbusiness.com",initialValue:e.emailAddress??"",validate:ke}),o=r?.appPasswordHelp??he,d=r?.usesAccountPassword??!1,c=await a({type:"password",message:d?"Paste your mailbox password":"Paste the app password",initialValue:e.emailPassword??"",validate:B(d?"Mailbox password":"App password"),note:{title:d?"Mailbox password":"App password",body:(r&&!d?`An app password is a separate, single-purpose password that your
98
107
  email provider issues for third-party apps like Klaudius. It is NOT
99
108
  your normal account login password.
100
109
 
@@ -102,7 +111,7 @@ your normal account login password.
102
111
 
103
112
  The password is stored locally in this project's .env file.
104
113
  It is never sent to Klaudius's servers \u2014 only to your email
105
- provider when sending outreach.`}}),i,u,l,h,g,k;if(n==="custom"){i=await a({type:"text",message:"SMTP host (the server Klaudius connects to for sending)",placeholder:"e.g. smtp.yourprovider.com",initialValue:e.emailSmtpHost??"",validate:B("SMTP host")});let p=await a({type:"text",message:"SMTP port (usually 587 for STARTTLS or 465 for SSL)",initialValue:String(e.emailSmtpPort??587),validate:v=>/^\d+$/.test(v)?void 0:"Must be a number"});u=parseInt(p,10),l=await a({type:"text",message:"IMAP host (the server Klaudius connects to for reading replies)",placeholder:"e.g. imap.yourprovider.com",initialValue:e.emailImapHost??"",validate:B("IMAP host")});let m=await a({type:"text",message:"IMAP port (usually 993 for SSL)",initialValue:String(e.emailImapPort??993),validate:v=>/^\d+$/.test(v)?void 0:"Must be a number"});h=parseInt(m,10),g=await a({type:"text",message:"Sent folder name (so SMTP-sent messages also appear in your email client's Sent folder)",placeholder:'e.g. "Sent", "Sent Items"',initialValue:e.emailSentFolder??"Sent"}),k=await a({type:"text",message:"Inbox folder name (almost always INBOX)",initialValue:e.emailInboxFolder??"INBOX"})}else{let p=r,m=n===e.emailProvider,v=m?e.emailSmtpHost:void 0,J=m?e.emailSmtpPort:void 0,M=m?e.emailImapHost:void 0,Q=m?e.emailImapPort:void 0,N=!!v&&v!==p.smtpHost||!!M&&M!==p.imapHost;if(await a({type:"select",message:`Server settings for ${p.label}`,initialValue:N?"manual":"standard",options:[{value:"standard",label:`Use the standard ${p.label} servers \u2014 ${p.smtpHost} (Recommended)`},{value:"manual",label:"Enter servers manually (regional accounts, custom setups)"}],note:p.serverHelp?{title:"Server settings",body:p.serverHelp}:void 0})==="manual"){i=await a({type:"text",message:"SMTP host (the server Klaudius connects to for sending)",initialValue:v??p.smtpHost,validate:B("SMTP host")});let X=await a({type:"text",message:"SMTP port (usually 587 for STARTTLS or 465 for SSL)",initialValue:String(J??p.smtpPort),validate:w=>/^\d+$/.test(w)?void 0:"Must be a number"});u=parseInt(X,10),l=await a({type:"text",message:"IMAP host (the server Klaudius connects to for reading replies)",initialValue:M??p.imapHost,validate:B("IMAP host")});let b=await a({type:"text",message:"IMAP port (usually 993 for SSL)",initialValue:String(Q??p.imapPort),validate:w=>/^\d+$/.test(w)?void 0:"Must be a number"});h=parseInt(b,10),g=(m?e.emailSentFolder:void 0)??p.sentFolder,k=(m?e.emailInboxFolder:void 0)??p.inboxFolder}else i=p.smtpHost,u=p.smtpPort,l=p.imapHost,h=p.imapPort,g=p.sentFolder,k=p.inboxFolder}return{emailProvider:n,emailAuth:"password",emailAddress:s,emailPassword:d,emailFromName:e.name,emailSmtpHost:i,emailSmtpPort:u,emailImapHost:l,emailImapPort:h,emailSentFolder:g,emailInboxFolder:k}}},Qe={id:"sms",title:"SMS setup",isApplicable:e=>e.outreachChannels?.includes("sms")===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"SMS setup",body:`Klaudius can send SMS one of two ways:
114
+ provider when sending outreach.`}}),l,u,i,h,g,k;if(n==="custom"){l=await a({type:"text",message:"SMTP host (the server Klaudius connects to for sending)",placeholder:"e.g. smtp.yourprovider.com",initialValue:e.emailSmtpHost??"",validate:B("SMTP host")});let p=await a({type:"text",message:"SMTP port (usually 587 for STARTTLS or 465 for SSL)",initialValue:String(e.emailSmtpPort??587),validate:v=>/^\d+$/.test(v)?void 0:"Must be a number"});u=parseInt(p,10),i=await a({type:"text",message:"IMAP host (the server Klaudius connects to for reading replies)",placeholder:"e.g. imap.yourprovider.com",initialValue:e.emailImapHost??"",validate:B("IMAP host")});let m=await a({type:"text",message:"IMAP port (usually 993 for SSL)",initialValue:String(e.emailImapPort??993),validate:v=>/^\d+$/.test(v)?void 0:"Must be a number"});h=parseInt(m,10),g=await a({type:"text",message:"Sent folder name (so SMTP-sent messages also appear in your email client's Sent folder)",placeholder:'e.g. "Sent", "Sent Items"',initialValue:e.emailSentFolder??"Sent"}),k=await a({type:"text",message:"Inbox folder name (almost always INBOX)",initialValue:e.emailInboxFolder??"INBOX"})}else{let p=r,m=n===e.emailProvider,v=m?e.emailSmtpHost:void 0,J=m?e.emailSmtpPort:void 0,M=m?e.emailImapHost:void 0,Q=m?e.emailImapPort:void 0,N=!!v&&v!==p.smtpHost||!!M&&M!==p.imapHost;if(await a({type:"select",message:`Server settings for ${p.label}`,initialValue:N?"manual":"standard",options:[{value:"standard",label:`Use the standard ${p.label} servers \u2014 ${p.smtpHost} (Recommended)`},{value:"manual",label:"Enter servers manually (regional accounts, custom setups)"}],note:p.serverHelp?{title:"Server settings",body:p.serverHelp}:void 0})==="manual"){l=await a({type:"text",message:"SMTP host (the server Klaudius connects to for sending)",initialValue:v??p.smtpHost,validate:B("SMTP host")});let X=await a({type:"text",message:"SMTP port (usually 587 for STARTTLS or 465 for SSL)",initialValue:String(J??p.smtpPort),validate:w=>/^\d+$/.test(w)?void 0:"Must be a number"});u=parseInt(X,10),i=await a({type:"text",message:"IMAP host (the server Klaudius connects to for reading replies)",initialValue:M??p.imapHost,validate:B("IMAP host")});let b=await a({type:"text",message:"IMAP port (usually 993 for SSL)",initialValue:String(Q??p.imapPort),validate:w=>/^\d+$/.test(w)?void 0:"Must be a number"});h=parseInt(b,10),g=(m?e.emailSentFolder:void 0)??p.sentFolder,k=(m?e.emailInboxFolder:void 0)??p.inboxFolder}else l=p.smtpHost,u=p.smtpPort,i=p.imapHost,h=p.imapPort,g=p.sentFolder,k=p.inboxFolder}return{emailProvider:n,emailAuth:"password",emailAddress:s,emailPassword:c,emailFromName:e.name,emailSmtpHost:l,emailSmtpPort:u,emailImapHost:i,emailImapPort:h,emailSentFolder:g,emailInboxFolder:k}}},ea={id:"sms",title:"SMS setup",isApplicable:e=>e.outreachChannels?.includes("sms")===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"SMS setup",body:`Klaudius can send SMS one of two ways:
106
115
 
107
116
  \u2022 macOS iMessage \u2014 free, uses Messages.app on your Mac.
108
117
  Reaches other Apple users as iMessage for free. To reach
@@ -118,7 +127,7 @@ provider when sending outreach.`}}),i,u,l,h,g,k;if(n==="custom"){i=await a({type
118
127
 
119
128
  \u2022 Twilio \u2014 cross-platform, ~$0.01 per SMS. Sender is a phone
120
129
  number you buy from Twilio. Works on any OS, reaches any
121
- phone, no iPhone required. Recommended for consistent delivery.`});let n=await a({type:"select",message:"Which SMS provider?",initialValue:e.smsProvider??(process.platform==="darwin"?"imessage":"twilio"),options:[{value:"imessage",label:"macOS iMessage (free, Mac only)"},{value:"twilio",label:"Twilio (cross-platform, paid per-message \u2014 recommended)"}]}),r=await a({type:"text",message:"Your mobile number (used as a safe target for test sends so Klaudius doesn't accidentally message real candidates while you're testing)",placeholder:"+12025550123",initialValue:e.testPhone??"",validate:Se}),s={smsProvider:n,testPhone:r};return n==="twilio"&&(s.twilioAccountSid=await a({type:"text",message:"Twilio Account SID (starts with AC...)",initialValue:e.twilioAccountSid??"",validate:o=>/^AC[a-zA-Z0-9]+$/.test(o)?void 0:"Should start with 'AC'"}),s.twilioAuthToken=await a({type:"password",message:"Twilio Auth Token",initialValue:e.twilioAuthToken??"",validate:ze("Twilio Auth Token")}),s.twilioPhoneNumber=await a({type:"text",message:"Twilio phone number (the number outreach will be sent FROM)",placeholder:"+15551234567",initialValue:e.twilioPhoneNumber??"",validate:Se})),s}},Xe={id:"whatsapp",title:"WhatsApp setup",isApplicable:e=>e.outreachPriority?.includes("whatsapp")===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"WhatsApp setup",body:`Klaudius connects to WhatsApp as a linked device on your phone \u2014 same way
130
+ phone, no iPhone required. Recommended for consistent delivery.`});let n=await a({type:"select",message:"Which SMS provider?",initialValue:e.smsProvider??(process.platform==="darwin"?"imessage":"twilio"),options:[{value:"imessage",label:"macOS iMessage (free, Mac only)"},{value:"twilio",label:"Twilio (cross-platform, paid per-message \u2014 recommended)"}]}),r=await a({type:"text",message:"Your mobile number (used as a safe target for test sends so Klaudius doesn't accidentally message real candidates while you're testing)",placeholder:"+12025550123",initialValue:e.testPhone??"",validate:ve}),s={smsProvider:n,testPhone:r};return n==="twilio"&&(s.twilioAccountSid=await a({type:"text",message:"Twilio Account SID (starts with AC...)",initialValue:e.twilioAccountSid??"",validate:o=>/^AC[a-zA-Z0-9]+$/.test(o)?void 0:"Should start with 'AC'"}),s.twilioAuthToken=await a({type:"password",message:"Twilio Auth Token",initialValue:e.twilioAuthToken??"",validate:ze("Twilio Auth Token")}),s.twilioPhoneNumber=await a({type:"text",message:"Twilio phone number (the number outreach will be sent FROM)",placeholder:"+15551234567",initialValue:e.twilioPhoneNumber??"",validate:ve})),s}},aa={id:"whatsapp",title:"WhatsApp setup",isApplicable:e=>e.outreachPriority?.includes("whatsapp")===!0,execute:async(e,{prompt:a,info:t})=>{t({title:"WhatsApp setup",body:`Klaudius connects to WhatsApp as a linked device on your phone \u2014 same way
122
131
  WhatsApp Web works. Setup is a one-time QR scan from the WhatsApp app on
123
132
  the phone whose number you want to use. Klaudius will guide you through
124
133
  that AFTER this wizard, once npm dependencies are installed.
@@ -131,7 +140,7 @@ a separate phone number per account (they're tied to real SIMs).
131
140
 
132
141
  You'll be asked how many accounts to link and a short label for each
133
142
  (used only locally \u2014 appears in logs, in the .env file, and in this
134
- project's per-account directory under ~/.klaudius/whatsapp/).`});let n=await a({type:"select",message:"How many WhatsApp numbers do you want to link?",initialValue:String(e.whatsappAccounts?.length??1),options:[{value:"1",label:"1 number (recommended starting point)"},{value:"2",label:"2 numbers (spread load across two)"},{value:"3",label:"3 numbers"},{value:"4",label:"4 numbers"},{value:"5",label:"5 numbers (maximum)"}]}),r=parseInt(n,10),s=["primary","secondary","tertiary","quaternary","quinary"],o=[];for(let c=0;c<r;c++){let d=await a({type:"text",message:r===1?"Label for this WhatsApp account (used only locally \u2014 'primary' is fine)":`Label for WhatsApp account ${c+1} of ${r} (e.g. 'primary', 'uk-1', 'us-east')`,initialValue:e.whatsappAccounts?.[c]??s[c],validate:i=>{let u=i.trim();if(!u)return"Required";if(u.length>30)return"Too long (max 30 characters)";if(u.startsWith("-")||u.endsWith("-"))return"Can't start or end with a hyphen";if(!/^[A-Za-z0-9_-]+$/.test(u))return"Letters, digits, underscore, hyphen only (no spaces)";if(o.includes(u))return"Duplicate label"}});o.push(d.trim())}return{whatsappAccounts:o}}},ea={id:"deploy-provider",title:"Deployment host",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>(t({title:"Where should Klaudius deploy the websites it builds?",body:`Every client site Klaudius builds is a static website, so it deploys
143
+ project's per-account directory under ~/.klaudius/whatsapp/).`});let n=await a({type:"select",message:"How many WhatsApp numbers do you want to link?",initialValue:String(e.whatsappAccounts?.length??1),options:[{value:"1",label:"1 number (recommended starting point)"},{value:"2",label:"2 numbers (spread load across two)"},{value:"3",label:"3 numbers"},{value:"4",label:"4 numbers"},{value:"5",label:"5 numbers (maximum)"}]}),r=parseInt(n,10),s=["primary","secondary","tertiary","quaternary","quinary"],o=[];for(let d=0;d<r;d++){let c=await a({type:"text",message:r===1?"Label for this WhatsApp account (used only locally \u2014 'primary' is fine)":`Label for WhatsApp account ${d+1} of ${r} (e.g. 'primary', 'uk-1', 'us-east')`,initialValue:e.whatsappAccounts?.[d]??s[d],validate:l=>{let u=l.trim();if(!u)return"Required";if(u.length>30)return"Too long (max 30 characters)";if(u.startsWith("-")||u.endsWith("-"))return"Can't start or end with a hyphen";if(!/^[A-Za-z0-9_-]+$/.test(u))return"Letters, digits, underscore, hyphen only (no spaces)";if(o.includes(u))return"Duplicate label"}});o.push(c.trim())}return{whatsappAccounts:o}}},na={id:"deploy-provider",title:"Deployment host",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>(t({title:"Where should Klaudius deploy the websites it builds?",body:`Every client site Klaudius builds is a static website, so it deploys
135
144
  cleanly to any of the hosts below \u2014 pick whichever you'd rather have
136
145
  an account with. All have a free tier that's plenty to get started.
137
146
 
@@ -145,7 +154,7 @@ an account with. All have a free tier that's plenty to get started.
145
154
  This only changes where sites are hosted and which credential you set
146
155
  up next. Everything else \u2014 how sites are found, built, and pitched \u2014
147
156
  is identical. (The optional dynamic add-ons \u2014 CMS, live Google
148
- rating, booking \u2014 are Vercel-only today.)`}),{deployProvider:await a({type:"select",message:"Which host should Klaudius deploy client sites to?",initialValue:e.deployProvider??"vercel",options:[{value:"vercel",label:"Vercel (default)"},{value:"cloudflare",label:"Cloudflare Pages"},{value:"netlify",label:"Netlify"},{value:"selfhost",label:"Self-hosted (your own server over SSH)"}]})})},aa={id:"vercel",title:"Vercel deployment",isApplicable:e=>(e.deployProvider??"vercel")==="vercel",execute:async(e,{prompt:a})=>({vercelToken:await a({type:"password",message:"Paste your Vercel API token",initialValue:e.vercelToken??"",validate:n=>n.trim().length===0?"Required \u2014 without this Klaudius can't deploy generated sites":void 0,note:{title:"Vercel deployment",body:`Klaudius deploys every generated client site to Vercel. We use a
157
+ rating, booking \u2014 are Vercel-only today.)`}),{deployProvider:await a({type:"select",message:"Which host should Klaudius deploy client sites to?",initialValue:e.deployProvider??"vercel",options:[{value:"vercel",label:"Vercel (default)"},{value:"cloudflare",label:"Cloudflare Pages"},{value:"netlify",label:"Netlify"},{value:"selfhost",label:"Self-hosted (your own server over SSH)"}]})})},ta={id:"vercel",title:"Vercel deployment",isApplicable:e=>(e.deployProvider??"vercel")==="vercel",execute:async(e,{prompt:a})=>({vercelToken:await a({type:"password",message:"Paste your Vercel API token",initialValue:e.vercelToken??"",validate:n=>n.trim().length===0?"Required \u2014 without this Klaudius can't deploy generated sites":void 0,note:{title:"Vercel deployment",body:`Klaudius deploys every generated client site to Vercel. We use a
149
158
  Vercel API token to do this without an interactive login.
150
159
 
151
160
  How to get one (one-time, ~30 seconds):
@@ -168,7 +177,7 @@ STUCK? Open Claude (or any LLM) in another tab/app and paste:
168
177
  "I need to create a personal Vercel API token for the
169
178
  Klaudius CLI tool. Walk me through generating one at
170
179
  vercel.com/account/tokens, including which scope and
171
- expiration to choose."`}})})},na={id:"cloudflare",title:"Cloudflare deployment",isApplicable:e=>e.deployProvider==="cloudflare",execute:async(e,{prompt:a})=>{let t=await a({type:"password",message:"Paste your Cloudflare API token",initialValue:e.cloudflareApiToken??"",validate:r=>r.trim().length===0?"Required \u2014 without this Klaudius can't deploy generated sites":void 0,note:{title:"Cloudflare API token",body:`Klaudius deploys every generated client site to Cloudflare Pages
180
+ expiration to choose."`}})})},oa={id:"cloudflare",title:"Cloudflare deployment",isApplicable:e=>e.deployProvider==="cloudflare",execute:async(e,{prompt:a})=>{let t=await a({type:"password",message:"Paste your Cloudflare API token",initialValue:e.cloudflareApiToken??"",validate:r=>r.trim().length===0?"Required \u2014 without this Klaudius can't deploy generated sites":void 0,note:{title:"Cloudflare API token",body:`Klaudius deploys every generated client site to Cloudflare Pages
172
181
  using \`wrangler\`. It authenticates with an API token (no interactive
173
182
  login), so no browser step at deploy time.
174
183
 
@@ -205,7 +214,7 @@ Where to find it:
205
214
  the account's Workers & Pages overview page under 'Account ID'
206
215
 
207
216
  Without it, wrangler shows an interactive account picker that would
208
- stall an unattended pipeline run, so Klaudius requires it up front.`}});return{cloudflareApiToken:t,cloudflareAccountId:n.trim()}}},ta={id:"netlify",title:"Netlify deployment",isApplicable:e=>e.deployProvider==="netlify",execute:async(e,{prompt:a})=>({netlifyAuthToken:await a({type:"password",message:"Paste your Netlify access token",initialValue:e.netlifyAuthToken??"",validate:n=>n.trim().length===0?"Required \u2014 without this Klaudius can't deploy generated sites":void 0,note:{title:"Netlify access token",body:`Klaudius deploys every generated client site to Netlify using the
217
+ stall an unattended pipeline run, so Klaudius requires it up front.`}});return{cloudflareApiToken:t,cloudflareAccountId:n.trim()}}},sa={id:"netlify",title:"Netlify deployment",isApplicable:e=>e.deployProvider==="netlify",execute:async(e,{prompt:a})=>({netlifyAuthToken:await a({type:"password",message:"Paste your Netlify access token",initialValue:e.netlifyAuthToken??"",validate:n=>n.trim().length===0?"Required \u2014 without this Klaudius can't deploy generated sites":void 0,note:{title:"Netlify access token",body:`Klaudius deploys every generated client site to Netlify using the
209
218
  Netlify CLI. It authenticates with a personal access token (no
210
219
  interactive login), so there's no browser step at deploy time.
211
220
 
@@ -228,7 +237,7 @@ STUCK? Open Claude (or any LLM) in another tab/app and paste:
228
237
  "I need to create a personal access token for the Klaudius CLI
229
238
  tool in Netlify. Walk me through generating one at
230
239
  app.netlify.com/user/applications, including which expiry to
231
- choose."`}})})},oa={id:"selfhost",title:"Self-host deployment",isApplicable:e=>e.deployProvider==="selfhost",execute:async(e,{prompt:a})=>{let t=await a({type:"text",message:"Where should sites be uploaded? (rsync destination)",placeholder:"e.g. deploy@203.0.113.7:/var/www/klaudius-sites",initialValue:e.selfhostDeployTarget??"",validate:me,note:{title:"Self-host deployment",body:`Klaudius builds each client site locally as plain static files and
240
+ choose."`}})})},ia={id:"selfhost",title:"Self-host deployment",isApplicable:e=>e.deployProvider==="selfhost",execute:async(e,{prompt:a})=>{let t=await a({type:"text",message:"Where should sites be uploaded? (rsync destination)",placeholder:"e.g. deploy@203.0.113.7:/var/www/klaudius-sites",initialValue:e.selfhostDeployTarget??"",validate:me,note:{title:"Self-host deployment",body:`Klaudius builds each client site locally as plain static files and
232
241
  uploads them to your server with rsync over SSH. Each client gets
233
242
  its own subdirectory under the destination you enter here, e.g.
234
243
  deploy@yourvps:/var/www/klaudius-sites \u2192 .../klaudius-sites/<slug>/
@@ -259,7 +268,7 @@ deploy end-to-end. STUCK on the server config? Paste into any LLM:
259
268
  "Help me configure nginx (or Caddy) with a wildcard vhost that
260
269
  serves https://<name>.sites.example.com from
261
270
  /var/www/klaudius-sites/<name>/, plus a wildcard Let's Encrypt
262
- certificate via DNS-01."`}});return{selfhostDeployTarget:t.trim().replace(/\/+$/,""),selfhostUrlTemplate:n.trim()}}},sa={id:"supabase",title:"Supabase",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Supabase setup",body:`Supabase is your CRM. It's where Klaudius records every business it
271
+ certificate via DNS-01."`}});return{selfhostDeployTarget:t.trim().replace(/\/+$/,""),selfhostUrlTemplate:n.trim()}}},la={id:"supabase",title:"Supabase",isApplicable:()=>!0,execute:async(e,{prompt:a,info:t})=>{t({title:"Supabase setup",body:`Supabase is your CRM. It's where Klaudius records every business it
263
272
  finds, where each one sits in your funnel (gathered \u2192 built \u2192 deployed
264
273
  \u2192 outreach sent \u2192 responded), and the follow-up state for every lead.
265
274
  You can browse it at any time from the Supabase dashboard, or ask
@@ -297,7 +306,7 @@ in another tab/app and paste this prompt verbatim:
297
306
  Settings \u2192 Data API \u2192 'API URL'
298
307
 
299
308
  It looks like https://xxxx.supabase.co. Click to copy and paste
300
- below.`}})).trim().replace(/\/rest\/v1\/?$/i,"").replace(/\/$/,""),s=r.match(/^https:\/\/([a-z0-9]+)\.supabase\.co/i)?.[1]??"",c=(await a({type:"password",message:"Paste the Supabase secret key (sb_secret_\u2026)",initialValue:e.supabaseServiceKey??"",validate:u=>{let l=u.trim(),h=ae(l);if(h)return h;if(l.length<20)return"Looks too short";if(l.startsWith("sb_publishable_"))return"That's the publishable key. Klaudius needs the 'sb_secret_\u2026' key on the same page (different row, below the publishable one).";if(!l.startsWith("sb_secret_")&&!l.startsWith("eyJ"))return"Doesn't look like a Supabase secret key. Expected 'sb_secret_\u2026' (or a legacy JWT starting with 'eyJ\u2026' on older projects)."},note:{title:"Secret key",body:`Open this exact page:
309
+ below.`}})).trim().replace(/\/rest\/v1\/?$/i,"").replace(/\/$/,""),s=r.match(/^https:\/\/([a-z0-9]+)\.supabase\.co/i)?.[1]??"",d=(await a({type:"password",message:"Paste the Supabase secret key (sb_secret_\u2026)",initialValue:e.supabaseServiceKey??"",validate:u=>{let i=u.trim(),h=ae(i);if(h)return h;if(i.length<20)return"Looks too short";if(i.startsWith("sb_publishable_"))return"That's the publishable key. Klaudius needs the 'sb_secret_\u2026' key on the same page (different row, below the publishable one).";if(!i.startsWith("sb_secret_")&&!i.startsWith("eyJ"))return"Doesn't look like a Supabase secret key. Expected 'sb_secret_\u2026' (or a legacy JWT starting with 'eyJ\u2026' on older projects)."},note:{title:"Secret key",body:`Open this exact page:
301
310
  https://supabase.com/dashboard/project/${s}/settings/api-keys
302
311
 
303
312
  Under 'Secret keys', find the row whose value starts with
@@ -309,7 +318,7 @@ are client-side keys with no write permissions).
309
318
  Don't confuse this page with 'Edge Functions \u2192 Secrets' in the
310
319
  left sidebar \u2014 that's an unrelated feature (env vars for Edge
311
320
  Functions). The page you want is Settings (gear icon, bottom
312
- of the left sidebar) \u2192 API Keys.`}})).replace(/\s+/g,""),i=(await a({type:"password",message:"Paste the Supabase personal access token",initialValue:e.supabasePat??"",validate:Ge,note:{title:"Personal access token",body:`This is a separate credential from the secret key above \u2014 it's an
321
+ of the left sidebar) \u2192 API Keys.`}})).replace(/\s+/g,""),l=(await a({type:"password",message:"Paste the Supabase personal access token",initialValue:e.supabasePat??"",validate:He,note:{title:"Personal access token",body:`This is a separate credential from the secret key above \u2014 it's an
313
322
  ACCOUNT-wide token (not project-scoped) used by the Supabase MCP and
314
323
  by Klaudius's schema migration.
315
324
 
@@ -319,7 +328,7 @@ Open this exact page:
319
328
  Click 'Generate new token', name it 'Klaudius', and set the
320
329
  expiration to 'Never' (recommended \u2014 saves you having to rotate
321
330
  it later). Copy the value (starts with 'sbp_') and paste it
322
- below.`}})).replace(/\s+/g,"");return{supabaseUrl:r,supabaseServiceKey:c,supabasePat:i,supabaseProjectRef:s}}},ia={id:"google-places",title:"Google Places API",isApplicable:()=>!0,execute:async(e,{prompt:a})=>{let t=await a({type:"password",message:"Paste your Google Places API key",placeholder:"AIzaSy\u2026",initialValue:e.googlePlacesApiKey??"",validate:r=>be(r),note:{title:"Google Places API key",body:`Klaudius's /find skill queries Google's Places API to discover businesses
331
+ below.`}})).replace(/\s+/g,"");return{supabaseUrl:r,supabaseServiceKey:d,supabasePat:l,supabaseProjectRef:s}}},ra={id:"google-places",title:"Google Places API",isApplicable:()=>!0,execute:async(e,{prompt:a})=>{let t=await a({type:"password",message:"Paste your Google Places API key",placeholder:"AIzaSy\u2026",initialValue:e.googlePlacesApiKey??"",validate:r=>be(r),note:{title:"Google Places API key",body:`Klaudius's /find skill queries Google's Places API to discover businesses
323
332
  without websites in your target region. Without a key, the pipeline has
324
333
  no source of leads \u2014 so this is required.
325
334
 
@@ -355,13 +364,13 @@ STUCK? Open Claude (or any LLM) in another tab/app and paste this prompt:
355
364
  "I need a Google Places API (New) key for a CLI tool called
356
365
  Klaudius. Walk me through claiming the $300 Google Cloud free trial
357
366
  and getting the API key Google auto-generates after enabling
358
- Places API (New), including any signup gotchas."`}});return{googlePlacesApiKey:fe(t).value}}},la={id:"notifications",title:"Notifications (optional)",isApplicable:()=>!0,clearOnSkip:["notifyChannel","notifyTo","telegramBotToken","telegramChatId"],execute:async(e,{prompt:a})=>{let t=!!e.emailAddress,n=!!e.smsProvider||!!e.testPhone,r=e.notifyChannel==="telegram"?!!e.telegramBotToken:e.notifyChannel==="email"?t:e.notifyChannel==="sms"?n:!1,s=await a({type:"select",message:"How should Klaudius send you pipeline alerts?",initialValue:r?e.notifyChannel:e.telegramBotToken?"telegram":"none",options:[{value:"telegram",label:"Telegram (recommended \u2014 instant phone pings, free)"},...t?[{value:"email",label:"Email (to your own inbox, reuses your outreach account)"}]:[],...n?[{value:"sms",label:"SMS (to your own phone, via your configured SMS setup)"}]:[],{value:"none",label:"None"}],note:{title:"Pipeline notifications (optional)",body:`Klaudius alerts you when outreach lands and when anything needs a
367
+ Places API (New), including any signup gotchas."`}});return{googlePlacesApiKey:fe(t).value}}},ua={id:"notifications",title:"Notifications (optional)",isApplicable:()=>!0,clearOnSkip:["notifyChannel","notifyTo","telegramBotToken","telegramChatId"],execute:async(e,{prompt:a})=>{let t=!!e.emailAddress,n=!!e.smsProvider||!!e.testPhone,r=e.notifyChannel==="telegram"?!!e.telegramBotToken:e.notifyChannel==="email"?t:e.notifyChannel==="sms"?n:!1,s=await a({type:"select",message:"How should Klaudius send you pipeline alerts?",initialValue:r?e.notifyChannel:e.telegramBotToken?"telegram":"none",options:[{value:"telegram",label:"Telegram (recommended \u2014 instant phone pings, free)"},...t?[{value:"email",label:"Email (to your own inbox, reuses your outreach account)"}]:[],...n?[{value:"sms",label:"SMS (to your own phone, via your configured SMS setup)"}]:[],{value:"none",label:"None"}],note:{title:"Pipeline notifications (optional)",body:`Klaudius alerts you when outreach lands and when anything needs a
359
368
  human eye (a failed deploy, an API error, odd-looking data).
360
369
 
361
370
  \u2022 Telegram \u2014 needs a bot token (via @BotFather, ~30 seconds);
362
371
  the next prompts walk you through it.
363
372
  \u2022 Email / SMS \u2014 zero extra setup; alerts go to your own
364
- inbox/phone through the account you already configured.`}});if(s==="none")return{notifyChannel:void 0,notifyTo:void 0,telegramBotToken:void 0,telegramChatId:void 0};if(s==="email"||s==="sms"){let l=s==="email"?e.emailAddress:e.testPhone,h=await a({type:"text",message:s==="email"?"Where should alert emails go?":"Which number should alert texts go to?",initialValue:e.notifyTo??l??"",validate:g=>g.trim().length===0?"Required":void 0});return{notifyChannel:s,notifyTo:h.trim()}}let o=await a({type:"password",message:"Paste your Telegram bot token",initialValue:e.telegramBotToken??"",validate:B("Bot token"),note:{title:"Bot token",body:`Telegram lets you create personal bots in ~30 seconds. Klaudius
373
+ inbox/phone through the account you already configured.`}});if(s==="none")return{notifyChannel:void 0,notifyTo:void 0,telegramBotToken:void 0,telegramChatId:void 0};if(s==="email"||s==="sms"){let i=s==="email"?e.emailAddress:e.testPhone,h=await a({type:"text",message:s==="email"?"Where should alert emails go?":"Which number should alert texts go to?",initialValue:e.notifyTo??i??"",validate:g=>g.trim().length===0?"Required":void 0});return{notifyChannel:s,notifyTo:h.trim()}}let o=await a({type:"password",message:"Paste your Telegram bot token",initialValue:e.telegramBotToken??"",validate:B("Bot token"),note:{title:"Bot token",body:`Telegram lets you create personal bots in ~30 seconds. Klaudius
365
374
  uses a bot to send you private notifications.
366
375
 
367
376
  How to create one:
@@ -374,16 +383,16 @@ How to create one:
374
383
  'KlaudiusNotifierBot'). Each username has to be globally
375
384
  unique, so add a personal suffix if it's taken.
376
385
  6. BotFather replies with a token like
377
- '1234567890:AAEhBP_yourtokenhere\u2026'. Copy it and paste below.`}}),c=null,d=0,i=null,u=null;for(;c===null;){d++;let l=d>1,h=u==="network"?`${i}
386
+ '1234567890:AAEhBP_yourtokenhere\u2026'. Copy it and paste below.`}}),d=null,c=0,l=null,u=null;for(;d===null;){c++;let i=c>1,h=u==="network"?`${l}
378
387
 
379
388
  This is usually a network problem on your end (corporate WiFi or VPN
380
389
  blocking Telegram, ISP DNS issue, a momentary drop). Check your
381
390
  connection, try a different network if available, then press Enter
382
- to retry.`:`${i}
391
+ to retry.`:`${l}
383
392
 
384
393
  Make sure you sent a regular text message (e.g. 'hi'), not
385
394
  just a /start tap \u2014 /start alone doesn't always register.
386
- Then press Enter to retry.`;await a({type:"text",message:l?u==="network"?"Check your network, then press Enter to retry":"Send another message to the bot, then press Enter to retry":"Send a message to your bot, then press Enter to detect chat ID",initialValue:"",placeholder:"(press Enter when you've sent the message)",validate:()=>{},note:{title:l?"Detect chat ID \u2014 retry":"Detect chat ID",body:l?h:`Klaudius will auto-detect your chat ID by asking Telegram for
395
+ Then press Enter to retry.`;await a({type:"text",message:i?u==="network"?"Check your network, then press Enter to retry":"Send another message to the bot, then press Enter to retry":"Send a message to your bot, then press Enter to detect chat ID",initialValue:"",placeholder:"(press Enter when you've sent the message)",validate:()=>{},note:{title:i?"Detect chat ID \u2014 retry":"Detect chat ID",body:i?h:`Klaudius will auto-detect your chat ID by asking Telegram for
387
396
  any messages your bot has received. To make that work:
388
397
 
389
398
  1. In the Telegram app, search for the bot you just created
@@ -392,5 +401,5 @@ any messages your bot has received. To make that work:
392
401
  If the chat starts with a 'Start' button, tap that first,
393
402
  THEN send 'hi'. /start alone doesn't always show up.
394
403
  3. Press Enter below \u2014 Klaudius will detect the chat ID for
395
- you.`}});let g=await pe({botToken:o});if(g.ok&&g.chatId)c=g.chatId;else if(g.reason==="no_messages")i="No messages from you to your bot have been picked up yet.",u="no_messages";else if(g.reason==="network")i=g.message??"Could not reach Telegram.",u="network";else throw new Error(`Telegram chat ID auto-detect failed: ${g.message??"unknown error"}`)}return{notifyChannel:"telegram",notifyTo:void 0,telegramBotToken:o,telegramChatId:c}}},O=[We,_e,$e,je,qe,Ye,Ze,Je,Qe,Xe,ea,aa,na,ta,oa,sa,ia,la];import{Box as Ae,Text as ra}from"ink";import{jsx as Pe,jsxs as da}from"react/jsx-runtime";var ua={pending:"\u25CB",current:"\u25C9",done:"\u2713",skipped:"\xB7"},ca={pending:void 0,current:"cyan",done:"green",skipped:void 0};function Ie({items:e}){return Pe(Ae,{flexDirection:"column",width:28,flexShrink:0,children:e.map(a=>{let t=a.status==="skipped"||a.status==="pending";return Pe(Ae,{children:da(ra,{color:ca[a.status],bold:a.status==="current",dimColor:t&&a.status!=="current",children:[ua[a.status]," ",a.title]})},a.id)})})}import{useEffect as ga,useState as Te}from"react";import{Box as ne,Text as _,useInput as ha}from"ink";import pa from"ink-text-input";import{jsx as U,jsxs as te}from"react/jsx-runtime";function xe({spec:e,masked:a,onSubmit:t,onBack:n}){let r=typeof e.initialValue=="string"?e.initialValue:"",s=a&&r.length>0,[o,c]=Te(s?"":r),[d,i]=Te(null);ga(()=>(S("TextPromptUI:mount",{masked:a,message:e.message.slice(0,60),initial:typeof e.initialValue=="string"?e.initialValue.slice(0,30):null}),()=>{S("TextPromptUI:unmount")}),[a,e.message,e.initialValue]),ha((l,h)=>{S("TextPromptUI:useInput fired",{input:l,ctrl:h.ctrl,escape:h.escape,return:h.return}),h.escape&&n()});let u=l=>{S("TextPromptUI:handleSubmit",{raw:l.slice(0,30)});let h=l.length===0&&s?r:l;if(e.validate){let g=e.validate(h);if(g){S("TextPromptUI:validate failed",{err:g}),i(g);return}}i(null),t(h)};return te(ne,{flexDirection:"column",children:[te(_,{children:[U(_,{color:"cyan",children:"?"})," ",e.message]}),te(ne,{children:[U(_,{color:"green",children:"\u203A "}),U(pa,{value:o,onChange:c,onSubmit:u,placeholder:s?"type or paste a new value \u2014 or press Enter to keep the current one":e.placeholder,mask:a?"\u2022":void 0})]}),d&&U(ne,{marginTop:0,children:U(_,{color:"red",children:d})})]})}import{useState as ma}from"react";import{Box as oe,Text as $,useInput as ya}from"ink";import{jsx as j,jsxs as se}from"react/jsx-runtime";function Ee({spec:e,onSubmit:a,onBack:t}){let n=e.options??[],r=typeof e.initialValue=="string"?Math.max(0,n.findIndex(c=>c.value===e.initialValue)):0,[s,o]=ma(r===-1?0:r);return ya((c,d)=>{if(d.escape)t();else if(d.upArrow)o(i=>(i-1+n.length)%n.length);else if(d.downArrow)o(i=>(i+1)%n.length);else if(d.return){let i=n[s];i&&a(i.value)}}),se(oe,{flexDirection:"column",children:[se($,{children:[j($,{color:"cyan",children:"?"})," ",e.message]}),j(oe,{flexDirection:"column",marginTop:0,children:n.map((c,d)=>{let i=d===s;return se($,{color:i?"cyan":void 0,bold:i,children:[i?"\u25CF ":"\u25CB ",c.label]},c.value)})}),j(oe,{marginTop:1,children:j($,{dimColor:!0,children:"Use the \u2191 \u2193 arrow keys to choose, then press Enter"})})]})}import{useState as fa}from"react";import{Box as ie,Text as L,useInput as ba}from"ink";import{jsx as q,jsxs as D}from"react/jsx-runtime";function Me({spec:e,onSubmit:a,onBack:t}){let[n,r]=fa(typeof e.initialValue=="boolean"?e.initialValue:!0);return ba((s,o)=>{o.escape?t():o.leftArrow||o.rightArrow?r(c=>!c):s==="y"||s==="Y"?r(!0):s==="n"||s==="N"?r(!1):o.return&&a(n)}),D(ie,{flexDirection:"column",children:[D(L,{children:[q(L,{color:"cyan",children:"?"})," ",e.message]}),D(ie,{marginTop:0,children:[D(L,{color:n?"cyan":void 0,bold:n,children:[n?"\u25CF ":"\u25CB ","Yes"]}),q(L,{children:" "}),D(L,{color:n?void 0:"cyan",bold:!n,children:[n?"\u25CB ":"\u25CF ","No"]})]}),q(ie,{marginTop:1,children:q(L,{dimColor:!0,children:"Use the \u2190 \u2192 arrow keys (or y / n) to choose, then press Enter"})})]})}import{useState as Ne}from"react";import{Box as le,Text as Y,useInput as wa}from"ink";import{jsx as Z,jsxs as re}from"react/jsx-runtime";function Be({spec:e,onSubmit:a,onBack:t}){let n=e.options??[],r=new Set(typeof e.initialValue=="string"?e.initialValue.split(",").map(i=>i.trim()).filter(Boolean):[]),[s,o]=Ne(0),[c,d]=Ne(r);return wa((i,u)=>{if(u.escape)t();else if(u.upArrow)o(l=>(l-1+n.length)%n.length);else if(u.downArrow)o(l=>(l+1)%n.length);else if(i===" "){let l=n[s];l&&d(h=>{let g=new Set(h);return g.has(l.value)?g.delete(l.value):g.add(l.value),g})}else u.return&&a(n.map(l=>l.value).filter(l=>c.has(l)).join(","))}),re(le,{flexDirection:"column",children:[re(Y,{children:[Z(Y,{color:"cyan",children:"?"})," ",e.message]}),Z(le,{flexDirection:"column",marginTop:0,children:n.map((i,u)=>{let l=u===s,h=c.has(i.value);return re(Y,{color:l?"cyan":void 0,bold:l,children:[l?"\u203A ":" ",h?"\u25C9 ":"\u25EF ",i.label]},i.value)})}),Z(le,{marginTop:1,children:Z(Y,{dimColor:!0,children:"\u2191 \u2193 to move, Space to tick/untick, Enter to confirm (ticking none is fine)"})})]})}import{Box as Oe,Text as Ke}from"ink";import{jsx as ue,jsxs as Ca}from"react/jsx-runtime";function ce({title:e,body:a}){let t=a.split(`
396
- `);return Ca(Oe,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,children:[ue(Ke,{color:"cyan",bold:!0,children:e}),ue(Oe,{flexDirection:"column",marginTop:0,children:t.map((n,r)=>ue(Ke,{dimColor:!1,children:n.length===0?" ":n},r))})]})}import{jsx as f,jsxs as z}from"react/jsx-runtime";function Cn({defaults:e,onComplete:a,onlySection:t,banner:n}){let{exit:r}=ka(),s=de({...e}),o=de(new Map),[,c]=K(0),d=()=>c(b=>b+1),[i,u]=K(null),[l,h]=K(null),[g,k]=K([]),[p,m]=K(null),[v,J]=K(!1),[M,Q]=K({current:0,total:0}),N=()=>{let b=o.current;for(let w of O){let ee=w.isApplicable(s.current),y=b.get(w.id);ee?t&&w.id!==t?y!=="current"&&b.set(w.id,"done"):(y==="skipped"||!y)&&b.set(w.id,"pending"):b.set(w.id,"skipped")}};o.current.size===0&&N();let G=de(!1);Sa(()=>{if(S("WizardApp:useEffect fired",{startedAlready:G.current}),G.current){S("WizardApp:useEffect returning early (startedRef true)");return}G.current=!0,S("WizardApp:orchestrator starting");let b=0,w=y=>{let T=++b;return S("orchestrator:promptFn called",{id:T,type:y.type,message:y.message.slice(0,60)}),m(null),new Promise((A,C)=>{h({id:T,spec:y,resolve:x=>{S("orchestrator:prompt resolved",{id:T,type:y.type,value:typeof x=="string"?x.slice(0,30):x}),A(x)},reject:x=>{S("orchestrator:prompt rejected",{id:T,reason:x.message}),C(x)}})})},ee=y=>{k(T=>[...T,y])};return(async()=>{try{let y=t?O.filter(C=>C.id===t):O,T=()=>y.filter(C=>C.isApplicable(s.current)).length,A=0;for(;A<y.length;){let C=y[A];if(!C.isApplicable(s.current)){o.current.set(C.id,"skipped"),A++,N(),d();continue}k([]);for(let P of O)P.id===C.id?o.current.set(P.id,"current"):o.current.get(P.id)==="current"&&o.current.set(P.id,"pending");u(C.id);let x=y.slice(0,A+1).filter(P=>P.isApplicable(s.current)).length;Q({current:x,total:T()}),d();try{let P=await C.execute(s.current,{prompt:w,info:ee});s.current={...s.current,...P},o.current.set(C.id,"done"),N(),A++}catch(P){if(P instanceof F){if(t&&C.clearOnSkip){for(let Re of C.clearOnSkip)s.current[Re]=void 0;o.current.set(C.id,"skipped"),N(),A++;continue}if(t)continue;o.current.set(C.id,"pending");let V=A-1;for(;V>=0&&!y[V].isApplicable(s.current);)V--;V<0||(A=V,o.current.set(y[A].id,"pending")),N(),d();continue}throw P}}S("orchestrator:all sections done, calling onComplete + exit"),J(!0),h(null),u(null),d(),await new Promise(C=>setTimeout(C,200)),a(s.current),r()}catch(y){S("orchestrator:caught error",{name:y?.name,message:y?.message}),y instanceof W&&(r(),process.exit(0));let T=y instanceof Error?y.message:String(y);m(`Setup error: ${T}`),d()}})(),()=>{S("WizardApp:useEffect cleanup ran (component unmounting)")}},[r,a]),Aa((b,w)=>{S("WizardApp:useInput fired",{input:b,ctrl:w.ctrl,escape:w.escape,return:w.return}),w.ctrl&&b==="c"&&(S("WizardApp:Ctrl+C \u2192 exiting"),r(),process.exit(0))});let X=va(()=>O.map(b=>({id:b.id,title:b.title,status:o.current.get(b.id)??"pending"})),[i,v,p]);return z(I,{flexDirection:"column",paddingY:1,children:[z(I,{marginBottom:1,children:[f(E,{bold:!0,color:"cyan",children:"Klaudius setup"}),f(E,{dimColor:!0,children:" \xB7 "}),f(E,{dimColor:!0,children:M.total>0?`Step ${M.current} of ${M.total}`:"Loading\u2026"})]}),z(I,{children:[f(Ie,{items:X}),z(I,{flexDirection:"column",flexGrow:1,marginLeft:2,children:[n&&z(I,{marginBottom:1,borderStyle:"round",borderColor:"red",paddingX:1,flexDirection:"column",children:[f(E,{color:"red",bold:!0,children:"\u26A0 Heads up"}),f(E,{children:n})]}),!t&&i!==null&&i!=="ai-agent"&&f(I,{marginBottom:1,children:f(E,{color:"green",children:"Nothing here is permanent, you can customize any of this later."})}),g.map((b,w)=>f(I,{marginBottom:1,children:f(ce,{title:b.title,body:b.body})},w)),l?.spec.note&&f(I,{marginBottom:1,children:f(ce,{title:l.spec.note.title,body:l.spec.note.body})}),l&&Ia(l),p&&f(I,{marginTop:1,children:f(E,{color:"red",children:p})}),v&&f(I,{marginTop:1,children:f(E,{color:"green",bold:!0,children:"\u2713 Setup complete. Continuing\u2026"})})]})]}),f(I,{marginTop:1,children:f(E,{dimColor:!0,children:Pa(t,i)})})]})}function Pa(e,a){if(e){let t=O.find(n=>n.id===a);return t?.clearOnSkip&&t.clearOnSkip.length>0?"\u21B5 confirm esc skip this section ctrl-c cancel":"\u21B5 confirm ctrl-c cancel"}return"\u21B5 confirm esc back to previous section ctrl-c cancel"}function Ia(e){let a=n=>e.resolve(n),t=()=>e.reject(new F);switch(e.spec.type){case"text":case"password":return f(xe,{spec:e.spec,masked:e.spec.type==="password",onSubmit:a,onBack:t},e.id);case"select":return f(Ee,{spec:e.spec,onSubmit:a,onBack:t},e.id);case"multiselect":return f(Be,{spec:e.spec,onSubmit:a,onBack:t},e.id);case"confirm":return f(Me,{spec:e.spec,onSubmit:a,onBack:t},e.id)}}export{Cn as WizardApp};
404
+ you.`}});let g=await pe({botToken:o});if(g.ok&&g.chatId)d=g.chatId;else if(g.reason==="no_messages")l="No messages from you to your bot have been picked up yet.",u="no_messages";else if(g.reason==="network")l=g.message??"Could not reach Telegram.",u="network";else throw new Error(`Telegram chat ID auto-detect failed: ${g.message??"unknown error"}`)}return{notifyChannel:"telegram",notifyTo:void 0,telegramBotToken:o,telegramChatId:d}}},O=[_e,$e,je,qe,Ye,Ze,Je,Qe,Xe,ea,aa,na,ta,oa,sa,ia,la,ra,ua];import{Box as Ae,Text as ca}from"ink";import{jsx as Ie,jsxs as ha}from"react/jsx-runtime";var da={pending:"\u25CB",current:"\u25C9",done:"\u2713",skipped:"\xB7"},ga={pending:void 0,current:"cyan",done:"green",skipped:void 0};function Te({items:e}){return Ie(Ae,{flexDirection:"column",width:28,flexShrink:0,children:e.map(a=>{let t=a.status==="skipped"||a.status==="pending";return Ie(Ae,{children:ha(ca,{color:ga[a.status],bold:a.status==="current",dimColor:t&&a.status!=="current",children:[da[a.status]," ",a.title]})},a.id)})})}import{useEffect as pa,useState as xe}from"react";import{Box as ne,Text as _,useInput as ma}from"ink";import ya from"ink-text-input";import{jsx as U,jsxs as te}from"react/jsx-runtime";function Ee({spec:e,masked:a,onSubmit:t,onBack:n}){let r=typeof e.initialValue=="string"?e.initialValue:"",s=a&&r.length>0,[o,d]=xe(s?"":r),[c,l]=xe(null);pa(()=>(S("TextPromptUI:mount",{masked:a,message:e.message.slice(0,60),initial:typeof e.initialValue=="string"?e.initialValue.slice(0,30):null}),()=>{S("TextPromptUI:unmount")}),[a,e.message,e.initialValue]),ma((i,h)=>{S("TextPromptUI:useInput fired",{input:i,ctrl:h.ctrl,escape:h.escape,return:h.return}),h.escape&&n()});let u=i=>{S("TextPromptUI:handleSubmit",{raw:i.slice(0,30)});let h=i.length===0&&s?r:i;if(e.validate){let g=e.validate(h);if(g){S("TextPromptUI:validate failed",{err:g}),l(g);return}}l(null),t(h)};return te(ne,{flexDirection:"column",children:[te(_,{children:[U(_,{color:"cyan",children:"?"})," ",e.message]}),te(ne,{children:[U(_,{color:"green",children:"\u203A "}),U(ya,{value:o,onChange:d,onSubmit:u,placeholder:s?"type or paste a new value \u2014 or press Enter to keep the current one":e.placeholder,mask:a?"\u2022":void 0})]}),c&&U(ne,{marginTop:0,children:U(_,{color:"red",children:c})})]})}import{useState as fa}from"react";import{Box as oe,Text as $,useInput as ba}from"ink";import{jsx as j,jsxs as se}from"react/jsx-runtime";function Me({spec:e,onSubmit:a,onBack:t}){let n=e.options??[],r=typeof e.initialValue=="string"?Math.max(0,n.findIndex(d=>d.value===e.initialValue)):0,[s,o]=fa(r===-1?0:r);return ba((d,c)=>{if(c.escape)t();else if(c.upArrow)o(l=>(l-1+n.length)%n.length);else if(c.downArrow)o(l=>(l+1)%n.length);else if(c.return){let l=n[s];l&&a(l.value)}}),se(oe,{flexDirection:"column",children:[se($,{children:[j($,{color:"cyan",children:"?"})," ",e.message]}),j(oe,{flexDirection:"column",marginTop:0,children:n.map((d,c)=>{let l=c===s;return se($,{color:l?"cyan":void 0,bold:l,children:[l?"\u25CF ":"\u25CB ",d.label]},d.value)})}),j(oe,{marginTop:1,children:j($,{dimColor:!0,children:"Use the \u2191 \u2193 arrow keys to choose, then press Enter"})})]})}import{useState as wa}from"react";import{Box as ie,Text as L,useInput as Ca}from"ink";import{jsx as q,jsxs as D}from"react/jsx-runtime";function Ne({spec:e,onSubmit:a,onBack:t}){let[n,r]=wa(typeof e.initialValue=="boolean"?e.initialValue:!0);return Ca((s,o)=>{o.escape?t():o.leftArrow||o.rightArrow?r(d=>!d):s==="y"||s==="Y"?r(!0):s==="n"||s==="N"?r(!1):o.return&&a(n)}),D(ie,{flexDirection:"column",children:[D(L,{children:[q(L,{color:"cyan",children:"?"})," ",e.message]}),D(ie,{marginTop:0,children:[D(L,{color:n?"cyan":void 0,bold:n,children:[n?"\u25CF ":"\u25CB ","Yes"]}),q(L,{children:" "}),D(L,{color:n?void 0:"cyan",bold:!n,children:[n?"\u25CB ":"\u25CF ","No"]})]}),q(ie,{marginTop:1,children:q(L,{dimColor:!0,children:"Use the \u2190 \u2192 arrow keys (or y / n) to choose, then press Enter"})})]})}import{useState as Be}from"react";import{Box as le,Text as Y,useInput as Sa}from"ink";import{jsx as Z,jsxs as re}from"react/jsx-runtime";function Oe({spec:e,onSubmit:a,onBack:t}){let n=e.options??[],r=new Set(typeof e.initialValue=="string"?e.initialValue.split(",").map(l=>l.trim()).filter(Boolean):[]),[s,o]=Be(0),[d,c]=Be(r);return Sa((l,u)=>{if(u.escape)t();else if(u.upArrow)o(i=>(i-1+n.length)%n.length);else if(u.downArrow)o(i=>(i+1)%n.length);else if(l===" "){let i=n[s];i&&c(h=>{let g=new Set(h);return g.has(i.value)?g.delete(i.value):g.add(i.value),g})}else u.return&&a(n.map(i=>i.value).filter(i=>d.has(i)).join(","))}),re(le,{flexDirection:"column",children:[re(Y,{children:[Z(Y,{color:"cyan",children:"?"})," ",e.message]}),Z(le,{flexDirection:"column",marginTop:0,children:n.map((l,u)=>{let i=u===s,h=d.has(l.value);return re(Y,{color:i?"cyan":void 0,bold:i,children:[i?"\u203A ":" ",h?"\u25C9 ":"\u25EF ",l.label]},l.value)})}),Z(le,{marginTop:1,children:Z(Y,{dimColor:!0,children:"\u2191 \u2193 to move, Space to tick/untick, Enter to confirm (ticking none is fine)"})})]})}import{Box as Ke,Text as Re}from"ink";import{jsx as ue,jsxs as va}from"react/jsx-runtime";function ce({title:e,body:a}){let t=a.split(`
405
+ `);return va(Ke,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingX:1,children:[ue(Re,{color:"cyan",bold:!0,children:e}),ue(Ke,{flexDirection:"column",marginTop:0,children:t.map((n,r)=>ue(Re,{dimColor:!1,children:n.length===0?" ":n},r))})]})}import{jsx as f,jsxs as G}from"react/jsx-runtime";function kn({defaults:e,onComplete:a,onlySection:t,banner:n}){let{exit:r}=Aa(),s=de({...e}),o=de(new Map),[,d]=K(0),c=()=>d(b=>b+1),[l,u]=K(null),[i,h]=K(null),[g,k]=K([]),[p,m]=K(null),[v,J]=K(!1),[M,Q]=K({current:0,total:0}),N=()=>{let b=o.current;for(let w of O){let ee=w.isApplicable(s.current),y=b.get(w.id);ee?t&&w.id!==t?y!=="current"&&b.set(w.id,"done"):(y==="skipped"||!y)&&b.set(w.id,"pending"):b.set(w.id,"skipped")}};o.current.size===0&&N();let z=de(!1);ka(()=>{if(S("WizardApp:useEffect fired",{startedAlready:z.current}),z.current){S("WizardApp:useEffect returning early (startedRef true)");return}z.current=!0,S("WizardApp:orchestrator starting");let b=0,w=y=>{let T=++b;return S("orchestrator:promptFn called",{id:T,type:y.type,message:y.message.slice(0,60)}),m(null),new Promise((P,C)=>{h({id:T,spec:y,resolve:x=>{S("orchestrator:prompt resolved",{id:T,type:y.type,value:typeof x=="string"?x.slice(0,30):x}),P(x)},reject:x=>{S("orchestrator:prompt rejected",{id:T,reason:x.message}),C(x)}})})},ee=y=>{k(T=>[...T,y])};return(async()=>{try{let y=t?O.filter(C=>C.id===t):O,T=()=>y.filter(C=>C.isApplicable(s.current)).length,P=0;for(;P<y.length;){let C=y[P];if(!C.isApplicable(s.current)){o.current.set(C.id,"skipped"),P++,N(),c();continue}k([]);for(let A of O)A.id===C.id?o.current.set(A.id,"current"):o.current.get(A.id)==="current"&&o.current.set(A.id,"pending");u(C.id);let x=y.slice(0,P+1).filter(A=>A.isApplicable(s.current)).length;Q({current:x,total:T()}),c();try{let A=await C.execute(s.current,{prompt:w,info:ee});s.current={...s.current,...A},o.current.set(C.id,"done"),N(),P++}catch(A){if(A instanceof F){if(t&&C.clearOnSkip){for(let Le of C.clearOnSkip)s.current[Le]=void 0;o.current.set(C.id,"skipped"),N(),P++;continue}if(t)continue;o.current.set(C.id,"pending");let V=P-1;for(;V>=0&&!y[V].isApplicable(s.current);)V--;V<0||(P=V,o.current.set(y[P].id,"pending")),N(),c();continue}throw A}}S("orchestrator:all sections done, calling onComplete + exit"),J(!0),h(null),u(null),c(),await new Promise(C=>setTimeout(C,200)),a(s.current),r()}catch(y){S("orchestrator:caught error",{name:y?.name,message:y?.message}),y instanceof W&&(r(),process.exit(0));let T=y instanceof Error?y.message:String(y);m(`Setup error: ${T}`),c()}})(),()=>{S("WizardApp:useEffect cleanup ran (component unmounting)")}},[r,a]),Ia((b,w)=>{S("WizardApp:useInput fired",{input:b,ctrl:w.ctrl,escape:w.escape,return:w.return}),w.ctrl&&b==="c"&&(S("WizardApp:Ctrl+C \u2192 exiting"),r(),process.exit(0))});let X=Pa(()=>O.map(b=>({id:b.id,title:b.title,status:o.current.get(b.id)??"pending"})),[l,v,p]);return G(I,{flexDirection:"column",paddingY:1,children:[G(I,{marginBottom:1,children:[f(E,{bold:!0,color:"cyan",children:"Klaudius setup"}),f(E,{dimColor:!0,children:" \xB7 "}),f(E,{dimColor:!0,children:M.total>0?`Step ${M.current} of ${M.total}`:"Loading\u2026"})]}),G(I,{children:[f(Te,{items:X}),G(I,{flexDirection:"column",flexGrow:1,marginLeft:2,children:[n&&G(I,{marginBottom:1,borderStyle:"round",borderColor:"red",paddingX:1,flexDirection:"column",children:[f(E,{color:"red",bold:!0,children:"\u26A0 Heads up"}),f(E,{children:n})]}),!t&&l!==null&&l!=="ai-agent"&&f(I,{marginBottom:1,children:f(E,{color:"green",children:"Nothing here is permanent, you can customize any of this later."})}),g.map((b,w)=>f(I,{marginBottom:1,children:f(ce,{title:b.title,body:b.body})},w)),i?.spec.note&&f(I,{marginBottom:1,children:f(ce,{title:i.spec.note.title,body:i.spec.note.body})}),i&&xa(i),p&&f(I,{marginTop:1,children:f(E,{color:"red",children:p})}),v&&f(I,{marginTop:1,children:f(E,{color:"green",bold:!0,children:"\u2713 Setup complete. Continuing\u2026"})})]})]}),f(I,{marginTop:1,children:f(E,{dimColor:!0,children:Ta(t,l)})})]})}function Ta(e,a){if(e){let t=O.find(n=>n.id===a);return t?.clearOnSkip&&t.clearOnSkip.length>0?"\u21B5 confirm esc skip this section ctrl-c cancel":"\u21B5 confirm ctrl-c cancel"}return"\u21B5 confirm esc back to previous section ctrl-c cancel"}function xa(e){let a=n=>e.resolve(n),t=()=>e.reject(new F);switch(e.spec.type){case"text":case"password":return f(Ee,{spec:e.spec,masked:e.spec.type==="password",onSubmit:a,onBack:t},e.id);case"select":return f(Me,{spec:e.spec,onSubmit:a,onBack:t},e.id);case"multiselect":return f(Oe,{spec:e.spec,onSubmit:a,onBack:t},e.id);case"confirm":return f(Ne,{spec:e.spec,onSubmit:a,onBack:t},e.id)}}export{kn as WizardApp};