noskills 4.1.47 → 4.1.48
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/chunks/{approve-D5AONTPF.js → approve-JDCG5RTO.js} +1 -1
- package/chunks/{ask-SWMI6GK2.js → ask-KPIHJIJZ.js} +1 -1
- package/chunks/{block-MW7CCPRS.js → block-WDK4VFDU.js} +1 -1
- package/chunks/{browser-AXSE2CPY.js → browser-XLYVEO2J.js} +1 -1
- package/chunks/{bun-LARHC47N.js → bun-5VMFSLLY.js} +1 -1
- package/chunks/{cancel-3JUX5SPS.js → cancel-RNUAFYI2.js} +1 -1
- package/chunks/{chunk-YK6UG66R.js → chunk-2X2U2VC5.js} +1 -1
- package/chunks/{chunk-OV7ZXBXC.js → chunk-4DHIEOZS.js} +1 -1
- package/chunks/{chunk-G5OCHQQ2.js → chunk-65A35QPF.js} +1 -1
- package/chunks/{chunk-DHMCIRLT.js → chunk-CKETVOVQ.js} +1 -1
- package/chunks/{chunk-XYJXQHQN.js → chunk-CLCZ7IO3.js} +1 -1
- package/chunks/{chunk-TJZAIUKM.js → chunk-JCIANZPY.js} +1 -1
- package/chunks/{chunk-RBLZTQ64.js → chunk-JI5AH4G4.js} +1 -1
- package/chunks/{chunk-Y6AFIAJP.js → chunk-K223KAUB.js} +1 -1
- package/chunks/{chunk-VK7L5SMS.js → chunk-MSJSMJL2.js} +1 -1
- package/chunks/{chunk-XRKWQJMC.js → chunk-NRCHLNQA.js} +1 -1
- package/chunks/{chunk-FEHZCASN.js → chunk-ON7NJA2P.js} +1 -1
- package/chunks/{chunk-QYMX2GR3.js → chunk-PL7WF7NC.js} +1 -1
- package/chunks/{chunk-MNEZ5QGX.js → chunk-RMCTOOQL.js} +1 -1
- package/chunks/{chunk-VPXOI7CR.js → chunk-RTD42HPS.js} +1 -1
- package/chunks/{chunk-TIGKFDKY.js → chunk-U3JLX6DY.js} +1 -1
- package/chunks/{chunk-FJCXMC2D.js → chunk-VHP7GMUP.js} +1 -1
- package/chunks/{chunk-QMZBEPES.js → chunk-WFOXOZWW.js} +1 -1
- package/chunks/{chunk-6FTHIS2Z.js → chunk-XQJ6LR2O.js} +1 -1
- package/chunks/{chunk-4BH6CF3J.js → chunk-YSLRAWBK.js} +1 -1
- package/chunks/{chunk-IZ4J7VRF.js → chunk-ZAOVTFWH.js} +1 -1
- package/chunks/{claude-code-FZXKRWA5.js → claude-code-R7PCCNRZ.js} +1 -1
- package/chunks/cmd-NWSNAUKC.js +1 -0
- package/chunks/{concern-XME2LKJJ.js → concern-BFL64SWF.js} +1 -1
- package/chunks/{deno-WQJZSBAW.js → deno-QOH6TCLQ.js} +1 -1
- package/chunks/{done-5FR2OAXK.js → done-ABJB7WCJ.js} +1 -1
- package/chunks/{free-KPB37MR3.js → free-K7J7X57R.js} +1 -1
- package/chunks/{init-HIQXEJDS.js → init-4ULYNWEU.js} +1 -1
- package/chunks/{invoke-hook-NXZYKSHD.js → invoke-hook-F5SNDW2N.js} +1 -1
- package/chunks/{kiro-AC5LYTVB.js → kiro-3VFHKARM.js} +1 -1
- package/chunks/{list-B5YTFNLR.js → list-FWRKOILC.js} +1 -1
- package/chunks/{manager-OOJQ6WXI.js → manager-J5QJQK4T.js} +5 -5
- package/chunks/{mod-RW5J2N5Q.js → mod-LORCBZWH.js} +1 -1
- package/chunks/{next-SP7JFPGS.js → next-KPZN56DW.js} +2 -2
- package/chunks/{node-JJN2TSIE.js → node-BPWE6I45.js} +1 -1
- package/chunks/{ollama-TM4MMP7N.js → ollama-VSBCL6RB.js} +1 -1
- package/chunks/{opencode-YGNBYWQL.js → opencode-YE3RKOY7.js} +1 -1
- package/chunks/pack-QZSOS3EC.js +5 -0
- package/chunks/{purge-OAHH3MCY.js → purge-AJ3FYIZU.js} +1 -1
- package/chunks/{reopen-H6WXM2OQ.js → reopen-XQ6QSX33.js} +1 -1
- package/chunks/{reset-O4WA2VGI.js → reset-B7JO5N4M.js} +1 -1
- package/chunks/{rule-IHME5I6Q.js → rule-SSF5KGII.js} +1 -1
- package/chunks/{run-7OEMPUFO.js → run-NCUAJFRJ.js} +1 -1
- package/chunks/{session-NSWI2Q3S.js → session-TJJDZ3VF.js} +1 -1
- package/chunks/{spec-2FKI55EV.js → spec-BYCG4S2R.js} +1 -1
- package/chunks/{status-MOMQ2FRD.js → status-FJCCVQQU.js} +1 -1
- package/chunks/{sync-YI7WLQP2.js → sync-EDTFSXLO.js} +1 -1
- package/chunks/{watch-GMTD4676.js → watch-HFPGREOU.js} +1 -1
- package/chunks/{wontfix-2AKBA54I.js → wontfix-342QFPKY.js} +1 -1
- package/chunks/{workerd-VA2BYLUO.js → workerd-IIQRIOBX.js} +1 -1
- package/noskills.js +1 -1
- package/package.json +1 -1
- package/chunks/cmd-RST2ZPA6.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var d=class extends Error{capability;runtimeName;constructor(t,n){super(`Capability "${t}" is not available on runtime "${n}"`),this.name="RuntimeCapabilityError",this.capability=t,this.runtimeName=n}},w=class extends Error{path;constructor(t){super(`No such file or directory: ${t}`),this.name="NotFoundError",this.path=t}},R=class extends Error{path;constructor(t){super(`File or directory already exists: ${t}`),this.name="AlreadyExistsError",this.path=t}},p=class extends Error{cmd;code;stderr;constructor(t,n,r){super(`Command "${t}" failed with exit code ${n}: ${r}`),this.name="ProcessError",this.cmd=t,this.code=n,this.stderr=r}};var P="/",W=":",c=e=>e.replace(/\\/g,"/").replace(/\/+/g,"/"),Y=e=>c(e),C=(...e)=>{if(e.length===0)return".";let t=e.filter(n=>n.length>0).join(P);return t.length===0?".":y(t)},m=(...e)=>{let t="",n=!1;for(let r=e.length-1;r>=0&&!n;r--){let o=e[r];o===void 0||o.length===0||(t=`${o}/${t}`,n=k(o))}return t=c(t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),y(t)??"."},v=e=>{if(e.length===0)return".";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let t=e.lastIndexOf("/");return t===-1?".":t===0?"/":e.slice(0,t)},f=(e,t)=>{if(e.length===0)return"";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let n=e.lastIndexOf("/"),r=n===-1?e:e.slice(n+1);return t&&r.endsWith(t)&&(r=r.slice(0,-t.length)),r},S=e=>{let t=f(e),n=t.lastIndexOf(".");return n<=0||n===t.length-1?"":t.slice(n)},y=e=>{if(e.length===0)return".";e=c(e);let t=e.startsWith("/"),n=e.endsWith("/"),r=e.split("/").filter(i=>i.length>0),o=[];for(let i of r)i!=="."&&(i===".."?o.length>0&&o[o.length-1]!==".."?o.pop():t||o.push(".."):o.push(i));let s=o.join("/");return t&&(s=`/${s}`),n&&s.length>1&&(s+="/"),s??"."},k=e=>e.length===0?!1:!!(e.startsWith("/")||e.length>=3&&/^[a-zA-Z]:[/\\]/.test(e)),
|
|
1
|
+
var d=class extends Error{capability;runtimeName;constructor(t,n){super(`Capability "${t}" is not available on runtime "${n}"`),this.name="RuntimeCapabilityError",this.capability=t,this.runtimeName=n}},w=class extends Error{path;constructor(t){super(`No such file or directory: ${t}`),this.name="NotFoundError",this.path=t}},R=class extends Error{path;constructor(t){super(`File or directory already exists: ${t}`),this.name="AlreadyExistsError",this.path=t}},p=class extends Error{cmd;code;stderr;constructor(t,n,r){super(`Command "${t}" failed with exit code ${n}: ${r}`),this.name="ProcessError",this.cmd=t,this.code=n,this.stderr=r}};var P="/",W=":",c=e=>e.replace(/\\/g,"/").replace(/\/+/g,"/"),Y=e=>c(e),C=(...e)=>{if(e.length===0)return".";let t=e.filter(n=>n.length>0).join(P);return t.length===0?".":y(t)},m=(...e)=>{let t="",n=!1;for(let r=e.length-1;r>=0&&!n;r--){let o=e[r];o===void 0||o.length===0||(t=`${o}/${t}`,n=k(o))}return t=c(t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),y(t)??"."},v=e=>{if(e.length===0)return".";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let t=e.lastIndexOf("/");return t===-1?".":t===0?"/":e.slice(0,t)},f=(e,t)=>{if(e.length===0)return"";for(e=c(e);e.length>1&&e.endsWith("/");)e=e.slice(0,-1);let n=e.lastIndexOf("/"),r=n===-1?e:e.slice(n+1);return t&&r.endsWith(t)&&(r=r.slice(0,-t.length)),r},S=e=>{let t=f(e),n=t.lastIndexOf(".");return n<=0||n===t.length-1?"":t.slice(n)},y=e=>{if(e.length===0)return".";e=c(e);let t=e.startsWith("/"),n=e.endsWith("/"),r=e.split("/").filter(i=>i.length>0),o=[];for(let i of r)i!=="."&&(i===".."?o.length>0&&o[o.length-1]!==".."?o.pop():t||o.push(".."):o.push(i));let s=o.join("/");return t&&(s=`/${s}`),n&&s.length>1&&(s+="/"),s??"."},k=e=>e.length===0?!1:!!(e.startsWith("/")||e.length>=3&&/^[a-zA-Z]:[/\\]/.test(e)),I=(e,t)=>{if(e===t||(e=m(e),t=m(t),e===t))return"";let n=e.split("/").filter(l=>l.length>0),r=t.split("/").filter(l=>l.length>0),o=0,s=Math.min(n.length,r.length);for(let l=0;l<s&&n[l]===r[l];l++)o++;let i=n.length-o,g=r.slice(o);return[...Array(i).fill(".."),...g].join("/")??"."},N=e=>{if(e.length===0)return{root:"",dir:"",base:"",ext:"",name:""};e=c(e);let t="",n="",r=f(e),o=S(e),s=o?r.slice(0,-o.length):r;return e.startsWith("/")?t="/":/^[a-zA-Z]:[/\\]/.test(e)&&(t=e.slice(0,3)),n=v(e),n==="."&&(n=""),{root:t,dir:n,base:r,ext:o,name:s}},U=e=>{let{root:t="",dir:n,base:r,ext:o="",name:s=""}=e,i=r??s+o;return n?n===t?`${n}${i}`:`${n}/${i}`:`${t}${i}`},E={join:C,resolve:m,dirname:v,basename:f,extname:S,normalize:y,isAbsolute:k,relative:I,parse:N,format:U,sep:P,delimiter:W};var $=e=>{if(typeof Deno<"u"&&Deno.env?.get)return Deno.env.get(e);let t=globalThis.process;if(t?.env)return t.env[e]},F=(...e)=>{for(let t of e){let n=$(t);if(n!==void 0)return n}},T=e=>{try{let t=globalThis.require;if(t instanceof Function)return t(e)}catch{}},D=()=>globalThis.process,M=()=>globalThis.navigator,a=globalThis,j=()=>typeof a.caches<"u"&&typeof a.Request<"u"&&typeof a.Response<"u"&&typeof a.window>"u"&&typeof a.document>"u",z=()=>typeof a.window<"u"||typeof a.document<"u",u=()=>{if(typeof globalThis>"u")return"unknown";if(typeof a.Bun<"u")return"bun";if(typeof a.Deno<"u")return"deno";let e=a.process;return e?.versions?.node&&!e?.versions?.bun?"node":j()?"workerd":z()?"browser":"unknown"},L={deno:()=>a.Deno?.version?.deno??"unknown",bun:()=>a.Bun?.version??"unknown",node:()=>a.process?.versions?.node??"unknown",workerd:()=>"unknown",browser:()=>a.navigator?.userAgent??"unknown",unknown:()=>"unknown"},re=()=>L[u()](),oe=e=>u()===e,ie=()=>u()==="browser",_=new Set(["deno","node","bun"]),se=()=>_.has(u()),ae=()=>u()==="workerd",O={darwin:"darwin",linux:"linux",windows:"windows",win32:"windows"},x=()=>{if(typeof Deno<"u"&&Deno.build?.os)return O[Deno.build.os]??"linux";let e=D();if(e?.platform)return O[e.platform]??"linux";let t=M();if(t?.userAgent){let n=t.userAgent.toLowerCase();if(n.includes("mac"))return"darwin";if(n.includes("win"))return"windows";if(n.includes("linux"))return"linux"}return"linux"},A={x86_64:"amd64",x64:"amd64",aarch64:"arm64",arm64:"arm64"},B=()=>{if(typeof Deno<"u"&&Deno.build?.arch)return A[Deno.build.arch]??"amd64";let e=D();if(e?.arch)return A[e.arch]??"amd64";let t=M();if(t?.userAgent){let n=t.userAgent.toLowerCase();if(n.includes("arm64")||n.includes("aarch64"))return"arm64"}return"amd64"},q=()=>{let e=F("HOME","USERPROFILE");if(e)return e;let t=T("os");return t?.homedir?t.homedir():x()==="windows"?"C:\\Users\\Default":"/home"},J=()=>{let e=F("TMPDIR","TMP","TEMP");if(e)return e;let t=T("os");return t?.tmpdir?t.tmpdir():x()==="windows"?"C:\\Windows\\Temp":"/tmp"},de=()=>({platform:x(),arch:B(),homedir:q(),tmpdir:J()}),h=e=>e==="inherit"?"inherit":e==="piped"?"pipe":"ignore";var V=e=>({stdin:e?.stdin??"null",stdout:e?.stdout??"piped",stderr:e?.stderr??"piped"}),le=e=>{let t=V(e);return[h(t.stdin),h(t.stdout),h(t.stderr)]};var ce=(e,t)=>{let n={spawn:e,spawnChild:t,async exec(r,o=[],s){let i=await e(r,o,s);if(!i.success){let g=new TextDecoder().decode(i.stderr);throw new p(r,i.code,g)}return new TextDecoder().decode(i.stdout).trim()},async execJson(r,o=[],s){let i=await n.exec(r,o,s);return JSON.parse(i)}};return n},b=(e,t)=>()=>{throw new d(e,t)},H=e=>{let t=b("fs",e);return{readFile:t,readTextFile:t,writeFile:t,writeTextFile:t,exists:t,stat:t,lstat:t,mkdir:t,ensureDir:t,remove:t,readDir:t,copyFile:t,rename:t,makeTempDir:t,realPath:t,watch:t,walk:t,chmod:t}},X=e=>{let t=b("exec",e);return{spawn:t,exec:t,execJson:t,spawnChild:t}},Z=e=>{let t=b("process",e);return{exit:t,setExitCode:t,cwd:t,chdir:t,hostname:t,execPath:t,get argv(){throw new d("process",e)},get argv0(){throw new d("process",e)},get args(){throw new d("process",e)},get pid(){throw new d("process",e)},get stdin(){throw new d("process",e)},get stdout(){throw new d("process",e)},get stderr(){throw new d("process",e)},isTerminal(){return!1},setStdinRaw(){throw new d("process",e)},writeToStdout(){throw new d("process",e)},consoleSize(){return{columns:80,rows:24}}}},G=()=>({get:()=>{},set:()=>{},delete:()=>{},has:()=>!1,toObject:()=>({})}),ue=e=>({name:e,version:"unknown",capabilities:{fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},fs:H(e),path:E,exec:X(e),env:G(),process:Z(e)});export{d as a,w as b,R as c,p as d,Y as e,E as f,u as g,re as h,oe as i,ie as j,se as k,ae as l,x as m,B as n,q as o,J as p,de as q,V as r,le as s,ce as t,H as u,X as v,Z as w,G as x,ue as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u,c as Ae,d,e as $,f as S,g as b,h as O,i as Oe,k as R,l as _,n as U,o as he,q as ee,r as te}from"./chunk-Y6AFIAJP.js";import{b as C}from"./chunk-MNEZ5QGX.js";import{d as N}from"./chunk-OTRBRRIO.js";var h=Symbol("tui.cancel"),Ke=e=>e===h,Ee={ctrlC:"exit",escape:"cancel"},Fe=()=>{try{return C.process.stdin}catch{return new ReadableStream}},He=e=>{let t=e?.interaction??(e?.target==="non-interactive"?"non-interactive":"interactive"),r=e?.audience??"human",s=t==="non-interactive"?"non-interactive":"interactive",n=t==="interactive";return{output:e?.output??he({renderer:n?te.ansi():te.plain(),sink:n?ee.stdout():ee.stderr()}),input:e?.input??Fe(),target:s,interaction:t,audience:r,signals:{...Ee,...e?.signals},stderr:e?.stderr??he({renderer:te.plain(),sink:ee.stderr()})}};var Pe={};N(Pe,{disableMouse:()=>We,enableMouse:()=>qe,isSGRMouseSequence:()=>ye,parseMouseEvent:()=>fe});var qe=()=>"\x1B[?1000h\x1B[?1002h\x1B[?1006h",We=()=>"\x1B[?1006l\x1B[?1002l\x1B[?1000l",je=/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/,fe=e=>{let t=e.match(je);if(t===null)return null;let r=parseInt(t[1],10),s=parseInt(t[2],10)-1,n=parseInt(t[3],10)-1,i=t[4]==="m",o=r&3,a=(r&4)!==0,c=(r&16)!==0,p=(r&32)!==0;return(r&64)!==0?{type:"wheel",button:0,x:s,y:n,shift:a,ctrl:c,direction:r&1?"down":"up"}:p?{type:"mousemove",button:o,x:s,y:n,shift:a,ctrl:c}:{type:i?"mouseup":"mousedown",button:o,x:s,y:n,shift:a,ctrl:c}},ye=e=>e.length>=4&&e[0]===27&&e[1]===91&&e[2]===60;var E=async e=>{let t=!1;if(C.capabilities.stdin&&C.process.isTerminal("stdin"))try{C.process.setStdinRaw(!0),t=!0}catch{}try{return await e()}finally{if(t)try{C.process.setStdinRaw(!1)}catch{}}},P=e=>{e.write(u("\x1B[?25l"))},k=e=>{e.write(u("\x1B[?25h"))},f=(e,t)=>{t>0&&e.write(u(`\x1B[${t}A\x1B[J`))};var Le=e=>{let t=new Uint8Array(e);if(e.length===1&&e[0]===3)return{name:"c",ctrl:!0,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===27)return{name:"escape",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&(e[0]===13||e[0]===10))return{name:"return",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===9)return{name:"tab",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===127)return{name:"backspace",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length>=3&&e[0]===27&&e[1]===91)switch(e[2]){case 65:return{name:"up",ctrl:!1,meta:!1,shift:!1,raw:t};case 66:return{name:"down",ctrl:!1,meta:!1,shift:!1,raw:t};case 67:return{name:"right",ctrl:!1,meta:!1,shift:!1,raw:t};case 68:return{name:"left",ctrl:!1,meta:!1,shift:!1,raw:t};case 72:return{name:"home",ctrl:!1,meta:!1,shift:!1,raw:t};case 70:return{name:"end",ctrl:!1,meta:!1,shift:!1,raw:t}}if(e.length===1&&e[0]>=1&&e[0]<=26)return{name:String.fromCharCode(e[0]+96),ctrl:!0,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===32)return{name:"space",char:" ",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]>=33&&e[0]<=126){let r=String.fromCharCode(e[0]);return{name:r,char:r,ctrl:!1,meta:!1,shift:!1,raw:t}}if(e.length>0&&e[0]>=192){let r=new TextDecoder().decode(e);return{name:r,char:r,ctrl:!1,meta:!1,shift:!1,raw:t}}return{name:"unknown",ctrl:!1,meta:!1,shift:!1,raw:t}};async function*L(e,t){let r=e.getReader();try{for(;!t?.aborted;){let{done:s,value:n}=await r.read();if(s||n===void 0)break;yield Le(n)}}finally{r.releaseLock()}}async function*ze(e,t){let r=e.getReader(),s=new TextDecoder;try{for(;!t?.aborted;){let{done:n,value:i}=await r.read();if(n||i===void 0)break;if(ye(i)){let o=s.decode(i),a=fe(o);if(a!==null){yield{kind:"mouse",event:a};continue}}yield{kind:"key",event:Le(i)}}}finally{r.releaseLock()}}var v=(e,t)=>{if(e==="exit"){k(t.output);try{C.process.setStdinRaw(!1)}catch{}C.process.exit(130)}return e==="cancel"?"cancel":"continue"};var g="\u2502",Be="\u250C",w="\u2514";var re="\u25CF",se="\u25CB",Me="\u25FC",Ie="\u25FB",I="\u25C6",T="\u25C7",A="\u25A0",Ne="\u25CF";var D="\u25B2";var _e="\u25C7";var ne=(e,t,r,s)=>{if(s==="done"){let o=r?"Yes":"No";return e.output.writeln(b(T),u(` ${t}`),d(` \xB7 ${o}`)),1}if(s==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let n=r?$(b(re),u(" Yes")):$(d(se),d(" Yes")),i=r?$(d(se),d(" No")):$(b(re),u(" No"));return e.output.writeln(R(I),u(` ${t}`)),e.output.writeln(d(g),u(" "),n,d(" / "),i),e.output.writeln(d(w)),3},Xe=async(e,t)=>{let r=t.initialValue??!0,s=0;P(e.output);try{return await E(async()=>{s=ne(e,t.message,r,"active"),await e.output.flush();let n=()=>{f(e.output,s),ne(e,t.message,r,"cancel")};for await(let i of L(e.input)){if(i.name==="c"&&i.ctrl){if(v(e.signals.ctrlC,e)==="cancel")return n(),await e.output.flush(),h;continue}if(i.name==="escape"){if(v(e.signals.escape,e)==="cancel")return n(),await e.output.flush(),h;continue}if(i.name==="return")return f(e.output,s),ne(e,t.message,r,"done"),await e.output.flush(),r;let o=!1;(i.name==="left"||i.name==="right")&&(r=!r,o=!0),(i.name==="y"||i.name==="Y")&&(r=!0,o=!0),(i.name==="n"||i.name==="N")&&(r=!1,o=!0),o&&(f(e.output,s),s=ne(e,t.message,r,"active"),await e.output.flush())}return h})}finally{k(e.output),await e.output.flush()}};var F=(e,t,r,s,n,i)=>{if(i==="done")return e.output.writeln(b(T),u(` ${t}`),d(` \xB7 ${r}`)),1;if(i==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let o=r.length>0?u(r):s!==void 0?d(s):u(""),a=n!==void 0?O(D):R(I);e.output.writeln(a,u(` ${t}`)),e.output.writeln(d(g),u(" "),o);let c=2;return n!==void 0?(e.output.writeln(d(w),u(" "),O(n)),c=3):(e.output.writeln(d(w)),c=3),c},Ye=async(e,t)=>{let r=t.initialValue??"",s=r.length,n,i=0;P(e.output);try{return await E(async()=>{i=F(e,t.message,r,t.placeholder,n,"active"),await e.output.flush();let o=()=>{f(e.output,i),F(e,t.message,r,t.placeholder,void 0,"cancel")};for await(let a of L(e.input)){if(a.name==="c"&&a.ctrl){if(v(e.signals.ctrlC,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="escape"){if(v(e.signals.escape,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="return"){if(t.validate!==void 0){let c=t.validate(r);if(c!==void 0){n=c,f(e.output,i),i=F(e,t.message,r,t.placeholder,n,"active"),await e.output.flush();continue}}return f(e.output,i),F(e,t.message,r,t.placeholder,void 0,"done"),await e.output.flush(),r}if(n=void 0,a.name==="backspace")s>0&&(r=r.slice(0,s-1)+r.slice(s),s--);else if(a.name==="left")s>0&&s--;else if(a.name==="right")s<r.length&&s++;else if(a.name==="home")s=0;else if(a.name==="end")s=r.length;else if(a.char!==void 0)r=r.slice(0,s)+a.char+r.slice(s),s++;else continue;f(e.output,i),i=F(e,t.message,r,t.placeholder,n,"active"),await e.output.flush()}return h})}finally{k(e.output),await e.output.flush()}};var H=(e,t,r,s,n,i,o)=>{if(o==="done"){let p=[...n].sort((l,m)=>l-m).map(l=>r[l]?.label??"").join(", ");return e.output.writeln(b(T),u(` ${t}`),d(` \xB7 ${p}`)),1}if(o==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let a=i!==void 0?O(D):R(I);e.output.writeln(a,u(` ${t}`));for(let p=0;p<r.length;p++){let l=r[p],m=p===s,y=n.has(p),G=l.disabled===!0,ce=y?b(Me):d(Ie),pe=G?d(` ${l.label}`):m?u(` ${l.label}`):d(` ${l.label}`),de=l.hint!==void 0?d(` (${l.hint})`):u("");e.output.writeln(d(g),u(" "),ce,pe,de)}let c=r.length+2;return i!==void 0?e.output.writeln(d(w),u(" "),O(i)):e.output.writeln(d(w)),c},ge=(e,t,r)=>{let s=e.length,n=t;for(let i=0;i<s;i++)if(n=(n+r+s)%s,e[n]?.disabled!==!0)return n;return t},Je=async(e,t)=>{let r=0,s=new Set;if(t.initialValues!==void 0)for(let o of t.initialValues){let a=t.options.findIndex(c=>c.value===o);a>=0&&s.add(a)}t.options[r]?.disabled===!0&&(r=ge(t.options,r,1));let n=0,i;P(e.output);try{return await E(async()=>{n=H(e,t.message,t.options,r,s,i,"active"),await e.output.flush();let o=()=>{f(e.output,n),H(e,t.message,t.options,r,s,void 0,"cancel")};for await(let a of L(e.input)){if(a.name==="c"&&a.ctrl){if(v(e.signals.ctrlC,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="escape"){if(v(e.signals.escape,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="return"){if(t.required!==!1&&s.size===0){i="Please select at least one option.",f(e.output,n),n=H(e,t.message,t.options,r,s,i,"active"),await e.output.flush();continue}return f(e.output,n),H(e,t.message,t.options,r,s,void 0,"done"),await e.output.flush(),[...s].sort((p,l)=>p-l).map(p=>t.options[p].value)}i=void 0;let c=!1;if((a.name==="up"||a.name==="k")&&(r=ge(t.options,r,-1),c=!0),(a.name==="down"||a.name==="j")&&(r=ge(t.options,r,1),c=!0),a.name==="space"&&t.options[r]?.disabled!==!0&&(s.has(r)?s.delete(r):s.add(r),c=!0),a.name==="a"){let p=t.options.every((l,m)=>l.disabled===!0||s.has(m));for(let l=0;l<t.options.length;l++)t.options[l]?.disabled!==!0&&(p?s.delete(l):s.add(l));c=!0}c&&(f(e.output,n),n=H(e,t.message,t.options,r,s,i,"active"),await e.output.flush())}return h})}finally{k(e.output),await e.output.flush()}};var Ze=(e,t)=>{e.output.writeln(_(Be),u(" "),Ae(t)),e.output.writeln(_(g))},Qe=(e,t)=>{e.output.writeln(_(g)),e.output.writeln(_(w),u(" "),u(t))},et=e=>{e.output.writeln(u(""))},tt=(e,t)=>{e.output.writeln(u(" "),d(t))},rt=e=>{e.output.writeln(_(g))},st={info:(e,t)=>{e.output.writeln(U("info",t))},success:(e,t)=>{e.output.writeln(U("success",t))},warn:(e,t)=>{e.output.writeln(U("warning",t))},error:(e,t)=>{e.output.writeln(U("error",t))},step:(e,t)=>{e.output.writeln(d(_e),u(" "),d(t))},message:(e,t,r)=>{e.output.writeln(d(r??g),u(" "),u(t))}};var nt=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],it=80,ot=(e,t,r)=>{let s=r?.frames??nt,n=r?.interval??it,i=t,o=0,a,c=()=>{e.output.write(u(`\r${" ".repeat(i.length+4)}\r`))},p=()=>{a!==void 0&&(clearInterval(a),a=void 0,c())};return{start:l=>{l!==void 0&&(i=l),a=setInterval(()=>{let m=s[o%s.length];e.output.write(u("\r"),R(m??""),u(` ${i}`)),o++},n)},stop:l=>{p(),l!==void 0&&(i=l)},update:l=>{i=l},succeed:l=>{p(),e.output.writeln(b(T),u(` ${l??i}`))},fail:l=>{p(),e.output.writeln(S(A),u(` ${l??i}`))},warn:l=>{p(),e.output.writeln(O(D),u(` ${l??i}`))},info:l=>{p(),e.output.writeln(Oe(Ne),u(` ${l??i}`))}}};var De={};N(De,{clearScreenSeq:()=>pt,enterAlternateScreen:()=>at,exitAlternateScreen:()=>lt,getTerminalSize:()=>dt,hideCursorSeq:()=>ut,showCursorSeq:()=>ct});var at=()=>"\x1B[?1049h",lt=()=>"\x1B[?1049l",ut=()=>"\x1B[?25l",ct=()=>"\x1B[?25h",pt=()=>"\x1B[2J\x1B[H",dt=()=>{try{let{columns:e,rows:t}=Deno.consoleSize();return{cols:e,rows:t}}catch{return{cols:80,rows:24}}};var le={};N(le,{bgBlue:()=>yt,bgGreen:()=>ft,bold:()=>mt,cyan:()=>we,dim:()=>ie,green:()=>oe,inverse:()=>Ce,moveTo:()=>x,red:()=>xe,reset:()=>ae,stripAnsi:()=>ve,truncate:()=>W,visibleLength:()=>q,white:()=>ht,yellow:()=>be});var x=(e,t)=>`\x1B[${e};${t}H`,mt=e=>`\x1B[1m${e}\x1B[22m`,ie=e=>`\x1B[2m${e}\x1B[22m`,oe=e=>`\x1B[32m${e}\x1B[39m`,be=e=>`\x1B[33m${e}\x1B[39m`,xe=e=>`\x1B[31m${e}\x1B[39m`,we=e=>`\x1B[36m${e}\x1B[39m`,ht=e=>`\x1B[37m${e}\x1B[39m`,ft=e=>`\x1B[42m${e}\x1B[49m`,yt=e=>`\x1B[44m${e}\x1B[49m`,Ce=e=>`\x1B[7m${e}\x1B[27m`,ae=()=>"\x1B[0m",gt=/\x1b\[[0-9;]*[a-zA-Z]/g,ve=e=>e.replace(gt,""),q=e=>ve(e).length,W=(e,t)=>{if(ve(e).length<=t)return e;let s=0,n=0,i=e;for(;n<i.length&&s<t-1;){if(i[n]==="\x1B"){let o=i.indexOf("m",n);if(o!==-1){n=o+1;continue}}s++,n++}return i.slice(0,n)+"\u2026"+ae()};var Ge={};N(Ge,{calculateLayout:()=>bt});var bt=(e,t,r)=>{let s=r.leftWidth<=1?Math.floor(e*r.leftWidth):Math.min(Math.floor(r.leftWidth),e),n=e-s,i=t-1,o=r.rightTopHeight<=1?Math.floor(i*r.rightTopHeight):Math.min(Math.floor(r.rightTopHeight),i),a=i-o;return{left:{id:"left",x:1,y:1,width:s,height:i},rightTop:{id:"rightTop",x:s+1,y:1,width:n,height:o},rightBottom:{id:"rightBottom",x:s+1,y:o+1,width:n,height:a},statusBar:{id:"statusBar",x:1,y:t,width:e,height:1}}};var $e={};N($e,{nextSelectableIndex:()=>wt,renderList:()=>Ct});var xt=(e,t)=>{switch(t){case"green":return oe(e);case"yellow":return be(e);case"red":return xe(e);case"cyan":return we(e);case"dim":return ie(e);default:return e}},wt=(e,t,r)=>{let s=r==="up"?-1:1,n=t+s;for(;n>=0&&n<e.length;){if(e[n].selectable!==!1)return n;n+=s}return t},Ct=(e,t,r)=>{let s=[],n=r.width-2,i=r.height-2,o=0;t>=i&&(o=t-i+1);for(let a=0;a<i;a++){let c=o+a,p=r.y+1+a;if(c>=e.length){s.push(x(p,r.x+1)+" ".repeat(n));continue}let l=e[c],m=l.selectable!==!1,y=c===t&&m,G=l.active?oe("\u25CF"):y?"\u25B8":" ",ce=l.badge!==void 0?" "+xt(`[${l.badge}]`,l.badgeColor??"dim"):"",pe=l.dimmed?ie(l.label):l.label,de=` ${G} ${pe}${ce}`,me=W(de,n),ke=Math.max(0,n-q(me));y?s.push(x(p,r.x+1)+Ce(me+" ".repeat(ke))):s.push(x(p,r.x+1)+me+" ".repeat(ke))}return s.join("")};var z=()=>({char:" ",fg:-1,bg:-1,fgRGB:null,bgRGB:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1}),ue=(e,t)=>{let r=[];for(let s=0;s<e;s++){let n=[];for(let i=0;i<t;i++)n.push(z());r.push(n)}return r},j=e=>{let t=[];for(let r=0;r<e;r++)t.push(z());return t},X=class{#e;#t;#r;#i=null;#o=0;#n;#s=new Set;constructor(t,r){this.#e=t,this.#t=r,this.#r=ue(t,r),this.#n=t-1}get rows(){return this.#e}get cols(){return this.#t}getCell(t,r){return t<0||t>=this.#e||r<0||r>=this.#t?z():this.#r[t][r]}setCell(t,r,s,n){t<0||t>=this.#e||r<0||r>=this.#t||(this.#r[t][r]={char:n,fg:s.fg,bg:s.bg,fgRGB:s.fgRGB,bgRGB:s.bgRGB,bold:s.bold,dim:s.dim,italic:s.italic,underline:s.underline,inverse:s.inverse},this.#s.add(t))}scrollUp(t=1){for(let r=0;r<t;r++)this.#r.splice(this.#o,1),this.#r.splice(this.#n,0,j(this.#t));for(let r=this.#o;r<=this.#n;r++)this.#s.add(r)}scrollDown(t=1){for(let r=0;r<t;r++)this.#r.splice(this.#n,1),this.#r.splice(this.#o,0,j(this.#t));for(let r=this.#o;r<=this.#n;r++)this.#s.add(r)}setScrollRegion(t,r){this.#o=Math.max(0,t),this.#n=Math.min(this.#e-1,r)}insertLines(t,r){for(let s=0;s<t;s++)this.#r.splice(this.#n,1),this.#r.splice(r,0,j(this.#t));for(let s=r;s<=this.#n;s++)this.#s.add(s)}deleteLines(t,r){for(let s=0;s<t;s++)this.#r.splice(r,1),this.#r.splice(this.#n,0,j(this.#t));for(let s=r;s<=this.#n;s++)this.#s.add(s)}clearLine(t,r){if(t<0||t>=this.#e)return;let s=this.#r[t];if(r===2)for(let n=0;n<this.#t;n++)s[n]=z();this.#s.add(t)}clearLineRange(t,r,s){if(t<0||t>=this.#e)return;let n=this.#r[t];for(let i=r;i<=Math.min(s,this.#t-1);i++)n[i]=z();this.#s.add(t)}clearDisplay(t,r,s){if(t===0){this.clearLineRange(r,s,this.#t-1);for(let n=r+1;n<this.#e;n++)this.clearLine(n,2)}else if(t===1){for(let n=0;n<r;n++)this.clearLine(n,2);this.clearLineRange(r,0,s)}else{this.#r=ue(this.#e,this.#t);for(let n=0;n<this.#e;n++)this.#s.add(n)}}enterAlternateScreen(){this.#i=this.#r,this.#r=ue(this.#e,this.#t);for(let t=0;t<this.#e;t++)this.#s.add(t)}exitAlternateScreen(){if(this.#i!==null){this.#r=this.#i,this.#i=null;for(let t=0;t<this.#e;t++)this.#s.add(t)}}resize(t,r){let s=ue(t,r),n=Math.min(t,this.#e),i=Math.min(r,this.#t);for(let o=0;o<n;o++)for(let a=0;a<i;a++)s[o][a]=this.#r[o][a];this.#e=t,this.#t=r,this.#r=s,this.#n=t-1;for(let o=0;o<t;o++)this.#s.add(o)}getLine(t){return t<0||t>=this.#e?j(this.#t):this.#r[t]}getGrid(){return this.#r}getDirtyLines(){return this.#s}clearDirty(){this.#s.clear()}markAllDirty(){for(let t=0;t<this.#e;t++)this.#s.add(t)}};var Y=class{row=0;col=0;visible=!0;#e=0;#t=0;moveTo(t,r){this.row=t,this.col=r}moveUp(t=1){this.row=Math.max(0,this.row-t)}moveDown(t=1){this.row+=t}moveForward(t=1){this.col+=t}moveBack(t=1){this.col=Math.max(0,this.col-t)}moveToColumn(t){this.col=t}save(){this.#e=this.row,this.#t=this.col}restore(){this.row=this.#e,this.col=this.#t}clamp(t,r){this.row=Math.max(0,Math.min(this.row,t-1)),this.col=Math.max(0,Math.min(this.col,r-1))}};var J=()=>({fg:-1,bg:-1,fgRGB:null,bgRGB:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1}),Te=(e,t)=>{let r={...t},s=0;for(;s<e.length;){let n=e[s];switch(n){case 0:Object.assign(r,J());break;case 1:r.bold=!0;break;case 2:r.dim=!0;break;case 3:r.italic=!0;break;case 4:r.underline=!0;break;case 7:r.inverse=!0;break;case 22:r.bold=!1,r.dim=!1;break;case 23:r.italic=!1;break;case 24:r.underline=!1;break;case 27:r.inverse=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:r.fg=n-30;break;case 39:r.fg=-1;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:r.bg=n-40;break;case 49:r.bg=-1;break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:r.fg=n-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r.bg=n-100+8;break;case 38:s+1<e.length&&e[s+1]===5&&s+2<e.length?(r.fg=e[s+2],r.fgRGB=null,s+=2):s+1<e.length&&e[s+1]===2&&s+4<e.length&&(r.fgRGB={r:e[s+2],g:e[s+3],b:e[s+4]},r.fg=-1,s+=4);break;case 48:s+1<e.length&&e[s+1]===5&&s+2<e.length?(r.bg=e[s+2],r.bgRGB=null,s+=2):s+1<e.length&&e[s+1]===2&&s+4<e.length&&(r.bgRGB={r:e[s+2],g:e[s+3],b:e[s+4]},r.bg=-1,s+=4);break}s++}return r};var Z=class{#e="GROUND";#t="";#r="";#i="";feed(t){let r=[],s=()=>{this.#i.length>0&&(r.push({type:"text",text:this.#i}),this.#i="")};for(let n=0;n<t.length;n++){let i=t[n],o=i.charCodeAt(0);switch(this.#e){case"GROUND":i==="\x1B"?(s(),this.#e="ESC"):o<32&&o!==27?(s(),r.push({type:"control",code:o})):this.#i+=i;break;case"ESC":i==="["?(this.#e="CSI_PARAM",this.#t=""):i==="]"?(this.#e="OSC",this.#r=""):(r.push({type:"esc",command:i}),this.#e="GROUND");break;case"CSI_PARAM":if(o>=48&&o<=63||i===";"||i==="?")this.#t+=i;else if(o>=64&&o<=126){let a=this.#t.replace(/^\?/,""),c=this.#t.startsWith("?"),p=a.length>0?a.split(";").map(m=>{let y=parseInt(m,10);return isNaN(y)?0:y}):[],l=(c?"?":"")+i;r.push({type:"csi",command:l,params:p}),this.#e="GROUND"}else this.#t+=i;break;case"OSC":if(i==="\x07"||i==="\\"&&this.#r.endsWith("\x1B")){let a=i==="\\"?this.#r.slice(0,-1):this.#r,c=a.indexOf(";"),p=c>=0?parseInt(a.slice(0,c),10):0,l=c>=0?a.slice(c+1):a;r.push({type:"osc",command:isNaN(p)?0:p,data:l}),this.#e="GROUND"}else this.#r+=i;break}}return s(),r}};var Q=class{screen;cursor;#e;#t;constructor(t,r){this.screen=new X(t,r),this.cursor=new Y,this.#e=new Z,this.#t=J()}write(t){let r=this.#e.feed(t);for(let s of r)switch(s.type){case"text":this.#r(s.text);break;case"csi":this.#o(s.command,s.params);break;case"esc":this.#n(s.command);break;case"control":this.#i(s.code);break;case"osc":break}}resize(t,r){this.screen.resize(t,r),this.cursor.clamp(t,r)}getScreen(){return this.screen}getCursor(){return this.cursor}#r(t){for(let r of t)this.cursor.col>=this.screen.cols&&(this.cursor.col=0,this.cursor.row++,this.cursor.row>=this.screen.rows&&(this.screen.scrollUp(),this.cursor.row=this.screen.rows-1)),this.screen.setCell(this.cursor.row,this.cursor.col,this.#t,r),this.cursor.col++}#i(t){switch(t){case 13:this.cursor.col=0;break;case 10:this.cursor.row++,this.cursor.row>=this.screen.rows&&(this.screen.scrollUp(),this.cursor.row=this.screen.rows-1);break;case 9:this.cursor.col=Math.min(this.screen.cols-1,(Math.floor(this.cursor.col/8)+1)*8);break;case 8:this.cursor.moveBack();break;case 7:break}}#o(t,r){let s=r[0]??0,n=r[1]??0,i=s||1;switch(t){case"A":this.cursor.moveUp(i);break;case"B":this.cursor.moveDown(i);break;case"C":this.cursor.moveForward(i);break;case"D":this.cursor.moveBack(i);break;case"H":case"f":this.cursor.moveTo((s||1)-1,(n||1)-1);break;case"G":this.cursor.moveToColumn((s||1)-1);break;case"d":this.cursor.moveTo((s||1)-1,this.cursor.col);break;case"J":this.screen.clearDisplay(s,this.cursor.row,this.cursor.col);break;case"K":s===0?this.screen.clearLineRange(this.cursor.row,this.cursor.col,this.screen.cols-1):s===1?this.screen.clearLineRange(this.cursor.row,0,this.cursor.col):this.screen.clearLine(this.cursor.row,2);break;case"m":this.#t=Te(r.length>0?r:[0],this.#t);break;case"S":this.screen.scrollUp(i);break;case"T":this.screen.scrollDown(i);break;case"L":this.screen.insertLines(i,this.cursor.row);break;case"M":this.screen.deleteLines(i,this.cursor.row);break;case"s":this.cursor.save();break;case"u":this.cursor.restore();break;case"r":this.screen.setScrollRegion((s||1)-1,(n||this.screen.rows)-1);break;case"?h":s===25&&(this.cursor.visible=!0),s===1049&&this.screen.enterAlternateScreen();break;case"?l":s===25&&(this.cursor.visible=!1),s===1049&&this.screen.exitAlternateScreen();break}this.cursor.clamp(this.screen.rows,this.screen.cols)}#n(t){switch(t){case"7":this.cursor.save();break;case"8":this.cursor.restore();break;case"M":this.cursor.row===0?this.screen.scrollDown():this.cursor.moveUp();break;case"c":this.screen.clearDisplay(2,0,0),this.cursor.moveTo(0,0),this.#t=J();break}}};var kt=e=>{let t=[];return e.bold&&t.push(1),e.dim&&t.push(2),e.italic&&t.push(3),e.underline&&t.push(4),e.fgRGB!==null?t.push(38,2,e.fgRGB.r,e.fgRGB.g,e.fgRGB.b):e.fg>=0&&e.fg<8?t.push(30+e.fg):e.fg>=8&&e.fg<16?t.push(90+(e.fg-8)):e.fg>=16&&t.push(38,5,e.fg),t.length===0?"":`\x1B[${t.join(";")}m`},At=e=>e.fg===-1&&e.fgRGB===null&&!e.bold&&!e.dim&&!e.italic&&!e.underline,Se=(e,t,r)=>{let s=[],n=e.getDirtyLines(),i=r.fullRedraw===!0||n.size>=r.height,o=Math.min(r.height,e.rows),a=Math.min(r.width,e.cols);for(let c=0;c<o;c++){if(!i&&!n.has(c))continue;s.push(`\x1B[${r.offsetRow+c};${r.offsetCol}H`);let p=e.getLine(c),l=!1,m=0;for(;m<a;m++){let y=m<p.length?p[m]:void 0;if(y===void 0||At(y))l&&(s.push("\x1B[0m"),l=!1),s.push(y?.char??" ");else{let G=kt(y);s.push(G),l=!0,s.push(y.char)}}l&&s.push("\x1B[0m")}return e.clearDirty(),s.join("")};var Re=class{#e;#t=!1;constructor(t,r){this.#e=new Q(t,r)}write(t){this.#e.write(t),this.#t=!0}render(t,r=!1){let s={offsetRow:t.y+1,offsetCol:t.x+1,width:t.width-2,height:t.height-2,fullRedraw:r};return this.#t=!1,Se(this.#e.getScreen(),this.#e.getCursor(),s)}resize(t,r){this.#e.resize(t,r),this.#t=!0}get dirty(){return this.#t}clearDirty(){this.#t=!1}get terminal(){return this.#e}};var Ve={};N(Ve,{drawBox:()=>Ue,fillBox:()=>Pt});var Et={single:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},Ue=e=>{let t=e.borderStyle??"single",r=Et[t],s=e.width-2,n=[],i=r.tl;if(e.title!==void 0){let o=` ${e.title} `;i+=o+r.h.repeat(Math.max(0,s-o.length))}else i+=r.h.repeat(s);if(i+=r.tr,n.push(x(e.y,e.x)+i),e.skipInterior===!0)for(let o=1;o<e.height-1;o++)n.push(x(e.y+o,e.x)+r.v+x(e.y+o,e.x+e.width-1)+r.v);else for(let o=1;o<e.height-1;o++)n.push(x(e.y+o,e.x)+r.v+ae()+" ".repeat(s)+r.v);return n.push(x(e.y+e.height-1,e.x)+r.bl+r.h.repeat(s)+r.br),n.join("")},Pt=(e,t)=>{let r=Ue(e),s=e.width-2,n=e.height-2,i=[];for(let o=0;o<n;o++){let a=o<t.length?t[o]:"",c=W(a??"",s),p=Math.max(0,s-q(c));i.push(x(e.y+1+o,e.x+1)+c+" ".repeat(p))}return r+i.join("")};export{Ke as a,He as b,Pe as c,E as d,ze as e,Xe as f,Ye as g,Je as h,Ze as i,Qe as j,et as k,tt as l,rt as m,st as n,ot as o,De as p,le as q,Ve as r,Ge as s,$e as t,Re as u};
|
|
1
|
+
import{b as u,c as Ae,d,e as $,f as S,g as x,h as O,i as Oe,k as R,l as _,n as U,o as he,q as ee,r as te}from"./chunk-K223KAUB.js";import{b}from"./chunk-RMCTOOQL.js";import{d as N}from"./chunk-OTRBRRIO.js";var h=Symbol("tui.cancel"),Ke=e=>e===h,Ee={ctrlC:"exit",escape:"cancel"},Fe=()=>{try{return b.process.stdin}catch{return new ReadableStream}},He=e=>{let t=e?.interaction??(e?.target==="non-interactive"?"non-interactive":"interactive"),r=e?.audience??"human",s=t==="non-interactive"?"non-interactive":"interactive",n=t==="interactive";return{output:e?.output??he({renderer:n?te.ansi():te.plain(),sink:n?ee.stdout():ee.stderr()}),input:e?.input??Fe(),target:s,interaction:t,audience:r,signals:{...Ee,...e?.signals},stderr:e?.stderr??he({renderer:te.plain(),sink:ee.stderr()})}};var Pe={};N(Pe,{disableMouse:()=>We,enableMouse:()=>qe,isSGRMouseSequence:()=>ye,parseMouseEvent:()=>fe});var qe=()=>"\x1B[?1000h\x1B[?1002h\x1B[?1006h",We=()=>"\x1B[?1006l\x1B[?1002l\x1B[?1000l",je=/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/,fe=e=>{let t=e.match(je);if(t===null)return null;let r=parseInt(t[1],10),s=parseInt(t[2],10)-1,n=parseInt(t[3],10)-1,i=t[4]==="m",o=r&3,a=(r&4)!==0,c=(r&16)!==0,p=(r&32)!==0;return(r&64)!==0?{type:"wheel",button:0,x:s,y:n,shift:a,ctrl:c,direction:r&1?"down":"up"}:p?{type:"mousemove",button:o,x:s,y:n,shift:a,ctrl:c}:{type:i?"mouseup":"mousedown",button:o,x:s,y:n,shift:a,ctrl:c}},ye=e=>e.length>=4&&e[0]===27&&e[1]===91&&e[2]===60;var E=async e=>{let t=!1;if(b.capabilities.stdin&&b.process.isTerminal("stdin"))try{b.process.setStdinRaw(!0),t=!0}catch{}try{return await e()}finally{if(t)try{b.process.setStdinRaw(!1)}catch{}}},P=e=>{e.write(u("\x1B[?25l"))},k=e=>{e.write(u("\x1B[?25h"))},f=(e,t)=>{t>0&&e.write(u(`\x1B[${t}A\x1B[J`))};var Le=e=>{let t=new Uint8Array(e);if(e.length===1&&e[0]===3)return{name:"c",ctrl:!0,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===27)return{name:"escape",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&(e[0]===13||e[0]===10))return{name:"return",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===9)return{name:"tab",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===127)return{name:"backspace",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length>=3&&e[0]===27&&e[1]===91)switch(e[2]){case 65:return{name:"up",ctrl:!1,meta:!1,shift:!1,raw:t};case 66:return{name:"down",ctrl:!1,meta:!1,shift:!1,raw:t};case 67:return{name:"right",ctrl:!1,meta:!1,shift:!1,raw:t};case 68:return{name:"left",ctrl:!1,meta:!1,shift:!1,raw:t};case 72:return{name:"home",ctrl:!1,meta:!1,shift:!1,raw:t};case 70:return{name:"end",ctrl:!1,meta:!1,shift:!1,raw:t}}if(e.length===1&&e[0]>=1&&e[0]<=26)return{name:String.fromCharCode(e[0]+96),ctrl:!0,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]===32)return{name:"space",char:" ",ctrl:!1,meta:!1,shift:!1,raw:t};if(e.length===1&&e[0]>=33&&e[0]<=126){let r=String.fromCharCode(e[0]);return{name:r,char:r,ctrl:!1,meta:!1,shift:!1,raw:t}}if(e.length>0&&e[0]>=192){let r=new TextDecoder().decode(e);return{name:r,char:r,ctrl:!1,meta:!1,shift:!1,raw:t}}return{name:"unknown",ctrl:!1,meta:!1,shift:!1,raw:t}};async function*L(e,t){let r=e.getReader();try{for(;!t?.aborted;){let{done:s,value:n}=await r.read();if(s||n===void 0)break;yield Le(n)}}finally{r.releaseLock()}}async function*ze(e,t){let r=e.getReader(),s=new TextDecoder;try{for(;!t?.aborted;){let{done:n,value:i}=await r.read();if(n||i===void 0)break;if(ye(i)){let o=s.decode(i),a=fe(o);if(a!==null){yield{kind:"mouse",event:a};continue}}yield{kind:"key",event:Le(i)}}}finally{r.releaseLock()}}var v=(e,t)=>{if(e==="exit"){k(t.output);try{b.process.setStdinRaw(!1)}catch{}b.process.exit(130)}return e==="cancel"?"cancel":"continue"};var g="\u2502",Be="\u250C",C="\u2514";var re="\u25CF",se="\u25CB",Me="\u25FC",Ie="\u25FB",I="\u25C6",T="\u25C7",A="\u25A0",Ne="\u25CF";var D="\u25B2";var _e="\u25C7";var ne=(e,t,r,s)=>{if(s==="done"){let o=r?"Yes":"No";return e.output.writeln(x(T),u(` ${t}`),d(` \xB7 ${o}`)),1}if(s==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let n=r?$(x(re),u(" Yes")):$(d(se),d(" Yes")),i=r?$(d(se),d(" No")):$(x(re),u(" No"));return e.output.writeln(R(I),u(` ${t}`)),e.output.writeln(d(g),u(" "),n,d(" / "),i),e.output.writeln(d(C)),3},Xe=async(e,t)=>{let r=t.initialValue??!0,s=0;P(e.output);try{return await E(async()=>{s=ne(e,t.message,r,"active"),await e.output.flush();let n=()=>{f(e.output,s),ne(e,t.message,r,"cancel")};for await(let i of L(e.input)){if(i.name==="c"&&i.ctrl){if(v(e.signals.ctrlC,e)==="cancel")return n(),await e.output.flush(),h;continue}if(i.name==="escape"){if(v(e.signals.escape,e)==="cancel")return n(),await e.output.flush(),h;continue}if(i.name==="return")return f(e.output,s),ne(e,t.message,r,"done"),await e.output.flush(),r;let o=!1;(i.name==="left"||i.name==="right")&&(r=!r,o=!0),(i.name==="y"||i.name==="Y")&&(r=!0,o=!0),(i.name==="n"||i.name==="N")&&(r=!1,o=!0),o&&(f(e.output,s),s=ne(e,t.message,r,"active"),await e.output.flush())}return h})}finally{k(e.output),await e.output.flush()}};var F=(e,t,r,s,n,i)=>{if(i==="done")return e.output.writeln(x(T),u(` ${t}`),d(` \xB7 ${r}`)),1;if(i==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let o=r.length>0?u(r):s!==void 0?d(s):u(""),a=n!==void 0?O(D):R(I);e.output.writeln(a,u(` ${t}`)),e.output.writeln(d(g),u(" "),o);let c=2;return n!==void 0?(e.output.writeln(d(C),u(" "),O(n)),c=3):(e.output.writeln(d(C)),c=3),c},Ye=async(e,t)=>{let r=t.initialValue??"",s=r.length,n,i=0;P(e.output);try{return await E(async()=>{i=F(e,t.message,r,t.placeholder,n,"active"),await e.output.flush();let o=()=>{f(e.output,i),F(e,t.message,r,t.placeholder,void 0,"cancel")};for await(let a of L(e.input)){if(a.name==="c"&&a.ctrl){if(v(e.signals.ctrlC,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="escape"){if(v(e.signals.escape,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="return"){if(t.validate!==void 0){let c=t.validate(r);if(c!==void 0){n=c,f(e.output,i),i=F(e,t.message,r,t.placeholder,n,"active"),await e.output.flush();continue}}return f(e.output,i),F(e,t.message,r,t.placeholder,void 0,"done"),await e.output.flush(),r}if(n=void 0,a.name==="backspace")s>0&&(r=r.slice(0,s-1)+r.slice(s),s--);else if(a.name==="left")s>0&&s--;else if(a.name==="right")s<r.length&&s++;else if(a.name==="home")s=0;else if(a.name==="end")s=r.length;else if(a.char!==void 0)r=r.slice(0,s)+a.char+r.slice(s),s++;else continue;f(e.output,i),i=F(e,t.message,r,t.placeholder,n,"active"),await e.output.flush()}return h})}finally{k(e.output),await e.output.flush()}};var H=(e,t,r,s,n,i,o)=>{if(o==="done"){let p=[...n].sort((l,m)=>l-m).map(l=>r[l]?.label??"").join(", ");return e.output.writeln(x(T),u(` ${t}`),d(` \xB7 ${p}`)),1}if(o==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let a=i!==void 0?O(D):R(I);e.output.writeln(a,u(` ${t}`));for(let p=0;p<r.length;p++){let l=r[p],m=p===s,y=n.has(p),G=l.disabled===!0,ce=y?x(Me):d(Ie),pe=G?d(` ${l.label}`):m?u(` ${l.label}`):d(` ${l.label}`),de=l.hint!==void 0?d(` (${l.hint})`):u("");e.output.writeln(d(g),u(" "),ce,pe,de)}let c=r.length+2;return i!==void 0?e.output.writeln(d(C),u(" "),O(i)):e.output.writeln(d(C)),c},ge=(e,t,r)=>{let s=e.length,n=t;for(let i=0;i<s;i++)if(n=(n+r+s)%s,e[n]?.disabled!==!0)return n;return t},Je=async(e,t)=>{let r=0,s=new Set;if(t.initialValues!==void 0)for(let o of t.initialValues){let a=t.options.findIndex(c=>c.value===o);a>=0&&s.add(a)}t.options[r]?.disabled===!0&&(r=ge(t.options,r,1));let n=0,i;P(e.output);try{return await E(async()=>{n=H(e,t.message,t.options,r,s,i,"active"),await e.output.flush();let o=()=>{f(e.output,n),H(e,t.message,t.options,r,s,void 0,"cancel")};for await(let a of L(e.input)){if(a.name==="c"&&a.ctrl){if(v(e.signals.ctrlC,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="escape"){if(v(e.signals.escape,e)==="cancel")return o(),await e.output.flush(),h;continue}if(a.name==="return"){if(t.required!==!1&&s.size===0){i="Please select at least one option.",f(e.output,n),n=H(e,t.message,t.options,r,s,i,"active"),await e.output.flush();continue}return f(e.output,n),H(e,t.message,t.options,r,s,void 0,"done"),await e.output.flush(),[...s].sort((p,l)=>p-l).map(p=>t.options[p].value)}i=void 0;let c=!1;if((a.name==="up"||a.name==="k")&&(r=ge(t.options,r,-1),c=!0),(a.name==="down"||a.name==="j")&&(r=ge(t.options,r,1),c=!0),a.name==="space"&&t.options[r]?.disabled!==!0&&(s.has(r)?s.delete(r):s.add(r),c=!0),a.name==="a"){let p=t.options.every((l,m)=>l.disabled===!0||s.has(m));for(let l=0;l<t.options.length;l++)t.options[l]?.disabled!==!0&&(p?s.delete(l):s.add(l));c=!0}c&&(f(e.output,n),n=H(e,t.message,t.options,r,s,i,"active"),await e.output.flush())}return h})}finally{k(e.output),await e.output.flush()}};var Ze=(e,t)=>{e.output.writeln(_(Be),u(" "),Ae(t)),e.output.writeln(_(g))},Qe=(e,t)=>{e.output.writeln(_(g)),e.output.writeln(_(C),u(" "),u(t))},et=e=>{e.output.writeln(u(""))},tt=(e,t)=>{e.output.writeln(u(" "),d(t))},rt=e=>{e.output.writeln(_(g))},st={info:(e,t)=>{e.output.writeln(U("info",t))},success:(e,t)=>{e.output.writeln(U("success",t))},warn:(e,t)=>{e.output.writeln(U("warning",t))},error:(e,t)=>{e.output.writeln(U("error",t))},step:(e,t)=>{e.output.writeln(d(_e),u(" "),d(t))},message:(e,t,r)=>{e.output.writeln(d(r??g),u(" "),u(t))}};var nt=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],it=80,ot=(e,t,r)=>{let s=r?.frames??nt,n=r?.interval??it,i=t,o=0,a,c=()=>{e.output.write(u(`\r${" ".repeat(i.length+4)}\r`))},p=()=>{a!==void 0&&(clearInterval(a),a=void 0,c())};return{start:l=>{l!==void 0&&(i=l),a=setInterval(()=>{let m=s[o%s.length];e.output.write(u("\r"),R(m??""),u(` ${i}`)),o++},n)},stop:l=>{p(),l!==void 0&&(i=l)},update:l=>{i=l},succeed:l=>{p(),e.output.writeln(x(T),u(` ${l??i}`))},fail:l=>{p(),e.output.writeln(S(A),u(` ${l??i}`))},warn:l=>{p(),e.output.writeln(O(D),u(` ${l??i}`))},info:l=>{p(),e.output.writeln(Oe(Ne),u(` ${l??i}`))}}};var De={};N(De,{clearScreenSeq:()=>pt,enterAlternateScreen:()=>at,exitAlternateScreen:()=>lt,getTerminalSize:()=>dt,hideCursorSeq:()=>ut,showCursorSeq:()=>ct});var at=()=>"\x1B[?1049h",lt=()=>"\x1B[?1049l",ut=()=>"\x1B[?25l",ct=()=>"\x1B[?25h",pt=()=>"\x1B[2J\x1B[H",dt=()=>{try{let{columns:e,rows:t}=b.process.consoleSize();return{cols:e,rows:t}}catch{return{cols:80,rows:24}}};var le={};N(le,{bgBlue:()=>yt,bgGreen:()=>ft,bold:()=>mt,cyan:()=>we,dim:()=>ie,green:()=>oe,inverse:()=>Ce,moveTo:()=>w,red:()=>xe,reset:()=>ae,stripAnsi:()=>ve,truncate:()=>W,visibleLength:()=>q,white:()=>ht,yellow:()=>be});var w=(e,t)=>`\x1B[${e};${t}H`,mt=e=>`\x1B[1m${e}\x1B[22m`,ie=e=>`\x1B[2m${e}\x1B[22m`,oe=e=>`\x1B[32m${e}\x1B[39m`,be=e=>`\x1B[33m${e}\x1B[39m`,xe=e=>`\x1B[31m${e}\x1B[39m`,we=e=>`\x1B[36m${e}\x1B[39m`,ht=e=>`\x1B[37m${e}\x1B[39m`,ft=e=>`\x1B[42m${e}\x1B[49m`,yt=e=>`\x1B[44m${e}\x1B[49m`,Ce=e=>`\x1B[7m${e}\x1B[27m`,ae=()=>"\x1B[0m",gt=/\x1b\[[0-9;]*[a-zA-Z]/g,ve=e=>e.replace(gt,""),q=e=>ve(e).length,W=(e,t)=>{if(ve(e).length<=t)return e;let s=0,n=0,i=e;for(;n<i.length&&s<t-1;){if(i[n]==="\x1B"){let o=i.indexOf("m",n);if(o!==-1){n=o+1;continue}}s++,n++}return i.slice(0,n)+"\u2026"+ae()};var Ge={};N(Ge,{calculateLayout:()=>bt});var bt=(e,t,r)=>{let s=r.leftWidth<=1?Math.floor(e*r.leftWidth):Math.min(Math.floor(r.leftWidth),e),n=e-s,i=t-1,o=r.rightTopHeight<=1?Math.floor(i*r.rightTopHeight):Math.min(Math.floor(r.rightTopHeight),i),a=i-o;return{left:{id:"left",x:1,y:1,width:s,height:i},rightTop:{id:"rightTop",x:s+1,y:1,width:n,height:o},rightBottom:{id:"rightBottom",x:s+1,y:o+1,width:n,height:a},statusBar:{id:"statusBar",x:1,y:t,width:e,height:1}}};var $e={};N($e,{nextSelectableIndex:()=>wt,renderList:()=>Ct});var xt=(e,t)=>{switch(t){case"green":return oe(e);case"yellow":return be(e);case"red":return xe(e);case"cyan":return we(e);case"dim":return ie(e);default:return e}},wt=(e,t,r)=>{let s=r==="up"?-1:1,n=t+s;for(;n>=0&&n<e.length;){if(e[n].selectable!==!1)return n;n+=s}return t},Ct=(e,t,r)=>{let s=[],n=r.width-2,i=r.height-2,o=0;t>=i&&(o=t-i+1);for(let a=0;a<i;a++){let c=o+a,p=r.y+1+a;if(c>=e.length){s.push(w(p,r.x+1)+" ".repeat(n));continue}let l=e[c],m=l.selectable!==!1,y=c===t&&m,G=l.active?oe("\u25CF"):y?"\u25B8":" ",ce=l.badge!==void 0?" "+xt(`[${l.badge}]`,l.badgeColor??"dim"):"",pe=l.dimmed?ie(l.label):l.label,de=` ${G} ${pe}${ce}`,me=W(de,n),ke=Math.max(0,n-q(me));y?s.push(w(p,r.x+1)+Ce(me+" ".repeat(ke))):s.push(w(p,r.x+1)+me+" ".repeat(ke))}return s.join("")};var z=()=>({char:" ",fg:-1,bg:-1,fgRGB:null,bgRGB:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1}),ue=(e,t)=>{let r=[];for(let s=0;s<e;s++){let n=[];for(let i=0;i<t;i++)n.push(z());r.push(n)}return r},j=e=>{let t=[];for(let r=0;r<e;r++)t.push(z());return t},X=class{#e;#t;#r;#i=null;#o=0;#n;#s=new Set;constructor(t,r){this.#e=t,this.#t=r,this.#r=ue(t,r),this.#n=t-1}get rows(){return this.#e}get cols(){return this.#t}getCell(t,r){return t<0||t>=this.#e||r<0||r>=this.#t?z():this.#r[t][r]}setCell(t,r,s,n){t<0||t>=this.#e||r<0||r>=this.#t||(this.#r[t][r]={char:n,fg:s.fg,bg:s.bg,fgRGB:s.fgRGB,bgRGB:s.bgRGB,bold:s.bold,dim:s.dim,italic:s.italic,underline:s.underline,inverse:s.inverse},this.#s.add(t))}scrollUp(t=1){for(let r=0;r<t;r++)this.#r.splice(this.#o,1),this.#r.splice(this.#n,0,j(this.#t));for(let r=this.#o;r<=this.#n;r++)this.#s.add(r)}scrollDown(t=1){for(let r=0;r<t;r++)this.#r.splice(this.#n,1),this.#r.splice(this.#o,0,j(this.#t));for(let r=this.#o;r<=this.#n;r++)this.#s.add(r)}setScrollRegion(t,r){this.#o=Math.max(0,t),this.#n=Math.min(this.#e-1,r)}insertLines(t,r){for(let s=0;s<t;s++)this.#r.splice(this.#n,1),this.#r.splice(r,0,j(this.#t));for(let s=r;s<=this.#n;s++)this.#s.add(s)}deleteLines(t,r){for(let s=0;s<t;s++)this.#r.splice(r,1),this.#r.splice(this.#n,0,j(this.#t));for(let s=r;s<=this.#n;s++)this.#s.add(s)}clearLine(t,r){if(t<0||t>=this.#e)return;let s=this.#r[t];if(r===2)for(let n=0;n<this.#t;n++)s[n]=z();this.#s.add(t)}clearLineRange(t,r,s){if(t<0||t>=this.#e)return;let n=this.#r[t];for(let i=r;i<=Math.min(s,this.#t-1);i++)n[i]=z();this.#s.add(t)}clearDisplay(t,r,s){if(t===0){this.clearLineRange(r,s,this.#t-1);for(let n=r+1;n<this.#e;n++)this.clearLine(n,2)}else if(t===1){for(let n=0;n<r;n++)this.clearLine(n,2);this.clearLineRange(r,0,s)}else{this.#r=ue(this.#e,this.#t);for(let n=0;n<this.#e;n++)this.#s.add(n)}}enterAlternateScreen(){this.#i=this.#r,this.#r=ue(this.#e,this.#t);for(let t=0;t<this.#e;t++)this.#s.add(t)}exitAlternateScreen(){if(this.#i!==null){this.#r=this.#i,this.#i=null;for(let t=0;t<this.#e;t++)this.#s.add(t)}}resize(t,r){let s=ue(t,r),n=Math.min(t,this.#e),i=Math.min(r,this.#t);for(let o=0;o<n;o++)for(let a=0;a<i;a++)s[o][a]=this.#r[o][a];this.#e=t,this.#t=r,this.#r=s,this.#n=t-1;for(let o=0;o<t;o++)this.#s.add(o)}getLine(t){return t<0||t>=this.#e?j(this.#t):this.#r[t]}getGrid(){return this.#r}getDirtyLines(){return this.#s}clearDirty(){this.#s.clear()}markAllDirty(){for(let t=0;t<this.#e;t++)this.#s.add(t)}};var Y=class{row=0;col=0;visible=!0;#e=0;#t=0;moveTo(t,r){this.row=t,this.col=r}moveUp(t=1){this.row=Math.max(0,this.row-t)}moveDown(t=1){this.row+=t}moveForward(t=1){this.col+=t}moveBack(t=1){this.col=Math.max(0,this.col-t)}moveToColumn(t){this.col=t}save(){this.#e=this.row,this.#t=this.col}restore(){this.row=this.#e,this.col=this.#t}clamp(t,r){this.row=Math.max(0,Math.min(this.row,t-1)),this.col=Math.max(0,Math.min(this.col,r-1))}};var J=()=>({fg:-1,bg:-1,fgRGB:null,bgRGB:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1}),Te=(e,t)=>{let r={...t},s=0;for(;s<e.length;){let n=e[s];switch(n){case 0:Object.assign(r,J());break;case 1:r.bold=!0;break;case 2:r.dim=!0;break;case 3:r.italic=!0;break;case 4:r.underline=!0;break;case 7:r.inverse=!0;break;case 22:r.bold=!1,r.dim=!1;break;case 23:r.italic=!1;break;case 24:r.underline=!1;break;case 27:r.inverse=!1;break;case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:r.fg=n-30;break;case 39:r.fg=-1;break;case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:r.bg=n-40;break;case 49:r.bg=-1;break;case 90:case 91:case 92:case 93:case 94:case 95:case 96:case 97:r.fg=n-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r.bg=n-100+8;break;case 38:s+1<e.length&&e[s+1]===5&&s+2<e.length?(r.fg=e[s+2],r.fgRGB=null,s+=2):s+1<e.length&&e[s+1]===2&&s+4<e.length&&(r.fgRGB={r:e[s+2],g:e[s+3],b:e[s+4]},r.fg=-1,s+=4);break;case 48:s+1<e.length&&e[s+1]===5&&s+2<e.length?(r.bg=e[s+2],r.bgRGB=null,s+=2):s+1<e.length&&e[s+1]===2&&s+4<e.length&&(r.bgRGB={r:e[s+2],g:e[s+3],b:e[s+4]},r.bg=-1,s+=4);break}s++}return r};var Z=class{#e="GROUND";#t="";#r="";#i="";feed(t){let r=[],s=()=>{this.#i.length>0&&(r.push({type:"text",text:this.#i}),this.#i="")};for(let n=0;n<t.length;n++){let i=t[n],o=i.charCodeAt(0);switch(this.#e){case"GROUND":i==="\x1B"?(s(),this.#e="ESC"):o<32&&o!==27?(s(),r.push({type:"control",code:o})):this.#i+=i;break;case"ESC":i==="["?(this.#e="CSI_PARAM",this.#t=""):i==="]"?(this.#e="OSC",this.#r=""):(r.push({type:"esc",command:i}),this.#e="GROUND");break;case"CSI_PARAM":if(o>=48&&o<=63||i===";"||i==="?")this.#t+=i;else if(o>=64&&o<=126){let a=this.#t.replace(/^\?/,""),c=this.#t.startsWith("?"),p=a.length>0?a.split(";").map(m=>{let y=parseInt(m,10);return isNaN(y)?0:y}):[],l=(c?"?":"")+i;r.push({type:"csi",command:l,params:p}),this.#e="GROUND"}else this.#t+=i;break;case"OSC":if(i==="\x07"||i==="\\"&&this.#r.endsWith("\x1B")){let a=i==="\\"?this.#r.slice(0,-1):this.#r,c=a.indexOf(";"),p=c>=0?parseInt(a.slice(0,c),10):0,l=c>=0?a.slice(c+1):a;r.push({type:"osc",command:isNaN(p)?0:p,data:l}),this.#e="GROUND"}else this.#r+=i;break}}return s(),r}};var Q=class{screen;cursor;#e;#t;constructor(t,r){this.screen=new X(t,r),this.cursor=new Y,this.#e=new Z,this.#t=J()}write(t){let r=this.#e.feed(t);for(let s of r)switch(s.type){case"text":this.#r(s.text);break;case"csi":this.#o(s.command,s.params);break;case"esc":this.#n(s.command);break;case"control":this.#i(s.code);break;case"osc":break}}resize(t,r){this.screen.resize(t,r),this.cursor.clamp(t,r)}getScreen(){return this.screen}getCursor(){return this.cursor}#r(t){for(let r of t)this.cursor.col>=this.screen.cols&&(this.cursor.col=0,this.cursor.row++,this.cursor.row>=this.screen.rows&&(this.screen.scrollUp(),this.cursor.row=this.screen.rows-1)),this.screen.setCell(this.cursor.row,this.cursor.col,this.#t,r),this.cursor.col++}#i(t){switch(t){case 13:this.cursor.col=0;break;case 10:this.cursor.row++,this.cursor.row>=this.screen.rows&&(this.screen.scrollUp(),this.cursor.row=this.screen.rows-1);break;case 9:this.cursor.col=Math.min(this.screen.cols-1,(Math.floor(this.cursor.col/8)+1)*8);break;case 8:this.cursor.moveBack();break;case 7:break}}#o(t,r){let s=r[0]??0,n=r[1]??0,i=s||1;switch(t){case"A":this.cursor.moveUp(i);break;case"B":this.cursor.moveDown(i);break;case"C":this.cursor.moveForward(i);break;case"D":this.cursor.moveBack(i);break;case"H":case"f":this.cursor.moveTo((s||1)-1,(n||1)-1);break;case"G":this.cursor.moveToColumn((s||1)-1);break;case"d":this.cursor.moveTo((s||1)-1,this.cursor.col);break;case"J":this.screen.clearDisplay(s,this.cursor.row,this.cursor.col);break;case"K":s===0?this.screen.clearLineRange(this.cursor.row,this.cursor.col,this.screen.cols-1):s===1?this.screen.clearLineRange(this.cursor.row,0,this.cursor.col):this.screen.clearLine(this.cursor.row,2);break;case"m":this.#t=Te(r.length>0?r:[0],this.#t);break;case"S":this.screen.scrollUp(i);break;case"T":this.screen.scrollDown(i);break;case"L":this.screen.insertLines(i,this.cursor.row);break;case"M":this.screen.deleteLines(i,this.cursor.row);break;case"s":this.cursor.save();break;case"u":this.cursor.restore();break;case"r":this.screen.setScrollRegion((s||1)-1,(n||this.screen.rows)-1);break;case"?h":s===25&&(this.cursor.visible=!0),s===1049&&this.screen.enterAlternateScreen();break;case"?l":s===25&&(this.cursor.visible=!1),s===1049&&this.screen.exitAlternateScreen();break}this.cursor.clamp(this.screen.rows,this.screen.cols)}#n(t){switch(t){case"7":this.cursor.save();break;case"8":this.cursor.restore();break;case"M":this.cursor.row===0?this.screen.scrollDown():this.cursor.moveUp();break;case"c":this.screen.clearDisplay(2,0,0),this.cursor.moveTo(0,0),this.#t=J();break}}};var kt=e=>{let t=[];return e.bold&&t.push(1),e.dim&&t.push(2),e.italic&&t.push(3),e.underline&&t.push(4),e.fgRGB!==null?t.push(38,2,e.fgRGB.r,e.fgRGB.g,e.fgRGB.b):e.fg>=0&&e.fg<8?t.push(30+e.fg):e.fg>=8&&e.fg<16?t.push(90+(e.fg-8)):e.fg>=16&&t.push(38,5,e.fg),t.length===0?"":`\x1B[${t.join(";")}m`},At=e=>e.fg===-1&&e.fgRGB===null&&!e.bold&&!e.dim&&!e.italic&&!e.underline,Se=(e,t,r)=>{let s=[],n=e.getDirtyLines(),i=r.fullRedraw===!0||n.size>=r.height,o=Math.min(r.height,e.rows),a=Math.min(r.width,e.cols);for(let c=0;c<o;c++){if(!i&&!n.has(c))continue;s.push(`\x1B[${r.offsetRow+c};${r.offsetCol}H`);let p=e.getLine(c),l=!1,m=0;for(;m<a;m++){let y=m<p.length?p[m]:void 0;if(y===void 0||At(y))l&&(s.push("\x1B[0m"),l=!1),s.push(y?.char??" ");else{let G=kt(y);s.push(G),l=!0,s.push(y.char)}}l&&s.push("\x1B[0m")}return e.clearDirty(),s.join("")};var Re=class{#e;#t=!1;constructor(t,r){this.#e=new Q(t,r)}write(t){this.#e.write(t),this.#t=!0}render(t,r=!1){let s={offsetRow:t.y+1,offsetCol:t.x+1,width:t.width-2,height:t.height-2,fullRedraw:r};return this.#t=!1,Se(this.#e.getScreen(),this.#e.getCursor(),s)}resize(t,r){this.#e.resize(t,r),this.#t=!0}get dirty(){return this.#t}clearDirty(){this.#t=!1}get terminal(){return this.#e}};var Ve={};N(Ve,{drawBox:()=>Ue,fillBox:()=>Pt});var Et={single:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},Ue=e=>{let t=e.borderStyle??"single",r=Et[t],s=e.width-2,n=[],i=r.tl;if(e.title!==void 0){let o=` ${e.title} `;i+=o+r.h.repeat(Math.max(0,s-o.length))}else i+=r.h.repeat(s);if(i+=r.tr,n.push(w(e.y,e.x)+i),e.skipInterior===!0)for(let o=1;o<e.height-1;o++)n.push(w(e.y+o,e.x)+r.v+w(e.y+o,e.x+e.width-1)+r.v);else for(let o=1;o<e.height-1;o++)n.push(w(e.y+o,e.x)+r.v+ae()+" ".repeat(s)+r.v);return n.push(w(e.y+e.height-1,e.x)+r.bl+r.h.repeat(s)+r.br),n.join("")},Pt=(e,t)=>{let r=Ue(e),s=e.width-2,n=e.height-2,i=[];for(let o=0;o<n;o++){let a=o<t.length?t[o]:"",c=W(a??"",s),p=Math.max(0,s-q(c));i.push(w(e.y+1+o,e.x+1)+c+" ".repeat(p))}return r+i.join("")};export{Ke as a,He as b,Pe as c,E as d,ze as e,Xe as f,Ye as g,Je as h,Ze as i,Qe as j,et as k,tt as l,rt as m,st as n,ot as o,De as p,le as q,Ve as r,Ge as s,$e as t,Re as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-
|
|
1
|
+
import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-NRCHLNQA.js";import{a as c}from"./chunk-OLM5RTFK.js";import"./chunk-ON7NJA2P.js";import"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as ClaudeCodeModel,P as claudeCodeFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-2X2U2VC5.js";import"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";export{c as cmd,b as cmdPrefix,d as extractPrefix,a as setCommandPrefix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as A}from"./chunk-MRZT23BL.js";import{b as $,c as b}from"./chunk-
|
|
1
|
+
import{b as A}from"./chunk-MRZT23BL.js";import{b as $,c as b}from"./chunk-2X2U2VC5.js";import{l as k,m as y,n as x,o as P}from"./chunk-PL7WF7NC.js";import{c as d,d as c,f as u,g as C,o as m,q as w,r as g}from"./chunk-K223KAUB.js";import{a as l,b as p}from"./chunk-2N4GTHXQ.js";import{b as v}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var q=async s=>{let e=s?.[0];if(e==="add")return await I(s?.slice(1));if(e==="remove")return await M(s?.slice(1));if(e==="list")return await R();let r=$(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${r} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=(s??[]).filter(i=>!i.startsWith("-")),t=await k(r);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await A(),o=[];for(let i of n){let f=await x(r,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await P(r,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(t.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...t,concerns:[...t.concerns,...o]};await y(r,i),e.writeln(C("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=s?.[0],t=await k(r);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!t.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...t,concerns:t.concerns.filter(o=>o!==n)};return await y(r,a),e.writeln(C("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},R=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),e=v.process.cwd(),r=await k(e),n=await A(),t=r?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=t.includes(a.id);s.writeln(" ",o?C("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{q as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as D,d as Q,r as G}from"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";import he from"node:process";function X(){let e=globalThis,r=e.Deno?.build?.os;return typeof r=="string"?r==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var A=X();function C(e){if(typeof e!="string")throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function H(e,r){if(r.length>=e.length)return e;let t=e.length-r.length;for(let o=r.length-1;o>=0;--o)if(e.charCodeAt(t+o)!==r.charCodeAt(o))return e;return e.slice(0,-r.length)}function k(e,r,t=0){let o=!1,s=e.length;for(let i=e.length-1;i>=t;--i)if(r(e.charCodeAt(i))){if(o){t=i+1;break}}else o||(o=!0,s=i+1);return e.slice(t,s)}function L(e,r){if(C(e),e.length===0)return e;if(typeof r!="string")throw new TypeError(`Suffix must be a string, received "${JSON.stringify(r)}"`)}function U(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function P(e){return e=U(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function S(e,r){if(e.length<=1)return e;let t=e.length;for(let o=e.length-1;o>0&&r(e.charCodeAt(o));o--)t=o;return e.slice(0,t)}function p(e){return e===47}function Y(e,r=""){e instanceof URL&&(e=P(e)),L(e,r);let t=k(e,p),o=S(t,p);return r?H(o,r):o}function V(e){return e===47}function m(e){return e===47||e===92}function R(e){return e>=97&&e<=122||e>=65&&e<=90}function E(e){e=U(e);let r=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(r=`\\\\${e.hostname}${r}`),r}function q(e,r=""){e instanceof URL&&(e=E(e)),L(e,r);let t=0;if(e.length>=2){let i=e.charCodeAt(0);R(i)&&e.charCodeAt(1)===58&&(t=2)}let o=k(e,m,t),s=S(o,m);return r?H(s,r):s}function ee(e,r=""){return A?q(e,r):Y(e,r)}var re=A?";":":",B=A?"\\":"/";function W(e){if(C(e),e.length===0)return"."}function te(e){e instanceof URL&&(e=P(e)),W(e);let r=-1,t=!1;for(let o=e.length-1;o>=1;--o)if(p(e.charCodeAt(o))){if(t){r=o;break}}else t=!0;return r===-1?p(e.charCodeAt(0))?"/":".":S(e.slice(0,r),p)}function oe(e){e instanceof URL&&(e=E(e)),W(e);let r=e.length,t=-1,o=-1,s=!0,i=0,a=e.charCodeAt(0);if(r>1)if(m(a)){if(t=i=1,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return e;n!==l&&(t=i=n+1)}}}}else R(a)&&e.charCodeAt(1)===58&&(t=i=2,r>2&&m(e.charCodeAt(2))&&(t=i=3));else if(m(a))return e;for(let n=r-1;n>=i;--n)if(m(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return S(e.slice(0,o),V)}function ie(e){return A?oe(e):te(e)}function ne(e){e instanceof URL&&(e=P(e)),C(e);let r=-1,t=0,o=-1,s=!0,i=0;for(let a=e.length-1;a>=0;--a){let n=e.charCodeAt(a);if(p(n)){if(!s){t=a+1;break}continue}o===-1&&(s=!1,o=a+1),n===46?r===-1?r=a:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||o===-1||i===0||i===1&&r===o-1&&r===t+1?"":e.slice(r,o)}function se(e){e instanceof URL&&(e=E(e)),C(e);let r=0,t=-1,o=0,s=-1,i=!0,a=0;e.length>=2&&e.charCodeAt(1)===58&&R(e.charCodeAt(0))&&(r=o=2);for(let n=e.length-1;n>=r;--n){let l=e.charCodeAt(n);if(m(l)){if(!i){o=n+1;break}continue}s===-1&&(i=!1,s=n+1),l===46?t===-1?t=n:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||s===-1||a===0||a===1&&t===s-1&&t===o+1?"":e.slice(t,s)}function ae(e){return A?se(e):ne(e)}function N(e,r){let t=r.dir||r.root,o=r.base||(r.name??"")+(r.ext??"");return t?o===e?t:t===r.root?t+o:t+e+o:o}function $(e){if(e===null||typeof e!="object")throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof e}"`)}function fe(e){return $(e),N("/",e)}function le(e){return $(e),N("\\",e)}function ce(e){return A?le(e):fe(e)}function j(e){return C(e),e.length>0&&p(e.charCodeAt(0))}function M(e){C(e);let r=e.length;if(r===0)return!1;let t=e.charCodeAt(0);return m(t)?!0:!!(R(t)&&r>2&&e.charCodeAt(1)===58&&m(e.charCodeAt(2)))}function me(e){return A?M(e):j(e)}function I(e){if(C(e),e.length===0)return"."}function _(e,r,t,o){let s="",i=0,a=-1,n=0,l;for(let f=0;f<=e.length;++f){if(f<e.length)l=e.charCodeAt(f);else{if(o(l))break;l=47}if(o(l)){if(!(a===f-1||n===1))if(a!==f-1&&n===2){if(s.length<2||i!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){let d=s.lastIndexOf(t);d===-1?(s="",i=0):(s=s.slice(0,d),i=s.length-1-s.lastIndexOf(t)),a=f,n=0;continue}else if(s.length===2||s.length===1){s="",i=0,a=f,n=0;continue}}r&&(s.length>0?s+=`${t}..`:s="..",i=2)}else s.length>0?s+=t+e.slice(a+1,f):s=e.slice(a+1,f),i=f-a-1;a=f,n=0}else l===46&&n!==-1?++n:n=-1}return s}function F(e){e instanceof URL&&(e=P(e)),I(e);let r=p(e.charCodeAt(0)),t=p(e.charCodeAt(e.length-1));return e=_(e,!r,"/",p),e.length===0&&!r&&(e="."),e.length>0&&t&&(e+="/"),r?`/${e}`:e}function K(e,...r){if(e===void 0)return".";e instanceof URL&&(e=P(e)),r=e?[e,...r]:r,r.forEach(o=>C(o));let t=r.filter(o=>o.length>0).join("/");return t===""?".":F(t)}function b(e){e instanceof URL&&(e=E(e)),I(e);let r=e.length,t=0,o,s=!1,i=e.charCodeAt(0);if(r>1)if(m(i))if(s=!0,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){let f=e.slice(l,n);for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return`\\\\${f}\\${e.slice(l)}\\`;n!==l&&(o=`\\\\${f}\\${e.slice(l,n)}`,t=n)}}}else t=1;else R(i)&&e.charCodeAt(1)===58&&(o=e.slice(0,2),t=2,r>2&&m(e.charCodeAt(2))&&(s=!0,t=3));else if(m(i))return"\\";let a;return t<r?a=_(e.slice(t),!s,"\\",m):a="",a.length===0&&!s&&(a="."),a.length>0&&m(e.charCodeAt(r-1))&&(a+="\\"),o===void 0?s?a.length>0?`\\${a}`:"\\":a:s?a.length>0?`${o}\\${a}`:`${o}\\`:o+a}function Z(e,...r){if(e instanceof URL&&(e=E(e)),r=e?[e,...r]:r,r.forEach(a=>C(a)),r=r.filter(a=>a.length>0),r.length===0)return".";let t=!0,o=0,s=r[0];if(m(s.charCodeAt(0))){++o;let a=s.length;a>1&&m(s.charCodeAt(1))&&(++o,a>2&&(m(s.charCodeAt(2))?++o:t=!1))}let i=r.join("\\");if(t){for(;o<i.length&&m(i.charCodeAt(o));++o);o>=2&&(i=`\\${i.slice(o)}`)}return b(i)}function J(e,...r){return A?Z(e,...r):K(e,...r)}function de(e){return A?b(e):F(e)}function ue(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;let t=p(e.charCodeAt(0)),o;t?(r.root="/",o=1):o=0;let s=-1,i=0,a=-1,n=!0,l=e.length-1,f=0;for(;l>=o;--l){let d=e.charCodeAt(l);if(p(d)){if(!n){i=l+1;break}continue}a===-1&&(n=!1,a=l+1),d===46?s===-1?s=l:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||a===-1||f===0||f===1&&s===a-1&&s===i+1?(a!==-1&&(i===0&&t?r.base=r.name=e.slice(1,a):r.base=r.name=e.slice(i,a)),r.base=r.base||"/"):(i===0&&t?(r.name=e.slice(1,s),r.base=e.slice(1,a)):(r.name=e.slice(i,s),r.base=e.slice(i,a)),r.ext=e.slice(s,a)),i>0?r.dir=S(e.slice(0,i-1),p):t&&(r.dir="/"),r}function pe(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""},t=e.length;if(t===0)return r;let o=0,s=e.charCodeAt(0);if(t>1){if(m(s)){if(o=1,m(e.charCodeAt(1))){let u=2,c=u;for(;u<t&&!m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&!m(e.charCodeAt(u));++u);u===t?o=u:u!==c&&(o=u+1)}}}}else if(R(s)&&e.charCodeAt(1)===58)if(o=2,t>2){if(m(e.charCodeAt(2))){if(t===3)return r.root=r.dir=e,r.base="\\",r;o=3}}else return r.root=r.dir=e,r}else if(m(s))return r.root=r.dir=e,r.base="\\",r;o>0&&(r.root=e.slice(0,o));let i=-1,a=o,n=-1,l=!0,f=e.length-1,d=0;for(;f>=o;--f){if(s=e.charCodeAt(f),m(s)){if(!l){a=f+1;break}continue}n===-1&&(l=!1,n=f+1),s===46?i===-1?i=f:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||n===-1||d===0||d===1&&i===n-1&&i===a+1?n!==-1&&(r.base=r.name=e.slice(a,n)):(r.name=e.slice(a,i),r.base=e.slice(a,n),r.ext=e.slice(i,n)),r.base=r.base||"\\",a>0&&a!==o?r.dir=e.slice(0,a-1):r.dir=r.root,r}function Ae(e){return A?pe(e):ue(e)}function O(...e){let r="",t=!1;for(let o=e.length-1;o>=-1&&!t;o--){let s;if(o>=0)s=e[o];else{let{Deno:i}=globalThis;if(typeof i?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");s=i.cwd()}C(s),s.length!==0&&(r=`${s}/${r}`,t=p(s.charCodeAt(0)))}return r=_(r,!t,"/",p),t?r.length>0?`/${r}`:"/":r.length>0?r:"."}function z(e,r){if(C(e),C(r),e===r)return""}function Ce(e,r){if(z(e,r),e=O(e),r=O(r),e===r)return"";let t=1,o=e.length;for(;t<o&&p(e.charCodeAt(t));++t);let s=o-t,i=1,a=r.length;for(;i<a&&p(r.charCodeAt(i));++i);let n=a-i,l=s<n?s:n,f=-1,d=0;for(;d<=l;++d){if(d===l){if(n>l){if(p(r.charCodeAt(i+d)))return r.slice(i+d+1);if(d===0)return r.slice(i+d)}else s>l&&(p(e.charCodeAt(t+d))?f=d:d===0&&(f=0));break}let c=e.charCodeAt(t+d),x=r.charCodeAt(i+d);if(c!==x)break;p(c)&&(f=d)}let u="";for(d=t+f+1;d<=o;++d)(d===o||p(e.charCodeAt(d)))&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(i+f):(i+=f,p(r.charCodeAt(i))&&++i,r.slice(i))}function T(...e){let r="",t="",o=!1;for(let s=e.length-1;s>=-1;s--){let i,{Deno:a}=globalThis;if(s>=0)i=e[s];else if(r){if(typeof a?.env?.get!="function"||typeof a?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");i=a.cwd(),(i===void 0||i.slice(0,3).toLowerCase()!==`${r.toLowerCase()}\\`)&&(i=`${r}\\`)}else{if(typeof a?.cwd!="function")throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");i=a.cwd()}C(i);let n=i.length;if(n===0)continue;let l=0,f="",d=!1,u=i.charCodeAt(0);if(n>1)if(m(u))if(d=!0,m(i.charCodeAt(1))){let c=2,x=c;for(;c<n&&!m(i.charCodeAt(c));++c);if(c<n&&c!==x){let v=i.slice(x,c);for(x=c;c<n&&m(i.charCodeAt(c));++c);if(c<n&&c!==x){for(x=c;c<n&&!m(i.charCodeAt(c));++c);c===n?(f=`\\\\${v}\\${i.slice(x)}`,l=c):c!==x&&(f=`\\\\${v}\\${i.slice(x,c)}`,l=c)}}}else l=1;else R(u)&&i.charCodeAt(1)===58&&(f=i.slice(0,2),l=2,n>2&&m(i.charCodeAt(2))&&(d=!0,l=3));else m(u)&&(l=1,d=!0);if(!(f.length>0&&r.length>0&&f.toLowerCase()!==r.toLowerCase())&&(r.length===0&&f.length>0&&(r=f),o||(t=`${i.slice(l)}\\${t}`,o=d),o&&r.length>0))break}return t=_(t,!o,"\\",m),r+(o?"\\":"")+t||"."}function xe(e,r){z(e,r);let t=T(e),o=T(r);if(t===o||(e=t.toLowerCase(),r=o.toLowerCase(),e===r))return"";let s=0,i=e.length;for(;s<i&&e.charCodeAt(s)===92;++s);for(;i-1>s&&e.charCodeAt(i-1)===92;--i);let a=i-s,n=0,l=r.length;for(;n<l&&r.charCodeAt(n)===92;++n);for(;l-1>n&&r.charCodeAt(l-1)===92;--l);let f=l-n,d=a<f?a:f,u=-1,c=0;for(;c<=d;++c){if(c===d){if(f>d){if(r.charCodeAt(n+c)===92)return o.slice(n+c+1);if(c===2)return o.slice(n+c)}a>d&&(e.charCodeAt(s+c)===92?u=c:c===2&&(u=3));break}let v=e.charCodeAt(s+c),we=r.charCodeAt(n+c);if(v!==we)break;v===92&&(u=c)}if(c!==d&&u===-1)return o;let x="";for(u===-1&&(u=0),c=s+u+1;c<=i;++c)(c===i||e.charCodeAt(c)===92)&&(x.length===0?x+="..":x+="\\..");return x.length>0?x+o.slice(n+u,l):(n+=u,o.charCodeAt(n)===92&&++n,o.slice(n,l))}function Re(e,r){return A?xe(e,r):Ce(e,r)}function ge(...e){return A?T(...e):O(...e)}var be={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},Oe=()=>{let e=r=>({isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink,size:r.size,mtime:r.mtime,atime:r.atime,birthtime:r.birthtime});return{async readFile(r,t){try{return await Deno.readFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async readTextFile(r,t){try{return await Deno.readTextFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async writeFile(r,t,o){await Deno.writeFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async writeTextFile(r,t,o){await Deno.writeTextFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async exists(r){try{return await Deno.stat(r),!0}catch(t){if(t instanceof Deno.errors.NotFound)return!1;throw t}},async stat(r){try{let t=await Deno.stat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async lstat(r){try{let t=await Deno.lstat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async mkdir(r,t){await Deno.mkdir(r,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(r){try{await Deno.mkdir(r,{recursive:!0})}catch(t){if(!(t instanceof Deno.errors.AlreadyExists))throw t}},async remove(r,t){try{await Deno.remove(r,{recursive:t?.recursive??!1})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async*readDir(r){try{for await(let t of Deno.readDir(r))yield{name:t.name,isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink}}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async copyFile(r,t){await Deno.copyFile(r,t)},async rename(r,t){await Deno.rename(r,t)},async makeTempDir(r){return await Deno.makeTempDir({dir:r?.dir,prefix:r?.prefix,suffix:r?.suffix})},async realPath(r){try{return await Deno.realPath(r)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},watch(r,t){let o=t?.recursive??!0,s=Deno.watchFs(r,{recursive:o}),i=a=>({kind:a.kind,paths:a.paths,flag:a.flag});return{close:()=>s.close(),[Symbol.asyncIterator]:async function*(){for await(let a of s)yield i(a)}}},async*walk(r,t){let o=t?.includeDirs??!0,s=t?.includeFiles??!0,i=t?.exts,a=t?.skip,n=async function*(l){for await(let f of Deno.readDir(l)){let d=J(l,f.name);if(!a?.some(u=>u.test(d))){if(f.isDirectory)o&&(yield{path:d,name:f.name,isFile:!1,isDirectory:!0,isSymlink:f.isSymlink}),yield*n(d);else if(f.isFile||f.isSymlink){if(!s||i&&!i.some(u=>f.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:d,name:f.name,isFile:f.isFile,isDirectory:!1,isSymlink:f.isSymlink}}}}};yield*n(r)},async chmod(r,t){let{chmod:o}=await import("./unstable_chmod-RZ5DE3XZ.js");await o(r,t)}}},He=()=>({join:J,resolve:ge,dirname:ie,basename:ee,extname:ae,normalize:de,isAbsolute:me,relative:Re,parse:Ae,format:ce,sep:B,delimiter:re}),ke=()=>({async spawn(e,r=[],t){let o=G(t),i=await new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).output();return{success:i.success,code:i.code,stdout:o.stdout==="piped"?i.stdout:new Uint8Array,stderr:o.stderr==="piped"?i.stderr:new Uint8Array}},async exec(e,r=[],t){let o=await this.spawn(e,r,t);if(!o.success){let s=new TextDecoder().decode(o.stderr);throw new Q(e,o.code,s)}return new TextDecoder().decode(o.stdout).trim()},async execJson(e,r=[],t){let o=await this.exec(e,r,t);return JSON.parse(o)},spawnChild(e,r=[],t){let o=G(t),i=new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).spawn(),a=(n,l)=>l!=="piped"||!n?Promise.resolve(new Uint8Array):new Response(n).arrayBuffer().then(f=>new Uint8Array(f));return{pid:i.pid,stdin:o.stdin==="piped"?i.stdin:null,stdout:o.stdout==="piped"?i.stdout:null,stderr:o.stderr==="piped"?i.stderr:null,status:i.status.then(n=>({success:n.success,code:n.code,signal:n.signal??void 0})),output:async()=>{let n=o.stdout==="piped"?i.stdout:null,l=o.stderr==="piped"?i.stderr:null,[f,d,u]=await Promise.all([i.status,a(n,o.stdout),a(l,o.stderr)]);return{success:f.success,code:f.code,stdout:d,stderr:u}},kill:n=>{i.kill(n)}}}}),Le=()=>({get(e){return Deno.env.get(e)},set(e,r){Deno.env.set(e,r)},delete(e){Deno.env.delete(e)},has(e){return Deno.env.get(e)!==void 0},toObject(){return Deno.env.toObject()}}),Ue=()=>({exit(e){Deno.exit(e)},setExitCode(e){Deno.exitCode=e},cwd(){return Deno.cwd()},chdir(e){Deno.chdir(e)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},argv:he.argv,argv0:he.argv0,args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable,isTerminal(e){try{switch(e){case"stdin":return Deno.stdin.isTerminal();case"stdout":return Deno.stdout.isTerminal();case"stderr":return Deno.stderr.isTerminal()}}catch{return!1}},setStdinRaw(e){Deno.stdin.setRaw(e)}}),Dn=()=>{let e=Oe(),r=He(),t=ke(),o=Le(),s=Ue();return{name:"deno",version:Deno.version.deno,capabilities:be,fs:e,path:r,exec:t,env:o,process:s}};export{be as DENO_CAPABILITIES,Dn as createDenoRuntime};
|
|
1
|
+
import{b as D,d as Q,r as G}from"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";import ge from"node:process";function X(){let e=globalThis,r=e.Deno?.build?.os;return typeof r=="string"?r==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var A=X();function C(e){if(typeof e!="string")throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function H(e,r){if(r.length>=e.length)return e;let t=e.length-r.length;for(let o=r.length-1;o>=0;--o)if(e.charCodeAt(t+o)!==r.charCodeAt(o))return e;return e.slice(0,-r.length)}function k(e,r,t=0){let o=!1,s=e.length;for(let i=e.length-1;i>=t;--i)if(r(e.charCodeAt(i))){if(o){t=i+1;break}}else o||(o=!0,s=i+1);return e.slice(t,s)}function L(e,r){if(C(e),e.length===0)return e;if(typeof r!="string")throw new TypeError(`Suffix must be a string, received "${JSON.stringify(r)}"`)}function U(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function P(e){return e=U(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function S(e,r){if(e.length<=1)return e;let t=e.length;for(let o=e.length-1;o>0&&r(e.charCodeAt(o));o--)t=o;return e.slice(0,t)}function p(e){return e===47}function Y(e,r=""){e instanceof URL&&(e=P(e)),L(e,r);let t=k(e,p),o=S(t,p);return r?H(o,r):o}function V(e){return e===47}function m(e){return e===47||e===92}function R(e){return e>=97&&e<=122||e>=65&&e<=90}function E(e){e=U(e);let r=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(r=`\\\\${e.hostname}${r}`),r}function q(e,r=""){e instanceof URL&&(e=E(e)),L(e,r);let t=0;if(e.length>=2){let i=e.charCodeAt(0);R(i)&&e.charCodeAt(1)===58&&(t=2)}let o=k(e,m,t),s=S(o,m);return r?H(s,r):s}function ee(e,r=""){return A?q(e,r):Y(e,r)}var re=A?";":":",B=A?"\\":"/";function W(e){if(C(e),e.length===0)return"."}function te(e){e instanceof URL&&(e=P(e)),W(e);let r=-1,t=!1;for(let o=e.length-1;o>=1;--o)if(p(e.charCodeAt(o))){if(t){r=o;break}}else t=!0;return r===-1?p(e.charCodeAt(0))?"/":".":S(e.slice(0,r),p)}function oe(e){e instanceof URL&&(e=E(e)),W(e);let r=e.length,t=-1,o=-1,s=!0,i=0,a=e.charCodeAt(0);if(r>1)if(m(a)){if(t=i=1,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return e;n!==l&&(t=i=n+1)}}}}else R(a)&&e.charCodeAt(1)===58&&(t=i=2,r>2&&m(e.charCodeAt(2))&&(t=i=3));else if(m(a))return e;for(let n=r-1;n>=i;--n)if(m(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return S(e.slice(0,o),V)}function ie(e){return A?oe(e):te(e)}function ne(e){e instanceof URL&&(e=P(e)),C(e);let r=-1,t=0,o=-1,s=!0,i=0;for(let a=e.length-1;a>=0;--a){let n=e.charCodeAt(a);if(p(n)){if(!s){t=a+1;break}continue}o===-1&&(s=!1,o=a+1),n===46?r===-1?r=a:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||o===-1||i===0||i===1&&r===o-1&&r===t+1?"":e.slice(r,o)}function se(e){e instanceof URL&&(e=E(e)),C(e);let r=0,t=-1,o=0,s=-1,i=!0,a=0;e.length>=2&&e.charCodeAt(1)===58&&R(e.charCodeAt(0))&&(r=o=2);for(let n=e.length-1;n>=r;--n){let l=e.charCodeAt(n);if(m(l)){if(!i){o=n+1;break}continue}s===-1&&(i=!1,s=n+1),l===46?t===-1?t=n:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||s===-1||a===0||a===1&&t===s-1&&t===o+1?"":e.slice(t,s)}function ae(e){return A?se(e):ne(e)}function N(e,r){let t=r.dir||r.root,o=r.base||(r.name??"")+(r.ext??"");return t?o===e?t:t===r.root?t+o:t+e+o:o}function $(e){if(e===null||typeof e!="object")throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof e}"`)}function fe(e){return $(e),N("/",e)}function le(e){return $(e),N("\\",e)}function ce(e){return A?le(e):fe(e)}function j(e){return C(e),e.length>0&&p(e.charCodeAt(0))}function M(e){C(e);let r=e.length;if(r===0)return!1;let t=e.charCodeAt(0);return m(t)?!0:!!(R(t)&&r>2&&e.charCodeAt(1)===58&&m(e.charCodeAt(2)))}function me(e){return A?M(e):j(e)}function I(e){if(C(e),e.length===0)return"."}function _(e,r,t,o){let s="",i=0,a=-1,n=0,l;for(let f=0;f<=e.length;++f){if(f<e.length)l=e.charCodeAt(f);else{if(o(l))break;l=47}if(o(l)){if(!(a===f-1||n===1))if(a!==f-1&&n===2){if(s.length<2||i!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){let d=s.lastIndexOf(t);d===-1?(s="",i=0):(s=s.slice(0,d),i=s.length-1-s.lastIndexOf(t)),a=f,n=0;continue}else if(s.length===2||s.length===1){s="",i=0,a=f,n=0;continue}}r&&(s.length>0?s+=`${t}..`:s="..",i=2)}else s.length>0?s+=t+e.slice(a+1,f):s=e.slice(a+1,f),i=f-a-1;a=f,n=0}else l===46&&n!==-1?++n:n=-1}return s}function F(e){e instanceof URL&&(e=P(e)),I(e);let r=p(e.charCodeAt(0)),t=p(e.charCodeAt(e.length-1));return e=_(e,!r,"/",p),e.length===0&&!r&&(e="."),e.length>0&&t&&(e+="/"),r?`/${e}`:e}function K(e,...r){if(e===void 0)return".";e instanceof URL&&(e=P(e)),r=e?[e,...r]:r,r.forEach(o=>C(o));let t=r.filter(o=>o.length>0).join("/");return t===""?".":F(t)}function b(e){e instanceof URL&&(e=E(e)),I(e);let r=e.length,t=0,o,s=!1,i=e.charCodeAt(0);if(r>1)if(m(i))if(s=!0,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){let f=e.slice(l,n);for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return`\\\\${f}\\${e.slice(l)}\\`;n!==l&&(o=`\\\\${f}\\${e.slice(l,n)}`,t=n)}}}else t=1;else R(i)&&e.charCodeAt(1)===58&&(o=e.slice(0,2),t=2,r>2&&m(e.charCodeAt(2))&&(s=!0,t=3));else if(m(i))return"\\";let a;return t<r?a=_(e.slice(t),!s,"\\",m):a="",a.length===0&&!s&&(a="."),a.length>0&&m(e.charCodeAt(r-1))&&(a+="\\"),o===void 0?s?a.length>0?`\\${a}`:"\\":a:s?a.length>0?`${o}\\${a}`:`${o}\\`:o+a}function Z(e,...r){if(e instanceof URL&&(e=E(e)),r=e?[e,...r]:r,r.forEach(a=>C(a)),r=r.filter(a=>a.length>0),r.length===0)return".";let t=!0,o=0,s=r[0];if(m(s.charCodeAt(0))){++o;let a=s.length;a>1&&m(s.charCodeAt(1))&&(++o,a>2&&(m(s.charCodeAt(2))?++o:t=!1))}let i=r.join("\\");if(t){for(;o<i.length&&m(i.charCodeAt(o));++o);o>=2&&(i=`\\${i.slice(o)}`)}return b(i)}function J(e,...r){return A?Z(e,...r):K(e,...r)}function de(e){return A?b(e):F(e)}function ue(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;let t=p(e.charCodeAt(0)),o;t?(r.root="/",o=1):o=0;let s=-1,i=0,a=-1,n=!0,l=e.length-1,f=0;for(;l>=o;--l){let d=e.charCodeAt(l);if(p(d)){if(!n){i=l+1;break}continue}a===-1&&(n=!1,a=l+1),d===46?s===-1?s=l:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||a===-1||f===0||f===1&&s===a-1&&s===i+1?(a!==-1&&(i===0&&t?r.base=r.name=e.slice(1,a):r.base=r.name=e.slice(i,a)),r.base=r.base||"/"):(i===0&&t?(r.name=e.slice(1,s),r.base=e.slice(1,a)):(r.name=e.slice(i,s),r.base=e.slice(i,a)),r.ext=e.slice(s,a)),i>0?r.dir=S(e.slice(0,i-1),p):t&&(r.dir="/"),r}function pe(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""},t=e.length;if(t===0)return r;let o=0,s=e.charCodeAt(0);if(t>1){if(m(s)){if(o=1,m(e.charCodeAt(1))){let u=2,c=u;for(;u<t&&!m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&!m(e.charCodeAt(u));++u);u===t?o=u:u!==c&&(o=u+1)}}}}else if(R(s)&&e.charCodeAt(1)===58)if(o=2,t>2){if(m(e.charCodeAt(2))){if(t===3)return r.root=r.dir=e,r.base="\\",r;o=3}}else return r.root=r.dir=e,r}else if(m(s))return r.root=r.dir=e,r.base="\\",r;o>0&&(r.root=e.slice(0,o));let i=-1,a=o,n=-1,l=!0,f=e.length-1,d=0;for(;f>=o;--f){if(s=e.charCodeAt(f),m(s)){if(!l){a=f+1;break}continue}n===-1&&(l=!1,n=f+1),s===46?i===-1?i=f:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||n===-1||d===0||d===1&&i===n-1&&i===a+1?n!==-1&&(r.base=r.name=e.slice(a,n)):(r.name=e.slice(a,i),r.base=e.slice(a,n),r.ext=e.slice(i,n)),r.base=r.base||"\\",a>0&&a!==o?r.dir=e.slice(0,a-1):r.dir=r.root,r}function Ae(e){return A?pe(e):ue(e)}function O(...e){let r="",t=!1;for(let o=e.length-1;o>=-1&&!t;o--){let s;if(o>=0)s=e[o];else{let{Deno:i}=globalThis;if(typeof i?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");s=i.cwd()}C(s),s.length!==0&&(r=`${s}/${r}`,t=p(s.charCodeAt(0)))}return r=_(r,!t,"/",p),t?r.length>0?`/${r}`:"/":r.length>0?r:"."}function z(e,r){if(C(e),C(r),e===r)return""}function Ce(e,r){if(z(e,r),e=O(e),r=O(r),e===r)return"";let t=1,o=e.length;for(;t<o&&p(e.charCodeAt(t));++t);let s=o-t,i=1,a=r.length;for(;i<a&&p(r.charCodeAt(i));++i);let n=a-i,l=s<n?s:n,f=-1,d=0;for(;d<=l;++d){if(d===l){if(n>l){if(p(r.charCodeAt(i+d)))return r.slice(i+d+1);if(d===0)return r.slice(i+d)}else s>l&&(p(e.charCodeAt(t+d))?f=d:d===0&&(f=0));break}let c=e.charCodeAt(t+d),x=r.charCodeAt(i+d);if(c!==x)break;p(c)&&(f=d)}let u="";for(d=t+f+1;d<=o;++d)(d===o||p(e.charCodeAt(d)))&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(i+f):(i+=f,p(r.charCodeAt(i))&&++i,r.slice(i))}function T(...e){let r="",t="",o=!1;for(let s=e.length-1;s>=-1;s--){let i,{Deno:a}=globalThis;if(s>=0)i=e[s];else if(r){if(typeof a?.env?.get!="function"||typeof a?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");i=a.cwd(),(i===void 0||i.slice(0,3).toLowerCase()!==`${r.toLowerCase()}\\`)&&(i=`${r}\\`)}else{if(typeof a?.cwd!="function")throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");i=a.cwd()}C(i);let n=i.length;if(n===0)continue;let l=0,f="",d=!1,u=i.charCodeAt(0);if(n>1)if(m(u))if(d=!0,m(i.charCodeAt(1))){let c=2,x=c;for(;c<n&&!m(i.charCodeAt(c));++c);if(c<n&&c!==x){let v=i.slice(x,c);for(x=c;c<n&&m(i.charCodeAt(c));++c);if(c<n&&c!==x){for(x=c;c<n&&!m(i.charCodeAt(c));++c);c===n?(f=`\\\\${v}\\${i.slice(x)}`,l=c):c!==x&&(f=`\\\\${v}\\${i.slice(x,c)}`,l=c)}}}else l=1;else R(u)&&i.charCodeAt(1)===58&&(f=i.slice(0,2),l=2,n>2&&m(i.charCodeAt(2))&&(d=!0,l=3));else m(u)&&(l=1,d=!0);if(!(f.length>0&&r.length>0&&f.toLowerCase()!==r.toLowerCase())&&(r.length===0&&f.length>0&&(r=f),o||(t=`${i.slice(l)}\\${t}`,o=d),o&&r.length>0))break}return t=_(t,!o,"\\",m),r+(o?"\\":"")+t||"."}function xe(e,r){z(e,r);let t=T(e),o=T(r);if(t===o||(e=t.toLowerCase(),r=o.toLowerCase(),e===r))return"";let s=0,i=e.length;for(;s<i&&e.charCodeAt(s)===92;++s);for(;i-1>s&&e.charCodeAt(i-1)===92;--i);let a=i-s,n=0,l=r.length;for(;n<l&&r.charCodeAt(n)===92;++n);for(;l-1>n&&r.charCodeAt(l-1)===92;--l);let f=l-n,d=a<f?a:f,u=-1,c=0;for(;c<=d;++c){if(c===d){if(f>d){if(r.charCodeAt(n+c)===92)return o.slice(n+c+1);if(c===2)return o.slice(n+c)}a>d&&(e.charCodeAt(s+c)===92?u=c:c===2&&(u=3));break}let v=e.charCodeAt(s+c),we=r.charCodeAt(n+c);if(v!==we)break;v===92&&(u=c)}if(c!==d&&u===-1)return o;let x="";for(u===-1&&(u=0),c=s+u+1;c<=i;++c)(c===i||e.charCodeAt(c)===92)&&(x.length===0?x+="..":x+="\\..");return x.length>0?x+o.slice(n+u,l):(n+=u,o.charCodeAt(n)===92&&++n,o.slice(n,l))}function Re(e,r){return A?xe(e,r):Ce(e,r)}function he(...e){return A?T(...e):O(...e)}var be={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},Oe=()=>{let e=r=>({isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink,size:r.size,mtime:r.mtime,atime:r.atime,birthtime:r.birthtime});return{async readFile(r,t){try{return await Deno.readFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async readTextFile(r,t){try{return await Deno.readTextFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async writeFile(r,t,o){await Deno.writeFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async writeTextFile(r,t,o){await Deno.writeTextFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async exists(r){try{return await Deno.stat(r),!0}catch(t){if(t instanceof Deno.errors.NotFound)return!1;throw t}},async stat(r){try{let t=await Deno.stat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async lstat(r){try{let t=await Deno.lstat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async mkdir(r,t){await Deno.mkdir(r,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(r){try{await Deno.mkdir(r,{recursive:!0})}catch(t){if(!(t instanceof Deno.errors.AlreadyExists))throw t}},async remove(r,t){try{await Deno.remove(r,{recursive:t?.recursive??!1})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async*readDir(r){try{for await(let t of Deno.readDir(r))yield{name:t.name,isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink}}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async copyFile(r,t){await Deno.copyFile(r,t)},async rename(r,t){await Deno.rename(r,t)},async makeTempDir(r){return await Deno.makeTempDir({dir:r?.dir,prefix:r?.prefix,suffix:r?.suffix})},async realPath(r){try{return await Deno.realPath(r)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},watch(r,t){let o=t?.recursive??!0,s=Deno.watchFs(r,{recursive:o}),i=a=>({kind:a.kind,paths:a.paths,flag:a.flag});return{close:()=>s.close(),[Symbol.asyncIterator]:async function*(){for await(let a of s)yield i(a)}}},async*walk(r,t){let o=t?.includeDirs??!0,s=t?.includeFiles??!0,i=t?.exts,a=t?.skip,n=async function*(l){for await(let f of Deno.readDir(l)){let d=J(l,f.name);if(!a?.some(u=>u.test(d))){if(f.isDirectory)o&&(yield{path:d,name:f.name,isFile:!1,isDirectory:!0,isSymlink:f.isSymlink}),yield*n(d);else if(f.isFile||f.isSymlink){if(!s||i&&!i.some(u=>f.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:d,name:f.name,isFile:f.isFile,isDirectory:!1,isSymlink:f.isSymlink}}}}};yield*n(r)},async chmod(r,t){let{chmod:o}=await import("./unstable_chmod-RZ5DE3XZ.js");await o(r,t)}}},He=()=>({join:J,resolve:he,dirname:ie,basename:ee,extname:ae,normalize:de,isAbsolute:me,relative:Re,parse:Ae,format:ce,sep:B,delimiter:re}),ke=()=>({async spawn(e,r=[],t){let o=G(t),i=await new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).output();return{success:i.success,code:i.code,stdout:o.stdout==="piped"?i.stdout:new Uint8Array,stderr:o.stderr==="piped"?i.stderr:new Uint8Array}},async exec(e,r=[],t){let o=await this.spawn(e,r,t);if(!o.success){let s=new TextDecoder().decode(o.stderr);throw new Q(e,o.code,s)}return new TextDecoder().decode(o.stdout).trim()},async execJson(e,r=[],t){let o=await this.exec(e,r,t);return JSON.parse(o)},spawnChild(e,r=[],t){let o=G(t),i=new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).spawn(),a=(n,l)=>l!=="piped"||!n?Promise.resolve(new Uint8Array):new Response(n).arrayBuffer().then(f=>new Uint8Array(f));return{pid:i.pid,stdin:o.stdin==="piped"?i.stdin:null,stdout:o.stdout==="piped"?i.stdout:null,stderr:o.stderr==="piped"?i.stderr:null,status:i.status.then(n=>({success:n.success,code:n.code,signal:n.signal??void 0})),output:async()=>{let n=o.stdout==="piped"?i.stdout:null,l=o.stderr==="piped"?i.stderr:null,[f,d,u]=await Promise.all([i.status,a(n,o.stdout),a(l,o.stderr)]);return{success:f.success,code:f.code,stdout:d,stderr:u}},kill:n=>{i.kill(n)}}}}),Le=()=>({get(e){return Deno.env.get(e)},set(e,r){Deno.env.set(e,r)},delete(e){Deno.env.delete(e)},has(e){return Deno.env.get(e)!==void 0},toObject(){return Deno.env.toObject()}}),Ue=()=>({exit(e){Deno.exit(e)},setExitCode(e){Deno.exitCode=e},cwd(){return Deno.cwd()},chdir(e){Deno.chdir(e)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},argv:ge.argv,argv0:ge.argv0,args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable,isTerminal(e){try{switch(e){case"stdin":return Deno.stdin.isTerminal();case"stdout":return Deno.stdout.isTerminal();case"stderr":return Deno.stderr.isTerminal()}}catch{return!1}},setStdinRaw(e){Deno.stdin.setRaw(e)},writeToStdout(e){Deno.stdout.writeSync(e)},consoleSize(){try{return Deno.consoleSize()}catch{return{columns:80,rows:24}}}}),Dn=()=>{let e=Oe(),r=He(),t=ke(),o=Le(),s=Ue();return{name:"deno",version:Deno.version.deno,capabilities:be,fs:e,path:r,exec:t,env:o,process:s}};export{be as DENO_CAPABILITIES,Dn as createDenoRuntime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,d as D}from"./chunk-
|
|
1
|
+
import{a as x,d as D}from"./chunk-XQJ6LR2O.js";import{c as $}from"./chunk-2X2U2VC5.js";import{n as k}from"./chunk-VHP7GMUP.js";import{d as S,f as g,h as C,i as y,j as E}from"./chunk-PL7WF7NC.js";import{c as m,d as o,f as a,g as u,o as w,q as f,r as h}from"./chunk-K223KAUB.js";import{a as d,b as n}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var G=async U=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),p=C(U);if(!p.ok)return e.writeln(a(p.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,p.spec)}catch(s){let c=s instanceof Error?s.message:String(s);return e.writeln(a(c)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let s=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(s)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to IDLE.")),await e.close(),n({exitCode:1})}}let r=k(t,"done");if(await y(i,r),r.spec!==null&&await E(i,r.spec,r),r.spec!==null&&(await x(i,r.spec,"completed"),await D(i,r.spec,"completed")),e.writeln(u("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",m(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let s=t.decisions.filter(c=>c.promoted);s.length>0&&e.writeln(o(` Promoted to rules: ${s.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(void 0)};export{G as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./chunk-
|
|
1
|
+
import{c}from"./chunk-2X2U2VC5.js";import{c as x,d as g}from"./chunk-VHP7GMUP.js";import{e as E,i as p}from"./chunk-PL7WF7NC.js";import{c as o,d as m,f as n,g as l,o as f,q as u,r as h}from"./chunk-K223KAUB.js";import{a as i,b as r}from"./chunk-2N4GTHXQ.js";import{b as w}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var b=async d=>{let e=f({renderer:h.ansi(),sink:u.stdout()}),a=w.process.cwd(),S=d!==void 0&&d.some(s=>s==="--exit"),t;try{t=await E(a)}catch(s){let y=s instanceof Error?s.message:String(s);return e.writeln(n(y)),await e.close(),r({exitCode:1})}if(S){if(t.phase!=="FREE")return e.writeln(n(`Cannot exit free mode in phase: ${t.phase}`)),e.writeln(m("Only FREE phase can transition back to IDLE.")),await e.close(),r({exitCode:1});let s=g(t);return await p(a,s),e.writeln(l("\u2714")," Exited free mode. Back to IDLE."),e.writeln(""),e.writeln("Start a spec with: ",o(`${c('spec new "..."')}`)),await e.close(),i(void 0)}if(t.phase!=="IDLE")return e.writeln(n(`Cannot enter free mode in phase: ${t.phase}`)),e.writeln(m("Only IDLE phase can transition to FREE.")),await e.close(),r({exitCode:1});let k=x(t);return await p(a,k),e.writeln(l("\u2714")," Free mode active \u2014 no enforcement."),e.writeln(""),e.writeln("Exit free mode with: ",o(`${c("free --exit")}`)),await e.close(),i(void 0)};export{b as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T,b as J,h as B,i as N,j as q,k as G,l as U,m as h,n as r,o as y}from"./chunk-
|
|
1
|
+
import{a as T,b as J,h as B,i as N,j as q,k as G,l as U,m as h,n as r,o as y}from"./chunk-ZAOVTFWH.js";import{a as ie,b as ne,c as re}from"./chunk-MSJSMJL2.js";import{d as Z}from"./chunk-WFOXOZWW.js";import{c as ee,d as te,e as oe}from"./chunk-4DHIEOZS.js";import"./chunk-7UX6WIXX.js";import{b as I}from"./chunk-MRZT23BL.js";import{d as se}from"./chunk-JCIANZPY.js";import{a as X,c as A,d as Y}from"./chunk-2X2U2VC5.js";import{A as Q,a as W,b as z,i as H,m as _,o as K,q as V}from"./chunk-PL7WF7NC.js";import"./chunk-AGPCY6XP.js";import{a as k}from"./chunk-U3JLX6DY.js";import"./chunk-K223KAUB.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as F}from"./chunk-CLCZ7IO3.js";import{a as S}from"./chunk-2N4GTHXQ.js";import"./chunk-ON7NJA2P.js";import{b as g}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var he=new F({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-KPIHJIJZ.js")},list:{description:"List available AI providers",load:()=>import("./list-FWRKOILC.js")}}});var ae=k;var ve=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},we=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],le=async t=>{let e=[];for(let i of we)for(let o of i.paths)if(await ve(`${t}/${o}`)){e.push(i.id);break}return e};var a=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let i=await g.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},xe=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},Pe=async t=>{let e=[],i=await ce(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},Se=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},Te=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ce(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},de=async t=>{let[e,i,o,d]=await Promise.all([xe(t),Pe(t),Se(t),Te(t)]);return{languages:e,frameworks:i,ci:o,testRunner:d}};var It=async t=>{let e=g.process.cwd(),i=ne(t),o=J({target:i==="agent"?"non-interactive":"interactive"}),d=re(t),b=pe(d,"--concerns"),f=pe(d,"--tools"),p=d.includes("--non-interactive")||i==="agent";if(await Q(e))return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${A("sync")}\` to regenerate tool files.`),S(void 0);N(o,"noskills init");let D=y(o,"Scanning project...");D.start();let m=await de(e);D.succeed("Project scanned");for(let s of m.languages)r.step(o,` ${s}`);for(let s of m.frameworks)r.step(o,` ${s}`);for(let s of m.ci)r.step(o,` ${s}`);m.testRunner!==null&&r.step(o,` test runner: ${m.testRunner}`),h(o);let R=y(o,"Detecting coding tools...");R.start();let $=await le(e),v=ie(),E=v!==null&&!$.includes(v)?[v]:[],w=[...new Set([...E,...$])];R.succeed(`${w.length} coding tool(s) detected`);for(let s of w){let n=s===v?" (current)":"";r.step(o,` ${s}${n}`)}let u;if(f!==null){let s=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],n=f.filter(c=>s.includes(c));u=[...new Set([...E,...n])]}else p?u=[...w]:(h(o),u=await Ie(o,w,v));h(o);let M=y(o,"Detecting AI providers...");M.start();let x=(await ae()).filter(s=>s.available).map(s=>s.name);M.succeed(`${x.length} provider(s) detected`),h(o);let P=await I(),l;if(b!==null){let s=P.map(n=>n.id);l=b.filter(n=>s.includes(n)).sort((n,c)=>s.indexOf(n)-s.indexOf(c))}else if(p)l=[];else{let s=P.map(c=>({value:c.id,label:c.name,hint:c.description.slice(0,60)})),n=await B(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});l=T(n)?[]:[...n]}l.length>0?r.success(o,` Concerns: ${l.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(o);let j=y(o,"Initializing...");j.start(),await V(e);let ue=P.filter(s=>l.includes(s.id));for(let s of ue)await K(e,s);let L=await Y();X(L);let C={...z(l,u,x,m),command:L};await _(e,C);let O=W();if(await H(e,O),j.succeed("Scaffolded `.eser/`"),u.length>0){let s=y(o,"Syncing tool files...");s.start();let n=await oe(e,u,C);s.succeed(`Synced ${n.length} tool(s)`)}else r.warn(o,"No tools selected. noskills will work in agentless CLI mode only."),r.info(o,"Add tools later with `noskills sync`.");if(q(o,`Done. ${u.length} tool(s), ${x.length} provider(s), ${l.length} concern(s).`),i==="agent"){let n=(await I()).filter(me=>l.includes(me.id)),c=await ee(e),ge=te(C?.tools??[]),fe=Z(O,n,c,C,void 0,void 0,void 0,ge);await se(fe,"json")}else G(o),U(o,`Start a spec with: ${A('spec new "..."')}`);return S(void 0)},ke=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],Ie=async(t,e,i)=>{let o=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),b=await B(t,{message:o,options:ke.map(p=>({...p,hint:p.value===i?"you're running inside it":d.has(p.value)?"detected":void 0,disabled:p.value===i})),initialValues:[...e],required:!1});if(T(b))return[...e];let f=[...b];return i!==null&&!f.includes(i)&&f.unshift(i),f},pe=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(o=>o.trim()).filter(Boolean);return null};export{It as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as F}from"./chunk-
|
|
1
|
+
import{d as F}from"./chunk-WFOXOZWW.js";import{c as A,d as _}from"./chunk-4DHIEOZS.js";import"./chunk-7UX6WIXX.js";import"./chunk-MRZT23BL.js";import{c as m}from"./chunk-2X2U2VC5.js";import{A as P,d as g,e as D,f as b,l as E,p as $,t as x,u as N}from"./chunk-PL7WF7NC.js";import{a as l}from"./chunk-2N4GTHXQ.js";import{b as a}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var L=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),I=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),S=e=>{let s=e.trim();if(!s.startsWith("git"))return!0;let t=s.slice(3).trim();if(t.length===0)return!0;let i=t.split(/\s+/),r=i[0]??"";if(L.has(r))return!0;let n=I.get(r);if(n!==void 0){let o=i[1]??"";if(n.has(o))return!0}return!1};var G=e=>{let s=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let r of s){let n;for(;(n=r.exec(e))!==null;){let o=n[1]??"";if(o.includes("git")&&!S(o))return!0}}let t=e.split(/\s*\|\s*/);for(let r of t){let n=r.trim();if(n.startsWith("git")&&!S(n))return!0}let i=e.matchAll(/\bgit\s+([\w-]+)/g);for(let r of i){let n=r[1]??"";if(!L.has(n)&&!I.has(n))return!0;if(I.has(n)){let o=r.index??0,p=e.slice(o);if(!S(p.split(/[;&|$)`]/)[0]??""))return!0}}return!1};var R=async()=>{let e=a.process.stdin.getReader(),s=[];try{for(;;){let{done:n,value:o}=await e.read();if(n||o===void 0)break;s.push(o)}}finally{e.releaseLock()}let t=0,i=new Uint8Array(s.reduce((n,o)=>n+o.length,0));for(let n of s)i.set(n,t),t+=n.length;let r=new TextDecoder().decode(i);try{return JSON.parse(r)}catch{return{}}},M=async e=>{let s=new TextEncoder,t=a.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},ee=async e=>{switch(e?.[0]){case"pre-tool-use":return await B();case"stop":return await Y();case"post-file-write":return await J();case"post-bash":return await K();case"session-start":return await j();default:return l(void 0)}},v=async e=>{await M({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${e}`}})},W=(e,s)=>{if(s||!e.includes("git"))return null;let t=e.split(/\s*(?:&&|;)\s*/);for(let i of t){let r=i.trim();if(r.startsWith("git")&&!S(r))return"Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."}return G(e)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},B=async()=>{let e=await R(),s=e.tool_name??"unknown",t=e.tool_input??{},i=e.cwd??a.process.cwd(),r=await E(i),n=a.env.get("NOSKILLS_SESSION")??null;if(n!==null){let c=await x(i,n);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(t.command??"").trim(),d=r?.allowGit??!1;if(!d&&u.includes("git")){let h=W(u,d);if(h!==null)return await v(h),l(void 0)}}return l(void 0)}}let o={};if(n!==null){let c=await x(i,n);if(c!==null&&c.mode==="spec"&&c.phase!==null)o={phase:c.phase};else if(c!==null&&c.spec!==null)try{o=await b(i,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await N(i);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,FREE:0,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let U of c){let C=U.phase??"IDLE",T=u[C]??0;T>h&&(h=T,d=C)}o={phase:d};let y=new TextEncoder,O=a.process.stderr.getWriter();await O.write(y.encode(`noskills: WARNING \u2014 ${c.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
|
|
2
2
|
`)),O.releaseLock()}else try{o=await D(i)}catch{return l(void 0)}}if(s==="Bash"){let c=(t.command??"").trim(),u=r?.allowGit??!1,d=W(c,u);return d!==null?(await v(d),l(void 0)):l(void 0)}let p=["Write","Edit","MultiEdit"];if(!p.includes(s))return l(void 0);let w=t.file_path??t.path??"";if(w.includes(".eser/")||w.includes(".claude/"))return l(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING"||f==="IDLE"||f==="FREE"||f==="COMPLETED"||f==="UNKNOWN"){if(f==="EXECUTING"&&p.includes(s)){let c=`${i}/${g.stateDir}/executor-warned.flag`;try{await a.fs.readTextFile(c)}catch{try{await a.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0}),await a.fs.writeTextFile(c,new Date().toISOString());let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
|
|
3
3
|
`)),d.releaseLock()}catch{}}}return l(void 0)}let k={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await v(k[f]??`Run \`${m("next")}\` first.`),l(void 0)},Y=async()=>{let e=await R();if(e.stop_hook_active===!0)return l(void 0);let s=e.cwd??a.process.cwd(),t;try{let u=await a.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(u)}catch{return l(void 0)}if(t.phase!=="EXECUTING")return l(void 0);let i=t.execution??{},r=`${s}/${g.stateDir}/files-changed.jsonl`,n=[];try{let d=(await a.fs.readTextFile(r)).trim().split(`
|
|
4
4
|
`).filter(Boolean);n=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let o=[],p="no changes";try{let{execSync:u}=await import("node:child_process");o=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-
|
|
1
|
+
import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-NRCHLNQA.js";import{a as l}from"./chunk-OLM5RTFK.js";import"./chunk-ON7NJA2P.js";import"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var k=class{capabilities=["text_generation","streaming"];provider="kiro";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr),t=await T(s.stdout,this.modelId),d=await s.waitForExit(),i=await u,a=f("kiro",d.code,i);if(a!==null)throw a;return t}async*streamText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr);try{let t=new TextDecoder,d=s.stdout.getReader(),i="",a=await d.read();for(;a.done!==!0;){i+=t.decode(a.value,{stream:!0});let x=i.split(`
|
|
2
2
|
`);i=x.pop()??"";for(let _ of x){let p=_.trim();if(p.length!==0){try{let A=JSON.parse(p),w=C(A);if(w!==null){yield w;continue}}catch{}yield{kind:"content_delta",textDelta:p+`
|
|
3
3
|
`}}}a=await d.read()}d.releaseLock(),i.trim().length>0&&(yield{kind:"content_delta",textDelta:i.trim()});let E=await s.waitForExit(),b=await u,h=f("kiro",E.code,b);h!==null?yield{kind:"error",error:h}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}catch(t){t instanceof l?yield{kind:"error",error:t}:yield{kind:"error",error:new l(t instanceof Error?t.message:String(t),{provider:"kiro",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},O={provider:"kiro",async createModel(n){let e=await S("kiro",n);return new k(e,n)}},v=(n,e)=>{let r=[];r.push("--output","json"),r.push("--model",n.model),e.maxTokens!==void 0&&r.push("--max-tokens",String(e.maxTokens));let o=n.properties?.args;return o!==void 0&&r.push(...o),r},C=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content"||e.type==="text"){let r=e.text??e.content;return r!==void 0?{kind:"content_delta",textDelta:String(r)}:null}return e.type==="done"||e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new l(e.error?.message??e.message??"Unknown Kiro error",{provider:"kiro"})}:null};export{k as KiroModel,O as kiroFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{a as p}from"./chunk-U3JLX6DY.js";import{c as t,d as a,g as l,m as n,o,q as m,r as d}from"./chunk-K223KAUB.js";import{a as i}from"./chunk-2N4GTHXQ.js";import"./chunk-ON7NJA2P.js";import"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as N,d as se,e as ne,p as y,q as l,r as x,s as ie,t as
|
|
2
|
-
`);for(let i of a)e.buffer.push(i);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},
|
|
3
|
-
`),_(void 0)}let
|
|
1
|
+
import{c as N,d as se,e as ne,p as y,q as l,r as x,s as ie,t as M,u as W}from"./chunk-ZAOVTFWH.js";import{b as X}from"./chunk-2X2U2VC5.js";import{A as le,f as re,k as ae,s as q,v as oe,x as ce,z as j}from"./chunk-PL7WF7NC.js";import"./chunk-K223KAUB.js";import{a as _,b as te}from"./chunk-2N4GTHXQ.js";import{d as ue,e as K,f as de}from"./chunk-ON7NJA2P.js";import{b as I}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var pe=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0});var we=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE",FREE:"FREE"}[e]??e.slice(0,4),Se=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},P=(e,n)=>{let a=new Set(n.filter(o=>o.spec!==null).map(o=>o.spec)),i=e.map(o=>({label:o.name,badge:we(o.phase),badgeColor:Se(o.phase),active:a.has(o.name),dimmed:o.phase==="COMPLETED"}));return i.length===0&&i.push({label:"No specs yet",dimmed:!0,selectable:!1}),i.push({label:"\u2500".repeat(20),dimmed:!0,selectable:!1}),i.push({label:"[n] New spec",badge:"+",badgeColor:"green"}),i.push({label:"[f] Free mode",badge:"~",badgeColor:"cyan"}),i},Y=(e,n,a,i)=>{let o=P(e,n),t=x.drawBox({x:i.x,y:i.y,width:i.width,height:i.height,title:"Specs",borderStyle:"rounded"}),L=M.renderList(o,a,i);return t+L};var xe=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE"],Ee=e=>{if(e===null||e==="FREE")return"FREE (no enforcement)";let a={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return xe.map(i=>i===a?l.bold(`\u2726${i}\u2726`):l.dim(i)).join("\u2192")},Ie=(e,n,a)=>{if(n===0)return l.dim("no tasks");let i=Math.round(e/n*a),o=a-i;return l.green("\u2588".repeat(i))+l.dim("\u2591".repeat(o))+` ${e}/${n}`},z=(e,n,a)=>{let i=[];return e===null?(i.push(l.dim("No spec selected")),i.push(""),i.push(l.dim("Select a spec from the list or press [n] for new"))):e.mode==="free"?(i.push(l.bold("Mode: ")+l.cyan("FREE")),i.push(l.dim("No enforcement active")),i.push(""),i.push(l.dim(`Session: ${e.sessionId}`))):(i.push(l.bold("Spec: ")+(e.spec??"unknown")),i.push(l.bold("Phase: ")+(e.phase??"unknown")),i.push(""),i.push(Ee(e.phase)),i.push(""),a!==void 0&&i.push(l.bold("Progress: ")+Ie(a.completed,a.total,15)),i.push(""),i.push(l.dim(`Session: ${e.sessionId}`))),x.fillBox({x:n.x,y:n.y,width:n.width,height:n.height,title:"Monitor",borderStyle:"rounded"},i)};var U=(e,n)=>{let a=e!==null?e.mode==="free"?"Terminal (FREE)":`Terminal (${e.spec??"?"})`:"Terminal",i=e!==null&&e.widget!==null,o=x.drawBox({x:n.x,y:n.y,width:n.width,height:n.height,title:a,borderStyle:"rounded",skipInterior:i});if(e===null||e.widget===null&&e.buffer.length===0){let A=l.dim("Waiting for output..."),k=" ".repeat(n.width-2),u="";for(let E=1;E<n.height-1;E++)u+=l.moveTo(n.y+E,n.x+1),u+=E===1?l.truncate(A,n.width-2)+" ".repeat(Math.max(0,n.width-2-l.visibleLength(A))):k;return o+u}if(e.widget!==null)return o+e.widget.render(n);let t=n.height-2,L=e.buffer.slice(-t);return x.fillBox({x:n.x,y:n.y,width:n.width,height:n.height,title:a,borderStyle:"rounded"},L)};var G=(e,n)=>({...e,tabs:[...e.tabs,n],selectedTabIndex:e.tabs.length}),me=(e,n)=>{let a=e.tabs.findIndex(t=>t.id===n);if(a===-1)return e;let i=e.tabs[a];i.process!==null&&i.process.kill();let o=e.tabs.filter(t=>t.id!==n);return{...e,tabs:o,selectedTabIndex:Math.min(e.selectedTabIndex,o.length-1)}},ge=(e,n)=>n<0||n>=e.tabs.length?e:{...e,selectedTabIndex:n},H=(e,n)=>{let a=n.split(`
|
|
2
|
+
`);for(let i of a)e.buffer.push(i);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},R=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var fe=(e,n,a)=>{if(a&&n==="c")return{type:"quit"};if(n==="tab")return{type:"toggleFocus"};if(e.focus==="list")switch(n){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newSpec"};case"f":return{type:"freeMode"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:n}},be=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),J=(e,n,a)=>{let i=M.nextSelectableIndex(a,e.selectedTabIndex,n);return{...e,selectedTabIndex:i}};var Be=async e=>{let n=e?.includes("--dry-run")??!1,a=I.process.cwd();if(!await le(a))return console.error("noskills is not initialized. Run:",X(),"init"),te({exitCode:1});let o=(await ae(a)).map(s=>({name:s.name,phase:s.state.phase,hasActiveSession:!1})),t=pe(),{cols:L,rows:A}=y.getTerminalSize(),k={leftWidth:.25,rightTopHeight:.35},u=ie.calculateLayout(L,A,k),E=new TextEncoder,g=s=>{I.process.writeToStdout(E.encode(s))};if(n){g(y.clearScreenSeq());let s=` noskills manager | ${o.length} spec(s) | ${X()} | Ctrl+C to quit`;g(l.moveTo(u.statusBar.y,u.statusBar.x)),g(l.inverse(l.truncate(s,u.statusBar.width))),g(Y(o,t.tabs,t.selectedTabIndex,u.left));let r=R(t);return g(z(r,u.rightTop)),g(U(r,u.rightBottom)),g(l.moveTo(A,1)),g(`
|
|
3
|
+
`),_(void 0)}let C=new de,F=null,Q=async()=>{for(let s of["claude","claude-code"])try{if(await ue`which ${s}`.noThrow().code()===0)return s}catch{}return"claude"},w=P(o,t.tabs);t.selectedTabIndex=M.nextSelectableIndex(w,-1,"down");let O=async()=>{let s=j();await q(a,{id:s,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let r=u.rightBottom.width-2,d=u.rightBottom.height-2,c=new W(d,r),m={id:`tab-${s}`,spec:null,mode:"free",sessionId:s,process:null,buffer:[],widget:c,active:!0,phase:null};try{let f=await Q(),b=await K({command:f,cwd:a,env:{...I.env.toObject(),NOSKILLS_SESSION:s},cols:r,rows:d});m.process=b,C.add(m.id,b),b.onData(T=>{c.write(T),H(m,T),F?.()})}catch(f){let b=f instanceof Error?f.message:String(f);c.write(`[noskills manager] Failed to spawn claude: ${b}\r
|
|
4
4
|
`),c.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
5
|
-
`)}Object.assign(t,G(t,m)),t.focus="terminal",w=
|
|
6
|
-
`)}Object.assign(t,G(t,T)),t.focus="terminal",w=
|
|
5
|
+
`)}Object.assign(t,G(t,m)),t.focus="terminal",w=P(o,t.tabs)},Z=async s=>{let r=t.tabs.find(h=>h.spec===s);if(r!==void 0){let h=t.tabs.indexOf(r);Object.assign(t,ge(t,h)),t.focus="terminal";return}let d=null;try{d=(await re(a,s)).phase}catch{}let c=j();await q(a,{id:c,spec:s,mode:"spec",phase:d,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let m=u.rightBottom.width-2,f=u.rightBottom.height-2,b=new W(f,m),T={id:`tab-${c}`,spec:s,mode:"spec",sessionId:c,process:null,buffer:[],widget:b,active:!0,phase:d};try{let h=await Q(),D=await K({command:h,cwd:a,env:{...I.env.toObject(),NOSKILLS_SESSION:c},cols:m,rows:f});T.process=D,C.add(T.id,D),D.onData(ee=>{b.write(ee),H(T,ee),F?.()})}catch(h){let D=h instanceof Error?h.message:String(h);b.write(`[noskills manager] Failed to spawn claude for spec "${s}": ${D}\r
|
|
6
|
+
`)}Object.assign(t,G(t,T)),t.focus="terminal",w=P(o,t.tabs)};g(y.enterAlternateScreen()),g(y.hideCursorSeq()),g(y.clearScreenSeq()),g(N.enableMouse());let p=new Set(["specs","monitor","terminal","status"]),v=()=>{let s=R(t),r=[];if(r.push(y.hideCursorSeq()),p.has("status")||p.size===0){let d=t.focus==="list"?"LIST":"TERM",c=` noskills manager | ${o.length} spec(s) | ${t.tabs.length} tab(s) | [${d}] Tab: toggle | q: quit | n: new | f: free`;r.push(l.moveTo(u.statusBar.y,u.statusBar.x)),r.push(l.inverse(l.truncate(c,u.statusBar.width)+" ".repeat(Math.max(0,u.statusBar.width-l.visibleLength(c)))))}p.has("specs")&&r.push(Y(o,t.tabs,t.selectedTabIndex,u.left)),p.has("monitor")&&r.push(z(s,u.rightTop)),p.has("terminal")&&r.push(U(s,u.rightBottom)),r.push(y.showCursorSeq()),p.clear(),g(r.join(""))},S=()=>{p.add("specs"),p.add("monitor"),p.add("terminal"),p.add("status")},$=!1;F=()=>{p.add("terminal"),!$&&($=!0,setTimeout(()=>{$=!1,t.running&&v()},16))},S(),v();let V=(s,r,d)=>s>=d.x&&s<d.x+d.width&&r>=d.y&&r<d.y+d.height,he=async s=>{if(V(s.x+1,s.y+1,u.left)){if(s.type==="mousedown"&&s.button===0){t.focus="list";let r=s.y+1-u.left.y-1;if(r>=0&&r<w.length){let d=w[r];if(d.selectable!==!1){if(t.selectedTabIndex=r,d.label.includes("[n]")||d.label.includes("[f]")){await O(),S();return}let c=o.find(m=>m.name===d.label)?.name;if(c!==void 0){await Z(c),S();return}}}p.add("specs"),p.add("monitor"),p.add("status")}else if(s.type==="wheel"){let r=s.direction==="up"?"up":"down";Object.assign(t,J(t,r,w)),p.add("specs"),p.add("monitor")}return}if(V(s.x+1,s.y+1,u.rightBottom)){t.focus="terminal",p.add("status");let r=R(t);if(r?.process!==null&&r!==null){let d=s.x+1-u.rightBottom.x,c=s.y+1-u.rightBottom.y,m=s.button;s.type==="mousemove"&&(m|=32),s.type==="wheel"&&(m=64|(s.direction==="down"?1:0)),s.shift&&(m|=4),s.ctrl&&(m|=16);let f=s.type==="mouseup"?"m":"M";r.process?.write(`\x1B[<${m};${d};${c}${f}`)}if(s.type==="wheel"&&r?.process!==null&&r!==null){let d=s.direction==="up"?"\x1B[A":"\x1B[B";r.process?.write(d.repeat(3))}return}V(s.x+1,s.y+1,u.rightTop)&&(t.focus="list",p.add("status"))};try{await se(async()=>{for await(let s of ne(I.process.stdin)){if(!t.running)break;if(s.kind==="mouse"){await he(s.event),p.size>0&&v();continue}let r=s.event,d=fe(t,r.name,r.ctrl);switch(d.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,be(t)),p.add("status");break;case"navigate":Object.assign(t,J(t,d.direction,w)),p.add("specs"),p.add("monitor"),p.add("terminal");break;case"freeMode":await O(),S();break;case"newSpec":await O(),S();break;case"select":{let c=w[t.selectedTabIndex];if(c===void 0)break;let m=c.label;if(m.includes("[n]")||m.includes("[f]"))await O();else{let f=o.find(b=>b.name===m)?.name;f!==void 0&&await Z(f)}S();break}case"closeTab":{let c=R(t);c!==null&&(c.process!==null&&C.remove(c.id),await oe(a,c.sessionId),Object.assign(t,me(t,c.id)),w=P(o,t.tabs),t.focus="list"),S();break}case"passthrough":{let c=R(t);c?.process!==null&&c!==null&&c.process?.write(new TextDecoder().decode(r.raw));break}case"none":break}if(!t.running)break;p.size>0&&v()}})}finally{await C.killAll(),C.forceKillAll(),await ce(a),g(N.disableMouse()),g(y.showCursorSeq()),g(y.exitAlternateScreen())}return _(void 0)};export{Be as main};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-ON7NJA2P.js";import"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";export{b as CommandBuilder,a as CommandError,f as ProcessGroup,d as exec,c as parseCommand,e as spawnPty};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{b as fe}from"./chunk-
|
|
2
|
-
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ke=async(o,e)=>{let r=[],i=(e.startsWith(o)?e.slice(o.length+1):e).split("/");i.pop();for(let t=i.length;t>=0;t--){let n=`${t===0?o:`${o}/${i.slice(0,t).join("/")}`}/.folder-rules.md`,a=t===0?".":i.slice(0,t).join("/");try{let l=await h.fs.readTextFile(n),u=Fe(l);for(let p of u)r.push({folder:a,rule:p})}catch{}}return r},ee=async(o,e)=>{let r=new Set,c=[];for(let i of e){let t=await ke(o,i);for(let s of t){let n=`${s.folder}::${s.rule}`;r.has(n)||(r.add(n),c.push(s))}}return c};var Ze=async o=>{let e=h.process.cwd(),r=ue(o),c=me(o);if(!await ce(e))return await v({error:`noskills not initialized. Run: ${j("init")}`},r),D({exitCode:1});let i=null;for(let m of c)m.startsWith("--answer=")&&(i=m.slice(9));let t=ne(c),s;try{s=await se(e,t)}catch(m){let d=m instanceof Error?m.message:String(m);return await v({error:d},r),D({exitCode:1})}if(t===null&&s.phase!=="IDLE"&&s.phase!=="FREE"&&s.phase!=="COMPLETED")return await v({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),D({exitCode:1});let n=await oe(e);if(n?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-
|
|
1
|
+
import{b as fe}from"./chunk-MSJSMJL2.js";import{a as le,b as de,c as pe,d as G}from"./chunk-WFOXOZWW.js";import{a as z,b as K,d as Y}from"./chunk-4DHIEOZS.js";import{a as Q}from"./chunk-7UX6WIXX.js";import"./chunk-MRZT23BL.js";import{a as ue,b as me,d as v}from"./chunk-JCIANZPY.js";import{a as Ie}from"./chunk-JI5AH4G4.js";import{a as q}from"./chunk-RTD42HPS.js";import{a as xe,b as Ce,c as De,d as Re}from"./chunk-XQJ6LR2O.js";import{c as j}from"./chunk-2X2U2VC5.js";import{a as ge,b as he,e as k,f as B,g as X,h as Se,i as we,k as ve,m as Z,n as ye}from"./chunk-VHP7GMUP.js";import{A as ce,a as te,d as F,f as se,g as ne,j as ie,k as re,l as oe,p as ae,r as U,w as H}from"./chunk-PL7WF7NC.js";import{a as J,b as D}from"./chunk-2N4GTHXQ.js";import{b as h}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var Fe=o=>o.split(`
|
|
2
|
+
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ke=async(o,e)=>{let r=[],i=(e.startsWith(o)?e.slice(o.length+1):e).split("/");i.pop();for(let t=i.length;t>=0;t--){let n=`${t===0?o:`${o}/${i.slice(0,t).join("/")}`}/.folder-rules.md`,a=t===0?".":i.slice(0,t).join("/");try{let l=await h.fs.readTextFile(n),u=Fe(l);for(let p of u)r.push({folder:a,rule:p})}catch{}}return r},ee=async(o,e)=>{let r=new Set,c=[];for(let i of e){let t=await ke(o,i);for(let s of t){let n=`${s.folder}::${s.rule}`;r.has(n)||(r.add(n),c.push(s))}}return c};var Ze=async o=>{let e=h.process.cwd(),r=ue(o),c=me(o);if(!await ce(e))return await v({error:`noskills not initialized. Run: ${j("init")}`},r),D({exitCode:1});let i=null;for(let m of c)m.startsWith("--answer=")&&(i=m.slice(9));let t=ne(c),s;try{s=await se(e,t)}catch(m){let d=m instanceof Error?m.message:String(m);return await v({error:d},r),D({exitCode:1})}if(t===null&&s.phase!=="IDLE"&&s.phase!=="FREE"&&s.phase!=="COMPLETED")return await v({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),D({exitCode:1});let n=await oe(e);if(n?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-NWSNAUKC.js");m(n.command)}if(n===null)return await v({error:"No config found"},r),D({exitCode:1});if(s.spec!==null&&s.phase!=="IDLE"&&s.phase!=="COMPLETED"){let m=`${e}/${F.specDir(s.spec)}`;try{await h.fs.stat(m)}catch{return await v({error:!0,message:`Active spec '${s.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${j("reset")}\` to return to IDLE, or \`${j("cancel")}\` to mark as cancelled.`},r),D({exitCode:1})}}let a=fe(c,n);s.phase==="DISCOVERY"&&s.discovery.audience!==a&&(s={...s,discovery:{...s.discovery,audience:a}});let u=(await ae(e)).filter(m=>n.concerns.includes(m.id));if(i!==null){let m=await Ae(e,s,n,u,i);await U(e,m);let d={...m,lastCalledAt:new Date().toISOString()};await U(e,d);let b=h.env.get("NOSKILLS_SESSION")??null;b!==null&&await H(e,b,d.phase);let C=await z(e),E=K(C,d.phase),_=d.spec!==null?await q(e,d.spec):null,O=await be(e,d),T=await ee(e,O),f=Y(n?.tools??[]),S=G(d,u,E,n,_,T,void 0,f);return await v(S,r),J(void 0)}let p={...s,lastCalledAt:new Date().toISOString()};await U(e,p);let x=h.env.get("NOSKILLS_SESSION")??null;x!==null&&await H(e,x,p.phase);let y=await z(e),P=K(y,p.phase),M=p.spec!==null?await q(e,p.spec):null,V=await be(e,p),A=await ee(e,V),R;p.phase==="IDLE"&&(R={existingSpecs:(await re(e)).map(d=>({name:d.name,phase:d.state.phase,iteration:d.state.execution.iteration,detail:d.state.phase==="EXECUTING"?`${d.state.execution.completedTasks.length} tasks done, iteration ${d.state.execution.iteration}`:d.state.phase==="SPEC_DRAFT"?"awaiting approval":d.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:P.length});let W=Y(n?.tools??[]),$=G(p,u,P,n,M,A,R,W);return await v($,r),J(void 0)},Ae=async(o,e,r,c,i)=>{switch(e.phase){case"DISCOVERY":{let t=e.discovery.audience==="agent",s=null;try{let a=JSON.parse(i);typeof a=="object"&&a!==null&&!Array.isArray(a)&&(t?le.map(p=>p.id).every(p=>p in a)&&(s=a):s=a)}catch{}let n=e;if(s!==null)for(let[a,l]of Object.entries(s))typeof l=="string"&&l.length>0&&(n=k(n,a,l));else{let a=de(c),l=n.discovery.currentQuestion,u=a[l];if(u===void 0)return e;n=k(n,u.id,i),n=we(n)}return pe(n.discovery.answers)&&(n=B(n)),n}case"DISCOVERY_REVIEW":{let t=i.trim().toLowerCase();if(t==="approve"){let s=Q(e.discovery.answers);return s.detected&&s.proposals.length>=2?Se(e):X(e)}if(t==="split")return await $e(o,e);if(t==="keep"){let s=Z(e,{id:`decision-split-keep-${Date.now()}`,question:"Split spec into separate areas?",choice:"Chose to keep as single spec despite multiple areas detected",promoted:!1,timestamp:new Date().toISOString()});return X(s)}try{let s=JSON.parse(i);if(typeof s.revise=="object"&&s.revise!==null){let n=e;for(let[a,l]of Object.entries(s.revise))typeof l=="string"&&l.length>0&&(n=k(n,a,l));return n}}catch{}return e}case"SPEC_DRAFT":{if(e.classification===null){let t,s=i.trim().toLowerCase();if(s==="none"||s==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let a=JSON.parse(i);t={involvesWebUI:a.involvesWebUI===!0||a.involvesUI===!0,involvesCLI:a.involvesCLI===!0||a.involvesUI===!0,involvesPublicAPI:a.involvesPublicAPI===!0,involvesMigration:a.involvesMigration===!0,involvesDataHandling:a.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let n={...e,classification:t};try{await Ie(o,n,c)}catch{}return n}try{let t=JSON.parse(i);if(typeof t.refinement=="string"&&t.refinement.length>0){let s=t.refinement;if(e.spec!==null){let n=`${o}/${F.specFile(e.spec)}`,a=await h.fs.readTextFile(n);if(s.includes("task-")){let u=Oe(s).map(y=>`- [ ] ${y}`).join(`
|
|
3
3
|
`),p=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,x=a.replace(p,`## Tasks
|
|
4
4
|
|
|
5
5
|
${u}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as S,c as P,d as w}from"./chunk-
|
|
1
|
+
import{a as h,b as S,c as P,d as w}from"./chunk-65A35QPF.js";import{s as c,t as f}from"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";import*as p from"node:child_process";import l from"node:process";import{Buffer as d}from"node:buffer";import{Readable as C,Writable as g}from"node:stream";var y={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},b=(i,u=[],s)=>new Promise((e,a)=>{let n=p.spawn(i,u,{cwd:s?.cwd,env:s?.env?{...l.env,...s.env}:void 0,stdio:c(s),signal:s?.signal}),o=[],t=[];n.stdout?.on("data",r=>o.push(r)),n.stderr?.on("data",r=>t.push(r)),n.on("error",a),n.on("close",r=>{e({success:r===0,code:r??1,stdout:new Uint8Array(d.concat(o)),stderr:new Uint8Array(d.concat(t))})})}),A=(i,u=[],s)=>{let e=p.spawn(i,u,{cwd:s?.cwd,env:s?.env?{...l.env,...s.env}:void 0,stdio:c(s),signal:s?.signal}),a=[],n=[];e.stdout?.on("data",t=>a.push(t)),e.stderr?.on("data",t=>n.push(t));let o=new Promise((t,r)=>{e.on("error",r),e.on("close",(m,v)=>{t({success:m===0,code:m??1,signal:v??void 0})})});return{pid:e.pid,stdin:e.stdin?g.toWeb(e.stdin):null,stdout:e.stdout?C.toWeb(e.stdout):null,stderr:e.stderr?C.toWeb(e.stderr):null,status:o,output:async()=>{let t=await o;return{success:t.success,code:t.code,stdout:new Uint8Array(d.concat(a)),stderr:new Uint8Array(d.concat(n))}},kill:t=>{e.kill(t)}}},U=()=>({name:"node",version:l.versions.node,capabilities:y,fs:h(),path:S(),exec:f(b,A),env:P(),process:w()});export{y as NODE_CAPABILITIES,U as createNodeRuntime};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as u}from"./chunk-
|
|
1
|
+
import{c as u}from"./chunk-NRCHLNQA.js";import{a as i,e as m}from"./chunk-OLM5RTFK.js";import"./chunk-ON7NJA2P.js";import"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var p="http://localhost:11434",d=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;baseUrl;config;constructor(e,o){this.baseUrl=e,this.config=o,this.modelId=o.model}async generateText(e,o){let s=g(this.config,e,!1);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok)throw await f(t);let r=await t.json();return h(r,this.modelId)}catch(t){throw t instanceof i?t:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}async*streamText(e,o){let s=g(this.config,e,!0);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok){yield{kind:"error",error:await f(t)};return}if(t.body===null){yield{kind:"error",error:new i("No response body",{provider:"ollama"})};return}for await(let r of u(t.body)){let l=k(r);l!==null&&(yield l)}}catch(t){t instanceof i?yield{kind:"error",error:t}:yield{kind:"error",error:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},v={provider:"ollama",createModel(n){let e=n.properties?.baseUrl??p;return Promise.resolve(new d(e,n))}},g=(n,e,o)=>{let s=y(e.messages,e.system),t={model:n.model,messages:s,stream:o},r={};return e.temperature!==void 0&&(r.temperature=e.temperature),e.maxTokens!==void 0&&(r.num_predict=e.maxTokens),e.topP!==void 0&&(r.top_p=e.topP),e.stopWords!==void 0&&(r.stop=e.stopWords),Object.keys(r).length>0&&(t.options=r),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?t.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(t.format="json")),t},y=(n,e)=>{let o=[];e!==void 0&&o.push({role:"system",content:e});for(let s of n){if(s.role==="system"){let a=[];for(let c of s.content)c.kind==="text"&&a.push(c.text);o.push({role:"system",content:a.join(`
|
|
2
2
|
`)});continue}let t=[],r=[];for(let a of s.content)a.kind==="text"?t.push(a.text):a.kind==="image"&&a.image.url!==void 0&&r.push(a.image.url);let l={role:s.role==="tool"?"user":s.role,content:t.join(`
|
|
3
3
|
`)};r.length>0&&(l.images=r),o.push(l)}return o},h=(n,e)=>{let o=[];return n.message?.content!==void 0&&o.push({kind:"text",text:n.message.content}),{content:o,stopReason:n.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:n.prompt_eval_count??0,outputTokens:n.eval_count??0,totalTokens:(n.prompt_eval_count??0)+(n.eval_count??0)},modelId:e,rawResponse:n}},k=n=>{if(n===null||typeof n!="object")return null;let e=n;return e.done===!0?{kind:"message_done",stopReason:e.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:e.prompt_eval_count??0,outputTokens:e.eval_count??0,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}}:e.message?.content!==void 0&&e.message.content.length>0?{kind:"content_delta",textDelta:e.message.content}:e.response!==void 0&&e.response.length>0?{kind:"content_delta",textDelta:e.response}:null},f=async n=>{let e;try{e=(await n.json()).error??`Ollama HTTP ${n.status}`}catch{e=`Ollama HTTP ${n.status}: ${n.statusText}`}return m("ollama",n.status,new Error(e))};export{d as OllamaModel,v as ollamaFactory};
|