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,8 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as re}from"./chunk-5YBG2HOI.js";import{a as Ie}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as z}from"./chunk-NQS27P25.js";import{a as ge,b as Se,c as ve}from"./chunk-6F4PFXYY.js";import"./chunk-IUORSUN6.js";import{a as K,c as Y,e as X}from"./chunk-5QUEAV4O.js";import"./chunk-KFVUFHJB.js";import{a as G}from"./chunk-NY4W44PI.js";import{a as we,b as ye,d as C}from"./chunk-2ZYCRMUT.js";import{a as be}from"./chunk-6WFCBJPF.js";import{a as W}from"./chunk-ODBJ5KMQ.js";import{a as Ee,b as Re,c as Fe,d as Oe}from"./chunk-NYHMH3N5.js";import{h as J}from"./chunk-L32KHQVT.js";import{a as xe,b as De,c as Z,d as ee,e as Ce,f as te,g as F,h as se,i as _,j as ne,k as ke,m as Ae,o as ie,p as Pe}from"./chunk-OXP2FOO5.js";import{A as fe,B as he,a as oe,c as R,e as ce,f as le,j as de,k as pe,l as ue,p as me,r as q,w as B}from"./chunk-RUTM4VP7.js";import{c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as j,b}from"./chunk-FFWPJP7A.js";import{i as D}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var at=async d=>{let{root:e}=await he(),a=we(d),u=ye(d);if(!await fe(e))return await C({error:`noskills not initialized. Run: ${V("init")}`},a),b({exitCode:1});let n=null;for(let m of u)m.startsWith("--answer=")&&(n=m.slice(9));let s=le(u),t;try{t=await ce(e,s)}catch(m){let f=m instanceof Error?m.message:String(m);return await C({error:f},a),b({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED")return await C({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},a),b({exitCode:1});let o=await ue(e);if(o?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-QE4P4DS4.js");m(o.command)}if(o===null)return await C({error:"No config found"},a),b({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let m=`${e}/${R.specDir(t.spec)}`;try{await D.fs.stat(m)}catch{return await C({error:!0,message:`Active spec '${t.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${V("reset")}\` to return to idle, or \`${V("cancel")}\` to mark as cancelled.`},a),b({exitCode:1})}}let i=Ie(u,o);t.phase==="DISCOVERY"&&t.discovery.audience!==i&&(t={...t,discovery:{...t.discovery,audience:i}});let l=(await me(e)).filter(m=>o.concerns.includes(m.id));if(n!==null){let m=await J(e),f=await Ne(e,t,o,l,n,m);await q(e,f);let g={...f,lastCalledAt:new Date().toISOString()};await q(e,g);let U=D.env.get("NOSKILLS_SESSION")??null;U!==null&&await B(e,U,g.phase);let N=await K(e),{tier1:M,tier2Count:v}=Y(N,g.phase),k=g.spec!==null?await W(e,g.spec):null,P=await Te(e,g),x=await re(e,P),I=X(o?.tools??[]),S=await J(e),A=await z(g,l,M,o,k,x,void 0,I,S,v,e),Q=n.trim().toLowerCase()==="save",$e=g.phase===t.phase;if(Q&&$e&&(g.phase==="SPEC_DRAFT"||g.phase==="SPEC_APPROVED")){let Le=g.phase==="SPEC_DRAFT"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',Ue={...A,instruction:Le,saved:!0};return await C(Ue,a),j(void 0)}return await C(A,a),j(void 0)}let r={...t,lastCalledAt:new Date().toISOString()};await q(e,r);let p=D.env.get("NOSKILLS_SESSION")??null;p!==null&&await B(e,p,r.phase);let h=await K(e),{tier1:w,tier2Count:y}=Y(h,r.phase),H=r.spec!==null?await W(e,r.spec):null,O=await Te(e,r),T=await re(e,O),$;r.phase==="IDLE"&&($={existingSpecs:(await pe(e)).map(f=>({name:f.name,phase:f.state.phase,iteration:f.state.execution.iteration,detail:f.state.phase==="EXECUTING"?`${f.state.execution.completedTasks.length} tasks done, iteration ${f.state.execution.iteration}`:f.state.phase==="SPEC_DRAFT"?"awaiting approval":f.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let L=X(o?.tools??[]),ae=await J(e),E=await z(r,l,w,o,H,T,$,L,ae,y,e);return await C(E,a),j(void 0)},Ne=async(d,e,a,u,n,s)=>{switch(e.phase){case"DISCOVERY":{let t=e.specDescription!==null&&e.specDescription.length>0,o=e.discovery.mode;if(o===void 0&&t)return["full","validate","technical-depth","ship-fast","explore"].includes(n)?Z(e,n):Z(e,"full");let i=e.discovery.premisesCompleted===!0;if(o!==void 0&&!i){try{let p=JSON.parse(n);if(p!==null&&typeof p=="object"&&"premises"in p){let w=p.premises.map(y=>({text:y.text??"",agreed:y.agreed??!0,revision:y.revision,user:s?.name??"Unknown User",timestamp:new Date().toISOString()}));return ee(e,w)}}catch{}return ee(e,[])}let c=e.discovery.audience==="agent",l=null;try{let p=JSON.parse(n);typeof p=="object"&&p!==null&&!Array.isArray(p)&&(c?ge.map(y=>y.id).every(y=>y in p)&&(l=p):l=p)}catch{}let r=e;if(l!==null)for(let[p,h]of Object.entries(l))typeof h=="string"&&h.length>0&&(r=F(r,p,h,s));else{let p=Se(u),h=r.discovery.currentQuestion,w=p[h];if(w===void 0)return e;r=F(r,w.id,n,s),r=ke(r)}return ve(r.discovery.answers)&&(r=se(r)),r}case"DISCOVERY_REVIEW":{let t=n.trim().toLowerCase();if(t==="approve"){let i=G(e.discovery.answers);return i.detected&&i.proposals.length>=2?ne(e):e.discovery.mode!==void 0?ne(e):_(e)}if(t==="split")return await Me(d,e);if(t==="keep"){let i=ie(e,{id:`decision-split-keep-${Date.now()}`,question:"Split spec into separate areas?",choice:"Chose to keep as single spec despite multiple areas detected",promoted:!1,timestamp:new Date().toISOString()});return _(i)}let o=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!o){let i;if(t==="skip"||t==="none")i=te(e);else{let c=!1;try{let l=JSON.parse(n);if(l!==null&&typeof l=="object"&&"approach"in l){let r={id:String(l.approach),name:String(l.name??l.approach),summary:String(l.summary??""),effort:String(l.effort??""),risk:String(l.risk??""),user:s?.name??"Unknown User",timestamp:new Date().toISOString()};i=Ce(e,r),c=!0}}catch{}c||(i=te(e))}return _(i)}try{let i=JSON.parse(n);if(typeof i.revise=="object"&&i.revise!==null){let c=e;for(let[l,r]of Object.entries(i.revise))typeof r=="string"&&r.length>0&&(c=F(c,l,r,s));return c}}catch{}return e}case"SPEC_DRAFT":{if(n.trim().toLowerCase()==="save")return e;if(e.classification===null){let t,o=n.trim().toLowerCase();if(o==="none"||o==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let c=JSON.parse(n);t={involvesWebUI:c.involvesWebUI===!0||c.involvesUI===!0,involvesCLI:c.involvesCLI===!0||c.involvesUI===!0,involvesPublicAPI:c.involvesPublicAPI===!0,involvesMigration:c.involvesMigration===!0,involvesDataHandling:c.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let i={...e,classification:t};try{await be(d,i,u)}catch{}return i}try{let t=JSON.parse(n);if(typeof t.refinement=="string"&&t.refinement.length>0){let o=t.refinement;if(e.spec!==null){let i=`${d}/${R.specFile(e.spec)}`,c=await D.fs.readTextFile(i);if(o.includes("task-")){let r=je(o).map(w=>`- [ ] ${w}`).join(`
|
|
3
|
+
`),p=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,h=c.replace(p,`## Tasks
|
|
4
|
+
|
|
5
|
+
${r}
|
|
6
|
+
`);await D.fs.writeTextFile(i,h)}}return e}}catch{}return e}case"SPEC_APPROVED":{if(n.trim().toLowerCase()==="save")return e;let t=Ae(e);return t.spec!==null&&(await Ee(d,t.spec,"executing"),await Oe(d,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(a.verifyCommand!==null&&a.verifyCommand!==void 0&&a.verifyCommand.length>0){let o=await Ve(d,a.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:o}},!o.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await qe(d,e,n,u)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",o={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=ie(e,o);return i=xe(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},Me=async(d,e)=>{let a=G(e.discovery.answers);if(!a.detected||a.proposals.length===0)return e;let u=[];for(let s of a.proposals){let t=`${d}/${R.specDir(s.name)}`;await D.fs.mkdir(t,{recursive:!0});let o=e.discovery.answers.filter(l=>s.relevantAnswers.includes(l.questionId)),c=De(oe(),s.name,`spec/${s.name}`);for(let l of o)c=F(c,l.questionId,l.answer);c=se(c),await de(d,s.name,c),u.push(s.name)}return Pe(e,"cancelled",`Split into: ${u.join(", ")}`)},je=d=>d.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),qe=async(d,e,a,u)=>{let n;try{n=JSON.parse(a)}catch{return{...e,execution:{...e.execution,lastProgress:a,awaitingStatusReport:!1}}}let s=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let k=e.execution.debt.items.map((I,S)=>({id:`legacy-${S+1}`,text:I,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:k}}};let P=new TextEncoder,x=D.process.stderr.getWriter();await x.write(P.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
7
|
+
`)),x.releaseLock()}let t=new Set(["mandatory-tests","mandatory-docs"]),i=(n.na??[]).filter(v=>t.has(v));if(i.length>0)return{...s,execution:{...s.execution,lastProgress:`REJECTED: Tests and documentation ACs require explicit justification to mark as N/A. Explain why tests or docs are not needed for this spec. Rejected IDs: ${i.join(", ")}`,awaitingStatusReport:!0}};let c=n.completed??[],l=new Set(c),r=n.na??[],p=new Set(r),h=n.newIssues??[],w=n.remaining??[],y=n.blocked??[],H=s.execution.debt?.unaddressedIterations??0,O=s.execution.debt!==null?s.execution.debt.items.filter(v=>!l.has(v.id)&&!p.has(v.id)):[],T=s.execution.debtCounter??0,$=h.map((v,k)=>({id:`debt-${T+k+1}`,text:v,since:s.execution.iteration})),L=[...O,...$],E=w.length===0&&y.length===0&&h.length===0||L.length===0?null:{items:L,fromIteration:s.execution.debt?.fromIteration??s.execution.iteration,unaddressedIterations:O.length>0?H+1:1},m=[...new Set([...s.execution.naItems??[],...r])],f=[];c.length>0&&f.push(`Completed: ${c.join(", ")}`),r.length>0&&f.push(`N/A: ${r.join(", ")}`);let g=f.length>0?f.join("; "):"Status report submitted",U=s.execution.lastVerification===null||s.execution.lastVerification.passed===!0,N=E===null&&U,M=T+h.length;if(N&&s.spec!==null){let v=await W(d,s.spec);if(v!==null){let k=s.execution.completedTasks??[],P=new Set(k),x=[];try{let S=JSON.parse(s.execution.lastProgress??"");Array.isArray(S.completed)&&(x=S.completed.filter(A=>!P.has(A)&&v.tasks.some(Q=>Q.id===A)))}catch{}if(x.length===0){let S=v.tasks.find(A=>!P.has(A.id));S!==void 0&&(x=[S.id])}let I=[];for(let S of x)await Re(d,s.spec,S),await Fe(d,s.spec,S,"done"),I.push(S);if(I.length>0){let S=I.length===1?`Task ${I[0]} accepted`:`Tasks ${I.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${S}: ${g}`,awaitingStatusReport:!1,debt:E,completedTasks:[...k,...I],debtCounter:M,naItems:m}}}}}return{...s,execution:{...s.execution,lastProgress:N?g:`Task not accepted \u2014 remaining items must be addressed first. ${g}`,awaitingStatusReport:!1,debt:E,debtCounter:M,naItems:m}}},Ve=async(d,e)=>{try{let{execSync:a}=await import("node:child_process"),u=a(e,{cwd:d,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(u).slice(0,4e3),timestamp:new Date().toISOString()}}catch(a){let u=a,n=((u.stdout??"")+(u.stderr??"")).slice(0,4e3);return u.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${a instanceof Error?a.message:String(a)}`,timestamp:new Date().toISOString()}}},Te=async(d,e)=>{let a=[...e.execution.modifiedFiles??[]],u=await _e(d);return[...new Set([...a,...u])]},_e=async d=>{let e=`${d}/${R.stateDir}/files-changed.jsonl`;try{let u=(await D.fs.readTextFile(e)).trim().split(`
|
|
8
|
+
`).filter(Boolean),n=[];for(let s of u)try{let t=JSON.parse(s);n.includes(t.file)||n.push(t.file)}catch{}return n}catch{return[]}};export{Ne as handleAnswer,at as main,je as parseRefinementTasks};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-3KGG2I2A.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OllamaModel,b as ollamaFactory};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-LS5MCZUM.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as OpenCodeModel,b as openCodeFactory};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{f as E}from"./chunk-5QUEAV4O.js";import{B as R,c as y,l as T}from"./chunk-RUTM4VP7.js";import{b as C}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as P,h as S,k as v}from"./chunk-SHN5MT56.js";import{c as h,d as f,f as w,g as F}from"./chunk-YVN2NZL4.js";import{a as $,b as g}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var U=r=>{let e=r;if(typeof e?.name!="string"||e.name.length===0)throw new Error("Pack manifest must have a non-empty 'name' field");if(typeof e?.version!="string"||e.version.length===0)throw new Error("Pack manifest must have a non-empty 'version' field");if(typeof e?.description!="string"||e.description.length===0)throw new Error("Pack manifest must have a non-empty 'description' field");return e},B=()=>({installed:[]});var L={name:"typescript",version:"1.0.0",description:"TypeScript best practices",tags:["typescript","types"],rules:["rules/use-strict-types.md","rules/no-any.md","rules/prefer-const.md"],concerns:["concerns/ts-quality.json"]};var _={id:"ts-quality",name:"TypeScript Quality",description:"Enforces TypeScript best practices",extras:[{questionId:"verification",text:"Does the code pass strict TypeScript checks (noEmit, strict mode)?"}],specSections:[],reminders:["Run tsc --noEmit before reporting task complete"],acceptanceCriteria:["TypeScript strict mode passes with zero errors"]};var J={name:"react",version:"1.0.0",description:"React component conventions",tags:["react","frontend"],rules:["rules/component-structure.md","rules/prefer-function-components.md","rules/state-management.md"]};var H={name:"security",version:"1.0.0",description:"Security audit rules",tags:["security","audit"],rules:["rules/no-secrets-in-code.md","rules/validate-input.md","rules/no-eval.md"],concerns:["concerns/security-audit.json"]};var K={id:"security-audit",name:"Security Audit",description:"Security-focused review for every spec",extras:[{questionId:"verification",text:"Has the change been reviewed for injection, XSS, CSRF, and auth bypass?"},{questionId:"scope_boundary",text:"What security boundaries must NOT be crossed?"}],specSections:["Security Review"],reminders:["Check for hardcoded secrets, unsanitized input, and missing auth checks"],acceptanceCriteria:["No hardcoded secrets","All user input validated","Auth checks present on protected routes"]};var ne={"use-strict-types":"Prefer explicit types over inference for function params and returns","no-any":"Never use 'any'. Use 'unknown' when type is genuinely unknown.","prefer-const":"Use const by default, let only when reassignment is needed"},te={"component-structure":"One component per file. Name file same as component.","prefer-function-components":"Use function components with hooks. No class components.","state-management":"Keep state as close to where it's used as possible."},se={"no-secrets-in-code":"Never hardcode API keys, passwords, or tokens","validate-input":"Validate and sanitize all user input at API boundaries","no-eval":"Never use eval(), new Function(), or equivalent dynamic code execution"},re={manifest:L,ruleContents:ne,concernContents:[_]},ie={manifest:J,ruleContents:te,concernContents:[]},ae={manifest:H,ruleContents:se,concernContents:[K]},x=new Map([["typescript",re],["react",ie],["security",ae]]);var z=".eser/packs.json",D=3e4,je=async r=>{let e=r?.[0];if(e==="list")return await ce();if(e==="install")return await le(r?.slice(1));if(e==="uninstall")return await de(r?.slice(1));if(e==="inspect")return await ue(r?.slice(1));if(e==="search")return await pe(r?.slice(1));let n=C(),i=P({renderer:v.ansi(),sink:S.stdout()});return i.writeln(`Usage: ${n} pack <list | install <name> | uninstall <name> | inspect <name> | search <query>>`),await i.close(),$(void 0)},M=async r=>{let e=`${r}/${z}`;try{let n=await m.fs.readTextFile(e);return JSON.parse(n)}catch{return B()}},N=async(r,e)=>{let n=`${r}/${z}`;await m.fs.mkdir(`${r}/.eser`,{recursive:!0}),await m.fs.writeTextFile(n,JSON.stringify(e,null,2)+`
|
|
3
|
+
`)},b=r=>x.get(r),O=r=>{let e=r.replace(/^github:/,"").replace(/^gh:/,""),n=e.indexOf("#");if(n===-1)return null;let i=e.slice(0,n),t=e.slice(n+1),l=i.indexOf("/");if(l===-1)return null;let u=i.slice(0,l),c=i.slice(l+1);return u.length===0||c.length===0||t.length===0?null:{owner:u,repo:c,ref:"main",packPath:t}},W=async r=>{let e=O(r);if(e===null)throw new Error(`Invalid pack specifier: ${r}. Expected format: github:owner/repo#pack-name`);let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.ref}/packs/${e.packPath}/pack.json`,i=await globalThis.fetch(n,{signal:AbortSignal.timeout(D)});if(!i.ok)throw new Error(`Could not fetch pack from ${r}. HTTP ${i.status}`);let t=JSON.parse(await i.text());return U(t)},j=async(r,e)=>{let n=O(r);if(n===null)throw new Error(`Invalid pack specifier: ${r}`);let i=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}/packs/${n.packPath}/${e}`,t=await globalThis.fetch(i,{signal:AbortSignal.timeout(D)});if(!t.ok)throw new Error(`Could not fetch ${e} from ${r}. HTTP ${t.status}`);return await t.text()},Q=async r=>{let e=`${r}/${y.concernsDir}`,n=0;try{for await(let i of m.fs.readDir(e))if(i.isFile&&i.name.endsWith(".json")){let t=i.name.match(/^(\d+)-/);if(t!==null){let l=parseInt(t[1],10);l>n&&(n=l)}}}catch{}return n+1},A=async(r,e,n)=>{let i=[],t=[],l=[],u=`${r}/${y.rulesDir}`;await m.fs.mkdir(u,{recursive:!0});for(let[p,o]of Object.entries(n.ruleContents)){let a=`pack-${e}-${p}.md`;await m.fs.writeTextFile(`${u}/${a}`,o+`
|
|
4
|
+
`),i.push(a)}if(n.concernContents.length>0){let p=`${r}/${y.concernsDir}`;await m.fs.mkdir(p,{recursive:!0});let o=await Q(r);for(let a of n.concernContents){let d=`${String(o).padStart(3,"0")}-${a.id}.json`;await m.fs.writeTextFile(`${p}/${d}`,JSON.stringify(a,null,2)+`
|
|
5
|
+
`),t.push(d),o++}}if(n.folderRuleContents!==void 0)for(let[p,o]of Object.entries(n.folderRuleContents)){let a=`${r}/${p}/.folder-rules.md`;await m.fs.mkdir(`${r}/${p}`,{recursive:!0}),await m.fs.writeTextFile(a,o+`
|
|
6
|
+
`),l.push(`${p}/.folder-rules.md`)}return{name:e,version:n.manifest.version,installedAt:new Date().toISOString(),source:"builtin",rules:i,concerns:t,folderRules:l}},oe=async(r,e,n)=>{let i=n.name,t=[],l=[],u=[],c=`${r}/${y.rulesDir}`;if(await m.fs.mkdir(c,{recursive:!0}),n.rules!==void 0)for(let o of n.rules){let a=await j(e,o),s=o.replace(/^rules\//,"").replace(/\.md$/,""),d=`pack-${i}-${s}.md`;await m.fs.writeTextFile(`${c}/${d}`,a),t.push(d)}if(n.concerns!==void 0&&n.concerns.length>0){let o=`${r}/${y.concernsDir}`;await m.fs.mkdir(o,{recursive:!0});let a=await Q(r);for(let s of n.concerns){let d=await j(e,s),k=JSON.parse(d),q=`${String(a).padStart(3,"0")}-${k.id}.json`;await m.fs.writeTextFile(`${o}/${q}`,d),l.push(q),a++}}if(n.folderRules!==void 0)for(let[o,a]of Object.entries(n.folderRules)){let s=await j(e,a),d=`${r}/${o}/.folder-rules.md`;await m.fs.mkdir(`${r}/${o}`,{recursive:!0}),await m.fs.writeTextFile(d,s),u.push(`${o}/.folder-rules.md`)}return{name:i,version:n.version,installedAt:new Date().toISOString(),source:e,rules:t,concerns:l,folderRules:u}},ce=async()=>{let r=P({renderer:v.ansi(),sink:S.stdout()}),{root:e}=await R(),n=await M(e),i=new Set(n.installed.map(t=>t.name));r.writeln(h("Built-in packs:"));for(let[t,l]of x){let u=Object.keys(l.ruleContents).length,c=l.concernContents.length,p=[];u>0&&p.push(`${u} rules`),c>0&&p.push(`${c} concern${c>1?"s":""}`),r.writeln(" ",h(t.padEnd(16)),f(l.manifest.description),f(` (${p.join(", ")})`))}if(r.writeln(""),r.writeln(h("Installed packs:")),n.installed.length===0)r.writeln(f(" No packs installed."));else for(let t of n.installed){let l=t.installedAt.slice(0,10);r.writeln(" ",i.has(t.name)?F(t.name.padEnd(16)):h(t.name.padEnd(16)),f(`v${t.version}`),f(` (installed ${l})`))}return await r.close(),$(void 0)},le=async r=>{let e=P({renderer:v.ansi(),sink:S.stdout()}),{root:n}=await R(),i=r?.[0];if(i===void 0||i.length===0){let a=C();return e.writeln(w("Please provide a pack name: "),h(`${a} pack install typescript`)),await e.close(),g({exitCode:1})}let t=await M(n),l=i.includes("/")||i.includes(":"),u=l?O(i)?.packPath??i:i;if(t.installed.some(a=>a.name===u))return e.writeln(w(`Pack "${u}" is already installed.`)),e.writeln(f(" Uninstall first to re-install.")),await e.close(),g({exitCode:1});let c;if(l){e.writeln(f(`Fetching pack from ${i}...`));try{let a=await W(i);if(a.requires!==void 0){for(let s of a.requires)if(!t.installed.some(d=>d.name===s)){e.writeln(f(` Installing dependency: ${s}`));let d=b(s);if(d!==void 0){let k=await A(n,s,d);t.installed.push(k)}}}c=await oe(n,i,a)}catch(a){return e.writeln(w(`Failed to install: ${a instanceof Error?a.message:String(a)}`)),await e.close(),g({exitCode:1})}}else{let a=b(i);if(a===void 0)return e.writeln(w(`Unknown pack: ${i}`)),e.writeln(f(` Available built-in packs: ${[...x.keys()].join(", ")}`)),await e.close(),g({exitCode:1});if(a.manifest.requires!==void 0){for(let s of a.manifest.requires)if(!t.installed.some(d=>d.name===s)){e.writeln(f(` Installing dependency: ${s}`));let d=b(s);if(d!==void 0){let k=await A(n,s,d),I=[...t.installed,k];await N(n,{installed:I})}}}c=await A(n,i,a)}let p={installed:[...t.installed,c]};await N(n,p);let o=await T(n);return o!==null&&o.tools.length>0&&(await E(n,o.tools,o),e.writeln(f(" Tool files synced."))),e.writeln(F("\u2714"),` Pack "${c.name}" v${c.version} installed.`),c.rules.length>0&&e.writeln(f(` Rules: ${c.rules.join(", ")}`)),c.concerns.length>0&&e.writeln(f(` Concerns: ${c.concerns.join(", ")}`)),await e.close(),$(void 0)},de=async r=>{let e=P({renderer:v.ansi(),sink:S.stdout()}),{root:n}=await R(),i=r?.[0];if(i===void 0||i.length===0){let s=C();return e.writeln(w("Please provide a pack name: "),h(`${s} pack uninstall typescript`)),await e.close(),g({exitCode:1})}let t=await M(n),l=t.installed.find(s=>s.name===i);if(l===void 0)return e.writeln(w(`Pack "${i}" is not installed.`)),await e.close(),g({exitCode:1});let u=[];for(let s of t.installed){if(s.name===i)continue;let d=b(s.name);d?.manifest.requires!==void 0&&d.manifest.requires.includes(i)&&u.push(s.name)}u.length>0&&e.writeln(w(`Warning: pack "${i}" is required by: ${u.join(", ")}`));let c=`${n}/${y.rulesDir}`;for(let s of l.rules)try{await m.fs.remove(`${c}/${s}`)}catch{}let p=`${n}/${y.concernsDir}`;for(let s of l.concerns)try{await m.fs.remove(`${p}/${s}`)}catch{}for(let s of l.folderRules)try{await m.fs.remove(`${n}/${s}`)}catch{}let o={installed:t.installed.filter(s=>s.name!==i)};await N(n,o);let a=await T(n);return a!==null&&a.tools.length>0&&(await E(n,a.tools,a),e.writeln(f(" Tool files synced."))),e.writeln(F("\u2714"),` Pack "${i}" uninstalled.`),await e.close(),$(void 0)},ue=async r=>{let e=P({renderer:v.ansi(),sink:S.stdout()}),n=r?.[0];if(n===void 0||n.length===0){let s=C();return e.writeln(w("Please provide a pack name: "),h(`${s} pack inspect typescript`)),await e.close(),g({exitCode:1})}let i=n.includes("/")||n.includes(":"),t,l=null,u=null;if(i)try{t=await W(n)}catch(s){return e.writeln(w(`Failed to fetch: ${s instanceof Error?s.message:String(s)}`)),await e.close(),g({exitCode:1})}else{let s=b(n);if(s===void 0)return e.writeln(w(`Unknown pack: ${n}`)),await e.close(),g({exitCode:1});t=s.manifest,l=s.ruleContents,u=s.concernContents}e.writeln(h(`Pack: ${t.name}`),f(` v${t.version}`)),e.writeln(`Description: ${t.description}`),t.author!==void 0&&e.writeln(`Author: ${t.author}`),t.tags!==void 0&&t.tags.length>0&&e.writeln(`Tags: ${t.tags.join(", ")}`),e.writeln("");let c=t.rules?.length??0;if(e.writeln(h(`Rules (${c}):`)),l!==null)for(let[s,d]of Object.entries(l))e.writeln(` - ${s}: `,f(`"${d}"`));else if(t.rules!==void 0)for(let s of t.rules){let d=s.replace(/^rules\//,"").replace(/\.md$/,"");e.writeln(` - ${d}`)}let p=t.concerns?.length??0;if(e.writeln(""),e.writeln(h(`Concerns (${p}):`)),u!==null&&u.length>0)for(let s of u)e.writeln(` - ${s.id}: ${s.name}`),s.acceptanceCriteria.length>0&&e.writeln(f(` ACs: "${s.acceptanceCriteria.join('", "')}"`));else p===0&&e.writeln(f(" none"));let o=t.folderRules!==void 0?Object.keys(t.folderRules).length:0;e.writeln(""),e.writeln(`Folder rules: ${o>0?o:"none"}`);let a=t.requires?.length??0;return e.writeln(`Dependencies: ${a>0?t.requires.join(", "):"none"}`),await e.close(),$(void 0)},pe=async r=>{let e=P({renderer:v.ansi(),sink:S.stdout()}),n=r?.[0]?.toLowerCase();if(n===void 0||n.length===0){let c=C();return e.writeln(w("Please provide a search query: "),h(`${c} pack search typescript`)),await e.close(),g({exitCode:1})}e.writeln(h("Matching packs:"));let i=!1;for(let[c,p]of x){let o=p.manifest.tags??[],a=c.includes(n),s=o.some(k=>k.includes(n)),d=p.manifest.description.toLowerCase().includes(n);(a||s||d)&&(e.writeln(" ",h(c.padEnd(16)),f(p.manifest.description),f(" [builtin]")),i=!0)}let{root:t}=await R(),u=(await T(t))?.packRegistry;if(u!==void 0)try{let c=await globalThis.fetch(u,{signal:AbortSignal.timeout(D)});if(c.ok){let p=JSON.parse(await c.text());for(let o of p.packs){let a=o.tags??[],s=o.name.includes(n),d=a.some(I=>I.includes(n)),k=o.description.toLowerCase().includes(n);(s||d||k)&&(e.writeln(" ",h(o.name.padEnd(16)),f(o.description),f(` [${o.source}]`)),i=!0)}}}catch{}return i||e.writeln(f(` No packs matching "${n}" found.`)),await e.close(),$(void 0)};export{A as installBuiltinPack,oe as installRemotePack,je as main,M as readPacksFile,N as writePacksFile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,
|
|
2
|
+
import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,k as R,p as x}from"./chunk-RUTM4VP7.js";import{a as E}from"./chunk-2XNFZXHY.js";import{a as k,b as C,f as v,o}from"./chunk-5GGWX7CO.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{a as d,b as $}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import{e as j}from"./chunk-5WJ6AUNY.js";var S=j(E(),1);var Y=async e=>{let t=a.process.cwd(),n=D(e),s=C({target:n==="agent"?"non-interactive":"interactive"}),u=P(e).includes("--force");if(!u&&n==="agent")return o.error(s,"Purge requires `--force` flag in agent mode."),$({exitCode:1});if(u)return o.step(s,"Purging noskills content..."),await q(t,s),o.success(s,"Purge complete."),d(void 0);let g=(await N(t)).filter(i=>i.exists);if(g.length===0)return o.info(s,"Nothing to remove."),d(void 0);let p=[];for(let i of g){let y=await v(s,{message:i.message});if(k(y))return o.info(s,"Aborted."),d(void 0);p.push({id:i.id,confirmed:y===!0})}let f=p.filter(i=>i.confirmed),I=p.filter(i=>!i.confirmed);if(f.length===0)return o.info(s,"Nothing selected for removal."),d(void 0);let T=new Set(f.map(i=>i.id)),w=[];for(let i of f)await H(t,i.id)?o.step(s,` Removed ${h(i.id)}`):(w.push(i.id),o.step(s,` Failed to remove ${h(i.id)}`));for(let i of I)o.step(s,` Kept ${h(i.id)}`);T.size>0&&await b(t);let M=f.length-w.length;return o.success(s,`Purge complete (${M} of ${g.length} categories removed).`),d(void 0)},N=async e=>{let[t,n,s,r]=await Promise.all([O(e),L(e),J(e),U(e)]);return[t,n,s,r]},O=async e=>{let t=await x(e),n=t.map(s=>s.id).join(", ");return{id:"concerns",exists:t.length>0,message:`Remove concerns? (${n})`}},L=async e=>{let t=await R(e),n=0;try{for await(let c of a.fs.readDir(`${e}/${l.specsDir}`))c.isDirectory&&n++}catch{}let s=Math.max(t.length,n);if(s===0)return{id:"specs",exists:!1,message:""};let r=t.map(c=>`${c.name} ${c.state.phase}`).join(", ");return{id:"specs",exists:!0,message:t.length>0?`Remove specs? (${s} specs: ${r})`:`Remove specs? (${s} spec directories)`}},J=async e=>{let t=0;try{for await(let n of a.fs.readDir(`${e}/${l.rulesDir}`))n.isFile&&t++}catch{}return{id:"rules",exists:t>0,message:`Remove rules? (${t} active rules)`}},U=async e=>{let t=!1,n=!1,s=!1;try{let c=await a.fs.readTextFile(`${e}/.claude/settings.json`);t=JSON.parse(c).hooks!==void 0}catch{}try{n=(await a.fs.readTextFile(`${e}/CLAUDE.md`)).includes("<!-- noskills:start -->")}catch{}let r=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let c of r)try{await a.fs.stat(c),s=!0;break}catch{}return{id:"agent-integration",exists:t||n||s,message:"Remove agent integration? (.claude/settings.json, CLAUDE.md, .claude/agents/noskills-*.md)"}},h=e=>({concerns:"concerns",specs:"specs",rules:"rules","agent-integration":"agent integration"})[e],H=(e,t)=>{switch(t){case"concerns":return m(`${e}/${l.concernsDir}`);case"specs":return z([`${e}/${l.specsDir}`,`${e}/${l.stateDir}`]);case"rules":return m(`${e}/${l.rulesDir}`);case"agent-integration":return A(e)}},q=async(e,t)=>{await m(`${e}/${l.concernsDir}`)&&o.step(t," Removed `.eser/concerns/`"),await m(`${e}/${l.specsDir}`)&&o.step(t," Removed `.eser/specs/`"),await m(`${e}/${l.rulesDir}`)&&o.step(t," Removed `.eser/rules/`"),await m(`${e}/${l.stateDir}`)&&o.step(t," Removed `.eser/.state/`"),await b(e)&&o.step(t," Removed noskills section from `manifest.yml`"),await A(e)&&o.step(t," Removed agent integration")},m=async e=>{try{await a.fs.stat(e);let{rmSync:t}=await import("node:fs");return t(e,{recursive:!0,force:!0}),!0}catch{return!1}},z=async e=>{let t=!1;for(let n of e)await m(n)&&(t=!0);return t},F=async e=>{try{await a.fs.stat(e);let{unlinkSync:t}=await import("node:fs");return t(e),!0}catch{return!1}},b=async e=>{let t=`${e}/${l.manifestFile}`;try{let n=await a.fs.readTextFile(t),s=S.parseDocument(n);return s.has("noskills")?(s.delete("noskills"),await a.fs.writeTextFile(t,s.toString()),!0):!1}catch{return!1}},B=async e=>{let t=`${e}/CLAUDE.md`,n="<!-- noskills:start -->",s="<!-- noskills:end -->";try{let r=await a.fs.readTextFile(t),u=r.indexOf(n),c=r.indexOf(s);return u!==-1&&c!==-1?(r=r.slice(0,u).trimEnd()+`
|
|
3
3
|
`+r.slice(c+s.length).trimStart(),await a.fs.writeTextFile(t,r.trimEnd()+`
|
|
4
4
|
`),!0):!1}catch{return!1}},K=async e=>{let t=`${e}/.claude/settings.json`;try{let n=await a.fs.readTextFile(t),s=JSON.parse(n);return s.hooks!==void 0?(delete s.hooks,await a.fs.writeTextFile(t,JSON.stringify(s,null,2)+`
|
|
5
5
|
`),!0):!1}catch{return!1}},A=async e=>{let t=!1;await K(e)&&(t=!0),await B(e)&&(t=!0);let n=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let r of n)await F(r)&&(t=!0);let s=[`${e}/.cursorrules`,`${e}/.windsurfrules`,`${e}/.kiro/steering/conventions.md`,`${e}/.github/copilot-instructions.md`];for(let r of s)await F(r)&&(t=!0);return t};export{Y as main};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as c}from"./chunk-
|
|
2
|
+
import{a as c}from"./chunk-UTENCUNI.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as g}from"./chunk-LFNUSULJ.js";import{a as R,c as f}from"./chunk-PZUDTTK4.js";import{f as w,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{f as m}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{d as a}from"./chunk-VKB3B2FE.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:n,output:A}=R(),x=async()=>(await a`git status --porcelain`.noThrow().text()).length===0,E=async()=>{let e=await a`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
|
|
3
3
|
`):[]},$=async(e,r)=>{for(let s of r)await a`git add ${s}`.spawn();await a`git commit -m ${e}`.spawn()},P=async()=>{await a`git push origin HEAD`.spawn()},b=async e=>{await a`git tag -d ${e}`.noThrow().spawn();let r=`:refs/tags/${e}`;await a`git push origin ${r}`.noThrow().spawn()},O=async e=>await w(n,{message:e})===!0,k=async e=>{let{type:r,dryRun:s=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit or stash changes first.");let o=await E();if(o.length>0&&e.yes!==!0)throw new Error(`You have ${o.length} unpushed commit(s):
|
|
4
4
|
${o.join(`
|
|
5
5
|
`)}
|
|
6
6
|
|
|
7
|
-
Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-
|
|
7
|
+
Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-VGXMC5GM.js")).versions(r,{dryRun:s});let u=await c()??l,d=!1;try{await(await import("./changelog-gen-JTU6WIYA.js")).generateChangelog({dryRun:s}),d=!0}catch{d=!1}let h=!1,v=!1;if(!s){d&&await a`deno fmt CHANGELOG.md`.noThrow().spawn();let y=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],C=`chore(codebase): release v${u}`;await $(C,y),h=!0,await P(),v=!0}return{version:u,previousVersion:l,changelogGenerated:d,committed:h,pushed:v,dryRun:s}},M=async(e={})=>{let{dryRun:r=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit and push first.");let s=await E();if(s.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
|
|
8
8
|
${s.join(`
|
|
9
9
|
`)}`);let o=await c();if(o===void 0||!/^\d+\.\d+\.\d+$/.test(o))throw new Error(`Invalid or missing version in VERSION file: "${o}"`);let l=`v${o}`;if(!r){let u=`chore(codebase): release v${o}`;await a`git commit --allow-empty -m ${u}`.spawn(),await a`git push origin HEAD`.spawn()}return{version:o,tag:l,dryRun:r}},T=async(e={})=>{let r=await c();if(r===void 0||!/^\d+\.\d+\.\d+$/.test(r))throw new Error(`Invalid or missing version in VERSION file: "${r}"`);let s=`v${r}`;if(e.yes!==!0)throw new Error(`This will delete tag ${s} locally and remotely. Re-run with --yes to confirm.`);return await b(s),{version:r,tag:s,deleted:!0}},U=e=>m.fromPromise(()=>k(e)),H=e=>m.fromPromise(()=>M(e)),I=e=>m.fromPromise(()=>T(e)),V=e=>{let r=e.args[0];return r===void 0||!["patch","minor","major","same"].includes(r)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:r,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},j=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),N=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?(t.warn(n,"[DRY RUN] Release preview:"),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"generated":"no user-facing changes"}`),t.info(n," No changes were made.")):(t.success(n,`Released v${r.version}`),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"updated":"no user-facing changes"}`),t.info(n,` Committed: ${r.committed}`),t.info(n,` Pushed: ${r.pushed}`),t.info(n," CI will validate, tag, and publish."),t.info(n," Watch: https://github.com/eser/stack/actions")),i.ok(void 0)},D=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?t.warn(n,`[DRY RUN] Would delete and recreate tag ${r.tag}`):(t.success(n,`Re-tagged ${r.tag}`),t.info(n,"CI will validate and publish.")),i.ok(void 0)},S=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.deleted&&t.success(n,`Deleted tag v${r.version} (local + remote).`),i.ok(void 0)},F=g.createTrigger({handler:U,adaptInput:V,adaptOutput:N}),W=g.createTrigger({handler:H,adaptInput:j,adaptOutput:D}),Y=g.createTrigger({handler:I,adaptInput:G,adaptOutput:S}),ee=async e=>{let r=p(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),s=r._[0],o=r["dry-run"]===!0,l=r.yes===!0;if(s!==void 0&&!o&&!l&&["patch","minor","major","same"].includes(s)){let d=await c()??"0.0.0";if(t.info(n,`Current version: ${d}`),t.info(n,`Bump type: ${s}`),t.info(n,"This will bump version, generate changelog, commit, and push."),await A.flush(),!await O("Proceed?"))return t.warn(n,"Aborted."),i.ok(void 0);r.yes=!0}let u=f("release",r);return await F(u)},re=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=f("rerelease",r);return await W(s)},se=async e=>{let r=p(e??[],{boolean:["yes"],alias:{y:"yes"}}),s=f("unrelease",r);return await Y(s)};export{F as handleReleaseCli,W as handleRereleaseCli,Y as handleUnreleaseCli,ee as main,k as release,U as releaseHandler,M as rerelease,H as rereleaseHandler,re as rereleaseMain,T as unrelease,I as unreleaseHandler,se as unreleaseMain};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-
|
|
2
|
+
import"./chunk-SOSF762G.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as C,c as P}from"./chunk-PZUDTTK4.js";import{o as u}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 w}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as p}from"./chunk-VKB3B2FE.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import{a as v}from"./chunk-MG65QJY6.js";import{g as l}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{j as x,n as R}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as c}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:h,output:Y}=C(),E=/^##\s{1,100}\[?([^\]\s]+)\]?\s{0,100}-?\s{0,100}([0-9]{4}-[0-9]{2}-[0-9]{2})?\s{0,100}$/,A=t=>{let e=t.trim().replace(/^refs\/tags\//,"");return e.startsWith("v")?e:`v${e}`},N=t=>{let e=t.split(/\r?\n/),n=[];for(let s=0;s<e.length;s+=1){let i=e[s].match(E);i!==null&&/^\d/.test(i[1])&&n.push({version:i[1],date:i[2]??"",headingLineIndex:s})}return n.length===0?[]:n.map((s,o)=>{let i=n[o+1],g=s.headingLineIndex+1,a=i!==void 0?i.headingLineIndex:e.length,r=e.slice(g,a);for(;r.length>0&&r[0].trim()==="";)r.shift();for(;r.length>0&&r[r.length-1].trim()==="";)r.pop();let d=[`## ${s.version}${s.date!==""?` - ${s.date}`:""}`];return r.length>0&&d.push("",...r),{version:s.version,date:s.date,tag:`v${s.version}`,notes:`${d.join(`
|
|
3
3
|
`).trim()}
|
|
4
4
|
`}})},T=async(t={})=>{let{changelogPath:e="CHANGELOG.md",root:n="."}=t,s=R(n,e),o=await c.runtime.fs.readTextFile(s);return{entries:N(o)}},O=async(t,e)=>{try{return await p.exec`gh release view ${t} --repo ${e}`.quiet().text(),!0}catch{return!1}},k=async t=>{let{repo:e,createIfMissing:n=!1,changelogPath:s="CHANGELOG.md",root:o=".",releaseTitle:i="eserstack {tag}"}=t,{entries:g}=await T({changelogPath:s,root:o});if(g.length===0)throw new Error("No release headings found in CHANGELOG.md.");let a=t.tag!==void 0?A(t.tag):g[0].tag,r=g.find(y=>y.tag===a);if(r===void 0)throw new Error(`No matching changelog section found for ${a}.`);let d=await c.runtime.fs.makeTempDir({prefix:"eserstack-release-"}),f=x(d,`${a}-notes.md`);await c.runtime.fs.writeTextFile(f,r.notes);try{if(await O(a,e))return await p.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"updated"};if(!n)return{tag:a,entry:r,action:"skipped"};let $=i.replace("{tag}",a);try{return await p.exec`gh release create ${a} --repo ${e} --title ${$} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"created"}}catch{return await p.exec`gh release edit ${a} --repo ${e} --notes-file ${f}`.spawn(),{tag:a,entry:r,action:"updated"}}}finally{await c.runtime.fs.remove(d,{recursive:!0})}},I=t=>w.fromPromise(()=>k(t)),S=t=>{let e=t.flags.repo??c.runtime.env.get("GITHUB_REPOSITORY")??"";return e===""?l.fail(m.adaptError("Missing repository. Pass --repo or set GITHUB_REPOSITORY.")):l.ok({repo:e,tag:t.flags.tag??void 0,createIfMissing:t.flags["create-if-missing"]===!0})},b=t=>{if(l.isFail(t)){let n=t.error,s=n instanceof Error?n.message:n.message??String(n);return u.error(h,s),l.fail({exitCode:1})}let{value:e}=t;switch(e.action){case"created":u.success(h,`Created release ${e.tag} with changelog notes.`);break;case"updated":u.success(h,`Updated release notes for ${e.tag}.`);break;case"skipped":u.warn(h,`Release ${e.tag} not found. Skipping (pass --create-if-missing to create).`);break}return l.ok(void 0)},G=m.createTrigger({handler:I,adaptInput:S,adaptOutput:b}),q=async t=>{let e=v(t??[],{string:["repo","tag"],boolean:["create-if-missing"],alias:{h:"help"}}),n=P("release-notes",e);return await G(n)};export{G as handleCli,O as hasGitHubRelease,q as main,A as normalizeTag,T as parseChangelog,N as parseChangelogText,k as syncReleaseNotes,I as syncReleaseNotesHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c,d as f}from"./chunk-
|
|
2
|
+
import{c,d as f}from"./chunk-FVXGVHUR.js";import{a as R}from"./chunk-UTENCUNI.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as d,c as p}from"./chunk-PZUDTTK4.js";import{o as n}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 u}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as g}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:i,output:N}=d(),P=async(e={})=>{let{root:r=".",remote:s="origin",tagPrefix:h="v",messageTemplate:y="Release {tag}",dryRun:l=!1}=e,t=await R({root:r});if(t===void 0||!/^\d+\.\d+\.\d+$/.test(t))throw new Error(`Invalid or missing version in VERSION file: "${t}"`);let o=`${h}${t}`,v=y.replace("{tag}",o).replace("{version}",t);return l||(await c(o,v),await f(s,o)),{version:t,tag:o,remote:s,dryRun:l}},T=e=>u.fromPromise(()=>P(e)),C=e=>a.ok({dryRun:e.flags["dry-run"]===!0}),x=e=>{if(a.isFail(e)){let s=e.error instanceof Error?e.error.message:String(e.error);return n.error(i,s),a.fail({exitCode:1})}let{value:r}=e;return r.dryRun?n.warn(i,`[DRY RUN] Would create and push tag ${r.tag}`):(n.success(i,`Created tag ${r.tag}`),n.info(i,`Pushed tag ${r.tag} to ${r.remote}`)),a.ok(void 0)},A=m.createTrigger({handler:T,adaptInput:C,adaptOutput:x}),S=async e=>{let r=g(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=p("release-tag",r);return await A(s)};export{A as handleCli,S as main,P as pushReleaseTag,T as pushReleaseTagHandler};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{h as E}from"./chunk-L32KHQVT.js";import{q as y,s as C}from"./chunk-OXP2FOO5.js";import{B as g,e as w,g as f,h,j as S}from"./chunk-RUTM4VP7.js";import"./chunk-2XNFZXHY.js";import{f as m,h as d,k as u}from"./chunk-SHN5MT56.js";import{d as c,f as n,g as l}from"./chunk-YVN2NZL4.js";import{a as p,b as a}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var M=async v=>{let e=m({renderer:u.ansi(),sink:d.stdout()}),{root:r}=await g(),i=f(v);if(!i.ok)return e.writeln(n(i.error)),await e.close(),a({exitCode:1});let t;try{t=await w(r,i.spec)}catch(o){let x=o instanceof Error?o.message:String(o);return e.writeln(n(x)),await e.close(),a({exitCode:1})}if(t.phase!=="COMPLETED")return e.writeln(n(`Cannot reopen in phase: ${t.phase}`)),e.writeln(c("Only COMPLETED specs can be reopened.")),await e.close(),a({exitCode:1});let k=await E(r),s=y(t);return s=C(s,"COMPLETED","DISCOVERY",k,"reopened"),await h(r,s),s.spec!==null&&await S(r,s.spec,s),e.writeln(l("\u2714")," Spec reopened. Discovery answers preserved \u2014 run `noskills next` to revise."),await e.close(),p(void 0)};export{M as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{C as v}from"./chunk-OXP2FOO5.js";import{B as I,c as h,e as g,g as y,h as S,j as k}from"./chunk-RUTM4VP7.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-SHN5MT56.js";import{d as a,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as l}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var F=async A=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),{root:i}=await I(),o=y(A);if(!o.ok)return e.writeln(n(o.error)),await e.close(),l({exitCode:1});let s;try{s=await g(i,o.spec)}catch(r){let R=r instanceof Error?r.message:String(r);return e.writeln(n(R)),await e.close(),l({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${i}/${h.specDir(s.spec)}`;try{await m.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(a("Resetting to idle anyway."))}}let t=s.spec,p=v(s);return await S(i,p),t!==null&&await k(i,t,p),e.writeln(d("\u2714")," Reset to idle."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{F as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as T}from"./chunk-6F4PFXYY.js";import"./chunk-IUORSUN6.js";import{a as M}from"./chunk-YWSOQJ7G.js";import{h as P}from"./chunk-L32KHQVT.js";import{A as D}from"./chunk-OXP2FOO5.js";import{B as C,e as x,g as E,j as b,l as k,p as A}from"./chunk-RUTM4VP7.js";import"./chunk-2XNFZXHY.js";import{f as I,h as S,k as $}from"./chunk-SHN5MT56.js";import{c as q,d as c,f as d,g as p,h as v}from"./chunk-YVN2NZL4.js";import{a as w,b as g}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var J=async f=>{let t=I({renderer:$.ansi(),sink:S.stdout()}),{root:r}=await C(),i=E(f);if(!i.ok)return t.writeln(d(i.error)),await t.close(),g({exitCode:1});let u;try{u=await x(r,i.spec)}catch(e){let s=e instanceof Error?e.message:String(e);return t.writeln(d(s)),await t.close(),g({exitCode:1})}let o=await P(r),h=u.discovery.delegations??[],n=h.filter(e=>e.delegatedTo===o.name&&e.status==="pending"),l=h.filter(e=>e.delegatedTo===o.name&&e.status==="answered");if(n.length===0&&l.length===0)return t.writeln(c("No delegations for you on this spec.")),await t.close(),w(void 0);let N=await A(r),R=await k(r),W=N.filter(e=>R?.concerns.includes(e.id)??!1),F=T(W),y=new Map(F.map(e=>[e.id,e.text]));if(t.writeln(q(`Spec: ${i.spec}`)),t.writeln(""),n.length>0){t.writeln(v(`You have ${n.length} pending delegation(s):`)),t.writeln("");for(let e=0;e<n.length;e++){let s=n[e],Q=y.get(s.questionId)??s.questionId;t.writeln(` ${e+1}. `,d("[PENDING]"),` ${Q}`),t.writeln(c(` Delegated by: ${s.delegatedBy} (${s.delegatedAt.slice(0,10)})`))}}if(l.length>0){t.writeln(""),t.writeln(p(`${l.length} answered delegation(s):`));for(let e of l){let s=y.get(e.questionId)??e.questionId;t.writeln(" ",p("\u2714"),` ${s}`),t.writeln(c(` Answer: ${e.answer?.slice(0,80)??""}`))}}let m=null,a=null;for(let e of f??[])e.startsWith("--answer=")&&(m=e.slice(9)),e.startsWith("--question=")&&(a=parseInt(e.slice(11),10)-1);if(m!==null&&a!==null&&a>=0&&a<n.length){let e=n[a],s=D(u,e.questionId,m,o.name);await b(r,i.spec,s),await M(r,{ts:new Date().toISOString(),type:"delegation-answered",spec:i.spec,user:o.name,question:e.questionId}),t.writeln(""),t.writeln(p("\u2714"),` Answered: ${e.questionId}`)}return await t.close(),w(void 0)};export{J as main};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as A,f as C}from"./chunk-5QUEAV4O.js";import{B as x,c as k,l as R}from"./chunk-RUTM4VP7.js";import{b as T,c as P}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as p,h as d,k as u}from"./chunk-SHN5MT56.js";import{c as y,d as a,f as j,g as v}from"./chunk-YVN2NZL4.js";import{a as h,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 B=async e=>{let s=e?.[0];if(s==="add")return await b(e?.slice(1));if(s==="list")return await W();if(s==="promote")return await U(e?.slice(1));let i=T(),t=p({renderer:u.ansi(),sink:d.stdout()});return t.writeln(`Usage: ${i} rule <add "rule text" | list | promote "decision">`),await t.close(),h(void 0)},b=async e=>{let s=p({renderer:u.ansi(),sink:d.stdout()}),{root:i}=await x(),t=[],r=[],n=[];if(e!==void 0)for(let o of e)o.startsWith("--phases=")?t=o.slice(9).split(",").map(g=>g.trim()):o.startsWith("--applies-to=")?r=o.slice(13).split(",").map(g=>g.trim().replace(/^["']|["']$/g,"")):o.startsWith("-")||n.push(o);let c=n.join(" "),m=await R(i);if(c.length===0)return s.writeln(j("Please provide a rule: "),y(`${P('rule add "Use Deno Tests for all tests"')}`)),await s.close(),w({exitCode:1});let D=c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),l="";(t.length>0||r.length>0)&&(l+=`---
|
|
3
|
+
`,t.length>0&&(l+=`phases: [${t.join(", ")}]
|
|
4
|
+
`),r.length>0&&(l+=`applies_to: [${r.map(o=>`"${o}"`).join(", ")}]
|
|
5
|
+
`),l+=`---
|
|
6
|
+
`),l+=c+`
|
|
7
|
+
`;let E=`${i}/${k.rulesDir}/${D}.md`;await $.fs.mkdir(`${i}/${k.rulesDir}`,{recursive:!0}),await $.fs.writeTextFile(E,l);let f=[];t.length>0&&f.push(t.join(", ")),r.length>0&&f.push(r.join(", "));let L=f.length>0?` [${f.join("; ")}]`:"";return s.writeln(v("\u2714")," Rule added: ",a(c),a(L)),m!==null&&m.tools.length>0&&(await C(i,m.tools,m),s.writeln(a(" Tool files synced."))),await s.close(),h(void 0)},W=async()=>{let e=p({renderer:u.ansi(),sink:d.stdout()}),{root:s}=await x(),i=await A(s);if(e.writeln(y("Rules")),e.writeln(""),i.length===0)e.writeln(a(` No rules yet. Add one with: ${P('rule add "..."')}`));else for(let t=0;t<i.length;t++){let r=i[t],n=[];r.phases!==void 0&&r.phases.length>0?n.push(r.phases.join(", ")):n.push("all phases"),r.appliesTo!==void 0&&r.appliesTo.length>0?n.push(r.appliesTo.join(", ")):n.push("all files"),e.writeln(` ${t+1}. ${r.text} `,a(`[${n.join(", ")}]`))}return await e.close(),h(void 0)},U=async e=>{let s=p({renderer:u.ansi(),sink:d.stdout()}),i=e?.join(" ");return i===void 0||i.length===0?(s.writeln(j("Please provide the decision text to promote.")),await s.close(),w({exitCode:1})):(await s.close(),await b(e))};export{B as main};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as B}from"./chunk-NQS27P25.js";import"./chunk-6F4PFXYY.js";import"./chunk-IUORSUN6.js";import{b as W,e as X}from"./chunk-5QUEAV4O.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{a as j,m as _}from"./chunk-OXP2FOO5.js";import{A as L,B as M,d as g,e as F,f as N,h as $,l as U,p as G}from"./chunk-RUTM4VP7.js";import{b as E,c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as T,b as D,g as A}from"./chunk-5GGWX7CO.js";import{f as I,h as R,k as O}from"./chunk-SHN5MT56.js";import{c as y,d as o,f as l,g as v,h,k as P}from"./chunk-YVN2NZL4.js";import{a as S,b as w}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var pe=async t=>{let e=I({renderer:O.ansi(),sink:R.stdout()}),{root:i}=await M(),n=t?.includes("--unattended")??!1,r=z(t,"--max-turns")??10,p=z(t,"--max-iterations")??50;if(!await L(i))return e.writeln(l(`noskills not initialized. Run: ${V("init")}`)),await e.close(),w({exitCode:1});let x=N(t),c=await F(i,x);if(c.phase!=="EXECUTING"&&c.phase!=="SPEC_APPROVED")return e.writeln(l(`Cannot run from phase: ${c.phase}`)),e.writeln(o("Must be in SPEC_APPROVED or EXECUTING to start.")),await e.close(),w({exitCode:1});if(c.phase==="SPEC_APPROVED"){e.writeln(o("Starting execution from approved spec..."));let s=_(c);await $(i,s)}let u=await U(i);if(u===null)return e.writeln(l("Config not found.")),await e.close(),w({exitCode:1});e.writeln(y(`${E()} run`)),e.writeln(o(`Mode: ${n?"unattended":"interactive"}, max-turns: ${r}, max-iterations: ${p}`)),e.writeln("");let m=0,d=0;for(;m<p;){m++;let s=await g(i);if(s.phase==="COMPLETED"){e.writeln(""),e.writeln(v("\u2714")," Spec completed!"),e.writeln(` Iterations: ${s.execution.iteration}`),e.writeln(` Decisions: ${s.decisions.length}`);break}if(s.phase==="BLOCKED"){let a=s.execution.lastProgress??"Unknown";if(e.writeln(""),e.writeln(h("\u26A0")," Execution blocked: ",o(a)),n){await Z(i,a,m),e.writeln(o("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let C=D(),f=await A(C,{message:"Enter resolution (or leave empty to stop):"});if(T(f)||f===""){e.writeln(o("Stopped by user."));break}let k=j(s,"EXECUTING");await $(i,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(s.phase!=="EXECUTING"){e.writeln(l(`Unexpected phase: ${s.phase}. Stopping.`)),d=1;break}let H=(await G(i)).filter(a=>u.concerns.includes(a.id)),q=await W(i),K=X(u.tools),J=await B(s,H,q,u,void 0,void 0,void 0,K),Q=Y(J);e.writeln(P(`\u2500\u2500 Iteration ${m}`),o(` (execution: ${s.execution.iteration}, debt: ${s.execution.debt?.items.length??0})`)),s.execution.lastProgress!==null&&e.writeln(o(` Last: ${s.execution.lastProgress}`)),s.execution.lastVerification?.passed===!1&&e.writeln(l(" Verification failed \u2014 agent will fix")),s.execution.debt!==null&&e.writeln(h(` Debt: ${s.execution.debt.items.length} items`)),e.writeln(o(" Spawning agent..."));try{await(await import("./mod-D5IDWU35.js")).exec`claude -p ${Q} --max-turns ${String(r)} --output-format json`.noThrow().text()}catch{e.writeln(l(" Failed to spawn claude CLI. Is it installed?")),d=1;break}e.writeln(o(" Agent exited. Stop hook captured state."));let b=await g(i);if(u.autoCommit===!0&&u.allowGit!==!1)try{let a=await import("./mod-D5IDWU35.js");if((await a.exec`git diff --name-only`.noThrow().text()).trim().length>0){await a.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await a.exec`git commit -m ${f}`.noThrow().text(),e.writeln(o(" Auto-committed."))}}catch{e.writeln(o(" Auto-commit failed (non-fatal)."))}}return m>=p&&(e.writeln(""),e.writeln(h("\u26A0"),` Max iterations (${p}) reached. Stopping.`),d=2),await e.close(),d!==0?w({exitCode:d}):S(void 0)},Y=t=>{let e=[];if(e.push(t.meta.resumeHint),e.push(""),t.meta.spec!==null&&(e.push(`Working on spec: ${t.meta.spec}`),e.push("")),"instruction"in t&&(e.push(t.instruction),e.push("")),"previousIterationDebt"in t){let n=t.previousIterationDebt;if(n!==void 0){e.push(`DEBT from iteration ${n.fromIteration} (address first):`);for(let r of n.items)e.push(`- ${r}`);e.push("")}}if("statusReportRequired"in t){let n=t.statusReport;if(n!==void 0){e.push("Report against these acceptance criteria:");for(let r of n.criteria)e.push(`- ${r}`);e.push("")}}if("verificationFailed"in t&&t.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in t?t.verificationOutput:"")??""),e.push("")),t.behavioral.rules.length>0){e.push("Rules:");for(let n of t.behavioral.rules)e.push(`- ${n}`);e.push("")}if("context"in t){let n=t.context;if(n.concernReminders.length>0){e.push("Reminders:");for(let r of n.concernReminders)e.push(`- ${r}`);e.push("")}}let i=E();return e.push(`When done, report progress: ${i} next --answer="your progress"`),e.push(`If blocked, run: ${i} block "reason"`),e.push(`When all tasks are complete: ${i} done`),e.join(`
|
|
3
|
+
`)},z=(t,e)=>{if(t===void 0)return null;let i=`${e}=`;for(let n of t)if(n.startsWith(i)){let r=parseInt(n.slice(i.length),10);if(!isNaN(r)&&r>0)return r}return null},Z=async(t,e,i)=>{let n=`${t}/.eser/.state/blocked.log`,r=`[${new Date().toISOString()}] iteration=${i} reason=${e}
|
|
4
|
+
`;try{let{appendFileSync:p,mkdirSync:x}=await import("node:fs"),{dirname:c}=await import("node:path");x(c(n),{recursive:!0}),p(n,r)}catch{}};export{pe as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as V,b as q,c as z}from"./chunk-
|
|
2
|
+
import{a as V,b as q,c as z}from"./chunk-DTDUHDLM.js";import"./chunk-4X4NHXFE.js";import"./chunk-2XNFZXHY.js";import{a as A,c as J,d as k,e as L}from"./chunk-P2MUEKFT.js";import{f as N,h as U,k as B}from"./chunk-SHN5MT56.js";import{f as x,g as C,h as F}from"./chunk-YVN2NZL4.js";import{d as H}from"./chunk-VKB3B2FE.js";import{a as I}from"./chunk-MG65QJY6.js";import{a as W,b as c,c as P,d as S}from"./chunk-FFWPJP7A.js";import{i as _}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var O=s=>({_tag:"WorkflowError",message:s}),Z=s=>{if(typeof s=="string")return{name:s,options:{},continueOnError:!1};let o=Object.entries(s);if(o.length!==1)throw new Error(`Invalid step config: expected exactly one key, got ${o.length}`);let[e,n]=o[0],r={},i=!1,l;for(let[a,t]of Object.entries(n))a==="continueOnError"?i=t===!0:a==="timeout"?l=t*1e3:r[a]=t;return{name:e,options:r,continueOnError:i,timeout:l}},ee=(s,o,e)=>L(J(s,n=>O(n instanceof Error?n.message:String(n))),o,O(`Step '${e}' timed out after ${(o/1e3).toFixed(0)}s`)),G=(s,o,e={})=>A(async()=>{let n=performance.now(),r=[],i=e.defaultTimeout??6e4;for(let a of s.steps){let t=Z(a);if(e.only!==void 0&&t.name!==e.only)continue;let T=o.get(t.name);if(T===void 0)return c(O(`Unknown tool '${t.name}' in workflow '${s.id}'. Registered tools: ${o.names().join(", ")||"(none)"}`));let v={...t.options,root:e.root??".",fix:e.fix??!1,_args:e.args??[]};e.changedFiles!==void 0&&(v._changedFiles=e.changedFiles),e.onStepStart?.(t.name);let g=performance.now(),j=t.timeout??i,h=ee(()=>T.run(v),j,t.name),p=await k(h),d;if(P(p))d=p.value;else if(t.continueOnError)d={name:t.name,passed:!1,issues:[{message:p.error.message}],mutations:[],stats:{}};else return p;let b=performance.now()-g,y={...d,durationMs:b};r.push(y),d.mutations.length>0&&e.onMutations!==void 0&&await e.onMutations(d.mutations),e.onStepEnd?.(y)}let l=performance.now()-n;return W({workflowId:s.id,passed:r.every(a=>a.passed),steps:r,totalDurationMs:l})}),D=(s,o,e=new Set)=>{if(s.includes===void 0||s.includes.length===0)return s;let n=new Set(e);n.add(s.id);let r=[];for(let i of s.includes){if(n.has(i))throw new Error(`Circular include detected: workflow '${s.id}' includes '${i}' which is already in the include chain: ${[...n].join(" \u2192 ")}`);let l=o.find(t=>t.id===i);if(l===void 0)throw new Error(`Workflow '${s.id}' includes '${i}' but no workflow with that id exists. Available: ${o.map(t=>t.id).join(", ")||"(none)"}`);let a=D(l,o,n);r.push(...a.steps)}return{...s,steps:[...r,...s.steps],includes:void 0}},K=(s,o,e,n={})=>A(async()=>{let r=o.workflows.find(l=>l.id===s);if(r===void 0)return c(O(`Workflow '${s}' not found. Available: ${o.workflows.map(l=>l.id).join(", ")||"(none)"}`));let i=D(r,o.workflows);return await k(G(i,e,n))}),Q=(s,o,e,n={})=>A(async()=>{let r=o.filter(l=>l.on.includes(s));if(r.length===0)return c(O(`No workflows found for event '${s}'. Available: ${o.map(l=>`${l.id} (${l.on.join(", ")})`).join("; ")||"(none)"}`));let i=[];for(let l of r){let a=D(l,o),t=await k(G(a,e,n));if(S(t))return t;i.push(t.value)}return W(i)});var oe=50,$=B.ansi(),se=(s,o,e)=>{let n=".".repeat(Math.max(1,oe-s.length)),r=`${(o.durationMs/1e3).toFixed(1)}s`,i;if(o.passed&&o.mutations.length>0)i=$.render([F(`Fixed (${o.mutations.length} file${o.mutations.length===1?"":"s"}, ${r})`)]);else if(o.passed)if(e&&Object.keys(o.stats).length>0){let l=Object.entries(o.stats).map(([a,t])=>`${t} ${a}`).join(", ");i=$.render([C(`Passed (${l}, ${r})`)])}else i=$.render([C(`Passed (${r})`)]);else i=$.render([x(`Failed (${r})`)]);return`${s}${n}${i}`},pe=async(s,o)=>{let e=I(s??[],{string:["event","workflow","only","config"],boolean:["fix","dry-run","help","verbose","json","changed"],alias:{e:"event",w:"workflow",h:"help",v:"verbose"}});if(e.help)return console.log(`eser workflows run \u2014 Run workflow pipelines
|
|
3
3
|
`),console.log("Usage:"),console.log(" eser workflows run -e <event> Run by event"),console.log(" eser workflows run -w <workflow-id> Run by workflow id"),console.log(),console.log("Options:"),console.log(" -e, --event <name> Event to trigger (precommit, commitmsg, prepush)"),console.log(" -w, --workflow <id> Workflow id to run"),console.log(" --fix Auto-fix issues where supported"),console.log(" --dry-run Preview mutations without writing"),console.log(" --only <step> Run only a specific step"),console.log(" --config <path> Config directory (default: .)"),console.log(" -v, --verbose Show stats and issues for all steps"),console.log(" --json Output results as JSON"),console.log(" --changed Only check files changed in git"),console.log(" -h, --help Show this help"),W(void 0);let n=N({renderer:$,sink:U.stdout()}),r=e.event,i=e.workflow,l=e.fix??!1,a=e["dry-run"]??!1,t=e.only,T=e._,v=e.verbose??!1,g=e.json??!1,j=e.changed??!1;if(r===void 0&&i===void 0)return console.error("Error: specify -e <event> or -w <workflow-id>. Use --help for usage."),await n.close(),c({exitCode:1});let h=V();h.register(z),o?.tools!==void 0&&h.registerAll(o.tools);let p=e.config??".",d=await q(p);if(d===null)return console.error("Error: no .eser/manifest.yml found in current directory."),await n.close(),c({exitCode:1});let b;if(j)try{b=await H`git diff --name-only HEAD`.cwd(p).noThrow().lines()}catch{n.writeln(F("Warning: could not run git, running without file filtering."))}let y=[],M={root:p,fix:l,dryRun:a,only:t,args:T,changedFiles:b,onStepStart:void 0,onStepEnd:g?void 0:f=>{if(console.log(se(f.name,f,v)),!f.passed||v)for(let u of f.issues){let R=u.path!==void 0?u.line!==void 0?`${u.path}:${u.line}`:u.path:"";console.log(` ${$.render([x("\u2717")])} ${R}${R.length>0?": ":""}${u.message}`)}},onMutations:async f=>{if(!a)for(let u of f)u.oldContent!==u.newContent&&await _.fs.writeTextFile(u.path,u.newContent)}};try{let f=!0,u=0,R=0;if(r!==void 0){let w=await k(Q(r,d.workflows,h,M));if(S(w))throw new Error(w.error.message);for(let m of w.value){y.push(m),m.passed||(f=!1);for(let E of m.steps)E.passed||(R++,u+=E.issues.length)}}else{let w=await k(K(i,d,h,M));if(S(w))throw new Error(w.error.message);let m=w.value;y.push(m),f=m.passed;for(let E of m.steps)E.passed||(R++,u+=E.issues.length)}return g&&console.log(JSON.stringify(y,null,2)),f?(g||n.writeln(C(`
|
|
4
4
|
All checks passed!`)),await n.close(),W(void 0)):(g||n.writeln(x(`
|
|
5
5
|
${R} check(s) failed with ${u} issue(s)`)),await n.close(),c({exitCode:1}))}catch(f){return n.writeln(x(`Error: ${f instanceof Error?f.message:String(f)}`)),await n.close(),c({exitCode:1})}};export{pe as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as w,h as g,k as y}from"./chunk-SHN5MT56.js";import{b as m,d as p,f as C}from"./chunk-YVN2NZL4.js";import{b as x}from"./chunk-
|
|
2
|
+
import{f as w,h as g,k as y}from"./chunk-SHN5MT56.js";import{b as m,d as p,f as C}from"./chunk-YVN2NZL4.js";import{b as x}from"./chunk-VKB3B2FE.js";import{a as h,b as f}from"./chunk-FFWPJP7A.js";import{i as S}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var l=(e,r)=>typeof r=="string"?{command:r,description:e,workingDirectory:void 0,depends:[]}:{command:r.command,description:r.description??e,workingDirectory:r.workingDirectory,depends:r.depends??[]},k=(e,r,t=new Set,s=new Set)=>{if(s.has(e))return[];if(t.has(e))throw new Error(`Circular dependency detected: ${e} depends on itself (cycle in dependency chain)`);let n=r[e];if(n===void 0)throw new Error(`Unknown script dependency: "${e}"`);t.add(e);let c=l(e,n),o=[];for(let a of c.depends){let i=k(a,r,t,s);for(let d of i)s.has(d)||(o.push(d),s.add(d))}return s.add(e),o},P=()=>{let e=new URL("./main.ts",import.meta.url),r=e.protocol==="file:"?e.pathname:e.href;return`${S.process.execPath()} run --allow-all ${r}`},R=e=>{if(e==="eser"||e.startsWith("eser ")){let r=e.slice(4);return`${P()}${r}`}return e},$=async(e,r,t)=>{let s=R(e),n=t!==void 0&&t.length>0?`${s} ${t.join(" ")}`:s,c=r??".";return(await new x("sh",["-c",n]).cwd(c).stdout("inherit").stderr("inherit").noThrow().spawn()).code},O=async(e,r,t,s)=>{let n=w({renderer:y.ansi(),sink:g.stdout()}),c=k(e,t);for(let i of c){let d=l(i,t[i]);n.writeln(p(`$ ${i}`));let u=await $(d.command,d.workingDirectory);if(u!==0)return n.writeln(C(`Script dependency "${i}" failed with exit code ${u}`)),await n.close(),f({exitCode:u})}let o=l(e,t[e]);n.writeln(p(`$ ${e}`));let a=await $(o.command,o.workingDirectory,s);return a!==0?(await n.close(),f({exitCode:a})):(await n.close(),h(void 0))},B=e=>{let r=w({renderer:y.ansi(),sink:g.stdout()});r.writeln(m("Scripts:"));for(let[t,s]of Object.entries(e)){let n=l(t,s);r.writeln(m(` ${t.padEnd(20)} `),p(n.description))}r.writeln()};export{$ as executeCommand,l as parseScript,k as resolveDependencies,O as runScript,B as showScripts};
|