eser 4.1.29 → 4.1.31
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-O35CHPAB.js → add-5SDE43IH.js} +1 -1
- package/chunks/{approve-XMPDDDZD.js → approve-XNUZYGYJ.js} +1 -1
- package/chunks/{ask-BZIPZT7O.js → ask-L3N6REQI.js} +1 -1
- package/chunks/{block-C2GOOMFH.js → block-NWIP4USQ.js} +1 -1
- package/chunks/{browser-JNDQ24XT.js → browser-SG2DBNGS.js} +1 -1
- package/chunks/{build-LADMCGZD.js → build-6DCIDFY7.js} +2 -2
- package/chunks/bun-3AACRJXG.js +2 -0
- package/chunks/{changelog-gen-KMNP2KO4.js → changelog-gen-7V37P7PE.js} +1 -1
- package/chunks/{chunk-SAQAIPUB.js → chunk-2EVWKUN6.js} +1 -1
- package/chunks/{chunk-G35GBI4M.js → chunk-32HV3K27.js} +1 -1
- package/chunks/{chunk-XAV6BM52.js → chunk-3KCPUYLZ.js} +1 -1
- package/chunks/{chunk-IKYBNRCS.js → chunk-3QIPK7NI.js} +1 -1
- package/chunks/{chunk-DPL7GREV.js → chunk-455V3AE5.js} +1 -1
- package/chunks/{chunk-SOCLJVZ3.js → chunk-46ZWBKIW.js} +1 -1
- package/chunks/{chunk-C2FHTZ2Y.js → chunk-4DOMGQOO.js} +1 -1
- package/chunks/{chunk-2SEPWXDK.js → chunk-4GQY3STW.js} +1 -1
- package/chunks/{chunk-YZ4L35HK.js → chunk-4SYC4WJV.js} +1 -1
- package/chunks/{chunk-CFTANV4S.js → chunk-4WQGB7NO.js} +1 -1
- package/chunks/{chunk-GITZBQ2Z.js → chunk-5MWX3POX.js} +1 -1
- package/chunks/{chunk-LT7CC4SX.js → chunk-5PNGVDLV.js} +1 -1
- package/chunks/{chunk-CLXOJOH3.js → chunk-6QC7ILI5.js} +1 -1
- package/chunks/{chunk-JPCJIMM5.js → chunk-6SYJFJDF.js} +1 -1
- package/chunks/{chunk-EJ4XBQTD.js → chunk-7BFBOLLC.js} +1 -1
- package/chunks/{chunk-Z2CGXVFY.js → chunk-7NUMDHE2.js} +1 -1
- package/chunks/{chunk-RZKZDGNM.js → chunk-AGRTWPDI.js} +1 -1
- package/chunks/{chunk-T4CNY6II.js → chunk-BCPCQHDL.js} +1 -1
- package/chunks/{chunk-V4AJMSER.js → chunk-BP3IFAPO.js} +1 -1
- package/chunks/{chunk-LXE2WGIW.js → chunk-C7HGK43H.js} +1 -1
- package/chunks/{chunk-RMGMMTO6.js → chunk-CEYKWASA.js} +1 -1
- package/chunks/{chunk-ZKUI7MRS.js → chunk-CKNA5LIK.js} +1 -1
- package/chunks/{chunk-CS3FL7HI.js → chunk-CLL3YG4W.js} +1 -1
- package/chunks/{chunk-H7XLUEAU.js → chunk-COKZ6MLN.js} +2 -2
- package/chunks/{chunk-VXTKQXGM.js → chunk-CUIMSX4V.js} +1 -1
- package/chunks/{chunk-IAZ2MM3P.js → chunk-EBCQCAQ7.js} +1 -1
- package/chunks/{chunk-QTOUP2B7.js → chunk-ER4ZWF4Y.js} +1 -1
- package/chunks/{chunk-HFFIXVAB.js → chunk-F5BPXG5L.js} +1 -1
- package/chunks/{chunk-TBHZHGUF.js → chunk-FORPNESQ.js} +1 -1
- package/chunks/{chunk-NP2CCJ4C.js → chunk-GBM3TZFD.js} +1 -1
- package/chunks/{chunk-VIOT4AMI.js → chunk-H4SPMUT6.js} +1 -1
- package/chunks/{chunk-6HGMAVFR.js → chunk-HVLKXRPA.js} +1 -1
- package/chunks/{chunk-KXI7O3KZ.js → chunk-HVOPUZOM.js} +1 -1
- package/chunks/{chunk-SMT3I5PQ.js → chunk-HYT26FYU.js} +1 -1
- package/chunks/{chunk-KP3HXVLZ.js → chunk-I4C675WP.js} +1 -1
- package/chunks/{chunk-PDJEHSKZ.js → chunk-IDMI5OBK.js} +1 -1
- package/chunks/chunk-JOTAKQMZ.js +2 -0
- package/chunks/{chunk-MNVCCOJS.js → chunk-K6H7JTIH.js} +1 -1
- package/chunks/{chunk-A3MBTPHJ.js → chunk-K7MYEXOS.js} +1 -1
- package/chunks/{chunk-VXA3KMDF.js → chunk-KKBIUT5L.js} +1 -1
- package/chunks/{chunk-4NEBMHCP.js → chunk-KPWEJXPI.js} +1 -1
- package/chunks/{chunk-TBOM65KB.js → chunk-KQE6FMKW.js} +1 -1
- package/chunks/{chunk-RYOLIM3I.js → chunk-MRCBHVSB.js} +1 -1
- package/chunks/{chunk-VKSH6UPG.js → chunk-MXGRYONZ.js} +1 -1
- package/chunks/{chunk-COJNSVOS.js → chunk-N2VBT43E.js} +1 -1
- package/chunks/chunk-N4HITOTN.js +2 -0
- package/chunks/{chunk-QEZJTCNE.js → chunk-NP723K5L.js} +1 -1
- package/chunks/{chunk-KLHDNHD3.js → chunk-NTHP6SND.js} +1 -1
- package/chunks/{chunk-VC5BX56D.js → chunk-P2TABZ4A.js} +1 -1
- package/chunks/{chunk-6LVNPRHQ.js → chunk-P74JF7XR.js} +1 -1
- package/chunks/{chunk-JPFGKN4T.js → chunk-PVPMHMKP.js} +1 -1
- package/chunks/{chunk-6XW64HCG.js → chunk-QOX7VSID.js} +1 -1
- package/chunks/{chunk-5YVKJFG6.js → chunk-RGUETQSC.js} +1 -1
- package/chunks/{chunk-YSJNWJ24.js → chunk-S3XXNZSC.js} +1 -1
- package/chunks/{chunk-HYFBCDIO.js → chunk-SOBOSRJB.js} +1 -1
- package/chunks/{chunk-5BHHLJJN.js → chunk-SQINSLNL.js} +1 -1
- package/chunks/{chunk-ZTPERUHN.js → chunk-UESOCN2G.js} +1 -1
- package/chunks/{chunk-KLWWCHOL.js → chunk-UJ6LH5FY.js} +1 -1
- package/chunks/{chunk-4MELQSFH.js → chunk-VC6ERZSI.js} +1 -1
- package/chunks/{chunk-FXBDWBXT.js → chunk-VG72SSDI.js} +1 -1
- package/chunks/{chunk-EETBL6X2.js → chunk-W3RVRCUB.js} +1 -1
- package/chunks/{chunk-U3FRSRMK.js → chunk-WG6J7DFO.js} +1 -1
- package/chunks/{chunk-3HC6RWFJ.js → chunk-XU5SILYR.js} +1 -1
- package/chunks/{chunk-7ZVGNL76.js → chunk-XVSIRN6G.js} +1 -1
- package/chunks/{chunk-XMVLDQGA.js → chunk-Y4ARZGGL.js} +1 -1
- package/chunks/{chunk-PASFORZM.js → chunk-YQVWAWMO.js} +1 -1
- package/chunks/{chunk-AN5JOFHD.js → chunk-YVIGHK4H.js} +1 -1
- package/chunks/{chunk-7FMX4QXF.js → chunk-ZNGLZECE.js} +1 -1
- package/chunks/{claude-code-T26K2CSI.js → claude-code-VUBEU7RR.js} +1 -1
- package/chunks/{clone-UYEZ44LL.js → clone-H3UAEVVP.js} +1 -1
- package/chunks/{commitmsg-646PHU7A.js → commitmsg-UK2ABB7D.js} +2 -2
- package/chunks/{concern-YRABYUVO.js → concern-UCYEAXJ4.js} +1 -1
- package/chunks/{deno-VWFDRCYK.js → deno-7BSPHDRG.js} +1 -1
- package/chunks/{dev-G4VQ2IYE.js → dev-XBH6C6DH.js} +2 -2
- package/chunks/{done-5SD4KWRA.js → done-DIN56LXZ.js} +1 -1
- package/chunks/{file-tools-shared-6W7Q4BM3.js → file-tools-shared-G36OYF5S.js} +1 -1
- package/chunks/{gh-CD3B5KEN.js → gh-RKKHKA3B.js} +2 -2
- package/chunks/{gh-contributors-35JDS77W.js → gh-contributors-X7BW57DD.js} +1 -1
- package/chunks/{init-URA5HJ76.js → init-32DVDSNZ.js} +3 -3
- package/chunks/{init-FAWK4Z3E.js → init-DKNS6BZV.js} +1 -1
- package/chunks/{install-M74UAT7X.js → install-LM44N3DB.js} +1 -1
- package/chunks/{invoke-hook-4LHASYW3.js → invoke-hook-4DBMDFA5.js} +1 -1
- package/chunks/{kiro-G4OHOVFL.js → kiro-HQLXD6ZU.js} +1 -1
- package/chunks/{list-LBUVQR7O.js → list-5TGTYMAU.js} +1 -1
- package/chunks/{list-J5HOVH5E.js → list-N4ZKDFW7.js} +1 -1
- package/chunks/{list-4EO2DKMM.js → list-PY3A762R.js} +1 -1
- package/chunks/{load-config-DVKFZVST.js → load-config-FTQMJVEW.js} +1 -1
- package/chunks/{main-ODLLH74E.js → main-JTYNMHNL.js} +2 -2
- package/chunks/{manifest-QSFTIV3B.js → manifest-NF2EK757.js} +1 -1
- package/chunks/{mod-ZZYMEYCH.js → mod-5WXRQGLS.js} +1 -1
- package/chunks/{mod-YSMK5V7P.js → mod-FEGQZ3ZY.js} +1 -1
- package/chunks/{mod-QHYBU43F.js → mod-HKYPZOU7.js} +1 -1
- package/chunks/{mod-5ZKIEGUP.js → mod-JI2A2546.js} +1 -1
- package/chunks/{mod-U23K3LXJ.js → mod-JZNE2HH6.js} +1 -1
- package/chunks/{mod-T55CWDLD.js → mod-MLRQFSBE.js} +1 -1
- package/chunks/{mod-S5HDMMLJ.js → mod-NCF6OSXO.js} +1 -1
- package/chunks/mod-RRIF7ZNJ.js +2 -0
- package/chunks/{mod-EWGGLW3S.js → mod-SA3J2VR5.js} +1 -1
- package/chunks/{mod-BE3R7D2V.js → mod-Y4UHOKMZ.js} +2 -2
- package/chunks/{mod-RLMNE7UW.js → mod-YX3JRMSI.js} +1 -1
- package/chunks/{new-GDE5UZWP.js → new-BOGCXTIY.js} +1 -1
- package/chunks/{next-2HGZUAMR.js → next-VEKY722P.js} +1 -1
- package/chunks/node-MFKYO4CY.js +2 -0
- package/chunks/{ollama-EE7S3UZE.js → ollama-36F5QAOO.js} +1 -1
- package/chunks/{opencode-WUF4YPPD.js → opencode-7J3JDC44.js} +1 -1
- package/chunks/{purge-OIEP3ALR.js → purge-SQ6NCKWN.js} +1 -1
- package/chunks/{recipe-applier-WZ43N5XT.js → recipe-applier-6QZYAZ57.js} +1 -1
- package/chunks/{registry-fetcher-G33L5S7X.js → registry-fetcher-76ISLGRR.js} +1 -1
- package/chunks/{release-5BYYTQJI.js → release-WKMSWXDS.js} +2 -2
- package/chunks/{release-notes-6M2YRB3G.js → release-notes-GOUHBQ2F.js} +1 -1
- package/chunks/{release-tag-QP4ZKQNS.js → release-tag-5WNEA4HM.js} +1 -1
- package/chunks/{reset-TKTDLTXB.js → reset-EYLAZVKO.js} +1 -1
- package/chunks/{rule-6TDBH4BL.js → rule-HV7DARH6.js} +1 -1
- package/chunks/{run-TQEEFEDE.js → run-6IMOOTJ5.js} +1 -1
- package/chunks/{run-SU27QAHR.js → run-RGEZUAPM.js} +1 -1
- package/chunks/{scripts-ZSF43ZJN.js → scripts-JK6W2MCO.js} +1 -1
- package/chunks/{serve-JSDQDTTM.js → serve-DEYVWV2K.js} +2 -2
- package/chunks/{server-P46LIK5C.js → server-KNWQV2HW.js} +1 -1
- package/chunks/{spec-ATRKKK2P.js → spec-JCR5EYCU.js} +1 -1
- package/chunks/{status-H2KLEMT6.js → status-F6JR6RIQ.js} +1 -1
- package/chunks/{sync-CK7PWMKK.js → sync-ZOU46K25.js} +1 -1
- package/chunks/{system-IV54LJTN.js → system-BJCQKFCP.js} +1 -1
- package/chunks/{system-NSABXTHD.js → system-OSEVYVYU.js} +1 -1
- package/chunks/{update-HP5WGRNK.js → update-4C4WNXCE.js} +1 -1
- package/chunks/{validate-filenames-GKDIEJH4.js → validate-bom-KEC4IOKO.js} +1 -1
- package/chunks/{validate-bom-KGIGVVOU.js → validate-case-conflict-ZZKZQQX4.js} +1 -1
- package/chunks/validate-circular-deps-QCJYK5K5.js +2 -0
- package/chunks/{validate-commit-msg-2FLWH6TC.js → validate-commit-msg-PZZ4T4QF.js} +1 -1
- package/chunks/validate-docs-M55HAXPX.js +2 -0
- package/chunks/{validate-case-conflict-OO2AO434.js → validate-eof-MX52AUUT.js} +1 -1
- package/chunks/validate-export-names-UFXPIDFW.js +2 -0
- package/chunks/{validate-eof-E33EQKDM.js → validate-filenames-LXIMPWRW.js} +1 -1
- package/chunks/validate-json-TABLVKEH.js +2 -0
- package/chunks/validate-large-files-CMCMEGYA.js +2 -0
- package/chunks/validate-licenses-MDGIDYNC.js +2 -0
- package/chunks/validate-line-endings-K36HS73S.js +2 -0
- package/chunks/validate-merge-conflict-PMGZYM3B.js +2 -0
- package/chunks/validate-mod-exports-M3UYNBK7.js +2 -0
- package/chunks/{validate-package-configs-FXHXJMG4.js → validate-package-configs-V5LR7K5C.js} +1 -1
- package/chunks/validate-secrets-IAMY5DB5.js +2 -0
- package/chunks/validate-shebangs-GUBDNU2N.js +2 -0
- package/chunks/validate-submodules-ZA2FAF3W.js +2 -0
- package/chunks/validate-symlinks-LSEEVFTR.js +2 -0
- package/chunks/validate-toml-JLQ3BY73.js +2 -0
- package/chunks/validate-trailing-whitespace-3UUUKE22.js +2 -0
- package/chunks/validate-yaml-2BG7G35N.js +2 -0
- package/chunks/{versions-PZPDQ673.js → versions-IVXYMSAZ.js} +1 -1
- package/chunks/{watch-47KEOG5L.js → watch-YKYNWTZF.js} +1 -1
- package/chunks/{workerd-LDORGZ6V.js → workerd-VVSAKLDZ.js} +1 -1
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/bun-ZPIZVC7D.js +0 -2
- package/chunks/chunk-EZE3F4PG.js +0 -2
- package/chunks/chunk-PHI2BESG.js +0 -2
- package/chunks/mod-6DSPYXMK.js +0 -2
- package/chunks/node-SUFYFPRO.js +0 -2
- package/chunks/validate-circular-deps-32ISYSEO.js +0 -2
- package/chunks/validate-docs-MNQ7ZRID.js +0 -2
- package/chunks/validate-export-names-IWS4NRYR.js +0 -2
- package/chunks/validate-json-L7BSQN3G.js +0 -2
- package/chunks/validate-large-files-CHHOQREX.js +0 -2
- package/chunks/validate-licenses-5WEHTSL4.js +0 -2
- package/chunks/validate-line-endings-EWGW2ZWD.js +0 -2
- package/chunks/validate-merge-conflict-IN5ZQJDJ.js +0 -2
- package/chunks/validate-mod-exports-PHEFFLDK.js +0 -2
- package/chunks/validate-secrets-ABX5UNHC.js +0 -2
- package/chunks/validate-shebangs-47GMC7WX.js +0 -2
- package/chunks/validate-submodules-4BPO5ORH.js +0 -2
- package/chunks/validate-symlinks-OCGMLYJS.js +0 -2
- package/chunks/validate-toml-MYSG53JW.js +0 -2
- package/chunks/validate-trailing-whitespace-AXXHTIAE.js +0 -2
- package/chunks/validate-yaml-FT5PODBP.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Q}from"./chunk-
|
|
2
|
+
import{a as Q}from"./chunk-ZNGLZECE.js";import{a as K,b as j,c as M,d as F,f as N}from"./chunk-COKZ6MLN.js";import"./chunk-VG72SSDI.js";import"./chunk-KPWEJXPI.js";import"./chunk-CUIMSX4V.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as X}from"./chunk-YTF3BAQS.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-LCG4SK6K.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{g as W,t as s}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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-YSMK5V7P.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-P46LIK5C.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-FEGQZ3ZY.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-KNWQV2HW.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-W3RVRCUB.js";import"./chunk-JYNHFD6B.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as re}from"./chunk-JYNHFD6B.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as U,h as H,k as G}from"./chunk-
|
|
2
|
+
import{a as re}from"./chunk-JYNHFD6B.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as U,h as H,k as G}from"./chunk-GBM3TZFD.js";import{b as w,d as S,f as C,g as O,k as z}from"./chunk-3SXTMY75.js";import{d as N}from"./chunk-PVPMHMKP.js";import{a as q}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-A6RDYP6R.js";import{t as l}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import{b as v}from"./chunk-DTO2YJWZ.js";import{e as te}from"./chunk-G6NAG2EK.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})},M={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,W(M))},W=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),B=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}=B(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,".*").replace(/\*/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 Ue=async r=>{let t=q(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 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-GBM3TZFD.js";import{p as f}from"./chunk-3SXTMY75.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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};
|
|
@@ -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-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import{t as n}from"./chunk-
|
|
2
|
+
import{d as S}from"./chunk-NBA6EFWU.js";import{e as q}from"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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,b,c,d}from"./chunk-
|
|
2
|
+
import{a,b,c,d}from"./chunk-PVPMHMKP.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{b as CommandBuilder,a as CommandError,d as exec,c as parseCommand};
|
|
@@ -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-KPWEJXPI.js";import"./chunk-CUIMSX4V.js";import"./chunk-NBA6EFWU.js";import"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as r,m as s,n as t,o as u,p as v,q as w,r as x,s as A,t as B,u as C}from"./chunk-
|
|
2
|
+
import{a as e,b as f,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as r,m as s,n as t,o as u,p as v,q as w,r as x,s as A,t as B,u as C}from"./chunk-MRCBHVSB.js";import{b as y,c as z}from"./chunk-Y4ARZGGL.js";import{a as p,b as q}from"./chunk-STI6DX7K.js";import{a,b,c,d}from"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,u as buildCommand,z as clearWorkerdEnv,A as createRuntime,C as current,x as detectExecutionContext,t as detectInvoker,e as detectRuntime,l as getArch,w as getCliCommand,m as getHomedir,k as getPlatform,o as getPlatformInfo,f as getRuntimeVersion,n as getTmpdir,h as isBrowser,v as isCommandInPath,j as isEdge,g as isRuntime,i as isServer,y as populateEnvFromContext,q as posixPath,s as resolvePathDirs,B as runtime,r as searchFileHierarchy,p 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,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-7BFBOLLC.js";import"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-S3XXNZSC.js";import"./chunk-XU5SILYR.js";import"./chunk-J2Z7NG2X.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-6SYJFJDF.js";import"./chunk-A6RDYP6R.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -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-VG72SSDI.js";import{a as S}from"./chunk-CUIMSX4V.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-LCG4SK6K.js";import"./chunk-7DPLGQHN.js";import"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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,6 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Fe,c as Re}from"./chunk-
|
|
3
|
-
`);for(let i=0;i<e.length;i++){let n=e[i];for(let{pattern:l,replacement:d}of qe){let c=l.exec(n);c!==null&&(ze(n,c.index)||_e(n,c.index)||a.push({path:t.path,line:i+1,message:`direct Deno API usage: ${c[0]} \u2014 use @eser/standards/cross-runtime (${d})`}))}}return a}}),ct=b.run,Ee=b.validator,pt=b.main;var k={validators:new Map,initialized:!1},Ye=()=>{o(P),o($),o(E),o(j),o(M),o(U),o(H),o(Z),o(te),o(se),o(ie),o(ne),o(de),o(pe),o(ue),o(ge),o(ye),o(he),o(be),o(we),o(Re),o(Ee)},I=()=>{k.initialized||(k.initialized=!0,Ye())},o=t=>{k.validators.set(t.name,t)},Ge=t=>(I(),k.validators.get(t)??null),N=()=>(I(),[...k.validators.values()]),Ke=()=>(I(),[...k.validators.keys()]),Ue=t=>({name:t.config.name,description:t.config.description,run:async s=>{let a=await t.run(s);return{name:a.name,passed:a.issues.length===0,issues:a.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:a.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:a.filesChecked,issuesFound:a.issues.length}}}}),Xe=t=>({name:t.name,description:t.description,run:async s=>{let a=await t.validate({root:s.root??".",options:s});return{name:a.name,passed:a.passed,issues:a.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:a.stats}}}),He=()=>{let t=[],s=[K,X,Q,ee,ae,oe,re,le,ce,me,fe,ve,ke,xe,Ve,Fe,b];for(let e of s)t.push(Ue(e));let a=[P,$,E,j,M];for(let e of a)t.push(Xe(e));return t.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let i=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{runtime:n}=await import("./mod-
|
|
2
|
+
import{a as Fe,c as Re}from"./chunk-H4SPMUT6.js";import{a as Pe}from"./chunk-K7MYEXOS.js";import{a as $e}from"./chunk-VC6ERZSI.js";import{a as ve,c as ye}from"./chunk-ER4ZWF4Y.js";import{a as ke,c as he}from"./chunk-7NUMDHE2.js";import{a as xe,c as be}from"./chunk-3QIPK7NI.js";import{a as Ve,c as we}from"./chunk-32HV3K27.js";import{a as Ce}from"./chunk-EBCQCAQ7.js";import{a as Se}from"./chunk-3KCPUYLZ.js";import{a as De}from"./chunk-5PNGVDLV.js";import{a as Te}from"./chunk-CLL3YG4W.js";import"./chunk-AGRTWPDI.js";import{a as ee,c as te}from"./chunk-CKNA5LIK.js";import{a as ae,c as se}from"./chunk-5MWX3POX.js";import{a as oe,c as ie}from"./chunk-QOX7VSID.js";import{a as re,c as ne}from"./chunk-FORPNESQ.js";import{a as le,c as de}from"./chunk-HVOPUZOM.js";import{a as ce,c as pe}from"./chunk-HYT26FYU.js";import{a as me,c as ue}from"./chunk-K6H7JTIH.js";import{a as fe,c as ge}from"./chunk-N2VBT43E.js";import{a as K,c as U}from"./chunk-BCPCQHDL.js";import{a as X,c as H}from"./chunk-YQVWAWMO.js";import{a as Q,c as Z}from"./chunk-NP723K5L.js";import{a as G}from"./chunk-RGUETQSC.js";import"./chunk-HVLKXRPA.js";import{b as B,c as Y}from"./chunk-W3RVRCUB.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import"./chunk-2VEVVX6U.js";import"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as _}from"./chunk-NBA6EFWU.js";import"./chunk-3BEX5FYF.js";import{f as W,h as J,k as z}from"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as g,d as y,f as x,g as R,h as L,k as q}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as T,b as A}from"./chunk-A6RDYP6R.js";import{t as F}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var C=async t=>{let s=await B(t);return s===null?null:s},Me=async t=>await Y(t);var P={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(t){let s=await De({root:t.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(a=>({severity:"error",message:`Circular dependency: ${a.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var $={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(t){let s=await Pe({root:t.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(a=>({severity:"error",message:`Missing export in ${a.packageName}: ${a.file}`,file:a.file})),stats:{packagesChecked:s.packagesChecked}}}};var E={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(t){let s=await Te({root:t.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(a=>({severity:"error",message:`${a.packageName}: "${a.exportPath}" should be "${a.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var j={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(t){let s=t.options?.requireExamples,a=await Se({root:t.root,requireExamples:s});return{name:"validate-docs",passed:a.isValid,issues:a.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:a.filesChecked,symbolsChecked:a.symbolsChecked}}}};var M={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(t){let s=await $e({root:t.root}),a=[];for(let e of s.inconsistencies)a.push({severity:"error",message:`${e.packageName}: ${e.field} mismatch - deno.json: ${JSON.stringify(e.denoValue)}, package.json: ${JSON.stringify(e.packageValue)}`});for(let e of s.dependencyInconsistencies){let i=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(i+=` (expected: ${e.expected}, actual: ${e.actual})`),a.push({severity:"error",message:i})}return{name:"validate-package-configs",passed:s.isConsistent,issues:a,stats:{packagesChecked:s.packagesChecked}}}};var qe=[{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"}],We=[],Je=t=>We.some(s=>s.test(t)),ze=(t,s)=>{let a=t.slice(0,s);return a.includes("//")||a.includes("/*")&&!a.includes("*/")},_e=(t,s)=>{let a=!1,e=!1,i=!1;for(let n=0;n<s;n++){let l=t[n];(n>0?t[n-1]:"")!=="\\"&&(l==="'"&&!e&&!i&&(a=!a),l==='"'&&!a&&!i&&(e=!e),l==="`"&&!a&&!e&&(i=!i))}return a||e||i},b=G({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:_,checkFile(t,s){if(s===void 0)return[];if(Je(t.path))return[];let a=[],e=s.split(`
|
|
3
|
+
`);for(let i=0;i<e.length;i++){let n=e[i];for(let{pattern:l,replacement:d}of qe){let c=l.exec(n);c!==null&&(ze(n,c.index)||_e(n,c.index)||a.push({path:t.path,line:i+1,message:`direct Deno API usage: ${c[0]} \u2014 use @eser/standards/cross-runtime (${d})`}))}}return a}}),ct=b.run,Ee=b.validator,pt=b.main;var k={validators:new Map,initialized:!1},Ye=()=>{o(P),o($),o(E),o(j),o(M),o(U),o(H),o(Z),o(te),o(se),o(ie),o(ne),o(de),o(pe),o(ue),o(ge),o(ye),o(he),o(be),o(we),o(Re),o(Ee)},I=()=>{k.initialized||(k.initialized=!0,Ye())},o=t=>{k.validators.set(t.name,t)},Ge=t=>(I(),k.validators.get(t)??null),N=()=>(I(),[...k.validators.values()]),Ke=()=>(I(),[...k.validators.keys()]),Ue=t=>({name:t.config.name,description:t.config.description,run:async s=>{let a=await t.run(s);return{name:a.name,passed:a.issues.length===0,issues:a.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:a.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:a.filesChecked,issuesFound:a.issues.length}}}}),Xe=t=>({name:t.name,description:t.description,run:async s=>{let a=await t.validate({root:s.root??".",options:s});return{name:a.name,passed:a.passed,issues:a.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:a.stats}}}),He=()=>{let t=[],s=[K,X,Q,ee,ae,oe,re,le,ce,me,fe,ve,ke,xe,Ve,Fe,b];for(let e of s)t.push(Ue(e));let a=[P,$,E,j,M];for(let e of a)t.push(Xe(e));return t.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let i=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{runtime:n}=await import("./mod-MLRQFSBE.js"),l;try{l=await n.fs.readTextFile(i)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${i}`}],mutations:[],stats:{}}}let d=Ce(l,{allowAsterisk:e.allowAsterisk,allowMultipleScopes:e.allowMultipleScopes,forceScope:e.forceScope,types:e.types});return{name:"validate-commit-msg",passed:d.valid,issues:d.issues.map(c=>({message:c})),mutations:[],stats:{}}}}),t};var Qe=async(t={})=>{let s=t.root??F.process.cwd(),e=(await C(s))?.stack??[],i=[...t.skip??[]],n=t.only??[],l=N(),d=[],c=[],V=[];for(let p of l){if(n.length>0&&!n.includes(p.name))continue;if(i.includes(p.name)){V.push(p.name);continue}if(p.requiredStacks.length>0&&e.length>0&&!p.requiredStacks.some(w=>e.includes(w))){c.push({name:p.name,reason:`Requires '${p.requiredStacks.join("' or '")}' stack`});continue}let S={...t.fix!==void 0?{fix:t.fix}:{}},m=await p.validate({root:s,options:S});d.push(m)}return{passed:d.every(p=>p.passed),results:d,skipped:c,disabled:V}},Ot=async t=>{let s=O(t??F.process.args,{string:["root","only","skip"],boolean:["fix","help"],alias:{h:"help"}});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(" -h, --help Show this help message"),T(void 0);let a=z.ansi(),e=W({renderer:a,sink:J.stdout()}),i=s.root,n=s.fix,l=s.only,d=s.skip,c=l!==void 0?l.split(",").map(r=>r.trim()):void 0,V=d!==void 0?d.split(",").map(r=>r.trim()):void 0,S=(await C(i??"."))?.stack?.join(", ")??"all (no .eser/manifest.yml)";e.writeln(g(`Validating codebase...
|
|
4
4
|
`)),e.writeln(g("Stack: "),q(S),g(`
|
|
5
5
|
`));let m=await Qe({root:i,only:c,skip:V,fix:n});for(let r of m.results){let u=r.passed?R("PASS"):x("FAIL"),v=Object.entries(r.stats).map(([f,D])=>`${D} ${f}`).join(", ");e.writeln(g(` ${r.name.padEnd(18)} `),u,g(` (${v})`))}if(m.skipped.length>0){e.writeln(y(`
|
|
6
6
|
Skipped (stack not configured):`));for(let r of m.skipped)e.writeln(y(` - ${r.name}: ${r.reason}`))}if(m.disabled.length>0){e.writeln(y(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as G,b as v}from"./chunk-Q2KSOC32.js";import{a as P,b as g}from"./chunk-B5IPHVXT.js";import{a as S,b as J}from"./chunk-Y53YTL4C.js";import{a as K,b as V}from"./chunk-536RBSFU.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 G,b as v}from"./chunk-Q2KSOC32.js";import{a as P,b as g}from"./chunk-B5IPHVXT.js";import{a as S,b as J}from"./chunk-Y53YTL4C.js";import{a as K,b as V}from"./chunk-536RBSFU.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-4WQGB7NO.js";import{a as A,b as C}from"./chunk-KQE6FMKW.js";import{a as M,b as w}from"./chunk-MXGRYONZ.js";import{a as I,b as T}from"./chunk-YVIGHK4H.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-455V3AE5.js";import"./chunk-J7YTWK67.js";import"./chunk-PVPMHMKP.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-2MXDKLNX.js"),{openaiFactory:r}=await import("./openai-EU5TJZ5T.js"),{geminiFactory:t}=await import("./gemini-F4KLO5VU.js"),{vertexaiFactory:a}=await import("./vertexai-EXTYPVHK.js"),{claudeCodeFactory:i}=await import("./claude-code-VUBEU7RR.js"),{ollamaFactory:c}=await import("./ollama-36F5QAOO.js"),{openCodeFactory:n}=await import("./opencode-7J3JDC44.js"),{kiroFactory:p}=await import("./kiro-HQLXD6ZU.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{a as b,b as D}from"./chunk-
|
|
2
|
+
import{a as b,b as D}from"./chunk-SOBOSRJB.js";import{e as C}from"./chunk-I4C675WP.js";import{a as A,d as E}from"./chunk-3BEX5FYF.js";import{k as y}from"./chunk-UJ6LH5FY.js";import{f as k,h as R,k as $}from"./chunk-GBM3TZFD.js";import{d as m,f as w,g as h,k as v}from"./chunk-3SXTMY75.js";import{a as P}from"./chunk-MG65QJY6.js";import{a as g,b as p,c as j}from"./chunk-A6RDYP6R.js";import{t as N}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-
|
|
2
|
+
import{a as _}from"./chunk-XVSIRN6G.js";import{a as B,b as H,c as Q,d as z}from"./chunk-P74JF7XR.js";import{a as A}from"./chunk-C7HGK43H.js";import{a as v}from"./chunk-IDMI5OBK.js";import{a as P}from"./chunk-F5BPXG5L.js";import{b as L,c as N,d as V}from"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as j,c as b,d as G,f as J,h as W}from"./chunk-UESOCN2G.js";import{a as q,b as M,d as x}from"./chunk-2EVWKUN6.js";import{a as U}from"./chunk-LNNNLUZT.js";import{c as O,d as E,j as I,n as $,p as y,q as T}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{a as F,b as D}from"./chunk-A6RDYP6R.js";import{t as h}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var Z=o=>o.split(`
|
|
3
3
|
`).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ee=async(o,e)=>{let i=[],n=(e.startsWith(o)?e.slice(o.length+1):e).split("/");n.pop();for(let t=n.length;t>=0;t--){let r=`${t===0?o:`${o}/${n.slice(0,t).join("/")}`}/.folder-rules.md`,c=t===0?".":n.slice(0,t).join("/");try{let p=await h.fs.readTextFile(r),g=Z(p);for(let f of g)i.push({folder:c,rule:f})}catch{}}return i},k=async(o,e)=>{let i=new Set,a=[];for(let n of e){let t=await ee(o,n);for(let s of t){let r=`${s.folder}::${s.rule}`;i.has(r)||(i.add(r),a.push(s))}}return a};var ye=async o=>{let e=h.process.cwd(),i=q(o),a=M(o);if(!await T(e)){let l=await I(e);return await x({error:`noskills not initialized. Run: ${U("init",l)}`},i),D({exitCode:1})}let n=null;for(let l of a)l.startsWith("--answer=")&&(n=l.slice(9));let t=await E(e),s=await I(e);if(t.pendingClear&&(t={...t,pendingClear:!1},await y(e,t)),s===null)return await x({error:"No config found"},i),D({exitCode:1});let c=(await $(e)).filter(l=>s.concerns.includes(l.id));if(n!==null){let l=await se(e,t,s,c,n);await y(e,l);let u={...l,lastCalledAt:new Date().toISOString()};await y(e,u);let m=await P(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=A(u,c,m,s,d,X);return await x(Y,i),F(void 0)}let p={...t,lastCalledAt:new Date().toISOString()};await y(e,p);let g=await P(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=A(p,c,g,s,f,C);return await x(S,i),F(void 0)},se=async(o,e,i,a,n)=>{switch(e.phase){case"DISCOVERY":{let t=null;try{let r=JSON.parse(n);typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=r)}catch{}let s=e;if(t!==null)for(let[r,c]of Object.entries(t))typeof c=="string"&&c.length>0&&(s=b(s,r,c));else{let r=L(a),c=N(r,s.discovery.answers);if(c===null)return e;s=b(s,c.id,n)}return V(s.discovery.answers)&&(s=G(s)),s}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let r=JSON.parse(n);t={involvesUI:r.involvesUI===!0,involvesPublicAPI:r.involvesPublicAPI===!0,involvesMigration:r.involvesMigration===!0,involvesDataHandling:r.involvesDataHandling===!0}}catch{t={involvesUI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let s={...e,classification:t};try{await _(o,s,a)}catch{}return s}return e}case"SPEC_APPROVED":{let t=J(e);return t.spec!==null&&(await B(o,t.spec,"executing"),await z(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(i.verifyCommand!==null&&i.verifyCommand!==void 0&&i.verifyCommand.length>0){let s=await ie(o,i.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ne(o,e,n,a)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},r=W(e,s);return r=j(r,"EXECUTING"),r={...r,execution:{...r.execution,lastProgress:`Resolved: ${n}`}},r}default:return e}},ne=async(o,e,i,a)=>{let n;try{n=JSON.parse(i)}catch{return{...e,execution:{...e.execution,lastProgress:i,awaitingStatusReport:!1}}}let t=n.completed??[],s=n.remaining??[],r=n.blocked??[],c=[...s,...r],p=e.execution.debt?.unaddressedIterations??0,g=c.length>0?{items:c,fromIteration:e.execution.iteration,unaddressedIterations:1}:null,f=g;if(e.execution.debt!==null&&g!==null){let l=new Set(t.map(d=>d.toLowerCase().trim())),u=e.execution.debt.items.filter(d=>!l.has(d.toLowerCase().trim())),m=[...new Set([...u,...c])];f=m.length>0?{items:m,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:u.length>0?p+1:1}:null}else if(e.execution.debt!==null&&g===null){let l=new Set(t.map(m=>m.toLowerCase().trim())),u=e.execution.debt.items.filter(m=>!l.has(m.toLowerCase().trim()));f=u.length>0?{items:u,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:p+1}:null}let w=t.length>0?`Completed: ${t.join(", ")}`:"Status report submitted",C=e.execution.lastVerification===null||e.execution.lastVerification.passed===!0,S=f===null&&C;if(S&&e.spec!==null){let l=await v(o,e.spec);if(l!==null){let u=e.execution.completedTasks??[],m=new Set(u),d=l.tasks.find(R=>!m.has(R.id));if(d!==void 0)return await H(o,e.spec,d.id),await Q(o,e.spec,d.id,"done"),{...e,pendingClear:!0,execution:{...e.execution,lastProgress:`Task ${d.id} accepted: ${w}`,awaitingStatusReport:!1,debt:f,completedTasks:[...u,d.id]}}}}return{...e,pendingClear:S,execution:{...e.execution,lastProgress:S?w:`Task not accepted \u2014 remaining items must be addressed first. ${w}`,awaitingStatusReport:!1,debt:f}}},ie=async(o,e)=>{try{let{execSync:i}=await import("node:child_process"),a=i(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(a).slice(0,4e3),timestamp:new Date().toISOString()}}catch(i){let a=i,n=((a.stdout??"")+(a.stderr??"")).slice(0,4e3);return a.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${i instanceof Error?i.message:String(i)}`,timestamp:new Date().toISOString()}}},K=async(o,e)=>{let i=[...e.execution.modifiedFiles??[]],a=await re(o);return[...new Set([...i,...a])]},re=async o=>{let e=`${o}/${O.stateDir}/files-changed.jsonl`;try{let a=(await h.fs.readTextFile(e)).trim().split(`
|
|
4
4
|
`).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as F}from"./chunk-CDPSH56U.js";import{b as g,d as E}from"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";import*as n from"node:fs/promises";import*as R from"node:fs";import*as i from"node:path";import*as v from"node:os";import*as b from"node:child_process";import a from"node:process";import{Buffer as p}from"node:buffer";import{Readable as k,Writable as O}from"node:stream";var S={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},x=()=>{let r=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),c=(e,t)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new g(t):e};return{async readFile(e,t){try{let s=await n.readFile(e,{signal:t?.signal});return new Uint8Array(s)}catch(s){return c(s,e)}},async readTextFile(e,t){try{return await n.readFile(e,{encoding:"utf-8",signal:t?.signal})}catch(s){return c(s,e)}},async writeFile(e,t,s){let d=s?.append?"a":"w";await n.writeFile(e,t,{signal:s?.signal,mode:s?.mode,flag:d})},async writeTextFile(e,t,s){let d=s?.append?"a":"w";await n.writeFile(e,t,{encoding:"utf-8",signal:s?.signal,mode:s?.mode,flag:d})},async exists(e){try{return await n.access(e),!0}catch{return!1}},async stat(e){try{let t=await n.stat(e);return r(t)}catch(t){return c(t,e)}},async lstat(e){try{let t=await n.lstat(e);return r(t)}catch(t){return c(t,e)}},async mkdir(e,t){await n.mkdir(e,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(e){await n.mkdir(e,{recursive:!0})},async remove(e,t){try{await n.rm(e,{recursive:t?.recursive??!1,force:!1})}catch(s){c(s,e)}},async*readDir(e){try{let t=await n.readdir(e,{withFileTypes:!0});for(let s of t)yield{name:s.name,isFile:s.isFile(),isDirectory:s.isDirectory(),isSymlink:s.isSymbolicLink()}}catch(t){c(t,e)}},async copyFile(e,t){await n.copyFile(e,t)},async rename(e,t){await n.rename(e,t)},async makeTempDir(e){let t=e?.dir??v.tmpdir(),s=e?.prefix??"",d=e?.suffix??"",u=await n.mkdtemp(i.join(t,s));if(d){let o=u+d;return await n.rename(u,o),o}return u},async realPath(e){try{return await n.realpath(e)}catch(t){throw t instanceof Error&&"code"in t&&t.code==="ENOENT"?new g(e):t}},watch(e,t){let s=t?.recursive??!0,d=[],u=[],o=[],l=!1,P=m=>{l||(o.length>0?o.shift()({value:m,done:!1}):u.push(m))};for(let m of e)try{let f=R.watch(m,{recursive:s},(h,y)=>{y!==null&&P({kind:h==="rename"?"create":"modify",paths:[i.join(m,y)]})});d.push(f)}catch{}return{close:()=>{l=!0;for(let m of d)m.close();for(let m of o)m({value:void 0,done:!0});o=[]},[Symbol.asyncIterator]:()=>({next:()=>l?Promise.resolve({value:void 0,done:!0}):u.length>0?Promise.resolve({value:u.shift(),done:!1}):new Promise(m=>{o.push(m)})})}},async chmod(e,t){await n.chmod(e,t)},async*walk(e,t){let s=t?.includeDirs??!0,d=t?.includeFiles??!0,u=t?.exts,o=t?.skip,l=async function*(P){let m=await n.readdir(P,{withFileTypes:!0});for(let f of m){let h=i.join(P,f.name);if(o?.some(w=>w.test(h)))continue;let y=f.isSymbolicLink();if(f.isDirectory())s&&(yield{path:h,name:f.name,isFile:!1,isDirectory:!0,isSymlink:y}),yield*l(h);else if(f.isFile()||y){if(!d||u&&!u.some(w=>f.name.endsWith(w.startsWith(".")?w:`.${w}`)))continue;yield{path:h,name:f.name,isFile:f.isFile(),isDirectory:!1,isSymlink:y}}}};yield*l(e)}}},W=()=>({join:i.join,resolve:i.resolve,dirname:i.dirname,basename:i.basename,extname:i.extname,normalize:i.normalize,isAbsolute:i.isAbsolute,relative:i.relative,parse:i.parse,format:i.format,sep:i.sep,delimiter:i.delimiter}),T=()=>({spawn(r,c=[],e){return new Promise((t,s)=>{let d=b.spawn(r,c,{cwd:e?.cwd,env:e?.env?{...a.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),u=[],o=[];d.stdout?.on("data",l=>u.push(l)),d.stderr?.on("data",l=>o.push(l)),d.on("error",s),d.on("close",l=>{t({success:l===0,code:l??1,stdout:new Uint8Array(p.concat(u)),stderr:new Uint8Array(p.concat(o))})})})},async exec(r,c=[],e){let t=await this.spawn(r,c,e);if(!t.success){let s=new TextDecoder().decode(t.stderr);throw new E(r,t.code,s)}return new TextDecoder().decode(t.stdout).trim()},async execJson(r,c=[],e){let t=await this.exec(r,c,e);return JSON.parse(t)},spawnChild(r,c=[],e){let t=b.spawn(r,c,{cwd:e?.cwd,env:e?.env?{...a.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),s=[],d=[];t.stdout?.on("data",o=>s.push(o)),t.stderr?.on("data",o=>d.push(o));let u=new Promise((o,l)=>{t.on("error",l),t.on("close",(P,m)=>{o({success:P===0,code:P??1,signal:m??void 0})})});return{pid:t.pid,stdin:t.stdin?O.toWeb(t.stdin):null,stdout:t.stdout?k.toWeb(t.stdout):null,stderr:t.stderr?k.toWeb(t.stderr):null,status:u,output:async()=>{let o=await u;return{success:o.success,code:o.code,stdout:new Uint8Array(p.concat(s)),stderr:new Uint8Array(p.concat(d))}},kill:o=>{t.kill(o)}}}}),A=()=>({get(r){return a.env[r]},set(r,c){a.env[r]=c},delete(r){delete a.env[r]},has(r){return r in a.env},toObject(){let r={};for(let[c,e]of Object.entries(a.env))e!==void 0&&(r[c]=e);return r}}),D=()=>({exit(r){a.exit(r)},setExitCode(r){a.exitCode=r},cwd(){return a.cwd()},chdir(r){a.chdir(r)},hostname(){return v.hostname()},execPath(){return a.execPath},args:a.argv.slice(2),pid:a.pid,stdin:k.toWeb(a.stdin),stdout:O.toWeb(a.stdout),stderr:O.toWeb(a.stderr),isTerminal(r){switch(r){case"stdin":return a.stdin.isTTY===!0;case"stdout":return a.stdout.isTTY===!0;case"stderr":return a.stderr.isTTY===!0}},setStdinRaw(r){a.stdin.setRawMode(r)}}),j=()=>{let r=x(),c=W(),e=T(),t=A(),s=D();return{name:"node",version:a.versions.node,capabilities:S,fs:r,path:c,exec:e,env:t,process:s}};export{S as NODE_CAPABILITIES,j as createNodeRuntime};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-KQE6FMKW.js";import"./chunk-455V3AE5.js";import"./chunk-J7YTWK67.js";import"./chunk-PVPMHMKP.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";export{a as OllamaModel,b as ollamaFactory};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-MXGRYONZ.js";import"./chunk-455V3AE5.js";import"./chunk-J7YTWK67.js";import"./chunk-PVPMHMKP.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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 v,b as k}from"./chunk-
|
|
2
|
+
import{a as v,b as k}from"./chunk-6QC7ILI5.js";import"./chunk-XU5SILYR.js";import{c}from"./chunk-WG6J7DFO.js";import{a as p,b as w,c as h,h as r}from"./chunk-JOTAKQMZ.js";import{a as $}from"./chunk-JYNHFD6B.js";import"./chunk-GBM3TZFD.js";import"./chunk-3SXTMY75.js";import{a as d,b as g}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import{e as y}from"./chunk-G6NAG2EK.js";var x=y($(),1);var M=async i=>{let e=n.process.cwd(),s=v(i),t=w({target:s==="agent"?"non-interactive":"interactive"});if(!k(i).includes("--force")){if(s==="agent")return r.error(t,"Purge requires `--force` flag in agent mode."),g({exitCode:1});let l=await h(t,{message:"This will remove all noskills specs, rules, concerns, and hooks. Continue?"});if(p(l)||l!==!0)return r.info(t,"Aborted."),d(void 0)}return r.step(t,"Purging noskills content..."),await u(`${e}/${c.concernsDir}`,t,"`.eser/concerns/`"),await u(`${e}/${c.specsDir}`,t,"`.eser/specs/`"),await u(`${e}/${c.rulesDir}`,t,"`.eser/rules/`"),await u(`${e}/${c.stateDir}`,t,"`.eser/.state/`"),await C(e,t),await T(e,t),await m(`${e}/.cursorrules`,t,"`.cursorrules`"),await m(`${e}/.windsurfrules`,t,"`.windsurfrules`"),await m(`${e}/.kiro/steering/conventions.md`,t,"`.kiro/steering/conventions.md`"),await m(`${e}/.github/copilot-instructions.md`,t,"`.github/copilot-instructions.md`"),await F(e,t),r.success(t,"Purge complete."),d(void 0)},u=async(i,e,s)=>{try{await n.fs.stat(i);let{rmSync:t}=await import("node:fs");t(i,{recursive:!0,force:!0}),r.step(e,` Removed ${s}`)}catch{}},m=async(i,e,s)=>{try{await n.fs.stat(i);let{unlinkSync:t}=await import("node:fs");t(i),r.step(e,` Removed ${s}`)}catch{}},C=async(i,e)=>{let s=`${i}/${c.manifestFile}`;try{let t=await n.fs.readTextFile(s),o=x.parseDocument(t);o.has("noskills")&&(o.delete("noskills"),await n.fs.writeTextFile(s,o.toString()),r.step(e," Removed noskills section from `manifest.yml`"))}catch{}},T=async(i,e)=>{let s=`${i}/CLAUDE.md`,t="<!-- noskills:start -->",o="<!-- noskills:end -->";try{let a=await n.fs.readTextFile(s),l=a.indexOf(t),f=a.indexOf(o);l!==-1&&f!==-1&&(a=a.slice(0,l).trimEnd()+`
|
|
3
3
|
`+a.slice(f+o.length).trimStart(),await n.fs.writeTextFile(s,a.trimEnd()+`
|
|
4
4
|
`),r.step(e," Removed noskills section from `CLAUDE.md`"))}catch{}},F=async(i,e)=>{let s=`${i}/.claude/settings.json`;try{let t=await n.fs.readTextFile(s),o=JSON.parse(t);o.hooks!==void 0&&(delete o.hooks,await n.fs.writeTextFile(s,JSON.stringify(o,null,2)+`
|
|
5
5
|
`),r.step(e," Removed hooks from `.claude/settings.json`"))}catch{}};export{M 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-I4C675WP.js";import"./chunk-UJ6LH5FY.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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-UJ6LH5FY.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.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-NTHP6SND.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as g}from"./chunk-2VEVVX6U.js";import{a as C,b as v}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as w}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as n,f as h,g as f,h as y,i as o}from"./chunk-3SXTMY75.js";import{d as l}from"./chunk-PVPMHMKP.js";import{a as m}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var t=C(),A=async()=>(await l`git status --porcelain`.noThrow().text()).length===0,b=async()=>{let e=await l`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
|
|
3
3
|
`):[]},P=async(e,s)=>{for(let r of s)await l`git add ${r}`.spawn();await l`git commit -m ${e}`.spawn()},O=async()=>{await l`git push origin HEAD`.spawn()},k=async e=>{await l`git tag -d ${e}`.noThrow().spawn();let s=`:refs/tags/${e}`;await l`git push origin ${s}`.noThrow().spawn()},T=async e=>{let s=new TextEncoder,r=new TextDecoder,a=new Uint8Array(256);await Deno.stderr.write(s.encode(`${e} [y/N] `));let p=await Deno.stdin.read(a),d=r.decode(a.subarray(0,p??0)).trim();return d==="y"||d==="Y"},M=async e=>{let{type:s,dryRun:r=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit or stash changes first.");let a=await b();if(a.length>0&&e.yes!==!0)throw new Error(`You have ${a.length} unpushed commit(s):
|
|
4
4
|
${a.join(`
|
|
5
5
|
`)}
|
|
6
6
|
|
|
7
|
-
Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-
|
|
7
|
+
Push first, or re-run with --yes to continue anyway.`);let p=await c()??"0.0.0";s!=="same"&&await(await import("./versions-IVXYMSAZ.js")).versions(s,{dryRun:r});let d=await c()??p,u=!1;try{await(await import("./changelog-gen-7V37P7PE.js")).generateChangelog({dryRun:r}),u=!0}catch{u=!1}let x=!1,E=!1;if(!r){u&&await l`deno fmt CHANGELOG.md`.noThrow().spawn();let R=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],$=`chore(codebase): release v${d}`;await P($,R),x=!0,await O(),E=!0}return{version:d,previousVersion:p,changelogGenerated:u,committed:x,pushed:E,dryRun:r}},U=async(e={})=>{let{dryRun:s=!1}=e;if(!await A())throw new Error("Working tree is dirty. Commit and push first.");let r=await b();if(r.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
|
|
8
8
|
${r.join(`
|
|
9
9
|
`)}`);let a=await c();if(a===void 0||!/^\d+\.\d+\.\d+$/.test(a))throw new Error(`Invalid or missing version in VERSION file: "${a}"`);let p=`v${a}`;if(!s){let d=`chore(codebase): release v${a}`;await l`git commit --allow-empty -m ${d}`.spawn(),await l`git push origin HEAD`.spawn()}return{version:a,tag:p,dryRun:s}},H=async(e={})=>{let s=await c();if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let r=`v${s}`;if(e.yes!==!0)throw new Error(`This will delete tag ${r} locally and remotely. Re-run with --yes to confirm.`);return await k(r),{version:s,tag:r,deleted:!0}},I=e=>w.fromPromise(()=>M(e)),V=e=>w.fromPromise(()=>U(e)),D=e=>w.fromPromise(()=>H(e)),j=e=>{let s=e.args[0];return s===void 0||!["patch","minor","major","same"].includes(s)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:s,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},N=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),S=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.dryRun?(t.writeln(y("\u26A0"),n(" [DRY RUN] Release preview:")),t.writeln(o("\u2139"),n(` Version: ${s.previousVersion} -> ${s.version}`)),t.writeln(o("\u2139"),n(` Changelog: ${s.changelogGenerated?"generated":"no user-facing changes"}`)),t.writeln(o("\u2139"),n(" No changes were made."))):(t.writeln(f("\u2713"),n(` Released v${s.version}`)),t.writeln(o("\u2139"),n(` Version: ${s.previousVersion} -> ${s.version}`)),t.writeln(o("\u2139"),n(` Changelog: ${s.changelogGenerated?"updated":"no user-facing changes"}`)),t.writeln(o("\u2139"),n(` Committed: ${s.committed}`)),t.writeln(o("\u2139"),n(` Pushed: ${s.pushed}`)),t.writeln(o("\u2139"),n(" CI will validate, tag, and publish.")),t.writeln(o("\u2139"),n(" Watch: https://github.com/eser/stack/actions"))),i.ok(void 0)},Y=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.dryRun?t.writeln(y("\u26A0"),n(` [DRY RUN] Would delete and recreate tag ${s.tag}`)):(t.writeln(f("\u2713"),n(` Re-tagged ${s.tag}`)),t.writeln(o("\u2139"),n(" CI will validate and publish."))),i.ok(void 0)},F=e=>{if(i.isFail(e)){let r=e.error,a=r instanceof Error?r.message:r.message??String(r);return t.writeln(h("\u2717"),n(" "+a)),i.fail({exitCode:1})}let{value:s}=e;return s.deleted&&t.writeln(f("\u2713"),n(` Deleted tag v${s.version} (local + remote).`)),i.ok(void 0)},W=g.createTrigger({handler:I,adaptInput:j,adaptOutput:S}),L=g.createTrigger({handler:V,adaptInput:N,adaptOutput:Y}),B=g.createTrigger({handler:D,adaptInput:G,adaptOutput:F}),re=async e=>{let s=m(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),r=s._[0],a=s["dry-run"]===!0,p=s.yes===!0;if(r!==void 0&&!a&&!p&&["patch","minor","major","same"].includes(r)){let u=await c()??"0.0.0";if(t.writeln(o("\u2139"),n(` Current version: ${u}`)),t.writeln(o("\u2139"),n(` Bump type: ${r}`)),t.writeln(o("\u2139"),n(" This will bump version, generate changelog, commit, and push.")),await t.flush(),!await T("Proceed?"))return t.writeln(y("\u26A0"),n(" Aborted.")),i.ok(void 0);s.yes=!0}let d=v("release",s);return await W(d)},ne=async e=>{let s=m(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),r=v("rerelease",s);return await L(r)},te=async e=>{let s=m(e??[],{boolean:["yes"],alias:{y:"yes"}}),r=v("unrelease",s);return await B(r)};export{W as handleReleaseCli,L as handleRereleaseCli,B as handleUnreleaseCli,re as main,M as release,I as releaseHandler,U as rerelease,V as rereleaseHandler,ne as rereleaseMain,H as unrelease,D as unreleaseHandler,te 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"./chunk-
|
|
2
|
+
import"./chunk-SOSF762G.js";import"./chunk-JOTAKQMZ.js";import{a as y}from"./chunk-2VEVVX6U.js";import{a as E,b as A}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as $}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as p,f as P,g as m,h as C}from"./chunk-3SXTMY75.js";import{e as u}from"./chunk-PVPMHMKP.js";import"./chunk-PWLF3WXM.js";import"./chunk-KKBIUT5L.js";import"./chunk-SQINSLNL.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as R,n as w}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{v as c}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var h=E(),O=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,T=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},k=t=>{let e=t.split(/\r?\n/),r=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(O);i!==null&&/^\d/.test(i[1])&&r.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return r.length===0?[]:r.map((s,o)=>{let i=r[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,n=e.slice(g,a);for(;n.length>0&&n[0].trim()==="";)n.shift();for(;n.length>0&&n[n.length-1].trim()==="";)n.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return n.length>0&&d.push("",...n),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
|
|
3
3
|
`).trim()}
|
|
4
4
|
`}})},I=async(t={})=>{let{changelogPath:e="CHANGELOG.md",root:r="."}=t,s=w(r,e),o=await c.runtime.fs.readTextFile(s);return{entries:k(o)}},S=async(t,e)=>{try{return await u.exec`gh release view ${t} --repo ${e}`.quiet().text(),!0}catch{return!1}},b=async t=>{let{repo:e,createIfMissing:r=!1,changelogPath:s="CHANGELOG.md",root:o=".",releaseTitle:i="eserstack {tag}"}=t,{entries:g}=await I({changelogPath:s,root:o});if(g.length===0)throw new Error("No release headings found in CHANGELOG.md.");let a=t.tag!==void 0?T(t.tag):g[0].tag,n=g.find(x=>x.tag===a);if(n===void 0)throw new Error(`No matching changelog section found for ${a}.`);let d=await c.runtime.fs.makeTempDir({prefix:"eserstack-release-"}),f=R(d,`${a}-notes.md`);await c.runtime.fs.writeTextFile(f,n.notes);try{if(await S(a,e))return await u.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"updated"};if(!r)return{tag:a,entry:n,action:"skipped"};let N=i.replace("{tag}",a);try{return await u.exec`gh release create ${a} --repo ${e} --title ${N} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"created"}}catch{return await u.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:n,action:"updated"}}}finally{await c.runtime.fs.remove(d,{recursive:!0})}},G=t=>$.fromPromise(()=>b(t)),H=t=>{let e=t.flags.repo??c.runtime.env.get("GITHUB_REPOSITORY")??"";return e===""?l.fail(y.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})},L=t=>{if(l.isFail(t)){let r=t.error,s=r instanceof Error?r.message:r.message??String(r);return h.writeln(P("\u2717"),p(" "+s)),l.fail({exitCode:1})}let{value:e}=t;switch(e.action){case"created":h.writeln(m("\u2713"),p(` Created release ${e.tag} with changelog notes.`));break;case"updated":h.writeln(m("\u2713"),p(` Updated release notes for ${e.tag}.`));break;case"skipped":h.writeln(C("\u26A0"),p(` Release ${e.tag} not found. Skipping (pass --create-if-missing to create).`));break}return l.ok(void 0)},M=y.createTrigger({handler:G,adaptInput:H,adaptOutput:L}),W=async t=>{let e=v(t??[],{string:["repo","tag"],boolean:["create-if-missing"],alias:{h:"help"}}),r=A("release-notes",e);return await M(r)};export{M as handleCli,S as hasGitHubRelease,W as main,T as normalizeTag,I as parseChangelog,k as parseChangelogText,b as syncReleaseNotes,G as syncReleaseNotesHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as y,d as v}from"./chunk-
|
|
2
|
+
import{c as y,d as v}from"./chunk-BP3IFAPO.js";import{a as P}from"./chunk-NTHP6SND.js";import"./chunk-4SYC4WJV.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-JYNHFD6B.js";import{a as h}from"./chunk-2VEVVX6U.js";import{a as f,b as R}from"./chunk-4DOMGQOO.js";import"./chunk-WF6JNPZS.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as c}from"./chunk-3BEX5FYF.js";import"./chunk-GBM3TZFD.js";import"./chunk-7DPLGQHN.js";import{b as a,f as g,g as u,h as d,i as m}from"./chunk-3SXTMY75.js";import"./chunk-PVPMHMKP.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as t}from"./chunk-A6RDYP6R.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var o=f(),C=async(e={})=>{let{root:r=".",remote:n="origin",tagPrefix:T="v",messageTemplate:x="Release {tag}",dryRun:l=!1}=e,s=await P({root:r});if(s===void 0||!/^\d+\.\d+\.\d+$/.test(s))throw new Error(`Invalid or missing version in VERSION file: "${s}"`);let i=`${T}${s}`,w=x.replace("{tag}",i).replace("{version}",s);return l||(await y(i,w),await v(n,i)),{version:s,tag:i,remote:n,dryRun:l}},A=e=>c.fromPromise(()=>C(e)),E=e=>t.ok({dryRun:e.flags["dry-run"]===!0}),$=e=>{if(t.isFail(e))return o.writeln(g("\u2717"),a(" "+(e.error instanceof Error?e.error.message:String(e.error)))),t.fail({exitCode:1});let{value:r}=e;return r.dryRun?o.writeln(d("\u26A0"),a(` [DRY RUN] Would create and push tag ${r.tag}`)):(o.writeln(u("\u2713"),a(` Created tag ${r.tag}`)),o.writeln(m("\u2139"),a(` Pushed tag ${r.tag} to ${r.remote}`))),t.ok(void 0)},O=h.createTrigger({handler:A,adaptInput:E,adaptOutput:$}),U=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),n=R("release-tag",r);return await O(n)};export{O as handleCli,U as main,C as pushReleaseTag,A as pushReleaseTagHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as u}from"./chunk-
|
|
2
|
+
import{i as u}from"./chunk-UESOCN2G.js";import{d as c,e as d}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as m,h as p,k as l}from"./chunk-GBM3TZFD.js";import{d as a,g as o}from"./chunk-3SXTMY75.js";import{a as r}from"./chunk-A6RDYP6R.js";import{t as n}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),i=n.process.cwd(),s=await c(i);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(i,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as y,b as k}from"./chunk-
|
|
2
|
+
import{a as y,b as k}from"./chunk-F5BPXG5L.js";import{a as g,b as x}from"./chunk-LNNNLUZT.js";import{c as w,j as c}from"./chunk-WG6J7DFO.js";import"./chunk-JYNHFD6B.js";import{f as a,h as l,k as d}from"./chunk-GBM3TZFD.js";import{c as p,d as o,f,g as h}from"./chunk-3SXTMY75.js";import{a as u,b as m}from"./chunk-A6RDYP6R.js";import{t as i}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var L=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="list")return await v();if(e==="promote")return await C(s?.slice(1));let t=await c(i.process.cwd()),n=x(t),r=a({renderer:d.ansi(),sink:l.stdout()});return r.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await r.close(),u(void 0)},$=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=i.process.cwd(),n=s?.join(" "),r=await c(t);if(n===void 0||n.length===0)return e.writeln(f("Please provide a rule: "),p(`${g('rule add "Use Deno Tests for all tests"',r)}`)),await e.close(),m({exitCode:1});let P=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),A=`${t}/${w.rulesDir}/${P}.md`;return await i.fs.mkdir(`${t}/${w.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(A,n+`
|
|
3
3
|
`),e.writeln(h("\u2714")," Rule added: ",o(n)),r!==null&&r.tools.length>0&&(await k(t,r.tools,r),e.writeln(o(" Tool files synced."))),await e.close(),u(void 0)},v=async()=>{let s=a({renderer:d.ansi(),sink:l.stdout()}),e=i.process.cwd(),t=await y(e);s.writeln(p("Rules")),s.writeln("");let n=await c(e);if(t.length===0)s.writeln(o(` No rules yet. Add one with: ${g('rule add "..."',n)}`));else for(let r of t)s.writeln(" ",o("\u2022"),` ${r}`);return await s.close(),u(void 0)},C=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(f("Please provide the decision text to promote.")),await e.close(),m({exitCode:1})):(await e.close(),await $(s))};export{L as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as L}from"./chunk-
|
|
2
|
+
import{a as L}from"./chunk-C7HGK43H.js";import{a as G}from"./chunk-F5BPXG5L.js";import"./chunk-4GQY3STW.js";import"./chunk-N4HITOTN.js";import{a as V,f as B}from"./chunk-UESOCN2G.js";import{a as M,b as C}from"./chunk-LNNNLUZT.js";import{d as x,e as g,j as $,n as F,q as U}from"./chunk-WG6J7DFO.js";import{a as D,b as A,d as N}from"./chunk-JOTAKQMZ.js";import"./chunk-JYNHFD6B.js";import{f as R,h as O,k as T}from"./chunk-GBM3TZFD.js";import{c as P,d as r,f as u,g as v,h,k as I}from"./chunk-3SXTMY75.js";import{a as S,b as w}from"./chunk-A6RDYP6R.js";import{t as y}from"./chunk-MRCBHVSB.js";import"./chunk-Y4ARZGGL.js";import"./chunk-STI6DX7K.js";import"./chunk-DTO2YJWZ.js";import"./chunk-G6NAG2EK.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${M("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=B(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=V(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await G(e),j=L(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-JI2A2546.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-JI2A2546.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
|
|
3
3
|
`)},W=(n,t)=>{if(n===void 0)return null;let e=`${t}=`;for(let a of n)if(a.startsWith(e)){let s=parseInt(a.slice(e.length),10);if(!isNaN(s)&&s>0)return s}return null},H=async(n,t,e)=>{let a=`${n}/.eser/.state/blocked.log`,s=`[${new Date().toISOString()}] iteration=${e} reason=${t}
|
|
4
4
|
`;try{let{appendFileSync:o,mkdirSync:p}=await import("node:fs"),{dirname:c}=await import("node:path");p(c(a),{recursive:!0}),o(a,s)}catch{}};export{ae as main};
|