eser 4.1.13 → 4.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -3
- package/chunks/add-4LRHVBEC.js +7 -0
- package/chunks/anthropic-GBDSASP5.js +1 -0
- package/chunks/approve-364KOMLB.js +1 -0
- package/chunks/ask-752YJEHO.js +2 -0
- package/chunks/block-JVJQU723.js +1 -0
- package/chunks/browser-6UKLTPJO.js +1 -0
- package/chunks/build-VKOO2WEA.js +6 -0
- package/chunks/bun-N3TIWBPP.js +1 -0
- package/chunks/changelog-gen-ZCNNOY7G.js +7 -0
- package/chunks/chunk-2R4MK2KR.js +2 -0
- package/chunks/chunk-2TRQKCFC.js +1 -0
- package/chunks/chunk-34GCQZ3Z.js +3 -0
- package/chunks/chunk-3APERFKY.js +18 -0
- package/chunks/chunk-3DMTTLUJ.js +1 -0
- package/chunks/chunk-3TYZYY77.js +1 -0
- package/chunks/chunk-4HMEWMWL.js +1 -0
- package/chunks/chunk-4OIKB2P5.js +1 -0
- package/chunks/chunk-4Q3SEHPE.js +1 -0
- package/chunks/chunk-4S7QYPS6.js +1 -0
- package/chunks/chunk-5C7ZQN6X.js +3 -0
- package/chunks/chunk-5O7V5P53.js +1 -0
- package/chunks/chunk-5UGVJVIQ.js +1 -0
- package/chunks/chunk-6FMPNAZ3.js +1 -0
- package/chunks/chunk-6U2VEZEM.js +1 -0
- package/chunks/chunk-6YRN6OJC.js +2 -0
- package/chunks/chunk-7GS5KPVF.js +1 -0
- package/chunks/chunk-7M3ONEMO.js +32 -0
- package/chunks/chunk-7QNRH7OR.js +3 -0
- package/chunks/chunk-A2GDVOQP.js +1 -0
- package/chunks/chunk-AK3OJD4W.js +1 -0
- package/chunks/chunk-ATLUGTI7.js +2 -0
- package/chunks/chunk-BK2BDHKB.js +1 -0
- package/chunks/chunk-BKVQBSFV.js +6 -0
- package/chunks/chunk-BP2MZX2P.js +2 -0
- package/chunks/chunk-C3OSYHJY.js +2 -0
- package/chunks/chunk-CDLEA2PD.js +1 -0
- package/chunks/chunk-DDLQMSA7.js +0 -0
- package/chunks/chunk-DLVQNMNV.js +1 -0
- package/chunks/chunk-DOV5776P.js +3 -0
- package/chunks/chunk-DQAEQEXD.js +1 -0
- package/chunks/chunk-DRQWYJMH.js +1 -0
- package/chunks/chunk-DXB73IDG.js +1 -0
- package/chunks/chunk-DZD6MI45.js +5 -0
- package/chunks/chunk-EW5NCPPE.js +3 -0
- package/chunks/chunk-FGDJVQG3.js +32 -0
- package/chunks/chunk-FKF2SWQM.js +18 -0
- package/chunks/chunk-GETSWLMF.js +4 -0
- package/chunks/chunk-GLSCZGXA.js +1 -0
- package/chunks/chunk-GRTR6TNJ.js +1 -0
- package/chunks/chunk-GXPLME3K.js +14 -0
- package/chunks/chunk-H2JGLZIR.js +1 -0
- package/chunks/chunk-HPPFA3XU.js +1 -0
- package/chunks/chunk-HPVL4BVQ.js +2 -0
- package/chunks/chunk-HVMMNGY5.js +7 -0
- package/chunks/chunk-IA7GIU76.js +14 -0
- package/chunks/chunk-IAWIWTDY.js +1 -0
- package/chunks/chunk-JQHMDTPL.js +1 -0
- package/chunks/chunk-L2BYHWDC.js +1 -0
- package/chunks/chunk-LRL56YFE.js +1 -0
- package/chunks/chunk-LU3DHXOC.js +2 -0
- package/chunks/chunk-LXVBR775.js +1 -0
- package/chunks/chunk-M5TBBQQC.js +21 -0
- package/chunks/chunk-MQH4XBFN.js +1 -0
- package/chunks/chunk-NADES3GN.js +1 -0
- package/chunks/chunk-NIX3WX3O.js +1 -0
- package/chunks/chunk-NSZ4HGDI.js +1 -0
- package/chunks/chunk-NUSNMQPL.js +1 -0
- package/chunks/chunk-NZFUFGOC.js +1 -0
- package/chunks/chunk-O2MNBI7V.js +1 -0
- package/chunks/chunk-OBIEQJDE.js +4 -0
- package/chunks/chunk-OLM5RTFK.js +1 -0
- package/chunks/chunk-PBSR4XR2.js +335 -0
- package/chunks/chunk-PLJNPQFC.js +1 -0
- package/chunks/chunk-PLRSDG6G.js +2 -0
- package/chunks/chunk-Q7QMINSQ.js +0 -0
- package/chunks/chunk-QIUIPRJP.js +1 -0
- package/chunks/chunk-QXTK62N4.js +1 -0
- package/chunks/chunk-R6F4EK2B.js +4 -0
- package/chunks/chunk-RGUC6KAZ.js +1 -0
- package/chunks/chunk-RUZDG5PT.js +60 -0
- package/chunks/chunk-SCCNNGD4.js +2 -0
- package/chunks/chunk-SCULX2ND.js +1 -0
- package/chunks/chunk-SJQWPBMJ.js +1 -0
- package/chunks/chunk-TMFPDVYN.js +127 -0
- package/chunks/chunk-UJX2S56V.js +1 -0
- package/chunks/chunk-USCAYIWL.js +1 -0
- package/chunks/chunk-V5HTJPFW.js +3 -0
- package/chunks/chunk-VFMYWG2I.js +3 -0
- package/chunks/chunk-VGFZXQMW.js +1 -0
- package/chunks/chunk-VTQ72OK7.js +1 -0
- package/chunks/chunk-WE7PSSAQ.js +91 -0
- package/chunks/chunk-WUJUQPHI.js +1 -0
- package/chunks/chunk-X4ZCYXOT.js +1 -0
- package/chunks/chunk-XJ3VEVYL.js +3 -0
- package/chunks/chunk-XMTGT2NJ.js +10 -0
- package/chunks/chunk-XWYLEYLY.js +1 -0
- package/chunks/chunk-Y6DLCHJN.js +1 -0
- package/chunks/chunk-Y6DZEK4W.js +1 -0
- package/chunks/chunk-YUXQ7JNG.js +1 -0
- package/chunks/chunk-Z7742D7Q.js +1 -0
- package/chunks/chunk-ZE5T64HQ.js +1 -0
- package/chunks/chunk-ZF2XYULB.js +1 -0
- package/chunks/chunk-ZOZYBQX2.js +0 -0
- package/chunks/chunk-ZTLJ775S.js +1 -0
- package/chunks/chunk-ZY72QNKZ.js +3 -0
- package/chunks/claude-code-PWTLM554.js +1 -0
- package/chunks/clone-DASXIL35.js +5 -0
- package/chunks/commitmsg-SQRQONCS.js +10 -0
- package/chunks/deno-PZXN5K3J.js +1 -0
- package/chunks/dev-FLO2KEPZ.js +3 -0
- package/chunks/file-tools-shared-ESMPLZVJ.js +1 -0
- package/chunks/fileFromPath-4UEDFJ4U.js +6 -0
- package/chunks/gemini-I6F5N7PS.js +1 -0
- package/chunks/gh-Y4BXDXR5.js +4 -0
- package/chunks/gh-contributors-5SHGJHAQ.js +11 -0
- package/chunks/init-GXBXQGGV.js +1 -0
- package/chunks/init-UFJL24PW.js +12 -0
- package/chunks/install-Q2KQZM62.js +2 -0
- package/chunks/kiro-NMTIFMT4.js +1 -0
- package/chunks/list-B7L4FZKG.js +2 -0
- package/chunks/list-MN7OUE52.js +1 -0
- package/chunks/list-UZKWSA4S.js +1 -0
- package/chunks/load-config-TSM3AAQ6.js +1 -0
- package/chunks/main-WVXCURBF.js +5 -0
- package/chunks/manifest-VJQJG2LS.js +1 -0
- package/chunks/mod-3PJAIZ2O.js +1 -0
- package/chunks/mod-6P2JPEHC.js +1 -0
- package/chunks/mod-CI56JMO4.js +43 -0
- package/chunks/mod-FKPTF5D5.js +1 -0
- package/chunks/mod-GZ6BSK2P.js +1 -0
- package/chunks/mod-JTBNNSZZ.js +1 -0
- package/chunks/mod-MKMQWZ6G.js +1 -0
- package/chunks/mod-PEAFMI6F.js +1 -0
- package/chunks/mod-QODEWK3G.js +9 -0
- package/chunks/mod-S33TIBIC.js +1 -0
- package/chunks/mod-STKIZYZ3.js +27 -0
- package/chunks/new-W5YBJFGW.js +4 -0
- package/chunks/next-773GX25N.js +3 -0
- package/chunks/node-RWYXITVV.js +59 -0
- package/chunks/node-VPHAK3FD.js +1 -0
- package/chunks/ollama-DQ5VM4HI.js +1 -0
- package/chunks/openai-EKIA3VP3.js +19 -0
- package/chunks/openai-XMIVMDDL.js +1 -0
- package/chunks/opencode-IZMQZ4ZK.js +1 -0
- package/chunks/recipe-applier-F2REROYS.js +1 -0
- package/chunks/registry-fetcher-ZJ76EHBA.js +1 -0
- package/chunks/release-YJOLKWDT.js +8 -0
- package/chunks/release-notes-Z53AFCII.js +3 -0
- package/chunks/release-tag-QRIKYVQB.js +1 -0
- package/chunks/reset-5LQGIOGB.js +1 -0
- package/chunks/rule-K42YEAMO.js +2 -0
- package/chunks/run-7JXDS75G.js +4 -0
- package/chunks/scripts-RSK5XDRW.js +1 -0
- package/chunks/sdk-5JGXLIO5.js +18 -0
- package/chunks/serve-U6IXMGXQ.js +3 -0
- package/chunks/server-PXE4DB3V.js +69 -0
- package/chunks/spec-5446CSQC.js +1 -0
- package/chunks/status-HK3P6J6G.js +1 -0
- package/chunks/sync-4FSA5257.js +1 -0
- package/chunks/system-3MH6OCP6.js +1 -0
- package/chunks/system-DTVAUBIX.js +1 -0
- package/chunks/unstable_chmod-WRDBWEC2.js +1 -0
- package/chunks/update-QD5S73WT.js +5 -0
- package/chunks/validate-bom-IVALGNGE.js +1 -0
- package/chunks/validate-case-conflict-LKECKLD5.js +1 -0
- package/chunks/validate-circular-deps-PXFPCBXA.js +1 -0
- package/chunks/validate-commit-msg-77CBKGOF.js +1 -0
- package/chunks/validate-docs-3UGB7LN7.js +1 -0
- package/chunks/validate-eof-ZSIYNHO5.js +1 -0
- package/chunks/validate-export-names-BPSCBX7B.js +1 -0
- package/chunks/validate-filenames-G4XJ2LHN.js +1 -0
- package/chunks/validate-json-YRCFW2O7.js +1 -0
- package/chunks/validate-large-files-MWWSFDOE.js +1 -0
- package/chunks/validate-licenses-Q2YA2MND.js +1 -0
- package/chunks/validate-line-endings-C6NHWHGI.js +1 -0
- package/chunks/validate-merge-conflict-KTBL4FUY.js +1 -0
- package/chunks/validate-mod-exports-LQIIQRIS.js +1 -0
- package/chunks/validate-package-configs-36PYXIWC.js +1 -0
- package/chunks/validate-secrets-UFDJ7ITY.js +1 -0
- package/chunks/validate-shebangs-3UO4MDMZ.js +1 -0
- package/chunks/validate-submodules-YA654D3B.js +1 -0
- package/chunks/validate-symlinks-R2PNE5TG.js +1 -0
- package/chunks/validate-toml-7H2N5AKI.js +1 -0
- package/chunks/validate-trailing-whitespace-HXO7M3ED.js +1 -0
- package/chunks/validate-yaml-ZJJCQVBB.js +1 -0
- package/chunks/versions-CWT5S7G4.js +1 -0
- package/chunks/vertexai-2SMP54AR.js +1 -0
- package/chunks/workerd-NXKZMQPV.js +1 -0
- package/eser.js +1 -986
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as Re}from"./chunk-IAWIWTDY.js";import{a as Pe}from"./chunk-SJQWPBMJ.js";import{a as ge,c as ve}from"./chunk-HPVL4BVQ.js";import{a as ke,c as ye}from"./chunk-MQH4XBFN.js";import{a as Ve,c as he}from"./chunk-QIUIPRJP.js";import{a as xe}from"./chunk-EW5NCPPE.js";import{a as Ce}from"./chunk-V5HTJPFW.js";import{a as we}from"./chunk-XWYLEYLY.js";import{a as Se}from"./chunk-ZTLJ775S.js";import"./chunk-DLVQNMNV.js";import{a as be,c as $e}from"./chunk-HVMMNGY5.js";import{a as Z,c as ee}from"./chunk-VGFZXQMW.js";import{a as ae,c as te}from"./chunk-NSZ4HGDI.js";import{a as se,c as oe}from"./chunk-C3OSYHJY.js";import{a as ie,c as re}from"./chunk-CDLEA2PD.js";import{a as ne,c as le}from"./chunk-YUXQ7JNG.js";import{a as de,c as ce}from"./chunk-4HMEWMWL.js";import{a as pe,c as me}from"./chunk-L2BYHWDC.js";import{a as ue,c as fe}from"./chunk-H2JGLZIR.js";import{a as Y,c as _}from"./chunk-DZD6MI45.js";import{a as G,c as U}from"./chunk-SCCNNGD4.js";import{a as H,c as K}from"./chunk-NADES3GN.js";import{a as Q,c as X}from"./chunk-XJ3VEVYL.js";import"./chunk-VFMYWG2I.js";import"./chunk-Y6DLCHJN.js";import{b as J,c as B}from"./chunk-7GS5KPVF.js";import"./chunk-ATLUGTI7.js";import"./chunk-Y6DZEK4W.js";import"./chunk-34GCQZ3Z.js";import"./chunk-3APERFKY.js";import"./chunk-6U2VEZEM.js";import"./chunk-JQHMDTPL.js";import"./chunk-2TRQKCFC.js";import"./chunk-ZF2XYULB.js";import"./chunk-5UGVJVIQ.js";import"./chunk-4S7QYPS6.js";import"./chunk-NUSNMQPL.js";import"./chunk-GXPLME3K.js";import{f as A,h as W,k as z}from"./chunk-FGDJVQG3.js";import"./chunk-USCAYIWL.js";import{b as m,d as k,e as h,f as P,g as O,j as q}from"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import{a as L}from"./chunk-HPPFA3XU.js";import{a as R,b as D}from"./chunk-DQAEQEXD.js";import{t as w}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var S=async a=>{let t=await J(a);return t===null?null:t},je=async a=>await B(a);var M={name:"validate-circular-deps",description:"Detect circular package dependencies",requiredStacks:[],async validate(a){let t=await we({root:a.root});return{name:"validate-circular-deps",passed:!t.hasCycles,issues:t.cycles.map(s=>({severity:"error",message:`Circular dependency: ${s.join(" \u2192 ")}`})),stats:{packagesChecked:t.packagesChecked}}}};var j={name:"validate-mod-exports",description:"Validate mod.ts exports all files",requiredStacks:["javascript"],async validate(a){let t=await Re({root:a.root});return{name:"validate-mod-exports",passed:t.isComplete,issues:t.missingExports.map(s=>({severity:"error",message:`Missing export in ${s.packageName}: ${s.file}`,file:s.file})),stats:{packagesChecked:t.packagesChecked}}}};var T={name:"validate-export-names",description:"Validate export naming conventions",requiredStacks:["javascript"],async validate(a){let t=await Se({root:a.root});return{name:"validate-export-names",passed:t.isValid,issues:t.violations.map(s=>({severity:"error",message:`${s.packageName}: "${s.exportPath}" should be "${s.suggestion}"`})),stats:{packagesChecked:t.packagesChecked}}}};var E={name:"validate-docs",description:"Validate JSDoc documentation",requiredStacks:["javascript"],async validate(a){let t=a.options?.requireExamples,s=await Ce({root:a.root,requireExamples:t});return{name:"validate-docs",passed:s.isValid,issues:s.issues.map(e=>({severity:"error",message:`${e.symbol}: ${e.issue}`,file:e.file,line:e.line})),stats:{filesChecked:s.filesChecked,symbolsChecked:s.symbolsChecked}}}};var I={name:"validate-package-configs",description:"Validate deno.json/package.json consistency",requiredStacks:["javascript"],async validate(a){let t=await Pe({root:a.root}),s=[];for(let e of t.inconsistencies)s.push({severity:"error",message:`${e.packageName}: ${e.field} mismatch - deno.json: ${JSON.stringify(e.denoValue)}, package.json: ${JSON.stringify(e.packageValue)}`});for(let e of t.dependencyInconsistencies){let n=`${e.packageName}: ${e.dependencyName} - ${e.issue}`;e.expected!==void 0&&e.actual!==void 0&&(n+=` (expected: ${e.expected}, actual: ${e.actual})`),s.push({severity:"error",message:n})}return{name:"validate-package-configs",passed:t.isConsistent,issues:s,stats:{packagesChecked:t.packagesChecked}}}};var y={validators:new Map,initialized:!1},De=()=>{o(M),o(j),o(T),o(E),o(I),o(_),o(U),o(K),o(X),o(ee),o(te),o(oe),o(re),o(le),o(ce),o(me),o(fe),o(ve),o(ye),o(he),o($e)},N=()=>{y.initialized||(y.initialized=!0,De())},o=a=>{y.validators.set(a.name,a)},Le=a=>(N(),y.validators.get(a)??null),F=()=>(N(),[...y.validators.values()]),Oe=()=>(N(),[...y.validators.keys()]),qe=a=>({name:a.config.name,description:a.config.description,run:async t=>{let s=await a.run(t);return{name:s.name,passed:s.issues.length===0,issues:s.issues.map(e=>({path:e.path,line:e.line,message:e.message,fixed:e.fixed})),mutations:s.mutations.map(e=>({path:e.path,oldContent:e.oldContent,newContent:e.newContent})),stats:{filesChecked:s.filesChecked,issuesFound:s.issues.length}}}}),Ae=a=>({name:a.name,description:a.description,run:async t=>{let s=await a.validate({root:t.root??".",options:t});return{name:s.name,passed:s.passed,issues:s.issues.map(e=>({path:e.file,line:e.line,message:e.message})),mutations:[],stats:s.stats}}}),We=()=>{let a=[],t=[Y,G,H,Q,Z,ae,se,ie,ne,de,pe,ue,ge,ke,Ve,be];for(let e of t)a.push(qe(e));let s=[M,j,T,E,I];for(let e of s)a.push(Ae(e));return a.push({name:"validate-commit-msg",description:"Validate conventional commit format",run:async e=>{let n=e.commitMsgFile??e._args?.[0]??".git/COMMIT_EDITMSG",{current:f}=await import("./mod-FKPTF5D5.js"),u;try{u=await f.fs.readTextFile(n)}catch{return{name:"validate-commit-msg",passed:!1,issues:[{message:`cannot read commit message file: ${n}`}],mutations:[],stats:{}}}let l=xe(u,{allowAsterisk:e.allowAsterisk,allowMultipleScopes:e.allowMultipleScopes,forceScope:e.forceScope,types:e.types});return{name:"validate-commit-msg",passed:l.valid,issues:l.issues.map(g=>({message:g})),mutations:[],stats:{}}}}),a};var ze=async(a={})=>{let t=a.root??w.process.cwd(),e=(await S(t))?.stack??[],n=[...a.skip??[]],f=a.only??[],u=F(),l=[],g=[],x=[];for(let r of u){if(f.length>0&&!f.includes(r.name))continue;if(n.includes(r.name)){x.push(r.name);continue}if(r.requiredStacks.length>0&&e.length>0&&!r.requiredStacks.some(C=>e.includes(C))){g.push({name:r.name,reason:`Requires '${r.requiredStacks.join("' or '")}' stack`});continue}let b={...a.fix!==void 0?{fix:a.fix}:{}},d=await r.validate({root:t,options:b});l.push(d)}return{passed:l.every(r=>r.passed),results:l,skipped:g,disabled:x}},wa=async a=>{let t=L(a??w.process.args,{string:["root","only","skip"],boolean:["fix","help"],alias:{h:"help"}});if(t.help)return console.log("Usage: deno run --allow-all ./validation/mod.ts [options]"),console.log(),console.log("Options:"),console.log(" --root <dir> Root directory (default: cwd)"),console.log(" --only <validators> Run only specific validators (comma-separated)"),console.log(" --skip <validators> Skip specific validators (comma-separated)"),console.log(" --fix Auto-fix issues where supported"),console.log(" -h, --help Show this help message"),R(void 0);let s=z.ansi(),e=A({renderer:s,sink:W.stdout()}),n=t.root,f=t.fix,u=t.only,l=t.skip,g=u!==void 0?u.split(",").map(i=>i.trim()):void 0,x=l!==void 0?l.split(",").map(i=>i.trim()):void 0,b=(await S(n??"."))?.stack?.join(", ")??"all (no .manifest.yml)";e.writeln(m(`Validating codebase...
|
|
2
|
+
`)),e.writeln(m("Stack: "),q(b),m(`
|
|
3
|
+
`));let d=await ze({root:n,only:g,skip:x,fix:f});for(let i of d.results){let c=i.passed?P("PASS"):h("FAIL"),v=Object.entries(i.stats).map(([p,$])=>`${$} ${p}`).join(", ");e.writeln(m(` ${i.name.padEnd(18)} `),c,m(` (${v})`))}if(d.skipped.length>0){e.writeln(k(`
|
|
4
|
+
Skipped (stack not configured):`));for(let i of d.skipped)e.writeln(k(` - ${i.name}: ${i.reason}`))}if(d.disabled.length>0){e.writeln(k(`
|
|
5
|
+
Disabled:`));for(let i of d.disabled)e.writeln(k(` - ${i}`))}let V=d.results.flatMap(i=>i.issues.map(c=>({validator:i.name,...c})));if(V.length>0){e.writeln(h(`
|
|
6
|
+
Issues (${V.length}):
|
|
7
|
+
`));let i=new Map;for(let c of V){let v=c.file??c.validator,p=i.get(v)??[];p.push(c),i.set(v,p)}for(let[c,v]of i){e.writeln(k(` ${c}`));for(let p of v){let $=p.severity==="error"?h("error"):O("warning"),Me=p.line!==void 0?`:${p.line}`:"";e.writeln(m(" "),$,m(`${Me}: ${p.message}`))}e.writeln()}}let C=d.results.filter(i=>!i.passed).length;return C>0?(await e.close(),D({message:s.render([h(`
|
|
8
|
+
${C} check(s) failed with ${V.length} issue(s)`)]),exitCode:1})):(e.writeln(P(`
|
|
9
|
+
All checks passed!`)),await e.close(),R(void 0))};export{je as getProjectConfigPath,Le as getValidator,Oe as getValidatorNames,F as getValidators,We as getWorkflowTools,S as loadProjectConfig,wa as main,o as registerValidator,ze as validate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-RUZDG5PT.js";import"./chunk-FGDJVQG3.js";import"./chunk-PLJNPQFC.js";import"./chunk-DOV5776P.js";import"./chunk-O2MNBI7V.js";import"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";export{d as completionsHandler,f as doctorHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import{a as _}from"./chunk-GXPLME3K.js";import{f as U,h as H,k as G}from"./chunk-FGDJVQG3.js";import{b as w,d as S,e as C,f as O,j as z}from"./chunk-PLJNPQFC.js";import{b as N}from"./chunk-DOV5776P.js";import{a as q}from"./chunk-HPPFA3XU.js";import{a as E,b as $,d as V,f as D}from"./chunk-DQAEQEXD.js";import{t as l}from"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import{b as v}from"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var x=class extends TransformStream{constructor(t){let e;super({transform(s,a){if(e!==void 0){let n=new Uint8Array(e.length+s.length);n.set(e),n.set(s,e.length),s=n}for(let n=t;n<=s.length;n+=t)a.enqueue(s.slice(n-t,n));let f=-s.length%t;e=f?s.slice(f):void 0},flush(s){e?.length&&s.enqueue(e)}})}};var P=class{#s;#n;#t;#e=[];#r=!1;constructor(){let{readable:t,writable:e}=new TransformStream;this.#s=ReadableStream.from(this.#i()),this.#n=e,this.#t=t.pipeThrough(new x(512)).getReader()}async#a(){let{done:t,value:e}=await this.#t.read();if(!t){if(e.length!==512)throw new RangeError(`Cannot extract the tar archive: The tarball chunk has an unexpected number of bytes (${e.length})`);return this.#e.push(e),this.#e.shift()}}async*#i(){for(let e=0;e<2;++e){let{done:s,value:a}=await this.#t.read();if(s||a.length!==512)throw new RangeError("Cannot extract the tar archive: The tarball is too small to be valid");this.#e.push(a)}let t=new TextDecoder;for(;;){for(;this.#r;)await new Promise(n=>setTimeout(n,0));if(this.#e.every(n=>n.every(o=>o===0))){await this.#t.cancel("Tar stream finished prematurely");return}let e=await this.#a();if(e==null){if(this.#e.every(n=>n.every(o=>o===0)))break;throw new TypeError("Cannot extract the tar archive: The tarball has invalid ending")}let s=parseInt(t.decode(e.subarray(148,156)),8);if(e.fill(32,148,156),e.reduce((n,o)=>n+o)!==s)throw new SyntaxError("Cannot extract the tar archive: An archive entry has invalid header checksum");let a={name:t.decode(e.subarray(0,100)).split("\0")[0],mode:parseInt(t.decode(e.subarray(100,108)),8),uid:parseInt(t.decode(e.subarray(108,116)),8),gid:parseInt(t.decode(e.subarray(116,124)),8),size:parseInt(t.decode(e.subarray(124,136)).trimEnd(),8),mtime:parseInt(t.decode(e.subarray(136,147)),8),typeflag:t.decode(e.subarray(156,157)),linkname:t.decode(e.subarray(157,257)).split("\0")[0]};a.typeflag==="\0"&&(a.typeflag="0"),[117,115,116,97,114,0,48,48].every((n,o)=>e[o+257]===n)&&(a={...a,magic:t.decode(e.subarray(257,263)),version:t.decode(e.subarray(263,265)),uname:t.decode(e.subarray(265,297)).split("\0")[0],gname:t.decode(e.subarray(297,329)).split("\0")[0],devmajor:t.decode(e.subarray(329,337)).replaceAll("\0",""),devminor:t.decode(e.subarray(337,345)).replaceAll("\0",""),prefix:t.decode(e.subarray(345,500)).split("\0")[0]});let f={path:("prefix"in a&&a.prefix.length?a.prefix+"/":"")+a.name,header:a};["1","2","3","4","5","6"].includes(a.typeflag)||(f.readable=this.#l(a.size)),yield f}}async*#o(t){for(let e=Math.ceil(t/512);e>0;--e){let s=await this.#a();if(s==null)throw new SyntaxError("Cannot extract the tar archive: Unexpected end of Tarball");e===1&&t%512?yield s.subarray(0,t%512):yield s}}#l(t){this.#r=!0;let e=()=>this.#r=!1,s=this.#o(t);return new ReadableStream({type:"bytes",async pull(a){let{done:f,value:n}=await s.next();if(f)return e(),a.close(),a.byobRequest?.respond(0);if(a.byobRequest?.view){let o=new Uint8Array(a.byobRequest.view.buffer),i=o.length;i<n.length?(o.set(n.slice(0,i)),a.byobRequest.respond(i),a.enqueue(n.slice(i))):(o.set(n),a.byobRequest.respond(n.length))}else a.enqueue(n)},async cancel(){for await(let a of s);e()}})}get readable(){return this.#s}get writable(){return this.#n}};var L=async(r,t,e={})=>{let{stripComponents:s=0,subpath:a}=e,f=a!==void 0?l.path.normalize(a).replace(/^\/+/,""):void 0,o=r.pipeThrough(new DecompressionStream("gzip")).pipeThrough(new P);for await(let i of o){let c=l.path.normalize(i.path);if(c.startsWith("..")||l.path.isAbsolute(c)){i.readable!==void 0&&await i.readable.cancel();continue}let u=c.split(l.path.sep).slice(s);if(u.length===0){i.readable!==void 0&&await i.readable.cancel();continue}let d=u.join(l.path.sep);if(f!==void 0){if(!d.startsWith(f)){i.readable!==void 0&&await i.readable.cancel();continue}if(d.slice(f.length).replace(/^\/+/,"")===""){i.readable!==void 0&&await i.readable.cancel();continue}}let h=f!==void 0?l.path.join(t,d.slice(f.length).replace(/^\/+/,"")):l.path.join(t,d);if(await l.fs.ensureDir(l.path.dirname(h)),i.readable!==void 0){let b=new Response(i.readable),m=new Uint8Array(await b.arrayBuffer());await l.fs.writeFile(h,m)}}};var te="main",re=r=>{let[t,e]=r.split("#");if(t===void 0)throw new Error(`Invalid GitHub specifier: ${r}`);let s=t.split("/");if(s.length<2)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);let[a,f,...n]=s;if(a===void 0||f===void 0)throw new Error(`Invalid GitHub specifier: ${r}. Expected format: owner/repo[/path][#ref]`);return{provider:"github",raw:r,owner:a,repo:f,ref:e??te,path:n.length>0?n.join("/"):void 0}},se=async(r,t)=>{let e=r,{owner:s,repo:a,ref:f,path:n}=e,o=`https://codeload.github.com/${s}/${a}/tar.gz/${f}`,i=await fetch(o);if(!i.ok)throw i.status===404?new Error(`Repository not found: ${s}/${a} (ref: ${f})`):new Error(`Failed to fetch template: ${i.status} ${i.statusText}`);if(i.body===null)throw new Error("Response body is empty");await L(i.body,t,{stripComponents:1,subpath:n})},M={name:"github",prefixes:["github","gh"],isDefault:!0,parse:re,fetch:se};var g={providers:new Map,defaultProvider:null,initialized:!1},A=()=>{g.initialized||(g.initialized=!0,W(M))},W=r=>{g.providers.set(r.name,r);for(let t of r.prefixes)g.providers.set(t,r);r.isDefault===!0&&(g.defaultProvider=r)},ne=r=>(A(),g.providers.get(r)??null),ae=()=>(A(),g.defaultProvider),B=r=>{A();let t=r.indexOf(":");if(t!==-1){let e=r.slice(0,t),s=r.slice(t+1),a=g.providers.get(e);if(a===void 0)throw new Error(`Unknown provider prefix: ${e}`);return{provider:a,ref:a.parse(s)}}if(g.defaultProvider===null)throw new Error("No default provider registered");return{provider:g.defaultProvider,ref:g.defaultProvider.parse(r)}},I=async(r,t)=>{let{provider:e,ref:s}=B(r);return await e.fetch(s,t),s};var Y=[".manifest.yml",".manifest.yaml"],j=async r=>{for(let t of Y){let e=l.path.join(r,t);try{let s=await l.fs.readTextFile(e),a=_(s);if(typeof a.name!="string"||a.name==="")throw new Error(`Template config missing required 'name' field: ${e}`);return a}catch(s){if(s instanceof v)continue;throw s}}return null},ie=r=>{let t=r.description??r.name,e=r.default!==void 0?` [${r.default}]`:"",s=r.required===!0?" (required)":"",a=`${t}${s}${e}: `,f=globalThis.prompt(a);return f===null||f===""?r.default??null:f},X=(r,t)=>r.pattern===void 0||new RegExp(r.pattern).test(t)?null:`Value '${t}' does not match pattern '${r.pattern}'`,F=(r,t)=>{let{provided:e,interactive:s}=t,a=r.variables??[],f={...e},n=[];for(let o of a){let{name:i,required:c,default:p}=o;if(f[i]!==void 0){let u=X(o,f[i]);u!==null&&n.push(`${i}: ${u}`);continue}if(s){let u=ie(o);if(u!==null){let d=X(o,u);d!==null?n.push(`${i}: ${d}`):f[i]=u;continue}}if(p!==void 0){f[i]=p;continue}c===!0&&n.push(`Missing required variable: ${i}`)}if(n.length>0)throw new Error(`Variable resolution failed:
|
|
2
|
+
${n.join(`
|
|
3
|
+
`)}`);return f},J=async r=>{for(let t of Y){let e=l.path.join(r,t);try{return await l.fs.stat(e),e}catch{continue}}return null};var K=/\{\{\s*\.(\w+)\s*\}\}/g,oe=new Set([".png",".jpg",".jpeg",".gif",".ico",".webp",".svg",".woff",".woff2",".ttf",".eot",".otf",".zip",".tar",".gz",".bz2",".xz",".7z",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".exe",".dll",".so",".dylib",".mp3",".mp4",".avi",".mov",".webm"]),le=r=>{let t=l.path.extname(r).toLowerCase();return oe.has(t)},fe=(r,t)=>{for(let e of t)if(e.startsWith("*")){let s=e.slice(1);if(r.endsWith(s))return!0}else if(e.includes("*")){let s=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");if(new RegExp(`^${s}$`).test(r))return!0}else if(r===e||r.startsWith(e+"/"))return!0;return!1},R=(r,t)=>r.replace(K,(e,s)=>{let a=t[s];return a===void 0?`{{.${s}}}`:a}),T=r=>K.test(r),Q=async(r,t)=>{let{variables:e,ignore:s}=t,a=[],f=[];for await(let n of l.fs.walk(r,{includeDirs:!0})){let o=l.path.relative(r,n.path);o!==""&&(fe(o,s)||(n.isDirectory?T(n.name)&&f.push(n.path):n.isFile&&a.push(n.path)))}for(let n of a){let o=l.path.basename(n),i=l.path.dirname(n);if(!le(n))try{let c=await l.fs.readTextFile(n);if(T(c)){let p=R(c,e);await l.fs.writeTextFile(n,p)}}catch(c){if(!(c instanceof Error&&c.name==="InvalidData"))throw c}if(T(o)){let c=R(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}}f.sort((n,o)=>o.split(l.path.sep).length-n.split(l.path.sep).length);for(let n of f){let o=l.path.basename(n),i=l.path.dirname(n),c=R(o,e),p=l.path.join(i,c);p!==n&&await l.fs.rename(n,p)}},Z=async r=>{try{await l.fs.remove(r)}catch(t){if(!(t instanceof v))throw t}};var k=async r=>{let{specifier:t,targetDir:e,variables:s={},force:a=!1,skipPostInstall:f=!1,interactive:n=!1}=r,o=l.path.isAbsolute(e)?e:l.path.join(l.process.cwd(),e);try{let m=[];for await(let y of l.fs.readDir(o)){m.push(y);break}if(m.length>0&&!a)throw new Error(`Target directory is not empty: ${o}. Use --force to overwrite.`)}catch(m){if(!(m instanceof v))throw m}await l.fs.ensureDir(o),await I(t,o);let i=await j(o),c=i?.name??t,p=i!==null?F(i,{provided:s,interactive:n}):s,u=[".git",".manifest.yml",".manifest.yaml",...i?.ignore??[]];await Q(o,{variables:p,ignore:u});let d=await J(o);d!==null&&await Z(d);let h=i?.postInstall??[],b=[];if(!f&&h.length>0)for(let m of h)try{(await N`${m}`.cwd(o).stdout("inherit").stderr("inherit").noThrow().spawn()).success?b.push(m):console.warn(`Post-install command failed: ${m}`)}catch(y){console.warn(`Post-install command error: ${m}`,y)}return{templateName:c,targetDir:o,variables:p,postInstallCommands:b}};var qe=async r=>{let t=q(r??l.process.args,{string:["path","var"],boolean:["force","interactive","skip-post-install","help"],alias:{p:"path",f:"force",i:"interactive",h:"help"},collect:["var"]});if(t.help)return console.log(`Usage: scaffold <specifier> [options]
|
|
4
|
+
|
|
5
|
+
Options:
|
|
6
|
+
-p, --path <dir> Target directory (default: .)
|
|
7
|
+
-f, --force Overwrite existing files
|
|
8
|
+
-i, --interactive Prompt for missing variables
|
|
9
|
+
--var key=value Set a template variable (repeatable)
|
|
10
|
+
--skip-post-install Skip post-install commands
|
|
11
|
+
-h, --help Show this help message
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
scaffold eser/ajan
|
|
15
|
+
scaffold gh:eser/ajan#v1.0 -p ./my-project
|
|
16
|
+
scaffold eser/ajan --var name=my-app --var author=me`),E(void 0);let e=G.ansi(),s=U({renderer:e,sink:H.stdout()});if(t._.length===0)return await s.close(),$({message:`${e.render([C("Error: Template specifier is required")])}
|
|
17
|
+
|
|
18
|
+
Usage: scaffold <specifier> [options]
|
|
19
|
+
|
|
20
|
+
Examples:
|
|
21
|
+
scaffold eser/ajan
|
|
22
|
+
scaffold gh:eser/ajan#v1.0
|
|
23
|
+
scaffold eser/ajan -p ./my-project`,exitCode:1});let a=String(t._[0]),f=t.path??".",n=t.force??!1,o=t["skip-post-install"]??!1,i=t.interactive??!1,c=t.var,p={};if(c!==void 0)for(let h of c){let[b,...m]=String(h).split("=");b!==void 0&&(p[b]=m.join("="))}s.writeln(w("Scaffolding from "),z(a),w("..."));let u=await D(()=>k({specifier:a,targetDir:f,variables:p,force:n,skipPostInstall:o,interactive:i}),h=>({message:h.message}));if(V(u))return await s.close(),$({message:e.render([C(`
|
|
24
|
+
Scaffolding failed: ${u.error.message}`)]),exitCode:1});let d=u.value;if(s.writeln(O(`
|
|
25
|
+
Scaffolded ${d.templateName} to ${d.targetDir}`)),Object.keys(d.variables).length>0){s.writeln(w(`
|
|
26
|
+
Variables applied:`));for(let[h,b]of Object.entries(d.variables))s.writeln(w(" "),S(h),w(`: ${b}`))}if(d.postInstallCommands.length>0){s.writeln(w(`
|
|
27
|
+
Post-install commands executed:`));for(let h of d.postInstallCommands)s.writeln(w(" "),S(h))}return await s.close(),E(void 0)};export{I as fetchTemplate,ae as getDefaultProvider,ne as getProvider,T as hasVariables,j as loadTemplateConfig,qe as main,B as parseSpecifier,W as registerProvider,F as resolveVariables,k as scaffold,R as substituteVariables};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as C,b as D}from"./chunk-3TYZYY77.js";import{e as E}from"./chunk-6YRN6OJC.js";import{a as $,d as A}from"./chunk-NUSNMQPL.js";import{f as y}from"./chunk-SCULX2ND.js";import{f as v,h as k,k as R}from"./chunk-FGDJVQG3.js";import{d as m,e as w,f as P,j as h}from"./chunk-PLJNPQFC.js";import{a as N}from"./chunk-HPPFA3XU.js";import{a as g,b as p,c as j}from"./chunk-DQAEQEXD.js";import"./chunk-GRTR6TNJ.js";import"./chunk-Z7742D7Q.js";import"./chunk-VTQ72OK7.js";import"./chunk-QXTK62N4.js";import"./chunk-DXB73IDG.js";var b=r=>$(async t=>{try{let s=await y(r.registrySource,{local:r.local}),a=s.recipes.filter(n=>n.scale==="project"),o=a.find(n=>n.name===r.templateName);if(o===void 0)return p({_tag:"TemplateNotFound",message:`Template '${r.templateName}' not found. Available: ${a.map(n=>n.name).join(", ")}`});await Deno.mkdir(r.targetDir,{recursive:!0});let u={project_name:r.projectName,...r.variables},e=await E(o,{cwd:r.targetDir,registryUrl:s.registryUrl,force:!0,variables:u}),f=await C(r.targetDir),d=D(o,f);t.out.writeln(P(`\u2713 Created ${r.projectName} with ${e.written.length} file(s)`));for(let n of e.written)t.out.writeln(` \u2192 ${n}`);if(d.instructions.length>0){t.out.writeln(m(`
|
|
2
|
+
Next steps:`)),t.out.writeln(m(` cd ${r.projectName}`));for(let n of d.instructions)t.out.writeln(m(` ${n}`))}return g({template:o,result:e,depInfo:d})}catch(s){let a=s instanceof Error?s.message:String(s);return p({_tag:"ApplyError",message:a})}});var q=async r=>{let t=N(r??[],{string:["name","registry","var"],boolean:["local"],collect:["var"]}),s=t._[0],a=t.name??s,o=t.registry,u=t.local===!0,e=v({renderer:R.ansi(),sink:k.stdout()}),f={};for(let c of t.var){let[i,...l]=String(c).split("=");i!==void 0&&i!==""&&(f[i]=l.join("="))}if(s===void 0){try{let i=(await y(o,{local:u})).recipes.filter(l=>l.scale==="project");e.writeln("Usage: eser kit new <template> [--name <project-name>] [--var key=value]"),e.writeln(),e.writeln("Available project templates:"),e.writeln();for(let l of i)e.writeln(` ${l.name.padEnd(20)} ${l.description} `,m(`[${l.language}]`))}catch(c){let i=c instanceof Error?c.message:String(c);e.writeln(w(`Error: ${i}`))}return await e.close(),g(void 0)}if(a===void 0)return e.writeln(w("Project name is required.")),await e.close(),p({exitCode:1});e.writeln(h(`
|
|
3
|
+
Creating ${a} from ${s}...
|
|
4
|
+
`));let d=`${Deno.cwd()}/${a}`,n=await A(b({templateName:s,projectName:a,targetDir:d,registrySource:o,local:u,variables:f}),{out:e});return await e.close(),j(n)?g(void 0):p({exitCode:1})};export{q as main};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as g}from"./chunk-XMTGT2NJ.js";import{b as C,c as y,d as O}from"./chunk-BK2BDHKB.js";import{a as E,c as k,d as _,f as I}from"./chunk-LXVBR775.js";import{c as m,d as x,e as w,f as D,i as S,k as v}from"./chunk-BKVQBSFV.js";import{a as d,b as h}from"./chunk-DQAEQEXD.js";import"./chunk-DXB73IDG.js";var q=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],l=t=>q.map(n=>({...n,extras:C(t,n.id)})),u=(t,n)=>{let s=new Set(n.map(o=>o.questionId));for(let o of t)if(!s.has(o.id))return o;return null},B=t=>{let n=new Set(t.map(s=>s.questionId));return q.every(s=>n.has(s.id))};var f=(t,n,s)=>{switch(t.phase){case"IDLE":return N();case"DISCOVERY":return $(t,n,s);case"SPEC_DRAFT":return L(t);case"SPEC_APPROVED":case"BUILDING":return U(t,n,s);case"BLOCKED":return W(t);case"DONE":return G(t);default:return N()}},N=()=>({phase:"IDLE",instruction:'No active spec. Start one with: noskills spec new "description"'}),$=(t,n,s)=>{let o=l(n),e=u(o,t.discovery.answers);if(e===null)return{phase:"DISCOVERY",instruction:"All discovery questions answered. Run: noskills approve",question:{id:"",text:"",concerns:[],extras:[]},context:{rules:s,concernReminders:[]},transition:{onComplete:"noskills approve",remainingQuestions:0}};let r=t.discovery.answers.length,i=o.length;return{phase:"DISCOVERY",instruction:"Ask the user the following question and relay their answer.",question:{id:e.id,text:e.text,concerns:[...e.concerns],extras:e.extras.map(c=>c.text)},context:{rules:s,concernReminders:y(n)},transition:{onComplete:'noskills next --answer="..."',remainingQuestions:i-r-1}}},L=t=>({phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:t.specState.path??"",transition:{onApprove:"noskills approve"}}),U=(t,n,s)=>{let o=O(n),e={phase:"BUILDING",instruction:"Read the spec and implement the next task. Report progress when done.",context:{rules:s,concernReminders:y(n)},transition:{onComplete:'noskills next --answer="..."',onBlocked:'noskills block "reason"',iteration:t.building.iteration}};return o.length>0?{...e,concernTensions:o}:e},W=t=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:t.building.lastProgress??"Unknown",transition:{onResolved:'noskills next --answer="..."'}}),G=t=>({phase:"DONE",summary:{spec:t.spec,iterations:t.building.iteration,decisionsCount:t.decisions.length}});var b=(t,n,s,o)=>{let e=[];e.push(`# Spec: ${t}`),e.push(""),e.push("## Status: draft"),e.push(""),s.length>0&&(e.push(`## Concerns: ${s.map(r=>r.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let r of n)e.push(`### ${r.questionId}`),e.push(""),e.push(r.answer),e.push("");for(let r of s)if(r.specSections.length>0)for(let i of r.specSections)e.push(`## ${i} (${r.id})`),e.push(""),e.push("_To be filled in during implementation._"),e.push("");if(o.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let r=0;r<o.length;r++){let i=o[r];e.push(`| ${r+1} | ${i.question} | ${i.choice} | ${i.promoted?"yes":"no"} |`)}e.push("")}return e.push("## Tasks"),e.push(""),e.push("_To be generated from discovery answers._"),e.push(""),e.push("## Verification"),e.push(""),e.push("_To be defined based on discovery answers._"),e.push(""),e.join(`
|
|
2
|
+
`)};var A=async(t,n,s)=>{if(n.spec===null)throw new Error("No active spec");let o=`${t}/${m.specDir(n.spec)}`,e=`${t}/${m.specFile(n.spec)}`;await Deno.mkdir(o,{recursive:!0});let r=b(n.spec,n.discovery.answers,s,n.decisions);return await Deno.writeTextFile(e,r),e};var X=async t=>{let n=Deno.cwd();if(!await v(n)){let a=JSON.stringify({error:"noskills not initialized. Run: noskills init"});return await p(a),h({exitCode:1})}let s=null;if(t!==void 0)for(let a of t)a.startsWith("--answer=")&&(s=a.slice(9));let o=await x(n),e=await D(n);if(e===null){let a=JSON.stringify({error:"No config found"});return await p(a),h({exitCode:1})}let i=(await S(n)).filter(a=>e.concerns.includes(a.id));if(s!==null){let a=await j(n,o,e,i,s);await w(n,a);let T=await g(n),F=f(a,i,T);return await p(JSON.stringify(F,null,2)),d(void 0)}let c=await g(n),Q=f(o,i,c);return await p(JSON.stringify(Q,null,2)),d(void 0)},j=async(t,n,s,o,e)=>{switch(n.phase){case"DISCOVERY":{let r=l(o),i=u(r,n.discovery.answers);if(i===null)return n;let c=k(n,i.id,e);return B(c.discovery.answers)&&(c=_(c),await A(t,c,o)),c}case"BUILDING":return I(n,e);case"BLOCKED":return E(n,"BUILDING");default:return n}},p=async t=>{let n=new TextEncoder;await Deno.stdout.write(n.encode(t+`
|
|
3
|
+
`))};export{X as main};
|