eser 4.1.49 → 4.1.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{anthropic-QBGNUIP3.js → anthropic-YMZNUQKZ.js} +1 -1
- package/chunks/approve-VBXGXWZI.js +2 -0
- package/chunks/{ask-M3VS3GIJ.js → ask-6DWHUCLO.js} +1 -1
- package/chunks/block-Z4BELXXO.js +2 -0
- package/chunks/{build-Y4OQZN3X.js → build-4WTOXDXD.js} +1 -1
- package/chunks/cancel-HHW2G675.js +2 -0
- package/chunks/{changelog-gen-LMXK5T7J.js → changelog-gen-JTU6WIYA.js} +1 -1
- package/chunks/{chunk-YVKPHSJX.js → chunk-352YGR5O.js} +1 -1
- package/chunks/{chunk-FNPBHLLZ.js → chunk-3KGG2I2A.js} +1 -1
- package/chunks/{chunk-LYM57LLM.js → chunk-4BOZ4A55.js} +1 -1
- package/chunks/chunk-5GGWX7CO.js +4 -0
- package/chunks/{chunk-L7ROACZC.js → chunk-5QUEAV4O.js} +26 -26
- package/chunks/chunk-5YBG2HOI.js +3 -0
- package/chunks/chunk-67AFLWXV.js +4 -0
- package/chunks/chunk-6F4PFXYY.js +2 -0
- package/chunks/{chunk-TDIR6AUJ.js → chunk-6HJUPT5Y.js} +1 -1
- package/chunks/{chunk-RSYERFWM.js → chunk-6M64JLJW.js} +1 -1
- package/chunks/{chunk-U34MRDPH.js → chunk-6WFCBJPF.js} +1 -1
- package/chunks/{chunk-AWMLF355.js → chunk-7L4DDCRL.js} +1 -1
- package/chunks/{chunk-JMGANJGV.js → chunk-7V3IDYYI.js} +1 -1
- package/chunks/{chunk-C6URCXQM.js → chunk-BKWQQUSY.js} +1 -1
- package/chunks/{chunk-KHBIOZJE.js → chunk-BVIGTD2Z.js} +1 -1
- package/chunks/{chunk-Q56M5KDF.js → chunk-BZSILAX3.js} +1 -1
- package/chunks/{chunk-XFCBVUI7.js → chunk-DGI7M6TL.js} +1 -1
- package/chunks/{chunk-WTMV5GTZ.js → chunk-DTDUHDLM.js} +1 -1
- package/chunks/{chunk-DYMKE4R3.js → chunk-DYBJ6UPO.js} +1 -1
- package/chunks/{chunk-3TS5IRPD.js → chunk-EJBYYUXZ.js} +1 -1
- package/chunks/{chunk-3SBAWBWS.js → chunk-F4QK3J3J.js} +1 -1
- package/chunks/{chunk-MTCPFQ5I.js → chunk-FVXGVHUR.js} +1 -1
- package/chunks/{chunk-Q66KA572.js → chunk-GQ4WRANA.js} +1 -1
- package/chunks/{chunk-3MMV2UHT.js → chunk-H6U2EE7V.js} +1 -1
- package/chunks/{chunk-3D5TBTM3.js → chunk-HTC2FO4I.js} +2 -2
- package/chunks/{chunk-4NNSMDFH.js → chunk-IUORSUN6.js} +1 -1
- package/chunks/{chunk-D43XK3L2.js → chunk-JBUJTUEU.js} +1 -1
- package/chunks/chunk-KFVUFHJB.js +6 -0
- package/chunks/{chunk-XVH5L5HY.js → chunk-L6J3BWVP.js} +1 -1
- package/chunks/{chunk-FQY3JLY2.js → chunk-LRAHXO3G.js} +1 -1
- package/chunks/chunk-LS5MCZUM.js +2 -0
- package/chunks/chunk-MX5DKVDI.js +2 -0
- package/chunks/chunk-NE2J6ISX.js +6 -0
- package/chunks/chunk-NQS27P25.js +6 -0
- package/chunks/{chunk-43E7ZXUB.js → chunk-NYHMH3N5.js} +1 -1
- package/chunks/chunk-ODBJ5KMQ.js +3 -0
- package/chunks/chunk-OXP2FOO5.js +2 -0
- package/chunks/{chunk-6BILFSH2.js → chunk-PBZV2KA3.js} +1 -1
- package/chunks/{chunk-JTSRGXS4.js → chunk-PZUDTTK4.js} +1 -1
- package/chunks/{chunk-PPSDIDOI.js → chunk-QHVTWYZJ.js} +1 -1
- package/chunks/{chunk-N4NDBIQS.js → chunk-QXSFQQGJ.js} +1 -1
- package/chunks/{chunk-2DAFGT4S.js → chunk-RLA2Z7XV.js} +1 -1
- package/chunks/{chunk-FFEFO7MA.js → chunk-RLTTHJ3E.js} +1 -1
- package/chunks/{chunk-3PZVRB75.js → chunk-RSHUTH4K.js} +1 -1
- package/chunks/chunk-RUTM4VP7.js +11 -0
- package/chunks/{chunk-3VZXRI4F.js → chunk-SKW7N57D.js} +1 -1
- package/chunks/{chunk-SNWQNMGD.js → chunk-TJ4VL7T5.js} +1 -1
- package/chunks/{chunk-XBCL25QR.js → chunk-UTENCUNI.js} +1 -1
- package/chunks/{chunk-K7TY7247.js → chunk-V3KWM26F.js} +1 -1
- package/chunks/{chunk-U25GY4AZ.js → chunk-VGCEFEFY.js} +1 -1
- package/chunks/{chunk-HVQK35SO.js → chunk-VJSHVZ7R.js} +1 -1
- package/chunks/chunk-VKB3B2FE.js +4 -0
- package/chunks/{chunk-IIFFSCDJ.js → chunk-VXVW4UNH.js} +1 -1
- package/chunks/chunk-YWSOQJ7G.js +5 -0
- package/chunks/chunk-YXETE4S3.js +4 -0
- package/chunks/{chunk-PHOYLFXC.js → chunk-ZZMU6YO4.js} +1 -1
- package/chunks/{claude-code-UJYCO6CN.js → claude-code-RN3Q2VCK.js} +1 -1
- package/chunks/commitmsg-BRWGZ26L.js +15 -0
- package/chunks/concern-YFXJJ7DL.js +2 -0
- package/chunks/delegate-FVHPWQS7.js +2 -0
- package/chunks/{dev-XHMBUBQE.js → dev-UV7J3QTQ.js} +1 -1
- package/chunks/diagrams-IC2ADMKS.js +2 -0
- package/chunks/diagrams-MRJB73CF.js +2 -0
- package/chunks/done-DMKJ27IQ.js +2 -0
- package/chunks/{file-tools-shared-YKDNDDHR.js → file-tools-shared-IIW7WSUM.js} +1 -1
- package/chunks/followup-XKVSZT2H.js +2 -0
- package/chunks/free-IPJPYOJS.js +2 -0
- package/chunks/{gh-AWX6I7FO.js → gh-3GMLD6TO.js} +2 -2
- package/chunks/{gh-contributors-EDZTKR5E.js → gh-contributors-PNU47Y7Q.js} +1 -1
- package/chunks/{init-GBMYF3YG.js → init-BZ6B74SY.js} +1 -1
- package/chunks/init-ONTNPCSY.js +2 -0
- package/chunks/invoke-hook-ZM6UQND6.js +14 -0
- package/chunks/{kiro-V6SMU4OL.js → kiro-JS5UVLRL.js} +1 -1
- package/chunks/learn-SRDLP7B5.js +8 -0
- package/chunks/{list-NX7RRO6R.js → list-COFD6OUQ.js} +1 -1
- package/chunks/{list-ZVCGDRUH.js → list-RI4IF5TD.js} +1 -1
- package/chunks/{main-NCAKIBQC.js → main-PQW6MNZM.js} +1 -1
- package/chunks/manager-BMNUSWJO.js +7 -0
- package/chunks/{mod-VZT7JWPZ.js → mod-64M47KGW.js} +1 -1
- package/chunks/{mod-52TIS344.js → mod-6LLSLOX6.js} +1 -1
- package/chunks/{mod-NSL6IJRQ.js → mod-CTW3YE4Q.js} +1 -1
- package/chunks/{mod-7ICCX4OY.js → mod-D5IDWU35.js} +1 -1
- package/chunks/{mod-5NDTGNVM.js → mod-DESWHMN6.js} +1 -1
- package/chunks/{mod-DFDEWFDA.js → mod-MKKBIIC4.js} +1 -1
- package/chunks/{mod-KPIOBBDD.js → mod-YNYASB66.js} +1 -1
- package/chunks/next-FD3EHJW3.js +8 -0
- package/chunks/{ollama-DFG5G467.js → ollama-PL4UHEF2.js} +1 -1
- package/chunks/{opencode-UA45VV3W.js → opencode-K4G7UMAE.js} +1 -1
- package/chunks/pack-ZQMMSIIP.js +6 -0
- package/chunks/{purge-Q3FI3S5M.js → purge-LXL3F3EJ.js} +1 -1
- package/chunks/{release-4VI2Y2ZT.js → release-5PXID6GL.js} +2 -2
- package/chunks/{release-notes-2ZYPZ6TK.js → release-notes-3OMBQLOK.js} +1 -1
- package/chunks/{release-tag-SG4WPYDZ.js → release-tag-2B2CWVMZ.js} +1 -1
- package/chunks/reopen-3NA6JI4N.js +2 -0
- package/chunks/reset-XITFRWII.js +2 -0
- package/chunks/review-UVYK4M4T.js +2 -0
- package/chunks/rule-BAO7IP5S.js +7 -0
- package/chunks/run-EBKNNOG7.js +4 -0
- package/chunks/{run-DAKF5SJN.js → run-IMXYUDHS.js} +1 -1
- package/chunks/{scripts-VRQQ24O3.js → scripts-XTXYY5MJ.js} +1 -1
- package/chunks/{sdk-L2SQCWYV.js → sdk-EJKXYVDC.js} +8 -8
- package/chunks/{serve-5MTJLRIN.js → serve-T5HR56BZ.js} +1 -1
- package/chunks/session-SZYH2UOE.js +2 -0
- package/chunks/spec-CPRKQGOX.js +2 -0
- package/chunks/status-SRCNQJ4V.js +2 -0
- package/chunks/sync-WE6A7KC7.js +2 -0
- package/chunks/{system-JBGO2IFD.js → system-6TO2XBOH.js} +1 -1
- package/chunks/{system-QDBQLRO6.js → system-RWYI6DJF.js} +1 -1
- package/chunks/{validate-bom-XTZYCKGP.js → validate-bom-YFYXM4ND.js} +1 -1
- package/chunks/{validate-case-conflict-CQIPKKHY.js → validate-case-conflict-E7LKQYVM.js} +1 -1
- package/chunks/{validate-circular-deps-Y6X6GZCG.js → validate-circular-deps-L4MDRIG3.js} +1 -1
- package/chunks/{validate-commit-msg-MXTBUPTC.js → validate-commit-msg-2JQ2W6Y6.js} +1 -1
- package/chunks/{validate-docs-ZOHUOW3I.js → validate-docs-EXDICKDK.js} +1 -1
- package/chunks/{validate-filenames-6E634ZHO.js → validate-eof-UYQI6DYK.js} +1 -1
- package/chunks/{validate-export-names-7V3647EU.js → validate-export-names-QBYWTK5Q.js} +1 -1
- package/chunks/{validate-eof-4I2QAFTC.js → validate-filenames-Z6VSIR2C.js} +1 -1
- package/chunks/{validate-json-LRWPQ4JX.js → validate-json-2JS2Y4YU.js} +1 -1
- package/chunks/validate-large-files-JKQBKNS4.js +2 -0
- package/chunks/validate-licenses-7MVLVDZA.js +2 -0
- package/chunks/validate-line-endings-KMXN5IUT.js +2 -0
- package/chunks/validate-merge-conflict-N7M4OVXI.js +2 -0
- package/chunks/{validate-mod-exports-Y6W74PAB.js → validate-mod-exports-C7WDH4FK.js} +1 -1
- package/chunks/{validate-package-configs-VVCKJELU.js → validate-package-configs-AYVT55GJ.js} +1 -1
- package/chunks/validate-secrets-3PW5GJZD.js +2 -0
- package/chunks/validate-shebangs-JACZB7C3.js +2 -0
- package/chunks/validate-submodules-SCY4LARV.js +2 -0
- package/chunks/validate-symlinks-PDLYFPNE.js +2 -0
- package/chunks/{validate-toml-FNXGITZJ.js → validate-toml-NGF5Q27B.js} +1 -1
- package/chunks/validate-trailing-whitespace-PDAFNVPQ.js +2 -0
- package/chunks/{validate-yaml-YRAD4HU3.js → validate-yaml-ILJZJGDG.js} +1 -1
- package/chunks/{versions-LJSQVW77.js → versions-VGXMC5GM.js} +1 -1
- package/chunks/watch-WBZB2C5P.js +9 -0
- package/chunks/web-GAF33V4M.js +2 -0
- package/chunks/wontfix-JBPCNL6S.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-HF44PKLL.js +0 -2
- package/chunks/block-F7S7PYMQ.js +0 -2
- package/chunks/cancel-Q6LMMZBV.js +0 -2
- package/chunks/chunk-2TANTKYS.js +0 -4
- package/chunks/chunk-4TTJVJEI.js +0 -2
- package/chunks/chunk-C2IORZTF.js +0 -4
- package/chunks/chunk-EQUPVWVY.js +0 -2
- package/chunks/chunk-FXDWRGGR.js +0 -2
- package/chunks/chunk-GVTM4EOU.js +0 -4
- package/chunks/chunk-IZUADMIU.js +0 -3
- package/chunks/chunk-LJ7A5HYR.js +0 -2
- package/chunks/chunk-RBQ2FOSL.js +0 -17
- package/chunks/chunk-RBU3HF66.js +0 -10
- package/chunks/commitmsg-57EMHAFY.js +0 -11
- package/chunks/concern-7ZK3KY54.js +0 -2
- package/chunks/done-FQQYM27R.js +0 -2
- package/chunks/free-XOGOSVEQ.js +0 -2
- package/chunks/init-3HE3P3N3.js +0 -2
- package/chunks/invoke-hook-EIOZ5WSA.js +0 -12
- package/chunks/manager-GC34GK44.js +0 -7
- package/chunks/next-2LOPGEJO.js +0 -9
- package/chunks/pack-B5VXZEW7.js +0 -6
- package/chunks/reopen-6FB7DVV2.js +0 -2
- package/chunks/reset-T4YMGQPV.js +0 -2
- package/chunks/rule-EJKPIOLE.js +0 -7
- package/chunks/run-BV6BHCCQ.js +0 -4
- package/chunks/session-3HOLYHOY.js +0 -2
- package/chunks/spec-3P3HJT27.js +0 -2
- package/chunks/status-6XVLXNA5.js +0 -2
- package/chunks/sync-EEH6563X.js +0 -2
- package/chunks/validate-large-files-RV7O7ZUR.js +0 -2
- package/chunks/validate-licenses-KHDUSBXM.js +0 -2
- package/chunks/validate-line-endings-XOCAE22U.js +0 -2
- package/chunks/validate-merge-conflict-PDJRAIKU.js +0 -2
- package/chunks/validate-secrets-UI5XKJ6B.js +0 -2
- package/chunks/validate-shebangs-GE23Z6NU.js +0 -2
- package/chunks/validate-submodules-R5JKX3Z6.js +0 -2
- package/chunks/validate-symlinks-WBF6VHHT.js +0 -2
- package/chunks/validate-trailing-whitespace-UCMQTQ3B.js +0 -2
- package/chunks/watch-N3KV2ONB.js +0 -9
- package/chunks/wontfix-MJJ2LK6J.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{i as r}from"./chunk-6DBKPC2O.js";var v=".eser/.events",l=`${v}/events.jsonl`;var u=async(a,s)=>{let i=`${a}/${v}`,e=`${a}/${l}`;await r.fs.mkdir(i,{recursive:!0});let n=JSON.stringify(s)+`
|
|
3
|
+
`,t="";try{t=await r.fs.readTextFile(e)}catch{}await r.fs.writeTextFile(e,t+n)},E=async(a,s)=>{let i=`${a}/${l}`,e;try{e=await r.fs.readTextFile(i)}catch{return[]}let n=e.trim().split(`
|
|
4
|
+
`).filter(t=>t.length>0).map(t=>{try{return JSON.parse(t)}catch{return null}}).filter(t=>t!==null);return s?.since!==void 0&&(n=n.filter(t=>t.ts>s.since)),n.reverse(),s?.limit!==void 0&&s.limit>0&&(n=n.slice(0,s.limit)),n},m=(a,s)=>{let i=`${a}/${l}`,e=0,n=!1;(async()=>{try{e=(await r.fs.stat(i)).size}catch{e=0}})();let t=setInterval(async()=>{if(!n)try{let o=await r.fs.stat(i);if(o.size<=e)return;let d=await r.fs.readTextFile(i),f=new TextEncoder().encode(d);if(f.length>e){let y=d.slice(new TextDecoder().decode(f.slice(0,e)).length).trim().split(`
|
|
5
|
+
`).filter(c=>c.length>0);for(let c of y)try{let p=JSON.parse(c);s(p)}catch{}}e=o.size}catch{}},500);return()=>{n=!0,clearInterval(t)}};export{u as a,E as b,m as c};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as d}from"./chunk-J7YTWK67.js";import{b as c,d as u}from"./chunk-VKB3B2FE.js";var y=async(n,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let r=await u`which ${n}`.noThrow().text();if(r.length>0)return r}catch{}throw new d(`Binary "${n}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:n})},f=(n,t,e)=>{let r=e?.stdinData!==void 0,s=new c(n,[...t],{stdin:r?"piped":"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(r&&s.stdin!==null){let i=new TextEncoder,a=s.stdin.getWriter();a.write(i.encode(e.stdinData)).then(()=>{a.close()}).catch(()=>{})}if(e?.signal!==void 0){let i=e.signal;i.aborted?s.kill("SIGTERM"):i.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let i=await s.status;return{code:i.code,success:i.success}},kill:i=>{s.kill(i??"SIGTERM")}}},l=new TextDecoder;async function*m(n){let t=n.getReader(),e="";try{let r=await t.read();for(;r.done!==!0;){e+=l.decode(r.value,{stream:!0});let s=e.split(`
|
|
3
|
+
`);e=s.pop()??"";for(let i of s){let a=i.trim();if(a.length!==0)try{yield JSON.parse(a)}catch{}}r=await t.read()}let o=e.trim();if(o.length>0)try{yield JSON.parse(o)}catch{}}finally{t.releaseLock()}}var w=async(n,t)=>{let e=n.getReader(),r=[],o=await e.read();for(;o.done!==!0;)r.push(l.decode(o.value,{stream:!0})),o=await e.read();return e.releaseLock(),{content:[{kind:"text",text:r.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},h=async n=>{let t=n.getReader(),e=[],r=await t.read();for(;r.done!==!0;)e.push(l.decode(r.value,{stream:!0})),r=await t.read();return t.releaseLock(),e.join("").trim()},x=(n,t,e)=>{if(t===0)return null;let r=e.length>0?`${n} exited with code ${t}: ${e}`:`${n} exited with code ${t}`;return t===1?new d(r,{provider:n}):t===126||t===127?new d(`${n} binary not found or not executable (exit code ${t})`,{provider:n}):new d(r,{provider:n})},b=(n,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let r of n)for(let o of r.content)o.kind==="text"&&e.push(o.text);return e.join(`
|
|
4
|
+
`)};export{y as a,f as b,m as c,w as d,h as e,x as f,b as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as w}from"./chunk-
|
|
2
|
+
import{a as w}from"./chunk-VXVW4UNH.js";import{a as v}from"./chunk-LFNUSULJ.js";import{b as y}from"./chunk-PZUDTTK4.js";import{f as k}from"./chunk-P2MUEKFT.js";import{b as l,f,g as h,h as C,i as m}from"./chunk-YVN2NZL4.js";import{g as a}from"./chunk-FFWPJP7A.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-MX5DKVDI.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as ClaudeCodeModel,b as claudeCodeFactory};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-7ZYDAZBD.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import"./chunk-QXSFQQGJ.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f as u,h as f,k as p}from"./chunk-SHN5MT56.js";import{c as n,d,f as g}from"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as r}from"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var b=`Output ONLY a conventional commit message. Nothing else.
|
|
3
|
+
|
|
4
|
+
STRICT RULES:
|
|
5
|
+
- One line only. Max 72 characters.
|
|
6
|
+
- Format: type(scope): description
|
|
7
|
+
- Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
|
|
8
|
+
- No body. No explanation. No markdown. No code blocks. No bullet points.
|
|
9
|
+
- No quotes. No backticks. No decorative formatting. No insight blocks.
|
|
10
|
+
- No preamble. No commentary. Just the commit message line.
|
|
11
|
+
|
|
12
|
+
Example of correct output (the ENTIRE response is this one line):
|
|
13
|
+
feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=u({renderer:p.ansi(),sink:f.stdout()});try{let t=await r`git diff --cached`.noThrow().text();if(t.length===0&&(t=await r`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),o=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 "${o}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${o}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(g(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-YNYASB66.js")).defaultFactories(),o=new w({factories:s}),a=e;if(a===void 0)try{await r`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await o.addModel("default",{provider:a,model:"default"});let c=o.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:
|
|
14
|
+
|
|
15
|
+
${i}`)],maxTokens:256});return await o.close(),x(k).trim()},$={name:"ai-commitmsg",description:"Generate commit message from git diff using AI",run:async i=>{try{let e=i.provider,t=await r`git diff --cached`.noThrow().text();return t.length===0&&(t=await r`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,$ as workflowTool};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as y}from"./chunk-IUORSUN6.js";import{B as k,l as C,m as P,n as b,o as R}from"./chunk-RUTM4VP7.js";import{b as x,c as A}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-SHN5MT56.js";import{c as d,d as c,f as u,g as v}from"./chunk-YVN2NZL4.js";import{a as l,b as p}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var W=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="remove")return await I(s?.slice(1));if(e==="list")return await j();let t=x(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${t} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},$=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),{root:t}=await k(),n=(s??[]).filter(i=>!i.startsWith("-")),r=await C(t);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(A("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(r===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await y(),o=[];for(let i of n){let f=await b(t,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await R(t,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(r.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...r,concerns:[...r.concerns,...o]};await P(t,i),e.writeln(v("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),{root:t}=await k(),n=s?.[0],r=await C(t);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(A("concern remove move-fast"))),await e.close(),p({exitCode:1});if(r===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!r.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...r,concerns:r.concerns.filter(o=>o!==n)};return await P(t,a),e.writeln(v("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},j=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),{root:e}=await k(),t=await C(e),n=await y(),r=t?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=r.includes(a.id);s.writeln(" ",o?v("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{W as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as k}from"./chunk-YWSOQJ7G.js";import{h as C}from"./chunk-L32KHQVT.js";import{z as E}from"./chunk-OXP2FOO5.js";import{B as v,e as g,g as y,j as S}from"./chunk-RUTM4VP7.js";import"./chunk-2XNFZXHY.js";import{f,h as w,k as h}from"./chunk-SHN5MT56.js";import{f as n,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as a}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var j=async p=>{let e=f({renderer:h.ansi(),sink:w.stdout()}),{root:i}=await v(),s=y(p);if(!s.ok)return e.writeln(n(s.error)),await e.close(),a({exitCode:1});let m=(p??[]).filter(r=>!r.startsWith("--")),o=m[0],l=m.slice(1).join(" ");if(!o||!l)return e.writeln(n("Usage: noskills spec <name> delegate <questionId> <userName>")),await e.close(),a({exitCode:1});let t;try{t=await g(i,s.spec)}catch(r){let R=r instanceof Error?r.message:String(r);return e.writeln(n(R)),await e.close(),a({exitCode:1})}if(t.phase!=="DISCOVERY"&&t.phase!=="DISCOVERY_REVIEW")return e.writeln(n(`Cannot delegate in phase: ${t.phase}. Only during discovery.`)),await e.close(),a({exitCode:1});let c=await C(i),I=E(t,o,l,c.name);return await S(i,s.spec,I),await k(i,{ts:new Date().toISOString(),type:"delegation-created",spec:s.spec,user:c.name,question:o,from:c.name,to:l}),e.writeln(u("\u2714"),` Delegated "${o}" to ${l}`),await e.close(),d(void 0)};export{j as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
2
|
import{f as a,h as l,k as i}from"./chunk-SHN5MT56.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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(`
|
|
3
3
|
\u26A1 Starting development server...
|
|
4
|
-
`));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-
|
|
4
|
+
`));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-PQW6MNZM.js"),import("./mod-OG7BBJP4.js"),import("./mod-CTW3YE4Q.js"),import("./mod-64M47KGW.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,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-NE2J6ISX.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as checkStaleness,b as readRegistry,a as scanProject,d as verifyDiagram,c as writeRegistry};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as k,b as v,c as F,d as R,e as b}from"./chunk-NE2J6ISX.js";import{B as h,d as y}from"./chunk-RUTM4VP7.js";import"./chunk-2XNFZXHY.js";import{f as p,h as w,k as $}from"./chunk-SHN5MT56.js";import{c as u,d as r,f as d,g as f,h as g}from"./chunk-YVN2NZL4.js";import{a,b as c}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var U=async m=>{let e=p({renderer:$.ansi(),sink:w.stdout()}),{root:n}=await h(),l=m?.[0];if(l==="scan"){let i=await k(n);await F(n,i),e.writeln(f("\u2714"),` Found ${i.length} diagram(s):`);for(let s of i)e.writeln(` ${s.file}:${s.line} `,r(`[${s.type}]`),r(` refs: ${s.referencedFiles.length}`));return await e.close(),a(void 0)}if(l==="list"||l===void 0){let i=await v(n);if(i.length===0)return e.writeln(r("No diagrams registered. Run: noskills diagrams scan")),await e.close(),a(void 0);e.writeln(u(`${i.length} diagram(s):`));for(let s of i)e.writeln(` ${s.file}:${s.line} `,r(`[${s.type}]`),` refs: ${s.referencedFiles.join(", ")||"none"}`),e.writeln(r(` verified: ${s.lastVerified.slice(0,10)}`));return await e.close(),a(void 0)}if(l==="check"){let s=(await y(n)).execution.modifiedFiles,o=await b(n,s);if(o.length===0)e.writeln(f("\u2714")," No stale diagrams.");else{e.writeln(g(`\u26A0 ${o.length} potentially stale diagram(s):`));for(let t of o)e.writeln(` ${t.file}:${t.line} `,r(`[${t.type}]`)),e.writeln(r(` ${t.reason}`))}return await e.close(),a(void 0)}if(l==="verify"){let i=m?.[1];if(!i)return e.writeln(d("Usage: noskills diagrams verify <file>")),await e.close(),c({exitCode:1});let s;for(let t of m??[])t.startsWith("--line=")&&(s=parseInt(t.slice(7),10));return await R(n,i,s)?e.writeln(f("\u2714"),` Verified: ${i}`):e.writeln(d(`Diagram not found in registry: ${i}`)),await e.close(),a(void 0)}return e.writeln(d("Unknown subcommand. Use: scan, list, check, verify")),await e.close(),c({exitCode:1})};export{U as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as P}from"./chunk-YWSOQJ7G.js";import{a as x,d as O}from"./chunk-NYHMH3N5.js";import{h as I}from"./chunk-L32KHQVT.js";import{C as D,p as U,s as $}from"./chunk-OXP2FOO5.js";import{B as k,c as S,e as g,g as C,h as y,j as T}from"./chunk-RUTM4VP7.js";import{c as v}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f,h,k as E}from"./chunk-SHN5MT56.js";import{c as l,d as o,f as a,g as w}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as u}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=async b=>{let e=f({renderer:E.ansi(),sink:h.stdout()}),{root:r}=await k(),p=C(b);if(!p.ok)return e.writeln(a(p.error)),await e.close(),n({exitCode:1});let t;try{t=await g(r,p.spec)}catch(i){let c=i instanceof Error?i.message:String(i);return e.writeln(a(c)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let i=`${r}/${S.specDir(t.spec)}`;try{await u.fs.stat(i)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to idle.")),await e.close(),n({exitCode:1})}}let m=await I(r),s=U(t,"done");s=$(s,"EXECUTING","COMPLETED",m),s.spec!==null&&await T(r,s.spec,s);let G=D(s);if(await y(r,G),s.spec!==null&&(await x(r,s.spec,"completed"),await O(r,s.spec,"completed")),await P(r,{ts:new Date().toISOString(),type:"phase-change",spec:t.spec??"unknown",user:m.name,from:"EXECUTING",to:"COMPLETED"}),e.writeln(w("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",l(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let i=t.decisions.filter(c=>c.promoted);i.length>0&&e.writeln(o(` Promoted to rules: ${i.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",l(`${v('spec new "..."')}`)),await e.close(),d(void 0)};export{B as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-BVIGTD2Z.js";import"./chunk-NBA6EFWU.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.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,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as v}from"./chunk-L32KHQVT.js";import{v as y,w as I,x as R,y as E}from"./chunk-OXP2FOO5.js";import{B as q,e as F,g as U,j as c}from"./chunk-RUTM4VP7.js";import"./chunk-2XNFZXHY.js";import{f as k,h as x,k as C}from"./chunk-SHN5MT56.js";import{d,f as o,g as p}from"./chunk-YVN2NZL4.js";import{a as l,b as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Y=async w=>{let e=k({renderer:C.ansi(),sink:x.stdout()}),{root:a}=await q(),n=U(w);if(!n.ok)return e.writeln(o(n.error)),await e.close(),i({exitCode:1});let f=(w??[]).filter(s=>!s.startsWith("--")),t=f[0],m=f.slice(1).join(" "),u=null,h=!1;for(let s of w??[])s.startsWith("--answer=")&&(u=s.slice(9)),s==="--skip"&&(h=!0);if(!t)return e.writeln(o('Usage: noskills spec <name> followup <questionId> "question text"')),e.writeln(d(' Or: noskills spec <name> followup <followUpId> --answer="text"')),e.writeln(d(" Or: noskills spec <name> followup <followUpId> --skip")),await e.close(),i({exitCode:1});let r;try{r=await F(a,n.spec)}catch(s){let A=s instanceof Error?s.message:String(s);return e.writeln(o(A)),await e.close(),i({exitCode:1})}if(u!==null){let s=I(r,t,u);return await c(a,n.spec,s),e.writeln(p("\u2714"),` Answered follow-up: ${t}`),await e.close(),l(void 0)}if(h){let s=R(r,t);return await c(a,n.spec,s),e.writeln(p("\u2714"),` Skipped follow-up: ${t}`),await e.close(),l(void 0)}if(m.length===0)return e.writeln(o("Follow-up question text is required.")),await e.close(),i({exitCode:1});if(r.phase!=="DISCOVERY"&&r.phase!=="DISCOVERY_REVIEW")return e.writeln(o(`Cannot add follow-ups in phase: ${r.phase}`)),await e.close(),i({exitCode:1});let O=await v(a),g=y(r,t,m,O.name);await c(a,n.spec,g);let S=E(g,t),$=S[S.length-1];return e.writeln(p("\u2714"),` Follow-up added: ${$?.id??t}`),await e.close(),l(void 0)};export{Y as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as a}from"./chunk-UEMWZOIU.js";import{f as o,h as n,k as i}from"./chunk-SHN5MT56.js";import{c as e,d as t}from"./chunk-YVN2NZL4.js";import{a as r}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var c=async m=>{let s=o({renderer:i.ansi(),sink:n.stdout()});return s.writeln(t("noskills starts in idle mode with no enforcement. To work on a spec, run:")),s.writeln(e(` ${a('spec new "description"')}`)),await s.close(),r(void 0)};export{c as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a}from"./chunk-
|
|
2
|
+
import{a}from"./chunk-PZUDTTK4.js";import{o as t}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:l,output:h}=a(),n=()=>{t.info(l,`eser codebase gh \u2014 GitHub operations
|
|
3
3
|
`),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(`
|
|
4
|
-
Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-
|
|
4
|
+
Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-PNU47Y7Q.js")).main(s);case"release-notes":return await(await import("./release-notes-3OMBQLOK.js")).main(s);case"release-tag":return await(await import("./release-tag-2B2CWVMZ.js")).main(s);default:return t.error(l,`Unknown gh subcommand: ${e}`),n(),o.fail({exitCode:1})}};export{b as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-SOSF762G.js";import{a as R}from"./chunk-LFNUSULJ.js";import{a as w,c as x}from"./chunk-
|
|
2
|
+
import"./chunk-SOSF762G.js";import{a as R}from"./chunk-LFNUSULJ.js";import{a as w,c as x}from"./chunk-PZUDTTK4.js";import{o as c}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as l}from"./chunk-VKB3B2FE.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import{a as b}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{n as f}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:d,output:K}=w(),m="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",E=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}},P=async(t,e)=>{let o=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(o).filter(n=>!n.login.includes("[bot]"))},v=(t,e=8)=>{if(t.length===0)return`${m}
|
|
3
3
|
${u}`;let o=[];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>`);o.push(` <tr>
|
|
4
4
|
${i.join(`
|
|
5
5
|
`)}
|
|
@@ -6,7 +6,7 @@ Available templates: ${S.join(", ")}`,exitCode:1});e.writeln(v(`
|
|
|
6
6
|
`)),e.writeln(s(` Template: ${l}`));let c="eser",p=`laroux-template-${l}`,k="main",d=`${b.process.cwd()}/${r}`;try{await b.fs.mkdir(d,{recursive:!0})}catch{return await e.close(),i({message:n.render([o(`
|
|
7
7
|
Could not create directory: ${d}`)]),exitCode:1})}e.writeln(s(` Fetching from gh:${c}/${p}...
|
|
8
8
|
`));try{let a=await import("./registry-fetcher-TGWYJ5GN.js"),u=await import("./recipe-applier-I2VBGHZU.js"),f=await $(()=>a.fetchRecipeFromRepo(c,p,k,"recipe.json"),()=>{});if(f._tag==="Ok"&&f.value!==void 0){let g=`https://raw.githubusercontent.com/${c}/${p}/${k}`,w=await u.applyRecipe(f.value,{cwd:d,registryUrl:g,force:j,variables:{project_name:r}});e.writeln(x(`
|
|
9
|
-
\u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-
|
|
9
|
+
\u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-DESWHMN6.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:j,skipPostInstall:L,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
|
|
10
10
|
Scaffolding failed: ${y.error.message}`)]),exitCode:1});let C=y.value;if(e.writeln(x(`
|
|
11
11
|
\u{1F389} Project created successfully!`)),Object.keys(C.variables).length>0){e.writeln(t(`
|
|
12
12
|
Variables applied:`));for(let[h,_]of Object.entries(C.variables))e.writeln(t(" "),s(h),t(`: ${_}`))}}}catch(a){let u=a instanceof Error?a.message:String(a);return await e.close(),i({message:n.render([o(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ae,b as re}from"./chunk-NTY267SI.js";import{d as oe}from"./chunk-L5OC7F24.js";import{a as ee}from"./chunk-NQS27P25.js";import"./chunk-6F4PFXYY.js";import{b as k}from"./chunk-IUORSUN6.js";import{b as te,e as se,f as ne}from"./chunk-5QUEAV4O.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{d as ie}from"./chunk-2ZYCRMUT.js";import{A as Q,a as H,b as _,d as q,h as B,l as S,m as K,o as U,q as V}from"./chunk-RUTM4VP7.js";import{a as X,c as Y,d as Z}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as I,b as R,i as P,j as W,k as J,l as z,m as G,n as g,o as w,p as m}from"./chunk-5GGWX7CO.js";import"./chunk-GE3LJ6QM.js";import{a as N}from"./chunk-QXSFQQGJ.js";import"./chunk-BNQAZLIQ.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as F}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var ce=N;var ye=async t=>{try{return await p.fs.stat(t),!0}catch{return!1}},Ce=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],le=async t=>{let e=[];for(let i of Ce)for(let n of i.paths)if(await ye(`${t}/${n}`)){e.push(i.id);break}return e};var r=async t=>{try{return await p.fs.stat(t),!0}catch{return!1}},de=async(t,e)=>{try{let i=await p.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},xe=async t=>{let e=[];return(await r(`${t}/package.json`)||await r(`${t}/deno.json`))&&e.push("typescript"),await r(`${t}/go.mod`)&&e.push("go"),await r(`${t}/Cargo.toml`)&&e.push("rust"),(await r(`${t}/pyproject.toml`)||await r(`${t}/setup.py`))&&e.push("python"),e},Te=async t=>{let e=[],i=await de(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},be=async t=>{let e=[];return await r(`${t}/.github/workflows`)&&e.push("github-actions"),await r(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await r(`${t}/Jenkinsfile`)&&e.push("jenkins"),await r(`${t}/.circleci`)&&e.push("circleci"),e},$e=async t=>{if(await r(`${t}/deno.json`))return"deno";let e=await de(`${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},ue=async t=>{let[e,i,n,d]=await Promise.all([xe(t),Te(t),be(t),$e(t)]);return{languages:e,frameworks:i,ci:n,testRunner:d}};var qe=async t=>{let e=p.process.cwd(),i=ae(t),n=R({target:i==="agent"?"non-interactive":"interactive"}),d=re(t),h=pe(d,"--concerns"),f=pe(d,"--tools"),u=d.includes("--non-interactive")||i==="agent",x=await Q(e);W(n,"noskills init");let D=m(n,"Checking directories...");D.start(),await V(e),D.succeed("Config: .eser/");let j=m(n,"Scanning project...");j.start();let T=await ue(e);j.succeed("Project scanned");for(let s of T.languages)w.step(n,` ${s}`);for(let s of T.frameworks)w.step(n,` ${s}`);g(n);let A=m(n,"Detecting coding tools...");A.start();let L=await le(e),y=oe(),O=y!==null&&!L.includes(y)?[y]:[],C=[...new Set([...O,...L])];A.succeed(`${C.length} coding tool(s) detected`);let l;if(f!==null){let s=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],o=f.filter(a=>s.includes(a));l=[...new Set([...O,...o])]}else if(x){let s=await S(e);l=s!==null?[...s.tools]:[...C]}else u?l=[...C]:(g(n),l=await Se(n,C,y));g(n);let E=m(n,"Detecting AI providers...");E.start();let b=(await ce()).filter(s=>s.available).map(s=>s.name);E.succeed(`${b.length} provider(s) detected`),g(n);let $=await k(),c;if(h!==null){let s=$.map(o=>o.id);c=h.filter(o=>s.includes(o)).sort((o,a)=>s.indexOf(o)-s.indexOf(a))}else if(x){let s=await S(e);c=s!==null?[...s.concerns]:[]}else if(u)c=[];else{let s=$.map(a=>({value:a.id,label:a.name,hint:a.description.slice(0,60)})),o=await P(n,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});c=I(o)?[]:[...o]}c.length>0&&w.success(n,` Concerns: ${c.join(", ")}`),g(n);let fe=$.filter(s=>c.includes(s.id));for(let s of fe)await U(e,s);let M=await Z();X(M);let v={..._(c,l,b,T),command:M};if(await K(e,v),!x){let s=H();await B(e,s)}if(l.length>0){let s=m(n,"Syncing tool files...");s.start();let o=await ne(e,l,v);s.succeed(`Synced ${o.length} tool(s)`);for(let a of o)w.step(n,` ${a}`)}if(J(n,`Done. ${l.length} tool(s), ${b.length} provider(s), ${c.length} concern(s).`),i==="agent"){let s=await q(e),a=(await k()).filter(we=>c.includes(we.id)),ge=await te(e),me=se(v?.tools??[]),he=await ee(s,a,ge,v,void 0,void 0,void 0,me);await ie(he,"json")}else z(n),G(n,`Start a spec with: ${Y('spec new "..."')}`);return F(void 0)},Pe=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],Se=async(t,e,i)=>{let n=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),h=await P(t,{message:n,options:Pe.map(u=>({...u,hint:u.value===i?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===i})),initialValues:[...e],required:!1});if(I(h))return[...e];let f=[...h];return i!==null&&!f.includes(i)&&f.unshift(i),f},pe=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(n=>n.trim()).filter(Boolean);return null};export{qe as main};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as J}from"./chunk-5YBG2HOI.js";import{a as A}from"./chunk-NQS27P25.js";import"./chunk-6F4PFXYY.js";import{f as F}from"./chunk-IUORSUN6.js";import{a as G,b as W,d as U,e as B}from"./chunk-5QUEAV4O.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{A as L,c as w,d as C,e as P,l as y,p as D,t as _,u as $}from"./chunk-RUTM4VP7.js";import{c as m}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as l}from"./chunk-FFWPJP7A.js";import{i}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var j=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),X=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),H=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),z=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),q=t=>{let s=0;for(;s<t.length;){let e=t[s];if(H.has(e)){s+=2;continue}if(z.has(e)){s+=1;continue}if(e.startsWith("--git-dir=")||e.startsWith("--work-tree=")||e.startsWith("--namespace=")||e.startsWith("--super-prefix=")||e.startsWith("--config-env=")){s+=1;continue}if(e.startsWith("-C")&&e.length>2){s+=1;continue}if(e.startsWith("-c")&&e.length>2&&e.includes("=")){s+=1;continue}return e}return null},E=t=>{let s=t.trim();if(!s.startsWith("git"))return!0;let e=s.slice(3).trim();if(e.length===0)return!0;let n=e.split(/\s+/),a=q(n)??"";if(j.has(a))return!0;let o=X.get(a);if(o!==void 0){let r=n.indexOf(a),g=r>=0&&r+1<n.length?n[r+1]:"";if(o.has(g))return!0}return!1};var K=t=>{let s=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let a of s){let o;for(;(o=a.exec(t))!==null;){let r=o[1]??"";if(r.includes("git")&&!E(r))return!0}}let e=t.split(/\s*\|\s*/);for(let a of e){let o=a.trim();if(o.startsWith("git")&&!E(o))return!0}let n=t.matchAll(/(?:^|[\s($`(])git\b/g);for(let a of n){let r=a[0].indexOf("git"),g=(a.index??0)+r,f=(t.slice(g).split(/[;&|$)`'"]/)[0]??"").trim();if(f.startsWith("git")&&!E(f))return!0}return!1};var v=async()=>{let t=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:r}=await t.read();if(o||r===void 0)break;s.push(r)}}finally{t.releaseLock()}let e=0,n=new Uint8Array(s.reduce((o,r)=>o+r.length,0));for(let o of s)n.set(o,e),e+=o.length;let a=new TextDecoder().decode(n);try{return JSON.parse(a)}catch{return{}}},N=async t=>{let s=new TextEncoder,e=i.process.stdout.getWriter();await e.write(s.encode(JSON.stringify(t))),e.releaseLock()},ge=async t=>{switch(t?.[0]){case"pre-tool-use":return await ee();case"stop":return await te();case"post-file-write":return await se();case"post-bash":return await ne();case"session-start":return await ie();default:return l(void 0)}},b=async t=>{await N({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${t}`}})},Z=async t=>{await N({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow",additionalContext:t}})},M=(t,s)=>{if(s||!t.includes("git"))return null;let e=t.split(/\s*(?:&&|;)\s*/);for(let n of e){let a=n.trim();if(a.startsWith("git")&&!E(a))return"Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."}return K(t)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},ee=async()=>{let t=await v(),s=t.tool_name??"unknown",e=t.tool_input??{},n=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),a=await y(n),o=i.env.get("NOSKILLS_SESSION")??null;if(o!==null){let c=await _(n,o);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(e.command??"").trim(),d=a?.allowGit??!1;if(!d&&u.includes("git")){let h=M(u,d);if(h!==null)return await b(h),l(void 0)}}return l(void 0)}}let r={};if(o!==null){let c=await _(n,o);if(c!==null&&c.mode==="spec"&&c.phase!==null)r={phase:c.phase};else if(c!==null&&c.spec!==null)try{r=await P(n,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await $(n);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let x of c){let k=x.phase??"IDLE",T=u[k]??0;T>h&&(h=T,d=k)}r={phase:d};let R=new TextEncoder,I=i.process.stderr.getWriter();await I.write(R.encode(`noskills: WARNING \u2014 ${c.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
|
|
3
|
+
`)),I.releaseLock()}else try{r=await C(n)}catch{return l(void 0)}}if(s==="Bash"){let c=(e.command??"").trim(),u=a?.allowGit??!1,d=M(c,u);return d!==null?(await b(d),l(void 0)):l(void 0)}let g=["Write","Edit","MultiEdit"];if(!g.includes(s))return l(void 0);let p=e.file_path??e.path??"";if(p.includes(".eser/")||p.includes(".claude/"))return l(void 0);let f=r.phase??"UNKNOWN";if(f==="EXECUTING"||f==="IDLE"||f==="COMPLETED"||f==="UNKNOWN"){if(f==="EXECUTING"&&g.includes(s)){let c=`${n}/${w.stateDir}/executor-warned.flag`;try{await i.fs.readTextFile(c)}catch{try{await i.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0}),await i.fs.writeTextFile(c,new Date().toISOString());let u=new TextEncoder,d=i.process.stderr.getWriter();await d.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
|
|
4
|
+
`)),d.releaseLock()}catch{}}}if(f==="EXECUTING"&&p.length>0)try{let c=[],u=await G(n),d=U(u,"EXECUTING",p);c.push(...d);let h=await J(n,[p]);for(let S of h)c.push(`(${S.folder}/) ${S.rule}`);let I=r.classification??null,x=await D(n),k=await y(n),T=x.filter(S=>k!==null&&k.concerns.includes(S.id)),V=F(T,p,I);if(c.push(...V),c.length>0){let S=`[noskills] Rules for this file:
|
|
5
|
+
`+c.map(Y=>`- ${Y}`).join(`
|
|
6
|
+
`);return await Z(S),l(void 0)}}catch{}return l(void 0)}let O={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await b(O[f]??`Run \`${m("next")}\` first.`),l(void 0)},te=async()=>{let t=await v();if(t.stop_hook_active===!0)return l(void 0);let s=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),e;try{let u=await i.fs.readTextFile(`${s}/${w.stateFile}`);e=JSON.parse(u)}catch{return l(void 0)}if(e.phase!=="EXECUTING")return l(void 0);let n=e.execution??{},a=`${s}/${w.stateDir}/files-changed.jsonl`,o=[];try{let d=(await i.fs.readTextFile(a)).trim().split(`
|
|
7
|
+
`).filter(Boolean);o=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let r=[],g="no changes";try{let{execSync:u}=await import("node:child_process");r=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
8
|
+
`).filter(Boolean);let R=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
9
|
+
`);g=R[R.length-1]??"no changes"}catch{}let p=[...new Set([...o,...r])],f=(n.iteration??0)+1,O=`${s}/${w.stateDir}/iterations`;try{await i.fs.mkdir(O,{recursive:!0}),await i.fs.writeTextFile(`${O}/iteration-${f}.json`,JSON.stringify({iteration:f,files:p,gitStat:g.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
10
|
+
`)}catch{}let c=15;try{let u=await y(s);u!==null&&(c=u.maxIterationsBeforeRestart)}catch{}e.execution={...n,iteration:f,modifiedFiles:p,lastProgress:g.trim()||n.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await i.fs.writeTextFile(`${s}/${w.stateFile}`,JSON.stringify(e,null,2)+`
|
|
11
|
+
`)}catch{}try{await i.fs.writeTextFile(a,"")}catch{}try{await i.fs.remove(`${s}/${w.stateDir}/executor-warned.flag`)}catch{}if(f>=c){let u=new TextEncoder,d=i.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${c}). Consider starting a fresh conversation.
|
|
12
|
+
`)),d.releaseLock()}return l(void 0)},se=async()=>{let t=await v(),s=t.tool_input??{},e=s.file_path??s.path??"";if(!e||e.includes(".eser/")||e.includes(".claude/"))return l(void 0);let n=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),a=`${n}/${w.stateDir}/files-changed.jsonl`,o=JSON.stringify({file:e,tool:t.tool_name,ts:new Date().toISOString()});try{await i.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0});let r="";try{r=await i.fs.readTextFile(a)}catch{}await i.fs.writeTextFile(a,r+o+`
|
|
13
|
+
`)}catch{}return l(void 0)},ne=async()=>{let t=await v(),e=(t.tool_input??{}).command??"";if(!e.includes("noskills"))return l(void 0);let n=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),a=`${n}/${w.stateDir}/noskills-calls.jsonl`,o=JSON.stringify({command:e,ts:new Date().toISOString()});try{await i.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0});let r="";try{r=await i.fs.readTextFile(a)}catch{}await i.fs.writeTextFile(a,r+o+`
|
|
14
|
+
`)}catch{}return l(void 0)},ie=async()=>{let t=i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd();if(!await L(t))return l(void 0);let s=await C(t),e=await y(t),a=(await D(t)).filter(p=>e!==null&&e.concerns.includes(p.id)),o=await W(t),r=B(e?.tools??[]),g=await A(s,a,o,e,void 0,void 0,void 0,r);return await N(g),l(void 0)};export{ge as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-67AFLWXV.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as KiroModel,b as kiroFactory};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as R}from"./chunk-5QUEAV4O.js";import{a as D,b as x,c as C}from"./chunk-KFVUFHJB.js";import{B as S,c as k,f as E,l as L}from"./chunk-RUTM4VP7.js";import"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as b,h as I,k as T}from"./chunk-SHN5MT56.js";import{c as P,d as a,f as o,g}from"./chunk-YVN2NZL4.js";import{a as u,b as w}from"./chunk-FFWPJP7A.js";import{i as $}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var U=async(i,e,t)=>{let d=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),h=`---
|
|
3
|
+
phases: [EXECUTING]
|
|
4
|
+
source: learned from spec "${t}" on ${new Date().toISOString().slice(0,10)}
|
|
5
|
+
---
|
|
6
|
+
${e}
|
|
7
|
+
`,f=`${i}/${k.rulesDir}/${d}.md`;return await $.fs.mkdir(`${i}/${k.rulesDir}`,{recursive:!0}),await $.fs.writeTextFile(f,h),f},j=i=>{let e=i.toLowerCase();return e.includes("always ")||e.includes("never ")||e.includes("every time")||e.includes("must ")||e.includes("do not ")||e.startsWith("use ")||e.includes("convention:")||e.includes("rule:")},B=async i=>{let e=b({renderer:T.ansi(),sink:I.stdout()}),{root:t}=await S(),d=i?.[0];if(d==="list"||d===void 0){let n=await x(t);if(n.length===0)return e.writeln(a("No learnings recorded yet.")),await e.close(),u(void 0);e.writeln(P(`${n.length} learning(s):`)),e.writeln("");for(let s=0;s<n.length;s++){let r=n[s],v=r.type==="mistake"?o("\u26A0"):g("\u2713"),m=a(`[${r.type}]`),W=r.severity==="high"?o("HIGH"):a(r.severity);e.writeln(` ${s+1}. ${v} ${m} ${r.text}`),e.writeln(a(` spec: ${r.spec} | severity: `),W,a(` | ${r.ts.slice(0,10)}`))}return await e.close(),u(void 0)}if(d==="remove"){let n=parseInt(i?.[1]??"",10)-1;return isNaN(n)||n<0?(e.writeln(o("Usage: noskills learn remove <number>")),await e.close(),w({exitCode:1})):(await C(t,n)?e.writeln(g("\u2714"),` Removed learning #${n+1}`):e.writeln(o(`Learning #${n+1} not found`)),await e.close(),u(void 0))}if(d==="promote"){let n=parseInt(i?.[1]??"",10)-1;if(isNaN(n)||n<0)return e.writeln(o("Usage: noskills learn promote <number>")),await e.close(),w({exitCode:1});let s=await x(t);if(n>=s.length)return e.writeln(o(`Learning #${n+1} not found`)),await e.close(),w({exitCode:1});let r=s[n],v=await U(t,r.text,r.spec);await C(t,n);let m=await L(t);return m!==null&&m.tools.length>0&&await R(t,m.tools,m),e.writeln(g("\u2714"),` Promoted to rule: ${v}`),e.writeln(a(" Removed from learnings.")),await e.close(),u(void 0)}let h=E(i),f=(i??[]).includes("--rule"),c=(i??[]).filter(n=>!n.startsWith("--")).join(" ");if(c.length===0)return e.writeln(o('Usage: noskills spec <name> learn "learning text"')),e.writeln(a(" Add --rule to create a permanent project rule instead.")),await e.close(),w({exitCode:1});let A=h??"unknown";if(f){let n=await U(t,c,A),s=await L(t);return s!==null&&s.tools.length>0&&await R(t,s.tools,s),e.writeln(g("\u2714"),` Rule created: ${n}`),await e.close(),u(void 0)}let p="convention",y="medium";for(let n of i??[]){if(n.startsWith("--type=")){let s=n.slice(7);["mistake","convention","success","dependency"].includes(s)&&(p=s)}if(n.startsWith("--severity=")){let s=n.slice(11);["high","medium","low"].includes(s)&&(y=s)}}let l=c.toLowerCase();l.includes("mistake")||l.includes("wrong")||l.includes("assumed")?(p="mistake",y="high"):l.includes("convention")||l.includes("pattern")||l.includes("always use")?p="convention":(l.includes("worked well")||l.includes("success"))&&(p="success"),await D(t,{ts:new Date().toISOString(),spec:A,type:p,text:c,severity:y});let N=j(c)?a(`
|
|
8
|
+
Tip: This sounds like a permanent rule. Add --rule to enforce it in every spec.`):"";return e.writeln(g("\u2714"),` Learning recorded: [${p}] ${c.slice(0,60)}${c.length>60?"...":""}`),N&&e.writeln(N),await e.close(),u(void 0)};export{B as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as p}from"./chunk-
|
|
2
|
+
import{a as p}from"./chunk-QXSFQQGJ.js";import{f as o,h as m,k as d}from"./chunk-SHN5MT56.js";import{c as t,d as a,g as l,m as n}from"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h,b as u,c as k}from"./chunk-
|
|
2
|
+
import{a as h,b as u,c as k}from"./chunk-DTDUHDLM.js";import"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import{f as m,h as c,k as w}from"./chunk-SHN5MT56.js";import{b as t,c as a,d as e}from"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as g}from"./chunk-MG65QJY6.js";import{a as i}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var R=async(y,p)=>{let d=g(y??[],{string:["config"],boolean:["help"],alias:{h:"help"}});if(d.help)return console.log(`eser workflows list \u2014 List available workflows and tools
|
|
3
3
|
`),console.log("Options:"),console.log(" --config <path> Config directory (default: .)"),console.log(" -h, --help Show this help"),i(void 0);let o=m({renderer:w.ansi(),sink:c.stdout()}),A=d.config??".",r=await u(A),n=h();if(n.register(k),p?.tools!==void 0&&n.registerAll(p.tools),r!==null&&r.workflows.length>0){o.writeln(a("Workflows:"));for(let s of r.workflows){let x=s.on.length>0?s.on.join(", "):"(no events)",f=s.steps.length,C=f===1?"step":"steps";o.writeln(t(` ${s.id.padEnd(20)} `),e(x.padEnd(25)),t(` ${f} ${C}`))}}else o.writeln(e("No workflows defined."));o.writeln();let l=n.getAll();if(l.length>0){o.writeln(a(`Registered tools (${l.length}):`));for(let s of l)o.writeln(t(` ${s.name.padEnd(28)} `),e(s.description))}else o.writeln(e("No tools registered."));return await o.close(),i(void 0)};export{R as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-
|
|
2
|
+
import{a as K,b as j,c as M,d as F,f as N}from"./chunk-TJ4VL7T5.js";import{a as Q}from"./chunk-LLA75EMV.js";import"./chunk-LWQPFCWC.js";import"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as X}from"./chunk-YTF3BAQS.js";import{b as Y}from"./chunk-NBA6EFWU.js";import{d as G,e as m,g as V}from"./chunk-5DWJ7WEE.js";import{a as v}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i as s}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{m as W}from"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=m.getLogger(["laroux-bundler","prebuilt-bundler"]),w=class{config;cachedManifest=null;constructor(e){this.config=e}async getBundle(){B.debug("\u{1F4E6} Loading prebuilt bundle from disk...");let e=s.path.resolve(this.config.distDir,"client","manifest.json"),t=await s.fs.readTextFile(e),r=JSON.parse(t),o=s.path.resolve(this.config.distDir,"client","module-map.json"),i={};try{let p=await s.fs.readTextFile(o);i=JSON.parse(p),B.debug(`\u2705 Loaded module map with ${Object.keys(i).length} entries`)}catch{B.warn("\u26A0\uFE0F Module map not found, SSR may fail for client components")}this.cachedManifest=r;let l=r.entrypoint?`/${r.entrypoint}`:"/client.js";return B.debug(`\u2705 Loaded manifest with entrypoint: ${l}`),{clientCode:null,moduleMap:i,chunkManifest:r,entrypoint:l}}async reload(){this.cachedManifest=null,await this.getBundle()}};var A=m.getLogger(["laroux-bundler","runtime-bundler"]),_=class{clientComponents=new Map;moduleMap=null;bundleCode=null;chunkManifest=null;lastScan=0;scanInterval=1e3;config;async getOrCreateBundle(){let e=Date.now();return(e-this.lastScan>this.scanInterval||!this.bundleCode)&&(await this.rebuild(),this.lastScan=e),{clientCode:this.bundleCode,moduleMap:this.moduleMap,clientComponents:this.clientComponents,chunkManifest:this.chunkManifest}}constructor(e){this.config=e}async rebuild(){let{plugin:e}=this.config,t=e.analyzeClientComponents?await e.analyzeClientComponents(this.config.srcDir,this.config.projectRoot):[];this.clientComponents.clear();for(let o of t)this.clientComponents.set(o.filePath,o);this.moduleMap=e.createModuleMap?await e.createModuleMap(t):{};let r=await this.bundleClientCode(t);this.bundleCode=r.code,this.chunkManifest=r.manifest}async bundleClientCode(e){let{plugin:t}=this.config,r=s.process.cwd(),o=await s.fs.makeTempDir({prefix:"rsc-runtime-",dir:r});try{if(!t.createClientEntry)throw new Error("Framework plugin does not provide createClientEntry");let i=await t.createClientEntry(e,r,o),l=K("deno-bundler",{entryName:"client"}),p={client:i};for(let g of e)p[g.relativePath]=g.filePath;let u={entrypoints:p,outputDir:o,format:"esm",platform:"browser",codeSplitting:j.codeSplitting,minify:j.minify,sourcemap:!1},a=await l.bundle(u);if(!a.success){let g=a.errors?.map(c=>c.message).join(", ")??"Unknown error";throw new Error(`Bundle failed: ${g}`)}let d=a.outputs.get("client.js");if(!d)throw new Error("Bundle output 'client.js' not found in bundle result");let f=new TextDecoder().decode(d.code),h={version:"1.0",buildId:"runtime",timestamp:Date.now(),logLevel:"debug",entrypoint:"__runtime_bundle.js",hmrEnabled:!0,chunks:{},files:{}};for(let g of e){let c=g.relativePath;h.chunks[c]={main:"__runtime_bundle",deps:[],size:0}}return{code:f,manifest:h}}catch(i){let l=i instanceof Error?i.message:String(i),p=i instanceof Error?i.stack:null;A.error("\u274C Runtime bundling failed:"),A.error(` Error: ${l}`),p!==null&&A.error(` Stack trace:
|
|
3
3
|
${p}`);let u=f=>f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\n/g,"\\n").replace(/\r/g,"\\r"),a=`
|
|
4
4
|
console.error("Runtime bundling failed:", ${JSON.stringify(l)});
|
|
5
5
|
document.getElementById("root").innerHTML = '<div class="error"><h2>Bundle Error</h2><pre>${u(l)}</pre></div>';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-NE2J6ISX.js";import"./chunk-KFVUFHJB.js";import{a as Le}from"./chunk-ODBJ5KMQ.js";import{b as ae,c as oe}from"./chunk-YWSOQJ7G.js";import"./chunk-NYHMH3N5.js";import{h as ie}from"./chunk-L32KHQVT.js";import"./chunk-OXP2FOO5.js";import{A as Pe,B as Ce,c as Te,d as xe,e as te,i as ve,k as Ie,l as Me,s as se,v as Re,x as De,z as ne}from"./chunk-RUTM4VP7.js";import{b as re}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as J,d as we,e as Se,r as O,s as a,t as V,u as j,v as Z,w as ee,x as z,y as Ee}from"./chunk-5GGWX7CO.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as he,e as H,f as be}from"./chunk-VKB3B2FE.js";import{a as Q,b as ye}from"./chunk-FFWPJP7A.js";import{i as N}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Ye=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],Ge=e=>{let n={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE",BLOCKED:"EXECUTING"}[e]??e;return Ye.map(r=>r===n?`[ ${r} ]`:r).join(" \u2192 ")},Ae=async(e,s)=>{let n;try{n=await ve(e,s)}catch{n=await xe(e)}let r=await Le(e,s),l=new Set(n.execution.completedTasks??[]),t=(r?.tasks??[]).map(u=>({id:u.id,description:u.title,done:l.has(u.id),...u.files!==void 0&&u.files.length>0?{files:u.files}:{}})),b=[...new Set(n.discovery.answers.map(u=>"user"in u?u.user:null).filter(u=>u!==null&&u!=="Unknown User"))],E=(n.specNotes??[]).filter(u=>u.text.startsWith("[QUESTION] ")).map(u=>({id:u.id,text:u.text.replace("[QUESTION] ",""),user:u.user,ts:u.timestamp})),v=n.transitionHistory??[],g=v.length>0?v[0].timestamp:new Date().toISOString(),I=n.lastCalledAt??g,S=n.execution.confidenceFindings??[],h=S.length>0?Math.round(S.reduce((u,i)=>u+i.confidence,0)/S.length*10)/10:null,M=S.filter(u=>u.confidence<5).length;return{name:s,slug:s,phase:n.phase,description:n.specDescription??"",tasks:t,contributors:b,delegations:n.discovery.delegations??[],pendingQuestions:E,pendingSignoffs:[],roadmap:Ge(n.phase),createdAt:g,updatedAt:I,avgConfidence:h,lowConfidenceItems:M}},K=async e=>{let s=await Ie(e),n=new Set(s.map(i=>i.name));try{let i=`${e}/${Te.specsDir}`;for await(let m of(await import("./mod-4XKQZL6W.js")).runtime.fs.readDir(i))m.isDirectory&&!n.has(m.name)&&n.add(m.name)}catch{}let r=[];for(let i of n)try{r.push(await Ae(e,i))}catch{}r.sort((i,m)=>{let T=i.phase!=="COMPLETED"&&i.phase!=="IDLE",R=m.phase!=="COMPLETED"&&m.phase!=="IDLE";return T&&!R?-1:!T&&R?1:m.updatedAt.localeCompare(i.updatedAt)});let l=r.find(i=>i.phase!=="COMPLETED"&&i.phase!=="IDLE")??null,t=await ae(e,{limit:50}),b=t.filter(i=>i.type==="mention"),E=new Set(t.filter(i=>i.type==="mention-reply").map(i=>i.mentionId)),v=b.filter(i=>!E.has(i.id)).map(i=>({id:i.id??"",spec:i.spec,from:i.from??i.user,to:i.to??"",question:i.question??"",status:"pending",ts:i.ts})),I=t.filter(i=>i.type==="signoff").filter(i=>i.status==="pending").map(i=>({spec:i.spec,role:i.role??"",status:"pending",ts:i.ts})),S=await ie(e),h=S!==void 0?{name:S.name,email:S.email}:null,u=(await Me(e))?.roles??null;return{specs:r,activeSpec:l,pendingMentions:v,pendingSignoffs:I,recentEvents:t,currentUser:h,roles:u}};var ke=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0,specsVisible:!0,monitorVisible:!0});var Ze=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"}[e]??e.slice(0,4),et=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},tt=(e,s)=>{switch(s){case"green":return a.green(e);case"yellow":return a.yellow(e);case"red":return a.red(e);case"cyan":return a.cyan(e);case"dim":return a.dim(e);default:return e}},A=(e,s)=>{let n=new Set(s.filter(l=>l.spec!==null).map(l=>l.spec)),r=e.map(l=>({label:l.name,badge:Ze(l.phase),badgeColor:et(l.phase),active:n.has(l.name),dimmed:l.phase==="COMPLETED"}));return r.length===0&&r.push({label:"No specs yet",dimmed:!0,selectable:!1}),r},ce=(e,s,n,r)=>{let l=A(e,s),t=V.drawBox({x:r.x,y:r.y,width:r.width,height:r.height,title:"Specs",borderStyle:"rounded"}),b=r.width-2,E=r.height-2,v=Math.max(0,Math.min(n,l.length-1)),g=z.ensureVisible(z.createScrollState(l.length,E),v),I=z.visibleRange(g),S=[];for(let u=0;u<E;u++){let i=I.start+u,m=r.y+1+u;if(i>=I.end||i>=l.length){S.push(a.moveTo(m,r.x+1)+" ".repeat(b));continue}let T=l[i];if(T===void 0){S.push(a.moveTo(m,r.x+1)+" ".repeat(b));continue}let R=T.selectable!==!1,f=i===n&&R,D=T.active?a.green("\u25CF"):f?"\u25B8":" ",C=T.badge!==void 0?" "+tt(`[${T.badge}]`,T.badgeColor??"dim"):"",F=T.dimmed?a.dim(T.label):T.label,Y=` ${D} ${F}${C}`,U=a.truncate(Y,b),c=Math.max(0,b-a.visibleLength(U));f?S.push(a.moveTo(m,r.x+1)+a.inverse(U+" ".repeat(c))):S.push(a.moveTo(m,r.x+1)+U+" ".repeat(c))}let h={id:r.id,x:r.x,y:r.y+1,width:r.width-1,height:E},M=z.renderScrollbar(h,g);return t+S.join("")+M};var nt=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],rt=e=>{if(e===null||e==="IDLE")return"IDLE";let n={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return nt.map(r=>r===n?a.bold(`\u2726${r}\u2726`):a.dim(r)).join("\u2192")},it=(e,s,n)=>{if(s===0)return a.dim("no tasks");let r=Math.round(e/s*n),l=n-r;return a.green("\u2588".repeat(r))+a.dim("\u2591".repeat(l))+` ${e}/${s}`},le=(e,s,n)=>{let r=[];return e===null?(r.push(a.bold("Mode: ")+a.cyan("IDLE")),r.push(a.dim("No active spec"))):e.mode==="free"?(r.push(a.bold("Mode: ")+a.cyan("IDLE")),r.push(a.dim("No active spec")),r.push(""),r.push(a.dim(`Session: ${e.sessionId}`))):(r.push(a.bold("Spec: ")+(e.spec??"unknown")),r.push(a.bold("Phase: ")+(e.phase??"unknown")),r.push(""),r.push(rt(e.phase)),r.push(""),n!==void 0&&r.push(a.bold("Progress: ")+it(n.completed,n.total,15)),r.push(""),r.push(a.dim(`Session: ${e.sessionId}`))),V.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:"Monitor",borderStyle:"rounded"},r)};var ot=e=>({DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"})[e]??e.slice(0,4),ct=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},lt=e=>e.map(s=>({id:s.id,label:s.spec!==null?s.spec:"IDLE",badge:s.phase!==null?ot(s.phase):void 0,badgeColor:s.phase!==null?ct(s.phase):void 0,closable:!0})),Ve=(e,s,n,r,l=1)=>{let t=[];if(t.push(a.moveTo(r,l)),e.length===0){let v=a.dim(" No tabs \u2014 press n to create one ");return t.push(v+" ".repeat(Math.max(0,n-a.visibleLength(v)))),t.join("")}let b=lt(e),E=Ee.renderTabBar({tabs:b,activeIndex:s,maxWidth:n,style:"inverse"});return t.push(E),t.join("")};var de=(e,s,n,r)=>{let l="Terminal",t=n??[],b=r??0,E=s.y-1,v=s.width,g=Ve(t,b,v,E,s.x),I=e!==null&&e.widget!==null,S=V.drawBox({x:s.x,y:s.y,width:s.width,height:s.height,title:l,borderStyle:"rounded",skipInterior:I});if(t.length===0){let u=a.dim("No tabs \u2014 press n to create one"),i=" ".repeat(Math.max(0,s.width-2)),m="",T=Math.floor((s.height-2)/2);for(let R=1;R<s.height-1;R++)if(m+=a.moveTo(s.y+R,s.x+1),R===T){let f=a.visibleLength(u),D=Math.max(0,Math.floor((s.width-2-f)/2));m+=" ".repeat(D)+u+" ".repeat(Math.max(0,s.width-2-D-f))}else m+=i;return g+S+m}if(e===null||e.widget===null&&e.buffer.length===0){let u=" ".repeat(Math.max(0,s.width-2)),i="";for(let m=1;m<s.height-1;m++)i+=a.moveTo(s.y+m,s.x+1),i+=u;return g+S+i}if(e.widget!==null)return g+S+e.widget.render(s);let h=s.height-2,M=e.buffer.slice(-h);return g+V.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:l,borderStyle:"rounded"},M)};var ue=(e,s)=>({...e,tabs:[...e.tabs,s],selectedTabIndex:e.tabs.length}),X=(e,s)=>{let n=e.tabs.findIndex(t=>t.id===s);if(n===-1)return e;let r=e.tabs[n];r.process!==null&&r.process.kill();let l=e.tabs.filter(t=>t.id!==s);return{...e,tabs:l,selectedTabIndex:Math.min(e.selectedTabIndex,l.length-1)}},Be=(e,s)=>s<0||s>=e.tabs.length?e:{...e,selectedTabIndex:s},pe=(e,s)=>{let n=s.split(`
|
|
3
|
+
`);for(let r of n)e.buffer.push(r);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},k=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var me=(e,s,n)=>{if(e.focus==="terminal")return n&&s==="c"?{type:"quit"}:s==="escape"?{type:"toggleFocus"}:{type:"passthrough",data:s};if(n&&s==="c")return{type:"quit"};if(n&&s==="d")return{type:"quit"};if(n&&s==="t")return{type:"newTab"};if(s==="tab"||s==="escape")return{type:"toggleFocus"};if(n&&s==="e")return{type:"toggleSpecs"};if(n&&s==="w")return{type:"toggleMonitor"};if(e.focus==="list")switch(s){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newTab"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:s}},Fe=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),fe=(e,s,n)=>{let r=j.nextSelectableIndex(n,e.selectedTabIndex,s);return{...e,selectedTabIndex:r}},ge=(e,s,n)=>e>=n.x&&e<n.x+n.width&&s>=n.y&&s<n.y+n.height,Ue=(e,s,n,r)=>{let l=e.x+1,t=e.y+1;if(ge(l,t,s.left)){if(e.type==="wheel")return{type:"scrollSpecs",direction:e.direction==="up"?"up":"down"};if(e.type==="mousedown"&&e.button===0){let b=e.y+1-s.left.y-1;if(b>=0&&b<n.length&&n[b].selectable!==!1)return{type:"clickSpec",index:b}}return{type:"none"}}return ge(l,t,s.rightBottom)?e.type==="wheel"?{type:"scrollTerminal",direction:e.direction==="up"?"up":"down"}:r!=="terminal"?{type:"clickTerminal"}:{type:"forwardMouse",event:e}:ge(l,t,s.rightTop)?{type:"clickMonitor"}:{type:"none"}};var Zt=async e=>{let s=e?.includes("--dry-run")??!1,{root:n}=await Ce();if(!await Pe(n))return console.error("noskills is not initialized. Run:",re(),"init"),ye({exitCode:1});let l=(await K(n)).specs.map(c=>({name:c.name,phase:c.phase,hasActiveSession:!1})),t=ke(),{cols:b,rows:E}=O.getTerminalSize(),v=(c,d)=>{let o=E-1,p=_=>({id:_,x:0,y:0,width:0,height:0});if(!c&&!d)return{left:p("left"),rightTop:p("rightTop"),rightBottom:{id:"rightBottom",x:1,y:2,width:b,height:o-1},statusBar:{id:"statusBar",x:1,y:E,width:b,height:1}};let w=c?Math.min(Math.floor(b*.25),b):0,P=Math.floor(o*(d?.35:0)),L=[];d&&L.push({id:"rightTop",size:{type:"fixed",value:P}}),L.push({id:"rightBottom",size:{type:"flex",grow:1}});let B=[];c&&B.push({id:"left",size:{type:"fixed",value:w}}),B.push({direction:"column",size:{type:"flex",grow:1},children:L});let _e={direction:"column",children:[{direction:"row",size:{type:"flex",grow:1},children:B},{id:"statusBar",size:{type:"fixed",value:1}}]},$e=ee.computeLayout(_e,b,E),q=_=>{let $=ee.findPanel($e,_);return $===void 0?p(_):{id:_,x:$.x+1,y:$.y+1,width:$.width,height:$.height}},Ne=q("left"),ze=q("rightTop"),G=q("rightBottom"),We=q("statusBar"),qe=G.y+1,je=G.height-1;return{left:c?Ne:p("left"),rightTop:d?ze:p("rightTop"),rightBottom:{...G,y:qe,height:je},statusBar:We}},g=v(t.specsVisible,t.monitorVisible),I=()=>({cols:g.rightBottom.width-2,rows:g.rightBottom.height-2}),S=new TextEncoder,h=c=>{N.process.writeToStdout(S.encode(c))};if(s){h(O.clearScreenSeq());let c=` noskills manager | ${l.length} spec(s) | ${re()} | Ctrl+C to quit`;h(a.moveTo(g.statusBar.y,g.statusBar.x)),h(a.inverse(a.truncate(c,g.statusBar.width))),h(ce(l,t.tabs,t.selectedTabIndex,g.left));let d=k(t);return h(le(d,g.rightTop)),h(de(d,g.rightBottom,t.tabs,t.selectedTabIndex)),h(a.moveTo(E,1)),h(`
|
|
4
|
+
`),Q(void 0)}let M=new be,u=null,i=async()=>{for(let c of["claude","claude-code"])try{if(await he`which ${c}`.noThrow().code()===0)return c}catch{}return"claude"},m=A(l,t.tabs);t.selectedTabIndex=j.nextSelectableIndex(m,-1,"down");let T=async()=>{let c=ne();await se(n,{id:c,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let d=I(),y=new Z(d.rows,d.cols),o={id:`tab-${c}`,spec:null,mode:"free",sessionId:c,process:null,buffer:[],widget:y,active:!0,phase:null};try{let p=await i(),w=await H({command:p,cwd:n,env:{...N.env.toObject(),NOSKILLS_SESSION:c,NOSKILLS_PROJECT_ROOT:n},cols:d.cols,rows:d.rows});o.process=w,M.add(o.id,w),w.onData(x=>{y.write(x),pe(o,x),u?.()}),w.exitCode.then(()=>{Object.assign(t,X(t,o.id)),m=A(l,t.tabs),C(),t.running&&D()}).catch(()=>{})}catch(p){let w=p instanceof Error?p.message:String(p);y.write(`[noskills manager] Failed to spawn claude: ${w}\r
|
|
5
|
+
`),y.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
6
|
+
`)}Object.assign(t,ue(t,o)),t.focus="terminal",m=A(l,t.tabs)},R=async c=>{let d=t.tabs.find(P=>P.spec===c);if(d!==void 0){let P=t.tabs.indexOf(d);Object.assign(t,Be(t,P)),t.focus="terminal";return}let y=null;try{y=(await te(n,c)).phase}catch{}let o=ne();await se(n,{id:o,spec:c,mode:"spec",phase:y,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let p=I(),w=new Z(p.rows,p.cols),x={id:`tab-${o}`,spec:c,mode:"spec",sessionId:o,process:null,buffer:[],widget:w,active:!0,phase:y};try{let P=await i(),L=await H({command:P,cwd:n,env:{...N.env.toObject(),NOSKILLS_SESSION:o,NOSKILLS_PROJECT_ROOT:n},cols:p.cols,rows:p.rows});x.process=L,M.add(x.id,L),L.onData(B=>{w.write(B),pe(x,B),u?.()}),L.exitCode.then(()=>{Object.assign(t,X(t,x.id)),m=A(l,t.tabs),C(),t.running&&D()}).catch(()=>{})}catch(P){let L=P instanceof Error?P.message:String(P);w.write(`[noskills manager] Failed to spawn claude for spec "${c}": ${L}\r
|
|
7
|
+
`)}Object.assign(t,ue(t,x)),t.focus="terminal",m=A(l,t.tabs)};await T(),h(O.enterAlternateScreen()),h(O.hideCursorSeq()),h(O.clearScreenSeq()),h(J.enableMouse());let f=new Set(["specs","monitor","terminal","status"]),D=()=>{let c=k(t),d=[];if(d.push(O.hideCursorSeq()),f.size>=4&&d.push("\x1B[2J\x1B[H"),f.has("status")||f.size===0){let o=t.focus==="list"?"LIST":"TERM",p=`ctrl+e: ${t.specsVisible?"hide":"show"} specs | ctrl+w: ${t.monitorVisible?"hide":"show"} monitor`,w=t.focus==="terminal"?"esc: panels | ctrl+c: quit":`esc/tab: switch | ctrl+d: quit | ctrl+t: new tab | ${p}`,x=` noskills | ${t.tabs.length} tab(s) | [${o}] ${w}`;d.push(a.moveTo(g.statusBar.y,g.statusBar.x)),d.push(a.inverse(a.truncate(x,g.statusBar.width)+" ".repeat(Math.max(0,g.statusBar.width-a.visibleLength(x)))))}t.specsVisible&&f.has("specs")&&d.push(ce(l,t.tabs,t.selectedTabIndex,g.left)),t.monitorVisible&&f.has("monitor")&&d.push(le(c,g.rightTop)),f.has("terminal")&&d.push(de(c,g.rightBottom,t.tabs,t.selectedTabIndex));let y=k(t);if(y?.widget!==null&&y?.widget!==void 0){let o=g.rightBottom.y+1+y.widget.terminal.cursorRow,p=g.rightBottom.x+1+y.widget.terminal.cursorCol;d.push(a.moveTo(o,p))}d.push(O.showCursorSeq()),f.clear(),h(d.join(""))},C=()=>{f.add("specs"),f.add("monitor"),f.add("terminal"),f.add("status")},F=!1;u=()=>{f.add("terminal"),!F&&(F=!0,setTimeout(()=>{F=!1,t.running&&D()},16))};let Y=oe(n,async()=>{try{let c=await K(n);l.length=0;for(let d of c.specs)l.push({name:d.name,phase:d.phase,hasActiveSession:!1});m=A(l,t.tabs),f.add("specs"),f.add("monitor"),t.running&&D()}catch{}});C(),D();let U=async c=>{let d=Ue(c,g,m,t.focus);switch(d.type){case"clickSpec":{t.focus="list",t.selectedTabIndex=d.index;let y=l.find(o=>o.name===m[d.index]?.label)?.name;if(y!==void 0){await R(y),C();return}f.add("specs"),f.add("monitor"),f.add("status");break}case"clickTerminal":{t.focus="terminal",f.add("status");break}case"clickMonitor":{t.focus="list",f.add("status");break}case"scrollSpecs":{Object.assign(t,fe(t,d.direction,m)),f.add("specs"),f.add("monitor");break}case"scrollTerminal":{let y=k(t);if(y?.process!==null&&y!==null){let o=d.direction==="up"?"\x1B[A":"\x1B[B";y.process?.write(o.repeat(3))}break}case"forwardMouse":{t.focus="terminal",f.add("status");let y=k(t);if(y?.process!==null&&y!==null){let o=c.x+1-g.rightBottom.x,p=c.y+1-g.rightBottom.y,w=c.button;c.type==="mousemove"&&(w|=32),c.type==="wheel"&&(w=64|(c.direction==="down"?1:0)),c.shift&&(w|=4),c.ctrl&&(w|=16);let x=c.type==="mouseup"?"m":"M";y.process?.write(`\x1B[<${w};${o};${p}${x}`)}break}case"none":break}};try{await we(async()=>{for await(let c of Se(N.process.stdin)){if(!t.running)break;if(c.kind==="mouse"){await U(c.event),f.size>0&&D();continue}let d=c.event;if(t.focus==="terminal"){let o=me(t,d.name,d.ctrl);if(o.type==="passthrough"||o.type==="none"){let p=k(t);p?.process!==null&&p!==null&&p.process?.write(new TextDecoder().decode(d.raw));continue}}let y=me(t,d.name,d.ctrl);switch(y.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,Fe(t)),f.add("status");break;case"navigate":Object.assign(t,fe(t,y.direction,m)),f.add("specs"),f.add("monitor"),f.add("terminal");break;case"newTab":await T(),C();break;case"toggleSpecs":{t.specsVisible=!t.specsVisible,!t.specsVisible&&!t.monitorVisible&&(t.focus="terminal"),g=v(t.specsVisible,t.monitorVisible);let o=I();for(let p of t.tabs)p.process!==null&&p.process.resize(o.cols,o.rows),p.widget!==null&&p.widget.resize(o.rows,o.cols);C();break}case"toggleMonitor":{t.monitorVisible=!t.monitorVisible,!t.specsVisible&&!t.monitorVisible&&(t.focus="terminal"),g=v(t.specsVisible,t.monitorVisible);let o=I();for(let p of t.tabs)p.process!==null&&p.process.resize(o.cols,o.rows),p.widget!==null&&p.widget.resize(o.rows,o.cols);C();break}case"select":{let o=m[t.selectedTabIndex];if(o===void 0)break;let p=o.label;{let w=l.find(x=>x.name===p)?.name;w!==void 0&&await R(w)}C();break}case"closeTab":{let o=k(t);o!==null&&(o.process!==null&&M.remove(o.id),await Re(n,o.sessionId),Object.assign(t,X(t,o.id)),m=A(l,t.tabs),t.focus="list"),C();break}case"passthrough":{let o=k(t);o?.process!==null&&o!==null&&o.process?.write(new TextDecoder().decode(d.raw));break}case"none":break}if(!t.running)break;f.size>0&&D()}})}finally{Y(),await M.killAll(),M.forceKillAll(),await De(n),h(J.disableMouse()),h(O.showCursorSeq()),h(O.exitAlternateScreen())}return Q(void 0)};export{Zt as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-NVPQJFAI.js";import"./chunk-3OG2MEF2.js";import"./chunk-NBA6EFWU.js";import"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as ABOVE_FOLD_PATTERNS,d as CRITICAL_LAYERS,f as CRITICAL_PROPERTY_PATTERNS,m as DEFAULT_CRITICAL_UNIVERSAL_CSS,b as compileTailwind,n as createTailwindPlugin,c as expandApplyDirectives,h as extractCriticalPageCss,j as extractCriticalUniversalCss,l as extractThemeLayer,i as generateAsyncCssLoader,k as generateCriticalUniversalCss,g as getDefaultCriticalCssConfig,a as loadStylesheet};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-RLA2Z7XV.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-DGI7M6TL.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as completionsHandler,f as doctorHandler,g as infoHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-
|
|
2
|
+
import{c as T,h as J}from"./chunk-LWQPFCWC.js";import{a as S}from"./chunk-3OG2MEF2.js";import{b as B,c as W}from"./chunk-NBA6EFWU.js";import{e as h}from"./chunk-5DWJ7WEE.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{i}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var P=h.getLogger(["laroux-bundler","rsc-analyze"]);function Z(t){return{filePath:t.filePath,relativePath:t.relativePath,exportNames:[...t.exports]}}async function E(t,e,n){if(P.debug(`\u{1F50D} Analyzing client components in: ${t}`),!n){let p=(await T(t,{projectRoot:e})).map(Z);return P.debug(`\u{1F4CA} Total client components found: ${p.length}`),p}let r=[],o=0,a=0,l=await T(t,{projectRoot:e});for(let s of l){let p=0;try{p=(await i.fs.stat(s.filePath)).mtime?.getTime()??0}catch{continue}let c=n.getClientComponent(s.filePath,p);if(c){o++,c.isClient&&r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:c.exportNames});continue}a++;let x=[...s.exports];n.setClientComponent(s.filePath,!0,x,p),r.push({filePath:s.filePath,relativePath:s.relativePath,exportNames:x}),P.debug(` \u2713 Found client component: ${s.relativePath} (exports: ${x.join(", ")})`)}return(o>0||a>0)&&P.debug(`\u{1F4CA} Component analysis: ${o} cache hits, ${a} analyzed`),P.debug(`\u{1F4CA} Total client components found: ${r.length}`),r}async function _(t){let e=[],n=/(?:node_modules|\.test\.|\.spec\.)/;for await(let r of S(t,"**/*.{tsx,ts,jsx,js}",n))e.push(i.path.join(t,r));return e}var v=h.getLogger(["laroux-bundler","rsc-transform"]);async function H(t,e){let n=i.path.dirname(t.relativePath),r=i.path.join(e,n);await i.fs.ensureDir(r);let o=tt(t),a=t.relativePath.split("/").pop(),l=i.path.join(r,a);return await i.fs.writeTextFile(l,o),{originalPath:t.filePath,transformedPath:l}}function tt(t){let e=t.exportNames.map(n=>n==="default"?`export default createClientReference(
|
|
3
3
|
"./${t.relativePath}",
|
|
4
4
|
"default"
|
|
5
5
|
);`:`export const ${n} = createClientReference(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{b as CommandBuilder,a as CommandError,f as ProcessGroup,d as exec,c as parseCommand,e as spawnPty};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-SHN5MT56.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-
|
|
2
|
+
import{a as re}from"./chunk-2XNFZXHY.js";import{d as _}from"./chunk-NBA6EFWU.js";import{f as G,h as U,k as H}from"./chunk-SHN5MT56.js";import{b as w,d as S,f as C,g as q,k as z}from"./chunk-YVN2NZL4.js";import{d as N}from"./chunk-VKB3B2FE.js";import{a as O}from"./chunk-MG65QJY6.js";import{a as E,b as $,d as V,f as D}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import{b as v}from"./chunk-6G6UVWJN.js";import{e as te}from"./chunk-5WJ6AUNY.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var ne="main",ae=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??ne,path:n.length>0?n.join("/"):void 0}},ie=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},B={name:"github",prefixes:["github","gh"],isDefault:!0,parse:ae,fetch:ie};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,M(B))},M=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},oe=r=>(A(),g.providers.get(r)??null),le=()=>(A(),g.defaultProvider),W=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=W(r);return await e.fetch(s,t),s};var Y=te(re(),1);var J=[".eser/manifest.yml",".eser/manifest.yaml",".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of J){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=Y.parse(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},fe=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=fe(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
|
|
3
3
|
${n.join(`
|
|
4
4
|
`)}`);return f},K=async r=>{for(let t of J){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var Q=/\{\{\s*\.(\w+)\s*\}\}/g,ce=["png","jpg","jpeg","gif","ico","webp","svg","woff","woff2","ttf","eot","otf","zip","tar","gz","bz2","xz","7z","pdf","doc","docx","xls","xlsx","ppt","pptx","exe","dll","so","dylib","mp3","mp4","avi","mov","webm"],pe=r=>_(r.toLowerCase(),ce),de=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"\0GLOBSTAR\0").replace(/\*/g,"[^/]*").replace(/\0GLOBSTAR\0/g,".*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},T=(r,t)=>r.replace(Q,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),R=r=>Q.test(r),Z=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(de(o,s)||(n.isDirectory?R(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!pe(n))try{let c=await l.fs.readTextFile(n);if(R(c)){let p=T(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(R(o)){let c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=T(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},ee=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".eser/manifest.yml",".eser/manifest.yaml",...i?.ignore??[]];await Z(o,{variables:p,ignore:u});let d=await K(o);d!==null&&await ee(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var Ge=async r=>{let t=O(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as Le}from"./chunk-
|
|
2
|
+
import{a as Le}from"./chunk-ZZMU6YO4.js";import{a as qe}from"./chunk-JBUJTUEU.js";import{a as _e,c as Je}from"./chunk-4BOZ4A55.js";import{a as We}from"./chunk-6M64JLJW.js";import{a as ze}from"./chunk-LRAHXO3G.js";import{a as Se,c as $e}from"./chunk-7L4DDCRL.js";import{a as Re,c as Te}from"./chunk-6HJUPT5Y.js";import{a as De,c as Fe}from"./chunk-352YGR5O.js";import{a as Pe,c as je}from"./chunk-SKW7N57D.js";import{a as Ie,c as Ee}from"./chunk-GQ4WRANA.js";import{a as Me,c as Ne}from"./chunk-EJBYYUXZ.js";import{a as Oe}from"./chunk-F4QK3J3J.js";import{a as Ae}from"./chunk-DYBJ6UPO.js";import"./chunk-VXVW4UNH.js";import{a as de,c as ce}from"./chunk-RLTTHJ3E.js";import{a as pe,c as me}from"./chunk-7V3IDYYI.js";import{a as ue,c as fe}from"./chunk-BZSILAX3.js";import{a as ge,c as ve}from"./chunk-RSHUTH4K.js";import{a as ye,c as he}from"./chunk-H6U2EE7V.js";import{a as ke,c as be}from"./chunk-V3KWM26F.js";import{a as xe,c as Ve}from"./chunk-L6J3BWVP.js";import{a as Ce,c as we}from"./chunk-BKWQQUSY.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import{a as ne,c as le}from"./chunk-VGCEFEFY.js";import{a as re}from"./chunk-VJSHVZ7R.js";import"./chunk-BVIGTD2Z.js";import{b as H,c as Q}from"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import{a as ie}from"./chunk-PZUDTTK4.js";import{a as q,b as Z,f as ee,h as te,j as ae,k as _,o as m,p as se,q as oe}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import{b as X}from"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as K}from"./chunk-MG65QJY6.js";import{a as P,b as L}from"./chunk-FFWPJP7A.js";import{i as j}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var I=async a=>{let s=await H(a);return s===null?null:s},Ke=async a=>await Q(a);var J={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let s=await Le({root:a.root});return{name:"validate-circular-deps",passed:!s.hasCycles,issues:s.cycles.map(e=>({severity:"error",message:`Circular dependency: ${e.join(" \u2192 ")}`})),stats:{packagesChecked:s.packagesChecked}}}};var W={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let s=await We({root:a.root});return{name:"validate-mod-exports",passed:s.isComplete,issues:s.missingExports.map(e=>({severity:"error",message:`Missing export in ${e.packageName}: ${e.file}`,file:e.file})),stats:{packagesChecked:s.packagesChecked}}}};var z={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let s=await qe({root:a.root});return{name:"validate-export-names",passed:s.isValid,issues:s.violations.map(e=>({severity:"error",message:`${e.packageName}: "${e.exportPath}" should be "${e.suggestion}"`})),stats:{packagesChecked:s.packagesChecked}}}};var Y={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let s=a.options?.requireExamples,e=await Ae({root:a.root,requireExamples:s});return{name:"validate-docs",passed:e.isValid,issues:e.issues.map(t=>({severity:"error",message:`${t.symbol}: ${t.issue}`,file:t.file,line:t.line})),stats:{filesChecked:e.filesChecked,symbolsChecked:e.symbolsChecked}}}};var B={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let s=await ze({root:a.root}),e=[];for(let t of s.inconsistencies)e.push({severity:"error",message:`${t.packageName}: ${t.field} mismatch - deno.json: ${JSON.stringify(t.denoValue)}, package.json: ${JSON.stringify(t.packageValue)}`});for(let t of s.dependencyInconsistencies){let c=`${t.packageName}: ${t.dependencyName} - ${t.issue}`;t.expected!==void 0&&t.actual!==void 0&&(c+=` (expected: ${t.expected}, actual: ${t.actual})`),e.push({severity:"error",message:c})}return{name:"validate-package-configs",passed:s.isConsistent,issues:e,stats:{packagesChecked:s.packagesChecked}}}};var tt=[{pattern:/\bDeno\.cwd\(\)/,replacement:"runtime.process.cwd()"},{pattern:/\bDeno\.env\.get\b/,replacement:"runtime.env.get()"},{pattern:/\bDeno\.env\.set\b/,replacement:"runtime.env.set()"},{pattern:/\bDeno\.env\.delete\b/,replacement:"runtime.env.delete()"},{pattern:/\bDeno\.env\.has\b/,replacement:"runtime.env.has()"},{pattern:/\bDeno\.env\.toObject\b/,replacement:"runtime.env.toObject()"},{pattern:/\bDeno\.readTextFile\b/,replacement:"runtime.fs.readTextFile()"},{pattern:/\bDeno\.readFile\b/,replacement:"runtime.fs.readFile()"},{pattern:/\bDeno\.writeTextFile\b/,replacement:"runtime.fs.writeTextFile()"},{pattern:/\bDeno\.writeFile\b/,replacement:"runtime.fs.writeFile()"},{pattern:/\bDeno\.mkdir\b/,replacement:"runtime.fs.mkdir()"},{pattern:/\bDeno\.remove\b/,replacement:"runtime.fs.remove()"},{pattern:/\bDeno\.stat\b/,replacement:"runtime.fs.stat()"},{pattern:/\bDeno\.lstat\b/,replacement:"runtime.fs.lstat()"},{pattern:/\bDeno\.readDir\b/,replacement:"runtime.fs.readDir()"},{pattern:/\bDeno\.copyFile\b/,replacement:"runtime.fs.copyFile()"},{pattern:/\bDeno\.rename\b/,replacement:"runtime.fs.rename()"},{pattern:/\bDeno\.open\b/,replacement:"runtime.fs (or @eser/streams)"},{pattern:/\bDeno\.exit\b/,replacement:"runtime.process.exit()"},{pattern:/\bnew Deno\.Command\b/,replacement:"runtime.exec.spawn() (or @eser/shell/exec)"},{pattern:/\bDeno\.args\b/,replacement:"runtime.process.args"}],at=[],st=a=>at.some(s=>s.test(a)),ot=(a,s)=>{let e=a.slice(0,s);return e.includes("//")||e.includes("/*")&&!e.includes("*/")},it=(a,s)=>{let e=!1,t=!1,c=!1;for(let p=0;p<s;p++){let u=a[p];(p>0?a[p-1]:"")!=="\\"&&(u==="'"&&!t&&!c&&(e=!e),u==='"'&&!e&&!c&&(t=!t),u==="`"&&!e&&!t&&(c=!c))}return e||t||c},w=re({name:"validate-runtime-js-apis",description:"Detect direct usage of runtime-specific APIs (use @eser/standards/cross-runtime instead)",canFix:!1,stacks:["javascript"],defaults:{},extensions:X,checkFile(a,s){if(s===void 0)return[];if(st(a.path))return[];let e=[],t=s.split(`
|
|
3
3
|
`);for(let c=0;c<t.length;c++){let p=t[c];for(let{pattern:u,replacement:f}of tt){let g=u.exec(p);g!==null&&(ot(p,g.index)||it(p,g.index)||e.push({path:a.path,line:c+1,message:`direct Deno API usage: ${g[0]} \u2014 use @eser/standards/cross-runtime (${f})`}))}}return e}}),St=w.run,Ye=w.validator,$t=w.main;var x={validators:new Map,initialized:!1},nt=()=>{n(J),n(W),n(z),n(Y),n(B),n(le),n(ce),n(me),n(fe),n(ve),n(he),n(be),n(Ve),n(we),n($e),n(Te),n(Fe),n(je),n(Ee),n(Ne),n(Je),n(Ye)},U=()=>{x.initialized||(x.initialized=!0,nt())},n=a=>{x.validators.set(a.name,a)},lt=a=>(U(),x.validators.get(a)??null),E=()=>(U(),[...x.validators.values()]),dt=()=>(U(),[...x.validators.keys()]),ct=a=>({name:a.config.name,description:a.config.description,run:async s=>{let e=await a.run(s);return{name:e.name,passed:e.issues.length===0,issues:e.issues.map(t=>({path:t.path,line:t.line,message:t.message,fixed:t.fixed})),mutations:e.mutations.map(t=>({path:t.path,oldContent:t.oldContent,newContent:t.newContent})),stats:{filesChecked:e.filesChecked,issuesFound:e.issues.length}}}}),pt=a=>({name:a.name,description:a.description,run:async s=>{let e=await a.validate({root:s.root??".",options:s});return{name:e.name,passed:e.passed,issues:e.issues.map(t=>({path:t.file,line:t.line,message:t.message})),mutations:[],stats:e.stats}}}),mt=()=>{let a=[],s=[ne,de,pe,ue,ge,ye,ke,xe,Ce,Se,Re,De,Pe,Ie,Me,_e,w];for(let t of s)a.push(ct(t));let e=[J,W,z,Y,B];for(let t of e)a.push(pt(t));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async t=>{let c=t.commitMsgFile??t._args?.[0]??".git/COMMIT_EDITMSG",{runtime:p}=await import("./mod-4XKQZL6W.js"),u;try{u=await p.fs.readTextFile(c)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${c}`}],mutations:[],stats:{}}}let f=Oe(u,{allowAsterisk:t.allowAsterisk,allowMultipleScopes:t.allowMultipleScopes,forceScope:t.forceScope,types:t.types});return{name:"validate-commit-msg",passed:f.valid,issues:f.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ut=8,Zt=async(a={})=>{let s=a.root??j.process.cwd(),t=(await I(s))?.stack??[],c=[...a.skip??[]],p=a.only??[],u=E(),f=[],g=[],S=[];for(let i of u){if(p.length>0&&!p.includes(i.name))continue;if(c.includes(i.name)){S.push(i.name);continue}if(i.requiredStacks.length>0&&t.length>0&&!i.requiredStacks.some(G=>t.includes(G))){g.push({name:i.name,reason:`Requires '${i.requiredStacks.join("' or '")}' stack`});continue}let $={...a.fix!==void 0?{fix:a.fix}:{}},h=await i.validate({root:s,options:$});f.push(h)}return{passed:f.every(i=>i.passed),results:f,skipped:g,disabled:S}},ea=async a=>{let s=K(a??j.process.args,{string:["root","only","skip"],boolean:["fix","help","json","yes"],alias:{h:"help",y:"yes"}});if(s.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -y, --yes Auto-confirm all fix prompts (no interactive prompts)"),console.log(" --json Output results as JSON (suppresses TUI output)"),console.log(" -h, --help Show this help message"),P(void 0);let e=s.json,t=s.yes,c=s.root,p=s.fix,u=s.only,f=s.skip,g=u!==void 0?u.split(",").map(o=>o.trim()):[],S=f!==void 0?f.split(",").map(o=>o.trim()):[],{ctx:i}=e?{ctx:Z({interaction:"non-interactive"})}:ie(),$=i.interaction==="interactive",h=c??j.process.cwd();e||ae(i,"Validating codebase...");let M=e?void 0:se(i,"Loading config...");M?.start();let R=(await I(h))?.stack??[],Be=R.length>0?R.join(", "):"all (no .eser/manifest.yml)";M?.succeed("Config loaded"),e||m.info(i,`Stack: ${Be}`);let Ue=E(),k=[],T=[],D=[];for(let o of Ue)if(!(g.length>0&&!g.includes(o.name))){if(S.includes(o.name)){D.push(o.name);continue}if(o.requiredStacks.length>0&&R.length>0&&!o.requiredStacks.some(d=>R.includes(d))){T.push({name:o.name,reason:`Requires '${o.requiredStacks.join("' or '")}' stack`});continue}k.push(o)}let V=[],N=e?void 0:oe(i,{total:k.length,label:"Validating..."});N?.start();let O=o=>{if(V.push(o),!e){let l=Object.entries(o.stats).map(([r,y])=>`${y} ${r}`).join(", "),d=`${o.name.padEnd(18)} (${l})`;o.passed?m.success(i,`PASS ${d}`):m.error(i,`FAIL ${d}`)}N?.advance(1)};if(p)for(let o of k){let l=await o.validate({root:h,options:{}}),d=l;if(!l.passed){let r=!0;if($&&!t&&!e){let y=l.issues.length,v=await ee(i,{message:`Fix ${y} issue(s) found by ${o.name}?`,initialValue:!0});(q(v)||!v)&&(r=!1)}r&&(d=await o.validate({root:h,options:{fix:!0}}))}O(d)}else{let o=0,l=async()=>{for(;o<k.length;){let y=o++,v=k[y];if(v===void 0)break;try{let b=await v.validate({root:h,options:{}});O(b)}catch(b){let Ge={name:v.name,passed:!1,issues:[{severity:"error",message:String(b)}],stats:{filesChecked:0,issuesFound:1,fixedCount:0}};O(Ge)}}},d=Math.min(ut,k.length),r=Array.from({length:d},()=>l());await Promise.allSettled(r)}if(N?.stop("Validation complete"),!e&&T.length>0){m.step(i,"Skipped (stack not configured):");for(let o of T)m.step(i,` - ${o.name}: ${o.reason}`)}if(!e&&D.length>0){m.step(i,"Disabled:");for(let o of D)m.step(i,` - ${o}`)}let C=V.flatMap(o=>o.issues.map(l=>({validator:o.name,...l})));if(!e&&C.length>0){m.warn(i,`Issues (${C.length}):`);let o=new Map;for(let l of C){let d=l.file??l.validator,r=o.get(d)??[];r.push(l),o.set(d,r)}for(let[l,d]of o){m.step(i,` ${l}`);for(let r of d){let y=r.severity==="error"?"error":"warning",v=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${y}${v}: ${r.message}`):m.warn(i,` ${y}${v}: ${r.message}`)}}}let F=V.filter(o=>!o.passed);if(!e&&$&&F.length>0)for(;;){let o=[...F.map(r=>({value:r.name,label:`${r.name} (${r.issues.length} issue(s))`})),{value:"__done__",label:"Done"}],l=await te(i,{message:"View details for which validator?",options:o});if(q(l)||l==="__done__")break;let d=F.find(r=>r.name===l);if(d!==void 0){m.info(i,`Details for ${d.name} (${d.issues.length} issue(s)):`);for(let r of d.issues){let y=r.severity==="error"?"error":"warning",v=r.file??d.name,b=r.line!==void 0?`:${r.line}`:"";r.severity==="error"?m.error(i,` ${v}${b} [${y}]: ${r.message}`):m.warn(i,` ${v}${b} [${y}]: ${r.message}`)}}}if(e){let o=V.every(d=>d.passed),l=JSON.stringify({passed:o,results:V,skipped:T,disabled:D},null,2);return console.log(l),o?P(void 0):L({message:"",exitCode:1})}let A=F.length;return A>0?(_(i,`${A} check(s) failed with ${C.length} issue(s)`),L({message:`${A} check(s) failed with ${C.length} issue(s)`,exitCode:1})):(_(i,"All checks passed!"),P(void 0))};export{Ke as getProjectConfigPath,lt as getValidator,dt as getValidatorNames,E as getValidators,mt as getWorkflowTools,I as loadProjectConfig,ea as main,n as registerValidator,Zt as validate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-
|
|
2
|
+
import{a as K,b as V}from"./chunk-UQ2BC7UA.js";import{a as G,b as v}from"./chunk-QHVTWYZJ.js";import{a as P,b as g}from"./chunk-SBAXURB7.js";import{a as S,b as J}from"./chunk-HLKFDKLZ.js";import{a as h,b as O,c as k,d as R,e as B,f as E}from"./chunk-TDQRRGDJ.js";import"./chunk-BNQAZLIQ.js";import{a as f,b as u}from"./chunk-MX5DKVDI.js";import{a as A,b as C}from"./chunk-3KGG2I2A.js";import{a as M,b as w}from"./chunk-LS5MCZUM.js";import{a as I,b as T}from"./chunk-67AFLWXV.js";import{a as l,b as m,c as s,d,e as y,f as F,g as x}from"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var o=null,b=async()=>{if(o!==null)return o;let{anthropicFactory:e}=await import("./anthropic-YMZNUQKZ.js"),{openaiFactory:r}=await import("./openai-2KONKHWL.js"),{geminiFactory:t}=await import("./gemini-43AWJEWI.js"),{vertexaiFactory:a}=await import("./vertexai-2F2A3VTE.js"),{claudeCodeFactory:i}=await import("./claude-code-RN3Q2VCK.js"),{ollamaFactory:c}=await import("./ollama-PL4UHEF2.js"),{openCodeFactory:n}=await import("./opencode-K4G7UMAE.js"),{kiroFactory:p}=await import("./kiro-JS5UVLRL.js");return o=[e,r,t,a,i,c,n,p],o};export{G as AnthropicModel,f as ClaudeCodeModel,S as GeminiModel,I as KiroModel,A as OllamaModel,P as OpenAIModel,M as OpenCodeModel,K as VertexAIModel,v as anthropicFactory,y as captureStderr,F as classifyExitCode,E as classifyGenAIError,u as claudeCodeFactory,b as defaultFactories,x as formatMessagesAsText,J as geminiFactory,T as kiroFactory,O as mapContentBlockToGenAIPart,B as mapGenAIResponseToResult,k as mapMessagesToGenAI,h as mapRoleToGenAI,R as mapToolsToGenAI,C as ollamaFactory,w as openCodeFactory,g as openaiFactory,s as parseJsonlStream,d as parseTextOutput,l as resolveBinary,m as spawnCliProcess,V as vertexaiFactory};
|