eser 4.1.53 → 4.1.55
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-CL22MZYV.js → ajan-HYDPJF3Z.js} +1 -1
- package/chunks/{approve-VBXGXWZI.js → approve-7QQFUQ2C.js} +1 -1
- package/chunks/{block-Z4BELXXO.js → block-4ISSYCGQ.js} +1 -1
- package/chunks/{cancel-HHW2G675.js → cancel-ZRTVX5AT.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-BAVRVBBX.js +2 -0
- package/chunks/{chunk-NYHMH3N5.js → chunk-DI7OHJ53.js} +1 -1
- package/chunks/{chunk-RLA2Z7XV.js → chunk-IXO5V52Y.js} +1 -1
- package/chunks/chunk-KI6473LF.js +6 -0
- package/chunks/chunk-LEG3PWOU.js +4 -0
- package/chunks/{chunk-RUTM4VP7.js → chunk-LOZLXP5G.js} +6 -6
- package/chunks/{chunk-DGI7M6TL.js → chunk-MLC6JFJF.js} +1 -1
- package/chunks/chunk-NCSKHFFW.js +3 -0
- package/chunks/chunk-PPB6ACBB.js +2 -0
- package/chunks/{concern-YFXJJ7DL.js → concern-J22UTED2.js} +1 -1
- package/chunks/{delegate-FVHPWQS7.js → delegate-EBL5HMGD.js} +1 -1
- package/chunks/{diagrams-MRJB73CF.js → diagrams-XRNON3TH.js} +1 -1
- package/chunks/done-QSQ7AMLP.js +2 -0
- package/chunks/{followup-XKVSZT2H.js → followup-EMQ3ZNNS.js} +1 -1
- package/chunks/{gh-3GMLD6TO.js → gh-66RDDALE.js} +1 -1
- package/chunks/{init-ONTNPCSY.js → init-OQ4CKFY7.js} +1 -1
- package/chunks/{invoke-hook-ZM6UQND6.js → invoke-hook-U3LDMMLY.js} +9 -9
- package/chunks/{learn-SRDLP7B5.js → learn-6MIAYVOR.js} +1 -1
- package/chunks/{manager-BMNUSWJO.js → manager-R2Q4FOHO.js} +1 -1
- package/chunks/{mod-6LLSLOX6.js → mod-FSAQBB7E.js} +1 -1
- package/chunks/mod-HZDU4RQ6.js +9 -0
- package/chunks/{mod-TB73AJG3.js → mod-ZCIGCCW4.js} +1 -1
- package/chunks/next-ZR6B35KN.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-KFHUPFTT.js} +1 -1
- package/chunks/{reset-XITFRWII.js → reset-F25OLGX7.js} +1 -1
- package/chunks/{review-UVYK4M4T.js → review-ITFNV2TI.js} +1 -1
- package/chunks/{rule-BAO7IP5S.js → rule-E3CUOBUX.js} +1 -1
- package/chunks/{run-EBKNNOG7.js → run-7HOUSACQ.js} +1 -1
- package/chunks/{session-SZYH2UOE.js → session-6EGZXYCI.js} +1 -1
- package/chunks/{spec-CPRKQGOX.js → spec-XFXHNULK.js} +1 -1
- package/chunks/{status-SRCNQJ4V.js → status-KEARGELM.js} +1 -1
- package/chunks/{sync-WE6A7KC7.js → sync-7FA2HPX7.js} +1 -1
- package/chunks/{system-6TO2XBOH.js → system-I6RBRBRL.js} +1 -1
- package/chunks/{versions-VGXMC5GM.js → versions-NR3A7CS5.js} +1 -1
- package/chunks/{watch-WBZB2C5P.js → watch-XTRRIRTM.js} +1 -1
- package/chunks/{web-GAF33V4M.js → web-VCJYTSV2.js} +1 -1
- package/chunks/{wontfix-JBPCNL6S.js → wontfix-SLHYAWS7.js} +1 -1
- package/eser.js +1 -1
- package/package.json +1 -1
- 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/mod-IALKEUJL.js +0 -9
- package/chunks/next-FD3EHJW3.js +0 -8
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as J}from"./chunk-5YBG2HOI.js";import{a as A}from"./chunk-
|
|
3
|
-
`)),I.releaseLock()}else try{r=await
|
|
4
|
-
`)),d.releaseLock()}catch{}}}if(f==="EXECUTING"&&p.length>0)try{let c=[],u=await G(n),d=U(u,"EXECUTING",p);c.push(...d);let h=await J(n,[p]);for(let S of h)c.push(`(${S.folder}/) ${S.rule}`);let I=r.classification??null,
|
|
2
|
+
import{a as J}from"./chunk-5YBG2HOI.js";import{a as A}from"./chunk-KI6473LF.js";import"./chunk-4KDDHQVL.js";import{f as F}from"./chunk-PPB6ACBB.js";import{a as G,b as W,d as U,e as B}from"./chunk-4JICYXYK.js";import"./chunk-KFVUFHJB.js";import"./chunk-NY4W44PI.js";import{A as L,c as w,d as D,e as P,l as y,p as b,t as _,u as $}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}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var j=new Set(["log","diff","status","show","blame","rev-parse","ls-files","ls-tree","cat-file","describe","shortlog","name-rev","for-each-ref","rev-list","help","version"]),X=new Map([["branch",new Set(["","--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"])],["tag",new Set(["","-l","--list","-v","--verify","-n"])],["stash",new Set(["list","show"])],["remote",new Set(["","-v","--verbose","show","get-url"])],["config",new Set(["--get","--get-all","--get-regexp","--list","-l","--global","--local","--system"])],["reflog",new Set(["","show"])]]),H=new Set(["-C","-c","--git-dir","--work-tree","--namespace","--super-prefix","--config-env"]),z=new Set(["--no-replace-objects","--bare","--no-optional-locks","--literal-pathspecs","--glob-pathspecs","--noglob-pathspecs","--icase-pathspecs","--no-pager","--paginate"]),q=t=>{let s=0;for(;s<t.length;){let e=t[s];if(H.has(e)){s+=2;continue}if(z.has(e)){s+=1;continue}if(e.startsWith("--git-dir=")||e.startsWith("--work-tree=")||e.startsWith("--namespace=")||e.startsWith("--super-prefix=")||e.startsWith("--config-env=")){s+=1;continue}if(e.startsWith("-C")&&e.length>2){s+=1;continue}if(e.startsWith("-c")&&e.length>2&&e.includes("=")){s+=1;continue}return e}return null},E=t=>{let s=t.trim();if(!s.startsWith("git"))return!0;let e=s.slice(3).trim();if(e.length===0)return!0;let n=e.split(/\s+/),a=q(n)??"";if(j.has(a))return!0;let o=X.get(a);if(o!==void 0){let r=n.indexOf(a),g=r>=0&&r+1<n.length?n[r+1]:"";if(o.has(g))return!0}return!1};var K=t=>{let s=[/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+["'](.+?)["']/g,/(?:bash|sh|\/bin\/bash|\/bin\/sh)\s+-c\s+(\S+)/g,/eval\s+["'](.+?)["']/g];for(let a of s){let o;for(;(o=a.exec(t))!==null;){let r=o[1]??"";if(r.includes("git")&&!E(r))return!0}}let e=t.split(/\s*\|\s*/);for(let a of e){let o=a.trim();if(o.startsWith("git")&&!E(o))return!0}let n=t.matchAll(/(?:^|[\s($`(])git\b/g);for(let a of n){let r=a[0].indexOf("git"),g=(a.index??0)+r,f=(t.slice(g).split(/[;&|$)`'"]/)[0]??"").trim();if(f.startsWith("git")&&!E(f))return!0}return!1};var x=async()=>{let t=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:r}=await t.read();if(o||r===void 0)break;s.push(r)}}finally{t.releaseLock()}let e=0,n=new Uint8Array(s.reduce((o,r)=>o+r.length,0));for(let o of s)n.set(o,e),e+=o.length;let a=new TextDecoder().decode(n);try{return JSON.parse(a)}catch{return{}}},N=async t=>{let s=new TextEncoder,e=i.process.stdout.getWriter();await e.write(s.encode(JSON.stringify(t))),e.releaseLock()},ge=async t=>{switch(t?.[0]){case"pre-tool-use":return await ee();case"stop":return await te();case"post-file-write":return await se();case"post-bash":return await ne();case"session-start":return await ie();default:return l(void 0)}},v=async t=>{await N({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${t}`}})},Z=async t=>{await N({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow",additionalContext:t}})},M=(t,s)=>{if(s||!t.includes("git"))return null;let e=t.split(/\s*(?:&&|;)\s*/);for(let n of e){let a=n.trim();if(a.startsWith("git")&&!E(a))return"Git write operations are not allowed. Only read commands (log, diff, status, show, blame, branch, tag) are permitted. The user controls git, the agent controls files."}return K(t)?"Git write operations detected in subshell or pipe. Only read commands are permitted. The user controls git, the agent controls files.":null},ee=async()=>{let t=await x(),s=t.tool_name??"unknown",e=t.tool_input??{},n=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),a=await y(n),o=i.env.get("NOSKILLS_SESSION")??null;if(o!==null){let c=await _(n,o);if(c!==null&&c.mode==="free"){if(s==="Bash"){let u=(e.command??"").trim(),d=a?.allowGit??!1;if(!d&&u.includes("git")){let h=M(u,d);if(h!==null)return await v(h),l(void 0)}}return l(void 0)}}let r={};if(o!==null){let c=await _(n,o);if(c!==null&&c.mode==="spec"&&c.phase!==null)r={phase:c.phase};else if(c!==null&&c.spec!==null)try{r=await P(n,c.spec)}catch{return l(void 0)}else return l(void 0)}else{let c=await $(n);if(c.length>0){let u={DISCOVERY:10,DISCOVERY_REVIEW:10,SPEC_DRAFT:10,SPEC_APPROVED:8,BLOCKED:8,EXECUTING:2,IDLE:0,COMPLETED:0},d="IDLE",h=0;for(let C of c){let R=C.phase??"IDLE",T=u[R]??0;T>h&&(h=T,d=R)}r={phase:d};let k=new TextEncoder,I=i.process.stderr.getWriter();await I.write(k.encode(`noskills: WARNING \u2014 ${c.length} session(s) active but NOSKILLS_SESSION not set. Using most restrictive phase (${d}). Set NOSKILLS_SESSION for correct per-instance enforcement.
|
|
3
|
+
`)),I.releaseLock()}else try{r=await D(n)}catch{return l(void 0)}}if(s==="Bash"){let c=(e.command??"").trim(),u=a?.allowGit??!1,d=M(c,u);return d!==null?(await 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=r.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 c=`${n}/${w.stateDir}/executor-warned.flag`;try{await i.fs.readTextFile(c)}catch{try{await i.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0}),await i.fs.writeTextFile(c,new Date().toISOString());let u=new TextEncoder,d=i.process.stderr.getWriter();await d.write(u.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
|
|
4
|
+
`)),d.releaseLock()}catch{}}}if(f==="EXECUTING"&&p.length>0)try{let c=[],u=await G(n),d=U(u,"EXECUTING",p);c.push(...d);let h=await J(n,[p]);for(let S of h)c.push(`(${S.folder}/) ${S.rule}`);let I=r.classification??null,C=await b(n),R=await y(n),T=C.filter(S=>R!==null&&R.concerns.includes(S.id)),V=F(T,p,I);if(c.push(...V),c.length>0){let S=`[noskills] Rules for this file:
|
|
5
5
|
`+c.map(Y=>`- ${Y}`).join(`
|
|
6
|
-
`);return await Z(S),l(void 0)}}catch{}return l(void 0)}let O={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await
|
|
6
|
+
`);return await Z(S),l(void 0)}}catch{}return l(void 0)}let O={DISCOVERY:`You are in DISCOVERY \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m("next")}\` to continue.`,DISCOVERY_REVIEW:`You are in DISCOVERY_REVIEW \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, complete discovery and get the spec approved first. Run \`${m('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`You are in SPEC_DRAFT \u2014 this is a thinking phase, not an implementation phase. Read and discuss only. To write code, approve the spec first. Run \`${m("approve")}\``,SPEC_APPROVED:`You are in SPEC_APPROVED \u2014 start execution first: \`${m('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${m('next --answer="resolution"')}\``};return await v(O[f]??`Run \`${m("next")}\` first.`),l(void 0)},te=async()=>{let t=await x();if(t.stop_hook_active===!0)return l(void 0);let s=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),e;try{let u=await i.fs.readTextFile(`${s}/${w.stateFile}`);e=JSON.parse(u)}catch{return l(void 0)}if(e.phase!=="EXECUTING")return l(void 0);let n=e.execution??{},a=`${s}/${w.stateDir}/files-changed.jsonl`,o=[];try{let d=(await i.fs.readTextFile(a)).trim().split(`
|
|
7
7
|
`).filter(Boolean);o=[...new Set(d.map(h=>{try{return JSON.parse(h).file}catch{return null}}).filter(h=>h!==null))]}catch{}let r=[],g="no changes";try{let{execSync:u}=await import("node:child_process");r=u("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
8
|
-
`).filter(Boolean);let
|
|
9
|
-
`);g=
|
|
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([...o,...r])],f=(n.iteration??0)+1,O=`${s}/${w.stateDir}/iterations`;try{await i.fs.mkdir(O,{recursive:!0}),await i.fs.writeTextFile(`${O}/iteration-${f}.json`,JSON.stringify({iteration:f,files:p,gitStat:g.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
10
10
|
`)}catch{}let c=15;try{let u=await y(s);u!==null&&(c=u.maxIterationsBeforeRestart)}catch{}e.execution={...n,iteration:f,modifiedFiles:p,lastProgress:g.trim()||n.lastProgress||null},e.lastCalledAt=new Date().toISOString();try{await i.fs.writeTextFile(`${s}/${w.stateFile}`,JSON.stringify(e,null,2)+`
|
|
11
11
|
`)}catch{}try{await i.fs.writeTextFile(a,"")}catch{}try{await i.fs.remove(`${s}/${w.stateDir}/executor-warned.flag`)}catch{}if(f>=c){let u=new TextEncoder,d=i.process.stderr.getWriter();await d.write(u.encode(`noskills: iteration ${f} reached threshold (${c}). Consider starting a fresh conversation.
|
|
12
|
-
`)),d.releaseLock()}return l(void 0)},se=async()=>{let t=await
|
|
13
|
-
`)}catch{}return l(void 0)},ne=async()=>{let t=await
|
|
14
|
-
`)}catch{}return l(void 0)},ie=async()=>{let t=i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd();if(!await L(t))return l(void 0);let s=await
|
|
12
|
+
`)),d.releaseLock()}return l(void 0)},se=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??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),a=`${n}/${w.stateDir}/files-changed.jsonl`,o=JSON.stringify({file:e,tool:t.tool_name,ts:new Date().toISOString()});try{await i.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0});let r="";try{r=await i.fs.readTextFile(a)}catch{}await i.fs.writeTextFile(a,r+o+`
|
|
13
|
+
`)}catch{}return l(void 0)},ne=async()=>{let t=await x(),e=(t.tool_input??{}).command??"";if(!e.includes("noskills"))return l(void 0);let n=t.cwd??i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd(),a=`${n}/${w.stateDir}/noskills-calls.jsonl`,o=JSON.stringify({command:e,ts:new Date().toISOString()});try{await i.fs.mkdir(`${n}/${w.stateDir}`,{recursive:!0});let r="";try{r=await i.fs.readTextFile(a)}catch{}await i.fs.writeTextFile(a,r+o+`
|
|
14
|
+
`)}catch{}return l(void 0)},ie=async()=>{let t=i.env.get("NOSKILLS_PROJECT_ROOT")??i.process.cwd();if(!await L(t))return l(void 0);let s=await D(t),e=await y(t),a=(await b(t)).filter(p=>e!==null&&e.concerns.includes(p.id)),o=await W(t),r=B(e?.tools??[]),g=await A(s,a,o,e,void 0,void 0,void 0,r);return await N(g),l(void 0)};export{ge as main};
|
|
@@ -1,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
|
---
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-NE2J6ISX.js";import"./chunk-KFVUFHJB.js";import{a as Le}from"./chunk-ODBJ5KMQ.js";import{b as ae,c as oe}from"./chunk-YWSOQJ7G.js";import"./chunk-
|
|
2
|
+
import"./chunk-NE2J6ISX.js";import"./chunk-KFVUFHJB.js";import{a as Le}from"./chunk-ODBJ5KMQ.js";import{b as ae,c as oe}from"./chunk-YWSOQJ7G.js";import"./chunk-DI7OHJ53.js";import{h as ie}from"./chunk-L32KHQVT.js";import"./chunk-BAVRVBBX.js";import{A as Pe,B as Ce,c as Te,d as xe,e as te,i as ve,k as Ie,l as Me,s as se,v as Re,x as De,z as ne}from"./chunk-LOZLXP5G.js";import{b as re}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{c as J,d as we,e as Se,r as O,s as a,t as V,u as j,v as Z,w as ee,x as z,y as Ee}from"./chunk-5GGWX7CO.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import{d as he,e as H,f as be}from"./chunk-VKB3B2FE.js";import{a as Q,b as ye}from"./chunk-FFWPJP7A.js";import{i as N}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var Ye=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],Ge=e=>{let n={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE",BLOCKED:"EXECUTING"}[e]??e;return Ye.map(r=>r===n?`[ ${r} ]`:r).join(" \u2192 ")},Ae=async(e,s)=>{let n;try{n=await ve(e,s)}catch{n=await xe(e)}let r=await Le(e,s),l=new Set(n.execution.completedTasks??[]),t=(r?.tasks??[]).map(u=>({id:u.id,description:u.title,done:l.has(u.id),...u.files!==void 0&&u.files.length>0?{files:u.files}:{}})),b=[...new Set(n.discovery.answers.map(u=>"user"in u?u.user:null).filter(u=>u!==null&&u!=="Unknown User"))],E=(n.specNotes??[]).filter(u=>u.text.startsWith("[QUESTION] ")).map(u=>({id:u.id,text:u.text.replace("[QUESTION] ",""),user:u.user,ts:u.timestamp})),v=n.transitionHistory??[],g=v.length>0?v[0].timestamp:new Date().toISOString(),I=n.lastCalledAt??g,S=n.execution.confidenceFindings??[],h=S.length>0?Math.round(S.reduce((u,i)=>u+i.confidence,0)/S.length*10)/10:null,M=S.filter(u=>u.confidence<5).length;return{name:s,slug:s,phase:n.phase,description:n.specDescription??"",tasks:t,contributors:b,delegations:n.discovery.delegations??[],pendingQuestions:E,pendingSignoffs:[],roadmap:Ge(n.phase),createdAt:g,updatedAt:I,avgConfidence:h,lowConfidenceItems:M}},K=async e=>{let s=await Ie(e),n=new Set(s.map(i=>i.name));try{let i=`${e}/${Te.specsDir}`;for await(let m of(await import("./mod-4XKQZL6W.js")).runtime.fs.readDir(i))m.isDirectory&&!n.has(m.name)&&n.add(m.name)}catch{}let r=[];for(let i of n)try{r.push(await Ae(e,i))}catch{}r.sort((i,m)=>{let T=i.phase!=="COMPLETED"&&i.phase!=="IDLE",R=m.phase!=="COMPLETED"&&m.phase!=="IDLE";return T&&!R?-1:!T&&R?1:m.updatedAt.localeCompare(i.updatedAt)});let l=r.find(i=>i.phase!=="COMPLETED"&&i.phase!=="IDLE")??null,t=await ae(e,{limit:50}),b=t.filter(i=>i.type==="mention"),E=new Set(t.filter(i=>i.type==="mention-reply").map(i=>i.mentionId)),v=b.filter(i=>!E.has(i.id)).map(i=>({id:i.id??"",spec:i.spec,from:i.from??i.user,to:i.to??"",question:i.question??"",status:"pending",ts:i.ts})),I=t.filter(i=>i.type==="signoff").filter(i=>i.status==="pending").map(i=>({spec:i.spec,role:i.role??"",status:"pending",ts:i.ts})),S=await ie(e),h=S!==void 0?{name:S.name,email:S.email}:null,u=(await Me(e))?.roles??null;return{specs:r,activeSpec:l,pendingMentions:v,pendingSignoffs:I,recentEvents:t,currentUser:h,roles:u}};var ke=()=>({tabs:[],selectedTabIndex:-1,focus:"list",running:!0,specsVisible:!0,monitorVisible:!0});var Ze=e=>e===null?"\u2014":{DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"}[e]??e.slice(0,4),et=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},tt=(e,s)=>{switch(s){case"green":return a.green(e);case"yellow":return a.yellow(e);case"red":return a.red(e);case"cyan":return a.cyan(e);case"dim":return a.dim(e);default:return e}},A=(e,s)=>{let n=new Set(s.filter(l=>l.spec!==null).map(l=>l.spec)),r=e.map(l=>({label:l.name,badge:Ze(l.phase),badgeColor:et(l.phase),active:n.has(l.name),dimmed:l.phase==="COMPLETED"}));return r.length===0&&r.push({label:"No specs yet",dimmed:!0,selectable:!1}),r},ce=(e,s,n,r)=>{let l=A(e,s),t=V.drawBox({x:r.x,y:r.y,width:r.width,height:r.height,title:"Specs",borderStyle:"rounded"}),b=r.width-2,E=r.height-2,v=Math.max(0,Math.min(n,l.length-1)),g=z.ensureVisible(z.createScrollState(l.length,E),v),I=z.visibleRange(g),S=[];for(let u=0;u<E;u++){let i=I.start+u,m=r.y+1+u;if(i>=I.end||i>=l.length){S.push(a.moveTo(m,r.x+1)+" ".repeat(b));continue}let T=l[i];if(T===void 0){S.push(a.moveTo(m,r.x+1)+" ".repeat(b));continue}let R=T.selectable!==!1,f=i===n&&R,D=T.active?a.green("\u25CF"):f?"\u25B8":" ",C=T.badge!==void 0?" "+tt(`[${T.badge}]`,T.badgeColor??"dim"):"",F=T.dimmed?a.dim(T.label):T.label,Y=` ${D} ${F}${C}`,U=a.truncate(Y,b),c=Math.max(0,b-a.visibleLength(U));f?S.push(a.moveTo(m,r.x+1)+a.inverse(U+" ".repeat(c))):S.push(a.moveTo(m,r.x+1)+U+" ".repeat(c))}let h={id:r.id,x:r.x,y:r.y+1,width:r.width-1,height:E},M=z.renderScrollbar(h,g);return t+S.join("")+M};var nt=["IDLE","DISCOVERY","REVIEW","DRAFT","APPROVED","EXECUTING","DONE","IDLE"],rt=e=>{if(e===null||e==="IDLE")return"IDLE";let n={DISCOVERY_REVIEW:"REVIEW",SPEC_DRAFT:"DRAFT",SPEC_APPROVED:"APPROVED",COMPLETED:"DONE"}[e]??e;return nt.map(r=>r===n?a.bold(`\u2726${r}\u2726`):a.dim(r)).join("\u2192")},it=(e,s,n)=>{if(s===0)return a.dim("no tasks");let r=Math.round(e/s*n),l=n-r;return a.green("\u2588".repeat(r))+a.dim("\u2591".repeat(l))+` ${e}/${s}`},le=(e,s,n)=>{let r=[];return e===null?(r.push(a.bold("Mode: ")+a.cyan("IDLE")),r.push(a.dim("No active spec"))):e.mode==="free"?(r.push(a.bold("Mode: ")+a.cyan("IDLE")),r.push(a.dim("No active spec")),r.push(""),r.push(a.dim(`Session: ${e.sessionId}`))):(r.push(a.bold("Spec: ")+(e.spec??"unknown")),r.push(a.bold("Phase: ")+(e.phase??"unknown")),r.push(""),r.push(rt(e.phase)),r.push(""),n!==void 0&&r.push(a.bold("Progress: ")+it(n.completed,n.total,15)),r.push(""),r.push(a.dim(`Session: ${e.sessionId}`))),V.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:"Monitor",borderStyle:"rounded"},r)};var ot=e=>({DISCOVERY:"DISC",DISCOVERY_REVIEW:"REVW",SPEC_DRAFT:"DRFT",SPEC_APPROVED:"APPR",EXECUTING:"EXEC",BLOCKED:"BLKD",COMPLETED:"DONE",IDLE:"IDLE"})[e]??e.slice(0,4),ct=e=>{switch(e){case"EXECUTING":return"green";case"DISCOVERY":case"DISCOVERY_REVIEW":return"cyan";case"BLOCKED":return"red";case"SPEC_DRAFT":case"SPEC_APPROVED":return"yellow";case"COMPLETED":return"dim";default:return"dim"}},lt=e=>e.map(s=>({id:s.id,label:s.spec!==null?s.spec:"IDLE",badge:s.phase!==null?ot(s.phase):void 0,badgeColor:s.phase!==null?ct(s.phase):void 0,closable:!0})),Ve=(e,s,n,r,l=1)=>{let t=[];if(t.push(a.moveTo(r,l)),e.length===0){let v=a.dim(" No tabs \u2014 press n to create one ");return t.push(v+" ".repeat(Math.max(0,n-a.visibleLength(v)))),t.join("")}let b=lt(e),E=Ee.renderTabBar({tabs:b,activeIndex:s,maxWidth:n,style:"inverse"});return t.push(E),t.join("")};var de=(e,s,n,r)=>{let l="Terminal",t=n??[],b=r??0,E=s.y-1,v=s.width,g=Ve(t,b,v,E,s.x),I=e!==null&&e.widget!==null,S=V.drawBox({x:s.x,y:s.y,width:s.width,height:s.height,title:l,borderStyle:"rounded",skipInterior:I});if(t.length===0){let u=a.dim("No tabs \u2014 press n to create one"),i=" ".repeat(Math.max(0,s.width-2)),m="",T=Math.floor((s.height-2)/2);for(let R=1;R<s.height-1;R++)if(m+=a.moveTo(s.y+R,s.x+1),R===T){let f=a.visibleLength(u),D=Math.max(0,Math.floor((s.width-2-f)/2));m+=" ".repeat(D)+u+" ".repeat(Math.max(0,s.width-2-D-f))}else m+=i;return g+S+m}if(e===null||e.widget===null&&e.buffer.length===0){let u=" ".repeat(Math.max(0,s.width-2)),i="";for(let m=1;m<s.height-1;m++)i+=a.moveTo(s.y+m,s.x+1),i+=u;return g+S+i}if(e.widget!==null)return g+S+e.widget.render(s);let h=s.height-2,M=e.buffer.slice(-h);return g+V.fillBox({x:s.x,y:s.y,width:s.width,height:s.height,title:l,borderStyle:"rounded"},M)};var ue=(e,s)=>({...e,tabs:[...e.tabs,s],selectedTabIndex:e.tabs.length}),X=(e,s)=>{let n=e.tabs.findIndex(t=>t.id===s);if(n===-1)return e;let r=e.tabs[n];r.process!==null&&r.process.kill();let l=e.tabs.filter(t=>t.id!==s);return{...e,tabs:l,selectedTabIndex:Math.min(e.selectedTabIndex,l.length-1)}},Be=(e,s)=>s<0||s>=e.tabs.length?e:{...e,selectedTabIndex:s},pe=(e,s)=>{let n=s.split(`
|
|
3
3
|
`);for(let r of n)e.buffer.push(r);e.buffer.length>1e3&&e.buffer.splice(0,e.buffer.length-1e3)},k=e=>e.selectedTabIndex<0||e.selectedTabIndex>=e.tabs.length?null:e.tabs[e.selectedTabIndex]??null;var me=(e,s,n)=>{if(e.focus==="terminal")return n&&s==="c"?{type:"quit"}:s==="escape"?{type:"toggleFocus"}:{type:"passthrough",data:s};if(n&&s==="c")return{type:"quit"};if(n&&s==="d")return{type:"quit"};if(n&&s==="t")return{type:"newTab"};if(s==="tab"||s==="escape")return{type:"toggleFocus"};if(n&&s==="e")return{type:"toggleSpecs"};if(n&&s==="w")return{type:"toggleMonitor"};if(e.focus==="list")switch(s){case"up":return{type:"navigate",direction:"up"};case"down":return{type:"navigate",direction:"down"};case"return":return{type:"select"};case"n":return{type:"newTab"};case"x":return{type:"closeTab"};case"q":return{type:"quit"};default:return{type:"none"}}return{type:"passthrough",data:s}},Fe=e=>({...e,focus:e.focus==="list"?"terminal":"list"}),fe=(e,s,n)=>{let r=j.nextSelectableIndex(n,e.selectedTabIndex,s);return{...e,selectedTabIndex:r}},ge=(e,s,n)=>e>=n.x&&e<n.x+n.width&&s>=n.y&&s<n.y+n.height,Ue=(e,s,n,r)=>{let l=e.x+1,t=e.y+1;if(ge(l,t,s.left)){if(e.type==="wheel")return{type:"scrollSpecs",direction:e.direction==="up"?"up":"down"};if(e.type==="mousedown"&&e.button===0){let b=e.y+1-s.left.y-1;if(b>=0&&b<n.length&&n[b].selectable!==!1)return{type:"clickSpec",index:b}}return{type:"none"}}return ge(l,t,s.rightBottom)?e.type==="wheel"?{type:"scrollTerminal",direction:e.direction==="up"?"up":"down"}:r!=="terminal"?{type:"clickTerminal"}:{type:"forwardMouse",event:e}:ge(l,t,s.rightTop)?{type:"clickMonitor"}:{type:"none"}};var Zt=async e=>{let s=e?.includes("--dry-run")??!1,{root:n}=await Ce();if(!await Pe(n))return console.error("noskills is not initialized. Run:",re(),"init"),ye({exitCode:1});let l=(await K(n)).specs.map(c=>({name:c.name,phase:c.phase,hasActiveSession:!1})),t=ke(),{cols:b,rows:E}=O.getTerminalSize(),v=(c,d)=>{let o=E-1,p=_=>({id:_,x:0,y:0,width:0,height:0});if(!c&&!d)return{left:p("left"),rightTop:p("rightTop"),rightBottom:{id:"rightBottom",x:1,y:2,width:b,height:o-1},statusBar:{id:"statusBar",x:1,y:E,width:b,height:1}};let w=c?Math.min(Math.floor(b*.25),b):0,P=Math.floor(o*(d?.35:0)),L=[];d&&L.push({id:"rightTop",size:{type:"fixed",value:P}}),L.push({id:"rightBottom",size:{type:"flex",grow:1}});let B=[];c&&B.push({id:"left",size:{type:"fixed",value:w}}),B.push({direction:"column",size:{type:"flex",grow:1},children:L});let _e={direction:"column",children:[{direction:"row",size:{type:"flex",grow:1},children:B},{id:"statusBar",size:{type:"fixed",value:1}}]},$e=ee.computeLayout(_e,b,E),q=_=>{let $=ee.findPanel($e,_);return $===void 0?p(_):{id:_,x:$.x+1,y:$.y+1,width:$.width,height:$.height}},Ne=q("left"),ze=q("rightTop"),G=q("rightBottom"),We=q("statusBar"),qe=G.y+1,je=G.height-1;return{left:c?Ne:p("left"),rightTop:d?ze:p("rightTop"),rightBottom:{...G,y:qe,height:je},statusBar:We}},g=v(t.specsVisible,t.monitorVisible),I=()=>({cols:g.rightBottom.width-2,rows:g.rightBottom.height-2}),S=new TextEncoder,h=c=>{N.process.writeToStdout(S.encode(c))};if(s){h(O.clearScreenSeq());let c=` noskills manager | ${l.length} spec(s) | ${re()} | Ctrl+C to quit`;h(a.moveTo(g.statusBar.y,g.statusBar.x)),h(a.inverse(a.truncate(c,g.statusBar.width))),h(ce(l,t.tabs,t.selectedTabIndex,g.left));let d=k(t);return h(le(d,g.rightTop)),h(de(d,g.rightBottom,t.tabs,t.selectedTabIndex)),h(a.moveTo(E,1)),h(`
|
|
4
4
|
`),Q(void 0)}let M=new be,u=null,i=async()=>{for(let c of["claude","claude-code"])try{if(await he`which ${c}`.noThrow().code()===0)return c}catch{}return"claude"},m=A(l,t.tabs);t.selectedTabIndex=j.nextSelectableIndex(m,-1,"down");let T=async()=>{let c=ne();await se(n,{id:c,spec:null,mode:"free",phase:null,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"});let d=I(),y=new Z(d.rows,d.cols),o={id:`tab-${c}`,spec:null,mode:"free",sessionId:c,process:null,buffer:[],widget:y,active:!0,phase:null};try{let p=await i(),w=await H({command:p,cwd:n,env:{...N.env.toObject(),NOSKILLS_SESSION:c,NOSKILLS_PROJECT_ROOT:n},cols:d.cols,rows:d.rows});o.process=w,M.add(o.id,w),w.onData(x=>{y.write(x),pe(o,x),u?.()}),w.exitCode.then(()=>{Object.assign(t,X(t,o.id)),m=A(l,t.tabs),C(),t.running&&D()}).catch(()=>{})}catch(p){let w=p instanceof Error?p.message:String(p);y.write(`[noskills manager] Failed to spawn claude: ${w}\r
|
|
5
5
|
`),y.write(`Is Claude Code installed? Set command in manifest.yml\r
|
|
@@ -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-IXO5V52Y.js";import"./chunk-L5OC7F24.js";import"./chunk-J2Z7NG2X.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-VKB3B2FE.js";import"./chunk-MLC6JFJF.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,9 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-5WJ6AUNY.js";var $=await import("node:fs"),c=s=>{try{return $.statSync(s),!0}catch{return!1}},P=s=>{let o=globalThis;if(typeof o.process<"u"&&typeof o.process.env=="object")return o.process.env[s]??void 0},A=s=>{if(s!==void 0)return s;let o=globalThis;return typeof o.__dirname=="string"?o.__dirname:typeof o.process<"u"&&typeof o.process.cwd=="function"?o.process.cwd():"."},g={command:"eser-ajan.wasm",reactor:"eser-ajan-reactor.wasm"},l=(s="command",o)=>{let a=g[s]??g.command,r=[a,`${a}.bin`],f=s==="reactor"?"wasi-reactor":"wasi",e=[],m=P("ESER_AJAN_WASM_PATH");if(m!==void 0){if(c(m))return m;e.push(`$ESER_AJAN_WASM_PATH = ${m}`)}let d=A(o);for(let n of r){let t=`${d}/${n}`;if(e.push(t),c(t))return t}let h=`${d}/..`;for(let n of r){let t=`${h}/dist/${f}/${n}`;if(e.push(t),c(t))return t}for(let n of r){let t=`${d}/dist/${f}/${n}`;if(e.push(t),c(t))return t}let u=globalThis,p=typeof u.process<"u"&&typeof u.process.cwd=="function"?u.process.cwd():".";if(p!==d)for(let n of r){let t=`${p}/pkg/@eser/ajan/dist/${f}/${n}`;if(e.push(t),c(t))return t}let w=[d,h,p];for(let n of w)for(let t of r){let i=`${n}/node_modules/@eserstack/ajan-wasm/${t}`;if(e.push(i),c(i))return i}for(let n of r){let t=[`/usr/local/lib/${n}`,`/usr/lib/${n}`];for(let i of t)if(e.push(i),c(i))return i}throw new Error(`Could not find eser-ajan WASM module (${a}).
|
|
3
|
+
Checked the following locations:
|
|
4
|
+
`+e.map(n=>` - ${n}`).join(`
|
|
5
|
+
`)+`
|
|
6
|
+
|
|
7
|
+
To fix this:
|
|
8
|
+
1. Install: npm install @eser/ajan
|
|
9
|
+
2. Or set ESER_AJAN_WASM_PATH to the full path of ${a}`)};var y=import.meta.dirname,_=(s="command")=>{try{return l(s,y),!0}catch{return!1}},W=async s=>{let o=s?.mode??"command",a=s?.wasmPath??l(o,y);if(o==="reactor"){let{loadReactorWasm:f}=await import("./loader-reactor-P6I3MX5L.js");return f(a)}let{loadCommandWasm:r}=await import("./loader-command-I5DTYP25.js");return r(a)};export{_ as isWasmAvailable,W as loadEserAjanWasm};
|
|
@@ -13,7 +13,7 @@ Supported runtimes:
|
|
|
13
13
|
- Node 25+ (node:ffi, experimental)
|
|
14
14
|
|
|
15
15
|
Current runtime: ${n}`)},nn=async(n,e)=>{let r=typeof n=="string"?n:void 0,t=typeof n=="object"?n:e;if(f("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=!f("ESER_AJAN_NATIVE")&&t?.native!==!1,s=!f("ESER_AJAN_WASM")&&t?.wasm!==!1;if(o||F("Native FFI disabled \u2014 skipping to WASM fallback"),s||F("WASM fallback disabled"),o)try{let a=r??I(R);return Q().open(a)}catch{}if(s)try{return await(await import("./mod-
|
|
16
|
+
Unset ESER_AJAN to re-enable.`);let o=!f("ESER_AJAN_NATIVE")&&t?.native!==!1,s=!f("ESER_AJAN_WASM")&&t?.wasm!==!1;if(o||F("Native FFI disabled \u2014 skipping to WASM fallback"),s||F("WASM fallback disabled"),o)try{let a=r??I(R);return Q().open(a)}catch{}if(s)try{return await(await import("./mod-HZDU4RQ6.js")).loadEserAjanWasm()}catch(a){throw new Error(`No native FFI backend available and WASM fallback failed.
|
|
17
17
|
WASM error: ${a instanceof Error?a.message:String(a)}
|
|
18
18
|
|
|
19
19
|
To fix this, install the @eser/ajan package or build the native library.
|
|
@@ -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-KI6473LF.js";import{a as he,b as ge,c as ve}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 we,b as Se,d as k}from"./chunk-2ZYCRMUT.js";import{a as Ee}from"./chunk-LEG3PWOU.js";import{a as H}from"./chunk-ODBJ5KMQ.js";import{a as Re,b as Oe,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 ke,m as Pe,o as ne,p as be,v as Ae}from"./chunk-BAVRVBBX.js";import{A as me,B as fe,a as ae,c as O,e as oe,f as ce,j as le,k as de,l as pe,p as ue,r as V,w as B}from"./chunk-LOZLXP5G.js";import{c as _}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=we(l),u=Se(l);if(!await me(e))return await k({error:`noskills not initialized. Run: ${_("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 k({error:h},r),E({exitCode:1})}if(s===null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED")return await k({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 k({error:"No config found"},r),E({exitCode:1});if(t.spec!==null&&t.phase!=="IDLE"&&t.phase!=="COMPLETED"){let f=`${e}/${O.specDir(t.spec)}`;try{await D.fs.stat(f)}catch{return await k({error:!0,message:`Active spec '${t.spec}' directory not found. Files may have been deleted manually.`,suggestion:`Run \`${_("reset")}\` to return to idle, or \`${_("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 V(e,h);let g={...h,lastCalledAt:new Date().toISOString()};await V(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:S}=Y(M,g.phase),P=g.spec!==null?await H(e,g.spec):null,A=await $e(e,g),I=await ie(e,A),C=X(a?.tools??[]),v=await W(e),b=await z(g,d,j,a,P,I,void 0,C,v,S,e),Q=n.trim().toLowerCase()==="save",Ue=g.phase===t.phase;if(Q&&Ue&&(g.phase==="SPEC_DRAFT"||g.phase==="SPEC_APPROVED")){let Le=g.phase==="SPEC_DRAFT"?"Spec draft saved. The spec stays in DRAFT and can be reviewed by anyone. Other users can add ACs (`ac add`), notes (`note add`), or tasks (`task add`) while in draft. When ready, any user can approve with `noskills spec <name> approve`.":'Spec is approved and parked. Others can still add ACs or notes. When ready, run `noskills next --answer="start"` to begin execution.',Ne={...b,instruction:Le,saved:!0};return await k(Ne,r),q(void 0)}return await k(b,r),q(void 0)}let c={...t,lastCalledAt:new Date().toISOString()};await V(e,c);let m=D.env.get("NOSKILLS_SESSION")??null;m!==null&&await B(e,m,c.phase);let p=await K(e),{tier1:w,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),U;c.phase==="IDLE"&&(U={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_DRAFT"?"awaiting approval":h.state.phase==="COMPLETED"?"completed":void 0})),rulesCount:w.length});let L=X(a?.tools??[]),re=await W(e),R=await z(c,d,w,a,y,$,U,L,re,x,e);return await k(R,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,w]of Object.entries(c))typeof w=="string"&&w.length>0&&(m=F(m,p,w,s));m={...m,discovery:{...m.discovery,batchSubmitted:!0}}}else{let p=ge(u),w=m.discovery.currentQuestion,x=p[w];if(x===void 0)return e;m=F(m,x.id,n,s),m=ke(m)}return ve(m.discovery.answers)&&(m=te(m)),m}case"DISCOVERY_REVIEW":{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_DRAFT":{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}/${O.specFile(e.spec)}`,o=await D.fs.readTextFile(i);if(a.includes("task-")){let c=qe(a).map(w=>`- [ ] ${w}`).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=Pe(e);return t.spec!==null&&(await Re(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 _e(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 Ve(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}/${O.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)),Ve=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 P=e.execution.debt.items.map((C,v)=>({id:`legacy-${v+1}`,text:C,since:e.execution.debt.fromIteration}));s={...e,execution:{...e.execution,debt:{...e.execution.debt,items:P}}};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(S=>t.has(S));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??[],w=n.remaining??[],x=n.blocked??[],y=s.execution.debt?.unaddressedIterations??0,T=s.execution.debt!==null?s.execution.debt.items.filter(S=>!d.has(S.id)&&!m.has(S.id)):[],$=s.execution.debtCounter??0,U=p.map((S,P)=>({id:`debt-${$+P+1}`,text:S,since:s.execution.iteration})),L=[...T,...U],R=w.length===0&&x.length===0&&p.length===0||L.length===0?null:{items:L,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=R===null&&N,j=$+p.length;if(M&&s.spec!==null){let S=await H(l,s.spec);if(S!==null){let P=s.execution.completedTasks??[],A=new Set(P),I=[];try{let v=JSON.parse(s.execution.lastProgress??"");Array.isArray(v.completed)&&(I=v.completed.filter(b=>!A.has(b)&&S.tasks.some(Q=>Q.id===b)))}catch{}if(I.length===0){let v=S.tasks.find(b=>!A.has(b.id));v!==void 0&&(I=[v.id])}let C=[];for(let v of I)await Oe(l,s.spec,v),await Fe(l,s.spec,v,"done"),C.push(v);if(C.length>0){let v=C.length===1?`Task ${C[0]} accepted`:`Tasks ${C.join(", ")} accepted`;return{...s,execution:{...s.execution,lastProgress:`${v}: ${g}`,awaitingStatusReport:!1,debt:R,completedTasks:[...P,...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:R,debtCounter:j,naItems:f}}},_e=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}/${O.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-BAVRVBBX.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-BAVRVBBX.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-BAVRVBBX.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-KI6473LF.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-BAVRVBBX.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
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 W,h as U}from"./chunk-L32KHQVT.js";import{b as z,g as N,h as F,p as L,r as H,s as J,t as Q,u as _}from"./chunk-OXP2FOO5.js";import{A as j,B as R,a as T,c as b,e as E,f as M,j as C,k as K}from"./chunk-RUTM4VP7.js";import{b as S,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-FD3EHJW3.js")],["approve",()=>import("./approve-VBXGXWZI.js")],["done",()=>import("./done-DMKJ27IQ.js")],["block",()=>import("./block-Z4BELXXO.js")],["reset",()=>import("./reset-XITFRWII.js")],["cancel",()=>import("./cancel-HHW2G675.js")],["wontfix",()=>import("./wontfix-JBPCNL6S.js")],["reopen",()=>import("./reopen-3NA6JI4N.js")],["review",()=>import("./review-UVYK4M4T.js")],["delegate",()=>import("./delegate-FVHPWQS7.js")],["followup",()=>import("./followup-XKVSZT2H.js")],["learn",()=>import("./learn-SRDLP7B5.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=S(),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-SRCNQJ4V.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 j(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,g=[];for(let k of n)k.startsWith("--name=")?(s=k.slice(7),h=!0):k.startsWith("-")||g.push(k);if(h)a.push(...g);else if(g.length>=1){let k=g[0];ie(k)?a.push(...g):(s=k,a.push(...g.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,g=2;for(;;){if(ee.has(h)){h=`${s}-${g}`,g++;continue}let k=`${t}/${b.specDir(h)}`;try{await D.fs.stat(k),h=`${s}-${g}`,g++}catch{break}}s=h}if(s===null||s.length===0)return e.writeln(p("Error: description is required.")),e.writeln(c("Example: "),m(`${S()} 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(`${S()} 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 \`${S()} reset --spec=${s}\` first.`)),await e.close(),d({exitCode:1})}catch{}let A=T(),f=z(A,s,i,l),P=await U(t),V=J(f,"IDLE","DISCOVERY",P);return o!==null&&(V={...f,discovery:{...f.discovery,planPath:o}}),await D.fs.mkdir(`${t}/${b.specDir(s)}`,{recursive:!0}),await C(t,s,V),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 j(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=M(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${S()} 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_REVIEW")return e.writeln(p(`Cannot split spec in phase ${a.phase}. Must be in DISCOVERY or DISCOVERY_REVIEW.`)),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(g=>f.relevantAnswers.includes(g.questionId)),h=z(T(),f.name,`spec/${f.name}`);for(let g of q)h=N(h,g.questionId,g.answer);h=F(h),await C(t,f.name,h),u.push(f.name)}let A=L(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=z(T(),i.name,`spec/${i.name}`);for(let P of a.discovery.answers)f=N(f,P.questionId,P.answer);f=F(f),await C(t,i.name,f),l.push(i.name)}let r=L(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 j(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=M(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${S()} 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_REVIEW"||o.phase==="SPEC_DRAFT"||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 \`${S()} 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: ${S()} 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 ${W(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: ${S()} 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: ${S()} 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 ${W(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: ${S()} 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: ${S()} 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 ${W(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: ${S()} 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};
|
|
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 W,h as U}from"./chunk-L32KHQVT.js";import{b as z,g as N,h as F,p as L,r as H,s as J,t as Q,u as _}from"./chunk-BAVRVBBX.js";import{A as j,B as R,a as T,c as b,e as E,f as M,j as C,k as K}from"./chunk-LOZLXP5G.js";import{b as S,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-ZR6B35KN.js")],["approve",()=>import("./approve-7QQFUQ2C.js")],["done",()=>import("./done-QSQ7AMLP.js")],["block",()=>import("./block-4ISSYCGQ.js")],["reset",()=>import("./reset-F25OLGX7.js")],["cancel",()=>import("./cancel-ZRTVX5AT.js")],["wontfix",()=>import("./wontfix-SLHYAWS7.js")],["reopen",()=>import("./reopen-KFHUPFTT.js")],["review",()=>import("./review-ITFNV2TI.js")],["delegate",()=>import("./delegate-EBL5HMGD.js")],["followup",()=>import("./followup-EMQ3ZNNS.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=S(),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-KEARGELM.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 j(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,g=[];for(let k of n)k.startsWith("--name=")?(s=k.slice(7),h=!0):k.startsWith("-")||g.push(k);if(h)a.push(...g);else if(g.length>=1){let k=g[0];ie(k)?a.push(...g):(s=k,a.push(...g.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,g=2;for(;;){if(ee.has(h)){h=`${s}-${g}`,g++;continue}let k=`${t}/${b.specDir(h)}`;try{await D.fs.stat(k),h=`${s}-${g}`,g++}catch{break}}s=h}if(s===null||s.length===0)return e.writeln(p("Error: description is required.")),e.writeln(c("Example: "),m(`${S()} 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(`${S()} 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 \`${S()} reset --spec=${s}\` first.`)),await e.close(),d({exitCode:1})}catch{}let A=T(),f=z(A,s,i,l),P=await U(t),V=J(f,"IDLE","DISCOVERY",P);return o!==null&&(V={...f,discovery:{...f.discovery,planPath:o}}),await D.fs.mkdir(`${t}/${b.specDir(s)}`,{recursive:!0}),await C(t,s,V),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 j(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=M(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${S()} 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_REVIEW")return e.writeln(p(`Cannot split spec in phase ${a.phase}. Must be in DISCOVERY or DISCOVERY_REVIEW.`)),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(g=>f.relevantAnswers.includes(g.questionId)),h=z(T(),f.name,`spec/${f.name}`);for(let g of q)h=N(h,g.questionId,g.answer);h=F(h),await C(t,f.name,h),u.push(f.name)}let A=L(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=z(T(),i.name,`spec/${i.name}`);for(let P of a.discovery.answers)f=N(f,P.questionId,P.answer);f=F(f),await C(t,i.name,f),l.push(i.name)}let r=L(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 j(t))return e.writeln(p("noskills is not initialized.")," Run: ",m(I("init"))),await e.close(),d({exitCode:1});let s=M(n??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),m(`${S()} 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_REVIEW"||o.phase==="SPEC_DRAFT"||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 \`${S()} 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: ${S()} 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 ${W(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: ${S()} 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: ${S()} 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 ${W(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: ${S()} 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: ${S()} 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 ${W(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: ${S()} 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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as R}from"./chunk-
|
|
2
|
+
import{a as R}from"./chunk-KI6473LF.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 M=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 V=b(g),e=await I(n,V),t=await x(n),j={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW"?{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(N=>t!==null&&t.concerns.includes(N.id)),T=await O(n),$=S(t?.tools??[]),F=await R(e,a,T,t,void 0,void 0,void 0,$);return await w({...j,...F},"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_REVIEW")&&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{M 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-OQ4CKFY7.js")).main(e)};export{l as main};
|