noskills 4.5.1 → 5.0.0

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.
Files changed (223) hide show
  1. package/README.md +497 -18
  2. package/noskills.js +145 -1
  3. package/package.json +14 -1
  4. package/{chunks/ajan-bridge-T5M4DPDT.js → ts/chunks/ajan-bridge-6UUIUFAV.js} +1 -1
  5. package/ts/chunks/anthropic-ICVQ5GK6.js +1 -0
  6. package/ts/chunks/approve-R7MCYHCS.js +1 -0
  7. package/ts/chunks/ask-GBLFPNFX.js +2 -0
  8. package/ts/chunks/block-YEKLMXHR.js +1 -0
  9. package/ts/chunks/cancel-7NS4WM2N.js +1 -0
  10. package/ts/chunks/chunk-2CLD527I.js +1 -0
  11. package/ts/chunks/chunk-34AWV7DB.js +1 -0
  12. package/ts/chunks/chunk-3M26Y3NG.js +27 -0
  13. package/{chunks/chunk-KM64FL2X.js → ts/chunks/chunk-3QVRJO3V.js} +1 -1
  14. package/ts/chunks/chunk-5ALJRBMW.js +22 -0
  15. package/ts/chunks/chunk-5NMDE2VZ.js +4 -0
  16. package/ts/chunks/chunk-6BKTY7SA.js +4 -0
  17. package/ts/chunks/chunk-6M7PCVUR.js +1 -0
  18. package/ts/chunks/chunk-6O2RXYTM.js +3 -0
  19. package/ts/chunks/chunk-7DIQYKPL.js +3 -0
  20. package/ts/chunks/chunk-7J6R2D2K.js +2 -0
  21. package/ts/chunks/chunk-ATNTR7M5.js +1 -0
  22. package/ts/chunks/chunk-AW3XJGEP.js +1 -0
  23. package/ts/chunks/chunk-BRC46A3N.js +39 -0
  24. package/ts/chunks/chunk-C5LYQDQH.js +368 -0
  25. package/ts/chunks/chunk-CCYWFSXR.js +3 -0
  26. package/{chunks/chunk-OAWYVETM.js → ts/chunks/chunk-CL55MNGD.js} +1 -1
  27. package/ts/chunks/chunk-CSP2GUD4.js +29 -0
  28. package/{chunks/chunk-EROZRDGT.js → ts/chunks/chunk-D2UKX2VW.js} +1 -1
  29. package/ts/chunks/chunk-DGYDUGTM.js +1 -0
  30. package/ts/chunks/chunk-FB3Z7XYQ.js +1 -0
  31. package/ts/chunks/chunk-FLLYK5FU.js +1 -0
  32. package/{chunks/chunk-EJYSOUEA.js → ts/chunks/chunk-GCPGG4YB.js} +1 -1
  33. package/{chunks/chunk-LN4NDYT6.js → ts/chunks/chunk-HLDPASM6.js} +1 -1
  34. package/ts/chunks/chunk-HNQA5O2S.js +2 -0
  35. package/ts/chunks/chunk-HUP7XWW6.js +1 -0
  36. package/ts/chunks/chunk-J3XNDEMU.js +4 -0
  37. package/ts/chunks/chunk-K6FVY52W.js +5 -0
  38. package/ts/chunks/chunk-KQJGXVWX.js +91 -0
  39. package/ts/chunks/chunk-M4U4Y3XQ.js +7 -0
  40. package/ts/chunks/chunk-M6CAJL36.js +1 -0
  41. package/ts/chunks/chunk-MPHTBN7E.js +1 -0
  42. package/ts/chunks/chunk-NYIFCLEG.js +1 -0
  43. package/ts/chunks/chunk-RRDWQKZY.js +1 -0
  44. package/ts/chunks/chunk-RVNSKPFL.js +1 -0
  45. package/ts/chunks/chunk-S5F2DAAG.js +5 -0
  46. package/ts/chunks/chunk-SCYP2G2T.js +3 -0
  47. package/ts/chunks/chunk-SWP6BJR6.js +147 -0
  48. package/{chunks/chunk-XDRX4ZBJ.js → ts/chunks/chunk-SWRVSRYY.js} +1 -1
  49. package/ts/chunks/chunk-T2X4E35X.js +1 -0
  50. package/ts/chunks/chunk-TDLTCTV4.js +1 -0
  51. package/ts/chunks/chunk-TKBGNLNV.js +1 -0
  52. package/ts/chunks/chunk-UY4YFVSW.js +3 -0
  53. package/ts/chunks/chunk-V5ZXCJPI.js +2 -0
  54. package/ts/chunks/chunk-W46BJM2F.js +1 -0
  55. package/ts/chunks/chunk-W7KQFMHV.js +1 -0
  56. package/ts/chunks/chunk-XGRZPTAD.js +24 -0
  57. package/ts/chunks/chunk-XTQFSF6C.js +1 -0
  58. package/ts/chunks/chunk-YN3SHWBR.js +1 -0
  59. package/ts/chunks/chunk-ZAY6LSJD.js +2 -0
  60. package/ts/chunks/chunk-ZGVXR3EC.js +8 -0
  61. package/ts/chunks/chunk-ZW5C5IGT.js +32 -0
  62. package/ts/chunks/claude-code-J2V5WSGZ.js +1 -0
  63. package/ts/chunks/concern-EDWQHU4H.js +1 -0
  64. package/ts/chunks/config-E7BDBHPK.js +1 -0
  65. package/ts/chunks/decision-ledger-5QXKZSV2.js +1 -0
  66. package/ts/chunks/delegate-LVQQ3GCV.js +1 -0
  67. package/ts/chunks/diagrams-2F5ZYXA7.js +1 -0
  68. package/ts/chunks/diagrams-H62JGTIS.js +1 -0
  69. package/ts/chunks/done-U3TOSZIX.js +1 -0
  70. package/ts/chunks/followup-J2HJU3ZT.js +1 -0
  71. package/ts/chunks/free-73WMLMCT.js +1 -0
  72. package/ts/chunks/gemini-GA6P4M7D.js +1 -0
  73. package/ts/chunks/init-6CVDGRY2.js +1 -0
  74. package/ts/chunks/invoke-hook-2TMKWL7I.js +15 -0
  75. package/ts/chunks/kiro-BJSKSAUC.js +1 -0
  76. package/ts/chunks/learn-7Q2VWZMI.js +7 -0
  77. package/ts/chunks/ledger-XR4AHZRX.js +2 -0
  78. package/ts/chunks/list-CUQCPXZH.js +1 -0
  79. package/ts/chunks/manager-WTLJ5C2I.js +3 -0
  80. package/ts/chunks/mod-BZA5TFW7.js +1 -0
  81. package/ts/chunks/mod-RWA5ZPYH.js +1 -0
  82. package/ts/chunks/mod-X372UNSQ.js +1 -0
  83. package/ts/chunks/mod-XVE4ZWPY.js +1 -0
  84. package/ts/chunks/next-CEYZSYGB.js +20 -0
  85. package/ts/chunks/node-33JV5VS3.js +15 -0
  86. package/ts/chunks/node-XYP2DQHR.js +74 -0
  87. package/ts/chunks/node-ZSGIX7K3.js +1 -0
  88. package/ts/chunks/ollama-X6OGN5BW.js +1 -0
  89. package/ts/chunks/openai-TV7KLQ2C.js +1 -0
  90. package/ts/chunks/openai-YPM2E7QS.js +30 -0
  91. package/ts/chunks/opencode-AK6WWZRF.js +1 -0
  92. package/ts/chunks/pack-EOUSZGJT.js +5 -0
  93. package/ts/chunks/plan-export-ZBINRAAS.js +3 -0
  94. package/ts/chunks/purge-GPMC5A6Y.js +5 -0
  95. package/ts/chunks/reopen-LPVNZN5I.js +1 -0
  96. package/ts/chunks/reset-RNLPXGWQ.js +1 -0
  97. package/ts/chunks/review-ZGAY5XCN.js +1 -0
  98. package/ts/chunks/rule-SNBQ4VZD.js +6 -0
  99. package/ts/chunks/run-4TDP4C7Z.js +3 -0
  100. package/ts/chunks/sdk-MEVPL5WT.js +1 -0
  101. package/ts/chunks/session-J7TSLNEH.js +1 -0
  102. package/ts/chunks/spec-3NSPFDIC.js +1 -0
  103. package/ts/chunks/status-DIEA2OGR.js +1 -0
  104. package/ts/chunks/sync-HZNKILSP.js +1 -0
  105. package/ts/chunks/validate-MWHDOF2F.js +1 -0
  106. package/ts/chunks/vertexai-ARXI4AMJ.js +1 -0
  107. package/ts/chunks/watch-P6HABMAS.js +7 -0
  108. package/ts/chunks/web-BMIC3VJQ.js +1 -0
  109. package/ts/chunks/wontfix-6UKEYTVB.js +1 -0
  110. package/ts/noskills.js +2 -0
  111. package/chunks/anthropic-TS7EMQML.js +0 -1
  112. package/chunks/approve-HEW3VFYH.js +0 -1
  113. package/chunks/ask-AXHTCVD6.js +0 -2
  114. package/chunks/block-VN76CXZW.js +0 -1
  115. package/chunks/browser-BGFD24RX.js +0 -1
  116. package/chunks/bun-WZ7BVR7Y.js +0 -1
  117. package/chunks/cancel-7WRAST62.js +0 -1
  118. package/chunks/chunk-3ZJ3UGQL.js +0 -48
  119. package/chunks/chunk-4PF2MT7S.js +0 -29
  120. package/chunks/chunk-575Y3OEG.js +0 -1
  121. package/chunks/chunk-5DZHAHXW.js +0 -110
  122. package/chunks/chunk-5PBNUBBY.js +0 -3
  123. package/chunks/chunk-5RLCKUIF.js +0 -2
  124. package/chunks/chunk-6YSS6PEL.js +0 -3
  125. package/chunks/chunk-7GC46XEU.js +0 -1
  126. package/chunks/chunk-7PPUGTKL.js +0 -4
  127. package/chunks/chunk-AUZWXMWA.js +0 -27
  128. package/chunks/chunk-CH6A3LES.js +0 -91
  129. package/chunks/chunk-CML74SNT.js +0 -3
  130. package/chunks/chunk-CTTMQSHF.js +0 -1
  131. package/chunks/chunk-DBKXMYLF.js +0 -4
  132. package/chunks/chunk-DEHRWREM.js +0 -1
  133. package/chunks/chunk-EIGFDYGQ.js +0 -1
  134. package/chunks/chunk-EIMBEXUJ.js +0 -1
  135. package/chunks/chunk-ENP4P2YH.js +0 -0
  136. package/chunks/chunk-FE4MKOI4.js +0 -1
  137. package/chunks/chunk-GQTHILPL.js +0 -5
  138. package/chunks/chunk-IFE5SYGK.js +0 -1
  139. package/chunks/chunk-IGDFEGCH.js +0 -2
  140. package/chunks/chunk-JL3MAFYQ.js +0 -1
  141. package/chunks/chunk-JYVB6UAV.js +0 -1
  142. package/chunks/chunk-KJLEPI7T.js +0 -1
  143. package/chunks/chunk-KMLNG3EC.js +0 -1
  144. package/chunks/chunk-KRKOWSYW.js +0 -148
  145. package/chunks/chunk-KRRPOVQG.js +0 -1
  146. package/chunks/chunk-LJEWPIEI.js +0 -1
  147. package/chunks/chunk-NGCBWJML.js +0 -2
  148. package/chunks/chunk-O4KKKYCH.js +0 -1
  149. package/chunks/chunk-PKEQKXZW.js +0 -23
  150. package/chunks/chunk-PRQ5CRIG.js +0 -1
  151. package/chunks/chunk-PSX63TYP.js +0 -2
  152. package/chunks/chunk-Q4TI7EYT.js +0 -5
  153. package/chunks/chunk-QKWJ72HI.js +0 -3
  154. package/chunks/chunk-RAQY37P6.js +0 -1
  155. package/chunks/chunk-S4MUTKHT.js +0 -4
  156. package/chunks/chunk-SLO22P65.js +0 -1
  157. package/chunks/chunk-UE56BMAW.js +0 -21
  158. package/chunks/chunk-VJRCTYGL.js +0 -1
  159. package/chunks/chunk-VXU6XZ66.js +0 -39
  160. package/chunks/chunk-W4TQLLUK.js +0 -7
  161. package/chunks/chunk-Y5E7ZCCX.js +0 -1
  162. package/chunks/chunk-Z7OYXH3J.js +0 -1
  163. package/chunks/claude-code-DIWRQKZA.js +0 -1
  164. package/chunks/cmd-46ZIHXLB.js +0 -1
  165. package/chunks/concern-QSENGU6C.js +0 -1
  166. package/chunks/config-S3UXTJN2.js +0 -1
  167. package/chunks/decision-ledger-GY2W6VWL.js +0 -1
  168. package/chunks/delegate-WKXIER7E.js +0 -1
  169. package/chunks/deno-YM5PW6ZM.js +0 -1
  170. package/chunks/diagrams-A7W2EBYV.js +0 -1
  171. package/chunks/diagrams-CBCUA47B.js +0 -1
  172. package/chunks/done-WR3UFYJT.js +0 -1
  173. package/chunks/followup-5EGZEF5Q.js +0 -1
  174. package/chunks/free-KJQHRYZA.js +0 -1
  175. package/chunks/gemini-IWP24T63.js +0 -1
  176. package/chunks/init-437SU6XH.js +0 -1
  177. package/chunks/invoke-hook-LMCWNF65.js +0 -13
  178. package/chunks/kiro-THWCXS5L.js +0 -1
  179. package/chunks/learn-ZTYKBZER.js +0 -7
  180. package/chunks/ledger-FOOPJ2UO.js +0 -1
  181. package/chunks/list-HNGIOVBK.js +0 -1
  182. package/chunks/loader-command-3A5FK2RF.js +0 -1
  183. package/chunks/loader-reactor-YZM7HO4G.js +0 -1
  184. package/chunks/manager-2MOLEJ4Q.js +0 -3
  185. package/chunks/mod-6EZYRKWV.js +0 -1
  186. package/chunks/mod-7VTKN6Q5.js +0 -1
  187. package/chunks/mod-7X5TKHKC.js +0 -1
  188. package/chunks/mod-AJIRKRAH.js +0 -1
  189. package/chunks/mod-SFSUQWSB.js +0 -8
  190. package/chunks/mod-TGOMO3CJ.js +0 -1
  191. package/chunks/next-Y6FOPM4Z.js +0 -15
  192. package/chunks/node-AZK2C657.js +0 -12
  193. package/chunks/node-GQQ42DT2.js +0 -68
  194. package/chunks/node-J4GTOSL2.js +0 -1
  195. package/chunks/ollama-2KAMCXVL.js +0 -1
  196. package/chunks/openai-HHE35TAX.js +0 -31
  197. package/chunks/openai-YES2XJDU.js +0 -1
  198. package/chunks/opencode-S4M7WJTO.js +0 -1
  199. package/chunks/pack-KUT53Z24.js +0 -5
  200. package/chunks/plan-export-PG2BVRQZ.js +0 -3
  201. package/chunks/purge-JGNJNEET.js +0 -4
  202. package/chunks/reopen-RPDXN3CF.js +0 -1
  203. package/chunks/reset-RBCQO2RF.js +0 -1
  204. package/chunks/review-VMS5MYOV.js +0 -1
  205. package/chunks/rule-IB4VKSBC.js +0 -6
  206. package/chunks/run-62PWXVII.js +0 -3
  207. package/chunks/sdk-FR7Z4YSC.js +0 -1
  208. package/chunks/session-Q43KMFL2.js +0 -1
  209. package/chunks/spec-4RKLPOEM.js +0 -1
  210. package/chunks/status-OGLFEFF7.js +0 -1
  211. package/chunks/sync-H35O5DN5.js +0 -1
  212. package/chunks/unstable_chmod-44MCKF3B.js +0 -1
  213. package/chunks/validate-JX7UTAK5.js +0 -1
  214. package/chunks/vertexai-WF5CKMYI.js +0 -1
  215. package/chunks/watch-SOZDHLSC.js +0 -8
  216. package/chunks/web-3VGRM3W4.js +0 -1
  217. package/chunks/wontfix-RBOGLLWJ.js +0 -1
  218. package/chunks/workerd-I7MLRCLJ.js +0 -1
  219. /package/{chunks → ts/chunks}/chunk-HISXAZ4Y.js +0 -0
  220. /package/{chunks → ts/chunks}/chunk-I4Z2RF7L.js +0 -0
  221. /package/{chunks → ts/chunks}/dist-3MH5UCQU.js +0 -0
  222. /package/{chunks → ts/chunks}/multipart-parser-DKDFOZKD.js +0 -0
  223. /package/{chunks → ts/chunks}/src-HXQVVTGQ.js +0 -0
@@ -1 +0,0 @@
1
- import{b as I,c as R}from"./chunk-IFE5SYGK.js";import{c as a,d as i,f as d,g as v,o as m,q as f,r as w}from"./chunk-VXU6XZ66.js";import{A as C,B as N,C as $,D as x,E as h,h as b,n as O,v as P,x as y,y as A}from"./chunk-KRKOWSYW.js";import{a as u,b as g}from"./chunk-OAWYVETM.js";import{i as E}from"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.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 +0,0 @@
1
- import{a as re}from"./chunk-DBKXMYLF.js";import{a as ie,d as G}from"./chunk-7PPUGTKL.js";import{g as z,h as N}from"./chunk-5RLCKUIF.js";import{A as K,L as ne,b as j,g as _,h as q,q as Y,s as ee,y as te,z as se}from"./chunk-UE56BMAW.js";import"./chunk-XDRX4ZBJ.js";import{b as g,c as T}from"./chunk-IFE5SYGK.js";import{c as f,d as c,f as p,g as R,h as O,k as B,o as v,q as y,r as $}from"./chunk-VXU6XZ66.js";import"./chunk-VJRCTYGL.js";import{i as H}from"./chunk-PKEQKXZW.js";import"./chunk-O4KKKYCH.js";import{D as M,E as P,b as F,f as C,h as b,i as V,m as k,n as J,o as Q,s as Z}from"./chunk-KRKOWSYW.js";import{a as u,b as d}from"./chunk-OAWYVETM.js";import{i as D}from"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";var ae=new Set(["new","list","help","next","approve","done","block","reset","cancel","wontfix","reopen","revisit","split","ac","task","note","review","delegate","followup","plan-export","ledger"]),ue=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"]),we=n=>n.replace(/(?:~|\.{1,2})?\/(?:[\w@.-]+\/)*[\w@.-]+/g," ").replace(/(?:[\w@.-]+\/){2,}[\w@.-]+/g," ").replace(/\s+/g," ").trim(),me=n=>{let a=we(n).toLowerCase().replace(/[^a-z0-9\s-]/g,"").split(/\s+/).filter(o=>o.length>0&&!ue.has(o)).slice(0,6).join("-");return a.length>50&&(a=a.slice(0,50).replace(/-[^-]*$/,"")),a=a.replace(/^-+|-+$/g,""),a||"spec"},fe=n=>n.includes(" ")||n.length>50,he=new Map([["next",()=>import("./next-Y6FOPM4Z.js")],["approve",()=>import("./approve-HEW3VFYH.js")],["done",()=>import("./done-WR3UFYJT.js")],["block",()=>import("./block-VN76CXZW.js")],["reset",()=>import("./reset-RBCQO2RF.js")],["cancel",()=>import("./cancel-7WRAST62.js")],["wontfix",()=>import("./wontfix-RBOGLLWJ.js")],["reopen",()=>import("./reopen-RPDXN3CF.js")],["review",()=>import("./review-VMS5MYOV.js")],["delegate",()=>import("./delegate-WKXIER7E.js")],["followup",()=>import("./followup-5EGZEF5Q.js")],["learn",()=>import("./learn-ZTYKBZER.js")],["plan-export",()=>import("./plan-export-PG2BVRQZ.js")],["ledger",()=>import("./ledger-FOOPJ2UO.js")]]);var je=async n=>{let t=n?.[0];if(t==="new")return await ge(n?.slice(1));if(t==="list")return await Se(n?.slice(1));if(t==="help"||t===void 0){let l=g(),r=v({renderer:$.ansi(),sink:y.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, ledger")),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(),u(void 0)}let e=t,s=n?.[1];if(s===void 0)return await(await import("./status-OGLFEFF7.js")).main([`--spec=${e}`]);if(s==="split")return await ye([`--spec=${e}`,...n?.slice(2)??[]]);if(s==="revisit")return await $e([`--spec=${e}`,...n?.slice(2)??[]]);if(s==="ac")return await Ce(e,n?.slice(2));if(s==="task")return await ke(e,n?.slice(2));if(s==="note")return await xe(e,n?.slice(2));let a=he.get(s);if(a!==void 0)return await(await a()).main([`--spec=${e}`,...n?.slice(2)??[]]);let o=v({renderer:$.ansi(),sink:y.stdout()});return o.writeln(p(`Unknown command: spec ${e} ${s}`)),o.writeln(c(" Valid: next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split, ac, task, note, ledger")),await o.close(),d({exitCode:1})},ge=async n=>{let t=v({renderer:$.ansi(),sink:y.stdout()}),{root:e}=await P();if(!await M(e))return t.writeln(p("noskills is not initialized.")," Run: ",f(T("init"))),await t.close(),d({exitCode:1});let s=null,a=[];if(n!==void 0){let h=!1,S=[];for(let E of n)E.startsWith("--name=")?(s=E.slice(7),h=!0):E.startsWith("-")||S.push(E);if(h)a.push(...S);else if(S.length>=1){let E=S[0];fe(E)?a.push(...S):(s=E,a.push(...S.slice(1)))}}let o=null;if(n!==void 0)for(let h of n)h.startsWith("--from-plan=")&&(o=h.slice(12));let l=a.join(" ");if((s===null||s.length===0)&&l.length>0){s=me(l);let h=s,S=2;for(;;){if(ae.has(h)){h=`${s}-${S}`,S++;continue}let E=`${e}/${C.specDir(h)}`;try{await D.fs.stat(E),h=`${s}-${S}`,S++}catch{break}}s=h}if(s===null||s.length===0){let h={phase:"IDLE",action:"spec-new-interactive",instruction:"Ask the user what they want to build. Accept any input \u2014 one sentence, detailed requirements, meeting notes, a Linear task. Then call spec new again with their description.",prompt:"What do you want to build?"};return await t.close(),await G(h,"json"),u(void 0)}if(ae.has(s))return t.writeln(p(`"${s}" is a reserved name.`),c(" Choose a different spec name.")),await t.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 t.writeln(p("Invalid spec name: "),f(s)),t.writeln(c("Must be lowercase, hyphens, numbers only. Max 50 chars. Regex: /^[a-z0-9][a-z0-9-]*[a-z0-9]$/")),await t.close(),d({exitCode:1});if(l.length===0)return t.writeln(p("Please provide a description: "),f(`${g()} spec new "Add photo upload support"`)),await t.close(),d({exitCode:1});if(o!==null)try{if((await D.fs.stat(o)).size>50*1024)return t.writeln(p("Plan file too large. Maximum 50KB.")),await t.close(),d({exitCode:1})}catch{return t.writeln(p(`Plan file not found: ${o}`)),await t.close(),d({exitCode:1})}let i=`spec/${s}`,w=`${e}/${C.specDir(s)}`;try{return await D.fs.stat(w),t.writeln(p(`Spec "${s}" already exists.`),c(` Use a different --name or run \`${g()} reset --spec=${s}\` first.`)),await t.close(),d({exitCode:1})}catch{}let A=F(),m=j(A,s,i,l),x=await N(e),L=te(m,"IDLE","DISCOVERY",x);o!==null&&(L={...m,discovery:{...m.discovery,planPath:o}}),await D.fs.mkdir(`${e}/${C.specDir(s)}`,{recursive:!0});let I=await Z(e),U=await Q(e),oe=I.filter(h=>U?.concerns.includes(h.id)??!1),le=new Date,ce={name:x?.name??"unknown",email:x?.email??""},W=H({specName:s,activeConcerns:oe,classification:null,creator:ce,now:le}),pe=`${e}/${C.specFile(s)}`;await D.fs.writeTextFile(pe,W.content);let de={...L,specState:{path:C.specFile(s),status:"draft",metadata:W.metadata,placeholders:W.placeholders}};return await k(e,s,de),await re(e,{ts:new Date().toISOString(),type:"spec-created",spec:s,user:x?.name??"unknown",description:l??""}),t.writeln(R("\u2714")," Spec started: ",f(s)),t.writeln(" Directory: ",c(C.specDir(s))),t.writeln(" Branch: ",c(i)),t.writeln(" Phase: ",O("DISCOVERY")),o!==null&&t.writeln(" Plan: ",c(o)),t.writeln(""),t.writeln("Run ",f(T(`next --spec=${s}`))," to begin discovery questions."),await t.close(),u(void 0)},Se=async n=>{let{root:t}=await P(),e=ie(n),s=await J(t),a=`${t}/${C.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(e==="json")return await G(l,"json"),u(void 0);let r=v({renderer:$.ansi(),sink:y.stdout()});if(r.writeln(f("Specs")),r.writeln(""),l.length===0)r.writeln(c(" No specs yet."));else for(let i of l){let w=i.phase==="COMPLETED"?R(i.phase):i.phase==="EXECUTING"?B(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," ",w,A)}return await r.close(),u(void 0)},ve=n=>{let t=[],e=0;for(;e<n.length;)if(n[e]==="--into"&&e+1<n.length){let s=n[e+1],a=s;e+2<n.length&&!n[e+2].startsWith("-")?(a=n[e+2],e+=3):e+=2,t.push({name:s,description:a})}else e+=1;return t},ye=async n=>{let t=v({renderer:$.ansi(),sink:y.stdout()}),{root:e}=await P();if(!await M(e))return t.writeln(p("noskills is not initialized.")," Run: ",f(T("init"))),await t.close(),d({exitCode:1});let s=V(n??[]);if(s===null)return t.writeln(p("Error: --spec=<name> is required.")),t.writeln(c("Example: "),f(`${g()} spec split --spec=parent --into name1 "desc1" --into name2 "desc2"`)),await t.close(),d({exitCode:1});let a;try{a=await b(e,s)}catch(i){let w=i instanceof Error?i.message:String(i);return t.writeln(p(`Error: ${w}`)),await t.close(),d({exitCode:1})}if(a.phase!=="DISCOVERY"&&a.phase!=="DISCOVERY_REFINEMENT")return t.writeln(p(`Cannot split spec in phase ${a.phase}. Must be in DISCOVERY or DISCOVERY_REFINEMENT.`)),await t.close(),d({exitCode:1});let o=ve(n??[]);if(o.length<2){let i=ne(a.discovery.answers);if(!i.detected||i.proposals.length<2)return t.writeln(p("Error: at least 2 --into entries required, or discovery answers must contain 2+ independent areas.")),await t.close(),d({exitCode:1});let w=[];for(let m of i.proposals){let x=`${e}/${C.specDir(m.name)}`;await D.fs.mkdir(x,{recursive:!0});let X=a.discovery.answers.filter(U=>m.relevantAnswers.includes(U.questionId)),I=j(F(),m.name,`spec/${m.name}`);for(let U of X)I=_(I,U.questionId,U.answer);I=q(I),await k(e,m.name,I),w.push(m.name)}let A=Y(a,"cancelled",`Split into: ${w.join(", ")}`);await k(e,s,A),t.writeln(R("Split complete."),` Created ${w.length} sub-specs:`);for(let m of w)t.writeln(" ",c("\u25CB")," ",f(m));return t.writeln("",c(`Parent spec "${s}" cancelled.`)),await t.close(),u(void 0)}let l=[];for(let i of o){let w=`${e}/${C.specDir(i.name)}`;await D.fs.mkdir(w,{recursive:!0});let m=j(F(),i.name,`spec/${i.name}`);for(let x of a.discovery.answers)m=_(m,x.questionId,x.answer);m=q(m),await k(e,i.name,m),l.push(i.name)}let r=Y(a,"cancelled",`Split into: ${l.join(", ")}`);await k(e,s,r),t.writeln(R("Split complete."),` Created ${l.length} sub-specs:`);for(let i of l)t.writeln(" ",c("\u25CB")," ",f(i));return t.writeln("",c(`Parent spec "${s}" cancelled.`)),await t.close(),u(void 0)},$e=async n=>{let t=v({renderer:$.ansi(),sink:y.stdout()}),{root:e}=await P();if(!await M(e))return t.writeln(p("noskills is not initialized.")," Run: ",f(T("init"))),await t.close(),d({exitCode:1});let s=V(n??[]);if(s===null)return t.writeln(p("Error: --spec=<name> is required.")),t.writeln(c("Example: "),f(`${g()} spec revisit --spec=my-spec "reason for revisit"`)),await t.close(),d({exitCode:1});let a=(n??[]).find(i=>!i.startsWith("--")&&i!==s);if(a===void 0||a.trim().length===0)return t.writeln(p('Error: Reason is required: noskills spec revisit --spec=X "reason"')),await t.close(),d({exitCode:1});let o;try{o=await b(e,s)}catch(i){let w=i instanceof Error?i.message:String(i);return t.writeln(p(`Error: ${w}`)),await t.close(),d({exitCode:1})}if(o.phase==="DISCOVERY"||o.phase==="DISCOVERY_REFINEMENT"||o.phase==="SPEC_PROPOSAL"||o.phase==="SPEC_APPROVED")return t.writeln(p("Already in planning phase, no need to revisit.")),await t.close(),d({exitCode:1});if(o.phase==="COMPLETED")return t.writeln(p(`Spec is completed. Use \`${g()} reopen --spec=${s}\` instead.`)),await t.close(),d({exitCode:1});if(o.phase==="IDLE")return t.writeln(p("No active spec to revisit.")),await t.close(),d({exitCode:1});let l=o.execution.completedTasks.length,r=ee(o,a.trim());return await k(e,s,r),t.writeln(R("Revisit complete.")),t.writeln(" Phase: ",f("DISCOVERY"),c(` (revisited from ${o.phase})`)),l>0&&t.writeln(" Previous progress: ",f(`${l} tasks completed`)),t.writeln(" Reason: ",c(`"${a.trim()}"`)),t.writeln(" Discovery answers preserved \u2014 revise or re-approve."),await t.close(),u(void 0)},Ce=async(n,t)=>{let e=v({renderer:$.ansi(),sink:y.stdout()}),{root:s}=await P(),a=t?.[0];if(n===void 0||a===void 0)return e.writeln(`Usage: ${g()} spec <name> ac <add "text" | list>`),await e.close(),u(void 0);if(a==="add"){let o=(t?.slice(1)??[]).filter(w=>!w.startsWith("-")).join(" ");if(o.length===0)return e.writeln(p("Please provide AC text.")),await e.close(),d({exitCode:1});let l=await b(s,n),r=await N(s);l.phase==="EXECUTING"&&e.writeln(O("Warning: Adding ACs during execution is scope creep."));let i=se(l,o,r);return await k(s,n,i),e.writeln(R("AC added: "),`"${o}"`,c(` (by ${z(r)})`)),await e.close(),u(void 0)}if(a==="list"){let l=(await b(s,n)).customACs??[];if(e.writeln(f(`Custom ACs for ${n}`)),e.writeln(""),l.length===0)e.writeln(c(" No custom ACs."));else for(let r of l)e.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.addedInPhase}`));return await e.close(),u(void 0)}return e.writeln(`Usage: ${g()} spec <name> ac <add "text" | list>`),await e.close(),u(void 0)},ke=async(n,t)=>{let e=v({renderer:$.ansi(),sink:y.stdout()}),{root:s}=await P(),a=t?.[0];if(n===void 0||a===void 0)return e.writeln(`Usage: ${g()} spec <name> task <add "text" | list>`),await e.close(),u(void 0);if(a==="add"){let o=(t?.slice(1)??[]).filter(w=>!w.startsWith("-")).join(" ");if(o.length===0)return e.writeln(p("Please provide task text.")),await e.close(),d({exitCode:1});let l=await b(s,n);if(l.phase==="EXECUTING"||l.phase==="BLOCKED")return e.writeln(p("Cannot add tasks during execution. Use `spec revisit` to go back to discovery.")),await e.close(),d({exitCode:1});let r=await N(s),i=K(l,`[TASK] ${o}`,r);return await k(s,n,i),e.writeln(R("Task added: "),`"${o}"`,c(` (by ${z(r)})`)),await e.close(),u(void 0)}if(a==="list"){let l=((await b(s,n)).specNotes??[]).filter(r=>r.text.startsWith("[TASK] "));if(e.writeln(f(`Custom tasks for ${n}`)),e.writeln(""),l.length===0)e.writeln(c(" No custom tasks."));else for(let r of l)e.writeln(` - ${r.text.replace("[TASK] ","")}`,c(` -- ${r.user}, ${r.phase}`));return await e.close(),u(void 0)}return e.writeln(`Usage: ${g()} spec <name> task <add "text" | list>`),await e.close(),u(void 0)},xe=async(n,t)=>{let e=v({renderer:$.ansi(),sink:y.stdout()}),{root:s}=await P(),a=t?.[0];if(n===void 0||a===void 0)return e.writeln(`Usage: ${g()} spec <name> note <add "text" | list>`),await e.close(),u(void 0);if(a==="add"){let o=(t?.slice(1)??[]).filter(w=>!w.startsWith("-")).join(" ");if(o.length===0)return e.writeln(p("Please provide note text.")),await e.close(),d({exitCode:1});let l=await b(s,n),r=await N(s),i=K(l,o,r);return await k(s,n,i),e.writeln(R("Note added: "),`"${o}"`,c(` (by ${z(r)})`)),await e.close(),u(void 0)}if(a==="list"){let l=((await b(s,n)).specNotes??[]).filter(r=>!r.text.startsWith("[TASK] "));if(e.writeln(f(`Notes for ${n}`)),e.writeln(""),l.length===0)e.writeln(c(" No notes."));else for(let r of l)e.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.phase}`));return await e.close(),u(void 0)}return e.writeln(`Usage: ${g()} spec <name> note <add "text" | list>`),await e.close(),u(void 0)};export{ae as RESERVED_NAMES,fe as looksLikeDescription,je as main,me as slugFromDescription};
@@ -1 +0,0 @@
1
- import{b as k,e as O}from"./chunk-5DZHAHXW.js";import{a as S,d as w}from"./chunk-7PPUGTKL.js";import{N as R}from"./chunk-UE56BMAW.js";import"./chunk-XDRX4ZBJ.js";import{c as h}from"./chunk-IFE5SYGK.js";import{c as i,d as r,f as c,g as C,h as p,k as y,o as d,q as u,r as m}from"./chunk-VXU6XZ66.js";import{a as f}from"./chunk-VJRCTYGL.js";import"./chunk-PKEQKXZW.js";import"./chunk-O4KKKYCH.js";import{D as v,E as P,h as I,i as b,o as x,s as D}from"./chunk-KRKOWSYW.js";import{a as l,b as E}from"./chunk-OAWYVETM.js";import"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";var K=async g=>{let{root:n}=await P(),o=S(g);if(!await v(n)){if(o==="json")await w({error:"noskills is not initialized"},o);else{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(c("noskills is not initialized.")," Run: ",i(h("init"))),await s.close()}return E({exitCode:1})}let N=b(g),e=await I(n,N),t=await x(n),T={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REFINEMENT"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length};if(o==="json"){let a=(await D(n)).filter(V=>t!==null&&t.concerns.includes(V.id)),F=await k(n),j=O(t?.tools??[]),$=await R(e,a,F,t,void 0,void 0,void 0,j);return await w({...T,...$},"json"),l(void 0)}{let s=d({renderer:m.ansi(),sink:u.stdout()});s.writeln(i(`${h("status")}`)),s.writeln("");let a=e.phase==="COMPLETED"?C(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?y(e.phase):p(e.phase);s.writeln(" Phase: ",a),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),(e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REFINEMENT")&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(p(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),await s.close()}return l(void 0)};export{K as main};
@@ -1 +0,0 @@
1
- import{d as t,o as i,q as r,r as n}from"./chunk-VXU6XZ66.js";import"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.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-437SU6XH.js")).main(e)};export{l as main};
@@ -1 +0,0 @@
1
- import"./chunk-HISXAZ4Y.js";var r=globalThis.navigator?.userAgent?.includes("Deno");function s(){return globalThis.process.getBuiltinModule("node:fs")}var c=r?Deno.errors.AlreadyExists:class extends Error{},d=r?Deno.errors.BadResource:class extends Error{},E=r?Deno.errors.BrokenPipe:class extends Error{},y=r?Deno.errors.Busy:class extends Error{},B=r?Deno.errors.Interrupted:class extends Error{},T=r?Deno.errors.InvalidData:class extends Error{},a=r?Deno.errors.NotFound:class extends Error{},P=r?Deno.errors.PermissionDenied:class extends Error{},F=r?Deno.errors.TimedOut:class extends Error{},S=r?Deno.errors.UnexpectedEof:class extends Error{},O=r?Deno.errors.WriteZero:class extends Error{};function n(e){return o=>Object.assign(new e(o.message),{stack:o.stack})}var l={EEXIST:n(c),ENOENT:n(a),EBADF:n(d)};function p(e){return e instanceof Error&&"code"in e}function i(e){return p(e)&&l[e.code]?.(e)||e}async function W(e,o){if(r)await Deno.chmod(e,o);else try{await s().promises.chmod(e,o)}catch(t){throw i(t)}}function Z(e,o){if(r)Deno.chmodSync(e,o);else try{s().chmodSync(e,o)}catch(t){throw i(t)}}export{W as chmod,Z as chmodSync};
@@ -1 +0,0 @@
1
- import{b as a}from"./chunk-IFE5SYGK.js";import{c,d as r,f as o,g as u,h as p,o as m,q as f,r as w}from"./chunk-VXU6XZ66.js";import{f as g}from"./chunk-PKEQKXZW.js";import{E as h,l as v}from"./chunk-KRKOWSYW.js";import{a as d,b as i}from"./chunk-OAWYVETM.js";import"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";var D=async $=>{let e=m({renderer:w.ansi(),sink:f.stdout()}),{root:S}=await h(),s=($??[])[0]??null;if(s===null)return e.writeln(o("Error: spec name is required.")),e.writeln(r(`Usage: ${a()} validate <spec-name>`)),await e.close(),i({exitCode:1});let l;try{l=await v(S,s)}catch{return e.writeln(o(`Spec "${s}" not found.`)),e.writeln(r(`Run \`${a()} spec list\` to see available specs.`)),await e.close(),i({exitCode:1})}if(l===null)return e.writeln(o(`No state found for spec "${s}".`)),await e.close(),i({exitCode:1});let n=g(l.specState),x=l.specState.placeholders.filter(t=>t.status!=="conditional-hidden");if(n.canAdvance)return e.writeln(u("\u2713")," ",c(s),`: all ${x.length} sections resolved`),await e.close(),d(void 0);if(e.writeln(o("\u2717")," ",c(s),`: ${n.unresolvedSections.length} unresolved, ${n.pendingDecisions.length} pending decisions`),n.unresolvedSections.length>0){e.writeln(""),e.writeln(p("Unresolved sections:"));for(let t of n.unresolvedSections)e.writeln(" - ",t.sectionTitle)}if(n.pendingDecisions.length>0){e.writeln(""),e.writeln(p("Pending decisions:"));for(let t of n.pendingDecisions)e.writeln(" - ",`${t.section}: ${t.question}`,r(` (waiting for ${t.waitingFor.join(", ")})`))}return e.writeln(""),e.writeln(r(`Run \`${a()} spec ${s} next\` to fill remaining sections.`)),await e.close(),i({exitCode:1})};export{D as main};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-EIGFDYGQ.js";import"./chunk-PSX63TYP.js";import"./chunk-EJYSOUEA.js";import"./chunk-JYVB6UAV.js";import"./chunk-OAWYVETM.js";import"./chunk-HISXAZ4Y.js";export{a as VertexAIModel,b as vertexaiFactory};
@@ -1,8 +0,0 @@
1
- import{a as O,c as I}from"./chunk-7PPUGTKL.js";import{a as F,c as R}from"./chunk-EROZRDGT.js";import{D as v,E as L,f as E,g as x,n as P,o as D}from"./chunk-KRKOWSYW.js";import{a as y,b as C}from"./chunk-OAWYVETM.js";import{i as g}from"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";var N=async e=>{let t=await x(e),d=await D(e),l=await W(e),s=null,c=null,u=0,a=0;if(t.spec!==null){let i=await F(e,t.spec);if(i!==null){u=i.tasks.length,a=t.execution.completedTasks.length;let f=R(i.tasks,t.execution.completedTasks);f!==null&&(s=f.id,c=f.title)}}let p=null;t.lastCalledAt!==null&&(p=Math.floor((Date.now()-new Date(t.lastCalledAt).getTime())/1e3));let r=(await P(e)).map(i=>({name:i.name,phase:i.state.phase,iteration:i.state.execution.iteration}));return{spec:t.spec,phase:t.phase,iteration:t.execution.iteration,activeTaskId:s,activeTaskTitle:c,totalTasks:u,completedTaskCount:a,lastProgress:t.execution.lastProgress,lastCalledAt:t.lastCalledAt,modifiedFiles:t.execution.modifiedFiles,debt:t.execution.debt,concerns:d?.concerns??[],maxIterations:d?.maxIterationsBeforeRestart??15,awaitingStatusReport:t.execution.awaitingStatusReport,verificationPassed:t.execution.lastVerification?.passed??null,decisionsCount:t.decisions.length,discoveryAnswered:t.discovery.answers.length,discoveryTotal:6,trackedFiles:l,timeSinceUpdate:p,allSpecs:r}},W=async e=>{let t=`${e}/${E.progressesDir}/files-changed.jsonl`;try{let l=(await g.fs.readTextFile(t)).trim().split(`
2
- `).filter(Boolean),s=[];for(let c of l)try{let u=JSON.parse(c);s.includes(u.file)||s.push(u.file)}catch{}return s}catch{return[]}},B="\x1B[2J\x1B[H",b="\x1B[1m",m="\x1B[2m",o="\x1B[0m",T="\x1B[32m",k="\x1B[33m",w="\x1B[31m",A="\x1B[36m",S=e=>{switch(e){case"COMPLETED":return T;case"BLOCKED":return w;case"EXECUTING":return A;default:return k}},M=(e,t,d)=>{if(t===0)return"\u2591".repeat(d);let l=Math.min(e/t,1),s=Math.round(l*d);return"\u2588".repeat(s)+"\u2591".repeat(d-s)},U=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,j=e=>e.replace(/\x1b\[[0-9;]*m/g,""),K=(e,t)=>{let d=j(e).length;return e+" ".repeat(Math.max(0,t-d))},V=e=>{let t=[],l="\u2500".repeat(54),s=a=>`${m}\u2502${o} ${K(a,52)}${m}\u2502${o}`,c=()=>`${m}\u2502${"".padEnd(54)}\u2502${o}`;if(t.push(`${m}\u256D${l}\u256E${o}`),t.push(s(`${b}noskills watch${o}`)),t.push(c()),t.push(s(`${b}Specs:${o}`)),e.allSpecs.length>0)for(let a of e.allSpecs){let p=S(a.phase),n=a.name.slice(0,18).padEnd(18),r=`${p}${a.phase}${o}`.padEnd(a.phase.length+10);if(a.phase==="EXECUTING"||a.phase==="BLOCKED"){let i=M(e.completedTaskCount,e.totalTasks,10),f=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;t.push(s(` ${n} ${r} ${i} ${e.completedTaskCount}/${e.totalTasks} (${f}%)`))}else a.phase==="COMPLETED"?t.push(s(` ${n} ${r} done`)):t.push(s(` ${n} ${r}`))}else if(e.spec!==null){let a=S(e.phase);t.push(s(` ${e.spec} ${a}${e.phase}${o}`))}else t.push(s(` ${m}No specs yet${o}`));if(t.push(c()),e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REFINEMENT")t.push(s(`Phase: ${S(e.phase)}${e.phase}${o} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered`));else if(e.phase==="SPEC_PROPOSAL")t.push(s(`Phase: ${k}${e.phase}${o} ${k}Awaiting approval${o}`));else if(e.phase==="SPEC_APPROVED")t.push(s(`Phase: ${k}${e.phase}${o} ${T}Ready to start${o}`));else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){if(e.spec!==null&&t.push(s(`${b}${e.spec}${o} (iteration ${e.iteration}):`)),e.activeTaskId!==null){let n=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`;t.push(s(` Active task: ${A}${n.slice(0,36)}${o}`))}let a=M(e.completedTaskCount,e.totalTasks,12),p=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;if(t.push(s(` Progress: ${T}${a} ${e.completedTaskCount}/${e.totalTasks} tasks (${p}%)${o}`)),t.push(s(` Iteration: ${e.iteration}`)),t.push(s(` Last update: ${U(e.timeSinceUpdate)}`)),e.lastProgress!==null&&t.push(s(` ${m}${e.lastProgress.slice(0,50)}${o}`)),e.phase==="BLOCKED"){let n=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");t.push(s(` ${w}BLOCKED: ${n.slice(0,40)}${o}`)),t.push(s(` ${k}Human input needed${o}`))}if(e.awaitingStatusReport&&t.push(s(` ${k}Status report pending${o}`)),e.verificationPassed===!1&&t.push(s(` ${w}Verification failed${o}`)),t.push(c()),e.debt!==null&&e.debt.items.length>0){t.push(s(` Debt: ${e.debt.items.length} item(s)`));for(let n of e.debt.items.slice(0,3))t.push(s(` \u2514\u2500 ${n.text.slice(0,44)}`));e.debt.items.length>3&&t.push(s(` \u2514\u2500 ... and ${e.debt.items.length-3} more`))}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let n=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;t.push(s(` Files changed: ${n.length}`));for(let r of n.slice(0,5)){let i=r.length>44?"..."+r.slice(-41):r;t.push(s(` \u2514\u2500 ${i}`))}n.length>5&&t.push(s(` \u2514\u2500 ... and ${n.length-5} more`))}}else e.phase==="COMPLETED"?t.push(s(`${T}Complete!${o} ${e.iteration} iterations, ${e.decisionsCount} decisions`)):e.phase==="IDLE"&&t.push(s(`${m}No active spec \u2014 work freely${o}`));t.push(c()),e.concerns.length>0&&t.push(s(`Concerns: ${e.concerns.join(", ").slice(0,40)}`));let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${o}`:`${T}ok${o} (${e.iteration}/${e.maxIterations})`;return t.push(s(`Context: ${u}`)),t.push(`${m}\u2570${l}\u256F${o}`),t.push(` ${m}watching .eser/.state/progresses/ ... ctrl+c to stop${o}`),t.join(`
3
- `)},_=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,verificationPassed:e.verificationPassed}),H=async e=>{let{root:t}=await L(),l=e!==void 0&&e.some(r=>r==="-o"||r.startsWith("--output"))?O(e):"ansi";if(!await v(t)){let r=new TextEncoder,i=g.process.stdout.getWriter();return await i.write(r.encode(`noskills not initialized.
4
- `)),i.releaseLock(),C({exitCode:1})}let s=`${t}/${E.progressesDir}`,c="",u=async()=>{let r=await N(t),i=l==="json"?_(r):l==="markdown"?I(r,"markdown"):V(r);if(l==="json"){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(i+`
5
- `)),$.releaseLock()}else if(l==="markdown"){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(i+`
6
- ---
7
- `)),$.releaseLock()}else if(i!==c){let h=new TextEncoder,$=g.process.stdout.getWriter();await $.write(h.encode(B+i+`
8
- `)),$.releaseLock(),c=i}return r.allSpecs.length>0&&r.allSpecs.every(h=>h.phase==="COMPLETED")||r.allSpecs.length===0&&r.phase==="COMPLETED"};if(await u())return y(void 0);let p=1e3,n=0;for(;;){await new Promise(r=>setTimeout(r,p));try{let i=(await g.fs.stat(`${s}/state.json`)).mtime?.getTime()??0;if(i>n&&(n=i,await new Promise(h=>setTimeout(h,200)),await u()))break}catch{}}return y(void 0)};export{N as buildSnapshot,H as main,_ as renderJsonLine,V as renderTerminal};
@@ -1 +0,0 @@
1
- import{D as l,E as a}from"./chunk-KRKOWSYW.js";import{a as n,b as s}from"./chunk-OAWYVETM.js";import"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";var u=async p=>{let{root:t}=await a();if(!await l(t))return console.error("noskills is not initialized. Run: noskills init"),s({exitCode:1});let r=3e3,o=!1;for(let e of p??[])e.startsWith("--port=")&&(r=parseInt(e.slice(7),10)),e==="--open"&&(o=!0);let c="@eserstack/noskills-web",i;try{i=(await import(c)).startServer}catch{return console.error("@eserstack/noskills-web is not installed. Run: pnpm install"),s({exitCode:1})}return await i({root:t,port:r,open:o}),n(void 0)};export{u as main};
@@ -1 +0,0 @@
1
- import{a as P}from"./chunk-DBKXMYLF.js";import{a as T,d as L}from"./chunk-LN4NDYT6.js";import{h as I}from"./chunk-5RLCKUIF.js";import{K as A,q as v,y as D}from"./chunk-UE56BMAW.js";import"./chunk-XDRX4ZBJ.js";import"./chunk-IFE5SYGK.js";import{d as f,f as n,g as u,o as w,q as h,r as S}from"./chunk-VXU6XZ66.js";import"./chunk-VJRCTYGL.js";import"./chunk-PKEQKXZW.js";import"./chunk-O4KKKYCH.js";import{E as C,f as g,h as x,j as E,k,m as y}from"./chunk-KRKOWSYW.js";import{a as m,b as i}from"./chunk-OAWYVETM.js";import{i as d}from"./chunk-Y5E7ZCCX.js";import"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";var z=async c=>{let e=w({renderer:S.ansi(),sink:h.stdout()}),{root:r}=await C(),p=E(c);if(!p.ok)return e.writeln(n(p.error)),await e.close(),i({exitCode:1});let o=(c??[]).filter(a=>!a.startsWith("--spec=")).join(" ");if(o.length===0)return e.writeln(n('A reason is required: noskills wontfix "reason text"')),await e.close(),i({exitCode:1});let t;try{t=await x(r,p.spec)}catch(a){let $=a instanceof Error?a.message:String(a);return e.writeln(n($)),await e.close(),i({exitCode:1})}if(t.phase==="IDLE"||t.phase==="UNINITIALIZED"||t.phase==="COMPLETED")return e.writeln(n(`Cannot mark as won't fix in phase: ${t.phase}`)),await e.close(),i({exitCode:1});if(t.spec!==null){let a=`${r}/${g.specDir(t.spec)}`;try{await d.fs.stat(a)}catch{return e.writeln(n(`Active spec '${t.spec}' directory not found.`)),e.writeln(f("Run `noskills reset` to return to idle.")),await e.close(),i({exitCode:1})}}let l=await I(r),s=v(t,"wontfix",o);s=D(s,t.phase,"COMPLETED",l,o),s.spec!==null&&await y(r,s.spec,s);let U=A(s);return await k(r,U),s.spec!==null&&(await T(r,s.spec,"wontfix"),await L(r,s.spec,"wontfix")),await P(r,{ts:new Date().toISOString(),type:"phase-change",spec:t.spec??"unknown",user:l.name,from:t.phase,to:"COMPLETED",reason:"wontfix"}),e.writeln(u("\u2714"),` Spec marked as won't fix: ${o}`),await e.close(),m(void 0)};export{z as main};
@@ -1 +0,0 @@
1
- import{a,b,c,d}from"./chunk-LJEWPIEI.js";import"./chunk-FE4MKOI4.js";import"./chunk-HISXAZ4Y.js";export{a as WORKERD_CAPABILITIES,c as clearEnv,d as createWorkerdRuntime,b as populateEnvFromContext};
File without changes
File without changes
File without changes
File without changes