noskills 4.1.49 → 4.1.53

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 (101) hide show
  1. package/README.md +345 -890
  2. package/chunks/{anthropic-UTLWCK66.js → anthropic-LDUWIUPL.js} +1 -1
  3. package/chunks/approve-ZX62EG5U.js +1 -0
  4. package/chunks/{ask-KPIHJIJZ.js → ask-VGI3BFZW.js} +1 -1
  5. package/chunks/block-ERQESYMH.js +1 -0
  6. package/chunks/cancel-FOVCYBQY.js +1 -0
  7. package/chunks/{chunk-K223KAUB.js → chunk-2GF5IUQD.js} +1 -1
  8. package/chunks/chunk-5CNPFLE6.js +1 -0
  9. package/chunks/chunk-5P46WSNG.js +5 -0
  10. package/chunks/{chunk-AQWB2PVR.js → chunk-5URW6X3N.js} +93 -92
  11. package/chunks/{chunk-7OIAMA3E.js → chunk-6YHWLEJ4.js} +26 -26
  12. package/chunks/chunk-AP3YBNPX.js +1 -0
  13. package/chunks/{chunk-OCDUS26F.js → chunk-DEIZVYT6.js} +1 -1
  14. package/chunks/chunk-H77MLIL5.js +4 -0
  15. package/chunks/{chunk-TI4CLT2V.js → chunk-HNAHPI6V.js} +1 -1
  16. package/chunks/chunk-JVCVWI3B.js +3 -0
  17. package/chunks/{chunk-ESTTTPON.js → chunk-KYQ77E7T.js} +1 -1
  18. package/chunks/{chunk-JCIANZPY.js → chunk-LBPD4EIH.js} +1 -1
  19. package/chunks/chunk-OKM4FE4G.js +1 -0
  20. package/chunks/chunk-OVLGUKPG.js +1 -0
  21. package/chunks/chunk-PKYW3S5P.js +5 -0
  22. package/chunks/chunk-RGGYSKJY.js +5 -0
  23. package/chunks/chunk-RJX4ZXQ4.js +2 -0
  24. package/chunks/{chunk-WWPJMOT3.js → chunk-SVJVJDZR.js} +1 -1
  25. package/chunks/chunk-UG26APX2.js +3 -0
  26. package/chunks/{chunk-2X2U2VC5.js → chunk-UT6ZCLRA.js} +1 -1
  27. package/chunks/chunk-XNGHRJVK.js +1 -0
  28. package/chunks/{chunk-CLCZ7IO3.js → chunk-YSSDQJTT.js} +1 -1
  29. package/chunks/chunk-YTNM7A5Y.js +3 -0
  30. package/chunks/chunk-Z3O5HAIO.js +2 -0
  31. package/chunks/claude-code-BWCSAVK2.js +1 -0
  32. package/chunks/{cmd-NWSNAUKC.js → cmd-ZXO6KFK6.js} +1 -1
  33. package/chunks/concern-2PON4VPG.js +1 -0
  34. package/chunks/{config-EPT7NOOO.js → config-CZDLCSOC.js} +1 -1
  35. package/chunks/delegate-VRPCGUT2.js +1 -0
  36. package/chunks/diagrams-D5CYTTWA.js +1 -0
  37. package/chunks/diagrams-I2QKL7WR.js +1 -0
  38. package/chunks/done-WQDGQZ5D.js +1 -0
  39. package/chunks/followup-Q3RLSNNM.js +1 -0
  40. package/chunks/free-R4ZTZ76O.js +1 -0
  41. package/chunks/init-HTCNOWTZ.js +1 -0
  42. package/chunks/invoke-hook-675IUCLN.js +13 -0
  43. package/chunks/kiro-RGYUKJAX.js +3 -0
  44. package/chunks/learn-MWUFAR2G.js +7 -0
  45. package/chunks/{list-FWRKOILC.js → list-6EQP6VUL.js} +1 -1
  46. package/chunks/manager-Q7DRXNNO.js +6 -0
  47. package/chunks/{mod-LORCBZWH.js → mod-A77UWGGG.js} +1 -1
  48. package/chunks/mod-TYCXSLSH.js +1 -0
  49. package/chunks/next-7W4YVHSZ.js +7 -0
  50. package/chunks/{ollama-VSBCL6RB.js → ollama-LTZ43OHQ.js} +1 -1
  51. package/chunks/opencode-PZDL7VDP.js +1 -0
  52. package/chunks/pack-DXWS4PMA.js +5 -0
  53. package/chunks/{purge-573OIQZI.js → purge-XZ5EOCFP.js} +1 -1
  54. package/chunks/reopen-VATALF56.js +1 -0
  55. package/chunks/reset-BL73UVLM.js +1 -0
  56. package/chunks/review-VF6JOTLX.js +1 -0
  57. package/chunks/rule-ODX4WMCS.js +6 -0
  58. package/chunks/run-J5Z6R4DP.js +3 -0
  59. package/chunks/{sdk-LHBUQS75.js → sdk-6IMATOQ3.js} +8 -8
  60. package/chunks/session-DFMI2GCC.js +1 -0
  61. package/chunks/spec-3PAUTPIT.js +1 -0
  62. package/chunks/status-5JHFFTMD.js +1 -0
  63. package/chunks/sync-CVEZ4FMQ.js +1 -0
  64. package/chunks/watch-I7Q3AEAQ.js +8 -0
  65. package/chunks/web-JOWEH622.js +1 -0
  66. package/chunks/wontfix-CJMNFDCG.js +1 -0
  67. package/noskills.js +1 -1
  68. package/package.json +1 -1
  69. package/chunks/approve-LCVVXAE3.js +0 -1
  70. package/chunks/block-MNFFAMEP.js +0 -1
  71. package/chunks/cancel-M3G3XXMU.js +0 -1
  72. package/chunks/chunk-4N7N37OY.js +0 -1
  73. package/chunks/chunk-MSJSMJL2.js +0 -1
  74. package/chunks/chunk-NLLZQP64.js +0 -1
  75. package/chunks/chunk-NRCHLNQA.js +0 -3
  76. package/chunks/chunk-ON7NJA2P.js +0 -3
  77. package/chunks/chunk-RMCTOOQL.js +0 -1
  78. package/chunks/chunk-RTD42HPS.js +0 -2
  79. package/chunks/chunk-U3JLX6DY.js +0 -1
  80. package/chunks/chunk-Y2PH2BTY.js +0 -16
  81. package/chunks/claude-code-R7PCCNRZ.js +0 -1
  82. package/chunks/concern-NQODAEHU.js +0 -1
  83. package/chunks/done-XDWNPZVT.js +0 -1
  84. package/chunks/free-MXG3ZUQY.js +0 -1
  85. package/chunks/init-NJ7KI65T.js +0 -1
  86. package/chunks/invoke-hook-D6BRYBNY.js +0 -11
  87. package/chunks/kiro-3VFHKARM.js +0 -3
  88. package/chunks/manager-BIVHW3S7.js +0 -6
  89. package/chunks/next-LQLZL4LN.js +0 -8
  90. package/chunks/opencode-YE3RKOY7.js +0 -1
  91. package/chunks/pack-5U7QBA2H.js +0 -5
  92. package/chunks/reopen-IR7FAPQE.js +0 -1
  93. package/chunks/reset-XY2HW67W.js +0 -1
  94. package/chunks/rule-YI5GBUAS.js +0 -6
  95. package/chunks/run-B6BBYCQM.js +0 -3
  96. package/chunks/session-5BLO37XK.js +0 -1
  97. package/chunks/spec-W52NAT6U.js +0 -1
  98. package/chunks/status-DJZSCXLA.js +0 -1
  99. package/chunks/sync-A44KPO5R.js +0 -1
  100. package/chunks/watch-I7NEY7YJ.js +0 -8
  101. package/chunks/wontfix-JULEBOGK.js +0 -1
@@ -1,3 +0,0 @@
1
- import{a as D,b as A,g as F}from"./chunk-4N7N37OY.js";import{d as B}from"./chunk-Y2PH2BTY.js";import{c as W,d as X}from"./chunk-7OIAMA3E.js";import"./chunk-7UX6WIXX.js";import"./chunk-OCDUS26F.js";import{b as E,c as V}from"./chunk-2X2U2VC5.js";import{a as _,o as j}from"./chunk-NLLZQP64.js";import{A as M,e as g,f as N,g as U,i as $,l as G,p as L}from"./chunk-AQWB2PVR.js";import{c as v,d as o,f as l,g as P,h,k as I,o as R,q as O,r as T}from"./chunk-K223KAUB.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{b as y}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var ue=async t=>{let e=R({renderer:T.ansi(),sink:O.stdout()}),i=y.process.cwd(),n=t?.includes("--unattended")??!1,r=z(t,"--max-turns")??10,p=z(t,"--max-iterations")??50;if(!await M(i))return e.writeln(l(`noskills not initialized. Run: ${V("init")}`)),await e.close(),w({exitCode:1});let x=U(t),c=await N(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=j(c);await $(i,s)}let u=await G(i);if(u===null)return e.writeln(l("Config not found.")),await e.close(),w({exitCode:1});e.writeln(v(`${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(P("\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=A(),f=await F(C,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){e.writeln(o("Stopped by user."));break}let k=_(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 L(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(I(`\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-LORCBZWH.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-LORCBZWH.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(`
2
- `)},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}
3
- `;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{ue as main};
@@ -1 +0,0 @@
1
- import{b as I,c as E}from"./chunk-2X2U2VC5.js";import{A as R,f as b,k as y,s as A,u as C,v as N,x as $,y as x,z as O}from"./chunk-AQWB2PVR.js";import{c as l,d as n,f as c,g as v,o as f,q as w,r as S}from"./chunk-K223KAUB.js";import{a as u,b as h}from"./chunk-2N4GTHXQ.js";import{b as m}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var F=async t=>{let s=t?.[0];if(s==="start")return await P(t?.slice(1));if(s==="end")return await D(t?.slice(1));if(s==="list")return await M();if(s==="gc")return await K();let i=I(),e=f({renderer:S.ansi(),sink:w.stdout()});return e.writeln(`Usage: ${i} session <start | end | list | gc>`),e.writeln(""),e.writeln(n(" start --spec=<name> Bind to a spec")),e.writeln(n(" start --free Free mode (no enforcement)")),e.writeln(n(" start --auto Auto-detect spec or free")),e.writeln(n(" end [--id=<id>] End current/specific session")),e.writeln(n(" list Show active sessions")),e.writeln(n(" gc Remove stale sessions")),await e.close(),u(void 0)},P=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd();if(!await R(i))return s.writeln(c("noskills is not initialized.")," Run: ",l(E("init"))),await s.close(),h({exitCode:1});let e=null,o=!1,d=!1;for(let r of t??[])r.startsWith("--spec=")?e=r.slice(7):r==="--free"?o=!0:r==="--auto"&&(d=!0);if(d){let p=(await y(i)).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(c("Specify --spec=<name>, --free, or --auto.")),s.writeln(n(`Example: ${I()} session start --spec=my-feature`)),await s.close(),h({exitCode:1});let a=null;if(e!==null)try{a=(await b(i,e)).phase}catch(r){let p=r instanceof Error?r.message:String(r);return s.writeln(c(`Error: ${p}`)),await s.close(),h({exitCode:1})}let g=O(),k={id:g,spec:e,mode:o?"free":"spec",phase:o?null:a,pid:0,startedAt:new Date().toISOString(),lastActiveAt:new Date().toISOString(),tool:"claude-code"};return await A(i,k),s.writeln(v("Session started.")),s.writeln(" ID: ",l(g)),s.writeln(" Mode: ",l(o?"free":"spec")),e!==null&&(s.writeln(" Spec: ",l(e)),a!==null&&s.writeln(" Phase: ",n(a))),s.writeln(""),s.writeln("Run: ",l(`export NOSKILLS_SESSION=${g}`)),await s.close(),u(void 0)},D=async t=>{let s=f({renderer:S.ansi(),sink:w.stdout()}),i=m.process.cwd(),e=null;for(let d of t??[])d.startsWith("--id=")&&(e=d.slice(5));return e===null&&(e=m.env.get("NOSKILLS_SESSION")??null),e===null?(s.writeln(c("No session specified. Use --id=<id> or set NOSKILLS_SESSION env var.")),await s.close(),h({exitCode:1})):(await N(i,e)?s.writeln(v("Session ended: "),n(e)):s.writeln(c(`Session not found: ${e}`)),await s.close(),u(void 0))},M=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await C(s);if(t.writeln(l("Sessions")),t.writeln(""),i.length===0)t.writeln(n(` No active sessions. Start one with: ${E("session start --spec=<name>")}`));else for(let e of i){let o=x(e),d=Date.now()-new Date(e.lastActiveAt).getTime(),a=Math.floor(d/6e4),g=a<60?`${a}min ago`:`${Math.floor(a/60)}h ago`,k=e.mode==="free"?"free":`spec:${e.spec??"?"}`,r=e.phase??"\u2014",p=o?c(" (stale)"):"";t.writeln(" ",l(e.id)," ",n(k.padEnd(25))," ",n(r.padEnd(18))," ",n(g),p)}return await t.close(),u(void 0)},K=async()=>{let t=f({renderer:S.ansi(),sink:w.stdout()}),s=m.process.cwd(),i=await $(s);if(i.length===0)t.writeln(n("No stale sessions to remove."));else{t.writeln(v(`Removed ${i.length} stale session(s):`));for(let e of i)t.writeln(" ",n(e))}return await t.close(),u(void 0)};export{F as main};
@@ -1 +0,0 @@
1
- import{a as _}from"./chunk-7UX6WIXX.js";import{a as K,d as X}from"./chunk-JCIANZPY.js";import{g as z,h as I}from"./chunk-TI4CLT2V.js";import{b as S,c as A}from"./chunk-2X2U2VC5.js";import{b as O,i as M,j as N,r as F,t as B,u as G,v as H,w as q}from"./chunk-NLLZQP64.js";import{A as T,a as U,d as D,f as E,g as W,j as x,k as L}from"./chunk-AQWB2PVR.js";import{c as w,d as c,f as p,g as k,h as P,k as j,o as g,q as y,r as v}from"./chunk-K223KAUB.js";import{a as m,b as d}from"./chunk-2N4GTHXQ.js";import{b as h}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var J=new Set(["new","list","help","next","approve","done","block","reset","cancel","wontfix","reopen","revisit","split","ac","task","note"]),Q=new Map([["next",()=>import("./next-LQLZL4LN.js")],["approve",()=>import("./approve-LCVVXAE3.js")],["done",()=>import("./done-XDWNPZVT.js")],["block",()=>import("./block-MNFFAMEP.js")],["reset",()=>import("./reset-XY2HW67W.js")],["cancel",()=>import("./cancel-M3G3XXMU.js")],["wontfix",()=>import("./wontfix-JULEBOGK.js")],["reopen",()=>import("./reopen-IR7FAPQE.js")]]);var $e=async i=>{let e=i?.[0];if(e==="new")return await Z(i?.slice(1));if(e==="list")return await ee(i?.slice(1));if(e==="help"||e===void 0){let o=S(),r=g({renderer:v.ansi(),sink:y.stdout()});return r.writeln(`Usage: ${o} spec <new <name> "desc" | 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(` ${o} spec new my-feature "Add upload support"`)),r.writeln(c(` ${o} spec my-feature next`)),r.writeln(c(` ${o} spec my-feature next --answer="approve"`)),await r.close(),m(void 0)}let t=e,s=i?.[1];if(s===void 0)return await(await import("./status-DJZSCXLA.js")).main([`--spec=${t}`]);if(s==="split")return await se([`--spec=${t}`,...i?.slice(2)??[]]);if(s==="revisit")return await ne([`--spec=${t}`,...i?.slice(2)??[]]);if(s==="ac")return await ie(t,i?.slice(2));if(s==="task")return await re(t,i?.slice(2));if(s==="note")return await ae(t,i?.slice(2));let l=Q.get(s);if(l!==void 0)return await(await l()).main([`--spec=${t}`,...i?.slice(2)??[]]);let a=g({renderer:v.ansi(),sink:y.stdout()});return a.writeln(p(`Unknown command: spec ${t} ${s}`)),a.writeln(c(" Valid: next, approve, done, block, reset, cancel, wontfix, reopen, revisit, split, ac, task, note")),await a.close(),d({exitCode:1})},Z=async i=>{let e=g({renderer:v.ansi(),sink:y.stdout()}),t=h.process.cwd();if(!await T(t))return e.writeln(p("noskills is not initialized.")," Run: ",w(A("init"))),await e.close(),d({exitCode:1});let s=null,l=[];if(i!==void 0){let $=!1;for(let C of i)C.startsWith("--name=")?(s=C.slice(7),$=!0):C.startsWith("-")||(!$&&s===null?(s=C,$=!0):l.push(C))}let a=null;if(i!==void 0)for(let $ of i)$.startsWith("--from-plan=")&&(a=$.slice(12));let o=l.join(" ");if(s===null||s.length===0)return e.writeln(p("Error: spec name is required.")),e.writeln(c("Example: "),w(`${S()} spec new photo-upload "photo upload feature"`)),await e.close(),d({exitCode:1});if(J.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: "),w(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(o.length===0)return e.writeln(p("Please provide a description: "),w(`${S()} spec new --name=${s} "photo upload feature"`)),await e.close(),d({exitCode:1});if(a!==null)try{if((await h.fs.stat(a)).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: ${a}`)),await e.close(),d({exitCode:1})}let n=`spec/${s}`,u=`${t}/${D.specDir(s)}`;try{return await h.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 R=U(),f=O(R,s,n,o),b=await I(t),V=G(f,"IDLE","DISCOVERY",b);return a!==null&&(V={...f,discovery:{...f.discovery,planPath:a}}),await h.fs.mkdir(`${t}/${D.specDir(s)}`,{recursive:!0}),await x(t,s,V),e.writeln(k("\u2714")," Spec started: ",w(s)),e.writeln(" Directory: ",c(D.specDir(s))),e.writeln(" Branch: ",c(n)),e.writeln(" Phase: ",P("DISCOVERY")),a!==null&&e.writeln(" Plan: ",c(a)),e.writeln(""),e.writeln("Run ",w(A(`next --spec=${s}`))," to begin discovery questions."),await e.close(),m(void 0)},ee=async i=>{let e=h.process.cwd(),t=K(i),s=await L(e),l=`${e}/${D.specsDir}`,a=new Set(s.map(n=>n.name)),o=[];for(let n of s)o.push({name:n.name,phase:n.state.phase,iteration:n.state.execution.iteration});try{for await(let n of h.fs.readDir(l))n.isDirectory&&!a.has(n.name)&&o.push({name:n.name,phase:"IDLE",iteration:0})}catch{}if(t==="json")return await X(o,"json"),m(void 0);let r=g({renderer:v.ansi(),sink:y.stdout()});if(r.writeln(w("Specs")),r.writeln(""),o.length===0)r.writeln(c(" No specs yet."));else for(let n of o){let u=n.phase==="COMPLETED"?k(n.phase):n.phase==="EXECUTING"?j(n.phase):n.phase==="BLOCKED"?p(n.phase):P(n.phase),R=n.phase==="EXECUTING"?c(` iteration ${n.iteration}`):"";r.writeln(" ",c("\u25CB")," ",n.name," ",u,R)}return await r.close(),m(void 0)},te=i=>{let e=[],t=0;for(;t<i.length;)if(i[t]==="--into"&&t+1<i.length){let s=i[t+1],l=s;t+2<i.length&&!i[t+2].startsWith("-")?(l=i[t+2],t+=3):t+=2,e.push({name:s,description:l})}else t+=1;return e},se=async i=>{let e=g({renderer:v.ansi(),sink:y.stdout()}),t=h.process.cwd();if(!await T(t))return e.writeln(p("noskills is not initialized.")," Run: ",w(A("init"))),await e.close(),d({exitCode:1});let s=W(i??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),w(`${S()} spec split --spec=parent --into name1 "desc1" --into name2 "desc2"`)),await e.close(),d({exitCode:1});let l;try{l=await E(t,s)}catch(n){let u=n instanceof Error?n.message:String(n);return e.writeln(p(`Error: ${u}`)),await e.close(),d({exitCode:1})}if(l.phase!=="DISCOVERY"&&l.phase!=="DISCOVERY_REVIEW")return e.writeln(p(`Cannot split spec in phase ${l.phase}. Must be in DISCOVERY or DISCOVERY_REVIEW.`)),await e.close(),d({exitCode:1});let a=te(i??[]);if(a.length<2){let n=_(l.discovery.answers);if(!n.detected||n.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 n.proposals){let b=`${t}/${D.specDir(f.name)}`;await h.fs.mkdir(b,{recursive:!0});let Y=l.discovery.answers.filter(C=>f.relevantAnswers.includes(C.questionId)),$=O(U(),f.name,`spec/${f.name}`);for(let C of Y)$=M($,C.questionId,C.answer);$=N($),await x(t,f.name,$),u.push(f.name)}let R=F(l,"cancelled",`Split into: ${u.join(", ")}`);await x(t,s,R),e.writeln(k("Split complete."),` Created ${u.length} sub-specs:`);for(let f of u)e.writeln(" ",c("\u25CB")," ",w(f));return e.writeln("",c(`Parent spec "${s}" cancelled.`)),await e.close(),m(void 0)}let o=[];for(let n of a){let u=`${t}/${D.specDir(n.name)}`;await h.fs.mkdir(u,{recursive:!0});let f=O(U(),n.name,`spec/${n.name}`);for(let b of l.discovery.answers)f=M(f,b.questionId,b.answer);f=N(f),await x(t,n.name,f),o.push(n.name)}let r=F(l,"cancelled",`Split into: ${o.join(", ")}`);await x(t,s,r),e.writeln(k("Split complete."),` Created ${o.length} sub-specs:`);for(let n of o)e.writeln(" ",c("\u25CB")," ",w(n));return e.writeln("",c(`Parent spec "${s}" cancelled.`)),await e.close(),m(void 0)},ne=async i=>{let e=g({renderer:v.ansi(),sink:y.stdout()}),t=h.process.cwd();if(!await T(t))return e.writeln(p("noskills is not initialized.")," Run: ",w(A("init"))),await e.close(),d({exitCode:1});let s=W(i??[]);if(s===null)return e.writeln(p("Error: --spec=<name> is required.")),e.writeln(c("Example: "),w(`${S()} spec revisit --spec=my-spec "reason for revisit"`)),await e.close(),d({exitCode:1});let l=(i??[]).find(n=>!n.startsWith("--")&&n!==s);if(l===void 0||l.trim().length===0)return e.writeln(p('Error: Reason is required: noskills spec revisit --spec=X "reason"')),await e.close(),d({exitCode:1});let a;try{a=await E(t,s)}catch(n){let u=n instanceof Error?n.message:String(n);return e.writeln(p(`Error: ${u}`)),await e.close(),d({exitCode:1})}if(a.phase==="DISCOVERY"||a.phase==="DISCOVERY_REVIEW"||a.phase==="SPEC_DRAFT"||a.phase==="SPEC_APPROVED")return e.writeln(p("Already in planning phase, no need to revisit.")),await e.close(),d({exitCode:1});if(a.phase==="COMPLETED")return e.writeln(p(`Spec is completed. Use \`${S()} reopen --spec=${s}\` instead.`)),await e.close(),d({exitCode:1});if(a.phase==="IDLE"||a.phase==="FREE")return e.writeln(p("No active spec to revisit.")),await e.close(),d({exitCode:1});let o=a.execution.completedTasks.length,r=B(a,l.trim());return await x(t,s,r),e.writeln(k("Revisit complete.")),e.writeln(" Phase: ",w("DISCOVERY"),c(` (revisited from ${a.phase})`)),o>0&&e.writeln(" Previous progress: ",w(`${o} tasks completed`)),e.writeln(" Reason: ",c(`"${l.trim()}"`)),e.writeln(" Discovery answers preserved \u2014 revise or re-approve."),await e.close(),m(void 0)},ie=async(i,e)=>{let t=g({renderer:v.ansi(),sink:y.stdout()}),s=h.process.cwd(),l=e?.[0];if(i===void 0||l===void 0)return t.writeln(`Usage: ${S()} spec <name> ac <add "text" | list>`),await t.close(),m(void 0);if(l==="add"){let a=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(a.length===0)return t.writeln(p("Please provide AC text.")),await t.close(),d({exitCode:1});let o=await E(s,i),r=await I(s);o.phase==="EXECUTING"&&t.writeln(P("Warning: Adding ACs during execution is scope creep."));let n=H(o,a,r);return await x(s,i,n),t.writeln(k("AC added: "),`"${a}"`,c(` (by ${z(r)})`)),await t.close(),m(void 0)}if(l==="list"){let o=(await E(s,i)).customACs??[];if(t.writeln(w(`Custom ACs for ${i}`)),t.writeln(""),o.length===0)t.writeln(c(" No custom ACs."));else for(let r of o)t.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.addedInPhase}`));return await t.close(),m(void 0)}return t.writeln(`Usage: ${S()} spec <name> ac <add "text" | list>`),await t.close(),m(void 0)},re=async(i,e)=>{let t=g({renderer:v.ansi(),sink:y.stdout()}),s=h.process.cwd(),l=e?.[0];if(i===void 0||l===void 0)return t.writeln(`Usage: ${S()} spec <name> task <add "text" | list>`),await t.close(),m(void 0);if(l==="add"){let a=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(a.length===0)return t.writeln(p("Please provide task text.")),await t.close(),d({exitCode:1});let o=await E(s,i);if(o.phase==="EXECUTING"||o.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 I(s),n=q(o,`[TASK] ${a}`,r);return await x(s,i,n),t.writeln(k("Task added: "),`"${a}"`,c(` (by ${z(r)})`)),await t.close(),m(void 0)}if(l==="list"){let o=((await E(s,i)).specNotes??[]).filter(r=>r.text.startsWith("[TASK] "));if(t.writeln(w(`Custom tasks for ${i}`)),t.writeln(""),o.length===0)t.writeln(c(" No custom tasks."));else for(let r of o)t.writeln(` - ${r.text.replace("[TASK] ","")}`,c(` -- ${r.user}, ${r.phase}`));return await t.close(),m(void 0)}return t.writeln(`Usage: ${S()} spec <name> task <add "text" | list>`),await t.close(),m(void 0)},ae=async(i,e)=>{let t=g({renderer:v.ansi(),sink:y.stdout()}),s=h.process.cwd(),l=e?.[0];if(i===void 0||l===void 0)return t.writeln(`Usage: ${S()} spec <name> note <add "text" | list>`),await t.close(),m(void 0);if(l==="add"){let a=(e?.slice(1)??[]).filter(u=>!u.startsWith("-")).join(" ");if(a.length===0)return t.writeln(p("Please provide note text.")),await t.close(),d({exitCode:1});let o=await E(s,i),r=await I(s),n=q(o,a,r);return await x(s,i,n),t.writeln(k("Note added: "),`"${a}"`,c(` (by ${z(r)})`)),await t.close(),m(void 0)}if(l==="list"){let o=((await E(s,i)).specNotes??[]).filter(r=>!r.text.startsWith("[TASK] "));if(t.writeln(w(`Notes for ${i}`)),t.writeln(""),o.length===0)t.writeln(c(" No notes."));else for(let r of o)t.writeln(` - ${r.text}`,c(` -- ${r.user}, ${r.phase}`));return await t.close(),m(void 0)}return t.writeln(`Usage: ${S()} spec <name> note <add "text" | list>`),await t.close(),m(void 0)};export{J as RESERVED_NAMES,$e as main};
@@ -1 +0,0 @@
1
- import{a as f,d as P}from"./chunk-Y2PH2BTY.js";import{c as R,d as S}from"./chunk-7OIAMA3E.js";import"./chunk-7UX6WIXX.js";import"./chunk-OCDUS26F.js";import{a as k,d as w}from"./chunk-JCIANZPY.js";import{c as h}from"./chunk-2X2U2VC5.js";import{A as O,f as b,g as x,l as D,p as v}from"./chunk-AQWB2PVR.js";import{c as i,d as r,f as c,g as y,h as p,k as I,o as d,q as u,r as m}from"./chunk-K223KAUB.js";import{a as l,b as E}from"./chunk-2N4GTHXQ.js";import{b as C}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var W=async g=>{let n=C.process.cwd(),o=k(g);if(!await O(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=x(g),e=await b(n,V),t=await D(n),T={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 v(n)).filter(N=>t!==null&&t.concerns.includes(N.id)),$=await R(n),j=S(t?.tools??[]),F=await P(e,a,$,t,void 0,void 0,void 0,j);return await w({...T,...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"?y(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?I(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{W as main};
@@ -1 +0,0 @@
1
- import{e as w}from"./chunk-7OIAMA3E.js";import{c as g}from"./chunk-2X2U2VC5.js";import{l as u}from"./chunk-AQWB2PVR.js";import{c as m,d as r,f as c,g as n,o as p,q as d,r as f}from"./chunk-K223KAUB.js";import{a as o,b as a}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init"))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
@@ -1,8 +0,0 @@
1
- import{a as v,c as L}from"./chunk-JCIANZPY.js";import{a as F,c as I}from"./chunk-RTD42HPS.js";import{A as D,e as S,k as x,l as P}from"./chunk-AQWB2PVR.js";import{a as y,b as C}from"./chunk-2N4GTHXQ.js";import{b as f}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var M=async e=>{let t=await S(e),d=await P(e),l=await A(e),s=null,c=null,u=0,a=0;if(t.spec!==null){let n=await F(e,t.spec);if(n!==null){u=n.tasks.length,a=t.execution.completedTasks.length;let g=I(n.tasks,t.execution.completedTasks);g!==null&&(s=g.id,c=g.title)}}let p=null;t.lastCalledAt!==null&&(p=Math.floor((Date.now()-new Date(t.lastCalledAt).getTime())/1e3));let r=(await x(e)).map(n=>({name:n.name,phase:n.state.phase,iteration:n.state.execution.iteration}));return{spec:t.spec,phase:t.phase,iteration:t.execution.iteration,activeTaskId:s,activeTaskTitle:c,totalTasks:u,completedTaskCount:a,lastProgress:t.execution.lastProgress,lastCalledAt:t.lastCalledAt,modifiedFiles:t.execution.modifiedFiles,debt:t.execution.debt,concerns:d?.concerns??[],maxIterations:d?.maxIterationsBeforeRestart??15,awaitingStatusReport:t.execution.awaitingStatusReport,verificationPassed:t.execution.lastVerification?.passed??null,decisionsCount:t.decisions.length,discoveryAnswered:t.discovery.answers.length,discoveryTotal:6,trackedFiles:l,timeSinceUpdate:p,allSpecs:r}},A=async e=>{let t=`${e}/.eser/.state/files-changed.jsonl`;try{let l=(await f.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[]}},W="\x1B[2J\x1B[H",E="\x1B[1m",h="\x1B[2m",o="\x1B[0m",k="\x1B[32m",T="\x1B[33m",w="\x1B[31m",R="\x1B[36m",b=e=>{switch(e){case"COMPLETED":return k;case"BLOCKED":return w;case"EXECUTING":return R;default:return T}},O=(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)},N=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,B=e=>e.replace(/\x1b\[[0-9;]*m/g,""),U=(e,t)=>{let d=B(e).length;return e+" ".repeat(Math.max(0,t-d))},j=e=>{let t=[],l="\u2500".repeat(54),s=a=>`${h}\u2502${o} ${U(a,52)}${h}\u2502${o}`,c=()=>`${h}\u2502${"".padEnd(54)}\u2502${o}`;if(t.push(`${h}\u256D${l}\u256E${o}`),t.push(s(`${E}noskills watch${o}`)),t.push(c()),t.push(s(`${E}Specs:${o}`)),e.allSpecs.length>0)for(let a of e.allSpecs){let p=b(a.phase),i=a.name.slice(0,18).padEnd(18),r=`${p}${a.phase}${o}`.padEnd(a.phase.length+10);if(a.phase==="EXECUTING"||a.phase==="BLOCKED"){let n=O(e.completedTaskCount,e.totalTasks,10),g=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;t.push(s(` ${i} ${r} ${n} ${e.completedTaskCount}/${e.totalTasks} (${g}%)`))}else a.phase==="COMPLETED"?t.push(s(` ${i} ${r} done`)):t.push(s(` ${i} ${r}`))}else if(e.spec!==null){let a=b(e.phase);t.push(s(` ${e.spec} ${a}${e.phase}${o}`))}else t.push(s(` ${h}No specs yet${o}`));if(t.push(c()),e.phase==="DISCOVERY"||e.phase==="DISCOVERY_REVIEW")t.push(s(`Phase: ${b(e.phase)}${e.phase}${o} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered`));else if(e.phase==="SPEC_DRAFT")t.push(s(`Phase: ${T}${e.phase}${o} ${T}Awaiting approval${o}`));else if(e.phase==="SPEC_APPROVED")t.push(s(`Phase: ${T}${e.phase}${o} ${k}Ready to start${o}`));else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){if(e.spec!==null&&t.push(s(`${E}${e.spec}${o} (iteration ${e.iteration}):`)),e.activeTaskId!==null){let i=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`;t.push(s(` Active task: ${R}${i.slice(0,36)}${o}`))}let a=O(e.completedTaskCount,e.totalTasks,12),p=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0;if(t.push(s(` Progress: ${k}${a} ${e.completedTaskCount}/${e.totalTasks} tasks (${p}%)${o}`)),t.push(s(` Iteration: ${e.iteration}`)),t.push(s(` Last update: ${N(e.timeSinceUpdate)}`)),e.lastProgress!==null&&t.push(s(` ${h}${e.lastProgress.slice(0,50)}${o}`)),e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");t.push(s(` ${w}BLOCKED: ${i.slice(0,40)}${o}`)),t.push(s(` ${T}Human input needed${o}`))}if(e.awaitingStatusReport&&t.push(s(` ${T}Status report pending${o}`)),e.verificationPassed===!1&&t.push(s(` ${w}Verification failed${o}`)),t.push(c()),e.debt!==null&&e.debt.items.length>0){t.push(s(` Debt: ${e.debt.items.length} item(s)`));for(let i of e.debt.items.slice(0,3))t.push(s(` \u2514\u2500 ${i.text.slice(0,44)}`));e.debt.items.length>3&&t.push(s(` \u2514\u2500 ... and ${e.debt.items.length-3} more`))}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let i=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;t.push(s(` Files changed: ${i.length}`));for(let r of i.slice(0,5)){let n=r.length>44?"..."+r.slice(-41):r;t.push(s(` \u2514\u2500 ${n}`))}i.length>5&&t.push(s(` \u2514\u2500 ... and ${i.length-5} more`))}}else e.phase==="COMPLETED"?t.push(s(`${k}Complete!${o} ${e.iteration} iterations, ${e.decisionsCount} decisions`)):e.phase==="FREE"?t.push(s(`${h}Free mode \u2014 no enforcement${o}`)):e.phase==="IDLE"&&t.push(s(`${h}No active work${o}`));t.push(c()),e.concerns.length>0&&t.push(s(`Concerns: ${e.concerns.join(", ").slice(0,40)}`));let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${o}`:`${k}ok${o} (${e.iteration}/${e.maxIterations})`;return t.push(s(`Context: ${u}`)),t.push(`${h}\u2570${l}\u256F${o}`),t.push(` ${h}watching .eser/.state/ ... ctrl+c to stop${o}`),t.join(`
3
- `)},K=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}),X=async e=>{let t=f.process.cwd(),l=e!==void 0&&e.some(r=>r==="-o"||r.startsWith("--output"))?v(e):"ansi";if(!await D(t)){let r=new TextEncoder,n=f.process.stdout.getWriter();return await n.write(r.encode(`noskills not initialized.
4
- `)),n.releaseLock(),C({exitCode:1})}let s=`${t}/.eser/.state`,c="",u=async()=>{let r=await M(t),n=l==="json"?K(r):l==="markdown"?L(r,"markdown"):j(r);if(l==="json"){let m=new TextEncoder,$=f.process.stdout.getWriter();await $.write(m.encode(n+`
5
- `)),$.releaseLock()}else if(l==="markdown"){let m=new TextEncoder,$=f.process.stdout.getWriter();await $.write(m.encode(n+`
6
- ---
7
- `)),$.releaseLock()}else if(n!==c){let m=new TextEncoder,$=f.process.stdout.getWriter();await $.write(m.encode(W+n+`
8
- `)),$.releaseLock(),c=n}return r.allSpecs.length>0&&r.allSpecs.every(m=>m.phase==="COMPLETED")||r.allSpecs.length===0&&r.phase==="COMPLETED"};if(await u())return y(void 0);let p=1e3,i=0;for(;;){await new Promise(r=>setTimeout(r,p));try{let n=(await f.fs.stat(`${s}/state.json`)).mtime?.getTime()??0;if(n>i&&(i=n,await new Promise(m=>setTimeout(m,200)),await u()))break}catch{}}return y(void 0)};export{M as buildSnapshot,X as main,K as renderJsonLine,j as renderTerminal};
@@ -1 +0,0 @@
1
- import{a as D,d as I}from"./chunk-ESTTTPON.js";import{h as A}from"./chunk-TI4CLT2V.js";import{r as y,u as C}from"./chunk-NLLZQP64.js";import{d as x,f as S,h as g,i as E,j as k}from"./chunk-AQWB2PVR.js";import{d as u,f as n,g as f,o as d,q as w,r as h}from"./chunk-K223KAUB.js";import{a as m,b as i}from"./chunk-2N4GTHXQ.js";import{b as c}from"./chunk-RMCTOOQL.js";import"./chunk-CKETVOVQ.js";import"./chunk-YSLRAWBK.js";import"./chunk-OTRBRRIO.js";var O=async l=>{let e=d({renderer:h.ansi(),sink:w.stdout()}),r=c.process.cwd(),p=g(l);if(!p.ok)return e.writeln(n(p.error)),await e.close(),i({exitCode:1});let o=(l??[]).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 s;try{s=await S(r,p.spec)}catch(a){let U=a instanceof Error?a.message:String(a);return e.writeln(n(U)),await e.close(),i({exitCode:1})}if(s.phase==="IDLE"||s.phase==="FREE"||s.phase==="UNINITIALIZED"||s.phase==="COMPLETED")return e.writeln(n(`Cannot mark as won't fix in phase: ${s.phase}`)),await e.close(),i({exitCode:1});if(s.spec!==null){let a=`${r}/${x.specDir(s.spec)}`;try{await c.fs.stat(a)}catch{return e.writeln(n(`Active spec '${s.spec}' directory not found.`)),e.writeln(u("Run `noskills reset` to return to IDLE.")),await e.close(),i({exitCode:1})}}let L=await A(r),t=y(s,"wontfix",o);return t=C(t,s.phase,"COMPLETED",L,o),await E(r,t),t.spec!==null&&await k(r,t.spec,t),t.spec!==null&&(await D(r,t.spec,"wontfix"),await I(r,t.spec,"wontfix")),e.writeln(f("\u2714"),` Spec marked as won't fix: ${o}`),await e.close(),m(void 0)};export{O as main};