eser 4.1.54 → 4.1.56
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/{ajan-HYDPJF3Z.js → ajan-RZNLBRWL.js} +1 -1
- package/chunks/approve-CSNHLN74.js +2 -0
- package/chunks/{block-Z4BELXXO.js → block-RYXM4VQQ.js} +1 -1
- package/chunks/{cancel-HHW2G675.js → cancel-KVUNVJJ2.js} +1 -1
- package/chunks/{changelog-gen-JTU6WIYA.js → changelog-gen-HL2OZBDU.js} +1 -1
- package/chunks/{chunk-5QUEAV4O.js → chunk-4JICYXYK.js} +1 -1
- package/chunks/{chunk-6F4PFXYY.js → chunk-4KDDHQVL.js} +1 -1
- package/chunks/{chunk-NYHMH3N5.js → chunk-DI7OHJ53.js} +1 -1
- package/chunks/chunk-E4WXXNF6.js +2 -0
- package/chunks/{chunk-GOWXYTXW.js → chunk-IHHITZU2.js} +1 -1
- package/chunks/chunk-LEG3PWOU.js +4 -0
- package/chunks/{chunk-RUTM4VP7.js → chunk-LOZLXP5G.js} +6 -6
- package/chunks/chunk-NCSKHFFW.js +3 -0
- package/chunks/chunk-P4SPHY3G.js +6 -0
- package/chunks/chunk-PPB6ACBB.js +2 -0
- package/chunks/{chunk-5K2B6EQM.js → chunk-YTLTR452.js} +1 -1
- package/chunks/{concern-YFXJJ7DL.js → concern-J22UTED2.js} +1 -1
- package/chunks/{delegate-FVHPWQS7.js → delegate-JVA57PQG.js} +1 -1
- package/chunks/{diagrams-MRJB73CF.js → diagrams-XRNON3TH.js} +1 -1
- package/chunks/done-MQGWNNZO.js +2 -0
- package/chunks/{followup-XKVSZT2H.js → followup-H2CVZVOP.js} +1 -1
- package/chunks/{gh-3GMLD6TO.js → gh-66RDDALE.js} +1 -1
- package/chunks/{init-ONTNPCSY.js → init-4Q4HAHND.js} +1 -1
- package/chunks/invoke-hook-NMA2CDWK.js +14 -0
- package/chunks/{learn-SRDLP7B5.js → learn-6MIAYVOR.js} +1 -1
- package/chunks/manager-QK6D3SA2.js +7 -0
- package/chunks/{mod-5SS5V7LJ.js → mod-EQ33JILZ.js} +1 -1
- package/chunks/mod-KPAF2K4Q.js +23 -0
- package/chunks/next-S6SRRGZ4.js +8 -0
- package/chunks/{pack-ZQMMSIIP.js → pack-JXH34X7D.js} +1 -1
- package/chunks/{purge-LXL3F3EJ.js → purge-TQXMK5OC.js} +1 -1
- package/chunks/{release-5PXID6GL.js → release-RKXERKDT.js} +2 -2
- package/chunks/{release-tag-2B2CWVMZ.js → release-tag-WQOAE2OF.js} +1 -1
- package/chunks/{reopen-3NA6JI4N.js → reopen-SJU63UEG.js} +1 -1
- package/chunks/{reset-XITFRWII.js → reset-ELKH7QV3.js} +1 -1
- package/chunks/{review-UVYK4M4T.js → review-GYD3HGFK.js} +1 -1
- package/chunks/{rule-BAO7IP5S.js → rule-E3CUOBUX.js} +1 -1
- package/chunks/{run-EBKNNOG7.js → run-H3PSKRPV.js} +1 -1
- package/chunks/{session-SZYH2UOE.js → session-6EGZXYCI.js} +1 -1
- package/chunks/spec-QQW7427P.js +2 -0
- package/chunks/status-MZRTOMES.js +2 -0
- package/chunks/{sync-WE6A7KC7.js → sync-JYEN3MZS.js} +1 -1
- package/chunks/{system-X6YWUEZJ.js → system-TEBXYSPT.js} +1 -1
- package/chunks/{versions-VGXMC5GM.js → versions-NR3A7CS5.js} +1 -1
- package/chunks/{watch-WBZB2C5P.js → watch-SAPVNSL6.js} +5 -5
- package/chunks/{web-GAF33V4M.js → web-VCJYTSV2.js} +1 -1
- package/chunks/{wontfix-JBPCNL6S.js → wontfix-LL6NHECR.js} +1 -1
- package/eser.js +1 -1
- package/package.json +2 -1
- package/chunks/approve-VBXGXWZI.js +0 -2
- package/chunks/chunk-6WFCBJPF.js +0 -4
- package/chunks/chunk-IUORSUN6.js +0 -2
- package/chunks/chunk-NQS27P25.js +0 -6
- package/chunks/chunk-OXP2FOO5.js +0 -2
- package/chunks/chunk-UTENCUNI.js +0 -3
- package/chunks/done-DMKJ27IQ.js +0 -2
- package/chunks/invoke-hook-ZM6UQND6.js +0 -14
- package/chunks/manager-BMNUSWJO.js +0 -7
- package/chunks/mod-ZCIGCCW4.js +0 -23
- package/chunks/next-FD3EHJW3.js +0 -8
- package/chunks/spec-CPRKQGOX.js +0 -2
- package/chunks/status-SRCNQJ4V.js +0 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as B}from"./chunk-5YBG2HOI.js";import{a as A}from"./chunk-P4SPHY3G.js";import"./chunk-4KDDHQVL.js";import{f as F}from"./chunk-PPB6ACBB.js";import{a as G,b as W,d as M,e as U}from"./chunk-4JICYXYK.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{A as $,c as w,d as D,e as _,l as O,p as N,t as P,u as L}from"./chunk-LOZLXP5G.js";import{c as m}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as l}from"./chunk-FFWPJP7A.js";import{i as r}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var X=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),H=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),z=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),q=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),Q=t=>{let s=0;for(;s<t.length;){let e=t[s];if(z.has(e)){s+=2;continue}if(q.has(e)){s+=1;continue}if(e.startsWith("--git-dir=")||e.startsWith("--work-tree=")||e.startsWith("--namespace=")||e.startsWith("--super-prefix=")||e.startsWith("--config-env=")){s+=1;continue}if(e.startsWith("-C")&&e.length>2){s+=1;continue}if(e.startsWith("-c")&&e.length>2&&e.includes("=")){s+=1;continue}return e}return null},E=t=>{let s=t.trim();if(!s.startsWith("git"))return!0;let e=s.slice(3).trim();if(e.length===0)return!0;let n=e.split(/\s+/),c=Q(n)??"";if(X.has(c))return!0;let i=H.get(c);if(i!==void 0){let o=n.indexOf(c),g=o>=0&&o+1<n.length?n[o+1]:"";if(i.has(g))return!0}return!1};var J=t=>{let s=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let c of s){let i;for(;(i=c.exec(t))!==null;){let o=i[1]??"";if(o.includes("git")&&!E(o))return!0}}let e=t.split(/\s*\|\s*/);for(let c of e){let i=c.trim();if(i.startsWith("git")&&!E(i))return!0}let n=t.matchAll(/(?:^|[\s($`(])git\b/g);for(let c of n){let o=c[0].indexOf("git"),g=(c.index??0)+o,f=(t.slice(g).split(/[;&|$)`'"]/)[0]??"").trim();if(f.startsWith("git")&&!E(f))return!0}return!1},K=t=>t.replace(/--\w+='[^']*'/g,"").replace(/--\w+="[^"]*"/g,"").replace(/--\w+=\S*/g,"");var x=async()=>{let t=r.process.stdin.getReader(),s=[];try{for(;;){let{done:i,value:o}=await t.read();if(i||o===void 0)break;s.push(o)}}finally{t.releaseLock()}let e=0,n=new Uint8Array(s.reduce((i,o)=>i+o.length,0));for(let i of s)n.set(i,e),e+=i.length;let c=new TextDecoder().decode(n);try{return JSON.parse(c)}catch{return{}}},b=async t=>{let s=new TextEncoder,e=r.process.stdout.getWriter();await e.write(s.encode(JSON.stringify(t))),e.releaseLock()},pe=async t=>{switch(t?.[0]){case"pre-tool-use":return await te();case"stop":return await se();case"post-file-write":return await ne();case"post-bash":return await ie();case"session-start":return await re();default:return l(void 0)}},v=async t=>{await b({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${t}`}})},ee=async t=>{await b({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow",additionalContext:t}})},V=(t,s)=>{if(s)return null;let e=K(t);if(!e.includes("git"))return null;let n=e.split(/\s*(?:&&|;)\s*/);for(let c of n){let i=c.trim();if(i.startsWith("git")&&!E(i))return"Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."}return J(e)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},te=async()=>{let t=await x(),s=t.tool_name??"unknown",e=t.tool_input??{},n=t.cwd??r.env.get("NOSKILLS_PROJECT_ROOT")??r.process.cwd(),c=await O(n),i=r.env.get("NOSKILLS_SESSION")??null;if(i!==null){let a=await P(n,i);if(a!==null&&a.mode==="free"){if(s==="Bash"){let u=(e.command??"").trim(),d=c?.allowGit??!1;if(!d&&u.includes("git")){let h=V(u,d);if(h!==null)return await v(h),l(void 0)}}return l(void 0)}}let o={};if(i!==null){let a=await P(n,i);if(a!==null&&a.mode==="spec"&&a.phase!==null)o={phase:a.phase};else if(a!==null&&a.spec!==null)try{o=await _(n,a.spec)}catch{return l(void 0)}else return l(void 0)}else{let a=await L(n);if(a.length>0){let u={DISCOVERY:10,DISCOVERY_REFINEMENT:10,SPEC_PROPOSAL:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let C of a){let R=C.phase??"IDLE",I=u[R]??0;I>h&&(h=I,d=R)}o={phase:d};let k=new TextEncoder,T=r.process.stderr.getWriter();await T.write(k.encode(`noskills: WARNING \u2014 ${a.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
|
|
3
|
+
`)),T.releaseLock()}else try{o=await D(n)}catch{return l(void 0)}}if(s==="Bash"){let a=(e.command??"").trim(),u=c?.allowGit??!1,d=V(a,u);return d!==null?(await v(d),l(void 0)):l(void 0)}let g=["Write","Edit","MultiEdit"];if(!g.includes(s))return l(void 0);let p=e.file_path??e.path??"";if(p.includes(".eser/")||p.includes(".claude/"))return l(void 0);let f=o.phase??"UNKNOWN";if(f==="UNKNOWN")return await v("Phase unknown \u2014 file edit blocked. Run `noskills status` to check state."),l(void 0);if(f==="EXECUTING"||f==="IDLE"||f==="COMPLETED"){if(f==="EXECUTING"&&g.includes(s)){let a=`${n}/${w.stateDir}/executor-warned.flag`;try{await r.fs.readTextFile(a)}catch{try{await r.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0}),await r.fs.writeTextFile(a,new Date().toISOString());let u=new TextEncoder,d=r.process.stderr.getWriter();await d.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
|
|
4
|
+
`)),d.releaseLock()}catch{}}}if(f==="EXECUTING"&&p.length>0)try{let a=[],u=await G(n),d=M(u,"EXECUTING",p);a.push(...d);let h=await B(n,[p]);for(let S of h)a.push(`(${S.folder}/) ${S.rule}`);let T=o.classification??null,C=await N(n),R=await O(n),I=C.filter(S=>R!==null&&R.concerns.includes(S.id)),Y=F(I,p,T);if(a.push(...Y),a.length>0){let S=`[noskills] Rules for this file:
|
|
5
|
+
`+a.map(j=>`- ${j}`).join(`
|
|
6
|
+
`);return await ee(S),l(void 0)}}catch{}return l(void 0)}let y={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REFINEMENT:`You are in DISCOVERY_REFINEMENT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_PROPOSAL:`You are in SPEC_PROPOSAL \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await v(y[f]??`Run \`${m("next")}\` first.`),l(void 0)},se=async()=>{let t=await x();if(t.stop_hook_active===!0)return l(void 0);let s=t.cwd??r.env.get("NOSKILLS_PROJECT_ROOT")??r.process.cwd(),e;try{let u=await r.fs.readTextFile(`${s}/${w.stateFile}`);e=JSON.parse(u)}catch{return l(void 0)}if(e.phase!=="EXECUTING")return l(void 0);let n=e.execution??{},c=`${s}/${w.stateDir}/files-changed.jsonl`,i=[];try{let d=(await r.fs.readTextFile(c)).trim().split(`
|
|
7
|
+
`).filter(Boolean);i=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let o=[],g="no changes";try{let{execSync:u}=await import("node:child_process");o=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
8
|
+
`).filter(Boolean);let k=u("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
9
|
+
`);g=k[k.length-1]??"no changes"}catch{}let p=[...new Set([...i,...o])],f=(n.iteration??0)+1,y=`${s}/${w.stateDir}/iterations`;try{await r.fs.mkdir(y,{recursive:!0}),await r.fs.writeTextFile(`${y}/iteration-${f}.json`,JSON.stringify({iteration:f,files:p,gitStat:g.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
10
|
+
`)}catch{}let a=15;try{let u=await O(s);u!==null&&(a=u.maxIterationsBeforeRestart)}catch{}e.execution={...n,iteration:f,modifiedFiles:p,lastProgress:g.trim()||n.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await r.fs.writeTextFile(`${s}/${w.stateFile}`,JSON.stringify(e,null,2)+`
|
|
11
|
+
`)}catch{}try{await r.fs.writeTextFile(c,"")}catch{}try{await r.fs.remove(`${s}/${w.stateDir}/executor-warned.flag`)}catch{}if(f>=a){let u=new TextEncoder,d=r.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${a}). Consider starting a fresh conversation.
|
|
12
|
+
`)),d.releaseLock()}return l(void 0)},ne=async()=>{let t=await x(),s=t.tool_input??{},e=s.file_path??s.path??"";if(!e||e.includes(".eser/")||e.includes(".claude/"))return l(void 0);let n=t.cwd??r.env.get("NOSKILLS_PROJECT_ROOT")??r.process.cwd(),c=`${n}/${w.stateDir}/files-changed.jsonl`,i=JSON.stringify({file:e,tool:t.tool_name,ts:new Date().toISOString()});try{await r.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0});let o="";try{o=await r.fs.readTextFile(c)}catch{}await r.fs.writeTextFile(c,o+i+`
|
|
13
|
+
`)}catch{}return l(void 0)},ie=async()=>{let t=await x(),e=(t.tool_input??{}).command??"";if(!e.includes("noskills"))return l(void 0);let n=t.cwd??r.env.get("NOSKILLS_PROJECT_ROOT")??r.process.cwd(),c=`${n}/${w.stateDir}/noskills-calls.jsonl`,i=JSON.stringify({command:e,ts:new Date().toISOString()});try{await r.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0});let o="";try{o=await r.fs.readTextFile(c)}catch{}await r.fs.writeTextFile(c,o+i+`
|
|
14
|
+
`)}catch{}return l(void 0)},re=async()=>{let t=r.env.get("NOSKILLS_PROJECT_ROOT")??r.process.cwd();if(!await $(t))return l(void 0);let s=await D(t),e=await O(t),c=(await N(t)).filter(p=>e!==null&&e.concerns.includes(p.id)),i=await W(t),o=U(e?.tools??[]),g=await A(s,c,i,e,void 0,void 0,void 0,o);return await b(g),l(void 0)};export{pe as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as R}from"./chunk-
|
|
2
|
+
import{f as R}from"./chunk-4JICYXYK.js";import{a as D,b as x,c as C}from"./chunk-KFVUFHJB.js";import{B as S,c as k,f as E,l as L}from"./chunk-LOZLXP5G.js";import"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as b,h as I,k as T}from"./chunk-SHN5MT56.js";import{c as P,d as a,f as o,g}from"./chunk-YVN2NZL4.js";import{a as u,b as w}from"./chunk-FFWPJP7A.js";import{i as $}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var U=async(i,e,t)=>{let d=e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),h=`---
|
|
3
3
|
phases: [EXECUTING]
|
|
4
4
|
source: learned from spec "${t}" on ${new Date().toISOString().slice(0,10)}
|
|
5
5
|
---
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-NE2J6ISX.js";import"./chunk-KFVUFHJB.js";import{a as Oe}from"./chunk-ODBJ5KMQ.js";import{b as ae,c as oe}from"./chunk-YWSOQJ7G.js";import"./chunk-DI7OHJ53.js";import{h as ie}from"./chunk-L32KHQVT.js";import"./chunk-E4WXXNF6.js";import{A as De,B as Le,c as Te,d as xe,e as te,i as ve,k as Pe,l as Ie,s as se,v as Me,x as Re,z as ne}from"./chunk-LOZLXP5G.js";import{b as re}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as J,d as Se,e as we,r as C,s as a,t as B,u as K,v as Z,w as ee,x as z,y as Ee}from"./chunk-5GGWX7CO.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as he,e as H,f as be}from"./chunk-VKB3B2FE.js";import{a as Q,b as ye}from"./chunk-FFWPJP7A.js";import{i as $}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Ye=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],Ge=e=>{let n={DISCOVERY_REFINEMENT:"REVIEW",SPEC_PROPOSAL:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE",BLOCKED:"EXECUTING"}[e]??e;return Ye.map(r=>r===n?`[ ${r} ]`:r).join(" \u2192 ")},Ae=async(e,s)=>{let n;try{n=await ve(e,s)}catch{n=await xe(e)}let r=await Oe(e,s),l=new Set(n.execution.completedTasks??[]),t=(r?.tasks??[]).map(u=>({id:u.id,description:u.title,done:l.has(u.id),...u.files!==void 0&&u.files.length>0?{files:u.files}:{}})),b=[...new Set(n.discovery.answers.map(u=>"user"in u?u.user:null).filter(u=>u!==null&&u!=="Unknown User"))],E=(n.specNotes??[]).filter(u=>u.text.startsWith("[QUESTION] ")).map(u=>({id:u.id,text:u.text.replace("[QUESTION] ",""),user:u.user,ts:u.timestamp})),v=n.transitionHistory??[],g=v.length>0?v[0].timestamp:new Date().toISOString(),P=n.lastCalledAt??g,w=n.execution.confidenceFindings??[],h=w.length>0?Math.round(w.reduce((u,i)=>u+i.confidence,0)/w.length*10)/10:null,I=w.filter(u=>u.confidence<5).length;return{name:s,slug:s,phase:n.phase,description:n.specDescription??"",tasks:t,contributors:b,delegations:n.discovery.delegations??[],pendingQuestions:E,pendingSignoffs:[],roadmap:Ge(n.phase),createdAt:g,updatedAt:P,avgConfidence:h,lowConfidenceItems:I}},W=async e=>{let s=await Pe(e),n=new Set(s.map(i=>i.name));try{let i=`${e}/${Te.specsDir}`;for await(let m of(await import("./mod-4XKQZL6W.js")).runtime.fs.readDir(i))m.isDirectory&&!n.has(m.name)&&n.add(m.name)}catch{}let r=[];for(let i of n)try{r.push(await Ae(e,i))}catch{}r.sort((i,m)=>{let T=i.phase!=="COMPLETED"&&i.phase!=="IDLE",M=m.phase!=="COMPLETED"&&m.phase!=="IDLE";return T&&!M?-1:!T&&M?1:m.updatedAt.localeCompare(i.updatedAt)});let l=r.find(i=>i.phase!=="COMPLETED"&&i.phase!=="IDLE")??null,t=await ae(e,{limit:50}),b=t.filter(i=>i.type==="mention"),E=new Set(t.filter(i=>i.type==="mention-reply").map(i=>i.mentionId)),v=b.filter(i=>!E.has(i.id)).map(i=>({id:i.id??"",spec:i.spec,from:i.from??i.user,to:i.to??"",question:i.question??"",status:"pending",ts:i.ts})),P=t.filter(i=>i.type==="signoff").filter(i=>i.status==="pending").map(i=>({spec:i.spec,role:i.role??"",status:"pending",ts:i.ts})),w=await ie(e),h=w!==void 0?{name:w.name,email:w.email}:null,u=(await Ie(e))?.roles??null;return{specs:r,activeSpec:l,pendingMentions:v,pendingSignoffs:P,recentEvents:t,currentUser:h,roles:u}};var ke=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0,specsVisible:!0,monitorVisible:!0});var Ze=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REFINEMENT:"REVW",SPEC_PROPOSAL:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"}[e]??e.slice(0,4),et=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REFINEMENT":return"cyan";case"BLOCKED":return"red";case"SPEC_PROPOSAL":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},tt=(e,s)=>{switch(s){case"green":return a.green(e);case"yellow":return a.yellow(e);case"red":return a.red(e);case"cyan":return a.cyan(e);case"dim":return a.dim(e);default:return e}},A=(e,s)=>{let n=new Set(s.filter(l=>l.spec!==null).map(l=>l.spec)),r=e.map(l=>({label:l.name,badge:Ze(l.phase),badgeColor:et(l.phase),active:n.has(l.name),dimmed:l.phase==="COMPLETED"}));return r.length===0&&r.push({label:"No specs yet",dimmed:!0,selectable:!1}),r},ce=(e,s,n,r)=>{let l=A(e,s),t=B.drawBox({x:r.x,y:r.y,width:r.width,height:r.height,title:"Specs",borderStyle:"rounded"}),b=r.width-2,E=r.height-2,v=Math.max(0,Math.min(n,l.length-1)),g=z.ensureVisible(z.createScrollState(l.length,E),v),P=z.visibleRange(g),w=[];for(let u=0;u<E;u++){let i=P.start+u,m=r.y+1+u;if(i>=P.end||i>=l.length){w.push(a.moveTo(m,r.x+1)+" ".repeat(b));continue}let T=l[i];if(T===void 0){w.push(a.moveTo(m,r.x+1)+" ".repeat(b));continue}let M=T.selectable!==!1,f=i===n&&M,R=T.active?a.green("\u25CF"):f?"\u25B8":" ",L=T.badge!==void 0?" "+tt(`[${T.badge}]`,T.badgeColor??"dim"):"",N=T.dimmed?a.dim(T.label):T.label,Y=` ${R} ${N}${L}`,U=a.truncate(Y,b),c=Math.max(0,b-a.visibleLength(U));f?w.push(a.moveTo(m,r.x+1)+a.inverse(U+" ".repeat(c))):w.push(a.moveTo(m,r.x+1)+U+" ".repeat(c))}let h={id:r.id,x:r.x,y:r.y+1,width:r.width-1,height:E},I=z.renderScrollbar(h,g);return t+w.join("")+I};var nt=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],rt=e=>{if(e===null||e==="IDLE")return"IDLE";let n={DISCOVERY_REFINEMENT:"REVIEW",SPEC_PROPOSAL:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return nt.map(r=>r===n?a.bold(`\u2726${r}\u2726`):a.dim(r)).join("\u2192")},it=(e,s,n)=>{if(s===0)return a.dim("no tasks");let r=Math.round(e/s*n),l=n-r;return a.green("\u2588".repeat(r))+a.dim("\u2591".repeat(l))+` ${e}/${s}`},le=(e,s,n)=>{let r=[];return e===null?(r.push(a.bold("Mode: ")+a.cyan("IDLE")),r.push(a.dim("No active spec"))):e.mode==="free"?(r.push(a.bold("Mode: ")+a.cyan("IDLE")),r.push(a.dim("No active spec")),r.push(""),r.push(a.dim(`Session: ${e.sessionId}`))):(r.push(a.bold("Spec: ")+(e.spec??"unknown")),r.push(a.bold("Phase: ")+(e.phase??"unknown")),r.push(""),r.push(rt(e.phase)),r.push(""),n!==void 0&&r.push(a.bold("Progress: ")+it(n.completed,n.total,15)),r.push(""),r.push(a.dim(`Session: ${e.sessionId}`))),B.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:"Monitor",borderStyle:"rounded"},r)};var ot=e=>({DISCOVERY:"DISC",DISCOVERY_REFINEMENT:"REVW",SPEC_PROPOSAL:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"})[e]??e.slice(0,4),ct=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REFINEMENT":return"cyan";case"BLOCKED":return"red";case"SPEC_PROPOSAL":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},lt=e=>e.map(s=>({id:s.id,label:s.spec!==null?s.spec:"IDLE",badge:s.phase!==null?ot(s.phase):void 0,badgeColor:s.phase!==null?ct(s.phase):void 0,closable:!0})),Be=(e,s,n,r,l=1)=>{let t=[];if(t.push(a.moveTo(r,l)),e.length===0){let v=a.dim(" No tabs \u2014 press n to create one ");return t.push(v+" ".repeat(Math.max(0,n-a.visibleLength(v)))),t.join("")}let b=lt(e),E=Ee.renderTabBar({tabs:b,activeIndex:s,maxWidth:n,style:"inverse"});return t.push(E),t.join("")};var de=(e,s,n,r)=>{let l="Terminal",t=n??[],b=r??0,E=s.y-1,v=s.width,g=Be(t,b,v,E,s.x),P=e!==null&&e.widget!==null,w=B.drawBox({x:s.x,y:s.y,width:s.width,height:s.height,title:l,borderStyle:"rounded",skipInterior:P});if(t.length===0){let u=a.dim("No tabs \u2014 press n to create one"),i=" ".repeat(Math.max(0,s.width-2)),m="",T=Math.floor((s.height-2)/2);for(let M=1;M<s.height-1;M++)if(m+=a.moveTo(s.y+M,s.x+1),M===T){let f=a.visibleLength(u),R=Math.max(0,Math.floor((s.width-2-f)/2));m+=" ".repeat(R)+u+" ".repeat(Math.max(0,s.width-2-R-f))}else m+=i;return g+w+m}if(e===null||e.widget===null&&e.buffer.length===0){let u=" ".repeat(Math.max(0,s.width-2)),i="";for(let m=1;m<s.height-1;m++)i+=a.moveTo(s.y+m,s.x+1),i+=u;return g+w+i}if(e.widget!==null)return g+w+e.widget.render(s);let h=s.height-2,I=e.buffer.slice(-h);return g+B.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:l,borderStyle:"rounded"},I)};var ue=(e,s)=>({...e,tabs:[...e.tabs,s],selectedTabIndex:e.tabs.length}),X=(e,s)=>{let n=e.tabs.findIndex(t=>t.id===s);if(n===-1)return e;let r=e.tabs[n];r.process!==null&&r.process.kill();let l=e.tabs.filter(t=>t.id!==s);return{...e,tabs:l,selectedTabIndex:Math.min(e.selectedTabIndex,l.length-1)}},Ve=(e,s)=>s<0||s>=e.tabs.length?e:{...e,selectedTabIndex:s},pe=(e,s)=>{let n=s.split(`
|
|
3
|
+
`);for(let r of n)e.buffer.push(r);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},k=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var me=(e,s,n)=>{if(e.focus==="terminal")return n&&s==="c"?{type:"quit"}:s==="escape"?{type:"toggleFocus"}:{type:"passthrough",data:s};if(n&&s==="c")return{type:"quit"};if(n&&s==="d")return{type:"quit"};if(n&&s==="t")return{type:"newTab"};if(s==="tab"||s==="escape")return{type:"toggleFocus"};if(n&&s==="e")return{type:"toggleSpecs"};if(n&&s==="w")return{type:"toggleMonitor"};if(e.focus==="list")switch(s){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newTab"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:s}},Ne=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),fe=(e,s,n)=>{let r=K.nextSelectableIndex(n,e.selectedTabIndex,s);return{...e,selectedTabIndex:r}},ge=(e,s,n)=>e>=n.x&&e<n.x+n.width&&s>=n.y&&s<n.y+n.height,Ue=(e,s,n,r)=>{let l=e.x+1,t=e.y+1;if(ge(l,t,s.left)){if(e.type==="wheel")return{type:"scrollSpecs",direction:e.direction==="up"?"up":"down"};if(e.type==="mousedown"&&e.button===0){let b=e.y+1-s.left.y-1;if(b>=0&&b<n.length&&n[b].selectable!==!1)return{type:"clickSpec",index:b}}return{type:"none"}}return ge(l,t,s.rightBottom)?e.type==="wheel"?{type:"scrollTerminal",direction:e.direction==="up"?"up":"down"}:r!=="terminal"?{type:"clickTerminal"}:{type:"forwardMouse",event:e}:ge(l,t,s.rightTop)?{type:"clickMonitor"}:{type:"none"}};var Zt=async e=>{let s=e?.includes("--dry-run")??!1,{root:n}=await Le();if(!await De(n))return console.error("noskills is not initialized. Run:",re(),"init"),ye({exitCode:1});let l=(await W(n)).specs.map(c=>({name:c.name,phase:c.phase,hasActiveSession:!1})),t=ke(),{cols:b,rows:E}=C.getTerminalSize(),v=(c,d)=>{let o=E-1,p=F=>({id:F,x:0,y:0,width:0,height:0});if(!c&&!d)return{left:p("left"),rightTop:p("rightTop"),rightBottom:{id:"rightBottom",x:1,y:2,width:b,height:o-1},statusBar:{id:"statusBar",x:1,y:E,width:b,height:1}};let S=c?Math.min(Math.floor(b*.25),b):0,D=Math.floor(o*(d?.35:0)),O=[];d&&O.push({id:"rightTop",size:{type:"fixed",value:D}}),O.push({id:"rightBottom",size:{type:"flex",grow:1}});let V=[];c&&V.push({id:"left",size:{type:"fixed",value:S}}),V.push({direction:"column",size:{type:"flex",grow:1},children:O});let Fe={direction:"column",children:[{direction:"row",size:{type:"flex",grow:1},children:V},{id:"statusBar",size:{type:"fixed",value:1}}]},_e=ee.computeLayout(Fe,b,E),j=F=>{let _=ee.findPanel(_e,F);return _===void 0?p(F):{id:F,x:_.x+1,y:_.y+1,width:_.width,height:_.height}},$e=j("left"),ze=j("rightTop"),G=j("rightBottom"),qe=j("statusBar"),je=G.y+1,Ke=G.height-1;return{left:c?$e:p("left"),rightTop:d?ze:p("rightTop"),rightBottom:{...G,y:je,height:Ke},statusBar:qe}},g=v(t.specsVisible,t.monitorVisible),P=()=>({cols:g.rightBottom.width-2,rows:g.rightBottom.height-2}),w=new TextEncoder,h=c=>{$.process.writeToStdout(w.encode(c))};if(s){h(C.clearScreenSeq());let c=` noskills manager | ${l.length} spec(s) | ${re()} | Ctrl+C to quit`;h(a.moveTo(g.statusBar.y,g.statusBar.x)),h(a.inverse(a.truncate(c,g.statusBar.width))),h(ce(l,t.tabs,t.selectedTabIndex,g.left));let d=k(t);return h(le(d,g.rightTop)),h(de(d,g.rightBottom,t.tabs,t.selectedTabIndex)),h(a.moveTo(E,1)),h(`
|
|
4
|
+
`),Q(void 0)}let I=new be,u=null,i=async()=>{for(let c of["claude","claude-code"])try{if(await he`which ${c}`.noThrow().code()===0)return c}catch{}return"claude"},m=A(l,t.tabs);t.selectedTabIndex=K.nextSelectableIndex(m,-1,"down");let T=async()=>{let c=ne();await se(n,{id:c,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let d=P(),y=new Z(d.rows,d.cols),o={id:`tab-${c}`,spec:null,mode:"free",sessionId:c,process:null,buffer:[],widget:y,active:!0,phase:null};try{let p=await i(),S=await H({command:p,cwd:n,env:{...$.env.toObject(),NOSKILLS_SESSION:c,NOSKILLS_PROJECT_ROOT:n},cols:d.cols,rows:d.rows});o.process=S,I.add(o.id,S),S.onData(x=>{y.write(x),pe(o,x),u?.()}),S.exitCode.then(()=>{Object.assign(t,X(t,o.id)),m=A(l,t.tabs),L(),t.running&&R()}).catch(()=>{})}catch(p){let S=p instanceof Error?p.message:String(p);y.write(`[noskills manager] Failed to spawn claude: ${S}\r
|
|
5
|
+
`),y.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
6
|
+
`)}Object.assign(t,ue(t,o)),t.focus="terminal",m=A(l,t.tabs)},M=async c=>{let d=t.tabs.find(D=>D.spec===c);if(d!==void 0){let D=t.tabs.indexOf(d);Object.assign(t,Ve(t,D)),t.focus="terminal";return}let y=null;try{y=(await te(n,c)).phase}catch{}let o=ne();await se(n,{id:o,spec:c,mode:"spec",phase:y,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let p=P(),S=new Z(p.rows,p.cols),x={id:`tab-${o}`,spec:c,mode:"spec",sessionId:o,process:null,buffer:[],widget:S,active:!0,phase:y};try{let D=await i(),O=await H({command:D,cwd:n,env:{...$.env.toObject(),NOSKILLS_SESSION:o,NOSKILLS_PROJECT_ROOT:n},cols:p.cols,rows:p.rows});x.process=O,I.add(x.id,O),O.onData(V=>{S.write(V),pe(x,V),u?.()}),O.exitCode.then(()=>{Object.assign(t,X(t,x.id)),m=A(l,t.tabs),L(),t.running&&R()}).catch(()=>{})}catch(D){let O=D instanceof Error?D.message:String(D);S.write(`[noskills manager] Failed to spawn claude for spec "${c}": ${O}\r
|
|
7
|
+
`)}Object.assign(t,ue(t,x)),t.focus="terminal",m=A(l,t.tabs)};await T(),h(C.enterAlternateScreen()),h(C.hideCursorSeq()),h(C.clearScreenSeq()),h(J.enableMouse());let f=new Set(["specs","monitor","terminal","status"]),R=()=>{let c=k(t),d=[];if(d.push(C.hideCursorSeq()),f.size>=4&&d.push("\x1B[2J\x1B[H"),f.has("status")||f.size===0){let o=t.focus==="list"?"LIST":"TERM",p=`ctrl+e: ${t.specsVisible?"hide":"show"} specs | ctrl+w: ${t.monitorVisible?"hide":"show"} monitor`,S=t.focus==="terminal"?"esc: panels | ctrl+c: quit":`esc/tab: switch | ctrl+d: quit | ctrl+t: new tab | ${p}`,x=` noskills | ${t.tabs.length} tab(s) | [${o}] ${S}`;d.push(a.moveTo(g.statusBar.y,g.statusBar.x)),d.push(a.inverse(a.truncate(x,g.statusBar.width)+" ".repeat(Math.max(0,g.statusBar.width-a.visibleLength(x)))))}t.specsVisible&&f.has("specs")&&d.push(ce(l,t.tabs,t.selectedTabIndex,g.left)),t.monitorVisible&&f.has("monitor")&&d.push(le(c,g.rightTop)),f.has("terminal")&&d.push(de(c,g.rightBottom,t.tabs,t.selectedTabIndex));let y=k(t);if(y?.widget!==null&&y?.widget!==void 0){let o=g.rightBottom.y+1+y.widget.terminal.cursorRow,p=g.rightBottom.x+1+y.widget.terminal.cursorCol;d.push(a.moveTo(o,p))}d.push(C.showCursorSeq()),f.clear(),h(d.join(""))},L=()=>{f.add("specs"),f.add("monitor"),f.add("terminal"),f.add("status")},N=!1;u=()=>{f.add("terminal"),!N&&(N=!0,setTimeout(()=>{N=!1,t.running&&R()},16))};let Y=oe(n,async()=>{try{let c=await W(n);l.length=0;for(let d of c.specs)l.push({name:d.name,phase:d.phase,hasActiveSession:!1});m=A(l,t.tabs),f.add("specs"),f.add("monitor"),t.running&&R()}catch{}});L(),R();let U=async c=>{let d=Ue(c,g,m,t.focus);switch(d.type){case"clickSpec":{t.focus="list",t.selectedTabIndex=d.index;let y=l.find(o=>o.name===m[d.index]?.label)?.name;if(y!==void 0){await M(y),L();return}f.add("specs"),f.add("monitor"),f.add("status");break}case"clickTerminal":{t.focus="terminal",f.add("status");break}case"clickMonitor":{t.focus="list",f.add("status");break}case"scrollSpecs":{Object.assign(t,fe(t,d.direction,m)),f.add("specs"),f.add("monitor");break}case"scrollTerminal":{let y=k(t);if(y?.process!==null&&y!==null){let o=d.direction==="up"?"\x1B[A":"\x1B[B";y.process?.write(o.repeat(3))}break}case"forwardMouse":{t.focus="terminal",f.add("status");let y=k(t);if(y?.process!==null&&y!==null){let o=c.x+1-g.rightBottom.x,p=c.y+1-g.rightBottom.y,S=c.button;c.type==="mousemove"&&(S|=32),c.type==="wheel"&&(S=64|(c.direction==="down"?1:0)),c.shift&&(S|=4),c.ctrl&&(S|=16);let x=c.type==="mouseup"?"m":"M";y.process?.write(`\x1B[<${S};${o};${p}${x}`)}break}case"none":break}};try{await Se(async()=>{for await(let c of we($.process.stdin)){if(!t.running)break;if(c.kind==="mouse"){await U(c.event),f.size>0&&R();continue}let d=c.event;if(t.focus==="terminal"){let o=me(t,d.name,d.ctrl);if(o.type==="passthrough"||o.type==="none"){let p=k(t);p?.process!==null&&p!==null&&p.process?.write(new TextDecoder().decode(d.raw));continue}}let y=me(t,d.name,d.ctrl);switch(y.type){case"quit":t.running=!1;break;case"toggleFocus":Object.assign(t,Ne(t)),f.add("status");break;case"navigate":Object.assign(t,fe(t,y.direction,m)),f.add("specs"),f.add("monitor"),f.add("terminal");break;case"newTab":await T(),L();break;case"toggleSpecs":{t.specsVisible=!t.specsVisible,!t.specsVisible&&!t.monitorVisible&&(t.focus="terminal"),g=v(t.specsVisible,t.monitorVisible);let o=P();for(let p of t.tabs)p.process!==null&&p.process.resize(o.cols,o.rows),p.widget!==null&&p.widget.resize(o.rows,o.cols);L();break}case"toggleMonitor":{t.monitorVisible=!t.monitorVisible,!t.specsVisible&&!t.monitorVisible&&(t.focus="terminal"),g=v(t.specsVisible,t.monitorVisible);let o=P();for(let p of t.tabs)p.process!==null&&p.process.resize(o.cols,o.rows),p.widget!==null&&p.widget.resize(o.rows,o.cols);L();break}case"select":{let o=m[t.selectedTabIndex];if(o===void 0)break;let p=o.label;{let S=l.find(x=>x.name===p)?.name;S!==void 0&&await M(S)}L();break}case"closeTab":{let o=k(t);o!==null&&(o.process!==null&&I.remove(o.id),await Me(n,o.sessionId),Object.assign(t,X(t,o.id)),m=A(l,t.tabs),t.focus="list"),L();break}case"passthrough":{let o=k(t);o?.process!==null&&o!==null&&o.process?.write(new TextDecoder().decode(d.raw));break}case"none":break}if(!t.running)break;f.size>0&&R()}})}finally{Y(),await I.killAll(),I.forceKillAll(),await Re(n),h(J.disableMouse()),h(C.showCursorSeq()),h(C.exitAlternateScreen())}return Q(void 0)};export{Zt as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g}from"./chunk-YTLTR452.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-IHHITZU2.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{d as completionsHandler,f as doctorHandler,g as infoHandler,a as installHandler,b as uninstallHandler,c as updateHandler,e as versionHandler};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-5WJ6AUNY.js";var B={EserAjanVersion:{parameters:[],result:"pointer"},EserAjanInit:{parameters:[],result:"i32"},EserAjanShutdown:{parameters:[],result:"void"},EserAjanFree:{parameters:["pointer"],result:"void"},EserAjanConfigLoad:{parameters:["pointer"],result:"pointer"},EserAjanDIResolve:{parameters:["pointer"],result:"pointer"}},D=e=>{let r=new TextEncoder().encode(e),t=new ArrayBuffer(r.length+1),o=new Uint8Array(t);return o.set(r),o},v=e=>e===null?{value:"",ptr:e}:{value:new Deno.UnsafePointerView(e).getCString(),ptr:e},T=e=>{let n=r=>{r!==null&&e.EserAjanFree(r)};return{EserAjanVersion:()=>{let{value:r,ptr:t}=v(e.EserAjanVersion());return n(t),r},EserAjanInit:()=>e.EserAjanInit(),EserAjanShutdown:()=>{e.EserAjanShutdown()},EserAjanFree:r=>{e.EserAjanFree(r)},EserAjanConfigLoad:r=>{let t=D(r),o=e.EserAjanConfigLoad(Deno.UnsafePointer.of(t)),{value:a,ptr:s}=v(o);return n(s),a},EserAjanDIResolve:r=>{let t=D(r),o=e.EserAjanDIResolve(Deno.UnsafePointer.of(t)),{value:a,ptr:s}=v(o);return n(s),a}}},L={name:"deno",available:()=>typeof Deno<"u"&&typeof Deno.dlopen=="function",open:e=>{let n=Deno.dlopen(e,B);return Promise.resolve({symbols:T(n.symbols),close:()=>{n.close()}})}};var S={name:"bun",available:()=>typeof globalThis.Bun<"u",open:async e=>{let n=await import("bun:ffi"),{dlopen:r,CString:t,ptr:o}=n,a=r(e,{EserAjanVersion:{args:[],returns:"ptr"},EserAjanInit:{args:[],returns:"i32"},EserAjanShutdown:{args:[],returns:"void"},EserAjanFree:{args:["ptr"],returns:"void"},EserAjanConfigLoad:{args:["ptr"],returns:"ptr"},EserAjanDIResolve:{args:["ptr"],returns:"ptr"}}),{symbols:s}=a,i=d=>{let g=new TextEncoder().encode(d+"\0");return o(g)},c=d=>{if(d===null||d===0)return"";let f=new t(d);return s.EserAjanFree(d),f.toString()};return{symbols:{EserAjanVersion:()=>c(s.EserAjanVersion()),EserAjanInit:()=>s.EserAjanInit(),EserAjanShutdown:()=>{s.EserAjanShutdown()},EserAjanFree:d=>{s.EserAjanFree(d)},EserAjanConfigLoad:d=>c(s.EserAjanConfigLoad(i(d))),EserAjanDIResolve:d=>c(s.EserAjanDIResolve(i(d)))},close:()=>{a.close()}}}};var _={name:"node",available:()=>{let e=globalThis;return typeof e.process<"u"&&typeof e.process.versions?.node=="string"&&typeof e.Deno>"u"&&typeof e.Bun>"u"},open:async e=>{let n=await import("koffi");if(n.default!==void 0&&(n=n.default),typeof n.load!="function")throw new Error("koffi module loaded but koffi.load is not a function. Check your koffi version (requires ^2.15.0).");let r=n.load(e),t=r.func("char* EserAjanVersion()"),o=r.func("int EserAjanInit()"),a=r.func("void EserAjanShutdown()"),s=r.func("char* EserAjanConfigLoad(const char* path)"),i=r.func("char* EserAjanDIResolve(const char* name)");return{symbols:{EserAjanVersion:()=>t()??"",EserAjanInit:()=>o(),EserAjanShutdown:()=>{a()},EserAjanFree:c=>{},EserAjanConfigLoad:c=>s(c)??"",EserAjanDIResolve:c=>i(c)??""},close:()=>{r.unload()}}}};var J=await import("node:fs"),j=()=>{let e=globalThis;if(typeof e.Deno<"u"){let n=e.Deno.build.os;return n==="darwin"?".dylib":n==="windows"?".dll":".so"}if(typeof e.process<"u"&&typeof e.process.platform=="string"){let n=e.process.platform;return n==="darwin"?".dylib":n==="win32"?".dll":".so"}return".so"},W=()=>{let e=globalThis,n="linux",r="x64";if(typeof e.Deno<"u"){let t=e.Deno.build.os;n=t==="windows"?"win32":t,r=e.Deno.build.arch==="aarch64"?"arm64":"x64"}else typeof e.process<"u"&&(n=e.process.platform,r=e.process.arch==="arm64"?"arm64":"x64");return`${n}-${r}`},l=e=>{try{return J.statSync(e),!0}catch{return!1}},O=e=>{if(e!==void 0)return e;let n=globalThis;return typeof n.__dirname=="string"?n.__dirname:typeof n.process<"u"&&typeof n.process.cwd=="function"?n.process.cwd():"."},w=e=>{let r=`libeser_ajan${j()}`,t=[],o=U("ESER_AJAN_LIB_PATH");if(o!==void 0){if(l(o))return o;t.push(`$ESER_AJAN_LIB_PATH = ${o}`)}let a=O(e),s=`${a}/${r}`;if(t.push(s),l(s))return s;let i=W(),c={x64:"x86_64",arm64:"aarch64"},d={win32:"windows"},f=i.split("-"),g=f[0]??"linux",I=f[1]??"x64",$=c[I]??I,R=d[g]??g,y=`${$}-${R}`,k=`${a}/..`,b=`${k}/dist/${y}/${r}`;if(t.push(b),l(b))return b;let A=`${a}/dist/${y}/${r}`;if(t.push(A),l(A))return A;let E=globalThis,m=typeof E.process<"u"&&typeof E.process.cwd=="function"?E.process.cwd():".";if(m!==a){let u=`${m}/pkg/@eser/ajan/dist/${y}/${r}`;if(t.push(u),l(u))return u}let P=[a,k,m];for(let u of P){let h=`${u}/node_modules/@eserstack/ajan-${i}/${r}`;if(t.push(h),l(h))return h}let N=[`/usr/local/lib/${r}`,`/usr/lib/${r}`];for(let u of N)if(t.push(u),l(u))return u;throw new Error(`Could not find eser-ajan shared library (${r}).
|
|
3
|
+
Checked the following locations:
|
|
4
|
+
`+t.map(u=>` - ${u}`).join(`
|
|
5
|
+
`)+`
|
|
6
|
+
|
|
7
|
+
To fix this:
|
|
8
|
+
1. Install: npm install @eser/ajan
|
|
9
|
+
2. Or set ESER_AJAN_LIB_PATH to the full path of ${r}`)},U=e=>{let n=globalThis;if(typeof n.process<"u"&&typeof n.process.env=="object")return n.process.env[e]??void 0};var K=e=>{try{let n=globalThis;if(typeof n.process<"u"&&n.process.env!=null)return n.process.env[e]}catch{}},p=e=>{let n=K(e);return n!==void 0&&n.toLowerCase()==="disabled"},F=e=>{console.debug(`[eser-ajan/ffi] ${e}`)},x=import.meta.dirname,G=j,Q=e=>w(e??x),q=[L,S,_],Y=()=>{let e=globalThis;return typeof e.Deno<"u"&&typeof e.Deno.dlopen=="function"?"deno":typeof e.Bun<"u"?"bun":typeof e.process<"u"&&typeof e.process.versions?.node=="string"&&typeof e.Deno>"u"&&typeof e.Bun>"u"?"node":"unknown"},z=()=>{for(let n of q)if(n.available())return n;let e=Y();throw new Error(`No FFI backend available for runtime "${e}".
|
|
10
|
+
Supported runtimes:
|
|
11
|
+
- Deno 2.7+ (Deno.dlopen)
|
|
12
|
+
- Bun 1.3+ (bun:ffi)
|
|
13
|
+
- Node 25+ (node:ffi, experimental)
|
|
14
|
+
|
|
15
|
+
Current runtime: ${e}`)},X=async(e,n)=>{let r=typeof e=="string"?e:void 0,t=typeof e=="object"?e:n;if(p("ESER_AJAN"))throw F("ALL disabled \u2014 ESER_AJAN=disabled"),new Error(`Ajan is disabled via ESER_AJAN=disabled environment variable.
|
|
16
|
+
Unset ESER_AJAN to re-enable.`);let o=!p("ESER_AJAN_NATIVE")&&t?.native!==!1,a=!p("ESER_AJAN_WASM")&&t?.wasm!==!1;if(o||F("Native FFI disabled \u2014 skipping to WASM fallback"),a||F("WASM fallback disabled"),o)try{let i=r??w(x);return await z().open(i)}catch{}if(a)try{return await(await import("./mod-HZDU4RQ6.js")).loadEserAjanWasm()}catch(i){throw new Error(`No native FFI backend available and WASM fallback failed.
|
|
17
|
+
WASM error: ${i instanceof Error?i.message:String(i)}
|
|
18
|
+
|
|
19
|
+
To fix this, install the @eser/ajan package or build the native library.
|
|
20
|
+
See: https://github.com/eser/stack/tree/main/pkg/@eser/ajan`)}let s=[];throw o||s.push(p("ESER_AJAN_NATIVE")?"ESER_AJAN_NATIVE=disabled":"native=false in LoadOptions"),a||s.push(p("ESER_AJAN_WASM")?"ESER_AJAN_WASM=disabled":"wasm=false in LoadOptions"),new Error(`All FFI backends are disabled.
|
|
21
|
+
Reasons: ${s.join(", ")}
|
|
22
|
+
|
|
23
|
+
To fix this, unset the relevant environment variables or adjust LoadOptions.`)};export{Y as detectRuntime,G as getLibraryExtension,X as loadEserAjan,Q as resolveLibraryPath,z as selectBackend};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as ie}from"./chunk-5YBG2HOI.js";import{a as ye}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{a as z}from"./chunk-P4SPHY3G.js";import{a as he,b as ge,c as Se}from"./chunk-4KDDHQVL.js";import"./chunk-PPB6ACBB.js";import{a as K,c as Y,e as X}from"./chunk-4JICYXYK.js";import"./chunk-KFVUFHJB.js";import{a as G}from"./chunk-NY4W44PI.js";import{a as ve,b as we,d as P}from"./chunk-2ZYCRMUT.js";import{a as Ee}from"./chunk-LEG3PWOU.js";import{a as H}from"./chunk-ODBJ5KMQ.js";import{a as Oe,b as Re,c as Fe,d as Te}from"./chunk-DI7OHJ53.js";import{h as W}from"./chunk-L32KHQVT.js";import{a as xe,b as Ce,c as Z,d as Ie,e as De,f as ee,g as F,h as te,i as J,j as se,k as Pe,m as ke,o as ne,p as be,v as Ae}from"./chunk-E4WXXNF6.js";import{A as me,B as fe,a as ae,c as R,e as oe,f as ce,j as le,k as de,l as pe,p as ue,r as _,w as B}from"./chunk-LOZLXP5G.js";import{c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as q,b as E}from"./chunk-FFWPJP7A.js";import{i as D}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var ot=async l=>{let{root:e}=await fe(),r=ve(l),u=we(l);if(!await me(e))return await P({error:`noskills not initialized. Run: ${V("init")}`},r),E({exitCode:1});let n=null;for(let f of u)f.startsWith("--answer=")&&(n=f.slice(9));let s=ce(u),t;try{t=await oe(e,s)}catch(f){let h=f instanceof Error?f.message:String(f);return await P({error:h},r),E({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED")return await P({error:"Error: --spec=<name> is required. Use `noskills spec list` to see available specs."},r),E({exitCode:1});let a=await pe(e);if(a?.command!==void 0){let{setCommandPrefix:f}=await import("./cmd-QE4P4DS4.js");f(a.command)}if(a===null)return await P({error:"No config found"},r),E({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let f=`${e}/${R.specDir(t.spec)}`;try{await D.fs.stat(f)}catch{return await P({error:!0,message:`Active spec '${t.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${V("reset")}\` to return to idle, or \`${V("cancel")}\` to mark as cancelled.`},r),E({exitCode:1})}}let i=ye(u,a);t.phase==="DISCOVERY"&&t.discovery.audience!==i&&(t={...t,discovery:{...t.discovery,audience:i}});let d=(await ue(e)).filter(f=>a.concerns.includes(f.id));if(n!==null){let f=await W(e),h=await Me(e,t,a,d,n,f);await _(e,h);let g={...h,lastCalledAt:new Date().toISOString()};await _(e,g);let N=D.env.get("NOSKILLS_SESSION")??null;N!==null&&await B(e,N,g.phase);let M=await K(e),{tier1:j,tier2Count:w}=Y(M,g.phase),k=g.spec!==null?await H(e,g.spec):null,A=await $e(e,g),I=await ie(e,A),C=X(a?.tools??[]),S=await W(e),b=await z(g,d,j,a,k,I,void 0,C,S,w,e),Q=n.trim().toLowerCase()==="save",Le=g.phase===t.phase;if(Q&&Le&&(g.phase==="SPEC_PROPOSAL"||g.phase==="SPEC_APPROVED")){let Ue=g.phase==="SPEC_PROPOSAL"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',Ne={...b,instruction:Ue,saved:!0};return await P(Ne,r),q(void 0)}return await P(b,r),q(void 0)}let c={...t,lastCalledAt:new Date().toISOString()};await _(e,c);let m=D.env.get("NOSKILLS_SESSION")??null;m!==null&&await B(e,m,c.phase);let p=await K(e),{tier1:v,tier2Count:x}=Y(p,c.phase),y=c.spec!==null?await H(e,c.spec):null,T=await $e(e,c),$=await ie(e,T),L;c.phase==="IDLE"&&(L={existingSpecs:(await de(e)).map(h=>({name:h.name,phase:h.state.phase,iteration:h.state.execution.iteration,detail:h.state.phase==="EXECUTING"?`${h.state.execution.completedTasks.length} tasks done, iteration ${h.state.execution.iteration}`:h.state.phase==="SPEC_PROPOSAL"?"awaiting approval":h.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:v.length});let U=X(a?.tools??[]),re=await W(e),O=await z(c,d,v,a,y,$,L,U,re,x,e);return await P(O,r),q(void 0)},Me=async(l,e,r,u,n,s)=>{switch(e.phase){case"DISCOVERY":{let t=e.discovery.userContext!==void 0&&e.discovery.userContext.length>0,a=e.specDescription!==null&&e.specDescription.length>0,i=e.discovery.mode;if(!t&&i===void 0&&a)return Ae(e,n);if(i===void 0&&a)return["full","validate","technical-depth","ship-fast","explore"].includes(n)?Z(e,n):Z(e,"full");let o=e.discovery.premisesCompleted===!0;if(i!==void 0&&!o){try{let p=JSON.parse(n);if(p!==null&&typeof p=="object"&&"premises"in p){let x=p.premises.map(y=>({text:y.text??"",agreed:y.agreed??!0,revision:y.revision,user:s?.name??"Unknown User",timestamp:new Date().toISOString()}));if(x.length===0)throw new Error("Premise challenge requires at least one premise. Empty array rejected.");return Ie(e,x)}}catch{throw new Error("Premise challenge requires valid JSON with premises array. Re-prompt the user.")}throw new Error("Premise challenge requires a premises array. Cannot skip with empty input.")}let d=e.discovery.audience==="agent",c=null;try{let p=JSON.parse(n);typeof p=="object"&&p!==null&&!Array.isArray(p)&&(d?he.map(y=>y.id).every(y=>y in p)&&(c=p):c=p)}catch{}let m=e;if(c!==null){for(let[p,v]of Object.entries(c))typeof v=="string"&&v.length>0&&(m=F(m,p,v,s));m={...m,discovery:{...m.discovery,batchSubmitted:!0}}}else{let p=ge(u),v=m.discovery.currentQuestion,x=p[v];if(x===void 0)return e;m=F(m,x.id,n,s),m=Pe(m)}return Se(m.discovery.answers)&&(m=te(m)),m}case"DISCOVERY_REFINEMENT":{let t=n.trim().toLowerCase();if(t==="approve"){let i=G(e.discovery.answers);return i.detected&&i.proposals.length>=2?se(e):e.discovery.mode!==void 0?se(e):J(e)}if(t==="split")return await je(l,e);if(t==="keep"){let i=ne(e,{id:`decision-split-keep-${Date.now()}`,question:"Split spec into separate areas?",choice:"Chose to keep as single spec despite multiple areas detected",promoted:!1,timestamp:new Date().toISOString()});return J(i)}let a=e.discovery.alternativesPresented===!0;if(e.discovery.approved&&!a){let i;if(t==="skip"||t==="none")i=ee(e);else{let o=!1;try{let d=JSON.parse(n);if(d!==null&&typeof d=="object"&&"approach"in d){let c={id:String(d.approach),name:String(d.name??d.approach),summary:String(d.summary??""),effort:String(d.effort??""),risk:String(d.risk??""),user:s?.name??"Unknown User",timestamp:new Date().toISOString()};i=De(e,c),o=!0}}catch{}o||(i=ee(e))}return J(i)}try{let i=JSON.parse(n);if(typeof i.revise=="object"&&i.revise!==null){let o=e;for(let[d,c]of Object.entries(i.revise))typeof c=="string"&&c.length>0&&(o=F(o,d,c,s));return o}}catch{}return e}case"SPEC_PROPOSAL":{if(n.trim().toLowerCase()==="save")return e;if(e.classification===null){let t,a=n.trim().toLowerCase();if(a==="none"||a==="skip")t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1};else try{let o=JSON.parse(n);t={involvesWebUI:o.involvesWebUI===!0||o.involvesUI===!0,involvesCLI:o.involvesCLI===!0||o.involvesUI===!0,involvesPublicAPI:o.involvesPublicAPI===!0,involvesMigration:o.involvesMigration===!0,involvesDataHandling:o.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let i={...e,classification:t};try{await Ee(l,i,u)}catch{}return i}try{let t=JSON.parse(n);if(typeof t.refinement=="string"&&t.refinement.length>0){let a=t.refinement;if(e.spec!==null){let i=`${l}/${R.specFile(e.spec)}`,o=await D.fs.readTextFile(i);if(a.includes("task-")){let c=qe(a).map(v=>`- [ ] ${v}`).join(`
|
|
3
|
+
`),m=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,p=o.replace(m,`## Tasks
|
|
4
|
+
|
|
5
|
+
${c}
|
|
6
|
+
`);await D.fs.writeTextFile(i,p)}}return e}}catch{}return e}case"SPEC_APPROVED":{if(n.trim().toLowerCase()==="save")return e;let t=ke(e);return t.spec!==null&&(await Oe(l,t.spec,"executing"),await Te(l,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(r.verifyCommand!==null&&r.verifyCommand!==void 0&&r.verifyCommand.length>0){let a=await Ve(l,r.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:a}},!a.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await _e(l,e,n,u)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",a={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},i=ne(e,a);return i=xe(i,"EXECUTING"),i={...i,execution:{...i.execution,lastProgress:`Resolved: ${n}`}},i}default:return e}},je=async(l,e)=>{let r=G(e.discovery.answers);if(!r.detected||r.proposals.length===0)return e;let u=[];for(let s of r.proposals){let t=`${l}/${R.specDir(s.name)}`;await D.fs.mkdir(t,{recursive:!0});let a=e.discovery.answers.filter(d=>s.relevantAnswers.includes(d.questionId)),o=Ce(ae(),s.name,`spec/${s.name}`);for(let d of a)o=F(o,d.questionId,d.answer);o=te(o),await le(l,s.name,o),u.push(s.name)}return be(e,"cancelled",`Split into: ${u.join(", ")}`)},qe=l=>l.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),_e=async(l,e,r,u)=>{let n;try{n=JSON.parse(r)}catch{return{...e,execution:{...e.execution,lastProgress:r,awaitingStatusReport:!1}}}let s=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let k=e.execution.debt.items.map((C,S)=>({id:`legacy-${S+1}`,text:C,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:k}}};let A=new TextEncoder,I=D.process.stderr.getWriter();await I.write(A.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
|
|
7
|
+
`)),I.releaseLock()}let t=new Set(["mandatory-tests","mandatory-docs"]),i=(n.na??[]).filter(w=>t.has(w));if(i.length>0)return{...s,execution:{...s.execution,lastProgress:`REJECTED: Tests and documentation ACs require explicit justification to mark as N/A. Explain why tests or docs are not needed for this spec. Rejected IDs: ${i.join(", ")}`,awaitingStatusReport:!0}};let o=n.completed??[],d=new Set(o),c=n.na??[],m=new Set(c),p=n.newIssues??[],v=n.remaining??[],x=n.blocked??[],y=s.execution.debt?.unaddressedIterations??0,T=s.execution.debt!==null?s.execution.debt.items.filter(w=>!d.has(w.id)&&!m.has(w.id)):[],$=s.execution.debtCounter??0,L=p.map((w,k)=>({id:`debt-${$+k+1}`,text:w,since:s.execution.iteration})),U=[...T,...L],O=v.length===0&&x.length===0&&p.length===0||U.length===0?null:{items:U,fromIteration:s.execution.debt?.fromIteration??s.execution.iteration,unaddressedIterations:T.length>0?y+1:1},f=[...new Set([...s.execution.naItems??[],...c])],h=[];o.length>0&&h.push(`Completed: ${o.join(", ")}`),c.length>0&&h.push(`N/A: ${c.join(", ")}`);let g=h.length>0?h.join("; "):"Status report submitted",N=s.execution.lastVerification===null||s.execution.lastVerification.passed===!0,M=O===null&&N,j=$+p.length;if(M&&s.spec!==null){let w=await H(l,s.spec);if(w!==null){let k=s.execution.completedTasks??[],A=new Set(k),I=[];try{let S=JSON.parse(s.execution.lastProgress??"");Array.isArray(S.completed)&&(I=S.completed.filter(b=>!A.has(b)&&w.tasks.some(Q=>Q.id===b)))}catch{}if(I.length===0){let S=w.tasks.find(b=>!A.has(b.id));S!==void 0&&(I=[S.id])}let C=[];for(let S of I)await Re(l,s.spec,S),await Fe(l,s.spec,S,"done"),C.push(S);if(C.length>0){let S=C.length===1?`Task ${C[0]} accepted`:`Tasks ${C.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${S}: ${g}`,awaitingStatusReport:!1,debt:O,completedTasks:[...k,...C],debtCounter:j,naItems:f}}}}}return{...s,execution:{...s.execution,lastProgress:M?g:`Task not accepted \u2014 remaining items must be addressed first. ${g}`,awaitingStatusReport:!1,debt:O,debtCounter:j,naItems:f}}},Ve=async(l,e)=>{try{let{execSync:r}=await import("node:child_process"),u=r(e,{cwd:l,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(u).slice(0,4e3),timestamp:new Date().toISOString()}}catch(r){let u=r,n=((u.stdout??"")+(u.stderr??"")).slice(0,4e3);return u.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${r instanceof Error?r.message:String(r)}`,timestamp:new Date().toISOString()}}},$e=async(l,e)=>{let r=[...e.execution.modifiedFiles??[]],u=await Je(l);return[...new Set([...r,...u])]},Je=async l=>{let e=`${l}/${R.stateDir}/files-changed.jsonl`;try{let u=(await D.fs.readTextFile(e)).trim().split(`
|
|
8
|
+
`).filter(Boolean),n=[];for(let s of u)try{let t=JSON.parse(s);n.includes(t.file)||n.push(t.file)}catch{}return n}catch{return[]}};export{Me as handleAnswer,ot as main,qe as parseRefinementTasks};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as E}from"./chunk-
|
|
2
|
+
import{f as E}from"./chunk-4JICYXYK.js";import{B as R,c as y,l as T}from"./chunk-LOZLXP5G.js";import{b as C}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as P,h as S,k as v}from"./chunk-SHN5MT56.js";import{c as h,d as f,f as w,g as F}from"./chunk-YVN2NZL4.js";import{a as $,b as g}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var U=r=>{let e=r;if(typeof e?.name!="string"||e.name.length===0)throw new Error("Pack manifest must have a non-empty 'name' field");if(typeof e?.version!="string"||e.version.length===0)throw new Error("Pack manifest must have a non-empty 'version' field");if(typeof e?.description!="string"||e.description.length===0)throw new Error("Pack manifest must have a non-empty 'description' field");return e},B=()=>({installed:[]});var L={name:"typescript",version:"1.0.0",description:"TypeScript best practices",tags:["typescript","types"],rules:["rules/use-strict-types.md","rules/no-any.md","rules/prefer-const.md"],concerns:["concerns/ts-quality.json"]};var _={id:"ts-quality",name:"TypeScript Quality",description:"Enforces TypeScript best practices",extras:[{questionId:"verification",text:"Does the code pass strict TypeScript checks (noEmit, strict mode)?"}],specSections:[],reminders:["Run tsc --noEmit before reporting task complete"],acceptanceCriteria:["TypeScript strict mode passes with zero errors"]};var J={name:"react",version:"1.0.0",description:"React component conventions",tags:["react","frontend"],rules:["rules/component-structure.md","rules/prefer-function-components.md","rules/state-management.md"]};var H={name:"security",version:"1.0.0",description:"Security audit rules",tags:["security","audit"],rules:["rules/no-secrets-in-code.md","rules/validate-input.md","rules/no-eval.md"],concerns:["concerns/security-audit.json"]};var K={id:"security-audit",name:"Security Audit",description:"Security-focused review for every spec",extras:[{questionId:"verification",text:"Has the change been reviewed for injection, XSS, CSRF, and auth bypass?"},{questionId:"scope_boundary",text:"What security boundaries must NOT be crossed?"}],specSections:["Security Review"],reminders:["Check for hardcoded secrets, unsanitized input, and missing auth checks"],acceptanceCriteria:["No hardcoded secrets","All user input validated","Auth checks present on protected routes"]};var ne={"use-strict-types":"Prefer explicit types over inference for function params and returns","no-any":"Never use 'any'. Use 'unknown' when type is genuinely unknown.","prefer-const":"Use const by default, let only when reassignment is needed"},te={"component-structure":"One component per file. Name file same as component.","prefer-function-components":"Use function components with hooks. No class components.","state-management":"Keep state as close to where it's used as possible."},se={"no-secrets-in-code":"Never hardcode API keys, passwords, or tokens","validate-input":"Validate and sanitize all user input at API boundaries","no-eval":"Never use eval(), new Function(), or equivalent dynamic code execution"},re={manifest:L,ruleContents:ne,concernContents:[_]},ie={manifest:J,ruleContents:te,concernContents:[]},ae={manifest:H,ruleContents:se,concernContents:[K]},x=new Map([["typescript",re],["react",ie],["security",ae]]);var z=".eser/packs.json",D=3e4,je=async r=>{let e=r?.[0];if(e==="list")return await ce();if(e==="install")return await le(r?.slice(1));if(e==="uninstall")return await de(r?.slice(1));if(e==="inspect")return await ue(r?.slice(1));if(e==="search")return await pe(r?.slice(1));let n=C(),i=P({renderer:v.ansi(),sink:S.stdout()});return i.writeln(`Usage: ${n} pack <list | install <name> | uninstall <name> | inspect <name> | search <query>>`),await i.close(),$(void 0)},M=async r=>{let e=`${r}/${z}`;try{let n=await m.fs.readTextFile(e);return JSON.parse(n)}catch{return B()}},N=async(r,e)=>{let n=`${r}/${z}`;await m.fs.mkdir(`${r}/.eser`,{recursive:!0}),await m.fs.writeTextFile(n,JSON.stringify(e,null,2)+`
|
|
3
3
|
`)},b=r=>x.get(r),O=r=>{let e=r.replace(/^github:/,"").replace(/^gh:/,""),n=e.indexOf("#");if(n===-1)return null;let i=e.slice(0,n),t=e.slice(n+1),l=i.indexOf("/");if(l===-1)return null;let u=i.slice(0,l),c=i.slice(l+1);return u.length===0||c.length===0||t.length===0?null:{owner:u,repo:c,ref:"main",packPath:t}},W=async r=>{let e=O(r);if(e===null)throw new Error(`Invalid pack specifier: ${r}. Expected format: github:owner/repo#pack-name`);let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.ref}/packs/${e.packPath}/pack.json`,i=await globalThis.fetch(n,{signal:AbortSignal.timeout(D)});if(!i.ok)throw new Error(`Could not fetch pack from ${r}. HTTP ${i.status}`);let t=JSON.parse(await i.text());return U(t)},j=async(r,e)=>{let n=O(r);if(n===null)throw new Error(`Invalid pack specifier: ${r}`);let i=`https://raw.githubusercontent.com/${n.owner}/${n.repo}/${n.ref}/packs/${n.packPath}/${e}`,t=await globalThis.fetch(i,{signal:AbortSignal.timeout(D)});if(!t.ok)throw new Error(`Could not fetch ${e} from ${r}. HTTP ${t.status}`);return await t.text()},Q=async r=>{let e=`${r}/${y.concernsDir}`,n=0;try{for await(let i of m.fs.readDir(e))if(i.isFile&&i.name.endsWith(".json")){let t=i.name.match(/^(\d+)-/);if(t!==null){let l=parseInt(t[1],10);l>n&&(n=l)}}}catch{}return n+1},A=async(r,e,n)=>{let i=[],t=[],l=[],u=`${r}/${y.rulesDir}`;await m.fs.mkdir(u,{recursive:!0});for(let[p,o]of Object.entries(n.ruleContents)){let a=`pack-${e}-${p}.md`;await m.fs.writeTextFile(`${u}/${a}`,o+`
|
|
4
4
|
`),i.push(a)}if(n.concernContents.length>0){let p=`${r}/${y.concernsDir}`;await m.fs.mkdir(p,{recursive:!0});let o=await Q(r);for(let a of n.concernContents){let d=`${String(o).padStart(3,"0")}-${a.id}.json`;await m.fs.writeTextFile(`${p}/${d}`,JSON.stringify(a,null,2)+`
|
|
5
5
|
`),t.push(d),o++}}if(n.folderRuleContents!==void 0)for(let[p,o]of Object.entries(n.folderRuleContents)){let a=`${r}/${p}/.folder-rules.md`;await m.fs.mkdir(`${r}/${p}`,{recursive:!0}),await m.fs.writeTextFile(a,o+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,k as R,p as x}from"./chunk-
|
|
2
|
+
import{a as D,b as P}from"./chunk-NTY267SI.js";import"./chunk-L5OC7F24.js";import{c as l,k as R,p as x}from"./chunk-LOZLXP5G.js";import{a as E}from"./chunk-2XNFZXHY.js";import{a as k,b as C,f as v,o}from"./chunk-5GGWX7CO.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{a as d,b as $}from"./chunk-FFWPJP7A.js";import{i as a}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import{e as j}from"./chunk-5WJ6AUNY.js";var S=j(E(),1);var Y=async e=>{let t=a.process.cwd(),n=D(e),s=C({target:n==="agent"?"non-interactive":"interactive"}),u=P(e).includes("--force");if(!u&&n==="agent")return o.error(s,"Purge requires `--force` flag in agent mode."),$({exitCode:1});if(u)return o.step(s,"Purging noskills content..."),await q(t,s),o.success(s,"Purge complete."),d(void 0);let g=(await N(t)).filter(i=>i.exists);if(g.length===0)return o.info(s,"Nothing to remove."),d(void 0);let p=[];for(let i of g){let y=await v(s,{message:i.message});if(k(y))return o.info(s,"Aborted."),d(void 0);p.push({id:i.id,confirmed:y===!0})}let f=p.filter(i=>i.confirmed),I=p.filter(i=>!i.confirmed);if(f.length===0)return o.info(s,"Nothing selected for removal."),d(void 0);let T=new Set(f.map(i=>i.id)),w=[];for(let i of f)await H(t,i.id)?o.step(s,` Removed ${h(i.id)}`):(w.push(i.id),o.step(s,` Failed to remove ${h(i.id)}`));for(let i of I)o.step(s,` Kept ${h(i.id)}`);T.size>0&&await b(t);let M=f.length-w.length;return o.success(s,`Purge complete (${M} of ${g.length} categories removed).`),d(void 0)},N=async e=>{let[t,n,s,r]=await Promise.all([O(e),L(e),J(e),U(e)]);return[t,n,s,r]},O=async e=>{let t=await x(e),n=t.map(s=>s.id).join(", ");return{id:"concerns",exists:t.length>0,message:`Remove concerns? (${n})`}},L=async e=>{let t=await R(e),n=0;try{for await(let c of a.fs.readDir(`${e}/${l.specsDir}`))c.isDirectory&&n++}catch{}let s=Math.max(t.length,n);if(s===0)return{id:"specs",exists:!1,message:""};let r=t.map(c=>`${c.name} ${c.state.phase}`).join(", ");return{id:"specs",exists:!0,message:t.length>0?`Remove specs? (${s} specs: ${r})`:`Remove specs? (${s} spec directories)`}},J=async e=>{let t=0;try{for await(let n of a.fs.readDir(`${e}/${l.rulesDir}`))n.isFile&&t++}catch{}return{id:"rules",exists:t>0,message:`Remove rules? (${t} active rules)`}},U=async e=>{let t=!1,n=!1,s=!1;try{let c=await a.fs.readTextFile(`${e}/.claude/settings.json`);t=JSON.parse(c).hooks!==void 0}catch{}try{n=(await a.fs.readTextFile(`${e}/CLAUDE.md`)).includes("<!-- noskills:start -->")}catch{}let r=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let c of r)try{await a.fs.stat(c),s=!0;break}catch{}return{id:"agent-integration",exists:t||n||s,message:"Remove agent integration? (.claude/settings.json, CLAUDE.md, .claude/agents/noskills-*.md)"}},h=e=>({concerns:"concerns",specs:"specs",rules:"rules","agent-integration":"agent integration"})[e],H=(e,t)=>{switch(t){case"concerns":return m(`${e}/${l.concernsDir}`);case"specs":return z([`${e}/${l.specsDir}`,`${e}/${l.stateDir}`]);case"rules":return m(`${e}/${l.rulesDir}`);case"agent-integration":return A(e)}},q=async(e,t)=>{await m(`${e}/${l.concernsDir}`)&&o.step(t," Removed `.eser/concerns/`"),await m(`${e}/${l.specsDir}`)&&o.step(t," Removed `.eser/specs/`"),await m(`${e}/${l.rulesDir}`)&&o.step(t," Removed `.eser/rules/`"),await m(`${e}/${l.stateDir}`)&&o.step(t," Removed `.eser/.state/`"),await b(e)&&o.step(t," Removed noskills section from `manifest.yml`"),await A(e)&&o.step(t," Removed agent integration")},m=async e=>{try{await a.fs.stat(e);let{rmSync:t}=await import("node:fs");return t(e,{recursive:!0,force:!0}),!0}catch{return!1}},z=async e=>{let t=!1;for(let n of e)await m(n)&&(t=!0);return t},F=async e=>{try{await a.fs.stat(e);let{unlinkSync:t}=await import("node:fs");return t(e),!0}catch{return!1}},b=async e=>{let t=`${e}/${l.manifestFile}`;try{let n=await a.fs.readTextFile(t),s=S.parseDocument(n);return s.has("noskills")?(s.delete("noskills"),await a.fs.writeTextFile(t,s.toString()),!0):!1}catch{return!1}},B=async e=>{let t=`${e}/CLAUDE.md`,n="<!-- noskills:start -->",s="<!-- noskills:end -->";try{let r=await a.fs.readTextFile(t),u=r.indexOf(n),c=r.indexOf(s);return u!==-1&&c!==-1?(r=r.slice(0,u).trimEnd()+`
|
|
3
3
|
`+r.slice(c+s.length).trimStart(),await a.fs.writeTextFile(t,r.trimEnd()+`
|
|
4
4
|
`),!0):!1}catch{return!1}},K=async e=>{let t=`${e}/.claude/settings.json`;try{let n=await a.fs.readTextFile(t),s=JSON.parse(n);return s.hooks!==void 0?(delete s.hooks,await a.fs.writeTextFile(t,JSON.stringify(s,null,2)+`
|
|
5
5
|
`),!0):!1}catch{return!1}},A=async e=>{let t=!1;await K(e)&&(t=!0),await B(e)&&(t=!0);let n=[`${e}/.claude/agents/noskills-executor.md`,`${e}/.claude/agents/noskills-verifier.md`];for(let r of n)await F(r)&&(t=!0);let s=[`${e}/.cursorrules`,`${e}/.windsurfrules`,`${e}/.kiro/steering/conventions.md`,`${e}/.github/copilot-instructions.md`];for(let r of s)await F(r)&&(t=!0);return t};export{Y as main};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as c}from"./chunk-
|
|
2
|
+
import{a as c}from"./chunk-NCSKHFFW.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as g}from"./chunk-LFNUSULJ.js";import{a as R,c as f}from"./chunk-PZUDTTK4.js";import{f as w,o as t}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as m}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{d as a}from"./chunk-VKB3B2FE.js";import{a as p}from"./chunk-MG65QJY6.js";import{g as i}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:n,output:A}=R(),x=async()=>(await a`git status --porcelain`.noThrow().text()).length===0,E=async()=>{let e=await a`git log @{u}..HEAD --oneline`.noThrow().text();return e.length>0?e.split(`
|
|
3
3
|
`):[]},$=async(e,r)=>{for(let s of r)await a`git add ${s}`.spawn();await a`git commit -m ${e}`.spawn()},P=async()=>{await a`git push origin HEAD`.spawn()},b=async e=>{await a`git tag -d ${e}`.noThrow().spawn();let r=`:refs/tags/${e}`;await a`git push origin ${r}`.noThrow().spawn()},O=async e=>await w(n,{message:e})===!0,k=async e=>{let{type:r,dryRun:s=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit or stash changes first.");let o=await E();if(o.length>0&&e.yes!==!0)throw new Error(`You have ${o.length} unpushed commit(s):
|
|
4
4
|
${o.join(`
|
|
5
5
|
`)}
|
|
6
6
|
|
|
7
|
-
Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-
|
|
7
|
+
Push first, or re-run with --yes to continue anyway.`);let l=await c()??"0.0.0";r!=="same"&&await(await import("./versions-NR3A7CS5.js")).versions(r,{dryRun:s});let u=await c()??l,d=!1;try{await(await import("./changelog-gen-HL2OZBDU.js")).generateChangelog({dryRun:s}),d=!0}catch{d=!1}let h=!1,v=!1;if(!s){d&&await a`deno fmt CHANGELOG.md`.noThrow().spawn();let y=["VERSION","CHANGELOG.md","pkg/*/deno.json","pkg/*/package.json","package.json"],C=`chore(codebase): release v${u}`;await $(C,y),h=!0,await P(),v=!0}return{version:u,previousVersion:l,changelogGenerated:d,committed:h,pushed:v,dryRun:s}},M=async(e={})=>{let{dryRun:r=!1}=e;if(!await x())throw new Error("Working tree is dirty. Commit and push first.");let s=await E();if(s.length>0)throw new Error(`You have unpushed commits. Push first, then rerelease.
|
|
8
8
|
${s.join(`
|
|
9
9
|
`)}`);let o=await c();if(o===void 0||!/^\d+\.\d+\.\d+$/.test(o))throw new Error(`Invalid or missing version in VERSION file: "${o}"`);let l=`v${o}`;if(!r){let u=`chore(codebase): release v${o}`;await a`git commit --allow-empty -m ${u}`.spawn(),await a`git push origin HEAD`.spawn()}return{version:o,tag:l,dryRun:r}},T=async(e={})=>{let r=await c();if(r===void 0||!/^\d+\.\d+\.\d+$/.test(r))throw new Error(`Invalid or missing version in VERSION file: "${r}"`);let s=`v${r}`;if(e.yes!==!0)throw new Error(`This will delete tag ${s} locally and remotely. Re-run with --yes to confirm.`);return await b(s),{version:r,tag:s,deleted:!0}},U=e=>m.fromPromise(()=>k(e)),H=e=>m.fromPromise(()=>M(e)),I=e=>m.fromPromise(()=>T(e)),V=e=>{let r=e.args[0];return r===void 0||!["patch","minor","major","same"].includes(r)?i.fail(g.adaptError("Usage: eser codebase release <patch|minor|major|same> [--dry-run] [--yes]")):i.ok({type:r,dryRun:e.flags["dry-run"]===!0,yes:e.flags.yes===!0})},j=e=>i.ok({dryRun:e.flags["dry-run"]===!0}),G=e=>i.ok({yes:e.flags.yes===!0}),N=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?(t.warn(n,"[DRY RUN] Release preview:"),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"generated":"no user-facing changes"}`),t.info(n," No changes were made.")):(t.success(n,`Released v${r.version}`),t.info(n,` Version: ${r.previousVersion} -> ${r.version}`),t.info(n,` Changelog: ${r.changelogGenerated?"updated":"no user-facing changes"}`),t.info(n,` Committed: ${r.committed}`),t.info(n,` Pushed: ${r.pushed}`),t.info(n," CI will validate, tag, and publish."),t.info(n," Watch: https://github.com/eser/stack/actions")),i.ok(void 0)},D=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.dryRun?t.warn(n,`[DRY RUN] Would delete and recreate tag ${r.tag}`):(t.success(n,`Re-tagged ${r.tag}`),t.info(n,"CI will validate and publish.")),i.ok(void 0)},S=e=>{if(i.isFail(e)){let s=e.error,o=s instanceof Error?s.message:s.message??String(s);return t.error(n,o),i.fail({exitCode:1})}let{value:r}=e;return r.deleted&&t.success(n,`Deleted tag v${r.version} (local + remote).`),i.ok(void 0)},F=g.createTrigger({handler:U,adaptInput:V,adaptOutput:N}),W=g.createTrigger({handler:H,adaptInput:j,adaptOutput:D}),Y=g.createTrigger({handler:I,adaptInput:G,adaptOutput:S}),ee=async e=>{let r=p(e??[],{boolean:["dry-run","yes"],alias:{n:"dry-run",y:"yes"}}),s=r._[0],o=r["dry-run"]===!0,l=r.yes===!0;if(s!==void 0&&!o&&!l&&["patch","minor","major","same"].includes(s)){let d=await c()??"0.0.0";if(t.info(n,`Current version: ${d}`),t.info(n,`Bump type: ${s}`),t.info(n,"This will bump version, generate changelog, commit, and push."),await A.flush(),!await O("Proceed?"))return t.warn(n,"Aborted."),i.ok(void 0);r.yes=!0}let u=f("release",r);return await F(u)},re=async e=>{let r=p(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=f("rerelease",r);return await W(s)},se=async e=>{let r=p(e??[],{boolean:["yes"],alias:{y:"yes"}}),s=f("unrelease",r);return await Y(s)};export{F as handleReleaseCli,W as handleRereleaseCli,Y as handleUnreleaseCli,ee as main,k as release,U as releaseHandler,M as rerelease,H as rereleaseHandler,re as rereleaseMain,T as unrelease,I as unreleaseHandler,se as unreleaseMain};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{c,d as f}from"./chunk-FVXGVHUR.js";import{a as R}from"./chunk-
|
|
2
|
+
import{c,d as f}from"./chunk-FVXGVHUR.js";import{a as R}from"./chunk-NCSKHFFW.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import{a as m}from"./chunk-LFNUSULJ.js";import{a as d,c as p}from"./chunk-PZUDTTK4.js";import{o as n}from"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as u}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import{a as g}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:i,output:N}=d(),P=async(e={})=>{let{root:r=".",remote:s="origin",tagPrefix:h="v",messageTemplate:y="Release {tag}",dryRun:l=!1}=e,t=await R({root:r});if(t===void 0||!/^\d+\.\d+\.\d+$/.test(t))throw new Error(`Invalid or missing version in VERSION file: "${t}"`);let o=`${h}${t}`,v=y.replace("{tag}",o).replace("{version}",t);return l||(await c(o,v),await f(s,o)),{version:t,tag:o,remote:s,dryRun:l}},T=e=>u.fromPromise(()=>P(e)),C=e=>a.ok({dryRun:e.flags["dry-run"]===!0}),x=e=>{if(a.isFail(e)){let s=e.error instanceof Error?e.error.message:String(e.error);return n.error(i,s),a.fail({exitCode:1})}let{value:r}=e;return r.dryRun?n.warn(i,`[DRY RUN] Would create and push tag ${r.tag}`):(n.success(i,`Created tag ${r.tag}`),n.info(i,`Pushed tag ${r.tag} to ${r.remote}`)),a.ok(void 0)},A=m.createTrigger({handler:T,adaptInput:C,adaptOutput:x}),S=async e=>{let r=g(e??[],{boolean:["dry-run"],alias:{n:"dry-run"}}),s=p("release-tag",r);return await A(s)};export{A as handleCli,S as main,P as pushReleaseTag,T as pushReleaseTagHandler};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{h as E}from"./chunk-L32KHQVT.js";import{q as y,s as C}from"./chunk-
|
|
2
|
+
import{h as E}from"./chunk-L32KHQVT.js";import{q as y,s as C}from"./chunk-E4WXXNF6.js";import{B as g,e as w,g as f,h,j as S}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f as m,h as d,k as u}from"./chunk-SHN5MT56.js";import{d as c,f as n,g as l}from"./chunk-YVN2NZL4.js";import{a as p,b as a}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var M=async v=>{let e=m({renderer:u.ansi(),sink:d.stdout()}),{root:r}=await g(),i=f(v);if(!i.ok)return e.writeln(n(i.error)),await e.close(),a({exitCode:1});let t;try{t=await w(r,i.spec)}catch(o){let x=o instanceof Error?o.message:String(o);return e.writeln(n(x)),await e.close(),a({exitCode:1})}if(t.phase!=="COMPLETED")return e.writeln(n(`Cannot reopen in phase: ${t.phase}`)),e.writeln(c("Only COMPLETED specs can be reopened.")),await e.close(),a({exitCode:1});let k=await E(r),s=y(t);return s=C(s,"COMPLETED","DISCOVERY",k,"reopened"),await h(r,s),s.spec!==null&&await S(r,s.spec,s),e.writeln(l("\u2714")," Spec reopened. Discovery answers preserved \u2014 run `noskills next` to revise."),await e.close(),p(void 0)};export{M as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{
|
|
2
|
+
import{D as v}from"./chunk-E4WXXNF6.js";import{B as I,c as h,e as g,g as y,h as S,j as k}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f as u,h as w,k as f}from"./chunk-SHN5MT56.js";import{d as a,f as n,g as d}from"./chunk-YVN2NZL4.js";import{a as c,b as l}from"./chunk-FFWPJP7A.js";import{i as m}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var F=async A=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),{root:i}=await I(),o=y(A);if(!o.ok)return e.writeln(n(o.error)),await e.close(),l({exitCode:1});let s;try{s=await g(i,o.spec)}catch(r){let R=r instanceof Error?r.message:String(r);return e.writeln(n(R)),await e.close(),l({exitCode:1})}if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),c(void 0);if(s.spec!==null){let r=`${i}/${h.specDir(s.spec)}`;try{await m.fs.stat(r)}catch{e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(a("Resetting to idle anyway."))}}let t=s.spec,p=v(s);return await S(i,p),t!==null&&await k(i,t,p),e.writeln(d("\u2714")," Reset to idle."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),c(void 0)};export{F as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as T}from"./chunk-
|
|
2
|
+
import{b as T}from"./chunk-4KDDHQVL.js";import"./chunk-PPB6ACBB.js";import{a as M}from"./chunk-YWSOQJ7G.js";import{h as P}from"./chunk-L32KHQVT.js";import{B as D}from"./chunk-E4WXXNF6.js";import{B as C,e as x,g as E,j as b,l as k,p as A}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{f as I,h as S,k as $}from"./chunk-SHN5MT56.js";import{c as q,d as c,f as d,g as p,h as v}from"./chunk-YVN2NZL4.js";import{a as w,b as g}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var J=async f=>{let t=I({renderer:$.ansi(),sink:S.stdout()}),{root:r}=await C(),i=E(f);if(!i.ok)return t.writeln(d(i.error)),await t.close(),g({exitCode:1});let u;try{u=await x(r,i.spec)}catch(e){let s=e instanceof Error?e.message:String(e);return t.writeln(d(s)),await t.close(),g({exitCode:1})}let o=await P(r),h=u.discovery.delegations??[],n=h.filter(e=>e.delegatedTo===o.name&&e.status==="pending"),l=h.filter(e=>e.delegatedTo===o.name&&e.status==="answered");if(n.length===0&&l.length===0)return t.writeln(c("No delegations for you on this spec.")),await t.close(),w(void 0);let N=await A(r),R=await k(r),W=N.filter(e=>R?.concerns.includes(e.id)??!1),F=T(W),y=new Map(F.map(e=>[e.id,e.text]));if(t.writeln(q(`Spec: ${i.spec}`)),t.writeln(""),n.length>0){t.writeln(v(`You have ${n.length} pending delegation(s):`)),t.writeln("");for(let e=0;e<n.length;e++){let s=n[e],Q=y.get(s.questionId)??s.questionId;t.writeln(` ${e+1}. `,d("[PENDING]"),` ${Q}`),t.writeln(c(` Delegated by: ${s.delegatedBy} (${s.delegatedAt.slice(0,10)})`))}}if(l.length>0){t.writeln(""),t.writeln(p(`${l.length} answered delegation(s):`));for(let e of l){let s=y.get(e.questionId)??e.questionId;t.writeln(" ",p("\u2714"),` ${s}`),t.writeln(c(` Answer: ${e.answer?.slice(0,80)??""}`))}}let m=null,a=null;for(let e of f??[])e.startsWith("--answer=")&&(m=e.slice(9)),e.startsWith("--question=")&&(a=parseInt(e.slice(11),10)-1);if(m!==null&&a!==null&&a>=0&&a<n.length){let e=n[a],s=D(u,e.questionId,m,o.name);await b(r,i.spec,s),await M(r,{ts:new Date().toISOString(),type:"delegation-answered",spec:i.spec,user:o.name,question:e.questionId}),t.writeln(""),t.writeln(p("\u2714"),` Answered: ${e.questionId}`)}return await t.close(),w(void 0)};export{J as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as A,f as C}from"./chunk-
|
|
2
|
+
import{a as A,f as C}from"./chunk-4JICYXYK.js";import{B as x,c as k,l as R}from"./chunk-LOZLXP5G.js";import{b as T,c as P}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as p,h as d,k as u}from"./chunk-SHN5MT56.js";import{c as y,d as a,f as j,g as v}from"./chunk-YVN2NZL4.js";import{a as h,b as w}from"./chunk-FFWPJP7A.js";import{i as $}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var B=async e=>{let s=e?.[0];if(s==="add")return await b(e?.slice(1));if(s==="list")return await W();if(s==="promote")return await U(e?.slice(1));let i=T(),t=p({renderer:u.ansi(),sink:d.stdout()});return t.writeln(`Usage: ${i} rule <add "rule text" | list | promote "decision">`),await t.close(),h(void 0)},b=async e=>{let s=p({renderer:u.ansi(),sink:d.stdout()}),{root:i}=await x(),t=[],r=[],n=[];if(e!==void 0)for(let o of e)o.startsWith("--phases=")?t=o.slice(9).split(",").map(g=>g.trim()):o.startsWith("--applies-to=")?r=o.slice(13).split(",").map(g=>g.trim().replace(/^["']|["']$/g,"")):o.startsWith("-")||n.push(o);let c=n.join(" "),m=await R(i);if(c.length===0)return s.writeln(j("Please provide a rule: "),y(`${P('rule add "Use Deno Tests for all tests"')}`)),await s.close(),w({exitCode:1});let D=c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),l="";(t.length>0||r.length>0)&&(l+=`---
|
|
3
3
|
`,t.length>0&&(l+=`phases: [${t.join(", ")}]
|
|
4
4
|
`),r.length>0&&(l+=`applies_to: [${r.map(o=>`"${o}"`).join(", ")}]
|
|
5
5
|
`),l+=`---
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as B}from"./chunk-
|
|
2
|
+
import{a as B}from"./chunk-P4SPHY3G.js";import"./chunk-4KDDHQVL.js";import"./chunk-PPB6ACBB.js";import{b as W,e as X}from"./chunk-4JICYXYK.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{a as j,m as _}from"./chunk-E4WXXNF6.js";import{A as L,B as M,d as g,e as F,f as N,h as $,l as U,p as G}from"./chunk-LOZLXP5G.js";import{b as E,c as V}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{a as T,b as D,g as A}from"./chunk-5GGWX7CO.js";import{f as I,h as R,k as O}from"./chunk-SHN5MT56.js";import{c as y,d as o,f as l,g as v,h,k as P}from"./chunk-YVN2NZL4.js";import{a as S,b as w}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var pe=async t=>{let e=I({renderer:O.ansi(),sink:R.stdout()}),{root:i}=await M(),n=t?.includes("--unattended")??!1,r=z(t,"--max-turns")??10,p=z(t,"--max-iterations")??50;if(!await L(i))return e.writeln(l(`noskills not initialized. Run: ${V("init")}`)),await e.close(),w({exitCode:1});let x=N(t),c=await F(i,x);if(c.phase!=="EXECUTING"&&c.phase!=="SPEC_APPROVED")return e.writeln(l(`Cannot run from phase: ${c.phase}`)),e.writeln(o("Must be in SPEC_APPROVED or EXECUTING to start.")),await e.close(),w({exitCode:1});if(c.phase==="SPEC_APPROVED"){e.writeln(o("Starting execution from approved spec..."));let s=_(c);await $(i,s)}let u=await U(i);if(u===null)return e.writeln(l("Config not found.")),await e.close(),w({exitCode:1});e.writeln(y(`${E()} run`)),e.writeln(o(`Mode: ${n?"unattended":"interactive"}, max-turns: ${r}, max-iterations: ${p}`)),e.writeln("");let m=0,d=0;for(;m<p;){m++;let s=await g(i);if(s.phase==="COMPLETED"){e.writeln(""),e.writeln(v("\u2714")," Spec completed!"),e.writeln(` Iterations: ${s.execution.iteration}`),e.writeln(` Decisions: ${s.decisions.length}`);break}if(s.phase==="BLOCKED"){let a=s.execution.lastProgress??"Unknown";if(e.writeln(""),e.writeln(h("\u26A0")," Execution blocked: ",o(a)),n){await Z(i,a,m),e.writeln(o("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let C=D(),f=await A(C,{message:"Enter resolution (or leave empty to stop):"});if(T(f)||f===""){e.writeln(o("Stopped by user."));break}let k=j(s,"EXECUTING");await $(i,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(s.phase!=="EXECUTING"){e.writeln(l(`Unexpected phase: ${s.phase}. Stopping.`)),d=1;break}let H=(await G(i)).filter(a=>u.concerns.includes(a.id)),q=await W(i),K=X(u.tools),J=await B(s,H,q,u,void 0,void 0,void 0,K),Q=Y(J);e.writeln(P(`\u2500\u2500 Iteration ${m}`),o(` (execution: ${s.execution.iteration}, debt: ${s.execution.debt?.items.length??0})`)),s.execution.lastProgress!==null&&e.writeln(o(` Last: ${s.execution.lastProgress}`)),s.execution.lastVerification?.passed===!1&&e.writeln(l(" Verification failed \u2014 agent will fix")),s.execution.debt!==null&&e.writeln(h(` Debt: ${s.execution.debt.items.length} items`)),e.writeln(o(" Spawning agent..."));try{await(await import("./mod-D5IDWU35.js")).exec`claude -p ${Q} --max-turns ${String(r)} --output-format json`.noThrow().text()}catch{e.writeln(l(" Failed to spawn claude CLI. Is it installed?")),d=1;break}e.writeln(o(" Agent exited. Stop hook captured state."));let b=await g(i);if(u.autoCommit===!0&&u.allowGit!==!1)try{let a=await import("./mod-D5IDWU35.js");if((await a.exec`git diff --name-only`.noThrow().text()).trim().length>0){await a.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await a.exec`git commit -m ${f}`.noThrow().text(),e.writeln(o(" Auto-committed."))}}catch{e.writeln(o(" Auto-commit failed (non-fatal)."))}}return m>=p&&(e.writeln(""),e.writeln(h("\u26A0"),` Max iterations (${p}) reached. Stopping.`),d=2),await e.close(),d!==0?w({exitCode:d}):S(void 0)},Y=t=>{let e=[];if(e.push(t.meta.resumeHint),e.push(""),t.meta.spec!==null&&(e.push(`Working on spec: ${t.meta.spec}`),e.push("")),"instruction"in t&&(e.push(t.instruction),e.push("")),"previousIterationDebt"in t){let n=t.previousIterationDebt;if(n!==void 0){e.push(`DEBT from iteration ${n.fromIteration} (address first):`);for(let r of n.items)e.push(`- ${r}`);e.push("")}}if("statusReportRequired"in t){let n=t.statusReport;if(n!==void 0){e.push("Report against these acceptance criteria:");for(let r of n.criteria)e.push(`- ${r}`);e.push("")}}if("verificationFailed"in t&&t.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in t?t.verificationOutput:"")??""),e.push("")),t.behavioral.rules.length>0){e.push("Rules:");for(let n of t.behavioral.rules)e.push(`- ${n}`);e.push("")}if("context"in t){let n=t.context;if(n.concernReminders.length>0){e.push("Reminders:");for(let r of n.concernReminders)e.push(`- ${r}`);e.push("")}}let i=E();return e.push(`When done, report progress: ${i} next --answer="your progress"`),e.push(`If blocked, run: ${i} block "reason"`),e.push(`When all tasks are complete: ${i} done`),e.join(`
|
|
3
3
|
`)},z=(t,e)=>{if(t===void 0)return null;let i=`${e}=`;for(let n of t)if(n.startsWith(i)){let r=parseInt(n.slice(i.length),10);if(!isNaN(r)&&r>0)return r}return null},Z=async(t,e,i)=>{let n=`${t}/.eser/.state/blocked.log`,r=`[${new Date().toISOString()}] iteration=${i} reason=${e}
|
|
4
4
|
`;try{let{appendFileSync:p,mkdirSync:x}=await import("node:fs"),{dirname:c}=await import("node:path");x(c(n),{recursive:!0}),p(n,r)}catch{}};export{pe as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{A as x,B as h,e as b,k as O,s as P,u as y,v as A,x as C,y as N,z as $}from"./chunk-
|
|
2
|
+
import{A as x,B as h,e as b,k as O,s as P,u as y,v as A,x as C,y as N,z as $}from"./chunk-LOZLXP5G.js";import{b as I,c as R}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as f,k as w}from"./chunk-SHN5MT56.js";import{c as a,d as i,f as d,g as v}from"./chunk-YVN2NZL4.js";import{a as u,b as g}from"./chunk-FFWPJP7A.js";import{i as E}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var G=async t=>{let s=t?.[0];if(s==="start")return await D(t?.slice(1));if(s==="end")return await M(t?.slice(1));if(s==="list")return await j();if(s==="gc")return await _();let n=I(),e=m({renderer:w.ansi(),sink:f.stdout()});return e.writeln(`Usage: ${n} session <start | end | list | gc>`),e.writeln(""),e.writeln(i(" start --spec=<name> Bind to a spec")),e.writeln(i(" start --free Idle mode (no spec, no enforcement)")),e.writeln(i(" start --auto Auto-detect spec or idle")),e.writeln(i(" end [--id=<id>] End current/specific session")),e.writeln(i(" list Show active sessions")),e.writeln(i(" gc Remove stale sessions")),await e.close(),u(void 0)},D=async t=>{let s=m({renderer:w.ansi(),sink:f.stdout()}),{root:n}=await h();if(!await x(n))return s.writeln(d("noskills is not initialized.")," Run: ",a(R("init"))),await s.close(),g({exitCode:1});let e=null,o=!1,c=!1;for(let r of t??[])r.startsWith("--spec=")?e=r.slice(7):r==="--free"?o=!0:r==="--auto"&&(c=!0);if(c){let p=(await O(n)).filter(L=>L.state.phase!=="COMPLETED"&&L.state.phase!=="IDLE");p.length===1?e=p[0].name:o=!0}if(e===null&&!o)return s.writeln(d("Specify --spec=<name>, --free, or --auto.")),s.writeln(i(`Example: ${I()} session start --spec=my-feature`)),await s.close(),g({exitCode:1});let l=null;if(e!==null)try{l=(await b(n,e)).phase}catch(r){let p=r instanceof Error?r.message:String(r);return s.writeln(d(`Error: ${p}`)),await s.close(),g({exitCode:1})}let S=$(),k={id:S,spec:e,mode:o?"free":"spec",phase:o?null:l,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code",projectRoot:n};return await P(n,k),s.writeln(v("Session started.")),s.writeln(" ID: ",a(S)),s.writeln(" Mode: ",a(o?"free":"spec")),e!==null&&(s.writeln(" Spec: ",a(e)),l!==null&&s.writeln(" Phase: ",i(l))),s.writeln(""),s.writeln("Run:"),s.writeln(a(` export NOSKILLS_SESSION=${S}`)),s.writeln(a(` export NOSKILLS_PROJECT_ROOT=${n}`)),await s.close(),u(void 0)},M=async t=>{let s=m({renderer:w.ansi(),sink:f.stdout()}),{root:n}=await h(),e=null;for(let c of t??[])c.startsWith("--id=")&&(e=c.slice(5));return e===null&&(e=E.env.get("NOSKILLS_SESSION")??null),e===null?(s.writeln(d("No session specified. Use --id=<id> or set NOSKILLS_SESSION env var.")),await s.close(),g({exitCode:1})):(await A(n,e)?s.writeln(v("Session ended: "),i(e)):s.writeln(d(`Session not found: ${e}`)),await s.close(),u(void 0))},j=async()=>{let t=m({renderer:w.ansi(),sink:f.stdout()}),{root:s}=await h(),n=await y(s);if(t.writeln(a("Sessions")),t.writeln(""),n.length===0)t.writeln(i(` No active sessions. Start one with: ${R("session start --spec=<name>")}`));else for(let e of n){let o=N(e),c=Date.now()-new Date(e.lastActiveAt).getTime(),l=Math.floor(c/6e4),S=l<60?`${l}min ago`:`${Math.floor(l/60)}h ago`,k=e.mode==="free"?"free":`spec:${e.spec??"?"}`,r=e.phase??"\u2014",p=o?d(" (stale)"):"";t.writeln(" ",a(e.id)," ",i(k.padEnd(25))," ",i(r.padEnd(18))," ",i(S),p)}return await t.close(),u(void 0)},_=async()=>{let t=m({renderer:w.ansi(),sink:f.stdout()}),{root:s}=await h(),n=await C(s);if(n.length===0)t.writeln(i("No stale sessions to remove."));else{t.writeln(v(`Removed ${n.length} stale session(s):`));for(let e of n)t.writeln(" ",i(e))}return await t.close(),u(void 0)};export{G as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as G}from"./chunk-NY4W44PI.js";import{a as X,d as B}from"./chunk-2ZYCRMUT.js";import{a as Z}from"./chunk-YWSOQJ7G.js";import{g as j,h as U}from"./chunk-L32KHQVT.js";import{b as M,g as W,h as L,p as V,r as H,s as J,t as Q,u as _}from"./chunk-E4WXXNF6.js";import{A as N,B as R,a as T,c as b,e as E,f as F,j as C,k as K}from"./chunk-LOZLXP5G.js";import{b as g,c as I}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as $,h as v,k as y}from"./chunk-SHN5MT56.js";import{c as m,d as c,f as p,g as x,h as O,k as Y}from"./chunk-YVN2NZL4.js";import{a as w,b as d}from"./chunk-FFWPJP7A.js";import{i as D}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var ee=new Set(["new","list","help","next","approve","done","block","reset","cancel","wontfix","reopen","revisit","split","ac","task","note","review","delegate","followup"]),te=new Set(["a","an","the","and","or","but","in","on","at","to","for","of","with","by","from","is","it","its","this","that","as","be","are","was","were","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","i","we","you","they","our","my","so","if","not","no","all"]),se=n=>n.replace(/(?:~|\.{1,2})?\/(?:[\w@.-]+\/)*[\w@.-]+/g," ").replace(/(?:[\w@.-]+\/){2,}[\w@.-]+/g," ").replace(/\s+/g," ").trim(),ne=n=>{let a=se(n).toLowerCase().replace(/[^a-z0-9\s-]/g,"").split(/\s+/).filter(o=>o.length>0&&!te.has(o)).slice(0,6).join("-");return a.length>50&&(a=a.slice(0,50).replace(/-[^-]*$/,"")),a=a.replace(/^-+|-+$/g,""),a||"spec"},ie=n=>n.includes(" ")||n.length>50,re=new Map([["next",()=>import("./next-S6SRRGZ4.js")],["approve",()=>import("./approve-CSNHLN74.js")],["done",()=>import("./done-MQGWNNZO.js")],["block",()=>import("./block-RYXM4VQQ.js")],["reset",()=>import("./reset-ELKH7QV3.js")],["cancel",()=>import("./cancel-KVUNVJJ2.js")],["wontfix",()=>import("./wontfix-LL6NHECR.js")],["reopen",()=>import("./reopen-SJU63UEG.js")],["review",()=>import("./review-GYD3HGFK.js")],["delegate",()=>import("./delegate-JVA57PQG.js")],["followup",()=>import("./followup-H2CVZVOP.js")],["learn",()=>import("./learn-6MIAYVOR.js")]]);var De=async n=>{let e=n?.[0];if(e==="new")return await ae(n?.slice(1));if(e==="list")return await oe(n?.slice(1));if(e==="help"||e===void 0){let l=g(),r=$({renderer:y.ansi(),sink:v.stdout()});return r.writeln(`Usage: ${l} spec <new "description" | list | <name> <command>>`),r.writeln(""),r.writeln(c(" Commands for a spec:")),r.writeln(c(" next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split, ac, task, note")),r.writeln(""),r.writeln(c(" Examples:")),r.writeln(c(` ${l} spec new "Add photo upload support" # name auto-generated`)),r.writeln(c(` ${l} spec new my-feature "Add upload support" # explicit name`)),r.writeln(c(` ${l} spec my-feature next`)),r.writeln(c(` ${l} spec my-feature next --answer="approve"`)),await r.close(),w(void 0)}let t=e,s=n?.[1];if(s===void 0)return await(await import("./status-MZRTOMES.js")).main([`--spec=${t}`]);if(s==="split")return await ce([`--spec=${t}`,...n?.slice(2)??[]]);if(s==="revisit")return await pe([`--spec=${t}`,...n?.slice(2)??[]]);if(s==="ac")return await de(t,n?.slice(2));if(s==="task")return await ue(t,n?.slice(2));if(s==="note")return await we(t,n?.slice(2));let a=re.get(s);if(a!==void 0)return await(await a()).main([`--spec=${t}`,...n?.slice(2)??[]]);let o=$({renderer:y.ansi(),sink:v.stdout()});return o.writeln(p(`Unknown command: spec ${t} ${s}`)),o.writeln(c(" Valid: next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split, ac, task, note")),await o.close(),d({exitCode:1})},ae=async n=>{let e=$({renderer:y.ansi(),sink:v.stdout()}),{root:t}=await R();if(!await N(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=null,a=[];if(n!==void 0){let h=!1,S=[];for(let k of n)k.startsWith("--name=")?(s=k.slice(7),h=!0):k.startsWith("-")||S.push(k);if(h)a.push(...S);else if(S.length>=1){let k=S[0];ie(k)?a.push(...S):(s=k,a.push(...S.slice(1)))}}let o=null;if(n!==void 0)for(let h of n)h.startsWith("--from-plan=")&&(o=h.slice(12));let l=a.join(" ");if((s===null||s.length===0)&&l.length>0){s=ne(l);let h=s,S=2;for(;;){if(ee.has(h)){h=`${s}-${S}`,S++;continue}let k=`${t}/${b.specDir(h)}`;try{await D.fs.stat(k),h=`${s}-${S}`,S++}catch{break}}s=h}if(s===null||s.length===0)return e.writeln(p("Error: description is required.")),e.writeln(c("Example: "),m(`${g()} spec new "Add photo upload support"`)),await e.close(),d({exitCode:1});if(ee.has(s))return e.writeln(p(`"${s}" is a reserved name.`),c(" Choose a different spec name.")),await e.close(),d({exitCode:1});let r=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/;if(s.length>50||s.length>1&&!r.test(s)||s.length===1&&!/^[a-z0-9]$/.test(s))return e.writeln(p("Invalid spec name: "),m(s)),e.writeln(c("Must be lowercase, hyphens, numbers only. Max 50 chars. Regex: /^[a-z0-9][a-z0-9-]*[a-z0-9]$/")),await e.close(),d({exitCode:1});if(l.length===0)return e.writeln(p("Please provide a description: "),m(`${g()} spec new "Add photo upload support"`)),await e.close(),d({exitCode:1});if(o!==null)try{if((await D.fs.stat(o)).size>50*1024)return e.writeln(p("Plan file too large. Maximum 50KB.")),await e.close(),d({exitCode:1})}catch{return e.writeln(p(`Plan file not found: ${o}`)),await e.close(),d({exitCode:1})}let i=`spec/${s}`,u=`${t}/${b.specDir(s)}`;try{return await D.fs.stat(u),e.writeln(p(`Spec "${s}" already exists.`),c(` Use a different --name or run \`${g()} reset --spec=${s}\` first.`)),await e.close(),d({exitCode:1})}catch{}let A=T(),f=M(A,s,i,l),P=await U(t),z=J(f,"IDLE","DISCOVERY",P);return o!==null&&(z={...f,discovery:{...f.discovery,planPath:o}}),await D.fs.mkdir(`${t}/${b.specDir(s)}`,{recursive:!0}),await C(t,s,z),await Z(t,{ts:new Date().toISOString(),type:"spec-created",spec:s,user:P?.name??"unknown",description:l??""}),e.writeln(x("\u2714")," Spec started: ",m(s)),e.writeln(" Directory: ",c(b.specDir(s))),e.writeln(" Branch: ",c(i)),e.writeln(" Phase: ",O("DISCOVERY")),o!==null&&e.writeln(" Plan: ",c(o)),e.writeln(""),e.writeln("Run ",m(I(`next --spec=${s}`))," to begin discovery questions."),await e.close(),w(void 0)},oe=async n=>{let{root:e}=await R(),t=X(n),s=await K(e),a=`${e}/${b.specsDir}`,o=new Set(s.map(i=>i.name)),l=[];for(let i of s)l.push({name:i.name,phase:i.state.phase,iteration:i.state.execution.iteration});try{for await(let i of D.fs.readDir(a))i.isDirectory&&!o.has(i.name)&&l.push({name:i.name,phase:"IDLE",iteration:0})}catch{}if(t==="json")return await B(l,"json"),w(void 0);let r=$({renderer:y.ansi(),sink:v.stdout()});if(r.writeln(m("Specs")),r.writeln(""),l.length===0)r.writeln(c(" No specs yet."));else for(let i of l){let u=i.phase==="COMPLETED"?x(i.phase):i.phase==="EXECUTING"?Y(i.phase):i.phase==="BLOCKED"?p(i.phase):O(i.phase),A=i.phase==="EXECUTING"?c(` iteration ${i.iteration}`):"";r.writeln(" ",c("\u25CB")," ",i.name," ",u,A)}return await r.close(),w(void 0)},le=n=>{let e=[],t=0;for(;t<n.length;)if(n[t]==="--into"&&t+1<n.length){let s=n[t+1],a=s;t+2<n.length&&!n[t+2].startsWith("-")?(a=n[t+2],t+=3):t+=2,e.push({name:s,description:a})}else t+=1;return e},ce=async n=>{let e=$({renderer:y.ansi(),sink:v.stdout()}),{root:t}=await R();if(!await N(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=F(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${g()} spec split --spec=parent --into name1 "desc1" --into name2 "desc2"`)),await e.close(),d({exitCode:1});let a;try{a=await E(t,s)}catch(i){let u=i instanceof Error?i.message:String(i);return e.writeln(p(`Error: ${u}`)),await e.close(),d({exitCode:1})}if(a.phase!=="DISCOVERY"&&a.phase!=="DISCOVERY_REFINEMENT")return e.writeln(p(`Cannot split spec in phase ${a.phase}. Must be in DISCOVERY or DISCOVERY_REFINEMENT.`)),await e.close(),d({exitCode:1});let o=le(n??[]);if(o.length<2){let i=G(a.discovery.answers);if(!i.detected||i.proposals.length<2)return e.writeln(p("Error: at least 2 --into entries required, or discovery answers must contain 2+ independent areas.")),await e.close(),d({exitCode:1});let u=[];for(let f of i.proposals){let P=`${t}/${b.specDir(f.name)}`;await D.fs.mkdir(P,{recursive:!0});let q=a.discovery.answers.filter(S=>f.relevantAnswers.includes(S.questionId)),h=M(T(),f.name,`spec/${f.name}`);for(let S of q)h=W(h,S.questionId,S.answer);h=L(h),await C(t,f.name,h),u.push(f.name)}let A=V(a,"cancelled",`Split into: ${u.join(", ")}`);await C(t,s,A),e.writeln(x("Split complete."),` Created ${u.length} sub-specs:`);for(let f of u)e.writeln(" ",c("\u25CB")," ",m(f));return e.writeln("",c(`Parent spec "${s}" cancelled.`)),await e.close(),w(void 0)}let l=[];for(let i of o){let u=`${t}/${b.specDir(i.name)}`;await D.fs.mkdir(u,{recursive:!0});let f=M(T(),i.name,`spec/${i.name}`);for(let P of a.discovery.answers)f=W(f,P.questionId,P.answer);f=L(f),await C(t,i.name,f),l.push(i.name)}let r=V(a,"cancelled",`Split into: ${l.join(", ")}`);await C(t,s,r),e.writeln(x("Split complete."),` Created ${l.length} sub-specs:`);for(let i of l)e.writeln(" ",c("\u25CB")," ",m(i));return e.writeln("",c(`Parent spec "${s}" cancelled.`)),await e.close(),w(void 0)},pe=async n=>{let e=$({renderer:y.ansi(),sink:v.stdout()}),{root:t}=await R();if(!await N(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=F(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${g()} spec revisit --spec=my-spec "reason for revisit"`)),await e.close(),d({exitCode:1});let a=(n??[]).find(i=>!i.startsWith("--")&&i!==s);if(a===void 0||a.trim().length===0)return e.writeln(p('Error: Reason is required: noskills spec revisit --spec=X "reason"')),await e.close(),d({exitCode:1});let o;try{o=await E(t,s)}catch(i){let u=i instanceof Error?i.message:String(i);return e.writeln(p(`Error: ${u}`)),await e.close(),d({exitCode:1})}if(o.phase==="DISCOVERY"||o.phase==="DISCOVERY_REFINEMENT"||o.phase==="SPEC_PROPOSAL"||o.phase==="SPEC_APPROVED")return e.writeln(p("Already in planning phase, no need to revisit.")),await e.close(),d({exitCode:1});if(o.phase==="COMPLETED")return e.writeln(p(`Spec is completed. Use \`${g()} reopen --spec=${s}\` instead.`)),await e.close(),d({exitCode:1});if(o.phase==="IDLE")return e.writeln(p("No active spec to revisit.")),await e.close(),d({exitCode:1});let l=o.execution.completedTasks.length,r=H(o,a.trim());return await C(t,s,r),e.writeln(x("Revisit complete.")),e.writeln(" Phase: ",m("DISCOVERY"),c(` (revisited from ${o.phase})`)),l>0&&e.writeln(" Previous progress: ",m(`${l} tasks completed`)),e.writeln(" Reason: ",c(`"${a.trim()}"`)),e.writeln(" Discovery answers preserved \u2014 revise or re-approve."),await e.close(),w(void 0)},de=async(n,e)=>{let t=$({renderer:y.ansi(),sink:v.stdout()}),{root:s}=await R(),a=e?.[0];if(n===void 0||a===void 0)return t.writeln(`Usage: ${g()} spec <name> ac <add "text" | list>`),await t.close(),w(void 0);if(a==="add"){let o=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(o.length===0)return t.writeln(p("Please provide AC text.")),await t.close(),d({exitCode:1});let l=await E(s,n),r=await U(s);l.phase==="EXECUTING"&&t.writeln(O("Warning: Adding ACs during execution is scope creep."));let i=Q(l,o,r);return await C(s,n,i),t.writeln(x("AC added: "),`"${o}"`,c(` (by ${j(r)})`)),await t.close(),w(void 0)}if(a==="list"){let l=(await E(s,n)).customACs??[];if(t.writeln(m(`Custom ACs for ${n}`)),t.writeln(""),l.length===0)t.writeln(c(" No custom ACs."));else for(let r of l)t.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.addedInPhase}`));return await t.close(),w(void 0)}return t.writeln(`Usage: ${g()} spec <name> ac <add "text" | list>`),await t.close(),w(void 0)},ue=async(n,e)=>{let t=$({renderer:y.ansi(),sink:v.stdout()}),{root:s}=await R(),a=e?.[0];if(n===void 0||a===void 0)return t.writeln(`Usage: ${g()} spec <name> task <add "text" | list>`),await t.close(),w(void 0);if(a==="add"){let o=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(o.length===0)return t.writeln(p("Please provide task text.")),await t.close(),d({exitCode:1});let l=await E(s,n);if(l.phase==="EXECUTING"||l.phase==="BLOCKED")return t.writeln(p("Cannot add tasks during execution. Use `spec revisit` to go back to discovery.")),await t.close(),d({exitCode:1});let r=await U(s),i=_(l,`[TASK] ${o}`,r);return await C(s,n,i),t.writeln(x("Task added: "),`"${o}"`,c(` (by ${j(r)})`)),await t.close(),w(void 0)}if(a==="list"){let l=((await E(s,n)).specNotes??[]).filter(r=>r.text.startsWith("[TASK] "));if(t.writeln(m(`Custom tasks for ${n}`)),t.writeln(""),l.length===0)t.writeln(c(" No custom tasks."));else for(let r of l)t.writeln(` - ${r.text.replace("[TASK] ","")}`,c(` -- ${r.user}, ${r.phase}`));return await t.close(),w(void 0)}return t.writeln(`Usage: ${g()} spec <name> task <add "text" | list>`),await t.close(),w(void 0)},we=async(n,e)=>{let t=$({renderer:y.ansi(),sink:v.stdout()}),{root:s}=await R(),a=e?.[0];if(n===void 0||a===void 0)return t.writeln(`Usage: ${g()} spec <name> note <add "text" | list>`),await t.close(),w(void 0);if(a==="add"){let o=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(o.length===0)return t.writeln(p("Please provide note text.")),await t.close(),d({exitCode:1});let l=await E(s,n),r=await U(s),i=_(l,o,r);return await C(s,n,i),t.writeln(x("Note added: "),`"${o}"`,c(` (by ${j(r)})`)),await t.close(),w(void 0)}if(a==="list"){let l=((await E(s,n)).specNotes??[]).filter(r=>!r.text.startsWith("[TASK] "));if(t.writeln(m(`Notes for ${n}`)),t.writeln(""),l.length===0)t.writeln(c(" No notes."));else for(let r of l)t.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.phase}`));return await t.close(),w(void 0)}return t.writeln(`Usage: ${g()} spec <name> note <add "text" | list>`),await t.close(),w(void 0)};export{ee as RESERVED_NAMES,ie as looksLikeDescription,De as main,ne as slugFromDescription};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as R}from"./chunk-P4SPHY3G.js";import{a as f}from"./chunk-4KDDHQVL.js";import"./chunk-PPB6ACBB.js";import{b as O,e as S}from"./chunk-4JICYXYK.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{a as k,d as w}from"./chunk-2ZYCRMUT.js";import{A as v,B as P,e as I,f as b,l as x,p as D}from"./chunk-LOZLXP5G.js";import{c as h}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as d,h as u,k as m}from"./chunk-SHN5MT56.js";import{c as i,d as r,f as c,g as C,h as p,k as y}from"./chunk-YVN2NZL4.js";import{a as l,b as E}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var K=async g=>{let{root:n}=await P(),o=k(g);if(!await v(n)){if(o==="json")await w({error:"noskills is not initialized"},o);else{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(c("noskills is not initialized.")," Run: ",i(h("init"))),await s.close()}return E({exitCode:1})}let N=b(g),e=await I(n,N),t=await x(n),T={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REFINEMENT"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length};if(o==="json"){let a=(await D(n)).filter(V=>t!==null&&t.concerns.includes(V.id)),F=await O(n),j=S(t?.tools??[]),$=await R(e,a,F,t,void 0,void 0,void 0,j);return await w({...T,...$},"json"),l(void 0)}{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(i(`${h("status")}`)),s.writeln("");let a=e.phase==="COMPLETED"?C(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?y(e.phase):p(e.phase);s.writeln(" Phase: ",a),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),(e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REFINEMENT")&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(p(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),await s.close()}return l(void 0)};export{K as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{f as i,h as r,k as n}from"./chunk-SHN5MT56.js";import{d as t}from"./chunk-YVN2NZL4.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var l=async e=>{let s=i({renderer:n.ansi(),sink:r.stdout()});return s.writeln(t("`sync` has been merged into `init`. Running `noskills init`...")),s.writeln(""),await s.close(),await(await import("./init-
|
|
2
|
+
import{f as i,h as r,k as n}from"./chunk-SHN5MT56.js";import{d as t}from"./chunk-YVN2NZL4.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var l=async e=>{let s=i({renderer:n.ansi(),sink:r.stdout()});return s.writeln(t("`sync` has been merged into `init`. Running `noskills init`...")),s.writeln(""),await s.close(),await(await import("./init-4Q4HAHND.js")).main(e)};export{l as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as e,b as s,c as o,d as l,e as r,f as a,g as t}from"./chunk-
|
|
2
|
+
import{a as e,b as s,c as o,d as l,e as r,f as a,g as t}from"./chunk-YTLTR452.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-IHHITZU2.js";import"./chunk-PWLF3WXM.js";import{b as n}from"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var d=new n("system").description("Commands related with this CLI").command(new n("install").description("Install eser CLI globally").run(e)).command(new n("uninstall").description("Uninstall eser CLI globally").run(s)).command(new n("update").description("Update eser CLI to the latest version").run(o)).command(new n("completions").description("Generate shell completion scripts").flag({name:"shell",type:"string",description:"Shell type: bash, zsh, or fish"}).run(l)).command(new n("version").description("Show version and check for updates").flag({name:"bare",type:"boolean",description:"Print version number only"}).run(r)).command(new n("doctor").description("Run diagnostic checks").run(a)).command(new n("info").description("Show runtime and execution context diagnostics").run(t));export{d as systemCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-NCSKHFFW.js";import"./chunk-HTC2FO4I.js";import"./chunk-GTHXGAMQ.js";import"./chunk-3XJLLDR5.js";import"./chunk-P7WCO724.js";import"./chunk-2XNFZXHY.js";import"./chunk-LFNUSULJ.js";import"./chunk-PZUDTTK4.js";import"./chunk-5GGWX7CO.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import"./chunk-MG65QJY6.js";import"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{e as handleCli,f as main,a as readVersionFile,b as showVersions,c as versions,d as versionsHandler};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as L,c as
|
|
3
|
-
`).filter(Boolean),s=[];for(let c of l)try{let u=JSON.parse(c);s.includes(u.file)||s.push(u.file)}catch{}return s}catch{return[]}},
|
|
4
|
-
`)},V=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,verificationPassed:e.verificationPassed}),z=async e=>{let{root:t}=await
|
|
5
|
-
`)),n.releaseLock(),
|
|
2
|
+
import{a as L,c as O}from"./chunk-2ZYCRMUT.js";import{a as I,c as F}from"./chunk-ODBJ5KMQ.js";import{A as v,B as D,d as C,k as x,l as P}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{a as y,b as S}from"./chunk-FFWPJP7A.js";import{i as g}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var A=async e=>{let t=await C(e),d=await P(e),l=await N(e),s=null,c=null,u=0,a=0;if(t.spec!==null){let n=await I(e,t.spec);if(n!==null){u=n.tasks.length,a=t.execution.completedTasks.length;let f=F(n.tasks,t.execution.completedTasks);f!==null&&(s=f.id,c=f.title)}}let p=null;t.lastCalledAt!==null&&(p=Math.floor((Date.now()-new Date(t.lastCalledAt).getTime())/1e3));let r=(await x(e)).map(n=>({name:n.name,phase:n.state.phase,iteration:n.state.execution.iteration}));return{spec:t.spec,phase:t.phase,iteration:t.execution.iteration,activeTaskId:s,activeTaskTitle:c,totalTasks:u,completedTaskCount:a,lastProgress:t.execution.lastProgress,lastCalledAt:t.lastCalledAt,modifiedFiles:t.execution.modifiedFiles,debt:t.execution.debt,concerns:d?.concerns??[],maxIterations:d?.maxIterationsBeforeRestart??15,awaitingStatusReport:t.execution.awaitingStatusReport,verificationPassed:t.execution.lastVerification?.passed??null,decisionsCount:t.decisions.length,discoveryAnswered:t.discovery.answers.length,discoveryTotal:6,trackedFiles:l,timeSinceUpdate:p,allSpecs:r}},N=async e=>{let t=`${e}/.eser/.state/files-changed.jsonl`;try{let l=(await g.fs.readTextFile(t)).trim().split(`
|
|
3
|
+
`).filter(Boolean),s=[];for(let c of l)try{let u=JSON.parse(c);s.includes(u.file)||s.push(u.file)}catch{}return s}catch{return[]}},W="\x1B[2J\x1B[H",E="\x1B[1m",m="\x1B[2m",o="\x1B[0m",k="\x1B[32m",T="\x1B[33m",w="\x1B[31m",M="\x1B[36m",b=e=>{switch(e){case"COMPLETED":return k;case"BLOCKED":return w;case"EXECUTING":return M;default:return T}},R=(e,t,d)=>{if(t===0)return"\u2591".repeat(d);let l=Math.min(e/t,1),s=Math.round(l*d);return"\u2588".repeat(s)+"\u2591".repeat(d-s)},B=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,U=e=>e.replace(/\x1b\[[0-9;]*m/g,""),j=(e,t)=>{let d=U(e).length;return e+" ".repeat(Math.max(0,t-d))},K=e=>{let t=[],l="\u2500".repeat(54),s=a=>`${m}\u2502${o} ${j(a,52)}${m}\u2502${o}`,c=()=>`${m}\u2502${"".padEnd(54)}\u2502${o}`;if(t.push(`${m}\u256D${l}\u256E${o}`),t.push(s(`${E}noskills watch${o}`)),t.push(c()),t.push(s(`${E}Specs:${o}`)),e.allSpecs.length>0)for(let a of e.allSpecs){let p=b(a.phase),i=a.name.slice(0,18).padEnd(18),r=`${p}${a.phase}${o}`.padEnd(a.phase.length+10);if(a.phase==="EXECUTING"||a.phase==="BLOCKED"){let n=R(e.completedTaskCount,e.totalTasks,10),f=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;t.push(s(` ${i} ${r} ${n} ${e.completedTaskCount}/${e.totalTasks} (${f}%)`))}else a.phase==="COMPLETED"?t.push(s(` ${i} ${r} done`)):t.push(s(` ${i} ${r}`))}else if(e.spec!==null){let a=b(e.phase);t.push(s(` ${e.spec} ${a}${e.phase}${o}`))}else t.push(s(` ${m}No specs yet${o}`));if(t.push(c()),e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REFINEMENT")t.push(s(`Phase: ${b(e.phase)}${e.phase}${o} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered`));else if(e.phase==="SPEC_PROPOSAL")t.push(s(`Phase: ${T}${e.phase}${o} ${T}Awaiting approval${o}`));else if(e.phase==="SPEC_APPROVED")t.push(s(`Phase: ${T}${e.phase}${o} ${k}Ready to start${o}`));else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){if(e.spec!==null&&t.push(s(`${E}${e.spec}${o} (iteration ${e.iteration}):`)),e.activeTaskId!==null){let i=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`;t.push(s(` Active task: ${M}${i.slice(0,36)}${o}`))}let a=R(e.completedTaskCount,e.totalTasks,12),p=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;if(t.push(s(` Progress: ${k}${a} ${e.completedTaskCount}/${e.totalTasks} tasks (${p}%)${o}`)),t.push(s(` Iteration: ${e.iteration}`)),t.push(s(` Last update: ${B(e.timeSinceUpdate)}`)),e.lastProgress!==null&&t.push(s(` ${m}${e.lastProgress.slice(0,50)}${o}`)),e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");t.push(s(` ${w}BLOCKED: ${i.slice(0,40)}${o}`)),t.push(s(` ${T}Human input needed${o}`))}if(e.awaitingStatusReport&&t.push(s(` ${T}Status report pending${o}`)),e.verificationPassed===!1&&t.push(s(` ${w}Verification failed${o}`)),t.push(c()),e.debt!==null&&e.debt.items.length>0){t.push(s(` Debt: ${e.debt.items.length} item(s)`));for(let i of e.debt.items.slice(0,3))t.push(s(` \u2514\u2500 ${i.text.slice(0,44)}`));e.debt.items.length>3&&t.push(s(` \u2514\u2500 ... and ${e.debt.items.length-3} more`))}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let i=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;t.push(s(` Files changed: ${i.length}`));for(let r of i.slice(0,5)){let n=r.length>44?"..."+r.slice(-41):r;t.push(s(` \u2514\u2500 ${n}`))}i.length>5&&t.push(s(` \u2514\u2500 ... and ${i.length-5} more`))}}else e.phase==="COMPLETED"?t.push(s(`${k}Complete!${o} ${e.iteration} iterations, ${e.decisionsCount} decisions`)):e.phase==="IDLE"&&t.push(s(`${m}No active spec \u2014 work freely${o}`));t.push(c()),e.concerns.length>0&&t.push(s(`Concerns: ${e.concerns.join(", ").slice(0,40)}`));let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${o}`:`${k}ok${o} (${e.iteration}/${e.maxIterations})`;return t.push(s(`Context: ${u}`)),t.push(`${m}\u2570${l}\u256F${o}`),t.push(` ${m}watching .eser/.state/ ... ctrl+c to stop${o}`),t.join(`
|
|
4
|
+
`)},V=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,verificationPassed:e.verificationPassed}),z=async e=>{let{root:t}=await D(),l=e!==void 0&&e.some(r=>r==="-o"||r.startsWith("--output"))?L(e):"ansi";if(!await v(t)){let r=new TextEncoder,n=g.process.stdout.getWriter();return await n.write(r.encode(`noskills not initialized.
|
|
5
|
+
`)),n.releaseLock(),S({exitCode:1})}let s=`${t}/.eser/.state`,c="",u=async()=>{let r=await A(t),n=l==="json"?V(r):l==="markdown"?O(r,"markdown"):K(r);if(l==="json"){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(n+`
|
|
6
6
|
`)),$.releaseLock()}else if(l==="markdown"){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(n+`
|
|
7
7
|
---
|
|
8
|
-
`)),$.releaseLock()}else if(n!==c){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(
|
|
8
|
+
`)),$.releaseLock()}else if(n!==c){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(W+n+`
|
|
9
9
|
`)),$.releaseLock(),c=n}return r.allSpecs.length>0&&r.allSpecs.every(h=>h.phase==="COMPLETED")||r.allSpecs.length===0&&r.phase==="COMPLETED"};if(await u())return y(void 0);let p=1e3,i=0;for(;;){await new Promise(r=>setTimeout(r,p));try{let n=(await g.fs.stat(`${s}/state.json`)).mtime?.getTime()??0;if(n>i&&(i=n,await new Promise(h=>setTimeout(h,200)),await u()))break}catch{}}return y(void 0)};export{A as buildSnapshot,z as main,V as renderJsonLine,K as renderTerminal};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{A as l,B as a}from"./chunk-
|
|
2
|
+
import{A as l,B as a}from"./chunk-LOZLXP5G.js";import"./chunk-2XNFZXHY.js";import{a as n,b as s}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var m=async p=>{let{root:t}=await a();if(!await l(t))return console.error("noskills is not initialized. Run: noskills init"),s({exitCode:1});let r=3e3,o=!1;for(let e of p??[])e.startsWith("--port=")&&(r=parseInt(e.slice(7),10)),e==="--open"&&(o=!0);let c="@eser/noskills-web",i;try{i=(await import(c)).startServer}catch{return console.error("@eser/noskills-web is not installed. Run: deno install"),s({exitCode:1})}return await i({root:t,port:r,open:o}),n(void 0)};export{m as main};
|