eser 4.1.39 → 4.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{add-V7YYHLFH.js → add-IM5JC6QA.js} +1 -1
- package/chunks/approve-RQVNTLFH.js +2 -0
- package/chunks/{ask-PMB64QWG.js → ask-UTEI7KGQ.js} +1 -1
- package/chunks/block-3NE7YTL7.js +2 -0
- package/chunks/{build-HUKFUVPB.js → build-IRLEBMJE.js} +2 -2
- package/chunks/cancel-W5FDMXFI.js +2 -0
- package/chunks/{changelog-gen-JV3EHOMV.js → changelog-gen-USXHO6PE.js} +1 -1
- package/chunks/{chunk-VIQLCQOI.js → chunk-2BEIAJ5J.js} +1 -1
- package/chunks/{chunk-XYUJCTPP.js → chunk-2N62LL55.js} +1 -1
- package/chunks/{chunk-OPPOHKNZ.js → chunk-2OKCK56H.js} +1 -1
- package/chunks/{chunk-HTJLIAH4.js → chunk-2UHHAPKY.js} +1 -1
- package/chunks/{chunk-NZRU3N6C.js → chunk-3LDGQFQZ.js} +1 -1
- package/chunks/chunk-3PBNSBPA.js +12 -0
- package/chunks/{chunk-NJUIBCQR.js → chunk-3U5M6YO6.js} +1 -1
- package/chunks/{chunk-F5HQDZLN.js → chunk-4COCZPO5.js} +1 -1
- package/chunks/{chunk-BWDCKK63.js → chunk-4EJVA4QA.js} +1 -1
- package/chunks/{chunk-ECY4MUD3.js → chunk-5MVJUALI.js} +1 -1
- package/chunks/{chunk-HZ2ALFWG.js → chunk-5Y5VGPYR.js} +1 -1
- package/chunks/chunk-6SSSHLEY.js +2 -0
- package/chunks/{chunk-HP5W5XT6.js → chunk-6V6C6MWY.js} +1 -1
- package/chunks/{chunk-WJKE6XHF.js → chunk-6VHZQNHX.js} +1 -1
- package/chunks/{chunk-UMKCOU3N.js → chunk-7RL5ZFGE.js} +1 -1
- package/chunks/{chunk-F35K7YVH.js → chunk-BNMKKNLB.js} +1 -1
- package/chunks/{chunk-OAFB4A6D.js → chunk-BSV66I74.js} +1 -1
- package/chunks/{chunk-DWLFTRZS.js → chunk-CXTPYPO4.js} +1 -1
- package/chunks/{chunk-ISQIZSXN.js → chunk-DRCKMHUI.js} +1 -1
- package/chunks/{chunk-4EHAL3NK.js → chunk-E423U2PP.js} +1 -1
- package/chunks/chunk-ENNZWOEX.js +4 -0
- package/chunks/{chunk-MBCPGD5L.js → chunk-EXP2TZZC.js} +1 -1
- package/chunks/{chunk-TEOMM3RD.js → chunk-GKOMIH2B.js} +1 -1
- package/chunks/{chunk-BBOEAL63.js → chunk-H5GHXMIT.js} +1 -1
- package/chunks/{chunk-MOY4CXAZ.js → chunk-H6HLRKRK.js} +2 -2
- package/chunks/chunk-H7FWYKMD.js +82 -0
- package/chunks/{chunk-YEWODYET.js → chunk-H7U2VQCK.js} +1 -1
- package/chunks/{chunk-L7UCWRDZ.js → chunk-IBB6UZR2.js} +1 -1
- package/chunks/{chunk-AHKNU2JM.js → chunk-IBBGWXAI.js} +1 -1
- package/chunks/{chunk-ZWMJQZQF.js → chunk-IQQEVKBP.js} +1 -1
- package/chunks/{chunk-WILZ4OR2.js → chunk-IWXI3UYI.js} +1 -1
- package/chunks/{chunk-H2O5G3XB.js → chunk-JZ7DUWYC.js} +1 -1
- package/chunks/{chunk-EGMYM4TM.js → chunk-KZAPWWOT.js} +1 -1
- package/chunks/{chunk-4FGLERUG.js → chunk-L7RS6MQ5.js} +1 -1
- package/chunks/{chunk-3IZX4OZ7.js → chunk-LSET5TD3.js} +1 -1
- package/chunks/{chunk-WAEXOK7L.js → chunk-LYKN5EIM.js} +1 -1
- package/chunks/{chunk-ZC4F4MYU.js → chunk-MBG7SPPO.js} +1 -1
- package/chunks/{chunk-OAT2D23A.js → chunk-MPGRKZIA.js} +1 -1
- package/chunks/{chunk-MQ4EMT35.js → chunk-OEUVCV5C.js} +1 -1
- package/chunks/chunk-OM5GSS2H.js +7 -0
- package/chunks/{chunk-L2E2H7YT.js → chunk-OWQXQ33F.js} +1 -1
- package/chunks/{chunk-RVJZFWN7.js → chunk-QD46ROBD.js} +1 -1
- package/chunks/{chunk-HVTJ5LVU.js → chunk-QMRKAC6C.js} +1 -1
- package/chunks/{chunk-ILROPD5P.js → chunk-QYMHLTVT.js} +1 -1
- package/chunks/{chunk-KEOTIPA6.js → chunk-RFHWH6ZX.js} +1 -1
- package/chunks/{chunk-TLVGNOK3.js → chunk-RIOYVPPP.js} +1 -1
- package/chunks/{chunk-OWV223WQ.js → chunk-SF6FT44C.js} +1 -1
- package/chunks/{chunk-QFFGKP3M.js → chunk-SH4H7OLV.js} +1 -1
- package/chunks/{chunk-T4WKRBQZ.js → chunk-SK6QUPJR.js} +1 -1
- package/chunks/{chunk-O2TA7OHJ.js → chunk-SMKZDN2Q.js} +1 -1
- package/chunks/{chunk-DKFL6XPX.js → chunk-TELZ2ZFI.js} +1 -1
- package/chunks/{chunk-4QDEJUAF.js → chunk-TYLYMZQC.js} +1 -1
- package/chunks/{chunk-ULNEO3RY.js → chunk-UQRZJPYH.js} +1 -1
- package/chunks/{chunk-3AA3RXKD.js → chunk-V3NJTF2Y.js} +1 -1
- package/chunks/{chunk-K2MKYDPY.js → chunk-V6YI7YJ4.js} +1 -1
- package/chunks/{chunk-LBMJGMDD.js → chunk-VE6XM5OZ.js} +1 -1
- package/chunks/{chunk-A6K5L4SG.js → chunk-VNJJQED3.js} +1 -1
- package/chunks/{chunk-3QF3I2RD.js → chunk-VVWAUS3D.js} +1 -1
- package/chunks/{chunk-CMSPX2RN.js → chunk-WPOZMPUR.js} +1 -1
- package/chunks/{chunk-2KKLYXSA.js → chunk-WWI6727S.js} +1 -1
- package/chunks/{chunk-PXCM4FHO.js → chunk-XOSAN6PX.js} +1 -1
- package/chunks/{chunk-MEZCXQAX.js → chunk-YJ3ICGHV.js} +1 -1
- package/chunks/{chunk-P72TUTYK.js → chunk-YURNTYEP.js} +1 -1
- package/chunks/{chunk-U5Q5MC74.js → chunk-Z2LXZLZV.js} +1 -1
- package/chunks/{chunk-QXATB6Z5.js → chunk-ZEFYMWGZ.js} +1 -1
- package/chunks/{chunk-5224ZYEW.js → chunk-ZRUM5PE7.js} +1 -1
- package/chunks/claude-code-VX2T4YII.js +2 -0
- package/chunks/{clone-YEBQK7CG.js → clone-DSVKII72.js} +1 -1
- package/chunks/{cmd-2DAVTVOF.js → cmd-YU4MVRRR.js} +1 -1
- package/chunks/{commitmsg-FQ3IZ3TH.js → commitmsg-FS52L6J5.js} +2 -2
- package/chunks/{concern-TIGYH5DX.js → concern-BWZV4KBS.js} +1 -1
- package/chunks/{deno-XQHOVHKR.js → deno-I5YAWOB6.js} +1 -1
- package/chunks/{dev-BNGJJR2O.js → dev-QZF2X7YC.js} +2 -2
- package/chunks/done-44REMKQ4.js +2 -0
- package/chunks/{file-tools-shared-KBTCO2FV.js → file-tools-shared-LMF72D6S.js} +1 -1
- package/chunks/{gh-Q7VEABJS.js → gh-FKZHTNFN.js} +2 -2
- package/chunks/{gh-contributors-4KGARSNL.js → gh-contributors-3MFKDSG3.js} +1 -1
- package/chunks/{init-45ODFAV3.js → init-RIVFJ2HP.js} +1 -1
- package/chunks/{init-RV7K5JC4.js → init-ZOMBOUG3.js} +3 -3
- package/chunks/{install-6XIQS5E7.js → install-WD65EAID.js} +1 -1
- package/chunks/{invoke-hook-Q3NMJXDO.js → invoke-hook-CPYBTKLO.js} +3 -3
- package/chunks/kiro-JGEZGFF3.js +2 -0
- package/chunks/{list-NYLFIF2U.js → list-NS7ECFDY.js} +1 -1
- package/chunks/{list-UQMPOF5Y.js → list-PSLAM3H6.js} +1 -1
- package/chunks/{list-BOLPKAEY.js → list-XFPTCIMR.js} +1 -1
- package/chunks/{load-config-G4DHKB5K.js → load-config-OGSPRY4L.js} +1 -1
- package/chunks/{main-236QYA7G.js → main-BUEG2IMJ.js} +2 -2
- package/chunks/{manifest-3VJ4O6HR.js → manifest-4EA74HMS.js} +1 -1
- package/chunks/{mod-QWYXFGRG.js → mod-2PIV6QCE.js} +1 -1
- package/chunks/{mod-IHYN4TEM.js → mod-ERJSLSPA.js} +2 -2
- package/chunks/{mod-DXA25A4J.js → mod-G7PJEGW6.js} +1 -1
- package/chunks/{mod-YH5Z6G4Q.js → mod-II7CSZUT.js} +1 -1
- package/chunks/mod-JWUOEEMP.js +2 -0
- package/chunks/{mod-BQJDMCYC.js → mod-KTGLCC3R.js} +1 -1
- package/chunks/{mod-GSWVSC2C.js → mod-Q6SI6S6S.js} +1 -1
- package/chunks/{mod-EWLBSEHA.js → mod-RO7WP3SA.js} +1 -1
- package/chunks/{mod-PZSJGUM7.js → mod-U2MNO6EC.js} +1 -1
- package/chunks/{mod-IXVUQHXS.js → mod-WOZXOD2F.js} +1 -1
- package/chunks/{mod-SXL6PDQM.js → mod-XEK7FROU.js} +1 -1
- package/chunks/{new-U5U4E6HR.js → new-3ZN4U7FJ.js} +1 -1
- package/chunks/next-QNLI4Z6Y.js +9 -0
- package/chunks/ollama-LD6OENM2.js +2 -0
- package/chunks/opencode-ECTBCC3O.js +2 -0
- package/chunks/{purge-RM6OD5PV.js → purge-565VM3XK.js} +1 -1
- package/chunks/{recipe-applier-TTZEZGSC.js → recipe-applier-6SGY2W3A.js} +1 -1
- package/chunks/{registry-fetcher-SPENFEOH.js → registry-fetcher-H63ZWZHU.js} +1 -1
- package/chunks/{release-UEX6YK4K.js → release-6I5TL34I.js} +2 -2
- package/chunks/{release-notes-GA7CTA54.js → release-notes-GJ4EBMTD.js} +1 -1
- package/chunks/{release-tag-VJWBXG5G.js → release-tag-IOH5HGAA.js} +1 -1
- package/chunks/reopen-T5ZROS7Y.js +2 -0
- package/chunks/reset-EDANY7W4.js +2 -0
- package/chunks/{rule-ZQOGLQQI.js → rule-SMPE3A72.js} +1 -1
- package/chunks/{run-L35K3KRF.js → run-FGMEIO57.js} +1 -1
- package/chunks/run-VPRSGIHR.js +4 -0
- package/chunks/{scripts-VI2TKQOH.js → scripts-L2FZBUHU.js} +1 -1
- package/chunks/{serve-AVVEYGQB.js → serve-R7XGF4EL.js} +2 -2
- package/chunks/{server-R347ON4B.js → server-KJW4HWK7.js} +1 -1
- package/chunks/spec-WGXL4BOE.js +2 -0
- package/chunks/status-65FD7MJB.js +2 -0
- package/chunks/{sync-PB4KWB3R.js → sync-EIMJAEA7.js} +1 -1
- package/chunks/{system-YLXVXRXW.js → system-5OWRHFDI.js} +1 -1
- package/chunks/{system-BXJ2LV5O.js → system-X4X6JD4X.js} +1 -1
- package/chunks/{update-522VXIKX.js → update-CV7JPZGM.js} +1 -1
- package/chunks/validate-bom-5IPW3R4O.js +2 -0
- package/chunks/validate-case-conflict-5XOPS6HD.js +2 -0
- package/chunks/validate-circular-deps-WME7VUO4.js +2 -0
- package/chunks/validate-commit-msg-MEQH6ADP.js +2 -0
- package/chunks/validate-docs-LBWVCSN2.js +2 -0
- package/chunks/validate-eof-56S7THGQ.js +2 -0
- package/chunks/validate-export-names-YJGQHPGF.js +2 -0
- package/chunks/validate-filenames-DJF7GO3C.js +2 -0
- package/chunks/validate-json-2OMEH67D.js +2 -0
- package/chunks/validate-large-files-OE4P7FD7.js +2 -0
- package/chunks/validate-licenses-BNEQDBKC.js +2 -0
- package/chunks/validate-line-endings-PHV2ZK7V.js +2 -0
- package/chunks/validate-merge-conflict-XN3376IV.js +2 -0
- package/chunks/validate-mod-exports-D2Q5GV76.js +2 -0
- package/chunks/{validate-package-configs-3Y55ZLUY.js → validate-package-configs-ZO5YJE2D.js} +1 -1
- package/chunks/validate-secrets-ZMBKEXOK.js +2 -0
- package/chunks/validate-shebangs-3OR2L3RH.js +2 -0
- package/chunks/validate-submodules-HIYYVQDP.js +2 -0
- package/chunks/validate-symlinks-QMLLO5R3.js +2 -0
- package/chunks/validate-toml-U77NIEDN.js +2 -0
- package/chunks/validate-trailing-whitespace-UE7AOZEZ.js +2 -0
- package/chunks/validate-yaml-UX2VQJJT.js +2 -0
- package/chunks/versions-OKK45EDV.js +2 -0
- package/chunks/watch-Y3ARCBAW.js +9 -0
- package/chunks/wontfix-FSTUJ7T6.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-HVIH2A3C.js +0 -2
- package/chunks/block-JSK5CJPO.js +0 -2
- package/chunks/chunk-7UASU4NU.js +0 -10
- package/chunks/chunk-A3JJKZ4C.js +0 -4
- package/chunks/chunk-JI536JLJ.js +0 -2
- package/chunks/chunk-NEHZOG23.js +0 -7
- package/chunks/chunk-RGUPFAEE.js +0 -68
- package/chunks/claude-code-ELUDT5TV.js +0 -2
- package/chunks/done-GGPPHJW2.js +0 -2
- package/chunks/kiro-NZ7LM6HA.js +0 -2
- package/chunks/mod-P4AVZJNK.js +0 -2
- package/chunks/next-AQ4TIEL7.js +0 -9
- package/chunks/ollama-LHWMXMLY.js +0 -2
- package/chunks/opencode-24O2MW3L.js +0 -2
- package/chunks/reset-WHYTPTFB.js +0 -2
- package/chunks/run-IX74MQTI.js +0 -4
- package/chunks/spec-KMKZDLV2.js +0 -2
- package/chunks/status-MLX4O37A.js +0 -2
- package/chunks/validate-bom-JCMRVAUT.js +0 -2
- package/chunks/validate-case-conflict-WZQCMKSZ.js +0 -2
- package/chunks/validate-circular-deps-7R4F2YDV.js +0 -2
- package/chunks/validate-commit-msg-PH7Y3JEI.js +0 -2
- package/chunks/validate-docs-WCIOHNYP.js +0 -2
- package/chunks/validate-eof-KRYQLTFQ.js +0 -2
- package/chunks/validate-export-names-OCQ2XSY6.js +0 -2
- package/chunks/validate-filenames-46O7FCXF.js +0 -2
- package/chunks/validate-json-3EZ2L64H.js +0 -2
- package/chunks/validate-large-files-7YX6MSOB.js +0 -2
- package/chunks/validate-licenses-OC7JRVAH.js +0 -2
- package/chunks/validate-line-endings-2DM5UGCJ.js +0 -2
- package/chunks/validate-merge-conflict-UDMWYMJ5.js +0 -2
- package/chunks/validate-mod-exports-W24IV367.js +0 -2
- package/chunks/validate-secrets-66VXCCUF.js +0 -2
- package/chunks/validate-shebangs-AMEAHVLB.js +0 -2
- package/chunks/validate-submodules-DYCE27WK.js +0 -2
- package/chunks/validate-symlinks-QN744GUH.js +0 -2
- package/chunks/validate-toml-5K2XNHAE.js +0 -2
- package/chunks/validate-trailing-whitespace-QYWHHIAK.js +0 -2
- package/chunks/validate-yaml-VGKLHEAQ.js +0 -2
- package/chunks/versions-FYALONNL.js +0 -2
- package/chunks/watch-P56QT3Q2.js +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as N,b as x,c as H}from"./chunk-
|
|
2
|
+
import{a as N,b as x,c as H}from"./chunk-6V6C6MWY.js";import{f as C}from"./chunk-BNMKKNLB.js";import{a as E,d as $}from"./chunk-P2MUEKFT.js";import{k as S}from"./chunk-GKOMIH2B.js";import{f as b,h,k as I}from"./chunk-MBG7SPPO.js";import{d as o,f as k,g,h as A,k as y}from"./chunk-YVN2NZL4.js";import{a as v}from"./chunk-MG65QJY6.js";import{a as d,b as c,c as R}from"./chunk-FFWPJP7A.js";import{i as w}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var _=r=>E(async e=>{try{let t=await S(r.registrySource,{verbose:r.verbose,local:r.local}),s=t.recipes.find(n=>n.name===r.recipeName);if(s===void 0)return c({_tag:"RecipeNotFound",message:`Recipe '${r.recipeName}' not found. Run \`eser kit list\` to see available recipes.`});let a=await N(r.cwd),i=x(s,a);for(let n of i.warnings)e.out.writeln(A(`Warning: ${n}`));let l=await C(r.recipeName,t.recipes,{cwd:r.cwd,registryUrl:t.registryUrl,force:r.force,skipExisting:r.skipExisting,dryRun:r.dryRun,verbose:r.verbose,variables:r.variables}),m=0,p=0;for(let n of l.recipes)m+=n.result.written.length,p+=n.result.skipped.length;e.out.writeln(g(`\u2713 Added ${m} file(s)`)),l.recipes.length>1&&e.out.writeln(o(` Applied ${l.recipes.length} recipes (including dependencies)`)),p>0&&e.out.writeln(o(` Skipped ${p} existing file(s)`));let f=l.recipes.find(n=>n.name===r.recipeName);if(f!==void 0)for(let n of f.result.written)e.out.writeln(` \u2192 ${n}`);let u;if(!r.noInstall&&!r.dryRun&&i.instructions.length>0){e.out.writeln(o(`
|
|
3
3
|
Installing dependencies...`)),u=await H(i.instructions,r.cwd,{verbose:r.verbose});for(let n of u)n.success?e.out.writeln(g(` \u2713 ${n.command}`)):e.out.writeln(k(` \u2717 ${n.command}: ${n.error}`))}else if(i.instructions.length>0){e.out.writeln(o(`
|
|
4
4
|
Dependencies (run manually):`));for(let n of i.instructions)e.out.writeln(o(` ${n}`))}return d({recipe:s,chainResult:l,depInfo:i,installResults:u})}catch(t){let s=t instanceof Error?t.message:String(t);return c({_tag:"ApplyError",message:s})}});var j=r=>{let e={};for(let t of r){let[s,...a]=String(t).split("=");s!==void 0&&s!==""&&(e[s]=a.join("="))}return e},B=async r=>{let e=v(r??[],{string:["registry","var"],boolean:["dry-run","force","skip-existing","verbose","local","no-install"],collect:["var"]}),t=e._[0],s=b({renderer:I.ansi(),sink:h.stdout()});if(t===void 0)return s.writeln("Usage: eser kit add <recipe> [--registry <url>] [--dry-run] [--var key=value]"),s.writeln(),s.writeln("Run ",o("`eser kit list`")," to see available recipes."),await s.close(),d(void 0);let a=e["dry-run"]===!0;a?s.writeln(y(`
|
|
5
5
|
Dry run: ${t}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as E}from"./chunk-ENNZWOEX.js";import"./chunk-TYLYMZQC.js";import{a as P,d as A}from"./chunk-OEUVCV5C.js";import{e as D,g as R}from"./chunk-6SSSHLEY.js";import{c as v,e as S,f as g,g as d,l as y,p as C}from"./chunk-OM5GSS2H.js";import{c as n}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{f as u,h as f,k as h}from"./chunk-MBG7SPPO.js";import{c as a,d as i,f as o,g as c,k as l}from"./chunk-YVN2NZL4.js";import{a as m,b as w}from"./chunk-FFWPJP7A.js";import{i as p}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var M=async F=>{let s=u({renderer:h.ansi(),sink:f.stdout()}),t=p.process.cwd(),_=g(F),e=await S(t,_),$=await y(t);if(e.spec!==null){let r=`${t}/${v.specDir(e.spec)}`;try{await p.fs.stat(r)}catch{return s.writeln(o(`Active spec '${e.spec}' directory not found.`)),s.writeln(i("Run `noskills reset` to return to IDLE.")),await s.close(),w({exitCode:1})}}if(e.phase==="SPEC_DRAFT"){if(e.classification===null&&e.spec!==null){let b=(await C(t)).filter(k=>$?.concerns.includes(k.id)??!1);try{await E(t,e,b)}catch{}}let r=R(e);await d(t,r),r.spec!==null&&(await P(t,r.spec,"approved"),await A(t,r.spec,"approved")),s.writeln(c("\u2714")," Spec approved. Phase: ",l("SPEC_APPROVED")),s.writeln("When ready, run ",a(`${n('next --answer="start"')}`)," to begin execution.")}else if(e.phase==="DISCOVERY_REVIEW"){let r=D(e);await d(t,r),s.writeln(c("\u2714")," Discovery answers approved. Phase: ",l("SPEC_DRAFT")),s.writeln("Review the spec and run ",a(n("approve"))," again to approve.")}else e.phase==="DISCOVERY"&&e.discovery.completed?(s.writeln(i("Discovery complete. Spec draft already generated.")),s.writeln("Review the spec and run ",a(n("approve"))," again when in SPEC_DRAFT phase.")):s.writeln(o(`Cannot approve in phase: ${e.phase}`));return await s.close(),m(void 0)};export{M as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as _,b as $}from"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-BNQAZLIQ.js";import{d as x,f as v,g as I,h as y,k as P}from"./chunk-
|
|
2
|
+
import{a as _,b as $}from"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-BNQAZLIQ.js";import{d as x,f as v,g as I,h as y,k as P}from"./chunk-MBG7SPPO.js";import{d as O,e as L,g as R}from"./chunk-5DWJ7WEE.js";import{a as T}from"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as S}from"./chunk-5MVJUALI.js";import{a as C,b as g}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var k=(e,t,n)=>{let i=e.streamText(t,n);return{name:`ai-text/${e.provider}/${e.modelId}`,readable:new ReadableStream({async start(o){try{for await(let s of i)s.kind==="content_delta"&&o.enqueue(x(s.textDelta));o.close()}catch(s){o.error(s)}}})}};var Y={cc:"claude-code",ol:"ollama",oc:"opencode",oai:"openai",ant:"anthropic",gem:"gemini",vtx:"vertexai"},q={"claude-code":"Claude Code",ollama:"Ollama",opencode:"OpenCode",kiro:"Kiro",anthropic:"Anthropic API",openai:"OpenAI API",gemini:"Gemini API",vertexai:"Vertex AI"},H=e=>Y[e]??e,K=async e=>{if(e){let t=m.process.stderr.getWriter(),n=v({renderer:P.ansi(),sink:y.writable(new WritableStream({async write(i){await t.write(new TextEncoder().encode(String(i.data)))},close(){t.releaseLock()}}))});await O.configure({sinks:{stderr:R.getOutputSink(n)},loggers:[{category:["ai"],lowestLevel:T.Debug,sinks:["stderr"]}]})}return L.getLogger(["ai","ask"])},M=async e=>{await e.info("Auto-detecting AI provider...");try{if(await S`which claude`.noThrow().code()===0)return await e.info("Claude Code detected."),"claude-code"}catch{}try{if((await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok)return await e.info("Ollama detected at localhost:11434."),"ollama"}catch{}try{if(await S`which opencode`.noThrow().code()===0)return await e.info("OpenCode detected."),"opencode"}catch{}if(m.capabilities.env){if(m.env.has("ANTHROPIC_API_KEY"))return await e.info("Anthropic API key detected."),"anthropic";if(m.env.has("OPENAI_API_KEY"))return await e.info("OpenAI API key detected."),"openai"}throw new Error("No AI provider detected. Install claude, ollama, or set ANTHROPIC_API_KEY / OPENAI_API_KEY.")},U=async e=>{switch(e){case"claude-code":return(await import("./claude-code-VX2T4YII.js")).claudeCodeFactory;case"ollama":return(await import("./ollama-LD6OENM2.js")).ollamaFactory;case"opencode":return(await import("./opencode-ECTBCC3O.js")).openCodeFactory;case"kiro":return(await import("./kiro-JGEZGFF3.js")).kiroFactory;case"anthropic":return(await import("./anthropic-QBGNUIP3.js")).anthropicFactory;case"openai":return(await import("./openai-2KONKHWL.js")).openaiFactory;case"gemini":return(await import("./gemini-43AWJEWI.js")).geminiFactory;case"vertexai":return(await import("./vertexai-2F2A3VTE.js")).vertexaiFactory;default:throw new Error(`Unknown provider: ${e}`)}},le=async e=>{let t=e??[],n=null,i=null,o=null,s=!1,p=!1,A=[],a=0;for(;a<t.length;){let r=t[a];if(r==="-p"||r==="--provider"){n=t[a+1]??null,a+=2;continue}if(r==="-m"||r==="--model"){i=t[a+1]??null,a+=2;continue}if(r==="--max-tokens"){let c=t[a+1];c!==void 0&&(o=Number(c)),a+=2;continue}if(r==="--json"){s=!0,a+=1;continue}if(r==="-v"||r==="--verbose"){p=!0,a+=1;continue}r.startsWith("-")||A.push(r),a+=1}let f=A.join(" ");if(f.length===0)return g({message:'Usage: ai ask "your prompt" [-p provider] [-m model] [--verbose]',exitCode:1});let d=await K(p);try{let r=n!==null?H(n):await M(d),c=q[r]??r,E=i??z(r);await d.info(`Using ${c} (${E})`);let N=await U(r),w=new _({factories:[N]});await w.addModel("default",{provider:r,model:E});let h=w.getDefault();if(h===null)return g({message:"Failed to initialize model",exitCode:1});let b=[F("user",f)];if(await d.info(`Sending prompt (${f.length} chars)...`),s){let u=await h.generateText({messages:b,maxTokens:o??void 0});await d.info(`Response received (${$(u).length} chars)`);let l=v({sink:y.stdout()});l.writeln(JSON.stringify(u,null,2)),await l.close()}else{let u=k(h,{messages:b,maxTokens:o??void 0});await I().from(u).to(V()).run();let l=m.process.stdout.getWriter();await l.write(new TextEncoder().encode(`
|
|
3
3
|
`)),l.releaseLock()}return await w.close(),C(void 0)}catch(r){let c=r instanceof Error?r.message:String(r);return await d.error(c),p&&r instanceof Error&&r.cause!==void 0&&await d.debug(`Cause: ${String(r.cause)}`),g({message:c,exitCode:1})}},j=12,G=e=>new Promise(t=>setTimeout(t,e)),V=(e=j)=>{let t=new TextEncoder;return{name:"typewriter",writable:new WritableStream({async write(n){let i=String(n.data),o=m.process.stdout.getWriter();for(let s of i)await o.write(t.encode(s)),await G(e);o.releaseLock()}})}},z=e=>{switch(e){case"claude-code":return"claude-sonnet-4-20250514";case"ollama":return"llama3";case"opencode":return"default";case"kiro":return"default";case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o";case"gemini":return"gemini-2.0-flash";case"vertexai":return"gemini-2.0-flash";default:return"default"}};export{le as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{i as x}from"./chunk-6SSSHLEY.js";import{c as h,e as g,f as k,g as y}from"./chunk-OM5GSS2H.js";import{c as v}from"./chunk-MPGRKZIA.js";import"./chunk-2XNFZXHY.js";import{f as u,h as f,k as w}from"./chunk-MBG7SPPO.js";import{c as m,d as i,f as a,h as d}from"./chunk-YVN2NZL4.js";import{a as p,b as o}from"./chunk-FFWPJP7A.js";import{i as n}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var N=async c=>{let e=u({renderer:w.ansi(),sink:f.stdout()}),t=n.process.cwd(),A=k(c),l=(c??[]).filter(r=>!r.startsWith("--spec=")).join(" ")||"No reason given",s=await g(t,A);if(s.spec!==null){let r=`${t}/${h.specDir(s.spec)}`;try{await n.fs.stat(r)}catch{return e.writeln(a(`Active spec '${s.spec}' directory not found.`)),e.writeln(i("Run `noskills reset` to return to IDLE.")),await e.close(),o({exitCode:1})}}if(s.phase!=="EXECUTING")return e.writeln(a(`Cannot block in phase: ${s.phase}`)),await e.close(),o({exitCode:1});let C=x(s,l);return await y(t,C),e.writeln(d("\u26A0")," Spec blocked: ",i(l)),e.writeln("Resolve with: ",m(`${v('next --answer="resolution"')}`)),await e.close(),p(void 0)};export{N as main};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as d,h as g,k as m}from"./chunk-
|
|
2
|
+
import{f as d,h as g,k as m}from"./chunk-MBG7SPPO.js";import{b as c,d as L,h as C,k as u}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as v}from"./chunk-ZEFYMWGZ.js";import"./chunk-MG65QJY6.js";import{a as y}from"./chunk-FFWPJP7A.js";import"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var V=["trace","debug","info","warn","error","fatal"],N=async x=>{let{flags:o}=v(x??[],[{name:"out-dir",type:"string",default:"dist",description:"Output directory"},{name:"clean",type:"boolean",description:"Clean output first"},{name:"no-minify",type:"boolean",description:"Disable minification"},{name:"analyze",type:"boolean",description:"Analyze bundle size"},{name:"log-level",type:"string",default:"info",description:"Log level"}]),t=d({renderer:m.ansi(),sink:g.stdout()});t.writeln(u(`
|
|
3
3
|
\u{1F4E6} Building for production...
|
|
4
|
-
`));let e=await import("./mod-5JT4O5L3.js"),{runtime:n}=await import("./mod-
|
|
4
|
+
`));let e=await import("./mod-5JT4O5L3.js"),{runtime:n}=await import("./mod-G7PJEGW6.js"),i=n.process.cwd(),p=o["out-dir"],S=!o["no-minify"],h=o.clean,k=o.analyze,f=o["log-level"]??"info",b=V.includes(f.toLowerCase())?f.toLowerCase():"info",z={trace:e.Severities.Trace,debug:e.Severities.Debug,info:e.Severities.Info,warn:e.Severities.Warning,error:e.Severities.Error,fatal:e.Severities.Critical},D=d({renderer:m.ansi(),sink:g.stdout()});await e.config.configure({sinks:{console:e.sinks.getOutputSink(D)},loggers:[{category:["laroux-bundler"],lowestLevel:z[b],sinks:["console"]}]});let[{build:A,createBuildContext:E},{loadConfig:O},{reactPlugin:B},{createTailwindPlugin:P}]=await Promise.all([import("./system-X4X6JD4X.js"),import("./load-config-OGSPRY4L.js"),import("./mod-XEK7FROU.js"),import("./mod-RO7WP3SA.js")]),T=e.logger.getLogger(["laroux-bundler","cli"]),s=await O(i),r={projectRoot:i,srcDir:n.path.resolve(i,s.srcDir),distDir:n.path.resolve(i,p),logLevel:b,fonts:s.fonts,images:s.images,cssModuleTypes:s.cssModuleTypes,noCssModuleAutoReference:s.noCssModuleAutoReference,browserShims:s.browserShims,serverExternals:s.build.serverExternals,build:{...s.build,minify:S}};if(h)try{await n.fs.remove(r.distDir,{recursive:!0}),T.debug(`Cleaned ${r.distDir}`)}catch{}let R=P({globalCssPath:n.path.resolve(i,"src/app/styles/global.css")}),j=E(r,{framework:B,css:R,bundlerBackend:"rolldown"});if(await A(j),await e.config.reset(),k){t.writeln(u(`
|
|
5
5
|
\u{1F4CA} Bundle Analysis:
|
|
6
6
|
`));try{let M=`${p}/client/manifest.json`,$=await n.fs.readTextFile(M),w=JSON.parse($);t.writeln(c("Chunks:"));for(let[a,l]of Object.entries(w.files)){let I=(l.size/1024).toFixed(2);t.writeln(c(` ${a.padEnd(30)} ${I.padStart(8)} KB`))}let F=Object.values(w.files).reduce((a,l)=>a+l.size,0);t.writeln(L(`
|
|
7
7
|
Total: ${(F/1024).toFixed(2)} KB`))}catch{t.writeln(C("Could not analyze build (manifest.json not found)"))}}return await t.close(),y(void 0)};export{N as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as g,d as D}from"./chunk-OEUVCV5C.js";import{k as S}from"./chunk-6SSSHLEY.js";import{c as u,e as f,f as w,g as h}from"./chunk-OM5GSS2H.js";import"./chunk-2XNFZXHY.js";import{f as l,h as m,k as d}from"./chunk-MBG7SPPO.js";import{d as p,f as c,g as o}from"./chunk-YVN2NZL4.js";import{a as i,b as a}from"./chunk-FFWPJP7A.js";import{i as n}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var x=async I=>{let s=l({renderer:d.ansi(),sink:m.stdout()}),t=n.process.cwd(),y=w(I),e=await f(t,y);if(e.phase==="IDLE"||e.phase==="UNINITIALIZED"||e.phase==="COMPLETED")return s.writeln(c(`Cannot cancel in phase: ${e.phase}`)),await s.close(),a({exitCode:1});if(e.spec!==null){let C=`${t}/${u.specDir(e.spec)}`;try{await n.fs.stat(C)}catch{return s.writeln(c(`Active spec '${e.spec}' directory not found.`)),s.writeln(p("Run `noskills reset` to return to IDLE.")),await s.close(),a({exitCode:1})}}let r=S(e,"cancelled");return await h(t,r),r.spec!==null&&(await g(t,r.spec,"cancelled"),await D(t,r.spec,"cancelled")),s.writeln(o("\u2714")," Spec cancelled."),await s.close(),i(void 0)};export{x as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R,b as A}from"./chunk-
|
|
2
|
+
import{a as R,b as A}from"./chunk-2UHHAPKY.js";import{a as w}from"./chunk-IBB6UZR2.js";import"./chunk-VNJJQED3.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as x}from"./chunk-LFNUSULJ.js";import{a as y,c as v}from"./chunk-L7RS6MQ5.js";import{l as m}from"./chunk-JZ7DUWYC.js";import"./chunk-WF6JNPZS.js";import"./chunk-VAIRJES2.js";import"./chunk-J2Z7NG2X.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as h}from"./chunk-P2MUEKFT.js";import"./chunk-MBG7SPPO.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-5MVJUALI.js";import{a as C}from"./chunk-MG65QJY6.js";import{g as u}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-7ATUODBM.js";import"./chunk-N7DXBY3O.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-6VHZQNHX.js";import"./chunk-6E6JUBFH.js";import"./chunk-BQT5RJZB.js";import"./chunk-5WJ6AUNY.js";var{ctx:f,output:q}=y(),$={feat:"Added",fix:"Fixed",refactor:"Changed",perf:"Changed",docs:"Changed",revert:"Removed"},E=new Set(["chore","ci","test"]),S=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}(.+)$/,T=/\s{0,100}\(take\s{1,100}[IVXLCDM\d]+\)\s{0,100}\.?$/i,G=(t,o)=>{let n=t.match(S);if(n!==null)return{type:n[1].toLowerCase(),scope:n[2],message:n[3].trim(),hash:o}},O=t=>t.replace(T,"").trim(),N=t=>{let o=[];for(let n of t){let e=G(n.subject,n.hash);e!==void 0&&o.push(e)}return o},I=t=>{let o=new Set,n=[];for(let e of t){let s=O(e.message),a=s.replace(/[.\s]{1,20}$/,"").toLowerCase(),l=`${e.type}:${a}`;o.has(l)||(o.add(l),n.push({...e,message:s}))}return n},P=t=>{let o=new Map;for(let n of t){if(E.has(n.type))continue;let e=$[n.type];if(e===void 0)continue;let s=o.get(e);s!==void 0?s.push(n):o.set(e,[n])}return o},M=t=>t.scope!==void 0?`- **${t.scope}:** ${t.message}`:`- ${t.message}`,b=(t,o)=>{let n=P(o);if(n.size===0){let l=new Date().toISOString().split("T")[0];return`## ${t} - ${l}
|
|
3
3
|
|
|
4
4
|
_Maintenance release._`}let e=new Date().toISOString().split("T")[0],s=[`## ${t} - ${e}`],a=["Added","Changed","Fixed","Removed"];for(let l of a){let r=n.get(l);if(!(r===void 0||r.length===0)){s.push("",`### ${l}`,"");for(let d of r)s.push(M(d))}}return s.join(`
|
|
5
5
|
`)},k=(t,o,n)=>{let e=t.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as n}from"./chunk-3XJLLDR5.js";import{a as r}from"./chunk-
|
|
2
|
+
import{a as n}from"./chunk-3XJLLDR5.js";import{a as r}from"./chunk-UQRZJPYH.js";var o=r({name:"validate-json",description:"Validate JSON syntax",canFix:!1,stacks:[],defaults:{},extensions:["json","jsonc"],checkFile(e,a,t){if(a===void 0)return[];if((t.exclude??[]).some(s=>e.path.includes(s)))return[];try{return e.name.endsWith(".jsonc")?n(a):JSON.parse(a),[]}catch(s){let i=s instanceof SyntaxError?s.message:"invalid JSON";return[{path:e.path,message:i}]}}}),p=o.run,f=o.validator,x=o.main;export{o as a,p as b,f as c,x as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c as u}from"./chunk-
|
|
2
|
+
import{c as u}from"./chunk-YURNTYEP.js";import{a as i,e as m}from"./chunk-J7YTWK67.js";var p="http://localhost:11434",d=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;baseUrl;config;constructor(e,o){this.baseUrl=e,this.config=o,this.modelId=o.model}async generateText(e,o){let s=g(this.config,e,!1);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok)throw await f(t);let r=await t.json();return h(r,this.modelId)}catch(t){throw t instanceof i?t:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}async*streamText(e,o){let s=g(this.config,e,!0);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok){yield{kind:"error",error:await f(t)};return}if(t.body===null){yield{kind:"error",error:new i("No response body",{provider:"ollama"})};return}for await(let r of u(t.body)){let l=k(r);l!==null&&(yield l)}}catch(t){t instanceof i?yield{kind:"error",error:t}:yield{kind:"error",error:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},v={provider:"ollama",createModel(n){let e=n.properties?.baseUrl??p;return Promise.resolve(new d(e,n))}},g=(n,e,o)=>{let s=y(e.messages,e.system),t={model:n.model,messages:s,stream:o},r={};return e.temperature!==void 0&&(r.temperature=e.temperature),e.maxTokens!==void 0&&(r.num_predict=e.maxTokens),e.topP!==void 0&&(r.top_p=e.topP),e.stopWords!==void 0&&(r.stop=e.stopWords),Object.keys(r).length>0&&(t.options=r),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?t.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(t.format="json")),t},y=(n,e)=>{let o=[];e!==void 0&&o.push({role:"system",content:e});for(let s of n){if(s.role==="system"){let a=[];for(let c of s.content)c.kind==="text"&&a.push(c.text);o.push({role:"system",content:a.join(`
|
|
3
3
|
`)});continue}let t=[],r=[];for(let a of s.content)a.kind==="text"?t.push(a.text):a.kind==="image"&&a.image.url!==void 0&&r.push(a.image.url);let l={role:s.role==="tool"?"user":s.role,content:t.join(`
|
|
4
4
|
`)};r.length>0&&(l.images=r),o.push(l)}return o},h=(n,e)=>{let o=[];return n.message?.content!==void 0&&o.push({kind:"text",text:n.message.content}),{content:o,stopReason:n.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:n.prompt_eval_count??0,outputTokens:n.eval_count??0,totalTokens:(n.prompt_eval_count??0)+(n.eval_count??0)},modelId:e,rawResponse:n}},k=n=>{if(n===null||typeof n!="object")return null;let e=n;return e.done===!0?{kind:"message_done",stopReason:e.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:e.prompt_eval_count??0,outputTokens:e.eval_count??0,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}}:e.message?.content!==void 0&&e.message.content.length>0?{kind:"content_delta",textDelta:e.message.content}:e.response!==void 0&&e.response.length>0?{kind:"content_delta",textDelta:e.response}:null},f=async n=>{let e;try{e=(await n.json()).error??`Ollama HTTP ${n.status}`}catch{e=`Ollama HTTP ${n.status}: ${n.statusText}`}return m("ollama",n.status,new Error(e))};export{d as a,v as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as l}from"./chunk-
|
|
2
|
+
import{a as l}from"./chunk-UQRZJPYH.js";var p=new Set(["con","prn","aux","nul","com1","com2","com3","com4","com5","com6","com7","com8","com9","lpt1","lpt2","lpt3","lpt4","lpt5","lpt6","lpt7","lpt8","lpt9"]),E=/^[a-z0-9_./[\]@-]+$/,u=/^[a-z0-9./[\]@-]+$/,g=[".claude/",".github/",".git/","CLAUDE.md","AGENTS.md","CHANGELOG.md","Makefile","Dockerfile","LICENSE","README.md","VERSION"],d=(o,s)=>{for(let e of s)if(e.includes("*")){let a=e.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]+");if(new RegExp(a).test(o))return!0}else if(o.includes(e)||o.endsWith(e))return!0;return!1},c=l({name:"validate-filenames",description:"Enforce filename conventions (kebab-case / snake_case)",canFix:!1,stacks:[],defaults:{},checkAll(o,s){let e=[],a=s.rules,f=s.exclude??g;for(let t of o){if(d(t.path,f))continue;let i=t.name,m=i.replace(/\.[^.]+$/,"");if(p.has(m.toLowerCase())){e.push({path:t.path,message:`Windows-reserved filename: ${i}`});continue}if(a!==void 0){let r=!1;for(let n of a)if(n.directory==="*"||t.path.includes(n.directory)){if(n.exclude!==void 0&&d(t.path,n.exclude)){r=!0;break}(n.convention==="snake_case"?E:u).test(i)||e.push({path:t.path,message:`filename must be ${n.convention}`}),r=!0;break}if(r)continue}u.test(i)||e.push({path:t.path,message:"filename must be kebab-case"})}return e}}),S=c.run,k=c.validator,v=c.main;export{c as a,S as b,k as c,v as d};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as i}from"./chunk-
|
|
2
|
+
import{d as i}from"./chunk-5MVJUALI.js";var n="#%$".repeat(35),g=s=>{let e=s.split(n).map(t=>{let c=t.slice(0,40);t=t.slice(40);let r=t.indexOf(`
|
|
3
3
|
`);if(r<0)return{hash:c,subject:t.trim(),body:""};let o=t.slice(0,r).trim(),a=t.slice(r+1).trim();return{hash:c,subject:o,body:a}});return e.shift(),e},m=async()=>await i`git describe --tags --abbrev=0`.text();var l=async(s,e)=>{let t=`--pretty=format:${n}%H%B`,c=`${s}..${e}`,r=await i`git --no-pager log ${t} ${c}`.text();return g(r)};var p=async(s,e)=>{await i`git tag -a ${s} -m ${e}`.spawn()},h=async(s,e)=>{await i`git push ${s} ${e}`.spawn()};export{m as a,l as b,p as c,h as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as o}from"./chunk-
|
|
2
|
+
import{a as o}from"./chunk-UQRZJPYH.js";var a=1024,s=o({name:"validate-large-files",description:"Detect files exceeding size limit",canFix:!1,stacks:[],defaults:{maxKb:a},checkAll(n,r){let e=r.maxKb??a,l=e*1024,t=[];for(let i of n)if(i.size>l){let c=Math.round(i.size/1024);t.push({path:i.path,message:`file is ${c}KB (max: ${e}KB)`})}return t}}),d=s.run,f=s.validator,x=s.main;export{s as a,d as b,f as c,x as d};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as D,c as R,d as x,e as O}from"./chunk-OCPEFZBJ.js";import{c as A}from"./chunk-MPGRKZIA.js";var T=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],S=e=>T.map(s=>({...s,extras:R(e,s.id)}));var P=e=>{let s=new Set(e.map(t=>t.questionId));return T.every(t=>s.has(t.id))};var n=e=>A(e),_="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",U=(e,s,t,a)=>{let c=e.execution.iteration>=s,p="You are a senior engineer and a scrum master who takes pride in honest reporting. Your reputation depends on accuracy, not speed. You are responsible for others' toil, and you are a perfect example of a servant leader. When reporting progress: if something is NOT implemented, say so \u2014 don't hide it. If partially done, say 'partially done: [what works] / [what doesn't]'. If untested, say 'implemented but untested'. NEVER say 'done' for something you haven't verified yourself. Underpromise \u2014 4 of 6 done means '4 of 6 done, 2 remaining', not 'almost done'.",i="Never skip steps or make decisions without asking the user. If you think something can be skipped or inferred, ask first. Explicit > Clever.",g="At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST use AskUserQuestion to get the user's input. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.",l="At every decision point where you present options to the user, share your recommendation BEFORE asking. Say what you think and why, then ask if the user agrees. Format: 'I'd recommend X because [reason]. Agree, or would you prefer Y?' The user always has the final word, but you save them cognitive load by proposing first.",o=t?[p,i,g,l]:[_,p,i,g,l],u=a?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...o,"When interactiveOptions are present, pass them DIRECTLY as the `options` array in AskUserQuestion \u2014 they are already in the correct {label, description} format. You MUST also provide a `header` field (max 12 chars, e.g. 'Action') and a `question` field. When the user picks an option, look up its label in the `commandMap` object to find the command to execute.","For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions.","Do not take action without the user choosing an option first.","When the user wants to create a new spec, they can provide anything: a one-line description, a full task list, meeting notes, a kanban card, a customer email, or a detailed requirements document. Accept whatever format they provide. If it's long, summarize it into a spec title for the slug but preserve the full text as context for discovery.","After running spec new, ask the user if they want full discovery, quick discovery, or skip to spec draft. Full discovery: pre-scan, premise challenge, 6 questions, expansions, architecture, error map, synthesis. Quick discovery: only questions relevant to active concerns, skip expansions and error map. Skip to spec draft: classification \u2192 approve \u2192 execute. Never skip discovery without asking."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{modeOverride:"You are in plan mode. Behave exactly as you would in Claude Code's native plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to have a thorough conversation with the user \u2014 ask probing questions, challenge vague answers, explore alternatives, understand the problem deeply. The quality of everything that follows depends on this conversation.",rules:[...o,"You MUST ask each discovery question using AskUserQuestion tool. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer through AskUserQuestion. Each question \u2192 one AskUserQuestion call \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers as option descriptions in AskUserQuestion \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.","DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","BEFORE asking any discovery questions, conduct a pre-discovery codebase scan: read the project README, CLAUDE.md, and any design docs; check the last 20 git commits (git log --oneline -20); look for TODO files, open issue references, and existing specs; scan the directory structure to understand the project shape. Then present a brief 'Pre-discovery audit' summary: stack detected, recent work themes, open TODOs, existing specs. This gives you CONTEXT to ask INFORMED questions, not blind ones.","After the pre-discovery codebase scan and BEFORE starting questions, ask the user: 'What kind of discovery do you need? A) Explore scope \u2014 I'll help expand, find opportunities, think bigger. B) Technical depth \u2014 I'll focus on architecture, error handling, implementation strategy. C) Validate my plan \u2014 I already know what I want, challenge my assumptions. D) Ship fast \u2014 minimal scope, cut the fat, get to tasks quickly.' Adapt your discovery emphasis accordingly: Explore \u2192 heavy on expansion proposals and dream state; Technical \u2192 heavy on architectural decisions and error/rescue map; Validate \u2192 heavy on premise challenge and pushback; Ship fast \u2192 minimal questions, skip expansions, go direct to classification and tasks.","Before starting discovery questions, challenge the user's initial spec description against what you learned from the codebase scan. Look for: hidden complexity they haven't mentioned, conflicts with existing code, scope that's bigger or smaller than they think, existing modules that overlap with what they're asking for. Share your observations and ask clarifying follow-ups, then proceed to questions.","When asking discovery questions, use your codebase knowledge to offer concrete options alongside the open-ended question. For example, instead of just 'What does the user do today?' present: 'Based on the codebase, I see three likely scenarios: A) ... B) ... C) ... D) Something else \u2014 describe it. Which is closest?' The user can always pick 'something else' but concrete options speed up the conversation and force specificity.","Ask one question at a time using your interactive question tool.","Push back on vague answers \u2014 you will be the one executing this spec, vague answers make your job harder.","When the user gives a short answer, follow up: 'Can you be more specific?'","After collecting discovery answers, synthesize a CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision before generating the spec. Show three columns: where the project is now, what this spec achieves, and where it could go in 6 months. Note: 'This spec moves you from column 1 to column 2. Column 3 is out of scope but worth knowing \u2014 every decision in this spec should keep column 3 possible.' This helps the user see if the scope is right.","When you spot expansion opportunities during discovery (from codebase scan, TODOs, concern requirements, synergies with the current plan), present each as a numbered proposal (1/N, 2/N...). Every proposal MUST include: clear description of WHAT and WHY (how it connects to the current plan); effort estimate as S/M/L/XL with human time and CC time estimates (e.g., 'S (human: ~1 day / CC: ~15 min)' \u2014 not just 'small'); risk assessment as Low/Low-Med/Med/Med-High/High naming the specific risk factor; completeness delta showing X/10 without this and Y/10 with this. Every proposal gets three options: A) Add to scope B) Defer to future spec C) Skip \u2014 not interested, plus 'Chat about this' and 'Skip remaining proposals' escape hatches.","After discovery questions and expansion proposals, identify architectural decisions that must be resolved before implementation. These are decisions where choosing A vs B changes the shape of multiple tasks, the data model, the API surface, or system boundaries. Present each as a concrete technical question with options, a RECOMMENDATION with reasoning, and completeness scores. Show how each option affects downstream work (e.g., 'If you choose B, tasks 3 and 4 need a job queue setup step added'). Only surface decisions that BLOCK implementation \u2014 not preferences or nice-to-haves. If the user says 'I don't know yet', mark it as a risk: 'UNRESOLVED: [decision] TBD. Tasks X-Y may change.' Never allow implementation to start with unresolved architectural decisions \u2014 flag them prominently in the spec.","Before finalizing, map error and rescue paths for every significant codepath in the planned work. Create a table: codepath | what can go wrong | how it's handled. Identify CRITICAL GAPS \u2014 failure modes that the plan doesn't address. Present each critical gap as a decision with options, a recommendation, and completeness scores, just like architectural decisions. Resolved gaps become tasks or acceptance criteria. Unresolved gaps become risk flags. Think like an SRE reviewing a design doc \u2014 what fails at 3am?","After all discovery questions, expansion proposals, architectural decisions, and error mapping are complete, present a DISCOVERY SUMMARY for the user to review: intent, ambition, reversibility, impact, verification, out of scope, the dream state table (current \u2192 this spec \u2192 future), accepted/deferred/skipped expansions, resolved architectural decisions, and the error/rescue map. Ask for confirmation before generating the spec. This is the last chance to catch misunderstandings.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object."],tone:"Curious interviewer who has a stake in the answers and comes PREPARED. You've read the codebase before asking. Challenge assumptions, offer concrete options, think about architecture and failure modes. Think deeply before asking each question."};case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...o,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.","Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":return{modeOverride:"You are in plan mode. Behave exactly as you would in Claude Code's native plan mode. Do not attempt to create, edit, or write any files. Your job is to review the generated spec with the user \u2014 identify gaps, suggest improvements, check if tasks are concrete enough to execute.",rules:[...o,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","Ask the user if they want to refine before approving.","When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+n(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."};case"SPEC_APPROVED":return{rules:[...o,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec.","Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let h=[...o,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive a task from noskills next, do NOT execute it yourself. Spawn the noskills-executor sub-agent using the Agent tool. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the sub-agent completes, review its results briefly, then report to noskills via \`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}\`. You are the orchestrator \u2014 the sub-agent is the implementer.`,"If the sub-agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the sub-agent failure in your next status report so it can be investigated.","After the noskills-executor sub-agent completes a task, spawn a noskills-verifier sub-agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.",`After spawning sub-agents, ALWAYS present a dispatch table showing the FULL pipeline \u2014 not just executors, but also verification and test steps:
|
|
3
|
+
|
|
4
|
+
| Step | Agent | Files | Tasks | Est. Time |
|
|
5
|
+
|------|-------|-------|-------|-----------|
|
|
6
|
+
| 1. Implement | noskills-executor | purge.ts | Tasks 1-6 | ~3 min |
|
|
7
|
+
| 2. Verify | noskills-verifier | purge.ts (read-only) | Validate ACs | ~1 min |
|
|
8
|
+
| 3. Write tests | noskills-executor | purge.test.ts | Task 7 | ~2 min |
|
|
9
|
+
|
|
10
|
+
When agents complete, update with actual time and status (Done / Failed / Found N issues). The user should see the complete plan upfront.
|
|
11
|
+
|
|
12
|
+
Estimate: S ~1min, M ~2min, L ~5min, XL ~10min.`,"The agent that writes implementation code must NOT write tests for that code. Spawn a SEPARATE sub-agent for test writing. This prevents the implementer from writing tests that only confirm what it already knows. The test writer reads the code fresh and tests what it actually does, not what the implementer intended.","When deciding how to split work across sub-agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused sub-agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks.",`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&h.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let r={rules:h,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return c?{...r,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:r}case"BLOCKED":return{rules:[...o,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"COMPLETED":return{rules:[...o,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...o,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},$=5*60*1e3,F=(e,s)=>{let t;switch(e.phase){case"IDLE":t=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":t=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":t=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":t=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":t=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":t=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":t=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"COMPLETED":t=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:t=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:s.map(a=>a.id),resumeHint:t}},B=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 COMPLETED",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let s=new Date(e.lastCalledAt).getTime();if(Date.now()-s>$)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 COMPLETED",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},ee=(e,s,t,a,c,p,i)=>{let g=F(e,s),l=a?.maxIterationsBeforeRestart??15,o=a?.allowGit??!1,u=U(e,l,o,c),h=B(e),r;switch(e.phase){case"IDLE":r=q(s,D,t.length,i);break;case"DISCOVERY":r=M(e,s,t);break;case"DISCOVERY_REVIEW":r=V(e,s);break;case"SPEC_DRAFT":r=Q(e);break;case"SPEC_APPROVED":r=j(e);break;case"EXECUTING":r=H(e,s,t,l,c,p);break;case"BLOCKED":r=K(e);break;case"COMPLETED":r=z(e);break;default:r=q(s,D,t.length,i)}let d={...r,meta:g,behavioral:u};h!==void 0&&(d={...d,protocolGuide:h});let y=Y(e,s,i);if(y.length>0){let E=y.map(({label:w,description:C})=>({label:w,description:C})),v={};for(let w of y)v[w.label]=w.command;d={...d,interactiveOptions:E,commandMap:v}}return d},Y=(e,s,t)=>{switch(e.phase){case"IDLE":{let a=[],p=(t?.existingSpecs??[]).filter(i=>i.phase!=="COMPLETED");s.length===0&&a.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:n("concern add <id> [<id2> ...]")}),a.push({label:"Start a new spec",description:"Begin discovery questions for a new feature",command:n('spec new "description"')});for(let i of p.slice(0,2))a.push({label:`Continue: ${i.name} (${i.phase})`,description:i.detail??`Iteration ${i.iteration}`,command:n(`spec switch ${i.name}`)});return s.length>0&&a.push({label:"Edit concerns",description:`Currently: ${s.map(i=>i.id).join(", ")}`,command:n("concern list")}),a.slice(0,4)}case"DISCOVERY_REVIEW":return[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:n('next --answer="approve"')},{label:"Revise answers",description:"Correct one or more discovery answers",command:n(`next --answer='{"revise":{...}}'`)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:n("approve")},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:n(`next --answer='{"refinement":"..."}'`)},{label:"Start over",description:"Reset the spec and start fresh",command:n("reset")}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin implementing the tasks",command:n('next --answer="start"')},{label:"Not yet",description:'Save for later \u2014 resume with noskills next --answer="start"',command:""}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:n('next --answer="resolution"')},{label:"Reset spec",description:"Abandon this spec and start over",command:n("reset")}];case"COMPLETED":return[{label:"New spec",description:"Start a new feature spec",command:n('spec new "description"')},{label:"Reopen spec",description:"Reopen this spec for revision",command:n("reopen")},{label:"Check status",description:"Review completed spec summary",command:n("status")}];default:return[]}},W="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",q=(e,s,t,a)=>({phase:"IDLE",instruction:"Present the welcome dashboard and interactive options to the user. Show existing specs if any, then present choices. IMPORTANT: Present ALL available concerns to the user \u2014 never truncate the list. Split across multiple AskUserQuestion calls if needed.",welcome:W,existingSpecs:a?.existingSpecs??[],availableConcerns:s.map(c=>({id:c.id,description:c.description})),activeConcerns:e.map(c=>c.id),activeRulesCount:a?.rulesCount??t,hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),M=(e,s,t)=>{let a=S(s),c=e.discovery.answers.length,p=P(e.discovery.answers),i=e.discovery.audience==="agent";if(p)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:c,context:{rules:t,concernReminders:[]},transition:{onComplete:n("approve")}};if(i){let o=e.discovery.currentQuestion,u=a[o];if(u===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:c,context:{rules:t,concernReminders:[]},transition:{onComplete:n("approve")}};let h={id:u.id,text:u.text,concerns:[...u.concerns],extras:u.extras.map(r=>r.text)};return{phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${n('next --agent --answer="<answer>"')}\``,questions:[h],answeredCount:c,currentQuestion:o,totalQuestions:a.length,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n('next --agent --answer="<answer>"')}`}}}let g=new Set(e.discovery.answers.map(o=>o.questionId));return{phase:"DISCOVERY",instruction:"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:a.filter(o=>!g.has(o.id)).map(o=>({id:o.id,text:o.text,concerns:[...o.concerns],extras:o.extras.map(u=>u.text)})),answeredCount:c,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},V=(e,s)=>{let t=S(s);return{phase:"DISCOVERY_REVIEW",instruction:"Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.",answers:e.discovery.answers.map(c=>{let p=t.find(i=>i.id===c.questionId);return{questionId:c.questionId,question:p?.text??c.questionId,answer:c.answer}}),transition:{onApprove:n('next --answer="approve"'),onRevise:n(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`)}}},Q=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${n(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+n(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},j=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),G=(e,s)=>{if(s===null)return!1;let t=e.toLowerCase();return t.includes("mobile")||t.includes("layout")||t.includes("interaction design")?s.involvesWebUI:t.includes("ui state")||t.includes("skeleton ui")?s.involvesWebUI||s.involvesCLI:t.includes("api doc")||t.includes("public api")?s.involvesPublicAPI:t.includes("migration")||t.includes("backward compat")||t.includes("deprecat")?s.involvesMigration:t.includes("audit trail")||t.includes("access control")||t.includes("data handling")||t.includes("data retention")?s.involvesDataHandling:!0},X=(e,s,t,a,c,p,i,g)=>{let l=[],o=new Set(g??[]),u=0,h=()=>`ac-${++u}`;if(a!==null)for(let r of a.items)o.has(r.id)||l.push({id:r.id,text:`[DEBT from iteration ${r.since}] ${r.text}`});if(s&&l.push({id:h(),text:`[FAILED] Tests \u2014 fix this first: ${t.slice(0,200)}`}),p!=null)for(let r of p.verification){let d=h();o.has(d)||l.push({id:d,text:r})}for(let r of e)if(r.acceptanceCriteria!==void 0&&r.acceptanceCriteria.length>0)for(let d of r.acceptanceCriteria){if(!G(d,c))continue;let y=h();o.has(y)||l.push({id:y,text:`(${r.id}) ${d}`})}if(i!==void 0)for(let r of i){let d=h();o.has(d)||l.push({id:d,text:`(folder: ${r.folder}) ${r.rule}`})}return l},H=(e,s,t,a,c,p)=>{let i=O(s),g=e.execution.iteration>=a,l=e.execution.lastVerification?.passed===!1,o=e.execution.lastVerification?.output??"",u=c?.tasks??[],h=e.execution.completedTasks??[],r=new Set(h),d=u.find(m=>!r.has(m.id))??null,y=d!==null?{id:d.id,title:d.title,totalTasks:u.length,completedTasks:h.length}:void 0;if(e.execution.awaitingStatusReport){let m=X(s,l,o,e.execution.debt,e.classification,c,p,e.execution.naItems),k={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:m,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return l&&(k={...k,verificationFailed:!0,verificationOutput:o.slice(0,2e3)}),k}let E=(e.execution.lastProgress??"").includes("Task not accepted"),v=e.execution.debt?.items??[],w=e.execution.debt?.unaddressedIterations??0,C=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",I;if(l)I="Verification FAILED. Fix the failing tests before continuing.";else if(E&&v.length>0){let m=w>=3?` These items have been outstanding for ${w} iterations.`:"";I=`Task not accepted \u2014 ${v.length} remaining item(s) must be addressed before this task can be completed.${m} Address them, then submit a new status report.`}else I=C;let f={phase:"EXECUTING",instruction:I,task:y,context:{rules:t,concernReminders:x(s)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(E&&v.length>0&&(f={...f,taskRejected:!0,rejectionReason:`${v.length} remaining item(s) must be addressed.`,rejectionRemaining:v.map(m=>m.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let m=e.execution.debt.unaddressedIterations??0,k=m>=3?`URGENT: These items have been unaddressed for ${m} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";f={...f,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:k}}}if(l){let m=o.slice(0,2e3);f={...f,verificationFailed:!0,verificationOutput:m}}i.length>0&&(f={...f,concernTensions:i}),g&&(f={...f,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let b=[...e.decisions].reverse().find(m=>!m.promoted);return b!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(f={...f,promotePrompt:{decisionId:b.id,question:b.question,choice:b.choice,prompt:`You just resolved a decision: "${b.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${b.choice}"`)}\``}}),f},K=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),z=e=>({phase:"COMPLETED",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length,completionReason:e.completionReason,completionNote:e.completionNote}});export{T as a,S as b,P as c,ee as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as E,b as A,c as I}from"./chunk-
|
|
2
|
+
import{a as E,b as A,c as I}from"./chunk-IQQEVKBP.js";import{a as w}from"./chunk-LFNUSULJ.js";import{b as v}from"./chunk-L7RS6MQ5.js";import{f as D}from"./chunk-P2MUEKFT.js";import{b as l,f as g,g as k,h as C,i as h}from"./chunk-YVN2NZL4.js";import{g as a}from"./chunk-FFWPJP7A.js";import{j as b}from"./chunk-6VHZQNHX.js";var u=v(),O=/\/\*\*\s*([\s\S]*?)\s*\*\//g,R=/export\s+(const|function|class|type|interface)\s+(\w+)/g,$=/@example/,S=s=>{let n=[],i;for(R.lastIndex=0;(i=R.exec(s))!==null;){let e=i.index,t=i[2];if(t===void 0)continue;let c=s.substring(0,e).split(`
|
|
3
3
|
`).length,p=null,m=[...s.substring(0,e).matchAll(O)];if(m.length>0){let r=m[m.length-1];if(r!==void 0){let d=(r.index??0)+r[0].length,f=s.substring(d,e);/^\s*$/.test(f)&&(p=r[1]??null)}}n.push({jsdoc:p,symbolName:t,line:c})}return n},_=(s,n,i)=>{let e=[];if(s===null)return e.push("missing-description"),e;let t=s.split(`
|
|
4
4
|
`)[0]?.trim();return(!t||t.startsWith("@"))&&e.push("empty-description"),i&&!$.test(s)&&e.push("missing-example"),e},F=async(s={})=>{let{root:n=".",requireExamples:i=!1}=s,e=await E(n),t=[],o=0,c=0;for(let p of e){let y=await I(p.path);for(let m of y){let r=A(m,p.path),d;try{d=await b.runtime.fs.readTextFile(r)}catch{continue}o++;let f=S(d);for(let{jsdoc:T,symbolName:x,line:P}of f){c++;let M=_(T,x,i);for(let N of M)t.push({file:r,symbol:x,issue:N,line:P})}}}return{isValid:t.length===0,issues:t,filesChecked:o,symbolsChecked:c}},J=s=>{switch(s){case"missing-description":return"Missing JSDoc documentation";case"missing-param":return"Missing @param documentation";case"missing-returns":return"Missing @returns documentation";case"missing-example":return"Missing @example";case"empty-description":return"Empty description"}},j=s=>D.fromPromise(()=>F(s)),V=s=>a.ok({root:"."}),q=s=>{if(a.isFail(s))return u.writeln(g("\u2717"),l(" "+String(s.error))),a.fail({exitCode:1});let{value:n}=s;if(u.writeln(h("\u2139"),l(` Checked ${n.filesChecked} files, ${n.symbolsChecked} symbols.`)),!n.isValid){u.writeln(g("\u2717"),l(` Found ${n.issues.length} documentation issues:`));let i=new Map;for(let e of n.issues){let t=i.get(e.file)??[];t.push(e),i.set(e.file,t)}for(let[e,t]of i){u.writeln(C("\u26A0"),l(" "+e));for(let o of t){let c=o.line!==void 0?`:${o.line}`:"";u.writeln(h("\u2139"),l(` ${o.symbol}${c}: ${J(o.issue)}`))}}return a.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All documentation is valid.")),a.ok(void 0)},B=w.createTrigger({handler:j,adaptInput:V,adaptOutput:q}),Q=async s=>await B({command:"validate-docs",args:[],flags:{}});export{F as a,j as b,B as c,Q as d};
|
|
@@ -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-IQQEVKBP.js";import{a as v}from"./chunk-LFNUSULJ.js";import{b as y}from"./chunk-L7RS6MQ5.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,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as w}from"./chunk-
|
|
2
|
+
import{b as w}from"./chunk-L7RS6MQ5.js";import{b as r,f as n,g as h}from"./chunk-YVN2NZL4.js";import{a as y}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import{j as v}from"./chunk-6VHZQNHX.js";var m=w(),x=["ci","chore","docs","feat","fix","perf","refactor","revert","test"],C=/^(\w+)(?:\(([^)]+)\))?!?:\s{1,5}.+$/,M=(p,e={})=>{let o=e.allowAsterisk??!0,a=e.allowMultipleScopes??!0,c=e.forceScope??!1,f=new Set(e.types??x),s=[],l=p.split(`
|
|
3
3
|
`)[0]?.trim()??"";if(l==="")return{valid:!1,issues:["commit message is empty"]};if(l.startsWith("Merge "))return{valid:!0,issues:[]};let d=l.match(C);if(d===null)return s.push(`invalid format: expected "type(scope): message", got: "${l}"`),{valid:!1,issues:s};let g=d[1].toLowerCase(),t=d[2];return f.has(g)||s.push(`invalid type "${g}". Must be one of: ${[...f].join(", ")}`),c&&(t===void 0||t.trim()==="")&&s.push("scope is required: use type(scope): message"),t!==void 0&&t.trim()!==""&&(t==="*"&&!o&&s.push('wildcard scope "*" is not allowed (allowAsterisk is false)'),t.includes(",")&&(a?t.split(",").map(u=>u.trim()).filter(u=>u==="").length>0&&s.push("invalid scope: each comma-separated scope must be non-empty"):s.push("multiple scopes are not allowed (allowMultipleScopes is false)"))),{valid:s.length===0,issues:s}},_=async p=>{let e=y(p??[],{string:["message"],boolean:["help"],alias:{h:"help",m:"message"}});if(e.help)return console.log(`eser codebase validate-commit-msg \u2014 Validate conventional commit format
|
|
4
4
|
`),console.log("Usage:"),console.log(" eser codebase validate-commit-msg <commit-msg-file>"),console.log(" eser codebase validate-commit-msg --message 'feat(x): msg'"),i.ok(void 0);let o;if(e.message!==void 0)o=e.message;else if(e._.length>0)try{o=await v.runtime.fs.readTextFile(String(e._[0]))}catch{return m.writeln(n("\u2717"),r(` cannot read commit message file: ${e._[0]}`)),i.fail({exitCode:1})}else return m.writeln(n("\u2717"),r(" no commit message provided")),i.fail({exitCode:1});let a=M(o);if(a.valid)return m.writeln(h("\u2713"),r(" commit message is valid")),i.ok(void 0);for(let c of a.issues)m.writeln(n("\u2717"),r(" "+c));return i.fail({exitCode:1})};export{M as a,_ as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{j as p}from"./chunk-
|
|
2
|
+
import{j as p}from"./chunk-6VHZQNHX.js";import{d as g}from"./chunk-5WJ6AUNY.js";var y={};g(y,{CommandBuilder:()=>a,CommandError:()=>u,exec:()=>f,parseCommand:()=>l});var u=class extends Error{constructor(e,n,s,o){super(e);this.command=n;this.code=s;this.stderr=o;this.name="CommandError"}};var m=new TextDecoder,a=class r{#e;#r;#t;constructor(t,e=[],n={}){this.#e=t,this.#r=e,this.#t={throwOnError:!0,stdout:"piped",stderr:"piped",...n}}cwd(t){return new r(this.#e,this.#r,{...this.#t,cwd:t})}env(t,e){let n=this.#t.env??{},s;return typeof t=="string"&&e!==void 0?s={...n,[t]:e}:t!==null&&typeof t=="object"?s={...n,...t}:s=n,new r(this.#e,this.#r,{...this.#t,env:s})}stdin(t){return new r(this.#e,this.#r,{...this.#t,stdin:t})}stdout(t){return new r(this.#e,this.#r,{...this.#t,stdout:t})}stderr(t){return new r(this.#e,this.#r,{...this.#t,stderr:t})}timeout(t){return new r(this.#e,this.#r,{...this.#t,timeout:t})}noThrow(){return new r(this.#e,this.#r,{...this.#t,throwOnError:!1})}quiet(){return new r(this.#e,this.#r,{...this.#t,stdout:"null",stderr:"null"})}printCommand(){let t=[this.#e,...this.#r].join(" ");return console.log(`$ ${t}`),this}async spawn(){let{runtime:t}=p,e=await t.exec.spawn(this.#e,this.#r,{cwd:this.#t.cwd,env:this.#t.env,stdin:this.#t.stdin,stdout:this.#t.stdout,stderr:this.#t.stderr});if(!e.success&&this.#t.throwOnError===!0){let n=m.decode(e.stderr);throw new u(`Command failed with exit code ${e.code}: ${this.#e}`,this.#e,e.code,n)}return e}async text(t="stdout"){let e=await this.spawn();switch(t){case"stdout":return m.decode(e.stdout).trim();case"stderr":return m.decode(e.stderr).trim();case"combined":return(m.decode(e.stdout)+m.decode(e.stderr)).trim()}}async json(){let t=await this.text();return JSON.parse(t)}async lines(){let t=await this.text();return t===""?[]:t.split(`
|
|
3
3
|
`)}async bytes(){return(await this.spawn()).stdout}async code(){return(await this.noThrow().spawn()).code}pipe(t){return new h([this,t])}child(){let{runtime:t}=p;return t.exec.spawnChild(this.#e,this.#r,{cwd:this.#t.cwd,env:this.#t.env,stdin:this.#t.stdin??"piped",stdout:this.#t.stdout??"piped",stderr:this.#t.stderr??"piped"})}},h=class r{#e;constructor(t){this.#e=t}pipe(t){return new r([...this.#e,t])}async text(){let t="";for(let e of this.#e){let n=await e.spawn();t=m.decode(n.stdout)}return t.trim()}async lines(){let t=await this.text();return t===""?[]:t.split(`
|
|
4
4
|
`)}};var l=(r,t)=>{let e=[];for(let s=0;s<r.length;s++){let o=r[s];if(o!==void 0&&e.push(o),s<t.length){let i=t[s];Array.isArray(i)?e.push(i.map(c=>w(String(c))).join(" ")):i!=null&&e.push(w(String(i)))}}let n=e.join("").trim();return C(n)},w=r=>/[\s"'\\$`]/.test(r)?`'${r.replace(/'/g,"'\\''")}'`:r,C=r=>{let t=[],e="",n=!1,s=!1,o=!1;for(let c=0;c<r.length;c++){let d=r[c];if(o){e+=d,o=!1;continue}if(d==="\\"){o=!0;continue}if(d==="'"&&!s){n=!n;continue}if(d==='"'&&!n){s=!s;continue}if(d===" "&&!n&&!s){e.length>0&&(t.push(e),e="");continue}e+=d}e.length>0&&t.push(e);let i=t[0];return i===void 0?["",[]]:[i,t.slice(1)]};var f=(r,...t)=>{let[e,n]=l(r,t);return new a(e,n)};export{u as a,a as b,l as c,f as d,y as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as b,b as G,c as R}from"./chunk-
|
|
2
|
+
import{a as b,b as G,c as R}from"./chunk-EXP2TZZC.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-MBG7SPPO.js";import{b as r,d as i,f as w,g as C,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as y}from"./chunk-5MVJUALI.js";import{a as k}from"./chunk-DRCKMHUI.js";import{a as f,b as g}from"./chunk-FFWPJP7A.js";import{g as T,i as m}from"./chunk-6VHZQNHX.js";import{g as ie,m as O,n as J,o as I,p as le}from"./chunk-BQT5RJZB.js";var de="# eser CLI completions",B="eser",te=async e=>{try{return await m.fs.readTextFile(e)}catch{return""}},me=async e=>{try{return await m.fs.stat(e),!0}catch{return!1}},se=async e=>{let t=R(e,B);if(t.completionType==="file")return await me(t.completionsFile);let s=await te(t.rcFile),n=G(e,B);return s.includes(n)},ne=async e=>{let t=R(e,B),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=m.path.dirname(n);try{await m.fs.mkdir(o,{recursive:!0})}catch{}await m.fs.writeTextFile(n,`# eser CLI completions
|
|
3
3
|
# This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
|
|
4
4
|
complete -c eser -f
|
|
5
5
|
complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as o}from"./chunk-OM5GSS2H.js";var a={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY","COMPLETED"],DISCOVERY:["DISCOVERY_REVIEW","COMPLETED"],DISCOVERY_REVIEW:["DISCOVERY_REVIEW","SPEC_DRAFT","COMPLETED"],SPEC_DRAFT:["SPEC_DRAFT","SPEC_APPROVED","COMPLETED"],SPEC_APPROVED:["EXECUTING","COMPLETED"],EXECUTING:["COMPLETED","BLOCKED"],BLOCKED:["EXECUTING","COMPLETED"],COMPLETED:["IDLE","DISCOVERY"]},c=(e,t)=>a[e].includes(t),s=(e,t)=>{if(!c(e,t))throw new Error(`Invalid phase transition: ${e} \u2192 ${t}. Allowed: ${a[e].join(", ")}`)},h=(e,t)=>(s(e.phase,t),{...e,phase:t}),E=(e,t,n)=>(s(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:t,branch:n,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human"},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[]}),u=(e,t,n)=>{if(e.phase!=="DISCOVERY"&&e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let i=[...e.discovery.answers.filter(r=>r.questionId!==t),{questionId:t,answer:n}];return{...e,discovery:{...e.discovery,answers:i}}},m=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"DISCOVERY_REVIEW",discovery:{...e.discovery,completed:!0},specState:{path:o.specFile(e.spec),status:"draft"}}},d=e=>(s(e.phase,"SPEC_DRAFT"),{...e,phase:"SPEC_DRAFT"}),S=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot advance discovery question in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,currentQuestion:e.discovery.currentQuestion+1}}},C=e=>(s(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),D=e=>(s(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{answers:[],completed:!0,currentQuestion:0,audience:"human"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]}});var I=(e,t)=>(s(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${t}`}}),P=(e,t)=>({...e,decisions:[...e.decisions,t]}),R=(e,t,n)=>(s(e.phase,"COMPLETED"),{...e,phase:"COMPLETED",completionReason:t,completedAt:new Date().toISOString(),completionNote:n??null}),F=e=>{if(e.phase!=="COMPLETED")throw new Error(`Cannot reopen in phase: ${e.phase}`);return{...e,phase:"DISCOVERY",reopenedFrom:e.completionReason,completionReason:null,completedAt:null,completionNote:null,discovery:{...e.discovery,completed:!1,currentQuestion:0},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},classification:null}},O=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human"},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[],classification:null,completionReason:null,completedAt:null,completionNote:null,reopenedFrom:null});export{h as a,E as b,u as c,m as d,d as e,S as f,C as g,D as h,I as i,P as j,R as k,F as l,O as m};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as d}from"./chunk-
|
|
2
|
+
import{i as d}from"./chunk-6VHZQNHX.js";var l=[["go.mod","go"],["deno.json","deno"],["deno.jsonc","deno"],["package.json","node"]],g=async r=>{for(let[c,n]of l)try{return await d.fs.stat(`${r}/${c}`),{type:n,configFile:c}}catch{}return{type:"unknown",configFile:void 0}},f=(r,c)=>{let n=[],t=[],e=r.dependencies;if(e===void 0)return{instructions:n,warnings:t};let i=r.language,o=c.type;if(o!=="unknown"&&(i==="go"&&o==="go"||i==="typescript"&&(o==="deno"||o==="node")||i==="javascript"&&(o==="deno"||o==="node")||t.push(`Recipe '${r.name}' is for ${i}, but detected ${o} project (${c.configFile}).`)),e.go!==void 0&&e.go.length>0)for(let s of e.go)n.push(`go get ${s}`);if(e.jsr!==void 0&&e.jsr.length>0)for(let s of e.jsr)n.push(`deno add ${s}`);if(e.npm!==void 0&&e.npm.length>0)for(let s of e.npm)n.push(`npm install ${s}`);return{instructions:n,warnings:t}},y=async(r,c,n)=>{let t=[];for(let e of r){if(n?.dryRun===!0){t.push({command:e,success:!0});continue}n?.verbose===!0&&console.log(` [install] ${e}`);let i=e.split(/\s+/),o=i[0],s=i.slice(1);try{let a=await d.exec.spawn(o,s,{cwd:c,stdout:"inherit",stderr:"inherit"});if(!a.success){t.push({command:e,success:!1,error:`Exit code ${a.code}`});break}t.push({command:e,success:!0})}catch(a){let u=a instanceof Error?a.message:String(a);t.push({command:e,success:!1,error:u});break}}return t};export{g as a,f as b,y as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as B,c as L}from"./chunk-6E6JUBFH.js";import{a as P,b,c as w,d as O,e as E,f as I,g as a,h as N,i as _,j as W,k as $,l as F,m as p,n as j,o as S,p as A,q as T,y as M}from"./chunk-BQT5RJZB.js";import{d as Q}from"./chunk-5WJ6AUNY.js";var U={};Q(U,{AlreadyExistsError:()=>w,NotFoundError:()=>b,ProcessError:()=>O,RuntimeCapabilityError:()=>P,buildCommand:()=>R,clearWorkerdEnv:()=>L,createRuntime:()=>H,detectExecutionContext:()=>y,detectInvoker:()=>h,detectRuntime:()=>a,getArch:()=>j,getCliPrefix:()=>J,getHomedir:()=>S,getPlatform:()=>p,getPlatformInfo:()=>T,getRuntimeVersion:()=>N,getTmpdir:()=>A,isBrowser:()=>W,isCommandInPath:()=>v,isEdge:()=>F,isRuntime:()=>_,isServer:()=>$,matchCliPrefix:()=>D,populateEnvFromContext:()=>B,posixPath:()=>I,resolvePathDirs:()=>g,runtime:()=>i,toPosix:()=>E});var g=(e,n)=>{let t=n==="windows"?";":":";return e.split(t).filter(r=>r.length>0)},l=new Set(["deno","node","bun"]),h=(e,n,t,r,o,s)=>{let d=l.has(e)?e:n;if(!l.has(d))return{invoker:"binary",mode:"installed"};if(d==="bun")return r.BUN_INSTALL!==void 0?{invoker:"bun",mode:"installed"}:{invoker:"bunx",mode:"on-demand"};if(d==="node"){let m=t[1]??"";if(m.includes("_npx")||m.includes("/npx"))return{invoker:"npx",mode:"on-demand"};if(m.includes("pnpm")||m.includes("pnpx"))return{invoker:"pnpx",mode:"on-demand"};let c=r.npm_execpath??"";return c.includes("npx")?{invoker:"npx",mode:"on-demand"}:c.includes("pnpm")?{invoker:"pnpx",mode:"on-demand"}:(r.npm_config_user_agent??"").includes("pnpm")?{invoker:"pnpm",mode:"installed"}:{invoker:"npm",mode:"installed"}}return d==="deno"?o!==void 0&&(o.startsWith("jsr:")||o.startsWith("https:"))?{invoker:"deno",mode:"on-demand"}:s===!0?{invoker:"dev",mode:"dev"}:{invoker:"deno",mode:"installed"}:{invoker:"unknown",mode:"installed"}},R=(e,n,t)=>e==="npx"?`npx ${t.npmPackage}`:e==="pnpx"?`pnpx ${t.npmPackage}`:e==="bunx"?`bunx ${t.npmPackage}`:e==="deno"&&n==="on-demand"?`deno run --allow-all jsr:${t.jsrPackage}`:e==="dev"?t.devCommand:t.command,v=async e=>{let n=p(),t=n==="windows"?`${e}.exe`:e,r=i.env.get("PATH")??"",o=g(r,n);for(let s of o)try{return await i.fs.stat(i.path.join(s,t)),!0}catch{continue}return!1},D=(e,n)=>{for(let t of e){let r=n.indexOf(t);if(r>=0)return n.slice(0,r+1).join(" ");let o=n.findIndex(s=>s.endsWith(`/${t}`)||s.endsWith(`\\${t}`)||s.includes(`:${t}`));if(o>=0)return n.slice(0,o+1).join(" ")}},J=async(e,n)=>{let t=await y(e),r=i.process.argv;for(let o of n){if(r.includes(o))return`${t.command} ${o}`;if(r.some(d=>d.endsWith(`/${o}`)||d.endsWith(`\\${o}`)||d.includes(`:${o}`)))return t.command}},y=async e=>{let n=i.path.basename(i.process.execPath()),t=a(),r=i.process.argv,o=import.meta.url,s=l.has(n)?n:t,d={BUN_INSTALL:i.env.get("BUN_INSTALL"),npm_execpath:i.env.get("npm_execpath"),npm_config_user_agent:i.env.get("npm_config_user_agent")},m=!1;if(s==="deno"&&o.startsWith("file://")){let k=i.process.cwd();try{let x=i.path.join(k,"deno.json"),C=await i.fs.readTextFile(x),u=JSON.parse(C).tasks;u!==void 0&&"cli"in u&&(m=!0)}catch{}if(!m)try{let x=i.path.join(k,"package.json"),C=await i.fs.readTextFile(x),u=JSON.parse(C).scripts;u!==void 0&&"cli"in u&&(m=!0)}catch{}}let{invoker:c,mode:f}=h(n,t,r,d,o,m),K=l.has(s)?s:"compiled",q=R(c,f,e),z=await v(e.command);return{runtime:K,mode:f,invoker:c,command:q,isInPath:z}};var V={deno:async()=>(await import("./deno-
|
|
2
|
+
import{b as B,c as L}from"./chunk-6E6JUBFH.js";import{a as P,b,c as w,d as O,e as E,f as I,g as a,h as N,i as _,j as W,k as $,l as F,m as p,n as j,o as S,p as A,q as T,y as M}from"./chunk-BQT5RJZB.js";import{d as Q}from"./chunk-5WJ6AUNY.js";var U={};Q(U,{AlreadyExistsError:()=>w,NotFoundError:()=>b,ProcessError:()=>O,RuntimeCapabilityError:()=>P,buildCommand:()=>R,clearWorkerdEnv:()=>L,createRuntime:()=>H,detectExecutionContext:()=>y,detectInvoker:()=>h,detectRuntime:()=>a,getArch:()=>j,getCliPrefix:()=>J,getHomedir:()=>S,getPlatform:()=>p,getPlatformInfo:()=>T,getRuntimeVersion:()=>N,getTmpdir:()=>A,isBrowser:()=>W,isCommandInPath:()=>v,isEdge:()=>F,isRuntime:()=>_,isServer:()=>$,matchCliPrefix:()=>D,populateEnvFromContext:()=>B,posixPath:()=>I,resolvePathDirs:()=>g,runtime:()=>i,toPosix:()=>E});var g=(e,n)=>{let t=n==="windows"?";":":";return e.split(t).filter(r=>r.length>0)},l=new Set(["deno","node","bun"]),h=(e,n,t,r,o,s)=>{let d=l.has(e)?e:n;if(!l.has(d))return{invoker:"binary",mode:"installed"};if(d==="bun")return r.BUN_INSTALL!==void 0?{invoker:"bun",mode:"installed"}:{invoker:"bunx",mode:"on-demand"};if(d==="node"){let m=t[1]??"";if(m.includes("_npx")||m.includes("/npx"))return{invoker:"npx",mode:"on-demand"};if(m.includes("pnpm")||m.includes("pnpx"))return{invoker:"pnpx",mode:"on-demand"};let c=r.npm_execpath??"";return c.includes("npx")?{invoker:"npx",mode:"on-demand"}:c.includes("pnpm")?{invoker:"pnpx",mode:"on-demand"}:(r.npm_config_user_agent??"").includes("pnpm")?{invoker:"pnpm",mode:"installed"}:{invoker:"npm",mode:"installed"}}return d==="deno"?o!==void 0&&(o.startsWith("jsr:")||o.startsWith("https:"))?{invoker:"deno",mode:"on-demand"}:s===!0?{invoker:"dev",mode:"dev"}:{invoker:"deno",mode:"installed"}:{invoker:"unknown",mode:"installed"}},R=(e,n,t)=>e==="npx"?`npx ${t.npmPackage}`:e==="pnpx"?`pnpx ${t.npmPackage}`:e==="bunx"?`bunx ${t.npmPackage}`:e==="deno"&&n==="on-demand"?`deno run --allow-all jsr:${t.jsrPackage}`:e==="dev"?t.devCommand:t.command,v=async e=>{let n=p(),t=n==="windows"?`${e}.exe`:e,r=i.env.get("PATH")??"",o=g(r,n);for(let s of o)try{return await i.fs.stat(i.path.join(s,t)),!0}catch{continue}return!1},D=(e,n)=>{for(let t of e){let r=n.indexOf(t);if(r>=0)return n.slice(0,r+1).join(" ");let o=n.findIndex(s=>s.endsWith(`/${t}`)||s.endsWith(`\\${t}`)||s.includes(`:${t}`));if(o>=0)return n.slice(0,o+1).join(" ")}},J=async(e,n)=>{let t=await y(e),r=i.process.argv;for(let o of n){if(r.includes(o))return`${t.command} ${o}`;if(r.some(d=>d.endsWith(`/${o}`)||d.endsWith(`\\${o}`)||d.includes(`:${o}`)))return t.command}},y=async e=>{let n=i.path.basename(i.process.execPath()),t=a(),r=i.process.argv,o=import.meta.url,s=l.has(n)?n:t,d={BUN_INSTALL:i.env.get("BUN_INSTALL"),npm_execpath:i.env.get("npm_execpath"),npm_config_user_agent:i.env.get("npm_config_user_agent")},m=!1;if(s==="deno"&&o.startsWith("file://")){let k=i.process.cwd();try{let x=i.path.join(k,"deno.json"),C=await i.fs.readTextFile(x),u=JSON.parse(C).tasks;u!==void 0&&"cli"in u&&(m=!0)}catch{}if(!m)try{let x=i.path.join(k,"package.json"),C=await i.fs.readTextFile(x),u=JSON.parse(C).scripts;u!==void 0&&"cli"in u&&(m=!0)}catch{}}let{invoker:c,mode:f}=h(n,t,r,d,o,m),K=l.has(s)?s:"compiled",q=R(c,f,e),z=await v(e.command);return{runtime:K,mode:f,invoker:c,command:q,isInPath:z}};var V={deno:async()=>(await import("./deno-I5YAWOB6.js")).createDenoRuntime(),node:async()=>(await import("./node-ZGM6SXXI.js")).createNodeRuntime(),bun:async()=>(await import("./bun-HIMXX54I.js")).createBunRuntime(),workerd:async()=>(await import("./workerd-LOWXXQEU.js")).createWorkerdRuntime(),browser:async()=>(await import("./browser-JGBNWUEQ.js")).createBrowserRuntime()},X=["fs","exec","env","path","process"],Y=e=>e!==void 0&&X.some(n=>e[n]!==void 0),Z=(e,n,t)=>({name:e.name,version:e.version,capabilities:t,fs:n.fs??e.fs,path:n.path??e.path,exec:n.exec??e.exec,env:n.env??e.env,process:n.process??e.process}),H=async e=>{let n=a(),t=V[n],r=t!==void 0?await t():M(n),o=e?.capabilities?{...r.capabilities,...e.capabilities}:r.capabilities;return e!==void 0&&Y(e)?Z(r,e,o):e?.capabilities?{...r,capabilities:o}:r},i=await H();export{g as a,h as b,R as c,v as d,D as e,J as f,y as g,H as h,i,U as j};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as h,b as u,c as S,d as k,e as g,f as m,g as f}from"./chunk-
|
|
2
|
+
import{a as h,b as u,c as S,d as k,e as g,f as m,g as f}from"./chunk-YURNTYEP.js";import{a as c}from"./chunk-J7YTWK67.js";var y=class{capabilities=["text_generation","streaming"];provider="opencode";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=w(this.config,e,"json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr),t=await k(s.stdout,this.modelId),p=await s.waitForExit(),a=await l,d=m("opencode",p.code,a);if(d!==null)throw d;return t}async*streamText(e,r){let o=w(this.config,e,"stream-json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr);try{for await(let d of S(s.stdout)){let x=v(d);x!==null&&(yield x)}let t=await s.waitForExit(),p=await l,a=m("opencode",t.code,p);a!==null&&(yield{kind:"error",error:a})}catch(t){t instanceof c?yield{kind:"error",error:t}:yield{kind:"error",error:new c(t instanceof Error?t.message:String(t),{provider:"opencode",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},b={provider:"opencode",async createModel(n){let e=await h("opencode",n);return new y(e,n)}},w=(n,e,r)=>{let o=["--output-format",r];o.push("--model",n.model),e.maxTokens!==void 0&&o.push("--max-tokens",String(e.maxTokens));let i=n.properties?.args;return i!==void 0&&o.push(...i),o},v=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content_block_delta"||e.type==="assistant"){let r=e.delta?.text??e.message?.content?.[0]?.text;return r!==void 0?{kind:"content_delta",textDelta:r}:null}return e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown OpenCode error",{provider:"opencode"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{m as w,o as R}from"./chunk-
|
|
2
|
+
import{m as w,o as R}from"./chunk-GKOMIH2B.js";import{i as g}from"./chunk-6VHZQNHX.js";var p=class extends Error{constructor(r){super(`Required variable '${r}' has no value and no default`),this.name="MissingVariableError"}},m=(e,r)=>{let t={};for(let n of e){let a=r[n.name];if(a!==void 0)t[n.name]=a;else if(n.default!==void 0)t[n.name]=n.default;else throw new p(n.name)}return t},v=(e,r)=>e.replace(/\{\{\s*\.(\w+)\s*\}\}/g,(t,n)=>n in r?r[n]:t);var y=class extends Error{constructor(r){super(`Circular dependency detected: ${r.join(" \u2192 ")}`),this.name="CyclicDependencyError"}},f=class extends Error{constructor(r,t){super(`Recipe '${r}' requires '${t}', which is not in the registry`),this.name="MissingDependencyError"}},b=(e,r)=>{let t=new Map;for(let s of r)t.set(s.name,s);if(t.get(e)===void 0)throw new f("<root>",e);let a=[],i=new Set,o=new Set,l=(s,d)=>{if(i.has(s))return;if(o.has(s))throw new y([...d,s]);let c=t.get(s);if(c===void 0)throw new f(d[d.length-1]??"<root>",s);if(o.add(s),c.requires!==void 0)for(let u of c.requires)l(u,[...d,s]);o.delete(s),i.add(s),a.push(c)};return l(e,[]),a};var $=(e,r)=>{let t=e.endsWith("/")?e:`${e}/`,n=new URL(r,`file://${t}`).pathname;return n.startsWith(t)||n===e},x=async e=>{let r=e.split("/");r.pop();let t=r.join("/");t!==""&&t!=="."&&await g.fs.mkdir(t,{recursive:!0})},h=async e=>{try{return await g.fs.stat(e),!0}catch{return!1}},k=(e,r)=>r===void 0||Object.keys(r).length===0?e:v(e,r),F=async(e,r,t,n)=>{let a=`${r.cwd}/${e.target}`;if(n.includes(e.target))return;if(r.skipExisting===!0&&await h(a)){r.verbose===!0&&console.log(` [skip] ${e.target} (already exists)`),n.push(e.target);return}if(r.dryRun===!0){console.log(` [dry-run] would write ${e.target}`),t.push(e.target);return}r.verbose===!0&&console.log(` [write] ${e.target}`);let i=await w(r.registryUrl,e.source),o=k(i,r.variables);await x(a),await g.fs.writeTextFile(a,o),t.push(e.target)},E=async(e,r,t,n)=>{let a=await R(r.registryUrl,e.source);for(let i of a){let o=`${e.target}/${i.path}`;if(!$(r.cwd,o))throw new Error(`Folder recipe contains path traversal in '${o}'. Aborting.`)}for(let i of a){let o=`${e.target}/${i.path}`,l=`${r.cwd}/${o}`;if(r.skipExisting===!0&&await h(l)){n.push(o);continue}if(r.dryRun===!0){console.log(` [dry-run] would write ${o}`),t.push(o);continue}r.verbose===!0&&console.log(` [write] ${o}`);let s=k(i.content,r.variables);await x(l),await g.fs.writeTextFile(l,s),t.push(o)}},S=async(e,r,t,n)=>{let a=[];for(let i of e){if(t===!0){console.log(` [dry-run] would run: ${i}`),a.push(i);continue}n===!0&&console.log(` [post-install] ${i}`);let o=i.split(/\s+/),l=await g.exec.spawn(o[0],o.slice(1),{cwd:r,stdout:"inherit",stderr:"inherit"});if(!l.success)throw new Error(`Post-install command failed: '${i}' (exit code ${l.code})`);a.push(i)}return a},q=async(e,r)=>{let t=[],n=[],a=e.files.length,i=r.variables;e.variables!==void 0&&e.variables.length>0&&(i=m(e.variables,r.variables??{}));let o={...r,variables:i};for(let s of e.files)if((s.kind??"file")==="file"&&!$(r.cwd,s.target))throw new Error(`Recipe '${e.name}' contains path traversal in target '${s.target}'. Aborting.`);if(r.force!==!0&&r.skipExisting!==!0)for(let s of e.files){if((s.kind??"file")!=="file")continue;let c=`${r.cwd}/${s.target}`;await h(c)&&(r.dryRun===!0?console.log(` [conflict] ${s.target} (already exists)`):(console.warn(` Warning: ${s.target} already exists. Use --force to overwrite or --skip-existing to skip.`),n.push(s.target)))}for(let s of e.files){let d=s.kind??"file";try{d==="folder"?await E(s,o,t,n):await F(s,o,t,n)}catch(c){let u=c instanceof Error?c.message:String(c);throw new Error(`Failed applying '${s.target}'. ${t.length} files written so far. Retry with \`eser kit add ${e.name} --force\`. Cause: ${u}`)}}let l=[];return e.postInstall!==void 0&&e.postInstall.length>0&&(l=await S(e.postInstall,r.cwd,r.dryRun,r.verbose)),{written:t,skipped:n,total:a,postInstallRan:l}},V=async(e,r,t)=>{let n=b(e,r),a=[];for(let i of n){t.verbose===!0&&console.log(`
|
|
3
3
|
Applying recipe: ${i.name}`);let o=await q(i,t);a.push({name:i.name,result:o})}return{recipes:a}};export{$ as a,h as b,k as c,S as d,q as e,V as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as o}from"./chunk-
|
|
2
|
+
import{a as o}from"./chunk-UQRZJPYH.js";var a=o({name:"validate-shebangs",description:"Validate shebang/executable consistency",canFix:!1,stacks:[],defaults:{},checkFile(t,i){return[]}}),r=a.run,l=a.validator,c=a.main;export{a,r as b,l as c,c as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{d as g}from"./chunk-NBA6EFWU.js";import{d as p}from"./chunk-
|
|
2
|
+
import{d as g}from"./chunk-NBA6EFWU.js";import{d as p}from"./chunk-5MVJUALI.js";import{i as o}from"./chunk-6VHZQNHX.js";var m=[/node_modules/,/\.git\//,/\/dist\//,/etc\/coverage/,/etc\/temp/,/\.output\//],x=async t=>{try{let n=await p`git ls-files --cached --others --exclude-standard`.cwd(t).noThrow().lines();return n.length>0?n:null}catch{return null}},k=async(t={})=>{let{root:n=".",extensions:e,exclude:s=[]}=t,l=[...m,...s.map(r=>typeof r=="string"?new RegExp(r):r)],u=[],d=await x(n);if(d!==null)for(let r of d){let i=o.path.join(n,r),c=o.path.basename(r);if(e!==void 0&&e.length>0&&!g(r,e)||l.some(a=>a.test(i)||a.test(r)))continue;let y=0,f=!1;try{let a=await o.fs.lstat(i);if(y=a.size,f=a.isSymlink,a.isDirectory&&!(t.includeDirs??!1))continue}catch{continue}u.push({path:i,name:c,size:y,isSymlink:f})}else for await(let r of o.fs.walk(n,{includeDirs:t.includeDirs??!1,includeFiles:!0,exts:e,skip:l})){if(!r.isFile&&!r.isSymlink)continue;let i=0;try{i=(await o.fs.stat(r.path)).size}catch{continue}u.push({path:r.path,name:r.name,size:i,isSymlink:r.isSymlink})}if(t.includeOnly!==void 0&&t.includeOnly.length>0){let r=t.includeOnly;return u.filter(i=>r.some(c=>i.path.endsWith(c)||i.path.includes(c)))}return u},B=async t=>{if(t.textContent!==void 0)return t.textContent;try{let n=await h(t);if(w(n))return;let e=new TextDecoder().decode(n);return t.textContent=e,e}catch{return}},h=async t=>{if(t.rawBytes!==void 0)return t.rawBytes;let n=await o.fs.readFile(t.path);return t.rawBytes=n,n},w=t=>{let n=Math.min(t.length,8192);for(let e=0;e<n;e++)if(t[e]===0)return!0;return!1},M=(t,n)=>{for(let e of n)if(typeof e=="string"){if(t.includes(e)||t.endsWith(e))return!0}else if(e.test(t))return!0;return!1},b=(t,n)=>{let e=new Map;for(let s of n)e.set(s.path,s);for(let s of t){let l=e.get(s.path);l!==void 0&&(s.textContent=l.newContent,s.rawBytes=void 0)}},D=async t=>{let n=0;for(let e of t)e.oldContent!==e.newContent&&(await o.fs.writeTextFile(e.path,e.newContent),n++);return n};export{m as a,k as b,B as c,h as d,w as e,M as f,b as g,D as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
var r={name:"@eser/cli",version:"4.1.
|
|
2
|
+
var r={name:"@eser/cli",version:"4.1.41",type:"module",exports:"./main.ts",bin:{eser:"./bin.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/codebase":"workspace:*","@eser/kit":"workspace:*","@eser/noskills":"workspace:*","@eser/laroux-server":"workspace:*","@eser/workflows":"workspace:*","@eser/functions":"workspace:*","@eser/logging":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@std/cli":"npm:@jsr/std__cli@^1.0.25","@std/fmt":"npm:@jsr/std__fmt@^1.0.8"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16",esbuild:"^0.27.3"}};export{r as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as o}from"./chunk-
|
|
2
|
+
import{a as o}from"./chunk-UQRZJPYH.js";import{a as l}from"./chunk-2XNFZXHY.js";import{e as n}from"./chunk-5WJ6AUNY.js";var i=n(l(),1);var a=o({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:["yml","yaml"],checkFile(e,r){if(r===void 0)return[];try{return i.parse(r),[]}catch(t){let s=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:s}]}}}),d=a.run,u=a.validator,f=a.main;export{a,d as b,u as c,f as d};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{b as f}from"./chunk-TYLYMZQC.js";import{c as d}from"./chunk-OM5GSS2H.js";import{i as u}from"./chunk-6VHZQNHX.js";var m=r=>{let i=r.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return i.length>1?i:r.split(/\.(?=\s+[A-Z])|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},v=(r,i=[])=>{let t=[],o=r.find(e=>e.questionId==="ambition");if(o!==void 0){let e=o.answer,c=e.match(/10[- ]?star[:\s]+(.+?)(?:\n|$)/is),a=e.match(/5[- ]?star[:\s]+(.+?)(?:\n|$)/is),s=(c!==null?c[1].trim():a!==null?a[1].trim():e.replace(/1[- ]?star[:\s]+[^.]*\.\s*/i,"").trim()).replace(/^(the|a|an|with|plus|also)\s+/i,"").replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim();s.length>0&&(s=s.charAt(0).toUpperCase()+s.slice(1)),s=s.replace(/[.\u2026]+$/,"").trim(),s.length>140&&(s=s.slice(0,137)+"..."),s.length>3&&t.push(s)}let n=r.find(e=>e.questionId==="verification");if(n!==void 0){let e=n.answer.split(/\n/).map(c=>c.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(c=>c.length>0);for(let c of e)t.push(c)}for(let e of i){let c=e.choice.toLowerCase();if(c.includes("accepted")||c.includes("add to scope")){let a=e.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),l=a.charAt(0).toUpperCase()+a.slice(1);t.push(l)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t},w=(r,i)=>{let t={};if(i===null){for(let o of r.specSections)t[o]=!1;return t}for(let o of r.specSections){let n=o.toLowerCase();n.includes("design")||n.includes("mobile")||n.includes("layout")||n.includes("interaction")?t[o]=i.involvesWebUI:n.includes("contributor")||n.includes("public api")||n.includes("api surface")?t[o]=i.involvesPublicAPI:n.includes("migration")||n.includes("deprecation")||n.includes("backward")||n.includes("compatibility")?t[o]=i.involvesMigration:n.includes("audit")||n.includes("access control")||n.includes("data handling")?t[o]=i.involvesDataHandling:t[o]=!0}return t},g=(r,i,t,o,n)=>{let e=[];e.push(`# Spec: ${r}`),e.push(""),e.push("## Status: draft"),e.push(""),t.length>0&&(e.push(`## Concerns: ${t.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of i)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of t)if(s.specSections.length>0){let p=w(s,n??null);for(let h of s.specSections)p[h]!==!1&&(e.push(`## ${h} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<o.length;s++){let p=o[s];e.push(`| ${s+1} | ${p.question} | ${p.choice} | ${p.promoted?"yes":"no"} |`)}e.push("")}let c=i.find(s=>s.questionId==="scope_boundary");if(c!==void 0){e.push("## Out of Scope"),e.push("");let s=m(c.answer);for(let p of s)e.push(`- ${p}`);e.push("")}let a=v(i,o);e.push("## Tasks"),e.push("");for(let s=0;s<a.length;s++)e.push(`- [ ] task-${s+1}: ${a[s]}`);e.push("");let l=i.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),l!==void 0){let s=m(l.answer);for(let p of s)e.push(`- ${p}`)}else e.push("_To be defined._");return e.push(""),e.join(`
|
|
3
|
+
`)};var D=async(r,i,t)=>{if(i.spec===null)throw new Error("No active spec");let o=`${r}/${d.specDir(i.spec)}`,n=`${r}/${d.specFile(i.spec)}`;await u.fs.mkdir(o,{recursive:!0});let e=g(i.spec,i.discovery.answers,t,i.decisions,i.classification);await u.fs.writeTextFile(n,e);let c=f(i.spec,e),a=`${o}/progress.json`,l={spec:i.spec,status:"draft",tasks:c.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:i.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await u.fs.writeTextFile(a,JSON.stringify(l,null,2)+`
|
|
4
|
+
`),n};export{D as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as o}from"./chunk-
|
|
2
|
+
import{i as o}from"./chunk-6VHZQNHX.js";var r=()=>o.env.get("HOME")??"",l=()=>{let e=o.env.get("SHELL")??"";return e.includes("zsh")?"zsh":e.includes("fish")?"fish":"bash"},s=e=>{let t=r();switch(e){case"zsh":return o.path.join(t,".zshrc");case"bash":return o.path.join(t,".bashrc");case"fish":return o.path.join(t,".config","fish","config.fish")}},c=(e,t)=>{let n=r();switch(e){case"zsh":return o.path.join(n,".zshrc");case"bash":return o.path.join(n,".bashrc");case"fish":return o.path.join(n,".config","fish","completions",`${t}.fish`)}},g=(e,t)=>`eval "$(${t} system completions --shell ${e})"`,a=e=>e==="fish"?"file":"eval",p=(e,t="eser")=>{let n=e??l(),i=a(n);return{shell:n,rcFile:s(n),completionType:i,completionsFile:i==="file"?c(n,t):void 0}},f=[{envVars:["CLAUDE_CODE","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_SESSION_ID"],tool:"claude-code"},{envVars:["CURSOR_SESSION","CURSOR"],tool:"cursor"},{envVars:["KIRO_SESSION","KIRO"],tool:"kiro"},{envVars:["WINDSURF_SESSION"],tool:"windsurf"},{envVars:["GITHUB_COPILOT"],tool:"copilot"}],h=()=>{for(let e of f)for(let t of e.envVars){let n=o.env.get(t);if(n!==void 0&&n!=="")return e.tool}return null},u=()=>h()!==null?"agent":"human";export{l as a,g as b,p as c,h as d,u as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{i as c}from"./chunk-
|
|
2
|
+
import{i as c}from"./chunk-6VHZQNHX.js";var R=["registry/v1"],$=["file","folder"],b=["local","github"],E=r=>r==="project"||r==="structure"||r==="utility",F=r=>{if(typeof r!="object"||r===null)return!1;let e=r;return!(typeof e.source!="string"||typeof e.target!="string"||e.kind!==void 0&&!$.includes(e.kind)||e.provider!==void 0&&!b.includes(e.provider))},S=r=>{if(typeof r!="object"||r===null)return!1;let e=r;return!(e.go!==void 0&&!Array.isArray(e.go)||e.jsr!==void 0&&!Array.isArray(e.jsr)||e.npm!==void 0&&!Array.isArray(e.npm))},k=r=>{if(typeof r!="object"||r===null)return!1;let e=r;return!(typeof e.name!="string"||e.name===""||typeof e.description!="string"||e.default!==void 0&&typeof e.default!="string"||e.prompt!==void 0&&typeof e.prompt!="string")},u=r=>{if(typeof r!="object"||r===null)return!1;let e=r;if(typeof e.name!="string"||e.name===""||typeof e.description!="string"||typeof e.language!="string"||!E(e.scale)||!Array.isArray(e.files)||e.files.length===0)return!1;for(let n of e.files)if(!F(n))return!1;if(e.dependencies!==void 0&&!S(e.dependencies)||e.tags!==void 0&&!Array.isArray(e.tags))return!1;if(e.requires!==void 0){if(!Array.isArray(e.requires))return!1;for(let n of e.requires)if(typeof n!="string")return!1}if(e.variables!==void 0){if(!Array.isArray(e.variables))return!1;for(let n of e.variables)if(!k(n))return!1}if(e.postInstall!==void 0){if(!Array.isArray(e.postInstall))return!1;for(let n of e.postInstall)if(typeof n!="string")return!1}return!0},g=r=>{if(typeof r!="object"||r===null)throw new Error("Registry manifest must be a JSON object");let e=r;if(e.$schema!==void 0){let i=String(e.$schema);R.some(s=>i.includes(s))||console.warn(`Warning: Registry uses unknown schema "${i}". This CLI supports v1.`)}if(typeof e.name!="string"||e.name==="")throw new Error("Registry manifest requires a non-empty 'name' field");if(typeof e.description!="string")throw new Error("Registry manifest requires a 'description' field");if(typeof e.author!="string")throw new Error("Registry manifest requires an 'author' field");if(typeof e.registryUrl!="string"||e.registryUrl==="")throw new Error("Registry manifest requires a non-empty 'registryUrl' field");if(!Array.isArray(e.recipes))throw new Error("Registry manifest requires a 'recipes' array");for(let i of e.recipes)if(!u(i)){let o=typeof i=="object"&&i!==null?i.name??"<unknown>":"<invalid>";throw new Error(`Invalid recipe definition: '${o}'`)}let n=e.recipes,t=new Set;for(let i of n){if(t.has(i.name))throw new Error(`Duplicate recipe name '${i.name}' in registry`);t.add(i.name)}return r},y=r=>{if(!u(r))throw new Error("Invalid recipe definition");return r},h=(r,e)=>{let n=r.replace(/\/{1,20}$/,""),t=e.replace(/^\/{1,20}/,"");return`${n}/${t}`};var P=3e4,T="eser",v="stack",m="main",p=".eser/recipes.json",j=`https://raw.githubusercontent.com/${T}/${v}/${m}/.eser/recipes.json`,D=p,x=r=>{let e=r.replace(/^gh:/,""),n=e.indexOf("#"),t=n===-1?e:e.slice(0,n),i=n===-1?void 0:e.slice(n+1);if(t.includes("/")){let o=t.indexOf("/"),s=t.slice(0,o),f=t.slice(o+1);return s===""||f===""?{kind:"name",name:t,ref:i}:{kind:"repo",owner:s,repo:f,ref:i??m}}return{kind:"name",name:t,ref:i}},l=async r=>await globalThis.fetch(r,{signal:AbortSignal.timeout(P)}),I=async()=>{let r=c.process.cwd();for(let e=0;e<10;e++){let n=`${r}/${p}`;try{return await c.fs.stat(n),n}catch{let t=r.replace(/\/[^/]+$/,"");if(t===r)break;r=t}}},_=async(r,e)=>{let n=r??j;if(e?.local===!0&&r===void 0){let s=await I();s!==void 0&&(n=s,e?.verbose===!0&&console.log(`Using local registry: ${s}`))}let t=n.startsWith("http://")||n.startsWith("https://");e?.verbose===!0&&console.log(`Fetching registry from: ${n}`);let i;if(t){let s=await l(n);if(!s.ok)throw new Error(`Could not reach registry at ${n}. HTTP ${s.status}`);i=await s.text()}else try{i=await c.fs.readTextFile(n)}catch{throw new Error(`Could not read registry file at ${n}`)}let o;try{o=JSON.parse(i)}catch{throw new Error(`Registry at ${n} is not valid JSON`)}return g(o)},C=async(r,e,n,t)=>{let i=`https://raw.githubusercontent.com/${r}/${e}/${n}/${p}`;return await _(i,t)},M=async(r,e)=>{let n=h(r,e),t=await l(n);if(!t.ok)throw new Error(`Could not fetch recipe file at ${n}. HTTP ${t.status}`);return await t.text()},U=r=>{let e=r.match(/^https:\/\/raw\.githubusercontent\.com\/([^/]+)\/([^/]+)\/([^/]+)(?:\/(.*))?$/);if(e!==null)return{owner:e[1],repo:e[2],ref:e[3],basePath:e[4]??""}},q=async(r,e)=>{let n=U(r);if(n===void 0)throw new Error(`Cannot fetch folder: registry URL '${r}' is not a GitHub raw URL`);let t=n.basePath?`${n.basePath}/${e}`.replace(/\/+/g,"/"):e,i=`https://api.github.com/repos/${n.owner}/${n.repo}/contents/${t}?ref=${n.ref}`,o=await l(i);if(!o.ok)throw new Error(`Could not list folder '${t}' from ${n.owner}/${n.repo}. HTTP ${o.status}`);let s=await o.json();if(!Array.isArray(s))throw new Error(`Expected directory listing for '${t}', got a file instead`);let w=s.filter(a=>a.type==="file").map(async a=>{if(a.download_url===null)throw new Error(`File '${a.path}' has no download URL (may be too large)`);let d=await l(a.download_url);if(!d.ok)throw new Error(`Could not fetch file '${a.path}'. HTTP ${d.status}`);return{path:a.path.startsWith(t)?a.path.slice(t.length).replace(/^\//,""):a.path,content:await d.text()}});return await Promise.all(w)},H=async(r,e,n="main",t="recipe.json")=>{let i=`https://raw.githubusercontent.com/${r}/${e}/${n}/${t}`,o=await l(i);if(!o.ok)throw new Error(`Could not fetch recipe from ${r}/${e}@${n}/${t}. HTTP ${o.status}`);let s;try{s=JSON.parse(await o.text())}catch{throw new Error(`Recipe file at ${r}/${e}@${n}/${t} is not valid JSON`)}return y(s)};export{P as a,T as b,v as c,m as d,p as e,j as f,D as g,x as h,l as i,I as j,_ as k,C as l,M as m,U as n,q as o,H as p};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-UQRZJPYH.js";var n=r({name:"validate-eof",description:"Ensure files end with exactly one newline",canFix:!0,stacks:[],defaults:{},checkFile(i,e){return e===void 0?[]:e.length===0?[]:e.endsWith(`
|
|
3
3
|
`)?e.endsWith(`
|
|
4
4
|
|
|
5
5
|
`)?[{path:i.path,message:"file has multiple trailing newlines"}]:[]:[{path:i.path,message:"file does not end with a newline"}]},fixFile(i,e){if(e.length===0)return;let t=`${e.replace(/\n+$/,"")}
|