push neon reactor

This commit is contained in:
2026-07-12 15:11:38 +02:00
parent 172e72dbcd
commit aeab5f7820
9597 changed files with 2407488 additions and 0 deletions
+80
View File
@@ -0,0 +1,80 @@
"use strict";const core=require("@clack/core"),process$1=require("node:process"),color=require("picocolors"),sisteransi=require("sisteransi");function isUnicodeSupported(){return process$1.platform!=="win32"?process$1.env.TERM!=="linux":Boolean(process$1.env.CI)||Boolean(process$1.env.WT_SESSION)||Boolean(process$1.env.TERMINUS_SUBLIME)||process$1.env.ConEmuTask==="{cmd::Cmder}"||process$1.env.TERM_PROGRAM==="Terminus-Sublime"||process$1.env.TERM_PROGRAM==="vscode"||process$1.env.TERM==="xterm-256color"||process$1.env.TERM==="alacritty"||process$1.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const unicode=isUnicodeSupported(),s=(t,n)=>unicode?t:n,S_STEP_ACTIVE=s("\u25C6","*"),S_STEP_CANCEL=s("\u25A0","x"),S_STEP_ERROR=s("\u25B2","x"),S_STEP_SUBMIT=s("\u25C7","o"),S_BAR_START=s("\u250C","T"),S_BAR=s("\u2502","|"),S_BAR_END=s("\u2514","\u2014"),S_RADIO_ACTIVE=s("\u25CF",">"),S_RADIO_INACTIVE=s("\u25CB"," "),S_CHECKBOX_ACTIVE=s("\u25FB","[\u2022]"),S_CHECKBOX_SELECTED=s("\u25FC","[+]"),S_CHECKBOX_INACTIVE=s("\u25FB","[ ]"),S_PASSWORD_MASK=s("\u25AA","\u2022"),S_BAR_H=s("\u2500","-"),S_CORNER_TOP_RIGHT=s("\u256E","+"),S_CONNECT_LEFT=s("\u251C","+"),S_CORNER_BOTTOM_RIGHT=s("\u256F","+"),S_INFO=s("\u25CF","\u2022"),S_SUCCESS=s("\u25C6","*"),S_WARN=s("\u25B2","!"),S_ERROR=s("\u25A0","x"),symbol=t=>{switch(t){case"initial":case"active":return color.cyan(S_STEP_ACTIVE);case"cancel":return color.red(S_STEP_CANCEL);case"error":return color.yellow(S_STEP_ERROR);case"submit":return color.green(S_STEP_SUBMIT)}},text=t=>new core.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`,r=t.placeholder?color.inverse(t.placeholder[0])+color.dim(t.placeholder.slice(1)):color.inverse(color.hidden("_")),e=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${n.trim()}
${color.yellow(S_BAR)} ${e}
${color.yellow(S_BAR_END)} ${color.yellow(this.error)}
`;case"submit":return`${n}${color.gray(S_BAR)} ${color.dim(this.value||t.placeholder)}`;case"cancel":return`${n}${color.gray(S_BAR)} ${color.strikethrough(color.dim(this.value??""))}${this.value?.trim()?`
`+color.gray(S_BAR):""}`;default:return`${n}${color.cyan(S_BAR)} ${e}
${color.cyan(S_BAR_END)}
`}}}).prompt(),password=t=>new core.PasswordPrompt({validate:t.validate,mask:t.mask??S_PASSWORD_MASK,render(){const n=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`,r=this.valueWithCursor,e=this.masked;switch(this.state){case"error":return`${n.trim()}
${color.yellow(S_BAR)} ${e}
${color.yellow(S_BAR_END)} ${color.yellow(this.error)}
`;case"submit":return`${n}${color.gray(S_BAR)} ${color.dim(e)}`;case"cancel":return`${n}${color.gray(S_BAR)} ${color.strikethrough(color.dim(e??""))}${e?`
`+color.gray(S_BAR):""}`;default:return`${n}${color.cyan(S_BAR)} ${r}
${color.cyan(S_BAR_END)}
`}}}).prompt(),confirm=t=>{const n=t.active??"Yes",r=t.inactive??"No";return new core.ConfirmPrompt({active:n,inactive:r,initialValue:t.initialValue??!0,render(){const e=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`,i=this.value?n:r;switch(this.state){case"submit":return`${e}${color.gray(S_BAR)} ${color.dim(i)}`;case"cancel":return`${e}${color.gray(S_BAR)} ${color.strikethrough(color.dim(i))}
${color.gray(S_BAR)}`;default:return`${e}${color.cyan(S_BAR)} ${this.value?`${color.green(S_RADIO_ACTIVE)} ${n}`:`${color.dim(S_RADIO_INACTIVE)} ${color.dim(n)}`} ${color.dim("/")} ${this.value?`${color.dim(S_RADIO_INACTIVE)} ${color.dim(r)}`:`${color.green(S_RADIO_ACTIVE)} ${r}`}
${color.cyan(S_BAR_END)}
`}}}).prompt()},select=t=>{const n=(r,e)=>{const i=r.label??String(r.value);return e==="active"?`${color.green(S_RADIO_ACTIVE)} ${i} ${r.hint?color.dim(`(${r.hint})`):""}`:e==="selected"?`${color.dim(i)}`:e==="cancelled"?`${color.strikethrough(color.dim(i))}`:`${color.dim(S_RADIO_INACTIVE)} ${color.dim(i)}`};return new core.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){const r=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${r}${color.gray(S_BAR)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${color.gray(S_BAR)} ${n(this.options[this.cursor],"cancelled")}
${color.gray(S_BAR)}`;default:return`${r}${color.cyan(S_BAR)} ${this.options.map((e,i)=>n(e,i===this.cursor?"active":"inactive")).join(`
${color.cyan(S_BAR)} `)}
${color.cyan(S_BAR_END)}
`}}}).prompt()},selectKey=t=>{const n=(r,e="inactive")=>{const i=r.label??String(r.value);return e==="selected"?`${color.dim(i)}`:e==="cancelled"?`${color.strikethrough(color.dim(i))}`:e==="active"?`${color.bgCyan(color.gray(` ${r.value} `))} ${i} ${r.hint?color.dim(`(${r.hint})`):""}`:`${color.gray(color.bgWhite(color.inverse(` ${r.value} `)))} ${i} ${r.hint?color.dim(`(${r.hint})`):""}`};return new core.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){const r=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${r}${color.gray(S_BAR)} ${n(this.options.find(e=>e.value===this.value),"selected")}`;case"cancel":return`${r}${color.gray(S_BAR)} ${n(this.options[0],"cancelled")}
${color.gray(S_BAR)}`;default:return`${r}${color.cyan(S_BAR)} ${this.options.map((e,i)=>n(e,i===this.cursor?"active":"inactive")).join(`
${color.cyan(S_BAR)} `)}
${color.cyan(S_BAR_END)}
`}}}).prompt()},multiselect=t=>{const n=(r,e)=>{const i=r.label??String(r.value);return e==="active"?`${color.cyan(S_CHECKBOX_ACTIVE)} ${i} ${r.hint?color.dim(`(${r.hint})`):""}`:e==="selected"?`${color.green(S_CHECKBOX_SELECTED)} ${color.dim(i)}`:e==="cancelled"?`${color.strikethrough(color.dim(i))}`:e==="active-selected"?`${color.green(S_CHECKBOX_SELECTED)} ${i} ${r.hint?color.dim(`(${r.hint})`):""}`:e==="submitted"?`${color.dim(i)}`:`${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(i)}`};return new core.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
${color.reset(color.dim(`Press ${color.gray(color.bgWhite(color.inverse(" space ")))} to select, ${color.gray(color.bgWhite(color.inverse(" enter ")))} to submit`))}`},render(){let r=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${r}${color.gray(S_BAR)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>n(e,"submitted")).join(color.dim(", "))||color.dim("none")}`;case"cancel":{const e=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>n(i,"cancelled")).join(color.dim(", "));return`${r}${color.gray(S_BAR)} ${e.trim()?`${e}
${color.gray(S_BAR)}`:""}`}case"error":{const e=this.error.split(`
`).map((i,c)=>c===0?`${color.yellow(S_BAR_END)} ${color.yellow(i)}`:` ${i}`).join(`
`);return r+color.yellow(S_BAR)+" "+this.options.map((i,c)=>{const a=this.value.includes(i.value),l=c===this.cursor;return l&&a?n(i,"active-selected"):a?n(i,"selected"):n(i,l?"active":"inactive")}).join(`
${color.yellow(S_BAR)} `)+`
`+e+`
`}default:return`${r}${color.cyan(S_BAR)} ${this.options.map((e,i)=>{const c=this.value.includes(e.value),a=i===this.cursor;return a&&c?n(e,"active-selected"):c?n(e,"selected"):n(e,a?"active":"inactive")}).join(`
${color.cyan(S_BAR)} `)}
${color.cyan(S_BAR_END)}
`}}}).prompt()},groupMultiselect=t=>{const n=(r,e,i=[])=>{const c=r.label??String(r.value),a=typeof r.group=="string",l=a&&(i[i.indexOf(r)+1]??{group:!0}),o=a&&l.group===!0,u=a?`${o?S_BAR_END:S_BAR} `:"";return e==="active"?`${color.dim(u)}${color.cyan(S_CHECKBOX_ACTIVE)} ${c} ${r.hint?color.dim(`(${r.hint})`):""}`:e==="group-active"?`${u}${color.cyan(S_CHECKBOX_ACTIVE)} ${color.dim(c)}`:e==="group-active-selected"?`${u}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(c)}`:e==="selected"?`${color.dim(u)}${color.green(S_CHECKBOX_SELECTED)} ${color.dim(c)}`:e==="cancelled"?`${color.strikethrough(color.dim(c))}`:e==="active-selected"?`${color.dim(u)}${color.green(S_CHECKBOX_SELECTED)} ${c} ${r.hint?color.dim(`(${r.hint})`):""}`:e==="submitted"?`${color.dim(c)}`:`${color.dim(u)}${color.dim(S_CHECKBOX_INACTIVE)} ${color.dim(c)}`};return new core.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
${color.reset(color.dim(`Press ${color.gray(color.bgWhite(color.inverse(" space ")))} to select, ${color.gray(color.bgWhite(color.inverse(" enter ")))} to submit`))}`},render(){let r=`${color.gray(S_BAR)}
${symbol(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${r}${color.gray(S_BAR)} ${this.options.filter(({value:e})=>this.value.includes(e)).map(e=>n(e,"submitted")).join(color.dim(", "))}`;case"cancel":{const e=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>n(i,"cancelled")).join(color.dim(", "));return`${r}${color.gray(S_BAR)} ${e.trim()?`${e}
${color.gray(S_BAR)}`:""}`}case"error":{const e=this.error.split(`
`).map((i,c)=>c===0?`${color.yellow(S_BAR_END)} ${color.yellow(i)}`:` ${i}`).join(`
`);return`${r}${color.yellow(S_BAR)} ${this.options.map((i,c,a)=>{const l=this.value.includes(i.value)||i.group===!0&&this.isGroupSelected(`${i.value}`),o=c===this.cursor;return!o&&typeof i.group=="string"&&this.options[this.cursor].value===i.group?n(i,l?"group-active-selected":"group-active",a):o&&l?n(i,"active-selected",a):l?n(i,"selected",a):n(i,o?"active":"inactive",a)}).join(`
${color.yellow(S_BAR)} `)}
${e}
`}default:return`${r}${color.cyan(S_BAR)} ${this.options.map((e,i,c)=>{const a=this.value.includes(e.value)||e.group===!0&&this.isGroupSelected(`${e.value}`),l=i===this.cursor;return!l&&typeof e.group=="string"&&this.options[this.cursor].value===e.group?n(e,a?"group-active-selected":"group-active",c):l&&a?n(e,"active-selected",c):a?n(e,"selected",c):n(e,l?"active":"inactive",c)}).join(`
${color.cyan(S_BAR)} `)}
${color.cyan(S_BAR_END)}
`}}}).prompt()},strip=t=>t.replace(ansiRegex(),""),note=(t="",n="")=>{const r=`
${t}
`.split(`
`),e=Math.max(r.reduce((c,a)=>(a=strip(a),a.length>c?a.length:c),0),strip(n).length)+2,i=r.map(c=>`${color.gray(S_BAR)} ${color.dim(c)}${" ".repeat(e-strip(c).length)}${color.gray(S_BAR)}`).join(`
`);process.stdout.write(`${color.gray(S_BAR)}
${color.green(S_STEP_SUBMIT)} ${color.reset(n)} ${color.gray(S_BAR_H.repeat(Math.max(e-n.length-1,1))+S_CORNER_TOP_RIGHT)}
${i}
${color.gray(S_CONNECT_LEFT+S_BAR_H.repeat(e+2)+S_CORNER_BOTTOM_RIGHT)}
`)},cancel=(t="")=>{process.stdout.write(`${color.gray(S_BAR_END)} ${color.red(t)}
`)},intro=(t="")=>{process.stdout.write(`${color.gray(S_BAR_START)} ${t}
`)},outro=(t="")=>{process.stdout.write(`${color.gray(S_BAR)}
${color.gray(S_BAR_END)} ${t}
`)},log={message:(t="",{symbol:n=color.gray(S_BAR)}={})=>{const r=[`${color.gray(S_BAR)}`];if(t){const[e,...i]=t.split(`
`);r.push(`${n} ${e}`,...i.map(c=>`${color.gray(S_BAR)} ${c}`))}process.stdout.write(`${r.join(`
`)}
`)},info:t=>{log.message(t,{symbol:color.blue(S_INFO)})},success:t=>{log.message(t,{symbol:color.green(S_SUCCESS)})},step:t=>{log.message(t,{symbol:color.green(S_STEP_SUBMIT)})},warn:t=>{log.message(t,{symbol:color.yellow(S_WARN)})},warning:t=>{log.warn(t)},error:t=>{log.message(t,{symbol:color.red(S_ERROR)})}},frames=unicode?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],spinner=()=>{let t,n;const r=unicode?80:120;return{start(e=""){e=e.replace(/\.?\.?\.$/,""),t=core.block(),process.stdout.write(`${color.gray(S_BAR)}
${color.magenta("\u25CB")} ${e}
`);let i=0,c=0;n=setInterval(()=>{let a=frames[i];process.stdout.write(sisteransi.cursor.move(-999,-1)),process.stdout.write(`${color.magenta(a)} ${e}${Math.floor(c)>=1?".".repeat(Math.floor(c)).slice(0,3):""}
`),i=i===frames.length-1?0:i+1,c=c===frames.length?0:c+.125},r)},stop(e=""){process.stdout.write(sisteransi.cursor.move(-999,-2)),process.stdout.write(sisteransi.erase.down(2)),clearInterval(n),process.stdout.write(`${color.gray(S_BAR)}
${color.green(S_STEP_SUBMIT)} ${e}
`),t()}}};function ansiRegex(){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(t,"g")}const group=async(t,n)=>{const r={},e=Object.keys(t);for(const i of e){const c=t[i],a=await c({results:r})?.catch(l=>{throw l});if(typeof n?.onCancel=="function"&&core.isCancel(a)){r[i]="canceled",n.onCancel({results:r});continue}r[i]=a}return r};exports.isCancel=core.isCancel,exports.cancel=cancel,exports.confirm=confirm,exports.group=group,exports.groupMultiselect=groupMultiselect,exports.intro=intro,exports.log=log,exports.multiselect=multiselect,exports.note=note,exports.outro=outro,exports.password=password,exports.select=select,exports.selectKey=selectKey,exports.spinner=spinner,exports.text=text;