eser 4.1.49 → 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.
- package/chunks/{anthropic-QBGNUIP3.js → anthropic-YMZNUQKZ.js} +1 -1
- package/chunks/{approve-HF44PKLL.js → approve-PXC7FMDI.js} +1 -1
- package/chunks/{ask-M3VS3GIJ.js → ask-6DWHUCLO.js} +1 -1
- package/chunks/{block-F7S7PYMQ.js → block-CSVO3R47.js} +1 -1
- package/chunks/{build-Y4OQZN3X.js → build-S4DSRSSR.js} +1 -1
- package/chunks/cancel-AJOYWYV5.js +2 -0
- package/chunks/{changelog-gen-LMXK5T7J.js → changelog-gen-TE6FXELA.js} +1 -1
- package/chunks/{chunk-43E7ZXUB.js → chunk-2PWSTO7A.js} +1 -1
- package/chunks/{chunk-D43XK3L2.js → chunk-3CE7GA2P.js} +1 -1
- package/chunks/{chunk-FNPBHLLZ.js → chunk-3KGG2I2A.js} +1 -1
- package/chunks/{chunk-3MMV2UHT.js → chunk-4QMRLILJ.js} +1 -1
- package/chunks/{chunk-3VZXRI4F.js → chunk-4XXI5LYN.js} +1 -1
- package/chunks/{chunk-YVKPHSJX.js → chunk-66VSO643.js} +1 -1
- package/chunks/chunk-67AFLWXV.js +4 -0
- package/chunks/{chunk-U25GY4AZ.js → chunk-72R6CKNY.js} +1 -1
- package/chunks/{chunk-RSYERFWM.js → chunk-AUDMKDAA.js} +1 -1
- package/chunks/{chunk-K7TY7247.js → chunk-BESTYZQY.js} +1 -1
- package/chunks/{chunk-LYM57LLM.js → chunk-BJ45FF6F.js} +1 -1
- package/chunks/{chunk-XFCBVUI7.js → chunk-BNZPRQUS.js} +1 -1
- package/chunks/{chunk-KHBIOZJE.js → chunk-BVIGTD2Z.js} +1 -1
- package/chunks/{chunk-SNWQNMGD.js → chunk-CE6UVD6F.js} +1 -1
- package/chunks/{chunk-PHOYLFXC.js → chunk-DHNS2KLJ.js} +1 -1
- package/chunks/{chunk-WTMV5GTZ.js → chunk-DTDUHDLM.js} +1 -1
- package/chunks/{chunk-MTCPFQ5I.js → chunk-FVXGVHUR.js} +1 -1
- package/chunks/{chunk-3D5TBTM3.js → chunk-HTC2FO4I.js} +2 -2
- package/chunks/{chunk-Q66KA572.js → chunk-HV3EYAGF.js} +1 -1
- package/chunks/{chunk-XVH5L5HY.js → chunk-IY3YRKJJ.js} +1 -1
- package/chunks/{chunk-XBCL25QR.js → chunk-KFSZ6MDH.js} +1 -1
- package/chunks/{chunk-RBU3HF66.js → chunk-KNIM3QST.js} +1 -1
- package/chunks/chunk-LS5MCZUM.js +2 -0
- package/chunks/{chunk-HVQK35SO.js → chunk-MGNBNMJZ.js} +1 -1
- package/chunks/chunk-MX5DKVDI.js +2 -0
- package/chunks/{chunk-TDIR6AUJ.js → chunk-N6PXARPJ.js} +1 -1
- package/chunks/{chunk-L7ROACZC.js → chunk-NWWXAZFA.js} +1 -1
- package/chunks/{chunk-Q56M5KDF.js → chunk-OSNPAAYT.js} +1 -1
- package/chunks/{chunk-6BILFSH2.js → chunk-PBZV2KA3.js} +1 -1
- package/chunks/{chunk-FQY3JLY2.js → chunk-PG7KG7NX.js} +1 -1
- package/chunks/{chunk-FFEFO7MA.js → chunk-PY6ZNQ4B.js} +1 -1
- package/chunks/{chunk-PPSDIDOI.js → chunk-QHVTWYZJ.js} +1 -1
- package/chunks/chunk-QL5FA3P3.js +2 -0
- package/chunks/{chunk-3TS5IRPD.js → chunk-QRNSYEPI.js} +1 -1
- package/chunks/{chunk-N4NDBIQS.js → chunk-QXSFQQGJ.js} +1 -1
- package/chunks/{chunk-DYMKE4R3.js → chunk-TBRDRQQK.js} +1 -1
- package/chunks/{chunk-JMGANJGV.js → chunk-TTLUVJIR.js} +1 -1
- package/chunks/chunk-UTWYRNI6.js +17 -0
- package/chunks/{chunk-3PZVRB75.js → chunk-UYGKTA3C.js} +1 -1
- package/chunks/chunk-VKB3B2FE.js +4 -0
- package/chunks/{chunk-IIFFSCDJ.js → chunk-VXVW4UNH.js} +1 -1
- package/chunks/{chunk-2DAFGT4S.js → chunk-WJI2X6IA.js} +1 -1
- package/chunks/{chunk-C6URCXQM.js → chunk-YCI2VITZ.js} +1 -1
- package/chunks/chunk-YXETE4S3.js +4 -0
- package/chunks/{chunk-U34MRDPH.js → chunk-Z2RL2SFY.js} +1 -1
- package/chunks/{chunk-AWMLF355.js → chunk-ZQ7KN4HT.js} +1 -1
- package/chunks/{claude-code-UJYCO6CN.js → claude-code-RN3Q2VCK.js} +1 -1
- package/chunks/commitmsg-BRWGZ26L.js +15 -0
- package/chunks/{concern-7ZK3KY54.js → concern-DXCLVP5Y.js} +1 -1
- package/chunks/{dev-XHMBUBQE.js → dev-NJVFMPTE.js} +1 -1
- package/chunks/done-HGZT3ZOT.js +2 -0
- package/chunks/{file-tools-shared-YKDNDDHR.js → file-tools-shared-IIW7WSUM.js} +1 -1
- package/chunks/free-IPJPYOJS.js +2 -0
- package/chunks/{gh-AWX6I7FO.js → gh-YLYXDL2X.js} +1 -1
- package/chunks/{gh-contributors-EDZTKR5E.js → gh-contributors-YFATSPSW.js} +1 -1
- package/chunks/{init-GBMYF3YG.js → init-BZ6B74SY.js} +1 -1
- package/chunks/{init-3HE3P3N3.js → init-X6KNS3NC.js} +1 -1
- package/chunks/{invoke-hook-EIOZ5WSA.js → invoke-hook-KLJOYZF5.js} +2 -2
- package/chunks/{kiro-V6SMU4OL.js → kiro-JS5UVLRL.js} +1 -1
- package/chunks/{list-NX7RRO6R.js → list-COFD6OUQ.js} +1 -1
- package/chunks/{list-ZVCGDRUH.js → list-RI4IF5TD.js} +1 -1
- package/chunks/{main-NCAKIBQC.js → main-JZTE4B4L.js} +1 -1
- package/chunks/{manager-GC34GK44.js → manager-FMP6PKIR.js} +5 -5
- package/chunks/{mod-VZT7JWPZ.js → mod-64M47KGW.js} +1 -1
- package/chunks/{mod-NSL6IJRQ.js → mod-CTW3YE4Q.js} +1 -1
- package/chunks/{mod-7ICCX4OY.js → mod-D5IDWU35.js} +1 -1
- package/chunks/{mod-5NDTGNVM.js → mod-DESWHMN6.js} +1 -1
- package/chunks/{mod-52TIS344.js → mod-MC2WNSB2.js} +1 -1
- package/chunks/{mod-DFDEWFDA.js → mod-TUZZQKGZ.js} +1 -1
- package/chunks/{mod-KPIOBBDD.js → mod-YNYASB66.js} +1 -1
- package/chunks/next-6K3PS64Z.js +9 -0
- package/chunks/{ollama-DFG5G467.js → ollama-PL4UHEF2.js} +1 -1
- package/chunks/{opencode-UA45VV3W.js → opencode-K4G7UMAE.js} +1 -1
- package/chunks/{pack-B5VXZEW7.js → pack-YQVWUWCL.js} +1 -1
- package/chunks/{purge-Q3FI3S5M.js → purge-ZQ23VDGR.js} +1 -1
- package/chunks/{release-4VI2Y2ZT.js → release-XACZAR6J.js} +2 -2
- package/chunks/{release-notes-2ZYPZ6TK.js → release-notes-W6MNV6OT.js} +1 -1
- package/chunks/{release-tag-SG4WPYDZ.js → release-tag-HSZX6WYU.js} +1 -1
- package/chunks/{reopen-6FB7DVV2.js → reopen-Z3MPVAGR.js} +1 -1
- package/chunks/reset-NWO3MNAG.js +2 -0
- package/chunks/{rule-EJKPIOLE.js → rule-CH5GMFKE.js} +1 -1
- package/chunks/{run-BV6BHCCQ.js → run-5YOXFMP2.js} +1 -1
- package/chunks/{run-DAKF5SJN.js → run-IMXYUDHS.js} +1 -1
- package/chunks/{scripts-VRQQ24O3.js → scripts-XTXYY5MJ.js} +1 -1
- package/chunks/{sdk-L2SQCWYV.js → sdk-EJKXYVDC.js} +8 -8
- package/chunks/{serve-5MTJLRIN.js → serve-3PZ7RBQY.js} +1 -1
- package/chunks/session-22XFZLH2.js +2 -0
- package/chunks/spec-PWS2UYVL.js +2 -0
- package/chunks/{status-6XVLXNA5.js → status-G5D6BYFF.js} +1 -1
- package/chunks/{sync-EEH6563X.js → sync-URY32B7Y.js} +1 -1
- package/chunks/{system-JBGO2IFD.js → system-CP5L6XUP.js} +1 -1
- package/chunks/{system-QDBQLRO6.js → system-N5A3SM5G.js} +1 -1
- package/chunks/{validate-bom-XTZYCKGP.js → validate-bom-EH5Z5TVU.js} +1 -1
- package/chunks/{validate-case-conflict-CQIPKKHY.js → validate-case-conflict-XN4KQDSK.js} +1 -1
- package/chunks/{validate-circular-deps-Y6X6GZCG.js → validate-circular-deps-YZ4DIXIM.js} +1 -1
- package/chunks/{validate-docs-ZOHUOW3I.js → validate-docs-BE32R2UM.js} +1 -1
- package/chunks/{validate-filenames-6E634ZHO.js → validate-eof-JPKT2D3D.js} +1 -1
- package/chunks/{validate-export-names-7V3647EU.js → validate-export-names-D3QNF6VB.js} +1 -1
- package/chunks/{validate-eof-4I2QAFTC.js → validate-filenames-DMZ46CRH.js} +1 -1
- package/chunks/{validate-json-LRWPQ4JX.js → validate-json-KG3U4NLK.js} +1 -1
- package/chunks/validate-large-files-C2ILVCDB.js +2 -0
- package/chunks/validate-licenses-P24RTTYG.js +2 -0
- package/chunks/validate-line-endings-F65GG2PC.js +2 -0
- package/chunks/validate-merge-conflict-PVT6WR2W.js +2 -0
- package/chunks/{validate-mod-exports-Y6W74PAB.js → validate-mod-exports-J6KLADGR.js} +1 -1
- package/chunks/{validate-package-configs-VVCKJELU.js → validate-package-configs-BFCQMBEI.js} +1 -1
- package/chunks/validate-secrets-RBD2KJ3R.js +2 -0
- package/chunks/validate-shebangs-L5YR7AGC.js +2 -0
- package/chunks/validate-submodules-HD7CSBOG.js +2 -0
- package/chunks/validate-symlinks-RPSZMV5Y.js +2 -0
- package/chunks/{validate-toml-FNXGITZJ.js → validate-toml-OMUYIHX2.js} +1 -1
- package/chunks/validate-trailing-whitespace-BIG3YYFY.js +2 -0
- package/chunks/{validate-yaml-YRAD4HU3.js → validate-yaml-VTE42YLF.js} +1 -1
- package/chunks/{versions-LJSQVW77.js → versions-GXSXTSSG.js} +1 -1
- package/chunks/{watch-N3KV2ONB.js → watch-EVUCQISN.js} +6 -6
- package/chunks/wontfix-4R2ESAR5.js +2 -0
- package/eser.js +1 -1
- package/package.json +1 -1
- package/chunks/cancel-Q6LMMZBV.js +0 -2
- package/chunks/chunk-2TANTKYS.js +0 -4
- package/chunks/chunk-C2IORZTF.js +0 -4
- package/chunks/chunk-EQUPVWVY.js +0 -2
- package/chunks/chunk-FXDWRGGR.js +0 -2
- package/chunks/chunk-GVTM4EOU.js +0 -4
- package/chunks/chunk-LJ7A5HYR.js +0 -2
- package/chunks/chunk-RBQ2FOSL.js +0 -17
- package/chunks/commitmsg-57EMHAFY.js +0 -11
- package/chunks/done-FQQYM27R.js +0 -2
- package/chunks/free-XOGOSVEQ.js +0 -2
- package/chunks/next-2LOPGEJO.js +0 -9
- package/chunks/reset-T4YMGQPV.js +0 -2
- package/chunks/session-3HOLYHOY.js +0 -2
- package/chunks/spec-3P3HJT27.js +0 -2
- package/chunks/validate-large-files-RV7O7ZUR.js +0 -2
- package/chunks/validate-licenses-KHDUSBXM.js +0 -2
- package/chunks/validate-line-endings-XOCAE22U.js +0 -2
- package/chunks/validate-merge-conflict-PDJRAIKU.js +0 -2
- package/chunks/validate-secrets-UI5XKJ6B.js +0 -2
- package/chunks/validate-shebangs-GE23Z6NU.js +0 -2
- package/chunks/validate-submodules-R5JKX3Z6.js +0 -2
- package/chunks/validate-symlinks-WBF6VHHT.js +0 -2
- package/chunks/validate-trailing-whitespace-UCMQTQ3B.js +0 -2
- package/chunks/wontfix-MJJ2LK6J.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as o}from"./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as y}from"./chunk-IZUADMIU.js";import{c as d}from"./chunk-
|
|
2
|
+
import{b as y}from"./chunk-IZUADMIU.js";import{c as d}from"./chunk-KNIM3QST.js";import{i as h}from"./chunk-6DBKPC2O.js";var S=p=>{let n=p.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return n.length>1?n:p.split(/\.(?=\s+[A-Z])|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},A=(p,n=[])=>{let t=[],c=p.find(r=>r.questionId==="ambition");if(c!==void 0){let r=c.answer,a=r.match(/10[- ]?star[:\s]+(.+?)(?:\n|$)/is),l=r.match(/5[- ]?star[:\s]+(.+?)(?:\n|$)/is),o=(a!==null?a[1].trim():l!==null?l[1].trim():r.replace(/1[- ]?star[:\s]+[^.]*\.\s*/i,"").trim()).replace(/^(the|a|an|with|plus|also)\s+/i,"").replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim();o.length>0&&(o=o.charAt(0).toUpperCase()+o.slice(1)),o=o.replace(/[.\u2026]+$/,"").trim(),o.length>140&&(o=o.slice(0,137)+"..."),o.length>3&&t.push(o)}let i=p.find(r=>r.questionId==="verification");if(i!==void 0){let r=i.answer.split(/\n/).map(a=>a.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(a=>a.length>0);for(let a of r)t.push(a)}for(let r of n){let a=r.choice.toLowerCase();if(a.includes("accepted")||a.includes("add to scope")){let l=r.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),e=l.charAt(0).toUpperCase()+l.slice(1);t.push(e)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t.push("Write or update tests for all new and changed behavior"),t.push("Update documentation for all public-facing changes (README, API docs, CHANGELOG)"),t},C=(p,n)=>{let t={};if(n===null){for(let c of p.specSections)t[c]=!1;return t}for(let c of p.specSections){let i=c.toLowerCase();i.includes("design")||i.includes("mobile")||i.includes("layout")||i.includes("interaction")?t[c]=n.involvesWebUI:i.includes("contributor")||i.includes("public api")||i.includes("api surface")?t[c]=n.involvesPublicAPI:i.includes("migration")||i.includes("deprecation")||i.includes("backward")||i.includes("compatibility")?t[c]=n.involvesMigration:i.includes("audit")||i.includes("access control")||i.includes("data handling")?t[c]=n.involvesDataHandling:t[c]=!0}return t},b=(p,n,t,c,i,r,a,l)=>{let e=[];e.push(`# Spec: ${p}`),e.push(""),e.push("## Status: draft"),e.push(""),t.length>0&&(e.push(`## Concerns: ${t.map(s=>s.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let s of n){if(e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),"user"in s&&s.user!=="Unknown User"){let u=s;e.push(""),e.push(`_-- ${u.user}_`)}e.push("")}for(let s of t)if(s.specSections.length>0){let u=C(s,i??null);for(let w of s.specSections)u[w]!==!1&&(e.push(`## ${w} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(c.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<c.length;s++){let u=c[s];e.push(`| ${s+1} | ${u.question} | ${u.choice} | ${u.promoted?"yes":"no"} |`)}e.push("")}let o=n.find(s=>s.questionId==="scope_boundary");if(o!==void 0){e.push("## Out of Scope"),e.push("");let s=S(o.answer);for(let u of s)e.push(`- ${u}`);e.push("")}let f=A(n,c);e.push("## Tasks"),e.push("");for(let s=0;s<f.length;s++)e.push(`- [ ] task-${s+1}: ${f[s]}`);e.push("");let m=n.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),m!==void 0){let s=S(m.answer);for(let u of s)e.push(`- ${u}`)}else e.push("_To be defined._");e.push("");let g=r??[];if(g.length>0){e.push("## Custom Acceptance Criteria"),e.push("");for(let s of g)e.push(`- ${s.text} _-- ${s.user}, ${s.addedInPhase}_`);e.push("")}let $=(a??[]).filter(s=>!s.text.startsWith("[TASK] "));if($.length>0){e.push("## Notes"),e.push("");for(let s of $)e.push(`- ${s.text} _-- ${s.user}, ${s.phase}_`);e.push("")}let v=l??[];if(v.length>0){e.push("## Transition History"),e.push(""),e.push("| From | To | User | Timestamp | Reason |"),e.push("|------|----|------|-----------|--------|");for(let s of v)e.push(`| ${s.from} | ${s.to} | ${s.user} | ${s.timestamp} | ${s.reason??"-"} |`);e.push("")}return e.join(`
|
|
3
3
|
`)};var _=async(p,n,t)=>{if(n.spec===null)throw new Error("No active spec");let c=`${p}/${d.specDir(n.spec)}`,i=`${p}/${d.specFile(n.spec)}`;await h.fs.mkdir(c,{recursive:!0});let r=b(n.spec,n.discovery.answers,t,n.decisions,n.classification,n.customACs,n.specNotes,n.transitionHistory);await h.fs.writeTextFile(i,r);let a=y(n.spec,r),l=`${c}/progress.json`,e={spec:n.spec,status:"draft",tasks:a.tasks.map(o=>({id:o.id,title:o.title,status:"pending"})),decisions:n.decisions.map(o=>({question:o.question,choice:o.choice,promoted:o.promoted})),debt:[],updatedAt:new Date().toISOString()};return await h.fs.writeTextFile(l,JSON.stringify(e,null,2)+`
|
|
4
4
|
`),i};export{_ as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as o}from"./chunk-
|
|
2
|
+
import{a as o}from"./chunk-MGNBNMJZ.js";import{a as l}from"./chunk-2XNFZXHY.js";import{e as n}from"./chunk-5WJ6AUNY.js";var i=n(l(),1);var a=o({name:"validate-yaml",description:"Validate YAML syntax",canFix:!1,stacks:[],defaults:{},extensions:["yml","yaml"],checkFile(e,r){if(r===void 0)return[];try{return i.parse(r),[]}catch(t){let s=t instanceof Error?t.message:"invalid YAML";return[{path:e.path,message:s}]}}}),d=a.run,u=a.validator,f=a.main;export{a,d as b,u as c,f as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-MX5DKVDI.js";import"./chunk-YXETE4S3.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as ClaudeCodeModel,b as claudeCodeFactory};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import"./chunk-7ZYDAZBD.js";import{a as w,b as x}from"./chunk-GE3LJ6QM.js";import"./chunk-QXSFQQGJ.js";import{a as h}from"./chunk-BNQAZLIQ.js";import{f as u,h as f,k as p}from"./chunk-SHN5MT56.js";import{c as n,d,f as g}from"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import{d as r}from"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as l,b as m}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var b=`Output ONLY a conventional commit message. Nothing else.
|
|
3
|
+
|
|
4
|
+
STRICT RULES:
|
|
5
|
+
- One line only. Max 72 characters.
|
|
6
|
+
- Format: type(scope): description
|
|
7
|
+
- Types: feat, fix, chore, docs, refactor, test, style, perf, ci, build
|
|
8
|
+
- No body. No explanation. No markdown. No code blocks. No bullet points.
|
|
9
|
+
- No quotes. No backticks. No decorative formatting. No insight blocks.
|
|
10
|
+
- No preamble. No commentary. Just the commit message line.
|
|
11
|
+
|
|
12
|
+
Example of correct output (the ENTIRE response is this one line):
|
|
13
|
+
feat(ai): add streaming support for Claude Code adapter`,v=async i=>{let e=u({renderer:p.ansi(),sink:f.stdout()});try{let t=await r`git diff --cached`.noThrow().text();if(t.length===0&&(t=await r`git diff`.noThrow().text()),t.length===0)return e.writeln(d("No changes detected (nothing staged or modified).")),await e.close(),l(void 0);let s=await y(t),o=s.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/`/g,"\\`").replace(/\$/g,"\\$").replace(/!/g,"\\!");return e.writeln(""),e.writeln(n("Plain Format:")),e.writeln("```"),e.writeln(s),e.writeln("```"),e.writeln(""),e.writeln(n("Shell Command:")),e.writeln("```"),e.writeln(`git commit -m "${o}"`),e.writeln("```"),e.writeln(""),e.writeln(n("Copy to Clipboard:")),e.writeln("```"),e.writeln(`echo "${o}" | pbcopy`),e.writeln("```"),await e.close(),l(void 0)}catch(t){let s=t instanceof Error?t.message:String(t);return e.writeln(g(`Error: ${s}`)),await e.close(),m({message:s,exitCode:1})}},y=async(i,e)=>{let s=await(await import("./mod-YNYASB66.js")).defaultFactories(),o=new w({factories:s}),a=e;if(a===void 0)try{await r`which claude`.noThrow().code()===0&&(a="claude-code")}catch{}a===void 0&&(a="anthropic"),await o.addModel("default",{provider:a,model:"default"});let c=o.getDefault();if(c===null)throw new Error("No AI model available for commit message generation");let k=await c.generateText({system:b,messages:[h("user",`Generate a commit message for this diff:
|
|
14
|
+
|
|
15
|
+
${i}`)],maxTokens:256});return await o.close(),x(k).trim()},$={name:"ai-commitmsg",description:"Generate commit message from git diff using AI",run:async i=>{try{let e=i.provider,t=await r`git diff --cached`.noThrow().text();return t.length===0&&(t=await r`git diff`.noThrow().text()),t.length===0?{name:"ai-commitmsg",passed:!0,issues:[],mutations:[],stats:{skipped:1}}:{name:"ai-commitmsg",passed:!0,issues:[{message:`Suggested: ${await y(t,e)}`}],mutations:[],stats:{generated:1}}}catch(e){return{name:"ai-commitmsg",passed:!1,issues:[{message:e instanceof Error?e.message:String(e)}],mutations:[],stats:{errors:1}}}}};export{y as generateCommitMessage,v as main,$ as workflowTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{b as A}from"./chunk-4NNSMDFH.js";import{k,l as y,m as x,n as P}from"./chunk-
|
|
2
|
+
import{b as A}from"./chunk-4NNSMDFH.js";import{k,l as y,m as x,n as P}from"./chunk-KNIM3QST.js";import{b as $,c as b}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as m,h as w,k as g}from"./chunk-SHN5MT56.js";import{c as d,d as c,f as u,g as C}from"./chunk-YVN2NZL4.js";import{a as l,b as p}from"./chunk-FFWPJP7A.js";import{i as v}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async s=>{let e=s?.[0];if(e==="add")return await I(s?.slice(1));if(e==="remove")return await M(s?.slice(1));if(e==="list")return await R();let r=$(),n=m({renderer:g.ansi(),sink:w.stdout()});return n.writeln(`Usage: ${r} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=(s??[]).filter(i=>!i.startsWith("-")),t=await k(r);if(n.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let a=await A(),o=[];for(let i of n){let f=await x(r,i);if(f===null&&(f=a.find(h=>h.id===i)??null,f!==null&&await P(r,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(c(` Available: ${a.map(h=>h.id).join(", ")}`));continue}if(t.concerns.includes(i)||o.includes(i)){e.writeln(c(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...t,concerns:[...t.concerns,...o]};await y(r,i),e.writeln(C("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async s=>{let e=m({renderer:g.ansi(),sink:w.stdout()}),r=v.process.cwd(),n=s?.[0],t=await k(r);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast"))),await e.close(),p({exitCode:1});if(t===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!t.concerns.includes(n))return e.writeln(c(`Concern "${n}" is not active.`)),await e.close(),l(void 0);let a={...t,concerns:t.concerns.filter(o=>o!==n)};return await y(r,a),e.writeln(C("\u2714")," Deactivated concern: ",d(n)),await e.close(),l(void 0)},R=async()=>{let s=m({renderer:g.ansi(),sink:w.stdout()}),e=v.process.cwd(),r=await k(e),n=await A(),t=r?.concerns??[];if(s.writeln(d("Concerns")),s.writeln(""),n.length===0)s.writeln(c(" No concerns defined."));else for(let a of n){let o=t.includes(a.id);s.writeln(" ",o?C("\u25CF"):c("\u25CB")," ",o?d(a.id):c(a.id),c(` ${a.description.slice(0,60)}...`))}return await s.close(),l(void 0)};export{q as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
2
|
import{f as a,h as l,k as i}from"./chunk-SHN5MT56.js";import{k as n}from"./chunk-YVN2NZL4.js";import"./chunk-PWLF3WXM.js";import{a as t}from"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var h=["trace","debug","info","warn","error","fatal"],k=async m=>{let{flags:e}=t(m??[],[{name:"port",short:"p",type:"number",default:8e3,description:"Server port"},{name:"no-hmr",type:"boolean",description:"Disable HMR"},{name:"log-level",type:"string",default:"info",description:"Log level"},{name:"open",short:"o",type:"boolean",description:"Open browser"}]),r=a({renderer:i.ansi(),sink:l.stdout()});r.writeln(n(`
|
|
3
3
|
\u26A1 Starting development server...
|
|
4
|
-
`));let p=e.port,s=e["log-level"]??"info",c=!e["no-hmr"],g=e.open??!1,d=h.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:u},{reactRenderer:L,reactHtmlShellBuilder:f},{reactPlugin:v},{createTailwindPlugin:b}]=await Promise.all([import("./main-
|
|
4
|
+
`));let p=e.port,s=e["log-level"]??"info",c=!e["no-hmr"],g=e.open??!1,d=h.includes(s.toLowerCase())?s.toLowerCase():"info",[{startServer:u},{reactRenderer:L,reactHtmlShellBuilder:f},{reactPlugin:v},{createTailwindPlugin:b}]=await Promise.all([import("./main-JZTE4B4L.js"),import("./mod-OG7BBJP4.js"),import("./mod-CTW3YE4Q.js"),import("./mod-64M47KGW.js")]);return await r.close(),await u({mode:"dev",port:p,logLevel:d,hmr:c,open:g,renderer:L,htmlShell:f,frameworkPlugin:v,cssPlugin:b({globalCssPath:"src/app/styles/global.css"})}),o(void 0)};export{k as main};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{a as D,d as I}from"./chunk-2PWSTO7A.js";import{h as x}from"./chunk-L32KHQVT.js";import{p as k,s as T,v as U}from"./chunk-QL5FA3P3.js";import{c as S,e as g,g as C,h as E,i as y}from"./chunk-KNIM3QST.js";import{c as $}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import{f as w,h as f,k as h}from"./chunk-SHN5MT56.js";import{c as m,d as o,f as a,g as u}from"./chunk-YVN2NZL4.js";import{a as d,b as n}from"./chunk-FFWPJP7A.js";import{i as l}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var q=async P=>{let e=w({renderer:h.ansi(),sink:f.stdout()}),i=l.process.cwd(),c=C(P);if(!c.ok)return e.writeln(a(c.error)),await e.close(),n({exitCode:1});let t;try{t=await g(i,c.spec)}catch(r){let p=r instanceof Error?r.message:String(r);return e.writeln(a(p)),await e.close(),n({exitCode:1})}if(t.phase!=="EXECUTING")return e.writeln(a(`Cannot complete in phase: ${t.phase}`)),e.writeln(o("Only EXECUTING phase can transition to COMPLETED.")),await e.close(),n({exitCode:1});if(t.spec!==null){let r=`${i}/${S.specDir(t.spec)}`;try{await l.fs.stat(r)}catch{return e.writeln(a(`Active spec '${t.spec}' directory not found.`)),e.writeln(o("Run `noskills reset` to return to idle.")),await e.close(),n({exitCode:1})}}let v=await x(i),s=k(t,"done");s=T(s,"EXECUTING","COMPLETED",v),s.spec!==null&&await y(i,s.spec,s);let A=U(s);if(await E(i,A),s.spec!==null&&(await D(i,s.spec,"completed"),await I(i,s.spec,"completed")),e.writeln(u("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",m(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let r=t.decisions.filter(p=>p.promoted);r.length>0&&e.writeln(o(` Promoted to rules: ${r.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",m(`${$('spec new "..."')}`)),await e.close(),d(void 0)};export{q as main};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a,b,c,d,e,f,g,h}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f,g,h}from"./chunk-BVIGTD2Z.js";import"./chunk-NBA6EFWU.js";import"./chunk-VKB3B2FE.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";export{a as DEFAULT_EXCLUDES,g as applyMutations,e as isBinaryBytes,d as loadBytes,c as loadContent,f as matchesAnyPattern,b as walkSourceFiles,h as writeMutations};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
+
import{c as a}from"./chunk-UEMWZOIU.js";import{f as o,h as n,k as i}from"./chunk-SHN5MT56.js";import{c as e,d as t}from"./chunk-YVN2NZL4.js";import{a as r}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var c=async m=>{let s=o({renderer:i.ansi(),sink:n.stdout()});return s.writeln(t("noskills starts in idle mode with no enforcement. To work on a spec, run:")),s.writeln(e(` ${a('spec new "description"')}`)),await s.close(),r(void 0)};export{c as main};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
2
|
import{a}from"./chunk-JTSRGXS4.js";import{o as t}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as o}from"./chunk-FFWPJP7A.js";import"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:l,output:h}=a(),n=()=>{t.info(l,`eser codebase gh \u2014 GitHub operations
|
|
3
3
|
`),console.log("Subcommands:"),console.log(" contributors Update contributor list in README.md"),console.log(" release-notes Sync CHANGELOG to GitHub Releases"),console.log(" release-tag Create and push release git tags"),console.log(`
|
|
4
|
-
Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-
|
|
4
|
+
Run 'eser codebase gh <subcommand> --help' for details.`)},b=async m=>{let r=m??[],e=r[0],s=r.slice(1);if(e===void 0||e==="--help"||e==="-h")return n(),o.ok(void 0);switch(e){case"contributors":return await(await import("./gh-contributors-YFATSPSW.js")).main(s);case"release-notes":return await(await import("./release-notes-W6MNV6OT.js")).main(s);case"release-tag":return await(await import("./release-tag-HSZX6WYU.js")).main(s);default:return t.error(l,`Unknown gh subcommand: ${e}`),n(),o.fail({exitCode:1})}};export{b as main};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import"./chunk-SOSF762G.js";import{a as R}from"./chunk-LFNUSULJ.js";import{a as w,c as x}from"./chunk-JTSRGXS4.js";import{o as c}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as l}from"./chunk-
|
|
2
|
+
import"./chunk-SOSF762G.js";import{a as R}from"./chunk-LFNUSULJ.js";import{a as w,c as x}from"./chunk-JTSRGXS4.js";import{o as c}from"./chunk-4TTJVJEI.js";import"./chunk-VV47GXU5.js";import"./chunk-J2Z7NG2X.js";import"./chunk-YTF3BAQS.js";import"./chunk-S7S2I2K5.js";import"./chunk-NBA6EFWU.js";import{f as C}from"./chunk-P2MUEKFT.js";import"./chunk-SHN5MT56.js";import"./chunk-7DPLGQHN.js";import"./chunk-YVN2NZL4.js";import{g as l}from"./chunk-VKB3B2FE.js";import"./chunk-PWLF3WXM.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import{a as b}from"./chunk-MG65QJY6.js";import{g as a}from"./chunk-FFWPJP7A.js";import"./chunk-2BOCLC67.js";import"./chunk-N7DXBY3O.js";import{n as f}from"./chunk-7ATUODBM.js";import"./chunk-AP72BKVG.js";import{j as p}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var{ctx:d,output:K}=w(),m="<!-- CONTRIBUTORS:START -->",u="<!-- CONTRIBUTORS:END -->",E=async()=>{let t=await l.exec`gh repo view --json owner,name`.text(),e=JSON.parse(t);return{owner:e.owner.login,name:e.name}},P=async(t,e)=>{let o=await l.exec`gh api repos/${t}/${e}/contributors --paginate`.text();return JSON.parse(o).filter(n=>!n.login.includes("[bot]"))},v=(t,e=8)=>{if(t.length===0)return`${m}
|
|
3
3
|
${u}`;let o=[];for(let r=0;r<t.length;r+=e){let i=t.slice(r,r+e).map(s=>` <td align="center"><a href="${s.html_url}"><img src="${s.avatar_url}?s=80" width="80" /><br /><sub>${s.login}</sub></a></td>`);o.push(` <tr>
|
|
4
4
|
${i.join(`
|
|
5
5
|
`)}
|
|
@@ -6,7 +6,7 @@ Available templates: ${S.join(", ")}`,exitCode:1});e.writeln(v(`
|
|
|
6
6
|
`)),e.writeln(s(` Template: ${l}`));let c="eser",p=`laroux-template-${l}`,k="main",d=`${b.process.cwd()}/${r}`;try{await b.fs.mkdir(d,{recursive:!0})}catch{return await e.close(),i({message:n.render([o(`
|
|
7
7
|
Could not create directory: ${d}`)]),exitCode:1})}e.writeln(s(` Fetching from gh:${c}/${p}...
|
|
8
8
|
`));try{let a=await import("./registry-fetcher-TGWYJ5GN.js"),u=await import("./recipe-applier-I2VBGHZU.js"),f=await $(()=>a.fetchRecipeFromRepo(c,p,k,"recipe.json"),()=>{});if(f._tag==="Ok"&&f.value!==void 0){let g=`https://raw.githubusercontent.com/${c}/${p}/${k}`,w=await u.applyRecipe(f.value,{cwd:d,registryUrl:g,force:j,variables:{project_name:r}});e.writeln(x(`
|
|
9
|
-
\u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-
|
|
9
|
+
\u{1F389} Project created successfully!`)),e.writeln(s(` ${w.written.length} files written`))}else{let g=await import("./mod-DESWHMN6.js"),w=`gh:${c}/${p}`,y=await $(()=>g.scaffold({specifier:w,targetDir:r,force:j,skipPostInstall:L,interactive:!0}),h=>({message:h.message}));if(y._tag==="Fail")return await e.close(),i({message:n.render([o(`
|
|
10
10
|
Scaffolding failed: ${y.error.message}`)]),exitCode:1});let C=y.value;if(e.writeln(x(`
|
|
11
11
|
\u{1F389} Project created successfully!`)),Object.keys(C.variables).length>0){e.writeln(t(`
|
|
12
12
|
Variables applied:`));for(let[h,_]of Object.entries(C.variables))e.writeln(t(" "),s(h),t(`: ${_}`))}}}catch(a){let u=a instanceof Error?a.message:String(a);return await e.close(),i({message:n.render([o(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
import{a as oe,b as ie}from"./chunk-NTY267SI.js";import{d as ne}from"./chunk-L5OC7F24.js";import{d as Y}from"./chunk-
|
|
2
|
+
import{a as oe,b as ie}from"./chunk-NTY267SI.js";import{d as ne}from"./chunk-L5OC7F24.js";import{d as Y}from"./chunk-UTWYRNI6.js";import"./chunk-NY4W44PI.js";import{b as P}from"./chunk-4NNSMDFH.js";import{d as se}from"./chunk-2ZYCRMUT.js";import{c as Z,d as ee,e as te}from"./chunk-NWWXAZFA.js";import{a as H,b as _,h as q,l as B,n as K,p as U,z as V}from"./chunk-KNIM3QST.js";import{a as Q,c as S,d as X}from"./chunk-UEMWZOIU.js";import"./chunk-2XNFZXHY.js";import"./chunk-7ZYDAZBD.js";import{a as k,b as M,i as I,j as W,k as z,l as J,m as G,n as h,o as r,p as w}from"./chunk-4TTJVJEI.js";import"./chunk-GE3LJ6QM.js";import{a as F}from"./chunk-QXSFQQGJ.js";import"./chunk-BNQAZLIQ.js";import"./chunk-SHN5MT56.js";import"./chunk-YVN2NZL4.js";import"./chunk-J7YTWK67.js";import"./chunk-VKB3B2FE.js";import"./chunk-PBZV2KA3.js";import"./chunk-NMEPQK3T.js";import"./chunk-RNFCAHVL.js";import"./chunk-MG65QJY6.js";import{a as b}from"./chunk-FFWPJP7A.js";import{i as f}from"./chunk-6DBKPC2O.js";import"./chunk-ALFFE37K.js";import"./chunk-6G6UVWJN.js";import"./chunk-5WJ6AUNY.js";var re=F;var me=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},he=[{id:"claude-code",paths:["CLAUDE.md",".claude"]},{id:"cursor",paths:[".cursorrules",".cursor"]},{id:"kiro",paths:[".kiro"]},{id:"copilot",paths:[".github/copilot-instructions.md"]},{id:"windsurf",paths:[".windsurfrules"]},{id:"codex",paths:[".codex",".codex/config.toml"]},{id:"copilot-cli",paths:[".copilot",".github/hooks"]}],ae=async t=>{let e=[];for(let o of he)for(let s of o.paths)if(await me(`${t}/${s}`)){e.push(o.id);break}return e};var a=async t=>{try{return await f.fs.stat(t),!0}catch{return!1}},ce=async(t,e)=>{try{let o=await f.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},ye=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},Ce=async t=>{let e=[],o=await ce(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},ve=async t=>{let e=[];return await a(`${t}/.github/workflows`)&&e.push("github-actions"),await a(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await a(`${t}/Jenkinsfile`)&&e.push("jenkins"),await a(`${t}/.circleci`)&&e.push("circleci"),e},$e=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ce(`${t}/package.json`,"devDependencies");if(e!==null){if("vitest"in e)return"vitest";if("jest"in e)return"jest";if("playwright"in e)return"playwright"}return null},le=async t=>{let[e,o,s,d]=await Promise.all([ye(t),Ce(t),ve(t),$e(t)]);return{languages:e,frameworks:o,ci:s,testRunner:d}};var Ge=async t=>{let e=f.process.cwd(),o=oe(t),s=M({target:o==="agent"?"non-interactive":"interactive"}),d=ie(t),y=de(d,"--concerns"),g=de(d,"--tools"),u=d.includes("--non-interactive")||o==="agent";if(await V(e))return r.warn(s,"noskills is already initialized in this project."),r.info(s,`Run \`${S("sync")}\` to regenerate tool files.`),b(void 0);W(s,"noskills init");let D=w(s,"Scanning project...");D.start();let m=await le(e);D.succeed("Project scanned");for(let n of m.languages)r.step(s,` ${n}`);for(let n of m.frameworks)r.step(s,` ${n}`);for(let n of m.ci)r.step(s,` ${n}`);m.testRunner!==null&&r.step(s,` test runner: ${m.testRunner}`),h(s);let j=w(s,"Detecting coding tools...");j.start();let A=await ae(e),C=ne(),L=C!==null&&!A.includes(C)?[C]:[],v=[...new Set([...L,...A])];j.succeed(`${v.length} coding tool(s) detected`);for(let n of v){let i=n===C?" (current)":"";r.step(s,` ${n}${i}`)}let p;if(g!==null){let n=["claude-code","cursor","kiro","copilot","windsurf","opencode","codex","copilot-cli"],i=g.filter(l=>n.includes(l));p=[...new Set([...L,...i])]}else u?p=[...v]:(h(s),p=await be(s,v,C));h(s);let O=w(s,"Detecting AI providers...");O.start();let x=(await re()).filter(n=>n.available).map(n=>n.name);O.succeed(`${x.length} provider(s) detected`),h(s);let T=await P(),c;if(y!==null){let n=T.map(i=>i.id);c=y.filter(i=>n.includes(i)).sort((i,l)=>n.indexOf(i)-n.indexOf(l))}else if(u)c=[];else{let n=T.map(l=>({value:l.id,label:l.name,hint:l.description.slice(0,60)})),i=await I(s,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:n});c=k(i)?[]:[...i]}c.length>0?r.success(s,` Concerns: ${c.join(", ")}`):r.info(s,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(s);let E=w(s,"Initializing...");E.start(),await U(e);let ue=T.filter(n=>c.includes(n.id));for(let n of ue)await K(e,n);let N=await X();Q(N);let $={..._(c,p,x,m),command:N};await B(e,$);let R=H();if(await q(e,R),E.succeed("Scaffolded `.eser/`"),p.length>0){let n=w(s,"Syncing tool files...");n.start();let i=await te(e,p,$);n.succeed(`Synced ${i.length} tool(s)`)}else r.warn(s,"No tools selected. noskills will work in agentless CLI mode only."),r.info(s,"Add tools later with `noskills sync`.");if(z(s,`Done. ${p.length} tool(s), ${x.length} provider(s), ${c.length} concern(s).`),o==="agent"){let i=(await P()).filter(ge=>c.includes(ge.id)),l=await Z(e),pe=ee($?.tools??[]),fe=await Y(R,i,l,$,void 0,void 0,void 0,pe);await se(fe,"json")}else J(s),G(s,`Start a spec with: ${S('spec new "..."')}`);return b(void 0)},Te=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"},{value:"opencode",label:"OpenCode"},{value:"codex",label:"Codex CLI"},{value:"copilot-cli",label:"Copilot CLI"}],be=async(t,e,o)=>{let s=e.length===0?"No coding tools detected. Which tools do you use? (space to toggle)":"Any additional tools? (space to toggle, enter to skip)",d=new Set(e),y=await I(t,{message:s,options:Te.map(u=>({...u,hint:u.value===o?"you're running inside it":d.has(u.value)?"detected":void 0,disabled:u.value===o})),initialValues:[...e],required:!1});if(k(y))return[...e];let g=[...y];return o!==null&&!g.includes(o)&&g.unshift(o),g},de=(t,e)=>{if(t===void 0)return null;for(let o of t)if(o.startsWith(`${e}=`))return o.slice(e.length+1).split(",").map(s=>s.trim()).filter(Boolean);return null};export{Ge as main};
|