eser 4.1.48 → 4.1.50

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 (168) hide show
  1. package/chunks/{anthropic-QBGNUIP3.js → anthropic-YMZNUQKZ.js} +1 -1
  2. package/chunks/approve-PXC7FMDI.js +2 -0
  3. package/chunks/{ask-M3VS3GIJ.js → ask-6DWHUCLO.js} +1 -1
  4. package/chunks/block-CSVO3R47.js +2 -0
  5. package/chunks/{build-DPBRNANI.js → build-S4DSRSSR.js} +1 -1
  6. package/chunks/cancel-AJOYWYV5.js +2 -0
  7. package/chunks/{changelog-gen-627BV77Z.js → changelog-gen-TE6FXELA.js} +1 -1
  8. package/chunks/{chunk-7NKYCWAA.js → chunk-2PWSTO7A.js} +1 -1
  9. package/chunks/{chunk-H6P3EACV.js → chunk-3CE7GA2P.js} +1 -1
  10. package/chunks/{chunk-FNPBHLLZ.js → chunk-3KGG2I2A.js} +1 -1
  11. package/chunks/{chunk-73IMECRI.js → chunk-3SBAWBWS.js} +1 -1
  12. package/chunks/chunk-4NNSMDFH.js +2 -0
  13. package/chunks/{chunk-R4GKIRAI.js → chunk-4QMRLILJ.js} +1 -1
  14. package/chunks/chunk-4TTJVJEI.js +2 -0
  15. package/chunks/{chunk-7KFSTOXR.js → chunk-4XXI5LYN.js} +1 -1
  16. package/chunks/{chunk-4LQG2WOJ.js → chunk-66VSO643.js} +1 -1
  17. package/chunks/chunk-67AFLWXV.js +4 -0
  18. package/chunks/{chunk-C7NZBKCW.js → chunk-72R6CKNY.js} +1 -1
  19. package/chunks/{chunk-TFRONHJA.js → chunk-AUDMKDAA.js} +1 -1
  20. package/chunks/{chunk-RHVDIXOM.js → chunk-BESTYZQY.js} +1 -1
  21. package/chunks/{chunk-2YTW3JQ6.js → chunk-BJ45FF6F.js} +1 -1
  22. package/chunks/{chunk-DM6U63HP.js → chunk-BNZPRQUS.js} +1 -1
  23. package/chunks/{chunk-KHBIOZJE.js → chunk-BVIGTD2Z.js} +1 -1
  24. package/chunks/{chunk-5JV6KQMP.js → chunk-CE6UVD6F.js} +1 -1
  25. package/chunks/{chunk-WI2RW3YL.js → chunk-DHNS2KLJ.js} +1 -1
  26. package/chunks/{chunk-WTMV5GTZ.js → chunk-DTDUHDLM.js} +1 -1
  27. package/chunks/{chunk-MTCPFQ5I.js → chunk-FVXGVHUR.js} +1 -1
  28. package/chunks/{chunk-3D5TBTM3.js → chunk-HTC2FO4I.js} +2 -2
  29. package/chunks/{chunk-J5HFD7AQ.js → chunk-HV3EYAGF.js} +1 -1
  30. package/chunks/{chunk-XUV7CW3L.js → chunk-IY3YRKJJ.js} +1 -1
  31. package/chunks/{chunk-O325ZU5M.js → chunk-JTSRGXS4.js} +1 -1
  32. package/chunks/{chunk-CVDLYIOW.js → chunk-KFSZ6MDH.js} +1 -1
  33. package/chunks/chunk-KNIM3QST.js +10 -0
  34. package/chunks/chunk-L32KHQVT.js +3 -0
  35. package/chunks/chunk-LS5MCZUM.js +2 -0
  36. package/chunks/{chunk-ATYDQCCJ.js → chunk-MGNBNMJZ.js} +1 -1
  37. package/chunks/chunk-MX5DKVDI.js +2 -0
  38. package/chunks/{chunk-JO4JKJ7R.js → chunk-N6PXARPJ.js} +1 -1
  39. package/chunks/{chunk-2LF7QSIN.js → chunk-NWWXAZFA.js} +8 -8
  40. package/chunks/{chunk-MW3RJU6I.js → chunk-OSNPAAYT.js} +1 -1
  41. package/chunks/{chunk-6BILFSH2.js → chunk-PBZV2KA3.js} +1 -1
  42. package/chunks/{chunk-YKEVDAWS.js → chunk-PG7KG7NX.js} +1 -1
  43. package/chunks/{chunk-UGYRUVUH.js → chunk-PY6ZNQ4B.js} +1 -1
  44. package/chunks/{chunk-PPSDIDOI.js → chunk-QHVTWYZJ.js} +1 -1
  45. package/chunks/chunk-QL5FA3P3.js +2 -0
  46. package/chunks/{chunk-ULIMXXRY.js → chunk-QRNSYEPI.js} +1 -1
  47. package/chunks/{chunk-N4NDBIQS.js → chunk-QXSFQQGJ.js} +1 -1
  48. package/chunks/{chunk-OLHBVIWG.js → chunk-TBRDRQQK.js} +1 -1
  49. package/chunks/{chunk-DLBRD3UT.js → chunk-TTLUVJIR.js} +1 -1
  50. package/chunks/chunk-UTWYRNI6.js +17 -0
  51. package/chunks/{chunk-JFKHBLJB.js → chunk-UYGKTA3C.js} +1 -1
  52. package/chunks/chunk-VKB3B2FE.js +4 -0
  53. package/chunks/{chunk-IIFFSCDJ.js → chunk-VXVW4UNH.js} +1 -1
  54. package/chunks/{chunk-TZDEJTLC.js → chunk-WJI2X6IA.js} +1 -1
  55. package/chunks/{chunk-LYPDFFKK.js → chunk-YCI2VITZ.js} +1 -1
  56. package/chunks/chunk-YXETE4S3.js +4 -0
  57. package/chunks/chunk-Z2RL2SFY.js +4 -0
  58. package/chunks/{chunk-R3UCRXDC.js → chunk-ZQ7KN4HT.js} +1 -1
  59. package/chunks/{claude-code-UJYCO6CN.js → claude-code-RN3Q2VCK.js} +1 -1
  60. package/chunks/commitmsg-BRWGZ26L.js +15 -0
  61. package/chunks/{concern-I6LCWEIC.js → concern-DXCLVP5Y.js} +1 -1
  62. package/chunks/config-O3OOS5BQ.js +2 -0
  63. package/chunks/{dev-JM7NU24M.js → dev-NJVFMPTE.js} +1 -1
  64. package/chunks/done-HGZT3ZOT.js +2 -0
  65. package/chunks/{file-tools-shared-YKDNDDHR.js → file-tools-shared-IIW7WSUM.js} +1 -1
  66. package/chunks/free-IPJPYOJS.js +2 -0
  67. package/chunks/{gh-DJ2YTDQX.js → gh-YLYXDL2X.js} +2 -2
  68. package/chunks/{gh-contributors-SXUFX3SO.js → gh-contributors-YFATSPSW.js} +1 -1
  69. package/chunks/{init-GBMYF3YG.js → init-BZ6B74SY.js} +1 -1
  70. package/chunks/{init-M3P2QCX2.js → init-X6KNS3NC.js} +1 -1
  71. package/chunks/invoke-hook-KLJOYZF5.js +12 -0
  72. package/chunks/{kiro-V6SMU4OL.js → kiro-JS5UVLRL.js} +1 -1
  73. package/chunks/{list-NX7RRO6R.js → list-COFD6OUQ.js} +1 -1
  74. package/chunks/{list-ZVCGDRUH.js → list-RI4IF5TD.js} +1 -1
  75. package/chunks/{main-JAGIKKVD.js → main-JZTE4B4L.js} +1 -1
  76. package/chunks/manager-FMP6PKIR.js +7 -0
  77. package/chunks/{mod-VZT7JWPZ.js → mod-64M47KGW.js} +1 -1
  78. package/chunks/{mod-NSL6IJRQ.js → mod-CTW3YE4Q.js} +1 -1
  79. package/chunks/{mod-7ICCX4OY.js → mod-D5IDWU35.js} +1 -1
  80. package/chunks/{mod-5NDTGNVM.js → mod-DESWHMN6.js} +1 -1
  81. package/chunks/{mod-QCXWBSGJ.js → mod-MC2WNSB2.js} +1 -1
  82. package/chunks/{mod-2WMXZZGJ.js → mod-TUZZQKGZ.js} +1 -1
  83. package/chunks/{mod-KPIOBBDD.js → mod-YNYASB66.js} +1 -1
  84. package/chunks/next-6K3PS64Z.js +9 -0
  85. package/chunks/{ollama-DFG5G467.js → ollama-PL4UHEF2.js} +1 -1
  86. package/chunks/{opencode-UA45VV3W.js → opencode-K4G7UMAE.js} +1 -1
  87. package/chunks/{pack-7TGKWDRO.js → pack-YQVWUWCL.js} +1 -1
  88. package/chunks/{purge-IKPQWHBC.js → purge-ZQ23VDGR.js} +1 -1
  89. package/chunks/{release-SEKFNXRA.js → release-XACZAR6J.js} +2 -2
  90. package/chunks/{release-notes-UUCPVHBQ.js → release-notes-W6MNV6OT.js} +1 -1
  91. package/chunks/{release-tag-F4B6ICW4.js → release-tag-HSZX6WYU.js} +1 -1
  92. package/chunks/reopen-Z3MPVAGR.js +2 -0
  93. package/chunks/reset-NWO3MNAG.js +2 -0
  94. package/chunks/{rule-PQ6WRV5W.js → rule-CH5GMFKE.js} +1 -1
  95. package/chunks/run-5YOXFMP2.js +4 -0
  96. package/chunks/{run-DAKF5SJN.js → run-IMXYUDHS.js} +1 -1
  97. package/chunks/{scripts-VRQQ24O3.js → scripts-XTXYY5MJ.js} +1 -1
  98. package/chunks/{sdk-L2SQCWYV.js → sdk-EJKXYVDC.js} +8 -8
  99. package/chunks/{serve-OGJIE344.js → serve-3PZ7RBQY.js} +1 -1
  100. package/chunks/session-22XFZLH2.js +2 -0
  101. package/chunks/spec-PWS2UYVL.js +2 -0
  102. package/chunks/status-G5D6BYFF.js +2 -0
  103. package/chunks/{sync-N5STAT6M.js → sync-URY32B7Y.js} +1 -1
  104. package/chunks/{system-6GEEPUXD.js → system-CP5L6XUP.js} +1 -1
  105. package/chunks/{system-3236RFTI.js → system-N5A3SM5G.js} +1 -1
  106. package/chunks/{validate-bom-ME2NQAP3.js → validate-bom-EH5Z5TVU.js} +1 -1
  107. package/chunks/{validate-case-conflict-QUNIB43P.js → validate-case-conflict-XN4KQDSK.js} +1 -1
  108. package/chunks/{validate-circular-deps-DLUCIW7T.js → validate-circular-deps-YZ4DIXIM.js} +1 -1
  109. package/chunks/{validate-commit-msg-SRLJRTKU.js → validate-commit-msg-MXTBUPTC.js} +1 -1
  110. package/chunks/{validate-docs-43LWHLVW.js → validate-docs-BE32R2UM.js} +1 -1
  111. package/chunks/{validate-filenames-WNLZI2S6.js → validate-eof-JPKT2D3D.js} +1 -1
  112. package/chunks/{validate-export-names-D5I5DZTN.js → validate-export-names-D3QNF6VB.js} +1 -1
  113. package/chunks/{validate-eof-RV3IK6ZM.js → validate-filenames-DMZ46CRH.js} +1 -1
  114. package/chunks/{validate-json-6KIMBNBJ.js → validate-json-KG3U4NLK.js} +1 -1
  115. package/chunks/validate-large-files-C2ILVCDB.js +2 -0
  116. package/chunks/validate-licenses-P24RTTYG.js +2 -0
  117. package/chunks/validate-line-endings-F65GG2PC.js +2 -0
  118. package/chunks/validate-merge-conflict-PVT6WR2W.js +2 -0
  119. package/chunks/{validate-mod-exports-VCV4VZ5F.js → validate-mod-exports-J6KLADGR.js} +1 -1
  120. package/chunks/{validate-package-configs-6PGL2YGD.js → validate-package-configs-BFCQMBEI.js} +1 -1
  121. package/chunks/validate-secrets-RBD2KJ3R.js +2 -0
  122. package/chunks/validate-shebangs-L5YR7AGC.js +2 -0
  123. package/chunks/validate-submodules-HD7CSBOG.js +2 -0
  124. package/chunks/validate-symlinks-RPSZMV5Y.js +2 -0
  125. package/chunks/{validate-toml-PV3G7EFD.js → validate-toml-OMUYIHX2.js} +1 -1
  126. package/chunks/validate-trailing-whitespace-BIG3YYFY.js +2 -0
  127. package/chunks/{validate-yaml-IOMFQTSQ.js → validate-yaml-VTE42YLF.js} +1 -1
  128. package/chunks/{versions-ROLQITT5.js → versions-GXSXTSSG.js} +1 -1
  129. package/chunks/{watch-4NXY7JEX.js → watch-EVUCQISN.js} +6 -6
  130. package/chunks/wontfix-4R2ESAR5.js +2 -0
  131. package/eser.js +1 -1
  132. package/package.json +1 -1
  133. package/chunks/approve-UWBYGXCF.js +0 -2
  134. package/chunks/block-W76WKMS3.js +0 -2
  135. package/chunks/cancel-46C7E5N7.js +0 -2
  136. package/chunks/chunk-2HSGE3TL.js +0 -2
  137. package/chunks/chunk-2TANTKYS.js +0 -4
  138. package/chunks/chunk-C2IORZTF.js +0 -4
  139. package/chunks/chunk-DPZJWN2Y.js +0 -2
  140. package/chunks/chunk-EQUPVWVY.js +0 -2
  141. package/chunks/chunk-GVTM4EOU.js +0 -4
  142. package/chunks/chunk-LJ7A5HYR.js +0 -2
  143. package/chunks/chunk-TMMAF763.js +0 -10
  144. package/chunks/chunk-WZHVKEPB.js +0 -17
  145. package/chunks/chunk-XOMPQOI6.js +0 -4
  146. package/chunks/chunk-YACXTCWF.js +0 -2
  147. package/chunks/commitmsg-57EMHAFY.js +0 -11
  148. package/chunks/done-A5VWIFOF.js +0 -2
  149. package/chunks/free-5NMWMMYS.js +0 -2
  150. package/chunks/invoke-hook-6BKTP2JY.js +0 -12
  151. package/chunks/manager-GN6J4AUV.js +0 -7
  152. package/chunks/next-TIUOHHFS.js +0 -9
  153. package/chunks/reopen-G4IUIH73.js +0 -2
  154. package/chunks/reset-BJZ263XC.js +0 -2
  155. package/chunks/run-Y4ESAQUK.js +0 -4
  156. package/chunks/session-CFDY73RJ.js +0 -2
  157. package/chunks/spec-CYRR2XUA.js +0 -2
  158. package/chunks/status-ZE2SA6FP.js +0 -2
  159. package/chunks/validate-large-files-UXP7AZCW.js +0 -2
  160. package/chunks/validate-licenses-BL6PNSBP.js +0 -2
  161. package/chunks/validate-line-endings-NYHXORRG.js +0 -2
  162. package/chunks/validate-merge-conflict-IWUP4ZMW.js +0 -2
  163. package/chunks/validate-secrets-JV4ZSOVR.js +0 -2
  164. package/chunks/validate-shebangs-YACNWUG7.js +0 -2
  165. package/chunks/validate-submodules-ZXID3VEK.js +0 -2
  166. package/chunks/validate-symlinks-QNMKPYUY.js +0 -2
  167. package/chunks/validate-trailing-whitespace-5Q5SEHOD.js +0 -2
  168. package/chunks/wontfix-YSXRDPKA.js +0 -2
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-YXETE4S3.js";import{a as c}from"./chunk-J7YTWK67.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),a=f(e.messages,e.system),o=p(this.binary,r,{signal:n,stdinData:a}),l=m(o.stderr),s=o.stdout.getReader(),i=[],d=new TextDecoder,g=await s.read();for(;g.done!==!0;)i.push(d.decode(g.value,{stream:!0})),g=await s.read();s.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=i.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",a=w(this.config,e,r),o=f(e.messages,e.system),l=p(this.binary,a,{signal:n,stdinData:o}),s=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,s):yield*this.#e(l,s)}catch(i){i instanceof c?yield{kind:"error",error:i}:yield{kind:"error",error:new c(i instanceof Error?i.message:String(i),{provider:"claude-code",cause:i instanceof Error?i:void 0})}}}async*#e(e,n){let r=new TextDecoder,a=e.stdout.getReader(),o=await a.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await a.read()}a.releaseLock();let l=await e.waitForExit(),s=await n,i=u("claude-code",l.code,s);i!==null?yield{kind:"error",error:i}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let s=E(l);s!==null&&(yield s)}let r=await e.waitForExit(),a=await n,o=u("claude-code",r.code,a);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let a=t.properties?.maxTurns;a!==void 0&&r.push("--max-turns",String(a));let o=t.properties?.allowedTools;if(o!==void 0)for(let s of o)r.push("--allowedTools",s);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as a,P as b};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as i}from"./chunk-ATYDQCCJ.js";import{j as a}from"./chunk-6DBKPC2O.js";var s=i({name:"validate-symlinks",description:"Detect broken symlinks",canFix:!1,stacks:[],defaults:{},async checkAll(n){let o=[];for(let t of n)if(t.isSymlink)try{await a.runtime.fs.stat(t.path)}catch{o.push({path:t.path,message:"broken symlink \u2014 target not found"})}return o}}),l=s.run,c=s.validator,m=s.main;export{s as a,l as b,c,m as d};
2
+ import{a as i}from"./chunk-MGNBNMJZ.js";import{j as a}from"./chunk-6DBKPC2O.js";var s=i({name:"validate-symlinks",description:"Detect broken symlinks",canFix:!1,stacks:[],defaults:{},async checkAll(n){let o=[];for(let t of n)if(t.isSymlink)try{await a.runtime.fs.stat(t.path)}catch{o.push({path:t.path,message:"broken symlink \u2014 target not found"})}return o}}),l=s.run,c=s.validator,m=s.main;export{s as a,l as b,c,m as d};
@@ -1,11 +1,11 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{c as y}from"./chunk-TMMAF763.js";import{a as b}from"./chunk-UEMWZOIU.js";import{i as n}from"./chunk-6DBKPC2O.js";var S="<!-- noskills:start -->",g="<!-- noskills:end -->",Y=(e,t,s="npx eser noskills")=>{let o=[S,"## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${s} spec <name> next # get current instruction`,` ${s} spec <name> next --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `spec <name>`.","Never omit it. Use `"+s+" spec list` to see available specs.","","### Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" spec <name> next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","### When to call noskills next","",`You MUST call \`${s} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];if((t?.allowGit??!1)||o.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),o.push("","### Interactive choices","","When noskills output contains `interactiveOptions`, you MUST present them","using the AskUserQuestion tool. NEVER present options in prose.","","This is not optional. If you ask a question without AskUserQuestion when","interactiveOptions are present, you are violating protocol.","","Pass interactiveOptions as the `options` array in AskUserQuestion.","Use the `commandMap` to resolve the user's selection to a CLI command.","","### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${s} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### Pre-discovery research","","When starting a new spec, noskills may flag technologies that need","research. Before asking discovery questions, search for current versions","and API status of flagged technologies. Report findings to the user.","Your training data may be outdated \u2014 always verify.","","### Spec splitting","","When noskills suggests splitting a spec, present the options and wait for the","user's decision. Never split a spec without explicit user approval.","","### Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","### Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.","","### Phase progress","","Every noskills output includes a roadmap showing the current phase.","Display it to the user. At critical transitions (approve, start execution),","noskills shows a gate with an explicit action. Present these prominently.","","### Code quality rules","","These rules apply during spec execution:","- After every file edit, run type-check and lint before reporting success","- Files over 500 LOC: read in chunks, never assume single read = full file","- If search returns few results, re-run narrower \u2014 assume truncation","- Re-read every file before and after editing","- Before refactoring large files, clean dead code first (separate commit)","","### Execution commitment","","Once a spec enters EXECUTING, complete it. Do not suggest mid-execution",'checkpoints, pauses, or "should we stop here?" questions.',"","noskills encourages small, meaningful specs defined during discovery.","If a spec is well-scoped, there is no reason to stop halfway \u2014 half-done","delivers nothing. If it feels too large mid-execution, that means","discovery should have split it. Finish this one, improve the next."),e.length>0){o.push("","### Active Rules","");for(let i of e)o.push(`- ${i}`)}return o.push(g),o.join(`
2
+ import{c as y}from"./chunk-KNIM3QST.js";import{a as b}from"./chunk-UEMWZOIU.js";import{i as n}from"./chunk-6DBKPC2O.js";var S="<!-- noskills:start -->",g="<!-- noskills:end -->",Y=(e,t,s="npx eser noskills")=>{let o=[S,"## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${s} spec <name> next # get current instruction`,` ${s} spec <name> next --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `spec <name>`.","Never omit it. Use `"+s+" spec list` to see available specs.","","### Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" spec <name> next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","### When to call noskills next","",`You MUST call \`${s} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];if((t?.allowGit??!1)||o.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),o.push("","### Interactive choices","","When noskills output contains `interactiveOptions`, you MUST present them","using the AskUserQuestion tool. NEVER present options in prose.","","This is not optional. If you ask a question without AskUserQuestion when","interactiveOptions are present, you are violating protocol.","","Pass interactiveOptions as the `options` array in AskUserQuestion.","Use the `commandMap` to resolve the user's selection to a CLI command.","","### Convention discovery","","When you notice a recurring pattern, receive a correction, or discover","a project quirk during any phase:","",'1. Ask: "Should this be a permanent rule?"',`2. If yes: \`${s} rule add "description" --phases=EXECUTING\``,"3. If just this spec: note it and move on","","Corrections are learnings. Capture them as rules so they compound.","Every session should leave the project's rule set slightly better.","Never write to `.eser/rules/` directly.","","### Creating specs","","When the user describes what they want to build, create a spec immediately:",`\`${s} spec new "user's description here"\``,"","The name is auto-generated from the description. Encourage the user to share","as much context as possible \u2014 detailed requirements produce better discovery.","Do NOT ask for a 'short slug' \u2014 just take what the user gives you and create","the spec. A one-liner, meeting notes, task list, or full requirements doc all work.","","### Pre-discovery research","","When starting a new spec, noskills may flag technologies that need","research. Before asking discovery questions, search for current versions","and API status of flagged technologies. Report findings to the user.","Your training data may be outdated \u2014 always verify.","","### Plan-based discovery","","When a spec is created with --from-plan, the first discovery output includes","the plan content. Read it, extract answers for all 6 questions, present them","for user confirmation. The plan is a starting point, not the final answer.","","### Discovery modes","","noskills offers 5 discovery modes selected at the start of each spec:","- full: Standard 6 questions (default)","- validate: Challenge the user's existing plan","- technical-depth: Focus on architecture and integration","- ship-fast: Minimum viable scope","- explore: Think bigger, find opportunities","","### Premise challenge","","After mode selection, challenge 2-4 premises from the spec description.","Present each premise for the user to agree/disagree. Submit as JSON.","","### Alternatives generation","","Before spec draft, propose 2-3 implementation approaches.","User picks one or skips. The selected approach shapes the spec.","","### AI slop prevention","","When implementing UI, avoid these generic AI-generated patterns:","- 3-column grids with icon circles (the most recognizable AI layout)","- Purple gradients, decorative blobs, wavy dividers","- Everything centered, uniform border-radius everywhere",'- Generic hero copy ("Welcome to...", "Unlock the power of...")',"- Cookie-cutter section rhythm","","Every UI element must feel intentional, not generated. If it looks like","every other AI-built site, iterate until it doesn't.","","### Spec splitting","","When noskills suggests splitting a spec, present the options and wait for the","user's decision. Never split a spec without explicit user approval.","","### Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","### Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.","","### Phase progress","","Every noskills output includes a roadmap showing the current phase.","Display it to the user. At critical transitions (approve, start execution),","noskills shows a gate with an explicit action. Present these prominently.","","### Code quality rules","","These rules apply during spec execution:","- After every file edit, run type-check and lint before reporting success","- Files over 500 LOC: read in chunks, never assume single read = full file","- If search returns few results, re-run narrower \u2014 assume truncation","- Re-read every file before and after editing","- Before refactoring large files, clean dead code first (separate commit)","","### Execution commitment","","Once a spec enters EXECUTING, complete it. Do not suggest mid-execution",'checkpoints, pauses, or "should we stop here?" questions.',"","noskills encourages small, meaningful specs defined during discovery.","If a spec is well-scoped, there is no reason to stop halfway \u2014 half-done","delivers nothing. If it feels too large mid-execution, that means","discovery should have split it. Finish this one, improve the next."),e.length>0){o.push("","### Active Rules","");for(let i of e)o.push(`- ${i}`)}return o.push(g),o.join(`
3
3
  `)},x=async(e,t,s,o="npx eser noskills")=>{let i=`${e}/CLAUDE.md`,r=Y(t,s,o),a;try{a=await n.fs.readTextFile(i);let c=a.indexOf(S),l=a.indexOf(g);c!==-1&&l!==-1?a=a.slice(0,c)+r+a.slice(l+g.length):a=a.trimEnd()+`
4
4
 
5
5
  `+r+`
6
6
  `}catch{a=r+`
7
7
  `}await n.fs.writeTextFile(i,a)};var J=e=>({hooks:{PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[{type:"command",command:`${e} invoke-hook pre-tool-use`,timeout:5}]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[{type:"command",command:`${e} invoke-hook post-file-write`,timeout:3}]},{matcher:"Bash",hooks:[{type:"command",command:`${e} invoke-hook post-bash`,timeout:3}]}],Stop:[{hooks:[{type:"command",command:`${e} invoke-hook stop`,timeout:10}]}],SessionStart:[{hooks:[{type:"command",command:`${e} invoke-hook session-start`,timeout:5}]}]}}),R=async(e,t="npx eser@latest noskills")=>{let s=`${e}/.claude/settings.json`,o={};try{let a=await n.fs.readTextFile(s);o=JSON.parse(a)}catch{}let i=J(t),r={...o,...i};await n.fs.mkdir(`${e}/.claude`,{recursive:!0}),await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
8
- `)};var q=async(e,t)=>{let s=`${e}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0});let o=`---
8
+ `)};var V=async(e,t)=>{let s=`${e}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0});let o=`---
9
9
  name: noskills-executor
10
10
  description: "Executes a single noskills task."
11
11
  tools: Read, Edit, MultiEdit, Write, Bash, Grep, Glob, LS
@@ -60,7 +60,7 @@ When finished, provide a structured JSON summary:
60
60
  \\\`\\\`\\\`
61
61
 
62
62
  The orchestrator will use this report for the noskills status report.
63
- `)},A={id:"claude-code",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!1,interaction:{hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"}},async syncRules(e,t){await x(e.root,e.rules,t,e.commandPrefix)},async syncHooks(e,t){await R(e.root,e.commandPrefix)},async syncAgents(e,t){await q(e.root,e.commandPrefix),await K(e.root,e.commandPrefix)}};var T=async(e,t,s="npx eser noskills")=>{let o=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.","","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","","## Execution model","","Execute tasks sequentially in this context. Do not attempt to spawn sub-agents.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.writeTextFile(`${e}/.cursorrules`,o.join(`
63
+ `)},A={id:"claude-code",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!1,interaction:{hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"}},async syncRules(e,t){await x(e.root,e.rules,t,e.commandPrefix)},async syncHooks(e,t){await R(e.root,e.commandPrefix)},async syncAgents(e,t){await V(e.root,e.commandPrefix),await K(e.root,e.commandPrefix)}};var T=async(e,t,s="npx eser noskills")=>{let o=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+s+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.","","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","","## Execution model","","Execute tasks sequentially in this context. Do not attempt to spawn sub-agents.",""];if(t.length>0){o.push("## Rules","");for(let i of t)o.push(`- ${i}`);o.push("")}await n.fs.writeTextFile(`${e}/.cursorrules`,o.join(`
64
64
  `))};var C={id:"cursor",capabilities:{rules:!0,hooks:!1,agents:!1,specs:!1,mcp:!1,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!1,subAgentMethod:"none"}},async syncRules(e){await T(e.root,e.rules,e.commandPrefix)}};var X=".kiro/steering",O=".kiro/settings",Z=".kiro/agents",ee=".kiro/specs",te="hooks.json",se="mcp.json",oe="noskills-protocol.md",ne="noskills-coaching.md",k="noskills-rules.md",N="conventions.md",ie="noskills-executor.json",re="noskills-verifier.json",ae=(e,t)=>{let s=["---","inclusion: always","---","","# noskills Protocol","","# Generated by noskills \u2014 do not edit manually","","## What is noskills","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","## Protocol","",` ${e} spec <name> next # get current instruction`,` ${e} spec <name> next --answer="your response" # submit result and advance`,"","Every noskills command that operates on a spec MUST include `spec <name>`.",`Never omit it. Use \`${e} spec list\` to see available specs.`,"","## Why noskills calls matter","","noskills is not a form to fill out. It is a live state machine that the user","watches in real-time. Every `"+e+" next --answer` call:","","- Updates the spec file on disk (the user sees it change)","- Updates the terminal dashboard if `noskills watch` is running","- Advances the state machine to the next phase","- Records the decision permanently in the project history","","When you batch-submit answers or backfill discovery responses yourself,","the user sees nothing happening \u2014 then suddenly everything jumps forward.","This defeats the purpose.","","Call noskills ONCE per interaction. Ask the user ONE question. Wait for","their answer. Submit it. Ask the next. The user is watching every step.","Do NOT pre-fill answers. Do NOT batch multiple answers. Do NOT answer","discovery questions yourself \u2014 the user's input is the data.","","## When to call noskills next","",`You MUST call \`${e} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];return(t?.allowGit??!1)||s.push("","## Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),s.push("","## Interactive choices","","Present choices as numbered lists. Users select by number.","When interactiveOptions are present in noskills output, present each as a","numbered item with its label and description. Ask the user to pick a number.","Use the `commandMap` to resolve the user's selection to a CLI command.","","## Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","## Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","## JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state.",""),s.join(`
65
65
  `)},ce=e=>["---","inclusion: auto","name: noskills-coaching",'description: "Guidance for noskills spec-driven development workflow, including convention discovery and rule promotion"',"---","","# noskills Coaching","","# Generated by noskills \u2014 do not edit manually","","## Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${e} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","## How to promote rules","","When a convention should be permanent, use the noskills CLI to register it:","",` ${e} rule add "<description of the rule>"`,"","This stores the rule in `.eser/rules/` and ensures it is synced to all","coding tools on the next `noskills sync`. Never edit `.eser/rules/` directly.",""].join(`
66
66
  `),le=e=>{let t=["---","inclusion: always","---","","# noskills Rules","","# Generated by noskills \u2014 do not edit manually","","## Active Rules",""];for(let s of e)t.push(`- ${s}`);return t.push(""),t.join(`
@@ -92,20 +92,20 @@ The orchestrator will use this report for the noskills status report.
92
92
  `),Me=e=>{let s=e.match(/^# Spec:\s*(.+)$/m)?.[1]?.trim()??"Untitled",o=new Map,i=e.split(/^## /m);for(let a of i){let c=a.indexOf(`
93
93
  `);if(c===-1)continue;let l=a.slice(0,c).trim().toLowerCase(),u=a.slice(c+1).trim();o.set(l,u)}let r=a=>{for(let[c,l]of o)if(c.startsWith(a.toLowerCase()))return l;return""};return{title:s,concerns:r("concerns"),discoveryAnswers:r("discovery answers"),contributorGuide:r("contributor guide"),publicApi:r("public api"),outOfScope:r("out of scope"),tasks:r("tasks"),verification:r("verification")}},Fe=e=>{let t=["---",`name: ${e.title}`,`description: "noskills spec: ${e.title}"`,"---","",`# ${e.title}`,""];return e.discoveryAnswers&&t.push("## Overview","",e.discoveryAnswers,""),e.concerns&&t.push("## Concerns","",e.concerns,""),e.contributorGuide&&t.push("## Contributor Guide","",e.contributorGuide,""),e.publicApi&&t.push("## Public API","",e.publicApi,""),e.outOfScope&&t.push("## Out of Scope","",e.outOfScope,""),e.tasks&&t.push("## Tasks","",e.tasks,""),e.verification&&t.push("## Verification","",e.verification,""),t.join(`
94
94
  `)},Pe=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},U={id:"opencode",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!0,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"delegation"}},async syncRules(e,t){await m(e,t)},async syncHooks(e,t){let s=`${e.root}/${Ce}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills.ts`,$e(e.commandPrefix))},async syncAgents(e,t){let s=`${e.root}/${Oe}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.md`,Ie(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.md`,De())},async syncSpecs(e,t){let s;try{s=await n.fs.readTextFile(t)}catch{return}if(s.trim()==="")return;let o=t.split("/"),i=o[o.length-2]??"unknown",r=Me(s),a=`${e.root}/${Ne}`;await n.fs.mkdir(a,{recursive:!0}),await n.fs.writeTextFile(`${a}/${i}.md`,Fe(r))},async syncMcp(e){let t=`${e.root}/${Ee}`,s={};if(await Pe(t))try{let c=await n.fs.readTextFile(t);s=JSON.parse(c)}catch{}let o=e.commandPrefix.split(/\s+/),i=o[0]??"npx",r=[...o.slice(1),"mcp-serve"],a={...s,mcp:{...s.mcp,noskills:{type:"local",command:i,args:r}}};await n.fs.writeTextFile(t,JSON.stringify(a,null,2)+`
95
- `)}};var je=".codex",We="hooks.json",_e=".codex/agents",He=".codex/config.toml",Le=e=>({hooks:[{_noskills:!0,event:"SessionStart",command:`${e} invoke-hook session-start`,timeout:5e3},{_noskills:!0,event:"PreToolUse",command:`${e} invoke-hook pre-tool-use`,timeout:5e3},{_noskills:!0,event:"PostToolUse",command:`${e} invoke-hook post-file-write`,timeout:3e3},{_noskills:!0,event:"Stop",command:`${e} invoke-hook stop`,timeout:1e4}]}),Ye=e=>['name = "noskills-executor"','description = "Executes a single noskills task. Follows spec behavioral rules and reports structured results."','developer_instructions = """',["You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"],',' "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"],',' "verification": {"typeCheck": "pass|fail", "tests": "pass|fail"}}',"","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`].join(`
95
+ `)}};var We=".codex",je="hooks.json",_e=".codex/agents",He=".codex/config.toml",Le=e=>({hooks:[{_noskills:!0,event:"SessionStart",command:`${e} invoke-hook session-start`,timeout:5e3},{_noskills:!0,event:"PreToolUse",command:`${e} invoke-hook pre-tool-use`,timeout:5e3},{_noskills:!0,event:"PostToolUse",command:`${e} invoke-hook post-file-write`,timeout:3e3},{_noskills:!0,event:"Stop",command:`${e} invoke-hook stop`,timeout:1e4}]}),Ye=e=>['name = "noskills-executor"','description = "Executes a single noskills task. Follows spec behavioral rules and reports structured results."','developer_instructions = """',["You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"],',' "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"],',' "verification": {"typeCheck": "pass|fail", "tests": "pass|fail"}}',"","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`].join(`
96
96
  `),'"""',""].join(`
97
97
  `),Ge=()=>['name = "noskills-verifier"',`description = "Independently verifies completed task work. Read-only. Never sees the executor's context."`,'developer_instructions = """',["You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## Report Format","When finished, provide a structured JSON summary:",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."},',' {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"","The orchestrator will use this report for the noskills status report."].join(`
98
98
  `),'"""',""].join(`
99
99
  `),Je=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"].map(i=>`"${i}"`).join(", ");return`[mcp_servers.noskills]
100
100
  command = "${s}"
101
101
  args = [${o}]
102
- `},Ve=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},j={id:"codex",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"spawn"}},async syncRules(e,t){await m(e,t)},async syncHooks(e,t){let s=`${e.root}/${je}`,o=`${s}/${We}`;await n.fs.mkdir(s,{recursive:!0});let i=[];try{let l=await n.fs.readTextFile(o),u=JSON.parse(l);Array.isArray(u.hooks)&&(i=u.hooks)}catch{}let r=i.filter(l=>!l._noskills),a=Le(e.commandPrefix),c={hooks:[...r,...a.hooks]};await n.fs.writeTextFile(o,JSON.stringify(c,null,2)+`
103
- `)},async syncAgents(e,t){let s=`${e.root}/${_e}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.toml`,Ye(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.toml`,Ge())},async syncMcp(e){let t=`${e.root}/${He}`;await n.fs.mkdir(`${e.root}/.codex`,{recursive:!0});let s="";if(await Ve(t))try{s=await n.fs.readTextFile(t)}catch{}let o=s.replace(/\[mcp_servers\.noskills\][\s\S]*?(?=\[|$)/,"").trimEnd(),i=Je(e.commandPrefix),r=o+(o.length>0?`
102
+ `},qe=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},W={id:"codex",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"spawn"}},async syncRules(e,t){await m(e,t)},async syncHooks(e,t){let s=`${e.root}/${We}`,o=`${s}/${je}`;await n.fs.mkdir(s,{recursive:!0});let i=[];try{let l=await n.fs.readTextFile(o),u=JSON.parse(l);Array.isArray(u.hooks)&&(i=u.hooks)}catch{}let r=i.filter(l=>!l._noskills),a=Le(e.commandPrefix),c={hooks:[...r,...a.hooks]};await n.fs.writeTextFile(o,JSON.stringify(c,null,2)+`
103
+ `)},async syncAgents(e,t){let s=`${e.root}/${_e}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.toml`,Ye(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.toml`,Ge())},async syncMcp(e){let t=`${e.root}/${He}`;await n.fs.mkdir(`${e.root}/.codex`,{recursive:!0});let s="";if(await qe(t))try{s=await n.fs.readTextFile(t)}catch{}let o=s.replace(/\[mcp_servers\.noskills\][\s\S]*?(?=\[|$)/,"").trimEnd(),i=Je(e.commandPrefix),r=o+(o.length>0?`
104
104
 
105
105
  `:"")+i;await n.fs.writeTextFile(t,r)}};var Ke=".github/hooks",Be="noskills.json",ze=".github/agents",Qe=".copilot",Xe="mcp.json",Ze=e=>({version:1,hooks:{"noskills:sessionStart":{_noskills:!0,command:["bash","-c",`${e} invoke-hook session-start`],timeoutSec:5},"noskills:preToolUse":{_noskills:!0,command:["bash","-c",`${e} invoke-hook pre-tool-use`],timeoutSec:5},"noskills:postToolUse":{_noskills:!0,command:["bash","-c",`${e} invoke-hook post-file-write`],timeoutSec:3},"noskills:agentStop":{_noskills:!0,command:["bash","-c",`${e} invoke-hook stop`],timeoutSec:10}}}),et=e=>["---","name: noskills-executor",'description: "Executes a single noskills task. Follows spec behavioral rules and reports structured results."',"tools:"," - read"," - write"," - glob"," - grep"," - shell","---","","You are executing a single task from a noskills spec.","Your ONLY job is to complete the task described in the prompt.","Follow all behavioral rules provided in the prompt.","Do NOT start new tasks, explore unrelated code, or make architectural decisions.","If the task is too vague to execute, say so immediately.","","## Self-Verification","After completing the task, you MUST verify your own work before reporting:","1. Run type check: `deno check` on all modified files","2. Run test suite: `deno test` on the relevant test files","3. If type check or tests fail, fix the issues before reporting","","## Reporting","When finished, provide a structured JSON summary:","```json",'{"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}',"```","","Do NOT return raw test output \u2014 summarize it in the verification field.",`The orchestrator will submit this to \`${e} next --answer\` on your behalf.`,""].join(`
106
106
  `),tt=()=>["---","name: noskills-verifier",`description: "Independently verifies completed task work. Read-only. Never sees the executor's context."`,"tools:"," - read"," - glob"," - grep"," - shell","---","","You are verifying another agent's work. You have NO context about how it was done.","Read the changed files. Run the test suite. Check each acceptance criterion independently.","","For each acceptance criterion:","- PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it","- FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match","","Be skeptical. Don't assume anything works \u2014 verify it yourself.","You CANNOT edit files. Read-only access only.","","## Verification Steps","1. Read each modified file and verify the changes are correct","2. Run type check: `deno check` on modified files","3. Run tests: `deno test` on relevant test files","4. Check each acceptance criterion against actual file contents","","## Report Format","When finished, provide a structured JSON summary:","```json",'{"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}',"```","","The orchestrator will use this report for the noskills status report.",""].join(`
107
- `),st=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"];return{mcpServers:{noskills:{type:"local",command:s,args:o,tools:["*"]}}}},ot=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},W={id:"copilot-cli",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"fleet"}},async syncRules(e,t){await m(e,t),await f(e.root,e.rules,e.commandPrefix)},async syncHooks(e,t){let s=`${e.root}/${Ke}`,o=`${s}/${Be}`;await n.fs.mkdir(s,{recursive:!0});let i={};try{let l=await n.fs.readTextFile(o),u=JSON.parse(l);u.hooks!==void 0&&u.hooks!==null&&(i=u.hooks)}catch{}let r={};for(let[l,u]of Object.entries(i))u._noskills||(r[l]=u);let a=Ze(e.commandPrefix),c={version:1,hooks:{...r,...a.hooks}};await n.fs.writeTextFile(o,JSON.stringify(c,null,2)+`
107
+ `),st=e=>{let t=e.split(/\s+/),s=t[0]??"npx",o=[...t.slice(1),"mcp-serve"];return{mcpServers:{noskills:{type:"local",command:s,args:o,tools:["*"]}}}},ot=async e=>{try{return await n.fs.stat(e),!0}catch{return!1}},j={id:"copilot-cli",capabilities:{rules:!0,hooks:!0,agents:!0,specs:!1,mcp:!0,interaction:{hasAskUserTool:!1,optionPresentation:"prose",hasSubAgentDelegation:!0,subAgentMethod:"fleet"}},async syncRules(e,t){await m(e,t),await f(e.root,e.rules,e.commandPrefix)},async syncHooks(e,t){let s=`${e.root}/${Ke}`,o=`${s}/${Be}`;await n.fs.mkdir(s,{recursive:!0});let i={};try{let l=await n.fs.readTextFile(o),u=JSON.parse(l);u.hooks!==void 0&&u.hooks!==null&&(i=u.hooks)}catch{}let r={};for(let[l,u]of Object.entries(i))u._noskills||(r[l]=u);let a=Ze(e.commandPrefix),c={version:1,hooks:{...r,...a.hooks}};await n.fs.writeTextFile(o,JSON.stringify(c,null,2)+`
108
108
  `)},async syncAgents(e,t){let s=`${e.root}/${ze}`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-executor.agent.md`,et(e.commandPrefix)),await n.fs.writeTextFile(`${s}/noskills-verifier.agent.md`,tt())},async syncMcp(e){let t=`${e.root}/${Qe}`,s=`${t}/${Xe}`;await n.fs.mkdir(t,{recursive:!0});let o={mcpServers:{}};if(await ot(s))try{let a=await n.fs.readTextFile(s),c=JSON.parse(a);c.mcpServers!==void 0&&c.mcpServers!==null&&(o=c)}catch{}let i=st(e.commandPrefix),r={...o,mcpServers:{...o.mcpServers,...i.mcpServers}};await n.fs.writeTextFile(s,JSON.stringify(r,null,2)+`
109
109
  `)}};var it=e=>{let t=e.trim();if(!t.startsWith("---"))return{meta:{},body:t};let s=t.indexOf("---",3);if(s===-1)return{meta:{},body:t};let o=t.slice(3,s).trim(),i=t.slice(s+3).trim(),r={};for(let a of o.split(`
110
110
  `)){let c=a.indexOf(":");if(c===-1)continue;let l=a.slice(0,c).trim(),u=a.slice(c+1).trim();if(u.startsWith("[")&&u.endsWith("]")){let d=u.slice(1,-1).split(",").map(p=>p.trim().replace(/^["']|["']$/g,"")).filter(p=>p.length>0);r[l]=d}else r[l]=u.replace(/^["']|["']$/g,"")}return{meta:r,body:i}},rt=async e=>{let t=`${e}/${y.rulesDir}`,s=[];try{for await(let o of n.fs.readDir(t))if(o.isFile&&(o.name.endsWith(".md")||o.name.endsWith(".txt"))){let i=await n.fs.readTextFile(`${t}/${o.name}`),{meta:r,body:a}=it(i),c=a.split(`
111
- `)[0]??a;s.push({text:c,phases:Array.isArray(r.phases)?r.phases:void 0,appliesTo:Array.isArray(r.applies_to)?r.applies_to:void 0})}}catch{}return s},ft=(e,t,s)=>e.filter(o=>!(o.phases!==void 0&&o.phases.length>0&&!o.phases.includes(t)||o.appliesTo!==void 0&&o.appliesTo.length>0&&s!==void 0&&s.length>0&&!o.appliesTo.some(r=>{let a=r.startsWith("*.")?r.slice(1):null;return a!==null?s.some(c=>c.endsWith(a)):s.some(c=>c.includes(r.replace(/\*/g,"")))}))).map(o=>o.text),at=async e=>(await rt(e)).map(s=>s.text),H=[A,C,$,D,F,U,j,W],_={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},yt=e=>{let t=e[0];return t===void 0?_:H.find(o=>o.id===t)?.capabilities.interaction??_},gt=async(e,t,s)=>{let o=await at(e),i=[],r={allowGit:s?.allowGit??!1},a=s?.command??"npx eser@latest noskills";b(a);for(let c of t){let l=H.find(d=>d.id===c);if(l===void 0)continue;let u={root:e,rules:o,commandPrefix:a};if(await l.syncRules(u,r),l.capabilities.hooks&&l.syncHooks!==void 0&&await l.syncHooks(u,r),l.capabilities.agents&&l.syncAgents!==void 0&&await l.syncAgents(u,r),l.capabilities.specs&&l.syncSpecs!==void 0){let d=`${e}/${y.specsDir}`;try{for await(let p of n.fs.readDir(d))if(p.isDirectory){let L=`${d}/${p.name}/spec.md`;await l.syncSpecs(u,L)}}catch{}}l.capabilities.mcp&&l.syncMcp!==void 0&&await l.syncMcp(u),i.push(c)}return t.includes("claude-code")&&i.push("hooks"),i};export{rt as a,ft as b,at as c,yt as d,gt as e};
111
+ `)[0]??a;s.push({text:c,phases:Array.isArray(r.phases)?r.phases:void 0,appliesTo:Array.isArray(r.applies_to)?r.applies_to:void 0})}}catch{}return s},ft=(e,t,s)=>e.filter(o=>!(o.phases!==void 0&&o.phases.length>0&&!o.phases.includes(t)||o.appliesTo!==void 0&&o.appliesTo.length>0&&s!==void 0&&s.length>0&&!o.appliesTo.some(r=>{let a=r.startsWith("*.")?r.slice(1):null;return a!==null?s.some(c=>c.endsWith(a)):s.some(c=>c.includes(r.replace(/\*/g,"")))}))).map(o=>o.text),at=async e=>(await rt(e)).map(s=>s.text),H=[A,C,$,D,F,U,W,j],_={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},yt=e=>{let t=e[0];return t===void 0?_:H.find(o=>o.id===t)?.capabilities.interaction??_},gt=async(e,t,s)=>{let o=await at(e),i=[],r={allowGit:s?.allowGit??!1},a=s?.command??"npx eser@latest noskills";b(a);for(let c of t){let l=H.find(d=>d.id===c);if(l===void 0)continue;let u={root:e,rules:o,commandPrefix:a};if(await l.syncRules(u,r),l.capabilities.hooks&&l.syncHooks!==void 0&&await l.syncHooks(u,r),l.capabilities.agents&&l.syncAgents!==void 0&&await l.syncAgents(u,r),l.capabilities.specs&&l.syncSpecs!==void 0){let d=`${e}/${y.specsDir}`;try{for await(let p of n.fs.readDir(d))if(p.isDirectory){let L=`${d}/${p.name}/spec.md`;await l.syncSpecs(u,L)}}catch{}}l.capabilities.mcp&&l.syncMcp!==void 0&&await l.syncMcp(u),i.push(c)}return t.includes("claude-code")&&i.push("hooks"),i};export{rt as a,ft as b,at as c,yt as d,gt as e};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as t}from"./chunk-ATYDQCCJ.js";var n=t({name:"validate-line-endings",description:"Normalize line endings to LF",canFix:!0,stacks:[],defaults:{},checkFile(i,e){return e===void 0?[]:e.includes("\r")?[{path:i.path,message:"file contains CRLF or CR line endings"}]:[]},fixFile(i,e){let r=e.replace(/\r\n/g,`
2
+ import{a as t}from"./chunk-MGNBNMJZ.js";var n=t({name:"validate-line-endings",description:"Normalize line endings to LF",canFix:!0,stacks:[],defaults:{},checkFile(i,e){return e===void 0?[]:e.includes("\r")?[{path:i.path,message:"file contains CRLF or CR line endings"}]:[]},fixFile(i,e){let r=e.replace(/\r\n/g,`
3
3
  `).replace(/\r/g,`
4
4
  `);if(r!==e)return{path:i.path,oldContent:e,newContent:r}}}),s=n.run,d=n.validator,p=n.main;export{n as a,s as b,d as c,p as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as e}from"./chunk-NMEPQK3T.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-M3VS3GIJ.js")},list:{description:"List available AI providers",load:()=>import("./list-NX7RRO6R.js")}}});export{i as a};
2
+ import{a as e}from"./chunk-NMEPQK3T.js";var i=new e({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-6DWHUCLO.js")},list:{description:"List available AI providers",load:()=>import("./list-COFD6OUQ.js")}}});export{i as a};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as b,b as w,d as F,f as D}from"./chunk-3D5TBTM3.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-O325ZU5M.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
2
+ import{a as b,b as w,d as F,f as D}from"./chunk-HTC2FO4I.js";import{a as C}from"./chunk-LFNUSULJ.js";import{b as h}from"./chunk-JTSRGXS4.js";import{f as R}from"./chunk-P2MUEKFT.js";import{b as l,f as m,g as k,h as A,i as g}from"./chunk-YVN2NZL4.js";import{g as d}from"./chunk-FFWPJP7A.js";var x=(e,r)=>{let o={},t=e.length;for(let s=0;s<t;s++){let n=e[s],a=r(n);o[a]===void 0?o[a]=[n]:o[a].push(n)}return o};var u=h(),P=(e,r)=>e===r?!0:typeof e!=typeof r||typeof e!="object"||e===null||r===null?!1:JSON.stringify(e)===JSON.stringify(r),O=(e,r)=>e[r],j=e=>e.startsWith("npm:@jsr/"),B=e=>{let r=e.slice(9),o=r.indexOf("__");if(o===-1)throw new Error(`Invalid npm JSR format: ${e}`);let t=r.slice(0,o),s=r.slice(o+2),n=s.indexOf("@"),a,p;return n===-1?(a=s,p=""):(a=s.slice(0,n),p=s.slice(n)),`jsr:@${t}/${a}${p}`},_=(e,r)=>j(r)?B(r):r.startsWith("npm:")?r:`npm:${e}@${r}`,S=e=>e==="workspace:*"||e.startsWith("workspace:"),M=(e,r,o)=>{let t=[],s=r.dependencies??{},n=r.devDependencies??{},a={...s,...n},p=o.imports??{};for(let[y,c]of Object.entries(a)){if(S(c))continue;let f=_(y,c),i=p[y];i===void 0?t.push({packageName:e,dependencyName:y,issue:"missing_in_deno",expected:f}):i!==f&&t.push({packageName:e,dependencyName:y,issue:"version_mismatch",expected:f,actual:i})}for(let[y,c]of Object.entries(p))a[y]===void 0&&t.push({packageName:e,dependencyName:y,issue:"missing_in_package",actual:p[y]});return t},G=async(e,r)=>{let o=[],t=[],s=await w({baseDir:e,includeFiles:[b.DenoJson,b.PackageJson]}),n=s._loadedFiles.find(c=>c.fileType===b.DenoJson),a=s._loadedFiles.find(c=>c.fileType===b.PackageJson);if(n===void 0||a===void 0)return{inconsistencies:[],dependencyInconsistencies:[]};let p=["name","version","exports"];for(let c of p){let f=O(n.content,c),i=O(a.content,c);f===void 0||i===void 0||P(f,i)||o.push({packageName:r,field:c,denoValue:f,packageValue:i})}let y=M(r,a.content,n.content);return t.push(...y),{inconsistencies:o,dependencyInconsistencies:t}},K=async(e={})=>{let{root:r=".",failFast:o=!1}=e,[t,s]=await D(r),n=[],a=[],p=0;for(let c of s){let f=F(c.config);try{let i=await G(f,c.name);if(p++,i.inconsistencies.length>0&&n.push(...i.inconsistencies),i.dependencyInconsistencies.length>0&&a.push(...i.dependencyInconsistencies),o&&(i.inconsistencies.length>0||i.dependencyInconsistencies.length>0))return{isConsistent:!1,inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}}catch{continue}}return{isConsistent:!(n.length>0||a.length>0),inconsistencies:n,dependencyInconsistencies:a,packagesChecked:p}},v=e=>typeof e=="string"?`"${e}"`:JSON.stringify(e,null,2),H=e=>{switch(e.issue){case"missing_in_deno":return`Missing in deno.json imports. Expected: ${e.expected}`;case"missing_in_package":return`Extra in deno.json imports (not in package.json): ${e.actual}`;case"version_mismatch":return`Version mismatch. Expected: ${e.expected}, Actual: ${e.actual}`}},L=e=>R.fromPromise(()=>K(e)),$=e=>d.ok({root:"."}),N=e=>{if(d.isFail(e))return u.writeln(m("\u2717"),l(" "+String(e.error))),d.fail({exitCode:1});let{value:r}=e;if(u.writeln(g("\u2139"),l(` Checked ${r.packagesChecked} packages.`)),!r.isConsistent){if(r.inconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.inconsistencies.length} field inconsistencies:`));let o=x(r.inconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.field} mismatch:`)),u.writeln(g("\u2139"),l(` deno.json: ${v(n.denoValue)}`)),u.writeln(g("\u2139"),l(` package.json: ${v(n.packageValue)}`))}}if(r.dependencyInconsistencies.length>0){u.writeln(m("\u2717"),l(` Found ${r.dependencyInconsistencies.length} dependency inconsistencies:`));let o=x(r.dependencyInconsistencies,t=>t.packageName);for(let[t,s]of Object.entries(o)){u.writeln(A("\u26A0"),l(" "+t));for(let n of s)u.writeln(m("\u2717"),l(` ${n.dependencyName}:`)),u.writeln(g("\u2139"),l(` ${H(n)}`))}}return d.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All package configs are consistent.")),d.ok(void 0)},J=C.createTrigger({handler:L,adaptInput:$,adaptOutput:N}),qn=async e=>await J({command:"validate-package-configs",args:[],flags:{}});export{K as a,L as b,J as c,qn as d};
@@ -1,3 +1,3 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as o}from"./chunk-ATYDQCCJ.js";var n=o({name:"validate-trailing-whitespace",description:"Remove trailing whitespace from lines",canFix:!0,stacks:[],defaults:{},checkFile(a,i){if(i===void 0)return[];let t=[],r=i.split(`
2
+ import{a as o}from"./chunk-MGNBNMJZ.js";var n=o({name:"validate-trailing-whitespace",description:"Remove trailing whitespace from lines",canFix:!0,stacks:[],defaults:{},checkFile(a,i){if(i===void 0)return[];let t=[],r=i.split(`
3
3
  `);for(let e=0;e<r.length;e++)/[ \t]+$/.test(r[e])&&t.push({path:a.path,line:e+1,message:"trailing whitespace"});return t},fixFile(a,i){let t=i.replace(/[ \t]+$/gm,"");if(t!==i)return{path:a.path,oldContent:i,newContent:t}}}),c=n.run,u=n.validator,d=n.main;export{n as a,c as b,u as c,d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{b as _,c as b}from"./chunk-BNQAZLIQ.js";import{a as y,e as f}from"./chunk-J7YTWK67.js";var h=class{capabilities=["text_generation","streaming","tool_calling","vision","batch_processing"];provider="anthropic";modelId;client;config;constructor(t,n){this.client=t,this.config=n,this.modelId=n.model}async generateText(t,n){let o=p(this.config,t);try{let a=await this.client.messages.create(o,{signal:n,timeout:this.config.requestTimeoutMs});return k(a,this.modelId)}catch(a){throw i(a)}}async*streamText(t,n){let o=p(this.config,t);try{let a=await this.client.messages.create({...o,stream:!0},{signal:n,timeout:this.config.requestTimeoutMs}),r=null,l=null,c="",d=0,u=0;for await(let s of a)if(s.type==="message_start")d=s.message?.usage?.input_tokens??0;else if(s.type==="content_block_start")s.content_block?.type==="tool_use"&&(r=s.content_block.id??null,l=s.content_block.name??null,c="");else if(s.type==="content_block_delta")s.delta?.type==="text_delta"?yield{kind:"content_delta",textDelta:s.delta.text}:s.delta?.type==="input_json_delta"&&(c+=s.delta.partial_json??"",yield{kind:"tool_call_delta",textDelta:s.delta.partial_json});else if(s.type==="content_block_stop"){if(r!==null&&l!==null){let m={};try{m=JSON.parse(c||"{}")}catch{}yield{kind:"tool_call_delta",toolCall:{id:r,name:l,arguments:m}},r=null,l=null,c=""}}else s.type==="message_delta"&&(u=s.usage?.output_tokens??u,yield{kind:"message_done",stopReason:x(s.delta?.stop_reason),usage:{inputTokens:d,outputTokens:u,totalTokens:d+u}})}catch(a){yield{kind:"error",error:i(a)}}}async submitBatch(t,n){let o=t.items.map(a=>({custom_id:a.customId,params:p(this.config,a.options)}));try{let a=await this.client.beta.messages.batches.create({requests:o},{signal:n});return g(a)}catch(a){throw i(a)}}async getBatchJob(t,n){try{let o=await this.client.beta.messages.batches.retrieve(t,{signal:n});return g(o)}catch(o){throw i(o)}}async listBatchJobs(t,n){try{let o=await this.client.beta.messages.batches.list({limit:t?.limit,after_id:t?.after},{signal:n}),a=[];for(let r of o.data??[])a.push(g(r));return a}catch(o){throw i(o)}}async downloadBatchResults(t,n){try{let o=await this.client.beta.messages.batches.results(t.id,{signal:n}),a=[];for await(let r of o)r.result?.type==="succeeded"?a.push({customId:r.custom_id,result:k(r.result.message,this.modelId)}):a.push({customId:r.custom_id,error:r.result?.error?.message??"Unknown error"});return a}catch(o){throw i(o)}}async cancelBatchJob(t,n){try{await this.client.beta.messages.batches.cancel(t,{signal:n})}catch(o){throw i(o)}}async close(){}getRawClient(){return this.client}},A={provider:"anthropic",async createModel(e){let{default:t}=await import("./sdk-L2SQCWYV.js"),n={};e.apiKey!==void 0&&(n.apiKey=e.apiKey),e.baseUrl!==void 0&&(n.baseURL=e.baseUrl);let o=new t(n);return new h(o,e)}},p=(e,t)=>{let n={model:e.model,max_tokens:t.maxTokens??e.maxTokens,messages:R(t.messages)};return t.system!==void 0&&(n.system=t.system),t.temperature!==void 0&&(n.temperature=t.temperature),t.topP!==void 0&&(n.top_p=t.topP),t.stopWords!==void 0&&(n.stop_sequences=t.stopWords),t.tools!==void 0&&(n.tools=t.tools.map(o=>({name:o.name,description:o.description,input_schema:o.parameters??{type:"object",properties:{}}}))),t.toolChoice!==void 0&&(n.tool_choice={type:t.toolChoice}),t.thinkingBudget!==void 0&&(n.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),n},R=e=>{let t=[];for(let n of e){if(n.role==="system")continue;let o=n.content.map(C);t.push({role:n.role==="tool"?"user":n.role,content:o})}return t},C=e=>{switch(e.kind){case"text":return{type:"text",text:e.text};case"image":{if(e.image.data!==void 0)return{type:"image",source:{type:"base64",media_type:e.image.mimeType??"image/png",data:w(e.image.data)}};if(e.image.url!==void 0){if(_(e.image.url)){let t=b(e.image.url);if(t!==null)return{type:"image",source:{type:"base64",media_type:t.mimeType,data:w(t.data)}}}return{type:"image",source:{type:"url",url:e.image.url}}}return{type:"text",text:"[unsupported image]"}}case"tool_call":return{type:"tool_use",id:e.toolCall.id,name:e.toolCall.name,input:e.toolCall.arguments};case"tool_result":return{type:"tool_result",tool_use_id:e.toolResult.toolCallId,content:e.toolResult.content,is_error:e.toolResult.isError};default:return{type:"text",text:`[unsupported content: ${e.kind}]`}}},k=(e,t)=>{let n=[];for(let o of e.content??[])o.type==="text"?n.push({kind:"text",text:o.text}):o.type==="thinking"?n.push({kind:"text",text:`[thinking] ${o.thinking}`}):o.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:o.id,name:o.name,arguments:o.input??{}}});return{content:n,stopReason:x(e.stop_reason),usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)},modelId:t,rawResponse:e}},x=e=>e==="end_turn"?"end_turn":e==="max_tokens"?"max_tokens":e==="tool_use"?"tool_use":e==="stop_sequence"?"stop":"end_turn",g=e=>({id:e.id,status:B(e.processing_status),createdAt:new Date(e.created_at),completedAt:e.ended_at!==void 0?new Date(e.ended_at):void 0,totalCount:e.request_counts?.total??0,doneCount:e.request_counts?.succeeded??0,failedCount:e.request_counts?.errored??0}),B=e=>e==="in_progress"?"processing":e==="ended"?"completed":e==="canceling"||e==="canceled"?"cancelled":"pending",i=e=>{if(e instanceof y)return e;let t=e instanceof Error?e:new Error(String(e)),n=e?.status??e?.statusCode??500;return f("anthropic",n,t)},w=e=>{let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)};export{h as a,A as b};
2
+ import{b as _,c as b}from"./chunk-BNQAZLIQ.js";import{a as y,e as f}from"./chunk-J7YTWK67.js";var h=class{capabilities=["text_generation","streaming","tool_calling","vision","batch_processing"];provider="anthropic";modelId;client;config;constructor(t,n){this.client=t,this.config=n,this.modelId=n.model}async generateText(t,n){let o=p(this.config,t);try{let a=await this.client.messages.create(o,{signal:n,timeout:this.config.requestTimeoutMs});return k(a,this.modelId)}catch(a){throw i(a)}}async*streamText(t,n){let o=p(this.config,t);try{let a=await this.client.messages.create({...o,stream:!0},{signal:n,timeout:this.config.requestTimeoutMs}),r=null,l=null,c="",d=0,u=0;for await(let s of a)if(s.type==="message_start")d=s.message?.usage?.input_tokens??0;else if(s.type==="content_block_start")s.content_block?.type==="tool_use"&&(r=s.content_block.id??null,l=s.content_block.name??null,c="");else if(s.type==="content_block_delta")s.delta?.type==="text_delta"?yield{kind:"content_delta",textDelta:s.delta.text}:s.delta?.type==="input_json_delta"&&(c+=s.delta.partial_json??"",yield{kind:"tool_call_delta",textDelta:s.delta.partial_json});else if(s.type==="content_block_stop"){if(r!==null&&l!==null){let m={};try{m=JSON.parse(c||"{}")}catch{}yield{kind:"tool_call_delta",toolCall:{id:r,name:l,arguments:m}},r=null,l=null,c=""}}else s.type==="message_delta"&&(u=s.usage?.output_tokens??u,yield{kind:"message_done",stopReason:x(s.delta?.stop_reason),usage:{inputTokens:d,outputTokens:u,totalTokens:d+u}})}catch(a){yield{kind:"error",error:i(a)}}}async submitBatch(t,n){let o=t.items.map(a=>({custom_id:a.customId,params:p(this.config,a.options)}));try{let a=await this.client.beta.messages.batches.create({requests:o},{signal:n});return g(a)}catch(a){throw i(a)}}async getBatchJob(t,n){try{let o=await this.client.beta.messages.batches.retrieve(t,{signal:n});return g(o)}catch(o){throw i(o)}}async listBatchJobs(t,n){try{let o=await this.client.beta.messages.batches.list({limit:t?.limit,after_id:t?.after},{signal:n}),a=[];for(let r of o.data??[])a.push(g(r));return a}catch(o){throw i(o)}}async downloadBatchResults(t,n){try{let o=await this.client.beta.messages.batches.results(t.id,{signal:n}),a=[];for await(let r of o)r.result?.type==="succeeded"?a.push({customId:r.custom_id,result:k(r.result.message,this.modelId)}):a.push({customId:r.custom_id,error:r.result?.error?.message??"Unknown error"});return a}catch(o){throw i(o)}}async cancelBatchJob(t,n){try{await this.client.beta.messages.batches.cancel(t,{signal:n})}catch(o){throw i(o)}}async close(){}getRawClient(){return this.client}},A={provider:"anthropic",async createModel(e){let{default:t}=await import("./sdk-EJKXYVDC.js"),n={};e.apiKey!==void 0&&(n.apiKey=e.apiKey),e.baseUrl!==void 0&&(n.baseURL=e.baseUrl);let o=new t(n);return new h(o,e)}},p=(e,t)=>{let n={model:e.model,max_tokens:t.maxTokens??e.maxTokens,messages:R(t.messages)};return t.system!==void 0&&(n.system=t.system),t.temperature!==void 0&&(n.temperature=t.temperature),t.topP!==void 0&&(n.top_p=t.topP),t.stopWords!==void 0&&(n.stop_sequences=t.stopWords),t.tools!==void 0&&(n.tools=t.tools.map(o=>({name:o.name,description:o.description,input_schema:o.parameters??{type:"object",properties:{}}}))),t.toolChoice!==void 0&&(n.tool_choice={type:t.toolChoice}),t.thinkingBudget!==void 0&&(n.thinking={type:"enabled",budget_tokens:t.thinkingBudget}),n},R=e=>{let t=[];for(let n of e){if(n.role==="system")continue;let o=n.content.map(C);t.push({role:n.role==="tool"?"user":n.role,content:o})}return t},C=e=>{switch(e.kind){case"text":return{type:"text",text:e.text};case"image":{if(e.image.data!==void 0)return{type:"image",source:{type:"base64",media_type:e.image.mimeType??"image/png",data:w(e.image.data)}};if(e.image.url!==void 0){if(_(e.image.url)){let t=b(e.image.url);if(t!==null)return{type:"image",source:{type:"base64",media_type:t.mimeType,data:w(t.data)}}}return{type:"image",source:{type:"url",url:e.image.url}}}return{type:"text",text:"[unsupported image]"}}case"tool_call":return{type:"tool_use",id:e.toolCall.id,name:e.toolCall.name,input:e.toolCall.arguments};case"tool_result":return{type:"tool_result",tool_use_id:e.toolResult.toolCallId,content:e.toolResult.content,is_error:e.toolResult.isError};default:return{type:"text",text:`[unsupported content: ${e.kind}]`}}},k=(e,t)=>{let n=[];for(let o of e.content??[])o.type==="text"?n.push({kind:"text",text:o.text}):o.type==="thinking"?n.push({kind:"text",text:`[thinking] ${o.thinking}`}):o.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:o.id,name:o.name,arguments:o.input??{}}});return{content:n,stopReason:x(e.stop_reason),usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)},modelId:t,rawResponse:e}},x=e=>e==="end_turn"?"end_turn":e==="max_tokens"?"max_tokens":e==="tool_use"?"tool_use":e==="stop_sequence"?"stop":"end_turn",g=e=>({id:e.id,status:B(e.processing_status),createdAt:new Date(e.created_at),completedAt:e.ended_at!==void 0?new Date(e.ended_at):void 0,totalCount:e.request_counts?.total??0,doneCount:e.request_counts?.succeeded??0,failedCount:e.request_counts?.errored??0}),B=e=>e==="in_progress"?"processing":e==="ended"?"completed":e==="canceling"||e==="canceled"?"cancelled":"pending",i=e=>{if(e instanceof y)return e;let t=e instanceof Error?e:new Error(String(e)),n=e?.status??e?.statusCode??500;return f("anthropic",n,t)},w=e=>{let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)};export{h as a,A as b};
@@ -0,0 +1,2 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{c}from"./chunk-KNIM3QST.js";var l={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY","COMPLETED"],DISCOVERY:["DISCOVERY_REVIEW","COMPLETED"],DISCOVERY_REVIEW:["DISCOVERY_REVIEW","SPEC_DRAFT","COMPLETED"],SPEC_DRAFT:["SPEC_DRAFT","SPEC_APPROVED","COMPLETED"],SPEC_APPROVED:["EXECUTING","COMPLETED"],EXECUTING:["COMPLETED","BLOCKED"],BLOCKED:["EXECUTING","COMPLETED"],COMPLETED:["IDLE","DISCOVERY"]},p=(e,s)=>l[e].includes(s),r=(e,s)=>{if(!p(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${l[e].join(", ")}`)},m=(e,s)=>(r(e.phase,s),{...e,phase:s}),d=(e,s,t,n)=>(r(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,specDescription:n??null,branch:t,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human",approved:!1,planPath:null},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[]}),u=(e,s)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot set discovery mode in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,mode:s}}},E=(e,s)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete premises in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,premises:s,premisesCompleted:!0}}},S=(e,s)=>{if(e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot select approach in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,selectedApproach:s,alternativesPresented:!0}}},C=e=>{if(e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot skip alternatives in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,alternativesPresented:!0}}},D=(e,s,t,n)=>{if(e.phase!=="DISCOVERY"&&e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let a=e.discovery.answers.filter(o=>o.questionId!==s),i={questionId:s,answer:t,user:n?.name??"Unknown User",email:n?.email??"",timestamp:new Date().toISOString(),type:"original"};return{...e,discovery:{...e.discovery,answers:[...a,i]}}};var v=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"DISCOVERY_REVIEW",discovery:{...e.discovery,completed:!0},specState:{path:c.specFile(e.spec),status:"draft"}}},I=e=>(r(e.phase,"SPEC_DRAFT"),{...e,phase:"SPEC_DRAFT"}),w=e=>{if(e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot approve discovery answers in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,approved:!0}}},F=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot advance discovery question in phase: ${e.phase}`);return{...e,discovery:{...e.discovery,currentQuestion:e.discovery.currentQuestion+1}}},y=e=>(r(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),R=e=>(r(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{...e.discovery,completed:!0,approved:!1},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]}});var O=(e,s)=>(r(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${s}`}}),P=(e,s)=>({...e,decisions:[...e.decisions,s]}),g=(e,s,t)=>(r(e.phase,"COMPLETED"),{...e,phase:"COMPLETED",completionReason:s,completedAt:new Date().toISOString(),completionNote:t??null}),x=e=>{if(e.phase!=="COMPLETED")throw new Error(`Cannot reopen in phase: ${e.phase}`);return{...e,phase:"DISCOVERY",reopenedFrom:e.completionReason,completionReason:null,completedAt:null,completionNote:null,discovery:{...e.discovery,completed:!1,currentQuestion:0},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},classification:null}},f=(e,s)=>{if(e.phase!=="EXECUTING"&&e.phase!=="BLOCKED")throw new Error(`Cannot revisit in phase: ${e.phase}. Only EXECUTING or BLOCKED can revisit.`);let t={from:e.phase,reason:s,completedTasks:[...e.execution.completedTasks],timestamp:new Date().toISOString()};return{...e,phase:"DISCOVERY",discovery:{...e.discovery,completed:!1,currentQuestion:0,approved:!1},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},classification:null,revisitHistory:[...e.revisitHistory??[],t]}},V=(e,s,t,n,a)=>{let i={from:s,to:t,user:n?.name??"Unknown User",email:n?.email??"",timestamp:new Date().toISOString(),reason:a},o=e.transitionHistory??[];return{...e,transitionHistory:[...o,i]}},T=(e,s,t)=>{let n=e.customACs??[],i={id:`custom-ac-${n.length+1}`,text:s,user:t?.name??"Unknown User",email:t?.email??"",timestamp:new Date().toISOString(),addedInPhase:e.phase};return{...e,customACs:[...n,i]}},A=(e,s,t)=>{let n=e.specNotes??[],i={id:`note-${n.length+1}`,text:s,user:t?.name??"Unknown User",email:t?.email??"",timestamp:new Date().toISOString(),phase:e.phase};return{...e,specNotes:[...n,i]}},L=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human",approved:!1,planPath:null},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[],classification:null,completionReason:null,completedAt:null,completionNote:null,reopenedFrom:null});export{m as a,d as b,u as c,E as d,S as e,C as f,D as g,v as h,I as i,w as j,F as k,y as l,R as m,O as n,P as o,g as p,x as q,f as r,V as s,T as t,A as u,L as v};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as i}from"./chunk-ATYDQCCJ.js";import{i as t}from"./chunk-6DBKPC2O.js";var s=i({name:"validate-submodules",description:"Detect new git submodules",canFix:!1,stacks:[],defaults:{},async checkAll(n,a){let o=t.path.join(a.root,".gitmodules");if(!await t.fs.exists(o))return[];let e=((await t.fs.readTextFile(o)).match(/\[submodule\s/g)??[]).length;return e>0?[{path:o,message:`found ${e} submodule(s) \u2014 submodules are not allowed`}]:[]}}),p=s.run,f=s.validator,x=s.main;export{s as a,p as b,f as c,x as d};
2
+ import{a as i}from"./chunk-MGNBNMJZ.js";import{i as t}from"./chunk-6DBKPC2O.js";var s=i({name:"validate-submodules",description:"Detect new git submodules",canFix:!1,stacks:[],defaults:{},async checkAll(n,a){let o=t.path.join(a.root,".gitmodules");if(!await t.fs.exists(o))return[];let e=((await t.fs.readTextFile(o)).match(/\[submodule\s/g)??[]).length;return e>0?[{path:o,message:`found ${e} submodule(s) \u2014 submodules are not allowed`}]:[]}}),p=s.run,f=s.validator,x=s.main;export{s as a,p as b,f as c,x as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{d as r}from"./chunk-GVTM4EOU.js";import{i}from"./chunk-6DBKPC2O.js";var t=async e=>{try{return await r`which ${e}`.noThrow().code()===0}catch{return!1}},s=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},a=e=>i.env.has(e),d=async()=>{let[e,o,l,n]=await Promise.all([t("claude"),s(),t("opencode"),t("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:e,detail:e?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:o,detail:o?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:l,detail:l?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:n,detail:n?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:a("ANTHROPIC_API_KEY"),detail:a("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:a("OPENAI_API_KEY"),detail:a("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY"),detail:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:a("GOOGLE_CLOUD_PROJECT"),detail:a("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]};export{d as a};
2
+ import{d as r}from"./chunk-VKB3B2FE.js";import{i}from"./chunk-6DBKPC2O.js";var t=async e=>{try{return await r`which ${e}`.noThrow().code()===0}catch{return!1}},s=async()=>{try{return(await fetch("http://localhost:11434/api/version",{signal:AbortSignal.timeout(1e3)})).ok}catch{return!1}},a=e=>i.env.has(e),d=async()=>{let[e,o,l,n]=await Promise.all([t("claude"),s(),t("opencode"),t("kiro")]);return[{name:"claude-code",alias:"cc",type:"CLI",available:e,detail:e?"claude binary found":"claude not on PATH"},{name:"ollama",alias:"ol",type:"HTTP",available:o,detail:o?"localhost:11434 reachable":"localhost:11434 not reachable"},{name:"opencode",alias:"oc",type:"CLI",available:l,detail:l?"opencode binary found":"opencode not on PATH"},{name:"kiro",alias:"kr",type:"CLI",available:n,detail:n?"kiro binary found":"kiro not on PATH"},{name:"anthropic",alias:"ant",type:"API",available:a("ANTHROPIC_API_KEY"),detail:a("ANTHROPIC_API_KEY")?"ANTHROPIC_API_KEY set":"ANTHROPIC_API_KEY not set"},{name:"openai",alias:"oai",type:"API",available:a("OPENAI_API_KEY"),detail:a("OPENAI_API_KEY")?"OPENAI_API_KEY set":"OPENAI_API_KEY not set"},{name:"gemini",alias:"gem",type:"API",available:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY"),detail:a("GEMINI_API_KEY")||a("GOOGLE_API_KEY")?"API key set":"GEMINI_API_KEY not set"},{name:"vertexai",alias:"vtx",type:"API",available:a("GOOGLE_CLOUD_PROJECT"),detail:a("GOOGLE_CLOUD_PROJECT")?"GOOGLE_CLOUD_PROJECT set":"GOOGLE_CLOUD_PROJECT not set"}]};export{d as a};
@@ -1,4 +1,4 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as E,b as A,c as I}from"./chunk-IIFFSCDJ.js";import{a as w}from"./chunk-LFNUSULJ.js";import{b as v}from"./chunk-O325ZU5M.js";import{f as D}from"./chunk-P2MUEKFT.js";import{b as l,f as g,g as k,h as C,i as h}from"./chunk-YVN2NZL4.js";import{g as a}from"./chunk-FFWPJP7A.js";import{j as b}from"./chunk-6DBKPC2O.js";var u=v(),O=/\/\*\*\s*([\s\S]*?)\s*\*\//g,R=/export\s+(const|function|class|type|interface)\s+(\w+)/g,$=/@example/,S=s=>{let n=[],i;for(R.lastIndex=0;(i=R.exec(s))!==null;){let e=i.index,t=i[2];if(t===void 0)continue;let c=s.substring(0,e).split(`
2
+ import{a as E,b as A,c as I}from"./chunk-VXVW4UNH.js";import{a as w}from"./chunk-LFNUSULJ.js";import{b as v}from"./chunk-JTSRGXS4.js";import{f as D}from"./chunk-P2MUEKFT.js";import{b as l,f as g,g as k,h as C,i as h}from"./chunk-YVN2NZL4.js";import{g as a}from"./chunk-FFWPJP7A.js";import{j as b}from"./chunk-6DBKPC2O.js";var u=v(),O=/\/\*\*\s*([\s\S]*?)\s*\*\//g,R=/export\s+(const|function|class|type|interface)\s+(\w+)/g,$=/@example/,S=s=>{let n=[],i;for(R.lastIndex=0;(i=R.exec(s))!==null;){let e=i.index,t=i[2];if(t===void 0)continue;let c=s.substring(0,e).split(`
3
3
  `).length,p=null,m=[...s.substring(0,e).matchAll(O)];if(m.length>0){let r=m[m.length-1];if(r!==void 0){let d=(r.index??0)+r[0].length,f=s.substring(d,e);/^\s*$/.test(f)&&(p=r[1]??null)}}n.push({jsdoc:p,symbolName:t,line:c})}return n},_=(s,n,i)=>{let e=[];if(s===null)return e.push("missing-description"),e;let t=s.split(`
4
4
  `)[0]?.trim();return(!t||t.startsWith("@"))&&e.push("empty-description"),i&&!$.test(s)&&e.push("missing-example"),e},F=async(s={})=>{let{root:n=".",requireExamples:i=!1}=s,e=await E(n),t=[],o=0,c=0;for(let p of e){let y=await I(p.path);for(let m of y){let r=A(m,p.path),d;try{d=await b.runtime.fs.readTextFile(r)}catch{continue}o++;let f=S(d);for(let{jsdoc:T,symbolName:x,line:P}of f){c++;let M=_(T,x,i);for(let N of M)t.push({file:r,symbol:x,issue:N,line:P})}}}return{isValid:t.length===0,issues:t,filesChecked:o,symbolsChecked:c}},J=s=>{switch(s){case"missing-description":return"Missing JSDoc documentation";case"missing-param":return"Missing @param documentation";case"missing-returns":return"Missing @returns documentation";case"missing-example":return"Missing @example";case"empty-description":return"Empty description"}},j=s=>D.fromPromise(()=>F(s)),V=s=>a.ok({root:"."}),q=s=>{if(a.isFail(s))return u.writeln(g("\u2717"),l(" "+String(s.error))),a.fail({exitCode:1});let{value:n}=s;if(u.writeln(h("\u2139"),l(` Checked ${n.filesChecked} files, ${n.symbolsChecked} symbols.`)),!n.isValid){u.writeln(g("\u2717"),l(` Found ${n.issues.length} documentation issues:`));let i=new Map;for(let e of n.issues){let t=i.get(e.file)??[];t.push(e),i.set(e.file,t)}for(let[e,t]of i){u.writeln(C("\u26A0"),l(" "+e));for(let o of t){let c=o.line!==void 0?`:${o.line}`:"";u.writeln(h("\u2139"),l(` ${o.symbol}${c}: ${J(o.issue)}`))}}return a.fail({exitCode:1})}return u.writeln(k("\u2713"),l(" All documentation is valid.")),a.ok(void 0)},B=w.createTrigger({handler:j,adaptInput:V,adaptOutput:q}),Q=async s=>await B({command:"validate-docs",args:[],flags:{}});export{F as a,j as b,B as c,Q as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as r}from"./chunk-ATYDQCCJ.js";var a="\uFEFF",i=r({name:"validate-bom",description:"Remove UTF-8 byte order markers",canFix:!0,stacks:[],defaults:{},checkFile(e,t){return t===void 0?[]:t.startsWith(a)?[{path:e.path,message:"file has UTF-8 BOM"}]:[]},fixFile(e,t){if(!t.startsWith(a))return;let o=t.slice(1);return{path:e.path,oldContent:t,newContent:o}}}),u=i.run,d=i.validator,m=i.main;export{i as a,u as b,d as c,m as d};
2
+ import{a as r}from"./chunk-MGNBNMJZ.js";var a="\uFEFF",i=r({name:"validate-bom",description:"Remove UTF-8 byte order markers",canFix:!0,stacks:[],defaults:{},checkFile(e,t){return t===void 0?[]:t.startsWith(a)?[{path:e.path,message:"file has UTF-8 BOM"}]:[]},fixFile(e,t){if(!t.startsWith(a))return;let o=t.slice(1);return{path:e.path,oldContent:t,newContent:o}}}),u=i.run,d=i.validator,m=i.main;export{i as a,u as b,d as c,m as d};
@@ -0,0 +1,17 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as Q}from"./chunk-NY4W44PI.js";import{a as M,c as $,d as q,e as B}from"./chunk-4NNSMDFH.js";import{c as j}from"./chunk-UEMWZOIU.js";import{i as Y}from"./chunk-6DBKPC2O.js";var G=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],te=[{questionId:"verification",text:"What tests should be written? (unit, integration, e2e \u2014 be specific about what behavior to test)"},{questionId:"verification",text:"What documentation needs updating? (README, API docs, CHANGELOG, inline comments)"}],V=e=>G.map(t=>{let n=te.filter(o=>o.questionId===t.id),s=$(e,t.id);return{...t,extras:[...n,...s]}});var H=e=>{let t=new Set(e.map(n=>n.questionId));return G.every(n=>t.has(n.id))};var A=e=>j(e),r=(e,t)=>A(t===null?e:`spec ${t} ${e}`),se="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",Z={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},oe=(e,t,n,s,o=Z)=>{let y=e.execution.iteration>=t,c="You are a senior engineer and a scrum master who takes pride in honest reporting. Your reputation depends on accuracy, not speed. You are responsible for others' toil, and you are a perfect example of a servant leader. When reporting progress: if something is NOT implemented, say so \u2014 don't hide it. If partially done, say 'partially done: [what works] / [what doesn't]'. If untested, say 'implemented but untested'. NEVER say 'done' for something you haven't verified yourself. Underpromise \u2014 4 of 6 done means '4 of 6 done, 2 remaining', not 'almost done'.",l="Never skip steps or make decisions without asking the user. If you think something can be skipped or inferred, ask first. Explicit > Clever.",f=o.hasAskUserTool?"At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST use AskUserQuestion to get the user's input. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.":"At every decision point (discovery questions, classification, spec approval, expansion proposals, architectural decisions, rule promotion), you MUST ask the user. Present options as a numbered list and ask the user to pick a number. You MUST NOT make decisions, infer preferences, or assume the user's intent. If you're unsure whether something is a decision point, it is \u2014 ask.",g="At every decision point where you present options to the user, share your recommendation BEFORE asking. Say what you think and why, then ask if the user agrees. Format: 'I'd recommend X because [reason]. Agree, or would you prefer Y?' The user always has the final word, but you save them cognitive load by proposing first.",x="noskills is a live state machine the user watches in real-time. Call noskills ONCE per interaction. Ask ONE question, wait for the user's answer, submit it. Never batch-submit, never backfill, never answer questions yourself.",d=n?[c,l,f,g,x]:[se,c,l,f,g,x];d.push("When noskills output contains a `roadmap` field, display it to the user BEFORE any other content. When output contains a `gate` field, display the gate message prominently \u2014 do NOT bury it in prose.");let v=s?.outOfScope??[],m=e.spec;switch(e.phase){case"IDLE":{let a=o.optionPresentation==="tool"?["When interactiveOptions are present, pass them DIRECTLY as the `options` array in AskUserQuestion \u2014 they are already in the correct {label, description} format. You MUST also provide a `header` field (max 12 chars, e.g. 'Action') and a `question` field. When the user picks an option, look up its label in the `commandMap` object to find the command to execute.","For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions."]:[`When interactiveOptions are present, present them as a numbered list. For each option show the number, label, and description. Ask the user to pick a number. When the user picks an option, look up its label in the \`commandMap\` object to find the command to execute. Example format:
3
+
4
+ 1. Start a new spec \u2014 Begin discovery questions for a new feature
5
+ 2. Add concerns \u2014 Shape how discovery and specs work
6
+
7
+ Pick a number:`,"For availableConcerns: present ALL available concerns as a numbered list. NEVER silently drop concerns \u2014 present ALL available concerns to the user. Ask the user to enter the numbers of the concerns they want to activate (comma-separated)."],D=o.hasAskUserTool?"For availableConcerns: use AskUserQuestion with multiSelect:true. AskUserQuestion supports max 4 options per question and max 4 questions per call. If there are more than 4 concerns, split them across two questions within the same AskUserQuestion call (e.g., first 3 in question 1, remaining in question 2). NEVER silently drop concerns \u2014 present ALL available concerns to the user, even if it requires multiple questions.":void 0,w=D!==void 0?[a[0],D]:a;return{rules:["The user has already told you what they want. If they described a feature, bug, or task, create a spec immediately with `noskills spec new \"user's description here\"` \u2014 the name is auto-generated. If they said 'fix X', create a spec for fixing X. If they pasted meeting notes, create a spec from those notes. Do NOT present a menu of options. Do NOT ask 'What would you like to do?' \u2014 the user already answered that question by talking to you. Do NOT ask for a 'short slug name' \u2014 just pass their description to spec new. Only show interactive options if the user explicitly asks 'what can I do?' or the conversation has no prior context.",...d,...w,"When the user wants to create a spec, encourage them to share everything they have \u2014 short or long. Say: 'Tell me what you want to build. A one-liner is fine, but if you have detailed requirements, meeting notes, a task list, or a full spec in mind, share it all \u2014 the more context, the better the discovery.' Do NOT ask for a 'short slug and description.' The slug is auto-generated from the content. Pass the full text as the description to `noskills spec new \"...\"` \u2014 detailed requirements produce better discovery.","After running spec new, ask the user if they want full discovery, quick discovery, or skip to spec draft. Full discovery: pre-scan, premise challenge, 6 questions, expansions, architecture, error map, synthesis. Quick discovery: only questions relevant to active concerns, skip expansions and error map. Skip to spec draft: classification \u2192 approve \u2192 execute. Never skip discovery without asking."],tone:"Welcoming. Present choices, then wait."}}case"DISCOVERY":{let a=o.hasAskUserTool?"You MUST ask each discovery question using AskUserQuestion tool. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer through AskUserQuestion. Each question \u2192 one AskUserQuestion call \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers as option descriptions in AskUserQuestion \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.":"You MUST ask each discovery question by presenting it to the user as text. You MUST NOT answer questions yourself or infer answers from the spec description. You MUST NOT submit discovery answers without the user explicitly providing each answer. Each question \u2192 present it \u2192 user answers \u2192 next question. If the user already gave a detailed description in spec new, you may PRE-FILL suggested answers \u2014 but the user must still confirm or override each one. If the user provided a fully formed plan, you may skip Phase 2 (questions) but you MUST still run premise challenge and alternatives. Never skip premise challenge.";return{modeOverride:"You are in plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to think and talk. Read code to understand. Ask questions to discover. Challenge assumptions. Propose ideas. Debate tradeoffs. But NEVER create, edit, or delete project files. Discovery exists to catch what you don't yet know you don't know.",rules:[...d,a,"DO NOT create, edit, or write any files.","DO NOT run shell commands that modify state.","You MAY read files and run read-only commands (cat, ls, grep, git log, git diff).","BEFORE asking any discovery questions, conduct a pre-discovery codebase scan: read the project README, CLAUDE.md, and any design docs; check the last 20 git commits (git log --oneline -20); look for TODO files, open issue references, and existing specs; scan the directory structure to understand the project shape. Then present a brief 'Pre-discovery audit' summary: stack detected, recent work themes, open TODOs, existing specs. This gives you CONTEXT to ask INFORMED questions, not blind ones.","If the noskills output contains `preDiscoveryResearch` with `required: true`, you MUST research every term in `extractedTerms` using web search before asking the first question. Present findings as a brief: current stable versions, API changes, deprecations, and anything that might affect the spec's assumptions.","After the pre-discovery codebase scan and BEFORE starting questions, ask the user: 'What kind of discovery do you need? A) Explore scope \u2014 I'll help expand, find opportunities, think bigger. B) Technical depth \u2014 I'll focus on architecture, error handling, implementation strategy. C) Validate my plan \u2014 I already know what I want, challenge my assumptions. D) Ship fast \u2014 minimal scope, cut the fat, get to tasks quickly.' Adapt your discovery emphasis accordingly: Explore \u2192 heavy on expansion proposals and dream state; Technical \u2192 heavy on architectural decisions and error/rescue map; Validate \u2192 heavy on premise challenge and pushback; Ship fast \u2192 minimal questions, skip expansions, go direct to classification and tasks.","Before starting discovery questions, challenge the user's initial spec description against what you learned from the codebase scan. Look for: hidden complexity they haven't mentioned, conflicts with existing code, scope that's bigger or smaller than they think, existing modules that overlap with what they're asking for. Share your observations and ask clarifying follow-ups, then proceed to questions.","When asking discovery questions, use your codebase knowledge to offer concrete options alongside the open-ended question. For example, instead of just 'What does the user do today?' present: 'Based on the codebase, I see three likely scenarios: A) ... B) ... C) ... D) Something else \u2014 describe it. Which is closest?' The user can always pick 'something else' but concrete options speed up the conversation and force specificity.",o.hasAskUserTool?"Ask one question at a time using AskUserQuestion tool.":"Ask one question at a time. Present it as text and wait for the user's response.","Push back on vague answers \u2014 you will be the one executing this spec, vague answers make your job harder.","When the user gives a short answer, follow up: 'Can you be more specific?'","After collecting discovery answers, synthesize a CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision before generating the spec. Show three columns: where the project is now, what this spec achieves, and where it could go in 6 months. Note: 'This spec moves you from column 1 to column 2. Column 3 is out of scope but worth knowing \u2014 every decision in this spec should keep column 3 possible.' This helps the user see if the scope is right.","When you spot expansion opportunities during discovery (from codebase scan, TODOs, concern requirements, synergies with the current plan), present each as a numbered proposal (1/N, 2/N...). Every proposal MUST include: clear description of WHAT and WHY (how it connects to the current plan); effort estimate as S/M/L/XL with human time and CC time estimates (e.g., 'S (human: ~1 day / CC: ~15 min)' \u2014 not just 'small'); risk assessment as Low/Low-Med/Med/Med-High/High naming the specific risk factor; completeness delta showing X/10 without this and Y/10 with this. Every proposal gets three options: A) Add to scope B) Defer to future spec C) Skip \u2014 not interested, plus 'Chat about this' and 'Skip remaining proposals' escape hatches.","After discovery questions and expansion proposals, identify architectural decisions that must be resolved before implementation. These are decisions where choosing A vs B changes the shape of multiple tasks, the data model, the API surface, or system boundaries. Present each as a concrete technical question with options, a RECOMMENDATION with reasoning, and completeness scores. Show how each option affects downstream work (e.g., 'If you choose B, tasks 3 and 4 need a job queue setup step added'). Only surface decisions that BLOCK implementation \u2014 not preferences or nice-to-haves. If the user says 'I don't know yet', mark it as a risk: 'UNRESOLVED: [decision] TBD. Tasks X-Y may change.' Never allow implementation to start with unresolved architectural decisions \u2014 flag them prominently in the spec.","Before finalizing, map error and rescue paths for every significant codepath in the planned work. Create a table: codepath | what can go wrong | how it's handled. Identify CRITICAL GAPS \u2014 failure modes that the plan doesn't address. Present each critical gap as a decision with options, a recommendation, and completeness scores, just like architectural decisions. Resolved gaps become tasks or acceptance criteria. Unresolved gaps become risk flags. Think like an SRE reviewing a design doc \u2014 what fails at 3am?","After all discovery questions, expansion proposals, architectural decisions, and error mapping are complete, present a DISCOVERY SUMMARY for the user to review: intent, ambition, reversibility, impact, verification, out of scope, the dream state table (current \u2192 this spec \u2192 future), accepted/deferred/skipped expansions, resolved architectural decisions, and the error/rescue map. Ask for confirmation before generating the spec. This is the last chance to catch misunderstandings.","Once you have a substantive answer for each question, collect all answers and submit them together in a single `noskills next --answer` call as a JSON object."],tone:"Curious interviewer who has a stake in the answers and comes PREPARED. You've read the codebase before asking. Challenge assumptions, offer concrete options, think about architecture and failure modes. Think deeply before asking each question."}}case"DISCOVERY_REVIEW":return{modeOverride:"You are in plan mode. Do not create, edit, or write any files. Present the discovery answers to the user for review and confirmation.",rules:[...d,"DO NOT create, edit, or write any files.","Present ALL discovery answers to the user clearly, one by one.",o.hasAskUserTool?"Use AskUserQuestion to ask: 'Are these answers correct, or would you like to revise any?'":"Ask the user: 'Are these answers correct, or would you like to revise any?' Present approval and revision as numbered options.","If the user approves, run the approve command.","If the user wants to revise, collect their corrections and submit them.","You MUST NOT approve on behalf of the user. The user must explicitly confirm.","If noskills output contains a splitProposal, present it to the user with the exact options shown. Do NOT split or merge specs on your own. Do NOT recommend one option over the other unless the user asks for your opinion. The user decides."],tone:"Careful reviewer. The user must confirm every answer."};case"SPEC_DRAFT":return{modeOverride:"You are in plan mode. Do not attempt to create, edit, or write any files. Do not run any shell commands that modify state. You can read files and run read-only commands to understand the codebase. Your ONLY job right now is to think and talk. Read code to understand. Ask questions to discover. Challenge assumptions. Propose ideas. Debate tradeoffs. But NEVER create, edit, or delete project files. Discovery exists to catch what you don't yet know you don't know.",rules:[...d,"DO NOT create, edit, or write any files.","Read the spec and present a summary to the user.","Flag any tasks that are too vague to execute.","Flag any missing acceptance criteria.","Ask the user if they want to refine before approving.",o.hasAskUserTool?"When presenting classification options, use AskUserQuestion with multiSelect:true. Do NOT infer classification yourself.":"When presenting classification options, present them as a numbered list with multiselect (user picks multiple numbers). Do NOT infer classification yourself.","If you identify issues in the spec (vague tasks, irrelevant sections, missing acceptance criteria), submit a refinement via: `"+r(`next --answer='{"refinement":"task-1: Add upload endpoint, task-2: Add validation middleware, task-3: Write integration tests"}'`,m)+"`. The spec will be updated and you can review again."],tone:"Thoughtful reviewer preparing to hand off to an implementer."};case"SPEC_APPROVED":return{rules:[...d,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec.",o.hasAskUserTool?"Before starting execution, show the spec summary to the user and ask for final confirmation via AskUserQuestion.":"Before starting execution, show the spec summary to the user and ask for final confirmation. Present 'Start execution' and 'Not yet' as numbered options."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[];o.subAgentMethod==="task"?a.push(`When you receive a task from noskills next, do NOT execute it yourself. Spawn the noskills-executor sub-agent using the Agent tool. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the sub-agent completes, review its results briefly, then report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the sub-agent is the implementer.`,"If the sub-agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the sub-agent failure in your next status report so it can be investigated.","After the noskills-executor sub-agent completes a task, spawn a noskills-verifier sub-agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.",`After spawning sub-agents, ALWAYS present a dispatch table showing the FULL pipeline \u2014 not just executors, but also verification and test steps:
8
+
9
+ | Step | Agent | Files | Tasks | Est. Time |
10
+ |------|-------|-------|-------|-----------|
11
+ | 1. Implement | noskills-executor | purge.ts | Tasks 1-6 | ~3 min |
12
+ | 2. Verify | noskills-verifier | purge.ts (read-only) | Validate ACs | ~1 min |
13
+ | 3. Write tests | noskills-executor | purge.test.ts | Task 7 | ~2 min |
14
+
15
+ When agents complete, update with actual time and status (Done / Failed / Found N issues). The user should see the complete plan upfront.
16
+
17
+ Estimate: S ~1min, M ~2min, L ~5min, XL ~10min.`,"The agent that writes implementation code must NOT write tests for that code. Spawn a SEPARATE sub-agent for test writing. This prevents the implementer from writing tests that only confirm what it already knows. The test writer reads the code fresh and tests what it actually does, not what the implementer intended.","When deciding how to split work across sub-agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused sub-agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):o.subAgentMethod==="spawn"?a.push(`When you receive a task from noskills next, use spawn_agent to delegate to the noskills-executor agent. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. Use wait_agent to collect results. Then report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the spawned agent is the implementer.`,"If the spawned agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the noskills-executor agent completes a task, spawn a noskills-verifier agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.","When deciding how to split work across spawned agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):o.subAgentMethod==="fleet"?a.push(`When you receive a task from noskills next, use /fleet to run parallel sub-agents for implementation tasks. Pass each agent: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. Collect results and report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the fleet agents are the implementers.`,"If a fleet agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the fleet agents complete, run a verification pass to independently check the work. Verify: changed files, acceptance criteria, test commands. Report PASS/FAIL per criterion with evidence.","When deciding how to split work across fleet agents: if all tasks touch the same file or tightly coupled files, batch them into one agent. If tasks touch independent files or modules, run parallel agents. Always err toward smaller, focused agents over large batched ones."):o.subAgentMethod==="delegation"?a.push(`When you receive a task from noskills next, use Kiro's agent delegation to spawn the noskills-executor agent. Pass it: the task title, description, acceptance criteria (with IDs), behavioral rules, out-of-scope constraints, concern reminders, and relevant file paths. When the agent completes, review its results briefly, then report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`. You are the orchestrator \u2014 the delegated agent is the implementer.`,"If the delegated agent fails, errors out, or returns no results, fall back to executing the task directly yourself. Report the agent failure in your next status report so it can be investigated.","After the noskills-executor agent completes a task, delegate to the noskills-verifier agent to independently verify the work. Pass it: the list of changed files, the acceptance criteria, and the test commands. The verifier reports PASS/FAIL per criterion with evidence. Use the verifier's report as your status report to noskills. Do NOT submit status reports based solely on the executor's self-report.","When deciding how to split work across delegated agents: if all tasks touch the same file or tightly coupled files, batch them into one executor. If tasks touch independent files or modules, spawn parallel executors. Always err toward smaller, focused agents over large batched ones \u2014 fresh context per task is better than accumulated context across tasks."):a.push("Execute tasks sequentially in this context. Do not attempt to spawn sub-agents \u2014 this tool does not support agent delegation. Complete each task yourself, verify your work (run type checks and tests), then report progress.",`After completing a task, report to noskills via \`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,m)}\`.`);let D=[...d,"You are the orchestrator, not the implementer. NEVER create, edit, or delete project files directly. ALWAYS delegate to noskills-executor sub-agent, even for single-line changes. There is no 'minor change' \u2014 every edit goes through the executor\u2192verifier pipeline. Your job: read noskills output, spawn sub-agents, report status.","Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",...a,`When you discover a pattern, receive a correction, or identify a recurring preference from the user, ask: 'Should this be a permanent rule for this project, or just for this task?' If permanent, run: \`${A('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`,"FORCED VERIFICATION: After every file edit, run the project's type-check command (e.g., `tsc --noEmit`, `deno check`, `go build`) and lint command. Report results in AC status. Do NOT mark any AC as passed if type-check fails. If no type-checker is configured, state that explicitly.","FILE READ BUDGET: Files over 500 lines must be read in chunks using offset and limit. Never assume a single read captured the full file. When you read a partial file, state which lines you read.","TOOL RESULT AWARENESS: If any search or command returns suspiciously few results, re-run with narrower scope (single directory, stricter pattern). State when you suspect results were truncated.","PRE-EDIT RE-READ: Before EVERY file edit, re-read the target file to get current content. After editing, read the file again to confirm the change applied correctly. Never edit against stale context.","DEAD CODE FIRST: Before structural refactors on files over 300 LOC, first remove dead imports, unused exports, and orphaned props. Commit cleanup separately before starting the real work.","Do NOT suggest pausing, checkpointing, committing mid-spec, or stopping execution. The spec was scoped during discovery as a meaningful deliverable \u2014 execute it to completion. A half-delivered increment has no value. If scope feels too large, finish this spec and note the concern for future specs. The user decides when to stop, not you."];e.execution.lastVerification?.passed===!1&&D.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let w={rules:D,tone:"Direct. Orchestrate immediately \u2014 spawn sub-agents.",outOfScope:v.length>0?v:void 0};return y?{...w,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:w}case"BLOCKED":return{rules:[...d,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"COMPLETED":return{rules:[...d,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...d,`Run \`${r("next",m)}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},re=5*60*1e3,ie=(e,t)=>{let n=e.spec,s;switch(e.phase){case"IDLE":s=`No active spec. Start one with: \`${A('spec new --name=<slug> "description"')}\``;break;case"DISCOVERY":s=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"DISCOVERY_REVIEW":s=`Discovery answers ready for review. ${e.discovery.answers.length} answers collected. Waiting for user confirmation.`;break;case"SPEC_DRAFT":s=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":s=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":s=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":s=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"COMPLETED":s=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:s=`Run \`${r("next",n)}\` to get started.`}return{protocol:`Run \`${r('next --answer="..."',n)}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:t.map(o=>o.id),resumeHint:s}},ae=e=>{let t=e.spec;if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE \u2192 IDLE",how:`Run \`${r("next",t)}\` for instructions. Submit results with \`${r('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let n=new Date(e.lastCalledAt).getTime();if(Date.now()-n>re)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 DISCOVERY_REVIEW \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE \u2192 IDLE",how:`Run \`${r("next",t)}\` for instructions. Submit results with \`${r('next --answer="..."',t)}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},X=[{key:"IDLE",label:"IDLE"},{key:"DISCOVERY",label:"DISCOVERY"},{key:"DISCOVERY_REVIEW",label:"REVIEW"},{key:"SPEC_DRAFT",label:"DRAFT"},{key:"SPEC_APPROVED",label:"APPROVED"},{key:"EXECUTING",label:"EXECUTING"},{key:"COMPLETED",label:"DONE"},{key:"IDLE_END",label:"IDLE"}],ce=e=>e==="BLOCKED"?X.map(t=>t.key==="EXECUTING"?"\u2726 EXECUTING (BLOCKED) \u2726":t.label).join(" \u2192 "):X.map(t=>t.key==="IDLE"&&e==="IDLE"?"\u2726 IDLE \u2726":t.key===e?`\u2726 ${t.label} \u2726`:t.label).join(" \u2192 "),le=(e,t)=>{switch(e.phase){case"DISCOVERY_REVIEW":return{message:`${e.discovery.answers.length}/6 answers collected.`,action:"Type APPROVE to generate spec, or REVISE to correct answers.",phase:"DISCOVERY_REVIEW"};case"SPEC_APPROVED":return{message:`Spec approved. ${t?.tasks?.length??0} tasks ready.`,action:"Type START to begin execution.",phase:"SPEC_APPROVED"};default:return}},Se=async(e,t,n,s,o,y,c,l,f)=>{let g=ie(e,t),x=s?.maxIterationsBeforeRestart??15,d=s?.allowGit??!1,u=l??Z,v=oe(e,x,d,o,u),m=ae(e),a;switch(e.phase){case"IDLE":a=K(t,M,n.length,c);break;case"DISCOVERY":a=await ge(e,t,n,f);break;case"DISCOVERY_REVIEW":a=ve(e,t);break;case"SPEC_DRAFT":a=we(e);break;case"SPEC_APPROVED":a=be(e);break;case"EXECUTING":a=Ee(e,t,n,x,o,y);break;case"BLOCKED":a=Ie(e);break;case"COMPLETED":a=De(e);break;default:a=K(t,M,n.length,c)}let D=ce(e.phase),w=le(e,o),b={...a,meta:g,behavioral:v,roadmap:D};w!==void 0&&(b={...b,gate:w}),m!==void 0&&(b={...b,protocolGuide:m});let C=de(e,t,c);if(C.length>0){let T=C.map(({label:h,description:I})=>({label:h,description:I})),p={};for(let h of C)p[h.label]=h.command;let E=u.optionPresentation==="tool"?"AskUserQuestion":"prose-numbered-list",U=u.optionPresentation==="tool"?"Use AskUserQuestion tool to present these options. Do NOT use prose.":"Present options as a numbered list. Ask user to pick a number.";b={...b,interactiveOptions:T,commandMap:p,toolHint:E,toolHintInstruction:U}}return b},de=(e,t,n)=>{let s=e.spec;switch(e.phase){case"IDLE":{let o=[],c=(n?.existingSpecs??[]).filter(l=>l.phase!=="COMPLETED");t.length===0&&o.push({label:"Add concerns (Recommended)",description:"Shape how discovery and specs work by adding project concerns",command:A("concern add <id> [<id2> ...]")}),o.push({label:"Start a new spec",description:"Tell me what you want to build \u2014 a one-liner, detailed requirements, meeting notes, anything",command:A('spec new "description"')});for(let l of c.slice(0,2))o.push({label:`Continue: ${l.name} (${l.phase})`,description:l.detail??`Iteration ${l.iteration}`,command:r("next",l.name)});return t.length>0&&o.push({label:"Edit concerns",description:`Currently: ${t.map(l=>l.id).join(", ")}`,command:A("concern list")}),o.slice(0,4)}case"DISCOVERY_REVIEW":return e.discovery.approved?[{label:"Keep as one spec",description:"All work in a single spec",command:r('next --answer="keep"',s)},{label:"Split into separate specs",description:"Create one spec per independent area",command:r('next --answer="split"',s)}]:[{label:"Approve all answers",description:"Answers look correct \u2014 generate the spec",command:r('next --answer="approve"',s)},{label:"Revise answers",description:"Correct one or more discovery answers",command:r(`next --answer='{"revise":{...}}'`,s)}];case"SPEC_DRAFT":return[{label:"Approve spec",description:"Review looks good \u2014 approve and move to execution",command:r("approve",s)},{label:"Refine spec",description:"Submit refinements to improve tasks or sections",command:r(`next --answer='{"refinement":"..."}'`,s)},{label:"Save for later",description:"Keep the draft as-is. Others can review, add ACs, notes, or tasks. Come back anytime to approve.",command:r('next --answer="save"',s)},{label:"Start over",description:"Reset the spec and start fresh",command:r("reset",s)}];case"SPEC_APPROVED":return[{label:"Start execution",description:"Begin implementing the tasks",command:r('next --answer="start"',s)},{label:"Save for later",description:"Spec is approved but don't start execution yet. Others can still add ACs or notes.",command:r('next --answer="save"',s)}];case"EXECUTING":return[];case"BLOCKED":return[{label:"Resolve block",description:"Provide a resolution to unblock execution",command:r('next --answer="resolution"',s)},{label:"Reset spec",description:"Abandon this spec and start over",command:r("reset",s)}];case"COMPLETED":return[{label:"New spec",description:"Start a new feature spec",command:A('spec new --name=<slug> "description"')},{label:"Reopen spec",description:"Reopen this spec for revision",command:r("reopen",s)},{label:"Check status",description:"Review completed spec summary",command:A("status")}];default:return[]}},ue="noskills is a state-machine orchestrator that acts as a scrum master for both you and your agent \u2014 keeping work focused, decisions in your hands, and tokens efficient.",K=(e,t,n,s)=>({phase:"IDLE",instruction:"No active spec. Work freely or start a new spec. If the user has already described what they want to build, create a spec immediately with `noskills spec new \"user's description here\"` \u2014 the name is auto-generated from the description. Do NOT re-ask what they want to do. Do NOT ask for a 'short slug' \u2014 just take what the user gives you and create the spec. When prompting the user, encourage them to share everything they have: 'Tell me what you want to build. A one-liner is fine, but if you have detailed requirements, meeting notes, a task list, or a full spec in mind, share it all \u2014 the more context, the better the discovery.' IMPORTANT: Present ALL available concerns to the user \u2014 never truncate the list. Split across multiple AskUserQuestion calls if needed.",welcome:ue,existingSpecs:s?.existingSpecs??[],availableConcerns:t.map(o=>({id:o.id,description:o.description})),activeConcerns:e.map(o=>o.id),activeRulesCount:s?.rulesCount??n,behavioralNote:"These options are fallbacks. If the user already described what they want, act on it directly without presenting these options.",hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),pe=/\b(Node\.?js|Deno|Bun|Go|Rust|Python|Ruby|Java|Kotlin|Swift|PHP|React|Vue|Angular|Svelte|Next\.?js|Nuxt|Remix|Astro|SolidJS|Qwik|TypeScript|Webpack|Vite|esbuild|Rollup|Terraform|Docker|Kubernetes|PostgreSQL|MySQL|Redis|MongoDB|SQLite|Prisma|Drizzle|gRPC|GraphQL|tRPC)\s+v?(\d+(?:\.\d+)?(?:\.\d+)?\+?)\b/gi,he=e=>{if(e===null||e.length===0)return[];let t=[],n,s=new RegExp(pe.source,"gi");for(;(n=s.exec(e))!==null;)t.push(`${n[1]} ${n[2]}`);return t},J=e=>{let t=he(e);if(t.length!==0)return{required:!0,instruction:"Before asking discovery questions, research the current state of all platforms, runtimes, libraries, and APIs mentioned in the spec description. Use web search and Context7 MCP if available. Report findings as a pre-discovery brief to the user. Do NOT assume your training data is current \u2014 versions change, APIs get added, features get deprecated.",extractedTerms:t}},me=50*1024,z=async e=>{if(e!==null)try{let t=await Y.fs.readTextFile(e);return t.length>me?void 0:{provided:!0,content:t,instruction:"A plan document was provided. Read it carefully, extract relevant information for each discovery question, and present pre-filled answers for user review. Do NOT skip any question \u2014 present your extraction and let the user confirm, correct, or expand. IMPORTANT: When extracting answers from the plan, mark each extraction as [STATED] (directly written in the plan) or [INFERRED] (your interpretation). Present extractions individually for confirmation."}}catch{return}},ye=e=>{switch(e){case"full":return["Ask each discovery question as written. Push for specific, concrete answers.","If the answer is vague, ask follow-up questions before accepting."];case"validate":return["The user has a plan. Your job is to challenge it, not explore it.","For each question, identify assumptions and ask: 'What would prove this wrong?'","If the description already answers a question, present your understanding and ask to confirm.","When pre-filling answers from a rich description, plan, or prior discussion, DISTINGUISH between what the user EXPLICITLY STATED and what you INFERRED. Format each pre-filled item as: '[STATED] GPU skinning in all 3 renderers \u2014 you said this during technical discussion' or '[INFERRED] tangent space is 10-star scope \u2014 I assumed this based on complexity'. The user confirms stated items and corrects inferred items.","Present pre-filled answers ONE ITEM AT A TIME for confirmation, not as a completed block. The user's job is to correct your inferences, not rubber-stamp your summary. If you pre-fill 5 items and 2 are wrong, the user must be able to catch them individually."];case"technical-depth":return["Focus on architecture, data flow, performance, and integration points.","Before each question, scan the codebase for related implementations.","Ask: 'How does this interact with [existing system]?' for each integration point."];case"ship-fast":return["Focus on minimum viable scope.","For each question, also ask: 'What can we defer to a follow-up?'","Push for the smallest version that delivers value."];case"explore":return["Think bigger. What's the 10x version?","For each question, ask about adjacent opportunities.","Suggest possibilities the user might not have considered."]}},fe=(e,t)=>{let n=new Map;for(let s of e){let o="user"in s?s.user:"Unknown User";t!==void 0&&o===t.name||n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([s,o])=>({name:s,contributions:`${o} answer${o>1?"s":""}`}))},ge=async(e,t,n,s)=>{let o=e.spec,y=V(t),c=e.discovery.answers.length,l=H(e.discovery.answers),f=e.discovery.audience==="agent",g=fe(e.discovery.answers,s),x=(e.specNotes??[]).filter(i=>!i.text.startsWith("[TASK] ")).map(i=>({text:i.text,user:i.user})),d={...s!==void 0?{currentUser:s}:{},...g.length>0?{previousContributors:g}:{},...x.length>0?{notes:x}:{}},u=e.specDescription!==null&&e.specDescription.length>0,v=e.discovery.planPath!==null,m=e.discovery.mode;if(m===void 0&&u&&c===0&&!v){let i={phase:"DISCOVERY",instruction:"Before starting discovery, select the discovery mode that best fits this spec.",questions:[],answeredCount:0,context:{rules:n,concernReminders:q(t)},transition:{onComplete:r('next --answer="<mode>"',o)},modeSelection:{required:!0,instruction:"Select the discovery mode.",options:[{id:"full",label:"Full discovery",description:"Standard 6 questions with all concern extras. Default for new features."},{id:"validate",label:"Validate my plan",description:"I already know what I want \u2014 challenge my assumptions, find gaps."},{id:"technical-depth",label:"Technical depth",description:"Focus on architecture, data flow, performance, integration points."},{id:"ship-fast",label:"Ship fast",description:"Minimum viable scope. What can we defer? What's the MVP?"},{id:"explore",label:"Explore scope",description:"Think bigger. 10x version? Adjacent opportunities? What are we missing?"}]}};return s!==void 0?{...i,currentUser:s}:i}let a=e.discovery.premisesCompleted===!0;if(m!==void 0&&!a&&!l){let i={phase:"DISCOVERY",instruction:"Before asking discovery questions, challenge the premises of this spec.",questions:[],answeredCount:0,context:{rules:n,concernReminders:q(t)},transition:{onComplete:r(`next --answer='{"premises":[...]}'`,o)},premiseChallenge:{required:!0,instruction:"Read the spec description"+(e.discovery.planPath!==null?" and the plan document":"")+'. Identify 2-4 premises the spec assumes. Present each premise and ask the user to agree or disagree. Submit as JSON: {"premises":[{"text":"...","agreed":true/false,"revision":"..."}]}',prompts:["Is this the right problem to solve? Could a different framing yield a simpler solution?","What happens if we do nothing? Is this a real pain point or a hypothetical one?","What existing code already partially solves this? Can we build on it instead?"]}};return s!==void 0?{...i,currentUser:s}:i}let D=m!==void 0?ye(m):[],w=[...n,...D],b=e.specDescription??"",C=b.length>500,T=e.discovery.premises??[],p=T.filter(i=>i.agreed).map(i=>i.text),E=T.filter(i=>!i.agreed&&i.revision!==void 0).map(i=>({original:i.text,revision:i.revision}));if(l){let i=e.revisitHistory??[],k=i.length>0?i[i.length-1]:null,O={phase:"DISCOVERY",instruction:k!==null?"This spec was revisited from EXECUTING. All previous answers are preserved. Review and approve, or revise answers before regenerating the spec.":`All discovery questions answered. Run: \`${r("approve",o)}\``,questions:[],answeredCount:c,context:{rules:n,concernReminders:[]},transition:{onComplete:r("approve",o)},...d};if(k!=null){let N=k;return{...O,revisited:!0,revisitReason:N.reason,previousProgress:{completedTasks:[...N.completedTasks],totalTasks:N.completedTasks.length}}}return O}if(f){let i=e.discovery.currentQuestion,k=y[i];if(k===void 0)return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${r("approve",o)}\``,questions:[],answeredCount:c,context:{rules:n,concernReminders:[]},transition:{onComplete:r("approve",o)},...d};let O={id:k.id,text:k.text,concerns:[...k.concerns],extras:k.extras.map(W=>W.text)},N={phase:"DISCOVERY",instruction:`Ask this question to the user using AskUserQuestion. Submit the answer with: \`${r('next --agent --answer="<answer>"',o)}\``,questions:[O],answeredCount:c,currentQuestion:i,totalQuestions:y.length,context:{rules:w,concernReminders:q(t)},transition:{onComplete:`${r('next --agent --answer="<answer>"',o)}`},...d},R=N;if((p.length>0||E.length>0)&&(R={...R,...p.length>0?{agreedPremises:p}:{},...E.length>0?{revisedPremises:E}:{}}),i===0){let W=J(e.specDescription??null);W!==void 0&&(R={...R,preDiscoveryResearch:W});let _=await z(e.discovery.planPath??null);_!==void 0&&(R={...R,planContext:_}),C&&_===void 0&&(R={...R,richDescription:{provided:!0,length:b.length,content:b,instruction:"The user provided a detailed description. For each question, extract relevant info and present as a pre-filled suggestion. IMPORTANT: When extracting answers from the description, mark each extraction as [STATED] (directly written by the user) or [INFERRED] (your interpretation). Present extractions individually for confirmation."}})}return R!==N?R:N}let U=new Set(e.discovery.answers.map(i=>i.questionId)),h=y.filter(i=>!U.has(i.id)).map(i=>({id:i.id,text:i.text,concerns:[...i.concerns],extras:i.extras.map(k=>k.text)})),I=e.revisitHistory??[],L=I.length>0?I[I.length-1]:null,S=L!==null,P={phase:"DISCOVERY",instruction:S?"This spec was revisited from EXECUTING. Previous discovery answers are preserved \u2014 review and revise as needed, or approve to regenerate tasks.":"Conduct a thorough discovery conversation. FIRST: perform a pre-discovery codebase scan (README, CLAUDE.md, recent git log, TODOs, directory structure) and present a brief audit summary. THEN: challenge the user's spec description against your findings. THEN: ask the discovery questions one at a time, offering concrete options based on codebase knowledge. AFTER questions: present a dream state table (current \u2192 this spec \u2192 future), scored expansion proposals, architectural decisions, and an error/rescue map. FINALLY: present a complete discovery synthesis for user confirmation before submitting answers as a JSON object.",questions:h,answeredCount:c,context:{rules:w,concernReminders:q(t)},transition:{onComplete:`${r(`next --answer='{"status_quo":"...","ambition":"...",...}'`,o)}`},...d,...p.length>0?{agreedPremises:p}:{},...E.length>0?{revisedPremises:E}:{}};if(S&&L!==void 0)return{...P,revisited:!0,revisitReason:L.reason,previousProgress:{completedTasks:[...L.completedTasks],totalTasks:L.completedTasks.length}};if(c===0){let i=P,k=J(e.specDescription??null);k!==void 0&&(i={...i,preDiscoveryResearch:k});let O=await z(e.discovery.planPath??null);if(O!==void 0&&(i={...i,planContext:O}),C&&O===void 0&&(i={...i,richDescription:{provided:!0,length:b.length,content:b,instruction:"The user provided a detailed description. For each question, extract relevant info and present as a pre-filled suggestion."}}),i!==P)return i}return P},ve=(e,t)=>{let n=e.spec,s=V(t),o=e.discovery.answers.map(l=>{let f=s.find(g=>g.id===l.questionId);return{questionId:l.questionId,question:f?.text??l.questionId,answer:l.answer}}),y=Q(e.discovery.answers);if(e.discovery.approved&&y.detected)return{phase:"DISCOVERY_REVIEW",instruction:"Discovery answers are approved. noskills detected multiple independent work areas in this spec. Present the split proposal to the user and let them decide whether to keep as one spec or split into separate specs.",answers:o,transition:{onApprove:r('next --answer="keep"',n),onRevise:r(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,n)},splitProposal:y};let c=e.discovery.alternativesPresented===!0;return e.discovery.approved&&!c?{phase:"DISCOVERY_REVIEW",subPhase:"alternatives",instruction:"Based on discovery answers, propose 2-3 distinct implementation approaches. Present each with name, summary, effort (S/M/L/XL), risk (Low/Med/High), pros, and cons. Ask the user to choose one, or skip.",answers:o,transition:{onApprove:r(`next --answer='{"approach":"A","name":"...","summary":"...","effort":"M","risk":"Low"}'`,n),onRevise:r('next --answer="skip"',n)},alternatives:{required:!0,instruction:"Generate 2-3 approaches from discovery answers and codebase. Present via AskUserQuestion.",format:{fields:["id","name","summary","effort","risk","pros","cons"]}}}:{phase:"DISCOVERY_REVIEW",instruction:y.detected?"Present ALL discovery answers to the user for review. ALSO present the split proposal \u2014 noskills detected multiple independent areas.":"Present ALL discovery answers to the user for review. The user must confirm or correct each answer before the spec can be generated. Use AskUserQuestion to ask for confirmation.",answers:o,transition:{onApprove:r('next --answer="approve"',n),onRevise:r(`next --answer='{"revise":{"status_quo":"corrected answer"}}'`,n)},splitProposal:y.detected?y:void 0}},we=e=>{let t=e.spec;return e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${r(`next --answer='{"involvesWebUI":false,"involvesCLI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`,t)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesWebUI",label:"Web/Mobile UI \u2014 layouts, responsive design, visual components"},{id:"involvesCLI",label:"CLI/Terminal UI \u2014 spinners, progress bars, interactive prompts"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+r(`next --answer='{"involvesWebUI":true,"involvesCLI":false,"involvesPublicAPI":false,...}'`,t)+"`. If none apply, answer with: `"+r('next --answer="none"',t)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:r("approve",t)}}},be=e=>{let t=e.spec;return{phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${r('next --answer="start"',t)}`}}},ke=(e,t)=>{if(t===null)return!1;let n=e.toLowerCase();return n.includes("mobile")||n.includes("layout")||n.includes("interaction design")?t.involvesWebUI:n.includes("ui state")||n.includes("skeleton ui")?t.involvesWebUI||t.involvesCLI:n.includes("readme")||n.includes("documentation updated")||n.includes("reflected in")&&n.includes("docs")?!0:n.includes("api doc")||n.includes("public api")?t.involvesPublicAPI:n.includes("migration")||n.includes("backward compat")||n.includes("deprecat")?t.involvesMigration:n.includes("audit trail")||n.includes("access control")||n.includes("data handling")||n.includes("data retention")?t.involvesDataHandling:!0},xe=(e,t,n,s,o,y,c,l)=>{let f=[],g=new Set(l??[]),x=0,d=()=>`ac-${++x}`;if(s!==null)for(let u of s.items)g.has(u.id)||f.push({id:u.id,text:`[DEBT from iteration ${u.since}] ${u.text}`});if(t&&f.push({id:d(),text:`[FAILED] Tests \u2014 fix this first: ${n.slice(0,200)}`}),y!=null)for(let u of y.verification){let v=d();g.has(v)||f.push({id:v,text:u})}for(let u of e)if(u.acceptanceCriteria!==void 0&&u.acceptanceCriteria.length>0)for(let v of u.acceptanceCriteria){if(!ke(v,o))continue;let m=d();g.has(m)||f.push({id:m,text:`(${u.id}) ${v}`})}if(c!==void 0)for(let u of c){let v=d();g.has(v)||f.push({id:v,text:`(folder: ${u.folder}) ${u.rule}`})}return f.push({id:"mandatory-tests",text:"Tests written and passing for all new and changed behavior"}),f.push({id:"mandatory-docs",text:"Documentation updated for all public-facing changes"}),f},Ee=(e,t,n,s,o,y)=>{let c=e.spec,l=B(t),f=e.execution.iteration>=s,g=e.execution.lastVerification?.passed===!1,x=e.execution.lastVerification?.output??"",d=o?.tasks??[],u=e.execution.completedTasks??[],v=new Set(u),m=d.find(h=>!v.has(h.id))??null,a=m!==null?{id:m.id,title:m.title,totalTasks:d.length,completedTasks:u.length}:void 0;if(e.execution.awaitingStatusReport){let h=xe(t,g,x,e.execution.debt,e.classification,o,y,e.execution.naItems),I=[];try{let F=JSON.parse(e.execution.lastProgress??"");Array.isArray(F.completed)&&(I=F.completed.filter(P=>typeof P=="string"&&P.startsWith("task-")))}catch{}let S={phase:"EXECUTING",instruction:I.length>=2?`${I.length} tasks reported complete. Report status against ALL relevant acceptance criteria.`:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:n,concernReminders:q(t)},transition:{onComplete:`${r(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`,c)}`,onBlocked:`${r('block "reason"',c)}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:h,reportFormat:{completed:"list item IDs you finished (e.g., ['debt-1', 'ac-3']) with evidence",remaining:"list item IDs not yet done",blocked:"list item IDs that need a decision from the user",na:"(optional) list item IDs that are not applicable to this task \u2014 they will be removed from future criteria",newIssues:"(optional) list NEW issues discovered during implementation \u2014 free text, will be assigned debt IDs automatically"}}};return I.length>=2&&(S={...S,batchTasks:I}),g&&(S={...S,verificationFailed:!0,verificationOutput:x.slice(0,2e3)}),S}let D=(e.execution.lastProgress??"").includes("Task not accepted"),w=e.execution.debt?.items??[],b=e.execution.debt?.unaddressedIterations??0,C=a!==void 0?`Execute task ${a.id}: ${a.title} (${a.completedTasks}/${a.totalTasks} completed)`:"All tasks completed. Run `"+r("done",c)+"` to finish.",T;if(g)T="Verification FAILED. Fix the failing tests before continuing.";else if(D&&w.length>0){let h=b>=3?` These items have been outstanding for ${b} iterations.`:"";T=`Task not accepted \u2014 ${w.length} remaining item(s) must be addressed before this task can be completed.${h} Address them, then submit a new status report.`}else T=C;let p={phase:"EXECUTING",instruction:T,task:a,context:{rules:n,concernReminders:q(t)},transition:{onComplete:`${r('next --answer="..."',c)}`,onBlocked:`${r('block "reason"',c)}`,iteration:e.execution.iteration}};if(D&&w.length>0&&(p={...p,taskRejected:!0,rejectionReason:`${w.length} remaining item(s) must be addressed.`,rejectionRemaining:w.map(h=>h.text)}),e.execution.debt!==null&&e.execution.debt.items.length>0){let h=e.execution.debt.unaddressedIterations??0,I=h>=3?`URGENT: These items have been unaddressed for ${h} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";p={...p,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:I}}}if(g){let h=x.slice(0,2e3);p={...p,verificationFailed:!0,verificationOutput:h}}l.length>0&&(p={...p,concernTensions:l}),f&&(p={...p,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${r("next",c)}\` to resume - your progress is saved.`});let E=[...e.decisions].reverse().find(h=>!h.promoted);return E!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(p={...p,promotePrompt:{decisionId:E.id,question:E.question,choice:E.choice,prompt:`You just resolved a decision: "${E.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${A(`rule add "${E.choice}"`)}\``}}),t.some(h=>h.id==="beautiful-product")&&(p={...p,designChecklist:{required:!0,instruction:"Before completing any UI task, rate your implementation 0-10 on these dimensions and include the ratings in your AC report:",dimensions:[{id:"hierarchy",label:"Information hierarchy \u2014 what does the user see first, second, third?"},{id:"states",label:"Interaction states \u2014 loading, empty, error, success all specified?"},{id:"edge-cases",label:"Edge cases \u2014 long text, zero results, slow connection handled?"},{id:"intentionality",label:"Overall intentionality \u2014 does this feel designed or generated?"}]}}),p},Ie=e=>{let t=e.spec;return{phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${r('next --answer="..."',t)}`}}},De=e=>({phase:"COMPLETED",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length,completionReason:e.completionReason,completionNote:e.completionNote},learningPrompt:{instruction:"Before closing this spec, reflect: did you discover any project-specific patterns, pitfalls, or preferences during this work? If so, suggest them as permanent rules.",examples:["This project uses specific allocators \u2014 rule: 'All heap allocations go through the engine allocator, never raw malloc'","Tests need special flags \u2014 rule: 'Always run deno test with --allow-all flag'","PR titles follow a pattern \u2014 rule: 'PR titles follow conventional commits format (feat:/fix:/chore:)'"]}});export{G as a,V as b,H as c,Se as d};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as o}from"./chunk-ATYDQCCJ.js";var a=1024,s=o({name:"validate-large-files",description:"Detect files exceeding size limit",canFix:!1,stacks:[],defaults:{maxKb:a},checkAll(n,r){let e=r.maxKb??a,l=e*1024,t=[];for(let i of n)if(i.size>l){let c=Math.round(i.size/1024);t.push({path:i.path,message:`file is ${c}KB (max: ${e}KB)`})}return t}}),d=s.run,f=s.validator,x=s.main;export{s as a,d as b,f as c,x as d};
2
+ import{a as o}from"./chunk-MGNBNMJZ.js";var a=1024,s=o({name:"validate-large-files",description:"Detect files exceeding size limit",canFix:!1,stacks:[],defaults:{maxKb:a},checkAll(n,r){let e=r.maxKb??a,l=e*1024,t=[];for(let i of n)if(i.size>l){let c=Math.round(i.size/1024);t.push({path:i.path,message:`file is ${c}KB (max: ${e}KB)`})}return t}}),d=s.run,f=s.validator,x=s.main;export{s as a,d as b,f as c,x as d};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{j as g}from"./chunk-6DBKPC2O.js";import{m as x}from"./chunk-6G6UVWJN.js";import{d as A}from"./chunk-5WJ6AUNY.js";var D={};A(D,{CommandBuilder:()=>p,CommandError:()=>u,ProcessGroup:()=>f,exec:()=>b,parseCommand:()=>h,spawnPty:()=>T});var u=class extends Error{constructor(e,n,s,i){super(e);this.command=n;this.code=s;this.stderr=i;this.name="CommandError"}};var m=new TextDecoder,p=class r{#t;#r;#e;constructor(t,e=[],n={}){this.#t=t,this.#r=e,this.#e={throwOnError:!0,stdout:"piped",stderr:"piped",...n}}cwd(t){return new r(this.#t,this.#r,{...this.#e,cwd:t})}env(t,e){let n=this.#e.env??{},s;return typeof t=="string"&&e!==void 0?s={...n,[t]:e}:t!==null&&typeof t=="object"?s={...n,...t}:s=n,new r(this.#t,this.#r,{...this.#e,env:s})}stdin(t){return new r(this.#t,this.#r,{...this.#e,stdin:t})}stdout(t){return new r(this.#t,this.#r,{...this.#e,stdout:t})}stderr(t){return new r(this.#t,this.#r,{...this.#e,stderr:t})}timeout(t){return new r(this.#t,this.#r,{...this.#e,timeout:t})}noThrow(){return new r(this.#t,this.#r,{...this.#e,throwOnError:!1})}quiet(){return new r(this.#t,this.#r,{...this.#e,stdout:"null",stderr:"null"})}printCommand(){let t=[this.#t,...this.#r].join(" ");return console.log(`$ ${t}`),this}async spawn(){let{runtime:t}=g,e=await t.exec.spawn(this.#t,this.#r,{cwd:this.#e.cwd,env:this.#e.env,stdin:this.#e.stdin,stdout:this.#e.stdout,stderr:this.#e.stderr});if(!e.success&&this.#e.throwOnError===!0){let n=m.decode(e.stderr);throw new u(`Command failed with exit code ${e.code}: ${this.#t}`,this.#t,e.code,n)}return e}async text(t="stdout"){let e=await this.spawn();switch(t){case"stdout":return m.decode(e.stdout).trim();case"stderr":return m.decode(e.stderr).trim();case"combined":return(m.decode(e.stdout)+m.decode(e.stderr)).trim()}}async json(){let t=await this.text();return JSON.parse(t)}async lines(){let t=await this.text();return t===""?[]:t.split(`
3
+ `)}async bytes(){return(await this.spawn()).stdout}async code(){return(await this.noThrow().spawn()).code}pipe(t){return new w([this,t])}child(){let{runtime:t}=g;return t.exec.spawnChild(this.#t,this.#r,{cwd:this.#e.cwd,env:this.#e.env,stdin:this.#e.stdin??"piped",stdout:this.#e.stdout??"piped",stderr:this.#e.stderr??"piped"})}},w=class r{#t;constructor(t){this.#t=t}pipe(t){return new r([...this.#t,t])}async text(){let t="";for(let e of this.#t){let n=await e.spawn();t=m.decode(n.stdout)}return t.trim()}async lines(){let t=await this.text();return t===""?[]:t.split(`
4
+ `)}};var h=(r,t)=>{let e=[];for(let s=0;s<r.length;s++){let i=r[s];if(i!==void 0&&e.push(i),s<t.length){let d=t[s];Array.isArray(d)?e.push(d.map(c=>S(String(c))).join(" ")):d!=null&&e.push(S(String(d)))}}let n=e.join("").trim();return B(n)},S=r=>/[\s"'\\$`]/.test(r)?`'${r.replace(/'/g,"'\\''")}'`:r,B=r=>{let t=[],e="",n=!1,s=!1,i=!1;for(let c=0;c<r.length;c++){let a=r[c];if(i){e+=a,i=!1;continue}if(a==="\\"){i=!0;continue}if(a==="'"&&!s){n=!n;continue}if(a==='"'&&!n){s=!s;continue}if(a===" "&&!n&&!s){e.length>0&&(t.push(e),e="");continue}e+=a}e.length>0&&t.push(e);let d=t[0];return d===void 0?["",[]]:[d,t.slice(1)]};var b=(r,...t)=>{let[e,n]=h(r,t);return new p(e,n)};var I=/\x04/g,M=/^Script (started|done),? ?(output file is )?[^\n]*\n?/gm,k=/^script: tcgetattr[^\n]*\n?/gm,$=r=>r.replace(I,"").replace(M,"").replace(k,""),L=(r,t)=>{let e=x();if(e==="darwin"){let n=t.map(i=>`'${i.replace(/'/g,"'\\''")}'`);return{cmd:"sh",args:["-c",`script -q /dev/null ${[r,...n].join(" ")} 2>/dev/null`],usesScript:!0}}return e==="linux"?{cmd:"sh",args:["-c",`script -qc '${(t.length>0?`${r} ${t.map(s=>`'${s.replace(/'/g,"'\\''")}'`).join(" ")}`:r).replace(/'/g,"'\\''")}' /dev/null 2>/dev/null`],usesScript:!0}:{cmd:r,args:t,usesScript:!1}},T=async r=>{let{runtime:t}=g,e=r.args!==void 0?[...r.args]:[],n=L(r.command,e),s={...r.env,TERM:"xterm-256color",COLUMNS:String(r.cols??80),LINES:String(r.rows??24)},i=t.exec.spawnChild(n.cmd,[...n.args],{cwd:r.cwd,env:s,stdin:"piped",stdout:"piped",stderr:"piped"}),d=new TextDecoder,c=new TextEncoder,a=[],C=!1,R=o=>{let l=n.usesScript?$(o):o;if(l.length!==0)for(let y of a)y(l)},v=async o=>{let l=o.getReader();try{for(;;){let{done:y,value:E}=await l.read();if(y)break;R(d.decode(E))}}catch{}finally{l.releaseLock()}},O=()=>{C||(C=!0,i.stdout&&v(i.stdout),i.stderr&&v(i.stderr))},P=null;return i.stdin&&(P=i.stdin.getWriter()),{onData(o){a.push(o),O()},write(o){P?.write(c.encode(o)).catch(()=>{})},resize(o,l){},kill(o){try{i.kill(o==="SIGKILL"?"SIGKILL":"SIGTERM")}catch{}},get pid(){return i.pid},get exitCode(){return i.status.then(o=>o.code)}}};var f=class{#t=new Map;get size(){return this.#t.size}add(t,e){let n={id:t,process:e,active:!0};return this.#t.set(t,n),e.exitCode.then(()=>{n.active=!1}).catch(()=>{n.active=!1}),n}get(t){return this.#t.get(t)}remove(t){let e=this.#t.get(t);return e===void 0?!1:(e.active&&e.process.kill(),this.#t.delete(t),!0)}list(){return[...this.#t.values()]}async killAll(t="SIGTERM"){for(let s of this.#t.values())s.active&&s.process.kill(t);let e=3e3,n=Date.now();for(let s of this.#t.values())if(s.active){let i=e-(Date.now()-n);i>0&&await Promise.race([s.process.exitCode,new Promise(d=>setTimeout(d,i))])}}forceKillAll(){for(let t of this.#t.values())t.active&&(t.process.kill("SIGKILL"),t.active=!1);this.#t.clear()}};export{u as a,p as b,h as c,b as d,T as e,f,D as g};
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{d as a,f as g}from"./chunk-3D5TBTM3.js";import{b as i}from"./chunk-NBA6EFWU.js";import{i as s}from"./chunk-6DBKPC2O.js";var u=async(n=".")=>{let[t,r]=await g(n);return r.map(e=>({name:e.name,version:e.version,path:a(e.config),config:e.config,entrypoints:c(e.config)}))},c=n=>{let t=n.exports?.value;if(t==null)return[];if(typeof t=="string")return[t];if(t!==null&&typeof t=="object"){let r=[];for(let e of Object.values(t))typeof e=="string"&&r.push(e);return r}return[]},d=(n,t)=>s.path.isAbsolute(n)?n:s.path.resolve(t,n),k=async n=>{let t=[];for await(let r of s.fs.walk(n,{exts:i,includeDirs:!1,skip:[/node_modules/,/\.git/]})){let e=s.path.relative(n,r.path),o=s.path.basename(e);o.endsWith("_test.ts")||o.endsWith("_bench.ts")||o.startsWith("_")||e.includes("testdata/")||t.push(`./${e}`)}return t.sort()};export{u as a,d as b,k as c};
2
+ import{d as a,f as g}from"./chunk-HTC2FO4I.js";import{b as i}from"./chunk-NBA6EFWU.js";import{i as s}from"./chunk-6DBKPC2O.js";var u=async(n=".")=>{let[t,r]=await g(n);return r.map(e=>({name:e.name,version:e.version,path:a(e.config),config:e.config,entrypoints:c(e.config)}))},c=n=>{let t=n.exports?.value;if(t==null)return[];if(typeof t=="string")return[t];if(t!==null&&typeof t=="object"){let r=[];for(let e of Object.values(t))typeof e=="string"&&r.push(e);return r}return[]},d=(n,t)=>s.path.isAbsolute(n)?n:s.path.resolve(t,n),k=async n=>{let t=[];for await(let r of s.fs.walk(n,{exts:i,includeDirs:!1,skip:[/node_modules/,/\.git/]})){let e=s.path.relative(n,r.path),o=s.path.basename(e);o.endsWith("_test.ts")||o.endsWith("_bench.ts")||o.startsWith("_")||e.includes("testdata/")||t.push(`./${e}`)}return t.sort()};export{u as a,d as b,k as c};
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as S,b as G,c as R}from"./chunk-L5OC7F24.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-SHN5MT56.js";import{b as r,d as i,f as w,g as y,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as v}from"./chunk-GVTM4EOU.js";import{a as k}from"./chunk-DM6U63HP.js";import{a as f,b as g}from"./chunk-FFWPJP7A.js";import{g as T,i as m}from"./chunk-6DBKPC2O.js";import{g as ie,m as O,n as K,o as I,p as le}from"./chunk-6G6UVWJN.js";var de="# eser CLI completions",B="eser",te=async e=>{try{return await m.fs.readTextFile(e)}catch{return""}},me=async e=>{try{return await m.fs.stat(e),!0}catch{return!1}},se=async e=>{let t=R(e,B);if(t.completionType==="file")return await me(t.completionsFile);let s=await te(t.rcFile),n=G(e,B);return s.includes(n)},ne=async e=>{let t=R(e,B),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=m.path.dirname(n);try{await m.fs.mkdir(o,{recursive:!0})}catch{}await m.fs.writeTextFile(n,`# eser CLI completions
2
+ import{a as S,b as G,c as R}from"./chunk-L5OC7F24.js";import{e as ee}from"./chunk-J2Z7NG2X.js";import{f as p,h as u,k as d}from"./chunk-SHN5MT56.js";import{b as r,d as i,f as w,g as y,h as Z,k as l}from"./chunk-YVN2NZL4.js";import{d as v}from"./chunk-VKB3B2FE.js";import{a as k}from"./chunk-BNZPRQUS.js";import{a as f,b as g}from"./chunk-FFWPJP7A.js";import{g as T,i as m}from"./chunk-6DBKPC2O.js";import{g as ie,m as O,n as K,o as I,p as le}from"./chunk-6G6UVWJN.js";var de="# eser CLI completions",B="eser",te=async e=>{try{return await m.fs.readTextFile(e)}catch{return""}},me=async e=>{try{return await m.fs.stat(e),!0}catch{return!1}},se=async e=>{let t=R(e,B);if(t.completionType==="file")return await me(t.completionsFile);let s=await te(t.rcFile),n=G(e,B);return s.includes(n)},ne=async e=>{let t=R(e,B),s=p({renderer:d.ansi(),sink:u.stdout()});try{if(t.completionType==="file"){let n=t.completionsFile,o=m.path.dirname(n);try{await m.fs.mkdir(o,{recursive:!0})}catch{}await m.fs.writeTextFile(n,`# eser CLI completions
3
3
  # This file is auto-generated. Run 'eser system completions --shell fish' to regenerate.
4
4
  complete -c eser -f
5
5
  complete -c eser -n "__fish_use_subcommand" -a "codebase" -d "Codebase management tools"
@@ -1,2 +1,2 @@
1
1
  import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
- import{a as r}from"./chunk-P7WCO724.js";import{a as i}from"./chunk-ATYDQCCJ.js";var t=i({name:"validate-toml",description:"Validate TOML syntax",canFix:!1,stacks:[],defaults:{},extensions:["toml"],checkFile(e,o){if(o===void 0)return[];try{return r(o),[]}catch(a){let s=a instanceof Error?a.message:"invalid TOML";return[{path:e.path,message:s}]}}}),p=t.run,d=t.validator,u=t.main;export{t as a,p as b,d as c,u as d};
2
+ import{a as r}from"./chunk-P7WCO724.js";import{a as i}from"./chunk-MGNBNMJZ.js";var t=i({name:"validate-toml",description:"Validate TOML syntax",canFix:!1,stacks:[],defaults:{},extensions:["toml"],checkFile(e,o){if(o===void 0)return[];try{return r(o),[]}catch(a){let s=a instanceof Error?a.message:"invalid TOML";return[{path:e.path,message:s}]}}}),p=t.run,d=t.validator,u=t.main;export{t as a,p as b,d as c,u as d};
@@ -0,0 +1,4 @@
1
+ import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
2
+ import{a as d}from"./chunk-J7YTWK67.js";import{b as c,d as u}from"./chunk-VKB3B2FE.js";var y=async(n,t)=>{let e=t.properties?.binPath;if(e!==void 0)return e;try{let r=await u`which ${n}`.noThrow().text();if(r.length>0)return r}catch{}throw new d(`Binary "${n}" not found. Set properties.binPath in config or ensure it is on PATH.`,{provider:n})},f=(n,t,e)=>{let r=e?.stdinData!==void 0,s=new c(n,[...t],{stdin:r?"piped":"null",stdout:"piped",stderr:"piped",cwd:e?.cwd,env:e?.env}).child();if(r&&s.stdin!==null){let i=new TextEncoder,a=s.stdin.getWriter();a.write(i.encode(e.stdinData)).then(()=>{a.close()}).catch(()=>{})}if(e?.signal!==void 0){let i=e.signal;i.aborted?s.kill("SIGTERM"):i.addEventListener("abort",()=>{s.kill("SIGTERM")},{once:!0})}return{stdout:s.stdout,stderr:s.stderr,waitForExit:async()=>{let i=await s.status;return{code:i.code,success:i.success}},kill:i=>{s.kill(i??"SIGTERM")}}},l=new TextDecoder;async function*m(n){let t=n.getReader(),e="";try{let r=await t.read();for(;r.done!==!0;){e+=l.decode(r.value,{stream:!0});let s=e.split(`
3
+ `);e=s.pop()??"";for(let i of s){let a=i.trim();if(a.length!==0)try{yield JSON.parse(a)}catch{}}r=await t.read()}let o=e.trim();if(o.length>0)try{yield JSON.parse(o)}catch{}}finally{t.releaseLock()}}var w=async(n,t)=>{let e=n.getReader(),r=[],o=await e.read();for(;o.done!==!0;)r.push(l.decode(o.value,{stream:!0})),o=await e.read();return e.releaseLock(),{content:[{kind:"text",text:r.join("").trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:t}},h=async n=>{let t=n.getReader(),e=[],r=await t.read();for(;r.done!==!0;)e.push(l.decode(r.value,{stream:!0})),r=await t.read();return t.releaseLock(),e.join("").trim()},x=(n,t,e)=>{if(t===0)return null;let r=e.length>0?`${n} exited with code ${t}: ${e}`:`${n} exited with code ${t}`;return t===1?new d(r,{provider:n}):t===126||t===127?new d(`${n} binary not found or not executable (exit code ${t})`,{provider:n}):new d(r,{provider:n})},b=(n,t)=>{let e=[];t!==void 0&&(e.push(t),e.push(""));for(let r of n)for(let o of r.content)o.kind==="text"&&e.push(o.text);return e.join(`
4
+ `)};export{y as a,f as b,m as c,w as d,h as e,x as f,b as g};