eser 4.1.48 → 4.1.50
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/{anthropic-QBGNUIP3.js → anthropic-YMZNUQKZ.js} +1 -1
- package/chunks/approve-PXC7FMDI.js +2 -0
- package/chunks/{ask-M3VS3GIJ.js → ask-6DWHUCLO.js} +1 -1
- package/chunks/block-CSVO3R47.js +2 -0
- package/chunks/{build-DPBRNANI.js → build-S4DSRSSR.js} +1 -1
- package/chunks/cancel-AJOYWYV5.js +2 -0
- package/chunks/{changelog-gen-627BV77Z.js → changelog-gen-TE6FXELA.js} +1 -1
- package/chunks/{chunk-7NKYCWAA.js → chunk-2PWSTO7A.js} +1 -1
- package/chunks/{chunk-H6P3EACV.js → chunk-3CE7GA2P.js} +1 -1
- package/chunks/{chunk-FNPBHLLZ.js → chunk-3KGG2I2A.js} +1 -1
- package/chunks/{chunk-73IMECRI.js → chunk-3SBAWBWS.js} +1 -1
- package/chunks/chunk-4NNSMDFH.js +2 -0
- package/chunks/{chunk-R4GKIRAI.js → chunk-4QMRLILJ.js} +1 -1
- package/chunks/chunk-4TTJVJEI.js +2 -0
- package/chunks/{chunk-7KFSTOXR.js → chunk-4XXI5LYN.js} +1 -1
- package/chunks/{chunk-4LQG2WOJ.js → chunk-66VSO643.js} +1 -1
- package/chunks/chunk-67AFLWXV.js +4 -0
- package/chunks/{chunk-C7NZBKCW.js → chunk-72R6CKNY.js} +1 -1
- package/chunks/{chunk-TFRONHJA.js → chunk-AUDMKDAA.js} +1 -1
- package/chunks/{chunk-RHVDIXOM.js → chunk-BESTYZQY.js} +1 -1
- package/chunks/{chunk-2YTW3JQ6.js → chunk-BJ45FF6F.js} +1 -1
- package/chunks/{chunk-DM6U63HP.js → chunk-BNZPRQUS.js} +1 -1
- package/chunks/{chunk-KHBIOZJE.js → chunk-BVIGTD2Z.js} +1 -1
- package/chunks/{chunk-5JV6KQMP.js → chunk-CE6UVD6F.js} +1 -1
- package/chunks/{chunk-WI2RW3YL.js → chunk-DHNS2KLJ.js} +1 -1
- package/chunks/{chunk-WTMV5GTZ.js → chunk-DTDUHDLM.js} +1 -1
- package/chunks/{chunk-MTCPFQ5I.js → chunk-FVXGVHUR.js} +1 -1
- package/chunks/{chunk-3D5TBTM3.js → chunk-HTC2FO4I.js} +2 -2
- package/chunks/{chunk-J5HFD7AQ.js → chunk-HV3EYAGF.js} +1 -1
- package/chunks/{chunk-XUV7CW3L.js → chunk-IY3YRKJJ.js} +1 -1
- package/chunks/{chunk-O325ZU5M.js → chunk-JTSRGXS4.js} +1 -1
- package/chunks/{chunk-CVDLYIOW.js → chunk-KFSZ6MDH.js} +1 -1
- package/chunks/chunk-KNIM3QST.js +10 -0
- package/chunks/chunk-L32KHQVT.js +3 -0
- package/chunks/chunk-LS5MCZUM.js +2 -0
- package/chunks/{chunk-ATYDQCCJ.js → chunk-MGNBNMJZ.js} +1 -1
- package/chunks/chunk-MX5DKVDI.js +2 -0
- package/chunks/{chunk-JO4JKJ7R.js → chunk-N6PXARPJ.js} +1 -1
- package/chunks/{chunk-2LF7QSIN.js → chunk-NWWXAZFA.js} +8 -8
- package/chunks/{chunk-MW3RJU6I.js → chunk-OSNPAAYT.js} +1 -1
- package/chunks/{chunk-6BILFSH2.js → chunk-PBZV2KA3.js} +1 -1
- package/chunks/{chunk-YKEVDAWS.js → chunk-PG7KG7NX.js} +1 -1
- package/chunks/{chunk-UGYRUVUH.js → chunk-PY6ZNQ4B.js} +1 -1
- package/chunks/{chunk-PPSDIDOI.js → chunk-QHVTWYZJ.js} +1 -1
- package/chunks/chunk-QL5FA3P3.js +2 -0
- package/chunks/{chunk-ULIMXXRY.js → chunk-QRNSYEPI.js} +1 -1
- package/chunks/{chunk-N4NDBIQS.js → chunk-QXSFQQGJ.js} +1 -1
- package/chunks/{chunk-OLHBVIWG.js → chunk-TBRDRQQK.js} +1 -1
- package/chunks/{chunk-DLBRD3UT.js → chunk-TTLUVJIR.js} +1 -1
- package/chunks/chunk-UTWYRNI6.js +17 -0
- package/chunks/{chunk-JFKHBLJB.js → chunk-UYGKTA3C.js} +1 -1
- package/chunks/chunk-VKB3B2FE.js +4 -0
- package/chunks/{chunk-IIFFSCDJ.js → chunk-VXVW4UNH.js} +1 -1
- package/chunks/{chunk-TZDEJTLC.js → chunk-WJI2X6IA.js} +1 -1
- package/chunks/{chunk-LYPDFFKK.js → chunk-YCI2VITZ.js} +1 -1
- package/chunks/chunk-YXETE4S3.js +4 -0
- package/chunks/chunk-Z2RL2SFY.js +4 -0
- package/chunks/{chunk-R3UCRXDC.js → chunk-ZQ7KN4HT.js} +1 -1
- package/chunks/{claude-code-UJYCO6CN.js → claude-code-RN3Q2VCK.js} +1 -1
- package/chunks/commitmsg-BRWGZ26L.js +15 -0
- package/chunks/{concern-I6LCWEIC.js → concern-DXCLVP5Y.js} +1 -1
- package/chunks/config-O3OOS5BQ.js +2 -0
- package/chunks/{dev-JM7NU24M.js → dev-NJVFMPTE.js} +1 -1
- package/chunks/done-HGZT3ZOT.js +2 -0
- package/chunks/{file-tools-shared-YKDNDDHR.js → file-tools-shared-IIW7WSUM.js} +1 -1
- package/chunks/free-IPJPYOJS.js +2 -0
- package/chunks/{gh-DJ2YTDQX.js → gh-YLYXDL2X.js} +2 -2
- package/chunks/{gh-contributors-SXUFX3SO.js → gh-contributors-YFATSPSW.js} +1 -1
- package/chunks/{init-GBMYF3YG.js → init-BZ6B74SY.js} +1 -1
- package/chunks/{init-M3P2QCX2.js → init-X6KNS3NC.js} +1 -1
- package/chunks/invoke-hook-KLJOYZF5.js +12 -0
- package/chunks/{kiro-V6SMU4OL.js → kiro-JS5UVLRL.js} +1 -1
- package/chunks/{list-NX7RRO6R.js → list-COFD6OUQ.js} +1 -1
- package/chunks/{list-ZVCGDRUH.js → list-RI4IF5TD.js} +1 -1
- package/chunks/{main-JAGIKKVD.js → main-JZTE4B4L.js} +1 -1
- package/chunks/manager-FMP6PKIR.js +7 -0
- package/chunks/{mod-VZT7JWPZ.js → mod-64M47KGW.js} +1 -1
- package/chunks/{mod-NSL6IJRQ.js → mod-CTW3YE4Q.js} +1 -1
- package/chunks/{mod-7ICCX4OY.js → mod-D5IDWU35.js} +1 -1
- package/chunks/{mod-5NDTGNVM.js → mod-DESWHMN6.js} +1 -1
- package/chunks/{mod-QCXWBSGJ.js → mod-MC2WNSB2.js} +1 -1
- package/chunks/{mod-2WMXZZGJ.js → mod-TUZZQKGZ.js} +1 -1
- package/chunks/{mod-KPIOBBDD.js → mod-YNYASB66.js} +1 -1
- package/chunks/next-6K3PS64Z.js +9 -0
- package/chunks/{ollama-DFG5G467.js → ollama-PL4UHEF2.js} +1 -1
- package/chunks/{opencode-UA45VV3W.js → opencode-K4G7UMAE.js} +1 -1
- package/chunks/{pack-7TGKWDRO.js → pack-YQVWUWCL.js} +1 -1
- package/chunks/{purge-IKPQWHBC.js → purge-ZQ23VDGR.js} +1 -1
- package/chunks/{release-SEKFNXRA.js → release-XACZAR6J.js} +2 -2
- package/chunks/{release-notes-UUCPVHBQ.js → release-notes-W6MNV6OT.js} +1 -1
- package/chunks/{release-tag-F4B6ICW4.js → release-tag-HSZX6WYU.js} +1 -1
- package/chunks/reopen-Z3MPVAGR.js +2 -0
- package/chunks/reset-NWO3MNAG.js +2 -0
- package/chunks/{rule-PQ6WRV5W.js → rule-CH5GMFKE.js} +1 -1
- package/chunks/run-5YOXFMP2.js +4 -0
- package/chunks/{run-DAKF5SJN.js → run-IMXYUDHS.js} +1 -1
- package/chunks/{scripts-VRQQ24O3.js → scripts-XTXYY5MJ.js} +1 -1
- package/chunks/{sdk-L2SQCWYV.js → sdk-EJKXYVDC.js} +8 -8
- package/chunks/{serve-OGJIE344.js → serve-3PZ7RBQY.js} +1 -1
- package/chunks/session-22XFZLH2.js +2 -0
- package/chunks/spec-PWS2UYVL.js +2 -0
- package/chunks/status-G5D6BYFF.js +2 -0
- package/chunks/{sync-N5STAT6M.js → sync-URY32B7Y.js} +1 -1
- package/chunks/{system-6GEEPUXD.js → system-CP5L6XUP.js} +1 -1
- package/chunks/{system-3236RFTI.js → system-N5A3SM5G.js} +1 -1
- package/chunks/{validate-bom-ME2NQAP3.js → validate-bom-EH5Z5TVU.js} +1 -1
- package/chunks/{validate-case-conflict-QUNIB43P.js → validate-case-conflict-XN4KQDSK.js} +1 -1
- package/chunks/{validate-circular-deps-DLUCIW7T.js → validate-circular-deps-YZ4DIXIM.js} +1 -1
- package/chunks/{validate-commit-msg-SRLJRTKU.js → validate-commit-msg-MXTBUPTC.js} +1 -1
- package/chunks/{validate-docs-43LWHLVW.js → validate-docs-BE32R2UM.js} +1 -1
- package/chunks/{validate-filenames-WNLZI2S6.js → validate-eof-JPKT2D3D.js} +1 -1
- package/chunks/{validate-export-names-D5I5DZTN.js → validate-export-names-D3QNF6VB.js} +1 -1
- package/chunks/{validate-eof-RV3IK6ZM.js → validate-filenames-DMZ46CRH.js} +1 -1
- package/chunks/{validate-json-6KIMBNBJ.js → validate-json-KG3U4NLK.js} +1 -1
- package/chunks/validate-large-files-C2ILVCDB.js +2 -0
- package/chunks/validate-licenses-P24RTTYG.js +2 -0
- package/chunks/validate-line-endings-F65GG2PC.js +2 -0
- package/chunks/validate-merge-conflict-PVT6WR2W.js +2 -0
- package/chunks/{validate-mod-exports-VCV4VZ5F.js → validate-mod-exports-J6KLADGR.js} +1 -1
- package/chunks/{validate-package-configs-6PGL2YGD.js → validate-package-configs-BFCQMBEI.js} +1 -1
- package/chunks/validate-secrets-RBD2KJ3R.js +2 -0
- package/chunks/validate-shebangs-L5YR7AGC.js +2 -0
- package/chunks/validate-submodules-HD7CSBOG.js +2 -0
- package/chunks/validate-symlinks-RPSZMV5Y.js +2 -0
- package/chunks/{validate-toml-PV3G7EFD.js → validate-toml-OMUYIHX2.js} +1 -1
- package/chunks/validate-trailing-whitespace-BIG3YYFY.js +2 -0
- package/chunks/{validate-yaml-IOMFQTSQ.js → validate-yaml-VTE42YLF.js} +1 -1
- package/chunks/{versions-ROLQITT5.js → versions-GXSXTSSG.js} +1 -1
- package/chunks/{watch-4NXY7JEX.js → watch-EVUCQISN.js} +6 -6
- package/chunks/wontfix-4R2ESAR5.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-UWBYGXCF.js +0 -2
- package/chunks/block-W76WKMS3.js +0 -2
- package/chunks/cancel-46C7E5N7.js +0 -2
- package/chunks/chunk-2HSGE3TL.js +0 -2
- package/chunks/chunk-2TANTKYS.js +0 -4
- package/chunks/chunk-C2IORZTF.js +0 -4
- package/chunks/chunk-DPZJWN2Y.js +0 -2
- package/chunks/chunk-EQUPVWVY.js +0 -2
- package/chunks/chunk-GVTM4EOU.js +0 -4
- package/chunks/chunk-LJ7A5HYR.js +0 -2
- package/chunks/chunk-TMMAF763.js +0 -10
- package/chunks/chunk-WZHVKEPB.js +0 -17
- package/chunks/chunk-XOMPQOI6.js +0 -4
- package/chunks/chunk-YACXTCWF.js +0 -2
- package/chunks/commitmsg-57EMHAFY.js +0 -11
- package/chunks/done-A5VWIFOF.js +0 -2
- package/chunks/free-5NMWMMYS.js +0 -2
- package/chunks/invoke-hook-6BKTP2JY.js +0 -12
- package/chunks/manager-GN6J4AUV.js +0 -7
- package/chunks/next-TIUOHHFS.js +0 -9
- package/chunks/reopen-G4IUIH73.js +0 -2
- package/chunks/reset-BJZ263XC.js +0 -2
- package/chunks/run-Y4ESAQUK.js +0 -4
- package/chunks/session-CFDY73RJ.js +0 -2
- package/chunks/spec-CYRR2XUA.js +0 -2
- package/chunks/status-ZE2SA6FP.js +0 -2
- package/chunks/validate-large-files-UXP7AZCW.js +0 -2
- package/chunks/validate-licenses-BL6PNSBP.js +0 -2
- package/chunks/validate-line-endings-NYHXORRG.js +0 -2
- package/chunks/validate-merge-conflict-IWUP4ZMW.js +0 -2
- package/chunks/validate-secrets-JV4ZSOVR.js +0 -2
- package/chunks/validate-shebangs-YACNWUG7.js +0 -2
- package/chunks/validate-submodules-ZXID3VEK.js +0 -2
- package/chunks/validate-symlinks-QNMKPYUY.js +0 -2
- package/chunks/validate-trailing-whitespace-5Q5SEHOD.js +0 -2
- package/chunks/wontfix-YSXRDPKA.js +0 -2
package/chunks/chunk-XOMPQOI6.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as f}from"./chunk-IZUADMIU.js";import{c as d}from"./chunk-TMMAF763.js";import{i as u}from"./chunk-6DBKPC2O.js";var m=r=>{let n=r.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return n.length>1?n:r.split(/\.(?=\s+[A-Z])|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},v=(r,n=[])=>{let t=[],o=r.find(e=>e.questionId==="ambition");if(o!==void 0){let e=o.answer,c=e.match(/10[- ]?star[:\s]+(.+?)(?:\n|$)/is),a=e.match(/5[- ]?star[:\s]+(.+?)(?:\n|$)/is),s=(c!==null?c[1].trim():a!==null?a[1].trim():e.replace(/1[- ]?star[:\s]+[^.]*\.\s*/i,"").trim()).replace(/^(the|a|an|with|plus|also)\s+/i,"").replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim();s.length>0&&(s=s.charAt(0).toUpperCase()+s.slice(1)),s=s.replace(/[.\u2026]+$/,"").trim(),s.length>140&&(s=s.slice(0,137)+"..."),s.length>3&&t.push(s)}let i=r.find(e=>e.questionId==="verification");if(i!==void 0){let e=i.answer.split(/\n/).map(c=>c.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(c=>c.length>0);for(let c of e)t.push(c)}for(let e of n){let c=e.choice.toLowerCase();if(c.includes("accepted")||c.includes("add to scope")){let a=e.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),l=a.charAt(0).toUpperCase()+a.slice(1);t.push(l)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t.push("Write or update tests for all new and changed behavior"),t.push("Update documentation for all public-facing changes (README, API docs, CHANGELOG)"),t},w=(r,n)=>{let t={};if(n===null){for(let o of r.specSections)t[o]=!1;return t}for(let o of r.specSections){let i=o.toLowerCase();i.includes("design")||i.includes("mobile")||i.includes("layout")||i.includes("interaction")?t[o]=n.involvesWebUI:i.includes("contributor")||i.includes("public api")||i.includes("api surface")?t[o]=n.involvesPublicAPI:i.includes("migration")||i.includes("deprecation")||i.includes("backward")||i.includes("compatibility")?t[o]=n.involvesMigration:i.includes("audit")||i.includes("access control")||i.includes("data handling")?t[o]=n.involvesDataHandling:t[o]=!0}return t},g=(r,n,t,o,i)=>{let e=[];e.push(`# Spec: ${r}`),e.push(""),e.push("## Status: draft"),e.push(""),t.length>0&&(e.push(`## Concerns: ${t.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of n)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of t)if(s.specSections.length>0){let p=w(s,i??null);for(let h of s.specSections)p[h]!==!1&&(e.push(`## ${h} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<o.length;s++){let p=o[s];e.push(`| ${s+1} | ${p.question} | ${p.choice} | ${p.promoted?"yes":"no"} |`)}e.push("")}let c=n.find(s=>s.questionId==="scope_boundary");if(c!==void 0){e.push("## Out of Scope"),e.push("");let s=m(c.answer);for(let p of s)e.push(`- ${p}`);e.push("")}let a=v(n,o);e.push("## Tasks"),e.push("");for(let s=0;s<a.length;s++)e.push(`- [ ] task-${s+1}: ${a[s]}`);e.push("");let l=n.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),l!==void 0){let s=m(l.answer);for(let p of s)e.push(`- ${p}`)}else e.push("_To be defined._");return e.push(""),e.join(`
|
|
3
|
-
`)};var D=async(r,n,t)=>{if(n.spec===null)throw new Error("No active spec");let o=`${r}/${d.specDir(n.spec)}`,i=`${r}/${d.specFile(n.spec)}`;await u.fs.mkdir(o,{recursive:!0});let e=g(n.spec,n.discovery.answers,t,n.decisions,n.classification);await u.fs.writeTextFile(i,e);let c=f(n.spec,e),a=`${o}/progress.json`,l={spec:n.spec,status:"draft",tasks:c.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:n.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await u.fs.writeTextFile(a,JSON.stringify(l,null,2)+`
|
|
4
|
-
`),i};export{D as a};
|
package/chunks/chunk-YACXTCWF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as ge,h as re,k as se}from"./chunk-SHN5MT56.js";import{b as u,c as Le,d as p,e as $,f as S,g,h as L,i as Be,k as R,l as _,n as ye,o as U}from"./chunk-YVN2NZL4.js";import{i as x}from"./chunk-6DBKPC2O.js";import{d as N}from"./chunk-5WJ6AUNY.js";var m=Symbol("tui.cancel"),We=e=>e===m,Me={ctrlC:"exit",escape:"cancel"},je=()=>{try{return x.process.stdin}catch{return new ReadableStream}},ze=e=>{let t=e?.interaction??(e?.target==="non-interactive"?"non-interactive":"interactive"),r=e?.audience??"human",s=t==="non-interactive"?"non-interactive":"interactive",i=t==="interactive";return{output:e?.output??ge({renderer:i?se.ansi():se.plain(),sink:i?re.stdout():re.stderr()}),input:e?.input??je(),target:s,interaction:t,audience:r,signals:{...Me,...e?.signals},stderr:e?.stderr??ge({renderer:se.plain(),sink:re.stderr()})}};var Ie={};N(Ie,{disableMouse:()=>Ye,enableMouse:()=>Xe,isSGRMouseSequence:()=>xe,parseMouseEvent:()=>be});var Xe=()=>"\x1B[?1000h\x1B[?1002h\x1B[?1006h",Ye=()=>"\x1B[?1006l\x1B[?1002l\x1B[?1000l",Je=/^\x1b\[<(\d+);(\d+);(\d+)([Mm])$/,be=e=>{let t=e.match(Je);if(t===null)return null;let r=parseInt(t[1],10),s=parseInt(t[2],10)-1,i=parseInt(t[3],10)-1,n=t[4]==="m",o=r&3,a=(r&4)!==0,c=(r&16)!==0,d=(r&32)!==0;return(r&64)!==0?{type:"wheel",button:0,x:s,y:i,shift:a,ctrl:c,direction:r&1?"down":"up"}:d?{type:"mousemove",button:o,x:s,y:i,shift:a,ctrl:c}:{type:n?"mouseup":"mousedown",button:o,x:s,y:i,shift:a,ctrl:c}},xe=e=>e.length>=4&&e[0]===27&&e[1]===91&&e[2]===60;var O=async e=>{let t=!1;if(x.capabilities.stdin&&x.process.isTerminal("stdin"))try{x.process.setStdinRaw(!0),t=!0}catch{}try{return await e()}finally{if(t)try{x.process.setStdinRaw(!1)}catch{}}},E=e=>{e.write(u("\x1B[?25l"))},k=e=>{e.write(u("\x1B[?25h"))},h=(e,t)=>{t>0&&e.write(u(`\x1B[${t}A\x1B[J`))},ne=e=>{e.write(u("\r\x1B[2K"))},Ne=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*P(e,t){let r=e.getReader();try{for(;!t?.aborted;){let{done:s,value:i}=await r.read();if(s||i===void 0)break;yield Ne(i)}}finally{r.releaseLock()}}async function*Ze(e,t){let r=e.getReader(),s=new TextDecoder;try{for(;!t?.aborted;){let{done:i,value:n}=await r.read();if(i||n===void 0)break;if(xe(n)){let o=s.decode(n),a=be(o);if(a!==null){yield{kind:"mouse",event:a};continue}}yield{kind:"key",event:Ne(n)}}}finally{r.releaseLock()}}var w=(e,t)=>{if(e==="exit"){k(t.output);try{x.process.setStdinRaw(!1)}catch{}x.process.exit(130)}return e==="cancel"?"cancel":"continue"};var y="\u2502",_e="\u250C",C="\u2514";var F="\u25CF",H="\u25CB",De="\u25FC",Ge="\u25FB",B="\u25C6",v="\u25C7",A="\u25A0",$e="\u25CF";var D="\u25B2";var Ue="\u25C7";var ie=(e,t,r,s)=>{if(s==="done"){let o=r?"Yes":"No";return e.output.writeln(g(v),u(` ${t}`),p(` \xB7 ${o}`)),1}if(s==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let i=r?$(g(F),u(" Yes")):$(p(H),p(" Yes")),n=r?$(p(H),p(" No")):$(g(F),u(" No"));return e.output.writeln(R(B),u(` ${t}`)),e.output.writeln(p(y),u(" "),i,p(" / "),n),e.output.writeln(p(C)),3},Qe=async(e,t)=>{let r=t.initialValue??!0,s=0;E(e.output);try{return await O(async()=>{s=ie(e,t.message,r,"active"),await e.output.flush();let i=()=>{h(e.output,s),ie(e,t.message,r,"cancel")};for await(let n of P(e.input)){if(n.name==="c"&&n.ctrl){if(w(e.signals.ctrlC,e)==="cancel")return i(),await e.output.flush(),m;continue}if(n.name==="escape"){if(w(e.signals.escape,e)==="cancel")return i(),await e.output.flush(),m;continue}if(n.name==="return")return h(e.output,s),ie(e,t.message,r,"done"),await e.output.flush(),r;let o=!1;(n.name==="left"||n.name==="right")&&(r=!r,o=!0),(n.name==="y"||n.name==="Y")&&(r=!0,o=!0),(n.name==="n"||n.name==="N")&&(r=!1,o=!0),o&&(h(e.output,s),s=ie(e,t.message,r,"active"),await e.output.flush())}return m})}finally{k(e.output),await e.output.flush()}};var q=(e,t,r,s,i,n)=>{if(n==="done")return e.output.writeln(g(v),u(` ${t}`),p(` \xB7 ${r}`)),1;if(n==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let o=r.length>0?u(r):s!==void 0?p(s):u(""),a=i!==void 0?L(D):R(B);e.output.writeln(a,u(` ${t}`)),e.output.writeln(p(y),u(" "),o);let c=2;return i!==void 0?(e.output.writeln(p(C),u(" "),L(i)),c=3):(e.output.writeln(p(C)),c=3),c},et=async(e,t)=>{let r=t.initialValue??"",s=r.length,i,n=0;E(e.output);try{return await O(async()=>{n=q(e,t.message,r,t.placeholder,i,"active"),await e.output.flush();let o=()=>{h(e.output,n),q(e,t.message,r,t.placeholder,void 0,"cancel")};for await(let a of P(e.input)){if(a.name==="c"&&a.ctrl){if(w(e.signals.ctrlC,e)==="cancel")return o(),await e.output.flush(),m;continue}if(a.name==="escape"){if(w(e.signals.escape,e)==="cancel")return o(),await e.output.flush(),m;continue}if(a.name==="return"){if(t.validate!==void 0){let c=t.validate(r);if(c!==void 0){i=c,h(e.output,n),n=q(e,t.message,r,t.placeholder,i,"active"),await e.output.flush();continue}}return h(e.output,n),q(e,t.message,r,t.placeholder,void 0,"done"),await e.output.flush(),r}if(i=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;h(e.output,n),n=q(e,t.message,r,t.placeholder,i,"active"),await e.output.flush()}return m})}finally{k(e.output),await e.output.flush()}};var oe=(e,t,r,s,i)=>{if(i==="done"){let n=r[s];return e.output.writeln(g(v),u(` ${t}`),p(` \xB7 ${n?.label??""}`)),1}if(i==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;e.output.writeln(R(B),u(` ${t}`));for(let n=0;n<r.length;n++){let o=r[n],a=n===s,c=o.disabled===!0,d=a?g(F):p(H),l=c?p(` ${o.label}`):a?u(` ${o.label}`):p(` ${o.label}`),f=o.hint!==void 0?p(` (${o.hint})`):u("");e.output.writeln(p(y),u(" "),d,l,f)}return e.output.writeln(p(C)),r.length+2},we=(e,t,r)=>{let s=e.length,i=t;for(let n=0;n<s;n++)if(i=(i+r+s)%s,e[i]?.disabled!==!0)return i;return t},tt=async(e,t)=>{let r=0;if(t.initialValue!==void 0){let i=t.options.findIndex(n=>n.value===t.initialValue);i>=0&&(r=i)}t.options[r]?.disabled===!0&&(r=we(t.options,r,1));let s=0;E(e.output);try{return await O(async()=>{s=oe(e,t.message,t.options,r,"active"),await e.output.flush();let i=()=>{h(e.output,s),oe(e,t.message,t.options,r,"cancel")};for await(let n of P(e.input)){if(n.name==="c"&&n.ctrl){if(w(e.signals.ctrlC,e)==="cancel")return i(),await e.output.flush(),m;continue}if(n.name==="escape"){if(w(e.signals.escape,e)==="cancel")return i(),await e.output.flush(),m;continue}if(n.name==="return")return h(e.output,s),oe(e,t.message,t.options,r,"done"),await e.output.flush(),t.options[r].value;let o=!1;(n.name==="up"||n.name==="k")&&(r=we(t.options,r,-1),o=!0),(n.name==="down"||n.name==="j")&&(r=we(t.options,r,1),o=!0),o&&(h(e.output,s),s=oe(e,t.message,t.options,r,"active"),await e.output.flush())}return m})}finally{k(e.output),await e.output.flush()}};var W=(e,t,r,s,i,n,o)=>{if(o==="done"){let d=[...i].sort((l,f)=>l-f).map(l=>r[l]?.label??"").join(", ");return e.output.writeln(g(v),u(` ${t}`),p(` \xB7 ${d}`)),1}if(o==="cancel")return e.output.writeln(S(A),u(` ${t}`)),1;let a=n!==void 0?L(D):R(B);e.output.writeln(a,u(` ${t}`));for(let d=0;d<r.length;d++){let l=r[d],f=d===s,b=i.has(d),G=l.disabled===!0,de=b?g(De):p(Ge),me=G?p(` ${l.label}`):f?u(` ${l.label}`):p(` ${l.label}`),he=l.hint!==void 0?p(` (${l.hint})`):u("");e.output.writeln(p(y),u(" "),de,me,he)}let c=r.length+2;return n!==void 0?e.output.writeln(p(C),u(" "),L(n)):e.output.writeln(p(C)),c},Ce=(e,t,r)=>{let s=e.length,i=t;for(let n=0;n<s;n++)if(i=(i+r+s)%s,e[i]?.disabled!==!0)return i;return t},rt=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=Ce(t.options,r,1));let i=0,n;E(e.output);try{return await O(async()=>{i=W(e,t.message,t.options,r,s,n,"active"),await e.output.flush();let o=()=>{h(e.output,i),W(e,t.message,t.options,r,s,void 0,"cancel")};for await(let a of P(e.input)){if(a.name==="c"&&a.ctrl){if(w(e.signals.ctrlC,e)==="cancel")return o(),await e.output.flush(),m;continue}if(a.name==="escape"){if(w(e.signals.escape,e)==="cancel")return o(),await e.output.flush(),m;continue}if(a.name==="return"){if(t.required!==!1&&s.size===0){n="Please select at least one option.",h(e.output,i),i=W(e,t.message,t.options,r,s,n,"active"),await e.output.flush();continue}return h(e.output,i),W(e,t.message,t.options,r,s,void 0,"done"),await e.output.flush(),[...s].sort((d,l)=>d-l).map(d=>t.options[d].value)}n=void 0;let c=!1;if((a.name==="up"||a.name==="k")&&(r=Ce(t.options,r,-1),c=!0),(a.name==="down"||a.name==="j")&&(r=Ce(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 d=t.options.every((l,f)=>l.disabled===!0||s.has(f));for(let l=0;l<t.options.length;l++)t.options[l]?.disabled!==!0&&(d?s.delete(l):s.add(l));c=!0}c&&(h(e.output,i),i=W(e,t.message,t.options,r,s,n,"active"),await e.output.flush())}return m})}finally{k(e.output),await e.output.flush()}};var st=(e,t)=>{e.output.writeln(_(_e),u(" "),Le(t)),e.output.writeln(_(y))},nt=(e,t)=>{e.output.writeln(_(y)),e.output.writeln(_(C),u(" "),u(t))},it=e=>{e.output.writeln(u(""))},ot=(e,t)=>{e.output.writeln(u(" "),p(t))},at=e=>{e.output.writeln(_(y))},lt={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(p(Ue),u(" "),p(t))},message:(e,t,r)=>{e.output.writeln(p(r??y),u(" "),u(t))}};var ut=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],ct=80,pt=(e,t,r)=>{let s=r?.frames??ut,i=r?.interval??ct,n=t,o=0,a,c=()=>{e.output.write(u(`\r${" ".repeat(n.length+4)}\r`))},d=()=>{a!==void 0&&(clearInterval(a),a=void 0,c())};return{start:l=>{l!==void 0&&(n=l),a=setInterval(()=>{let f=s[o%s.length];e.output.write(u("\r"),R(f??""),u(` ${n}`)),o++},i)},stop:l=>{d(),l!==void 0&&(n=l)},update:l=>{n=l},succeed:l=>{d(),e.output.writeln(g(v),u(` ${l??n}`))},fail:l=>{d(),e.output.writeln(S(A),u(` ${l??n}`))},warn:l=>{d(),e.output.writeln(L(D),u(` ${l??n}`))},info:l=>{d(),e.output.writeln(Be($e),u(` ${l??n}`))}}};var dt=(e,t)=>{let r=0,s=t.label??"",i=!1,n=()=>{let o=t.total>0?Math.round(r/t.total*100):0;ne(e.output),e.output.write(p(y),u(" "),ye(o,{width:t.width??20,label:s}))};return{start:o=>{o!==void 0&&(s=o),i=!0,e.output.writeln(p(v),u(` ${s}`)),n()},advance:(o,a)=>{i&&(r=Math.min(r+o,t.total),a!==void 0&&(s=a),n())},stop:o=>{i&&(i=!1,r=t.total,o!==void 0&&(s=o),ne(e.output),e.output.writeln(p(y),u(" "),ye(100,{width:t.width??20,label:s})))}}};var Ve={};N(Ve,{clearScreenSeq:()=>gt,enterAlternateScreen:()=>mt,exitAlternateScreen:()=>ht,getTerminalSize:()=>bt,hideCursorSeq:()=>ft,showCursorSeq:()=>yt});var mt=()=>"\x1B[?1049h",ht=()=>"\x1B[?1049l",ft=()=>"\x1B[?25l",yt=()=>"\x1B[?25h",gt=()=>"\x1B[2J\x1B[H",bt=()=>{try{let{columns:e,rows:t}=x.process.consoleSize();return{cols:e,rows:t}}catch{return{cols:80,rows:24}}};var ce={};N(ce,{bgBlue:()=>vt,bgGreen:()=>Ct,bold:()=>xt,cyan:()=>Se,dim:()=>ae,green:()=>le,inverse:()=>Re,moveTo:()=>T,red:()=>Te,reset:()=>ue,stripAnsi:()=>ke,truncate:()=>z,visibleLength:()=>j,white:()=>wt,yellow:()=>ve});var T=(e,t)=>`\x1B[${e};${t}H`,xt=e=>`\x1B[1m${e}\x1B[22m`,ae=e=>`\x1B[2m${e}\x1B[22m`,le=e=>`\x1B[32m${e}\x1B[39m`,ve=e=>`\x1B[33m${e}\x1B[39m`,Te=e=>`\x1B[31m${e}\x1B[39m`,Se=e=>`\x1B[36m${e}\x1B[39m`,wt=e=>`\x1B[37m${e}\x1B[39m`,Ct=e=>`\x1B[42m${e}\x1B[49m`,vt=e=>`\x1B[44m${e}\x1B[49m`,Re=e=>`\x1B[7m${e}\x1B[27m`,ue=()=>"\x1B[0m",Tt=/\x1b\[[0-9;]*[a-zA-Z]/g,ke=e=>e.replace(Tt,""),j=e=>ke(e).length,z=(e,t)=>{if(ke(e).length<=t)return e;let s=0,i=0,n=e;for(;i<n.length&&s<t-1;){if(n[i]==="\x1B"){let o=n.indexOf("m",i);if(o!==-1){i=o+1;continue}}s++,i++}return n.slice(0,i)+"\u2026"+ue()};var Ke={};N(Ke,{calculateLayout:()=>St});var St=(e,t,r)=>{let s=r.leftWidth<=1?Math.floor(e*r.leftWidth):Math.min(Math.floor(r.leftWidth),e),i=e-s,n=t-1,o=r.rightTopHeight<=1?Math.floor(n*r.rightTopHeight):Math.min(Math.floor(r.rightTopHeight),n),a=n-o;return{left:{id:"left",x:1,y:1,width:s,height:n},rightTop:{id:"rightTop",x:s+1,y:1,width:i,height:o},rightBottom:{id:"rightBottom",x:s+1,y:o+1,width:i,height:a},statusBar:{id:"statusBar",x:1,y:t,width:e,height:1}}};var Fe={};N(Fe,{nextSelectableIndex:()=>kt,renderList:()=>At});var Rt=(e,t)=>{switch(t){case"green":return le(e);case"yellow":return ve(e);case"red":return Te(e);case"cyan":return Se(e);case"dim":return ae(e);default:return e}},kt=(e,t,r)=>{let s=r==="up"?-1:1,i=t+s;for(;i>=0&&i<e.length;){if(e[i].selectable!==!1)return i;i+=s}return t},At=(e,t,r)=>{let s=[],i=r.width-2,n=r.height-2,o=0;t>=n&&(o=t-n+1);for(let a=0;a<n;a++){let c=o+a,d=r.y+1+a;if(c>=e.length){s.push(T(d,r.x+1)+" ".repeat(i));continue}let l=e[c],f=l.selectable!==!1,b=c===t&&f,G=l.active?le("\u25CF"):b?"\u25B8":" ",de=l.badge!==void 0?" "+Rt(`[${l.badge}]`,l.badgeColor??"dim"):"",me=l.dimmed?ae(l.label):l.label,he=` ${G} ${me}${de}`,fe=z(he,i),Pe=Math.max(0,i-j(fe));b?s.push(T(d,r.x+1)+Re(fe+" ".repeat(Pe))):s.push(T(d,r.x+1)+fe+" ".repeat(Pe))}return s.join("")};var Y=()=>({char:" ",fg:-1,bg:-1,fgRGB:null,bgRGB:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1}),pe=(e,t)=>{let r=[];for(let s=0;s<e;s++){let i=[];for(let n=0;n<t;n++)i.push(Y());r.push(i)}return r},X=e=>{let t=[];for(let r=0;r<e;r++)t.push(Y());return t},J=class{#e;#t;#r;#i=null;#o=0;#n;#s=new Set;constructor(t,r){this.#e=t,this.#t=r,this.#r=pe(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?Y():this.#r[t][r]}setCell(t,r,s,i){t<0||t>=this.#e||r<0||r>=this.#t||(this.#r[t][r]={char:i,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,X(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,X(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,X(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,X(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 i=0;i<this.#t;i++)s[i]=Y();this.#s.add(t)}clearLineRange(t,r,s){if(t<0||t>=this.#e)return;let i=this.#r[t];for(let n=r;n<=Math.min(s,this.#t-1);n++)i[n]=Y();this.#s.add(t)}clearDisplay(t,r,s){if(t===0){this.clearLineRange(r,s,this.#t-1);for(let i=r+1;i<this.#e;i++)this.clearLine(i,2)}else if(t===1){for(let i=0;i<r;i++)this.clearLine(i,2);this.clearLineRange(r,0,s)}else{this.#r=pe(this.#e,this.#t);for(let i=0;i<this.#e;i++)this.#s.add(i)}}enterAlternateScreen(){this.#i=this.#r,this.#r=pe(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=pe(t,r),i=Math.min(t,this.#e),n=Math.min(r,this.#t);for(let o=0;o<i;o++)for(let a=0;a<n;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?X(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 Z=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 Q=()=>({fg:-1,bg:-1,fgRGB:null,bgRGB:null,bold:!1,dim:!1,italic:!1,underline:!1,inverse:!1}),Ae=(e,t)=>{let r={...t},s=0;for(;s<e.length;){let i=e[s];switch(i){case 0:Object.assign(r,Q());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=i-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=i-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=i-90+8;break;case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:r.bg=i-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 ee=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 i=0;i<t.length;i++){let n=t[i],o=n.charCodeAt(0);switch(this.#e){case"GROUND":n==="\x1B"?(s(),this.#e="ESC"):o<32&&o!==27?(s(),r.push({type:"control",code:o})):this.#i+=n;break;case"ESC":n==="["?(this.#e="CSI_PARAM",this.#t=""):n==="]"?(this.#e="OSC",this.#r=""):(r.push({type:"esc",command:n}),this.#e="GROUND");break;case"CSI_PARAM":if(o>=48&&o<=63||n===";"||n==="?")this.#t+=n;else if(o>=64&&o<=126){let a=this.#t.replace(/^\?/,""),c=this.#t.startsWith("?"),d=a.length>0?a.split(";").map(f=>{let b=parseInt(f,10);return isNaN(b)?0:b}):[],l=(c?"?":"")+n;r.push({type:"csi",command:l,params:d}),this.#e="GROUND"}else this.#t+=n;break;case"OSC":if(n==="\x07"||n==="\\"&&this.#r.endsWith("\x1B")){let a=n==="\\"?this.#r.slice(0,-1):this.#r,c=a.indexOf(";"),d=c>=0?parseInt(a.slice(0,c),10):0,l=c>=0?a.slice(c+1):a;r.push({type:"osc",command:isNaN(d)?0:d,data:l}),this.#e="GROUND"}else this.#r+=n;break}}return s(),r}};var te=class{screen;cursor;#e;#t;constructor(t,r){this.screen=new J(t,r),this.cursor=new Z,this.#e=new ee,this.#t=Q()}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,i=r[1]??0,n=s||1;switch(t){case"A":this.cursor.moveUp(n);break;case"B":this.cursor.moveDown(n);break;case"C":this.cursor.moveForward(n);break;case"D":this.cursor.moveBack(n);break;case"H":case"f":this.cursor.moveTo((s||1)-1,(i||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=Ae(r.length>0?r:[0],this.#t);break;case"S":this.screen.scrollUp(n);break;case"T":this.screen.scrollDown(n);break;case"L":this.screen.insertLines(n,this.cursor.row);break;case"M":this.screen.deleteLines(n,this.cursor.row);break;case"s":this.cursor.save();break;case"u":this.cursor.restore();break;case"r":this.screen.setScrollRegion((s||1)-1,(i||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=Q();break}}};var Bt=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`},Mt=e=>e.fg===-1&&e.fgRGB===null&&!e.bold&&!e.dim&&!e.italic&&!e.underline,Oe=(e,t,r)=>{let s=[],i=e.getDirtyLines(),n=r.fullRedraw===!0||i.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(!n&&!i.has(c))continue;s.push(`\x1B[${r.offsetRow+c};${r.offsetCol}H`);let d=e.getLine(c),l=!1,f=0;for(;f<a;f++){let b=f<d.length?d[f]:void 0;if(b===void 0||Mt(b))l&&(s.push("\x1B[0m"),l=!1),s.push(b?.char??" ");else{let G=Bt(b);s.push(G),l=!0,s.push(b.char)}}l&&s.push("\x1B[0m")}return e.clearDirty(),s.join("")};var Ee=class{#e;#t=!1;constructor(t,r){this.#e=new te(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,Oe(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 qe={};N(qe,{drawBox:()=>He,fillBox:()=>Nt});var It={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"}},He=e=>{let t=e.borderStyle??"single",r=It[t],s=e.width-2,i=[],n=r.tl;if(e.title!==void 0){let o=` ${e.title} `;n+=o+r.h.repeat(Math.max(0,s-o.length))}else n+=r.h.repeat(s);if(n+=r.tr,i.push(T(e.y,e.x)+n),e.skipInterior===!0)for(let o=1;o<e.height-1;o++)i.push(T(e.y+o,e.x)+r.v+T(e.y+o,e.x+e.width-1)+r.v);else for(let o=1;o<e.height-1;o++)i.push(T(e.y+o,e.x)+r.v+ue()+" ".repeat(s)+r.v);return i.push(T(e.y+e.height-1,e.x)+r.bl+r.h.repeat(s)+r.br),i.join("")},Nt=(e,t)=>{let r=He(e),s=e.width-2,i=e.height-2,n=[];for(let o=0;o<i;o++){let a=o<t.length?t[o]:"",c=z(a??"",s),d=Math.max(0,s-j(c));n.push(T(e.y+1+o,e.x+1)+c+" ".repeat(d))}return r+n.join("")};export{We as a,ze as b,Ie as c,O as d,Ze as e,Qe as f,et as g,tt as h,rt as i,st as j,nt as k,it as l,ot as m,at as n,lt as o,pt as p,dt as q,Ve as r,ce as s,qe as t,Ke as u,Fe as v,Ee as w};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-7ZYDAZBD.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import"./chunk-N4NDBIQS.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f,h as g,k as p}from"./chunk-SHN5MT56.js";import{c as n,d,f as u}from"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as o}from"./chunk-GVTM4EOU.js";import"./chunk-6BILFSH2.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var b=`Output ONLY a conventional commit message. No explanation, no markdown, no code blocks, no bullet points.
|
|
3
|
-
|
|
4
|
-
Format: type(scope): description
|
|
5
|
-
Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
|
|
6
|
-
Max 72 characters. One line only. No body. No quotes. No backticks.
|
|
7
|
-
|
|
8
|
-
Example output:
|
|
9
|
-
feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=f({renderer:p.ansi(),sink:g.stdout()});try{let t=await o`git diff --cached`.noThrow().text();if(t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0)return e.writeln(d("No changes detected (nothing staged or modified).")),await e.close(),l(void 0);let s=await y(t),r=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/`/g,"\\`").replace(/\$/g,"\\$").replace(/!/g,"\\!");return e.writeln(""),e.writeln(n("Plain Format:")),e.writeln("```"),e.writeln(s),e.writeln("```"),e.writeln(""),e.writeln(n("Shell Command:")),e.writeln("```"),e.writeln(`git commit -m "${r}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${r}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(u(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-KPIOBBDD.js")).defaultFactories(),r=new w({factories:s}),a=e;if(a===void 0)try{await o`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await r.addModel("default",{provider:a,model:"default"});let c=r.getDefault();if(c===null)throw new Error("No AI model available for commit message generation");let k=await c.generateText({system:b,messages:[h("user",`Generate a commit message for this diff:
|
|
10
|
-
|
|
11
|
-
${i}`)],maxTokens:256});return await r.close(),x(k).trim()},O={name:"ai-commitmsg",description:"Generate commit message from git diff using AI",run:async i=>{try{let e=i.provider,t=await o`git diff --cached`.noThrow().text();return t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0?{name:"ai-commitmsg",passed:!0,issues:[],mutations:[],stats:{skipped:1}}:{name:"ai-commitmsg",passed:!0,issues:[{message:`Suggested: ${await y(t,e)}`}],mutations:[],stats:{generated:1}}}catch(e){return{name:"ai-commitmsg",passed:!1,issues:[{message:e instanceof Error?e.message:String(e)}],mutations:[],stats:{errors:1}}}}};export{y as generateCommitMessage,v as main,O as workflowTool};
|
package/chunks/done-A5VWIFOF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as x,d as D}from"./chunk-7NKYCWAA.js";import{n as k}from"./chunk-DPZJWN2Y.js";import{c as S,e as g,g as C,h as y,i as E}from"./chunk-TMMAF763.js";import{c as $}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as h}from"./chunk-SHN5MT56.js";import{c as m,d as o,f as a,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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};
|
package/chunks/free-5NMWMMYS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as x,d as g}from"./chunk-DPZJWN2Y.js";import{d as E,h as p}from"./chunk-TMMAF763.js";import{c}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f,h as u,k as h}from"./chunk-SHN5MT56.js";import{c as o,d as m,f as n,g as l}from"./chunk-YVN2NZL4.js";import{a as i,b as r}from"./chunk-FFWPJP7A.js";import{i as w}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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,12 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as F}from"./chunk-WZHVKEPB.js";import"./chunk-NY4W44PI.js";import"./chunk-2HSGE3TL.js";import{c as A,d as _}from"./chunk-2LF7QSIN.js";import{c as g,d as D,e as b,k as E,o as $,s as x,t as N,z as P}from"./chunk-TMMAF763.js";import{c as m}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as l}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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.
|
|
3
|
-
`)),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.
|
|
4
|
-
`)),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(`
|
|
5
|
-
`).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(`
|
|
6
|
-
`).filter(Boolean);let y=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
7
|
-
`);p=y[y.length-1]??"no changes"}catch{}let w=[...new Set([...n,...o])],f=(i.iteration??0)+1,k=`${s}/${g.stateDir}/iterations`;try{await a.fs.mkdir(k,{recursive:!0}),await a.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:w,gitStat:p.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
8
|
-
`)}catch{}let c=15;try{let u=await E(s);u!==null&&(c=u.maxIterationsBeforeRestart)}catch{}t.execution={...i,iteration:f,modifiedFiles:w,lastProgress:p.trim()||i.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await a.fs.writeTextFile(`${s}/${g.stateFile}`,JSON.stringify(t,null,2)+`
|
|
9
|
-
`)}catch{}try{await a.fs.writeTextFile(r,"")}catch{}try{await a.fs.remove(`${s}/${g.stateDir}/executor-warned.flag`)}catch{}if(f>=c){let u=new TextEncoder,d=a.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${c}). Consider starting a fresh conversation.
|
|
10
|
-
`)),d.releaseLock()}return l(void 0)},J=async()=>{let e=await R(),s=e.tool_input??{},t=s.file_path??s.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return l(void 0);let i=e.cwd??a.process.cwd(),r=`${i}/${g.stateDir}/files-changed.jsonl`,n=JSON.stringify({file:t,tool:e.tool_name,ts:new Date().toISOString()});try{await a.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let o="";try{o=await a.fs.readTextFile(r)}catch{}await a.fs.writeTextFile(r,o+n+`
|
|
11
|
-
`)}catch{}return l(void 0)},K=async()=>{let e=await R(),t=(e.tool_input??{}).command??"";if(!t.includes("noskills"))return l(void 0);let i=e.cwd??a.process.cwd(),r=`${i}/${g.stateDir}/noskills-calls.jsonl`,n=JSON.stringify({command:t,ts:new Date().toISOString()});try{await a.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let o="";try{o=await a.fs.readTextFile(r)}catch{}await a.fs.writeTextFile(r,o+n+`
|
|
12
|
-
`)}catch{}return l(void 0)},j=async()=>{let e=a.process.cwd();if(!await P(e))return l(void 0);let s=await D(e),t=await E(e),r=(await $(e)).filter(w=>t!==null&&t.concerns.includes(w.id)),n=await A(e),o=_(t?.tools??[]),p=F(s,r,n,t,void 0,void 0,void 0,o);return await M(p),l(void 0)};export{ee as main};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as oe,j as ce,r as j,u as le,w as ue,y as K,z as de}from"./chunk-TMMAF763.js";import{b as X}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as W,d as ie,e as re,r as y,s as l,t as x,u as ae,v as M,w as q}from"./chunk-YACXTCWF.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as se,e as N,f as ne}from"./chunk-GVTM4EOU.js";import{a as _,b as te}from"./chunk-FFWPJP7A.js";import{i as I}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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(`
|
|
3
|
-
`);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 de(a))return console.error("noskills is not initialized. Run:",X(),"init"),te({exitCode:1});let o=(await ce(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=ae.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(`
|
|
4
|
-
`),_(void 0)}let C=new ne,F=null,Q=async()=>{for(let s of["claude","claude-code"])try{if(await se`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=K();await j(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 q(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 N({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
|
|
5
|
-
`),c.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
6
|
-
`)}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 oe(a,s)).phase}catch{}let c=K();await j(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 q(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 N({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
|
|
7
|
-
`)}Object.assign(t,G(t,T)),t.focus="terminal",w=P(o,t.tabs)};g(y.enterAlternateScreen()),g(y.hideCursorSeq()),g(y.clearScreenSeq()),g(W.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 ie(async()=>{for await(let s of re(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 le(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 ue(a),g(W.disableMouse()),g(y.showCursorSeq()),g(y.exitAlternateScreen())}return _(void 0)};export{Be as main};
|
package/chunks/next-TIUOHHFS.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as fe}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as le,b as de,c as pe,d as G}from"./chunk-WZHVKEPB.js";import{a as Q}from"./chunk-NY4W44PI.js";import"./chunk-2HSGE3TL.js";import{a as ue,b as me,d as v}from"./chunk-2ZYCRMUT.js";import{a as z,b as K,d as Y}from"./chunk-2LF7QSIN.js";import{a as Ie}from"./chunk-XOMPQOI6.js";import{a as q}from"./chunk-IZUADMIU.js";import{a as xe,b as Ce,c as De,d as Re}from"./chunk-7NKYCWAA.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-DPZJWN2Y.js";import{a as te,c as F,e as se,f as ne,i as ie,j as re,k as oe,o as ae,q as U,v as H,z as ce}from"./chunk-TMMAF763.js";import{c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as J,b as D}from"./chunk-FFWPJP7A.js";import{i as h}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Fe=o=>o.split(`
|
|
3
|
-
`).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-QE4P4DS4.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(`
|
|
4
|
-
`),p=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,x=a.replace(p,`## Tasks
|
|
5
|
-
|
|
6
|
-
${u}
|
|
7
|
-
`);await h.fs.writeTextFile(n,x)}}return e}}catch{}return e}case"SPEC_APPROVED":{let t=ve(e);return t.spec!==null&&(await xe(o,t.spec,"executing"),await Re(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:i}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let s=await Le(o,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await Te(o,e,i,c)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:i,promoted:!1,timestamp:new Date().toISOString()},n=Z(e,s);return n=ge(n,"EXECUTING"),n={...n,execution:{...n.execution,lastProgress:`Resolved: ${i}`}},n}default:return e}},$e=async(o,e)=>{let r=Q(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let c=[];for(let t of r.proposals){let s=`${o}/${F.specDir(t.name)}`;await h.fs.mkdir(s,{recursive:!0});let n=e.discovery.answers.filter(u=>t.relevantAnswers.includes(u.questionId)),l=he(te(),t.name,`spec/${t.name}`);for(let u of n)l=k(l,u.questionId,u.answer);l=B(l),await ie(o,t.name,l),c.push(t.name)}return ye(e,"cancelled",`Split into: ${c.join(", ")}`)},Oe=o=>o.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),Te=async(o,e,r,c)=>{let i;try{i=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let t=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let S=e.execution.debt.items.map((w,g)=>({id:`legacy-${g+1}`,text:w,since:e.execution.debt.fromIteration}));t={...e,execution:{...e.execution,debt:{...e.execution.debt,items:S}}};let L=new TextEncoder,I=h.process.stderr.getWriter();await I.write(L.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
8
|
-
`)),I.releaseLock()}let s=new Set(["mandatory-tests","mandatory-docs"]),a=(i.na??[]).filter(f=>s.has(f));if(a.length>0)return{...t,execution:{...t.execution,lastProgress:`REJECTED: Tests and documentation ACs require explicit justification to mark as N/A. Explain why tests or docs are not needed for this spec. Rejected IDs: ${a.join(", ")}`,awaitingStatusReport:!0}};let l=i.completed??[],u=new Set(l),p=i.na??[],x=new Set(p),y=i.newIssues??[],P=i.remaining??[],M=i.blocked??[],V=t.execution.debt?.unaddressedIterations??0,A=t.execution.debt!==null?t.execution.debt.items.filter(f=>!u.has(f.id)&&!x.has(f.id)):[],R=t.execution.debtCounter??0,W=y.map((f,S)=>({id:`debt-${R+S+1}`,text:f,since:t.execution.iteration})),$=[...A,...W],d=P.length===0&&M.length===0&&y.length===0||$.length===0?null:{items:$,fromIteration:t.execution.debt?.fromIteration??t.execution.iteration,unaddressedIterations:A.length>0?V+1:1},b=[...new Set([...t.execution.naItems??[],...p])],C=[];l.length>0&&C.push(`Completed: ${l.join(", ")}`),p.length>0&&C.push(`N/A: ${p.join(", ")}`);let E=C.length>0?C.join("; "):"Status report submitted",_=t.execution.lastVerification===null||t.execution.lastVerification.passed===!0,O=d===null&&_,T=R+y.length;if(O&&t.spec!==null){let f=await q(o,t.spec);if(f!==null){let S=t.execution.completedTasks??[],L=new Set(S),I=[];try{let g=JSON.parse(t.execution.lastProgress??"");Array.isArray(g.completed)&&(I=g.completed.filter(N=>!L.has(N)&&f.tasks.some(Ee=>Ee.id===N)))}catch{}if(I.length===0){let g=f.tasks.find(N=>!L.has(N.id));g!==void 0&&(I=[g.id])}let w=[];for(let g of I)await Ce(o,t.spec,g),await De(o,t.spec,g,"done"),w.push(g);if(w.length>0){let g=w.length===1?`Task ${w[0]} accepted`:`Tasks ${w.join(", ")} accepted`;return{...t,execution:{...t.execution,lastProgress:`${g}: ${E}`,awaitingStatusReport:!1,debt:d,completedTasks:[...S,...w],debtCounter:T,naItems:b}}}}}return{...t,execution:{...t.execution,lastProgress:O?E:`Task not accepted \u2014 remaining items must be addressed first. ${E}`,awaitingStatusReport:!1,debt:d,debtCounter:T,naItems:b}}},Le=async(o,e)=>{try{let{execSync:r}=await import("node:child_process"),c=r(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(c).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let c=r,i=((c.stdout??"")+(c.stderr??"")).slice(0,4e3);return c.status!==void 0?{passed:!1,output:i||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${r instanceof Error?r.message:String(r)}`,timestamp:new Date().toISOString()}}},be=async(o,e)=>{let r=[...e.execution.modifiedFiles??[]],c=await Ne(o);return[...new Set([...r,...c])]},Ne=async o=>{let e=`${o}/${F.stateDir}/files-changed.jsonl`;try{let c=(await h.fs.readTextFile(e)).trim().split(`
|
|
9
|
-
`).filter(Boolean),i=[];for(let t of c)try{let s=JSON.parse(t);i.includes(s.file)||i.push(s.file)}catch{}return i}catch{return[]}};export{Ae as handleAnswer,Ze as main,Oe as parseRefinementTasks};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{o as y}from"./chunk-DPZJWN2Y.js";import{e as f,g as h,h as S,i as g}from"./chunk-TMMAF763.js";import"./chunk-2XNFZXHY.js";import{f as u,h as d,k as w}from"./chunk-SHN5MT56.js";import{d as l,f as n,g as m}from"./chunk-YVN2NZL4.js";import{a as p,b as t}from"./chunk-FFWPJP7A.js";import{i as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var A=async C=>{let e=u({renderer:w.ansi(),sink:d.stdout()}),a=c.process.cwd(),i=h(C);if(!i.ok)return e.writeln(n(i.error)),await e.close(),t({exitCode:1});let s;try{s=await f(a,i.spec)}catch(o){let k=o instanceof Error?o.message:String(o);return e.writeln(n(k)),await e.close(),t({exitCode:1})}if(s.phase!=="COMPLETED")return e.writeln(n(`Cannot reopen in phase: ${s.phase}`)),e.writeln(l("Only COMPLETED specs can be reopened.")),await e.close(),t({exitCode:1});let r=y(s);return await S(a,r),r.spec!==null&&await g(a,r.spec,r),e.writeln(m("\u2714")," Spec reopened. Discovery answers preserved \u2014 run `noskills next` to revise."),await e.close(),p(void 0)};export{A as main};
|
package/chunks/reset-BJZ263XC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{q as k}from"./chunk-DPZJWN2Y.js";import{c as h,e as g,g as y,h as S,i as I}from"./chunk-TMMAF763.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-SHN5MT56.js";import{d as i,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as p}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var x=async D=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),a=l.process.cwd(),o=y(D);if(!o.ok)return e.writeln(n(o.error)),await e.close(),p({exitCode:1});let s;try{s=await g(a,o.spec)}catch(r){let A=r instanceof Error?r.message:String(r);return e.writeln(n(A)),await e.close(),p({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(i("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${a}/${h.specDir(s.spec)}`;try{await l.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(i("Resetting to IDLE anyway."))}}let t=s.spec,m=k(s);return await S(a,m),t!==null&&await I(a,t,m),e.writeln(d("\u2714")," Reset to IDLE."),t!==null&&e.writeln(i(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{x as main};
|
package/chunks/run-Y4ESAQUK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as B}from"./chunk-WZHVKEPB.js";import"./chunk-NY4W44PI.js";import"./chunk-2HSGE3TL.js";import{c as W,d as X}from"./chunk-2LF7QSIN.js";import{a as _,k as j}from"./chunk-DPZJWN2Y.js";import{d as g,e as N,f as U,h as $,k as G,o as L,z as M}from"./chunk-TMMAF763.js";import{b as E,c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as D,b as A,g as F}from"./chunk-YACXTCWF.js";import{f as R,h as O,k as T}from"./chunk-SHN5MT56.js";import{c as v,d as o,f as l,g as P,h,k as I}from"./chunk-YVN2NZL4.js";import{a as S,b as w}from"./chunk-FFWPJP7A.js";import{i as y}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var ue=async t=>{let e=R({renderer:T.ansi(),sink:O.stdout()}),i=y.process.cwd(),n=t?.includes("--unattended")??!1,r=z(t,"--max-turns")??10,p=z(t,"--max-iterations")??50;if(!await M(i))return e.writeln(l(`noskills not initialized. Run: ${V("init")}`)),await e.close(),w({exitCode:1});let x=U(t),c=await N(i,x);if(c.phase!=="EXECUTING"&&c.phase!=="SPEC_APPROVED")return e.writeln(l(`Cannot run from phase: ${c.phase}`)),e.writeln(o("Must be in SPEC_APPROVED or EXECUTING to start.")),await e.close(),w({exitCode:1});if(c.phase==="SPEC_APPROVED"){e.writeln(o("Starting execution from approved spec..."));let s=j(c);await $(i,s)}let u=await G(i);if(u===null)return e.writeln(l("Config not found.")),await e.close(),w({exitCode:1});e.writeln(v(`${E()} run`)),e.writeln(o(`Mode: ${n?"unattended":"interactive"}, max-turns: ${r}, max-iterations: ${p}`)),e.writeln("");let m=0,d=0;for(;m<p;){m++;let s=await g(i);if(s.phase==="COMPLETED"){e.writeln(""),e.writeln(P("\u2714")," Spec completed!"),e.writeln(` Iterations: ${s.execution.iteration}`),e.writeln(` Decisions: ${s.decisions.length}`);break}if(s.phase==="BLOCKED"){let a=s.execution.lastProgress??"Unknown";if(e.writeln(""),e.writeln(h("\u26A0")," Execution blocked: ",o(a)),n){await Z(i,a,m),e.writeln(o("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let C=A(),f=await F(C,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){e.writeln(o("Stopped by user."));break}let k=_(s,"EXECUTING");await $(i,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(s.phase!=="EXECUTING"){e.writeln(l(`Unexpected phase: ${s.phase}. Stopping.`)),d=1;break}let H=(await L(i)).filter(a=>u.concerns.includes(a.id)),q=await W(i),K=X(u.tools),J=B(s,H,q,u,void 0,void 0,void 0,K),Q=Y(J);e.writeln(I(`\u2500\u2500 Iteration ${m}`),o(` (execution: ${s.execution.iteration}, debt: ${s.execution.debt?.items.length??0})`)),s.execution.lastProgress!==null&&e.writeln(o(` Last: ${s.execution.lastProgress}`)),s.execution.lastVerification?.passed===!1&&e.writeln(l(" Verification failed \u2014 agent will fix")),s.execution.debt!==null&&e.writeln(h(` Debt: ${s.execution.debt.items.length} items`)),e.writeln(o(" Spawning agent..."));try{await(await import("./mod-7ICCX4OY.js")).exec`claude -p ${Q} --max-turns ${String(r)} --output-format json`.noThrow().text()}catch{e.writeln(l(" Failed to spawn claude CLI. Is it installed?")),d=1;break}e.writeln(o(" Agent exited. Stop hook captured state."));let b=await g(i);if(u.autoCommit===!0&&u.allowGit!==!1)try{let a=await import("./mod-7ICCX4OY.js");if((await a.exec`git diff --name-only`.noThrow().text()).trim().length>0){await a.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await a.exec`git commit -m ${f}`.noThrow().text(),e.writeln(o(" Auto-committed."))}}catch{e.writeln(o(" Auto-commit failed (non-fatal)."))}}return m>=p&&(e.writeln(""),e.writeln(h("\u26A0"),` Max iterations (${p}) reached. Stopping.`),d=2),await e.close(),d!==0?w({exitCode:d}):S(void 0)},Y=t=>{let e=[];if(e.push(t.meta.resumeHint),e.push(""),t.meta.spec!==null&&(e.push(`Working on spec: ${t.meta.spec}`),e.push("")),"instruction"in t&&(e.push(t.instruction),e.push("")),"previousIterationDebt"in t){let n=t.previousIterationDebt;if(n!==void 0){e.push(`DEBT from iteration ${n.fromIteration} (address first):`);for(let r of n.items)e.push(`- ${r}`);e.push("")}}if("statusReportRequired"in t){let n=t.statusReport;if(n!==void 0){e.push("Report against these acceptance criteria:");for(let r of n.criteria)e.push(`- ${r}`);e.push("")}}if("verificationFailed"in t&&t.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in t?t.verificationOutput:"")??""),e.push("")),t.behavioral.rules.length>0){e.push("Rules:");for(let n of t.behavioral.rules)e.push(`- ${n}`);e.push("")}if("context"in t){let n=t.context;if(n.concernReminders.length>0){e.push("Reminders:");for(let r of n.concernReminders)e.push(`- ${r}`);e.push("")}}let i=E();return e.push(`When done, report progress: ${i} next --answer="your progress"`),e.push(`If blocked, run: ${i} block "reason"`),e.push(`When all tasks are complete: ${i} done`),e.join(`
|
|
3
|
-
`)},z=(t,e)=>{if(t===void 0)return null;let i=`${e}=`;for(let n of t)if(n.startsWith(i)){let r=parseInt(n.slice(i.length),10);if(!isNaN(r)&&r>0)return r}return null},Z=async(t,e,i)=>{let n=`${t}/.eser/.state/blocked.log`,r=`[${new Date().toISOString()}] iteration=${i} reason=${e}
|
|
4
|
-
`;try{let{appendFileSync:p,mkdirSync:x}=await import("node:fs"),{dirname:c}=await import("node:path");x(c(n),{recursive:!0}),p(n,r)}catch{}};export{ue as main};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as b,j as y,r as A,t as C,u as N,w as $,x,y as O,z as R}from"./chunk-TMMAF763.js";import{b as I,c as E}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as S}from"./chunk-SHN5MT56.js";import{c as l,d as n,f as c,g as v}from"./chunk-YVN2NZL4.js";import{a as u,b as h}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var F=async t=>{let s=t?.[0];if(s==="start")return await P(t?.slice(1));if(s==="end")return await D(t?.slice(1));if(s==="list")return await M();if(s==="gc")return await K();let i=I(),e=f({renderer:S.ansi(),sink:w.stdout()});return e.writeln(`Usage: ${i} session <start | end | list | gc>`),e.writeln(""),e.writeln(n(" start --spec=<name> Bind to a spec")),e.writeln(n(" start --free Free mode (no enforcement)")),e.writeln(n(" start --auto Auto-detect spec or free")),e.writeln(n(" end [--id=<id>] End current/specific session")),e.writeln(n(" list Show active sessions")),e.writeln(n(" gc Remove stale sessions")),await e.close(),u(void 0)},P=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd();if(!await R(i))return s.writeln(c("noskills is not initialized.")," Run: ",l(E("init"))),await s.close(),h({exitCode:1});let e=null,o=!1,d=!1;for(let r of t??[])r.startsWith("--spec=")?e=r.slice(7):r==="--free"?o=!0:r==="--auto"&&(d=!0);if(d){let p=(await y(i)).filter(L=>L.state.phase!=="COMPLETED"&&L.state.phase!=="IDLE");p.length===1?e=p[0].name:o=!0}if(e===null&&!o)return s.writeln(c("Specify --spec=<name>, --free, or --auto.")),s.writeln(n(`Example: ${I()} session start --spec=my-feature`)),await s.close(),h({exitCode:1});let a=null;if(e!==null)try{a=(await b(i,e)).phase}catch(r){let p=r instanceof Error?r.message:String(r);return s.writeln(c(`Error: ${p}`)),await s.close(),h({exitCode:1})}let g=O(),k={id:g,spec:e,mode:o?"free":"spec",phase:o?null:a,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"};return await A(i,k),s.writeln(v("Session started.")),s.writeln(" ID: ",l(g)),s.writeln(" Mode: ",l(o?"free":"spec")),e!==null&&(s.writeln(" Spec: ",l(e)),a!==null&&s.writeln(" Phase: ",n(a))),s.writeln(""),s.writeln("Run: ",l(`export NOSKILLS_SESSION=${g}`)),await s.close(),u(void 0)},D=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd(),e=null;for(let d of t??[])d.startsWith("--id=")&&(e=d.slice(5));return e===null&&(e=m.env.get("NOSKILLS_SESSION")??null),e===null?(s.writeln(c("No session specified. Use --id=<id> or set NOSKILLS_SESSION env var.")),await s.close(),h({exitCode:1})):(await N(i,e)?s.writeln(v("Session ended: "),n(e)):s.writeln(c(`Session not found: ${e}`)),await s.close(),u(void 0))},M=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await C(s);if(t.writeln(l("Sessions")),t.writeln(""),i.length===0)t.writeln(n(` No active sessions. Start one with: ${E("session start --spec=<name>")}`));else for(let e of i){let o=x(e),d=Date.now()-new Date(e.lastActiveAt).getTime(),a=Math.floor(d/6e4),g=a<60?`${a}min ago`:`${Math.floor(a/60)}h ago`,k=e.mode==="free"?"free":`spec:${e.spec??"?"}`,r=e.phase??"\u2014",p=o?c(" (stale)"):"";t.writeln(" ",l(e.id)," ",n(k.padEnd(25))," ",n(r.padEnd(18))," ",n(g),p)}return await t.close(),u(void 0)},K=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await $(s);if(i.length===0)t.writeln(n("No stale sessions to remove."));else{t.writeln(v(`Removed ${i.length} stale session(s):`));for(let e of i)t.writeln(" ",n(e))}return await t.close(),u(void 0)};export{F as main};
|
package/chunks/spec-CYRR2XUA.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Y}from"./chunk-NY4W44PI.js";import{a as _,d as U}from"./chunk-2ZYCRMUT.js";import{b as A,e as M,f as N,n as F,p as L}from"./chunk-DPZJWN2Y.js";import{a as b,c as g,e as O,f as V,i as v,j as W,z as P}from"./chunk-TMMAF763.js";import{b as E,c as R}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as y,h as C,k as $}from"./chunk-SHN5MT56.js";import{c as u,d as a,f as c,g as D,h as z,k as q}from"./chunk-YVN2NZL4.js";import{a as S,b as d}from"./chunk-FFWPJP7A.js";import{i as h}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var j=new Set(["new","list","help","next","approve","done","block","reset","cancel","wontfix","reopen","revisit","split"]),X=new Map([["next",()=>import("./next-TIUOHHFS.js")],["approve",()=>import("./approve-UWBYGXCF.js")],["done",()=>import("./done-A5VWIFOF.js")],["block",()=>import("./block-W76WKMS3.js")],["reset",()=>import("./reset-BJZ263XC.js")],["cancel",()=>import("./cancel-46C7E5N7.js")],["wontfix",()=>import("./wontfix-YSXRDPKA.js")],["reopen",()=>import("./reopen-G4IUIH73.js")]]);var pe=async r=>{let e=r?.[0];if(e==="new")return await B(r?.slice(1));if(e==="list")return await G(r?.slice(1));if(e==="help"||e===void 0){let p=E(),l=y({renderer:$.ansi(),sink:C.stdout()});return l.writeln(`Usage: ${p} spec <new <name> "desc" | list | <name> <command>>`),l.writeln(""),l.writeln(a(" Commands for a spec:")),l.writeln(a(" next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split")),l.writeln(""),l.writeln(a(" Examples:")),l.writeln(a(` ${p} spec new my-feature "Add upload support"`)),l.writeln(a(` ${p} spec my-feature next`)),l.writeln(a(` ${p} spec my-feature next --answer="approve"`)),await l.close(),S(void 0)}let n=e,s=r?.[1];if(s===void 0)return await(await import("./status-ZE2SA6FP.js")).main([`--spec=${n}`]);if(s==="split")return await H([`--spec=${n}`,...r?.slice(2)??[]]);if(s==="revisit")return await J([`--spec=${n}`,...r?.slice(2)??[]]);let i=X.get(s);if(i!==void 0)return await(await i()).main([`--spec=${n}`,...r?.slice(2)??[]]);let o=y({renderer:$.ansi(),sink:C.stdout()});return o.writeln(c(`Unknown command: spec ${n} ${s}`)),o.writeln(a(" Valid: next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split")),await o.close(),d({exitCode:1})},B=async r=>{let e=y({renderer:$.ansi(),sink:C.stdout()}),n=h.process.cwd();if(!await P(n))return e.writeln(c("noskills is not initialized.")," Run: ",u(R("init"))),await e.close(),d({exitCode:1});let s=null,i=[];if(r!==void 0){let m=!1;for(let f of r)f.startsWith("--name=")?(s=f.slice(7),m=!0):f.startsWith("-")||(!m&&s===null?(s=f,m=!0):i.push(f))}let o=i.join(" ");if(s===null||s.length===0)return e.writeln(c("Error: spec name is required.")),e.writeln(a("Example: "),u(`${E()} spec new photo-upload "photo upload feature"`)),await e.close(),d({exitCode:1});if(j.has(s))return e.writeln(c(`"${s}" is a reserved name.`),a(" Choose a different spec name.")),await e.close(),d({exitCode:1});let p=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/;if(s.length>50||s.length>1&&!p.test(s)||s.length===1&&!/^[a-z0-9]$/.test(s))return e.writeln(c("Invalid spec name: "),u(s)),e.writeln(a("Must be lowercase, hyphens, numbers only. Max 50 chars. Regex: /^[a-z0-9][a-z0-9-]*[a-z0-9]$/")),await e.close(),d({exitCode:1});if(o.length===0)return e.writeln(c("Please provide a description: "),u(`${E()} spec new --name=${s} "photo upload feature"`)),await e.close(),d({exitCode:1});let l=`spec/${s}`,t=`${n}/${g.specDir(s)}`;try{return await h.fs.stat(t),e.writeln(c(`Spec "${s}" already exists.`),a(` Use a different --name or run \`${E()} reset --spec=${s}\` first.`)),await e.close(),d({exitCode:1})}catch{}let w=b(),x=A(w,s,l,o);return await h.fs.mkdir(`${n}/${g.specDir(s)}`,{recursive:!0}),await v(n,s,x),e.writeln(D("\u2714")," Spec started: ",u(s)),e.writeln(" Directory: ",a(g.specDir(s))),e.writeln(" Branch: ",a(l)),e.writeln(" Phase: ",z("DISCOVERY")),e.writeln(""),e.writeln("Run ",u(R(`next --spec=${s}`))," to begin discovery questions."),await e.close(),S(void 0)},G=async r=>{let e=h.process.cwd(),n=_(r),s=await W(e),i=`${e}/${g.specsDir}`,o=new Set(s.map(t=>t.name)),p=[];for(let t of s)p.push({name:t.name,phase:t.state.phase,iteration:t.state.execution.iteration});try{for await(let t of h.fs.readDir(i))t.isDirectory&&!o.has(t.name)&&p.push({name:t.name,phase:"IDLE",iteration:0})}catch{}if(n==="json")return await U(p,"json"),S(void 0);let l=y({renderer:$.ansi(),sink:C.stdout()});if(l.writeln(u("Specs")),l.writeln(""),p.length===0)l.writeln(a(" No specs yet."));else for(let t of p){let w=t.phase==="COMPLETED"?D(t.phase):t.phase==="EXECUTING"?q(t.phase):t.phase==="BLOCKED"?c(t.phase):z(t.phase),x=t.phase==="EXECUTING"?a(` iteration ${t.iteration}`):"";l.writeln(" ",a("\u25CB")," ",t.name," ",w,x)}return await l.close(),S(void 0)},K=r=>{let e=[],n=0;for(;n<r.length;)if(r[n]==="--into"&&n+1<r.length){let s=r[n+1],i=s;n+2<r.length&&!r[n+2].startsWith("-")?(i=r[n+2],n+=3):n+=2,e.push({name:s,description:i})}else n+=1;return e},H=async r=>{let e=y({renderer:$.ansi(),sink:C.stdout()}),n=h.process.cwd();if(!await P(n))return e.writeln(c("noskills is not initialized.")," Run: ",u(R("init"))),await e.close(),d({exitCode:1});let s=V(r??[]);if(s===null)return e.writeln(c("Error: --spec=<name> is required.")),e.writeln(a("Example: "),u(`${E()} spec split --spec=parent --into name1 "desc1" --into name2 "desc2"`)),await e.close(),d({exitCode:1});let i;try{i=await O(n,s)}catch(t){let w=t instanceof Error?t.message:String(t);return e.writeln(c(`Error: ${w}`)),await e.close(),d({exitCode:1})}if(i.phase!=="DISCOVERY"&&i.phase!=="DISCOVERY_REVIEW")return e.writeln(c(`Cannot split spec in phase ${i.phase}. Must be in DISCOVERY or DISCOVERY_REVIEW.`)),await e.close(),d({exitCode:1});let o=K(r??[]);if(o.length<2){let t=Y(i.discovery.answers);if(!t.detected||t.proposals.length<2)return e.writeln(c("Error: at least 2 --into entries required, or discovery answers must contain 2+ independent areas.")),await e.close(),d({exitCode:1});let w=[];for(let m of t.proposals){let f=`${n}/${g.specDir(m.name)}`;await h.fs.mkdir(f,{recursive:!0});let T=i.discovery.answers.filter(I=>m.relevantAnswers.includes(I.questionId)),k=A(b(),m.name,`spec/${m.name}`);for(let I of T)k=M(k,I.questionId,I.answer);k=N(k),await v(n,m.name,k),w.push(m.name)}let x=F(i,"cancelled",`Split into: ${w.join(", ")}`);await v(n,s,x),e.writeln(D("Split complete."),` Created ${w.length} sub-specs:`);for(let m of w)e.writeln(" ",a("\u25CB")," ",u(m));return e.writeln("",a(`Parent spec "${s}" cancelled.`)),await e.close(),S(void 0)}let p=[];for(let t of o){let w=`${n}/${g.specDir(t.name)}`;await h.fs.mkdir(w,{recursive:!0});let m=A(b(),t.name,`spec/${t.name}`);for(let f of i.discovery.answers)m=M(m,f.questionId,f.answer);m=N(m),await v(n,t.name,m),p.push(t.name)}let l=F(i,"cancelled",`Split into: ${p.join(", ")}`);await v(n,s,l),e.writeln(D("Split complete."),` Created ${p.length} sub-specs:`);for(let t of p)e.writeln(" ",a("\u25CB")," ",u(t));return e.writeln("",a(`Parent spec "${s}" cancelled.`)),await e.close(),S(void 0)},J=async r=>{let e=y({renderer:$.ansi(),sink:C.stdout()}),n=h.process.cwd();if(!await P(n))return e.writeln(c("noskills is not initialized.")," Run: ",u(R("init"))),await e.close(),d({exitCode:1});let s=V(r??[]);if(s===null)return e.writeln(c("Error: --spec=<name> is required.")),e.writeln(a("Example: "),u(`${E()} spec revisit --spec=my-spec "reason for revisit"`)),await e.close(),d({exitCode:1});let i=(r??[]).find(t=>!t.startsWith("--")&&t!==s);if(i===void 0||i.trim().length===0)return e.writeln(c('Error: Reason is required: noskills spec revisit --spec=X "reason"')),await e.close(),d({exitCode:1});let o;try{o=await O(n,s)}catch(t){let w=t instanceof Error?t.message:String(t);return e.writeln(c(`Error: ${w}`)),await e.close(),d({exitCode:1})}if(o.phase==="DISCOVERY"||o.phase==="DISCOVERY_REVIEW"||o.phase==="SPEC_DRAFT"||o.phase==="SPEC_APPROVED")return e.writeln(c("Already in planning phase, no need to revisit.")),await e.close(),d({exitCode:1});if(o.phase==="COMPLETED")return e.writeln(c(`Spec is completed. Use \`${E()} reopen --spec=${s}\` instead.`)),await e.close(),d({exitCode:1});if(o.phase==="IDLE"||o.phase==="FREE")return e.writeln(c("No active spec to revisit.")),await e.close(),d({exitCode:1});let p=o.execution.completedTasks.length,l=L(o,i.trim());return await v(n,s,l),e.writeln(D("Revisit complete.")),e.writeln(" Phase: ",u("DISCOVERY"),a(` (revisited from ${o.phase})`)),p>0&&e.writeln(" Previous progress: ",u(`${p} tasks completed`)),e.writeln(" Reason: ",a(`"${i.trim()}"`)),e.writeln(" Discovery answers preserved \u2014 revise or re-approve."),await e.close(),S(void 0)};export{j as RESERVED_NAMES,pe as main};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as f,d as P}from"./chunk-WZHVKEPB.js";import"./chunk-NY4W44PI.js";import"./chunk-2HSGE3TL.js";import{a as k,d as w}from"./chunk-2ZYCRMUT.js";import{c as R,d as S}from"./chunk-2LF7QSIN.js";import{e as b,f as x,k as D,o as v,z as O}from"./chunk-TMMAF763.js";import{c as h}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as m}from"./chunk-SHN5MT56.js";import{c as i,d as r,f as c,g as y,h as p,k as I}from"./chunk-YVN2NZL4.js";import{a as l,b as E}from"./chunk-FFWPJP7A.js";import{i as C}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var W=async g=>{let t=C.process.cwd(),o=k(g);if(!await O(t)){if(o==="json")await w({error:"noskills is not initialized"},o);else{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(c("noskills is not initialized.")," Run: ",i(h("init"))),await s.close()}return E({exitCode:1})}let V=x(g),e=await b(t,V),n=await D(t),T={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:n?.concerns??[],tools:n?.tools??[],decisions:e.decisions.length};if(o==="json"){let a=(await v(t)).filter(N=>n!==null&&n.concerns.includes(N.id)),$=await R(t),j=S(n?.tools??[]),F=P(e,a,$,n,void 0,void 0,void 0,j);return await w({...T,...F},"json"),l(void 0)}{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(i(`${h("status")}`)),s.writeln("");let a=e.phase==="COMPLETED"?y(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?I(e.phase):p(e.phase);s.writeln(" Phase: ",a),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),(e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW")&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(p(` Debt: ${e.execution.debt.items.length} items`))),n!==null&&(s.writeln(""),n.concerns.length>0&&s.writeln(" Concerns: ",r(n.concerns.join(", "))),n.tools.length>0&&s.writeln(" Tools: ",r(n.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),await s.close()}return l(void 0)};export{W as main};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-JFKHBLJB.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-2YTW3JQ6.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-MW3RJU6I.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-RHVDIXOM.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-7KFSTOXR.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-4LQG2WOJ.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-ULIMXXRY.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-JO4JKJ7R.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-UGYRUVUH.js";import"./chunk-ATYDQCCJ.js";import"./chunk-KHBIOZJE.js";import"./chunk-O325ZU5M.js";import"./chunk-YACXTCWF.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-GVTM4EOU.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as main,b as run,a as tool,c as validator};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as y,d as A}from"./chunk-7NKYCWAA.js";import{n as E}from"./chunk-DPZJWN2Y.js";import{c as x,e as S,g,h as k,i as C}from"./chunk-TMMAF763.js";import"./chunk-2XNFZXHY.js";import{f as d,h as w,k as h}from"./chunk-SHN5MT56.js";import{d as u,f as n,g as f}from"./chunk-YVN2NZL4.js";import{a as m,b as i}from"./chunk-FFWPJP7A.js";import{i as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async l=>{let e=d({renderer:h.ansi(),sink:w.stdout()}),a=c.process.cwd(),o=g(l);if(!o.ok)return e.writeln(n(o.error)),await e.close(),i({exitCode:1});let p=(l??[]).filter(r=>!r.startsWith("--spec=")).join(" ");if(p.length===0)return e.writeln(n('A reason is required: noskills wontfix "reason text"')),await e.close(),i({exitCode:1});let s;try{s=await S(a,o.spec)}catch(r){let D=r instanceof Error?r.message:String(r);return e.writeln(n(D)),await e.close(),i({exitCode:1})}if(s.phase==="IDLE"||s.phase==="FREE"||s.phase==="UNINITIALIZED"||s.phase==="COMPLETED")return e.writeln(n(`Cannot mark as won't fix in phase: ${s.phase}`)),await e.close(),i({exitCode:1});if(s.spec!==null){let r=`${a}/${x.specDir(s.spec)}`;try{await c.fs.stat(r)}catch{return e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(u("Run `noskills reset` to return to IDLE.")),await e.close(),i({exitCode:1})}}let t=E(s,"wontfix",p);return await k(a,t),t.spec!==null&&await C(a,t.spec,t),t.spec!==null&&(await y(a,t.spec,"wontfix"),await A(a,t.spec,"wontfix")),e.writeln(f("\u2714"),` Spec marked as won't fix: ${p}`),await e.close(),m(void 0)};export{q as main};
|