noskills 4.5.0 → 4.5.2

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 (91) hide show
  1. package/chunks/{ajan-bridge-T5M4DPDT.js → ajan-bridge-BNPC757J.js} +1 -1
  2. package/chunks/{anthropic-TS7EMQML.js → anthropic-ZKOMTKX2.js} +1 -1
  3. package/chunks/{approve-HEW3VFYH.js → approve-3TKOHYHH.js} +1 -1
  4. package/chunks/{ask-AXHTCVD6.js → ask-UB26SBWQ.js} +1 -1
  5. package/chunks/{block-VN76CXZW.js → block-Q4WAIX7X.js} +1 -1
  6. package/chunks/{cancel-7WRAST62.js → cancel-DY76ADX4.js} +1 -1
  7. package/chunks/{chunk-4PF2MT7S.js → chunk-34RPTI4K.js} +7 -7
  8. package/chunks/chunk-3JTDWOAJ.js +2 -0
  9. package/chunks/{chunk-GQTHILPL.js → chunk-5FX4EBFY.js} +1 -1
  10. package/chunks/chunk-5OTECUN7.js +1 -0
  11. package/chunks/{chunk-6YSS6PEL.js → chunk-7PBHRFOZ.js} +1 -1
  12. package/chunks/{chunk-7GC46XEU.js → chunk-AB3N327V.js} +1 -1
  13. package/chunks/{chunk-KMLNG3EC.js → chunk-BYPCI5VU.js} +1 -1
  14. package/chunks/{chunk-QKWJ72HI.js → chunk-CKIZYL4O.js} +1 -1
  15. package/chunks/{chunk-S4MUTKHT.js → chunk-DYCGJ4RY.js} +1 -1
  16. package/chunks/{chunk-UE56BMAW.js → chunk-EVJYA7S3.js} +1 -1
  17. package/chunks/{chunk-LN4NDYT6.js → chunk-FYFUEK4U.js} +1 -1
  18. package/chunks/chunk-GNMOE7H3.js +48 -0
  19. package/chunks/chunk-HB62UGZI.js +2 -0
  20. package/chunks/{chunk-EIMBEXUJ.js → chunk-IM73MYMS.js} +1 -1
  21. package/chunks/{chunk-KM64FL2X.js → chunk-J25XTDQQ.js} +1 -1
  22. package/chunks/{chunk-JL3MAFYQ.js → chunk-LGQEWL5X.js} +1 -1
  23. package/chunks/{chunk-5DZHAHXW.js → chunk-LKZZ4JN5.js} +1 -1
  24. package/chunks/{chunk-DBKXMYLF.js → chunk-NPWXEWRN.js} +1 -1
  25. package/chunks/{chunk-PKEQKXZW.js → chunk-ONJVI5AZ.js} +1 -1
  26. package/chunks/{chunk-EIGFDYGQ.js → chunk-OP4XAIGW.js} +1 -1
  27. package/chunks/{chunk-W4TQLLUK.js → chunk-T6NZVA6P.js} +1 -1
  28. package/chunks/{chunk-5PBNUBBY.js → chunk-TCSIXKUD.js} +1 -1
  29. package/chunks/{chunk-KRKOWSYW.js → chunk-WDKWHGJU.js} +5 -7
  30. package/chunks/{chunk-PRQ5CRIG.js → chunk-XDPATEP5.js} +1 -1
  31. package/chunks/{chunk-CML74SNT.js → chunk-Y45DQJSS.js} +1 -1
  32. package/chunks/{chunk-RAQY37P6.js → chunk-YUTDPPXX.js} +1 -1
  33. package/chunks/claude-code-OQJIUKZP.js +1 -0
  34. package/chunks/{concern-QSENGU6C.js → concern-UIGVWDFS.js} +1 -1
  35. package/chunks/{config-S3UXTJN2.js → config-72Z4PIJN.js} +1 -1
  36. package/chunks/{decision-ledger-GY2W6VWL.js → decision-ledger-5IPPTRT7.js} +1 -1
  37. package/chunks/{delegate-WKXIER7E.js → delegate-OV6NY434.js} +1 -1
  38. package/chunks/{diagrams-A7W2EBYV.js → diagrams-OX4FBDGP.js} +1 -1
  39. package/chunks/{done-WR3UFYJT.js → done-V54GSSTY.js} +1 -1
  40. package/chunks/{followup-5EGZEF5Q.js → followup-NL7EPIGF.js} +1 -1
  41. package/chunks/{free-KJQHRYZA.js → free-KD344KRL.js} +1 -1
  42. package/chunks/{gemini-IWP24T63.js → gemini-23EOEXSF.js} +1 -1
  43. package/chunks/{init-437SU6XH.js → init-WDRNFT57.js} +1 -1
  44. package/chunks/{invoke-hook-LMCWNF65.js → invoke-hook-I3NTD36Q.js} +1 -1
  45. package/chunks/kiro-TPAAIMY6.js +1 -0
  46. package/chunks/{learn-ZTYKBZER.js → learn-WBWNJEB2.js} +1 -1
  47. package/chunks/{ledger-FOOPJ2UO.js → ledger-QYK252DV.js} +1 -1
  48. package/chunks/{list-HNGIOVBK.js → list-WO6RS7JX.js} +1 -1
  49. package/chunks/{manager-2MOLEJ4Q.js → manager-ZSPRC5R4.js} +1 -1
  50. package/chunks/{mod-AJIRKRAH.js → mod-B6LBGYON.js} +1 -1
  51. package/chunks/{mod-6EZYRKWV.js → mod-MMHDQRNF.js} +1 -1
  52. package/chunks/{mod-7X5TKHKC.js → mod-RBGAMGZA.js} +1 -1
  53. package/chunks/{mod-TGOMO3CJ.js → mod-SV4VELMH.js} +1 -1
  54. package/chunks/{next-Y6FOPM4Z.js → next-QXCLZ7P3.js} +1 -1
  55. package/chunks/node-2XIHQ2M4.js +1 -0
  56. package/chunks/node-BXYZKSJY.js +15 -0
  57. package/chunks/node-DMUOWFGA.js +69 -0
  58. package/chunks/ollama-MXRDGQDF.js +1 -0
  59. package/chunks/openai-LE47IWMQ.js +30 -0
  60. package/chunks/{openai-YES2XJDU.js → openai-MSJF4B6H.js} +1 -1
  61. package/chunks/opencode-ZDHKR2P6.js +1 -0
  62. package/chunks/{pack-KUT53Z24.js → pack-NS64WU6M.js} +1 -1
  63. package/chunks/{plan-export-PG2BVRQZ.js → plan-export-HECAF7D4.js} +1 -1
  64. package/chunks/{purge-JGNJNEET.js → purge-PSQNN42H.js} +1 -1
  65. package/chunks/{reopen-RPDXN3CF.js → reopen-L37M5XUI.js} +1 -1
  66. package/chunks/{reset-RBCQO2RF.js → reset-OOTZXW6Q.js} +1 -1
  67. package/chunks/{review-VMS5MYOV.js → review-QLD6WSOB.js} +1 -1
  68. package/chunks/{rule-IB4VKSBC.js → rule-OOANQBHB.js} +1 -1
  69. package/chunks/{run-62PWXVII.js → run-YHCIRY7Z.js} +1 -1
  70. package/chunks/{sdk-FR7Z4YSC.js → sdk-OQIHH3OY.js} +1 -1
  71. package/chunks/{session-Q43KMFL2.js → session-OWWDH7KA.js} +1 -1
  72. package/chunks/{spec-4RKLPOEM.js → spec-O7F525UN.js} +1 -1
  73. package/chunks/{status-OGLFEFF7.js → status-SZZXY7V3.js} +1 -1
  74. package/chunks/{sync-H35O5DN5.js → sync-3RYRGTEA.js} +1 -1
  75. package/chunks/{validate-JX7UTAK5.js → validate-UZD6JBSG.js} +1 -1
  76. package/chunks/{vertexai-WF5CKMYI.js → vertexai-CVCRCO24.js} +1 -1
  77. package/chunks/{watch-SOZDHLSC.js → watch-5DNM646U.js} +1 -1
  78. package/chunks/{web-3VGRM3W4.js → web-662LNB3K.js} +1 -1
  79. package/chunks/{wontfix-RBOGLLWJ.js → wontfix-UDCTLHNB.js} +1 -1
  80. package/noskills.js +1 -1
  81. package/package.json +1 -1
  82. package/chunks/chunk-3ZJ3UGQL.js +0 -48
  83. package/chunks/chunk-575Y3OEG.js +0 -1
  84. package/chunks/chunk-IGDFEGCH.js +0 -2
  85. package/chunks/claude-code-DIWRQKZA.js +0 -1
  86. package/chunks/kiro-THWCXS5L.js +0 -1
  87. package/chunks/node-AZK2C657.js +0 -12
  88. package/chunks/node-GQQ42DT2.js +0 -68
  89. package/chunks/ollama-2KAMCXVL.js +0 -1
  90. package/chunks/openai-HHE35TAX.js +0 -31
  91. package/chunks/opencode-S4M7WJTO.js +0 -1
@@ -1,4 +1,4 @@
1
1
  import{a as w,k as x}from"./chunk-JYVB6UAV.js";import{a as _,b}from"./chunk-OAWYVETM.js";var h=class{capabilities=["text_generation","streaming","tool_calling","vision","batch_processing","structured_output","reasoning"];provider="openai";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 s=await this.client.chat.completions.create(o,{signal:n,timeout:this.config.requestTimeoutMs});return _(R(s,this.modelId))}catch(s){return b(d(s))}}async*streamText(t,n){let o=p(this.config,t);try{let s=await this.client.chat.completions.create({...o,stream:!0},{signal:n,timeout:this.config.requestTimeoutMs}),r=new Map,a=0,i=0;for await(let u of s){let c=u.choices?.[0];if(c===void 0)continue;let m=c.delta;if(m?.content!==void 0&&m.content!==null&&(yield{kind:"content_delta",textDelta:m.content}),m?.tool_calls!==void 0)for(let l of m.tool_calls){let f=l.index??0,y=r.get(f);y===void 0?r.set(f,{id:l.id??"",name:l.function?.name??"",args:l.function?.arguments??""}):y.args+=l.function?.arguments??""}if(c.finish_reason!==void 0&&c.finish_reason!==null){for(let[,l]of r){let f={};try{f=JSON.parse(l.args||"{}")}catch{}yield{kind:"tool_call_delta",toolCall:{id:l.id,name:l.name,arguments:f}}}u.usage!==void 0&&(a=u.usage.prompt_tokens??0,i=u.usage.completion_tokens??0),yield{kind:"message_done",stopReason:C(c.finish_reason),usage:{inputTokens:a,outputTokens:i,totalTokens:a+i}}}}}catch(s){yield{kind:"error",error:d(s)}}}async submitBatch(t,n){let s=t.items.map(a=>{let i=p(this.config,a.options);return JSON.stringify({custom_id:a.customId,method:"POST",url:"/v1/chat/completions",body:i})}).join(`
2
2
  `),r=new Blob([s],{type:"application/jsonl"});try{let a=await this.client.files.create({file:r,purpose:"batch"},{signal:n}),i=await this.client.batches.create({input_file_id:a.id,endpoint:"/v1/chat/completions",completion_window:"24h"},{signal:n});return g(i)}catch(a){throw d(a)}}async getBatchJob(t,n){try{let o=await this.client.batches.retrieve(t,{signal:n});return g(o)}catch(o){throw d(o)}}async listBatchJobs(t,n){try{let o=await this.client.batches.list({limit:t?.limit,after:t?.after},{signal:n}),s=[];for(let r of o.data??[])s.push(g(r));return s}catch(o){throw d(o)}}async downloadBatchResults(t,n){let o=t.storage?.outputRef;if(o===void 0)return[];try{let a=(await(await this.client.files.content(o,{signal:n})).text()).split(`
3
- `).filter(u=>u.length>0),i=[];for(let u of a){let c=JSON.parse(u);c.response?.status_code===200?i.push({customId:c.custom_id,result:R(c.response.body,this.modelId)}):i.push({customId:c.custom_id,error:c.error?.message??"Unknown error"})}return i}catch(s){throw d(s)}}async cancelBatchJob(t,n){try{await this.client.batches.cancel(t,{signal:n})}catch(o){throw d(o)}}async close(){}getRawClient(){return this.client}},j={provider:"openai",async createModel(e){let{default:t}=await import("./openai-HHE35TAX.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=B(t.messages,t.system),o={model:e.model,messages:n,max_tokens:t.maxTokens??e.maxTokens};return t.temperature!==void 0&&(o.temperature=t.temperature),t.topP!==void 0&&(o.top_p=t.topP),t.stopWords!==void 0&&(o.stop=t.stopWords),t.tools!==void 0&&(o.tools=t.tools.map(s=>({type:"function",function:{name:s.name,description:s.description,parameters:s.parameters??{type:"object",properties:{}}}}))),t.toolChoice!==void 0&&(o.tool_choice=t.toolChoice),t.responseFormat!==void 0&&(t.responseFormat.type==="json_schema"?o.response_format={type:"json_schema",json_schema:{name:t.responseFormat.name??"response",schema:t.responseFormat.jsonSchema,strict:!0}}:t.responseFormat.type==="json_object"&&(o.response_format={type:"json_object"})),t.thinkingBudget!==void 0&&(o.reasoning_effort=v(t.thinkingBudget)),o},B=(e,t)=>{let n=[];t!==void 0&&n.push({role:"system",content:t});for(let o of e){if(o.role==="system"){let r=[];for(let a of o.content)a.kind==="text"&&r.push(a.text);n.push({role:"system",content:r.join(`
3
+ `).filter(u=>u.length>0),i=[];for(let u of a){let c=JSON.parse(u);c.response?.status_code===200?i.push({customId:c.custom_id,result:R(c.response.body,this.modelId)}):i.push({customId:c.custom_id,error:c.error?.message??"Unknown error"})}return i}catch(s){throw d(s)}}async cancelBatchJob(t,n){try{await this.client.batches.cancel(t,{signal:n})}catch(o){throw d(o)}}async close(){}getRawClient(){return this.client}},j={provider:"openai",async createModel(e){let{default:t}=await import("./openai-LE47IWMQ.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=B(t.messages,t.system),o={model:e.model,messages:n,max_tokens:t.maxTokens??e.maxTokens};return t.temperature!==void 0&&(o.temperature=t.temperature),t.topP!==void 0&&(o.top_p=t.topP),t.stopWords!==void 0&&(o.stop=t.stopWords),t.tools!==void 0&&(o.tools=t.tools.map(s=>({type:"function",function:{name:s.name,description:s.description,parameters:s.parameters??{type:"object",properties:{}}}}))),t.toolChoice!==void 0&&(o.tool_choice=t.toolChoice),t.responseFormat!==void 0&&(t.responseFormat.type==="json_schema"?o.response_format={type:"json_schema",json_schema:{name:t.responseFormat.name??"response",schema:t.responseFormat.jsonSchema,strict:!0}}:t.responseFormat.type==="json_object"&&(o.response_format={type:"json_object"})),t.thinkingBudget!==void 0&&(o.reasoning_effort=v(t.thinkingBudget)),o},B=(e,t)=>{let n=[];t!==void 0&&n.push({role:"system",content:t});for(let o of e){if(o.role==="system"){let r=[];for(let a of o.content)a.kind==="text"&&r.push(a.text);n.push({role:"system",content:r.join(`
4
4
  `)});continue}if(o.role==="tool"){for(let r of o.content)r.kind==="tool_result"&&n.push({role:"tool",tool_call_id:r.toolResult.toolCallId,content:r.toolResult.content});continue}let s=o.content.map(T);s.length===1&&s[0]?.type==="text"?n.push({role:o.role,content:s[0].text}):n.push({role:o.role,content:s})}return n},T=e=>{switch(e.kind){case"text":return{type:"text",text:e.text};case"image":{let t;if(e.image.url!==void 0)t=e.image.url;else if(e.image.data!==void 0)t=`data:${e.image.mimeType??"image/png"};base64,${k(e.image.data)}`;else return{type:"text",text:"[unsupported image]"};return{type:"image_url",image_url:{url:t,detail:e.image.detail??"auto"}}}case"audio":{if(e.audio.data!==void 0){let t=e.audio.mimeType??"audio/mpeg",n=A(t);return{type:"input_audio",input_audio:{data:k(e.audio.data),format:n}}}return{type:"text",text:"[unsupported audio format]"}}case"tool_call":return{type:"function",id:e.toolCall.id,function:{name:e.toolCall.name,arguments:JSON.stringify(e.toolCall.arguments)}};default:return{type:"text",text:`[unsupported content: ${e.kind}]`}}},R=(e,t)=>{let n=[],o="end_turn",s=e.choices?.[0];if(s!==void 0){if(s.message?.content!==void 0&&s.message.content!==null&&n.push({kind:"text",text:s.message.content}),s.message?.tool_calls!==void 0)for(let r of s.message.tool_calls){let a={};try{a=JSON.parse(r.function?.arguments??"{}")}catch{}n.push({kind:"tool_call",toolCall:{id:r.id,name:r.function?.name??"",arguments:a}})}o=C(s.finish_reason)}return{content:n,stopReason:o,usage:{inputTokens:e.usage?.prompt_tokens??0,outputTokens:e.usage?.completion_tokens??0,totalTokens:e.usage?.total_tokens??0},modelId:t,rawResponse:e}},C=e=>e==="stop"?"end_turn":e==="length"?"max_tokens":e==="tool_calls"?"tool_use":"end_turn",g=e=>({id:e.id,status:S(e.status),createdAt:new Date(e.created_at*1e3),completedAt:e.completed_at!==void 0?new Date(e.completed_at*1e3):void 0,totalCount:e.request_counts?.total??0,doneCount:e.request_counts?.completed??0,failedCount:e.request_counts?.failed??0,storage:{type:"openai_file",inputRef:e.input_file_id,outputRef:e.output_file_id}}),S=e=>e==="completed"?"completed":e==="failed"?"failed":e==="cancelled"||e==="cancelling"?"cancelled":e==="in_progress"||e==="finalizing"?"processing":"pending",v=e=>e<=1e3?"low":e>=1e4?"high":"medium",A=e=>e.includes("mp3")||e.includes("mpeg")?"mp3":e.includes("wav")?"wav":e.includes("flac")?"flac":e.includes("ogg")?"ogg":"mp3",d=e=>{if(e instanceof w)return e;let t=e instanceof Error?e:new Error(String(e)),n=e?.status??e?.statusCode??500;return x("openai",n,t)},k=e=>{let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)};export{h as a,j as b};
@@ -1,4 +1,4 @@
1
- import{d as ce,e as le}from"./chunk-XDRX4ZBJ.js";import{c as de}from"./chunk-IFE5SYGK.js";import{b as z,c as ie}from"./chunk-VJRCTYGL.js";import{f as G}from"./chunk-PKEQKXZW.js";import{a as X,d as _,e as Y,g as se,h as K,i as oe,j as re}from"./chunk-O4KKKYCH.js";import{a as j,f as ae}from"./chunk-KRKOWSYW.js";import{i as B}from"./chunk-Y5E7ZCCX.js";var Q={detected:!1,reason:"",proposals:[]},xe=[/\badditionally\b/i,/\bseparately\b/i,/\band also\b/i,/\banother issue\b/i,/\bsecond problem\b/i,/\bon the other hand\b/i,/\bplus\b/i],ue=/(?:^|[.!?]\s+)also[,\s]/im,Re=/(?:^|\n|\.\s+)\s*(?:\(\d+\)|\d+\.\s|(?:first|second|third|fourth|fifth)[:;,])/im,ke=/\b(fix|add|restore|update|remove|refactor|rewrite|implement|create|migrate|convert)\s+\S+(?:\s+\S+){0,4}\s+AND\s+(fix|add|restore|update|remove|refactor|rewrite|implement|create|migrate|convert)\s+/i,De=[/\buse\s+(?:the\s+)?(?:new\s+)?(\w+)\s+(?:type|interface|class|module|function)\b/i,/\bafter\s+(?:adding|creating|implementing)\b/i,/\bdepends\s+on\b/i,/\bprerequisite\b/i,/\brequires\s+(?:the\s+)?(?:above|previous|first)\b/i,/\bthen\s+use\b/i],me=(e,t)=>{if(t==="ship-fast")return Q;let n=new Map;for(let m of e)n.set(m.questionId,m.answer);let r=n.get("status_quo")??"",s=n.get("ambition")??"",o=n.get("scope_boundary")??"",i=n.get("verification")??"",l=Ce(r,s,o,i);return l.length<2||l.reduce((m,w)=>m+w.estimatedTasks,0)<=3||Le(l)?Q:{detected:!0,reason:`Discovery answers cover ${l.length} independent areas that could be separate specs.`,proposals:l}},Ce=(e,t,n,r)=>{let s=Ie(e,t);if(s.length>=2)return s.map(J);let o=Oe(e,t);if(o.length>=2)return o.map(J);let i=Te(e,t);return i.length>=2?i.map(J):[]},Ie=(e,t)=>{for(let[n,r]of[[e,"status_quo"],[t,"ambition"]]){if(!Re.test(n))continue;let s=Pe(n);if(s.length>=2)return s.map(o=>({text:o.trim(),sourceQuestions:[r]}))}return[]},Pe=e=>{let n=e.split(/\(\d+\)\s*/).slice(1).map(p=>p.trim()).filter(p=>p.length>0);if(n.length>=2)return n;let r=e.split(/(?:^|\n|(?<=\.)\s+)\s*\d+\.\s+/),s=r.length>1?r.slice(1).map(p=>p.trim()).filter(p=>p.length>0):[];if(s.length>=2)return s;let o=/(?:^|\n|(?<=\.)\s+)\s*(?:first|second|third|fourth|fifth)[:;,]\s*/i,i=e.split(o),l=i.length>1?i.slice(1).map(p=>p.trim()).filter(p=>p.length>0):[];return l.length>=2?l:[]},Oe=(e,t)=>{for(let[n,r]of[[e,"status_quo"],[t,"ambition"]]){if(ue.test(n)){let s=Ae(n,ue);if(s.length>=2)return s.map(o=>({text:o.trim(),sourceQuestions:[r]}))}for(let s of xe)if(s.test(n)){let o=n.split(s).map(i=>i.trim()).filter(i=>i.length>0);if(o.length>=2)return o.map(i=>({text:i,sourceQuestions:[r]}))}}return[]},Ae=(e,t)=>{let n=e.match(t);if(n===null||n.index===void 0)return[];let r=e.slice(0,n.index).trim(),s=e.slice(n.index+n[0].length).trim();return r.length>0&&s.length>0?[r,s]:[]},Te=(e,t)=>{for(let[n,r]of[[e,"status_quo"],[t,"ambition"]]){let s=ke.exec(n);if(s!==null&&s.index!==void 0){let o=n.toUpperCase().indexOf(" AND ",s.index);if(o>=0){let i=n.slice(0,o).trim(),l=n.slice(o+5).trim();if(i.length>0&&l.length>0)return[{text:i,sourceQuestions:[r]},{text:l,sourceQuestions:[r]}]}}}return[]},J=e=>{let t=Ne(e.text),n=Fe(e.text);return{name:t,description:e.text,estimatedTasks:n,relevantAnswers:[...e.sourceQuestions]}},Ne=e=>{let t=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","shall","should","may","might","must","can","could","to","of","in","for","on","with","at","by","from","that","this","it","its","and","or","but","not","no","so","if","then","too","very","just"]),s=e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").split(/\s+/).filter(o=>o.length>0&&!t.has(o)).slice(0,4).join("-").replace(/--+/g,"-").replace(/^-|-$/g,"").slice(0,50);return s.length>0?s:"area"},Fe=e=>{let t=/\b(fix|add|restore|update|remove|refactor|rewrite|implement|create|migrate|convert|replace|extract|move|rename|split|merge|test|verify|validate|configure|setup|install|deploy)\b/gi,r=e.match(t)?.length??0;return Math.max(2,Math.min(r+1,5))},Le=e=>{for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let r=e[t],s=e[n],o=`${r.description} ${s.description}`;for(let m of De)if(m.test(o))return!0;let i=pe(r.description),l=pe(s.description);if([...i].filter(m=>l.has(m)).some(m=>/^[A-Z]/.test(m)||m.includes(".")))return!0}return!1},pe=e=>{let t=new Set,n=e.match(/\b[A-Z][a-zA-Z0-9]+\b/g);if(n!==null)for(let s of n)t.add(s);let r=e.match(/\b[\w-]+\.\w{1,4}\b/g);if(r!==null)for(let s of r)t.add(s);return t};var F=e=>de(e),d=(e,t)=>F(t===null?e:`spec ${t} ${e}`),Ve=[{key:"involvesWebUI",pattern:/\b(ui|frontend|component|react|css|html|button|modal|form|page|screen|layout|design|loading state|empty state|error state)\b/i},{key:"involvesCLI",pattern:/\b(cli|terminal|command.?line|stdout|stdin|ansi|tui|console)\b/i},{key:"involvesPublicAPI",pattern:/\b(api|endpoint|rest|graphql|webhook|public.?facing|sdk|client.?library)\b/i},{key:"involvesMigration",pattern:/\b(migrat\w*|schema.?change|breaking.?change|backward.?compat|upgrade|deprecat\w*)\b/i},{key:"involvesDataHandling",pattern:/\b(pii|gdpr|encrypt|personal.?data|user.?data|data.?retention|data.?safety|sensitive)\b/i}],we=e=>{let t=[];e.specDescription&&t.push(e.specDescription);let n=e.discovery?.userContext;Array.isArray(n)&&t.push(...n);for(let o of e.discovery?.answers??[])t.push(o.answer);let r=t.join(" "),s={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1,source:"inferred",inferredFrom:[]};for(let{key:o,pattern:i}of Ve){let l=r.match(i);l!==null&&(s[o]=!0,s.inferredFrom.push(`${o}:${l[0].toLowerCase()}`))}return s},qe=[{key:"involvesWebUI",label:"Web UI"},{key:"involvesPublicAPI",label:"Public API"},{key:"involvesCLI",label:"CLI"},{key:"involvesMigration",label:"Migration"},{key:"involvesDataHandling",label:"Data Handling"}],_e=e=>{let t=new Map;for(let r of e.inferredFrom??[]){let s=r.indexOf(":");if(s===-1)continue;let o=r.slice(0,s),i=r.slice(s+1),l=t.get(o);l===void 0?t.set(o,[i]):l.includes(i)||l.push(i)}let n=["Based on your answers, this spec involves:"];for(let{key:r,label:s}of qe){let o=e[r]===!0,i=o?"\u2713":"\u2717";if(o){let l=t.get(r)??[];if(l.length>0){let p=l.map(m=>`"${m}"`).join(", ");n.push(` ${i} ${s} (mentions: ${p})`)}else n.push(` ${i} ${s}`)}else n.push(` ${i} ${s}`)}return n.join(`
1
+ import{d as ce,e as le}from"./chunk-XDRX4ZBJ.js";import{c as de}from"./chunk-IFE5SYGK.js";import{b as z,c as ie}from"./chunk-VJRCTYGL.js";import{a as X,d as _,e as Y,g as se,h as K,i as oe,j as re}from"./chunk-O4KKKYCH.js";import{f as G}from"./chunk-ONJVI5AZ.js";import{a as j,f as ae}from"./chunk-WDKWHGJU.js";import{i as B}from"./chunk-Y5E7ZCCX.js";var Q={detected:!1,reason:"",proposals:[]},xe=[/\badditionally\b/i,/\bseparately\b/i,/\band also\b/i,/\banother issue\b/i,/\bsecond problem\b/i,/\bon the other hand\b/i,/\bplus\b/i],ue=/(?:^|[.!?]\s+)also[,\s]/im,Re=/(?:^|\n|\.\s+)\s*(?:\(\d+\)|\d+\.\s|(?:first|second|third|fourth|fifth)[:;,])/im,ke=/\b(fix|add|restore|update|remove|refactor|rewrite|implement|create|migrate|convert)\s+\S+(?:\s+\S+){0,4}\s+AND\s+(fix|add|restore|update|remove|refactor|rewrite|implement|create|migrate|convert)\s+/i,De=[/\buse\s+(?:the\s+)?(?:new\s+)?(\w+)\s+(?:type|interface|class|module|function)\b/i,/\bafter\s+(?:adding|creating|implementing)\b/i,/\bdepends\s+on\b/i,/\bprerequisite\b/i,/\brequires\s+(?:the\s+)?(?:above|previous|first)\b/i,/\bthen\s+use\b/i],me=(e,t)=>{if(t==="ship-fast")return Q;let n=new Map;for(let m of e)n.set(m.questionId,m.answer);let r=n.get("status_quo")??"",s=n.get("ambition")??"",o=n.get("scope_boundary")??"",i=n.get("verification")??"",l=Ce(r,s,o,i);return l.length<2||l.reduce((m,w)=>m+w.estimatedTasks,0)<=3||Le(l)?Q:{detected:!0,reason:`Discovery answers cover ${l.length} independent areas that could be separate specs.`,proposals:l}},Ce=(e,t,n,r)=>{let s=Ie(e,t);if(s.length>=2)return s.map(J);let o=Oe(e,t);if(o.length>=2)return o.map(J);let i=Te(e,t);return i.length>=2?i.map(J):[]},Ie=(e,t)=>{for(let[n,r]of[[e,"status_quo"],[t,"ambition"]]){if(!Re.test(n))continue;let s=Pe(n);if(s.length>=2)return s.map(o=>({text:o.trim(),sourceQuestions:[r]}))}return[]},Pe=e=>{let n=e.split(/\(\d+\)\s*/).slice(1).map(p=>p.trim()).filter(p=>p.length>0);if(n.length>=2)return n;let r=e.split(/(?:^|\n|(?<=\.)\s+)\s*\d+\.\s+/),s=r.length>1?r.slice(1).map(p=>p.trim()).filter(p=>p.length>0):[];if(s.length>=2)return s;let o=/(?:^|\n|(?<=\.)\s+)\s*(?:first|second|third|fourth|fifth)[:;,]\s*/i,i=e.split(o),l=i.length>1?i.slice(1).map(p=>p.trim()).filter(p=>p.length>0):[];return l.length>=2?l:[]},Oe=(e,t)=>{for(let[n,r]of[[e,"status_quo"],[t,"ambition"]]){if(ue.test(n)){let s=Ae(n,ue);if(s.length>=2)return s.map(o=>({text:o.trim(),sourceQuestions:[r]}))}for(let s of xe)if(s.test(n)){let o=n.split(s).map(i=>i.trim()).filter(i=>i.length>0);if(o.length>=2)return o.map(i=>({text:i,sourceQuestions:[r]}))}}return[]},Ae=(e,t)=>{let n=e.match(t);if(n===null||n.index===void 0)return[];let r=e.slice(0,n.index).trim(),s=e.slice(n.index+n[0].length).trim();return r.length>0&&s.length>0?[r,s]:[]},Te=(e,t)=>{for(let[n,r]of[[e,"status_quo"],[t,"ambition"]]){let s=ke.exec(n);if(s!==null&&s.index!==void 0){let o=n.toUpperCase().indexOf(" AND ",s.index);if(o>=0){let i=n.slice(0,o).trim(),l=n.slice(o+5).trim();if(i.length>0&&l.length>0)return[{text:i,sourceQuestions:[r]},{text:l,sourceQuestions:[r]}]}}}return[]},J=e=>{let t=Ne(e.text),n=Fe(e.text);return{name:t,description:e.text,estimatedTasks:n,relevantAnswers:[...e.sourceQuestions]}},Ne=e=>{let t=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","shall","should","may","might","must","can","could","to","of","in","for","on","with","at","by","from","that","this","it","its","and","or","but","not","no","so","if","then","too","very","just"]),s=e.toLowerCase().replace(/[^a-z0-9\s-]/g,"").split(/\s+/).filter(o=>o.length>0&&!t.has(o)).slice(0,4).join("-").replace(/--+/g,"-").replace(/^-|-$/g,"").slice(0,50);return s.length>0?s:"area"},Fe=e=>{let t=/\b(fix|add|restore|update|remove|refactor|rewrite|implement|create|migrate|convert|replace|extract|move|rename|split|merge|test|verify|validate|configure|setup|install|deploy)\b/gi,r=e.match(t)?.length??0;return Math.max(2,Math.min(r+1,5))},Le=e=>{for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let r=e[t],s=e[n],o=`${r.description} ${s.description}`;for(let m of De)if(m.test(o))return!0;let i=pe(r.description),l=pe(s.description);if([...i].filter(m=>l.has(m)).some(m=>/^[A-Z]/.test(m)||m.includes(".")))return!0}return!1},pe=e=>{let t=new Set,n=e.match(/\b[A-Z][a-zA-Z0-9]+\b/g);if(n!==null)for(let s of n)t.add(s);let r=e.match(/\b[\w-]+\.\w{1,4}\b/g);if(r!==null)for(let s of r)t.add(s);return t};var F=e=>de(e),d=(e,t)=>F(t===null?e:`spec ${t} ${e}`),Ve=[{key:"involvesWebUI",pattern:/\b(ui|frontend|component|react|css|html|button|modal|form|page|screen|layout|design|loading state|empty state|error state)\b/i},{key:"involvesCLI",pattern:/\b(cli|terminal|command.?line|stdout|stdin|ansi|tui|console)\b/i},{key:"involvesPublicAPI",pattern:/\b(api|endpoint|rest|graphql|webhook|public.?facing|sdk|client.?library)\b/i},{key:"involvesMigration",pattern:/\b(migrat\w*|schema.?change|breaking.?change|backward.?compat|upgrade|deprecat\w*)\b/i},{key:"involvesDataHandling",pattern:/\b(pii|gdpr|encrypt|personal.?data|user.?data|data.?retention|data.?safety|sensitive)\b/i}],we=e=>{let t=[];e.specDescription&&t.push(e.specDescription);let n=e.discovery?.userContext;Array.isArray(n)&&t.push(...n);for(let o of e.discovery?.answers??[])t.push(o.answer);let r=t.join(" "),s={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1,source:"inferred",inferredFrom:[]};for(let{key:o,pattern:i}of Ve){let l=r.match(i);l!==null&&(s[o]=!0,s.inferredFrom.push(`${o}:${l[0].toLowerCase()}`))}return s},qe=[{key:"involvesWebUI",label:"Web UI"},{key:"involvesPublicAPI",label:"Public API"},{key:"involvesCLI",label:"CLI"},{key:"involvesMigration",label:"Migration"},{key:"involvesDataHandling",label:"Data Handling"}],_e=e=>{let t=new Map;for(let r of e.inferredFrom??[]){let s=r.indexOf(":");if(s===-1)continue;let o=r.slice(0,s),i=r.slice(s+1),l=t.get(o);l===void 0?t.set(o,[i]):l.includes(i)||l.push(i)}let n=["Based on your answers, this spec involves:"];for(let{key:r,label:s}of qe){let o=e[r]===!0,i=o?"\u2713":"\u2717";if(o){let l=t.get(r)??[];if(l.length>0){let p=l.map(m=>`"${m}"`).join(", ");n.push(` ${i} ${s} (mentions: ${p})`)}else n.push(` ${i} ${s}`)}else n.push(` ${i} ${s}`)}return n.join(`
2
2
  `)},We="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.",he=["Interview the user relentlessly about every aspect of this plan until you reach a shared understanding.","Walk down each branch of the design tree, resolving dependencies between decisions one-by-one.","For each question, provide your recommended answer \u2014 don't just ask, offer your informed opinion.","Ask questions ONE AT A TIME. Do not batch questions. Each question deserves its own focused exchange.","If a question can be answered by exploring the codebase, explore the codebase INSTEAD of asking. Only ask the user what the codebase cannot tell you.","You are an honest engineer. Do NOT fill placeholders with assumptions.","You are investing in this spec like a CEO invests in a product \u2014 get the details right.","You are doing academic-level due diligence \u2014 no hand-waving, no 'we'll figure it out later.'","If a section is not applicable, ask the user to confirm it's N/A with a specific reason \u2014 don't decide yourself.","If two answers conflict, surface the conflict to the user \u2014 don't resolve it yourself.","If an answer is vague, push back and ask for specifics \u2014 don't accept vague."],ee={hasAskUserTool:!0,optionPresentation:"tool",hasSubAgentDelegation:!0,subAgentMethod:"task"},Be=e=>{let t=["CEO REVIEW \u2014 PREMISE CHECK: Restate the core premise in one sentence. Does it still hold? What evidence supports it? What challenges it?","CEO REVIEW \u2014 READINESS DASHBOARD: Score 8 dimensions 1-10 (premise-clarity, reuse-leverage, test-coverage, failure-mode-coverage, boundary-clarity, unresolved-decisions, verification-path, scope-discipline). State overall score. Verdict: APPROVED or NEEDS WORK.","CEO REVIEW \u2014 REFLECTION: Honest observation of the user's decision patterns during this spec. Not flattery. If they made a questionable choice, say so respectfully."];return e==="hold-scope"?t:[...t,"CEO REVIEW \u2014 REUSE SCORE: Table of existing modules/functions reused vs new code. Calculate approximate reuse percentage. Flag if <40%.","CEO REVIEW \u2014 DREAM STATE DELTA: Current state (2-3 sentences), 12-month ideal (2-3 sentences), what this spec delivers (%), remaining gap.","CEO REVIEW \u2014 FAILURE MODE REGISTRY: Table with #, Failure, Trigger, Mitigation. Every failure mode must have concrete mitigation. Include at minimum: data corruption, race conditions, backward compat, user confusion, performance.","CEO REVIEW \u2014 NOT IN SCOPE: Explicit list of what this spec does NOT touch, with reasons. This is a contract.","CEO REVIEW \u2014 UNRESOLVED DECISIONS: Table with #, Decision, Default, Notes. Every unresolved decision must have a safe default. Present to user.","CEO REVIEW \u2014 FILE-LEVEL PLAN: Table of every file created/modified with purpose. Plus: functions to reuse, files NOT modified.",e==="scope-expansion"?"CEO REVIEW \u2014 EXPANSION TABLE: Present all accepted expansions with LOC estimates.":"CEO REVIEW \u2014 SCOPE DISCIPLINE: List what was held out of scope and why."]},Ye=e=>{let t=e.filter(r=>r.suggestsPosture!==void 0);return t.length===0?null:t.length===1?`Based on your active concerns, suggested posture: ${t[0].suggestsPosture} (${t[0].name} active).`:`Multiple concerns suggest different postures (${t.map(r=>`${r.name}: ${r.suggestsPosture}`).join(", ")}). Please select manually: a/b/c/d.`},Ge=(e,t,n,r,s,o=ee,i)=>{let l=e.execution.iteration>=t,p=o.hasAskUserTool?"Use AskUserQuestion for all decision points.":"Present options as a numbered list at every decision point.",m=[];n||m.push(We),m.push("Report progress honestly. Not done = 'not done'. Partial = 'partial: [works]/[doesn't]'. Untested = 'untested'. 4 of 6 = '4 of 6 done, 2 remaining'.",`Never skip steps or infer decisions. ${p} Recommend first, then ask. One noskills call per interaction \u2014 never batch-submit or backfill.`,"Display `roadmap` before other content. Display `gate` prominently.","NEVER suggest bypassing, skipping, or 'breaking out of' noskills. Discovery helps the user \u2014 it is not an obstacle. If scope changes: revise spec, reset and create new, or split.","NEVER ask permission to run the next noskills command. After spec new \u2192 run next immediately. After answering questions \u2192 run next. After approve \u2192 run next. After task completion \u2192 run next. The workflow is sequential \u2014 each step has one next step. Just run it.","Listen first: after spec creation, ask 'Tell me about this \u2014 share as much context as you have.' Wait for their response before mode selection. Rich context (>200 chars) \u2192 pre-fill discovery answers as STATED/INFERRED. Brief response \u2192 proceed normally.",'Discovery questions are adaptive. After each answer, generate 1-3 follow-up questions if the answer reveals ambiguity, risk, dependencies, or missing detail. Submit follow-ups via `noskills spec <name> followup <questionId> "question"`. Max 3 per question. Do NOT rush through discovery.',"Confidence scoring: every technical finding needs a confidence score (1-10). 9-10: verified (read code, ran test). 7-8: strong evidence. 5-6: reasonable inference. 3-4: guess. 1-2: speculation. State basis ('read X', 'inferred from Y'). If confidence < 5, prefix with '\u26A0 Unverified:'.");let w=s?.outOfScope??[],S=e.spec;switch(e.phase){case"IDLE":{let h=o.optionPresentation==="tool"?"Pass interactiveOptions DIRECTLY to AskUserQuestion options array (header max 12 chars). Use commandMap to resolve selections. For availableConcerns: AskUserQuestion with multiSelect:true, max 4 per question \u2014 split across questions if needed. Present ALL concerns.":"Present interactiveOptions as numbered list. Use commandMap to resolve selections. Present ALL availableConcerns as numbered list for multiselect.";return{rules:["If the user described a feature/bug/task, create a spec immediately: `noskills spec new \"description\"` \u2014 name is auto-generated. Do NOT present menus or ask 'What would you like to do?' unless the conversation has no prior context.",...m,h,"Encourage full context: 'Tell me what you want to build \u2014 one-liner, detailed requirements, meeting notes, anything.' Slug is auto-generated. Pass full text to `noskills spec new \"...\"`.","After spec new, ask: full discovery, quick discovery, or skip to spec draft. Never skip without asking.","Every task gets a spec. No exceptions. A one-liner fix, a config change, a 'simple' refactor \u2014 all get specs. The spec can be short but it must exist. 'Too simple for a spec' is the anti-pattern.","SPEC CREATION: When user says 'create a new spec', 'new spec', or similar \u2014 do NOT run `noskills spec new` without a description. Ask the user 'What do you want to build?' via AskUserQuestion first. Wait for their response. Then run: `noskills spec new \"their full response\"`. This takes < 5 seconds. Do not overthink it.","CONCERN MANAGEMENT: When the user wants to add or view concerns, run `noskills concern list` immediately. Do NOT analyze or recommend concerns. Present the list via AskUserQuestion (multiSelect:true, max 4 per question). Use a SINGLE `noskills concern add id1 id2 id3` command for all selections."],tone:"Welcoming. Present choices, then wait."}}case"DISCOVERY":{let h=o.hasAskUserTool?"Ask each question via AskUserQuestion. One question per call.":"Ask one question at a time as text.",g=r.flatMap(a=>a.conductRules?.DISCOVERY??[]);return{modeOverride:"plan mode. DO NOT create, edit, or write any files. DO NOT run state-modifying commands. MAY read files and run read-only commands (cat, ls, grep, git log, git diff).",rules:[...m,"MODE: You MUST be in plan mode during discovery. Do not exit plan mode. If you are not in plan mode, enter it now (Shift+Tab or /plan).",`${h} Never answer questions yourself. Never submit answers without user confirmation. Pre-fill suggested answers from detailed descriptions \u2014 user must confirm each. With a fully formed plan, skip questions but MUST run premise challenge and alternatives.`,"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).","Pre-discovery: (1) pre-discovery codebase scan \u2014 read README, CLAUDE.md, design docs, last 20 commits, TODOs, existing specs, directory structure. Present a brief audit summary. (2) If `preDiscoveryResearch.required`, web-search every `extractedTerms` entry \u2014 report versions, API changes, deprecations. (3) Ask discovery mode: A) Explore scope B) Technical depth C) Validate my plan D) Ship fast. Adapt emphasis accordingly.","Before starting discovery questions, challenge the user's initial spec description against codebase findings. Flag: hidden complexity, conflicts with existing code, scope mismatch, overlapping modules. Ask clarifying follow-ups.","When asking questions, offer concrete options from codebase knowledge alongside the open-ended question (e.g., 'I see three scenarios: A)... B)... C)... D) Something else'). Push back on vague answers. Follow up on short answer with 'Can you be more specific?'",(()=>{let a=re(r);return`${a.length>0?`After answers, ${a.join(" Also: ")}`:"After answers, synthesize CURRENT STATE \u2192 THIS SPEC \u2192 6-MONTH IDEAL vision."} Then: (1) expansion opportunities as numbered proposals with effort (S/M/L/XL), risk, completeness delta \u2014 options: Add/Defer/Skip. (2) Architectural decisions that BLOCK implementation \u2014 present with options, RECOMMENDATION, completeness scores. Unresolved = risk flag. (3) Error/rescue map: codepath | failure mode | handling. Flag CRITICAL GAPS as decisions.`})(),"Present DISCOVERY SUMMARY for confirmation: intent, scope, dream state, expansions, architectural decisions, error map. Ask for confirmation before generating spec. Submit all answers together in one `noskills next --answer` JSON call.",...he,...g],tone:"Curious interviewer with a stake in the answers. Comes PREPARED \u2014 read the codebase first. Challenge assumptions, think about architecture and failure modes."}}case"DISCOVERY_REFINEMENT":{let h=r.flatMap(u=>u.conductRules?.DISCOVERY_REFINEMENT??[]),g=Z(e),a;if(g==="stage-a"){let u=Ye(r),v=i?.defaultReviewPosture!==void 0;a=["COMPLETENESS ASSESSMENT: Before presenting answers for review, evaluate the spec's completeness across 6 dimensions. Score each 1-10: problem-clarity, scope-definition, technical-feasibility, verification-strategy, risk-identification, user-impact-analysis. Identify concrete gaps (specific, not vague). Present the table and gaps to the user.","Scoring guide: 9-10 = fully addressed; 7-8 = mostly addressed; 5-6 = partially; 3-4 = weakly; 1-2 = not addressed. A gap is anything the spec doesn't explicitly address that could cause problems during execution."],u!==null&&a.push(u),v?a.push(`Using project default posture: ${i.defaultReviewPosture} (from manifest.yml). To override, answer with a/b/c/d. Answer 'clear-posture' to remove this default.`):a.push("After presenting the completeness assessment, present the 4 review posture options: (a) Selective expansion \u2014 fill gaps only, no scope drift; (b) Hold scope \u2014 surface risks but no additions; (c) Scope expansion \u2014 actively explore adjacent features; (d) Scope reduction \u2014 cut to essentials. Ask user to choose."),a.push(o.hasAskUserTool?"Use AskUserQuestion to present the completeness table and posture options together in one question.":"Present completeness table and posture options in one message. User replies with 'a', 'b', 'c', or 'd'.")}else if(g==="stage-b"){let u=e.discovery.refinement?.reviewPosture;a=[u==="selective-expansion"?"REVIEW POSTURE: Selective expansion. Hold core scope rigid. Only suggest additions that address gaps from the completeness assessment. Each suggestion must explain: what gap it fills, what goes wrong if skipped. Target: raise completeness to 9+/10 with minimal additions.":u==="hold-scope"?"REVIEW POSTURE: Hold scope. Do NOT propose any additions or changes. Surface risks as observations, not change requests. Your job is to confirm the spec is ready, not to improve it.":u==="scope-expansion"?"REVIEW POSTURE: Scope expansion. Actively look for adjacent concerns and missing features. Each expansion must ride on infrastructure already being built. Present ALL suggestions as a multi-select table with columns: Addition | Why it rides cheap | LOC estimate.":"REVIEW POSTURE: Scope reduction. Identify everything that can be deferred. For each item: what's deferred, risk of deferring, minimal viable version. Present cut list for user approval."],e.discovery.refinement?.completenessScore&&a.push("RE-ASSESSMENT: After posture-guided review is complete, re-score the 6 completeness dimensions. Show delta: what was addressed (\u2713), what remains (\u25B3). Submit updated score as JSON {completeness: {...}} before CEO review."),a.push("When posture-guided review is complete, produce the CEO REVIEW ANALYSIS (see CEO review protocol rules below). Submit it as JSON {ceoReview: {...}, reflection?: '...'} to record it."),a.push(...Be(u??"selective-expansion"))}else a=["CEO review is complete. Present the updated completeness score delta, the readiness dashboard verdict, and ask the user to advance (approve), revise, or park the spec.",o.hasAskUserTool?"Use AskUserQuestion to present: updated completeness (delta table), readiness verdict, and options: advance / revise / park.":"Present delta and verdict. User answers: approve (advance), revise (return to stage-a), or park (cancel)."];return{modeOverride:"You are in plan mode. Do not create, edit, or write any files.",rules:[...m,"DO NOT create, edit, or write any files.",...a,...he,...h],tone:g==="stage-a"?"Structured evaluator. Score honestly \u2014 do not inflate.":g==="stage-b"?"Posture-guided reviewer. Follow the posture rules exactly.":"Decisive closer. Present delta and get a final decision."}}case"SPEC_PROPOSAL":{let h=e.discovery.delegations??[],g=[];if(h.length>0){let a=h.filter(y=>y.status==="pending"),u=h.filter(y=>y.status==="answered"),v=h.map(y=>`- ${y.questionId}: delegated to ${y.delegatedTo} \u2014 ${y.status==="answered"?"ANSWERED \u2713":"PENDING"}`);g.push(`DELEGATION STATUS:
3
3
  ${v.join(`
4
4
  `)}${a.length>0?`
@@ -1,3 +1,3 @@
1
- import{f as o}from"./chunk-KRKOWSYW.js";import{i as e}from"./chunk-Y5E7ZCCX.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
1
+ import{f as o}from"./chunk-WDKWHGJU.js";import{i as e}from"./chunk-Y5E7ZCCX.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
2
2
  `)}catch{}},f=async(r,i,n)=>{let s=`${r}/${o.specDir(i)}/progress.json`;try{let t=await e.fs.readTextFile(s),a=JSON.parse(t);a.status=n,a.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(s,JSON.stringify(a,null,2)+`
3
3
  `)}catch{}};export{d as a,u as b,w as c,f as d};