noskills 4.1.36 → 4.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +208 -50
  2. package/chunks/{anthropic-GKH6HH6J.js → anthropic-UTLWCK66.js} +1 -1
  3. package/chunks/approve-GSSSUQWC.js +1 -0
  4. package/chunks/ask-F4XM2EEC.js +2 -0
  5. package/chunks/block-LVQNJU4P.js +1 -0
  6. package/chunks/browser-AXSE2CPY.js +1 -0
  7. package/chunks/bun-LARHC47N.js +1 -0
  8. package/chunks/chunk-4BH6CF3J.js +1 -0
  9. package/chunks/chunk-4XOSXARZ.js +9 -0
  10. package/chunks/chunk-73EEM3FY.js +1 -0
  11. package/chunks/{chunk-24SANXOZ.js → chunk-7QFOEK3I.js} +1 -1
  12. package/chunks/chunk-AGWPQX43.js +31 -0
  13. package/chunks/{chunk-GSYCN7EG.js → chunk-ALZM4JXG.js} +1 -1
  14. package/chunks/{chunk-3AZBET4N.js → chunk-BBKSV2RO.js} +1 -1
  15. package/chunks/chunk-DHMCIRLT.js +1 -0
  16. package/chunks/{chunk-WUVVLUU5.js → chunk-EMHZF6ZY.js} +59 -59
  17. package/chunks/{chunk-IR75X4G7.js → chunk-ERX4HONR.js} +1 -1
  18. package/chunks/chunk-G5OCHQQ2.js +1 -0
  19. package/chunks/chunk-IAR3DEWR.js +1 -0
  20. package/chunks/{chunk-XCVAHUBM.js → chunk-KJH7Q57A.js} +1 -1
  21. package/chunks/chunk-MNEZ5QGX.js +1 -0
  22. package/chunks/chunk-OTRBRRIO.js +1 -0
  23. package/chunks/chunk-RYQPPQNO.js +3 -0
  24. package/chunks/{chunk-42EQ3GZJ.js → chunk-TJZAIUKM.js} +1 -1
  25. package/chunks/{chunk-O5KQZHIN.js → chunk-VK7L5SMS.js} +1 -1
  26. package/chunks/{chunk-IVSTITPL.js → chunk-VPXOI7CR.js} +1 -1
  27. package/chunks/chunk-XADY6SXR.js +67 -0
  28. package/chunks/{chunk-EZH232V7.js → chunk-Y6AFIAJP.js} +1 -1
  29. package/chunks/chunk-YK6UG66R.js +1 -0
  30. package/chunks/claude-code-K3SX5D5F.js +1 -0
  31. package/chunks/cmd-RST2ZPA6.js +1 -0
  32. package/chunks/concern-FGNG32KU.js +1 -0
  33. package/chunks/deno-WQJZSBAW.js +1 -0
  34. package/chunks/dist-UI3SRKS3.js +12 -0
  35. package/chunks/done-5IX2F6V7.js +1 -0
  36. package/chunks/{gemini-Z57NY6WY.js → gemini-YR5KT32S.js} +1 -1
  37. package/chunks/init-M7SJOVPZ.js +1 -0
  38. package/chunks/invoke-hook-VXIVDDQG.js +10 -0
  39. package/chunks/{kiro-MHP573OZ.js → kiro-T5X4D4SC.js} +1 -1
  40. package/chunks/list-3RK7TPGG.js +1 -0
  41. package/chunks/mod-KTV64DHD.js +1 -0
  42. package/chunks/multipart-parser-UVM6CEKF.js +2 -0
  43. package/chunks/next-GGVR6JM2.js +8 -0
  44. package/chunks/node-3FTYLC7H.js +67 -0
  45. package/chunks/node-JJN2TSIE.js +1 -0
  46. package/chunks/ollama-CNKKUTPX.js +3 -0
  47. package/chunks/{openai-ZNKOR4CD.js → openai-QGEN33SU.js} +2 -2
  48. package/chunks/openai-Y74OQTVB.js +23 -0
  49. package/chunks/opencode-MJO3K6T4.js +1 -0
  50. package/chunks/purge-6DEK2ZSI.js +4 -0
  51. package/chunks/reset-JEIUVTWV.js +1 -0
  52. package/chunks/rule-OVSBPSYO.js +2 -0
  53. package/chunks/run-7MZATQML.js +3 -0
  54. package/chunks/sdk-LHBUQS75.js +40 -0
  55. package/chunks/spec-J7KC4VFM.js +1 -0
  56. package/chunks/src-GLQPTDNR.js +3 -0
  57. package/chunks/status-BISV6DFB.js +1 -0
  58. package/chunks/sync-MWQWXN2C.js +1 -0
  59. package/chunks/{unstable_chmod-WRDBWEC2.js → unstable_chmod-RZ5DE3XZ.js} +1 -1
  60. package/chunks/{vertexai-WVENJL2F.js → vertexai-RUXZ24C2.js} +1 -1
  61. package/chunks/watch-AP5GGXG6.js +8 -0
  62. package/chunks/workerd-VA2BYLUO.js +1 -0
  63. package/noskills.js +1 -1
  64. package/package.json +1 -1
  65. package/chunks/approve-YXRIBZVV.js +0 -1
  66. package/chunks/ask-4XOYE32R.js +0 -2
  67. package/chunks/block-D67USBJS.js +0 -1
  68. package/chunks/browser-JYFQKVFU.js +0 -1
  69. package/chunks/bun-KVGAHBUF.js +0 -1
  70. package/chunks/chunk-3HRRWTVF.js +0 -3
  71. package/chunks/chunk-4ODVKO5Y.js +0 -1
  72. package/chunks/chunk-ACQUINWH.js +0 -1
  73. package/chunks/chunk-AK3OJD4W.js +0 -1
  74. package/chunks/chunk-DXB73IDG.js +0 -1
  75. package/chunks/chunk-FDZP7B5Y.js +0 -1
  76. package/chunks/chunk-FKF2SWQM.js +0 -18
  77. package/chunks/chunk-GOOD5WBA.js +0 -1
  78. package/chunks/chunk-IA7GIU76.js +0 -14
  79. package/chunks/chunk-LG5R766Y.js +0 -1
  80. package/chunks/chunk-NTKVTLTO.js +0 -1
  81. package/chunks/chunk-T7K64JD5.js +0 -1
  82. package/chunks/chunk-UA3VIHYO.js +0 -1
  83. package/chunks/chunk-UXRWSNVZ.js +0 -1
  84. package/chunks/chunk-WV3HK5WR.js +0 -1
  85. package/chunks/chunk-ZQ77HAFD.js +0 -12
  86. package/chunks/claude-code-6AAAJZKK.js +0 -1
  87. package/chunks/concern-4GBYLKWP.js +0 -1
  88. package/chunks/deno-5VR3ZY4Z.js +0 -1
  89. package/chunks/done-PTJRZ26W.js +0 -1
  90. package/chunks/fileFromPath-4UEDFJ4U.js +0 -6
  91. package/chunks/init-PVRN54IZ.js +0 -1
  92. package/chunks/invoke-hook-5VXI4CPD.js +0 -9
  93. package/chunks/list-GRXQ2DIM.js +0 -1
  94. package/chunks/mod-V2Z6HGL6.js +0 -1
  95. package/chunks/next-BZS3EN33.js +0 -3
  96. package/chunks/node-MZTU6BAB.js +0 -1
  97. package/chunks/node-RWYXITVV.js +0 -59
  98. package/chunks/ollama-24ACY3UB.js +0 -3
  99. package/chunks/openai-EKIA3VP3.js +0 -19
  100. package/chunks/opencode-LFWHRZPL.js +0 -1
  101. package/chunks/purge-JSAHNTXI.js +0 -4
  102. package/chunks/reset-CWI7K6GC.js +0 -1
  103. package/chunks/rule-GP665FCC.js +0 -2
  104. package/chunks/run-WLG5XKTM.js +0 -3
  105. package/chunks/sdk-5JGXLIO5.js +0 -18
  106. package/chunks/spec-JET4WJSV.js +0 -1
  107. package/chunks/status-EOXWE5UM.js +0 -1
  108. package/chunks/sync-RWNLL4VW.js +0 -1
  109. package/chunks/watch-5OC7T473.js +0 -8
  110. package/chunks/workerd-QUMEG65S.js +0 -1
@@ -1 +1 @@
1
- import{d as r}from"./chunk-3AZBET4N.js";import{b as i}from"./chunk-UA3VIHYO.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
+ import{d as r}from"./chunk-BBKSV2RO.js";import{b as i}from"./chunk-MNEZ5QGX.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};
@@ -0,0 +1 @@
1
+ import{b as v}from"./chunk-4BH6CF3J.js";import*as t from"node:fs/promises";import*as w from"node:fs";import*as i from"node:path";import*as F from"node:os";import n from"node:process";import{Readable as b,Writable as g}from"node:stream";var p=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),l=(e,r)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new v(r):e},x=()=>({async readFile(e,r){try{let s=await t.readFile(e,{signal:r?.signal});return new Uint8Array(s)}catch(s){return l(s,e)}},async readTextFile(e,r){try{return await t.readFile(e,{encoding:"utf-8",signal:r?.signal})}catch(s){return l(s,e)}},async writeFile(e,r,s){let a=s?.append?"a":"w";await t.writeFile(e,r,{signal:s?.signal,mode:s?.mode,flag:a})},async writeTextFile(e,r,s){let a=s?.append?"a":"w";await t.writeFile(e,r,{encoding:"utf-8",signal:s?.signal,mode:s?.mode,flag:a})},async exists(e){try{return await t.access(e),!0}catch{return!1}},async stat(e){try{let r=await t.stat(e);return p(r)}catch(r){return l(r,e)}},async lstat(e){try{let r=await t.lstat(e);return p(r)}catch(r){return l(r,e)}},async mkdir(e,r){await t.mkdir(e,{recursive:r?.recursive??!1,mode:r?.mode})},async ensureDir(e){await t.mkdir(e,{recursive:!0})},async remove(e,r){try{await t.rm(e,{recursive:r?.recursive??!1,force:!1})}catch(s){l(s,e)}},async*readDir(e){try{let r=await t.readdir(e,{withFileTypes:!0});for(let s of r)yield{name:s.name,isFile:s.isFile(),isDirectory:s.isDirectory(),isSymlink:s.isSymbolicLink()}}catch(r){l(r,e)}},async copyFile(e,r){await t.copyFile(e,r)},async rename(e,r){await t.rename(e,r)},async makeTempDir(e){let r=e?.dir??F.tmpdir(),s=e?.prefix??"",a=e?.suffix??"",c=await t.mkdtemp(i.join(r,s));if(a){let m=c+a;return await t.rename(c,m),m}return c},async realPath(e){try{return await t.realpath(e)}catch(r){return l(r,e)}},watch(e,r){let s=r?.recursive??!0,a=[],c=[],m=[],u=!1,f=o=>{u||(m.length>0?m.shift()({value:o,done:!1}):c.push(o))};for(let o of e)try{let d=w.watch(o,{recursive:s},(y,P)=>{P!==null&&f({kind:y==="rename"?"create":"modify",paths:[i.join(o,P)]})});a.push(d)}catch{}return{close:()=>{u=!0;for(let o of a)o.close();for(let o of m)o({value:void 0,done:!0});m=[]},[Symbol.asyncIterator]:()=>({next:()=>u?Promise.resolve({value:void 0,done:!0}):c.length>0?Promise.resolve({value:c.shift(),done:!1}):new Promise(o=>{m.push(o)})})}},async chmod(e,r){await t.chmod(e,r)},async*walk(e,r){let s=r?.includeDirs??!0,a=r?.includeFiles??!0,c=r?.exts,m=r?.skip,u=async function*(f){let o=await t.readdir(f,{withFileTypes:!0});for(let d of o){let y=i.join(f,d.name);if(m?.some(h=>h.test(y)))continue;let P=d.isSymbolicLink();if(d.isDirectory())s&&(yield{path:y,name:d.name,isFile:!1,isDirectory:!0,isSymlink:P}),yield*u(y);else if(d.isFile()||P){if(!a||c&&!c.some(h=>d.name.endsWith(h.startsWith(".")?h:`.${h}`)))continue;yield{path:y,name:d.name,isFile:d.isFile(),isDirectory:!1,isSymlink:P}}}};yield*u(e)}}),W=()=>({join:i.join,resolve:i.resolve,dirname:i.dirname,basename:i.basename,extname:i.extname,normalize:i.normalize,isAbsolute:i.isAbsolute,relative:i.relative,parse:i.parse,format:i.format,sep:i.sep,delimiter:i.delimiter}),R=()=>({get(e){return n.env[e]},set(e,r){n.env[e]=r},delete(e){delete n.env[e]},has(e){return e in n.env},toObject(){let e={};for(let[r,s]of Object.entries(n.env))s!==void 0&&(e[r]=s);return e}}),T=()=>({exit(e){n.exit(e)},setExitCode(e){n.exitCode=e},cwd(){return n.cwd()},chdir(e){n.chdir(e)},hostname(){return F.hostname()},execPath(){return n.execPath},argv:n.argv,argv0:n.argv0,args:n.argv.slice(2),pid:n.pid,stdin:b.toWeb(n.stdin),stdout:g.toWeb(n.stdout),stderr:g.toWeb(n.stderr),isTerminal(e){switch(e){case"stdin":return n.stdin.isTTY===!0;case"stdout":return n.stdout.isTTY===!0;case"stderr":return n.stderr.isTTY===!0}},setStdinRaw(e){n.stdin.setRawMode(e)}});export{x as a,W as b,R as c,T as d};
@@ -0,0 +1 @@
1
+ import{d as n}from"./chunk-EMHZF6ZY.js";var i={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY"],DISCOVERY:["DISCOVERY_REVIEW"],DISCOVERY_REVIEW:["DISCOVERY_REVIEW","SPEC_DRAFT"],SPEC_DRAFT:["SPEC_DRAFT","SPEC_APPROVED"],SPEC_APPROVED:["EXECUTING"],EXECUTING:["DONE","BLOCKED"],BLOCKED:["EXECUTING"],DONE:["IDLE"]},c=(e,s)=>i[e].includes(s),t=(e,s)=>{if(!c(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${i[e].join(", ")}`)},p=(e,s)=>(t(e.phase,s),{...e,phase:s}),u=(e,s,a)=>(t(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,branch:a,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human"},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[]}),E=(e,s,a)=>{if(e.phase!=="DISCOVERY"&&e.phase!=="DISCOVERY_REVIEW")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let r=[...e.discovery.answers.filter(o=>o.questionId!==s),{questionId:s,answer:a}];return{...e,discovery:{...e.discovery,answers:r}}},d=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:n.specFile(e.spec),status:"draft"}}},S=e=>(t(e.phase,"SPEC_DRAFT"),{...e,phase:"SPEC_DRAFT"}),m=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}}},D=e=>(t(e.phase,"SPEC_APPROVED"),{...e,phase:"SPEC_APPROVED",specState:{...e.specState,status:"approved"}}),C=e=>(t(e.phase,"EXECUTING"),{...e,phase:"EXECUTING",discovery:{answers:[],completed:!0,currentQuestion:0,audience:"human"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]}});var I=(e,s)=>(t(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",execution:{...e.execution,lastProgress:`BLOCKED: ${s}`}}),F=(e,s)=>({...e,decisions:[...e.decisions,s]}),R=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1,currentQuestion:0,audience:"human"},specState:{path:null,status:"none"},execution:{iteration:0,lastProgress:null,modifiedFiles:[],lastVerification:null,awaitingStatusReport:!1,debt:null,completedTasks:[],debtCounter:0,naItems:[]},decisions:[],classification:null});export{p as a,u as b,E as c,d,S as e,m as f,D as g,C as h,I as i,F as j,R as k};
@@ -1,3 +1,3 @@
1
- import{d as o}from"./chunk-WUVVLUU5.js";import{b as e}from"./chunk-UA3VIHYO.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
1
+ import{d as o}from"./chunk-EMHZF6ZY.js";import{b as e}from"./chunk-MNEZ5QGX.js";var d=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s);t=t.replace(/^## Status: .+$/m,`## Status: ${n}`),await e.fs.writeTextFile(s,t)}catch{}},u=async(r,i,n)=>{let s=`${r}/${o.specFile(i)}`;try{let t=await e.fs.readTextFile(s),a=new RegExp(`^(- )\\[ \\]( ${n}:.*)$`,"m");t=t.replace(a,"$1[x]$2"),await e.fs.writeTextFile(s,t)}catch{}},w=async(r,i,n,s)=>{let t=`${r}/${o.specDir(i)}/progress.json`;try{let a=await e.fs.readTextFile(t),c=JSON.parse(a);for(let p of c.tasks)p.id===n&&(p.status=s);c.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(t,JSON.stringify(c,null,2)+`
2
2
  `)}catch{}},f=async(r,i,n)=>{let s=`${r}/${o.specDir(i)}/progress.json`;try{let t=await e.fs.readTextFile(s),a=JSON.parse(t);a.status=n,a.updatedAt=new Date().toISOString(),await e.fs.writeTextFile(s,JSON.stringify(a,null,2)+`
3
3
  `)}catch{}};export{d as a,u as b,w as c,f as d};
@@ -0,0 +1 @@
1
+ import{b as B,c as L}from"./chunk-DHMCIRLT.js";import{a as P,b,c as w,d as O,e as E,f as I,g as a,h as N,i as _,j as W,k as $,l as F,m as p,n as j,o as S,p as A,q as T,y as M}from"./chunk-4BH6CF3J.js";import{d as Q}from"./chunk-OTRBRRIO.js";var H={};Q(H,{AlreadyExistsError:()=>w,NotFoundError:()=>b,ProcessError:()=>O,RuntimeCapabilityError:()=>P,buildCommand:()=>R,clearWorkerdEnv:()=>L,createRuntime:()=>U,detectExecutionContext:()=>y,detectInvoker:()=>h,detectRuntime:()=>a,getArch:()=>j,getCliPrefix:()=>J,getHomedir:()=>S,getPlatform:()=>p,getPlatformInfo:()=>T,getRuntimeVersion:()=>N,getTmpdir:()=>A,isBrowser:()=>W,isCommandInPath:()=>v,isEdge:()=>F,isRuntime:()=>_,isServer:()=>$,matchCliPrefix:()=>D,populateEnvFromContext:()=>B,posixPath:()=>I,resolvePathDirs:()=>g,runtime:()=>i,toPosix:()=>E});var V={deno:async()=>(await import("./deno-WQJZSBAW.js")).createDenoRuntime(),node:async()=>(await import("./node-JJN2TSIE.js")).createNodeRuntime(),bun:async()=>(await import("./bun-LARHC47N.js")).createBunRuntime(),workerd:async()=>(await import("./workerd-VA2BYLUO.js")).createWorkerdRuntime(),browser:async()=>(await import("./browser-AXSE2CPY.js")).createBrowserRuntime()},X=["fs","exec","env","path","process"],Y=e=>e!==void 0&&X.some(n=>e[n]!==void 0),Z=(e,n,t)=>({name:e.name,version:e.version,capabilities:t,fs:n.fs??e.fs,path:n.path??e.path,exec:n.exec??e.exec,env:n.env??e.env,process:n.process??e.process}),U=async e=>{let n=a(),t=V[n],r=t!==void 0?await t():M(n),o=e?.capabilities?{...r.capabilities,...e.capabilities}:r.capabilities;return e!==void 0&&Y(e)?Z(r,e,o):e?.capabilities?{...r,capabilities:o}:r},i=await U();var g=(e,n)=>{let t=n==="windows"?";":":";return e.split(t).filter(r=>r.length>0)},l=new Set(["deno","node","bun"]),h=(e,n,t,r,o,s)=>{let d=l.has(e)?e:n;if(!l.has(d))return{invoker:"binary",mode:"installed"};if(d==="bun")return r.BUN_INSTALL!==void 0?{invoker:"bun",mode:"installed"}:{invoker:"bunx",mode:"on-demand"};if(d==="node"){let m=t[1]??"";if(m.includes("_npx")||m.includes("/npx"))return{invoker:"npx",mode:"on-demand"};if(m.includes("pnpm")||m.includes("pnpx"))return{invoker:"pnpx",mode:"on-demand"};let c=r.npm_execpath??"";return c.includes("npx")?{invoker:"npx",mode:"on-demand"}:c.includes("pnpm")?{invoker:"pnpx",mode:"on-demand"}:(r.npm_config_user_agent??"").includes("pnpm")?{invoker:"pnpm",mode:"installed"}:{invoker:"npm",mode:"installed"}}return d==="deno"?o!==void 0&&(o.startsWith("jsr:")||o.startsWith("https:"))?{invoker:"deno",mode:"on-demand"}:s===!0?{invoker:"dev",mode:"dev"}:{invoker:"deno",mode:"installed"}:{invoker:"unknown",mode:"installed"}},R=(e,n,t)=>e==="npx"?`npx ${t.npmPackage}`:e==="pnpx"?`pnpx ${t.npmPackage}`:e==="bunx"?`bunx ${t.npmPackage}`:e==="deno"&&n==="on-demand"?`deno run --allow-all jsr:${t.jsrPackage}`:e==="dev"?t.devCommand:t.command,v=async e=>{let n=p(),t=n==="windows"?`${e}.exe`:e,r=i.env.get("PATH")??"",o=g(r,n);for(let s of o)try{return await i.fs.stat(i.path.join(s,t)),!0}catch{continue}return!1},D=(e,n)=>{for(let t of e){let r=n.indexOf(t);if(r>=0)return n.slice(0,r+1).join(" ");let o=n.findIndex(s=>s.endsWith(`/${t}`)||s.endsWith(`\\${t}`)||s.includes(`:${t}`));if(o>=0)return n.slice(0,o+1).join(" ")}},J=async(e,n)=>{let t=await y(e),r=i.process.argv;for(let o of n){if(r.includes(o))return`${t.command} ${o}`;if(r.some(d=>d.endsWith(`/${o}`)||d.endsWith(`\\${o}`)||d.includes(`:${o}`)))return t.command}},y=async e=>{let n=i.path.basename(i.process.execPath()),t=a(),r=i.process.argv,o=import.meta.url,s=l.has(n)?n:t,d={BUN_INSTALL:i.env.get("BUN_INSTALL"),npm_execpath:i.env.get("npm_execpath"),npm_config_user_agent:i.env.get("npm_config_user_agent")},m=!1;if(s==="deno"&&o.startsWith("file://")){let k=i.process.cwd();try{let x=i.path.join(k,"deno.json"),C=await i.fs.readTextFile(x),u=JSON.parse(C).tasks;u!==void 0&&"cli"in u&&(m=!0)}catch{}if(!m)try{let x=i.path.join(k,"package.json"),C=await i.fs.readTextFile(x),u=JSON.parse(C).scripts;u!==void 0&&"cli"in u&&(m=!0)}catch{}}let{invoker:c,mode:f}=h(n,t,r,d,o,m),K=l.has(s)?s:"compiled",q=R(c,f,e),z=await v(e.command);return{runtime:K,mode:f,invoker:c,command:q,isInPath:z}};export{J as a,i as b,H as c};
@@ -0,0 +1 @@
1
+ var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(a&&(b=a(a=0)),b);var o=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),p=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var q=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d,q as e};
@@ -0,0 +1,3 @@
1
+ import{b as f}from"./chunk-VPXOI7CR.js";import{d as h}from"./chunk-EMHZF6ZY.js";import{b as d}from"./chunk-MNEZ5QGX.js";var m=l=>{let i=l.split(/\n/).flatMap(t=>t.trim().length>0?[t.trim()]:[]);return i.length>1?i:l.split(/\.\s+|;\s+/).map(t=>t.trim()).filter(t=>t.length>5)},w=(l,i=[])=>{let t=[],r=l.find(e=>e.questionId==="ambition");if(r!==void 0){let e=r.answer,a=e.match(/10[- ]?star[:\s]+(.+)/i),p=a!==null?a[1].trim():e,u=p.split(/\n/).map(n=>n.trim()).filter(n=>n.length>0),s;u.length>1?s=u.map(n=>n.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(n=>n.length>3):s=p.split(/\.\s+/).map(n=>n.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(n=>n.length>3);for(let n of s){let c=n.replace(/^(the|a|an|with|plus|also)\s+/i,"").trim();c=c.replace(/^(the\s+)?(target|goal|objective)[:\s]+/i,"").trim(),c=c.charAt(0).toUpperCase()+c.slice(1),c=c.replace(/[.\u2026]+$/,"").trim();let v=/^[A-Z][a-z]+\s/.test(c)&&/^(Add|Create|Build|Implement|Set up|Configure|Enable|Update|Remove|Refactor|Extract|Fix|Write|Design|Integrate|Support|Replace|Migrate)\s/i.test(c);c.length>100&&!v&&(c=`Implement ${c.charAt(0).toLowerCase()}${c.slice(1)}`,c.length>140&&(c=c.slice(0,137)+"...")),c.length>3&&t.push(c)}}let o=l.find(e=>e.questionId==="verification");if(o!==void 0){let e=o.answer.split(/\n/).map(a=>a.replace(/^\s*[-\u2022*]\s*/,"").trim()).filter(a=>a.length>0);for(let a of e)t.push(a)}for(let e of i){let a=e.choice.toLowerCase();if(a.includes("accepted")||a.includes("add to scope")){let p=e.question.replace(/^should\s+(we|i)\s+/i,"").replace(/\?+$/,"").trim(),u=p.charAt(0).toUpperCase()+p.slice(1);t.push(u)}}return t.length===0&&t.push("_Tasks need to be defined before execution. Add tasks manually or run discovery with more detail._"),t},S=(l,i)=>{let t={};if(i===null){for(let r of l.specSections)t[r]=!1;return t}for(let r of l.specSections){let o=r.toLowerCase();o.includes("design")||o.includes("mobile")||o.includes("layout")||o.includes("interaction")?t[r]=i.involvesWebUI:o.includes("contributor")||o.includes("public api")||o.includes("api surface")?t[r]=i.involvesPublicAPI:o.includes("migration")||o.includes("deprecation")||o.includes("backward")||o.includes("compatibility")?t[r]=i.involvesMigration:o.includes("audit")||o.includes("access control")||o.includes("data handling")?t[r]=i.involvesDataHandling:t[r]=!0}return t},g=(l,i,t,r,o)=>{let e=[];e.push(`# Spec: ${l}`),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 i)e.push(`### ${s.questionId}`),e.push(""),e.push(s.answer),e.push("");for(let s of t)if(s.specSections.length>0){let n=S(s,o??null);for(let c of s.specSections)n[c]!==!1&&(e.push(`## ${c} (${s.id})`),e.push(""),e.push("_To be addressed during execution._"),e.push(""))}if(r.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let s=0;s<r.length;s++){let n=r[s];e.push(`| ${s+1} | ${n.question} | ${n.choice} | ${n.promoted?"yes":"no"} |`)}e.push("")}let a=i.find(s=>s.questionId==="scope_boundary");if(a!==void 0){e.push("## Out of Scope"),e.push("");let s=m(a.answer);for(let n of s)e.push(`- ${n}`);e.push("")}let p=w(i,r);e.push("## Tasks"),e.push("");for(let s=0;s<p.length;s++)e.push(`- [ ] task-${s+1}: ${p[s]}`);e.push("");let u=i.find(s=>s.questionId==="verification");if(e.push("## Verification"),e.push(""),u!==void 0){let s=m(u.answer);for(let n of s)e.push(`- ${n}`)}else e.push("_To be defined._");return e.push(""),e.join(`
2
+ `)};var D=async(l,i,t)=>{if(i.spec===null)throw new Error("No active spec");let r=`${l}/${h.specDir(i.spec)}`,o=`${l}/${h.specFile(i.spec)}`;await d.fs.mkdir(r,{recursive:!0});let e=g(i.spec,i.discovery.answers,t,i.decisions,i.classification);await d.fs.writeTextFile(o,e);let a=f(i.spec,e),p=`${r}/progress.json`,u={spec:i.spec,status:"draft",tasks:a.tasks.map(s=>({id:s.id,title:s.title,status:"pending"})),decisions:i.decisions.map(s=>({question:s.question,choice:s.choice,promoted:s.promoted})),debt:[],updatedAt:new Date().toISOString()};return await d.fs.writeTextFile(p,JSON.stringify(u,null,2)+`
3
+ `),o};export{D as a};
@@ -1,4 +1,4 @@
1
- import{b as l}from"./chunk-UA3VIHYO.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
1
+ import{b as l}from"./chunk-MNEZ5QGX.js";var F=s=>{if(s===void 0)return"json";for(let n of s)if(n==="-o"||n.startsWith("--output")){let t=s.indexOf(n);if(n.includes("="))return x(n.split("=")[1]??"json");let i=s[t+1];if(i!==void 0&&!i.startsWith("-"))return x(i)}return"json"},O=s=>{if(s===void 0)return[];let n=[],t=!1;for(let i=0;i<s.length;i++){if(t){t=!1;continue}let o=s[i];if(!o.startsWith("--output=")){if(o==="-o"||o==="--output"){t=!0;continue}n.push(o)}}return n},x=s=>{let n=s.toLowerCase();return n==="md"||n==="markdown"?"markdown":n==="text"||n==="txt"||n==="plain"?"text":"json"},e=(s,n)=>s[n],$=s=>JSON.stringify(s,null,2),w=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&(t.push(`# noskills \u2014 ${i}`),t.push(""));let o=e(n,"instruction");o!==void 0&&(t.push("## Instruction"),t.push(""),t.push(o),t.push(""));let a=e(n,"questions");if(a!==void 0&&a.length>0)for(let r of a){if(t.push(`## Question: ${r.id}`),t.push(""),t.push(`> ${r.text}`),r.extras!==void 0&&r.extras.length>0){t.push(""),t.push("Also consider:");for(let m of r.extras)t.push(`- ${m}`)}t.push("")}let h=e(n,"statusReport");if(h!==void 0){t.push("## Acceptance Criteria"),t.push("");for(let r of h.criteria)t.push(`- [ ] ${r}`);t.push("")}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(`## Debt (from iteration ${p.fromIteration})`),t.push(""),t.push(`> ${p.note}`),t.push("");for(let r of p.items)t.push(`- ${r}`);t.push("")}e(n,"verificationFailed")===!0&&(t.push("## Verification FAILED"),t.push(""),t.push("```"),t.push(String(e(n,"verificationOutput")??"")),t.push("```"),t.push(""));let c=e(n,"behavioral");if(c!==void 0){t.push("## Behavioral"),t.push(""),t.push(`**Tone:** ${c.tone}`),t.push("");for(let r of c.rules)t.push(`- ${r}`);c.urgency!==void 0&&(t.push(""),t.push(`**Urgency:** ${c.urgency}`)),t.push("")}let f=e(n,"meta");f!==void 0&&(t.push("---"),t.push(""),t.push(`*${f.resumeHint}*`),t.push(""));let d=e(n,"transition");if(d!==void 0){t.push("## Next Steps"),t.push("");for(let[r,m]of Object.entries(d))r!=="iteration"&&t.push(`- **${r}:** \`${m}\``);t.push("")}let u=e(n,"summary");u!==void 0&&(t.push("## Summary"),t.push(""),t.push(`- Spec: ${u.spec}`),t.push(`- Iterations: ${u.iterations}`),t.push(`- Decisions: ${u.decisionsCount}`),t.push(""));let g=e(n,"clearContext");return g!==void 0&&(t.push("---"),t.push(""),t.push(`**Action required:** ${g.reason}`),t.push("")),t.join(`
2
2
  `)},k=s=>{let n=s,t=[],i=e(n,"phase");i!==void 0&&t.push(`[${i}]`);let o=e(n,"instruction");o!==void 0&&t.push(o);let a=e(n,"questions");if(a!==void 0&&a.length>0){for(let u of a)if(t.push(""),t.push(`Question [${u.id}]: ${u.text}`),u.extras!==void 0)for(let g of u.extras)t.push(` - ${g}`)}let h=e(n,"statusReport");if(h!==void 0){t.push(""),t.push("Criteria:");for(let u of h.criteria)t.push(` - ${u}`)}let p=e(n,"previousIterationDebt");if(p!==void 0){t.push(""),t.push(p.note);for(let u of p.items)t.push(` - ${u}`)}e(n,"verificationFailed")===!0&&(t.push(""),t.push(`Verification failed: ${String(e(n,"verificationOutput")??"").slice(0,200)}`));let c=e(n,"meta");c!==void 0&&(t.push(""),t.push(c.resumeHint));let f=e(n,"summary");f!==void 0&&t.push(`Spec: ${f.spec}, Iterations: ${f.iterations}, Decisions: ${f.decisionsCount}`);let d=e(n,"clearContext");return d!==void 0&&(t.push(""),t.push(d.reason)),t.join(`
3
3
  `)},b=(s,n)=>{switch(n){case"markdown":return w(s);case"text":return k(s);default:return $(s)}},v=async(s,n)=>{let t=b(s,n),i=new TextEncoder,o=l.process.stdout.getWriter();await o.write(i.encode(t+`
4
4
  `)),o.releaseLock()};export{F as a,O as b,b as c,v as d};
@@ -1 +1 @@
1
- import{b as i}from"./chunk-UA3VIHYO.js";var l=[{envVars:["CLAUDE_CODE","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_SESSION_ID"],tool:"claude-code"},{envVars:["CURSOR_SESSION","CURSOR"],tool:"cursor"},{envVars:["KIRO_SESSION","KIRO"],tool:"kiro"},{envVars:["WINDSURF_SESSION"],tool:"windsurf"},{envVars:["GITHUB_COPILOT"],tool:"copilot"}],s=()=>{for(let e of l)for(let t of e.envVars){let n=i.env.get(t);if(n!==void 0&&n!=="")return e.tool}return null},o=()=>s()!==null?"agent":"human";var I=(e,t)=>{if(e!==void 0)for(let r of e){if(r==="--agent")return"agent";if(r==="--human")return"human"}let n=t?.agentMode;return n===!0?"agent":n===!1?"human":o()};var y=e=>e===void 0?[]:e.filter(t=>t!=="--agent"&&t!=="--human"&&t!=="--non-interactive");export{s as a,I as b,y as c};
1
+ import{b as i}from"./chunk-MNEZ5QGX.js";var l=[{envVars:["CLAUDE_CODE","CLAUDECODE","CLAUDE_CODE_ENTRYPOINT","CLAUDE_SESSION_ID"],tool:"claude-code"},{envVars:["CURSOR_SESSION","CURSOR"],tool:"cursor"},{envVars:["KIRO_SESSION","KIRO"],tool:"kiro"},{envVars:["WINDSURF_SESSION"],tool:"windsurf"},{envVars:["GITHUB_COPILOT"],tool:"copilot"}],s=()=>{for(let e of l)for(let t of e.envVars){let n=i.env.get(t);if(n!==void 0&&n!=="")return e.tool}return null},o=()=>s()!==null?"agent":"human";var I=(e,t)=>{if(e!==void 0)for(let r of e){if(r==="--agent")return"agent";if(r==="--human")return"human"}let n=t?.agentMode;return n===!0?"agent":n===!1?"human":o()};var y=e=>e===void 0?[]:e.filter(t=>t!=="--agent"&&t!=="--human"&&t!=="--non-interactive");export{s as a,I as b,y as c};
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-UA3VIHYO.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
1
+ import{b as c}from"./chunk-MNEZ5QGX.js";var f=async(n,r)=>{let e=`${n}/.eser/specs/${r}/spec.md`,t;try{t=await c.fs.readTextFile(e)}catch{return null}return d(r,t)},d=(n,r)=>{let e=[],t=[],o=[],i="";for(let l of r.split(`
2
2
  `)){let s=l.trim();if(s.startsWith("## ")){i=s.slice(3).trim().toLowerCase();continue}if(i.startsWith("tasks")){let a=s.match(/^-\s*\[[ x]\]\s*(task-\d+):\s*(.+)$/i);a!==null&&e.push({id:a[1],title:a[2].trim()})}i.startsWith("out of scope")&&s.startsWith("- ")&&t.push(s.slice(2).trim()),i.startsWith("verification")&&s.startsWith("- ")&&o.push(s.slice(2).trim())}return{name:n,tasks:e,outOfScope:t,verification:o}},u=(n,r)=>{let e=new Set(r);for(let t of n)if(!e.has(t.id))return t;return null};export{f as a,d as b,u as c};
@@ -0,0 +1,67 @@
1
+ import{a as h}from"./chunk-YK6UG66R.js";import{d}from"./chunk-EMHZF6ZY.js";import{b as n}from"./chunk-MNEZ5QGX.js";var p="<!-- noskills:start -->",u="<!-- noskills:end -->",v=(t,o,s="npx eser noskills")=>{let e=[p,"## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/rules/`, `.eser/specs/`, or concern files directly.","noskills gives you exactly what you need via JSON output.","","### Protocol","",` ${s} next # get current instruction`,` ${s} next --answer="your response" # submit result and advance`,"","### When to call noskills next","",`You MUST call \`${s} next\` in these situations:`,"","1. At the **START** of every conversation (first thing you do)","2. **BEFORE** creating or modifying any file (to verify you have an active task)","3. **AFTER** completing a logical unit of work (to report progress)","4. When you encounter a **DECISION** that affects architecture or scope","5. When you are **UNSURE** what to do next","","NEVER proceed with implementation without checking noskills first.","NEVER make architectural decisions independently \u2014 noskills routes them to the user."];if((o?.allowGit??!1)||e.push("","### Git is read-only","","You MUST NOT run git write commands: commit, add, push, checkout, stash,","reset, merge, rebase, cherry-pick. The user controls git. You control files.","You MAY read from git: log, diff, status, show, blame."),e.push("","### Convention discovery","","When you discover a pattern, receive a correction, or identify a recurring",'preference from the user, ask: "Should this be a permanent rule for this',`project, or just for this task?" If permanent, run: \`${s} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### Decision principle: Explicit > Clever","","You NEVER skip steps, bypass questions, or make assumptions on behalf of the user.","- Discovery questions \u2192 ask the user, don't answer yourself","- Classification \u2192 ask the user, don't infer","- Spec approval \u2192 ask the user, don't auto-approve","- Task refinement \u2192 ask the user, don't self-assign","- Rule promotion \u2192 ask the user, don't decide",`If you think something can be skipped, ASK "would you like to skip this?" \u2014 don't skip it.`,"","### Command execution","","When told to run a noskills command, execute it IMMEDIATELY. Do not explore,","research, read source code, or plan first. The command output contains all the","context you need. Exploring noskills internals wastes tokens and delays the user.","","### JSON output","","noskills returns JSON with a `phase` field and phase-specific instructions.","The `meta` block contains resume context - use it to orient yourself,","especially after compaction or at the start of a new session.","Follow the `instruction` field. Use `transition` commands to advance state."),t.length>0){e.push("","### Active Rules","");for(let i of t)e.push(`- ${i}`)}return e.push(u),e.join(`
2
+ `)},f=async(t,o,s,e="npx eser noskills")=>{let i=`${t}/CLAUDE.md`,a=v(o,s,e),r;try{r=await n.fs.readTextFile(i);let c=r.indexOf(p),l=r.indexOf(u);c!==-1&&l!==-1?r=r.slice(0,c)+a+r.slice(l+u.length):r=r.trimEnd()+`
3
+
4
+ `+a+`
5
+ `}catch{r=a+`
6
+ `}await n.fs.writeTextFile(i,r)};var m=async(t,o,s="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(o.length>0){e.push("## Rules","");for(let i of o)e.push(`- ${i}`);e.push("")}await n.fs.writeTextFile(`${t}/.cursorrules`,e.join(`
7
+ `))};var y=async(t,o,s="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(o.length>0){e.push("## Rules","");for(let i of o)e.push(`- ${i}`);e.push("")}await n.fs.mkdir(`${t}/.kiro/steering`,{recursive:!0}),await n.fs.writeTextFile(`${t}/.kiro/steering/conventions.md`,e.join(`
8
+ `))};var k=async(t,o,s="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(o.length>0){e.push("## Rules","");for(let i of o)e.push(`- ${i}`);e.push("")}await n.fs.mkdir(`${t}/.github`,{recursive:!0}),await n.fs.writeTextFile(`${t}/.github/copilot-instructions.md`,e.join(`
9
+ `))};var g=async(t,o,s="npx eser noskills")=>{let e=["# Generated by noskills \u2014 do not edit manually","","## noskills orchestrator","","This project uses noskills for state-driven orchestration.","Do NOT read `.eser/specs/` or `.eser/rules/` directly. noskills gives you what you need.","",`Run \`${s} next\` to get your current instruction.`,`Submit results with \`${s} next --answer="..."\``,"","## When to call noskills next","","1. At the START of every conversation","2. BEFORE creating or modifying any file","3. AFTER completing a logical unit of work","4. When you encounter a DECISION that affects architecture","5. When you are UNSURE what to do next","","NEVER proceed with implementation without checking noskills first.",""];if(o.length>0){e.push("## Rules","");for(let i of o)e.push(`- ${i}`);e.push("")}await n.fs.writeTextFile(`${t}/.windsurfrules`,e.join(`
10
+ `))};var N=t=>({hooks:{PreToolUse:[{matcher:"Write|Edit|MultiEdit|Bash",hooks:[{type:"command",command:`${t} invoke-hook pre-tool-use`,timeout:5}]}],PostToolUse:[{matcher:"Write|Edit|MultiEdit",hooks:[{type:"command",command:`${t} invoke-hook post-file-write`,timeout:3}]},{matcher:"Bash",hooks:[{type:"command",command:`${t} invoke-hook post-bash`,timeout:3}]}],Stop:[{hooks:[{type:"command",command:`${t} invoke-hook stop`,timeout:10}]}],SessionStart:[{hooks:[{type:"command",command:`${t} invoke-hook session-start`,timeout:5}]}]}}),w=async(t,o="npx eser@latest noskills")=>{let s=`${t}/.claude/settings.json`,e={};try{let r=await n.fs.readTextFile(s);e=JSON.parse(r)}catch{}let i=N(o),a={...e,...i};await n.fs.mkdir(`${t}/.claude`,{recursive:!0}),await n.fs.writeTextFile(s,JSON.stringify(a,null,2)+`
11
+ `)};var O=async t=>{let o=`${t}/${d.rulesDir}`,s=[];try{for await(let e of n.fs.readDir(o))if(e.isFile&&(e.name.endsWith(".md")||e.name.endsWith(".txt"))){let i=await n.fs.readTextFile(`${o}/${e.name}`),a=i.trim().split(`
12
+ `)[0]??i.trim();s.push(a)}}catch{}return s},b={cursor:m,kiro:y,copilot:k,windsurf:g},P=async(t,o,s)=>{let e=await O(t),i=[],a={allowGit:s?.allowGit??!1},r=s?.command??"npx eser@latest noskills";h(r);for(let c of o){if(c==="claude-code"){await f(t,e,a,r),i.push(c);continue}let l=b[c];l!==void 0&&(await l(t,e,r),i.push(c))}return o.includes("claude-code")&&(await w(t,r),await A(t,r),await F(t,r),i.push("hooks")),i},A=async(t,o)=>{let s=`${t}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0});let e=`---
13
+ name: noskills-executor
14
+ description: "Executes a single noskills task."
15
+ tools: Read, Edit, MultiEdit, Write, Bash, Grep, Glob, LS
16
+ ---
17
+
18
+ You are executing a single task from a noskills spec.
19
+ Your ONLY job is to complete the task described in the prompt.
20
+ Follow all behavioral rules provided in the prompt.
21
+ Do NOT start new tasks, explore unrelated code, or make architectural decisions.
22
+ If the task is too vague to execute, say so immediately.
23
+
24
+ ## Self-Verification
25
+ After completing the task, you MUST verify your own work before reporting:
26
+ 1. Run type check: \`deno check\` on all modified files
27
+ 2. Run test suite: \`deno test\` on the relevant test files
28
+ 3. If type check or tests fail, fix the issues before reporting
29
+
30
+ ## Reporting
31
+ When finished, provide a structured JSON summary:
32
+ \\\`\\\`\\\`json
33
+ {"completed": ["<item IDs done>"], "remaining": ["<item IDs not done>"], "blocked": ["<item IDs needing decisions>"], "filesModified": ["<paths>"], "verification": {"typeCheck": "pass|fail", "tests": "pass|fail (N passed, M failed)"}}
34
+ \\\`\\\`\\\`
35
+
36
+ Do NOT return raw test output \u2014 summarize it in the verification field.
37
+ The orchestrator will submit this to \`${o} next --answer\` on your behalf.
38
+ `;await n.fs.writeTextFile(`${s}/noskills-executor.md`,e)},F=async(t,o)=>{let s=`${t}/.claude/agents`;await n.fs.mkdir(s,{recursive:!0}),await n.fs.writeTextFile(`${s}/noskills-verifier.md`,`---
39
+ name: noskills-verifier
40
+ description: "Independently verifies completed task work. Read-only. Never sees the executor's context."
41
+ tools: Read, Bash, Grep, Glob, LS
42
+ ---
43
+
44
+ You are verifying another agent's work. You have NO context about how it was done.
45
+ Read the changed files. Run the test suite. Check each acceptance criterion independently.
46
+
47
+ For each acceptance criterion:
48
+ - PASS: with evidence \u2014 show the grep result, the test output, or the file content that proves it
49
+ - FAIL: with specific reason \u2014 what's missing, what's wrong, what doesn't match
50
+
51
+ Be skeptical. Don't assume anything works \u2014 verify it yourself.
52
+ You CANNOT edit files. Read-only access only.
53
+
54
+ ## Verification Steps
55
+ 1. Read each modified file and verify the changes are correct
56
+ 2. Run type check: \\\`deno check\\\` on modified files
57
+ 3. Run tests: \\\`deno test\\\` on relevant test files
58
+ 4. Check each acceptance criterion against actual file contents
59
+
60
+ ## Report Format
61
+ When finished, provide a structured JSON summary:
62
+ \\\`\\\`\\\`json
63
+ {"results": [{"id": "ac-1", "status": "PASS", "evidence": "..."}, {"id": "ac-2", "status": "FAIL", "reason": "..."}]}
64
+ \\\`\\\`\\\`
65
+
66
+ The orchestrator will use this report for the noskills status report.
67
+ `)};export{O as a,P as b};
@@ -1,4 +1,4 @@
1
- import{b as v}from"./chunk-UA3VIHYO.js";import{d as G}from"./chunk-DXB73IDG.js";var y=e=>e.map(n=>typeof n=="string"?X(n):n),X=e=>({kind:"text",value:e}),se=(...e)=>({kind:"bold",children:y(e)}),le=(...e)=>({kind:"dim",children:y(e)});var pe=(...e)=>({kind:"group",children:y(e)});var g=(e,...n)=>({kind:"color",color:e,children:y(n)}),ue=(...e)=>g("red",...e),de=(...e)=>g("green",...e),ce=(...e)=>g("yellow",...e),me=(...e)=>g("blue",...e),ye=(...e)=>g("magenta",...e),he=(...e)=>g("cyan",...e),fe=(...e)=>g("gray",...e);var ke=(e,n)=>({kind:"table",headers:y(e),rows:n.map(r=>y(r))});var Se=(e,...n)=>({kind:"alert",level:e,children:y(n)}),h=e=>{switch(e.kind){case"text":return e.value.length;case"newline":return 1;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.reduce((n,r)=>n+h(r),0);case"code-block":return e.value.length;case"table":case"list":return 0;case"gauge":{let n=e.width??20,r=e.label?` ${e.label}`:"";return n+` ${e.percent}%`.length+r.length}case"separator":return 0;case"alert":return 2+e.children.reduce((n,r)=>n+h(r),0)}};var w=(e,n)=>{let r=typeof e=="string"?"text":e instanceof Uint8Array?"bytes":"structured";return{data:e,meta:{timestamp:Date.now(),kind:r,channel:"stdout",...n}}};var E=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
1
+ import{b as v}from"./chunk-MNEZ5QGX.js";import{d as G}from"./chunk-OTRBRRIO.js";var y=e=>e.map(n=>typeof n=="string"?X(n):n),X=e=>({kind:"text",value:e}),se=(...e)=>({kind:"bold",children:y(e)}),le=(...e)=>({kind:"dim",children:y(e)});var pe=(...e)=>({kind:"group",children:y(e)});var g=(e,...n)=>({kind:"color",color:e,children:y(n)}),ue=(...e)=>g("red",...e),de=(...e)=>g("green",...e),ce=(...e)=>g("yellow",...e),me=(...e)=>g("blue",...e),ye=(...e)=>g("magenta",...e),he=(...e)=>g("cyan",...e),fe=(...e)=>g("gray",...e);var ke=(e,n)=>({kind:"table",headers:y(e),rows:n.map(r=>y(r))});var Se=(e,...n)=>({kind:"alert",level:e,children:y(n)}),h=e=>{switch(e.kind){case"text":return e.value.length;case"newline":return 1;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.reduce((n,r)=>n+h(r),0);case"code-block":return e.value.length;case"table":case"list":return 0;case"gauge":{let n=e.width??20,r=e.label?` ${e.label}`:"";return n+` ${e.percent}%`.length+r.length}case"separator":return 0;case"alert":return 2+e.children.reduce((n,r)=>n+h(r),0)}};var w=(e,n)=>{let r=typeof e=="string"?"text":e instanceof Uint8Array?"bytes":"structured";return{data:e,meta:{timestamp:Date.now(),kind:r,channel:"stdout",...n}}};var E=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
2
2
  `;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.map(E).join("");case"code-block":return e.value.split(`
3
3
  `).map(n=>` ${n}`).join(`
4
4
  `)+`
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-MNEZ5QGX.js";var n={command:"eser",devCommand:"deno task cli",npmPackage:"eser",jsrPackage:"@eser/cli"},r="npx eser@latest noskills",t=r,i=s=>{t=s},m=()=>t,a=s=>`${t} ${s}`,c=async()=>await e(n,["noskills","nos"])??r;export{i as a,m as b,a as c,c as d};
@@ -0,0 +1 @@
1
+ import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-7QFOEK3I.js";import{a as c}from"./chunk-OLM5RTFK.js";import"./chunk-BBKSV2RO.js";import"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var y=class{capabilities=["text_generation","streaming","tool_calling"];provider="claude-code";modelId;binary;config;constructor(e,n){this.binary=e,this.config=n,this.modelId=n.model}async generateText(e,n){let r=w(this.config,e,"json"),s=f(e.messages,e.system);r.push("-p",s);let o=p(this.binary,r,{signal:n}),l=m(o.stderr),i=o.stdout.getReader(),a=[],d=new TextDecoder,g=await i.read();for(;g.done!==!0;)a.push(d.decode(g.value,{stream:!0})),g=await i.read();i.releaseLock();let T=await o.waitForExit(),_=await l,x=u("claude-code",T.code,_);if(x!==null)throw x;let S=a.join("");return v(S,this.modelId)}async*streamText(e,n){let r=this.config.properties?.streamFormat??"text",s=w(this.config,e,r),o=f(e.messages,e.system);s.push("-p",o);let l=p(this.binary,s,{signal:n}),i=m(l.stderr);try{r==="stream-json"?yield*this.#t(l,i):yield*this.#e(l,i)}catch(a){a instanceof c?yield{kind:"error",error:a}:yield{kind:"error",error:new c(a instanceof Error?a.message:String(a),{provider:"claude-code",cause:a instanceof Error?a:void 0})}}}async*#e(e,n){let r=new TextDecoder,s=e.stdout.getReader(),o=await s.read();for(;o.done!==!0;){let d=r.decode(o.value,{stream:!0});d.length>0&&(yield{kind:"content_delta",textDelta:d}),o=await s.read()}s.releaseLock();let l=await e.waitForExit(),i=await n,a=u("claude-code",l.code,i);a!==null?yield{kind:"error",error:a}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}async*#t(e,n){for await(let l of h(e.stdout)){let i=E(l);i!==null&&(yield i)}let r=await e.waitForExit(),s=await n,o=u("claude-code",r.code,s);o!==null&&(yield{kind:"error",error:o})}close(){return Promise.resolve()}getRawClient(){return null}},P={provider:"claude-code",async createModel(t){let e=await k("claude",t);return new y(e,t)}},w=(t,e,n)=>{let r=[];n!=="text"&&r.push("--output-format",n),n==="stream-json"&&r.push("--verbose"),r.push("--model",t.model);let s=t.properties?.maxTurns;s!==void 0&&r.push("--max-turns",String(s));let o=t.properties?.allowedTools;if(o!==void 0)for(let i of o)r.push("--allowedTools",i);let l=t.properties?.args;return l!==void 0&&r.push(...l),r},v=(t,e)=>{try{let n=JSON.parse(t);return b(n,e)}catch{return{content:[{kind:"text",text:t.trim()}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0},modelId:e}}},b=(t,e)=>{let n=[];if(t.result!==void 0)n.push({kind:"text",text:String(t.result)});else if(t.message?.content!==void 0)for(let r of t.message.content)r.type==="text"?n.push({kind:"text",text:r.text}):r.type==="tool_use"&&n.push({kind:"tool_call",toolCall:{id:r.id??r.name,name:r.name,arguments:r.input??{}}});else typeof t=="string"&&n.push({kind:"text",text:t});return n.length===0&&n.push({kind:"text",text:JSON.stringify(t)}),{content:n,stopReason:t.stop_reason==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:t.usage?.input_tokens??0,outputTokens:t.usage?.output_tokens??0,totalTokens:(t.usage?.input_tokens??0)+(t.usage?.output_tokens??0)},modelId:e,rawResponse:t}},E=t=>{if(t===null||typeof t!="object")return null;let e=t;if(e.type==="assistant"){if(e.message?.content!==void 0){for(let n of e.message.content)if(n.type==="text")return{kind:"content_delta",textDelta:n.text}}return null}return e.type==="content_block_delta"?e.delta?.type==="text_delta"?{kind:"content_delta",textDelta:e.delta.text}:null:e.type==="result"?{kind:"message_done",stopReason:e.subtype==="tool_use"?"tool_use":"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new c(e.error?.message??"Unknown Claude Code error",{provider:"claude-code"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as ClaudeCodeModel,P as claudeCodeFactory};
@@ -0,0 +1 @@
1
+ import{a,b,c,d}from"./chunk-YK6UG66R.js";import"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";export{c as cmd,b as cmdPrefix,d as extractPrefix,a as setCommandPrefix};
@@ -0,0 +1 @@
1
+ import{b as A}from"./chunk-2WH262CW.js";import{b as $,c as b}from"./chunk-YK6UG66R.js";import{m as k,n as y,o as x,p as P}from"./chunk-EMHZF6ZY.js";import{c as d,d as c,f as u,g as C,o as m,q as w,r as g}from"./chunk-Y6AFIAJP.js";import{a as l,b as p}from"./chunk-2N4GTHXQ.js";import{b as v}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.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};
@@ -0,0 +1 @@
1
+ import{b as D,d as Q,r as G}from"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";import he from"node:process";function X(){let e=globalThis,r=e.Deno?.build?.os;return typeof r=="string"?r==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var A=X();function C(e){if(typeof e!="string")throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function H(e,r){if(r.length>=e.length)return e;let t=e.length-r.length;for(let o=r.length-1;o>=0;--o)if(e.charCodeAt(t+o)!==r.charCodeAt(o))return e;return e.slice(0,-r.length)}function k(e,r,t=0){let o=!1,s=e.length;for(let i=e.length-1;i>=t;--i)if(r(e.charCodeAt(i))){if(o){t=i+1;break}}else o||(o=!0,s=i+1);return e.slice(t,s)}function L(e,r){if(C(e),e.length===0)return e;if(typeof r!="string")throw new TypeError(`Suffix must be a string, received "${JSON.stringify(r)}"`)}function U(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function P(e){return e=U(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function S(e,r){if(e.length<=1)return e;let t=e.length;for(let o=e.length-1;o>0&&r(e.charCodeAt(o));o--)t=o;return e.slice(0,t)}function p(e){return e===47}function Y(e,r=""){e instanceof URL&&(e=P(e)),L(e,r);let t=k(e,p),o=S(t,p);return r?H(o,r):o}function V(e){return e===47}function m(e){return e===47||e===92}function R(e){return e>=97&&e<=122||e>=65&&e<=90}function E(e){e=U(e);let r=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(r=`\\\\${e.hostname}${r}`),r}function q(e,r=""){e instanceof URL&&(e=E(e)),L(e,r);let t=0;if(e.length>=2){let i=e.charCodeAt(0);R(i)&&e.charCodeAt(1)===58&&(t=2)}let o=k(e,m,t),s=S(o,m);return r?H(s,r):s}function ee(e,r=""){return A?q(e,r):Y(e,r)}var re=A?";":":",B=A?"\\":"/";function W(e){if(C(e),e.length===0)return"."}function te(e){e instanceof URL&&(e=P(e)),W(e);let r=-1,t=!1;for(let o=e.length-1;o>=1;--o)if(p(e.charCodeAt(o))){if(t){r=o;break}}else t=!0;return r===-1?p(e.charCodeAt(0))?"/":".":S(e.slice(0,r),p)}function oe(e){e instanceof URL&&(e=E(e)),W(e);let r=e.length,t=-1,o=-1,s=!0,i=0,a=e.charCodeAt(0);if(r>1)if(m(a)){if(t=i=1,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return e;n!==l&&(t=i=n+1)}}}}else R(a)&&e.charCodeAt(1)===58&&(t=i=2,r>2&&m(e.charCodeAt(2))&&(t=i=3));else if(m(a))return e;for(let n=r-1;n>=i;--n)if(m(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return S(e.slice(0,o),V)}function ie(e){return A?oe(e):te(e)}function ne(e){e instanceof URL&&(e=P(e)),C(e);let r=-1,t=0,o=-1,s=!0,i=0;for(let a=e.length-1;a>=0;--a){let n=e.charCodeAt(a);if(p(n)){if(!s){t=a+1;break}continue}o===-1&&(s=!1,o=a+1),n===46?r===-1?r=a:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||o===-1||i===0||i===1&&r===o-1&&r===t+1?"":e.slice(r,o)}function se(e){e instanceof URL&&(e=E(e)),C(e);let r=0,t=-1,o=0,s=-1,i=!0,a=0;e.length>=2&&e.charCodeAt(1)===58&&R(e.charCodeAt(0))&&(r=o=2);for(let n=e.length-1;n>=r;--n){let l=e.charCodeAt(n);if(m(l)){if(!i){o=n+1;break}continue}s===-1&&(i=!1,s=n+1),l===46?t===-1?t=n:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||s===-1||a===0||a===1&&t===s-1&&t===o+1?"":e.slice(t,s)}function ae(e){return A?se(e):ne(e)}function N(e,r){let t=r.dir||r.root,o=r.base||(r.name??"")+(r.ext??"");return t?o===e?t:t===r.root?t+o:t+e+o:o}function $(e){if(e===null||typeof e!="object")throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof e}"`)}function fe(e){return $(e),N("/",e)}function le(e){return $(e),N("\\",e)}function ce(e){return A?le(e):fe(e)}function j(e){return C(e),e.length>0&&p(e.charCodeAt(0))}function M(e){C(e);let r=e.length;if(r===0)return!1;let t=e.charCodeAt(0);return m(t)?!0:!!(R(t)&&r>2&&e.charCodeAt(1)===58&&m(e.charCodeAt(2)))}function me(e){return A?M(e):j(e)}function I(e){if(C(e),e.length===0)return"."}function _(e,r,t,o){let s="",i=0,a=-1,n=0,l;for(let f=0;f<=e.length;++f){if(f<e.length)l=e.charCodeAt(f);else{if(o(l))break;l=47}if(o(l)){if(!(a===f-1||n===1))if(a!==f-1&&n===2){if(s.length<2||i!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){let d=s.lastIndexOf(t);d===-1?(s="",i=0):(s=s.slice(0,d),i=s.length-1-s.lastIndexOf(t)),a=f,n=0;continue}else if(s.length===2||s.length===1){s="",i=0,a=f,n=0;continue}}r&&(s.length>0?s+=`${t}..`:s="..",i=2)}else s.length>0?s+=t+e.slice(a+1,f):s=e.slice(a+1,f),i=f-a-1;a=f,n=0}else l===46&&n!==-1?++n:n=-1}return s}function F(e){e instanceof URL&&(e=P(e)),I(e);let r=p(e.charCodeAt(0)),t=p(e.charCodeAt(e.length-1));return e=_(e,!r,"/",p),e.length===0&&!r&&(e="."),e.length>0&&t&&(e+="/"),r?`/${e}`:e}function K(e,...r){if(e===void 0)return".";e instanceof URL&&(e=P(e)),r=e?[e,...r]:r,r.forEach(o=>C(o));let t=r.filter(o=>o.length>0).join("/");return t===""?".":F(t)}function b(e){e instanceof URL&&(e=E(e)),I(e);let r=e.length,t=0,o,s=!1,i=e.charCodeAt(0);if(r>1)if(m(i))if(s=!0,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){let f=e.slice(l,n);for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return`\\\\${f}\\${e.slice(l)}\\`;n!==l&&(o=`\\\\${f}\\${e.slice(l,n)}`,t=n)}}}else t=1;else R(i)&&e.charCodeAt(1)===58&&(o=e.slice(0,2),t=2,r>2&&m(e.charCodeAt(2))&&(s=!0,t=3));else if(m(i))return"\\";let a;return t<r?a=_(e.slice(t),!s,"\\",m):a="",a.length===0&&!s&&(a="."),a.length>0&&m(e.charCodeAt(r-1))&&(a+="\\"),o===void 0?s?a.length>0?`\\${a}`:"\\":a:s?a.length>0?`${o}\\${a}`:`${o}\\`:o+a}function Z(e,...r){if(e instanceof URL&&(e=E(e)),r=e?[e,...r]:r,r.forEach(a=>C(a)),r=r.filter(a=>a.length>0),r.length===0)return".";let t=!0,o=0,s=r[0];if(m(s.charCodeAt(0))){++o;let a=s.length;a>1&&m(s.charCodeAt(1))&&(++o,a>2&&(m(s.charCodeAt(2))?++o:t=!1))}let i=r.join("\\");if(t){for(;o<i.length&&m(i.charCodeAt(o));++o);o>=2&&(i=`\\${i.slice(o)}`)}return b(i)}function J(e,...r){return A?Z(e,...r):K(e,...r)}function de(e){return A?b(e):F(e)}function ue(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;let t=p(e.charCodeAt(0)),o;t?(r.root="/",o=1):o=0;let s=-1,i=0,a=-1,n=!0,l=e.length-1,f=0;for(;l>=o;--l){let d=e.charCodeAt(l);if(p(d)){if(!n){i=l+1;break}continue}a===-1&&(n=!1,a=l+1),d===46?s===-1?s=l:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||a===-1||f===0||f===1&&s===a-1&&s===i+1?(a!==-1&&(i===0&&t?r.base=r.name=e.slice(1,a):r.base=r.name=e.slice(i,a)),r.base=r.base||"/"):(i===0&&t?(r.name=e.slice(1,s),r.base=e.slice(1,a)):(r.name=e.slice(i,s),r.base=e.slice(i,a)),r.ext=e.slice(s,a)),i>0?r.dir=S(e.slice(0,i-1),p):t&&(r.dir="/"),r}function pe(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""},t=e.length;if(t===0)return r;let o=0,s=e.charCodeAt(0);if(t>1){if(m(s)){if(o=1,m(e.charCodeAt(1))){let u=2,c=u;for(;u<t&&!m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&!m(e.charCodeAt(u));++u);u===t?o=u:u!==c&&(o=u+1)}}}}else if(R(s)&&e.charCodeAt(1)===58)if(o=2,t>2){if(m(e.charCodeAt(2))){if(t===3)return r.root=r.dir=e,r.base="\\",r;o=3}}else return r.root=r.dir=e,r}else if(m(s))return r.root=r.dir=e,r.base="\\",r;o>0&&(r.root=e.slice(0,o));let i=-1,a=o,n=-1,l=!0,f=e.length-1,d=0;for(;f>=o;--f){if(s=e.charCodeAt(f),m(s)){if(!l){a=f+1;break}continue}n===-1&&(l=!1,n=f+1),s===46?i===-1?i=f:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||n===-1||d===0||d===1&&i===n-1&&i===a+1?n!==-1&&(r.base=r.name=e.slice(a,n)):(r.name=e.slice(a,i),r.base=e.slice(a,n),r.ext=e.slice(i,n)),r.base=r.base||"\\",a>0&&a!==o?r.dir=e.slice(0,a-1):r.dir=r.root,r}function Ae(e){return A?pe(e):ue(e)}function O(...e){let r="",t=!1;for(let o=e.length-1;o>=-1&&!t;o--){let s;if(o>=0)s=e[o];else{let{Deno:i}=globalThis;if(typeof i?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");s=i.cwd()}C(s),s.length!==0&&(r=`${s}/${r}`,t=p(s.charCodeAt(0)))}return r=_(r,!t,"/",p),t?r.length>0?`/${r}`:"/":r.length>0?r:"."}function z(e,r){if(C(e),C(r),e===r)return""}function Ce(e,r){if(z(e,r),e=O(e),r=O(r),e===r)return"";let t=1,o=e.length;for(;t<o&&p(e.charCodeAt(t));++t);let s=o-t,i=1,a=r.length;for(;i<a&&p(r.charCodeAt(i));++i);let n=a-i,l=s<n?s:n,f=-1,d=0;for(;d<=l;++d){if(d===l){if(n>l){if(p(r.charCodeAt(i+d)))return r.slice(i+d+1);if(d===0)return r.slice(i+d)}else s>l&&(p(e.charCodeAt(t+d))?f=d:d===0&&(f=0));break}let c=e.charCodeAt(t+d),x=r.charCodeAt(i+d);if(c!==x)break;p(c)&&(f=d)}let u="";for(d=t+f+1;d<=o;++d)(d===o||p(e.charCodeAt(d)))&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(i+f):(i+=f,p(r.charCodeAt(i))&&++i,r.slice(i))}function T(...e){let r="",t="",o=!1;for(let s=e.length-1;s>=-1;s--){let i,{Deno:a}=globalThis;if(s>=0)i=e[s];else if(r){if(typeof a?.env?.get!="function"||typeof a?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");i=a.cwd(),(i===void 0||i.slice(0,3).toLowerCase()!==`${r.toLowerCase()}\\`)&&(i=`${r}\\`)}else{if(typeof a?.cwd!="function")throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");i=a.cwd()}C(i);let n=i.length;if(n===0)continue;let l=0,f="",d=!1,u=i.charCodeAt(0);if(n>1)if(m(u))if(d=!0,m(i.charCodeAt(1))){let c=2,x=c;for(;c<n&&!m(i.charCodeAt(c));++c);if(c<n&&c!==x){let v=i.slice(x,c);for(x=c;c<n&&m(i.charCodeAt(c));++c);if(c<n&&c!==x){for(x=c;c<n&&!m(i.charCodeAt(c));++c);c===n?(f=`\\\\${v}\\${i.slice(x)}`,l=c):c!==x&&(f=`\\\\${v}\\${i.slice(x,c)}`,l=c)}}}else l=1;else R(u)&&i.charCodeAt(1)===58&&(f=i.slice(0,2),l=2,n>2&&m(i.charCodeAt(2))&&(d=!0,l=3));else m(u)&&(l=1,d=!0);if(!(f.length>0&&r.length>0&&f.toLowerCase()!==r.toLowerCase())&&(r.length===0&&f.length>0&&(r=f),o||(t=`${i.slice(l)}\\${t}`,o=d),o&&r.length>0))break}return t=_(t,!o,"\\",m),r+(o?"\\":"")+t||"."}function xe(e,r){z(e,r);let t=T(e),o=T(r);if(t===o||(e=t.toLowerCase(),r=o.toLowerCase(),e===r))return"";let s=0,i=e.length;for(;s<i&&e.charCodeAt(s)===92;++s);for(;i-1>s&&e.charCodeAt(i-1)===92;--i);let a=i-s,n=0,l=r.length;for(;n<l&&r.charCodeAt(n)===92;++n);for(;l-1>n&&r.charCodeAt(l-1)===92;--l);let f=l-n,d=a<f?a:f,u=-1,c=0;for(;c<=d;++c){if(c===d){if(f>d){if(r.charCodeAt(n+c)===92)return o.slice(n+c+1);if(c===2)return o.slice(n+c)}a>d&&(e.charCodeAt(s+c)===92?u=c:c===2&&(u=3));break}let v=e.charCodeAt(s+c),we=r.charCodeAt(n+c);if(v!==we)break;v===92&&(u=c)}if(c!==d&&u===-1)return o;let x="";for(u===-1&&(u=0),c=s+u+1;c<=i;++c)(c===i||e.charCodeAt(c)===92)&&(x.length===0?x+="..":x+="\\..");return x.length>0?x+o.slice(n+u,l):(n+=u,o.charCodeAt(n)===92&&++n,o.slice(n,l))}function Re(e,r){return A?xe(e,r):Ce(e,r)}function ge(...e){return A?T(...e):O(...e)}var be={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},Oe=()=>{let e=r=>({isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink,size:r.size,mtime:r.mtime,atime:r.atime,birthtime:r.birthtime});return{async readFile(r,t){try{return await Deno.readFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async readTextFile(r,t){try{return await Deno.readTextFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async writeFile(r,t,o){await Deno.writeFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async writeTextFile(r,t,o){await Deno.writeTextFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async exists(r){try{return await Deno.stat(r),!0}catch(t){if(t instanceof Deno.errors.NotFound)return!1;throw t}},async stat(r){try{let t=await Deno.stat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async lstat(r){try{let t=await Deno.lstat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async mkdir(r,t){await Deno.mkdir(r,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(r){try{await Deno.mkdir(r,{recursive:!0})}catch(t){if(!(t instanceof Deno.errors.AlreadyExists))throw t}},async remove(r,t){try{await Deno.remove(r,{recursive:t?.recursive??!1})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async*readDir(r){try{for await(let t of Deno.readDir(r))yield{name:t.name,isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink}}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async copyFile(r,t){await Deno.copyFile(r,t)},async rename(r,t){await Deno.rename(r,t)},async makeTempDir(r){return await Deno.makeTempDir({dir:r?.dir,prefix:r?.prefix,suffix:r?.suffix})},async realPath(r){try{return await Deno.realPath(r)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},watch(r,t){let o=t?.recursive??!0,s=Deno.watchFs(r,{recursive:o}),i=a=>({kind:a.kind,paths:a.paths,flag:a.flag});return{close:()=>s.close(),[Symbol.asyncIterator]:async function*(){for await(let a of s)yield i(a)}}},async*walk(r,t){let o=t?.includeDirs??!0,s=t?.includeFiles??!0,i=t?.exts,a=t?.skip,n=async function*(l){for await(let f of Deno.readDir(l)){let d=J(l,f.name);if(!a?.some(u=>u.test(d))){if(f.isDirectory)o&&(yield{path:d,name:f.name,isFile:!1,isDirectory:!0,isSymlink:f.isSymlink}),yield*n(d);else if(f.isFile||f.isSymlink){if(!s||i&&!i.some(u=>f.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:d,name:f.name,isFile:f.isFile,isDirectory:!1,isSymlink:f.isSymlink}}}}};yield*n(r)},async chmod(r,t){let{chmod:o}=await import("./unstable_chmod-RZ5DE3XZ.js");await o(r,t)}}},He=()=>({join:J,resolve:ge,dirname:ie,basename:ee,extname:ae,normalize:de,isAbsolute:me,relative:Re,parse:Ae,format:ce,sep:B,delimiter:re}),ke=()=>({async spawn(e,r=[],t){let o=G(t),i=await new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).output();return{success:i.success,code:i.code,stdout:o.stdout==="piped"?i.stdout:new Uint8Array,stderr:o.stderr==="piped"?i.stderr:new Uint8Array}},async exec(e,r=[],t){let o=await this.spawn(e,r,t);if(!o.success){let s=new TextDecoder().decode(o.stderr);throw new Q(e,o.code,s)}return new TextDecoder().decode(o.stdout).trim()},async execJson(e,r=[],t){let o=await this.exec(e,r,t);return JSON.parse(o)},spawnChild(e,r=[],t){let o=G(t),i=new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).spawn(),a=(n,l)=>l!=="piped"||!n?Promise.resolve(new Uint8Array):new Response(n).arrayBuffer().then(f=>new Uint8Array(f));return{pid:i.pid,stdin:o.stdin==="piped"?i.stdin:null,stdout:o.stdout==="piped"?i.stdout:null,stderr:o.stderr==="piped"?i.stderr:null,status:i.status.then(n=>({success:n.success,code:n.code,signal:n.signal??void 0})),output:async()=>{let n=o.stdout==="piped"?i.stdout:null,l=o.stderr==="piped"?i.stderr:null,[f,d,u]=await Promise.all([i.status,a(n,o.stdout),a(l,o.stderr)]);return{success:f.success,code:f.code,stdout:d,stderr:u}},kill:n=>{i.kill(n)}}}}),Le=()=>({get(e){return Deno.env.get(e)},set(e,r){Deno.env.set(e,r)},delete(e){Deno.env.delete(e)},has(e){return Deno.env.get(e)!==void 0},toObject(){return Deno.env.toObject()}}),Ue=()=>({exit(e){Deno.exit(e)},setExitCode(e){Deno.exitCode=e},cwd(){return Deno.cwd()},chdir(e){Deno.chdir(e)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},argv:he.argv,argv0:he.argv0,args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable,isTerminal(e){try{switch(e){case"stdin":return Deno.stdin.isTerminal();case"stdout":return Deno.stdout.isTerminal();case"stderr":return Deno.stderr.isTerminal()}}catch{return!1}},setStdinRaw(e){Deno.stdin.setRaw(e)}}),Dn=()=>{let e=Oe(),r=He(),t=ke(),o=Le(),s=Ue();return{name:"deno",version:Deno.version.deno,capabilities:be,fs:e,path:r,exec:t,env:o,process:s}};export{be as DENO_CAPABILITIES,Dn as createDenoRuntime};
@@ -0,0 +1,12 @@
1
+ import{a as b,c as O}from"./chunk-OTRBRRIO.js";var V=O((st,Q)=>{var M=1e3,N=M*60,q=N*60,A=q*24,ye=A*7,ge=A*365.25;Q.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return be(e);if(t==="number"&&isFinite(e))return r.long?ve(e):me(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function be(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*ge;case"weeks":case"week":case"w":return t*ye;case"days":case"day":case"d":return t*A;case"hours":case"hour":case"hrs":case"hr":case"h":return t*q;case"minutes":case"minute":case"mins":case"min":case"m":return t*N;case"seconds":case"second":case"secs":case"sec":case"s":return t*M;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function me(e){var r=Math.abs(e);return r>=A?Math.round(e/A)+"d":r>=q?Math.round(e/q)+"h":r>=N?Math.round(e/N)+"m":r>=M?Math.round(e/M)+"s":e+"ms"}function ve(e){var r=Math.abs(e);return r>=A?$(e,r,A,"day"):r>=q?$(e,r,q,"hour"):r>=N?$(e,r,N,"minute"):r>=M?$(e,r,M,"second"):e+" ms"}function $(e,r,t,n){var s=r>=t*1.5;return Math.round(e/t)+" "+n+(s?"s":"")}});var G=O((ot,X)=>{function _e(e){t.debug=t,t.default=t,t.coerce=S,t.disable=C,t.enable=s,t.enabled=y,t.humanize=V(),t.destroy=x,Object.keys(e).forEach(o=>{t[o]=e[o]}),t.names=[],t.skips=[],t.formatters={};function r(o){let i=0;for(let c=0;c<o.length;c++)i=(i<<5)-i+o.charCodeAt(c),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=r;function t(o){let i,c=null,a,v;function l(...d){if(!l.enabled)return;let F=l,_=Number(new Date),j=_-(i||_);F.diff=j,F.prev=i,F.curr=_,i=_,d[0]=t.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let P=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(E,I)=>{if(E==="%%")return"%";P++;let K=t.formatters[I];if(typeof K=="function"){let Ce=d[P];E=K.call(F,Ce),d.splice(P,1),P--}return E}),t.formatArgs.call(F,d),(F.log||t.log).apply(F,d)}return l.namespace=o,l.useColors=t.useColors(),l.color=t.selectColor(o),l.extend=n,l.destroy=t.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(a!==t.namespaces&&(a=t.namespaces,v=t.enabled(o)),v),set:d=>{c=d}}),typeof t.init=="function"&&t.init(l),l}function n(o,i){let c=t(this.namespace+(typeof i>"u"?":":i)+o);return c.log=this.log,c}function s(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];let i=(typeof o=="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let c of i)c[0]==="-"?t.skips.push(c.slice(1)):t.names.push(c)}function u(o,i){let c=0,a=0,v=-1,l=0;for(;c<o.length;)if(a<i.length&&(i[a]===o[c]||i[a]==="*"))i[a]==="*"?(v=a,l=c,a++):(c++,a++);else if(v!==-1)a=v+1,l++,c=l;else return!1;for(;a<i.length&&i[a]==="*";)a++;return a===i.length}function C(){let o=[...t.names,...t.skips.map(i=>"-"+i)].join(",");return t.enable(""),o}function y(o){for(let i of t.skips)if(u(o,i))return!1;for(let i of t.names)if(u(o,i))return!0;return!1}function S(o){return o instanceof Error?o.stack||o.message:o}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}X.exports=_e});var Y=O((p,L)=>{p.formatArgs=Fe;p.save=Oe;p.load=Se;p.useColors=we;p.storage=Pe();p.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();p.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function we(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Fe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+L.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let t=0,n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(n=t))}),e.splice(n,0,r)}p.log=console.debug||console.log||(()=>{});function Oe(e){try{e?p.storage.setItem("debug",e):p.storage.removeItem("debug")}catch{}}function Se(){let e;try{e=p.storage.getItem("debug")||p.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Pe(){try{return localStorage}catch{}}L.exports=G()(p);var{formatters:xe}=L.exports;xe.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});var te=O((f,H)=>{var je=b("tty"),T=b("util");f.init=Be;f.log=Me;f.formatArgs=Ae;f.save=Ne;f.load=qe;f.useColors=Ee;f.destroy=T.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");f.colors=[6,2,3,4,5,1];try{let e=b("supports-color");e&&(e.stderr||e).level>=2&&(f.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}f.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,r)=>{let t=r.substring(6).toLowerCase().replace(/_([a-z])/g,(s,u)=>u.toUpperCase()),n=process.env[r];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[t]=n,e},{});function Ee(){return"colors"in f.inspectOpts?!!f.inspectOpts.colors:je.isatty(process.stderr.fd)}function Ae(e){let{namespace:r,useColors:t}=this;if(t){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),u=` ${s};1m${r} \x1B[0m`;e[0]=u+e[0].split(`
2
+ `).join(`
3
+ `+u),e.push(s+"m+"+H.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Ie()+r+" "+e[0]}function Ie(){return f.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Me(...e){return process.stderr.write(T.formatWithOptions(f.inspectOpts,...e)+`
4
+ `)}function Ne(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function qe(){return process.env.DEBUG}function Be(e){e.inspectOpts={};let r=Object.keys(f.inspectOpts);for(let t=0;t<r.length;t++)e.inspectOpts[r[t]]=f.inspectOpts[r[t]]}H.exports=G()(f);var{formatters:ee}=H.exports;ee.o=function(e){return this.inspectOpts.colors=this.useColors,T.inspect(e,this.inspectOpts).split(`
5
+ `).map(r=>r.trim()).join(" ")};ee.O=function(e){return this.inspectOpts.colors=this.useColors,T.inspect(e,this.inspectOpts)}});var W=O((it,J)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?J.exports=Y():J.exports=te()});var se=O(h=>{"use strict";var De=h&&h.__createBinding||(Object.create?function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,s)}:function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]}),ke=h&&h.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),re=h&&h.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&De(r,e,t);return ke(r,e),r};Object.defineProperty(h,"__esModule",{value:!0});h.req=h.json=h.toBuffer=void 0;var $e=re(b("http")),Le=re(b("https"));async function ne(e){let r=0,t=[];for await(let n of e)r+=n.length,t.push(n);return Buffer.concat(t,r)}h.toBuffer=ne;async function Te(e){let t=(await ne(e)).toString("utf8");try{return JSON.parse(t)}catch(n){let s=n;throw s.message+=` (input: ${t})`,s}}h.json=Te;function He(e,r={}){let n=((typeof e=="string"?e:e.href).startsWith("https:")?Le:$e).request(e,r),s=new Promise((u,C)=>{n.once("response",u).once("error",C).end()});return n.then=s.then.bind(s),n}h.req=He});var ue=O(g=>{"use strict";var ie=g&&g.__createBinding||(Object.create?function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,s)}:function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]}),Re=g&&g.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),ce=g&&g.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&ie(r,e,t);return Re(r,e),r},Ue=g&&g.__exportStar||function(e,r){for(var t in e)t!=="default"&&!Object.prototype.hasOwnProperty.call(r,t)&&ie(r,e,t)};Object.defineProperty(g,"__esModule",{value:!0});g.Agent=void 0;var ze=ce(b("net")),oe=ce(b("http")),Ge=b("https");Ue(se(),g);var w=Symbol("AgentBaseInternalState"),Z=class extends oe.Agent{constructor(r){super(r),this[w]={}}isSecureEndpoint(r){if(r){if(typeof r.secureEndpoint=="boolean")return r.secureEndpoint;if(typeof r.protocol=="string")return r.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
6
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(r){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[r]||(this.sockets[r]=[]);let t=new ze.Socket({writable:!1});return this.sockets[r].push(t),this.totalSocketCount++,t}decrementSockets(r,t){if(!this.sockets[r]||t===null)return;let n=this.sockets[r],s=n.indexOf(t);s!==-1&&(n.splice(s,1),this.totalSocketCount--,n.length===0&&delete this.sockets[r])}getName(r){return this.isSecureEndpoint(r)?Ge.Agent.prototype.getName.call(this,r):super.getName(r)}createSocket(r,t,n){let s={...t,secureEndpoint:this.isSecureEndpoint(t)},u=this.getName(s),C=this.incrementSockets(u);Promise.resolve().then(()=>this.connect(r,s)).then(y=>{if(this.decrementSockets(u,C),y instanceof oe.Agent)try{return y.addRequest(r,s)}catch(S){return n(S)}this[w].currentSocket=y,super.createSocket(r,t,n)},y=>{this.decrementSockets(u,C),n(y)})}createConnection(){let r=this[w].currentSocket;if(this[w].currentSocket=void 0,!r)throw new Error("No socket was returned in the `connect()` function");return r}get defaultPort(){return this[w].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(r){this[w]&&(this[w].defaultPort=r)}get protocol(){return this[w].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(r){this[w]&&(this[w].protocol=r)}};g.Agent=Z});var ae=O(B=>{"use strict";var Je=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(B,"__esModule",{value:!0});B.parseProxyResponse=void 0;var We=Je(W()),R=(0,We.default)("https-proxy-agent:parse-proxy-response");function Ze(e){return new Promise((r,t)=>{let n=0,s=[];function u(){let o=e.read();o?x(o):e.once("readable",u)}function C(){e.removeListener("end",y),e.removeListener("error",S),e.removeListener("readable",u)}function y(){C(),R("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function S(o){C(),R("onerror %o",o),t(o)}function x(o){s.push(o),n+=o.length;let i=Buffer.concat(s,n),c=i.indexOf(`\r
7
+ \r
8
+ `);if(c===-1){R("have not received end of HTTP headers yet..."),u();return}let a=i.slice(0,c).toString("ascii").split(`\r
9
+ `),v=a.shift();if(!v)return e.destroy(),t(new Error("No header received from proxy CONNECT response"));let l=v.split(" "),d=+l[1],F=l.slice(2).join(" "),_={};for(let j of a){if(!j)continue;let P=j.indexOf(":");if(P===-1)return e.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${j}"`));let k=j.slice(0,P).toLowerCase(),E=j.slice(P+1).trimStart(),I=_[k];typeof I=="string"?_[k]=[I,E]:Array.isArray(I)?I.push(E):_[k]=E}R("got proxy server response: %o %o",v,_),C(),r({connect:{statusCode:d,statusText:F,headers:_},buffered:i})}e.on("error",S),e.on("end",y),u()})}B.parseProxyResponse=Ze});var nt=O(m=>{var Ke=m&&m.__createBinding||(Object.create?function(e,r,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(r,t);(!s||("get"in s?!r.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,n,s)}:function(e,r,t,n){n===void 0&&(n=t),e[n]=r[t]}),Qe=m&&m.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),pe=m&&m.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Ke(r,e,t);return Qe(r,e),r},he=m&&m.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(m,"__esModule",{value:!0});m.HttpsProxyAgent=void 0;var U=pe(b("net")),fe=pe(b("tls")),Ve=he(b("assert")),Xe=he(W()),Ye=ue(),et=b("url"),tt=ae(),D=(0,Xe.default)("https-proxy-agent"),le=e=>e.servername===void 0&&e.host&&!U.isIP(e.host)?{...e,servername:e.host}:e,z=class extends Ye.Agent{constructor(r,t){super(t),this.options={path:void 0},this.proxy=typeof r=="string"?new et.URL(r):r,this.proxyHeaders=t?.headers??{},D("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),s=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?de(t,"headers"):null,host:n,port:s}}async connect(r,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let s;n.protocol==="https:"?(D("Creating `tls.Socket`: %o",this.connectOpts),s=fe.connect(le(this.connectOpts))):(D("Creating `net.Socket`: %o",this.connectOpts),s=U.connect(this.connectOpts));let u=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},C=U.isIPv6(t.host)?`[${t.host}]`:t.host,y=`CONNECT ${C}:${t.port} HTTP/1.1\r
10
+ `;if(n.username||n.password){let c=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;u["Proxy-Authorization"]=`Basic ${Buffer.from(c).toString("base64")}`}u.Host=`${C}:${t.port}`,u["Proxy-Connection"]||(u["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let c of Object.keys(u))y+=`${c}: ${u[c]}\r
11
+ `;let S=(0,tt.parseProxyResponse)(s);s.write(`${y}\r
12
+ `);let{connect:x,buffered:o}=await S;if(r.emit("proxyConnect",x),this.emit("proxyConnect",x,r),x.statusCode===200)return r.once("socket",rt),t.secureEndpoint?(D("Upgrading socket connection to TLS"),fe.connect({...de(le(t),"host","path","port"),socket:s})):s;s.destroy();let i=new U.Socket({writable:!1});return i.readable=!0,r.once("socket",c=>{D("Replaying proxy buffer for failed request"),(0,Ve.default)(c.listenerCount("data")>0),c.push(o),c.push(null)}),i}};z.protocols=["http","https"];m.HttpsProxyAgent=z;function rt(e){e.resume()}function de(e,...r){let t={},n;for(n in e)r.includes(n)||(t[n]=e[n]);return t}});export default nt();
@@ -0,0 +1 @@
1
+ import{a as C,d as U}from"./chunk-KJH7Q57A.js";import{c as S}from"./chunk-YK6UG66R.js";import{a as E}from"./chunk-IAR3DEWR.js";import{f,g as h,h as g}from"./chunk-EMHZF6ZY.js";import{c as n,d as i,f as l,g as m,o as d,q as w,r as u}from"./chunk-Y6AFIAJP.js";import{a,b as p}from"./chunk-2N4GTHXQ.js";import{b as c}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var A=async $=>{let e=d({renderer:u.ansi(),sink:w.stdout()}),s=c.process.cwd(),k=h($),t=await f(s,k);if(t.phase!=="EXECUTING")return e.writeln(l(`Cannot complete in phase: ${t.phase}`)),e.writeln(i("Only EXECUTING phase can transition to DONE.")),await e.close(),p({exitCode:1});let r=E(t,"DONE");if(await g(s,r),r.spec!==null&&(await C(s,r.spec,"done"),await U(s,r.spec,"done")),e.writeln(m("\u2714")," Spec completed!"),e.writeln(""),e.writeln(" Spec: ",n(t.spec??"unknown")),e.writeln(` Iterations: ${t.execution.iteration}`),e.writeln(` Decisions: ${t.decisions.length}`),t.decisions.length>0){let o=t.decisions.filter(y=>y.promoted);o.length>0&&e.writeln(i(` Promoted to rules: ${o.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",n(`${S('spec new "..."')}`)),await e.close(),a(void 0)};export{A as main};
@@ -1 +1 @@
1
- import{a as y,b as h,c as k,d as T}from"./chunk-SWYX6WYQ.js";import"./chunk-5MN3MWQN.js";import{a as u,e as p}from"./chunk-OLM5RTFK.js";import"./chunk-DXB73IDG.js";var c=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="gemini";modelId;client;config;constructor(e,t){this.client=e,this.config=t,this.modelId=t.model}async generateText(e,t){let a=C(this.config,e);try{let n=await this.client.models.generateContent({model:this.config.model,...a,config:{...a.config,httpOptions:t!==void 0?{signal:t}:void 0}});return k(n,this.modelId)}catch(n){throw S(n)}}async*streamText(e,t){let a=C(this.config,e);try{let n=await this.client.models.generateContentStream({model:this.config.model,...a,config:{...a.config,httpOptions:t!==void 0?{signal:t}:void 0}}),r=0,i=0;for await(let l of n){let g=l?.candidates??[];if(g.length>0){let f=g[0],R=f?.content?.parts??[];for(let s of R)s.text!==void 0&&(yield{kind:"content_delta",textDelta:s.text}),s.functionCall!==void 0&&(yield{kind:"tool_call_delta",toolCall:{id:s.functionCall.name,name:s.functionCall.name,arguments:s.functionCall.args??{}}});let d=f?.finishReason;if(d!=null){let s=l?.usageMetadata;r=s?.promptTokenCount??r,i=s?.candidatesTokenCount??i;let m="end_turn";d==="MAX_TOKENS"&&(m="max_tokens"),yield{kind:"message_done",stopReason:m,usage:{inputTokens:r,outputTokens:i,totalTokens:r+i}}}}}}catch(n){yield{kind:"error",error:S(n)}}}async close(){}getRawClient(){return this.client}},v={provider:"gemini",async createModel(o){let{GoogleGenAI:e}=await import("./node-RWYXITVV.js"),t=new e({apiKey:o.apiKey});return new c(t,o)}},C=(o,e)=>{let{contents:t,systemInstruction:a}=y(e.messages),n={maxOutputTokens:e.maxTokens??o.maxTokens};e.temperature!==void 0&&(n.temperature=e.temperature),e.topP!==void 0&&(n.topP=e.topP),e.stopWords!==void 0&&(n.stopSequences=e.stopWords),e.responseFormat!==void 0&&e.responseFormat.type==="json_schema"&&(n.responseMimeType="application/json",n.responseSchema=e.responseFormat.jsonSchema),e.thinkingBudget!==void 0&&(n.thinkingConfig={thinkingBudget:e.thinkingBudget});let r={contents:t,config:n},i=e.system??a;return i!=null&&(r.systemInstruction=i),e.tools!==void 0&&(r.tools=h(e.tools)),e.safetySettings!==void 0&&(r.safetySettings=e.safetySettings),r},S=o=>{if(o instanceof u)return o;let e=o instanceof Error?o:new Error(String(o)),t=T(o);return p("gemini",t,e)};export{c as GeminiModel,v as geminiFactory};
1
+ import{a as y,b as h,c as k,d as T}from"./chunk-SWYX6WYQ.js";import"./chunk-5MN3MWQN.js";import{a as u,e as p}from"./chunk-OLM5RTFK.js";import"./chunk-OTRBRRIO.js";var c=class{capabilities=["text_generation","streaming","tool_calling","vision","audio","structured_output","reasoning"];provider="gemini";modelId;client;config;constructor(e,t){this.client=e,this.config=t,this.modelId=t.model}async generateText(e,t){let a=C(this.config,e);try{let n=await this.client.models.generateContent({model:this.config.model,...a,config:{...a.config,httpOptions:t!==void 0?{signal:t}:void 0}});return k(n,this.modelId)}catch(n){throw S(n)}}async*streamText(e,t){let a=C(this.config,e);try{let n=await this.client.models.generateContentStream({model:this.config.model,...a,config:{...a.config,httpOptions:t!==void 0?{signal:t}:void 0}}),r=0,i=0;for await(let l of n){let g=l?.candidates??[];if(g.length>0){let f=g[0],R=f?.content?.parts??[];for(let s of R)s.text!==void 0&&(yield{kind:"content_delta",textDelta:s.text}),s.functionCall!==void 0&&(yield{kind:"tool_call_delta",toolCall:{id:s.functionCall.name,name:s.functionCall.name,arguments:s.functionCall.args??{}}});let d=f?.finishReason;if(d!=null){let s=l?.usageMetadata;r=s?.promptTokenCount??r,i=s?.candidatesTokenCount??i;let m="end_turn";d==="MAX_TOKENS"&&(m="max_tokens"),yield{kind:"message_done",stopReason:m,usage:{inputTokens:r,outputTokens:i,totalTokens:r+i}}}}}}catch(n){yield{kind:"error",error:S(n)}}}async close(){}getRawClient(){return this.client}},v={provider:"gemini",async createModel(o){let{GoogleGenAI:e}=await import("./node-3FTYLC7H.js"),t=new e({apiKey:o.apiKey});return new c(t,o)}},C=(o,e)=>{let{contents:t,systemInstruction:a}=y(e.messages),n={maxOutputTokens:e.maxTokens??o.maxTokens};e.temperature!==void 0&&(n.temperature=e.temperature),e.topP!==void 0&&(n.topP=e.topP),e.stopWords!==void 0&&(n.stopSequences=e.stopWords),e.responseFormat!==void 0&&e.responseFormat.type==="json_schema"&&(n.responseMimeType="application/json",n.responseSchema=e.responseFormat.jsonSchema),e.thinkingBudget!==void 0&&(n.thinkingConfig={thinkingBudget:e.thinkingBudget});let r={contents:t,config:n},i=e.system??a;return i!=null&&(r.systemInstruction=i),e.tools!==void 0&&(r.tools=h(e.tools)),e.safetySettings!==void 0&&(r.safetySettings=e.safetySettings),r},S=o=>{if(o instanceof u)return o;let e=o instanceof Error?o:new Error(String(o)),t=T(o);return p("gemini",t,e)};export{c as GeminiModel,v as geminiFactory};
@@ -0,0 +1 @@
1
+ import{a as T,b as J,e as B,f as N,g as q,h as G,i as U,j as h,k as r,l as y}from"./chunk-73EEM3FY.js";import{a as se,b as ie,c as ne}from"./chunk-VK7L5SMS.js";import{d as Z}from"./chunk-4XOSXARZ.js";import{b as I}from"./chunk-2WH262CW.js";import{a as ee,b as te}from"./chunk-XADY6SXR.js";import{d as oe}from"./chunk-TJZAIUKM.js";import{a as X,c as A,d as Y}from"./chunk-YK6UG66R.js";import{a as W,b as z,h as _,n as H,p as K,r as V,t as Q}from"./chunk-EMHZF6ZY.js";import"./chunk-AGPCY6XP.js";import{a as k}from"./chunk-ERX4HONR.js";import"./chunk-Y6AFIAJP.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as F}from"./chunk-ALZM4JXG.js";import{a as S}from"./chunk-2N4GTHXQ.js";import"./chunk-BBKSV2RO.js";import{b as g}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var me=new F({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-F4XM2EEC.js")},list:{description:"List available AI providers",load:()=>import("./list-3RK7TPGG.js")}}});var re=k;var ye=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},we=[{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"]}],ae=async t=>{let e=[];for(let i of we)for(let o of i.paths)if(await ye(`${t}/${o}`)){e.push(i.id);break}return e};var a=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},le=async(t,e)=>{try{let i=await g.fs.readTextFile(t);return JSON.parse(i)[e]??null}catch{return null}},ve=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=[],i=await le(`${t}/package.json`,"dependencies");return i!==null&&("react"in i&&e.push("react"),"vue"in i&&e.push("vue"),"svelte"in i&&e.push("svelte"),"next"in i&&e.push("nextjs"),"express"in i&&e.push("express"),"hono"in i&&e.push("hono")),e},xe=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},Pe=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await le(`${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},ce=async t=>{let[e,i,o,d]=await Promise.all([ve(t),Ce(t),xe(t),Pe(t)]);return{languages:e,frameworks:i,ci:o,testRunner:d}};var Bt=async t=>{let e=g.process.cwd(),i=ie(t),o=J({target:i==="agent"?"non-interactive":"interactive"}),d=ne(t),w=de(d,"--concerns"),m=de(d,"--tools"),p=d.includes("--non-interactive")||i==="agent";if(await Q(e))return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${A("sync")}\` to regenerate tool files.`),S(void 0);N(o,"noskills init");let D=y(o,"Scanning project...");D.start();let f=await ce(e);D.succeed("Project scanned");for(let s of f.languages)r.step(o,` ${s}`);for(let s of f.frameworks)r.step(o,` ${s}`);for(let s of f.ci)r.step(o,` ${s}`);f.testRunner!==null&&r.step(o,` test runner: ${f.testRunner}`),h(o);let R=y(o,"Detecting coding tools...");R.start();let $=await ae(e),b=se(),M=b!==null&&!$.includes(b)?[b]:[],v=[...new Set([...M,...$])];R.succeed(`${v.length} coding tool(s) detected`);for(let s of v){let n=s===b?" (current)":"";r.step(o,` ${s}${n}`)}let u;if(m!==null){let s=["claude-code","cursor","kiro","copilot","windsurf"],n=m.filter(c=>s.includes(c));u=[...new Set([...M,...n])]}else p?u=[...v]:(h(o),u=await Be(o,v,b));h(o);let E=y(o,"Detecting AI providers...");E.start();let C=(await re()).filter(s=>s.available).map(s=>s.name);E.succeed(`${C.length} provider(s) detected`),h(o);let x=await I(),l;if(w!==null){let s=x.map(n=>n.id);l=w.filter(n=>s.includes(n)).sort((n,c)=>s.indexOf(n)-s.indexOf(c))}else if(p)l=[];else{let s=x.map(c=>({value:c.id,label:c.name,hint:c.description.slice(0,60)})),n=await B(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});l=T(n)?[]:[...n]}l.length>0?r.success(o,` Concerns: ${l.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id> [<id2> ...]`."),h(o);let j=y(o,"Initializing...");j.start(),await V(e);let pe=x.filter(s=>l.includes(s.id));for(let s of pe)await K(e,s);let L=await Y();X(L);let P={...z(l,u,C,f),command:L};await H(e,P);let O=W();if(await _(e,O),j.succeed("Scaffolded `.eser/`"),u.length>0){let s=y(o,"Syncing tool files...");s.start();let n=await te(e,u,P);s.succeed(`Synced ${n.length} tool(s)`)}else r.warn(o,"No tools selected. noskills will work in agentless CLI mode only."),r.info(o,"Add tools later with `noskills sync`.");if(q(o,`Done. ${u.length} tool(s), ${C.length} provider(s), ${l.length} concern(s).`),i==="agent"){let n=(await I()).filter(ge=>l.includes(ge.id)),c=await ee(e),ue=Z(O,n,c,P);await oe(ue,"json")}else G(o),U(o,`Start a spec with: ${A('spec new "..."')}`);return S(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"}],Be=async(t,e,i)=>{let o=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),w=await B(t,{message:o,options:Te.map(p=>({...p,hint:p.value===i?"you're running inside it":d.has(p.value)?"detected":void 0,disabled:p.value===i})),initialValues:[...e],required:!1});if(T(w))return[...e];let m=[...w];return i!==null&&!m.includes(i)&&m.unshift(i),m},de=(t,e)=>{if(t===void 0)return null;for(let i of t)if(i.startsWith(`${e}=`))return i.slice(e.length+1).split(",").map(o=>o.trim()).filter(Boolean);return null};export{Bt as main};
@@ -0,0 +1,10 @@
1
+ import{d as E}from"./chunk-4XOSXARZ.js";import"./chunk-2WH262CW.js";import{a as C}from"./chunk-XADY6SXR.js";import{c as h}from"./chunk-YK6UG66R.js";import{d as g,e as $,m as S,q as D,t as v}from"./chunk-EMHZF6ZY.js";import{a as o}from"./chunk-2N4GTHXQ.js";import{b as n}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var F=new Map([["git stash",["list","show"]],["git tag",["-l","--list","-v","--verify"]],["git branch",["--list","-l","-a","--all","-r","--remotes","-v","--verbose","--contains","--no-contains","--merged","--no-merged"]]]),O=e=>{let s=e.trim();for(let[t,i]of F)if(s.startsWith(t)){let r=s.slice(t.length).trim().split(/\s+/)[0]??"";if(i.includes(r))return!0}return!1};var x=async()=>{let e=n.process.stdin.getReader(),s=[];try{for(;;){let{done:r,value:a}=await e.read();if(r||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,i=new Uint8Array(s.reduce((r,a)=>r+a.length,0));for(let r of s)i.set(r,t),t+=r.length;let l=new TextDecoder().decode(i);try{return JSON.parse(l)}catch{return{}}},T=async e=>{let s=new TextEncoder,t=n.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},L=async e=>{switch(e?.[0]){case"pre-tool-use":return await N();case"stop":return await P();case"post-file-write":return await b();case"post-bash":return await A();case"session-start":return await W();default:return o(void 0)}},N=async()=>{let e=await x(),s=e.tool_name??"unknown",t=e.tool_input??{},i=e.cwd??n.process.cwd(),l=await S(i),r={};try{r=await $(i)}catch{return o(void 0)}let a=async c=>{await T({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${c}`}})};if(s==="Bash"){let c=(t.command??"").trim();if(!(l?.allowGit??!1)){let f=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let w of f){let m="";if(c.startsWith(w))m=c.split(/\s*&&\s*|\s*;\s*/)[0]??c;else if(c.includes(` && ${w}`))m=c.split(/\s*&&\s*/).find(R=>R.trim().startsWith(w))??"";else if(c.includes(`; ${w}`))m=c.split(/\s*;\s*/).find(R=>R.trim().startsWith(w))??"";else continue;if(!O(m.trim()))return await a("git is read-only for agents. The user controls git. You may use `git log`, `git diff`, `git status`, `git show`, `git blame`."),o(void 0)}}return o(void 0)}let p=["Write","Edit","MultiEdit"];if(!p.includes(s))return o(void 0);let k=t.file_path??t.path??"";if(k.includes(".eser/")||k.includes(".claude/"))return o(void 0);let u=r.phase??"UNKNOWN";if(u==="EXECUTING"||u==="IDLE"||u==="DONE"||u==="UNKNOWN"){if(u==="EXECUTING"&&p.includes(s)){let c=`${i}/${g.stateDir}/executor-warned.flag`;try{await n.fs.readTextFile(c)}catch{try{await n.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0}),await n.fs.writeTextFile(c,new Date().toISOString());let d=new TextEncoder,f=n.process.stderr.getWriter();await f.write(d.encode(`noskills: REMINDER \u2014 You should be spawning a noskills-executor sub-agent for implementation work. If you're the main orchestrator agent, delegate to a sub-agent instead of editing directly. If you ARE a sub-agent, ignore this message and continue.
2
+ `)),f.releaseLock()}catch{}}}return o(void 0)}let y={DISCOVERY:`Discovery in progress. Run \`${h("next")}\` to continue.`,DISCOVERY_REVIEW:`Discovery answers need review. Run \`${h('next --answer="approve"')}\` or revise answers.`,SPEC_DRAFT:`Spec needs review. Run \`${h("approve")}\``,SPEC_APPROVED:`Start execution first: \`${h('next --answer="start"')}\``,BLOCKED:`Execution blocked. Resolve with \`${h('next --answer="resolution"')}\``};return await a(y[u]??`Run \`${h("next")}\` first.`),o(void 0)},P=async()=>{let e=await x();if(e.stop_hook_active===!0)return o(void 0);let s=e.cwd??n.process.cwd(),t;try{let d=await n.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(d)}catch{return o(void 0)}if(t.phase!=="EXECUTING")return o(void 0);let i=t.execution??{},l=`${s}/${g.stateDir}/files-changed.jsonl`,r=[];try{let f=(await n.fs.readTextFile(l)).trim().split(`
3
+ `).filter(Boolean);r=[...new Set(f.map(w=>{try{return JSON.parse(w).file}catch{return null}}).filter(w=>w!==null))]}catch{}let a=[],p="no changes";try{let{execSync:d}=await import("node:child_process");a=d("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
4
+ `).filter(Boolean);let m=d("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
5
+ `);p=m[m.length-1]??"no changes"}catch{}let k=[...new Set([...r,...a])],u=(i.iteration??0)+1,y=`${s}/${g.stateDir}/iterations`;try{await n.fs.mkdir(y,{recursive:!0}),await n.fs.writeTextFile(`${y}/iteration-${u}.json`,JSON.stringify({iteration:u,files:k,gitStat:p.trim(),timestamp:new Date().toISOString()},null,2)+`
6
+ `)}catch{}let c=15;try{let d=await S(s);d!==null&&(c=d.maxIterationsBeforeRestart)}catch{}t.execution={...i,iteration:u,modifiedFiles:k,lastProgress:p.trim()||i.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await n.fs.writeTextFile(`${s}/${g.stateFile}`,JSON.stringify(t,null,2)+`
7
+ `)}catch{}try{await n.fs.writeTextFile(l,"")}catch{}try{await n.fs.remove(`${s}/${g.stateDir}/executor-warned.flag`)}catch{}if(u>=c){let d=new TextEncoder,f=n.process.stderr.getWriter();await f.write(d.encode(`noskills: iteration ${u} reached threshold (${c}). Consider starting a fresh conversation.
8
+ `)),f.releaseLock()}return o(void 0)},b=async()=>{let e=await x(),s=e.tool_input??{},t=s.file_path??s.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return o(void 0);let i=e.cwd??n.process.cwd(),l=`${i}/${g.stateDir}/files-changed.jsonl`,r=JSON.stringify({file:t,tool:e.tool_name,ts:new Date().toISOString()});try{await n.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let a="";try{a=await n.fs.readTextFile(l)}catch{}await n.fs.writeTextFile(l,a+r+`
9
+ `)}catch{}return o(void 0)},A=async()=>{let e=await x(),t=(e.tool_input??{}).command??"";if(!t.includes("noskills"))return o(void 0);let i=e.cwd??n.process.cwd(),l=`${i}/${g.stateDir}/noskills-calls.jsonl`,r=JSON.stringify({command:t,ts:new Date().toISOString()});try{await n.fs.mkdir(`${i}/${g.stateDir}`,{recursive:!0});let a="";try{a=await n.fs.readTextFile(l)}catch{}await n.fs.writeTextFile(l,a+r+`
10
+ `)}catch{}return o(void 0)},W=async()=>{let e=n.process.cwd();if(!await v(e))return o(void 0);let s=await $(e),t=await S(e),l=(await D(e)).filter(p=>t!==null&&t.concerns.includes(p.id)),r=await C(e),a=E(s,l,r,t);return await T(a),o(void 0)};export{L as main};
@@ -1,3 +1,3 @@
1
- import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-24SANXOZ.js";import{a as l}from"./chunk-OLM5RTFK.js";import"./chunk-3AZBET4N.js";import"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var k=class{capabilities=["text_generation","streaming"];provider="kiro";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr),t=await T(s.stdout,this.modelId),d=await s.waitForExit(),i=await u,a=f("kiro",d.code,i);if(a!==null)throw a;return t}async*streamText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr);try{let t=new TextDecoder,d=s.stdout.getReader(),i="",a=await d.read();for(;a.done!==!0;){i+=t.decode(a.value,{stream:!0});let x=i.split(`
1
+ import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-7QFOEK3I.js";import{a as l}from"./chunk-OLM5RTFK.js";import"./chunk-BBKSV2RO.js";import"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var k=class{capabilities=["text_generation","streaming"];provider="kiro";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr),t=await T(s.stdout,this.modelId),d=await s.waitForExit(),i=await u,a=f("kiro",d.code,i);if(a!==null)throw a;return t}async*streamText(e,r){let o=v(this.config,e),c=y(e.messages,e.system);o.push("--prompt",c);let s=g(this.binary,o,{signal:r}),u=m(s.stderr);try{let t=new TextDecoder,d=s.stdout.getReader(),i="",a=await d.read();for(;a.done!==!0;){i+=t.decode(a.value,{stream:!0});let x=i.split(`
2
2
  `);i=x.pop()??"";for(let _ of x){let p=_.trim();if(p.length!==0){try{let A=JSON.parse(p),w=C(A);if(w!==null){yield w;continue}}catch{}yield{kind:"content_delta",textDelta:p+`
3
3
  `}}}a=await d.read()}d.releaseLock(),i.trim().length>0&&(yield{kind:"content_delta",textDelta:i.trim()});let E=await s.waitForExit(),b=await u,h=f("kiro",E.code,b);h!==null?yield{kind:"error",error:h}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}catch(t){t instanceof l?yield{kind:"error",error:t}:yield{kind:"error",error:new l(t instanceof Error?t.message:String(t),{provider:"kiro",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},O={provider:"kiro",async createModel(n){let e=await S("kiro",n);return new k(e,n)}},v=(n,e)=>{let r=[];r.push("--output","json"),r.push("--model",n.model),e.maxTokens!==void 0&&r.push("--max-tokens",String(e.maxTokens));let o=n.properties?.args;return o!==void 0&&r.push(...o),r},C=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content"||e.type==="text"){let r=e.text??e.content;return r!==void 0?{kind:"content_delta",textDelta:String(r)}:null}return e.type==="done"||e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new l(e.error?.message??e.message??"Unknown Kiro error",{provider:"kiro"})}:null};export{k as KiroModel,O as kiroFactory};
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-ERX4HONR.js";import{c as t,d as a,g as l,m as n,o,q as m,r as d}from"./chunk-Y6AFIAJP.js";import{a as i}from"./chunk-2N4GTHXQ.js";import"./chunk-BBKSV2RO.js";import"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var $=async b=>{let e=o({renderer:d.ansi(),sink:m.stdout()});e.writeln(t("AI Providers")),e.writeln("");let r=await p(),v=r.map(s=>[s.available?l("\u25CF"):a("\u25CB"),s.available?t(`${s.name} (${s.alias})`):a(`${s.name} (${s.alias})`),a(s.type),s.available?s.detail:a(s.detail)]);e.writeln(n(["","Provider","Type","Status"],v));let u=r.filter(s=>s.available).length;return e.writeln(a(`${u}/${r.length} providers available`)),await e.close(),i(void 0)};export{$ as main};
@@ -0,0 +1 @@
1
+ import{a,b,c,d}from"./chunk-BBKSV2RO.js";import"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";export{b as CommandBuilder,a as CommandError,d as exec,c as parseCommand};
@@ -0,0 +1,2 @@
1
+ import{c as F,d as U,f as V,k as Y}from"./chunk-AGWPQX43.js";import{b as B}from"./chunk-OTRBRRIO.js";function v(u){let o=u.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!o)return;let n=o[2]||o[3]||"",r=n.slice(n.lastIndexOf("\\")+1);return r=r.replace(/%22/g,'"'),r=r.replace(/&#(\d{4});/g,(E,l)=>String.fromCharCode(l)),r}async function z(u,o){if(!/multipart/i.test(o))throw new TypeError("Failed to fetch");let n=o.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let r=new y(n[1]||n[2]),E,l,d,H,e,i,A=[],b=new U,p=s=>{d+=h.decode(s,{stream:!0})},N=s=>{A.push(s)},a=()=>{let s=new F(A,i,{type:e});b.append(H,s)},S=()=>{b.append(H,d)},h=new TextDecoder("utf-8");h.decode(),r.onPartBegin=function(){r.onPartData=p,r.onPartEnd=S,E="",l="",d="",H="",e="",i=null,A.length=0},r.onHeaderField=function(s){E+=h.decode(s,{stream:!0})},r.onHeaderValue=function(s){l+=h.decode(s,{stream:!0})},r.onHeaderEnd=function(){if(l+=h.decode(),E=E.toLowerCase(),E==="content-disposition"){let s=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);s&&(H=s[2]||s[3]||""),i=v(l),i&&(r.onPartData=N,r.onPartEnd=a)}else E==="content-type"&&(e=l);l="",E=""};for await(let s of u)r.write(s);return r.end(),b}var f,t,w,_,O,g,x,m,C,I,M,$,R,y,Z=B(()=>{Y();V();f=0,t={START_BOUNDARY:f++,HEADER_FIELD_START:f++,HEADER_FIELD:f++,HEADER_VALUE_START:f++,HEADER_VALUE:f++,HEADER_VALUE_ALMOST_DONE:f++,HEADERS_ALMOST_DONE:f++,PART_DATA_START:f++,PART_DATA:f++,END:f++},w=1,_={PART_BOUNDARY:w,LAST_BOUNDARY:w*=2},O=10,g=13,x=32,m=45,C=58,I=97,M=122,$=u=>u|32,R=()=>{},y=class{constructor(o){this.index=0,this.flags=0,this.onHeaderEnd=R,this.onHeaderField=R,this.onHeadersEnd=R,this.onHeaderValue=R,this.onPartBegin=R,this.onPartData=R,this.onPartEnd=R,this.boundaryChars={},o=`\r
2
+ --`+o;let n=new Uint8Array(o.length);for(let r=0;r<o.length;r++)n[r]=o.charCodeAt(r),this.boundaryChars[n[r]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=t.START_BOUNDARY}write(o){let n=0,r=o.length,E=this.index,{lookbehind:l,boundary:d,boundaryChars:H,index:e,state:i,flags:A}=this,b=this.boundary.length,p=b-1,N=o.length,a,S,h=c=>{this[c+"Mark"]=n},s=c=>{delete this[c+"Mark"]},D=(c,P,T,k)=>{(P===void 0||P!==T)&&this[c](k&&k.subarray(P,T))},L=(c,P)=>{let T=c+"Mark";T in this&&(P?(D(c,this[T],n,o),delete this[T]):(D(c,this[T],o.length,o),this[T]=0))};for(n=0;n<r;n++)switch(a=o[n],i){case t.START_BOUNDARY:if(e===d.length-2){if(a===m)A|=_.LAST_BOUNDARY;else if(a!==g)return;e++;break}else if(e-1===d.length-2){if(A&_.LAST_BOUNDARY&&a===m)i=t.END,A=0;else if(!(A&_.LAST_BOUNDARY)&&a===O)e=0,D("onPartBegin"),i=t.HEADER_FIELD_START;else return;break}a!==d[e+2]&&(e=-2),a===d[e+2]&&e++;break;case t.HEADER_FIELD_START:i=t.HEADER_FIELD,h("onHeaderField"),e=0;case t.HEADER_FIELD:if(a===g){s("onHeaderField"),i=t.HEADERS_ALMOST_DONE;break}if(e++,a===m)break;if(a===C){if(e===1)return;L("onHeaderField",!0),i=t.HEADER_VALUE_START;break}if(S=$(a),S<I||S>M)return;break;case t.HEADER_VALUE_START:if(a===x)break;h("onHeaderValue"),i=t.HEADER_VALUE;case t.HEADER_VALUE:a===g&&(L("onHeaderValue",!0),D("onHeaderEnd"),i=t.HEADER_VALUE_ALMOST_DONE);break;case t.HEADER_VALUE_ALMOST_DONE:if(a!==O)return;i=t.HEADER_FIELD_START;break;case t.HEADERS_ALMOST_DONE:if(a!==O)return;D("onHeadersEnd"),i=t.PART_DATA_START;break;case t.PART_DATA_START:i=t.PART_DATA,h("onPartData");case t.PART_DATA:if(E=e,e===0){for(n+=p;n<N&&!(o[n]in H);)n+=b;n-=p,a=o[n]}if(e<d.length)d[e]===a?(e===0&&L("onPartData",!0),e++):e=0;else if(e===d.length)e++,a===g?A|=_.PART_BOUNDARY:a===m?A|=_.LAST_BOUNDARY:e=0;else if(e-1===d.length)if(A&_.PART_BOUNDARY){if(e=0,a===O){A&=~_.PART_BOUNDARY,D("onPartEnd"),D("onPartBegin"),i=t.HEADER_FIELD_START;break}}else A&_.LAST_BOUNDARY&&a===m?(D("onPartEnd"),i=t.END,A=0):e=0;if(e>0)l[e-1]=a;else if(E>0){let c=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);D("onPartData",0,E,c),E=0,h("onPartData"),n--}break;case t.END:break;default:throw new Error(`Unexpected state entered: ${i}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=e,this.state=i,this.flags=A}end(){if(this.state===t.HEADER_FIELD_START&&this.index===0||this.state===t.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==t.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});Z();export{z as toFormData};
@@ -0,0 +1,8 @@
1
+ import{b as ee}from"./chunk-VK7L5SMS.js";import{a as H,b as X,c as Y,d as V}from"./chunk-4XOSXARZ.js";import"./chunk-2WH262CW.js";import{a as j}from"./chunk-XADY6SXR.js";import{a as K,b as Z,d as I}from"./chunk-TJZAIUKM.js";import{a as ae}from"./chunk-RYQPPQNO.js";import{a as ce,b as le,c as de,d as ue}from"./chunk-KJH7Q57A.js";import{a as T}from"./chunk-VPXOI7CR.js";import{c as z}from"./chunk-YK6UG66R.js";import{a as te,c as E,d as se,e as ne,f as ie,h as re,j as oe}from"./chunk-IAR3DEWR.js";import{d as L,f as M,g as J,l as Q,m as _,q as G,s as P,t as B}from"./chunk-EMHZF6ZY.js";import{a as U,b as N}from"./chunk-2N4GTHXQ.js";import{b as h}from"./chunk-MNEZ5QGX.js";import"./chunk-DHMCIRLT.js";import"./chunk-4BH6CF3J.js";import"./chunk-OTRBRRIO.js";var fe=r=>r.split(`
2
+ `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ge=async(r,e)=>{let o=[],i=(e.startsWith(r)?e.slice(r.length+1):e).split("/");i.pop();for(let t=i.length;t>=0;t--){let s=`${t===0?r:`${r}/${i.slice(0,t).join("/")}`}/.folder-rules.md`,a=t===0?".":i.slice(0,t).join("/");try{let p=await h.fs.readTextFile(s),u=fe(p);for(let d of u)o.push({folder:a,rule:d})}catch{}}return o},q=async(r,e)=>{let o=new Set,c=[];for(let i of e){let t=await ge(r,i);for(let n of t){let s=`${n.folder}::${n.rule}`;o.has(s)||(o.add(s),c.push(n))}}return c};var Ne=async r=>{let e=h.process.cwd(),o=K(r),c=Z(r);if(!await B(e))return await I({error:`noskills not initialized. Run: ${z("init")}`},o),N({exitCode:1});let i=null;for(let m of c)m.startsWith("--answer=")&&(i=m.slice(9));let t=J(c),n=await M(e,t),s=await _(e);if(s?.command!==void 0){let{setCommandPrefix:m}=await import("./cmd-RST2ZPA6.js");m(s.command)}if(s===null)return await I({error:"No config found"},o),N({exitCode:1});let a=ee(c,s);n.phase==="DISCOVERY"&&n.discovery.audience!==a&&(n={...n,discovery:{...n.discovery,audience:a}});let u=(await G(e)).filter(m=>s.concerns.includes(m.id));if(i!==null){let m=await we(e,n,s,u,i);await P(e,m);let l={...m,lastCalledAt:new Date().toISOString()};await P(e,l);let F=await j(e),S=l.spec!==null?await T(e,l.spec):null,x=await pe(e,l),A=await q(e,x),k=V(l,u,F,s,S,A);return await I(k,o),U(void 0)}let d={...n,lastCalledAt:new Date().toISOString()};await P(e,d);let w=await j(e),v=d.spec!==null?await T(e,d.spec):null,C=await pe(e,d),b=await q(e,C),R;d.phase==="IDLE"&&(R={existingSpecs:(await Q(e)).map(l=>({name:l.name,phase:l.state.phase,iteration:l.state.execution.iteration,detail:l.state.phase==="EXECUTING"?`${l.state.execution.completedTasks.length} tasks done, iteration ${l.state.execution.iteration}`:l.state.phase==="SPEC_DRAFT"?"awaiting approval":l.state.phase==="DONE"?"completed":void 0})),rulesCount:w.length});let D=V(d,u,w,s,v,b,R);return await I(D,o),U(void 0)},we=async(r,e,o,c,i)=>{switch(e.phase){case"DISCOVERY":{let t=e.discovery.audience==="agent",n=null;try{let a=JSON.parse(i);typeof a=="object"&&a!==null&&!Array.isArray(a)&&(t?H.map(d=>d.id).every(d=>d in a)&&(n=a):n=a)}catch{}let s=e;if(n!==null)for(let[a,p]of Object.entries(n))typeof p=="string"&&p.length>0&&(s=E(s,a,p));else{let a=X(c),p=s.discovery.currentQuestion,u=a[p];if(u===void 0)return e;s=E(s,u.id,i),s=ie(s)}return Y(s.discovery.answers)&&(s=se(s)),s}case"DISCOVERY_REVIEW":{if(i.trim().toLowerCase()==="approve")return ne(e);try{let t=JSON.parse(i);if(typeof t.revise=="object"&&t.revise!==null){let n=e;for(let[s,a]of Object.entries(t.revise))typeof a=="string"&&a.length>0&&(n=E(n,s,a));return n}}catch{}return e}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let s=JSON.parse(i);t={involvesWebUI:s.involvesWebUI===!0||s.involvesUI===!0,involvesCLI:s.involvesCLI===!0||s.involvesUI===!0,involvesPublicAPI:s.involvesPublicAPI===!0,involvesMigration:s.involvesMigration===!0,involvesDataHandling:s.involvesDataHandling===!0}}catch{t={involvesWebUI:!1,involvesCLI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let n={...e,classification:t};try{await ae(r,n,c)}catch{}return n}try{let t=JSON.parse(i);if(typeof t.refinement=="string"&&t.refinement.length>0){let n=t.refinement;if(e.spec!==null){let s=`${r}/${L.specFile(e.spec)}`,a=await h.fs.readTextFile(s);if(n.includes("task-")){let u=Se(n).map(v=>`- [ ] ${v}`).join(`
3
+ `),d=/## Tasks\n\n([\s\S]*?)(?=\n## |\n*$)/,w=a.replace(d,`## Tasks
4
+
5
+ ${u}
6
+ `);await h.fs.writeTextFile(s,w)}}return e}}catch{}return e}case"SPEC_APPROVED":{let t=re(e);return t.spec!==null&&(await ce(r,t.spec,"executing"),await ue(r,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:i}};if(o.verifyCommand!==null&&o.verifyCommand!==void 0&&o.verifyCommand.length>0){let n=await ve(r,o.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:n}},!n.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ye(r,e,i,c)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",n={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:i,promoted:!1,timestamp:new Date().toISOString()},s=oe(e,n);return s=te(s,"EXECUTING"),s={...s,execution:{...s.execution,lastProgress:`Resolved: ${i}`}},s}default:return e}},Se=r=>r.split(/(?=task-\d+:)/).map(e=>e.replace(/[,;\n\s]+$/,"").trim()).filter(e=>/^task-\d+:/.test(e)),ye=async(r,e,o,c)=>{let i;try{i=JSON.parse(o)}catch{return{...e,execution:{...e.execution,lastProgress:o,awaitingStatusReport:!1}}}let t=e;if(e.execution.debt!==null&&e.execution.debt.items.length>0&&typeof e.execution.debt.items[0]=="string"){let y=e.execution.debt.items.map((O,me)=>({id:`legacy-${me+1}`,text:O,since:e.execution.debt.fromIteration}));t={...e,execution:{...e.execution,debt:{...e.execution.debt,items:y}}};let $=new TextEncoder,g=h.process.stderr.getWriter();await g.write($.encode(`noskills: migrated legacy string[] debt to DebtItem[] format
7
+ `)),g.releaseLock()}let n=i.completed??[],s=new Set(n),a=i.na??[],p=new Set(a),u=i.newIssues??[],d=i.remaining??[],w=i.blocked??[],v=t.execution.debt?.unaddressedIterations??0,C=t.execution.debt!==null?t.execution.debt.items.filter(f=>!s.has(f.id)&&!p.has(f.id)):[],b=t.execution.debtCounter??0,R=u.map((f,y)=>({id:`debt-${b+y+1}`,text:f,since:t.execution.iteration})),D=[...C,...R],l=d.length===0&&w.length===0&&u.length===0||D.length===0?null:{items:D,fromIteration:t.execution.debt?.fromIteration??t.execution.iteration,unaddressedIterations:C.length>0?v+1:1},F=[...new Set([...t.execution.naItems??[],...a])],S=[];n.length>0&&S.push(`Completed: ${n.join(", ")}`),a.length>0&&S.push(`N/A: ${a.join(", ")}`);let x=S.length>0?S.join("; "):"Status report submitted",A=t.execution.lastVerification===null||t.execution.lastVerification.passed===!0,k=l===null&&A,W=b+u.length;if(k&&t.spec!==null){let f=await T(r,t.spec);if(f!==null){let y=t.execution.completedTasks??[],$=new Set(y),g=f.tasks.find(O=>!$.has(O.id));if(g!==void 0)return await le(r,t.spec,g.id),await de(r,t.spec,g.id,"done"),{...t,execution:{...t.execution,lastProgress:`Task ${g.id} accepted: ${x}`,awaitingStatusReport:!1,debt:l,completedTasks:[...y,g.id],debtCounter:W,naItems:F}}}}return{...t,execution:{...t.execution,lastProgress:k?x:`Task not accepted \u2014 remaining items must be addressed first. ${x}`,awaitingStatusReport:!1,debt:l,debtCounter:W,naItems:F}}},ve=async(r,e)=>{try{let{execSync:o}=await import("node:child_process"),c=o(e,{cwd:r,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(c).slice(0,4e3),timestamp:new Date().toISOString()}}catch(o){let c=o,i=((c.stdout??"")+(c.stderr??"")).slice(0,4e3);return c.status!==void 0?{passed:!1,output:i||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${o instanceof Error?o.message:String(o)}`,timestamp:new Date().toISOString()}}},pe=async(r,e)=>{let o=[...e.execution.modifiedFiles??[]],c=await xe(r);return[...new Set([...o,...c])]},xe=async r=>{let e=`${r}/${L.stateDir}/files-changed.jsonl`;try{let c=(await h.fs.readTextFile(e)).trim().split(`
8
+ `).filter(Boolean),i=[];for(let t of c)try{let n=JSON.parse(t);i.includes(n.file)||i.push(n.file)}catch{}return i}catch{return[]}};export{we as handleAnswer,Ne as main,Se as parseRefinementTasks};