eser 4.1.49 → 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-HF44PKLL.js → approve-PXC7FMDI.js} +1 -1
- package/chunks/{ask-M3VS3GIJ.js → ask-6DWHUCLO.js} +1 -1
- package/chunks/{block-F7S7PYMQ.js → block-CSVO3R47.js} +1 -1
- package/chunks/{build-Y4OQZN3X.js → build-S4DSRSSR.js} +1 -1
- package/chunks/cancel-AJOYWYV5.js +2 -0
- package/chunks/{changelog-gen-LMXK5T7J.js → changelog-gen-TE6FXELA.js} +1 -1
- package/chunks/{chunk-43E7ZXUB.js → chunk-2PWSTO7A.js} +1 -1
- package/chunks/{chunk-D43XK3L2.js → chunk-3CE7GA2P.js} +1 -1
- package/chunks/{chunk-FNPBHLLZ.js → chunk-3KGG2I2A.js} +1 -1
- package/chunks/{chunk-3MMV2UHT.js → chunk-4QMRLILJ.js} +1 -1
- package/chunks/{chunk-3VZXRI4F.js → chunk-4XXI5LYN.js} +1 -1
- package/chunks/{chunk-YVKPHSJX.js → chunk-66VSO643.js} +1 -1
- package/chunks/chunk-67AFLWXV.js +4 -0
- package/chunks/{chunk-U25GY4AZ.js → chunk-72R6CKNY.js} +1 -1
- package/chunks/{chunk-RSYERFWM.js → chunk-AUDMKDAA.js} +1 -1
- package/chunks/{chunk-K7TY7247.js → chunk-BESTYZQY.js} +1 -1
- package/chunks/{chunk-LYM57LLM.js → chunk-BJ45FF6F.js} +1 -1
- package/chunks/{chunk-XFCBVUI7.js → chunk-BNZPRQUS.js} +1 -1
- package/chunks/{chunk-KHBIOZJE.js → chunk-BVIGTD2Z.js} +1 -1
- package/chunks/{chunk-SNWQNMGD.js → chunk-CE6UVD6F.js} +1 -1
- package/chunks/{chunk-PHOYLFXC.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-Q66KA572.js → chunk-HV3EYAGF.js} +1 -1
- package/chunks/{chunk-XVH5L5HY.js → chunk-IY3YRKJJ.js} +1 -1
- package/chunks/{chunk-XBCL25QR.js → chunk-KFSZ6MDH.js} +1 -1
- package/chunks/{chunk-RBU3HF66.js → chunk-KNIM3QST.js} +1 -1
- package/chunks/chunk-LS5MCZUM.js +2 -0
- package/chunks/{chunk-HVQK35SO.js → chunk-MGNBNMJZ.js} +1 -1
- package/chunks/chunk-MX5DKVDI.js +2 -0
- package/chunks/{chunk-TDIR6AUJ.js → chunk-N6PXARPJ.js} +1 -1
- package/chunks/{chunk-L7ROACZC.js → chunk-NWWXAZFA.js} +1 -1
- package/chunks/{chunk-Q56M5KDF.js → chunk-OSNPAAYT.js} +1 -1
- package/chunks/{chunk-6BILFSH2.js → chunk-PBZV2KA3.js} +1 -1
- package/chunks/{chunk-FQY3JLY2.js → chunk-PG7KG7NX.js} +1 -1
- package/chunks/{chunk-FFEFO7MA.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-3TS5IRPD.js → chunk-QRNSYEPI.js} +1 -1
- package/chunks/{chunk-N4NDBIQS.js → chunk-QXSFQQGJ.js} +1 -1
- package/chunks/{chunk-DYMKE4R3.js → chunk-TBRDRQQK.js} +1 -1
- package/chunks/{chunk-JMGANJGV.js → chunk-TTLUVJIR.js} +1 -1
- package/chunks/chunk-UTWYRNI6.js +17 -0
- package/chunks/{chunk-3PZVRB75.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-2DAFGT4S.js → chunk-WJI2X6IA.js} +1 -1
- package/chunks/{chunk-C6URCXQM.js → chunk-YCI2VITZ.js} +1 -1
- package/chunks/chunk-YXETE4S3.js +4 -0
- package/chunks/{chunk-U34MRDPH.js → chunk-Z2RL2SFY.js} +1 -1
- package/chunks/{chunk-AWMLF355.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-7ZK3KY54.js → concern-DXCLVP5Y.js} +1 -1
- package/chunks/{dev-XHMBUBQE.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-AWX6I7FO.js → gh-YLYXDL2X.js} +1 -1
- package/chunks/{gh-contributors-EDZTKR5E.js → gh-contributors-YFATSPSW.js} +1 -1
- package/chunks/{init-GBMYF3YG.js → init-BZ6B74SY.js} +1 -1
- package/chunks/{init-3HE3P3N3.js → init-X6KNS3NC.js} +1 -1
- package/chunks/{invoke-hook-EIOZ5WSA.js → invoke-hook-KLJOYZF5.js} +2 -2
- 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-NCAKIBQC.js → main-JZTE4B4L.js} +1 -1
- package/chunks/{manager-GC34GK44.js → manager-FMP6PKIR.js} +5 -5
- 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-52TIS344.js → mod-MC2WNSB2.js} +1 -1
- package/chunks/{mod-DFDEWFDA.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-B5VXZEW7.js → pack-YQVWUWCL.js} +1 -1
- package/chunks/{purge-Q3FI3S5M.js → purge-ZQ23VDGR.js} +1 -1
- package/chunks/{release-4VI2Y2ZT.js → release-XACZAR6J.js} +2 -2
- package/chunks/{release-notes-2ZYPZ6TK.js → release-notes-W6MNV6OT.js} +1 -1
- package/chunks/{release-tag-SG4WPYDZ.js → release-tag-HSZX6WYU.js} +1 -1
- package/chunks/{reopen-6FB7DVV2.js → reopen-Z3MPVAGR.js} +1 -1
- package/chunks/reset-NWO3MNAG.js +2 -0
- package/chunks/{rule-EJKPIOLE.js → rule-CH5GMFKE.js} +1 -1
- package/chunks/{run-BV6BHCCQ.js → run-5YOXFMP2.js} +1 -1
- 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-5MTJLRIN.js → serve-3PZ7RBQY.js} +1 -1
- package/chunks/session-22XFZLH2.js +2 -0
- package/chunks/spec-PWS2UYVL.js +2 -0
- package/chunks/{status-6XVLXNA5.js → status-G5D6BYFF.js} +1 -1
- package/chunks/{sync-EEH6563X.js → sync-URY32B7Y.js} +1 -1
- package/chunks/{system-JBGO2IFD.js → system-CP5L6XUP.js} +1 -1
- package/chunks/{system-QDBQLRO6.js → system-N5A3SM5G.js} +1 -1
- package/chunks/{validate-bom-XTZYCKGP.js → validate-bom-EH5Z5TVU.js} +1 -1
- package/chunks/{validate-case-conflict-CQIPKKHY.js → validate-case-conflict-XN4KQDSK.js} +1 -1
- package/chunks/{validate-circular-deps-Y6X6GZCG.js → validate-circular-deps-YZ4DIXIM.js} +1 -1
- package/chunks/{validate-docs-ZOHUOW3I.js → validate-docs-BE32R2UM.js} +1 -1
- package/chunks/{validate-filenames-6E634ZHO.js → validate-eof-JPKT2D3D.js} +1 -1
- package/chunks/{validate-export-names-7V3647EU.js → validate-export-names-D3QNF6VB.js} +1 -1
- package/chunks/{validate-eof-4I2QAFTC.js → validate-filenames-DMZ46CRH.js} +1 -1
- package/chunks/{validate-json-LRWPQ4JX.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-Y6W74PAB.js → validate-mod-exports-J6KLADGR.js} +1 -1
- package/chunks/{validate-package-configs-VVCKJELU.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-FNXGITZJ.js → validate-toml-OMUYIHX2.js} +1 -1
- package/chunks/validate-trailing-whitespace-BIG3YYFY.js +2 -0
- package/chunks/{validate-yaml-YRAD4HU3.js → validate-yaml-VTE42YLF.js} +1 -1
- package/chunks/{versions-LJSQVW77.js → versions-GXSXTSSG.js} +1 -1
- package/chunks/{watch-N3KV2ONB.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/cancel-Q6LMMZBV.js +0 -2
- package/chunks/chunk-2TANTKYS.js +0 -4
- package/chunks/chunk-C2IORZTF.js +0 -4
- package/chunks/chunk-EQUPVWVY.js +0 -2
- package/chunks/chunk-FXDWRGGR.js +0 -2
- package/chunks/chunk-GVTM4EOU.js +0 -4
- package/chunks/chunk-LJ7A5HYR.js +0 -2
- package/chunks/chunk-RBQ2FOSL.js +0 -17
- package/chunks/commitmsg-57EMHAFY.js +0 -11
- package/chunks/done-FQQYM27R.js +0 -2
- package/chunks/free-XOGOSVEQ.js +0 -2
- package/chunks/next-2LOPGEJO.js +0 -9
- package/chunks/reset-T4YMGQPV.js +0 -2
- package/chunks/session-3HOLYHOY.js +0 -2
- package/chunks/spec-3P3HJT27.js +0 -2
- package/chunks/validate-large-files-RV7O7ZUR.js +0 -2
- package/chunks/validate-licenses-KHDUSBXM.js +0 -2
- package/chunks/validate-line-endings-XOCAE22U.js +0 -2
- package/chunks/validate-merge-conflict-PDJRAIKU.js +0 -2
- package/chunks/validate-secrets-UI5XKJ6B.js +0 -2
- package/chunks/validate-shebangs-GE23Z6NU.js +0 -2
- package/chunks/validate-submodules-R5JKX3Z6.js +0 -2
- package/chunks/validate-symlinks-WBF6VHHT.js +0 -2
- package/chunks/validate-trailing-whitespace-UCMQTQ3B.js +0 -2
- package/chunks/wontfix-MJJ2LK6J.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as P}from"./chunk-
|
|
3
|
-
`)),D.releaseLock()}else try{r=await x(n)}catch{return l(void 0)}}if(s==="Bash"){let c=(e.command??"").trim(),u=o?.allowGit??!1,d=
|
|
2
|
+
import{d as P}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{c as _,d as A}from"./chunk-NWWXAZFA.js";import{c as p,d as x,e as T,k as R,o as C,s as I,t as $,z as N}from"./chunk-KNIM3QST.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 B=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"]),U=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"])]]),V=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),M=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),Y=t=>{let s=0;for(;s<t.length;){let e=t[s];if(V.has(e)){s+=2;continue}if(M.has(e)){s+=1;continue}if(e.startsWith("--git-dir=")||e.startsWith("--work-tree=")||e.startsWith("--namespace=")||e.startsWith("--super-prefix=")||e.startsWith("--config-env=")){s+=1;continue}if(e.startsWith("-C")&&e.length>2){s+=1;continue}if(e.startsWith("-c")&&e.length>2&&e.includes("=")){s+=1;continue}return e}return null},S=t=>{let s=t.trim();if(!s.startsWith("git"))return!0;let e=s.slice(3).trim();if(e.length===0)return!0;let n=e.split(/\s+/),o=Y(n)??"";if(B.has(o))return!0;let i=U.get(o);if(i!==void 0){let r=n.indexOf(o),g=r>=0&&r+1<n.length?n[r+1]:"";if(i.has(g))return!0}return!1};var G=t=>{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 o of s){let i;for(;(i=o.exec(t))!==null;){let r=i[1]??"";if(r.includes("git")&&!S(r))return!0}}let e=t.split(/\s*\|\s*/);for(let o of e){let i=o.trim();if(i.startsWith("git")&&!S(i))return!0}let n=t.matchAll(/(?:^|[\s($`(])git\b/g);for(let o of n){let r=o[0].indexOf("git"),g=(o.index??0)+r,f=(t.slice(g).split(/[;&|$)`'"]/)[0]??"").trim();if(f.startsWith("git")&&!S(f))return!0}return!1};var E=async()=>{let t=a.process.stdin.getReader(),s=[];try{for(;;){let{done:i,value:r}=await t.read();if(i||r===void 0)break;s.push(r)}}finally{t.releaseLock()}let e=0,n=new Uint8Array(s.reduce((i,r)=>i+r.length,0));for(let i of s)n.set(i,e),e+=i.length;let o=new TextDecoder().decode(n);try{return JSON.parse(o)}catch{return{}}},W=async t=>{let s=new TextEncoder,e=a.process.stdout.getWriter();await e.write(s.encode(JSON.stringify(t))),e.releaseLock()},ne=async t=>{switch(t?.[0]){case"pre-tool-use":return await K();case"stop":return await j();case"post-file-write":return await X();case"post-bash":return await H();case"session-start":return await z();default:return l(void 0)}},O=async t=>{await W({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${t}`}})},F=(t,s)=>{if(s||!t.includes("git"))return null;let e=t.split(/\s*(?:&&|;)\s*/);for(let n of e){let o=n.trim();if(o.startsWith("git")&&!S(o))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(t)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},K=async()=>{let t=await E(),s=t.tool_name??"unknown",e=t.tool_input??{},n=t.cwd??a.process.cwd(),o=await R(n),i=a.env.get("NOSKILLS_SESSION")??null;if(i!==null){let c=await I(n,i);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(e.command??"").trim(),d=o?.allowGit??!1;if(!d&&u.includes("git")){let h=F(u,d);if(h!==null)return await O(h),l(void 0)}}return l(void 0)}}let r={};if(i!==null){let c=await I(n,i);if(c!==null&&c.mode==="spec"&&c.phase!==null)r={phase:c.phase};else if(c!==null&&c.spec!==null)try{r=await T(n,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await $(n);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let L of c){let v=L.phase??"IDLE",b=u[v]??0;b>h&&(h=b,d=v)}r={phase:d};let y=new TextEncoder,D=a.process.stderr.getWriter();await D.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
|
+
`)),D.releaseLock()}else try{r=await x(n)}catch{return l(void 0)}}if(s==="Bash"){let c=(e.command??"").trim(),u=o?.allowGit??!1,d=F(c,u);return d!==null?(await O(d),l(void 0)):l(void 0)}let g=["Write","Edit","MultiEdit"];if(!g.includes(s))return l(void 0);let w=e.file_path??e.path??"";if(w.includes(".eser/")||w.includes(".claude/"))return l(void 0);let f=r.phase??"UNKNOWN";if(f==="EXECUTING"||f==="IDLE"||f==="COMPLETED"||f==="UNKNOWN"){if(f==="EXECUTING"&&g.includes(s)){let c=`${n}/${p.stateDir}/executor-warned.flag`;try{await a.fs.readTextFile(c)}catch{try{await a.fs.mkdir(`${n}/${p.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
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 O(k[f]??`Run \`${m("next")}\` first.`),l(void 0)},j=async()=>{let t=await E();if(t.stop_hook_active===!0)return l(void 0);let s=t.cwd??a.process.cwd(),e;try{let u=await a.fs.readTextFile(`${s}/${p.stateFile}`);e=JSON.parse(u)}catch{return l(void 0)}if(e.phase!=="EXECUTING")return l(void 0);let n=e.execution??{},o=`${s}/${p.stateDir}/files-changed.jsonl`,i=[];try{let d=(await a.fs.readTextFile(o)).trim().split(`
|
|
5
5
|
`).filter(Boolean);i=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let r=[],g="no changes";try{let{execSync:u}=await import("node:child_process");r=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
6
6
|
`).filter(Boolean);let y=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-67AFLWXV.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as KiroModel,b as kiroFactory};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p}from"./chunk-
|
|
2
|
+
import{a as p}from"./chunk-QXSFQQGJ.js";import{f as o,h as m,k as d}from"./chunk-SHN5MT56.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h,b as u,c as k}from"./chunk-
|
|
2
|
+
import{a as h,b as u,c as k}from"./chunk-DTDUHDLM.js";import"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-SHN5MT56.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
|
|
3
3
|
`),console.log("Options:"),console.log(" --config <path> Config directory (default: .)"),console.log(" -h, --help Show this help"),i(void 0);let o=m({renderer:w.ansi(),sink:c.stdout()}),A=d.config??".",r=await u(A),n=h();if(n.register(k),p?.tools!==void 0&&n.registerAll(p.tools),r!==null&&r.workflows.length>0){o.writeln(a("Workflows:"));for(let s of r.workflows){let x=s.on.length>0?s.on.join(", "):"(no events)",f=s.steps.length,C=f===1?"step":"steps";o.writeln(t(` ${s.id.padEnd(20)} `),e(x.padEnd(25)),t(` ${f} ${C}`))}}else o.writeln(e("No workflows defined."));o.writeln();let l=n.getAll();if(l.length>0){o.writeln(a(`Registered tools (${l.length}):`));for(let s of l)o.writeln(t(` ${s.name.padEnd(28)} `),e(s.description))}else o.writeln(e("No tools registered."));return await o.close(),i(void 0)};export{R as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-
|
|
2
|
+
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-CE6UVD6F.js";import"./chunk-NVPQJFAI.js";import{a as Q}from"./chunk-LLA75EMV.js";import"./chunk-LWQPFCWC.js";import"./chunk-3OG2MEF2.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-YTF3BAQS.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-5DWJ7WEE.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{m as W}from"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
|
|
3
3
|
${p}`);let u=f=>f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),a=`
|
|
4
4
|
console.error("Runtime bundling failed:", ${JSON.stringify(l)});
|
|
5
5
|
document.getElementById("root").innerHTML = '<div class="error"><h2>Bundle Error</h2><pre>${u(l)}</pre></div>';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as oe,j as ce,r as q,u as le,w as ue,y as j,z as de}from"./chunk-
|
|
3
|
-
`);for(let n of r)e.buffer.push(n);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},
|
|
4
|
-
`),V(void 0)}let
|
|
2
|
+
import{e as oe,j as ce,r as q,u as le,w as ue,y as j,z as de}from"./chunk-KNIM3QST.js";import{b as K}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as _,d as re,e as ie,r as w,s as c,t as M,u as ae,v as P,w as W}from"./chunk-4TTJVJEI.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as se,e as N,f as ne}from"./chunk-VKB3B2FE.js";import{a as V,b as te}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 pe=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0});var Se=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"}[e]??e.slice(0,4),Te=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"}},v=(e,s)=>{let r=new Set(s.filter(a=>a.spec!==null).map(a=>a.spec)),n=e.map(a=>({label:a.name,badge:Se(a.phase),badgeColor:Te(a.phase),active:r.has(a.name),dimmed:a.phase==="COMPLETED"}));return n.length===0&&n.push({label:"No specs yet",dimmed:!0,selectable:!1}),n.push({label:"\u2500".repeat(20),dimmed:!0,selectable:!1}),n.push({label:"[n] New spec",badge:"+",badgeColor:"green"}),n.push({label:"[f] Idle mode",badge:"~",badgeColor:"cyan"}),n},X=(e,s,r,n)=>{let a=v(e,s),t=M.drawBox({x:n.x,y:n.y,width:n.width,height:n.height,title:"Specs",borderStyle:"rounded"}),y=P.renderList(a,r,n);return t+y};var Ie=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],Me=e=>{if(e===null||e==="IDLE")return"IDLE";let r={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return Ie.map(n=>n===r?c.bold(`\u2726${n}\u2726`):c.dim(n)).join("\u2192")},Ee=(e,s,r)=>{if(s===0)return c.dim("no tasks");let n=Math.round(e/s*r),a=r-n;return c.green("\u2588".repeat(n))+c.dim("\u2591".repeat(a))+` ${e}/${s}`},Y=(e,s,r)=>{let n=[];return e===null?(n.push(c.dim("No spec selected")),n.push(""),n.push(c.dim("Select a spec from the list or press [n] for new"))):e.mode==="free"?(n.push(c.bold("Mode: ")+c.cyan("IDLE")),n.push(c.dim("No active spec")),n.push(""),n.push(c.dim(`Session: ${e.sessionId}`))):(n.push(c.bold("Spec: ")+(e.spec??"unknown")),n.push(c.bold("Phase: ")+(e.phase??"unknown")),n.push(""),n.push(Me(e.phase)),n.push(""),r!==void 0&&n.push(c.bold("Progress: ")+Ee(r.completed,r.total,15)),n.push(""),n.push(c.dim(`Session: ${e.sessionId}`))),M.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:"Monitor",borderStyle:"rounded"},n)};var z=(e,s)=>{let r=e!==null?e.mode==="free"?"Terminal (IDLE)":`Terminal (${e.spec??"?"})`:"Terminal",n=e!==null&&e.widget!==null,a=M.drawBox({x:s.x,y:s.y,width:s.width,height:s.height,title:r,borderStyle:"rounded",skipInterior:n});if(e===null||e.widget===null&&e.buffer.length===0){let S=c.dim("Waiting for output..."),B=" ".repeat(s.width-2),d="";for(let k=1;k<s.height-1;k++)d+=c.moveTo(s.y+k,s.x+1),d+=k===1?c.truncate(S,s.width-2)+" ".repeat(Math.max(0,s.width-2-c.visibleLength(S))):B;return a+d}if(e.widget!==null)return a+e.widget.render(s);let t=s.height-2,y=e.buffer.slice(-t);return M.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:r,borderStyle:"rounded"},y)};var U=(e,s)=>({...e,tabs:[...e.tabs,s],selectedTabIndex:e.tabs.length}),me=(e,s)=>{let r=e.tabs.findIndex(t=>t.id===s);if(r===-1)return e;let n=e.tabs[r];n.process!==null&&n.process.kill();let a=e.tabs.filter(t=>t.id!==s);return{...e,tabs:a,selectedTabIndex:Math.min(e.selectedTabIndex,a.length-1)}},ge=(e,s)=>s<0||s>=e.tabs.length?e:{...e,selectedTabIndex:s},G=(e,s)=>{let r=s.split(`
|
|
3
|
+
`);for(let n of r)e.buffer.push(n);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},E=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var fe=(e,s,r)=>{if(r&&s==="c")return{type:"quit"};if(s==="tab")return{type:"toggleFocus"};if(e.focus==="list")switch(s){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:s}},be=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),J=(e,s,r)=>{let n=P.nextSelectableIndex(r,e.selectedTabIndex,s);return{...e,selectedTabIndex:n}},H=(e,s,r)=>e>=r.x&&e<r.x+r.width&&s>=r.y&&s<r.y+r.height,ye=(e,s,r,n)=>{let a=e.x+1,t=e.y+1;if(H(a,t,s.left)){if(e.type==="wheel")return{type:"scrollSpecs",direction:e.direction==="up"?"up":"down"};if(e.type==="mousedown"&&e.button===0){let y=e.y+1-s.left.y-1;if(y>=0&&y<r.length){let S=r[y];if(S.selectable!==!1)return S.label.includes("[n]")?{type:"clickNewSpec"}:S.label.includes("[f]")?{type:"clickFreeMode"}:{type:"clickSpec",index:y}}}return{type:"none"}}return H(a,t,s.rightBottom)?e.type==="wheel"?{type:"scrollTerminal",direction:e.direction==="up"?"up":"down"}:n!=="terminal"?{type:"clickTerminal"}:{type:"forwardMouse",event:e}:H(a,t,s.rightTop)?{type:"clickMonitor"}:{type:"none"}};var Be=async e=>{let s=e?.includes("--dry-run")??!1,r=L.process.cwd();if(!await de(r))return console.error("noskills is not initialized. Run:",K(),"init"),te({exitCode:1});let a=(await ce(r)).map(i=>({name:i.name,phase:i.state.phase,hasActiveSession:!1})),t=pe(),{cols:y,rows:S}=w.getTerminalSize(),B={leftWidth:.25,rightTopHeight:.35},d=ae.calculateLayout(y,S,B),k=new TextEncoder,g=i=>{L.process.writeToStdout(k.encode(i))};if(s){g(w.clearScreenSeq());let i=` noskills manager | ${a.length} spec(s) | ${K()} | Ctrl+C to quit`;g(c.moveTo(d.statusBar.y,d.statusBar.x)),g(c.inverse(c.truncate(i,d.statusBar.width))),g(X(a,t.tabs,t.selectedTabIndex,d.left));let l=E(t);return g(Y(l,d.rightTop)),g(z(l,d.rightBottom)),g(c.moveTo(S,1)),g(`
|
|
4
|
+
`),V(void 0)}let D=new ne,F=null,Q=async()=>{for(let i of["claude","claude-code"])try{if(await se`which ${i}`.noThrow().code()===0)return i}catch{}return"claude"},T=v(a,t.tabs);t.selectedTabIndex=P.nextSelectableIndex(T,-1,"down");let A=async()=>{let i=j();await q(r,{id:i,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let l=d.rightBottom.width-2,p=d.rightBottom.height-2,o=new W(p,l),f={id:`tab-${i}`,spec:null,mode:"free",sessionId:i,process:null,buffer:[],widget:o,active:!0,phase:null};try{let m=await Q(),b=await N({command:m,cwd:r,env:{...L.env.toObject(),NOSKILLS_SESSION:i},cols:l,rows:p});f.process=b,D.add(f.id,b),b.onData(I=>{o.write(I),G(f,I),F?.()})}catch(m){let b=m instanceof Error?m.message:String(m);o.write(`[noskills manager] Failed to spawn claude: ${b}\r
|
|
5
5
|
`),o.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
6
|
-
`)}Object.assign(t,U(t,f)),t.focus="terminal",T=v(a,t.tabs)},Z=async i=>{let l=t.tabs.find(h=>h.spec===i);if(l!==void 0){let h=t.tabs.indexOf(l);Object.assign(t,ge(t,h)),t.focus="terminal";return}let p=null;try{p=(await oe(r,i)).phase}catch{}let o=j();await q(r,{id:o,spec:i,mode:"spec",phase:p,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let f=d.rightBottom.width-2,m=d.rightBottom.height-2,b=new W(m,f),
|
|
7
|
-
`)}Object.assign(t,U(t,
|
|
6
|
+
`)}Object.assign(t,U(t,f)),t.focus="terminal",T=v(a,t.tabs)},Z=async i=>{let l=t.tabs.find(h=>h.spec===i);if(l!==void 0){let h=t.tabs.indexOf(l);Object.assign(t,ge(t,h)),t.focus="terminal";return}let p=null;try{p=(await oe(r,i)).phase}catch{}let o=j();await q(r,{id:o,spec:i,mode:"spec",phase:p,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let f=d.rightBottom.width-2,m=d.rightBottom.height-2,b=new W(m,f),I={id:`tab-${o}`,spec:i,mode:"spec",sessionId:o,process:null,buffer:[],widget:b,active:!0,phase:p};try{let h=await Q(),R=await N({command:h,cwd:r,env:{...L.env.toObject(),NOSKILLS_SESSION:o},cols:f,rows:m});I.process=R,D.add(I.id,R),R.onData(ee=>{b.write(ee),G(I,ee),F?.()})}catch(h){let R=h instanceof Error?h.message:String(h);b.write(`[noskills manager] Failed to spawn claude for spec "${i}": ${R}\r
|
|
7
|
+
`)}Object.assign(t,U(t,I)),t.focus="terminal",T=v(a,t.tabs)};g(w.enterAlternateScreen()),g(w.hideCursorSeq()),g(w.clearScreenSeq()),g(_.enableMouse());let u=new Set(["specs","monitor","terminal","status"]),C=()=>{let i=E(t),l=[];if(l.push(w.hideCursorSeq()),u.has("status")||u.size===0){let p=t.focus==="list"?"LIST":"TERM",o=` noskills manager | ${a.length} spec(s) | ${t.tabs.length} tab(s) | [${p}] Tab: toggle | q: quit | n: new | f: free`;l.push(c.moveTo(d.statusBar.y,d.statusBar.x)),l.push(c.inverse(c.truncate(o,d.statusBar.width)+" ".repeat(Math.max(0,d.statusBar.width-c.visibleLength(o)))))}u.has("specs")&&l.push(X(a,t.tabs,t.selectedTabIndex,d.left)),u.has("monitor")&&l.push(Y(i,d.rightTop)),u.has("terminal")&&l.push(z(i,d.rightBottom)),l.push(w.showCursorSeq()),u.clear(),g(l.join(""))},x=()=>{u.add("specs"),u.add("monitor"),u.add("terminal"),u.add("status")},$=!1;F=()=>{u.add("terminal"),!$&&($=!0,setTimeout(()=>{$=!1,t.running&&C()},16))},x(),C();let he=async i=>{let l=ye(i,d,T,t.focus);switch(l.type){case"clickSpec":{t.focus="list",t.selectedTabIndex=l.index;let p=a.find(o=>o.name===T[l.index]?.label)?.name;if(p!==void 0){await Z(p),x();return}u.add("specs"),u.add("monitor"),u.add("status");break}case"clickNewSpec":case"clickFreeMode":{t.focus="list",await A(),x();return}case"clickTerminal":{t.focus="terminal",u.add("status");break}case"clickMonitor":{t.focus="list",u.add("status");break}case"scrollSpecs":{Object.assign(t,J(t,l.direction,T)),u.add("specs"),u.add("monitor");break}case"scrollTerminal":{let p=E(t);if(p?.process!==null&&p!==null){let o=l.direction==="up"?"\x1B[A":"\x1B[B";p.process?.write(o.repeat(3))}break}case"forwardMouse":{t.focus="terminal",u.add("status");let p=E(t);if(p?.process!==null&&p!==null){let o=i.x+1-d.rightBottom.x,f=i.y+1-d.rightBottom.y,m=i.button;i.type==="mousemove"&&(m|=32),i.type==="wheel"&&(m=64|(i.direction==="down"?1:0)),i.shift&&(m|=4),i.ctrl&&(m|=16);let b=i.type==="mouseup"?"m":"M";p.process?.write(`\x1B[<${m};${o};${f}${b}`)}break}case"none":break}};try{await re(async()=>{for await(let i of ie(L.process.stdin)){if(!t.running)break;if(i.kind==="mouse"){await he(i.event),u.size>0&&C();continue}let l=i.event,p=fe(t,l.name,l.ctrl);switch(p.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,be(t)),u.add("status");break;case"navigate":Object.assign(t,J(t,p.direction,T)),u.add("specs"),u.add("monitor"),u.add("terminal");break;case"freeMode":await A(),x();break;case"newSpec":await A(),x();break;case"select":{let o=T[t.selectedTabIndex];if(o===void 0)break;let f=o.label;if(f.includes("[n]")||f.includes("[f]"))await A();else{let m=a.find(b=>b.name===f)?.name;m!==void 0&&await Z(m)}x();break}case"closeTab":{let o=E(t);o!==null&&(o.process!==null&&D.remove(o.id),await le(r,o.sessionId),Object.assign(t,me(t,o.id)),T=v(a,t.tabs),t.focus="list"),x();break}case"passthrough":{let o=E(t);o?.process!==null&&o!==null&&o.process?.write(new TextDecoder().decode(l.raw));break}case"none":break}if(!t.running)break;u.size>0&&C()}})}finally{await D.killAll(),D.forceKillAll(),await ue(r),g(_.disableMouse()),g(w.showCursorSeq()),g(w.exitAlternateScreen())}return V(void 0)};export{Be as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-
|
|
2
|
+
import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
|
|
3
3
|
"./${t.relativePath}",
|
|
4
4
|
"default"
|
|
5
5
|
);`:`export const ${n} = createClientReference(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{b as CommandBuilder,a as CommandError,f as ProcessGroup,d as exec,c as parseCommand,e as spawnPty};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-SHN5MT56.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-
|
|
2
|
+
import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-SHN5MT56.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-VKB3B2FE.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{b as v}from"./chunk-6G6UVWJN.js";import{e as te}from"./chunk-5WJ6AUNY.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
|
|
3
3
|
${n.join(`
|
|
4
4
|
`)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\0GLOBSTAR\0").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(de(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!pe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".eser/manifest.yml",".eser/manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var Ge=async r=>{let t=O(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
|
|
5
5
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-WJI2X6IA.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-BNZPRQUS.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as completionsHandler,f as doctorHandler,g as infoHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Le}from"./chunk-
|
|
2
|
+
import{a as Le}from"./chunk-DHNS2KLJ.js";import{a as qe}from"./chunk-3CE7GA2P.js";import{a as _e,c as Je}from"./chunk-BJ45FF6F.js";import{a as We}from"./chunk-AUDMKDAA.js";import{a as ze}from"./chunk-PG7KG7NX.js";import{a as Se,c as $e}from"./chunk-ZQ7KN4HT.js";import{a as Re,c as Te}from"./chunk-N6PXARPJ.js";import{a as De,c as Fe}from"./chunk-66VSO643.js";import{a as Pe,c as je}from"./chunk-4XXI5LYN.js";import{a as Ie,c as Ee}from"./chunk-HV3EYAGF.js";import{a as Me,c as Ne}from"./chunk-QRNSYEPI.js";import{a as Oe}from"./chunk-3SBAWBWS.js";import{a as Ae}from"./chunk-TBRDRQQK.js";import"./chunk-VXVW4UNH.js";import{a as de,c as ce}from"./chunk-PY6ZNQ4B.js";import{a as pe,c as me}from"./chunk-TTLUVJIR.js";import{a as ue,c as fe}from"./chunk-OSNPAAYT.js";import{a as ge,c as ve}from"./chunk-UYGKTA3C.js";import{a as ye,c as he}from"./chunk-4QMRLILJ.js";import{a as ke,c as be}from"./chunk-BESTYZQY.js";import{a as xe,c as Ve}from"./chunk-IY3YRKJJ.js";import{a as Ce,c as we}from"./chunk-YCI2VITZ.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-72R6CKNY.js";import{a as re}from"./chunk-MGNBNMJZ.js";import"./chunk-BVIGTD2Z.js";import{b as H,c as Q}from"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-JTSRGXS4.js";import{a as q,b as Z,f as ee,h as te,j as ae,k as _,o as m,p as se,q as oe}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as K}from"./chunk-MG65QJY6.js";import{a as P,b as L}from"./chunk-FFWPJP7A.js";import{i as j}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var I=async a=>{let s=await H(a);return s===null?null:s},Ke=async a=>await Q(a);var J={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let s=await Le({root:a.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(e=>({severity:"error",message:`Circular dependency: ${e.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var W={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let s=await We({root:a.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(e=>({severity:"error",message:`Missing export in ${e.packageName}: ${e.file}`,file:e.file})),stats:{packagesChecked:s.packagesChecked}}}};var z={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let s=await qe({root:a.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(e=>({severity:"error",message:`${e.packageName}: "${e.exportPath}" should be "${e.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var Y={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let s=a.options?.requireExamples,e=await Ae({root:a.root,requireExamples:s});return{name:"validate-docs",passed:e.isValid,issues:e.issues.map(t=>({severity:"error",message:`${t.symbol}: ${t.issue}`,file:t.file,line:t.line})),stats:{filesChecked:e.filesChecked,symbolsChecked:e.symbolsChecked}}}};var B={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let s=await ze({root:a.root}),e=[];for(let t of s.inconsistencies)e.push({severity:"error",message:`${t.packageName}: ${t.field} mismatch - deno.json: ${JSON.stringify(t.denoValue)}, package.json: ${JSON.stringify(t.packageValue)}`});for(let t of s.dependencyInconsistencies){let c=`${t.packageName}: ${t.dependencyName} - ${t.issue}`;t.expected!==void 0&&t.actual!==void 0&&(c+=` (expected: ${t.expected}, actual: ${t.actual})`),e.push({severity:"error",message:c})}return{name:"validate-package-configs",passed:s.isConsistent,issues:e,stats:{packagesChecked:s.packagesChecked}}}};var tt=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],at=[],st=a=>at.some(s=>s.test(a)),ot=(a,s)=>{let e=a.slice(0,s);return e.includes("//")||e.includes("/*")&&!e.includes("*/")},it=(a,s)=>{let e=!1,t=!1,c=!1;for(let p=0;p<s;p++){let u=a[p];(p>0?a[p-1]:"")!=="\\"&&(u==="'"&&!t&&!c&&(e=!e),u==='"'&&!e&&!c&&(t=!t),u==="`"&&!e&&!t&&(c=!c))}return e||t||c},w=re({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:X,checkFile(a,s){if(s===void 0)return[];if(st(a.path))return[];let e=[],t=s.split(`
|
|
3
3
|
`);for(let c=0;c<t.length;c++){let p=t[c];for(let{pattern:u,replacement:f}of tt){let g=u.exec(p);g!==null&&(ot(p,g.index)||it(p,g.index)||e.push({path:a.path,line:c+1,message:`direct Deno API usage: ${g[0]} \u2014 use @eser/standards/cross-runtime (${f})`}))}}return e}}),St=w.run,Ye=w.validator,$t=w.main;var x={validators:new Map,initialized:!1},nt=()=>{n(J),n(W),n(z),n(Y),n(B),n(le),n(ce),n(me),n(fe),n(ve),n(he),n(be),n(Ve),n(we),n($e),n(Te),n(Fe),n(je),n(Ee),n(Ne),n(Je),n(Ye)},U=()=>{x.initialized||(x.initialized=!0,nt())},n=a=>{x.validators.set(a.name,a)},lt=a=>(U(),x.validators.get(a)??null),E=()=>(U(),[...x.validators.values()]),dt=()=>(U(),[...x.validators.keys()]),ct=a=>({name:a.config.name,description:a.config.description,run:async s=>{let e=await a.run(s);return{name:e.name,passed:e.issues.length===0,issues:e.issues.map(t=>({path:t.path,line:t.line,message:t.message,fixed:t.fixed})),mutations:e.mutations.map(t=>({path:t.path,oldContent:t.oldContent,newContent:t.newContent})),stats:{filesChecked:e.filesChecked,issuesFound:e.issues.length}}}}),pt=a=>({name:a.name,description:a.description,run:async s=>{let e=await a.validate({root:s.root??".",options:s});return{name:e.name,passed:e.passed,issues:e.issues.map(t=>({path:t.file,line:t.line,message:t.message})),mutations:[],stats:e.stats}}}),mt=()=>{let a=[],s=[ne,de,pe,ue,ge,ye,ke,xe,Ce,Se,Re,De,Pe,Ie,Me,_e,w];for(let t of s)a.push(ct(t));let e=[J,W,z,Y,B];for(let t of e)a.push(pt(t));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async t=>{let c=t.commitMsgFile??t._args?.[0]??".git/COMMIT_EDITMSG",{runtime:p}=await import("./mod-4XKQZL6W.js"),u;try{u=await p.fs.readTextFile(c)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${c}`}],mutations:[],stats:{}}}let f=Oe(u,{allowAsterisk:t.allowAsterisk,allowMultipleScopes:t.allowMultipleScopes,forceScope:t.forceScope,types:t.types});return{name:"validate-commit-msg",passed:f.valid,issues:f.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ut=8,Zt=async(a={})=>{let s=a.root??j.process.cwd(),t=(await I(s))?.stack??[],c=[...a.skip??[]],p=a.only??[],u=E(),f=[],g=[],S=[];for(let i of u){if(p.length>0&&!p.includes(i.name))continue;if(c.includes(i.name)){S.push(i.name);continue}if(i.requiredStacks.length>0&&t.length>0&&!i.requiredStacks.some(G=>t.includes(G))){g.push({name:i.name,reason:`Requires '${i.requiredStacks.join("' or '")}' stack`});continue}let $={...a.fix!==void 0?{fix:a.fix}:{}},h=await i.validate({root:s,options:$});f.push(h)}return{passed:f.every(i=>i.passed),results:f,skipped:g,disabled:S}},ea=async a=>{let s=K(a??j.process.args,{string:["root","only","skip"],boolean:["fix","help","json","yes"],alias:{h:"help",y:"yes"}});if(s.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -y, --yes Auto-confirm all fix prompts (no interactive prompts)"),console.log(" --json Output results as JSON (suppresses TUI output)"),console.log(" -h, --help Show this help message"),P(void 0);let e=s.json,t=s.yes,c=s.root,p=s.fix,u=s.only,f=s.skip,g=u!==void 0?u.split(",").map(o=>o.trim()):[],S=f!==void 0?f.split(",").map(o=>o.trim()):[],{ctx:i}=e?{ctx:Z({interaction:"non-interactive"})}:ie(),$=i.interaction==="interactive",h=c??j.process.cwd();e||ae(i,"Validating codebase...");let M=e?void 0:se(i,"Loading config...");M?.start();let R=(await I(h))?.stack??[],Be=R.length>0?R.join(", "):"all (no .eser/manifest.yml)";M?.succeed("Config loaded"),e||m.info(i,`Stack: ${Be}`);let Ue=E(),k=[],T=[],D=[];for(let o of Ue)if(!(g.length>0&&!g.includes(o.name))){if(S.includes(o.name)){D.push(o.name);continue}if(o.requiredStacks.length>0&&R.length>0&&!o.requiredStacks.some(d=>R.includes(d))){T.push({name:o.name,reason:`Requires '${o.requiredStacks.join("' or '")}' stack`});continue}k.push(o)}let V=[],N=e?void 0:oe(i,{total:k.length,label:"Validating..."});N?.start();let O=o=>{if(V.push(o),!e){let l=Object.entries(o.stats).map(([r,y])=>`${y} ${r}`).join(", "),d=`${o.name.padEnd(18)} (${l})`;o.passed?m.success(i,`PASS ${d}`):m.error(i,`FAIL ${d}`)}N?.advance(1)};if(p)for(let o of k){let l=await o.validate({root:h,options:{}}),d=l;if(!l.passed){let r=!0;if($&&!t&&!e){let y=l.issues.length,v=await ee(i,{message:`Fix ${y} issue(s) found by ${o.name}?`,initialValue:!0});(q(v)||!v)&&(r=!1)}r&&(d=await o.validate({root:h,options:{fix:!0}}))}O(d)}else{let o=0,l=async()=>{for(;o<k.length;){let y=o++,v=k[y];if(v===void 0)break;try{let b=await v.validate({root:h,options:{}});O(b)}catch(b){let Ge={name:v.name,passed:!1,issues:[{severity:"error",message:String(b)}],stats:{filesChecked:0,issuesFound:1,fixedCount:0}};O(Ge)}}},d=Math.min(ut,k.length),r=Array.from({length:d},()=>l());await Promise.allSettled(r)}if(N?.stop("Validation complete"),!e&&T.length>0){m.step(i,"Skipped (stack not configured):");for(let o of T)m.step(i,` - ${o.name}: ${o.reason}`)}if(!e&&D.length>0){m.step(i,"Disabled:");for(let o of D)m.step(i,` - ${o}`)}let C=V.flatMap(o=>o.issues.map(l=>({validator:o.name,...l})));if(!e&&C.length>0){m.warn(i,`Issues (${C.length}):`);let o=new Map;for(let l of C){let d=l.file??l.validator,r=o.get(d)??[];r.push(l),o.set(d,r)}for(let[l,d]of o){m.step(i,` ${l}`);for(let r of d){let y=r.severity==="error"?"error":"warning",v=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${y}${v}: ${r.message}`):m.warn(i,` ${y}${v}: ${r.message}`)}}}let F=V.filter(o=>!o.passed);if(!e&&$&&F.length>0)for(;;){let o=[...F.map(r=>({value:r.name,label:`${r.name} (${r.issues.length} issue(s))`})),{value:"__done__",label:"Done"}],l=await te(i,{message:"View details for which validator?",options:o});if(q(l)||l==="__done__")break;let d=F.find(r=>r.name===l);if(d!==void 0){m.info(i,`Details for ${d.name} (${d.issues.length} issue(s)):`);for(let r of d.issues){let y=r.severity==="error"?"error":"warning",v=r.file??d.name,b=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${v}${b} [${y}]: ${r.message}`):m.warn(i,` ${v}${b} [${y}]: ${r.message}`)}}}if(e){let o=V.every(d=>d.passed),l=JSON.stringify({passed:o,results:V,skipped:T,disabled:D},null,2);return console.log(l),o?P(void 0):L({message:"",exitCode:1})}let A=F.length;return A>0?(_(i,`${A} check(s) failed with ${C.length} issue(s)`),L({message:`${A} check(s) failed with ${C.length} issue(s)`,exitCode:1})):(_(i,"All checks passed!"),P(void 0))};export{Ke as getProjectConfigPath,lt as getValidator,dt as getValidatorNames,E as getValidators,mt as getWorkflowTools,I as loadProjectConfig,ea as main,n as registerValidator,Zt as validate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-
|
|
2
|
+
import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-QHVTWYZJ.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-MX5DKVDI.js";import{a as A,b as C}from"./chunk-3KGG2I2A.js";import{a as M,b as w}from"./chunk-LS5MCZUM.js";import{a as I,b as T}from"./chunk-67AFLWXV.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-YMZNUQKZ.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-RN3Q2VCK.js"),{ollamaFactory:c}=await import("./ollama-PL4UHEF2.js"),{openCodeFactory:n}=await import("./opencode-K4G7UMAE.js"),{kiroFactory:p}=await import("./kiro-JS5UVLRL.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ye}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as ge,b as he,c as Se,d as K}from"./chunk-UTWYRNI6.js";import{a as z}from"./chunk-NY4W44PI.js";import"./chunk-4NNSMDFH.js";import{a as ve,b as we,d as C}from"./chunk-2ZYCRMUT.js";import{a as Y,b as B,d as X}from"./chunk-NWWXAZFA.js";import{a as be}from"./chunk-Z2RL2SFY.js";import{a as _}from"./chunk-IZUADMIU.js";import{a as Pe,b as Ae,c as Fe,d as Ee}from"./chunk-2PWSTO7A.js";import{h as V}from"./chunk-L32KHQVT.js";import{a as xe,b as Ie,c as Z,d as ee,e as De,f as te,g as O,h as se,i as q,j as ne,k as Ce,m as ke,o as ie,p as Re}from"./chunk-QL5FA3P3.js";import{a as ae,c as E,e as ce,f as le,i as de,j as pe,k as ue,o as me,q as M,v as G,z as fe}from"./chunk-KNIM3QST.js";import{c as j}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as N,b as A}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 Te=a=>a.split(`
|
|
3
|
+
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),Le=async(a,e)=>{let r=[],n=(e.startsWith(a)?e.slice(a.length+1):e).split("/");n.pop();for(let s=n.length;s>=0;s--){let c=`${s===0?a:`${a}/${n.slice(0,s).join("/")}`}/.folder-rules.md`,i=s===0?".":n.slice(0,s).join("/");try{let l=await y.fs.readTextFile(c),d=Te(l);for(let o of d)r.push({folder:i,rule:o})}catch{}}return r},re=async(a,e)=>{let r=new Set,p=[];for(let n of e){let s=await Le(a,n);for(let t of s){let c=`${t.folder}::${t.rule}`;r.has(c)||(r.add(c),p.push(t))}}return p};var ot=async a=>{let e=y.process.cwd(),r=ve(a),p=we(a);if(!await fe(e))return await C({error:`noskills not initialized. Run: ${j("init")}`},r),A({exitCode:1});let n=null;for(let m of p)m.startsWith("--answer=")&&(n=m.slice(9));let s=le(p),t;try{t=await ce(e,s)}catch(m){let f=m instanceof Error?m.message:String(m);return await C({error:f},r),A({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED")return await C({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),A({exitCode:1});let c=await ue(e);if(c?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-QE4P4DS4.js");m(c.command)}if(c===null)return await C({error:"No config found"},r),A({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let m=`${e}/${E.specDir(t.spec)}`;try{await y.fs.stat(m)}catch{return await C({error:!0,message:`Active spec '${t.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),A({exitCode:1})}}let i=ye(p,c);t.phase==="DISCOVERY"&&t.discovery.audience!==i&&(t={...t,discovery:{...t.discovery,audience:i}});let d=(await me(e)).filter(m=>c.concerns.includes(m.id));if(n!==null){let m=await V(e),f=await Ne(e,t,c,d,n,m);await M(e,f);let g={...f,lastCalledAt:new Date().toISOString()};await M(e,g);let R=y.env.get("NOSKILLS_SESSION")??null;R!==null&&await G(e,R,g.phase);let H=await Y(e),L=B(H,g.phase),U=g.spec!==null?await _(e,g.spec):null,v=await Oe(e,g),k=await re(e,v),b=X(c?.tools??[]),D=await V(e),I=await K(g,d,L,c,U,k,void 0,b,D),S=n.trim().toLowerCase()==="save",P=g.phase===t.phase;if(S&&P&&(g.phase==="SPEC_DRAFT"||g.phase==="SPEC_APPROVED")){let Q=g.phase==="SPEC_DRAFT"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',$e={...I,instruction:Q,saved:!0};return await C($e,r),N(void 0)}return await C(I,r),N(void 0)}let o={...t,lastCalledAt:new Date().toISOString()};await M(e,o);let u=y.env.get("NOSKILLS_SESSION")??null;u!==null&&await G(e,u,o.phase);let h=await Y(e),w=B(h,o.phase),x=o.spec!==null?await _(e,o.spec):null,W=await Oe(e,o),$=await re(e,W),F;o.phase==="IDLE"&&(F={existingSpecs:(await pe(e)).map(f=>({name:f.name,phase:f.state.phase,iteration:f.state.execution.iteration,detail:f.state.phase==="EXECUTING"?`${f.state.execution.completedTasks.length} tasks done, iteration ${f.state.execution.iteration}`:f.state.phase==="SPEC_DRAFT"?"awaiting approval":f.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let J=X(c?.tools??[]),T=await V(e),oe=await K(o,d,w,c,x,$,F,J,T);return await C(oe,r),N(void 0)},Ne=async(a,e,r,p,n,s)=>{switch(e.phase){case"DISCOVERY":{let t=e.specDescription!==null&&e.specDescription.length>0,c=e.discovery.mode;if(c===void 0&&t)return["full","validate","technical-depth","ship-fast","explore"].includes(n)?Z(e,n):Z(e,"full");let i=e.discovery.premisesCompleted===!0;if(c!==void 0&&!i){try{let u=JSON.parse(n);if(u!==null&&typeof u=="object"&&"premises"in u){let w=u.premises.map(x=>({text:x.text??"",agreed:x.agreed??!0,revision:x.revision,user:s?.name??"Unknown User",timestamp:new Date().toISOString()}));return ee(e,w)}}catch{}return ee(e,[])}let l=e.discovery.audience==="agent",d=null;try{let u=JSON.parse(n);typeof u=="object"&&u!==null&&!Array.isArray(u)&&(l?ge.map(x=>x.id).every(x=>x in u)&&(d=u):d=u)}catch{}let o=e;if(d!==null)for(let[u,h]of Object.entries(d))typeof h=="string"&&h.length>0&&(o=O(o,u,h,s));else{let u=he(p),h=o.discovery.currentQuestion,w=u[h];if(w===void 0)return e;o=O(o,w.id,n,s),o=Ce(o)}return Se(o.discovery.answers)&&(o=se(o)),o}case"DISCOVERY_REVIEW":{let t=n.trim().toLowerCase();if(t==="approve"){let i=z(e.discovery.answers);return i.detected&&i.proposals.length>=2?ne(e):e.discovery.mode!==void 0?ne(e):q(e)}if(t==="split")return await Me(a,e);if(t==="keep"){let i=ie(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 q(i)}let c=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!c){let i;if(t==="skip"||t==="none")i=te(e);else{let l=!1;try{let d=JSON.parse(n);if(d!==null&&typeof d=="object"&&"approach"in d){let o={id:String(d.approach),name:String(d.name??d.approach),summary:String(d.summary??""),effort:String(d.effort??""),risk:String(d.risk??""),user:s?.name??"Unknown User",timestamp:new Date().toISOString()};i=De(e,o),l=!0}}catch{}l||(i=te(e))}return q(i)}try{let i=JSON.parse(n);if(typeof i.revise=="object"&&i.revise!==null){let l=e;for(let[d,o]of Object.entries(i.revise))typeof o=="string"&&o.length>0&&(l=O(l,d,o,s));return l}}catch{}return e}case"SPEC_DRAFT":{if(n.trim().toLowerCase()==="save")return e;if(e.classification===null){let t,c=n.trim().toLowerCase();if(c==="none"||c==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let l=JSON.parse(n);t={involvesWebUI:l.involvesWebUI===!0||l.involvesUI===!0,involvesCLI:l.involvesCLI===!0||l.involvesUI===!0,involvesPublicAPI:l.involvesPublicAPI===!0,involvesMigration:l.involvesMigration===!0,involvesDataHandling:l.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let i={...e,classification:t};try{await be(a,i,p)}catch{}return i}try{let t=JSON.parse(n);if(typeof t.refinement=="string"&&t.refinement.length>0){let c=t.refinement;if(e.spec!==null){let i=`${a}/${E.specFile(e.spec)}`,l=await y.fs.readTextFile(i);if(c.includes("task-")){let o=je(c).map(w=>`- [ ] ${w}`).join(`
|
|
4
|
+
`),u=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,h=l.replace(u,`## Tasks
|
|
5
|
+
|
|
6
|
+
${o}
|
|
7
|
+
`);await y.fs.writeTextFile(i,h)}}return e}}catch{}return e}case"SPEC_APPROVED":{if(n.trim().toLowerCase()==="save")return e;let t=ke(e);return t.spec!==null&&(await Pe(a,t.spec,"executing"),await Ee(a,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let c=await Ve(a,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:c}},!c.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await qe(a,e,n,p)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",c={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=ie(e,c);return i=xe(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},Me=async(a,e)=>{let r=z(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let p=[];for(let s of r.proposals){let t=`${a}/${E.specDir(s.name)}`;await y.fs.mkdir(t,{recursive:!0});let c=e.discovery.answers.filter(d=>s.relevantAnswers.includes(d.questionId)),l=Ie(ae(),s.name,`spec/${s.name}`);for(let d of c)l=O(l,d.questionId,d.answer);l=se(l),await de(a,s.name,l),p.push(s.name)}return Re(e,"cancelled",`Split into: ${p.join(", ")}`)},je=a=>a.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),qe=async(a,e,r,p)=>{let n;try{n=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let s=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let k=e.execution.debt.items.map((I,S)=>({id:`legacy-${S+1}`,text:I,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:k}}};let b=new TextEncoder,D=y.process.stderr.getWriter();await D.write(b.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
8
|
+
`)),D.releaseLock()}let t=new Set(["mandatory-tests","mandatory-docs"]),i=(n.na??[]).filter(v=>t.has(v));if(i.length>0)return{...s,execution:{...s.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: ${i.join(", ")}`,awaitingStatusReport:!0}};let l=n.completed??[],d=new Set(l),o=n.na??[],u=new Set(o),h=n.newIssues??[],w=n.remaining??[],x=n.blocked??[],W=s.execution.debt?.unaddressedIterations??0,$=s.execution.debt!==null?s.execution.debt.items.filter(v=>!d.has(v.id)&&!u.has(v.id)):[],F=s.execution.debtCounter??0,J=h.map((v,k)=>({id:`debt-${F+k+1}`,text:v,since:s.execution.iteration})),T=[...$,...J],m=w.length===0&&x.length===0&&h.length===0||T.length===0?null:{items:T,fromIteration:s.execution.debt?.fromIteration??s.execution.iteration,unaddressedIterations:$.length>0?W+1:1},f=[...new Set([...s.execution.naItems??[],...o])],g=[];l.length>0&&g.push(`Completed: ${l.join(", ")}`),o.length>0&&g.push(`N/A: ${o.join(", ")}`);let R=g.length>0?g.join("; "):"Status report submitted",H=s.execution.lastVerification===null||s.execution.lastVerification.passed===!0,L=m===null&&H,U=F+h.length;if(L&&s.spec!==null){let v=await _(a,s.spec);if(v!==null){let k=s.execution.completedTasks??[],b=new Set(k),D=[];try{let S=JSON.parse(s.execution.lastProgress??"");Array.isArray(S.completed)&&(D=S.completed.filter(P=>!b.has(P)&&v.tasks.some(Q=>Q.id===P)))}catch{}if(D.length===0){let S=v.tasks.find(P=>!b.has(P.id));S!==void 0&&(D=[S.id])}let I=[];for(let S of D)await Ae(a,s.spec,S),await Fe(a,s.spec,S,"done"),I.push(S);if(I.length>0){let S=I.length===1?`Task ${I[0]} accepted`:`Tasks ${I.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${S}: ${R}`,awaitingStatusReport:!1,debt:m,completedTasks:[...k,...I],debtCounter:U,naItems:f}}}}}return{...s,execution:{...s.execution,lastProgress:L?R:`Task not accepted \u2014 remaining items must be addressed first. ${R}`,awaitingStatusReport:!1,debt:m,debtCounter:U,naItems:f}}},Ve=async(a,e)=>{try{let{execSync:r}=await import("node:child_process"),p=r(e,{cwd:a,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(p).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let p=r,n=((p.stdout??"")+(p.stderr??"")).slice(0,4e3);return p.status!==void 0?{passed:!1,output:n||"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()}}},Oe=async(a,e)=>{let r=[...e.execution.modifiedFiles??[]],p=await _e(a);return[...new Set([...r,...p])]},_e=async a=>{let e=`${a}/${E.stateDir}/files-changed.jsonl`;try{let p=(await y.fs.readTextFile(e)).trim().split(`
|
|
9
|
+
`).filter(Boolean),n=[];for(let s of p)try{let t=JSON.parse(s);n.includes(t.file)||n.push(t.file)}catch{}return n}catch{return[]}};export{Ne as handleAnswer,ot as main,je as parseRefinementTasks};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-3KGG2I2A.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OllamaModel,b as ollamaFactory};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-LS5MCZUM.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OpenCodeModel,b as openCodeFactory};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{e as T}from"./chunk-
|
|
2
|
+
import{e as T}from"./chunk-NWWXAZFA.js";import{c as y,k as F}from"./chunk-KNIM3QST.js";import{b as v}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as P,h as S,k as C}from"./chunk-SHN5MT56.js";import{c as h,d as m,f as w,g as I}from"./chunk-YVN2NZL4.js";import{a as $,b as g}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=r=>{let e=r;if(typeof e?.name!="string"||e.name.length===0)throw new Error("Pack manifest must have a non-empty 'name' field");if(typeof e?.version!="string"||e.version.length===0)throw new Error("Pack manifest must have a non-empty 'version' field");if(typeof e?.description!="string"||e.description.length===0)throw new Error("Pack manifest must have a non-empty 'description' field");return e},U=()=>({installed:[]});var B={name:"typescript",version:"1.0.0",description:"TypeScript best practices",tags:["typescript","types"],rules:["rules/use-strict-types.md","rules/no-any.md","rules/prefer-const.md"],concerns:["concerns/ts-quality.json"]};var L={id:"ts-quality",name:"TypeScript Quality",description:"Enforces TypeScript best practices",extras:[{questionId:"verification",text:"Does the code pass strict TypeScript checks (noEmit, strict mode)?"}],specSections:[],reminders:["Run tsc --noEmit before reporting task complete"],acceptanceCriteria:["TypeScript strict mode passes with zero errors"]};var _={name:"react",version:"1.0.0",description:"React component conventions",tags:["react","frontend"],rules:["rules/component-structure.md","rules/prefer-function-components.md","rules/state-management.md"]};var J={name:"security",version:"1.0.0",description:"Security audit rules",tags:["security","audit"],rules:["rules/no-secrets-in-code.md","rules/validate-input.md","rules/no-eval.md"],concerns:["concerns/security-audit.json"]};var H={id:"security-audit",name:"Security Audit",description:"Security-focused review for every spec",extras:[{questionId:"verification",text:"Has the change been reviewed for injection, XSS, CSRF, and auth bypass?"},{questionId:"scope_boundary",text:"What security boundaries must NOT be crossed?"}],specSections:["Security Review"],reminders:["Check for hardcoded secrets, unsanitized input, and missing auth checks"],acceptanceCriteria:["No hardcoded secrets","All user input validated","Auth checks present on protected routes"]};var ee={"use-strict-types":"Prefer explicit types over inference for function params and returns","no-any":"Never use 'any'. Use 'unknown' when type is genuinely unknown.","prefer-const":"Use const by default, let only when reassignment is needed"},ne={"component-structure":"One component per file. Name file same as component.","prefer-function-components":"Use function components with hooks. No class components.","state-management":"Keep state as close to where it's used as possible."},te={"no-secrets-in-code":"Never hardcode API keys, passwords, or tokens","validate-input":"Validate and sanitize all user input at API boundaries","no-eval":"Never use eval(), new Function(), or equivalent dynamic code execution"},se={manifest:B,ruleContents:ee,concernContents:[L]},re={manifest:_,ruleContents:ne,concernContents:[]},ie={manifest:J,ruleContents:te,concernContents:[H]},x=new Map([["typescript",se],["react",re],["security",ie]]);var K=".eser/packs.json",j=3e4,Ee=async r=>{let e=r?.[0];if(e==="list")return await oe();if(e==="install")return await ce(r?.slice(1));if(e==="uninstall")return await le(r?.slice(1));if(e==="inspect")return await de(r?.slice(1));if(e==="search")return await ue(r?.slice(1));let n=v(),i=P({renderer:C.ansi(),sink:S.stdout()});return i.writeln(`Usage: ${n} pack <list | install <name> | uninstall <name> | inspect <name> | search <query>>`),await i.close(),$(void 0)},D=async r=>{let e=`${r}/${K}`;try{let n=await f.fs.readTextFile(e);return JSON.parse(n)}catch{return U()}},N=async(r,e)=>{let n=`${r}/${K}`;await f.fs.mkdir(`${r}/.eser`,{recursive:!0}),await f.fs.writeTextFile(n,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)},R=r=>x.get(r),M=r=>{let e=r.replace(/^github:/,"").replace(/^gh:/,""),n=e.indexOf("#");if(n===-1)return null;let i=e.slice(0,n),t=e.slice(n+1),l=i.indexOf("/");if(l===-1)return null;let u=i.slice(0,l),c=i.slice(l+1);return u.length===0||c.length===0||t.length===0?null:{owner:u,repo:c,ref:"main",packPath:t}},z=async r=>{let e=M(r);if(e===null)throw new Error(`Invalid pack specifier: ${r}. Expected format: github:owner/repo#pack-name`);let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.ref}/packs/${e.packPath}/pack.json`,i=await globalThis.fetch(n,{signal:AbortSignal.timeout(j)});if(!i.ok)throw new Error(`Could not fetch pack from ${r}. HTTP ${i.status}`);let t=JSON.parse(await i.text());return q(t)},E=async(r,e)=>{let n=M(r);if(n===null)throw new Error(`Invalid pack specifier: ${r}`);let i=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}/packs/${n.packPath}/${e}`,t=await globalThis.fetch(i,{signal:AbortSignal.timeout(j)});if(!t.ok)throw new Error(`Could not fetch ${e} from ${r}. HTTP ${t.status}`);return await t.text()},W=async r=>{let e=`${r}/${y.concernsDir}`,n=0;try{for await(let i of f.fs.readDir(e))if(i.isFile&&i.name.endsWith(".json")){let t=i.name.match(/^(\d+)-/);if(t!==null){let l=parseInt(t[1],10);l>n&&(n=l)}}}catch{}return n+1},A=async(r,e,n)=>{let i=[],t=[],l=[],u=`${r}/${y.rulesDir}`;await f.fs.mkdir(u,{recursive:!0});for(let[p,o]of Object.entries(n.ruleContents)){let a=`pack-${e}-${p}.md`;await f.fs.writeTextFile(`${u}/${a}`,o+`
|
|
4
4
|
`),i.push(a)}if(n.concernContents.length>0){let p=`${r}/${y.concernsDir}`;await f.fs.mkdir(p,{recursive:!0});let o=await W(r);for(let a of n.concernContents){let d=`${String(o).padStart(3,"0")}-${a.id}.json`;await f.fs.writeTextFile(`${p}/${d}`,JSON.stringify(a,null,2)+`
|
|
5
5
|
`),t.push(d),o++}}if(n.folderRuleContents!==void 0)for(let[p,o]of Object.entries(n.folderRuleContents)){let a=`${r}/${p}/.folder-rules.md`;await f.fs.mkdir(`${r}/${p}`,{recursive:!0}),await f.fs.writeTextFile(a,o+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,j as R,o as x}from"./chunk-
|
|
2
|
+
import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,j as R,o as x}from"./chunk-KNIM3QST.js";import{a as E}from"./chunk-2XNFZXHY.js";import{a as k,b as C,f as v,o}from"./chunk-4TTJVJEI.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{a as d,b as $}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import{e as j}from"./chunk-5WJ6AUNY.js";var S=j(E(),1);var Y=async e=>{let t=a.process.cwd(),n=D(e),s=C({target:n==="agent"?"non-interactive":"interactive"}),u=P(e).includes("--force");if(!u&&n==="agent")return o.error(s,"Purge requires `--force` flag in agent mode."),$({exitCode:1});if(u)return o.step(s,"Purging noskills content..."),await q(t,s),o.success(s,"Purge complete."),d(void 0);let g=(await N(t)).filter(i=>i.exists);if(g.length===0)return o.info(s,"Nothing to remove."),d(void 0);let p=[];for(let i of g){let y=await v(s,{message:i.message});if(k(y))return o.info(s,"Aborted."),d(void 0);p.push({id:i.id,confirmed:y===!0})}let f=p.filter(i=>i.confirmed),I=p.filter(i=>!i.confirmed);if(f.length===0)return o.info(s,"Nothing selected for removal."),d(void 0);let T=new Set(f.map(i=>i.id)),w=[];for(let i of f)await H(t,i.id)?o.step(s,` Removed ${h(i.id)}`):(w.push(i.id),o.step(s,` Failed to remove ${h(i.id)}`));for(let i of I)o.step(s,` Kept ${h(i.id)}`);T.size>0&&await b(t);let M=f.length-w.length;return o.success(s,`Purge complete (${M} of ${g.length} categories removed).`),d(void 0)},N=async e=>{let[t,n,s,r]=await Promise.all([O(e),L(e),J(e),U(e)]);return[t,n,s,r]},O=async e=>{let t=await x(e),n=t.map(s=>s.id).join(", ");return{id:"concerns",exists:t.length>0,message:`Remove concerns? (${n})`}},L=async e=>{let t=await R(e),n=0;try{for await(let c of a.fs.readDir(`${e}/${l.specsDir}`))c.isDirectory&&n++}catch{}let s=Math.max(t.length,n);if(s===0)return{id:"specs",exists:!1,message:""};let r=t.map(c=>`${c.name} ${c.state.phase}`).join(", ");return{id:"specs",exists:!0,message:t.length>0?`Remove specs? (${s} specs: ${r})`:`Remove specs? (${s} spec directories)`}},J=async e=>{let t=0;try{for await(let n of a.fs.readDir(`${e}/${l.rulesDir}`))n.isFile&&t++}catch{}return{id:"rules",exists:t>0,message:`Remove rules? (${t} active rules)`}},U=async e=>{let t=!1,n=!1,s=!1;try{let c=await a.fs.readTextFile(`${e}/.claude/settings.json`);t=JSON.parse(c).hooks!==void 0}catch{}try{n=(await a.fs.readTextFile(`${e}/CLAUDE.md`)).includes("<!-- noskills:start -->")}catch{}let r=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let c of r)try{await a.fs.stat(c),s=!0;break}catch{}return{id:"agent-integration",exists:t||n||s,message:"Remove agent integration? (.claude/settings.json, CLAUDE.md, .claude/agents/noskills-*.md)"}},h=e=>({concerns:"concerns",specs:"specs",rules:"rules","agent-integration":"agent integration"})[e],H=(e,t)=>{switch(t){case"concerns":return m(`${e}/${l.concernsDir}`);case"specs":return z([`${e}/${l.specsDir}`,`${e}/${l.stateDir}`]);case"rules":return m(`${e}/${l.rulesDir}`);case"agent-integration":return A(e)}},q=async(e,t)=>{await m(`${e}/${l.concernsDir}`)&&o.step(t," Removed `.eser/concerns/`"),await m(`${e}/${l.specsDir}`)&&o.step(t," Removed `.eser/specs/`"),await m(`${e}/${l.rulesDir}`)&&o.step(t," Removed `.eser/rules/`"),await m(`${e}/${l.stateDir}`)&&o.step(t," Removed `.eser/.state/`"),await b(e)&&o.step(t," Removed noskills section from `manifest.yml`"),await A(e)&&o.step(t," Removed agent integration")},m=async e=>{try{await a.fs.stat(e);let{rmSync:t}=await import("node:fs");return t(e,{recursive:!0,force:!0}),!0}catch{return!1}},z=async e=>{let t=!1;for(let n of e)await m(n)&&(t=!0);return t},F=async e=>{try{await a.fs.stat(e);let{unlinkSync:t}=await import("node:fs");return t(e),!0}catch{return!1}},b=async e=>{let t=`${e}/${l.manifestFile}`;try{let n=await a.fs.readTextFile(t),s=S.parseDocument(n);return s.has("noskills")?(s.delete("noskills"),await a.fs.writeTextFile(t,s.toString()),!0):!1}catch{return!1}},B=async e=>{let t=`${e}/CLAUDE.md`,n="<!-- noskills:start -->",s="<!-- noskills:end -->";try{let r=await a.fs.readTextFile(t),u=r.indexOf(n),c=r.indexOf(s);return u!==-1&&c!==-1?(r=r.slice(0,u).trimEnd()+`
|
|
3
3
|
`+r.slice(c+s.length).trimStart(),await a.fs.writeTextFile(t,r.trimEnd()+`
|
|
4
4
|
`),!0):!1}catch{return!1}},K=async e=>{let t=`${e}/.claude/settings.json`;try{let n=await a.fs.readTextFile(t),s=JSON.parse(n);return s.hooks!==void 0?(delete s.hooks,await a.fs.writeTextFile(t,JSON.stringify(s,null,2)+`
|
|
5
5
|
`),!0):!1}catch{return!1}},A=async e=>{let t=!1;await K(e)&&(t=!0),await B(e)&&(t=!0);let n=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let r of n)await F(r)&&(t=!0);let s=[`${e}/.cursorrules`,`${e}/.windsurfrules`,`${e}/.kiro/steering/conventions.md`,`${e}/.github/copilot-instructions.md`];for(let r of s)await F(r)&&(t=!0);return t};export{Y as main};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as c}from"./chunk-
|
|
2
|
+
import{a as c}from"./chunk-KFSZ6MDH.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as g}from"./chunk-LFNUSULJ.js";import{a as R,c as f}from"./chunk-JTSRGXS4.js";import{f as w,o as t}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as m}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{d as a}from"./chunk-VKB3B2FE.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:n,output:A}=R(),x=async()=>(await a`git status --porcelain`.noThrow().text()).length===0,E=async()=>{let e=await a`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
|
|
3
3
|
`):[]},$=async(e,r)=>{for(let s of r)await a`git add ${s}`.spawn();await a`git commit -m ${e}`.spawn()},P=async()=>{await a`git push origin HEAD`.spawn()},b=async e=>{await a`git tag -d ${e}`.noThrow().spawn();let r=`:refs/tags/${e}`;await a`git push origin ${r}`.noThrow().spawn()},O=async e=>await w(n,{message:e})===!0,k=async e=>{let{type:r,dryRun:s=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit or stash changes first.");let o=await E();if(o.length>0&&e.yes!==!0)throw new Error(`You have ${o.length} unpushed commit(s):
|
|
4
4
|
${o.join(`
|
|
5
5
|
`)}
|
|
6
6
|
|
|
7
|
-
Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-
|
|
7
|
+
Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-GXSXTSSG.js")).versions(r,{dryRun:s});let u=await c()??l,d=!1;try{await(await import("./changelog-gen-TE6FXELA.js")).generateChangelog({dryRun:s}),d=!0}catch{d=!1}let h=!1,v=!1;if(!s){d&&await a`deno fmt CHANGELOG.md`.noThrow().spawn();let y=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],C=`chore(codebase): release v${u}`;await $(C,y),h=!0,await P(),v=!0}return{version:u,previousVersion:l,changelogGenerated:d,committed:h,pushed:v,dryRun:s}},M=async(e={})=>{let{dryRun:r=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit and push first.");let s=await E();if(s.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
|
|
8
8
|
${s.join(`
|
|
9
9
|
`)}`);let o=await c();if(o===void 0||!/^\d+\.\d+\.\d+$/.test(o))throw new Error(`Invalid or missing version in VERSION file: "${o}"`);let l=`v${o}`;if(!r){let u=`chore(codebase): release v${o}`;await a`git commit --allow-empty -m ${u}`.spawn(),await a`git push origin HEAD`.spawn()}return{version:o,tag:l,dryRun:r}},T=async(e={})=>{let r=await c();if(r===void 0||!/^\d+\.\d+\.\d+$/.test(r))throw new Error(`Invalid or missing version in VERSION file: "${r}"`);let s=`v${r}`;if(e.yes!==!0)throw new Error(`This will delete tag ${s} locally and remotely. Re-run with --yes to confirm.`);return await b(s),{version:r,tag:s,deleted:!0}},U=e=>m.fromPromise(()=>k(e)),H=e=>m.fromPromise(()=>M(e)),I=e=>m.fromPromise(()=>T(e)),V=e=>{let r=e.args[0];return r===void 0||!["patch","minor","major","same"].includes(r)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:r,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},j=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),N=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?(t.warn(n,"[DRY RUN] Release preview:"),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"generated":"no user-facing changes"}`),t.info(n," No changes were made.")):(t.success(n,`Released v${r.version}`),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"updated":"no user-facing changes"}`),t.info(n,` Committed: ${r.committed}`),t.info(n,` Pushed: ${r.pushed}`),t.info(n," CI will validate, tag, and publish."),t.info(n," Watch: https://github.com/eser/stack/actions")),i.ok(void 0)},D=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?t.warn(n,`[DRY RUN] Would delete and recreate tag ${r.tag}`):(t.success(n,`Re-tagged ${r.tag}`),t.info(n,"CI will validate and publish.")),i.ok(void 0)},S=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.deleted&&t.success(n,`Deleted tag v${r.version} (local + remote).`),i.ok(void 0)},F=g.createTrigger({handler:U,adaptInput:V,adaptOutput:N}),W=g.createTrigger({handler:H,adaptInput:j,adaptOutput:D}),Y=g.createTrigger({handler:I,adaptInput:G,adaptOutput:S}),ee=async e=>{let r=p(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),s=r._[0],o=r["dry-run"]===!0,l=r.yes===!0;if(s!==void 0&&!o&&!l&&["patch","minor","major","same"].includes(s)){let d=await c()??"0.0.0";if(t.info(n,`Current version: ${d}`),t.info(n,`Bump type: ${s}`),t.info(n,"This will bump version, generate changelog, commit, and push."),await A.flush(),!await O("Proceed?"))return t.warn(n,"Aborted."),i.ok(void 0);r.yes=!0}let u=f("release",r);return await F(u)},re=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=f("rerelease",r);return await W(s)},se=async e=>{let r=p(e??[],{boolean:["yes"],alias:{y:"yes"}}),s=f("unrelease",r);return await Y(s)};export{F as handleReleaseCli,W as handleRereleaseCli,Y as handleUnreleaseCli,ee as main,k as release,U as releaseHandler,M as rerelease,H as rereleaseHandler,re as rereleaseMain,T as unrelease,I as unreleaseHandler,se as unreleaseMain};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-JTSRGXS4.js";import{o as u}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as p}from"./chunk-
|
|
2
|
+
import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-JTSRGXS4.js";import{o as u}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as p}from"./chunk-VKB3B2FE.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as x,n as R}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:h,output:Y}=C(),E=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,A=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},N=t=>{let e=t.split(/\r?\n/),n=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(E);i!==null&&/^\d/.test(i[1])&&n.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return n.length===0?[]:n.map((s,o)=>{let i=n[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,r=e.slice(g,a);for(;r.length>0&&r[0].trim()==="";)r.shift();for(;r.length>0&&r[r.length-1].trim()==="";)r.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return r.length>0&&d.push("",...r),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
|
|
3
3
|
`).trim()}
|
|
4
4
|
`}})},T=async(t={})=>{let{changelogPath:e="CHANGELOG.md",root:n="."}=t,s=R(n,e),o=await c.runtime.fs.readTextFile(s);return{entries:N(o)}},O=async(t,e)=>{try{return await p.exec`gh release view ${t} --repo ${e}`.quiet().text(),!0}catch{return!1}},k=async t=>{let{repo:e,createIfMissing:n=!1,changelogPath:s="CHANGELOG.md",root:o=".",releaseTitle:i="eserstack {tag}"}=t,{entries:g}=await T({changelogPath:s,root:o});if(g.length===0)throw new Error("No release headings found in CHANGELOG.md.");let a=t.tag!==void 0?A(t.tag):g[0].tag,r=g.find(y=>y.tag===a);if(r===void 0)throw new Error(`No matching changelog section found for ${a}.`);let d=await c.runtime.fs.makeTempDir({prefix:"eserstack-release-"}),f=x(d,`${a}-notes.md`);await c.runtime.fs.writeTextFile(f,r.notes);try{if(await O(a,e))return await p.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"updated"};if(!n)return{tag:a,entry:r,action:"skipped"};let $=i.replace("{tag}",a);try{return await p.exec`gh release create ${a} --repo ${e} --title ${$} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"created"}}catch{return await p.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"updated"}}}finally{await c.runtime.fs.remove(d,{recursive:!0})}},I=t=>w.fromPromise(()=>k(t)),S=t=>{let e=t.flags.repo??c.runtime.env.get("GITHUB_REPOSITORY")??"";return e===""?l.fail(m.adaptError("Missing repository. Pass --repo or set GITHUB_REPOSITORY.")):l.ok({repo:e,tag:t.flags.tag??void 0,createIfMissing:t.flags["create-if-missing"]===!0})},b=t=>{if(l.isFail(t)){let n=t.error,s=n instanceof Error?n.message:n.message??String(n);return u.error(h,s),l.fail({exitCode:1})}let{value:e}=t;switch(e.action){case"created":u.success(h,`Created release ${e.tag} with changelog notes.`);break;case"updated":u.success(h,`Updated release notes for ${e.tag}.`);break;case"skipped":u.warn(h,`Release ${e.tag} not found. Skipping (pass --create-if-missing to create).`);break}return l.ok(void 0)},G=m.createTrigger({handler:I,adaptInput:S,adaptOutput:b}),q=async t=>{let e=v(t??[],{string:["repo","tag"],boolean:["create-if-missing"],alias:{h:"help"}}),n=P("release-notes",e);return await G(n)};export{G as handleCli,O as hasGitHubRelease,q as main,A as normalizeTag,T as parseChangelog,N as parseChangelogText,k as syncReleaseNotes,I as syncReleaseNotesHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c,d as f}from"./chunk-
|
|
2
|
+
import{c,d as f}from"./chunk-FVXGVHUR.js";import{a as R}from"./chunk-KFSZ6MDH.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as d,c as p}from"./chunk-JTSRGXS4.js";import{o as n}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as u}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as g}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:i,output:N}=d(),P=async(e={})=>{let{root:r=".",remote:s="origin",tagPrefix:h="v",messageTemplate:y="Release {tag}",dryRun:l=!1}=e,t=await R({root:r});if(t===void 0||!/^\d+\.\d+\.\d+$/.test(t))throw new Error(`Invalid or missing version in VERSION file: "${t}"`);let o=`${h}${t}`,v=y.replace("{tag}",o).replace("{version}",t);return l||(await c(o,v),await f(s,o)),{version:t,tag:o,remote:s,dryRun:l}},T=e=>u.fromPromise(()=>P(e)),C=e=>a.ok({dryRun:e.flags["dry-run"]===!0}),x=e=>{if(a.isFail(e)){let s=e.error instanceof Error?e.error.message:String(e.error);return n.error(i,s),a.fail({exitCode:1})}let{value:r}=e;return r.dryRun?n.warn(i,`[DRY RUN] Would create and push tag ${r.tag}`):(n.success(i,`Created tag ${r.tag}`),n.info(i,`Pushed tag ${r.tag} to ${r.remote}`)),a.ok(void 0)},A=m.createTrigger({handler:T,adaptInput:C,adaptOutput:x}),S=async e=>{let r=g(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=p("release-tag",r);return await A(s)};export{A as handleCli,S as main,P as pushReleaseTag,T as pushReleaseTagHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as E}from"./chunk-L32KHQVT.js";import{
|
|
2
|
+
import{h as E}from"./chunk-L32KHQVT.js";import{q as y,s as C}from"./chunk-QL5FA3P3.js";import{e as f,g as h,h as S,i as g}from"./chunk-KNIM3QST.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as w}from"./chunk-SHN5MT56.js";import{d as l,f as a,g as m}from"./chunk-YVN2NZL4.js";import{a as p,b as n}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 k=>{let e=d({renderer:w.ansi(),sink:u.stdout()}),r=c.process.cwd(),i=h(k);if(!i.ok)return e.writeln(a(i.error)),await e.close(),n({exitCode:1});let t;try{t=await f(r,i.spec)}catch(o){let x=o instanceof Error?o.message:String(o);return e.writeln(a(x)),await e.close(),n({exitCode:1})}if(t.phase!=="COMPLETED")return e.writeln(a(`Cannot reopen in phase: ${t.phase}`)),e.writeln(l("Only COMPLETED specs can be reopened.")),await e.close(),n({exitCode:1});let v=await E(r),s=y(t);return s=C(s,"COMPLETED","DISCOVERY",v,"reopened"),await S(r,s),s.spec!==null&&await g(r,s.spec,s),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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{v as I}from"./chunk-QL5FA3P3.js";import{c as h,e as g,g as y,h as S,i as k}from"./chunk-KNIM3QST.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-SHN5MT56.js";import{d as a,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as l}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var E=async A=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),i=p.process.cwd(),o=y(A);if(!o.ok)return e.writeln(n(o.error)),await e.close(),l({exitCode:1});let s;try{s=await g(i,o.spec)}catch(r){let $=r instanceof Error?r.message:String(r);return e.writeln(n($)),await e.close(),l({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${i}/${h.specDir(s.spec)}`;try{await p.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(a("Resetting to idle anyway."))}}let t=s.spec,m=I(s);return await S(i,m),t!==null&&await k(i,t,m),e.writeln(d("\u2714")," Reset to idle."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{E as main};
|