eser 4.1.40 → 4.1.41
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/{add-V7YYHLFH.js → add-IM5JC6QA.js} +1 -1
- package/chunks/approve-RQVNTLFH.js +2 -0
- package/chunks/{ask-PMB64QWG.js → ask-UTEI7KGQ.js} +1 -1
- package/chunks/block-3NE7YTL7.js +2 -0
- package/chunks/{build-HUKFUVPB.js → build-IRLEBMJE.js} +2 -2
- package/chunks/cancel-W5FDMXFI.js +2 -0
- package/chunks/{changelog-gen-JV3EHOMV.js → changelog-gen-USXHO6PE.js} +1 -1
- package/chunks/{chunk-VIQLCQOI.js → chunk-2BEIAJ5J.js} +1 -1
- package/chunks/{chunk-XYUJCTPP.js → chunk-2N62LL55.js} +1 -1
- package/chunks/{chunk-OPPOHKNZ.js → chunk-2OKCK56H.js} +1 -1
- package/chunks/{chunk-HTJLIAH4.js → chunk-2UHHAPKY.js} +1 -1
- package/chunks/{chunk-NZRU3N6C.js → chunk-3LDGQFQZ.js} +1 -1
- package/chunks/chunk-3PBNSBPA.js +12 -0
- package/chunks/{chunk-NJUIBCQR.js → chunk-3U5M6YO6.js} +1 -1
- package/chunks/{chunk-F5HQDZLN.js → chunk-4COCZPO5.js} +1 -1
- package/chunks/{chunk-BWDCKK63.js → chunk-4EJVA4QA.js} +1 -1
- package/chunks/{chunk-ECY4MUD3.js → chunk-5MVJUALI.js} +1 -1
- package/chunks/{chunk-AMMTAUXC.js → chunk-5Y5VGPYR.js} +1 -1
- package/chunks/chunk-6SSSHLEY.js +2 -0
- package/chunks/{chunk-HP5W5XT6.js → chunk-6V6C6MWY.js} +1 -1
- package/chunks/{chunk-WJKE6XHF.js → chunk-6VHZQNHX.js} +1 -1
- package/chunks/{chunk-UMKCOU3N.js → chunk-7RL5ZFGE.js} +1 -1
- package/chunks/{chunk-F35K7YVH.js → chunk-BNMKKNLB.js} +1 -1
- package/chunks/{chunk-OAFB4A6D.js → chunk-BSV66I74.js} +1 -1
- package/chunks/{chunk-DWLFTRZS.js → chunk-CXTPYPO4.js} +1 -1
- package/chunks/{chunk-5RX5V5BA.js → chunk-DRCKMHUI.js} +1 -1
- package/chunks/{chunk-4EHAL3NK.js → chunk-E423U2PP.js} +1 -1
- package/chunks/chunk-ENNZWOEX.js +4 -0
- package/chunks/{chunk-MBCPGD5L.js → chunk-EXP2TZZC.js} +1 -1
- package/chunks/{chunk-TEOMM3RD.js → chunk-GKOMIH2B.js} +1 -1
- package/chunks/{chunk-BBOEAL63.js → chunk-H5GHXMIT.js} +1 -1
- package/chunks/{chunk-MOY4CXAZ.js → chunk-H6HLRKRK.js} +2 -2
- package/chunks/chunk-H7FWYKMD.js +82 -0
- package/chunks/{chunk-YEWODYET.js → chunk-H7U2VQCK.js} +1 -1
- package/chunks/{chunk-L7UCWRDZ.js → chunk-IBB6UZR2.js} +1 -1
- package/chunks/{chunk-AHKNU2JM.js → chunk-IBBGWXAI.js} +1 -1
- package/chunks/{chunk-ZWMJQZQF.js → chunk-IQQEVKBP.js} +1 -1
- package/chunks/{chunk-WILZ4OR2.js → chunk-IWXI3UYI.js} +1 -1
- package/chunks/{chunk-H2O5G3XB.js → chunk-JZ7DUWYC.js} +1 -1
- package/chunks/{chunk-EGMYM4TM.js → chunk-KZAPWWOT.js} +1 -1
- package/chunks/{chunk-4FGLERUG.js → chunk-L7RS6MQ5.js} +1 -1
- package/chunks/{chunk-3IZX4OZ7.js → chunk-LSET5TD3.js} +1 -1
- package/chunks/{chunk-WAEXOK7L.js → chunk-LYKN5EIM.js} +1 -1
- package/chunks/{chunk-ZC4F4MYU.js → chunk-MBG7SPPO.js} +1 -1
- package/chunks/{chunk-OAT2D23A.js → chunk-MPGRKZIA.js} +1 -1
- package/chunks/{chunk-MQ4EMT35.js → chunk-OEUVCV5C.js} +1 -1
- package/chunks/chunk-OM5GSS2H.js +7 -0
- package/chunks/{chunk-L2E2H7YT.js → chunk-OWQXQ33F.js} +1 -1
- package/chunks/{chunk-RVJZFWN7.js → chunk-QD46ROBD.js} +1 -1
- package/chunks/{chunk-HVTJ5LVU.js → chunk-QMRKAC6C.js} +1 -1
- package/chunks/{chunk-ILROPD5P.js → chunk-QYMHLTVT.js} +1 -1
- package/chunks/{chunk-KEOTIPA6.js → chunk-RFHWH6ZX.js} +1 -1
- package/chunks/{chunk-TLVGNOK3.js → chunk-RIOYVPPP.js} +1 -1
- package/chunks/{chunk-OWV223WQ.js → chunk-SF6FT44C.js} +1 -1
- package/chunks/{chunk-QFFGKP3M.js → chunk-SH4H7OLV.js} +1 -1
- package/chunks/{chunk-T4WKRBQZ.js → chunk-SK6QUPJR.js} +1 -1
- package/chunks/{chunk-O2TA7OHJ.js → chunk-SMKZDN2Q.js} +1 -1
- package/chunks/{chunk-DKFL6XPX.js → chunk-TELZ2ZFI.js} +1 -1
- package/chunks/{chunk-4QDEJUAF.js → chunk-TYLYMZQC.js} +1 -1
- package/chunks/{chunk-ULNEO3RY.js → chunk-UQRZJPYH.js} +1 -1
- package/chunks/{chunk-3AA3RXKD.js → chunk-V3NJTF2Y.js} +1 -1
- package/chunks/{chunk-K2MKYDPY.js → chunk-V6YI7YJ4.js} +1 -1
- package/chunks/{chunk-LBMJGMDD.js → chunk-VE6XM5OZ.js} +1 -1
- package/chunks/{chunk-A6K5L4SG.js → chunk-VNJJQED3.js} +1 -1
- package/chunks/{chunk-3QF3I2RD.js → chunk-VVWAUS3D.js} +1 -1
- package/chunks/{chunk-CMSPX2RN.js → chunk-WPOZMPUR.js} +1 -1
- package/chunks/{chunk-2KKLYXSA.js → chunk-WWI6727S.js} +1 -1
- package/chunks/{chunk-PXCM4FHO.js → chunk-XOSAN6PX.js} +1 -1
- package/chunks/{chunk-MEZCXQAX.js → chunk-YJ3ICGHV.js} +1 -1
- package/chunks/{chunk-P72TUTYK.js → chunk-YURNTYEP.js} +1 -1
- package/chunks/{chunk-U5Q5MC74.js → chunk-Z2LXZLZV.js} +1 -1
- package/chunks/{chunk-QXATB6Z5.js → chunk-ZEFYMWGZ.js} +1 -1
- package/chunks/{chunk-5224ZYEW.js → chunk-ZRUM5PE7.js} +1 -1
- package/chunks/claude-code-VX2T4YII.js +2 -0
- package/chunks/{clone-YEBQK7CG.js → clone-DSVKII72.js} +1 -1
- package/chunks/{cmd-2DAVTVOF.js → cmd-YU4MVRRR.js} +1 -1
- package/chunks/{commitmsg-FQ3IZ3TH.js → commitmsg-FS52L6J5.js} +2 -2
- package/chunks/{concern-TIGYH5DX.js → concern-BWZV4KBS.js} +1 -1
- package/chunks/{deno-XQHOVHKR.js → deno-I5YAWOB6.js} +1 -1
- package/chunks/{dev-BNGJJR2O.js → dev-QZF2X7YC.js} +2 -2
- package/chunks/done-44REMKQ4.js +2 -0
- package/chunks/{file-tools-shared-KBTCO2FV.js → file-tools-shared-LMF72D6S.js} +1 -1
- package/chunks/{gh-Q7VEABJS.js → gh-FKZHTNFN.js} +2 -2
- package/chunks/{gh-contributors-4KGARSNL.js → gh-contributors-3MFKDSG3.js} +1 -1
- package/chunks/{init-45ODFAV3.js → init-RIVFJ2HP.js} +1 -1
- package/chunks/{init-RV7K5JC4.js → init-ZOMBOUG3.js} +3 -3
- package/chunks/{install-6XIQS5E7.js → install-WD65EAID.js} +1 -1
- package/chunks/{invoke-hook-Q3NMJXDO.js → invoke-hook-CPYBTKLO.js} +3 -3
- package/chunks/kiro-JGEZGFF3.js +2 -0
- package/chunks/{list-NYLFIF2U.js → list-NS7ECFDY.js} +1 -1
- package/chunks/{list-UQMPOF5Y.js → list-PSLAM3H6.js} +1 -1
- package/chunks/{list-BOLPKAEY.js → list-XFPTCIMR.js} +1 -1
- package/chunks/{load-config-G4DHKB5K.js → load-config-OGSPRY4L.js} +1 -1
- package/chunks/{main-236QYA7G.js → main-BUEG2IMJ.js} +2 -2
- package/chunks/{manifest-3VJ4O6HR.js → manifest-4EA74HMS.js} +1 -1
- package/chunks/{mod-QWYXFGRG.js → mod-2PIV6QCE.js} +1 -1
- package/chunks/{mod-IHYN4TEM.js → mod-ERJSLSPA.js} +2 -2
- package/chunks/{mod-DXA25A4J.js → mod-G7PJEGW6.js} +1 -1
- package/chunks/{mod-YH5Z6G4Q.js → mod-II7CSZUT.js} +1 -1
- package/chunks/mod-JWUOEEMP.js +2 -0
- package/chunks/{mod-BQJDMCYC.js → mod-KTGLCC3R.js} +1 -1
- package/chunks/{mod-GSWVSC2C.js → mod-Q6SI6S6S.js} +1 -1
- package/chunks/{mod-EWLBSEHA.js → mod-RO7WP3SA.js} +1 -1
- package/chunks/{mod-PZSJGUM7.js → mod-U2MNO6EC.js} +1 -1
- package/chunks/{mod-IXVUQHXS.js → mod-WOZXOD2F.js} +1 -1
- package/chunks/{mod-SXL6PDQM.js → mod-XEK7FROU.js} +1 -1
- package/chunks/{new-U5U4E6HR.js → new-3ZN4U7FJ.js} +1 -1
- package/chunks/next-QNLI4Z6Y.js +9 -0
- package/chunks/ollama-LD6OENM2.js +2 -0
- package/chunks/opencode-ECTBCC3O.js +2 -0
- package/chunks/{purge-RM6OD5PV.js → purge-565VM3XK.js} +1 -1
- package/chunks/{recipe-applier-TTZEZGSC.js → recipe-applier-6SGY2W3A.js} +1 -1
- package/chunks/{registry-fetcher-SPENFEOH.js → registry-fetcher-H63ZWZHU.js} +1 -1
- package/chunks/{release-UEX6YK4K.js → release-6I5TL34I.js} +2 -2
- package/chunks/{release-notes-GA7CTA54.js → release-notes-GJ4EBMTD.js} +1 -1
- package/chunks/{release-tag-VJWBXG5G.js → release-tag-IOH5HGAA.js} +1 -1
- package/chunks/reopen-T5ZROS7Y.js +2 -0
- package/chunks/reset-EDANY7W4.js +2 -0
- package/chunks/{rule-ZQOGLQQI.js → rule-SMPE3A72.js} +1 -1
- package/chunks/{run-L35K3KRF.js → run-FGMEIO57.js} +1 -1
- package/chunks/run-VPRSGIHR.js +4 -0
- package/chunks/{scripts-VI2TKQOH.js → scripts-L2FZBUHU.js} +1 -1
- package/chunks/{serve-AVVEYGQB.js → serve-R7XGF4EL.js} +2 -2
- package/chunks/{server-R347ON4B.js → server-KJW4HWK7.js} +1 -1
- package/chunks/spec-WGXL4BOE.js +2 -0
- package/chunks/status-65FD7MJB.js +2 -0
- package/chunks/{sync-PB4KWB3R.js → sync-EIMJAEA7.js} +1 -1
- package/chunks/{system-KMRRIKMQ.js → system-5OWRHFDI.js} +1 -1
- package/chunks/{system-BXJ2LV5O.js → system-X4X6JD4X.js} +1 -1
- package/chunks/{update-522VXIKX.js → update-CV7JPZGM.js} +1 -1
- package/chunks/validate-bom-5IPW3R4O.js +2 -0
- package/chunks/validate-case-conflict-5XOPS6HD.js +2 -0
- package/chunks/validate-circular-deps-WME7VUO4.js +2 -0
- package/chunks/validate-commit-msg-MEQH6ADP.js +2 -0
- package/chunks/validate-docs-LBWVCSN2.js +2 -0
- package/chunks/validate-eof-56S7THGQ.js +2 -0
- package/chunks/validate-export-names-YJGQHPGF.js +2 -0
- package/chunks/validate-filenames-DJF7GO3C.js +2 -0
- package/chunks/validate-json-2OMEH67D.js +2 -0
- package/chunks/validate-large-files-OE4P7FD7.js +2 -0
- package/chunks/validate-licenses-BNEQDBKC.js +2 -0
- package/chunks/validate-line-endings-PHV2ZK7V.js +2 -0
- package/chunks/validate-merge-conflict-XN3376IV.js +2 -0
- package/chunks/validate-mod-exports-D2Q5GV76.js +2 -0
- package/chunks/{validate-package-configs-3Y55ZLUY.js → validate-package-configs-ZO5YJE2D.js} +1 -1
- package/chunks/validate-secrets-ZMBKEXOK.js +2 -0
- package/chunks/validate-shebangs-3OR2L3RH.js +2 -0
- package/chunks/validate-submodules-HIYYVQDP.js +2 -0
- package/chunks/validate-symlinks-QMLLO5R3.js +2 -0
- package/chunks/validate-toml-U77NIEDN.js +2 -0
- package/chunks/validate-trailing-whitespace-UE7AOZEZ.js +2 -0
- package/chunks/validate-yaml-UX2VQJJT.js +2 -0
- package/chunks/versions-OKK45EDV.js +2 -0
- package/chunks/watch-Y3ARCBAW.js +9 -0
- package/chunks/wontfix-FSTUJ7T6.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-HVIH2A3C.js +0 -2
- package/chunks/block-JSK5CJPO.js +0 -2
- package/chunks/chunk-7UASU4NU.js +0 -10
- package/chunks/chunk-A3JJKZ4C.js +0 -4
- package/chunks/chunk-JI536JLJ.js +0 -2
- package/chunks/chunk-NEHZOG23.js +0 -7
- package/chunks/chunk-RGUPFAEE.js +0 -68
- package/chunks/claude-code-ELUDT5TV.js +0 -2
- package/chunks/done-GGPPHJW2.js +0 -2
- package/chunks/kiro-NZ7LM6HA.js +0 -2
- package/chunks/mod-L26IBE5V.js +0 -2
- package/chunks/next-AQ4TIEL7.js +0 -9
- package/chunks/ollama-LHWMXMLY.js +0 -2
- package/chunks/opencode-24O2MW3L.js +0 -2
- package/chunks/reset-WHYTPTFB.js +0 -2
- package/chunks/run-IX74MQTI.js +0 -4
- package/chunks/spec-KMKZDLV2.js +0 -2
- package/chunks/status-MLX4O37A.js +0 -2
- package/chunks/validate-bom-JCMRVAUT.js +0 -2
- package/chunks/validate-case-conflict-WZQCMKSZ.js +0 -2
- package/chunks/validate-circular-deps-7R4F2YDV.js +0 -2
- package/chunks/validate-commit-msg-PH7Y3JEI.js +0 -2
- package/chunks/validate-docs-WCIOHNYP.js +0 -2
- package/chunks/validate-eof-KRYQLTFQ.js +0 -2
- package/chunks/validate-export-names-OCQ2XSY6.js +0 -2
- package/chunks/validate-filenames-46O7FCXF.js +0 -2
- package/chunks/validate-json-3EZ2L64H.js +0 -2
- package/chunks/validate-large-files-7YX6MSOB.js +0 -2
- package/chunks/validate-licenses-OC7JRVAH.js +0 -2
- package/chunks/validate-line-endings-2DM5UGCJ.js +0 -2
- package/chunks/validate-merge-conflict-UDMWYMJ5.js +0 -2
- package/chunks/validate-mod-exports-W24IV367.js +0 -2
- package/chunks/validate-secrets-66VXCCUF.js +0 -2
- package/chunks/validate-shebangs-AMEAHVLB.js +0 -2
- package/chunks/validate-submodules-DYCE27WK.js +0 -2
- package/chunks/validate-symlinks-QN744GUH.js +0 -2
- package/chunks/validate-toml-5K2XNHAE.js +0 -2
- package/chunks/validate-trailing-whitespace-QYWHHIAK.js +0 -2
- package/chunks/validate-yaml-VGKLHEAQ.js +0 -2
- package/chunks/versions-FYALONNL.js +0 -2
- package/chunks/watch-P56QT3Q2.js +0 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as E}from"./chunk-
|
|
3
|
-
`)),f.releaseLock()}catch{}}}return o(void 0)}let y={DISCOVERY:`Discovery in progress. Run \`${h("next")}\` to continue.`,DISCOVERY_REVIEW:`Discovery answers need review. Run \`${h('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`Spec needs review. Run \`${h("approve")}\``,SPEC_APPROVED:`Start execution first: \`${h('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${h('next --answer="resolution"')}\``};return await a(y[u]??`Run \`${h("next")}\` first.`),o(void 0)},
|
|
2
|
+
import{d as E}from"./chunk-3PBNSBPA.js";import"./chunk-OCPEFZBJ.js";import{a as C}from"./chunk-H7FWYKMD.js";import{c as g,d as $,l as S,p as D,s as v}from"./chunk-OM5GSS2H.js";import{c as h}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{a as o}from"./chunk-FFWPJP7A.js";import{i as n}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var F=new Map([["git stash",["list","show"]],["git tag",["-l","--list","-v","--verify"]],["git branch",["--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"]]]),T=e=>{let s=e.trim();for(let[t,i]of F)if(s.startsWith(t)){let r=s.slice(t.length).trim().split(/\s+/)[0]??"";if(i.includes(r))return!0}return!1};var x=async()=>{let e=n.process.stdin.getReader(),s=[];try{for(;;){let{done:r,value:a}=await e.read();if(r||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,i=new Uint8Array(s.reduce((r,a)=>r+a.length,0));for(let r of s)i.set(r,t),t+=r.length;let l=new TextDecoder().decode(i);try{return JSON.parse(l)}catch{return{}}},O=async e=>{let s=new TextEncoder,t=n.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},L=async e=>{switch(e?.[0]){case"pre-tool-use":return await P();case"stop":return await N();case"post-file-write":return await b();case"post-bash":return await A();case"session-start":return await W();default:return o(void 0)}},P=async()=>{let e=await x(),s=e.tool_name??"unknown",t=e.tool_input??{},i=e.cwd??n.process.cwd(),l=await S(i),r={};try{r=await $(i)}catch{return o(void 0)}let a=async c=>{await O({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${c}`}})};if(s==="Bash"){let c=(t.command??"").trim();if(!(l?.allowGit??!1)){let f=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let w of f){let m="";if(c.startsWith(w))m=c.split(/\s*&&\s*|\s*;\s*/)[0]??c;else if(c.includes(` && ${w}`))m=c.split(/\s*&&\s*/).find(R=>R.trim().startsWith(w))??"";else if(c.includes(`; ${w}`))m=c.split(/\s*;\s*/).find(R=>R.trim().startsWith(w))??"";else continue;if(!T(m.trim()))return await a("git is read-only for agents. The user controls git. You may use `git log`, `git diff`, `git status`, `git show`, `git blame`."),o(void 0)}}return o(void 0)}let p=["Write","Edit","MultiEdit"];if(!p.includes(s))return o(void 0);let k=t.file_path??t.path??"";if(k.includes(".eser/")||k.includes(".claude/"))return o(void 0);let u=r.phase??"UNKNOWN";if(u==="EXECUTING"||u==="IDLE"||u==="COMPLETED"||u==="UNKNOWN"){if(u==="EXECUTING"&&p.includes(s)){let c=`${i}/${g.stateDir}/executor-warned.flag`;try{await n.fs.readTextFile(c)}catch{try{await n.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0}),await n.fs.writeTextFile(c,new Date().toISOString());let d=new TextEncoder,f=n.process.stderr.getWriter();await f.write(d.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
|
|
3
|
+
`)),f.releaseLock()}catch{}}}return o(void 0)}let y={DISCOVERY:`Discovery in progress. Run \`${h("next")}\` to continue.`,DISCOVERY_REVIEW:`Discovery answers need review. Run \`${h('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`Spec needs review. Run \`${h("approve")}\``,SPEC_APPROVED:`Start execution first: \`${h('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${h('next --answer="resolution"')}\``};return await a(y[u]??`Run \`${h("next")}\` first.`),o(void 0)},N=async()=>{let e=await x();if(e.stop_hook_active===!0)return o(void 0);let s=e.cwd??n.process.cwd(),t;try{let d=await n.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(d)}catch{return o(void 0)}if(t.phase!=="EXECUTING")return o(void 0);let i=t.execution??{},l=`${s}/${g.stateDir}/files-changed.jsonl`,r=[];try{let f=(await n.fs.readTextFile(l)).trim().split(`
|
|
4
4
|
`).filter(Boolean);r=[...new Set(f.map(w=>{try{return JSON.parse(w).file}catch{return null}}).filter(w=>w!==null))]}catch{}let a=[],p="no changes";try{let{execSync:d}=await import("node:child_process");a=d("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
5
5
|
`).filter(Boolean);let m=d("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
6
6
|
`);p=m[m.length-1]??"no changes"}catch{}let k=[...new Set([...r,...a])],u=(i.iteration??0)+1,y=`${s}/${g.stateDir}/iterations`;try{await n.fs.mkdir(y,{recursive:!0}),await n.fs.writeTextFile(`${y}/iteration-${u}.json`,JSON.stringify({iteration:u,files:k,gitStat:p.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
@@ -8,4 +8,4 @@ import{d as E}from"./chunk-7UASU4NU.js";import"./chunk-OCPEFZBJ.js";import{a as
|
|
|
8
8
|
`)}catch{}try{await n.fs.writeTextFile(l,"")}catch{}try{await n.fs.remove(`${s}/${g.stateDir}/executor-warned.flag`)}catch{}if(u>=c){let d=new TextEncoder,f=n.process.stderr.getWriter();await f.write(d.encode(`noskills: iteration ${u} reached threshold (${c}). Consider starting a fresh conversation.
|
|
9
9
|
`)),f.releaseLock()}return o(void 0)},b=async()=>{let e=await x(),s=e.tool_input??{},t=s.file_path??s.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return o(void 0);let i=e.cwd??n.process.cwd(),l=`${i}/${g.stateDir}/files-changed.jsonl`,r=JSON.stringify({file:t,tool:e.tool_name,ts:new Date().toISOString()});try{await n.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let a="";try{a=await n.fs.readTextFile(l)}catch{}await n.fs.writeTextFile(l,a+r+`
|
|
10
10
|
`)}catch{}return o(void 0)},A=async()=>{let e=await x(),t=(e.tool_input??{}).command??"";if(!t.includes("noskills"))return o(void 0);let i=e.cwd??n.process.cwd(),l=`${i}/${g.stateDir}/noskills-calls.jsonl`,r=JSON.stringify({command:t,ts:new Date().toISOString()});try{await n.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let a="";try{a=await n.fs.readTextFile(l)}catch{}await n.fs.writeTextFile(l,a+r+`
|
|
11
|
-
`)}catch{}return o(void 0)},W=async()=>{let e=n.process.cwd();if(!await v(e))return o(void 0);let s=await $(e),t=await S(e),l=(await D(e)).filter(p=>t!==null&&t.concerns.includes(p.id)),r=await C(e),a=E(s,l,r,t);return await
|
|
11
|
+
`)}catch{}return o(void 0)},W=async()=>{let e=n.process.cwd();if(!await v(e))return o(void 0);let s=await $(e),t=await S(e),l=(await D(e)).filter(p=>t!==null&&t.concerns.includes(p.id)),r=await C(e),a=E(s,l,r,t);return await O(a),o(void 0)};export{L as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-IBBGWXAI.js";import"./chunk-YURNTYEP.js";import"./chunk-J7YTWK67.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as KiroModel,b as kiroFactory};
|
|
@@ -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-H7U2VQCK.js";import"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-MBG7SPPO.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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,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-XOSAN6PX.js";import{f as o,h as m,k as d}from"./chunk-MBG7SPPO.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R,d as h}from"./chunk-P2MUEKFT.js";import{k as S}from"./chunk-
|
|
2
|
+
import{a as R,d as h}from"./chunk-P2MUEKFT.js";import{k as S}from"./chunk-GKOMIH2B.js";import{f as m,h as f,k as y}from"./chunk-MBG7SPPO.js";import{c as p,d as l,k as d}from"./chunk-YVN2NZL4.js";import{a as u}from"./chunk-MG65QJY6.js";import{a as n,b as o,c as g}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var w=["project","structure","utility"],C={project:"PROJECTS",structure:"STRUCTURES",utility:"UTILITIES"},k=t=>R(async r=>{try{let s=await S(t.registrySource,{local:t.local}),e=[...s.recipes];if(t.language!==void 0&&(e=e.filter(i=>i.language===t.language)),t.scale!==void 0&&(e=e.filter(i=>i.scale===t.scale)),t.tag!==void 0&&(e=e.filter(i=>i.tags!==void 0&&i.tags.includes(t.tag))),e.length===0)return r.out.writeln("No recipes found matching your filters."),r.out.writeln("Run ",l("`eser kit list`")," without filters to see all recipes."),n({manifest:s,recipes:e});r.out.writeln(p(`${s.name} \u2014 ${s.description}`)),r.out.writeln();for(let i of w){let c=e.filter(a=>a.scale===i);if(c.length!==0){r.out.writeln(d(C[i]));for(let a of c)r.out.writeln(` ${a.name.padEnd(20)} ${a.description} `,l(`[${a.language}]`));r.out.writeln()}}return n({manifest:s,recipes:e})}catch(s){let e=s instanceof Error?s.message:String(s);return o({_tag:"RegistryError",message:e})}});var $=async t=>{let r=u(t??[],{string:["registry","language","scale","tag"],boolean:["local"]}),s=m({renderer:y.ansi(),sink:f.stdout()}),e=await h(k({registrySource:r.registry,language:r.language,scale:r.scale,tag:r.tag,local:r.local===!0}),{out:s});return await s.close(),g(e)?n(void 0):o({exitCode:1})};export{$ as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-SF6FT44C.js";import"./chunk-GTHXGAMQ.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as loadConfig};
|
|
@@ -1,6 +1,6 @@
|
|
|
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-H6HLRKRK.js";import"./chunk-V6YI7YJ4.js";import"./chunk-VVWAUS3D.js";import"./chunk-LSET5TD3.js";import{a as Q}from"./chunk-SF6FT44C.js";import"./chunk-VNJJQED3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-VAIRJES2.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-5MVJUALI.js";import"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import{m as W}from"./chunk-BQT5RJZB.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>';
|
|
6
|
-
`,d={version:"1.0",buildId:"runtime-error",timestamp:Date.now(),logLevel:"error",entrypoint:"__runtime_bundle.js",hmrEnabled:!1,chunks:{},files:{}};return{code:a,manifest:d}}finally{try{await s.fs.remove(o,{recursive:!0})}catch(i){A.debug("Temp directory cleanup failed",{error:i})}}}clear(){this.clientComponents.clear(),this.moduleMap=null,this.bundleCode=null,this.lastScan=0}};var D=class{cache;constructor(e){this.cache=new _(e)}async getBundle(){let e=await this.cache.getOrCreateBundle();return{clientCode:e.clientCode,moduleMap:e.moduleMap,chunkManifest:e.chunkManifest,entrypoint:"/__runtime_bundle.js"}}async getRuntimeBundle(){return await this.cache.getOrCreateBundle()}async rebuild(){await this.cache.rebuild()}clear(){this.cache.clear()}};var Z={name:"noop",renderPage:()=>Promise.resolve({html:""}),renderRSC:()=>Promise.resolve(new Response("")),generateBootstrapScript:()=>""};var ee={name:"noop",createShell:()=>"<!DOCTYPE html><html><head></head><body></body></html>",createStreamingStart:()=>"<!DOCTYPE html><html><head></head><body>",createStreamingEnd:()=>"</body></html>"};var b=m.getLogger(["laroux-server","hmr"]),$=class{clients=new Set;handleConnection(e){this.clients.add(e),b.debug(`HMR client connected (${this.clients.size} total)`),this.sendToClient(e,{type:"connected"}),e.addEventListener("close",()=>{this.clients.delete(e),b.debug(`HMR client disconnected (${this.clients.size} remaining)`)}),e.addEventListener("error",t=>{b.error("HMR WebSocket error:",{event:t}),this.clients.delete(e)})}notifyUpdate(e=Date.now(),t){let r={type:"update",timestamp:e,changedModules:t};b.debug(`Notifying ${this.clients.size} clients of update${t?` (${t.length} modules changed)`:""}`);for(let o of this.clients)this.sendToClient(o,r)}notifyError(e){let t={type:"error",message:e};b.warn(`Notifying clients of error: ${e}`);for(let r of this.clients)this.sendToClient(r,t)}sendToClient(e,t){if(e.readyState===WebSocket.OPEN)try{e.send(JSON.stringify(t))}catch(r){b.error("Failed to send HMR message:",{error:r})}}getClientCount(){return this.clients.size}close(){for(let e of this.clients)e.close();this.clients.clear()}};var L=m.getLogger(["laroux-server","api-handler"]);function ie(n){let e=new Set;return{pattern:n.replace(/\[\.\.\.(\w+)\]/g,(r,o)=>(e.add(o),`:${o}*`)).replace(/\[(\w+)\]/g,(r,o)=>`:${o}`),catchAllParams:e}}function se(n,e){let{pattern:t,catchAllParams:r}=ie(e),i=new URLPattern({pathname:t}).exec({pathname:n});if(!i)return null;let l={},p=i.pathname.groups;for(let[u,a]of Object.entries(p))r.has(u)?l[u]=a?a.split("/").filter(Boolean):[]:l[u]=a??"";return l}var H=class{routes=[];moduleCache=new Map;registryDir="";async loadRoutes(e){try{let t=`file://${e}/server/api-routes.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.routes=r.apiRoutes||[],L.debug(`Loaded ${this.routes.length} API route(s)`)}catch{this.routes=[],L.debug("No API routes registry found")}}async handleRequest(e,t){let r=new URL(e.url),o=e.method;for(let i of this.routes){let l=se(t,i.path);if(l!==null){L.debug(`API route matched: ${o} ${t} -> ${i.path}`);try{let p=s.path.resolve(this.registryDir,i.modulePath),u=this.moduleCache.get(p);u||(u=await import(`file://${p}`),this.moduleCache.set(p,u));let a=u[o];return a?await a({request:e,params:l,searchParams:r.searchParams}):(L.debug(`Method ${o} not allowed for ${i.path}`),new Response("Method Not Allowed",{status:405,headers:{Allow:this.getAllowedMethods(u).join(", ")}}))}catch(p){return L.error(`API route error: ${i.path}`,{error:p}),new Response(JSON.stringify({error:"Internal Server Error"}),{status:500,headers:{"Content-Type":"application/json"}})}}}return null}getAllowedMethods(e){let t=[];return e.GET&&t.push("GET"),e.POST&&t.push("POST"),e.PUT&&t.push("PUT"),e.DELETE&&t.push("DELETE"),e.PATCH&&t.push("PATCH"),e.HEAD&&t.push("HEAD"),e.OPTIONS&&t.push("OPTIONS"),t}clearCache(){this.moduleCache.clear()}};var P=m.getLogger(["laroux-server","proxy-handler"]),T=class{proxies=[];moduleCache=new Map;registryDir="";async loadProxies(e){try{let t=`file://${e}/server/proxy-registry.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.proxies=r.proxyRegistry||[],P.debug(`Loaded ${this.proxies.length} proxy definition(s)`)}catch{this.proxies=[],P.debug("No proxy registry found")}}async runProxies(e,t){let r=t;for(let o of this.proxies)if(this.matchesPrefix(r,o.pathPrefix)){P.debug(`Running proxy: ${o.pathPrefix} for ${r}`);try{let i=s.path.resolve(this.registryDir,o.modulePath),l=this.moduleCache.get(i);l||(l=await import(`file://${i}`),this.moduleCache.set(i,l));let p=l.default;if(typeof p!="function"){P.warn(`Proxy ${o.modulePath} does not export a default function`);continue}let u=await p({request:e,pathname:r,params:{}});if(u.type==="response")return P.debug(`Proxy ${o.pathPrefix} returned response`),{result:u,finalPathname:r};if(u.type==="redirect")return P.debug(`Proxy ${o.pathPrefix} redirecting to ${u.url}`),{result:u,finalPathname:r};u.type==="rewrite"&&(P.debug(`Proxy ${o.pathPrefix} rewriting to ${u.pathname}`),r=u.pathname)}catch(i){return P.error(`Proxy error: ${o.pathPrefix}`,{error:i}),{result:{type:"response",response:new Response(JSON.stringify({error:"Proxy Error"}),{status:500,headers:{"Content-Type":"application/json"}})},finalPathname:r}}}return{result:{type:"next"},finalPathname:r}}matchesPrefix(e,t){return t==="/"?!0:e===t||e.startsWith(t+"/")}clearCache(){this.moduleCache.clear()}};function te(n,e){let t=X(n,e.path);if(t===null)return null;let r={};for(let[o,i]of Object.entries(t))Array.isArray(i)?r[o]=[...i]:typeof i=="string"&&(r[o]=i);return r}function U(n,e){for(let t of e){let r=te(n,t);if(r!==null)return{route:t,params:r}}return null}var le=["trace","debug","info","warn","error","fatal"];var oe="manifest.json",ue=n=>({trace:v.Debug,debug:v.Debug,info:v.Info,warn:v.Warning,error:v.Error,fatal:v.Critical})[n],R,E;async function pe(n){let e=ue(n),{output:t,renderers:r,sinks:o}=await import("./mod-YH5Z6G4Q.js"),i=t({renderer:r.ansi(),sink:o.stdout()});await G.configure({sinks:{console:V.getOutputSink(i)},loggers:[{category:["laroux-server"],lowestLevel:e,sinks:["console"]},{category:["laroux-bundler"],lowestLevel:e,sinks:["console"]},{category:["laroux"],lowestLevel:e,sinks:["console"]}]}),R=m.getLogger(["laroux-server","server"]),E=m.getLogger(["laroux-server","bundler"])}var O=null;function ot(){O=null}async function ce(n){if(O!==null)return O;let t=`file://${s.path.join(n.distDir,"server","_generated-routes.ts")}?t=${Date.now()}`,{generatedRoutes:r}=await import(t);return O=r,r}async function re(n,e){let t=s.path.resolve(n.distDir,"server","src","app",`${e}.js`);if(await s.fs.exists(t))return t;for(let r of Y){let o=s.path.resolve(n.distDir,"server","src","app",`${e}.${r}`);if(await s.fs.exists(o))return o}return t}async function ne(n,e){let t=Date.now(),o=`file://${await re(e,"layout")}?t=${t}`,{Layout:i}=await import(o),l=await ce(e),p=U(n,l);if(p===null){let a=`file://${await re(e,"not-found")}?t=${t}`,{NotFound:d}=await import(a);return{Layout:i,Page:d,params:{}}}return{Layout:i,Page:p.route.component,params:p.params}}async function de(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.readTextFile(e);return JSON.parse(t).buildId}catch{return"unknown"}}async function me(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.stat(e),r=await s.fs.stat(n.srcDir);return t.mtime===null||r.mtime===null?!1:t.mtime>r.mtime}catch{return!1}}function I(n){return{projectRoot:n.projectRoot,srcDir:n.srcDir,distDir:n.distDir,logLevel:n.logLevel,fonts:n.fonts,images:n.images,cssModuleTypes:n.cssModuleTypes,noCssModuleAutoReference:n.noCssModuleAutoReference,browserShims:n.browserShims,serverExternals:n.build.serverExternals}}async function ge(n,e={}){let{config:t,bundler:r,hmrManager:o}=n,{frameworkPlugin:i,cssPlugin:l}=e;try{let c=s.path.resolve(t.distDir,"server","actions-manifest.json");if(await s.fs.exists(c)){let x=await s.fs.readTextFile(c),z=JSON.parse(x),q=Date.now(),C=0;for(let J of z.actions)try{let k=s.path.resolve(t.distDir,"server",J);await s.fs.exists(k)&&(await import(`file://${k}?t=${q}`),C++)}catch(k){R.warn(`Failed to load action ${J}:`,{error:k})}C>0&&R.debug(`Server actions loaded: ${C} file(s)`)}else R.debug("No actions manifest found (optional)")}catch(c){R.warn("Failed to load server actions:",{error:c})}await ne("/",t);let p=await de(t);E.debug(`Build ID: ${p}`);let a={...n,getApp:c=>ne(c,t),buildId:p},d=await r.getBundle(),f={framework:i,css:l,bundlerBackend:"deno-bundler"};if(d.clientCode!==null&&o!==null){if(i!==void 0){let c=M(I(t),f);N(c,async y=>{if(r instanceof D)try{await r.rebuild()}catch(x){E.error("Compilation failed:",{error:x})}E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`),o?.notifyUpdate(Date.now(),y.changedFiles)})}}else if(t.mode.isWatch&&i!==void 0){let c=M(I(t),f);N(c,y=>{E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`)})}let h="";d.clientCode!==null&&o!==null?h=" HMR":d.clientCode!==null&&(h=" Watch"),R.info(`RSC Server${h}`),R.info(` Local: http://localhost:${t.server.port}`);let{startHTTPServer:g}=await import("./server-R347ON4B.js");return g(a),a}async function it(n){let e=n.projectRoot??s.process.cwd(),t=n.logLevel??"info",r=n.mode==="dev",{renderer:o,htmlShell:i,frameworkPlugin:l,cssPlugin:p}=n;await pe(t);let u=await Q(e),a={...u,srcDir:s.path.resolve(e,u.srcDir),distDir:s.path.resolve(e,u.distDir),publicDir:s.path.resolve(e,u.publicDir),logLevel:t,mode:{isDev:r,isBuild:!1,isServe:!r,isWatch:r}};n.port!==void 0&&(a.server.port=n.port),n.hmr!==void 0?a.server.hmr=n.hmr:r&&(a.server.hmr=!0),n.open!==void 0&&(a.server.open=n.open),r&&(a.build.minify=!1);let d=await me(a),f=r||!d,h={framework:l,css:p};if(f&&r&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"deno-bundler"});await F(C)}else if(f&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"rolldown"});await F(C)}let g,c=null;r&&a.server.hmr?(c=new $,g=new w({distDir:a.distDir})):g=new w({distDir:a.distDir});let y=new H;await y.loadRoutes(a.distDir);let x=new T;await x.loadProxies(a.distDir),await ge({config:a,bundler:g,hmrManager:c,apiHandler:y,middlewareDispatcher:x,renderer:o??Z,htmlShell:i??ee},{frameworkPlugin:l,cssPlugin:p}),n.open&&fe(`http://localhost:${a.server.port}`)}function fe(n){let e={darwin:["open"],linux:["xdg-open"],windows:["cmd","/c","start"]},t=W(),r=e[t];r&&r[0]&&s.exec.spawnChild(r[0],[...r.slice(1),n],{stdout:"null",stderr:"null"})}export{le as VALID_LOG_LEVELS,ot as clearRoutesCache,it as startServer};
|
|
6
|
+
`,d={version:"1.0",buildId:"runtime-error",timestamp:Date.now(),logLevel:"error",entrypoint:"__runtime_bundle.js",hmrEnabled:!1,chunks:{},files:{}};return{code:a,manifest:d}}finally{try{await s.fs.remove(o,{recursive:!0})}catch(i){A.debug("Temp directory cleanup failed",{error:i})}}}clear(){this.clientComponents.clear(),this.moduleMap=null,this.bundleCode=null,this.lastScan=0}};var D=class{cache;constructor(e){this.cache=new _(e)}async getBundle(){let e=await this.cache.getOrCreateBundle();return{clientCode:e.clientCode,moduleMap:e.moduleMap,chunkManifest:e.chunkManifest,entrypoint:"/__runtime_bundle.js"}}async getRuntimeBundle(){return await this.cache.getOrCreateBundle()}async rebuild(){await this.cache.rebuild()}clear(){this.cache.clear()}};var Z={name:"noop",renderPage:()=>Promise.resolve({html:""}),renderRSC:()=>Promise.resolve(new Response("")),generateBootstrapScript:()=>""};var ee={name:"noop",createShell:()=>"<!DOCTYPE html><html><head></head><body></body></html>",createStreamingStart:()=>"<!DOCTYPE html><html><head></head><body>",createStreamingEnd:()=>"</body></html>"};var b=m.getLogger(["laroux-server","hmr"]),$=class{clients=new Set;handleConnection(e){this.clients.add(e),b.debug(`HMR client connected (${this.clients.size} total)`),this.sendToClient(e,{type:"connected"}),e.addEventListener("close",()=>{this.clients.delete(e),b.debug(`HMR client disconnected (${this.clients.size} remaining)`)}),e.addEventListener("error",t=>{b.error("HMR WebSocket error:",{event:t}),this.clients.delete(e)})}notifyUpdate(e=Date.now(),t){let r={type:"update",timestamp:e,changedModules:t};b.debug(`Notifying ${this.clients.size} clients of update${t?` (${t.length} modules changed)`:""}`);for(let o of this.clients)this.sendToClient(o,r)}notifyError(e){let t={type:"error",message:e};b.warn(`Notifying clients of error: ${e}`);for(let r of this.clients)this.sendToClient(r,t)}sendToClient(e,t){if(e.readyState===WebSocket.OPEN)try{e.send(JSON.stringify(t))}catch(r){b.error("Failed to send HMR message:",{error:r})}}getClientCount(){return this.clients.size}close(){for(let e of this.clients)e.close();this.clients.clear()}};var L=m.getLogger(["laroux-server","api-handler"]);function ie(n){let e=new Set;return{pattern:n.replace(/\[\.\.\.(\w+)\]/g,(r,o)=>(e.add(o),`:${o}*`)).replace(/\[(\w+)\]/g,(r,o)=>`:${o}`),catchAllParams:e}}function se(n,e){let{pattern:t,catchAllParams:r}=ie(e),i=new URLPattern({pathname:t}).exec({pathname:n});if(!i)return null;let l={},p=i.pathname.groups;for(let[u,a]of Object.entries(p))r.has(u)?l[u]=a?a.split("/").filter(Boolean):[]:l[u]=a??"";return l}var H=class{routes=[];moduleCache=new Map;registryDir="";async loadRoutes(e){try{let t=`file://${e}/server/api-routes.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.routes=r.apiRoutes||[],L.debug(`Loaded ${this.routes.length} API route(s)`)}catch{this.routes=[],L.debug("No API routes registry found")}}async handleRequest(e,t){let r=new URL(e.url),o=e.method;for(let i of this.routes){let l=se(t,i.path);if(l!==null){L.debug(`API route matched: ${o} ${t} -> ${i.path}`);try{let p=s.path.resolve(this.registryDir,i.modulePath),u=this.moduleCache.get(p);u||(u=await import(`file://${p}`),this.moduleCache.set(p,u));let a=u[o];return a?await a({request:e,params:l,searchParams:r.searchParams}):(L.debug(`Method ${o} not allowed for ${i.path}`),new Response("Method Not Allowed",{status:405,headers:{Allow:this.getAllowedMethods(u).join(", ")}}))}catch(p){return L.error(`API route error: ${i.path}`,{error:p}),new Response(JSON.stringify({error:"Internal Server Error"}),{status:500,headers:{"Content-Type":"application/json"}})}}}return null}getAllowedMethods(e){let t=[];return e.GET&&t.push("GET"),e.POST&&t.push("POST"),e.PUT&&t.push("PUT"),e.DELETE&&t.push("DELETE"),e.PATCH&&t.push("PATCH"),e.HEAD&&t.push("HEAD"),e.OPTIONS&&t.push("OPTIONS"),t}clearCache(){this.moduleCache.clear()}};var P=m.getLogger(["laroux-server","proxy-handler"]),T=class{proxies=[];moduleCache=new Map;registryDir="";async loadProxies(e){try{let t=`file://${e}/server/proxy-registry.ts`;this.registryDir=s.path.resolve(e,"server");let r=await import(t);this.proxies=r.proxyRegistry||[],P.debug(`Loaded ${this.proxies.length} proxy definition(s)`)}catch{this.proxies=[],P.debug("No proxy registry found")}}async runProxies(e,t){let r=t;for(let o of this.proxies)if(this.matchesPrefix(r,o.pathPrefix)){P.debug(`Running proxy: ${o.pathPrefix} for ${r}`);try{let i=s.path.resolve(this.registryDir,o.modulePath),l=this.moduleCache.get(i);l||(l=await import(`file://${i}`),this.moduleCache.set(i,l));let p=l.default;if(typeof p!="function"){P.warn(`Proxy ${o.modulePath} does not export a default function`);continue}let u=await p({request:e,pathname:r,params:{}});if(u.type==="response")return P.debug(`Proxy ${o.pathPrefix} returned response`),{result:u,finalPathname:r};if(u.type==="redirect")return P.debug(`Proxy ${o.pathPrefix} redirecting to ${u.url}`),{result:u,finalPathname:r};u.type==="rewrite"&&(P.debug(`Proxy ${o.pathPrefix} rewriting to ${u.pathname}`),r=u.pathname)}catch(i){return P.error(`Proxy error: ${o.pathPrefix}`,{error:i}),{result:{type:"response",response:new Response(JSON.stringify({error:"Proxy Error"}),{status:500,headers:{"Content-Type":"application/json"}})},finalPathname:r}}}return{result:{type:"next"},finalPathname:r}}matchesPrefix(e,t){return t==="/"?!0:e===t||e.startsWith(t+"/")}clearCache(){this.moduleCache.clear()}};function te(n,e){let t=X(n,e.path);if(t===null)return null;let r={};for(let[o,i]of Object.entries(t))Array.isArray(i)?r[o]=[...i]:typeof i=="string"&&(r[o]=i);return r}function U(n,e){for(let t of e){let r=te(n,t);if(r!==null)return{route:t,params:r}}return null}var le=["trace","debug","info","warn","error","fatal"];var oe="manifest.json",ue=n=>({trace:v.Debug,debug:v.Debug,info:v.Info,warn:v.Warning,error:v.Error,fatal:v.Critical})[n],R,E;async function pe(n){let e=ue(n),{output:t,renderers:r,sinks:o}=await import("./mod-II7CSZUT.js"),i=t({renderer:r.ansi(),sink:o.stdout()});await G.configure({sinks:{console:V.getOutputSink(i)},loggers:[{category:["laroux-server"],lowestLevel:e,sinks:["console"]},{category:["laroux-bundler"],lowestLevel:e,sinks:["console"]},{category:["laroux"],lowestLevel:e,sinks:["console"]}]}),R=m.getLogger(["laroux-server","server"]),E=m.getLogger(["laroux-server","bundler"])}var O=null;function ot(){O=null}async function ce(n){if(O!==null)return O;let t=`file://${s.path.join(n.distDir,"server","_generated-routes.ts")}?t=${Date.now()}`,{generatedRoutes:r}=await import(t);return O=r,r}async function re(n,e){let t=s.path.resolve(n.distDir,"server","src","app",`${e}.js`);if(await s.fs.exists(t))return t;for(let r of Y){let o=s.path.resolve(n.distDir,"server","src","app",`${e}.${r}`);if(await s.fs.exists(o))return o}return t}async function ne(n,e){let t=Date.now(),o=`file://${await re(e,"layout")}?t=${t}`,{Layout:i}=await import(o),l=await ce(e),p=U(n,l);if(p===null){let a=`file://${await re(e,"not-found")}?t=${t}`,{NotFound:d}=await import(a);return{Layout:i,Page:d,params:{}}}return{Layout:i,Page:p.route.component,params:p.params}}async function de(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.readTextFile(e);return JSON.parse(t).buildId}catch{return"unknown"}}async function me(n){try{let e=s.path.resolve(n.distDir,"client",oe),t=await s.fs.stat(e),r=await s.fs.stat(n.srcDir);return t.mtime===null||r.mtime===null?!1:t.mtime>r.mtime}catch{return!1}}function I(n){return{projectRoot:n.projectRoot,srcDir:n.srcDir,distDir:n.distDir,logLevel:n.logLevel,fonts:n.fonts,images:n.images,cssModuleTypes:n.cssModuleTypes,noCssModuleAutoReference:n.noCssModuleAutoReference,browserShims:n.browserShims,serverExternals:n.build.serverExternals}}async function ge(n,e={}){let{config:t,bundler:r,hmrManager:o}=n,{frameworkPlugin:i,cssPlugin:l}=e;try{let c=s.path.resolve(t.distDir,"server","actions-manifest.json");if(await s.fs.exists(c)){let x=await s.fs.readTextFile(c),z=JSON.parse(x),q=Date.now(),C=0;for(let J of z.actions)try{let k=s.path.resolve(t.distDir,"server",J);await s.fs.exists(k)&&(await import(`file://${k}?t=${q}`),C++)}catch(k){R.warn(`Failed to load action ${J}:`,{error:k})}C>0&&R.debug(`Server actions loaded: ${C} file(s)`)}else R.debug("No actions manifest found (optional)")}catch(c){R.warn("Failed to load server actions:",{error:c})}await ne("/",t);let p=await de(t);E.debug(`Build ID: ${p}`);let a={...n,getApp:c=>ne(c,t),buildId:p},d=await r.getBundle(),f={framework:i,css:l,bundlerBackend:"deno-bundler"};if(d.clientCode!==null&&o!==null){if(i!==void 0){let c=M(I(t),f);N(c,async y=>{if(r instanceof D)try{await r.rebuild()}catch(x){E.error("Compilation failed:",{error:x})}E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`),o?.notifyUpdate(Date.now(),y.changedFiles)})}}else if(t.mode.isWatch&&i!==void 0){let c=M(I(t),f);N(c,y=>{E.info(`\u2713 Compiled in ${y.duration.toFixed(0)}ms`)})}let h="";d.clientCode!==null&&o!==null?h=" HMR":d.clientCode!==null&&(h=" Watch"),R.info(`RSC Server${h}`),R.info(` Local: http://localhost:${t.server.port}`);let{startHTTPServer:g}=await import("./server-KJW4HWK7.js");return g(a),a}async function it(n){let e=n.projectRoot??s.process.cwd(),t=n.logLevel??"info",r=n.mode==="dev",{renderer:o,htmlShell:i,frameworkPlugin:l,cssPlugin:p}=n;await pe(t);let u=await Q(e),a={...u,srcDir:s.path.resolve(e,u.srcDir),distDir:s.path.resolve(e,u.distDir),publicDir:s.path.resolve(e,u.publicDir),logLevel:t,mode:{isDev:r,isBuild:!1,isServe:!r,isWatch:r}};n.port!==void 0&&(a.server.port=n.port),n.hmr!==void 0?a.server.hmr=n.hmr:r&&(a.server.hmr=!0),n.open!==void 0&&(a.server.open=n.open),r&&(a.build.minify=!1);let d=await me(a),f=r||!d,h={framework:l,css:p};if(f&&r&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"deno-bundler"});await F(C)}else if(f&&l!==void 0){let C=M(I(a),{...h,bundlerBackend:"rolldown"});await F(C)}let g,c=null;r&&a.server.hmr?(c=new $,g=new w({distDir:a.distDir})):g=new w({distDir:a.distDir});let y=new H;await y.loadRoutes(a.distDir);let x=new T;await x.loadProxies(a.distDir),await ge({config:a,bundler:g,hmrManager:c,apiHandler:y,middlewareDispatcher:x,renderer:o??Z,htmlShell:i??ee},{frameworkPlugin:l,cssPlugin:p}),n.open&&fe(`http://localhost:${a.server.port}`)}function fe(n){let e={darwin:["open"],linux:["xdg-open"],windows:["cmd","/c","start"]},t=W(),r=e[t];r&&r[0]&&s.exec.spawnChild(r[0],[...r.slice(1),n],{stdout:"null",stderr:"null"})}export{le as VALID_LOG_LEVELS,ot as clearRoutesCache,it as startServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
|
|
@@ -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,q as o,r as p,s as q,t as r}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,q as o,r as p,s as q,t as r}from"./chunk-QMRKAC6C.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{j as chunkToInlineScript,l as createInlineRSCStream,k as createInlineTransformStream,q as createReactHtmlShellBuilder,o as createReactRenderer,m as generateInlineBootstrapScript,n as generateInlineCompletionScript,c as generateRSCPayloadScript,e as loadModuleMap,r as reactHtmlShellBuilder,p as reactRenderer,i as renderApp,f as renderRSC,h as renderRSCResponse,a as renderSSR,d as renderToReadableStream,b as serializeRSCPayload,g as streamToResponse};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Le}from"./chunk-
|
|
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-
|
|
2
|
+
import{a as Le}from"./chunk-4COCZPO5.js";import{a as qe}from"./chunk-KZAPWWOT.js";import{a as _e,c as Je}from"./chunk-TELZ2ZFI.js";import{a as We}from"./chunk-RFHWH6ZX.js";import{a as ze}from"./chunk-WWI6727S.js";import{a as Se,c as $e}from"./chunk-E423U2PP.js";import{a as Re,c as Te}from"./chunk-SMKZDN2Q.js";import{a as De,c as Fe}from"./chunk-BSV66I74.js";import{a as Pe,c as je}from"./chunk-SK6QUPJR.js";import{a as Ie,c as Ee}from"./chunk-2OKCK56H.js";import{a as Me,c as Ne}from"./chunk-YJ3ICGHV.js";import{a as Oe}from"./chunk-4EJVA4QA.js";import{a as Ae}from"./chunk-3U5M6YO6.js";import"./chunk-IQQEVKBP.js";import{a as de,c as ce}from"./chunk-QYMHLTVT.js";import{a as pe,c as me}from"./chunk-IWXI3UYI.js";import{a as ue,c as fe}from"./chunk-LYKN5EIM.js";import{a as ge,c as ve}from"./chunk-3LDGQFQZ.js";import{a as ye,c as he}from"./chunk-RIOYVPPP.js";import{a as ke,c as be}from"./chunk-WPOZMPUR.js";import{a as xe,c as Ve}from"./chunk-2BEIAJ5J.js";import{a as Ce,c as we}from"./chunk-Z2LXZLZV.js";import"./chunk-VNJJQED3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-H5GHXMIT.js";import{a as re}from"./chunk-UQRZJPYH.js";import"./chunk-CXTPYPO4.js";import{b as H,c as Q}from"./chunk-OWQXQ33F.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-L7RS6MQ5.js";import{a as q,b as Z,c as ee,e as te,g as ae,h as _,l as m,m as se,n as oe}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-VAIRJES2.js";import"./chunk-J2Z7NG2X.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.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-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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
|
+
`);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-G7PJEGW6.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 r,b as s,c as t,d as u,e as v,f as w,g as x,h as A,i as B}from"./chunk-
|
|
2
|
+
import{a as r,b as s,c as t,d as u,e as v,f as w,g as x,h as A,i as B}from"./chunk-6VHZQNHX.js";import{b as y,c as z}from"./chunk-6E6JUBFH.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,t as buildCommand,z as clearWorkerdEnv,A as createRuntime,x as detectExecutionContext,s as detectInvoker,g as detectRuntime,n as getArch,w as getCliPrefix,o as getHomedir,m as getPlatform,q as getPlatformInfo,h as getRuntimeVersion,p as getTmpdir,j as isBrowser,u as isCommandInPath,l as isEdge,i as isRuntime,k as isServer,v as matchCliPrefix,y as populateEnvFromContext,f as posixPath,r as resolvePathDirs,B as runtime,e as toPosix};
|
|
@@ -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 as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f as g,g as h,h as i,i as j,j as k,k as l}from"./chunk-MBG7SPPO.js";import{q as f}from"./chunk-YVN2NZL4.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as PipelineError,a as StreamError,c as TimeoutError,d as createChunk,e as defineLayer,k as layers,g as output,h as pipeline,l as renderers,i as sinks,j as sources,f as span};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-5Y5VGPYR.js";import"./chunk-EXP2TZZC.js";import"./chunk-J2Z7NG2X.js";import"./chunk-MBG7SPPO.js";import"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import"./chunk-DRCKMHUI.js";import"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as CommandBuilder,a as CommandError,d as exec,c as parseCommand};
|
|
@@ -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-
|
|
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-MBG7SPPO.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-5MVJUALI.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-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import{b as v}from"./chunk-BQT5RJZB.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,h,i,j,k,l,m,n}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-VVWAUS3D.js";import"./chunk-LSET5TD3.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as n}from"./chunk-
|
|
2
|
+
import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{i as n}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var h=q.getLogger(["laroux","image-optimizer"]),$=null;async function j(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var F={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function B(i){let r=[],o=["jpg","jpeg","png","gif","webp"];async function a(t){try{for await(let e of n.fs.readDir(t)){let s=n.path.resolve(t,e.name);e.isDirectory?await a(s):e.isFile&&S(e.name.toLowerCase(),o)&&r.push(s)}}catch{}}return await a(i),r}async function E(i,r){return`data:image/webp;base64,${(await(await j())(i).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function C(i,r,o,a={}){let t=await j(),e={...F,...a},s=t(i),l=await s.metadata();if(l.width===void 0||l.height===void 0)throw new Error(`Could not read image dimensions: ${i}`);let u=l.width,w=l.height,y=u/w,m=n.path.extname(i),p=m.slice(1).toLowerCase(),f=n.path.basename(i,m),x=`${o}/${f}`,I=[];for(let c of e.widths){if(c>u)continue;let O=Math.round(c/y);for(let b of e.formats){let z,d;b==="original"?(d=p,z=n.path.resolve(r,`${f}-${c}w.${p}`)):(d=b,z=n.path.resolve(r,`${f}-${c}w.${b}`)),await n.fs.ensureDir(n.path.dirname(z));let g=s.clone().resize(c,O,{fit:"cover"});b==="webp"?g=g.webp({quality:e.quality.webp}):b==="avif"?g=g.avif({quality:e.quality.avif}):d==="jpg"||d==="jpeg"?g=g.jpeg({quality:e.quality.jpeg}):d==="png"&&(g=g.png({quality:e.quality.png}));let P=await g.toBuffer();await n.fs.writeFile(z,P),I.push({path:z,format:d,width:c,height:O,size:P.length})}}let v;return e.generateBlurPlaceholder&&(v=await E(i,e.placeholderWidth)),{originalPath:i,publicPath:x,originalWidth:u,originalHeight:w,variants:I,blurDataUrl:v,aspectRatio:y}}async function V(i,r,o="/images",a={}){h.info(`Scanning for images in ${i}...`);let t=await B(i);if(t.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${t.length} image(s) to optimize`);let e={},s=0,l=0;for(let m of t)try{let p=await n.fs.stat(m);s+=p.size;let f=await C(m,r,o,a);e[m]=f;let x=f.variants.reduce((I,v)=>I+v.size,0);l+=x,h.debug(`Optimized: ${n.path.basename(m)} \u2192 ${f.variants.length} variants`)}catch(p){h.warn(`Failed to optimize ${m}: ${p instanceof Error?p.message:String(p)}`)}let u={timestamp:Date.now(),images:e},w=n.path.resolve(r,"image-manifest.json");await n.fs.ensureDir(n.path.dirname(w)),await n.fs.writeTextFile(w,JSON.stringify(u,null,2));let y=s>0?((1-l/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${t.length} images, ${y}% size reduction`),u}function M(i,r="webp"){return i.variants.filter(a=>a.format===r).sort((a,t)=>a.width-t.width).map(a=>`${a.path} ${a.width}w`).join(", ")}function D(i,r,o="webp"){let a=i.variants.filter(t=>t.format===o).sort((t,e)=>t.width-e.width);return a.find(t=>t.width>=r)??a.at(-1)}export{M as generateSrcset,D as getBestVariant,C as optimizeImage,V as optimizeImages,B as scanImages};
|
|
@@ -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-PPSDIDOI.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-
|
|
2
|
+
import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-PPSDIDOI.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-VE6XM5OZ.js";import{a as A,b as C}from"./chunk-2N62LL55.js";import{a as M,b as w}from"./chunk-7RL5ZFGE.js";import{a as I,b as T}from"./chunk-IBBGWXAI.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-YURNTYEP.js";import"./chunk-J7YTWK67.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-QBGNUIP3.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-VX2T4YII.js"),{ollamaFactory:c}=await import("./ollama-LD6OENM2.js"),{openCodeFactory:n}=await import("./opencode-ECTBCC3O.js"),{kiroFactory:p}=await import("./kiro-JGEZGFF3.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};
|
|
@@ -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-
|
|
2
|
+
import{c as T,h as J}from"./chunk-V6YI7YJ4.js";import{a as S}from"./chunk-LSET5TD3.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-5MVJUALI.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as D}from"./chunk-
|
|
2
|
+
import{a as b,b as D}from"./chunk-6V6C6MWY.js";import{e as C}from"./chunk-BNMKKNLB.js";import{a as A,d as E}from"./chunk-P2MUEKFT.js";import{k as y}from"./chunk-GKOMIH2B.js";import{f as k,h as R,k as $}from"./chunk-MBG7SPPO.js";import{d as m,f as w,g as h,k as v}from"./chunk-YVN2NZL4.js";import{a as P}from"./chunk-MG65QJY6.js";import{a as g,b as p,c as j}from"./chunk-FFWPJP7A.js";import{i as N}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var S=r=>A(async t=>{try{let s=await y(r.registrySource,{local:r.local}),a=s.recipes.filter(n=>n.scale==="project"),o=a.find(n=>n.name===r.templateName);if(o===void 0)return p({_tag:"TemplateNotFound",message:`Template '${r.templateName}' not found. Available: ${a.map(n=>n.name).join(", ")}`});await N.fs.mkdir(r.targetDir,{recursive:!0});let f={project_name:r.projectName,...r.variables},e=await C(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:f}),u=await b(r.targetDir),d=D(o,u);t.out.writeln(h(`\u2713 Created ${r.projectName} with ${e.written.length} file(s)`));for(let n of e.written)t.out.writeln(` \u2192 ${n}`);if(d.instructions.length>0){t.out.writeln(m(`
|
|
3
3
|
Next steps:`)),t.out.writeln(m(` cd ${r.projectName}`));for(let n of d.instructions)t.out.writeln(m(` ${n}`))}return g({template:o,result:e,depInfo:d})}catch(s){let a=s instanceof Error?s.message:String(s);return p({_tag:"ApplyError",message:a})}});var B=async r=>{let t=P(r??[],{string:["name","registry","var"],boolean:["local"],collect:["var"]}),s=t._[0],a=t.name??s,o=t.registry,f=t.local===!0,e=k({renderer:$.ansi(),sink:R.stdout()}),u={};for(let c of t.var){let[i,...l]=String(c).split("=");i!==void 0&&i!==""&&(u[i]=l.join("="))}if(s===void 0){try{let i=(await y(o,{local:f})).recipes.filter(l=>l.scale==="project");e.writeln("Usage: eser kit new <template> [--name <project-name>] [--var key=value]"),e.writeln(),e.writeln("Available project templates:"),e.writeln();for(let l of i)e.writeln(` ${l.name.padEnd(20)} ${l.description} `,m(`[${l.language}]`))}catch(c){let i=c instanceof Error?c.message:String(c);e.writeln(w(`Error: ${i}`))}return await e.close(),g(void 0)}if(a===void 0)return e.writeln(w("Project name is required.")),await e.close(),p({exitCode:1});e.writeln(v(`
|
|
4
4
|
Creating ${a} from ${s}...
|
|
5
5
|
`));let d=`${Deno.cwd()}/${a}`,n=await E(S({templateName:s,projectName:a,targetDir:d,registrySource:o,local:f,variables:u}),{out:e});return await e.close(),j(n)?g(void 0):p({exitCode:1})};export{B as main};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ee}from"./chunk-QD46ROBD.js";import"./chunk-EXP2TZZC.js";import{a as X,b as Y,c as z,d as j}from"./chunk-3PBNSBPA.js";import"./chunk-OCPEFZBJ.js";import{a as q}from"./chunk-H7FWYKMD.js";import{a as K,b as Z,d as v}from"./chunk-V3NJTF2Y.js";import{a as ae}from"./chunk-ENNZWOEX.js";import{a as O}from"./chunk-TYLYMZQC.js";import{a as ce,b as le,c as de,d as ue}from"./chunk-OEUVCV5C.js";import{a as te,c as A,d as se,e as ne,f as ie,h as re,j as oe}from"./chunk-6SSSHLEY.js";import{c as E,e as J,f as Q,k as _,l as G,p as B,r as $,s as H}from"./chunk-OM5GSS2H.js";import{c as T}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{a as V,b as P}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var fe=r=>r.split(`
|
|
3
|
+
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ge=async(r,e)=>{let o=[],i=(e.startsWith(r)?e.slice(r.length+1):e).split("/");i.pop();for(let t=i.length;t>=0;t--){let s=`${t===0?r:`${r}/${i.slice(0,t).join("/")}`}/.folder-rules.md`,a=t===0?".":i.slice(0,t).join("/");try{let m=await f.fs.readTextFile(s),u=fe(m);for(let d of u)o.push({folder:a,rule:d})}catch{}}return o},M=async(r,e)=>{let o=new Set,c=[];for(let i of e){let t=await ge(r,i);for(let n of t){let s=`${n.folder}::${n.rule}`;o.has(s)||(o.add(s),c.push(n))}}return c};var Ue=async r=>{let e=f.process.cwd(),o=K(r),c=Z(r);if(!await H(e))return await v({error:`noskills not initialized. Run: ${T("init")}`},o),P({exitCode:1});let i=null;for(let p of c)p.startsWith("--answer=")&&(i=p.slice(9));let t=Q(c),n=await J(e,t),s=await G(e);if(s?.command!==void 0){let{setCommandPrefix:p}=await import("./cmd-YU4MVRRR.js");p(s.command)}if(s===null)return await v({error:"No config found"},o),P({exitCode:1});if(n.spec!==null&&n.phase!=="IDLE"&&n.phase!=="COMPLETED"){let p=`${e}/${E.specDir(n.spec)}`;try{await f.fs.stat(p)}catch{return await v({error:!0,message:`Active spec '${n.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${T("reset")}\` to return to IDLE, or \`${T("cancel")}\` to mark as cancelled.`},o),P({exitCode:1})}}let a=ee(c,s);n.phase==="DISCOVERY"&&n.discovery.audience!==a&&(n={...n,discovery:{...n.discovery,audience:a}});let u=(await B(e)).filter(p=>s.concerns.includes(p.id));if(i!==null){let p=await we(e,n,s,u,i);await $(e,p);let l={...p,lastCalledAt:new Date().toISOString()};await $(e,l);let F=await q(e),S=l.spec!==null?await O(e,l.spec):null,I=await pe(e,l),L=await M(e,I),k=j(l,u,F,s,S,L);return await v(k,o),V(void 0)}let d={...n,lastCalledAt:new Date().toISOString()};await $(e,d);let w=await q(e),x=d.spec!==null?await O(e,d.spec):null,C=await pe(e,d),b=await M(e,C),D;d.phase==="IDLE"&&(D={existingSpecs:(await _(e)).map(l=>({name:l.name,phase:l.state.phase,iteration:l.state.execution.iteration,detail:l.state.phase==="EXECUTING"?`${l.state.execution.completedTasks.length} tasks done, iteration ${l.state.execution.iteration}`:l.state.phase==="SPEC_DRAFT"?"awaiting approval":l.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let R=j(d,u,w,s,x,b,D);return await v(R,o),V(void 0)},we=async(r,e,o,c,i)=>{switch(e.phase){case"DISCOVERY":{let t=e.discovery.audience==="agent",n=null;try{let a=JSON.parse(i);typeof a=="object"&&a!==null&&!Array.isArray(a)&&(t?X.map(d=>d.id).every(d=>d in a)&&(n=a):n=a)}catch{}let s=e;if(n!==null)for(let[a,m]of Object.entries(n))typeof m=="string"&&m.length>0&&(s=A(s,a,m));else{let a=Y(c),m=s.discovery.currentQuestion,u=a[m];if(u===void 0)return e;s=A(s,u.id,i),s=ie(s)}return z(s.discovery.answers)&&(s=se(s)),s}case"DISCOVERY_REVIEW":{if(i.trim().toLowerCase()==="approve")return ne(e);try{let t=JSON.parse(i);if(typeof t.revise=="object"&&t.revise!==null){let n=e;for(let[s,a]of Object.entries(t.revise))typeof a=="string"&&a.length>0&&(n=A(n,s,a));return n}}catch{}return e}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let s=JSON.parse(i);t={involvesWebUI:s.involvesWebUI===!0||s.involvesUI===!0,involvesCLI:s.involvesCLI===!0||s.involvesUI===!0,involvesPublicAPI:s.involvesPublicAPI===!0,involvesMigration:s.involvesMigration===!0,involvesDataHandling:s.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let n={...e,classification:t};try{await ae(r,n,c)}catch{}return n}try{let t=JSON.parse(i);if(typeof t.refinement=="string"&&t.refinement.length>0){let n=t.refinement;if(e.spec!==null){let s=`${r}/${E.specFile(e.spec)}`,a=await f.fs.readTextFile(s);if(n.includes("task-")){let u=Se(n).map(x=>`- [ ] ${x}`).join(`
|
|
4
|
+
`),d=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,w=a.replace(d,`## Tasks
|
|
5
|
+
|
|
6
|
+
${u}
|
|
7
|
+
`);await f.fs.writeTextFile(s,w)}}return e}}catch{}return e}case"SPEC_APPROVED":{let t=re(e);return t.spec!==null&&(await ce(r,t.spec,"executing"),await ue(r,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:i}};if(o.verifyCommand!==null&&o.verifyCommand!==void 0&&o.verifyCommand.length>0){let n=await ve(r,o.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:n}},!n.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ye(r,e,i,c)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",n={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:i,promoted:!1,timestamp:new Date().toISOString()},s=oe(e,n);return s=te(s,"EXECUTING"),s={...s,execution:{...s.execution,lastProgress:`Resolved: ${i}`}},s}default:return e}},Se=r=>r.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),ye=async(r,e,o,c)=>{let i;try{i=JSON.parse(o)}catch{return{...e,execution:{...e.execution,lastProgress:o,awaitingStatusReport:!1}}}let t=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let y=e.execution.debt.items.map((N,me)=>({id:`legacy-${me+1}`,text:N,since:e.execution.debt.fromIteration}));t={...e,execution:{...e.execution,debt:{...e.execution.debt,items:y}}};let U=new TextEncoder,h=f.process.stderr.getWriter();await h.write(U.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
8
|
+
`)),h.releaseLock()}let n=i.completed??[],s=new Set(n),a=i.na??[],m=new Set(a),u=i.newIssues??[],d=i.remaining??[],w=i.blocked??[],x=t.execution.debt?.unaddressedIterations??0,C=t.execution.debt!==null?t.execution.debt.items.filter(g=>!s.has(g.id)&&!m.has(g.id)):[],b=t.execution.debtCounter??0,D=u.map((g,y)=>({id:`debt-${b+y+1}`,text:g,since:t.execution.iteration})),R=[...C,...D],l=d.length===0&&w.length===0&&u.length===0||R.length===0?null:{items:R,fromIteration:t.execution.debt?.fromIteration??t.execution.iteration,unaddressedIterations:C.length>0?x+1:1},F=[...new Set([...t.execution.naItems??[],...a])],S=[];n.length>0&&S.push(`Completed: ${n.join(", ")}`),a.length>0&&S.push(`N/A: ${a.join(", ")}`);let I=S.length>0?S.join("; "):"Status report submitted",L=t.execution.lastVerification===null||t.execution.lastVerification.passed===!0,k=l===null&&L,W=b+u.length;if(k&&t.spec!==null){let g=await O(r,t.spec);if(g!==null){let y=t.execution.completedTasks??[],U=new Set(y),h=g.tasks.find(N=>!U.has(N.id));if(h!==void 0)return await le(r,t.spec,h.id),await de(r,t.spec,h.id,"done"),{...t,execution:{...t.execution,lastProgress:`Task ${h.id} accepted: ${I}`,awaitingStatusReport:!1,debt:l,completedTasks:[...y,h.id],debtCounter:W,naItems:F}}}}return{...t,execution:{...t.execution,lastProgress:k?I:`Task not accepted \u2014 remaining items must be addressed first. ${I}`,awaitingStatusReport:!1,debt:l,debtCounter:W,naItems:F}}},ve=async(r,e)=>{try{let{execSync:o}=await import("node:child_process"),c=o(e,{cwd:r,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(c).slice(0,4e3),timestamp:new Date().toISOString()}}catch(o){let c=o,i=((c.stdout??"")+(c.stderr??"")).slice(0,4e3);return c.status!==void 0?{passed:!1,output:i||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${o instanceof Error?o.message:String(o)}`,timestamp:new Date().toISOString()}}},pe=async(r,e)=>{let o=[...e.execution.modifiedFiles??[]],c=await xe(r);return[...new Set([...o,...c])]},xe=async r=>{let e=`${r}/${E.stateDir}/files-changed.jsonl`;try{let c=(await f.fs.readTextFile(e)).trim().split(`
|
|
9
|
+
`).filter(Boolean),i=[];for(let t of c)try{let n=JSON.parse(t);i.includes(n.file)||i.push(n.file)}catch{}return i}catch{return[]}};export{we as handleAnswer,Ue as main,Se as parseRefinementTasks};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-2N62LL55.js";import"./chunk-YURNTYEP.js";import"./chunk-J7YTWK67.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{a as OllamaModel,b as ollamaFactory};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b}from"./chunk-7RL5ZFGE.js";import"./chunk-YURNTYEP.js";import"./chunk-J7YTWK67.js";import"./chunk-5MVJUALI.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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{a as D,b as P}from"./chunk-
|
|
2
|
+
import{a as D,b as P}from"./chunk-QD46ROBD.js";import"./chunk-EXP2TZZC.js";import{c as l,k as R,p as x}from"./chunk-OM5GSS2H.js";import{a as E}from"./chunk-2XNFZXHY.js";import{a as k,b as C,c as v,l as o}from"./chunk-JZ7DUWYC.js";import"./chunk-MBG7SPPO.js";import"./chunk-YVN2NZL4.js";import{a as d,b as $}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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,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-BNMKKNLB.js";import"./chunk-GKOMIH2B.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{e as applyRecipe,f as applyRecipeChain,b as fileExists,a as isPathSafe,c as processContent,d as runPostInstall};
|
|
@@ -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,o,p}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-GKOMIH2B.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";export{b as DEFAULT_OWNER,d as DEFAULT_REF,f as DEFAULT_REGISTRY_URL,c as DEFAULT_REPO,a as FETCH_TIMEOUT_MS,g as LOCAL_REGISTRY_PATH,e as RECIPES_FILENAME,j as detectLocalRegistry,m as fetchRecipeFile,o as fetchRecipeFolder,p as fetchRecipeFromRepo,k as fetchRegistry,l as fetchRegistryFromRepo,n as parseGitHubRawUrl,i as registryFetch,h as resolveSpecifier};
|
|
@@ -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-IBB6UZR2.js";import"./chunk-VNJJQED3.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 v,c as f}from"./chunk-L7RS6MQ5.js";import{l as n}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-VAIRJES2.js";import"./chunk-J2Z7NG2X.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as m}from"./chunk-P2MUEKFT.js";import"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{d as a}from"./chunk-5MVJUALI.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:t,output:C}=v(),R=async()=>(await a`git status --porcelain`.noThrow().text()).length===0,x=async()=>{let e=await a`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
|
|
3
3
|
`):[]},A=async(e,r)=>{for(let s of r)await a`git add ${s}`.spawn();await a`git commit -m ${e}`.spawn()},$=async()=>{await a`git push origin HEAD`.spawn()},P=async e=>{await a`git tag -d ${e}`.noThrow().spawn();let r=`:refs/tags/${e}`;await a`git push origin ${r}`.noThrow().spawn()},b=async e=>{let r=new TextEncoder,s=new TextDecoder,o=new Uint8Array(256);await Deno.stderr.write(r.encode(`${e} [y/N] `));let u=await Deno.stdin.read(o),l=s.decode(o.subarray(0,u??0)).trim();return l==="y"||l==="Y"},O=async e=>{let{type:r,dryRun:s=!1}=e;if(!await R())throw new Error("Working tree is dirty. Commit or stash changes first.");let o=await x();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 u=await c()??"0.0.0";r!=="same"&&await(await import("./versions-
|
|
7
|
+
Push first, or re-run with --yes to continue anyway.`);let u=await c()??"0.0.0";r!=="same"&&await(await import("./versions-OKK45EDV.js")).versions(r,{dryRun:s});let l=await c()??u,d=!1;try{await(await import("./changelog-gen-USXHO6PE.js")).generateChangelog({dryRun:s}),d=!0}catch{d=!1}let h=!1,w=!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"],E=`chore(codebase): release v${l}`;await A(E,y),h=!0,await $(),w=!0}return{version:l,previousVersion:u,changelogGenerated:d,committed:h,pushed:w,dryRun:s}},k=async(e={})=>{let{dryRun:r=!1}=e;if(!await R())throw new Error("Working tree is dirty. Commit and push first.");let s=await x();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 u=`v${o}`;if(!r){let l=`chore(codebase): release v${o}`;await a`git commit --allow-empty -m ${l}`.spawn(),await a`git push origin HEAD`.spawn()}return{version:o,tag:u,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 P(s),{version:r,tag:s,deleted:!0}},M=e=>m.fromPromise(()=>O(e)),U=e=>m.fromPromise(()=>k(e)),H=e=>m.fromPromise(()=>T(e)),I=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})},V=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),D=e=>i.ok({yes:e.flags.yes===!0}),j=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return n.error(t,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?(n.warn(t,"[DRY RUN] Release preview:"),n.info(t,` Version: ${r.previousVersion} -> ${r.version}`),n.info(t,` Changelog: ${r.changelogGenerated?"generated":"no user-facing changes"}`),n.info(t," No changes were made.")):(n.success(t,`Released v${r.version}`),n.info(t,` Version: ${r.previousVersion} -> ${r.version}`),n.info(t,` Changelog: ${r.changelogGenerated?"updated":"no user-facing changes"}`),n.info(t,` Committed: ${r.committed}`),n.info(t,` Pushed: ${r.pushed}`),n.info(t," CI will validate, tag, and publish."),n.info(t," Watch: https://github.com/eser/stack/actions")),i.ok(void 0)},N=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return n.error(t,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?n.warn(t,`[DRY RUN] Would delete and recreate tag ${r.tag}`):(n.success(t,`Re-tagged ${r.tag}`),n.info(t,"CI will validate and publish.")),i.ok(void 0)},G=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return n.error(t,o),i.fail({exitCode:1})}let{value:r}=e;return r.deleted&&n.success(t,`Deleted tag v${r.version} (local + remote).`),i.ok(void 0)},S=g.createTrigger({handler:M,adaptInput:I,adaptOutput:j}),Y=g.createTrigger({handler:U,adaptInput:V,adaptOutput:N}),F=g.createTrigger({handler:H,adaptInput:D,adaptOutput:G}),Z=async e=>{let r=p(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),s=r._[0],o=r["dry-run"]===!0,u=r.yes===!0;if(s!==void 0&&!o&&!u&&["patch","minor","major","same"].includes(s)){let d=await c()??"0.0.0";if(n.info(t,`Current version: ${d}`),n.info(t,`Bump type: ${s}`),n.info(t,"This will bump version, generate changelog, commit, and push."),await C.flush(),!await b("Proceed?"))return n.warn(t,"Aborted."),i.ok(void 0);r.yes=!0}let l=f("release",r);return await S(l)},ee=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=f("rerelease",r);return await Y(s)},re=async e=>{let r=p(e??[],{boolean:["yes"],alias:{y:"yes"}}),s=f("unrelease",r);return await F(s)};export{S as handleReleaseCli,Y as handleRereleaseCli,F as handleUnreleaseCli,Z as main,O as release,M as releaseHandler,k as rerelease,U as rereleaseHandler,ee as rereleaseMain,T as unrelease,H as unreleaseHandler,re 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-
|
|
2
|
+
import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-L7RS6MQ5.js";import{l as u}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-VAIRJES2.js";import"./chunk-J2Z7NG2X.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-P2MUEKFT.js";import"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{e as p}from"./chunk-5MVJUALI.js";import"./chunk-PWLF3WXM.js";import"./chunk-SH4H7OLV.js";import"./chunk-ZEFYMWGZ.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import{j as x,n as R}from"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import{j as c}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.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};
|