@codions/portta 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -88
- package/dist/assets/agents/hook.sh.tmpl +21 -0
- package/dist/assets/agents/instruction.md +8 -0
- package/dist/assets/agents/portta-context.ts.tmpl +24 -0
- package/dist/assets/skills/portta-adopt-compose/SKILL.md +220 -0
- package/dist/assets/skills/portta-dockerize/SKILL.md +118 -0
- package/dist/assets/skills/portta-host-context/SKILL.md +142 -0
- package/dist/cli.js +1568 -1017
- package/dist/documentation.json.gz +0 -0
- package/dist/runtime/.env.example +6 -42
- package/dist/runtime/VERSION +1 -1
- package/dist/runtime/docker/compose/features/web-dev.yaml +0 -2
- package/dist/runtime/docker/compose/features/web.yaml +0 -8
- package/dist/runtime/docker/images/apply/Dockerfile +1 -1
- package/dist/runtime/docker/images/toolbox/Dockerfile +1 -1
- package/dist/runtime/templates/README.md +3 -3
- package/dist/runtime/templates/overlays/06-monorepo.yaml +0 -7
- package/dist/runtime/templates/overlays/07-worktree.env +0 -1
- package/dist/runtime/templates/project/PORTTA.md +8 -7
- package/package.json +5 -16
- package/dist/acp-providers-M3DUUBYJ.js +0 -3
- package/dist/arktype-aI7TBD0R-SOJGD3SZ.js +0 -3
- package/dist/assets/skills/portta-workflows/SKILL.md +0 -285
- package/dist/assets/workflows/bake-off.workflow.js +0 -172
- package/dist/assets/workflows/code-review.workflow.js +0 -179
- package/dist/assets/workflows/deep-research.workflow.js +0 -223
- package/dist/assets/workflows/multi-provider-review.workflow.js +0 -169
- package/dist/assets/workflows/provider-debate.workflow.js +0 -141
- package/dist/assets/workflows/second-opinion.workflow.js +0 -176
- package/dist/chunk-3EZNE4MC.js +0 -6
- package/dist/chunk-4TGTGGMK.js +0 -4
- package/dist/chunk-4YGEG6YX.js +0 -1878
- package/dist/chunk-5SBYE3YH.js +0 -26
- package/dist/chunk-6J5HN4ZN.js +0 -3
- package/dist/chunk-6TV2V7RR.js +0 -3
- package/dist/chunk-CFWGQ7VJ.js +0 -19
- package/dist/chunk-EFZZFIRZ.js +0 -3
- package/dist/chunk-EH7H7D7J.js +0 -15
- package/dist/chunk-EYT7VTYA.js +0 -4
- package/dist/chunk-FRQCKCCK.js +0 -332
- package/dist/chunk-GI2EUNAK.js +0 -16
- package/dist/chunk-HB5T7XDN.js +0 -5
- package/dist/chunk-IILMQFWO.js +0 -14
- package/dist/chunk-LAYNTFDR.js +0 -70
- package/dist/chunk-MH5YJA5O.js +0 -2
- package/dist/chunk-O6U47HHQ.js +0 -341
- package/dist/chunk-OPVZAG2C.js +0 -10
- package/dist/chunk-PTKKSRMI.js +0 -223
- package/dist/chunk-Q3VNQ3LU.js +0 -3
- package/dist/chunk-QBKADN76.js +0 -4
- package/dist/chunk-QS5PHDYT.js +0 -240
- package/dist/chunk-SBVO6RXF.js +0 -87
- package/dist/chunk-T3TSZO4I.js +0 -7
- package/dist/chunk-TA2XHP5D.js +0 -4
- package/dist/chunk-UUSUJUAD.js +0 -7
- package/dist/chunk-UX7P3YHF.js +0 -3
- package/dist/chunk-VDSWNWUY.js +0 -168
- package/dist/chunk-WNZR7VOO.js +0 -145
- package/dist/chunk-YYSFNLBX.js +0 -5
- package/dist/cli-O2MMC25H.js +0 -98
- package/dist/completions-F4476JAU.js +0 -12
- package/dist/config-E5XLLPKE.js +0 -3
- package/dist/core-FSKGFGJO.js +0 -18
- package/dist/default-u_dwuiYb-OWTONHM6.js +0 -3
- package/dist/dispatch-ZCNGHCNP.js +0 -8
- package/dist/doctor-7F6ZXPZE.js +0 -5
- package/dist/effect-QlVUlMFu-4UNP2EGS.js +0 -3
- package/dist/esm-575VQW4T.js +0 -4
- package/dist/host.js +0 -8
- package/dist/init-HGEXUJP3.js +0 -245
- package/dist/linear-commands-XGHGICI7.js +0 -5
- package/dist/oneshot-DL57ZA55.js +0 -36
- package/dist/opencode-YDUTVKTG.js +0 -3
- package/dist/pi-L73UX3S5.js +0 -3
- package/dist/project-commands-2N44CRGM.js +0 -7
- package/dist/project-env-NWBVITHM.js +0 -4
- package/dist/run-commands-TCBNFJOT.js +0 -13
- package/dist/runtime/docker/compose/features/panel-host.yaml +0 -42
- package/dist/shell-ZWXPCUMD.js +0 -3
- package/dist/subprocess-jsonl-FQKDRENI.js +0 -3
- package/dist/supervisor.js +0 -179
- package/dist/sury-CWZTCd75-XQOYZHNU.js +0 -3
- package/dist/typebox-Dei93FPO-RCGWIHUQ.js +0 -3
- package/dist/valibot--1zFm7rT-DKLMYF44.js +0 -3
- package/dist/valibot-D_HTw1Gn-QTR63R64.js +0 -4
- package/dist/worktree-commands-F7REOKFJ.js +0 -50
- package/dist/zod-Bwrt9trS-6RSVELLV.js +0 -3
- package/dist/zod-DSgpEGAE-5JBFOUHY.js +0 -3
package/dist/chunk-GI2EUNAK.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as o}from"./chunk-6J5HN4ZN.js";import{spawnSync as y}from"node:child_process";import{readdirSync as w,realpathSync as f,rmSync as R,statSync as G}from"node:fs";import{basename as b,dirname as p,join as v,resolve as l}from"node:path";function m(e){let t=l(e);try{return f(t)}catch{let r=[],n=t;for(;n!==p(n);){r.unshift(b(n)),n=p(n);try{return v(f(n),...r)}catch{}}return t}}o(m,"canonicalizeFsPath");function E(e,t){return m(e)===m(t)}o(E,"sameFsPath");function W(e,t){let r=y("git",e,{cwd:t,encoding:"utf8",stdio:["ignore","pipe","pipe"]});return r.error?{ok:!1,stderr:`spawn error (cwd=${t}): ${d(r.error)}`}:{ok:!0,result:{exitCode:r.status,stdout:r.stdout??"",stderr:r.stderr??""}}}o(W,"spawnGit");function u(e,t){let r=W(e,t);if(!r.
|
|
4
|
-
ok)throw new Error(`git ${e.join(" ")} failed: ${r.stderr}`);let{result:n}=r;if(n.exitCode!==0){let s=n.stderr.trim();throw new Error(`git ${e.join(" ")} failed: ${s||`exit ${n.exitCode}`}`)}return n.stdout.trim()}o(u,"runGit");function a(e,t){let r=W(e,t);if(!r.ok)return{ok:!1,stderr:r.stderr};let{result:n}=r;return n.exitCode!==0?{ok:!1,stderr:n.stderr.trim()}:{ok:!0,stdout:n.stdout.trim()}}o(a,"tryRunGit");function d(e){return e instanceof Error?e.message:String(e)}o(d,"errorMessage");function x(e,t){
|
|
5
|
-
return e.some(r=>E(r.path,t))}o(x,"isRegisteredWorktree");function C(e){R(e,{recursive:!0,force:!0})}o(C,"removeDirectory");function B(e){let t=a(["symbolic-ref","--quiet","--short","HEAD"],e);return t.ok&&t.stdout.length>0?{ref:t.stdout,branch:t.stdout}:{ref:u(["rev-parse","--verify","HEAD"],e),branch:null}}o(B,"currentCheckoutRef");function D(e){let t=a(["rev-parse","--show-toplevel"],e);if(t.ok)return l(e,t.stdout);let r;try{r=w(e)}catch{return null}for(let n of r){let s=v(e,n);try{if(!G(s).isDirectory())
|
|
6
|
-
continue}catch{continue}let i=a(["rev-parse","--show-toplevel"],s);if(i.ok)return l(s,i.stdout)}return null}o(D,"resolveRepoRoot");function O(e){let t=u(["rev-parse","--show-toplevel"],e);return l(e,t)}o(O,"resolveWorktreeRoot");function P(e){let t=u(["rev-parse","--git-dir"],e);return l(e,t)}o(P,"resolveWorktreeGitDir");function S(e){let t=[],r=null,n=o(()=>{r?.path&&t.push(r),r=null},"flush");for(let s of e.split(`
|
|
7
|
-
`)){let i=s.trimEnd();if(!i){n();continue}if(i.startsWith("worktree ")){n(),r={path:i.slice(9),branch:null,head:null,detached:!1,bare:!1};continue}if(r){if(i.startsWith("branch ")){r.branch=i.slice(7).replace(/^refs\/heads\//,"");continue}if(i.startsWith("HEAD ")){r.head=i.slice(5);continue}if(i==="detached"){r.detached=!0;continue}i==="bare"&&(r.bare=!0)}}return n(),t}o(S,"parseGitWorktreePorcelain");function h(e){let t=u(["worktree","list","--porcelain"],e);return S(t)}o(h,"listGitWorktrees");
|
|
8
|
-
function $(e){try{return G(e.path).isDirectory()}catch{return!1}}o($,"worktreeEntryPathExists");function A(e){return e.filter($)}o(A,"filterLiveWorktreeEntries");function H(e){return u(["for-each-ref","--format=%(refname:short)","refs/heads"],e).split(`
|
|
9
|
-
`).map(r=>r.trim()).filter(r=>r.length>0)}o(H,"listLocalGitBranches");function T(e){try{u(["fetch","--prune","origin"],e)}catch{}return u(["for-each-ref","--format=%(refname:short)","refs/remotes/origin"],e).split(`
|
|
10
|
-
`).map(r=>r.trim()).filter(r=>r.length>0).map(r=>r.replace(/^origin\//,"")).filter(r=>r!=="HEAD"&&r!=="origin")}o(T,"listRemoteGitBranches");function M(e){let t=u(["status","--porcelain"],e),r=a(["rev-parse","HEAD"],e),n=a(["rev-list","--count","@{upstream}..HEAD"],e);return n.ok||(n=a(["rev-list","--count","HEAD","--not","--remotes=origin"],e)),{dirty:t.length>0,aheadCount:n.ok&&parseInt(n.stdout,10)||0,currentCommit:r.ok&&r.stdout.length>0?r.stdout:null}}o(M,"readGitWorktreeStatus");function L(e,t={}){
|
|
11
|
-
let r=["worktree","remove"];e.force&&r.push("--force"),r.push(e.worktreePath);let n=(t.tryRunGit??a)(r,e.repoRoot);if(n.ok)return;let s=`git ${r.join(" ")} failed: ${n.stderr||"exit 1"}`,i=(t.listWorktrees??h)(e.repoRoot);if(x(i,e.worktreePath))throw new Error(s);try{(t.removeDirectory??C)(e.worktreePath)}catch(c){throw new Error(`${s}; cleanup failed: ${d(c)}`)}}o(L,"removeGitWorktree");var k=class{static{o(this,"NodeGitGateway")}resolveRepoRoot(t){return D(t)}resolveWorktreeRoot(t){return O(t)}resolveWorktreeGitDir(t){
|
|
12
|
-
return P(t)}listWorktrees(t){return h(t)}listLiveWorktrees(t){return A(h(t))}listLocalBranches(t){return H(t)}listRemoteBranches(t){return T(t)}readWorktreeStatus(t){return M(t)}readStatus(t){return u(["status","--short","--untracked-files=all"],t)}createWorktree(t){let r=["worktree","add","--relative-paths"];t.mode==="new"?(r.push("-b",t.branch,t.worktreePath),t.baseBranch&&r.push(t.baseBranch)):t.startPoint?r.push("-b",t.branch,t.worktreePath,t.startPoint):r.push(t.worktreePath,t.branch),u(r,t.
|
|
13
|
-
repoRoot)}removeWorktree(t){L(t)}deleteBranch(t,r,n=!1){u(["branch",n?"-D":"-d",r],t)}mergeBranch(t){let r=B(t.repoRoot),n=r.branch!==t.targetBranch;n&&u(["checkout",t.targetBranch],t.repoRoot);let s=null,i=[];try{u(["merge","--no-ff","--no-edit",t.sourceBranch],t.repoRoot)}catch(c){s=d(c);let g=a(["merge","--abort"],t.repoRoot);!g.ok&&g.stderr.length>0&&!g.stderr.includes("MERGE_HEAD missing")&&i.push(`merge abort failed: ${g.stderr}`)}if(n){let c=a(["checkout",r.ref],t.repoRoot);c.ok||i.push(`\
|
|
14
|
-
restore checkout failed: ${c.stderr}`)}if(s){let c=i.length>0?`; ${i.join("; ")}`:"";throw new Error(`${s}${c}`)}if(i.length>0)throw new Error(i.join("; "))}currentBranch(t){return u(["branch","--show-current"],t)}resolveCommit(t,r){return u(["rev-parse","--verify",`${r}^{commit}`],t)}createAndSwitchBranch(t,r,n){u(["switch","--create",r,n],t)}readDiff(t){let r=a(["diff","HEAD","--no-color"],t);return r.ok?r.stdout:""}countUnsavedCommits(t,r){let n=o(i=>{let c=a(i,t);return c.ok?parseInt(c.stdout,
|
|
15
|
-
10)||0:null},"count"),s=r?n(["rev-list","--count","HEAD","--not","--remotes=origin",r]):null;return s!==null?s:n(["rev-list","--count","HEAD","--not","--remotes=origin"])??0}listUnpushedCommits(t){let r=a(["log","--oneline","@{upstream}..HEAD"],t);return r.ok||(r=a(["log","--oneline","HEAD","--not","--remotes=origin"],t)),!r.ok||!r.stdout?[]:r.stdout.split(`
|
|
16
|
-
`).filter(n=>n.length>0).map(n=>{let s=n.indexOf(" ");return{hash:n.slice(0,s),message:n.slice(s+1)}})}fetchBranch(t,r,n){return a(["fetch",r,n],t)}fastForwardMerge(t,r){return a(["merge","--ff-only",r],t)}hardReset(t,r){return a(["reset","--hard",r],t)}};export{m as a,E as b,S as c,k as d};
|
package/dist/chunk-HB5T7XDN.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as l}from"./chunk-4TGTGGMK.js";import{b as s}from"./chunk-EH7H7D7J.js";import{h as r}from"./chunk-T3TSZO4I.js";import{a as t}from"./chunk-6J5HN4ZN.js";var c=[{tool:"git",args:["--version"],required:!0,hint:"https://git-scm.com/downloads"},{tool:"node",args:["--version"],required:!0,hint:"https://nodejs.org/"},{tool:"python3",args:["--version"],required:!0,hint:"https://www.python.org/downloads/ or brew install python or sudo apt install python3"},{tool:"tmux",args:["-V"],required:!0,hint:"brew install tmux / sudo apt install tmux"},{tool:"gh",args:["--version"],required:!1,hint:"brew install gh then gh auth login"},{tool:"claude",args:["\
|
|
4
|
-
--version"],required:!1,hint:`Install the Claude Code CLI to let Claude scaffold ${r}`},{tool:"codex",args:["--version"],required:!1,hint:`Install the Codex CLI to let Codex scaffold ${r}`},{tool:"docker",args:["--version"],required:!1,hint:"https://docs.docker.com/get-started/get-docker/"}];function p(e,n={}){let o=n.resolveTool??s,a=n.runTool??((d,u)=>l(d,u).success),i=o(e.tool);return i?{...e,found:!0,probeOk:a(i,e.args)}:{...e,found:!1,probeOk:!1}}t(p,"inspectInitDependency");function h(e=c,n={}){
|
|
5
|
-
return e.map(o=>p(o,n))}t(h,"evaluateInitDependencies");function y(e){return e.filter(n=>n.required&&!n.found)}t(y,"missingRequiredDependencies");function D(e){return e.found}t(D,"isInitAgentSelectable");export{c as a,p as b,h as c,y as d,D as e};
|
package/dist/chunk-IILMQFWO.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as s}from"./chunk-6J5HN4ZN.js";import{spawn as k}from"node:child_process";var m=class extends Error{static{s(this,"AgentError")}provider;code;retryable;usage;constructor(n){super(n.message),this.name="AgentError",this.provider=n.provider,this.code=n.code,this.retryable=n.retryable??!1,this.usage=n.usage}},w=class extends Error{static{s(this,"AgentInterrupted")}constructor(n="agent interrupted"){super(n),this.name="AgentInterrupted"}};var L=30*6e4,I=5e3,_=16*1024;function M(e){return new Promise((n,t)=>{if(e.signal.aborted){t(new w);return}let i=e.spawnProcess??((o,d,a)=>k(o,d,{cwd:a.cwd,env:a.env,stdio:["pipe","pipe","pipe"]})),r;try{r=i(e.bin,e.args,{cwd:e.cwd,env:e.env})}catch(o){t(T(e.provider,e.bin,o));return}let c=e.stallTimeoutMs??L,A=e.killGraceMs??I,h=e.stderrLimit??_,g=!1,l="",p="",f,u,v=s(o=>{g||(g=!0,f&&clearTimeout(f),e.signal.removeEventListener("abort",y),o())},"settle"),b=s(()=>{try{r.kill("SIGTERM")}catch{}u||
|
|
4
|
-
(u=setTimeout(()=>{try{r.kill("SIGKILL")}catch{}},A),u.unref?.())},"killWithGrace"),y=s(()=>{b(),v(()=>t(new w))},"onAbort"),x=s(()=>{c<=0||g||(f&&clearTimeout(f),f=setTimeout(()=>{b(),v(()=>t(new m({provider:e.provider,code:"turn_stalled",message:`${e.bin} produced no output for ${c}ms \u2014 failing instead of hanging forever`,retryable:!0})))},c),f.unref?.())},"touch"),E=s(o=>{let d=o.trim();if(!d)return;let a;try{a=JSON.parse(d)}catch{e.onTextLine?.(d);return}try{e.onValue(a)}catch(P){b(),v(
|
|
5
|
-
()=>t(P instanceof Error?P:new Error(String(P))))}},"deliver");r.stdout.setEncoding("utf8"),r.stdout.on("data",o=>{if(g)return;x(),l+=o;let d=l.indexOf(`
|
|
6
|
-
`);for(;d!==-1&&!g;){let a=l.slice(0,d);l=l.slice(d+1),E(a),d=l.indexOf(`
|
|
7
|
-
`)}}),r.stderr.setEncoding("utf8"),r.stderr.on("data",o=>{p+=o,p.length>h&&(p=p.slice(p.length-h))}),r.on("error",o=>{v(()=>t(T(e.provider,e.bin,o)))}),r.on("exit",()=>{u&&clearTimeout(u)}),r.on("close",(o,d)=>{if(u&&clearTimeout(u),!g&&l.length>0){let a=l;l="",E(a)}v(()=>n({code:o,signal:d??null,stderrTail:p.trim()}))}),e.signal.addEventListener("abort",y,{once:!0}),x(),r.stdin.on?.("error",()=>{}),e.stdin!==void 0&&r.stdin.write(e.stdin,()=>{}),r.stdin.end?.()})}s(M,"runJsonlSubprocess");function $(e,n,t){
|
|
8
|
-
let i=t.signal?`signal ${t.signal}`:`code ${t.code??"null"}`,r=t.stderrTail?`
|
|
9
|
-
--- stderr (tail) ---
|
|
10
|
-
${t.stderrTail}`:"";return new m({provider:e,code:"provider_exit",message:`${n} exited (${i}) without a result${r}`,retryable:t.signal!==null})}s($,"exitError");function T(e,n,t){let i=t instanceof Error?t.message:String(t),r=/ENOENT|not found|not recognized|EACCES/i.test(i);return new m({provider:e,code:r?"binary_not_found":"spawn_failed",message:r?`cannot execute "${n}" \u2014 is the ${e} CLI installed and on PATH? (${i})`:`failed to spawn ${n}: ${i}`,retryable:!r})}s(T,"spawnFailure");function R(e){
|
|
11
|
-
let n=new AbortController,t="";return M({provider:e.provider,bin:e.bin,args:e.args,cwd:e.cwd,env:e.env,signal:n.signal,onValue:s(r=>{t+=`${typeof r=="string"?r:JSON.stringify(r)}
|
|
12
|
-
`},"onValue"),onTextLine:s(r=>{t+=`${r}
|
|
13
|
-
`},"onTextLine"),stallTimeoutMs:e.timeoutMs??1e4,killGraceMs:1e3,spawnProcess:e.spawnProcess}).then(r=>{if(r.code!==0)throw $(e.provider,e.bin,r);return t.trim()})}s(R,"captureStdout");function S(e){let n=e.split(`
|
|
14
|
-
`);for(let t=n.length-1;t>=0;t--){let i=n[t]?.match(/(\d+)\.(\d+)(?:\.(\d+))?/);if(i)return[Number(i[1]),Number(i[2]),Number(i[3]??0)]}}s(S,"parseVersion");function O(e,n){let t=S(e),i=S(n);if(!t||!i)return!1;for(let r=0;r<3;r++){let c=(t[r]??0)-(i[r]??0);if(c!==0)return c>0}return!0}s(O,"versionAtLeast");export{m as a,w as b,L as c,I as d,M as e,$ as f,R as g,S as h,O as i};
|
package/dist/chunk-LAYNTFDR.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
|
|
3
|
-
import{a as r,c as Ft,e as rt}from"./chunk-6J5HN4ZN.js";var Z=Ft((Te,yt)=>{"use strict";var Q={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let s="";return t<0?s+=`\x1B[${-t}D`:t>0&&(s+=`\x1B[${t}C`),e<0?s+=`\x1B[${-e}A`:e>0&&(s+=`\x1B[${e}B`),s},up:r((t=1)=>`\x1B[${t}A`,"up"),down:r((t=1)=>`\x1B[${t}B`,"down"),forward:r((t=1)=>`\x1B[${t}C`,"forward"),backward:r((t=1)=>`\x1B[${t}D`,"backward"),nextLine:r((t=1)=>"\x1B[E".repeat(t),"nextLine"),prevLine:r((t=1)=>"\x1B[F".repeat(t),"prevLine"),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?2\
|
|
4
|
-
5h",save:"\x1B7",restore:"\x1B8"},Bt={up:r((t=1)=>"\x1B[S".repeat(t),"up"),down:r((t=1)=>"\x1B[T".repeat(t),"down")},Kt={screen:"\x1B[2J",up:r((t=1)=>"\x1B[1J".repeat(t),"up"),down:r((t=1)=>"\x1B[J".repeat(t),"down"),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let s=0;s<t;s++)e+=this.line+(s<t-1?Q.up():"");return t&&(e+=Q.left),e}};yt.exports={cursor:Q,scroll:Bt,erase:Kt,beep:"\x07"}});import{stdout as wt,stdin as Ht}from"node:process";import qt from"node:readline";var nt=(()=>{let t=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return e=>{let s=0;for(t.lastIndex=0;t.test(e);)s+=1;return e.length-s}})(),ot=r(t=>t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510,"isFullWidth"),at=r(t=>t===8987||t===9001||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12771||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=19903||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=127488&&
|
|
5
|
-
t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t>=131072&&t<=196605||t>=196608&&t<=262141,"isWideNotCJKTNotEmoji");var Vt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,At=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,ut=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,Ot=/\t{1,1000}/y,lt=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier\
|
|
6
|
-
_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),Rt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Lt=new RegExp("\\p{M}+","gu"),Pt={limit:1/0,ellipsis:""},ct=r((t,e={},s={})=>{let i=e.limit??1/0,a=e.ellipsis??"",c=e?.ellipsisWidth??(a?ct(a,Pt,s).width:0),u=0,o=s.controlWidth??0,l=s.tabWidth??8,h=s.emojiWidth??2,$=2,d=s.regularWidth??1,p=s.wideWidth??$,f=[[Rt,d],[Vt,u],[At,o],[Ot,
|
|
7
|
-
l],[lt,h],[ut,p]],m=0,y=0,x=t.length,V=0,A=!1,L=x,O=Math.max(0,i-c),I=0,b=0,w=0,S=0;t:for(;;){if(b>I||y>=x&&y>m){let C=t.slice(I,b)||t.slice(m,y);V=0;for(let P of C.replaceAll(Lt,"")){let T=P.codePointAt(0)||0;if(ot(T)?S=$:at(T)?S=p:S=d,w+S>O&&(L=Math.min(L,Math.max(I,m)+V)),w+S>i){A=!0;break t}V+=P.length,w+=S}I=b=0}if(y>=x)break t;for(let C=0,P=f.length;C<P;C++){let[T,it]=f[C];if(T.lastIndex=y,T.test(t)){if(V=T===ut?nt(t.slice(y,T.lastIndex)):T===lt?1:T.lastIndex-y,S=V*it,w+S>O&&(L=Math.min(L,
|
|
8
|
-
y+Math.floor((O-w)/it))),w+S>i){A=!0;break t}w+=S,I=m,b=y,y=m=T.lastIndex;continue t}}y+=1}return{width:A?O:w,index:A?L:x,truncated:A,ellipsed:A&&i>=c}},"getStringTruncatedWidth"),ht=ct;var kt={limit:1/0,ellipsis:"",ellipsisWidth:0},Nt=r((t,e={})=>ht(t,kt,e).width,"fastStringWidth"),_=Nt;var D="\x1B",$t="\x9B",Dt=39,z="\x07",ft="[",Gt="]",vt="m",X=`${Gt}8;;`,dt=new RegExp(`(?:\\${ft}(?<code>\\d+)m|\\${X}(?<uri>.*)${z})`,"y"),pt=r(t=>{if(t>=30&&t<=37||t>=90&&t<=97)return 39;if(t>=40&&t<=47||t>=100&&t<=107)return 49;if(t===1||t===2)return 22;if(t===3)return 23;if(t===4)return 24;if(t===7)return 27;if(t===8)return 28;if(t===9)return 29;if(t===0)return 0},"getClosingCode"),mt=r(t=>`${D}${ft}${t}${vt}`,"wrapAnsiCode"),gt=r(t=>`${D}${X}${t}${z}`,"wrapAnsiHyperlink"),Y=r((t,e,s)=>{let i=e[Symbol.
|
|
9
|
-
iterator](),a=!1,c=!1,u=t.at(-1),o=u===void 0?0:_(u),l=i.next(),h=i.next(),$=0;for(;!l.done;){let d=l.value,p=_(d);o+p<=s?t[t.length-1]+=d:(t.push(d),o=0),(d===D||d===$t)&&(a=!0,c=e.startsWith(X,$+1)),a?c?d===z&&(a=!1,c=!1):d===vt&&(a=!1):(o+=p,o===s&&!h.done&&(t.push(""),o=0)),l=h,h=i.next(),$+=d.length}u=t.at(-1),!o&&u!==void 0&&u.length&&t.length>1&&(t[t.length-2]+=t.pop())},"wrapWord"),Wt=r(t=>{let e=t.split(" "),s=e.length;for(;s&&!_(e[s-1]);)s--;return s===e.length?t:e.slice(0,s).join(" ")+
|
|
10
|
-
e.slice(s).join("")},"stringVisibleTrimSpacesRight"),jt=r((t,e,s={})=>{if(s.trim!==!1&&t.trim()==="")return"";let i="",a,c,u=t.split(" "),o=[""],l=0;for(let d=0;d<u.length;d++){let p=u[d];if(s.trim!==!1){let m=o.at(-1)??"",y=m.trimStart();m.length!==y.length&&(o[o.length-1]=y,l=_(y))}d!==0&&(l>=e&&(s.wordWrap===!1||s.trim===!1)&&(o.push(""),l=0),(l||s.trim===!1)&&(o[o.length-1]+=" ",l++));let f=_(p);if(s.hard&&f>e){let m=e-l,y=1+Math.floor((f-m-1)/e);Math.floor((f-1)/e)<y&&o.push(""),Y(o,p,e),l=
|
|
11
|
-
_(o.at(-1)??"");continue}if(l+f>e&&l&&f){if(s.wordWrap===!1&&l<e){Y(o,p,e),l=_(o.at(-1)??"");continue}o.push(""),l=0}if(l+f>e&&s.wordWrap===!1){Y(o,p,e),l=_(o.at(-1)??"");continue}o[o.length-1]+=p,l+=f}s.trim!==!1&&(o=o.map(d=>Wt(d)));let h=o.join(`
|
|
12
|
-
`),$=!1;for(let d=0;d<h.length;d++){let p=h[d];if(i+=p,$)$=!1;else if($=p>="\uD800"&&p<="\uDBFF",$)continue;if(p===D||p===$t){dt.lastIndex=d+1;let m=dt.exec(h)?.groups;if(m?.code!==void 0){let y=Number.parseFloat(m.code);a=y===Dt?void 0:y}else m?.uri!==void 0&&(c=m.uri.length===0?void 0:m.uri)}if(h[d+1]===`
|
|
13
|
-
`){c&&(i+=gt(""));let f=a?pt(a):void 0;a&&f&&(i+=mt(f))}else p===`
|
|
14
|
-
`&&(a&&pt(a)&&(i+=mt(a)),c&&(i+=gt(c)))}return i},"exec"),Ut=/\r?\n/;function R(t,e,s){return String(t).normalize().split(Ut).map(i=>jt(i,e,s)).join(`
|
|
15
|
-
`)}r(R,"wrapAnsi");var M=rt(Z(),1);function W(t,e,s){if(!s.some(u=>!u.disabled))return t;let i=t+e,a=Math.max(s.length-1,0),c=i<0?a:i>a?0:i;return s[c]?.disabled?W(c,e<0?-1:1,s):c}r(W,"findCursor");var Jt=["up","down","left","right","space","enter","cancel"],Yt=["January","February","March","April","May","June","July","August","September","October","November","December"],E={actions:new Set(Jt),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,accessible:void 0,date:{monthNames:[...Yt],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 mon\
|
|
16
|
-
ths in a year",invalidDay:r((t,e)=>`There are only ${t} days in ${e}`,"invalidDay"),afterMin:r(t=>`Date must be on or after ${t.toISOString().slice(0,10)}`,"afterMin"),beforeMax:r(t=>`Date must be on or before ${t.toISOString().slice(0,10)}`,"beforeMax")}}};function zt(t){if(t!==void 0)return t;if(E.accessible!==void 0)return E.accessible;let e=process.env.ACCESSIBLE;return e!==void 0&&e!==""&&e!=="0"&&e!=="false"}r(zt,"isAccessible");function It(t,e){if(typeof t=="string")return E.aliases.get(t)===e;for(let s of t)if(s!==void 0&&It(s,e))return!0;return!1}r(It,"isActionKey");function Xt(t,e){if(t===e)return;let s=t.split(`
|
|
17
|
-
`),i=e.split(`
|
|
18
|
-
`),a=Math.max(s.length,i.length),c=[];for(let u=0;u<a;u++)s[u]!==i[u]&&c.push(u);return{lines:c,numLinesBefore:s.length,numLinesAfter:i.length,numLines:a}}r(Xt,"diffLines");var Oe=globalThis.process.platform.startsWith("win"),j=Symbol("clack:cancel");function St(t){return t===j}r(St,"isCancel");function G(t,e){let s=t;s.isTTY&&s.setRawMode(e)}r(G,"setRawMode");var K=r(t=>"columns"in t&&typeof t.columns=="number"?t.columns:80,"getColumns"),tt=r(t=>"rows"in t&&typeof t.rows=="number"?t.rows:20,"getRows");function N(t,e,s,i=s,a=s,c){let u=K(t??wt);return R(e,u-s.length,{hard:!0,trim:!1}).split(`
|
|
19
|
-
`).map((o,l,h)=>{let $=c?c(o,l):o;return l===0?`${i}${$}`:l===h.length-1?`${a}${$}`:`${s}${$}`}).join(`
|
|
20
|
-
`)}r(N,"wrapTextWithPrefix");function bt(t,e){if("~standard"in t){let s=t["~standard"].validate(e);return s instanceof Promise?s.then(i=>i.issues?.at(0)?.message):s.issues?.at(0)?.message}return t(e)}r(bt,"runValidation");var U=class{static{r(this,"y")}input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";get accessible(){return zt(this.opts.accessible)}constructor(e,s=!0){let{input:i=Ht,output:a=wt,render:c,signal:u,
|
|
21
|
-
...o}=e;this.opts=o,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=c.bind(this),this._track=s,this._abortSignal=u,this.input=i,this.output=a}unsubscribe(){this._subscribers.clear()}setSubscriber(e,s){let i=this._subscribers.get(e)??[];i.push(s),this._subscribers.set(e,i)}on(e,s){this.setSubscriber(e,{cb:s})}once(e,s){this.setSubscriber(e,{cb:s,once:!0})}emit(e,...s){let i=this._subscribers.get(e)??[],a=[];for(let c of i)
|
|
22
|
-
c.cb(...s),c.once&&a.push(()=>i.splice(i.indexOf(c),1));for(let c of a)c()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(j);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=qt.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),
|
|
23
|
-
this.input.on("keypress",this.onKeypress),G(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(M.cursor.show),this.output.off("resize",this.render),G(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(M.cursor.show),this.output.off("resize",this.render),G(this.input,!1),e(j)})})}_isActionKey(e,s){return e===" "}_shouldSubmit(e,s){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,s){this.
|
|
24
|
-
userInput=e??"",this.emit("userInput",this.userInput),s&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}async onKeypress(e,s){if(this.state!=="validating"){if(this._track&&s.name!=="return"&&(s.name&&this._isActionKey(e,s)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),s?.name&&
|
|
25
|
-
(!this._track&&E.aliases.has(s.name)&&this.emit("cursor",E.aliases.get(s.name)),E.actions.has(s.name)&&this.emit("cursor",s.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e,s),s?.name==="return"&&this._shouldSubmit(e,s)){if(this.opts.validate){let i=bt(this.opts.validate,this.value),a;i instanceof Promise?(this.state="validating",this.render(),a=await i):a=i,a&&(this.error=a instanceof Error?a.message:a,this.state="error",this.
|
|
26
|
-
rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}It([e,s?.name,s?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
27
|
-
`),G(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=R(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
28
|
-
`).length-1;this.output.write(M.cursor.move(-999,e*-1))}render(){let e=R(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(M.cursor.hide);else{let s=Xt(this._prevFrame,e),i=tt(this.output);if(this.restoreCursor(),s){let a=Math.max(0,s.numLinesAfter-i),c=Math.max(0,s.numLinesBefore-i),u=s.lines.find(o=>o>=a);if(u===void 0){this._prevFrame=e;return}if(s.lines.length===1){this.output.write(M.cursor.move(0,u-c)),this.
|
|
29
|
-
output.write(M.erase.lines(1));let o=e.split(`
|
|
30
|
-
`);this.output.write(o[u]),this._prevFrame=e,this.output.write(M.cursor.move(0,o.length-u-1));return}else if(s.lines.length>1){if(a<c)u=a;else{let l=u-c;l>0&&this.output.write(M.cursor.move(0,l))}this.output.write(M.erase.down());let o=e.split(`
|
|
31
|
-
`).slice(u);this.output.write(o.join(`
|
|
32
|
-
`)),this._prevFrame=e;return}}this.output.write(M.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var B=class extends U{static{r(this,"r")}get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(e){super(e,!1),this.value=!!e.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(M.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var _t=class extends U{static{r(this,"n")}options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){let e=this._selectedValue;this.value=e===void 0?void 0:e.value}constructor(e){super(e,!1),this.options=e.options;let s=this.options.findIndex(({value:a})=>a===e.initialValue),i=s===-1?0:s;this.cursor=this.options[i]?.disabled?W(i,1,this.options):i,this.changeValue(),this.on("cursor",a=>{switch(a){case"left":case"up":this.cursor=W(this.cursor,-1,this.options);break;case"d\
|
|
33
|
-
own":case"right":this.cursor=W(this.cursor,1,this.options);break}this.changeValue()})}};import{styleText as n,stripVTControlCharacters as Ye}from"node:util";import F from"node:process";var Tt=rt(Z(),1);function Qt(){return F.platform!=="win32"?F.env.TERM!=="linux":!!F.env.CI||!!F.env.WT_SESSION||!!F.env.TERMINUS_SUBLIME||F.env.ConEmuTask==="{cmd::Cmder}"||F.env.TERM_PROGRAM==="Terminus-Sublime"||F.env.TERM_PROGRAM==="vscode"||F.env.TERM==="xterm-256color"||F.env.TERM==="alacritty"||F.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}r(Qt,"isUnicodeSupported");var Zt=Qt();var g=r((t,e)=>Zt?t:e,"unicodeOr"),xt=g("\u25C6","*"),te=g("\u25A0","x"),ee=g("\u25B2","x"),st=g("\u25C7","o"),se=g("\u250C","T"),v=g("\u2502","|"),J=g("\u2514","\u2014"),Ze=g("\u2510","T"),ts=g("\u2518","\u2014"),et=g("\u25CF",">"),q=g("\u25CB"," "),es=g("\u25FB","[\u2022]"),ss=g("\u25FC","[+]"),is=g("\u25FB","[ ]"),rs=g("\u25AA","\u2022"),Et=g("\u2500","-"),ie=g("\u256E","+"),re=g("\u251C","+"),ne=g("\u256F","+"),oe=g("\u2570","+"),ns=g("\u256D","+"),ae=g("\u25CF","\u2022"),ue=g("\u25C6","*"),
|
|
34
|
-
le=g("\u25B2","!"),ce=g("\u25A0","x"),Mt=r(t=>{switch(t){case"initial":case"active":return n("cyan",xt);case"cancel":return n("red",te);case"error":return n("yellow",ee);case"submit":return n("green",st);case"validating":return n("dim",xt)}},"symbol"),he=r(t=>{switch(t){case"initial":case"active":return n("cyan",v);case"cancel":return n("red",v);case"error":return n("yellow",v);case"submit":return n("green",v)}},"symbolBar");function de(t,e){let s=[`${e?`${n("cyan",v)} `:""}${t.join(" \u2022 ")}`];
|
|
35
|
-
return e&&s.push(n("cyan",J)),s}r(de,"formatInstructionFooter");var Ct=r((t,e,s,i,a,c=!1)=>{let u=e,o=0;if(c)for(let l=i-1;l>=s;l--){let h=t[l];if(h&&(u-=h.length),o++,u<=a)break}else for(let l=s;l<i;l++){let h=t[l];if(h&&(u-=h.length),o++,u<=a)break}return{lineCount:u,removals:o}},"I"),pe=r(({cursor:t,options:e,style:s,output:i=process.stdout,maxItems:a=Number.POSITIVE_INFINITY,columnPadding:c=0,rowPadding:u=4})=>{let o=K(i)-c,l=tt(i),h=n("dim","..."),$=Math.max(l-u,0),d=Math.max(Math.min(a,$),
|
|
36
|
-
5),p=0;t>=d-3&&(p=Math.max(Math.min(t-d+3,e.length-d),0));let f=d<e.length&&p>0,m=d<e.length&&p+d<e.length,y=Math.min(p+d,e.length),x=[],V=0;f&&V++,m&&V++;let A=p+(f?1:0),L=y-(m?1:0);for(let I=A;I<L;I++){let b=e[I],w=b?s(b,I===t):"",S=R(w,o,{hard:!0,trim:!1}).split(`
|
|
37
|
-
`);x.push(S),V+=S.length}if(V>$){let I=0,b=0,w=V,S=t-A,C=$,P=r(()=>Ct(x,w,0,S,C),"L"),T=r(()=>Ct(x,w,S+1,x.length,C,!0),"E");f?({lineCount:w,removals:I}=P(),w>C&&(m||(C-=1),{lineCount:w,removals:b}=T())):(m||(C-=1),{lineCount:w,removals:b}=T(),w>C&&(C-=1,{lineCount:w,removals:I}=P())),I>0&&(f=!0,x.splice(0,I)),b>0&&(m=!0,x.splice(x.length-b,b))}let O=[];f&&O.push(h);for(let I of x)for(let b of I)O.push(b);return m&&O.push(h),O},"limitOptions");var os=r(t=>{let e=t.active??"Yes",s=t.inactive??"No";return new B({active:e,inactive:s,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){let i=t.withGuide??E.withGuide,a=`${Mt(this.state)} `,c=i?`${n("gray",v)} `:"",u=N(t.output,t.message,c,a),o=`${i?`${n("gray",v)}
|
|
38
|
-
`:""}${u}
|
|
39
|
-
`,l=this.value?e:s;switch(this.state){case"submit":{let h=i?`${n("gray",v)} `:"";return`${o}${h}${n("dim",l)}`}case"cancel":{let h=i?`${n("gray",v)} `:"";return`${o}${h}${n(["strikethrough","dim"],l)}${i?`
|
|
40
|
-
${n("gray",v)}`:""}`}default:{let h=i?`${n("cyan",v)} `:"",$=i?n("cyan",J):"";return`${o}${h}${this.value?`${n("green",et)} ${e}`:`${n("dim",q)} ${n("dim",e)}`}${t.vertical?i?`
|
|
41
|
-
${n("cyan",v)} `:`
|
|
42
|
-
`:` ${n("dim","/")} `}${this.value?`${n("dim",q)} ${n("dim",s)}`:`${n("green",et)} ${s}`}
|
|
43
|
-
${$}
|
|
44
|
-
`}}}}).prompt()},"confirm");var as=[`${n("dim","\u2191/\u2193")} to navigate`,`${n("dim","Space:")} select`,`${n("dim","Enter:")} confirm`];var k={message:r((t=[],{symbol:e=n("gray",v),secondarySymbol:s=n("gray",v),output:i=process.stdout,spacing:a=1,withGuide:c}={})=>{let u=[],o=c??E.withGuide,l=o?s:"",h=o?`${e} `:"",$=o?`${s} `:"";for(let p=0;p<a;p++)u.push(l);let d=Array.isArray(t)?t:t.split(`
|
|
45
|
-
`);if(d.length>0){let[p,...f]=d;p.length>0?u.push(`${h}${p}`):u.push(o?e:"");for(let m of f)m.length>0?u.push(`${$}${m}`):u.push(o?s:"")}i.write(`${u.join(`
|
|
46
|
-
`)}
|
|
47
|
-
`)},"message"),info:r((t,e)=>{k.message(t,{...e,symbol:n("blue",ae)})},"info"),success:r((t,e)=>{k.message(t,{...e,symbol:n("green",ue)})},"success"),step:r((t,e)=>{k.message(t,{...e,symbol:n("green",st)})},"step"),warn:r((t,e)=>{k.message(t,{...e,symbol:n("yellow",le)})},"warn"),warning:r((t,e)=>{k.warn(t,e)},"warning"),error:r((t,e)=>{k.message(t,{...e,symbol:n("red",ce)})},"error")};var us=r((t="",e)=>{let s=e?.output??process.stdout,i=e?.withGuide??E.withGuide?`${n("gray",se)} `:"";s.write(`${i}${t}
|
|
48
|
-
`)},"intro"),ls=r((t="",e)=>{let s=e?.output??process.stdout,i=e?.withGuide??E.withGuide?`${n("gray",v)}
|
|
49
|
-
${n("gray",J)} `:"";s.write(`${i}${t}
|
|
50
|
-
|
|
51
|
-
`)},"outro");var me=r(t=>t,"W$1"),ge=r((t,e,s)=>{let i={hard:!0,trim:!1},a=R(t,e,i).split(`
|
|
52
|
-
`),c=a.reduce((l,h)=>Math.max(_(h),l),0),u=a.map(s).reduce((l,h)=>Math.max(_(h),l),0),o=e-(u-c);return R(t,o,i)},"C"),cs=r((t="",e="",s)=>{let i=s?.output??F.stdout,a=s?.withGuide??E.withGuide,c=s?.format??me,u=["",...ge(t,K(i)-6,c).split(`
|
|
53
|
-
`).map(c),""],o=_(e),l=Math.max(u.reduce((p,f)=>{let m=_(f);return m>p?m:p},0),o)+2,h=u.map(p=>`${n("gray",v)} ${p}${" ".repeat(l-_(p))}${n("gray",v)}`).join(`
|
|
54
|
-
`),$=a?`${n("gray",v)}
|
|
55
|
-
`:"",d=a?re:oe;i.write(`${$}${n("green",st)} ${n("reset",e)} ${n("gray",Et.repeat(Math.max(l-o-1,1))+ie)}
|
|
56
|
-
${h}
|
|
57
|
-
${n("gray",d+Et.repeat(l+2)+ne)}
|
|
58
|
-
`)},"note");var hs={light:g("\u2500","-"),heavy:g("\u2501","="),block:g("\u2588","#")};var $e=[`${n("dim","\u2191/\u2193")} to navigate`,`${n("dim","Enter:")} confirm`],H=r((t,e)=>t.includes(`
|
|
59
|
-
`)?t.split(`
|
|
60
|
-
`).map(s=>e(s)).join(`
|
|
61
|
-
`):e(t),"c"),ds=r(t=>{let e=r((i,a)=>{if(i===void 0)return"";let c=i.label??String(i.value);switch(a){case"disabled":return`${n("gray",q)} ${H(c,u=>n("gray",u))}${i.hint?` ${n("dim",`(${i.hint??"disabled"})`)}`:""}`;case"selected":return`${H(c,u=>n("dim",u))}`;case"active":return`${n("green",et)} ${c}${i.hint?` ${n("dim",`(${i.hint})`)}`:""}`;case"cancelled":return`${H(c,u=>n(["strikethrough","dim"],u))}`;default:return`${n("dim",q)} ${H(c,u=>n("dim",u))}`}},"o"),s=t.showInstructions??!0;return new _t(
|
|
62
|
-
{options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){let i=t.withGuide??E.withGuide,a=`${Mt(this.state)} `,c=`${he(this.state)} `,u=N(t.output,t.message,c,a),o=`${i?`${n("gray",v)}
|
|
63
|
-
`:""}${u}
|
|
64
|
-
`;switch(this.state){case"submit":{let l=i?`${n("gray",v)} `:"",h=N(t.output,e(this.options[this.cursor],"selected"),l);return`${o}${h}`}case"cancel":{let l=i?`${n("gray",v)} `:"",h=N(t.output,e(this.options[this.cursor],"cancelled"),l);return`${o}${h}${i?`
|
|
65
|
-
${n("gray",v)}`:""}`}default:{let l=i?`${n("cyan",v)} `:"",h=o.split(`
|
|
66
|
-
`).length,$=s?de($e,i):i?[n("cyan",J)]:[],d=$.join(`
|
|
67
|
-
`),p=$.length+1;return`${o}${l}${pe({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:l.length,rowPadding:h+p,style:r((f,m)=>e(f,f.disabled?"disabled":m?"active":"inactive"),"style")}).join(`
|
|
68
|
-
${l}`)}
|
|
69
|
-
${d}
|
|
70
|
-
`}}}}).prompt()},"select");var ps=`${n("gray",v)} `;export{St as a,os as b,k as c,us as d,ls as e,cs as f,ds as g};
|
package/dist/chunk-MH5YJA5O.js
DELETED