eser 4.1.13 → 4.1.22
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/README.md +152 -3
- package/chunks/add-4LRHVBEC.js +7 -0
- package/chunks/anthropic-GBDSASP5.js +1 -0
- package/chunks/approve-364KOMLB.js +1 -0
- package/chunks/ask-752YJEHO.js +2 -0
- package/chunks/block-JVJQU723.js +1 -0
- package/chunks/browser-6UKLTPJO.js +1 -0
- package/chunks/build-VKOO2WEA.js +6 -0
- package/chunks/bun-N3TIWBPP.js +1 -0
- package/chunks/changelog-gen-ZCNNOY7G.js +7 -0
- package/chunks/chunk-2R4MK2KR.js +2 -0
- package/chunks/chunk-2TRQKCFC.js +1 -0
- package/chunks/chunk-34GCQZ3Z.js +3 -0
- package/chunks/chunk-3APERFKY.js +18 -0
- package/chunks/chunk-3DMTTLUJ.js +1 -0
- package/chunks/chunk-3TYZYY77.js +1 -0
- package/chunks/chunk-4HMEWMWL.js +1 -0
- package/chunks/chunk-4HNB3UTC.js +1 -0
- package/chunks/chunk-4OIKB2P5.js +1 -0
- package/chunks/chunk-4Q3SEHPE.js +1 -0
- package/chunks/chunk-4S7QYPS6.js +1 -0
- package/chunks/chunk-5C7ZQN6X.js +3 -0
- package/chunks/chunk-5O7V5P53.js +1 -0
- package/chunks/chunk-5UGVJVIQ.js +1 -0
- package/chunks/chunk-6FMPNAZ3.js +1 -0
- package/chunks/chunk-6U2VEZEM.js +1 -0
- package/chunks/chunk-6YRN6OJC.js +2 -0
- package/chunks/chunk-7GS5KPVF.js +1 -0
- package/chunks/chunk-7M3ONEMO.js +32 -0
- package/chunks/chunk-7QNRH7OR.js +3 -0
- package/chunks/chunk-A2GDVOQP.js +1 -0
- package/chunks/chunk-AK3OJD4W.js +1 -0
- package/chunks/chunk-ATLUGTI7.js +2 -0
- package/chunks/chunk-BK2BDHKB.js +1 -0
- package/chunks/chunk-BKVQBSFV.js +6 -0
- package/chunks/chunk-BP2MZX2P.js +2 -0
- package/chunks/chunk-C3OSYHJY.js +2 -0
- package/chunks/chunk-CDLEA2PD.js +1 -0
- package/chunks/chunk-DDLQMSA7.js +0 -0
- package/chunks/chunk-DLVQNMNV.js +1 -0
- package/chunks/chunk-DOV5776P.js +3 -0
- package/chunks/chunk-DQAEQEXD.js +1 -0
- package/chunks/chunk-DRQWYJMH.js +1 -0
- package/chunks/chunk-DXB73IDG.js +1 -0
- package/chunks/chunk-DZD6MI45.js +5 -0
- package/chunks/chunk-EW5NCPPE.js +3 -0
- package/chunks/chunk-FGDJVQG3.js +32 -0
- package/chunks/chunk-FKF2SWQM.js +18 -0
- package/chunks/chunk-GETSWLMF.js +4 -0
- package/chunks/chunk-GLSCZGXA.js +1 -0
- package/chunks/chunk-GRTR6TNJ.js +1 -0
- package/chunks/chunk-GXPLME3K.js +14 -0
- package/chunks/chunk-H2JGLZIR.js +1 -0
- package/chunks/chunk-HGNGFAAY.js +60 -0
- package/chunks/chunk-HPPFA3XU.js +1 -0
- package/chunks/chunk-HPVL4BVQ.js +2 -0
- package/chunks/chunk-HVMMNGY5.js +7 -0
- package/chunks/chunk-IA7GIU76.js +14 -0
- package/chunks/chunk-IAWIWTDY.js +1 -0
- package/chunks/chunk-JQHMDTPL.js +1 -0
- package/chunks/chunk-L2BYHWDC.js +1 -0
- package/chunks/chunk-LRL56YFE.js +1 -0
- package/chunks/chunk-LU3DHXOC.js +2 -0
- package/chunks/chunk-LXVBR775.js +1 -0
- package/chunks/chunk-M5TBBQQC.js +21 -0
- package/chunks/chunk-MQH4XBFN.js +1 -0
- package/chunks/chunk-NADES3GN.js +1 -0
- package/chunks/chunk-NIX3WX3O.js +1 -0
- package/chunks/chunk-NSZ4HGDI.js +1 -0
- package/chunks/chunk-NUSNMQPL.js +1 -0
- package/chunks/chunk-NZFUFGOC.js +1 -0
- package/chunks/chunk-OBIEQJDE.js +4 -0
- package/chunks/chunk-OLM5RTFK.js +1 -0
- package/chunks/chunk-PBSR4XR2.js +335 -0
- package/chunks/chunk-PLJNPQFC.js +1 -0
- package/chunks/chunk-PLRSDG6G.js +2 -0
- package/chunks/chunk-Q7QMINSQ.js +0 -0
- package/chunks/chunk-QIUIPRJP.js +1 -0
- package/chunks/chunk-QXTK62N4.js +1 -0
- package/chunks/chunk-R6F4EK2B.js +4 -0
- package/chunks/chunk-RGUC6KAZ.js +1 -0
- package/chunks/chunk-SCCNNGD4.js +2 -0
- package/chunks/chunk-SCULX2ND.js +1 -0
- package/chunks/chunk-SJQWPBMJ.js +1 -0
- package/chunks/chunk-TMFPDVYN.js +127 -0
- package/chunks/chunk-UJX2S56V.js +1 -0
- package/chunks/chunk-USCAYIWL.js +1 -0
- package/chunks/chunk-V5HTJPFW.js +3 -0
- package/chunks/chunk-VFMYWG2I.js +3 -0
- package/chunks/chunk-VGFZXQMW.js +1 -0
- package/chunks/chunk-VTQ72OK7.js +1 -0
- package/chunks/chunk-WE7PSSAQ.js +91 -0
- package/chunks/chunk-WUJUQPHI.js +1 -0
- package/chunks/chunk-X4ZCYXOT.js +1 -0
- package/chunks/chunk-XJ3VEVYL.js +3 -0
- package/chunks/chunk-XMTGT2NJ.js +10 -0
- package/chunks/chunk-XWYLEYLY.js +1 -0
- package/chunks/chunk-Y6DLCHJN.js +1 -0
- package/chunks/chunk-Y6DZEK4W.js +1 -0
- package/chunks/chunk-YUXQ7JNG.js +1 -0
- package/chunks/chunk-Z7742D7Q.js +1 -0
- package/chunks/chunk-ZE5T64HQ.js +1 -0
- package/chunks/chunk-ZF2XYULB.js +1 -0
- package/chunks/chunk-ZOZYBQX2.js +0 -0
- package/chunks/chunk-ZTLJ775S.js +1 -0
- package/chunks/chunk-ZY72QNKZ.js +3 -0
- package/chunks/claude-code-PWTLM554.js +1 -0
- package/chunks/clone-DASXIL35.js +5 -0
- package/chunks/commitmsg-SQRQONCS.js +10 -0
- package/chunks/deno-PZXN5K3J.js +1 -0
- package/chunks/dev-FLO2KEPZ.js +3 -0
- package/chunks/file-tools-shared-ESMPLZVJ.js +1 -0
- package/chunks/fileFromPath-4UEDFJ4U.js +6 -0
- package/chunks/gemini-I6F5N7PS.js +1 -0
- package/chunks/gh-Y4BXDXR5.js +4 -0
- package/chunks/gh-contributors-5SHGJHAQ.js +11 -0
- package/chunks/init-GXBXQGGV.js +1 -0
- package/chunks/init-UFJL24PW.js +12 -0
- package/chunks/install-Q2KQZM62.js +2 -0
- package/chunks/kiro-NMTIFMT4.js +1 -0
- package/chunks/list-B7L4FZKG.js +2 -0
- package/chunks/list-MN7OUE52.js +1 -0
- package/chunks/list-UZKWSA4S.js +1 -0
- package/chunks/load-config-TSM3AAQ6.js +1 -0
- package/chunks/main-WVXCURBF.js +5 -0
- package/chunks/manifest-VJQJG2LS.js +1 -0
- package/chunks/mod-3PJAIZ2O.js +1 -0
- package/chunks/mod-6P2JPEHC.js +1 -0
- package/chunks/mod-7X3BOO5H.js +1 -0
- package/chunks/mod-CI56JMO4.js +43 -0
- package/chunks/mod-FKPTF5D5.js +1 -0
- package/chunks/mod-GZ6BSK2P.js +1 -0
- package/chunks/mod-JTBNNSZZ.js +1 -0
- package/chunks/mod-MKMQWZ6G.js +1 -0
- package/chunks/mod-PEAFMI6F.js +1 -0
- package/chunks/mod-QODEWK3G.js +9 -0
- package/chunks/mod-STKIZYZ3.js +27 -0
- package/chunks/new-W5YBJFGW.js +4 -0
- package/chunks/next-773GX25N.js +3 -0
- package/chunks/node-RWYXITVV.js +59 -0
- package/chunks/node-VPHAK3FD.js +1 -0
- package/chunks/ollama-DQ5VM4HI.js +1 -0
- package/chunks/openai-EKIA3VP3.js +19 -0
- package/chunks/openai-XMIVMDDL.js +1 -0
- package/chunks/opencode-IZMQZ4ZK.js +1 -0
- package/chunks/recipe-applier-F2REROYS.js +1 -0
- package/chunks/registry-fetcher-ZJ76EHBA.js +1 -0
- package/chunks/release-YJOLKWDT.js +8 -0
- package/chunks/release-notes-Z53AFCII.js +3 -0
- package/chunks/release-tag-QRIKYVQB.js +1 -0
- package/chunks/reset-5LQGIOGB.js +1 -0
- package/chunks/rule-K42YEAMO.js +2 -0
- package/chunks/run-7JXDS75G.js +4 -0
- package/chunks/scripts-RSK5XDRW.js +1 -0
- package/chunks/sdk-5JGXLIO5.js +18 -0
- package/chunks/serve-U6IXMGXQ.js +3 -0
- package/chunks/server-PXE4DB3V.js +69 -0
- package/chunks/spec-5446CSQC.js +1 -0
- package/chunks/status-HK3P6J6G.js +1 -0
- package/chunks/sync-4FSA5257.js +1 -0
- package/chunks/system-3MH6OCP6.js +1 -0
- package/chunks/system-KWFBSQYQ.js +1 -0
- package/chunks/unstable_chmod-WRDBWEC2.js +1 -0
- package/chunks/update-QD5S73WT.js +5 -0
- package/chunks/validate-bom-IVALGNGE.js +1 -0
- package/chunks/validate-case-conflict-LKECKLD5.js +1 -0
- package/chunks/validate-circular-deps-PXFPCBXA.js +1 -0
- package/chunks/validate-commit-msg-77CBKGOF.js +1 -0
- package/chunks/validate-docs-3UGB7LN7.js +1 -0
- package/chunks/validate-eof-ZSIYNHO5.js +1 -0
- package/chunks/validate-export-names-BPSCBX7B.js +1 -0
- package/chunks/validate-filenames-G4XJ2LHN.js +1 -0
- package/chunks/validate-json-YRCFW2O7.js +1 -0
- package/chunks/validate-large-files-MWWSFDOE.js +1 -0
- package/chunks/validate-licenses-Q2YA2MND.js +1 -0
- package/chunks/validate-line-endings-C6NHWHGI.js +1 -0
- package/chunks/validate-merge-conflict-KTBL4FUY.js +1 -0
- package/chunks/validate-mod-exports-LQIIQRIS.js +1 -0
- package/chunks/validate-package-configs-36PYXIWC.js +1 -0
- package/chunks/validate-secrets-UFDJ7ITY.js +1 -0
- package/chunks/validate-shebangs-3UO4MDMZ.js +1 -0
- package/chunks/validate-submodules-YA654D3B.js +1 -0
- package/chunks/validate-symlinks-R2PNE5TG.js +1 -0
- package/chunks/validate-toml-7H2N5AKI.js +1 -0
- package/chunks/validate-trailing-whitespace-HXO7M3ED.js +1 -0
- package/chunks/validate-yaml-ZJJCQVBB.js +1 -0
- package/chunks/versions-CWT5S7G4.js +1 -0
- package/chunks/vertexai-2SMP54AR.js +1 -0
- package/chunks/workerd-NXKZMQPV.js +1 -0
- package/eser.js +1 -986
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as w}from"./chunk-DLVQNMNV.js";import{a as v}from"./chunk-6U2VEZEM.js";import{a as y}from"./chunk-JQHMDTPL.js";import{f as k}from"./chunk-NUSNMQPL.js";import{b as l,e as f,f as h,g as C,h as m}from"./chunk-PLJNPQFC.js";import{g as a}from"./chunk-DQAEQEXD.js";var p=y(),D=e=>{let s=new Map,r=new Set(e.map(i=>i.name));for(let i of e){let n=[];for(let d of i.config._loadedFiles){let t=d.content,u=t.dependencies;if(u!==void 0)for(let c of Object.keys(u))r.has(c)&&n.push(c);let o=t.imports;if(o!==void 0)for(let c of Object.values(o))r.has(c)&&n.push(c)}s.set(i.name,[...new Set(n)])}return s},x=e=>{let s=[],r=new Set,i=new Set,n=[],d=t=>{r.add(t),i.add(t),n.push(t);let u=e.get(t)??[];for(let o of u)if(!r.has(o))d(o);else if(i.has(o)){let c=n.indexOf(o),g=n.slice(c);g.push(o),s.push(g)}n.pop(),i.delete(t)};for(let t of e.keys())r.has(t)||d(t);return s},R=async(e={})=>{let{root:s="."}=e,r=await w(s),i=D(r),n=x(i);return{hasCycles:n.length>0,cycles:n,packagesChecked:r.length}},O=e=>k.fromPromise(()=>R(e)),b=e=>a.ok({root:"."}),A=e=>{if(a.isFail(e))return p.writeln(f("\u2717"),l(" "+(e.error instanceof Error?e.error.message:String(e.error)))),a.fail({exitCode:1});let{value:s}=e;if(p.writeln(m("\u2139"),l(` Checked ${s.packagesChecked} packages.`)),s.hasCycles){p.writeln(f("\u2717"),l(` Found ${s.cycles.length} circular dependencies:`));for(let r of s.cycles)p.writeln(C("\u26A0"),l(` ${r.join(" \u2192 ")}`));return a.fail({exitCode:1})}return p.writeln(h("\u2713"),l(" No circular dependencies found.")),a.ok(void 0)},M=v.createTrigger({handler:O,adaptInput:b,adaptOutput:A}),_=async e=>await M({command:"validate-circular-deps",args:[],flags:{}});export{R as a,O as b,M as c,_ as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as x}from"./chunk-DOV5776P.js";import{t as i}from"./chunk-GRTR6TNJ.js";var m=[/node_modules/,/\.git\//,/\/dist\//,/etc\/coverage/,/etc\/temp/,/\.output\//],g=async t=>{try{let n=await x`git ls-files --cached --others --exclude-standard`.cwd(t).noThrow().lines();return n.length>0?n:null}catch{return null}},k=async(t={})=>{let{root:n=".",extensions:e,exclude:o=[]}=t,l=[...m,...o.map(r=>typeof r=="string"?new RegExp(r):r)],d=[],y=await g(n);if(y!==null)for(let r of y){let s=i.path.join(n,r),c=i.path.basename(r);if(e!==void 0&&e.length>0){let a=i.path.extname(r);if(!e.map(u=>u.startsWith(".")?u:`.${u}`).includes(a))continue}if(l.some(a=>a.test(s)||a.test(r)))continue;let f=0,p=!1;try{let a=await i.fs.lstat(s);if(f=a.size,p=a.isSymlink,a.isDirectory&&!(t.includeDirs??!1))continue}catch{continue}d.push({path:s,name:c,size:f,isSymlink:p})}else for await(let r of i.fs.walk(n,{includeDirs:t.includeDirs??!1,includeFiles:!0,exts:e,skip:l})){if(!r.isFile&&!r.isSymlink)continue;let s=0;try{s=(await i.fs.stat(r.path)).size}catch{continue}d.push({path:r.path,name:r.name,size:s,isSymlink:r.isSymlink})}if(t.includeOnly!==void 0&&t.includeOnly.length>0){let r=t.includeOnly;return d.filter(s=>r.some(c=>s.path.endsWith(c)||s.path.includes(c)))}return d},B=async t=>{if(t.textContent!==void 0)return t.textContent;try{let n=await h(t);if(w(n))return;let e=new TextDecoder().decode(n);return t.textContent=e,e}catch{return}},h=async t=>{if(t.rawBytes!==void 0)return t.rawBytes;let n=await i.fs.readFile(t.path);return t.rawBytes=n,n},w=t=>{let n=Math.min(t.length,8192);for(let e=0;e<n;e++)if(t[e]===0)return!0;return!1},M=(t,n)=>{for(let e of n)if(typeof e=="string"){if(t.includes(e)||t.endsWith(e))return!0}else if(e.test(t))return!0;return!1},b=(t,n)=>{let e=new Map;for(let o of n)e.set(o.path,o);for(let o of t){let l=e.get(o.path);l!==void 0&&(o.textContent=l.newContent,o.rawBytes=void 0)}},D=async t=>{let n=0;for(let e of t)e.oldContent!==e.newContent&&(await i.fs.writeTextFile(e.path,e.newContent),n++);return n};export{m as a,k as b,B as c,h as d,w as e,M as f,b as g,D as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=class extends Error{constructor(a){super(a),this.name="DeepMergeError"}},E=(d,a,j)=>{if(a==null){let s=d.constructor,e=new s;for(let r of Object.keys(d))e[r]=d[r];return e}let O=j?.maxDepth??100,U=j?.noSkipUndefined??!1,p=new WeakSet,b=new WeakSet,f=(s,e,r)=>{if(!(s instanceof Object))return s;if(p.has(s))throw new l("Circular reference detected in first argument: cannot deep merge objects with circular references");if(e instanceof Object&&b.has(e))throw new l("Circular reference detected in second argument: cannot deep merge objects with circular references");if(r>O)throw new l(`Maximum recursion depth exceeded (${O}). Objects are too deeply nested or contain circular references.`);p.add(s),e instanceof Object&&b.add(e);try{let R=s.constructor,c=new R,x=Object.keys(s),m=new Set;for(let o=0,T=x.length;o<T;o++){let t=x[o],n=s[t],y=e!==void 0&&t in e,i=e?.[t];m.add(t);let g=y&&i===void 0&&!U;if(n instanceof Object&&n.constructor!==Array){let u;g?u=f(n,{},r+1):y&&i instanceof Object&&i.constructor!==Array?u=f(n,i,r+1):y?u=i:u=f(n,{},r+1),c[t]=u}else g?c[t]=n:c[t]=y?i:n}if(e===void 0)return c;let w=Object.keys(e);for(let o=0,T=w.length;o<T;o++){let t=w[o];if(m.has(t))continue;let n=e[t];n===void 0&&!U||(n instanceof Object&&n.constructor!==Array?c[t]=f({},n,r+1):c[t]=n)}return c}finally{p.delete(s),e instanceof Object&&b.delete(e)}};return f(d,a,0)};export{E as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-VFMYWG2I.js";import{a as r}from"./chunk-3APERFKY.js";var t=i({name:"validate-toml",description:"Validate TOML syntax",canFix:!1,stacks:[],defaults:{},extensions:[".toml"],checkFile(e,a){if(a===void 0)return[];try{return r(a),[]}catch(o){let n=o instanceof Error?o.message:"invalid TOML";return[{path:e.path,message:n}]}}}),p=t.run,d=t.validator,u=t.main;export{t as a,p as b,d as c,u as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as s}from"./chunk-VTQ72OK7.js";import{a as t}from"./chunk-QXTK62N4.js";var c={fs:!1,fsSync:!1,exec:!1,process:!1,env:!0,stdin:!1,stdout:!1,kv:!0},d=()=>{let e=()=>{throw new t("fs","workerd")};return{readFile:e,readTextFile:e,writeFile:e,writeTextFile:e,exists:e,stat:e,lstat:e,mkdir:e,ensureDir:e,remove:e,readDir:()=>{throw new t("fs","workerd")},copyFile:e,rename:e,makeTempDir:e,realPath:e,watch:e,walk:e,chmod:e}},w=()=>s,u=()=>{let e=()=>{throw new t("exec","workerd")};return{spawn:e,exec:e,execJson:e,spawnChild:e}},r=new Map,l=()=>({get(e){return r.get(e)},set(e,o){r.set(e,o)},delete(e){r.delete(e)},has(e){return r.has(e)},toObject(){return Object.fromEntries(r)}}),g=e=>{for(let[o,n]of Object.entries(e))n!=null&&n.constructor===String&&r.set(o,n)},k=()=>{r.clear()},m=()=>{let e=()=>{throw new t("process","workerd")};return{exit:e,setExitCode:e,cwd:e,chdir:e,hostname:e,execPath:e,get args(){throw new t("process","workerd")},get pid(){throw new t("process","workerd")},get stdin(){throw new t("process","workerd")},get stdout(){throw new t("process","workerd")},get stderr(){throw new t("process","workerd")}}},v=()=>{let e=d(),o=w(),n=u(),i=l(),a=m();return{name:"workerd",version:"unknown",capabilities:c,fs:e,path:o,exec:n,env:i,process:a}};export{c as a,g as b,k as c,v as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function s(){let t=globalThis,o=t.Deno?.build?.os;return typeof o=="string"?o==="windows":t.navigator?.platform?.startsWith("Win")??t.process?.platform?.startsWith("win")??!1}var a=s();function r(t){if(typeof t!="string")throw new TypeError(`Path must be a string, received "${JSON.stringify(t)}"`)}function n(t){return t===47}function m(t){return r(t),t.length>0&&n(t.charCodeAt(0))}function l(t){return t===47}function e(t){return t===47||t===92}function _(t){return t>=97&&t<=122||t>=65&&t<=90}function K(t){r(t);let o=t.length;if(o===0)return!1;let R=t.charCodeAt(0);return e(R)?!0:!!(_(R)&&o>2&&t.charCodeAt(1)===58&&e(t.charCodeAt(2)))}export{a,r as b,n as c,l as d,e,_ as f,m as g,K as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var l=a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=a=>{let n=[],i=new Set,r="",e=a,o=/\[(\.\.\.)?(\w+)\]/;for(;e.length>0;){let t=o.exec(e);if(t===null){r+=l(e);break}t.index>0&&(r+=l(e.slice(0,t.index)));let m=t[1]==="...",s=t[2];s!==void 0&&(n.push(s),m?(i.add(s),r+="(.*)"):r+="([^/]+)"),e=e.slice(t.index+t[0].length)}return{regex:new RegExp(`^${r}$`),paramNames:n,catchAllParams:i}},u=(a,n)=>{let i=a.match(n.regex);if(i===null)return null;let r={};for(let e=0;e<n.paramNames.length;e++){let o=n.paramNames[e],t=i[e+1];o!==void 0&&(n.catchAllParams.has(o)?r[o]=t!==void 0&&t!==""?t.split("/").filter(Boolean):[]:r[o]=t??"")}return r},g=(a,n)=>{let i=c(n);return u(a,i)};export{g as a};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-DLVQNMNV.js";import{a as y}from"./chunk-6U2VEZEM.js";import{a as C}from"./chunk-JQHMDTPL.js";import{f as v}from"./chunk-NUSNMQPL.js";import{b as a,e as m,f as x,g as k,h as g}from"./chunk-PLJNPQFC.js";import{g as p}from"./chunk-DQAEQEXD.js";import{u as h}from"./chunk-GRTR6TNJ.js";var l=C(),d=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase(),f=(e,o=[])=>{let s=e.split("/").filter(r=>r.length>0);for(let r of s){let t=r.startsWith(".")?r.slice(1):r;if(t.length===0)continue;let i=h.current.path.extname(t);if(i.length>0&&(t=t.slice(0,-i.length)),t.length!==0&&!o.includes(t)&&!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(t))return!1}return!0},N=async(e={})=>{let{root:o=".",ignoreWords:s=[]}=e,r=await E(o),t=[];for(let i of r){let n=i.config.exports?.value;if(n!=null){if(typeof n=="string"){f(n,s)||t.push({packageName:i.name,exportPath:n,suggestion:d(n)});continue}if(n!==null&&typeof n=="object")for(let[u,c]of Object.entries(n))f(u,s)||t.push({packageName:i.name,exportPath:u,suggestion:d(u)}),typeof c=="string"&&!f(c,s)&&t.push({packageName:i.name,exportPath:c,suggestion:d(c)})}}return{isValid:t.length===0,violations:t,packagesChecked:r.length}},w=e=>v.fromPromise(()=>N(e)),b=e=>p.ok({root:"."}),A=e=>{if(p.isFail(e))return l.writeln(m("\u2717"),a(" "+String(e.error))),p.fail({exitCode:1});let{value:o}=e;if(l.writeln(g("\u2139"),a(` Checked ${o.packagesChecked} packages.`)),!o.isValid){l.writeln(m("\u2717"),a(` Found ${o.violations.length} naming violations:`));for(let s of o.violations)l.writeln(k("\u26A0"),a(" "+s.packageName)),l.writeln(g("\u2139"),a(` Export: ${s.exportPath}`)),l.writeln(g("\u2139"),a(` Suggestion: ${s.suggestion}`));return p.fail({exitCode:1})}return l.writeln(x("\u2713"),a(" All export names follow conventions.")),p.ok(void 0)},P=y.createTrigger({handler:w,adaptInput:b,adaptOutput:A}),W=async e=>await P({command:"validate-export-names",args:[],flags:{}});export{N as a,w as b,P as c,W as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as u}from"./chunk-7QNRH7OR.js";import{a as i,e as m}from"./chunk-OLM5RTFK.js";var p="http://localhost:11434",d=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;baseUrl;config;constructor(e,o){this.baseUrl=e,this.config=o,this.modelId=o.model}async generateText(e,o){let s=g(this.config,e,!1);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok)throw await f(t);let r=await t.json();return h(r,this.modelId)}catch(t){throw t instanceof i?t:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}async*streamText(e,o){let s=g(this.config,e,!0);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok){yield{kind:"error",error:await f(t)};return}if(t.body===null){yield{kind:"error",error:new i("No response body",{provider:"ollama"})};return}for await(let r of u(t.body)){let l=k(r);l!==null&&(yield l)}}catch(t){t instanceof i?yield{kind:"error",error:t}:yield{kind:"error",error:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},v={provider:"ollama",createModel(n){let e=n.properties?.baseUrl??p;return Promise.resolve(new d(e,n))}},g=(n,e,o)=>{let s=y(e.messages,e.system),t={model:n.model,messages:s,stream:o},r={};return e.temperature!==void 0&&(r.temperature=e.temperature),e.maxTokens!==void 0&&(r.num_predict=e.maxTokens),e.topP!==void 0&&(r.top_p=e.topP),e.stopWords!==void 0&&(r.stop=e.stopWords),Object.keys(r).length>0&&(t.options=r),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?t.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(t.format="json")),t},y=(n,e)=>{let o=[];e!==void 0&&o.push({role:"system",content:e});for(let s of n){if(s.role==="system"){let a=[];for(let c of s.content)c.kind==="text"&&a.push(c.text);o.push({role:"system",content:a.join(`
|
|
2
|
+
`)});continue}let t=[],r=[];for(let a of s.content)a.kind==="text"?t.push(a.text):a.kind==="image"&&a.image.url!==void 0&&r.push(a.image.url);let l={role:s.role==="tool"?"user":s.role,content:t.join(`
|
|
3
|
+
`)};r.length>0&&(l.images=r),o.push(l)}return o},h=(n,e)=>{let o=[];return n.message?.content!==void 0&&o.push({kind:"text",text:n.message.content}),{content:o,stopReason:n.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:n.prompt_eval_count??0,outputTokens:n.eval_count??0,totalTokens:(n.prompt_eval_count??0)+(n.eval_count??0)},modelId:e,rawResponse:n}},k=n=>{if(n===null||typeof n!="object")return null;let e=n;return e.done===!0?{kind:"message_done",stopReason:e.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:e.prompt_eval_count??0,outputTokens:e.eval_count??0,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}}:e.message?.content!==void 0&&e.message.content.length>0?{kind:"content_delta",textDelta:e.message.content}:e.response!==void 0&&e.response.length>0?{kind:"content_delta",textDelta:e.response}:null},f=async n=>{let e;try{e=(await n.json()).error??`Ollama HTTP ${n.status}`}catch{e=`Ollama HTTP ${n.status}: ${n.statusText}`}return m("ollama",n.status,new Error(e))};export{d as a,v as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-3DMTTLUJ.js";import"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as ClaudeCodeModel,b as claudeCodeFactory};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as x,b as E}from"./chunk-3TYZYY77.js";import{e as $}from"./chunk-6YRN6OJC.js";import{a as C,d as P}from"./chunk-NUSNMQPL.js";import{j}from"./chunk-SCULX2ND.js";import{f as v,h as k,k as b}from"./chunk-FGDJVQG3.js";import{d,e as w,f as R,j as h}from"./chunk-PLJNPQFC.js";import{a as y}from"./chunk-HPPFA3XU.js";import{a as p,b as c,c as g}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var A=r=>{let n=r.replace(/^gh:/,""),[t,e]=n.split("#");if(t===void 0)return;let s=t.split("/");if(!(s.length!==2||s[0]===""||s[1]===""))return{owner:s[0],repo:s[1],ref:e??"main"}},S=r=>C(async n=>{try{let{specifier:t}=r,e=r.recipePath??"recipe.json",s=await j(t.owner,t.repo,t.ref,e),o=r.cwd;r.projectName!==void 0&&(o=`${r.cwd}/${r.projectName}`,await Deno.mkdir(o,{recursive:!0}));let a={...r.variables};r.projectName!==void 0&&a.project_name===void 0&&(a.project_name=r.projectName);let f=`https://raw.githubusercontent.com/${t.owner}/${t.repo}/${t.ref}`,i=await $(s,{cwd:o,registryUrl:f,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:a}),u=await x(o),m=E(s,u),I=r.dryRun?"Would write":"Cloned";n.out.writeln(R(`\u2713 ${I} ${i.written.length} file(s) from ${s.name}`));for(let l of i.written)n.out.writeln(` \u2192 ${l}`);if(i.postInstallRan.length>0){n.out.writeln(d(`
|
|
2
|
+
Post-install:`));for(let l of i.postInstallRan)n.out.writeln(d(` \u2713 ${l}`))}if(m.instructions.length>0){n.out.writeln(d(`
|
|
3
|
+
Dependencies:`));for(let l of m.instructions)n.out.writeln(d(` Run: ${l}`))}return p({recipe:s,result:i,depInfo:m,targetDir:o})}catch(t){let e=t instanceof Error?t.message:String(t);return c({_tag:"ApplyError",message:e})}});var W=async r=>{let n=y(r??[],{string:["recipe","name","var"],boolean:["force","dry-run","skip-existing","verbose"],collect:["var"],alias:{p:"name"}}),t=n._[0],e=v({renderer:b.ansi(),sink:k.stdout()});if(t===void 0)return e.writeln("Usage: eser kit clone <specifier> [options]"),e.writeln(),e.writeln("Specifier formats:"),e.writeln(" eser/ajan GitHub repo (default branch)"),e.writeln(" gh:eser/ajan#v1.0 GitHub repo at specific tag/branch"),e.writeln(),e.writeln("Options:"),e.writeln(" --recipe <path> Path to recipe.json (default: recipe.json)"),e.writeln(" --name, -p <dir> Target directory"),e.writeln(" --var key=value Template variable (repeatable)"),e.writeln(" --force Overwrite existing files"),e.writeln(" --dry-run Preview without writing"),await e.close(),p(void 0);let s=A(t);if(s===void 0)return e.writeln(w(`Invalid specifier: '${t}'. Use format: owner/repo or gh:owner/repo#ref`)),await e.close(),c({exitCode:1});let o={};for(let f of n.var){let[i,...u]=String(f).split("=");i!==void 0&&i!==""&&(o[i]=u.join("="))}e.writeln(h(`
|
|
4
|
+
Cloning from ${s.owner}/${s.repo}@${s.ref}...
|
|
5
|
+
`));let a=await P(S({specifier:s,recipePath:n.recipe,cwd:Deno.cwd(),projectName:n.name,dryRun:n["dry-run"]===!0,force:n.force===!0,skipExisting:n["skip-existing"]===!0,verbose:n.verbose===!0,variables:o}),{out:e});return await e.close(),g(a)?p(void 0):c({exitCode:1})};export{W as main};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import"./chunk-Q7QMINSQ.js";import{a as w,b as x}from"./chunk-6FMPNAZ3.js";import{a as h}from"./chunk-LRL56YFE.js";import"./chunk-X4ZCYXOT.js";import{f,h as g,k as p}from"./chunk-FGDJVQG3.js";import{c as n,d,e as u}from"./chunk-PLJNPQFC.js";import"./chunk-OLM5RTFK.js";import{b as o}from"./chunk-DOV5776P.js";import"./chunk-5O7V5P53.js";import"./chunk-DRQWYJMH.js";import"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as l,b as m}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var b=`Output ONLY a conventional commit message. No explanation, no markdown, no code blocks, no bullet points.
|
|
2
|
+
|
|
3
|
+
Format: type(scope): description
|
|
4
|
+
Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
|
|
5
|
+
Max 72 characters. One line only. No body. No quotes. No backticks.
|
|
6
|
+
|
|
7
|
+
Example output:
|
|
8
|
+
feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=f({renderer:p.ansi(),sink:g.stdout()});try{let t=await o`git diff --cached`.noThrow().text();if(t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0)return e.writeln(d("No changes detected (nothing staged or modified).")),await e.close(),l(void 0);let s=await y(t),r=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/`/g,"\\`").replace(/\$/g,"\\$").replace(/!/g,"\\!");return e.writeln(""),e.writeln(n("Plain Format:")),e.writeln("```"),e.writeln(s),e.writeln("```"),e.writeln(""),e.writeln(n("Shell Command:")),e.writeln("```"),e.writeln(`git commit -m "${r}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${r}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(u(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-GZ6BSK2P.js")).defaultFactories(),r=new w({factories:s}),a=e;if(a===void 0)try{await o`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await r.addModel("default",{provider:a,model:"default"});let c=r.getDefault();if(c===null)throw new Error("No AI model available for commit message generation");let k=await c.generateText({system:b,messages:[h("user",`Generate a commit message for this diff:
|
|
9
|
+
|
|
10
|
+
${i}`)],maxTokens:256});return await r.close(),x(k).trim()},O={name:"ai-commitmsg",description:"Generate commit message from git diff using AI",run:async i=>{try{let e=i.provider,t=await o`git diff --cached`.noThrow().text();return t.length===0&&(t=await o`git diff`.noThrow().text()),t.length===0?{name:"ai-commitmsg",passed:!0,issues:[],mutations:[],stats:{skipped:1}}:{name:"ai-commitmsg",passed:!0,issues:[{message:`Suggested: ${await y(t,e)}`}],mutations:[],stats:{generated:1}}}catch(e){return{name:"ai-commitmsg",passed:!1,issues:[{message:e instanceof Error?e.message:String(e)}],mutations:[],stats:{errors:1}}}}};export{y as generateCommitMessage,v as main,O as workflowTool};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as P,b as v,c as x,d as O}from"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import{d as h,e as D,f as g,g as f,i as F,j as w,k,n as S}from"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{a as y}from"./chunk-4OIKB2P5.js";import{b as d,d as p}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var b={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},E=()=>{let n=t=>({isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink,size:t.size,mtime:t.mtime,atime:t.atime,birthtime:t.birthtime});return{async readFile(t,e){try{return await Deno.readFile(t,{signal:e?.signal})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async readTextFile(t,e){try{return await Deno.readTextFile(t,{signal:e?.signal})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async writeFile(t,e,r){await Deno.writeFile(t,e,{signal:r?.signal,mode:r?.mode,create:r?.create??!0,append:r?.append??!1})},async writeTextFile(t,e,r){await Deno.writeTextFile(t,e,{signal:r?.signal,mode:r?.mode,create:r?.create??!0,append:r?.append??!1})},async exists(t){try{return await Deno.stat(t),!0}catch(e){if(e instanceof Deno.errors.NotFound)return!1;throw e}},async stat(t){try{let e=await Deno.stat(t);return n(e)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async lstat(t){try{let e=await Deno.lstat(t);return n(e)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async mkdir(t,e){await Deno.mkdir(t,{recursive:e?.recursive??!1,mode:e?.mode})},async ensureDir(t){try{await Deno.mkdir(t,{recursive:!0})}catch(e){if(!(e instanceof Deno.errors.AlreadyExists))throw e}},async remove(t,e){try{await Deno.remove(t,{recursive:e?.recursive??!1})}catch(r){throw r instanceof Deno.errors.NotFound?new d(t):r}},async*readDir(t){try{for await(let e of Deno.readDir(t))yield{name:e.name,isFile:e.isFile,isDirectory:e.isDirectory,isSymlink:e.isSymlink}}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},async copyFile(t,e){await Deno.copyFile(t,e)},async rename(t,e){await Deno.rename(t,e)},async makeTempDir(t){return await Deno.makeTempDir({dir:t?.dir,prefix:t?.prefix,suffix:t?.suffix})},async realPath(t){try{return await Deno.realPath(t)}catch(e){throw e instanceof Deno.errors.NotFound?new d(t):e}},watch(t,e){let r=e?.recursive??!0,a=Deno.watchFs(t,{recursive:r}),s=c=>({kind:c.kind,paths:c.paths,flag:c.flag});return{close:()=>a.close(),[Symbol.asyncIterator]:async function*(){for await(let c of a)yield s(c)}}},async*walk(t,e){let r=e?.includeDirs??!0,a=e?.includeFiles??!0,s=e?.exts,c=e?.skip,o=async function*(l){for await(let i of Deno.readDir(l)){let m=w(l,i.name);if(!c?.some(u=>u.test(m))){if(i.isDirectory)r&&(yield{path:m,name:i.name,isFile:!1,isDirectory:!0,isSymlink:i.isSymlink}),yield*o(m);else if(i.isFile||i.isSymlink){if(!a||s&&!s.some(u=>i.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:m,name:i.name,isFile:i.isFile,isDirectory:!1,isSymlink:i.isSymlink}}}}};yield*o(t)},async chmod(t,e){let{chmod:r}=await import("./unstable_chmod-WRDBWEC2.js");await r(t,e)}}},R=()=>({join:w,resolve:S,dirname:f,basename:h,extname:P,normalize:k,isAbsolute:F,relative:O,parse:x,format:v,sep:g,delimiter:D}),A=()=>({async spawn(n,t=[],e){let r=y(e),s=await new Deno.Command(n,{args:t,cwd:e?.cwd,env:e?.env,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,signal:e?.signal}).output();return{success:s.success,code:s.code,stdout:r.stdout==="piped"?s.stdout:new Uint8Array,stderr:r.stderr==="piped"?s.stderr:new Uint8Array}},async exec(n,t=[],e){let r=await this.spawn(n,t,e);if(!r.success){let a=new TextDecoder().decode(r.stderr);throw new p(n,r.code,a)}return new TextDecoder().decode(r.stdout).trim()},async execJson(n,t=[],e){let r=await this.exec(n,t,e);return JSON.parse(r)},spawnChild(n,t=[],e){let r=y(e),s=new Deno.Command(n,{args:t,cwd:e?.cwd,env:e?.env,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,signal:e?.signal}).spawn(),c=(o,l)=>l!=="piped"||!o?Promise.resolve(new Uint8Array):new Response(o).arrayBuffer().then(i=>new Uint8Array(i));return{pid:s.pid,stdin:r.stdin==="piped"?s.stdin:null,stdout:r.stdout==="piped"?s.stdout:null,stderr:r.stderr==="piped"?s.stderr:null,status:s.status.then(o=>({success:o.success,code:o.code,signal:o.signal??void 0})),output:async()=>{let o=r.stdout==="piped"?s.stdout:null,l=r.stderr==="piped"?s.stderr:null,[i,m,u]=await Promise.all([s.status,c(o,r.stdout),c(l,r.stderr)]);return{success:i.success,code:i.code,stdout:m,stderr:u}},kill:o=>{s.kill(o)}}}}),T=()=>({get(n){return Deno.env.get(n)},set(n,t){Deno.env.set(n,t)},delete(n){Deno.env.delete(n)},has(n){return Deno.env.get(n)!==void 0},toObject(){return Deno.env.toObject()}}),I=()=>({exit(n){Deno.exit(n)},setExitCode(n){Deno.exitCode=n},cwd(){return Deno.cwd()},chdir(n){Deno.chdir(n)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable}),U=()=>{let n=E(),t=R(),e=A(),r=T(),a=I();return{name:"deno",version:Deno.version.deno,capabilities:b,fs:n,path:t,exec:e,env:r,process:a}};export{b as DENO_CAPABILITIES,U as createDenoRuntime};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{f as a,h as l,k as i}from"./chunk-FGDJVQG3.js";import{j as n}from"./chunk-PLJNPQFC.js";import"./chunk-ZOZYBQX2.js";import{a as t}from"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as o}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var h=["trace","debug","info","warn","error","fatal"],k=async m=>{let{flags:e}=t(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"no-hmr",type:"boolean",description:"Disable HMR"},{name:"log-level",type:"string",default:"info",description:"Log level"},{name:"open",short:"o",type:"boolean",description:"Open browser"}]),r=a({renderer:i.ansi(),sink:l.stdout()});r.writeln(n(`
|
|
2
|
+
\u26A1 Starting development server...
|
|
3
|
+
`));let p=e.port,s=e["log-level"]??"info",c=!e["no-hmr"],g=e.open??!1,d=h.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:u},{reactRenderer:L,reactHtmlShellBuilder:f},{reactPlugin:v},{createTailwindPlugin:b}]=await Promise.all([import("./main-WVXCURBF.js"),import("./mod-MKMQWZ6G.js"),import("./mod-CI56JMO4.js"),import("./mod-JTBNNSZZ.js")]);return await r.close(),await u({mode:"dev",port:p,logLevel:d,hmr:c,open:g,renderer:L,htmlShell:f,frameworkPlugin:v,cssPlugin:b({globalCssPath:"src/app/styles/global.css"})}),o(void 0)};export{k as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-Y6DLCHJN.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as DEFAULT_EXCLUDES,g as applyMutations,e as isBinaryBytes,d as loadBytes,c as loadContent,f as matchesAnyPattern,b as walkSourceFiles,h as writeMutations};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as h,d as j}from"./chunk-FKF2SWQM.js";import{a as M,c as g,e as P}from"./chunk-DXB73IDG.js";var m=g((v,d)=>{if(!globalThis.DOMException)try{let{MessageChannel:e}=M("worker_threads"),t=new e().port1,r=new ArrayBuffer;t.postMessage(r,[r,r])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}d.exports=globalThis.DOMException});var b=P(m(),1);import{statSync as S,createReadStream as T,promises as w}from"fs";import{basename as _}from"path";var E=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function F(e){if(E(e)!=="object")return!1;let t=Object.getPrototypeOf(e);return t==null?!0:(t.constructor&&t.constructor.toString())===Object.toString()}var p=F;var u=function(e,t,r,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},a=function(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)},s,c,x="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",f=class e{constructor(t){s.set(this,void 0),c.set(this,void 0),u(this,s,t.path,"f"),u(this,c,t.start||0,"f"),this.name=_(a(this,s,"f")),this.size=t.size,this.lastModified=t.lastModified}slice(t,r){return new e({path:a(this,s,"f"),lastModified:this.lastModified,size:r-t,start:t})}async*stream(){let{mtimeMs:t}=await w.stat(a(this,s,"f"));if(t>this.lastModified)throw new b.default(x,"NotReadableError");this.size&&(yield*T(a(this,s,"f"),{start:a(this,c,"f"),end:a(this,c,"f")+this.size-1}))}get[(s=new WeakMap,c=new WeakMap,Symbol.toStringTag)](){return"File"}};function y(e,{mtimeMs:t,size:r},o,i={}){let n;p(o)?[i,n]=[o,void 0]:n=o;let l=new f({path:e,size:r,lastModified:t});return n||(n=l.name),new h([l],n,{...i,lastModified:l.lastModified})}function G(e,t,r={}){let o=S(e);return y(e,o,t,r)}async function A(e,t,r){let o=await w.stat(e);return y(e,o,t,r)}export{A as fileFromPath,G as fileFromPathSync,j as isFile};
|
|
2
|
+
/*! Bundled license information:
|
|
3
|
+
|
|
4
|
+
node-domexception/index.js:
|
|
5
|
+
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
6
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-NIX3WX3O.js";import"./chunk-PLRSDG6G.js";import"./chunk-LRL56YFE.js";import"./chunk-OLM5RTFK.js";import"./chunk-DXB73IDG.js";export{a as GeminiModel,b as geminiFactory};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as l}from"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as o,e as r,h as i}from"./chunk-PLJNPQFC.js";import{g as t}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var c=l(),m=()=>{c.writeln(i("\u2139"),o(` eser codebase gh \u2014 GitHub operations
|
|
2
|
+
`)),console.log("Subcommands:"),console.log(" contributors Update contributor list in README.md"),console.log(" release-notes Sync CHANGELOG to GitHub Releases"),console.log(" release-tag Create and push release git tags"),console.log(`
|
|
3
|
+
Run 'eser codebase gh <subcommand> --help' for details.`)},w=async u=>{let n=u??[],e=n[0],s=n.slice(1);if(e===void 0||e==="--help"||e==="-h")return m(),t.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-5SHGJHAQ.js")).main(s);case"release-notes":return await(await import("./release-notes-Z53AFCII.js")).main(s);case"release-tag":return await(await import("./release-tag-QRIKYVQB.js")).main(s);default:return c.writeln(r("\u2717"),o(` Unknown gh subcommand: ${e}
|
|
4
|
+
`)),m(),t.fail({exitCode:1})}};export{w as main};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import"./chunk-DDLQMSA7.js";import{a as A}from"./chunk-6U2VEZEM.js";import{a as R,b as $}from"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import{f as y}from"./chunk-NUSNMQPL.js";import"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as c,e as C,f as g,h as x}from"./chunk-PLJNPQFC.js";import{c as l}from"./chunk-DOV5776P.js";import"./chunk-ZOZYBQX2.js";import"./chunk-DRQWYJMH.js";import"./chunk-WE7PSSAQ.js";import{a as w}from"./chunk-HPPFA3XU.js";import{g as a}from"./chunk-DQAEQEXD.js";import"./chunk-WUJUQPHI.js";import"./chunk-A2GDVOQP.js";import{n as b}from"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{u as m}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var d=R(),p="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",O=async()=>{let t=await l.exec`gh repo view --json owner,name`.text(),e=JSON.parse(t);return{owner:e.owner.login,name:e.name}},U=async(t,e)=>{let n=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(n).filter(o=>!o.login.includes("[bot]"))},M=(t,e=8)=>{if(t.length===0)return`${p}
|
|
2
|
+
${u}`;let n=[];for(let r=0;r<t.length;r+=e){let i=t.slice(r,r+e).map(s=>` <td align="center"><a href="${s.html_url}"><img src="${s.avatar_url}?s=80" width="80" /><br /><sub>${s.login}</sub></a></td>`);n.push(` <tr>
|
|
3
|
+
${i.join(`
|
|
4
|
+
`)}
|
|
5
|
+
</tr>`)}return`${p}
|
|
6
|
+
<table>
|
|
7
|
+
${n.join(`
|
|
8
|
+
`)}
|
|
9
|
+
</table>
|
|
10
|
+
${u}`},T=(t,e)=>{let n=t.indexOf(p),r=t.indexOf(u);if(n===-1||r===-1)throw new Error(`Could not find contributor markers in README. Add '${p}' and '${u}' markers to the file.`);let o=t.slice(0,n),i=t.slice(r+u.length),s=`${o}${e}${i}`;return{content:s,changed:s!==t}},k=async(t={})=>{let{readmePath:e="README.md",columnsPerRow:n=8,commit:r=!1}=t,o=b(e),i=await O(),s=await U(i.owner,i.name),E=M(s,n),P=await m.current.fs.readTextFile(o),{content:v,changed:h}=T(P,E),f=!1;return h&&(await m.current.fs.writeTextFile(o,v),r&&(await l.exec`git add ${o}`.spawn(),await l.exec`git -c user.name=${"github-actions[bot]"} -c user.email=${"github-actions[bot]@users.noreply.github.com"} commit -m ${"docs: update contributors list"}`.spawn(),await l.exec`git push`.spawn(),f=!0)),{contributorCount:s.length,readmePath:o,updated:h,committed:f}},N=t=>y.fromPromise(()=>k(t)),S=t=>{let e=t.flags.columns,n=e!==void 0?Number(e):void 0;return a.ok({readmePath:t.flags.readme??void 0,columnsPerRow:n,commit:t.flags.commit===!0})},I=t=>{if(a.isFail(t)){let n=t.error,r=n instanceof Error?n.message:n.message??String(n);return d.writeln(C("\u2717"),c(" "+r)),a.fail({exitCode:1})}let{value:e}=t;return e.updated?e.committed?d.writeln(g("\u2713"),c(` Updated ${e.contributorCount} contributors and committed changes.`)):d.writeln(g("\u2713"),c(` Updated ${e.contributorCount} contributors in ${e.readmePath}.`)):d.writeln(x("\u2139"),c(` No changes \u2014 ${e.contributorCount} contributors already up to date.`)),a.ok(void 0)},D=A.createTrigger({handler:N,adaptInput:S,adaptOutput:I}),G=async t=>{let e=w(t??[],{string:["columns","readme"],boolean:["commit"],alias:{h:"help"}});if(e.help)return console.log(`eser codebase gh contributors \u2014 Update contributor list
|
|
11
|
+
`),console.log("Options:"),console.log(" --columns <n> Number of columns per row (default: 8)"),console.log(" --readme <path> Path to README.md (default: README.md)"),console.log(" --commit Auto-commit and push changes"),console.log(" --help, -h Show this help"),a.ok(void 0);let n=$("gh-contributors",e);return await D(n)};export{U as fetchContributors,M as generateContributorMarkdown,O as getRepoInfo,D as handleCli,G as main,T as replaceContributorSection,k as updateContributors,N as updateContributorsHandler};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d}from"./chunk-BK2BDHKB.js";import{a as y,b as $,e as v,g as k,h as P,j,k as b}from"./chunk-BKVQBSFV.js";import"./chunk-Q7QMINSQ.js";import"./chunk-6FMPNAZ3.js";import"./chunk-LRL56YFE.js";import{a as h}from"./chunk-X4ZCYXOT.js";import{f as m,h as w,k as g}from"./chunk-FGDJVQG3.js";import{c as l,d as a,f as o,g as f}from"./chunk-PLJNPQFC.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-5O7V5P53.js";import"./chunk-DRQWYJMH.js";import"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as p}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var D=h;var i=async t=>{try{return await Deno.stat(t),!0}catch{return!1}},C=async(t,e)=>{try{let n=await Deno.readTextFile(t);return JSON.parse(n)[e]??null}catch{return null}},A=async t=>{let e=[];return(await i(`${t}/package.json`)||await i(`${t}/deno.json`))&&e.push("typescript"),await i(`${t}/go.mod`)&&e.push("go"),await i(`${t}/Cargo.toml`)&&e.push("rust"),(await i(`${t}/pyproject.toml`)||await i(`${t}/setup.py`))&&e.push("python"),e},T=async t=>{let e=[],n=await C(`${t}/package.json`,"dependencies");return n!==null&&("react"in n&&e.push("react"),"vue"in n&&e.push("vue"),"svelte"in n&&e.push("svelte"),"next"in n&&e.push("nextjs"),"express"in n&&e.push("express"),"hono"in n&&e.push("hono")),e},z=async t=>{let e=[];return await i(`${t}/.github/workflows`)&&e.push("github-actions"),await i(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await i(`${t}/Jenkinsfile`)&&e.push("jenkins"),await i(`${t}/.circleci`)&&e.push("circleci"),e},B=async t=>{if(await i(`${t}/deno.json`))return"deno";let e=await C(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},x=async t=>{let[e,n,r,c]=await Promise.all([A(t),T(t),z(t),B(t)]);return{languages:e,frameworks:n,ci:r,testRunner:c}};var H=async t=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),n=Deno.cwd();if(await b(n))return e.writeln(f("noskills is already initialized in this project.")),e.writeln(a("Run `noskills sync` to regenerate tool files.")),await e.close(),p(void 0);e.writeln(l("noskills init")),e.writeln(""),e.writeln(a("Scanning project..."));let r=await x(n);for(let s of r.languages)e.writeln(" ",o("\u2714"),` ${s}`);for(let s of r.frameworks)e.writeln(" ",o("\u2714"),` ${s}`);for(let s of r.ci)e.writeln(" ",o("\u2714"),` ${s}`);r.testRunner!==null&&e.writeln(" ",o("\u2714"),` test runner: ${r.testRunner}`),e.writeln(""),e.writeln(a("Detecting AI providers..."));let c=await D();for(let s of c)s.available?e.writeln(" ",o("\u25CF")," ",l(`${s.name} (${s.alias})`),a(` ${s.detail}`)):e.writeln(" ",a("\u25CB")," ",a(`${s.name} (${s.alias}) ${s.detail}`));let u=c.filter(s=>s.available).map(s=>s.name);e.writeln(""),e.writeln(a("Initializing...")),await j(n),e.writeln(" Created .nos/");for(let s of d)await P(n,s);e.writeln(` Bootstrapped ${d.length} concerns into .nos/concerns/`);let I=$([],u,r);await k(n,I),e.writeln(" Created .nos/config.json");let N=y();await v(n,N),e.writeln(" Created .nos/.state/state.json"),e.writeln("");let R=u.length;return e.writeln(o("Done."),` ${R} AI provider(s) detected.`),e.writeln("Start a spec with: ",l('noskills spec new "..."')),await e.close(),p(void 0)};export{H as main};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{f as E,h as P,k as R}from"./chunk-FGDJVQG3.js";import{b as t,c as T,d as s,e as o,f as b,j as x}from"./chunk-PLJNPQFC.js";import"./chunk-ZOZYBQX2.js";import{a as A}from"./chunk-WE7PSSAQ.js";import"./chunk-HPPFA3XU.js";import{a as C,b as i,f as $}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var F=["minimal","blog","dashboard","docs"],U=async S=>{let{positional:O,flags:m}=A(S??[],[{name:"template",short:"t",type:"string",default:"minimal",description:"Project template"},{name:"force",short:"f",type:"boolean",description:"Overwrite"},{name:"no-git",type:"boolean",description:"Skip git"},{name:"no-install",type:"boolean",description:"Skip install"}]),r=O[0]??"my-laroux-app",l=m.template,v=m.force,D=m["no-git"],n=R.ansi(),e=E({renderer:n,sink:P.stdout()});if(!F.includes(l))return await e.close(),i({message:`${n.render([o(`
|
|
2
|
+
Error: Invalid template "${l}"`)])}
|
|
3
|
+
Available templates: ${F.join(", ")}`,exitCode:1});e.writeln(x(`
|
|
4
|
+
\u2728 Creating new laroux.js project in ./${r}
|
|
5
|
+
`)),e.writeln(s(` Template: ${l}`));let c="eser",p=`laroux-template-${l}`,j="main",d=`${Deno.cwd()}/${r}`;try{await Deno.mkdir(d,{recursive:!0})}catch{return await e.close(),i({message:n.render([o(`
|
|
6
|
+
Could not create directory: ${d}`)]),exitCode:1})}e.writeln(s(` Fetching from gh:${c}/${p}...
|
|
7
|
+
`));try{let a=await import("./registry-fetcher-ZJ76EHBA.js"),u=await import("./recipe-applier-F2REROYS.js"),f=await $(()=>a.fetchRecipeFromRepo(c,p,j,"recipe.json"),()=>{});if(f._tag==="Ok"&&f.value!==void 0){let g=`https://raw.githubusercontent.com/${c}/${p}/${j}`,w=await u.applyRecipe(f.value,{cwd:d,registryUrl:g,force:v,variables:{project_name:r}});e.writeln(b(`
|
|
8
|
+
\u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-STKIZYZ3.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:v,skipPostInstall:D,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
|
|
9
|
+
Scaffolding failed: ${y.error.message}`)]),exitCode:1});let k=y.value;if(e.writeln(b(`
|
|
10
|
+
\u{1F389} Project created successfully!`)),Object.keys(k.variables).length>0){e.writeln(t(`
|
|
11
|
+
Variables applied:`));for(let[h,N]of Object.entries(k.variables))e.writeln(t(" "),s(h),t(`: ${N}`))}}}catch(a){let u=a instanceof Error?a.message:String(a);return await e.close(),i({message:n.render([o(`
|
|
12
|
+
Failed: ${u}`)]),exitCode:1})}return e.writeln(),e.writeln(T("Next steps:")),e.writeln(),e.writeln(t(` cd ${r}`)),e.writeln(t(" laroux dev")),e.writeln(),e.writeln(t("Then open "),x("http://localhost:8000"),t(" in your browser.")),e.writeln(),e.writeln(s("Learn more at https://laroux.now/")),e.writeln(),await e.close(),C(void 0)};export{U as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as M}from"./chunk-7GS5KPVF.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-GXPLME3K.js";import{f as C,h as P,k as H}from"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as A,c as O,d as l,e as k,f as w,g as y,h as E}from"./chunk-PLJNPQFC.js";import{a as b}from"./chunk-HPPFA3XU.js";import{g as r}from"./chunk-DQAEQEXD.js";import{u as t}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var R={precommit:{hookName:"pre-commit",args:""},commitmsg:{hookName:"commit-msg",args:'-- "$1"'},prepush:{hookName:"pre-push",args:""}},N="# @eser managed hook",I=async(i,n)=>{let e=await t.getCliCommand({command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"}),s=n.length>0?` ${n}`:"",o=`${e} workflows run -e ${i}${s}`;return["#!/bin/sh",`${N} \u2014 generated by \`eser codebase install\``,"# Do not edit. Re-run `eser codebase install` to update.","",o,""].join(`
|
|
2
|
+
`)},S=async()=>{try{let s=(await t.current.exec.exec("git",["rev-parse","--git-dir"])).trim();if(s.length>0)return s}catch{}let i=t.current.process.cwd(),n=t.current.path.join(i,".git");try{if((await t.current.fs.stat(n)).isDirectory)return n}catch{}return null},G=i=>{let n=i.workflows;if(!Array.isArray(n))return[];let e=new Set;for(let s of n)if(Array.isArray(s.on))for(let o of s.on)typeof o=="string"&&e.add(o);return[...e]},T=H.ansi(),U=async i=>{let n=b(i??[],{boolean:["force","dry-run","help"],alias:{h:"help",f:"force",n:"dry-run"}});if(n.help)return console.log("eser codebase install \u2014 Install git hooks from .manifest.yml"),console.log(""),console.log("Flags:"),console.log(" --force, -f Overwrite non-managed hooks"),console.log(" --dry-run, -n Show what would happen without writing"),console.log(" --help, -h Show this help"),r.ok(void 0);let e=C({renderer:T,sink:P.stdout()}),s=n.force,o=n["dry-run"],d=await S();if(d===null)return e.writeln(k("Error: not inside a git repository")),await e.close(),r.fail({exitCode:1});let m=t.current.path.join(d,"hooks"),g=t.current.process.cwd(),a=await M(g);if(a===null)return e.writeln(k("Error: no .manifest.yml found in current directory")),await e.close(),r.fail({exitCode:1});let c=G(a);if(c.length===0)return e.writeln(y("No workflow events found \u2014 nothing to install.")),await e.close(),r.ok(void 0);o||await t.current.fs.ensureDir(m);let f=0,v=0,u=0;for(let D of c){let F=R[D];if(F===void 0){e.writeln(l(` skip ${D} (unknown event, no hook mapping)`));continue}let{hookName:p,args:K}=F,j=t.current.path.join(m,p),_=await I(D,K),x=!1,$=!1;try{let q=await t.current.fs.readTextFile(j);x=!0,$=q.includes(N)}catch{}if(o){x?$?e.writeln(E(` would update ${p} (managed)`)):s?e.writeln(y(` would overwrite ${p} (--force)`)):e.writeln(y(` would skip ${p} (user hook; use --force to overwrite)`)):e.writeln(E(` would create ${p}`));continue}if(x&&!$&&!s){e.writeln(y(` skip ${p} \u2014 user hook exists (use --force to overwrite)`)),v++;continue}await t.current.fs.writeTextFile(j,_);try{await t.current.fs.chmod(j,493)}catch{}x&&$?(e.writeln(w(` updated ${p}`)),u++):(e.writeln(w(` installed ${p}`)),f++)}e.writeln();let h=[];return f>0&&h.push(`${f} installed`),u>0&&h.push(`${u} updated`),v>0&&h.push(`${v} skipped`),o?e.writeln(l("(dry run \u2014 no changes made)")):h.length>0?e.writeln(w(`Done: ${h.join(", ")}.`)):e.writeln(l("Nothing to do.")),await e.close(),r.ok(void 0)},W=async i=>{if(b(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase uninstall \u2014 Remove managed git hooks"),r.ok(void 0);let e=C({renderer:T,sink:P.stdout()}),s=await S();if(s===null)return e.writeln(k("Error: not inside a git repository")),await e.close(),r.fail({exitCode:1});let o=t.current.path.join(s,"hooks"),d=0,m=Object.values(R).map(a=>a.hookName),g=[...new Set(m)];for(let a of g){let c=t.current.path.join(o,a);try{(await t.current.fs.readTextFile(c)).includes(N)&&(await t.current.fs.remove(c),e.writeln(w(` removed ${a}`)),d++)}catch{}}return e.writeln(),d>0?e.writeln(w(`Done: ${d} hook(s) removed.`)):e.writeln(l("No managed hooks found.")),await e.close(),r.ok(void 0)},X=async i=>{if(b(i??[],{boolean:["help"],alias:{h:"help"}}).help)return console.log("eser codebase status \u2014 Show git hook installation status"),r.ok(void 0);let e=C({renderer:T,sink:P.stdout()}),s=await S();if(s===null)return e.writeln(k("Error: not inside a git repository")),await e.close(),r.fail({exitCode:1});let o=t.current.path.join(s,"hooks"),d=t.current.process.cwd(),m=await M(d);if(m===null)return e.writeln(k("Error: no .manifest.yml found in current directory")),await e.close(),r.fail({exitCode:1});let g=G(m);if(g.length===0)return e.writeln(l("No workflow events found in manifest.")),await e.close(),r.ok(void 0);e.writeln(O("Git hook status:")),e.writeln();for(let a of g){let c=R[a];if(c===void 0){e.writeln(A(" "),l(a.padEnd(14)),A(" "),l("(no hook mapping)"));continue}let{hookName:f}=c,v=t.current.path.join(o,f),u;try{(await t.current.fs.readTextFile(v)).includes(N)?u=w("managed (@eser)"):u=y("user hook")}catch{u=l("not installed")}e.writeln(A(` ${f.padEnd(14)} `),u)}return e.writeln(),await e.close(),r.ok(void 0)};export{U as main,X as statusMain,W as uninstallMain};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-5C7ZQN6X.js";import"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as KiroModel,b as kiroFactory};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as h,b as u,c as k}from"./chunk-2R4MK2KR.js";import"./chunk-7GS5KPVF.js";import"./chunk-GXPLME3K.js";import{f as m,h as c,k as w}from"./chunk-FGDJVQG3.js";import{b as t,c as a,d as e}from"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import{a as g}from"./chunk-HPPFA3XU.js";import{a as i}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
|
|
2
|
+
`),console.log("Options:"),console.log(" --config <path> Config directory (default: .)"),console.log(" -h, --help Show this help"),i(void 0);let o=m({renderer:w.ansi(),sink:c.stdout()}),A=d.config??".",r=await u(A),n=h();if(n.register(k),p?.tools!==void 0&&n.registerAll(p.tools),r!==null&&r.workflows.length>0){o.writeln(a("Workflows:"));for(let s of r.workflows){let x=s.on.length>0?s.on.join(", "):"(no events)",f=s.steps.length,C=f===1?"step":"steps";o.writeln(t(` ${s.id.padEnd(20)} `),e(x.padEnd(25)),t(` ${f} ${C}`))}}else o.writeln(e("No workflows defined."));o.writeln();let l=n.getAll();if(l.length>0){o.writeln(a(`Registered tools (${l.length}):`));for(let s of l)o.writeln(t(` ${s.name.padEnd(28)} `),e(s.description))}else o.writeln(e("No tools registered."));return await o.close(),i(void 0)};export{R as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R,d as h}from"./chunk-NUSNMQPL.js";import{f as S}from"./chunk-SCULX2ND.js";import{f as m,h as f,k as y}from"./chunk-FGDJVQG3.js";import{c as p,d as l,j as d}from"./chunk-PLJNPQFC.js";import{a as u}from"./chunk-HPPFA3XU.js";import{a as n,b as o,c as g}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var w=["project","structure","utility"],C={project:"PROJECTS",structure:"STRUCTURES",utility:"UTILITIES"},k=t=>R(async r=>{try{let s=await S(t.registrySource,{local:t.local}),e=[...s.recipes];if(t.language!==void 0&&(e=e.filter(i=>i.language===t.language)),t.scale!==void 0&&(e=e.filter(i=>i.scale===t.scale)),t.tag!==void 0&&(e=e.filter(i=>i.tags!==void 0&&i.tags.includes(t.tag))),e.length===0)return r.out.writeln("No recipes found matching your filters."),r.out.writeln("Run ",l("`eser kit list`")," without filters to see all recipes."),n({manifest:s,recipes:e});r.out.writeln(p(`${s.name} \u2014 ${s.description}`)),r.out.writeln();for(let i of w){let c=e.filter(a=>a.scale===i);if(c.length!==0){r.out.writeln(d(C[i]));for(let a of c)r.out.writeln(` ${a.name.padEnd(20)} ${a.description} `,l(`[${a.language}]`));r.out.writeln()}}return n({manifest:s,recipes:e})}catch(s){let e=s instanceof Error?s.message:String(s);return o({_tag:"RegistryError",message:e})}});var $=async t=>{let r=u(t??[],{string:["registry","language","scale","tag"],boolean:["local"]}),s=m({renderer:y.ansi(),sink:f.stdout()}),e=await h(k({registrySource:r.registry,language:r.language,scale:r.scale,tag:r.tag,local:r.local===!0}),{out:s});return await s.close(),g(e)?n(void 0):o({exitCode:1})};export{$ as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-X4ZCYXOT.js";import{f as o,h as m,k as d}from"./chunk-FGDJVQG3.js";import{c as t,d as a,f as l,l as n}from"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import{a as i}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-M5TBBQQC.js";import"./chunk-Y6DZEK4W.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-A2GDVOQP.js";import"./chunk-ZE5T64HQ.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as loadConfig};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-TMFPDVYN.js";import{a as Q}from"./chunk-M5TBBQQC.js";import"./chunk-R6F4EK2B.js";import"./chunk-7M3ONEMO.js";import"./chunk-RGUC6KAZ.js";import"./chunk-ATLUGTI7.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import{a as X}from"./chunk-ZF2XYULB.js";import{b as Y}from"./chunk-5UGVJVIQ.js";import"./chunk-GXPLME3K.js";import{d as G,e as m,g as V}from"./chunk-OBIEQJDE.js";import{a as v}from"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import"./chunk-A2GDVOQP.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{g as W,t as s}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.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:
|
|
2
|
+
${p}`);let u=f=>f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),a=`
|
|
3
|
+
console.error("Runtime bundling failed:", ${JSON.stringify(l)});
|
|
4
|
+
document.getElementById("root").innerHTML = '<div class="error"><h2>Bundle Error</h2><pre>${u(l)}</pre></div>';
|
|
5
|
+
`,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-PEAFMI6F.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-PXE4DB3V.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c}from"./chunk-7GS5KPVF.js";import"./chunk-GXPLME3K.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{a as MANIFEST_FILENAMES,c as getManifestPath,b as loadManifest};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as P}from"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import{t as a}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var h=P.getLogger(["laroux","image-optimizer"]),$=null;async function q(){return $===null&&($=await import("npm:sharp@^0.33.5")),$.default??$}var C={formats:["webp","original"],widths:[640,768,1024,1280,1920],quality:{webp:80,avif:75,jpeg:85,png:90},generateBlurPlaceholder:!0,placeholderWidth:10};async function S(t){let r=[],o=[".jpg",".jpeg",".png",".gif",".webp"];async function n(e){try{for await(let i of a.fs.readDir(e)){let s=a.path.resolve(e,i.name);if(i.isDirectory)await n(s);else if(i.isFile){let g=a.path.extname(i.name).toLowerCase();o.includes(g)&&r.push(s)}}}catch{}}return await n(t),r}async function B(t,r){return`data:image/webp;base64,${(await(await q())(t).resize(r,void 0,{fit:"inside"}).blur(5).webp({quality:20}).toBuffer()).toString("base64")}`}async function j(t,r,o,n={}){let e=await q(),i={...C,...n},s=e(t),g=await s.metadata();if(g.width===void 0||g.height===void 0)throw new Error(`Could not read image dimensions: ${t}`);let c=g.width,w=g.height,y=c/w,m=a.path.basename(t,a.path.extname(t)),f=`${o}/${m}`,u=[];for(let l of i.widths){if(l>c)continue;let v=Math.round(l/y);for(let b of i.formats){let z,d;if(b==="original"){let O=a.path.extname(t).toLowerCase();d=O.replace(".",""),z=a.path.resolve(r,`${m}-${l}w${O}`)}else d=b,z=a.path.resolve(r,`${m}-${l}w.${b}`);await a.fs.ensureDir(a.path.dirname(z));let p=s.clone().resize(l,v,{fit:"cover"});b==="webp"?p=p.webp({quality:i.quality.webp}):b==="avif"?p=p.avif({quality:i.quality.avif}):d==="jpg"||d==="jpeg"?p=p.jpeg({quality:i.quality.jpeg}):d==="png"&&(p=p.png({quality:i.quality.png}));let x=await p.toBuffer();await a.fs.writeFile(z,x),u.push({path:z,format:d,width:l,height:v,size:x.length})}}let I;return i.generateBlurPlaceholder&&(I=await B(t,i.placeholderWidth)),{originalPath:t,publicPath:f,originalWidth:c,originalHeight:w,variants:u,blurDataUrl:I,aspectRatio:y}}async function F(t,r,o="/images",n={}){h.info(`Scanning for images in ${t}...`);let e=await S(t);if(e.length===0)return h.debug("No images found to optimize"),{timestamp:Date.now(),images:{}};h.info(`Found ${e.length} image(s) to optimize`);let i={},s=0,g=0;for(let m of e)try{let f=await a.fs.stat(m);s+=f.size;let u=await j(m,r,o,n);i[m]=u;let I=u.variants.reduce((l,v)=>l+v.size,0);g+=I,h.debug(`Optimized: ${a.path.basename(m)} \u2192 ${u.variants.length} variants`)}catch(f){h.warn(`Failed to optimize ${m}: ${f instanceof Error?f.message:String(f)}`)}let c={timestamp:Date.now(),images:i},w=a.path.resolve(r,"image-manifest.json");await a.fs.ensureDir(a.path.dirname(w)),await a.fs.writeTextFile(w,JSON.stringify(c,null,2));let y=s>0?((1-g/s)*100).toFixed(1):0;return h.info(`Image optimization complete: ${e.length} images, ${y}% size reduction`),c}function V(t,r="webp"){return t.variants.filter(n=>n.format===r).sort((n,e)=>n.width-e.width).map(n=>`${n.path} ${n.width}w`).join(", ")}function M(t,r,o="webp"){let n=t.variants.filter(e=>e.format===o).sort((e,i)=>e.width-i.width);return n.find(e=>e.width>=r)??n.at(-1)}export{V as generateSrcset,M as getBestVariant,j as optimizeImage,F as optimizeImages,S as scanImages};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c as e,d as f,e as g,f as h,g as i,h as j,i as k}from"./chunk-OBIEQJDE.js";import{a as c,b as d}from"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-DXB73IDG.js";export{c as Severities,d as SeverityNames,b as category,f as config,e as context,j as filters,h as formatters,g as logger,i as sinks,k as tracer,a as types};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-HGNGFAAY.js";import"./chunk-FGDJVQG3.js";import"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import"./chunk-4HNB3UTC.js";import"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{c as T,h as J}from"./chunk-R6F4EK2B.js";import{a as S}from"./chunk-RGUC6KAZ.js";import{b as B,c as W}from"./chunk-5UGVJVIQ.js";import{e as h}from"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import"./chunk-GLSCZGXA.js";import"./chunk-ZE5T64HQ.js";import{t as i}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.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 m=n.getClientComponent(s.filePath,p);if(m){o++,m.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:m.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(
|
|
2
|
+
"./${t.relativePath}",
|
|
3
|
+
"default"
|
|
4
|
+
);`:`export const ${n} = createClientReference(
|
|
5
|
+
"./${t.relativePath}",
|
|
6
|
+
"${n}"
|
|
7
|
+
);`);return`/**
|
|
8
|
+
* Auto-generated client component reference
|
|
9
|
+
* Original: ${t.relativePath}
|
|
10
|
+
* Exports: ${t.exportNames.join(", ")}
|
|
11
|
+
* This file is generated at build time - do not edit!
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { createClientReference } from "@eser/laroux-react/protocol";
|
|
15
|
+
|
|
16
|
+
// Export client components as references
|
|
17
|
+
// The actual component code runs in the browser
|
|
18
|
+
${e.join(`
|
|
19
|
+
|
|
20
|
+
`)}
|
|
21
|
+
`}async function A(t,e,n){v.debug(`\u{1F504} Transforming ${t.length} client component(s)...`);let r=[];for(let o of t){let a=await H(o,e);v.debug(` \u2713 ${o.relativePath} \u2192 ${i.path.relative(n,a.transformedPath)}`),r.push(a)}return v.debug("\u2705 Transformation complete"),r}function et(t){let e=new Map;for(let n of t){e.set(`./${n.originalPath}`,n.transformedPath);let r=n.originalPath.split("/").pop();e.set(`./${r}`,n.transformedPath)}return e}async function U(t,e,n){let r={generated:new Date().toISOString(),components:t.map(o=>({original:o.originalPath,transformed:i.path.relative(n,o.transformedPath)}))};await i.fs.writeTextFile(e,JSON.stringify(r,null,2)),v.debug(`\u{1F4DD} Transform manifest saved to: ${i.path.relative(n,e)}`)}var nt=h.getLogger(["laroux-bundler","rsc-module-map"]);function L(t){let e={};for(let n of t){let r=`./${n.relativePath}`,o=W(n.relativePath,".js");e[r]={id:r,chunks:[o],name:n.exportNames[0]??"default"}}return e}function rt(t){let e={};for(let[n,r]of Object.entries(t))e[n]={id:r.id,chunks:r.chunks,name:r.name};return e}async function F(t,e){let n=JSON.stringify(t,null,2);await i.fs.writeTextFile(e,n),nt.debug(`\u{1F4DD} Module map saved to: ${e}`)}async function ot(t){let e=await i.fs.readTextFile(t);return JSON.parse(e)}function N(t){let e={};for(let n of t)e[n.relativePath]={id:n.relativePath,chunks:["client.js"],name:n.exportNames[0]??"default"};return e}var u=h.getLogger(["laroux-bundler","rsc-rewrite-imports"]);function st(t,e){let n=!1,r=!1,o=!1,a="";for(let l=0;l<e;l++){let s=t[l];if(s===void 0)break;if(a==="\\"){a=s;continue}s==="'"&&!r&&!o?n=!n:s==='"'&&!n&&!o?r=!r:s==="`"&&!n&&!r&&(o=!o),a=s}return n||r||o}function Q(t){let e=[],n=/import\s+(?:type\s+)?(?:(?:\{[^}]*\}|\*\s+as\s+\w+|\w+)(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+|\w+))*\s+from\s+)?["']([^"']+)["'];?/g,r;for(;(r=n.exec(t))!==null;){let o=r[1];o&&(st(t,r.index)||(o.startsWith("./")||o.startsWith("../")||o.startsWith("@/"))&&e.push({original:r[0],path:o,startIndex:r.index,endIndex:r.index+r[0].length}))}return e}function G(t,e,n){if(e.startsWith("@/")){let a=e.slice(2);return i.path.join(n,"src",a)}let r=i.path.dirname(t);return i.path.resolve(r,e)}function it(t,e){if(e.has(t))return e.get(t);let n=B.map(r=>`.${r}`);for(let r of n){let o=t.endsWith(r)?t:t+r;if(e.has(o))return e.get(o)}return null}function X(t,e){if(e.has(t))return e.get(t);if(!t.endsWith(".module.css")){let n=t+".module.css";if(e.has(n))return e.get(n)}return null}async function q(t,e,n,r,o){let a=await i.fs.readTextFile(t),l=Q(a),s=a,p=0,m=0;for(let c of l){let C=G(t,c.path,o);if(X(C,n)){let M=c.path.endsWith(".module.css")?`${c.path}.json`:`${c.path}.module.css.json`,y=c.original.match(/^import\s+["']/),f;y?f=c.original.replace(/^import\s+["']([^"']+)["'];?/,`import styles from "${M}" with { type: "json" };`):f=c.original.replace(`"${c.path}"`,`"${M}" with { type: "json" }`).replace(`'${c.path}'`,`'${M}' with { type: "json" }`);let d=c.startIndex+m,w=c.endIndex+m;s=s.slice(0,d)+f+s.slice(w),m+=f.length-c.original.length,p++;continue}let $=it(C,e);if($){let M=i.path.relative(o,t),y=i.path.join(r,M),f=i.path.relative(i.path.dirname(y),$),d=f.startsWith(".")?f:`./${f}`,w=c.original.replace(`"${c.path}"`,`"${d}"`).replace(`'${c.path}'`,`'${d}'`),I=c.startIndex+m,b=c.endIndex+m;s=s.slice(0,I)+w+s.slice(b),m+=w.length-c.original.length,p++}else if(c.path.startsWith("@/")){let M=i.path.relative(o,t),y=i.path.join(r,M),f=i.path.join(o,"dist","server","src",c.path.slice(2)),d=i.path.relative(i.path.dirname(y),f),w=d.startsWith(".")?d:`./${d}`,I=c.original.replace(`"${c.path}"`,`"${w}"`).replace(`'${c.path}'`,`'${w}'`),b=c.startIndex+m,Y=c.endIndex+m;s=s.slice(0,b)+I+s.slice(Y),m+=I.length-c.original.length,p++}}let x=i.path.relative(o,t),g=i.path.join(r,x);return await i.fs.ensureDir(i.path.dirname(g)),await i.fs.writeTextFile(g,s),{originalPath:t,rewrittenPath:g,importsRewritten:p}}function K(t){let e=new Map;for(let n of t){e.set(n.originalPath,n.transformedPath);let r=n.originalPath.replace(/\.(tsx|ts|jsx|js)$/,"");e.set(r,n.transformedPath)}return e}function R(t){let e=new Map;for(let n of t){let r=n.replace(/\.module\.css$/,".module.css.json");e.set(n,r);let o=n.replace(/\.module\.css$/,"");e.set(o,r)}return e}async function z(t,e,n,r,o){u.debug(`\u{1F504} Rewriting imports in ${t.length} server component(s)...`);let a=K(e),l=R(n);u.debug(` Found ${n.length} CSS module(s) to track`);let s=[];for(let p of t){let m=await q(p,a,l,r,o);m.importsRewritten>0?u.debug(` \u2713 ${i.path.relative(o,p)} (${m.importsRewritten} import(s) rewritten)`):u.debug(` \u2713 ${i.path.relative(o,p)} (no client imports)`),s.push(m)}return u.debug("\u2705 Import rewriting complete"),s}async function V(t,e,n){let r=await i.fs.readTextFile(t),o=Q(r),a=r,l=0,s=0;for(let p of o){let m=G(t,p.path,n);if(X(m,e)){let g=p.path.endsWith(".module.css")?`${p.path}.json`:`${p.path}.module.css.json`,c=p.original.match(/^import\s+["']/),C;c?C=p.original.replace(/^import\s+["']([^"']+)["'];?/,`import styles from "${g}" with { type: "json" };`):C=p.original.replace(`"${p.path}"`,`"${g}" with { type: "json" }`).replace(`'${p.path}'`,`'${g}' with { type: "json" }`);let O=p.startIndex+s,$=p.endIndex+s;a=a.slice(0,O)+C+a.slice($),s+=C.length-p.original.length,l++}}return l>0&&await i.fs.writeTextFile(t,a),{importsRewritten:l}}async function at(t,e,n,r){u.debug(`\u{1F504} Rewriting CSS module imports in ${t.length} client component(s)...`);let o=R(e);u.debug(` Found ${e.length} CSS module(s) to track`);let a=0;for(let l of t){let s=await V(l.filePath,o,r);s.importsRewritten>0&&(u.debug(` \u2713 ${i.path.relative(r,l.filePath)} (${s.importsRewritten} CSS import(s) rewritten)`),a+=s.importsRewritten)}a>0?u.debug(`\u2705 Rewrote ${a} CSS module import(s) in ${t.length} client component(s)`):u.debug("\u2705 No CSS module imports found in client components")}async function D(t,e,n){u.debug("\u{1F504} Rewriting CSS module imports in all src files...");let r=R(e),o=[];for await(let l of S(t,"**/*.{tsx,ts}",/node_modules/))o.push(i.path.join(t,l));u.debug(` Found ${o.length} source file(s) to check`);let a=0;for(let l of o){let s=await V(l,r,n);s.importsRewritten>0&&(u.debug(` \u2713 ${i.path.relative(n,l)} (${s.importsRewritten} CSS import(s) rewritten)`),a+=s.importsRewritten)}a>0?u.debug(`\u2705 Rewrote ${a} CSS module import(s) in ${o.length} source file(s)`):u.debug("\u2705 No CSS module imports needed rewriting")}var lt=["entry.tsx","error-boundary.tsx","error-overlay.tsx","globals.d.ts","hmr-client.tsx","index.ts","lazy-loader.ts","smart-refresh.tsx"];function pt(t){if(t.startsWith("jsr:"))return!0;if(URL.canParse(t)){let e=new URL(t);return e.protocol==="https:"||e.protocol==="http:"}return!1}function ct(t){return URL.canParse(t)&&t.startsWith("file://")?new URL(t).pathname:t}function mt(t){let e=t.match(/^jsr:@([^/]+)\/([^@]+)@[\^~]?([^/]+)(.*)$/);if(e){let[,r,o,a,l]=e;return`${new URL(`https://jsr.io/@${r}/${o}/${a}`).href}${l}`}let n=t.match(/^jsr:@([^/]+)\/([^/]+)(.*)$/);if(n){let[,r,o,a]=n;return`${new URL(`https://jsr.io/@${r}/${o}`).href}${a}`}throw new Error(`Cannot parse JSR specifier: ${t}`)}function ut(t){return t.replace(/@jsxImportSource\s+npm:react@[^\s*]+/g,"@jsxImportSource react").replace(/@jsxImportSourceTypes\s+npm:react@[^\s*]+/g,"@jsxImportSourceTypes react").replace(/from\s+["']jsr:(@[^@]+)@[^"'/]+([^"']*)["']/g,'from "$1$2"').replace(/import\s*\(\s*["']jsr:(@[^@]+)@[^"'/]+([^"']*)["']\s*\)/g,'import("$1$2")').replace(/from\s+["']npm:\/?([^@]+)@[^"'/]+([^"']*)["']/g,'from "$1$2"').replace(/import\s*\(\s*["']npm:\/?([^@]+)@[^"'/]+([^"']*)["']\s*\)/g,'import("$1$2")')}function ft(){let e=import.meta.resolve("@eser/laroux-react/client/bootstrap").replace(/\/index\.ts$/,"");return e.startsWith("jsr:")&&(e=mt(e)),{isRemote:pt(e),baseUrl:e}}async function gt(t){let{isRemote:e,baseUrl:n}=ft();for(let r of lt){let o=i.path.resolve(t,r),a=n.endsWith("/")?new URL(r,n).href:new URL(`${n}/${r}`).href;if(e)try{let l=await fetch(a);if(!l.ok)throw new Error(`HTTP ${l.status}`);let s=await l.text();s=ut(s),await i.fs.writeTextFile(o,s)}catch(l){throw new Error(`Failed to fetch bootstrap file ${r} from ${a}: ${l instanceof Error?l.message:String(l)}`)}else{let l=ct(a);await J(l,o,{overwrite:!0})}}}async function k(t,e,n){let r=i.path.resolve(n,"_client-entry.tsx");await i.fs.ensureDir(n),await gt(n);let o=t.map((s,p)=>`import * as __component_${p} from "${s.filePath}";`).join(`
|
|
22
|
+
`),a=t.map((s,p)=>` __RUNTIME_MODULES__["${`./${s.relativePath}`}"] = __component_${p};`).join(`
|
|
23
|
+
`),l=`/**
|
|
24
|
+
* Auto-generated Client Entry Point - Runtime Bundle
|
|
25
|
+
* This file contains the bootstrap code and all client components
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
${o}
|
|
29
|
+
|
|
30
|
+
// Create global module registry for runtime components
|
|
31
|
+
if (typeof globalThis !== "undefined") {
|
|
32
|
+
globalThis.__RUNTIME_MODULES__ = globalThis.__RUNTIME_MODULES__ ?? {};
|
|
33
|
+
}
|
|
34
|
+
const __RUNTIME_MODULES__ = typeof globalThis !== "undefined"
|
|
35
|
+
? globalThis.__RUNTIME_MODULES__
|
|
36
|
+
: {};
|
|
37
|
+
|
|
38
|
+
// Register all client components
|
|
39
|
+
${a}
|
|
40
|
+
|
|
41
|
+
// Import and run the bootstrap code (copied to dist/)
|
|
42
|
+
import "./entry.tsx";
|
|
43
|
+
`;return await i.fs.writeTextFile(r,l),r}var dt={name:"react",analyzeClientComponents:async(t,e,n)=>await E(t,e,n),getAllComponents:async t=>await _(t),transformClientComponents:async(t,e,n)=>(await A(t,e,n)).map(o=>({originalPath:o.originalPath,transformedPath:o.transformedPath})),generateTransformManifest:async(t,e,n)=>{await U(t,e,n)},createModuleMap:t=>Promise.resolve(L(t)),saveModuleMap:async(t,e)=>{await F(t,e)},createClientManifest:t=>Promise.resolve(N(t)),rewriteServerComponents:async(t,e,n,r,o)=>{await z(t,e,n,r,o)},rewriteCssModuleImports:async(t,e,n)=>{await D(t,e,n)},createClientEntry:async(t,e,n)=>await k(t,e,n)};export{E as analyzeClientComponents,rt as createBundlerConfig,R as createCSSModuleMap,K as createClientComponentMap,k as createClientEntry,N as createClientManifest,et as createImportMapping,L as generateModuleMap,U as generateTransformManifest,_ as getAllComponents,ot as loadModuleMap,dt as reactPlugin,at as rewriteAllClientComponentCSSImports,z as rewriteAllServerComponents,D as rewriteAllSrcCSSModuleImports,q as rewriteServerComponentImports,F as saveModuleMap,A as transformAllClientComponents,H as transformClientComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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}from"./chunk-GRTR6TNJ.js";import{b as y,c as z}from"./chunk-Z7742D7Q.js";import{a as p,b as q}from"./chunk-VTQ72OK7.js";import{a,b,c,d}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{c as AlreadyExistsError,b as NotFoundError,d as ProcessError,a as RuntimeCapabilityError,u as buildCommand,z as clearWorkerdEnv,A as createRuntime,B 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,r as searchFileHierarchy,p as toPosix};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G,b as v}from"./chunk-UJX2S56V.js";import{a as P,b as g}from"./chunk-GETSWLMF.js";import{a as S,b as J}from"./chunk-NIX3WX3O.js";import{a as K,b as V}from"./chunk-4Q3SEHPE.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-PLRSDG6G.js";import"./chunk-LRL56YFE.js";import{a as f,b as u}from"./chunk-3DMTTLUJ.js";import{a as A,b as C}from"./chunk-ZY72QNKZ.js";import{a as M,b as w}from"./chunk-NZFUFGOC.js";import{a as I,b as T}from"./chunk-5C7ZQN6X.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-7QNRH7OR.js";import"./chunk-OLM5RTFK.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-GBDSASP5.js"),{openaiFactory:r}=await import("./openai-XMIVMDDL.js"),{geminiFactory:t}=await import("./gemini-I6F5N7PS.js"),{vertexaiFactory:a}=await import("./vertexai-2SMP54AR.js"),{claudeCodeFactory:i}=await import("./claude-code-PWTLM554.js"),{ollamaFactory:c}=await import("./ollama-DQ5VM4HI.js"),{openCodeFactory:n}=await import("./opencode-IZMQZ4ZK.js"),{kiroFactory:p}=await import("./kiro-NMTIFMT4.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-7M3ONEMO.js";import"./chunk-RGUC6KAZ.js";import"./chunk-5UGVJVIQ.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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-PBSR4XR2.js";import"./chunk-OBIEQJDE.js";import"./chunk-USCAYIWL.js";import"./chunk-PLJNPQFC.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.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 @@
|
|
|
1
|
+
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-FGDJVQG3.js";import{n as f}from"./chunk-PLJNPQFC.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{b as PipelineError,a as StreamError,c as TimeoutError,d as createChunk,e as defineLayer,k as layers,g as output,h as pipeline,l as renderers,i as sinks,j as sources,f as span};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as Re}from"./chunk-IAWIWTDY.js";import{a as Pe}from"./chunk-SJQWPBMJ.js";import{a as ge,c as ve}from"./chunk-HPVL4BVQ.js";import{a as ke,c as ye}from"./chunk-MQH4XBFN.js";import{a as Ve,c as he}from"./chunk-QIUIPRJP.js";import{a as xe}from"./chunk-EW5NCPPE.js";import{a as Ce}from"./chunk-V5HTJPFW.js";import{a as we}from"./chunk-XWYLEYLY.js";import{a as Se}from"./chunk-ZTLJ775S.js";import"./chunk-DLVQNMNV.js";import{a as be,c as $e}from"./chunk-HVMMNGY5.js";import{a as Z,c as ee}from"./chunk-VGFZXQMW.js";import{a as ae,c as te}from"./chunk-NSZ4HGDI.js";import{a as se,c as oe}from"./chunk-C3OSYHJY.js";import{a as ie,c as re}from"./chunk-CDLEA2PD.js";import{a as ne,c as le}from"./chunk-YUXQ7JNG.js";import{a as de,c as ce}from"./chunk-4HMEWMWL.js";import{a as pe,c as me}from"./chunk-L2BYHWDC.js";import{a as ue,c as fe}from"./chunk-H2JGLZIR.js";import{a as Y,c as _}from"./chunk-DZD6MI45.js";import{a as G,c as U}from"./chunk-SCCNNGD4.js";import{a as H,c as K}from"./chunk-NADES3GN.js";import{a as Q,c as X}from"./chunk-XJ3VEVYL.js";import"./chunk-VFMYWG2I.js";import"./chunk-Y6DLCHJN.js";import{b as J,c as B}from"./chunk-7GS5KPVF.js";import"./chunk-ATLUGTI7.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import"./chunk-6U2VEZEM.js";import"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import{f as A,h as W,k as z}from"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as m,d as k,e as h,f as P,g as O,j as q}from"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import{a as L}from"./chunk-HPPFA3XU.js";import{a as R,b as D}from"./chunk-DQAEQEXD.js";import{t as w}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var S=async a=>{let t=await J(a);return t===null?null:t},je=async a=>await B(a);var M={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let t=await we({root:a.root});return{name:"validate-circular-deps",passed:!t.hasCycles,issues:t.cycles.map(s=>({severity:"error",message:`Circular dependency: ${s.join(" \u2192 ")}`})),stats:{packagesChecked:t.packagesChecked}}}};var j={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let t=await Re({root:a.root});return{name:"validate-mod-exports",passed:t.isComplete,issues:t.missingExports.map(s=>({severity:"error",message:`Missing export in ${s.packageName}: ${s.file}`,file:s.file})),stats:{packagesChecked:t.packagesChecked}}}};var T={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let t=await Se({root:a.root});return{name:"validate-export-names",passed:t.isValid,issues:t.violations.map(s=>({severity:"error",message:`${s.packageName}: "${s.exportPath}" should be "${s.suggestion}"`})),stats:{packagesChecked:t.packagesChecked}}}};var E={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let t=a.options?.requireExamples,s=await Ce({root:a.root,requireExamples:t});return{name:"validate-docs",passed:s.isValid,issues:s.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:s.filesChecked,symbolsChecked:s.symbolsChecked}}}};var I={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let t=await Pe({root:a.root}),s=[];for(let e of t.inconsistencies)s.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 t.dependencyInconsistencies){let n=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(n+=` (expected: ${e.expected}, actual: ${e.actual})`),s.push({severity:"error",message:n})}return{name:"validate-package-configs",passed:t.isConsistent,issues:s,stats:{packagesChecked:t.packagesChecked}}}};var y={validators:new Map,initialized:!1},De=()=>{o(M),o(j),o(T),o(E),o(I),o(_),o(U),o(K),o(X),o(ee),o(te),o(oe),o(re),o(le),o(ce),o(me),o(fe),o(ve),o(ye),o(he),o($e)},N=()=>{y.initialized||(y.initialized=!0,De())},o=a=>{y.validators.set(a.name,a)},Le=a=>(N(),y.validators.get(a)??null),F=()=>(N(),[...y.validators.values()]),Oe=()=>(N(),[...y.validators.keys()]),qe=a=>({name:a.config.name,description:a.config.description,run:async t=>{let s=await a.run(t);return{name:s.name,passed:s.issues.length===0,issues:s.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:s.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:s.filesChecked,issuesFound:s.issues.length}}}}),Ae=a=>({name:a.name,description:a.description,run:async t=>{let s=await a.validate({root:t.root??".",options:t});return{name:s.name,passed:s.passed,issues:s.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:s.stats}}}),We=()=>{let a=[],t=[Y,G,H,Q,Z,ae,se,ie,ne,de,pe,ue,ge,ke,Ve,be];for(let e of t)a.push(qe(e));let s=[M,j,T,E,I];for(let e of s)a.push(Ae(e));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let n=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{current:f}=await import("./mod-FKPTF5D5.js"),u;try{u=await f.fs.readTextFile(n)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${n}`}],mutations:[],stats:{}}}let l=xe(u,{allowAsterisk:e.allowAsterisk,allowMultipleScopes:e.allowMultipleScopes,forceScope:e.forceScope,types:e.types});return{name:"validate-commit-msg",passed:l.valid,issues:l.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ze=async(a={})=>{let t=a.root??w.process.cwd(),e=(await S(t))?.stack??[],n=[...a.skip??[]],f=a.only??[],u=F(),l=[],g=[],x=[];for(let r of u){if(f.length>0&&!f.includes(r.name))continue;if(n.includes(r.name)){x.push(r.name);continue}if(r.requiredStacks.length>0&&e.length>0&&!r.requiredStacks.some(C=>e.includes(C))){g.push({name:r.name,reason:`Requires '${r.requiredStacks.join("' or '")}' stack`});continue}let b={...a.fix!==void 0?{fix:a.fix}:{}},d=await r.validate({root:t,options:b});l.push(d)}return{passed:l.every(r=>r.passed),results:l,skipped:g,disabled:x}},wa=async a=>{let t=L(a??w.process.args,{string:["root","only","skip"],boolean:["fix","help"],alias:{h:"help"}});if(t.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"),R(void 0);let s=z.ansi(),e=A({renderer:s,sink:W.stdout()}),n=t.root,f=t.fix,u=t.only,l=t.skip,g=u!==void 0?u.split(",").map(i=>i.trim()):void 0,x=l!==void 0?l.split(",").map(i=>i.trim()):void 0,b=(await S(n??"."))?.stack?.join(", ")??"all (no .manifest.yml)";e.writeln(m(`Validating codebase...
|
|
2
|
+
`)),e.writeln(m("Stack: "),q(b),m(`
|
|
3
|
+
`));let d=await ze({root:n,only:g,skip:x,fix:f});for(let i of d.results){let c=i.passed?P("PASS"):h("FAIL"),v=Object.entries(i.stats).map(([p,$])=>`${$} ${p}`).join(", ");e.writeln(m(` ${i.name.padEnd(18)} `),c,m(` (${v})`))}if(d.skipped.length>0){e.writeln(k(`
|
|
4
|
+
Skipped (stack not configured):`));for(let i of d.skipped)e.writeln(k(` - ${i.name}: ${i.reason}`))}if(d.disabled.length>0){e.writeln(k(`
|
|
5
|
+
Disabled:`));for(let i of d.disabled)e.writeln(k(` - ${i}`))}let V=d.results.flatMap(i=>i.issues.map(c=>({validator:i.name,...c})));if(V.length>0){e.writeln(h(`
|
|
6
|
+
Issues (${V.length}):
|
|
7
|
+
`));let i=new Map;for(let c of V){let v=c.file??c.validator,p=i.get(v)??[];p.push(c),i.set(v,p)}for(let[c,v]of i){e.writeln(k(` ${c}`));for(let p of v){let $=p.severity==="error"?h("error"):O("warning"),Me=p.line!==void 0?`:${p.line}`:"";e.writeln(m(" "),$,m(`${Me}: ${p.message}`))}e.writeln()}}let C=d.results.filter(i=>!i.passed).length;return C>0?(await e.close(),D({message:s.render([h(`
|
|
8
|
+
${C} check(s) failed with ${V.length} issue(s)`)]),exitCode:1})):(e.writeln(P(`
|
|
9
|
+
All checks passed!`)),await e.close(),R(void 0))};export{je as getProjectConfigPath,Le as getValidator,Oe as getValidatorNames,F as getValidators,We as getWorkflowTools,S as loadProjectConfig,wa as main,o as registerValidator,ze as validate};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{a as _}from"./chunk-GXPLME3K.js";import{f as U,h as H,k as G}from"./chunk-FGDJVQG3.js";import{b as w,d as S,e as C,f as O,j as z}from"./chunk-PLJNPQFC.js";import{b as N}from"./chunk-DOV5776P.js";import{a as q}from"./chunk-HPPFA3XU.js";import{a as E,b as $,d as V,f as D}from"./chunk-DQAEQEXD.js";import{t as l}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import{b as v}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.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 te="main",re=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??te,path:n.length>0?n.join("/"):void 0}},se=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:re,fetch:se};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)},ne=r=>(A(),g.providers.get(r)??null),ae=()=>(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=[".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of Y){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=_(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},ie=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=ie(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:
|
|
2
|
+
${n.join(`
|
|
3
|
+
`)}`);return f},J=async r=>{for(let t of Y){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var K=/\{\{\s*\.(\w+)\s*\}\}/g,oe=new Set([".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"]),le=r=>{let t=l.path.extname(r).toLowerCase();return oe.has(t)},fe=(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},R=(r,t)=>r.replace(K,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),T=r=>K.test(r),Q=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!==""&&(fe(o,s)||(n.isDirectory?T(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(!le(n))try{let c=await l.fs.readTextFile(n);if(T(c)){let p=R(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(T(o)){let c=R(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=R(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},Z=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",".manifest.yml",".manifest.yaml",...i?.ignore??[]];await Q(o,{variables:p,ignore:u});let d=await J(o);d!==null&&await Z(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 qe=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]
|
|
4
|
+
|
|
5
|
+
Options:
|
|
6
|
+
-p, --path <dir> Target directory (default: .)
|
|
7
|
+
-f, --force Overwrite existing files
|
|
8
|
+
-i, --interactive Prompt for missing variables
|
|
9
|
+
--var key=value Set a template variable (repeatable)
|
|
10
|
+
--skip-post-install Skip post-install commands
|
|
11
|
+
-h, --help Show this help message
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
scaffold eser/ajan
|
|
15
|
+
scaffold gh:eser/ajan#v1.0 -p ./my-project
|
|
16
|
+
scaffold eser/ajan --var name=my-app --var author=me`),E(void 0);let e=G.ansi(),s=U({renderer:e,sink:H.stdout()});if(t._.length===0)return await s.close(),$({message:`${e.render([C("Error: Template specifier is required")])}
|
|
17
|
+
|
|
18
|
+
Usage: scaffold <specifier> [options]
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
scaffold eser/ajan
|
|
22
|
+
scaffold gh:eser/ajan#v1.0
|
|
23
|
+
scaffold eser/ajan -p ./my-project`,exitCode:1});let a=String(t._[0]),f=t.path??".",n=t.force??!1,o=t["skip-post-install"]??!1,i=t.interactive??!1,c=t.var,p={};if(c!==void 0)for(let h of c){let[b,...m]=String(h).split("=");b!==void 0&&(p[b]=m.join("="))}s.writeln(w("Scaffolding from "),z(a),w("..."));let u=await D(()=>k({specifier:a,targetDir:f,variables:p,force:n,skipPostInstall:o,interactive:i}),h=>({message:h.message}));if(V(u))return await s.close(),$({message:e.render([C(`
|
|
24
|
+
Scaffolding failed: ${u.error.message}`)]),exitCode:1});let d=u.value;if(s.writeln(O(`
|
|
25
|
+
Scaffolded ${d.templateName} to ${d.targetDir}`)),Object.keys(d.variables).length>0){s.writeln(w(`
|
|
26
|
+
Variables applied:`));for(let[h,b]of Object.entries(d.variables))s.writeln(w(" "),S(h),w(`: ${b}`))}if(d.postInstallCommands.length>0){s.writeln(w(`
|
|
27
|
+
Post-install commands executed:`));for(let h of d.postInstallCommands)s.writeln(w(" "),S(h))}return await s.close(),E(void 0)};export{I as fetchTemplate,ae as getDefaultProvider,ne as getProvider,T as hasVariables,j as loadTemplateConfig,qe as main,B as parseSpecifier,W as registerProvider,F as resolveVariables,k as scaffold,R as substituteVariables};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as C,b as D}from"./chunk-3TYZYY77.js";import{e as E}from"./chunk-6YRN6OJC.js";import{a as $,d as A}from"./chunk-NUSNMQPL.js";import{f as y}from"./chunk-SCULX2ND.js";import{f as v,h as k,k as R}from"./chunk-FGDJVQG3.js";import{d as m,e as w,f as P,j as h}from"./chunk-PLJNPQFC.js";import{a as N}from"./chunk-HPPFA3XU.js";import{a as g,b as p,c as j}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var b=r=>$(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 Deno.mkdir(r.targetDir,{recursive:!0});let u={project_name:r.projectName,...r.variables},e=await E(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:u}),f=await C(r.targetDir),d=D(o,f);t.out.writeln(P(`\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(`
|
|
2
|
+
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 q=async r=>{let t=N(r??[],{string:["name","registry","var"],boolean:["local"],collect:["var"]}),s=t._[0],a=t.name??s,o=t.registry,u=t.local===!0,e=v({renderer:R.ansi(),sink:k.stdout()}),f={};for(let c of t.var){let[i,...l]=String(c).split("=");i!==void 0&&i!==""&&(f[i]=l.join("="))}if(s===void 0){try{let i=(await y(o,{local:u})).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(h(`
|
|
3
|
+
Creating ${a} from ${s}...
|
|
4
|
+
`));let d=`${Deno.cwd()}/${a}`,n=await A(b({templateName:s,projectName:a,targetDir:d,registrySource:o,local:u,variables:f}),{out:e});return await e.close(),j(n)?g(void 0):p({exitCode:1})};export{q as main};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as g}from"./chunk-XMTGT2NJ.js";import{b as C,c as y,d as O}from"./chunk-BK2BDHKB.js";import{a as E,c as k,d as _,f as I}from"./chunk-LXVBR775.js";import{c as m,d as x,e as w,f as D,i as S,k as v}from"./chunk-BKVQBSFV.js";import{a as d,b as h}from"./chunk-DQAEQEXD.js";import"./chunk-DXB73IDG.js";var q=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],l=t=>q.map(n=>({...n,extras:C(t,n.id)})),u=(t,n)=>{let s=new Set(n.map(o=>o.questionId));for(let o of t)if(!s.has(o.id))return o;return null},B=t=>{let n=new Set(t.map(s=>s.questionId));return q.every(s=>n.has(s.id))};var f=(t,n,s)=>{switch(t.phase){case"IDLE":return N();case"DISCOVERY":return $(t,n,s);case"SPEC_DRAFT":return L(t);case"SPEC_APPROVED":case"BUILDING":return U(t,n,s);case"BLOCKED":return W(t);case"DONE":return G(t);default:return N()}},N=()=>({phase:"IDLE",instruction:'No active spec. Start one with: noskills spec new "description"'}),$=(t,n,s)=>{let o=l(n),e=u(o,t.discovery.answers);if(e===null)return{phase:"DISCOVERY",instruction:"All discovery questions answered. Run: noskills approve",question:{id:"",text:"",concerns:[],extras:[]},context:{rules:s,concernReminders:[]},transition:{onComplete:"noskills approve",remainingQuestions:0}};let r=t.discovery.answers.length,i=o.length;return{phase:"DISCOVERY",instruction:"Ask the user the following question and relay their answer.",question:{id:e.id,text:e.text,concerns:[...e.concerns],extras:e.extras.map(c=>c.text)},context:{rules:s,concernReminders:y(n)},transition:{onComplete:'noskills next --answer="..."',remainingQuestions:i-r-1}}},L=t=>({phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:t.specState.path??"",transition:{onApprove:"noskills approve"}}),U=(t,n,s)=>{let o=O(n),e={phase:"BUILDING",instruction:"Read the spec and implement the next task. Report progress when done.",context:{rules:s,concernReminders:y(n)},transition:{onComplete:'noskills next --answer="..."',onBlocked:'noskills block "reason"',iteration:t.building.iteration}};return o.length>0?{...e,concernTensions:o}:e},W=t=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:t.building.lastProgress??"Unknown",transition:{onResolved:'noskills next --answer="..."'}}),G=t=>({phase:"DONE",summary:{spec:t.spec,iterations:t.building.iteration,decisionsCount:t.decisions.length}});var b=(t,n,s,o)=>{let e=[];e.push(`# Spec: ${t}`),e.push(""),e.push("## Status: draft"),e.push(""),s.length>0&&(e.push(`## Concerns: ${s.map(r=>r.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let r of n)e.push(`### ${r.questionId}`),e.push(""),e.push(r.answer),e.push("");for(let r of s)if(r.specSections.length>0)for(let i of r.specSections)e.push(`## ${i} (${r.id})`),e.push(""),e.push("_To be filled in during implementation._"),e.push("");if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let r=0;r<o.length;r++){let i=o[r];e.push(`| ${r+1} | ${i.question} | ${i.choice} | ${i.promoted?"yes":"no"} |`)}e.push("")}return e.push("## Tasks"),e.push(""),e.push("_To be generated from discovery answers._"),e.push(""),e.push("## Verification"),e.push(""),e.push("_To be defined based on discovery answers._"),e.push(""),e.join(`
|
|
2
|
+
`)};var A=async(t,n,s)=>{if(n.spec===null)throw new Error("No active spec");let o=`${t}/${m.specDir(n.spec)}`,e=`${t}/${m.specFile(n.spec)}`;await Deno.mkdir(o,{recursive:!0});let r=b(n.spec,n.discovery.answers,s,n.decisions);return await Deno.writeTextFile(e,r),e};var X=async t=>{let n=Deno.cwd();if(!await v(n)){let a=JSON.stringify({error:"noskills not initialized. Run: noskills init"});return await p(a),h({exitCode:1})}let s=null;if(t!==void 0)for(let a of t)a.startsWith("--answer=")&&(s=a.slice(9));let o=await x(n),e=await D(n);if(e===null){let a=JSON.stringify({error:"No config found"});return await p(a),h({exitCode:1})}let i=(await S(n)).filter(a=>e.concerns.includes(a.id));if(s!==null){let a=await j(n,o,e,i,s);await w(n,a);let T=await g(n),F=f(a,i,T);return await p(JSON.stringify(F,null,2)),d(void 0)}let c=await g(n),Q=f(o,i,c);return await p(JSON.stringify(Q,null,2)),d(void 0)},j=async(t,n,s,o,e)=>{switch(n.phase){case"DISCOVERY":{let r=l(o),i=u(r,n.discovery.answers);if(i===null)return n;let c=k(n,i.id,e);return B(c.discovery.answers)&&(c=_(c),await A(t,c,o)),c}case"BUILDING":return I(n,e);case"BLOCKED":return E(n,"BUILDING");default:return n}},p=async t=>{let n=new TextEncoder;await Deno.stdout.write(n.encode(t+`
|
|
3
|
+
`))};export{X as main};
|