klaudius 0.24.3 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WizardApp-YTYZG4A5.js +2 -0
- package/dist/bin.js +51 -47
- package/dist/chunk-ABFQ7C7Q.js +505 -0
- package/package.json +1 -1
- package/dist/WizardApp-HWWSHTCK.js +0 -396
- package/dist/chunk-R2LC3ZRY.js +0 -61
package/dist/chunk-R2LC3ZRY.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import{appendFileSync as m}from"fs";import{tmpdir as y}from"os";import{join as k}from"path";var p=k(y(),"klaudius-wizard-debug.log"),w=process.env.KLAUDIUS_WIZARD_DEBUG==="1",h=!1;function T(t,e){if(w)try{h||(h=!0,m(p,`
|
|
2
|
-
=== klaudius wizard debug session \u2014 ${new Date().toISOString()} ===
|
|
3
|
-
node ${process.version}, platform ${process.platform}, tty=${process.stdin.isTTY}
|
|
4
|
-
`));let o=`${Date.now()} `,s=e===void 0?"":" "+JSON.stringify(e,null,0).slice(0,400);m(p,o+t+s+`
|
|
5
|
-
`)}catch{}}var C=p,g=!1;function N(){if(g)return;g=!0;let t=process.exit.bind(process);process.exit=(e=>{let o=new Error("process.exit called").stack??"(no stack)";return T("process.exit called",{code:e,stack:o.split(`
|
|
6
|
-
`).slice(0,8).join(" | ")}),t(e)})}function R(t){if(!t)return;let e=t.toLowerCase();for(let[o,s]of Object.entries(u))if(s.smtpHost===e||s.altHostSets?.some(a=>a.smtpHost===e))return o}function _(t,e,o){if(t==="custom")return[];if(!Object.hasOwn(u,t))return[];let s=u[t];return[{label:`standard ${s.label}`,smtpHost:s.smtpHost,imapHost:s.imapHost},...s.altHostSets??[]].filter(n=>!(n.smtpHost===e&&n.imapHost===o))}var u={gmail:{label:"Gmail",smtpHost:"smtp.gmail.com",smtpPort:587,imapHost:"imap.gmail.com",imapPort:993,sentFolder:"[Gmail]/Sent Mail",inboxFolder:"INBOX",appPasswordHelp:`Generate at https://myaccount.google.com/apppasswords
|
|
7
|
-
(2-step verification must be enabled on your Google account first;
|
|
8
|
-
Google won't accept your normal account password from third-party apps).`},outlook:{label:"Outlook / Microsoft 365",smtpHost:"smtp-mail.outlook.com",smtpPort:587,imapHost:"outlook.office365.com",imapPort:993,sentFolder:"Sent Items",inboxFolder:"INBOX",oauthOnly:!0,appPasswordHelp:`Outlook / Microsoft 365 mailboxes don't use passwords with Klaudius \u2014
|
|
9
|
-
Microsoft retired app-password access. Connect with the one-time
|
|
10
|
-
browser sign-in instead: python3 scripts/ms_oauth.py login`},ionos:{label:"IONOS",smtpHost:"smtp.ionos.co.uk",smtpPort:587,imapHost:"imap.ionos.co.uk",imapPort:993,sentFolder:"Sent Items",inboxFolder:"INBOX",usesAccountPassword:!0,appPasswordHelp:`Use your normal IONOS mailbox password.
|
|
11
|
-
(IONOS doesn't require app passwords for IMAP/SMTP unless you've enabled 2FA \u2014
|
|
12
|
-
with 2FA on, generate an app password in IONOS account security settings and
|
|
13
|
-
use that here instead.)`,serverHelp:`IONOS runs country-specific mail servers. The standard servers here
|
|
14
|
-
are for IONOS UK (smtp.ionos.co.uk). If you signed up with IONOS in
|
|
15
|
-
another country, your servers use that country's domain instead \u2014
|
|
16
|
-
e.g. smtp.ionos.de (Germany) or smtp.ionos.com (US/international).
|
|
17
|
-
Not sure? Pick the standard servers \u2014 if they reject your login,
|
|
18
|
-
setup automatically tries the other regions for you.`,altHostSets:[{label:"IONOS Germany",smtpHost:"smtp.ionos.de",imapHost:"imap.ionos.de"},{label:"IONOS US / international",smtpHost:"smtp.ionos.com",imapHost:"imap.ionos.com"}],noAltWorkedHint:`None of IONOS's regional servers (.co.uk / .de / .com) accepted this login,
|
|
19
|
-
so the server isn't the problem \u2014 the mailbox password itself is likely
|
|
20
|
-
wrong (or 2FA is on, which means you need an app password instead).`},fastmail:{label:"Fastmail",smtpHost:"smtp.fastmail.com",smtpPort:587,imapHost:"imap.fastmail.com",imapPort:993,sentFolder:"Sent",inboxFolder:"INBOX",appPasswordHelp:`Generate at https://app.fastmail.com/settings/security/integrations
|
|
21
|
-
(Fastmail requires app passwords for IMAP/SMTP regardless of 2FA setting.)`},zoho:{label:"Zoho Mail",smtpHost:"smtp.zoho.com",smtpPort:587,imapHost:"imap.zoho.com",imapPort:993,sentFolder:"Sent",inboxFolder:"INBOX",appPasswordHelp:`Generate at https://accounts.zoho.com/u/h#security/app_passwords
|
|
22
|
-
(Zoho requires app passwords for IMAP/SMTP \u2014 your normal account password won't work.)
|
|
23
|
-
|
|
24
|
-
Heads up: Zoho's FREE plan doesn't include IMAP/SMTP access for new
|
|
25
|
-
accounts \u2014 no password will work until you're on a paid plan (Mail
|
|
26
|
-
Lite is ~$1/month).`,serverHelp:`Zoho runs different mail servers depending on your account:
|
|
27
|
-
\u2022 WHERE you signed up \u2014 log in at zoho.com \u2192 .com servers,
|
|
28
|
-
zoho.eu (Europe) \u2192 .eu servers, zoho.in (India) \u2192 .in servers
|
|
29
|
-
\u2022 WHAT you pay for \u2014 paid accounts on your own domain use the
|
|
30
|
-
'pro' servers (smtppro.zoho.eu), personal/free use plain (smtp.zoho.eu)
|
|
31
|
-
Not sure? Pick the standard servers \u2014 if they reject your login,
|
|
32
|
-
setup automatically tries the other combinations for you.`,altHostSets:[{label:"Zoho Europe (personal)",smtpHost:"smtp.zoho.eu",imapHost:"imap.zoho.eu"},{label:"Zoho US (paid, own domain)",smtpHost:"smtppro.zoho.com",imapHost:"imappro.zoho.com"},{label:"Zoho Europe (paid, own domain)",smtpHost:"smtppro.zoho.eu",imapHost:"imappro.zoho.eu"},{label:"Zoho India (personal)",smtpHost:"smtp.zoho.in",imapHost:"imap.zoho.in"},{label:"Zoho India (paid, own domain)",smtpHost:"smtppro.zoho.in",imapHost:"imappro.zoho.in"}],noAltWorkedHint:`None of Zoho's servers (US / Europe / India, personal + paid) accepted this
|
|
33
|
-
login, so the server isn't the problem. Two likely causes:
|
|
34
|
-
\u2022 The app password itself is wrong \u2014 generate a fresh one at
|
|
35
|
-
https://accounts.zoho.com/u/h#security/app_passwords
|
|
36
|
-
\u2022 Your Zoho account is on the FREE plan, which doesn't include
|
|
37
|
-
IMAP/SMTP access \u2014 upgrading to Mail Lite (~$1/month) unlocks it.`},titan:{label:"Titan",smtpHost:"smtp.titan.email",smtpPort:465,imapHost:"imap.titan.email",imapPort:993,sentFolder:"Sent",inboxFolder:"INBOX",usesAccountPassword:!0,appPasswordHelp:`Use your normal Titan mailbox password \u2014 the one you use for Titan
|
|
38
|
-
webmail. Titan has NO app-password mechanism, so don't go hunting
|
|
39
|
-
for one. Two settings must be right first, or the login is rejected
|
|
40
|
-
with what looks like a password error:
|
|
41
|
-
\u2022 Titan webmail \u2192 Settings \u2192 "Enable Titan on Other Apps" must be
|
|
42
|
-
turned ON (it's off by default).
|
|
43
|
-
\u2022 Two-Factor Authentication must be turned OFF \u2014 Titan blocks all
|
|
44
|
-
third-party access while 2FA is enabled.`,serverHelp:`Titan runs two sets of mail servers depending on which region your
|
|
45
|
-
mailbox is hosted in. The standard servers here (smtp.titan.email)
|
|
46
|
-
cover most accounts, but EU-hosted mailboxes (common when the
|
|
47
|
-
registrar is European, e.g. 123 Reg) use smtp0101.titan.email
|
|
48
|
-
instead. The "Enable Titan on Other Apps" screen in Titan webmail
|
|
49
|
-
shows your account's exact servers.
|
|
50
|
-
Not sure? Pick the standard servers \u2014 if they reject your login,
|
|
51
|
-
setup automatically tries the EU servers for you.`,altHostSets:[{label:"Titan EU-hosted",smtpHost:"smtp0101.titan.email",imapHost:"imap0101.titan.email"}],noAltWorkedHint:`Neither of Titan's server sets (standard / EU-hosted) accepted this
|
|
52
|
-
login, so the server isn't the problem. In Titan webmail, check:
|
|
53
|
-
\u2022 Settings \u2192 "Enable Titan on Other Apps" is turned ON
|
|
54
|
-
\u2022 Two-Factor Authentication is turned OFF (Titan blocks third-party
|
|
55
|
-
access entirely while 2FA is on)
|
|
56
|
-
\u2022 The password is your normal Titan mailbox password (there are no
|
|
57
|
-
app passwords on Titan).`}},U=`Check your provider's security settings for what SMTP/IMAP expects:
|
|
58
|
-
many providers require a generated app-specific password, while some
|
|
59
|
-
(e.g. IONOS, Titan) just use your normal mailbox password. If your
|
|
60
|
-
provider offers app passwords, prefer one \u2014 it's revocable on its own
|
|
61
|
-
and doesn't expose your account login.`;function l(t){if(!(t instanceof Error))return String(t);let e=t.cause;if(!e||!(e instanceof Error))return t.message;let o=e.code,s=e.message;return o&&s&&s!==o?`${t.message} (${o}: ${s})`:o?`${t.message} (${o})`:s?`${t.message} (${s})`:t.message}async function j(t){let e;try{let n=await fetch(`https://api.telegram.org/bot${encodeURIComponent(t.botToken)}/getUpdates`);if(e=await n.json(),!e.ok){let r=e.description??`HTTP ${n.status}`;return/webhook/i.test(r)?{ok:!1,reason:"webhook_set",message:"This bot has a webhook set, so getUpdates is unavailable. Auto-detect can't run; you'll need to paste the chat ID manually."}:{ok:!1,reason:"bad_token",message:`Telegram rejected the bot token: ${r}. Double-check the token from @BotFather.`}}}catch(n){return{ok:!1,reason:"network",message:`Could not reach Telegram: ${l(n)}`}}let o=e.result??[];if(o.length===0)return{ok:!1,reason:"no_messages",message:"No messages yet. Send your bot a regular text message in Telegram, then retry."};let s=o[o.length-1],a=s?.message?.chat?.id??s?.edited_message?.chat?.id??s?.channel_post?.chat?.id;return a===void 0?{ok:!1,reason:"no_messages",message:"Got an update from Telegram but couldn't find a chat ID in it. Send another text message and retry."}:{ok:!0,chatId:String(a)}}async function H(t){try{let e=await fetch(`https://api.telegram.org/bot${encodeURIComponent(t.botToken)}/getMe`),o=await e.json();return o.ok?{ok:!0,botHandle:o.result?.username?`@${o.result.username}`:o.result?.first_name}:{ok:!1,failedAt:"token",message:`Telegram rejected the bot token: ${o.description??`HTTP ${e.status}`}. Generate a new token by messaging @BotFather \u2192 /mytoken or /newbot.`}}catch(e){return{ok:!1,failedAt:"token",message:`Could not reach Telegram: ${l(e)}`}}}async function B(t){let e=await H({botToken:t.botToken});if(!e.ok)return e;let o=e.botHandle;try{let s=await fetch(`https://api.telegram.org/bot${encodeURIComponent(t.botToken)}/sendMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({chat_id:t.chatId,text:"\u2713 Klaudius connected. You'll get a notification here whenever outreach lands or a candidate replies. (You can ignore this setup message.)",disable_notification:!0})}),a=await s.json();if(!a.ok){let n=a.description??`HTTP ${s.status}`,r="";return/chat not found/i.test(n)?r=" The chat_id is wrong, or the bot hasn't been added to that chat yet. If it's a group, you must add the bot to the group first; then send /start to it.":(/bot was blocked/i.test(n)||/forbidden/i.test(n))&&(r=" The bot has been blocked by the chat, or never received a /start. Open Telegram, find your bot, and send /start to wake it up."),{ok:!1,failedAt:"chat",botHandle:o,message:`Telegram delivered the bot token check but couldn't send to chat_id ${t.chatId}: ${n}.${r}`}}}catch(s){return{ok:!1,failedAt:"chat",botHandle:o,message:`Could not reach Telegram for chat_id check: ${l(s)}`}}return{ok:!0,botHandle:o}}function Z(t){let e=t.trim();if(e.length===0)return"Required \u2014 without this Klaudius can't deploy generated sites";if(e.startsWith("http://")||e.startsWith("https://"))return"This is the SSH/rsync destination, not a URL \u2014 e.g. deploy@yourvps:/var/www/klaudius-sites";if(/^[A-Za-z]:[\\/]/.test(e))return"That's a local Windows path \u2014 the target must be a remote rsync destination like user@host:/path";if(!/^[^\s:]+:\/?.+/.test(e))return"Should look like user@host:/path (an rsync-over-SSH destination)"}function K(t){let e=t.trim();if(e.length===0)return"Required \u2014 outreach links every pitch to the live site URL";if(!/^https?:\/\//.test(e))return"Must start with https:// (or http://)";if(!e.includes("{slug}"))return"Must contain {slug} \u2014 it's replaced with each client's slug";if(!(e.replace(/^https?:\/\//,"").split("/")[0]??"").includes("{slug}"))return"{slug} must be in the hostname (e.g. https://{slug}.sites.example.com) \u2014 a path like /sites/{slug} breaks static-export asset links"}var S={\u0410:"A",\u0430:"a",\u0412:"B",\u0432:"b",\u0415:"E",\u0435:"e",\u041A:"K",\u043A:"k",\u041C:"M",\u043C:"m",\u041D:"H",\u043D:"h",\u041E:"O",\u043E:"o",\u0420:"P",\u0440:"p",\u0421:"C",\u0441:"c",\u0422:"T",\u0442:"t",\u0423:"Y",\u0443:"y",\u0425:"X",\u0445:"x",\u0406:"I",\u0456:"i",\u0405:"S",\u0455:"s",\u0408:"J",\u0458:"j",\u0417:"3",\u0437:"3",\u0427:"4",\u0431:"6",\u0391:"A",\u03B1:"a",\u0392:"B",\u03B2:"b",\u0395:"E",\u03B5:"e",\u0396:"Z",\u0397:"H",\u0399:"I",\u03B9:"i",\u039A:"K",\u03BA:"k",\u039C:"M",\u039D:"N",\u039F:"O",\u03BF:"o",\u03A1:"P",\u03C1:"p",\u03A4:"T",\u03C4:"t",\u03A5:"Y",\u03A7:"X",\u03C7:"x",\u03BD:"v","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\u2014":"-","\u2015":"-","\u2212":"-","\uFF3F":"_"},I=/[\u200B-\u200F\u202A-\u202E\u2060\uFEFF\u00AD]/g,P=/[\u0000-\u001F\u007F]/g;function v(t){let e=t.replace(I,"").replace(P,"").trim();return{value:e,changed:e!==t,repairs:[],unrepairable:[]}}function f(t){let o=v(t).value.normalize("NFKC").replace(/\s+/g,"");o.length>=2&&(o[0]==='"'&&o.at(-1)==='"'||o[0]==="'"&&o.at(-1)==="'")&&(o=o.slice(1,-1).trim());let s=[],a=[],n="";for(let r of o){let i=r.codePointAt(0);if(i<128){n+=r;continue}let c=S[r],d=n.length+1;c?(s.push(`position ${d}: '${r}' (${O(i)}, U+${b(i)}) \u2192 '${c}'`),n+=c):(a.push({position:d,char:r,code:i}),n+=r)}return{value:n,changed:n!==t,repairs:s,unrepairable:a}}var x=/^AIza[0-9A-Za-z_-]{35}$/;function A(t){return x.test(t)}function X(t){let e=f(t);if(e.value.length===0)return"Required \u2014 without this Klaudius can't find candidates.";if(e.unrepairable.length>0){let o=e.unrepairable[0];return`Character ${o.position} of this key is '${o.char}' (U+${b(o.code)}), which isn't a character a Google key can contain. Copy the key with the copy button next to it in the Cloud Console \u2014 reading it off a screenshot or retyping it introduces look-alike characters.`}}function q(t){let e=f(t).value;if(!A(e))return e.startsWith("AIza")?e.length!==39?`A Google API key is normally 39 characters \u2014 this one is ${e.length}. `+(e.length>39?"It looks like two keys ran together, so paste just the one key.":"It looks truncated, so copy it again with the copy button next to it in the Cloud Console."):"This key contains characters a Google key normally doesn't. Re-copy it with the copy button in the Cloud Console.":`A Google API key normally starts with "AIza" \u2014 this one starts with "${e.slice(0,4)}". Check you copied the API key itself (Cloud Console \u2192 Credentials), not a project ID or client ID.`}function b(t){return t.toString(16).toUpperCase().padStart(4,"0")}function O(t){return t>=1024&&t<=1279?"Cyrillic":t>=880&&t<=1023?"Greek":"non-Latin"}export{T as a,C as b,N as c,R as d,_ as e,u as f,U as g,l as h,j as i,H as j,B as k,Z as l,K as m,v as n,f as o,X as p,q};
|