noskills 4.1.34 → 4.1.36

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 (48) hide show
  1. package/README.md +85 -17
  2. package/chunks/{approve-5N5LJ2WQ.js → approve-YXRIBZVV.js} +1 -1
  3. package/chunks/{ask-TR4ZPBU5.js → ask-4XOYE32R.js} +1 -1
  4. package/chunks/block-D67USBJS.js +1 -0
  5. package/chunks/{chunk-AT7V3AKV.js → chunk-24SANXOZ.js} +1 -1
  6. package/chunks/{chunk-PSXXTDLU.js → chunk-2WH262CW.js} +1 -1
  7. package/chunks/{chunk-6C2MLMD6.js → chunk-3AZBET4N.js} +1 -1
  8. package/chunks/{chunk-5ORUHRWF.js → chunk-3HRRWTVF.js} +1 -1
  9. package/chunks/{chunk-TGA7MX5P.js → chunk-42EQ3GZJ.js} +1 -1
  10. package/chunks/{chunk-HLQNHWXS.js → chunk-4ODVKO5Y.js} +1 -1
  11. package/chunks/{chunk-4IFPLK7L.js → chunk-EZH232V7.js} +1 -1
  12. package/chunks/chunk-GOOD5WBA.js +1 -0
  13. package/chunks/{chunk-LZSLKXJE.js → chunk-GSYCN7EG.js} +2 -2
  14. package/chunks/{chunk-RVIPYZ7F.js → chunk-IR75X4G7.js} +1 -1
  15. package/chunks/{chunk-7ADGJB4H.js → chunk-IVSTITPL.js} +1 -1
  16. package/chunks/{chunk-AB4ZUDV6.js → chunk-LG5R766Y.js} +1 -1
  17. package/chunks/{chunk-BLHOTPRB.js → chunk-NTKVTLTO.js} +1 -1
  18. package/chunks/{chunk-ZS6ZJ4YL.js → chunk-O5KQZHIN.js} +1 -1
  19. package/chunks/chunk-UA3VIHYO.js +1 -0
  20. package/chunks/{chunk-OJUA2UZK.js → chunk-WUVVLUU5.js} +1 -1
  21. package/chunks/{chunk-KBNVVXFC.js → chunk-XCVAHUBM.js} +1 -1
  22. package/chunks/{chunk-LICLZJKZ.js → chunk-ZQ77HAFD.js} +1 -1
  23. package/chunks/{claude-code-3XV3QOZJ.js → claude-code-6AAAJZKK.js} +1 -1
  24. package/chunks/concern-4GBYLKWP.js +1 -0
  25. package/chunks/{done-IBA3FUE5.js → done-PTJRZ26W.js} +1 -1
  26. package/chunks/init-PVRN54IZ.js +1 -0
  27. package/chunks/{invoke-hook-AWHCXLLQ.js → invoke-hook-5VXI4CPD.js} +1 -1
  28. package/chunks/{kiro-IXVNKPRT.js → kiro-MHP573OZ.js} +1 -1
  29. package/chunks/{list-UT3MSC6R.js → list-GRXQ2DIM.js} +1 -1
  30. package/chunks/{mod-LUIKS5KC.js → mod-V2Z6HGL6.js} +1 -1
  31. package/chunks/{next-EO3BYTU5.js → next-BZS3EN33.js} +1 -1
  32. package/chunks/{ollama-K4QCYLVL.js → ollama-24ACY3UB.js} +1 -1
  33. package/chunks/{opencode-QBVD5FAD.js → opencode-LFWHRZPL.js} +1 -1
  34. package/chunks/{purge-RKZ7SY3Z.js → purge-JSAHNTXI.js} +1 -1
  35. package/chunks/{reset-VZO7YXM6.js → reset-CWI7K6GC.js} +1 -1
  36. package/chunks/{rule-YVHDEVR2.js → rule-GP665FCC.js} +1 -1
  37. package/chunks/{run-O6SYZE7T.js → run-WLG5XKTM.js} +1 -1
  38. package/chunks/{spec-RTBL43T7.js → spec-JET4WJSV.js} +1 -1
  39. package/chunks/{status-GQYCHJ2W.js → status-EOXWE5UM.js} +1 -1
  40. package/chunks/{sync-JDMWRRGH.js → sync-RWNLL4VW.js} +1 -1
  41. package/chunks/{watch-7DNXJAAQ.js → watch-5OC7T473.js} +1 -1
  42. package/noskills.js +1 -1
  43. package/package.json +1 -1
  44. package/chunks/block-WWW3MXHP.js +0 -1
  45. package/chunks/chunk-HS6FTDDW.js +0 -1
  46. package/chunks/chunk-ZJVSE2FP.js +0 -1
  47. package/chunks/concern-NGOU3XMP.js +0 -1
  48. package/chunks/init-XVNWKPT7.js +0 -1
@@ -1 +1 @@
1
- import{a as i}from"./chunk-HS6FTDDW.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-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};
@@ -0,0 +1 @@
1
+ import{b as I,c as D}from"./chunk-WV3HK5WR.js";import{a as N,b as f}from"./chunk-FDZP7B5Y.js";import{a as m,b as T,c as A,d as S}from"./chunk-ACQUINWH.js";import{d as Y}from"./chunk-DXB73IDG.js";var i=globalThis,Z=()=>typeof i.caches<"u"&&typeof i.Request<"u"&&typeof i.Response<"u"&&typeof i.window>"u"&&typeof i.document>"u",ee=()=>typeof i.window<"u"||typeof i.document<"u",a=()=>{if(typeof globalThis>"u")return"unknown";if(typeof i.Bun<"u")return"bun";if(typeof i.Deno<"u")return"deno";let e=i.process;return e?.versions?.node&&!e?.versions?.bun?"node":Z()?"workerd":ee()?"browser":"unknown"},ne={deno:()=>i.Deno?.version?.deno??"unknown",bun:()=>i.Bun?.version??"unknown",node:()=>i.process?.versions?.node??"unknown",workerd:()=>"unknown",browser:()=>i.navigator?.userAgent??"unknown",unknown:()=>"unknown"},M=()=>ne[a()](),_=e=>a()===e,W=()=>a()==="browser",te=new Set(["deno","node","bun"]),j=()=>te.has(a()),B=()=>a()==="workerd";var oe=e=>{if(typeof Deno<"u"&&Deno.env?.get)return Deno.env.get(e);let n=globalThis.process;if(n?.env)return n.env[e]},x=(...e)=>{for(let n of e){let t=oe(n);if(t!==void 0)return t}},g=e=>{try{let n=globalThis.require;if(n instanceof Function)return n(e)}catch{}},w=()=>globalThis.process,h=()=>globalThis.navigator;var H={darwin:"darwin",linux:"linux",windows:"windows",win32:"windows"},u=()=>{if(typeof Deno<"u"&&Deno.build?.os)return H[Deno.build.os]??"linux";let e=w();if(e?.platform)return H[e.platform]??"linux";let n=h();if(n?.userAgent){let t=n.userAgent.toLowerCase();if(t.includes("mac"))return"darwin";if(t.includes("win"))return"windows";if(t.includes("linux"))return"linux"}return"linux"},L={x86_64:"amd64",x64:"amd64",aarch64:"arm64",arm64:"arm64"},y=()=>{if(typeof Deno<"u"&&Deno.build?.arch)return L[Deno.build.arch]??"amd64";let e=w();if(e?.arch)return L[e.arch]??"amd64";let n=h();if(n?.userAgent){let t=n.userAgent.toLowerCase();if(t.includes("arm64")||t.includes("aarch64"))return"arm64"}return"amd64"},R=()=>{let e=x("HOME","USERPROFILE");if(e)return e;let n=g("os");return n?.homedir?n.homedir():u()==="windows"?"C:\\Users\\Default":"/home"},v=()=>{let e=x("TMPDIR","TMP","TEMP");if(e)return e;let n=g("os");return n?.tmpdir?n.tmpdir():u()==="windows"?"C:\\Windows\\Temp":"/tmp"},U=()=>({platform:u(),arch:y(),homedir:R(),tmpdir:v()});var G={};Y(G,{AlreadyExistsError:()=>A,NotFoundError:()=>T,ProcessError:()=>S,RuntimeCapabilityError:()=>m,buildCommand:()=>P,clearWorkerdEnv:()=>D,createRuntime:()=>J,current:()=>xe,detectExecutionContext:()=>V,detectInvoker:()=>C,detectRuntime:()=>a,getArch:()=>y,getCliCommand:()=>q,getHomedir:()=>R,getPlatform:()=>u,getPlatformInfo:()=>U,getRuntimeVersion:()=>M,getTmpdir:()=>v,isBrowser:()=>W,isCommandInPath:()=>c,isEdge:()=>B,isRuntime:()=>_,isServer:()=>j,populateEnvFromContext:()=>I,posixPath:()=>f,resolvePathDirs:()=>b,runtime:()=>o,searchFileHierarchy:()=>$,toPosix:()=>N});var $=async(e,n,t={})=>{let{searchParents:r=!1}=t,s=e;for(;;){for(let l of n){let p=o.path.join(s,l);if(await o.fs.exists(p)&&(await o.fs.stat(p)).isFile)return p}if(!r)break;let d=o.path.dirname(s);if(d===s)break;s=d}};var k=(e,n)=>()=>{throw new m(e,n)},se=e=>{let n=k("fs",e);return{readFile:n,readTextFile:n,writeFile:n,writeTextFile:n,exists:n,stat:n,lstat:n,mkdir:n,ensureDir:n,remove:n,readDir:n,copyFile:n,rename:n,makeTempDir:n,realPath:n,watch:n,walk:n,chmod:n}},ae=e=>{let n=k("exec",e);return{spawn:n,exec:n,execJson:n,spawnChild:n}},de=e=>{let n=k("process",e);return{exit:n,setExitCode:n,cwd:n,chdir:n,hostname:n,execPath:n,get args(){throw new m("process",e)},get pid(){throw new m("process",e)},get stdin(){throw new m("process",e)},get stdout(){throw new m("process",e)},get stderr(){throw new m("process",e)},isTerminal(){return!1},setStdinRaw(){throw new m("process",e)}}},me=()=>({get:()=>{},set:()=>{},delete:()=>{},has:()=>!1,toObject:()=>({})}),ce=e=>({name:e,version:"unknown",capabilities:{fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},fs:se(e),path:f,exec:ae(e),env:me(),process:de(e)}),ue={deno:async()=>(await import("./deno-5VR3ZY4Z.js")).createDenoRuntime(),node:async()=>(await import("./node-MZTU6BAB.js")).createNodeRuntime(),bun:async()=>(await import("./bun-KVGAHBUF.js")).createBunRuntime(),workerd:async()=>(await import("./workerd-QUMEG65S.js")).createWorkerdRuntime(),browser:async()=>(await import("./browser-JYFQKVFU.js")).createBrowserRuntime()},pe=["fs","exec","env","path","process"],le=e=>e!==void 0&&pe.some(n=>e[n]!==void 0),fe=(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}),J=async e=>{let n=a(),t=ue[n],r=t!==void 0?await t():ce(n),s=e?.capabilities?{...r.capabilities,...e.capabilities}:r.capabilities;return e!==void 0&&le(e)?fe(r,e,s):e?.capabilities?{...r,capabilities:s}:r},o=await J(),xe=o;var b=(e,n)=>{let t=n==="windows"?";":":";return e.split(t).filter(r=>r.length>0)},C=(e,n,t,r,s)=>{if(t)return{invoker:"binary",mode:"installed"};if(n==="bun")return e.BUN_INSTALL!==void 0?{invoker:"bun",mode:"installed"}:{invoker:"bunx",mode:"on-demand"};if(n==="node"){let d=e.npm_execpath??"";return d.includes("npx")?{invoker:"npx",mode:"on-demand"}:d.includes("pnpm")?{invoker:"pnpx",mode:"on-demand"}:(e.npm_config_user_agent??"").includes("pnpm")?{invoker:"pnpm",mode:"installed"}:{invoker:"npm",mode:"installed"}}return n==="deno"?r!==void 0&&(r.startsWith("jsr:")||r.startsWith("https:"))?{invoker:"deno",mode:"on-demand"}:s===!0?{invoker:"dev",mode:"dev"}:{invoker:"deno",mode:"installed"}:{invoker:"unknown",mode:"installed"}},P=(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,c=async e=>{let n=u(),t=n==="windows"?`${e}.exe`:e,r=o.env.get("PATH")??"",s=b(r,n);for(let d of s)try{return await o.fs.stat(o.path.join(d,t)),!0}catch{continue}return!1},q=async e=>await c(e.command)?e.command:await c("npx")?`npx ${e.npmPackage}`:await c("pnpx")?`pnpx ${e.npmPackage}`:await c("bunx")?`bunx ${e.npmPackage}`:await c("deno")?`deno run --allow-all jsr:${e.jsrPackage}`:e.command,V=async e=>{let n=import.meta.filename===void 0,t=a(),r=import.meta.url,s={BUN_INSTALL:o.env.get("BUN_INSTALL"),npm_execpath:o.env.get("npm_execpath"),npm_config_user_agent:o.env.get("npm_config_user_agent")},d=!1;if(t==="deno"&&r.startsWith("file://"))try{let z=o.process.cwd(),Q=o.path.join(z,"deno.json"),X=await o.fs.readTextFile(Q),F=JSON.parse(X).tasks;F!==void 0&&"cli"in F&&(d=!0)}catch{}let{invoker:l,mode:p}=C(s,t,n,r,d),E=n?"compiled":["deno","node","bun"].includes(t)?t:"deno",O=P(l,p,e),K=await c(e.command);return{runtime:E,mode:p,invoker:l,command:O,isInPath:K}};export{q as a,o as b,G as c};
@@ -1,4 +1,4 @@
1
- import{a as T}from"./chunk-HS6FTDDW.js";import{a as tt,c as y,e as Ta}from"./chunk-DXB73IDG.js";var q=y($=>{"use strict";var ts=Symbol.for("yaml.alias"),Bi=Symbol.for("yaml.document"),st=Symbol.for("yaml.map"),Fi=Symbol.for("yaml.pair"),ss=Symbol.for("yaml.scalar"),it=Symbol.for("yaml.seq"),R=Symbol.for("yaml.node.type"),Ca=s=>!!s&&typeof s=="object"&&s[R]===ts,Ia=s=>!!s&&typeof s=="object"&&s[R]===Bi,Pa=s=>!!s&&typeof s=="object"&&s[R]===st,$a=s=>!!s&&typeof s=="object"&&s[R]===Fi,Ki=s=>!!s&&typeof s=="object"&&s[R]===ss,Ma=s=>!!s&&typeof s=="object"&&s[R]===it;function ji(s){if(s&&typeof s=="object")switch(s[R]){case st:case it:return!0}return!1}function Da(s){if(s&&typeof s=="object")switch(s[R]){case ts:case st:case ss:case it:return!0}return!1}var _a=s=>(Ki(s)||ji(s))&&!!s.anchor;$.ALIAS=ts;$.DOC=Bi;$.MAP=st;$.NODE_TYPE=R;$.PAIR=Fi;$.SCALAR=ss;$.SEQ=it;$.hasAnchor=_a;$.isAlias=Ca;$.isCollection=ji;$.isDocument=Ia;$.isMap=Pa;$.isNode=Da;$.isPair=$a;$.isScalar=Ki;$.isSeq=Ma});var ve=y(is=>{"use strict";var P=q(),M=Symbol("break visit"),Ri=Symbol("skip children"),K=Symbol("remove node");function nt(s,e){let t=Ui(e);P.isDocument(s)?ce(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):ce(null,s,t,Object.freeze([]))}nt.BREAK=M;nt.SKIP=Ri;nt.REMOVE=K;function ce(s,e,t,i){let n=Yi(s,e,t,i);if(P.isNode(n)||P.isPair(n))return xi(s,i,n),ce(s,n,t,i);if(typeof n!="symbol"){if(P.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=ce(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){i=Object.freeze(i.concat(e));let r=ce("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=ce("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}async function rt(s,e){let t=Ui(e);P.isDocument(s)?await fe(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):await fe(null,s,t,Object.freeze([]))}rt.BREAK=M;rt.SKIP=Ri;rt.REMOVE=K;async function fe(s,e,t,i){let n=await Yi(s,e,t,i);if(P.isNode(n)||P.isPair(n))return xi(s,i,n),fe(s,n,t,i);if(typeof n!="symbol"){if(P.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=await fe(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){i=Object.freeze(i.concat(e));let r=await fe("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=await fe("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}function Ui(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Yi(s,e,t,i){if(typeof t=="function")return t(s,e,i);if(P.isMap(e))return t.Map?.(s,e,i);if(P.isSeq(e))return t.Seq?.(s,e,i);if(P.isPair(e))return t.Pair?.(s,e,i);if(P.isScalar(e))return t.Scalar?.(s,e,i);if(P.isAlias(e))return t.Alias?.(s,e,i)}function xi(s,e,t){let i=e[e.length-1];if(P.isCollection(i))i.items[s]=t;else if(P.isPair(i))s==="key"?i.key=t:i.value=t;else if(P.isDocument(i))i.contents=t;else{let n=P.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}is.visit=nt;is.visitAsync=rt});var ns=y(Vi=>{"use strict";var Ji=q(),Ba=ve(),Fa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ka=s=>s.replace(/[!,[\]{}]/g,e=>Fa[e]),ke=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,a]=i;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let a=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,a),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(a){return t(String(a)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Ka(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&Ji.isNode(e.contents)){let r={};Ba.visit(e.contents,(a,o)=>{Ji.isNode(o)&&o.tag&&(r[o.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,a]of i)r==="!!"&&a==="tag:yaml.org,2002:"||(!e||n.some(o=>o.startsWith(a)))&&t.push(`%TAG ${r} ${a}`);return t.join(`
1
+ import{b as T}from"./chunk-UA3VIHYO.js";import{a as tt,c as y,e as Ta}from"./chunk-DXB73IDG.js";var q=y($=>{"use strict";var ts=Symbol.for("yaml.alias"),Bi=Symbol.for("yaml.document"),st=Symbol.for("yaml.map"),Fi=Symbol.for("yaml.pair"),ss=Symbol.for("yaml.scalar"),it=Symbol.for("yaml.seq"),R=Symbol.for("yaml.node.type"),Ca=s=>!!s&&typeof s=="object"&&s[R]===ts,Ia=s=>!!s&&typeof s=="object"&&s[R]===Bi,Pa=s=>!!s&&typeof s=="object"&&s[R]===st,$a=s=>!!s&&typeof s=="object"&&s[R]===Fi,Ki=s=>!!s&&typeof s=="object"&&s[R]===ss,Ma=s=>!!s&&typeof s=="object"&&s[R]===it;function ji(s){if(s&&typeof s=="object")switch(s[R]){case st:case it:return!0}return!1}function Da(s){if(s&&typeof s=="object")switch(s[R]){case ts:case st:case ss:case it:return!0}return!1}var _a=s=>(Ki(s)||ji(s))&&!!s.anchor;$.ALIAS=ts;$.DOC=Bi;$.MAP=st;$.NODE_TYPE=R;$.PAIR=Fi;$.SCALAR=ss;$.SEQ=it;$.hasAnchor=_a;$.isAlias=Ca;$.isCollection=ji;$.isDocument=Ia;$.isMap=Pa;$.isNode=Da;$.isPair=$a;$.isScalar=Ki;$.isSeq=Ma});var ve=y(is=>{"use strict";var P=q(),M=Symbol("break visit"),Ri=Symbol("skip children"),K=Symbol("remove node");function nt(s,e){let t=Ui(e);P.isDocument(s)?ce(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):ce(null,s,t,Object.freeze([]))}nt.BREAK=M;nt.SKIP=Ri;nt.REMOVE=K;function ce(s,e,t,i){let n=Yi(s,e,t,i);if(P.isNode(n)||P.isPair(n))return xi(s,i,n),ce(s,n,t,i);if(typeof n!="symbol"){if(P.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=ce(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){i=Object.freeze(i.concat(e));let r=ce("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=ce("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}async function rt(s,e){let t=Ui(e);P.isDocument(s)?await fe(null,s.contents,t,Object.freeze([s]))===K&&(s.contents=null):await fe(null,s,t,Object.freeze([]))}rt.BREAK=M;rt.SKIP=Ri;rt.REMOVE=K;async function fe(s,e,t,i){let n=await Yi(s,e,t,i);if(P.isNode(n)||P.isPair(n))return xi(s,i,n),fe(s,n,t,i);if(typeof n!="symbol"){if(P.isCollection(e)){i=Object.freeze(i.concat(e));for(let r=0;r<e.items.length;++r){let a=await fe(r,e.items[r],t,i);if(typeof a=="number")r=a-1;else{if(a===M)return M;a===K&&(e.items.splice(r,1),r-=1)}}}else if(P.isPair(e)){i=Object.freeze(i.concat(e));let r=await fe("key",e.key,t,i);if(r===M)return M;r===K&&(e.key=null);let a=await fe("value",e.value,t,i);if(a===M)return M;a===K&&(e.value=null)}}return n}function Ui(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Yi(s,e,t,i){if(typeof t=="function")return t(s,e,i);if(P.isMap(e))return t.Map?.(s,e,i);if(P.isSeq(e))return t.Seq?.(s,e,i);if(P.isPair(e))return t.Pair?.(s,e,i);if(P.isScalar(e))return t.Scalar?.(s,e,i);if(P.isAlias(e))return t.Alias?.(s,e,i)}function xi(s,e,t){let i=e[e.length-1];if(P.isCollection(i))i.items[s]=t;else if(P.isPair(i))s==="key"?i.key=t:i.value=t;else if(P.isDocument(i))i.contents=t;else{let n=P.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}is.visit=nt;is.visitAsync=rt});var ns=y(Vi=>{"use strict";var Ji=q(),Ba=ve(),Fa={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ka=s=>s.replace(/[!,[\]{}]/g,e=>Fa[e]),ke=class s{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},s.defaultYaml,e),this.tags=Object.assign({},s.defaultTags,t)}clone(){let e=new s(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new s(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:s.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},s.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:s.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},s.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[r,a]=i;return this.tags[r]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[r]=i;if(r==="1.1"||r==="1.2")return this.yaml.version=r,!0;{let a=/^\d+\.\d+$/.test(r);return t(6,`Unsupported YAML version ${r}`,a),!1}}default:return t(0,`Unknown directive ${n}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||t(`The ${e} tag has no suffix`);let r=this.tags[i];if(r)try{return r+decodeURIComponent(n)}catch(a){return t(String(a)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Ka(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&Ji.isNode(e.contents)){let r={};Ba.visit(e.contents,(a,o)=>{Ji.isNode(o)&&o.tag&&(r[o.tag]=!0)}),n=Object.keys(r)}else n=[];for(let[r,a]of i)r==="!!"&&a==="tag:yaml.org,2002:"||(!e||n.some(o=>o.startsWith(a)))&&t.push(`%TAG ${r} ${a}`);return t.join(`
2
2
  `)}};ke.defaultYaml={explicit:!1,version:"1.2"};ke.defaultTags={"!!":"tag:yaml.org,2002:"};Vi.Directives=ke});var at=y(Ne=>{"use strict";var Gi=q(),ja=ve();function Ra(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function Wi(s){let e=new Set;return ja.visit(s,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function Qi(s,e){for(let t=1;;++t){let i=`${s}${t}`;if(!e.has(i))return i}}function Ua(s,e){let t=[],i=new Map,n=null;return{onAnchor:r=>{t.push(r),n??(n=Wi(s));let a=Qi(e,n);return n.add(a),a},setAnchors:()=>{for(let r of t){let a=i.get(r);if(typeof a=="object"&&a.anchor&&(Gi.isScalar(a.node)||Gi.isCollection(a.node)))a.node.anchor=a.anchor;else{let o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=r,o}}},sourceObjects:i}}Ne.anchorIsValid=Ra;Ne.anchorNames=Wi;Ne.createNodeAnchors=Ua;Ne.findNewAnchor=Qi});var rs=y(Hi=>{"use strict";function Ae(s,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let a=i[n],o=Ae(s,i,String(n),a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=Ae(s,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=Ae(s,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=Ae(s,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}return s.call(e,t,i)}Hi.applyReviver=Ae});var J=y(zi=>{"use strict";var Ya=q();function Xi(s,e,t){if(Array.isArray(s))return s.map((i,n)=>Xi(i,String(n),t));if(s&&typeof s.toJSON=="function"){if(!t||!Ya.hasAnchor(s))return s.toJSON(e,t);let i={aliasCount:0,count:1,res:void 0};t.anchors.set(s,i),t.onCreate=r=>{i.res=r,delete t.onCreate};let n=s.toJSON(e,t);return t.onCreate&&t.onCreate(n),n}return typeof s=="bigint"&&!t?.keep?Number(s):s}zi.toJS=Xi});var ot=y(en=>{"use strict";var xa=rs(),Zi=q(),Ja=J(),as=class{constructor(e){Object.defineProperty(this,Zi.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:n,reviver:r}={}){if(!Zi.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},o=Ja.toJS(this,"",a);if(typeof n=="function")for(let{count:l,res:c}of a.anchors.values())n(c,l);return typeof r=="function"?xa.applyReviver(r,{"":o},"",o):o}};en.NodeBase=as});var qe=y(tn=>{"use strict";var Va=at(),Ga=ve(),ue=q(),Wa=ot(),Qa=J(),os=class extends Wa.NodeBase{constructor(e){super(ue.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],Ga.visit(e,{Node:(r,a)=>{(ue.isAlias(a)||ue.hasAnchor(a))&&i.push(a)}}),t&&(t.aliasResolveCache=i));let n;for(let r of i){if(r===this)break;r.anchor===this.source&&(n=r)}return n}toJSON(e,t){if(!t)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:r}=t,a=this.resolve(n,t);if(!a){let l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let o=i.get(a);if(o||(Qa.toJS(a,null,t),o=i.get(a)),o?.res===void 0){let l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(r>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=lt(n,a,i)),o.count*o.aliasCount>r)){let l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return o.res}toString(e,t,i){let n=`*${this.source}`;if(e){if(Va.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(r)}if(e.implicitKey)return`${n} `}return n}};function lt(s,e,t){if(ue.isAlias(e)){let i=e.resolve(s),n=t&&i&&t.get(i);return n?n.count*n.aliasCount:0}else if(ue.isCollection(e)){let i=0;for(let n of e.items){let r=lt(s,n,t);r>i&&(i=r)}return i}else if(ue.isPair(e)){let i=lt(s,e.key,t),n=lt(s,e.value,t);return Math.max(i,n)}return 1}tn.Alias=os});var L=y(ls=>{"use strict";var Ha=q(),Xa=ot(),za=J(),Za=s=>!s||typeof s!="function"&&typeof s!="object",V=class extends Xa.NodeBase{constructor(e){super(Ha.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:za.toJS(this.value,e,t)}toString(){return String(this.value)}};V.BLOCK_FOLDED="BLOCK_FOLDED";V.BLOCK_LITERAL="BLOCK_LITERAL";V.PLAIN="PLAIN";V.QUOTE_DOUBLE="QUOTE_DOUBLE";V.QUOTE_SINGLE="QUOTE_SINGLE";ls.Scalar=V;ls.isScalarValue=Za});var Oe=y(nn=>{"use strict";var eo=qe(),te=q(),sn=L(),to="tag:yaml.org,2002:";function so(s,e,t){if(e){let i=t.filter(r=>r.tag===e),n=i.find(r=>!r.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return t.find(i=>i.identify?.(s)&&!i.format)}function io(s,e,t){if(te.isDocument(s)&&(s=s.contents),te.isNode(s))return s;if(te.isPair(s)){let f=t.schema[te.MAP].createNode?.(t.schema,null,t);return f.items.push(s),f}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:r,schema:a,sourceObjects:o}=t,l;if(i&&s&&typeof s=="object"){if(l=o.get(s),l)return l.anchor??(l.anchor=n(s)),new eo.Alias(l.anchor);l={anchor:null,node:null},o.set(s,l)}e?.startsWith("!!")&&(e=to+e.slice(2));let c=so(s,e,a.tags);if(!c){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){let f=new sn.Scalar(s);return l&&(l.node=f),f}c=s instanceof Map?a[te.MAP]:Symbol.iterator in Object(s)?a[te.SEQ]:a[te.MAP]}r&&(r(c),delete t.onTagObj);let d=c?.createNode?c.createNode(t.schema,s,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,s,t):new sn.Scalar(s);return e?d.tag=e:c.default||(d.tag=c.tag),l&&(l.node=d),d}nn.createNode=io});var ft=y(ct=>{"use strict";var no=Oe(),j=q(),ro=ot();function cs(s,e,t){let i=t;for(let n=e.length-1;n>=0;--n){let r=e[n];if(typeof r=="number"&&Number.isInteger(r)&&r>=0){let a=[];a[r]=i,i=a}else i=new Map([[r,i]])}return no.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}var rn=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done,fs=class extends ro.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>j.isNode(i)||j.isPair(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(rn(e))this.add(t);else{let[i,...n]=e,r=this.get(i,!0);if(j.isCollection(r))r.addIn(n,t);else if(r===void 0&&this.schema)this.set(i,cs(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[t,...i]=e;if(i.length===0)return this.delete(t);let n=this.get(t,!0);if(j.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){let[i,...n]=e,r=this.get(i,!0);return n.length===0?!t&&j.isScalar(r)?r.value:r:j.isCollection(r)?r.getIn(n,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!j.isPair(t))return!1;let i=t.value;return i==null||e&&j.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[t,...i]=e;if(i.length===0)return this.has(t);let n=this.get(t,!0);return j.isCollection(n)?n.hasIn(i):!1}setIn(e,t){let[i,...n]=e;if(n.length===0)this.set(i,t);else{let r=this.get(i,!0);if(j.isCollection(r))r.setIn(n,t);else if(r===void 0&&this.schema)this.set(i,cs(this.schema,n,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};ct.Collection=fs;ct.collectionFromPath=cs;ct.isEmptyPath=rn});var Ee=y(ut=>{"use strict";var ao=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function us(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}var oo=(s,e,t)=>s.endsWith(`
3
3
  `)?us(t,e):t.includes(`
4
4
  `)?`
@@ -1,3 +1,3 @@
1
- import{d as o}from"./chunk-OJUA2UZK.js";import{a as e}from"./chunk-HS6FTDDW.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-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)+`
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};
@@ -1,4 +1,4 @@
1
- import{d as h}from"./chunk-OJUA2UZK.js";import{a as i}from"./chunk-HS6FTDDW.js";var d="<!-- noskills:start -->",u="<!-- noskills:end -->",w=(t,s,o="npx eser noskills")=>{let e=[d,"## 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","",` ${o} next # get current instruction`,` ${o} next --answer="your response" # submit result and advance`,"","### When to call noskills next","",`You MUST call \`${o} 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((s?.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: \`${o} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### 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 n of t)e.push(`- ${n}`)}return e.push(u),e.join(`
1
+ import{d as h}from"./chunk-WUVVLUU5.js";import{b as i}from"./chunk-UA3VIHYO.js";var d="<!-- noskills:start -->",u="<!-- noskills:end -->",w=(t,s,o="npx eser noskills")=>{let e=[d,"## 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","",` ${o} next # get current instruction`,` ${o} next --answer="your response" # submit result and advance`,"","### When to call noskills next","",`You MUST call \`${o} 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((s?.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: \`${o} rule add`,'"<description>"`. If just this task, note it and move on.',"Never write to `.eser/rules/` directly.","","### 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 n of t)e.push(`- ${n}`)}return e.push(u),e.join(`
2
2
  `)},m=async(t,s,o,e="npx eser noskills")=>{let n=`${t}/CLAUDE.md`,a=w(s,o,e),r;try{r=await i.fs.readTextFile(n);let l=r.indexOf(d),c=r.indexOf(u);l!==-1&&c!==-1?r=r.slice(0,l)+a+r.slice(c+u.length):r=r.trimEnd()+`
3
3
 
4
4
  `+a+`
@@ -1 +1 @@
1
- import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-AT7V3AKV.js";import{a as c}from"./chunk-OLM5RTFK.js";import"./chunk-6C2MLMD6.js";import"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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};
1
+ import{a as k,b as p,c as h,e as m,f as u,g as f}from"./chunk-24SANXOZ.js";import{a as c}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 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{b as A}from"./chunk-2WH262CW.js";import{a as b,b as $}from"./chunk-UXRWSNVZ.js";import{k as C,l as y,m as x,n as P}from"./chunk-WUVVLUU5.js";import{c as d,d as a,f as u,g as k,o as w,q as g,r as v}from"./chunk-EZH232V7.js";import{a as l,b as p}from"./chunk-2N4GTHXQ.js";import{b as m}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var q=async r=>{let e=r?.[0];if(e==="add")return await I(r?.slice(1));if(e==="remove")return await M(r?.slice(1));if(e==="list")return await R();let t=await C(m.process.cwd()),s=$(t),n=w({renderer:v.ansi(),sink:g.stdout()});return n.writeln(`Usage: ${s} concern <add <id> | remove <id> | list>`),await n.close(),l(void 0)},I=async r=>{let e=w({renderer:v.ansi(),sink:g.stdout()}),t=m.process.cwd(),s=(r??[]).filter(i=>!i.startsWith("-")),n=await C(t);if(s.length===0)return e.writeln(u("Please provide concern ID(s): "),d(b("concern add open-source beautiful-product",n))),await e.close(),p({exitCode:1});if(n===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});let c=await A(),o=[];for(let i of s){let f=await x(t,i);if(f===null&&(f=c.find(h=>h.id===i)??null,f!==null&&await P(t,f)),f===null){e.writeln(u(`Unknown concern: ${i}`)),e.writeln(a(` Available: ${c.map(h=>h.id).join(", ")}`));continue}if(n.concerns.includes(i)||o.includes(i)){e.writeln(a(`Concern "${i}" is already active.`));continue}o.push(i)}if(o.length>0){let i={...n,concerns:[...n.concerns,...o]};await y(t,i),e.writeln(k("\u2714"),` Activated concerns: ${o.join(", ")}`)}return await e.close(),l(void 0)},M=async r=>{let e=w({renderer:v.ansi(),sink:g.stdout()}),t=m.process.cwd(),s=r?.[0],n=await C(t);if(s===void 0||s.length===0)return e.writeln(u("Please provide a concern ID: "),d(b("concern remove move-fast",n))),await e.close(),p({exitCode:1});if(n===null)return e.writeln(u("noskills not initialized.")),await e.close(),p({exitCode:1});if(!n.concerns.includes(s))return e.writeln(a(`Concern "${s}" is not active.`)),await e.close(),l(void 0);let c={...n,concerns:n.concerns.filter(o=>o!==s)};return await y(t,c),e.writeln(k("\u2714")," Deactivated concern: ",d(s)),await e.close(),l(void 0)},R=async()=>{let r=w({renderer:v.ansi(),sink:g.stdout()}),e=m.process.cwd(),t=await C(e),s=await A(),n=t?.concerns??[];if(r.writeln(d("Concerns")),r.writeln(""),s.length===0)r.writeln(a(" No concerns defined."));else for(let c of s){let o=n.includes(c.id);r.writeln(" ",o?k("\u25CF"):a("\u25CB")," ",o?d(c.id):a(c.id),a(` ${c.description.slice(0,60)}...`))}return await r.close(),l(void 0)};export{q as main};
@@ -1 +1 @@
1
- import{a as C,d as U}from"./chunk-KBNVVXFC.js";import{a as E}from"./chunk-HLQNHWXS.js";import{a as S}from"./chunk-UXRWSNVZ.js";import{e as f,f as h,k as g}from"./chunk-OJUA2UZK.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-4IFPLK7L.js";import{a as o,b as p}from"./chunk-2N4GTHXQ.js";import{a as c}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var G=async y=>{let e=d({renderer:u.ansi(),sink:w.stdout()}),s=c.process.cwd(),t=await f(s),$=await g(s);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 h(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 a=t.decisions.filter(k=>k.promoted);a.length>0&&e.writeln(i(` Promoted to rules: ${a.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",n(`${S('spec new "..."',$)}`)),await e.close(),o(void 0)};export{G as main};
1
+ import{a as C,d as U}from"./chunk-XCVAHUBM.js";import{a as E}from"./chunk-4ODVKO5Y.js";import{a as S}from"./chunk-UXRWSNVZ.js";import{e as f,f as h,k as g}from"./chunk-WUVVLUU5.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-EZH232V7.js";import{a as o,b as p}from"./chunk-2N4GTHXQ.js";import{b as c}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var G=async y=>{let e=d({renderer:u.ansi(),sink:w.stdout()}),s=c.process.cwd(),t=await f(s),$=await g(s);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 h(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 a=t.decisions.filter(k=>k.promoted);a.length>0&&e.writeln(i(` Promoted to rules: ${a.length}`))}return e.writeln(""),e.writeln("Start a new spec with: ",n(`${S('spec new "..."',$)}`)),await e.close(),o(void 0)};export{G as main};
@@ -0,0 +1 @@
1
+ import{a as ee,b as te,c as oe}from"./chunk-O5KQZHIN.js";import{a as S,b as J,e as T,f as N,g as q,h as r,i as h}from"./chunk-LG5R766Y.js";import{a as Q}from"./chunk-GOOD5WBA.js";import{a as X,b as Y}from"./chunk-ZQ77HAFD.js";import"./chunk-AGPCY6XP.js";import{a as k}from"./chunk-IR75X4G7.js";import{d as Z}from"./chunk-42EQ3GZJ.js";import"./chunk-NTKVTLTO.js";import{b as B}from"./chunk-2WH262CW.js";import{a as I}from"./chunk-UXRWSNVZ.js";import{a as G,b as U,f as W,k as z,l as _,n as H,p as K,r as V}from"./chunk-WUVVLUU5.js";import"./chunk-EZH232V7.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as F}from"./chunk-GSYCN7EG.js";import{a as P}from"./chunk-2N4GTHXQ.js";import"./chunk-3AZBET4N.js";import{a as O,b as g}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var pe=new F({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-4XOYE32R.js")},list:{description:"List available AI providers",load:()=>import("./list-GRXQ2DIM.js")}}});var se=k;var me=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},fe=[{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"]}],ne=async t=>{let e=[];for(let n of fe)for(let o of n.paths)if(await me(`${t}/${o}`)){e.push(n.id);break}return e};var a=async t=>{try{return await g.fs.stat(t),!0}catch{return!1}},ie=async(t,e)=>{try{let n=await g.fs.readTextFile(t);return JSON.parse(n)[e]??null}catch{return null}},ye=async t=>{let e=[];return(await a(`${t}/package.json`)||await a(`${t}/deno.json`))&&e.push("typescript"),await a(`${t}/go.mod`)&&e.push("go"),await a(`${t}/Cargo.toml`)&&e.push("rust"),(await a(`${t}/pyproject.toml`)||await a(`${t}/setup.py`))&&e.push("python"),e},we=async t=>{let e=[],n=await ie(`${t}/package.json`,"dependencies");return n!==null&&("react"in n&&e.push("react"),"vue"in n&&e.push("vue"),"svelte"in n&&e.push("svelte"),"next"in n&&e.push("nextjs"),"express"in n&&e.push("express"),"hono"in n&&e.push("hono")),e},be=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},ve=async t=>{if(await a(`${t}/deno.json`))return"deno";let e=await ie(`${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},re=async t=>{let[e,n,o,d]=await Promise.all([ye(t),we(t),be(t),ve(t)]);return{languages:e,frameworks:n,ci:o,testRunner:d}};var St=async t=>{let e=g.process.cwd(),n=te(t),o=J({target:n==="agent"?"non-interactive":"interactive"}),d=oe(t),y=ae(d,"--concerns"),m=ae(d,"--tools"),p=d.includes("--non-interactive")||n==="agent";if(await V(e)){let s=await z(e);return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${I("sync",s)}\` to regenerate tool files.`),P(void 0)}N(o,"noskills init");let $=h(o,"Scanning project...");$.start();let f=await re(e);$.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}`);let A=h(o,"Detecting coding tools...");A.start();let R=await ne(e),w=ee(),D=w!==null&&!R.includes(w)?[w]:[],b=[...new Set([...D,...R])];A.succeed(`${b.length} coding tool(s) detected`);for(let s of b){let i=s===w?" (current)":"";r.step(o,` ${s}${i}`)}let u;if(m!==null){let s=["claude-code","cursor","kiro","copilot","windsurf"],i=m.filter(c=>s.includes(c));u=[...new Set([...D,...i])]}else p?u=[...b]:u=await Pe(o,b,w);let M=h(o,"Detecting AI providers...");M.start();let C=(await se()).filter(s=>s.available).map(s=>s.name);M.succeed(`${C.length} provider(s) detected`);let x=await B(),l;if(y!==null){let s=x.map(i=>i.id);l=y.filter(i=>s.includes(i)).sort((i,c)=>s.indexOf(i)-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)})),i=await T(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});l=S(i)?[]:[...i]}l.length>0?r.success(o,`Concerns: ${l.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id>`.");let E=await Se(),j=h(o,"Initializing...");j.start(),await K(e);let le=x.filter(s=>l.includes(s.id));for(let s of le)await H(e,s);let v={...U(l,u,C,f),command:E};await _(e,v);let L=G();if(await W(e,L),j.succeed("Scaffolded `.eser/`"),u.length>0){let s=h(o,"Syncing tool files...");s.start();let i=await Y(e,u,v);s.succeed(`Synced ${i.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(r.success(o,`Done. ${u.length} tool(s), ${C.length} provider(s), ${l.length} concern(s).`),r.info(o,`Command prefix: ${E}`),n==="agent"){let i=(await B()).filter(de=>l.includes(de.id)),c=await X(e),ce=Q(L,i,c,v);await Z(ce,"json")}else q(o,`Start a spec with: ${I('spec new "..."',v)}`);return P(void 0)},xe=[{value:"claude-code",label:"Claude Code"},{value:"cursor",label:"Cursor"},{value:"kiro",label:"Kiro"},{value:"copilot",label:"GitHub Copilot"},{value:"windsurf",label:"Windsurf"}],Pe=async(t,e,n)=>{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),y=await T(t,{message:o,options:xe.map(p=>({...p,hint:p.value===n?"you're running inside it":d.has(p.value)?"detected":void 0,disabled:p.value===n})),initialValues:[...e],required:!1});if(S(y))return[...e];let m=[...y];return n!==null&&!m.includes(n)&&m.unshift(n),m},ae=(t,e)=>{if(t===void 0)return null;for(let n of t)if(n.startsWith(`${e}=`))return n.slice(e.length+1).split(",").map(o=>o.trim()).filter(Boolean);return null},Se=async()=>{try{return`${await O({command:"eser",devCommand:"deno task cli",npmPackage:"eser@latest",jsrPackage:"@eser/cli"})} noskills`}catch{return"npx eser@latest noskills"}};export{St as main};
@@ -1,4 +1,4 @@
1
- import{a as D}from"./chunk-ZJVSE2FP.js";import{a as C}from"./chunk-LICLZJKZ.js";import"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as d}from"./chunk-UXRWSNVZ.js";import{d as g,e as $,k as y,o as x,r as v}from"./chunk-OJUA2UZK.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var S=async()=>{let e=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:a}=await e.read();if(o||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,c=new Uint8Array(s.reduce((o,a)=>o+a.length,0));for(let o of s)c.set(o,t),t+=o.length;let n=new TextDecoder().decode(c);try{return JSON.parse(n)}catch{return{}}},P=async e=>{let s=new TextEncoder,t=i.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},W=async e=>{switch(e?.[0]){case"pre-tool-use":return await T();case"stop":return await F();case"post-file-write":return await E();case"post-bash":return await I();case"session-start":return await N();default:return r(void 0)}},T=async()=>{let e=await S(),s=e.tool_name??"unknown",t=e.tool_input??{},c=e.cwd??i.process.cwd(),n=await y(c),o={};try{o=await $(c)}catch{return r(void 0)}let a=async u=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${u}`}})};if(o.pendingClear===!0)return await a(`Task accepted. You must run \`/clear\` and then \`${d("next",n)}\` before continuing.`),r(void 0);if(s==="Bash"){let u=(t.command??"").trim();if(!(n?.allowGit??!1)){let w=["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 p of w)if(u.startsWith(p)||u.includes(` && ${p}`)||u.includes(`; ${p}`))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`."),r(void 0)}return r(void 0)}if(!["Write","Edit","MultiEdit"].includes(s))return r(void 0);let m=t.file_path??t.path??"";if(m.includes(".eser/")||m.includes(".claude/"))return r(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING")return r(void 0);let k={IDLE:`No active spec. Run \`${d("spec new",n)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",n)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",n)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",n)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',n)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',n)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",n)}\``};return await a(k[f]??`Run \`${d("next",n)}\` first.`),r(void 0)},F=async()=>{let e=await S();if(e.stop_hook_active===!0)return r(void 0);let s=e.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},n=`${s}/${g.stateDir}/files-changed.jsonl`,o=[];try{let w=(await i.fs.readTextFile(n)).trim().split(`
1
+ import{a as D}from"./chunk-GOOD5WBA.js";import{a as C}from"./chunk-ZQ77HAFD.js";import"./chunk-NTKVTLTO.js";import"./chunk-2WH262CW.js";import{a as d}from"./chunk-UXRWSNVZ.js";import{d as g,e as $,k as y,o as x,r as v}from"./chunk-WUVVLUU5.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{b as i}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var S=async()=>{let e=i.process.stdin.getReader(),s=[];try{for(;;){let{done:o,value:a}=await e.read();if(o||a===void 0)break;s.push(a)}}finally{e.releaseLock()}let t=0,c=new Uint8Array(s.reduce((o,a)=>o+a.length,0));for(let o of s)c.set(o,t),t+=o.length;let n=new TextDecoder().decode(c);try{return JSON.parse(n)}catch{return{}}},P=async e=>{let s=new TextEncoder,t=i.process.stdout.getWriter();await t.write(s.encode(JSON.stringify(e))),t.releaseLock()},W=async e=>{switch(e?.[0]){case"pre-tool-use":return await T();case"stop":return await F();case"post-file-write":return await E();case"post-bash":return await I();case"session-start":return await N();default:return r(void 0)}},T=async()=>{let e=await S(),s=e.tool_name??"unknown",t=e.tool_input??{},c=e.cwd??i.process.cwd(),n=await y(c),o={};try{o=await $(c)}catch{return r(void 0)}let a=async u=>{await P({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`noskills: ${u}`}})};if(o.pendingClear===!0)return await a(`Task accepted. You must run \`/clear\` and then \`${d("next",n)}\` before continuing.`),r(void 0);if(s==="Bash"){let u=(t.command??"").trim();if(!(n?.allowGit??!1)){let w=["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 p of w)if(u.startsWith(p)||u.includes(` && ${p}`)||u.includes(`; ${p}`))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`."),r(void 0)}return r(void 0)}if(!["Write","Edit","MultiEdit"].includes(s))return r(void 0);let m=t.file_path??t.path??"";if(m.includes(".eser/")||m.includes(".claude/"))return r(void 0);let f=o.phase??"UNKNOWN";if(f==="EXECUTING")return r(void 0);let k={IDLE:`No active spec. Run \`${d("spec new",n)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",n)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",n)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",n)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',n)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',n)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",n)}\``};return await a(k[f]??`Run \`${d("next",n)}\` first.`),r(void 0)},F=async()=>{let e=await S();if(e.stop_hook_active===!0)return r(void 0);let s=e.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${s}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},n=`${s}/${g.stateDir}/files-changed.jsonl`,o=[];try{let w=(await i.fs.readTextFile(n)).trim().split(`
2
2
  `).filter(Boolean);o=[...new Set(w.map(p=>{try{return JSON.parse(p).file}catch{return null}}).filter(p=>p!==null))]}catch{}let a=[],h="no changes";try{let{execSync:l}=await import("node:child_process");a=l("git diff --name-only",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
3
3
  `).filter(Boolean);let R=l("git diff --stat",{cwd:s,encoding:"utf-8",timeout:5e3}).trim().split(`
4
4
  `);h=R[R.length-1]??"no changes"}catch{}let m=[...new Set([...o,...a])],f=(c.iteration??0)+1,k=`${s}/${g.stateDir}/iterations`;try{await i.fs.mkdir(k,{recursive:!0}),await i.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:m,gitStat:h.trim(),timestamp:new Date().toISOString()},null,2)+`
@@ -1,3 +1,3 @@
1
- import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-AT7V3AKV.js";import{a as l}from"./chunk-OLM5RTFK.js";import"./chunk-6C2MLMD6.js";import"./chunk-HS6FTDDW.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-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(`
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};
@@ -1 +1 @@
1
- import{a as p}from"./chunk-RVIPYZ7F.js";import{c as t,d as a,g as l,m as n,o,q as m,r as d}from"./chunk-4IFPLK7L.js";import{a as i}from"./chunk-2N4GTHXQ.js";import"./chunk-6C2MLMD6.js";import"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.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};
1
+ import{a as p}from"./chunk-IR75X4G7.js";import{c as t,d as a,g as l,m as n,o,q as m,r as d}from"./chunk-EZH232V7.js";import{a as i}from"./chunk-2N4GTHXQ.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 $=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};
@@ -1 +1 @@
1
- import{a,b,c,d}from"./chunk-6C2MLMD6.js";import"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{b as CommandBuilder,a as CommandError,d as exec,c as parseCommand};
1
+ import{a,b,c,d}from"./chunk-3AZBET4N.js";import"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{b as CommandBuilder,a as CommandError,d as exec,c as parseCommand};
@@ -1,3 +1,3 @@
1
- import{a as _}from"./chunk-5ORUHRWF.js";import{a as v}from"./chunk-7ADGJB4H.js";import{a as B,b as H,c as Q,d as z}from"./chunk-KBNVVXFC.js";import{a as j,c as A,d as G,f as J,h as W}from"./chunk-HLQNHWXS.js";import{a as P}from"./chunk-ZJVSE2FP.js";import{a as b}from"./chunk-LICLZJKZ.js";import{a as q,b as M,d as x}from"./chunk-TGA7MX5P.js";import{b as U,c as L,d as N}from"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as V}from"./chunk-UXRWSNVZ.js";import{d as O,e as E,k as I,o as $,q as y,r as T}from"./chunk-OJUA2UZK.js";import{a as F,b as D}from"./chunk-2N4GTHXQ.js";import{a as h}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Z=o=>o.split(`
1
+ import{a as _}from"./chunk-3HRRWTVF.js";import{a as v}from"./chunk-IVSTITPL.js";import{a as B,b as H,c as Q,d as z}from"./chunk-XCVAHUBM.js";import{a as j,c as A,d as G,f as J,h as W}from"./chunk-4ODVKO5Y.js";import{a as P}from"./chunk-GOOD5WBA.js";import{a as b}from"./chunk-ZQ77HAFD.js";import{a as q,b as M,d as x}from"./chunk-42EQ3GZJ.js";import{b as U,c as L,d as N}from"./chunk-NTKVTLTO.js";import"./chunk-2WH262CW.js";import{a as V}from"./chunk-UXRWSNVZ.js";import{d as O,e as E,k as I,o as $,q as y,r as T}from"./chunk-WUVVLUU5.js";import{a as F,b as D}from"./chunk-2N4GTHXQ.js";import{b as h}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var Z=o=>o.split(`
2
2
  `).map(e=>e.replace(/^[-*]\s+/,"").trim()).filter(e=>e.length>0&&!e.startsWith("#")),ee=async(o,e)=>{let i=[],n=(e.startsWith(o)?e.slice(o.length+1):e).split("/");n.pop();for(let t=n.length;t>=0;t--){let r=`${t===0?o:`${o}/${n.slice(0,t).join("/")}`}/.folder-rules.md`,c=t===0?".":n.slice(0,t).join("/");try{let p=await h.fs.readTextFile(r),g=Z(p);for(let f of g)i.push({folder:c,rule:f})}catch{}}return i},k=async(o,e)=>{let i=new Set,a=[];for(let n of e){let t=await ee(o,n);for(let s of t){let r=`${s.folder}::${s.rule}`;i.has(r)||(i.add(r),a.push(s))}}return a};var ye=async o=>{let e=h.process.cwd(),i=q(o),a=M(o);if(!await T(e)){let l=await I(e);return await x({error:`noskills not initialized. Run: ${V("init",l)}`},i),D({exitCode:1})}let n=null;for(let l of a)l.startsWith("--answer=")&&(n=l.slice(9));let t=await E(e),s=await I(e);if(t.pendingClear&&(t={...t,pendingClear:!1},await y(e,t)),s===null)return await x({error:"No config found"},i),D({exitCode:1});let c=(await $(e)).filter(l=>s.concerns.includes(l.id));if(n!==null){let l=await se(e,t,s,c,n);await y(e,l);let u={...l,lastCalledAt:new Date().toISOString()};await y(e,u);let m=await b(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=P(u,c,m,s,d,X);return await x(Y,i),F(void 0)}let p={...t,lastCalledAt:new Date().toISOString()};await y(e,p);let g=await b(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=P(p,c,g,s,f,C);return await x(S,i),F(void 0)},se=async(o,e,i,a,n)=>{switch(e.phase){case"DISCOVERY":{let t=null;try{let r=JSON.parse(n);typeof r=="object"&&r!==null&&!Array.isArray(r)&&(t=r)}catch{}let s=e;if(t!==null)for(let[r,c]of Object.entries(t))typeof c=="string"&&c.length>0&&(s=A(s,r,c));else{let r=U(a),c=L(r,s.discovery.answers);if(c===null)return e;s=A(s,c.id,n)}return N(s.discovery.answers)&&(s=G(s)),s}case"SPEC_DRAFT":{if(e.classification===null){let t;try{let r=JSON.parse(n);t={involvesUI:r.involvesUI===!0,involvesPublicAPI:r.involvesPublicAPI===!0,involvesMigration:r.involvesMigration===!0,involvesDataHandling:r.involvesDataHandling===!0}}catch{t={involvesUI:!1,involvesPublicAPI:!1,involvesMigration:!1,involvesDataHandling:!1}}let s={...e,classification:t};try{await _(o,s,a)}catch{}return s}return e}case"SPEC_APPROVED":{let t=J(e);return t.spec!==null&&(await B(o,t.spec,"executing"),await z(o,t.spec,"executing")),t}case"EXECUTING":{if(!e.execution.awaitingStatusReport){let t={...e,execution:{...e.execution,lastProgress:n}};if(i.verifyCommand!==null&&i.verifyCommand!==void 0&&i.verifyCommand.length>0){let s=await ie(o,i.verifyCommand);if(t={...t,execution:{...t.execution,lastVerification:s}},!s.passed)return t}return t={...t,execution:{...t.execution,awaitingStatusReport:!0}},t}return await ne(o,e,n,a)}case"BLOCKED":{let t=e.execution.lastProgress??"Unknown",s={id:`d${e.decisions.length+1}`,question:t.replace(/^BLOCKED:\s*/,""),choice:n,promoted:!1,timestamp:new Date().toISOString()},r=W(e,s);return r=j(r,"EXECUTING"),r={...r,execution:{...r.execution,lastProgress:`Resolved: ${n}`}},r}default:return e}},ne=async(o,e,i,a)=>{let n;try{n=JSON.parse(i)}catch{return{...e,execution:{...e.execution,lastProgress:i,awaitingStatusReport:!1}}}let t=n.completed??[],s=n.remaining??[],r=n.blocked??[],c=[...s,...r],p=e.execution.debt?.unaddressedIterations??0,g=c.length>0?{items:c,fromIteration:e.execution.iteration,unaddressedIterations:1}:null,f=g;if(e.execution.debt!==null&&g!==null){let l=new Set(t.map(d=>d.toLowerCase().trim())),u=e.execution.debt.items.filter(d=>!l.has(d.toLowerCase().trim())),m=[...new Set([...u,...c])];f=m.length>0?{items:m,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:u.length>0?p+1:1}:null}else if(e.execution.debt!==null&&g===null){let l=new Set(t.map(m=>m.toLowerCase().trim())),u=e.execution.debt.items.filter(m=>!l.has(m.toLowerCase().trim()));f=u.length>0?{items:u,fromIteration:e.execution.debt.fromIteration,unaddressedIterations:p+1}:null}let w=t.length>0?`Completed: ${t.join(", ")}`:"Status report submitted",C=e.execution.lastVerification===null||e.execution.lastVerification.passed===!0,S=f===null&&C;if(S&&e.spec!==null){let l=await v(o,e.spec);if(l!==null){let u=e.execution.completedTasks??[],m=new Set(u),d=l.tasks.find(R=>!m.has(R.id));if(d!==void 0)return await H(o,e.spec,d.id),await Q(o,e.spec,d.id,"done"),{...e,pendingClear:!0,execution:{...e.execution,lastProgress:`Task ${d.id} accepted: ${w}`,awaitingStatusReport:!1,debt:f,completedTasks:[...u,d.id]}}}}return{...e,pendingClear:S,execution:{...e.execution,lastProgress:S?w:`Task not accepted \u2014 remaining items must be addressed first. ${w}`,awaitingStatusReport:!1,debt:f}}},ie=async(o,e)=>{try{let{execSync:i}=await import("node:child_process"),a=i(e,{cwd:o,encoding:"utf-8",timeout:6e4,stdio:["pipe","pipe","pipe"]});return{passed:!0,output:String(a).slice(0,4e3),timestamp:new Date().toISOString()}}catch(i){let a=i,n=((a.stdout??"")+(a.stderr??"")).slice(0,4e3);return a.status!==void 0?{passed:!1,output:n||"Verification failed with no output",timestamp:new Date().toISOString()}:{passed:!1,output:`Verification command failed to execute: ${i instanceof Error?i.message:String(i)}`,timestamp:new Date().toISOString()}}},K=async(o,e)=>{let i=[...e.execution.modifiedFiles??[]],a=await re(o);return[...new Set([...i,...a])]},re=async o=>{let e=`${o}/${O.stateDir}/files-changed.jsonl`;try{let a=(await h.fs.readTextFile(e)).trim().split(`
3
3
  `).filter(Boolean),n=[];for(let t of a)try{let s=JSON.parse(t);n.includes(s.file)||n.push(s.file)}catch{}return n}catch{return[]}};export{ye as main};
@@ -1,3 +1,3 @@
1
- import{c as u}from"./chunk-AT7V3AKV.js";import{a as i,e as m}from"./chunk-OLM5RTFK.js";import"./chunk-6C2MLMD6.js";import"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var p="http://localhost:11434",d=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;baseUrl;config;constructor(e,o){this.baseUrl=e,this.config=o,this.modelId=o.model}async generateText(e,o){let s=g(this.config,e,!1);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok)throw await f(t);let r=await t.json();return h(r,this.modelId)}catch(t){throw t instanceof i?t:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}async*streamText(e,o){let s=g(this.config,e,!0);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok){yield{kind:"error",error:await f(t)};return}if(t.body===null){yield{kind:"error",error:new i("No response body",{provider:"ollama"})};return}for await(let r of u(t.body)){let l=k(r);l!==null&&(yield l)}}catch(t){t instanceof i?yield{kind:"error",error:t}:yield{kind:"error",error:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},v={provider:"ollama",createModel(n){let e=n.properties?.baseUrl??p;return Promise.resolve(new d(e,n))}},g=(n,e,o)=>{let s=y(e.messages,e.system),t={model:n.model,messages:s,stream:o},r={};return e.temperature!==void 0&&(r.temperature=e.temperature),e.maxTokens!==void 0&&(r.num_predict=e.maxTokens),e.topP!==void 0&&(r.top_p=e.topP),e.stopWords!==void 0&&(r.stop=e.stopWords),Object.keys(r).length>0&&(t.options=r),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?t.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(t.format="json")),t},y=(n,e)=>{let o=[];e!==void 0&&o.push({role:"system",content:e});for(let s of n){if(s.role==="system"){let a=[];for(let c of s.content)c.kind==="text"&&a.push(c.text);o.push({role:"system",content:a.join(`
1
+ import{c as u}from"./chunk-24SANXOZ.js";import{a as i,e as m}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 p="http://localhost:11434",d=class{capabilities=["text_generation","streaming","vision"];provider="ollama";modelId;baseUrl;config;constructor(e,o){this.baseUrl=e,this.config=o,this.modelId=o.model}async generateText(e,o){let s=g(this.config,e,!1);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok)throw await f(t);let r=await t.json();return h(r,this.modelId)}catch(t){throw t instanceof i?t:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}async*streamText(e,o){let s=g(this.config,e,!0);try{let t=await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s),signal:o});if(!t.ok){yield{kind:"error",error:await f(t)};return}if(t.body===null){yield{kind:"error",error:new i("No response body",{provider:"ollama"})};return}for await(let r of u(t.body)){let l=k(r);l!==null&&(yield l)}}catch(t){t instanceof i?yield{kind:"error",error:t}:yield{kind:"error",error:new i(t instanceof Error?t.message:String(t),{provider:"ollama",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},v={provider:"ollama",createModel(n){let e=n.properties?.baseUrl??p;return Promise.resolve(new d(e,n))}},g=(n,e,o)=>{let s=y(e.messages,e.system),t={model:n.model,messages:s,stream:o},r={};return e.temperature!==void 0&&(r.temperature=e.temperature),e.maxTokens!==void 0&&(r.num_predict=e.maxTokens),e.topP!==void 0&&(r.top_p=e.topP),e.stopWords!==void 0&&(r.stop=e.stopWords),Object.keys(r).length>0&&(t.options=r),e.responseFormat!==void 0&&(e.responseFormat.type==="json_schema"?t.format=e.responseFormat.jsonSchema:e.responseFormat.type==="json_object"&&(t.format="json")),t},y=(n,e)=>{let o=[];e!==void 0&&o.push({role:"system",content:e});for(let s of n){if(s.role==="system"){let a=[];for(let c of s.content)c.kind==="text"&&a.push(c.text);o.push({role:"system",content:a.join(`
2
2
  `)});continue}let t=[],r=[];for(let a of s.content)a.kind==="text"?t.push(a.text):a.kind==="image"&&a.image.url!==void 0&&r.push(a.image.url);let l={role:s.role==="tool"?"user":s.role,content:t.join(`
3
3
  `)};r.length>0&&(l.images=r),o.push(l)}return o},h=(n,e)=>{let o=[];return n.message?.content!==void 0&&o.push({kind:"text",text:n.message.content}),{content:o,stopReason:n.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:n.prompt_eval_count??0,outputTokens:n.eval_count??0,totalTokens:(n.prompt_eval_count??0)+(n.eval_count??0)},modelId:e,rawResponse:n}},k=n=>{if(n===null||typeof n!="object")return null;let e=n;return e.done===!0?{kind:"message_done",stopReason:e.done_reason==="length"?"max_tokens":"end_turn",usage:{inputTokens:e.prompt_eval_count??0,outputTokens:e.eval_count??0,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}}:e.message?.content!==void 0&&e.message.content.length>0?{kind:"content_delta",textDelta:e.message.content}:e.response!==void 0&&e.response.length>0?{kind:"content_delta",textDelta:e.response}:null},f=async n=>{let e;try{e=(await n.json()).error??`Ollama HTTP ${n.status}`}catch{e=`Ollama HTTP ${n.status}: ${n.statusText}`}return m("ollama",n.status,new Error(e))};export{d as OllamaModel,v as ollamaFactory};
@@ -1 +1 @@
1
- import{a as h,b as u,c as S,d as k,e as g,f as m,g as f}from"./chunk-AT7V3AKV.js";import{a as c}from"./chunk-OLM5RTFK.js";import"./chunk-6C2MLMD6.js";import"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var y=class{capabilities=["text_generation","streaming"];provider="opencode";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=w(this.config,e,"json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr),t=await k(s.stdout,this.modelId),p=await s.waitForExit(),a=await l,d=m("opencode",p.code,a);if(d!==null)throw d;return t}async*streamText(e,r){let o=w(this.config,e,"stream-json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr);try{for await(let d of S(s.stdout)){let x=v(d);x!==null&&(yield x)}let t=await s.waitForExit(),p=await l,a=m("opencode",t.code,p);a!==null&&(yield{kind:"error",error:a})}catch(t){t instanceof c?yield{kind:"error",error:t}:yield{kind:"error",error:new c(t instanceof Error?t.message:String(t),{provider:"opencode",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},b={provider:"opencode",async createModel(n){let e=await h("opencode",n);return new y(e,n)}},w=(n,e,r)=>{let o=["--output-format",r];o.push("--model",n.model),e.maxTokens!==void 0&&o.push("--max-tokens",String(e.maxTokens));let i=n.properties?.args;return i!==void 0&&o.push(...i),o},v=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content_block_delta"||e.type==="assistant"){let r=e.delta?.text??e.message?.content?.[0]?.text;return r!==void 0?{kind:"content_delta",textDelta:r}:null}return 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 c(e.error?.message??"Unknown OpenCode error",{provider:"opencode"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as OpenCodeModel,b as openCodeFactory};
1
+ import{a as h,b as u,c as S,d as k,e as g,f as m,g as f}from"./chunk-24SANXOZ.js";import{a as c}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 y=class{capabilities=["text_generation","streaming"];provider="opencode";modelId;binary;config;constructor(e,r){this.binary=e,this.config=r,this.modelId=r.model}async generateText(e,r){let o=w(this.config,e,"json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr),t=await k(s.stdout,this.modelId),p=await s.waitForExit(),a=await l,d=m("opencode",p.code,a);if(d!==null)throw d;return t}async*streamText(e,r){let o=w(this.config,e,"stream-json"),i=f(e.messages,e.system);o.push("-p",i);let s=u(this.binary,o,{signal:r}),l=g(s.stderr);try{for await(let d of S(s.stdout)){let x=v(d);x!==null&&(yield x)}let t=await s.waitForExit(),p=await l,a=m("opencode",t.code,p);a!==null&&(yield{kind:"error",error:a})}catch(t){t instanceof c?yield{kind:"error",error:t}:yield{kind:"error",error:new c(t instanceof Error?t.message:String(t),{provider:"opencode",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},b={provider:"opencode",async createModel(n){let e=await h("opencode",n);return new y(e,n)}},w=(n,e,r)=>{let o=["--output-format",r];o.push("--model",n.model),e.maxTokens!==void 0&&o.push("--max-tokens",String(e.maxTokens));let i=n.properties?.args;return i!==void 0&&o.push(...i),o},v=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content_block_delta"||e.type==="assistant"){let r=e.delta?.text??e.message?.content?.[0]?.text;return r!==void 0?{kind:"content_delta",textDelta:r}:null}return 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 c(e.error?.message??"Unknown OpenCode error",{provider:"opencode"})}:e.content!==void 0&&typeof e.content=="string"?{kind:"content_delta",textDelta:e.content}:null};export{y as OpenCodeModel,b as openCodeFactory};
@@ -1,4 +1,4 @@
1
- import{b as v,c as k}from"./chunk-ZS6ZJ4YL.js";import{a as p,b as w,c as h,h as r}from"./chunk-AB4ZUDV6.js";import{c as $,d as c}from"./chunk-OJUA2UZK.js";import"./chunk-4IFPLK7L.js";import{a as d,b as g}from"./chunk-2N4GTHXQ.js";import{a as n}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import{e as y}from"./chunk-DXB73IDG.js";var x=y($(),1);var M=async i=>{let e=n.process.cwd(),s=v(i),t=w({target:s==="agent"?"non-interactive":"interactive"});if(!k(i).includes("--force")){if(s==="agent")return r.error(t,"Purge requires `--force` flag in agent mode."),g({exitCode:1});let l=await h(t,{message:"This will remove all noskills specs, rules, concerns, and hooks. Continue?"});if(p(l)||l!==!0)return r.info(t,"Aborted."),d(void 0)}return r.step(t,"Purging noskills content..."),await u(`${e}/${c.concernsDir}`,t,"`.eser/concerns/`"),await u(`${e}/${c.specsDir}`,t,"`.eser/specs/`"),await u(`${e}/${c.rulesDir}`,t,"`.eser/rules/`"),await u(`${e}/${c.stateDir}`,t,"`.eser/.state/`"),await C(e,t),await T(e,t),await m(`${e}/.cursorrules`,t,"`.cursorrules`"),await m(`${e}/.windsurfrules`,t,"`.windsurfrules`"),await m(`${e}/.kiro/steering/conventions.md`,t,"`.kiro/steering/conventions.md`"),await m(`${e}/.github/copilot-instructions.md`,t,"`.github/copilot-instructions.md`"),await F(e,t),r.success(t,"Purge complete."),d(void 0)},u=async(i,e,s)=>{try{await n.fs.stat(i);let{rmSync:t}=await import("node:fs");t(i,{recursive:!0,force:!0}),r.step(e,` Removed ${s}`)}catch{}},m=async(i,e,s)=>{try{await n.fs.stat(i);let{unlinkSync:t}=await import("node:fs");t(i),r.step(e,` Removed ${s}`)}catch{}},C=async(i,e)=>{let s=`${i}/${c.manifestFile}`;try{let t=await n.fs.readTextFile(s),o=x.parseDocument(t);o.has("noskills")&&(o.delete("noskills"),await n.fs.writeTextFile(s,o.toString()),r.step(e," Removed noskills section from `manifest.yml`"))}catch{}},T=async(i,e)=>{let s=`${i}/CLAUDE.md`,t="<!-- noskills:start -->",o="<!-- noskills:end -->";try{let a=await n.fs.readTextFile(s),l=a.indexOf(t),f=a.indexOf(o);l!==-1&&f!==-1&&(a=a.slice(0,l).trimEnd()+`
1
+ import{b as v,c as k}from"./chunk-O5KQZHIN.js";import{a as p,b as w,c as h,h as r}from"./chunk-LG5R766Y.js";import{c as $,d as c}from"./chunk-WUVVLUU5.js";import"./chunk-EZH232V7.js";import{a as d,b as g}from"./chunk-2N4GTHXQ.js";import{b as n}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import{e as y}from"./chunk-DXB73IDG.js";var x=y($(),1);var M=async i=>{let e=n.process.cwd(),s=v(i),t=w({target:s==="agent"?"non-interactive":"interactive"});if(!k(i).includes("--force")){if(s==="agent")return r.error(t,"Purge requires `--force` flag in agent mode."),g({exitCode:1});let l=await h(t,{message:"This will remove all noskills specs, rules, concerns, and hooks. Continue?"});if(p(l)||l!==!0)return r.info(t,"Aborted."),d(void 0)}return r.step(t,"Purging noskills content..."),await u(`${e}/${c.concernsDir}`,t,"`.eser/concerns/`"),await u(`${e}/${c.specsDir}`,t,"`.eser/specs/`"),await u(`${e}/${c.rulesDir}`,t,"`.eser/rules/`"),await u(`${e}/${c.stateDir}`,t,"`.eser/.state/`"),await C(e,t),await T(e,t),await m(`${e}/.cursorrules`,t,"`.cursorrules`"),await m(`${e}/.windsurfrules`,t,"`.windsurfrules`"),await m(`${e}/.kiro/steering/conventions.md`,t,"`.kiro/steering/conventions.md`"),await m(`${e}/.github/copilot-instructions.md`,t,"`.github/copilot-instructions.md`"),await F(e,t),r.success(t,"Purge complete."),d(void 0)},u=async(i,e,s)=>{try{await n.fs.stat(i);let{rmSync:t}=await import("node:fs");t(i,{recursive:!0,force:!0}),r.step(e,` Removed ${s}`)}catch{}},m=async(i,e,s)=>{try{await n.fs.stat(i);let{unlinkSync:t}=await import("node:fs");t(i),r.step(e,` Removed ${s}`)}catch{}},C=async(i,e)=>{let s=`${i}/${c.manifestFile}`;try{let t=await n.fs.readTextFile(s),o=x.parseDocument(t);o.has("noskills")&&(o.delete("noskills"),await n.fs.writeTextFile(s,o.toString()),r.step(e," Removed noskills section from `manifest.yml`"))}catch{}},T=async(i,e)=>{let s=`${i}/CLAUDE.md`,t="<!-- noskills:start -->",o="<!-- noskills:end -->";try{let a=await n.fs.readTextFile(s),l=a.indexOf(t),f=a.indexOf(o);l!==-1&&f!==-1&&(a=a.slice(0,l).trimEnd()+`
2
2
  `+a.slice(f+o.length).trimStart(),await n.fs.writeTextFile(s,a.trimEnd()+`
3
3
  `),r.step(e," Removed noskills section from `CLAUDE.md`"))}catch{}},F=async(i,e)=>{let s=`${i}/.claude/settings.json`;try{let t=await n.fs.readTextFile(s),o=JSON.parse(t);o.hooks!==void 0&&(delete o.hooks,await n.fs.writeTextFile(s,JSON.stringify(o,null,2)+`
4
4
  `),r.step(e," Removed hooks from `.claude/settings.json`"))}catch{}};export{M as main};
@@ -1 +1 @@
1
- import{i as u}from"./chunk-HLQNHWXS.js";import{e as c,f as d}from"./chunk-OJUA2UZK.js";import{d as a,g as o,o as m,q as p,r as l}from"./chunk-4IFPLK7L.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{a as n}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),i=n.process.cwd(),s=await c(i);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(i,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
1
+ import{i as u}from"./chunk-4ODVKO5Y.js";import{e as c,f as d}from"./chunk-WUVVLUU5.js";import{d as a,g as o,o as m,q as p,r as l}from"./chunk-EZH232V7.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{b as n}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var N=async w=>{let e=m({renderer:l.ansi(),sink:p.stdout()}),i=n.process.cwd(),s=await c(i);if(s.phase==="IDLE"||s.phase==="UNINITIALIZED")return e.writeln(a("Already idle. Nothing to reset.")),await e.close(),r(void 0);let t=s.spec,f=u(s);return await d(i,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .eser/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
@@ -1,2 +1,2 @@
1
- import{a as k,b as x}from"./chunk-LICLZJKZ.js";import{a as g,b as y}from"./chunk-UXRWSNVZ.js";import{d as w,k as c}from"./chunk-OJUA2UZK.js";import{c as p,d as o,f,g as h,o as a,q as l,r as d}from"./chunk-4IFPLK7L.js";import{a as u,b as m}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var L=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="list")return await v();if(e==="promote")return await C(s?.slice(1));let t=await c(i.process.cwd()),n=y(t),r=a({renderer:d.ansi(),sink:l.stdout()});return r.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await r.close(),u(void 0)},$=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=i.process.cwd(),n=s?.join(" "),r=await c(t);if(n===void 0||n.length===0)return e.writeln(f("Please provide a rule: "),p(`${g('rule add "Use Deno Tests for all tests"',r)}`)),await e.close(),m({exitCode:1});let P=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),A=`${t}/${w.rulesDir}/${P}.md`;return await i.fs.mkdir(`${t}/${w.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(A,n+`
1
+ import{a as k,b as x}from"./chunk-ZQ77HAFD.js";import{a as g,b as y}from"./chunk-UXRWSNVZ.js";import{d as w,k as c}from"./chunk-WUVVLUU5.js";import{c as p,d as o,f,g as h,o as a,q as l,r as d}from"./chunk-EZH232V7.js";import{a as u,b as m}from"./chunk-2N4GTHXQ.js";import{b as i}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var L=async s=>{let e=s?.[0];if(e==="add")return await $(s?.slice(1));if(e==="list")return await v();if(e==="promote")return await C(s?.slice(1));let t=await c(i.process.cwd()),n=y(t),r=a({renderer:d.ansi(),sink:l.stdout()});return r.writeln(`Usage: ${n} rule <add "rule text" | list | promote "decision">`),await r.close(),u(void 0)},$=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=i.process.cwd(),n=s?.join(" "),r=await c(t);if(n===void 0||n.length===0)return e.writeln(f("Please provide a rule: "),p(`${g('rule add "Use Deno Tests for all tests"',r)}`)),await e.close(),m({exitCode:1});let P=n.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),A=`${t}/${w.rulesDir}/${P}.md`;return await i.fs.mkdir(`${t}/${w.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(A,n+`
2
2
  `),e.writeln(h("\u2714")," Rule added: ",o(n)),r!==null&&r.tools.length>0&&(await x(t,r.tools,r),e.writeln(o(" Tool files synced."))),await e.close(),u(void 0)},v=async()=>{let s=a({renderer:d.ansi(),sink:l.stdout()}),e=i.process.cwd(),t=await k(e);s.writeln(p("Rules")),s.writeln("");let n=await c(e);if(t.length===0)s.writeln(o(` No rules yet. Add one with: ${g('rule add "..."',n)}`));else for(let r of t)s.writeln(" ",o("\u2022"),` ${r}`);return await s.close(),u(void 0)},C=async s=>{let e=a({renderer:d.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(f("Please provide the decision text to promote.")),await e.close(),m({exitCode:1})):(await e.close(),await $(s))};export{L as main};
@@ -1,3 +1,3 @@
1
- import{a as B,f as L}from"./chunk-HLQNHWXS.js";import{a as D,b as A,d as N}from"./chunk-AB4ZUDV6.js";import{a as M}from"./chunk-ZJVSE2FP.js";import{a as V}from"./chunk-LICLZJKZ.js";import"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as G,b as C}from"./chunk-UXRWSNVZ.js";import{e as x,f as g,k as $,o as F,r as U}from"./chunk-OJUA2UZK.js";import{c as P,d as r,f as u,g as v,h,k as I,o as R,q as O,r as T}from"./chunk-4IFPLK7L.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{a as y}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${G("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=L(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=B(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await V(e),j=M(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-LUIKS5KC.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-LUIKS5KC.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
1
+ import{a as B,f as L}from"./chunk-4ODVKO5Y.js";import{a as D,b as A,d as N}from"./chunk-LG5R766Y.js";import{a as M}from"./chunk-GOOD5WBA.js";import{a as V}from"./chunk-ZQ77HAFD.js";import"./chunk-NTKVTLTO.js";import"./chunk-2WH262CW.js";import{a as G,b as C}from"./chunk-UXRWSNVZ.js";import{e as x,f as g,k as $,o as F,r as U}from"./chunk-WUVVLUU5.js";import{c as P,d as r,f as u,g as v,h,k as I,o as R,q as O,r as T}from"./chunk-EZH232V7.js";import{a as S,b as w}from"./chunk-2N4GTHXQ.js";import{b as y}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var ae=async n=>{let t=R({renderer:T.ansi(),sink:O.stdout()}),e=y.process.cwd(),a=n?.includes("--unattended")??!1,s=W(n,"--max-turns")??10,o=W(n,"--max-iterations")??50;if(!await U(e)){let i=await $(e);return t.writeln(u(`noskills not initialized. Run: ${G("init",i)}`)),await t.close(),w({exitCode:1})}let p=await x(e);if(p.phase!=="EXECUTING"&&p.phase!=="SPEC_APPROVED")return t.writeln(u(`Cannot run from phase: ${p.phase}`)),t.writeln(r("Must be in SPEC_APPROVED or EXECUTING to start.")),await t.close(),w({exitCode:1});if(p.phase==="SPEC_APPROVED"){t.writeln(r("Starting execution from approved spec..."));let i=L(p);await g(e,i)}let c=await $(e);if(c===null)return t.writeln(u("Config not found.")),await t.close(),w({exitCode:1});t.writeln(P(`${C(c)} run`)),t.writeln(r(`Mode: ${a?"unattended":"interactive"}, max-turns: ${s}, max-iterations: ${o}`)),t.writeln("");let m=0,d=0;for(;m<o;){m++;let i=await x(e);if(i.phase==="DONE"){t.writeln(""),t.writeln(v("\u2714")," Spec completed!"),t.writeln(` Iterations: ${i.execution.iteration}`),t.writeln(` Decisions: ${i.decisions.length}`);break}if(i.phase==="BLOCKED"){let l=i.execution.lastProgress??"Unknown";if(t.writeln(""),t.writeln(h("\u26A0")," Execution blocked: ",r(l)),a){await H(e,l,m),t.writeln(r("Logged to .eser/.state/blocked.log. Resolve and re-run.")),d=1;break}let E=A(),f=await N(E,{message:"Enter resolution (or leave empty to stop):"});if(D(f)||f===""){t.writeln(r("Stopped by user."));break}let k=B(i,"EXECUTING");await g(e,{...k,execution:{...k.execution,lastProgress:`Resolved: ${f}`}});continue}if(i.phase!=="EXECUTING"){t.writeln(u(`Unexpected phase: ${i.phase}. Stopping.`)),d=1;break}i.pendingClear&&await g(e,{...i,pendingClear:!1});let X=(await F(e)).filter(l=>c.concerns.includes(l.id)),_=await V(e),j=M(i,X,_,c),z=q(j,c);t.writeln(I(`\u2500\u2500 Iteration ${m}`),r(` (execution: ${i.execution.iteration}, debt: ${i.execution.debt?.items.length??0})`)),i.execution.lastProgress!==null&&t.writeln(r(` Last: ${i.execution.lastProgress}`)),i.execution.lastVerification?.passed===!1&&t.writeln(u(" Verification failed \u2014 agent will fix")),i.execution.debt!==null&&t.writeln(h(` Debt: ${i.execution.debt.items.length} items`)),t.writeln(r(" Spawning agent..."));try{await(await import("./mod-V2Z6HGL6.js")).exec`claude -p ${z} --max-turns ${String(s)} --output-format json`.noThrow().text()}catch{t.writeln(u(" Failed to spawn claude CLI. Is it installed?")),d=1;break}t.writeln(r(" Agent exited. Stop hook captured state."));let b=await x(e);if(c.autoCommit===!0&&c.allowGit!==!1)try{let l=await import("./mod-V2Z6HGL6.js");if((await l.exec`git diff --name-only`.noThrow().text()).trim().length>0){await l.exec`git add -A`.noThrow().text();let f=`noskills: iteration ${b.execution.iteration} \u2014 ${b.execution.lastProgress??"progress"}`;await l.exec`git commit -m ${f}`.noThrow().text(),t.writeln(r(" Auto-committed."))}}catch{t.writeln(r(" Auto-commit failed (non-fatal)."))}}return m>=o&&(t.writeln(""),t.writeln(h("\u26A0"),` Max iterations (${o}) reached. Stopping.`),d=2),await t.close(),d!==0?w({exitCode:d}):S(void 0)},q=(n,t)=>{let e=[];if(e.push(n.meta.resumeHint),e.push(""),n.meta.spec!==null&&(e.push(`Working on spec: ${n.meta.spec}`),e.push("")),"instruction"in n&&(e.push(n.instruction),e.push("")),"previousIterationDebt"in n){let s=n.previousIterationDebt;if(s!==void 0){e.push(`DEBT from iteration ${s.fromIteration} (address first):`);for(let o of s.items)e.push(`- ${o}`);e.push("")}}if("statusReportRequired"in n){let s=n.statusReport;if(s!==void 0){e.push("Report against these acceptance criteria:");for(let o of s.criteria)e.push(`- ${o}`);e.push("")}}if("verificationFailed"in n&&n.verificationFailed===!0&&(e.push("Test output:"),e.push(("verificationOutput"in n?n.verificationOutput:"")??""),e.push("")),n.behavioral.rules.length>0){e.push("Rules:");for(let s of n.behavioral.rules)e.push(`- ${s}`);e.push("")}if("context"in n){let s=n.context;if(s.concernReminders.length>0){e.push("Reminders:");for(let o of s.concernReminders)e.push(`- ${o}`);e.push("")}}let a=C(t);return e.push(`When done, report progress: ${a} next --answer="your progress"`),e.push(`If blocked, run: ${a} block "reason"`),e.push(`When all tasks are complete: ${a} done`),e.join(`
2
2
  `)},W=(n,t)=>{if(n===void 0)return null;let e=`${t}=`;for(let a of n)if(a.startsWith(e)){let s=parseInt(a.slice(e.length),10);if(!isNaN(s)&&s>0)return s}return null},H=async(n,t,e)=>{let a=`${n}/.eser/.state/blocked.log`,s=`[${new Date().toISOString()}] iteration=${e} reason=${t}
3
3
  `;try{let{appendFileSync:o,mkdirSync:p}=await import("node:fs"),{dirname:c}=await import("node:path");p(c(a),{recursive:!0}),o(a,s)}catch{}};export{ae as main};
@@ -1 +1 @@
1
- import{b as j,i as F}from"./chunk-HLQNHWXS.js";import{a as T,d as U}from"./chunk-TGA7MX5P.js";import{a as x,b as C}from"./chunk-UXRWSNVZ.js";import{d as S,e as P,f as I,g as A,h as L,i as R,j as O,k,r as z}from"./chunk-OJUA2UZK.js";import{c as d,d as c,f as w,g as $,h as E,k as N,o as y,q as D,r as v}from"./chunk-4IFPLK7L.js";import{a as h,b as g}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var ee=async i=>{let e=i?.[0];if(e==="new")return await M(i?.slice(1));if(e==="list")return await B(i?.slice(1));if(e==="switch")return await q(i?.slice(1));let t=await k(l.process.cwd()),n=C(t),r=y({renderer:v.ansi(),sink:D.stdout()});return r.writeln(`Usage: ${n} spec <new "description" | list | switch <name>>`),await r.close(),h(void 0)},M=async i=>{let e=y({renderer:v.ansi(),sink:D.stdout()}),t=l.process.cwd(),n=await k(t);if(!await z(t))return e.writeln(w("noskills is not initialized.")," Run: ",d(x("init",n))),await e.close(),g({exitCode:1});let r=null,p=[];if(i!==void 0)for(let f of i)f.startsWith("--name=")?r=f.slice(7):f.startsWith("-")||p.push(f);let m=p.join(" ");if(m.length===0)return e.writeln(w("Please provide a description: "),d(`${C(n)} spec new "photo auto-listing"`)),await e.close(),g({exitCode:1});let a=r??W(m),o=await X(t,a),s=`spec/${o}`,u=await P(t);if(u.phase!=="IDLE"&&u.phase!=="DONE")return e.writeln(w(`Cannot start new spec in phase: ${u.phase}`),c(" \u2014 finish or reset the current spec first.")),await e.close(),g({exitCode:1});let b=j(u.phase==="DONE"?F(u):u,o,s);return await l.fs.mkdir(`${t}/${S.specDir(o)}`,{recursive:!0}),await I(t,b),await R(t,o,b),e.writeln($("\u2714")," Spec started: ",d(o)),e.writeln(" Directory: ",c(S.specDir(o))),e.writeln(" Branch: ",c(s)),e.writeln(" Phase: ",E("DISCOVERY")),e.writeln(""),e.writeln("Run ",d(x("next",n))," to begin discovery questions."),await e.close(),h(void 0)},W=i=>i.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50).replace(/-$/,""),X=async(i,e)=>{let t=`${i}/${S.specsDir}`,n=async r=>{try{return await l.fs.stat(`${t}/${r}`),!0}catch{return!1}};if(!await n(e))return e;for(let r=2;r<=99;r++){let p=`${e}-${r}`;if(!await n(p))return p}return`${e}-${Date.now()}`},B=async i=>{let e=l.process.cwd(),t=T(i),n=await A(e),r=await O(e),p=`${e}/${S.specsDir}`,m=new Set(r.map(s=>s.name)),a=[];for(let s of r)a.push({name:s.name,phase:s.state.phase,iteration:s.state.execution.iteration,active:s.name===n});try{for await(let s of l.fs.readDir(p))s.isDirectory&&!m.has(s.name)&&a.push({name:s.name,phase:"IDLE",iteration:0,active:s.name===n})}catch{}if(t==="json")return await U(a,"json"),h(void 0);let o=y({renderer:v.ansi(),sink:D.stdout()});if(o.writeln(d("Specs")),o.writeln(""),a.length===0)o.writeln(c(" No specs yet."));else for(let s of a){let u=s.active?$("\u25CF"):c("\u25CB"),b=s.active?d(s.name):c(s.name),f=s.phase==="DONE"?$(s.phase):s.phase==="EXECUTING"?N(s.phase):s.phase==="BLOCKED"?w(s.phase):E(s.phase),G=s.phase==="EXECUTING"?c(` iteration ${s.iteration}`):"";o.writeln(" ",u," ",b," ",f,G)}return await o.close(),h(void 0)},q=async i=>{let e=y({renderer:v.ansi(),sink:D.stdout()}),t=l.process.cwd(),n=i?.[0],r=await k(t);if(n===void 0||n.length===0)return e.writeln(w("Please provide a spec name: "),d(`${C(r)} spec switch my-feature`)),await e.close(),g({exitCode:1});let p=await A(t),m=await P(t);p!==null&&m.spec!==null&&await R(t,p,m);let a=await L(t,n),o=await l.fs.stat(`${t}/${S.specDir(n)}`).then(()=>!0).catch(()=>!1);return a.phase==="IDLE"&&!o?(e.writeln(w(`Spec "${n}" not found.`)),e.writeln(c(`Run \`${x("spec list",r)}\` to see available specs.`)),await e.close(),g({exitCode:1})):(await I(t,a),e.writeln($("\u2714")," Switched to: ",d(n)," (",N(a.phase),")"),a.phase==="EXECUTING"&&(e.writeln(c(` Iteration: ${a.execution.iteration}`)),a.execution.lastProgress!==null&&e.writeln(c(` Progress: ${a.execution.lastProgress}`))),await e.close(),h(void 0))};export{ee as main};
1
+ import{b as j,i as F}from"./chunk-4ODVKO5Y.js";import{a as T,d as U}from"./chunk-42EQ3GZJ.js";import{a as x,b as C}from"./chunk-UXRWSNVZ.js";import{d as S,e as P,f as I,g as A,h as L,i as R,j as O,k,r as z}from"./chunk-WUVVLUU5.js";import{c as d,d as c,f as w,g as $,h as E,k as N,o as y,q as D,r as v}from"./chunk-EZH232V7.js";import{a as h,b as g}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var ee=async i=>{let e=i?.[0];if(e==="new")return await M(i?.slice(1));if(e==="list")return await B(i?.slice(1));if(e==="switch")return await q(i?.slice(1));let t=await k(l.process.cwd()),n=C(t),r=y({renderer:v.ansi(),sink:D.stdout()});return r.writeln(`Usage: ${n} spec <new "description" | list | switch <name>>`),await r.close(),h(void 0)},M=async i=>{let e=y({renderer:v.ansi(),sink:D.stdout()}),t=l.process.cwd(),n=await k(t);if(!await z(t))return e.writeln(w("noskills is not initialized.")," Run: ",d(x("init",n))),await e.close(),g({exitCode:1});let r=null,p=[];if(i!==void 0)for(let f of i)f.startsWith("--name=")?r=f.slice(7):f.startsWith("-")||p.push(f);let m=p.join(" ");if(m.length===0)return e.writeln(w("Please provide a description: "),d(`${C(n)} spec new "photo auto-listing"`)),await e.close(),g({exitCode:1});let a=r??W(m),o=await X(t,a),s=`spec/${o}`,u=await P(t);if(u.phase!=="IDLE"&&u.phase!=="DONE")return e.writeln(w(`Cannot start new spec in phase: ${u.phase}`),c(" \u2014 finish or reset the current spec first.")),await e.close(),g({exitCode:1});let b=j(u.phase==="DONE"?F(u):u,o,s);return await l.fs.mkdir(`${t}/${S.specDir(o)}`,{recursive:!0}),await I(t,b),await R(t,o,b),e.writeln($("\u2714")," Spec started: ",d(o)),e.writeln(" Directory: ",c(S.specDir(o))),e.writeln(" Branch: ",c(s)),e.writeln(" Phase: ",E("DISCOVERY")),e.writeln(""),e.writeln("Run ",d(x("next",n))," to begin discovery questions."),await e.close(),h(void 0)},W=i=>i.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50).replace(/-$/,""),X=async(i,e)=>{let t=`${i}/${S.specsDir}`,n=async r=>{try{return await l.fs.stat(`${t}/${r}`),!0}catch{return!1}};if(!await n(e))return e;for(let r=2;r<=99;r++){let p=`${e}-${r}`;if(!await n(p))return p}return`${e}-${Date.now()}`},B=async i=>{let e=l.process.cwd(),t=T(i),n=await A(e),r=await O(e),p=`${e}/${S.specsDir}`,m=new Set(r.map(s=>s.name)),a=[];for(let s of r)a.push({name:s.name,phase:s.state.phase,iteration:s.state.execution.iteration,active:s.name===n});try{for await(let s of l.fs.readDir(p))s.isDirectory&&!m.has(s.name)&&a.push({name:s.name,phase:"IDLE",iteration:0,active:s.name===n})}catch{}if(t==="json")return await U(a,"json"),h(void 0);let o=y({renderer:v.ansi(),sink:D.stdout()});if(o.writeln(d("Specs")),o.writeln(""),a.length===0)o.writeln(c(" No specs yet."));else for(let s of a){let u=s.active?$("\u25CF"):c("\u25CB"),b=s.active?d(s.name):c(s.name),f=s.phase==="DONE"?$(s.phase):s.phase==="EXECUTING"?N(s.phase):s.phase==="BLOCKED"?w(s.phase):E(s.phase),G=s.phase==="EXECUTING"?c(` iteration ${s.iteration}`):"";o.writeln(" ",u," ",b," ",f,G)}return await o.close(),h(void 0)},q=async i=>{let e=y({renderer:v.ansi(),sink:D.stdout()}),t=l.process.cwd(),n=i?.[0],r=await k(t);if(n===void 0||n.length===0)return e.writeln(w("Please provide a spec name: "),d(`${C(r)} spec switch my-feature`)),await e.close(),g({exitCode:1});let p=await A(t),m=await P(t);p!==null&&m.spec!==null&&await R(t,p,m);let a=await L(t,n),o=await l.fs.stat(`${t}/${S.specDir(n)}`).then(()=>!0).catch(()=>!1);return a.phase==="IDLE"&&!o?(e.writeln(w(`Spec "${n}" not found.`)),e.writeln(c(`Run \`${x("spec list",r)}\` to see available specs.`)),await e.close(),g({exitCode:1})):(await I(t,a),e.writeln($("\u2714")," Switched to: ",d(n)," (",N(a.phase),")"),a.phase==="EXECUTING"&&(e.writeln(c(` Iteration: ${a.execution.iteration}`)),a.execution.lastProgress!==null&&e.writeln(c(` Progress: ${a.execution.lastProgress}`))),await e.close(),h(void 0))};export{ee as main};
@@ -1 +1 @@
1
- import{a as I,d as w}from"./chunk-TGA7MX5P.js";import{a as f}from"./chunk-BLHOTPRB.js";import"./chunk-PSXXTDLU.js";import{a as h}from"./chunk-UXRWSNVZ.js";import{e as y,k as u,r as D}from"./chunk-OJUA2UZK.js";import{c as i,d as r,f as c,g as b,h as o,k as E,o as p,q as d,r as m}from"./chunk-4IFPLK7L.js";import{a as g,b as C}from"./chunk-2N4GTHXQ.js";import{a as x}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(h("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${h("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};
1
+ import{a as I,d as w}from"./chunk-42EQ3GZJ.js";import{a as f}from"./chunk-NTKVTLTO.js";import"./chunk-2WH262CW.js";import{a as h}from"./chunk-UXRWSNVZ.js";import{e as y,k as u,r as D}from"./chunk-WUVVLUU5.js";import{c as i,d as r,f as c,g as b,h as o,k as E,o as p,q as d,r as m}from"./chunk-EZH232V7.js";import{a as g,b as C}from"./chunk-2N4GTHXQ.js";import{b as x}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var U=async P=>{let n=x.process.cwd(),a=I(P);if(!await D(n)){if(a==="json")await w({error:"noskills is not initialized"},a);else{let s=p({renderer:m.ansi(),sink:d.stdout()}),l=await u(n);s.writeln(c("noskills is not initialized.")," Run: ",i(h("init",l))),await s.close()}return C({exitCode:1})}let e=await y(n),t=await u(n),k={phase:e.phase,spec:e.spec,branch:e.branch,discovery:e.phase==="DISCOVERY"?{answered:e.discovery.answers.length,total:f.length}:void 0,execution:e.phase==="EXECUTING"||e.phase==="BLOCKED"?{iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,debt:e.execution.debt?.items.length??0,verificationPassed:e.execution.lastVerification?.passed??null}:void 0,concerns:t?.concerns??[],tools:t?.tools??[],decisions:e.decisions.length,pendingClear:e.pendingClear};if(a!=="json"){let s=p({renderer:m.ansi(),sink:d.stdout()});s.writeln(i(`${h("status",t)}`)),s.writeln("");let l=e.phase==="DONE"?b(e.phase):e.phase==="BLOCKED"?c(e.phase):e.phase==="EXECUTING"?E(e.phase):o(e.phase);s.writeln(" Phase: ",l),e.spec!==null&&s.writeln(" Spec: ",i(e.spec)),e.branch!==null&&s.writeln(" Branch: ",e.branch),e.phase==="DISCOVERY"&&s.writeln(` Discovery: ${e.discovery.answers.length}/${f.length} questions answered`),e.phase==="EXECUTING"&&(s.writeln(` Iteration: ${e.execution.iteration}`),e.execution.lastProgress!==null&&s.writeln(" Progress: ",r(e.execution.lastProgress)),e.execution.debt!==null&&s.writeln(o(` Debt: ${e.execution.debt.items.length} items`))),t!==null&&(s.writeln(""),t.concerns.length>0&&s.writeln(" Concerns: ",r(t.concerns.join(", "))),t.tools.length>0&&s.writeln(" Tools: ",r(t.tools.join(", ")))),e.decisions.length>0&&(s.writeln(""),s.writeln(` Decisions: ${e.decisions.length}`)),e.pendingClear&&(s.writeln(""),s.writeln(o(" \u26A0 Context clear pending \u2014 run `/clear`"))),await s.close()}else await w(k,"json");return g(void 0)};export{U as main};
@@ -1 +1 @@
1
- import{b as w}from"./chunk-LICLZJKZ.js";import{a as g}from"./chunk-UXRWSNVZ.js";import{k as u}from"./chunk-OJUA2UZK.js";import{c as m,d as r,f as c,g as n,o as p,q as d,r as f}from"./chunk-4IFPLK7L.js";import{a as o,b as a}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init",e))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
1
+ import{b as w}from"./chunk-ZQ77HAFD.js";import{a as g}from"./chunk-UXRWSNVZ.js";import{k as u}from"./chunk-WUVVLUU5.js";import{c as m,d as r,f as c,g as n,o as p,q as d,r as f}from"./chunk-EZH232V7.js";import{a as o,b as a}from"./chunk-2N4GTHXQ.js";import{b as l}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var v=async h=>{let s=p({renderer:f.ansi(),sink:d.stdout()}),t=l.process.cwd(),e=await u(t);if(e===null)return s.writeln(c("noskills is not initialized.")," Run: ",m(g("init",e))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await w(t,e.tools,e);for(let y of i)s.writeln(" ",n("\u2714"),` ${y}`);return i.length===0&&s.writeln(r(" No tools configured.")),s.writeln(""),s.writeln(n("Done.")),await s.close(),o(void 0)};export{v as main};
@@ -1,4 +1,4 @@
1
- import{a as S,c as E}from"./chunk-7ADGJB4H.js";import{a as C,c as M}from"./chunk-TGA7MX5P.js";import{e as T,k as y,r as b}from"./chunk-OJUA2UZK.js";import{a as x,b as k}from"./chunk-2N4GTHXQ.js";import{a as m}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=async e=>{let s=await T(e),l=await y(e),d=await L(e),o=null,u=null,n=0,c=0;if(s.spec!==null){let i=await S(e,s.spec);if(i!==null){n=i.tasks.length,c=s.execution.completedTasks.length;let a=E(i.tasks,s.execution.completedTasks);a!==null&&(o=a.id,u=a.title)}}let $=null;return s.lastCalledAt!==null&&($=Math.floor((Date.now()-new Date(s.lastCalledAt).getTime())/1e3)),{spec:s.spec,phase:s.phase,iteration:s.execution.iteration,activeTaskId:o,activeTaskTitle:u,totalTasks:n,completedTaskCount:c,lastProgress:s.execution.lastProgress,lastCalledAt:s.lastCalledAt,modifiedFiles:s.execution.modifiedFiles,debt:s.execution.debt,concerns:l?.concerns??[],maxIterations:l?.maxIterationsBeforeRestart??15,awaitingStatusReport:s.execution.awaitingStatusReport,pendingClear:s.pendingClear,verificationPassed:s.execution.lastVerification?.passed??null,decisionsCount:s.decisions.length,discoveryAnswered:s.discovery.answers.length,discoveryTotal:6,trackedFiles:d,timeSinceUpdate:$}},L=async e=>{let s=`${e}/.eser/.state/files-changed.jsonl`;try{let d=(await m.fs.readTextFile(s)).trim().split(`
1
+ import{a as S,c as E}from"./chunk-IVSTITPL.js";import{a as C,c as M}from"./chunk-42EQ3GZJ.js";import{e as T,k as y,r as b}from"./chunk-WUVVLUU5.js";import{a as x,b as k}from"./chunk-2N4GTHXQ.js";import{b as m}from"./chunk-UA3VIHYO.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=async e=>{let s=await T(e),l=await y(e),d=await L(e),o=null,u=null,n=0,c=0;if(s.spec!==null){let i=await S(e,s.spec);if(i!==null){n=i.tasks.length,c=s.execution.completedTasks.length;let a=E(i.tasks,s.execution.completedTasks);a!==null&&(o=a.id,u=a.title)}}let $=null;return s.lastCalledAt!==null&&($=Math.floor((Date.now()-new Date(s.lastCalledAt).getTime())/1e3)),{spec:s.spec,phase:s.phase,iteration:s.execution.iteration,activeTaskId:o,activeTaskTitle:u,totalTasks:n,completedTaskCount:c,lastProgress:s.execution.lastProgress,lastCalledAt:s.lastCalledAt,modifiedFiles:s.execution.modifiedFiles,debt:s.execution.debt,concerns:l?.concerns??[],maxIterations:l?.maxIterationsBeforeRestart??15,awaitingStatusReport:s.execution.awaitingStatusReport,pendingClear:s.pendingClear,verificationPassed:s.execution.lastVerification?.passed??null,decisionsCount:s.decisions.length,discoveryAnswered:s.discovery.answers.length,discoveryTotal:6,trackedFiles:d,timeSinceUpdate:$}},L=async e=>{let s=`${e}/.eser/.state/files-changed.jsonl`;try{let d=(await m.fs.readTextFile(s)).trim().split(`
2
2
  `).filter(Boolean),o=[];for(let u of d)try{let n=JSON.parse(u);o.includes(n.file)||o.push(n.file)}catch{}return o}catch{return[]}},F="\x1B[2J\x1B[H",I="\x1B[1m",r="\x1B[2m",t="\x1B[0m",f="\x1B[32m",p="\x1B[33m",w="\x1B[31m",P="\x1B[36m",O=e=>{switch(e){case"DONE":return f;case"BLOCKED":return w;case"EXECUTING":return P;default:return p}},A=(e,s,l)=>{if(s===0)return"\u2591".repeat(l);let d=Math.min(e/s,1),o=Math.round(d*l);return"\u2588".repeat(o)+"\u2591".repeat(l-o)},v=e=>e===null?"never":e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:`${Math.floor(e/3600)}h ago`,R=e=>{let s=[],d="\u2500".repeat(52);s.push(`${r}\u256D${d}\u256E${t}`),s.push(`${r}\u2502${t} ${I}noskills watch${t} \u2014 ${e.spec??"no active spec"}${r}${" ".repeat(Math.max(0,34-(e.spec?.length??15)))}\u2502${t}`);let o=O(e.phase);if(s.push(`${r}\u2502${t} Phase: ${o}${e.phase}${t}${" ".repeat(Math.max(0,42-e.phase.length))}${r}\u2502${t}`),e.phase==="DISCOVERY")s.push(`${r}\u2502${t} Discovery: ${e.discoveryAnswered}/${e.discoveryTotal} questions answered${" ".repeat(Math.max(0,14))}${r}\u2502${t}`);else if(e.phase==="SPEC_DRAFT")s.push(`${r}\u2502${t} ${p}Awaiting approval${t}${" ".repeat(Math.max(0,33))}${r}\u2502${t}`);else if(e.phase==="EXECUTING"||e.phase==="BLOCKED"){let n=A(e.completedTaskCount,e.totalTasks,12),c=e.totalTasks>0?Math.round(e.completedTaskCount/e.totalTasks*100):0,$=`${n} ${e.completedTaskCount}/${e.totalTasks} tasks (${c}%)`;if(s.push(`${r}\u2502${t} Progress: ${f}${$}${t}${" ".repeat(Math.max(0,40-$.length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} Iteration: ${e.iteration}${" ".repeat(Math.max(0,38-String(e.iteration).length))}${r}\u2502${t}`),e.activeTaskId!==null){let a=`${e.activeTaskId}${e.activeTaskTitle!==null?` (${e.activeTaskTitle})`:""}`.slice(0,36);s.push(`${r}\u2502${t} Active task: ${P}${a}${t}${" ".repeat(Math.max(0,36-a.length))}${r}\u2502${t}`)}if(e.phase==="BLOCKED"){let i=(e.lastProgress??"unknown").replace(/^BLOCKED:\s*/,"");s.push(`${r}\u2502${t} ${w}BLOCKED: ${i.slice(0,40)}${t}${" ".repeat(Math.max(0,40-i.slice(0,40).length))}${r}\u2502${t}`),s.push(`${r}\u2502${t} ${p}Human input needed${t}${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}}else e.phase==="DONE"&&s.push(`${r}\u2502${t} ${f}Complete!${t} ${e.iteration} iterations, ${e.decisionsCount} decisions${" ".repeat(Math.max(0,17-String(e.iteration).length-String(e.decisionsCount).length))}${r}\u2502${t}`);if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),s.push(`${r}\u2502${t} Last update: ${v(e.timeSinceUpdate)}${" ".repeat(Math.max(0,36-v(e.timeSinceUpdate).length))}${r}\u2502${t}`),e.lastProgress!==null){let n=e.lastProgress.slice(0,48);s.push(`${r}\u2502${t} ${r}${n}${t}${" ".repeat(Math.max(0,50-n.length))}${r}\u2502${t}`)}if(e.awaitingStatusReport&&s.push(`${r}\u2502${t} ${p}Status report pending${t}${" ".repeat(Math.max(0,29))}${r}\u2502${t}`),e.pendingClear&&s.push(`${r}\u2502${t} ${p}/clear pending${t}${" ".repeat(Math.max(0,36))}${r}\u2502${t}`),e.verificationPassed===!1&&s.push(`${r}\u2502${t} ${w}Verification failed${t}${" ".repeat(Math.max(0,31))}${r}\u2502${t}`),s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.debt!==null&&e.debt.items.length>0){s.push(`${r}\u2502${t} Debt: ${e.debt.items.length} item(s)${" ".repeat(Math.max(0,34))}${r}\u2502${t}`);for(let n of e.debt.items.slice(0,3)){let c=n.slice(0,44);s.push(`${r}\u2502${t} \u2514\u2500 ${c}${" ".repeat(Math.max(0,46-c.length))}${r}\u2502${t}`)}e.debt.items.length>3&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${e.debt.items.length-3} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(e.trackedFiles.length>0||e.modifiedFiles.length>0){let n=e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles;s.push(`${r}\u2502${t} Files changed: ${n.length}${" ".repeat(Math.max(0,34-String(n.length).length))}${r}\u2502${t}`);for(let c of n.slice(0,5)){let $=c.length>44?"..."+c.slice(-41):c;s.push(`${r}\u2502${t} \u2514\u2500 ${$}${" ".repeat(Math.max(0,46-$.length))}${r}\u2502${t}`)}n.length>5&&s.push(`${r}\u2502${t} \u2514\u2500 ... and ${n.length-5} more${" ".repeat(Math.max(0,32))}${r}\u2502${t}`)}if(s.push(`${r}\u2502${"".padEnd(52)}\u2502${t}`),e.concerns.length>0){let n=e.concerns.join(", ").slice(0,38);s.push(`${r}\u2502${t} Concerns: ${n}${" ".repeat(Math.max(0,40-n.length))}${r}\u2502${t}`)}let u=e.iteration>=e.maxIterations?`${w}RESTART RECOMMENDED${t}`:`${f}ok${t} (${e.iteration}/${e.maxIterations})`;return s.push(`${r}\u2502${t} Context: ${u}${" ".repeat(Math.max(0,41-u.replace(/\x1b\[[0-9;]*m/g,"").length))}${r}\u2502${t}`),s.push(`${r}\u2570${d}\u256F${t}`),s.push(` ${r}watching .eser/.state/ for changes... (ctrl+c to stop)${t}`),s.join(`
3
3
  `)},W=e=>JSON.stringify({ts:new Date().toISOString(),phase:e.phase,spec:e.spec,iteration:e.iteration,activeTask:e.activeTaskId,tasks:{completed:e.completedTaskCount,total:e.totalTasks},progress:e.lastProgress,debt:e.debt?.items.length??0,filesChanged:e.trackedFiles.length>0?e.trackedFiles:e.modifiedFiles,timeSinceUpdate:e.timeSinceUpdate,pendingClear:e.pendingClear,verificationPassed:e.verificationPassed}),J=async e=>{let s=m.process.cwd(),l=C(e);if(!await b(s)){let i=new TextEncoder,a=m.process.stdout.getWriter();return await a.write(i.encode(`noskills not initialized.
4
4
  `)),a.releaseLock(),k({exitCode:1})}let d=`${s}/.eser/.state`,o="",u=async()=>{let i=await D(s),a=l==="json"?W(i):l==="markdown"?M(i,"markdown"):R(i);if(l==="json"){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(a+`
package/noskills.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as t}from"./chunks/chunk-LZSLKXJE.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{a as s}from"./chunks/chunk-HS6FTDDW.js";import"./chunks/chunk-WV3HK5WR.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var i=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-XVNWKPT7.js")},status:{description:"Show current state",load:()=>import("./chunks/status-GQYCHJ2W.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-RTBL43T7.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-EO3BYTU5.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-5N5LJ2WQ.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-WWW3MXHP.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-VZO7YXM6.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-IBA3FUE5.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-NGOU3XMP.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-O6SYZE7T.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-7DNXJAAQ.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-JDMWRRGH.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-RKZ7SY3Z.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-AWHCXLLQ.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-YVHDEVR2.js")}}});var r={name:"@eser/noskills",version:"4.1.34",type:"module",exports:{".":"./main.ts","./mod":"./mod.ts","./module":"./module.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/primitives":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@eser/streams":"workspace:*",yaml:"^2"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16","@std/testing":"npm:@jsr/std__testing@^1.0.16"}};var p=i.toCommand("noskills",r.version),d=async()=>await p.parse();if(import.meta.main){let n=await d();o(n,{ok:()=>{},fail:e=>{e.message!==void 0&&console.error(e.message),s.process.setExitCode(e.exitCode)}})}export{d as main};
2
+ import{a as t}from"./chunks/chunk-GSYCN7EG.js";import{c as o}from"./chunks/chunk-2N4GTHXQ.js";import{b as s}from"./chunks/chunk-UA3VIHYO.js";import"./chunks/chunk-WV3HK5WR.js";import"./chunks/chunk-FDZP7B5Y.js";import"./chunks/chunk-ACQUINWH.js";import"./chunks/chunk-DXB73IDG.js";var i=new t({description:"noskills \u2014 state-machine orchestrator for AI agents",modules:{init:{description:"Initialize noskills in project",load:()=>import("./chunks/init-PVRN54IZ.js")},status:{description:"Show current state",load:()=>import("./chunks/status-EOXWE5UM.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-JET4WJSV.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-BZS3EN33.js")},approve:{description:"Approve phase transition",load:()=>import("./chunks/approve-YXRIBZVV.js")},block:{description:"Mark spec as blocked",load:()=>import("./chunks/block-D67USBJS.js")},reset:{description:"Reset current spec state",load:()=>import("./chunks/reset-CWI7K6GC.js")},done:{description:"Mark spec execution as complete",load:()=>import("./chunks/done-PTJRZ26W.js")},concern:{description:"Manage concerns (add, remove, list)",load:()=>import("./chunks/concern-4GBYLKWP.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-WLG5XKTM.js")},watch:{description:"Live dashboard for monitoring agent progress",load:()=>import("./chunks/watch-5OC7T473.js")},sync:{description:"Regenerate tool-specific files",load:()=>import("./chunks/sync-RWNLL4VW.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-JSAHNTXI.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-5VXI4CPD.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-GP665FCC.js")}}});var r={name:"@eser/noskills",version:"4.1.36",type:"module",exports:{".":"./main.ts","./mod":"./mod.ts","./module":"./module.ts"},dependencies:{"@eser/ai":"workspace:*","@eser/primitives":"workspace:*","@eser/shell":"workspace:*","@eser/standards":"workspace:*","@eser/streams":"workspace:*",yaml:"^2"},devDependencies:{"@std/assert":"npm:@jsr/std__assert@^1.0.16","@std/testing":"npm:@jsr/std__testing@^1.0.16"}};var p=i.toCommand("noskills",r.version),d=async()=>await p.parse();if(import.meta.main){let n=await d();o(n,{ok:()=>{},fail:e=>{e.message!==void 0&&console.error(e.message),s.process.setExitCode(e.exitCode)}})}export{d as main};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noskills",
3
- "version": "4.1.34",
3
+ "version": "4.1.36",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "noskills": "./noskills.js"
@@ -1 +0,0 @@
1
- import{g as k}from"./chunk-HLQNHWXS.js";import{a as g}from"./chunk-UXRWSNVZ.js";import{e as w,f,k as h}from"./chunk-OJUA2UZK.js";import{c as i,d as m,f as l,h as c,o as p,q as d,r as u}from"./chunk-4IFPLK7L.js";import{a as o,b as n}from"./chunk-2N4GTHXQ.js";import{a}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var $=async b=>{let e=p({renderer:u.ansi(),sink:d.stdout()}),s=a.process.cwd(),r=b?.join(" ")??"No reason given",t=await w(s),x=await h(s);if(t.phase!=="EXECUTING")return e.writeln(l(`Cannot block in phase: ${t.phase}`)),await e.close(),n({exitCode:1});let y=k(t,r);return await f(s,y),e.writeln(c("\u26A0")," Spec blocked: ",m(r)),e.writeln("Resolve with: ",i(`${g('next --answer="resolution"',x)}`)),await e.close(),o(void 0)};export{$ as main};
@@ -1 +0,0 @@
1
- import{b as I,c as D}from"./chunk-WV3HK5WR.js";import{a as N,b as f}from"./chunk-FDZP7B5Y.js";import{a as m,b as T,c as A,d as S}from"./chunk-ACQUINWH.js";import{d as Y}from"./chunk-DXB73IDG.js";var J={};Y(J,{AlreadyExistsError:()=>A,NotFoundError:()=>T,ProcessError:()=>S,RuntimeCapabilityError:()=>m,buildCommand:()=>P,clearWorkerdEnv:()=>D,createRuntime:()=>G,current:()=>xe,detectExecutionContext:()=>V,detectInvoker:()=>C,detectRuntime:()=>a,getArch:()=>y,getCliCommand:()=>q,getHomedir:()=>R,getPlatform:()=>u,getPlatformInfo:()=>U,getRuntimeVersion:()=>M,getTmpdir:()=>v,isBrowser:()=>W,isCommandInPath:()=>c,isEdge:()=>B,isRuntime:()=>_,isServer:()=>j,populateEnvFromContext:()=>I,posixPath:()=>f,resolvePathDirs:()=>b,runtime:()=>o,searchFileHierarchy:()=>$,toPosix:()=>N});var i=globalThis,Z=()=>typeof i.caches<"u"&&typeof i.Request<"u"&&typeof i.Response<"u"&&typeof i.window>"u"&&typeof i.document>"u",ee=()=>typeof i.window<"u"||typeof i.document<"u",a=()=>{if(typeof globalThis>"u")return"unknown";if(typeof i.Bun<"u")return"bun";if(typeof i.Deno<"u")return"deno";let e=i.process;return e?.versions?.node&&!e?.versions?.bun?"node":Z()?"workerd":ee()?"browser":"unknown"},ne={deno:()=>i.Deno?.version?.deno??"unknown",bun:()=>i.Bun?.version??"unknown",node:()=>i.process?.versions?.node??"unknown",workerd:()=>"unknown",browser:()=>i.navigator?.userAgent??"unknown",unknown:()=>"unknown"},M=()=>ne[a()](),_=e=>a()===e,W=()=>a()==="browser",te=new Set(["deno","node","bun"]),j=()=>te.has(a()),B=()=>a()==="workerd";var oe=e=>{if(typeof Deno<"u"&&Deno.env?.get)return Deno.env.get(e);let n=globalThis.process;if(n?.env)return n.env[e]},x=(...e)=>{for(let n of e){let t=oe(n);if(t!==void 0)return t}},g=e=>{try{let n=globalThis.require;if(n instanceof Function)return n(e)}catch{}},w=()=>globalThis.process,h=()=>globalThis.navigator;var H={darwin:"darwin",linux:"linux",windows:"windows",win32:"windows"},u=()=>{if(typeof Deno<"u"&&Deno.build?.os)return H[Deno.build.os]??"linux";let e=w();if(e?.platform)return H[e.platform]??"linux";let n=h();if(n?.userAgent){let t=n.userAgent.toLowerCase();if(t.includes("mac"))return"darwin";if(t.includes("win"))return"windows";if(t.includes("linux"))return"linux"}return"linux"},L={x86_64:"amd64",x64:"amd64",aarch64:"arm64",arm64:"arm64"},y=()=>{if(typeof Deno<"u"&&Deno.build?.arch)return L[Deno.build.arch]??"amd64";let e=w();if(e?.arch)return L[e.arch]??"amd64";let n=h();if(n?.userAgent){let t=n.userAgent.toLowerCase();if(t.includes("arm64")||t.includes("aarch64"))return"arm64"}return"amd64"},R=()=>{let e=x("HOME","USERPROFILE");if(e)return e;let n=g("os");return n?.homedir?n.homedir():u()==="windows"?"C:\\Users\\Default":"/home"},v=()=>{let e=x("TMPDIR","TMP","TEMP");if(e)return e;let n=g("os");return n?.tmpdir?n.tmpdir():u()==="windows"?"C:\\Windows\\Temp":"/tmp"},U=()=>({platform:u(),arch:y(),homedir:R(),tmpdir:v()});var $=async(e,n,t={})=>{let{searchParents:r=!1}=t,s=e;for(;;){for(let l of n){let p=o.path.join(s,l);if(await o.fs.exists(p)&&(await o.fs.stat(p)).isFile)return p}if(!r)break;let d=o.path.dirname(s);if(d===s)break;s=d}};var b=(e,n)=>{let t=n==="windows"?";":":";return e.split(t).filter(r=>r.length>0)},C=(e,n,t,r,s)=>{if(t)return{invoker:"binary",mode:"installed"};if(n==="bun")return e.BUN_INSTALL!==void 0?{invoker:"bun",mode:"installed"}:{invoker:"bunx",mode:"on-demand"};if(n==="node"){let d=e.npm_execpath??"";return d.includes("npx")?{invoker:"npx",mode:"on-demand"}:d.includes("pnpm")?{invoker:"pnpx",mode:"on-demand"}:(e.npm_config_user_agent??"").includes("pnpm")?{invoker:"pnpm",mode:"installed"}:{invoker:"npm",mode:"installed"}}return n==="deno"?r!==void 0&&(r.startsWith("jsr:")||r.startsWith("https:"))?{invoker:"deno",mode:"on-demand"}:s===!0?{invoker:"dev",mode:"dev"}:{invoker:"deno",mode:"installed"}:{invoker:"unknown",mode:"installed"}},P=(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,c=async e=>{let n=u(),t=n==="windows"?`${e}.exe`:e,r=o.env.get("PATH")??"",s=b(r,n);for(let d of s)try{return await o.fs.stat(o.path.join(d,t)),!0}catch{continue}return!1},q=async e=>await c(e.command)?e.command:await c("npx")?`npx ${e.npmPackage}`:await c("pnpx")?`pnpx ${e.npmPackage}`:await c("bunx")?`bunx ${e.npmPackage}`:await c("deno")?`deno run --allow-all jsr:${e.jsrPackage}`:e.command,V=async e=>{let n=import.meta.filename===void 0,t=a(),r=import.meta.url,s={BUN_INSTALL:o.env.get("BUN_INSTALL"),npm_execpath:o.env.get("npm_execpath"),npm_config_user_agent:o.env.get("npm_config_user_agent")},d=!1;if(t==="deno"&&r.startsWith("file://"))try{let z=o.process.cwd(),Q=o.path.join(z,"deno.json"),X=await o.fs.readTextFile(Q),F=JSON.parse(X).tasks;F!==void 0&&"cli"in F&&(d=!0)}catch{}let{invoker:l,mode:p}=C(s,t,n,r,d),E=n?"compiled":["deno","node","bun"].includes(t)?t:"deno",O=P(l,p,e),K=await c(e.command);return{runtime:E,mode:p,invoker:l,command:O,isInPath:K}};var k=(e,n)=>()=>{throw new m(e,n)},se=e=>{let n=k("fs",e);return{readFile:n,readTextFile:n,writeFile:n,writeTextFile:n,exists:n,stat:n,lstat:n,mkdir:n,ensureDir:n,remove:n,readDir:n,copyFile:n,rename:n,makeTempDir:n,realPath:n,watch:n,walk:n,chmod:n}},ae=e=>{let n=k("exec",e);return{spawn:n,exec:n,execJson:n,spawnChild:n}},de=e=>{let n=k("process",e);return{exit:n,setExitCode:n,cwd:n,chdir:n,hostname:n,execPath:n,get args(){throw new m("process",e)},get pid(){throw new m("process",e)},get stdin(){throw new m("process",e)},get stdout(){throw new m("process",e)},get stderr(){throw new m("process",e)},isTerminal(){return!1},setStdinRaw(){throw new m("process",e)}}},me=()=>({get:()=>{},set:()=>{},delete:()=>{},has:()=>!1,toObject:()=>({})}),ce=e=>({name:e,version:"unknown",capabilities:{fs:!1,fsSync:!1,exec:!1,process:!1,env:!1,stdin:!1,stdout:!1,kv:!1},fs:se(e),path:f,exec:ae(e),env:me(),process:de(e)}),ue={deno:async()=>(await import("./deno-5VR3ZY4Z.js")).createDenoRuntime(),node:async()=>(await import("./node-MZTU6BAB.js")).createNodeRuntime(),bun:async()=>(await import("./bun-KVGAHBUF.js")).createBunRuntime(),workerd:async()=>(await import("./workerd-QUMEG65S.js")).createWorkerdRuntime(),browser:async()=>(await import("./browser-JYFQKVFU.js")).createBrowserRuntime()},pe=["fs","exec","env","path","process"],le=e=>e!==void 0&&pe.some(n=>e[n]!==void 0),fe=(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}),G=async e=>{let n=a(),t=ue[n],r=t!==void 0?await t():ce(n),s=e?.capabilities?{...r.capabilities,...e.capabilities}:r.capabilities;return e!==void 0&&le(e)?fe(r,e,s):e?.capabilities?{...r,capabilities:s}:r},o=await G(),xe=o;export{o as a,J as b};
@@ -1 +0,0 @@
1
- import{b as P,d as S}from"./chunk-BLHOTPRB.js";import{c as k,d as C}from"./chunk-PSXXTDLU.js";import{a as O}from"./chunk-UXRWSNVZ.js";var I=null,n=e=>O(e,I),T="NEVER run git write commands (commit, add, push, checkout, stash, reset, merge, rebase, cherry-pick). Git is read-only for agents. The user controls git. You may read: git log, git diff, git status, git show, git blame.",$=(e,o,r,i)=>{let l=e.execution.iteration>=o,s=r?[]:[T],u=i?.outOfScope??[];switch(e.phase){case"IDLE":return{rules:[...s,"Present options to the user using your native interactive question tool (AskUserQuestionTool or equivalent). Do NOT list them as a text table or numbered list.","If no interactive question tool is available, fall back to a concise numbered list.","Do not take action without the user choosing an option first."],tone:"Welcoming. Present choices, then wait."};case"DISCOVERY":return{rules:[...s,"Ask the question exactly as written. Do not rephrase or add your own questions.","Relay the user's answer back verbatim. Do not interpret or summarize.","Do not start coding or exploring the codebase. Discovery is conversation only."],tone:"Conversational. You are a messenger between noskills and the user."};case"SPEC_DRAFT":return{rules:[...s,"Present the spec to the user for review. Do not modify it.","If the user requests changes, relay them \u2014 do not implement them.","Do not start coding. The spec must be approved first."],tone:"Brief. The user is reviewing, not discussing."};case"SPEC_APPROVED":return{rules:[...s,"The spec is approved but execution has not started.","Do not start coding until the user triggers execution.","If the user wants changes, they must reset and re-spec."],tone:"Patient. Wait for the go signal."};case"EXECUTING":{let a=[...s,"Do not explore the codebase beyond what the current task requires.","Do not refactor, improve, or modify code outside this task's scope.","Do not add features, tests, or documentation not specified in the spec.","If you need to read files to understand context, timebox it \u2014 then write code.","The deliverable is working code, not a plan or analysis.","Complete the task, then report progress. The user handles git.",`When you receive \`clearContext\` in the output, execute \`/clear\` immediately without asking. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\`.`,`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: \`${n('rule add "<description>"')}\`. If just this task, note it and move on. Never write to \`.eser/rules/\` directly.`];e.execution.lastVerification?.passed===!1&&a.push("Tests are failing. Fix ONLY the failing tests. Do not refactor passing code.");let t={rules:a,tone:"Direct. No preamble. Start coding immediately.",outOfScope:u.length>0?u:void 0};return l?{...t,urgency:`You have been in this session for ${e.execution.iteration}+ iterations. Your context is degrading. Finish the current task and recommend the user start a fresh session. Do not start new tasks.`}:t}case"BLOCKED":return{rules:[...s,"Present the decision to the user exactly as described.","Do not suggest a preferred option unless the user asks for your opinion.","After the user decides, relay the answer immediately. Do not elaborate."],tone:"Brief. The user is making a decision, not having a discussion."};case"DONE":return{rules:[...s,"Report the completion summary. Do not start new work.","If the user wants to continue, they start a new spec."],tone:"Concise. Celebrate briefly, then stop."};default:return{rules:[...s,`Run \`${n("next")}\` to get your instructions.`,"Do not take action without noskills guidance."],tone:"Neutral. Waiting for direction."}}},N=5*60*1e3,B=(e,o)=>{let r;switch(e.phase){case"IDLE":r=`No active spec. Start one with: \`${n("spec new")}\``;break;case"DISCOVERY":r=`Discovery in progress for "${e.spec}". ${e.discovery.answers.length} questions answered so far.`;break;case"SPEC_DRAFT":r=`Spec draft ready for review at ${e.specState.path}. Waiting for approval.`;break;case"SPEC_APPROVED":r=`Spec "${e.spec}" is approved. Waiting to start execution.`;break;case"EXECUTING":r=e.execution.lastProgress!==null?`Executing "${e.spec}", iteration ${e.execution.iteration}. Last progress: ${e.execution.lastProgress}. Continue with the current task.`:`Executing "${e.spec}", iteration ${e.execution.iteration}. Start the first task.`;break;case"BLOCKED":r=`Execution blocked: ${e.execution.lastProgress}. Ask the user to resolve.`;break;case"DONE":r=`Spec "${e.spec}" completed in ${e.execution.iteration} iterations.`;break;default:r=`Run \`${n("next")}\` to get started.`}return{protocol:`Run \`${n('next --answer="..."')}\` to submit results and advance`,spec:e.spec,branch:e.branch,iteration:e.execution.iteration,lastProgress:e.execution.lastProgress,activeConcerns:o.map(i=>i.id),resumeHint:r}},F=e=>{if(e.lastCalledAt===null)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase};let o=new Date(e.lastCalledAt).getTime();if(Date.now()-o>N)return{what:"noskills orchestrates your work: IDLE \u2192 DISCOVERY \u2192 SPEC_DRAFT \u2192 SPEC_APPROVED \u2192 EXECUTING \u2192 DONE",how:`Run \`${n("next")}\` for instructions. Submit results with \`${n('next --answer="..."')}\`. Never make architectural decisions without asking.`,currentPhase:e.phase}},Q=(e,o,r,i,l,s)=>{I=i??null;let u=B(e,o),a=i?.maxIterationsBeforeRestart??15,t=i?.allowGit??!1,h=$(e,a,t,l),f=F(e),d;switch(e.phase){case"IDLE":d=R(o);break;case"DISCOVERY":d=q(e,o,r);break;case"SPEC_DRAFT":d=L(e);break;case"SPEC_APPROVED":d=_(e);break;case"EXECUTING":d=G(e,o,r,a,l,s);break;case"BLOCKED":d=Y(e);break;case"DONE":d=j(e);break;default:d=R(o)}let m={...d,meta:u,behavioral:h};return f!==void 0&&(m={...m,protocolGuide:f}),e.pendingClear&&(m={...m,clearContext:{action:"clear_context",reason:`Task complete. Run \`/clear\` now. After clearing, read \`CLAUDE.md\` and run \`${n("next")}\` to continue.`},instruction:`Task accepted. Run \`/clear\` immediately to start fresh for the next task. After clearing, run \`${n("next")}\`.`}),m},R=e=>({phase:"IDLE",instruction:"Present the following options to the user using your interactive question tool. Do NOT list them as a text table.",interactiveOptions:[{label:"Start a new feature spec",command:n('spec new "description"')},{label:"Add project concerns",command:n("concern add <id>")},{label:"Add a coding convention",command:n('rule add "rule"')},{label:"Check project status",command:n("status")}],hint:e.length===0?"No concerns active. Consider adding concerns first \u2014 they shape discovery questions and specs.":void 0}),q=(e,o,r)=>{let i=P(o),l=e.discovery.answers.length;if(S(e.discovery.answers))return{phase:"DISCOVERY",instruction:`All discovery questions answered. Run: \`${n("approve")}\``,questions:[],answeredCount:l,context:{rules:r,concernReminders:[]},transition:{onComplete:n("approve")}};let u=new Set(e.discovery.answers.map(t=>t.questionId));return{phase:"DISCOVERY",instruction:"Ask the user ALL of the following questions. Collect answers for each, then submit them all at once as a JSON object.",questions:i.filter(t=>!u.has(t.id)).map(t=>({id:t.id,text:t.text,concerns:[...t.concerns],extras:t.extras.map(h=>h.text)})),answeredCount:l,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"status_quo":"...","ambition":"...",...}'`)}`}}},L=e=>e.classification===null?{phase:"SPEC_DRAFT",instruction:"Before generating the spec, classify what this spec involves. Ask the user to select all that apply.",specPath:e.specState.path??"",transition:{onApprove:`${n(`next --answer='{"involvesUI":false,"involvesPublicAPI":false,"involvesMigration":false,"involvesDataHandling":false}'`)}`},classificationRequired:!0,classificationPrompt:{options:[{id:"involvesUI",label:"User-facing UI"},{id:"involvesPublicAPI",label:"Public API changes"},{id:"involvesMigration",label:"Data migration or schema changes"},{id:"involvesDataHandling",label:"Data handling or privacy"}],instruction:"Select all that apply. Submit as JSON: `"+n(`next --answer='{"involvesUI":true,"involvesPublicAPI":false,...}'`)+"`"}}:{phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:e.specState.path??"",transition:{onApprove:n("approve")}},_=e=>({phase:"SPEC_APPROVED",instruction:"Spec is approved and ready. When the user is ready to start, begin execution.",specPath:e.specState.path??"",transition:{onStart:`${n('next --answer="start"')}`}}),U=(e,o)=>{if(o===null)return!1;switch(e){case"beautiful-product":return o.involvesUI;case"open-source":return o.involvesPublicAPI;case"long-lived":return o.involvesMigration;case"compliance":return o.involvesDataHandling;default:return!0}},V=(e,o,r,i,l,s,u)=>{let a=[];if(i!==null)for(let t of i.items)a.push(`[DEBT from iteration ${i.fromIteration}] ${t}`);if(o&&a.push(`[FAILED] Tests \u2014 fix this first: ${r.slice(0,200)}`),s!=null)for(let t of s.verification)a.push(t);for(let t of e)if(U(t.id,l)&&t.acceptanceCriteria!==void 0&&t.acceptanceCriteria.length>0)for(let h of t.acceptanceCriteria)a.push(`(${t.id}) ${h}`);if(u!==void 0)for(let t of u)a.push(`(folder: ${t.folder}) ${t.rule}`);return a},G=(e,o,r,i,l,s)=>{let u=C(o),a=e.execution.iteration>=i,t=e.execution.lastVerification?.passed===!1,h=e.execution.lastVerification?.output??"",f=l?.tasks??[],d=e.execution.completedTasks??[],m=new Set(d),D=f.find(p=>!m.has(p.id))??null,y=D!==null?{id:D.id,title:D.title,totalTasks:f.length,completedTasks:d.length}:void 0;if(e.execution.awaitingStatusReport){let p=V(o,t,h,e.execution.debt,e.classification,l,s),b={phase:"EXECUTING",instruction:"Before this task is accepted, report your completion status against these acceptance criteria.",context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n(`next --answer='{"completed":[...],"remaining":[...],"blocked":[...]}'`)}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration},statusReportRequired:!0,statusReport:{criteria:p,reportFormat:{completed:"list items you finished with evidence (file exists, test passes)",remaining:"list items not yet done",blocked:"list items that need a decision from the user"}}};return t&&(b={...b,verificationFailed:!0,verificationOutput:h.slice(0,2e3)}),b}let w=(e.execution.lastProgress??"").includes("Task not accepted"),x=e.execution.debt?.items??[],E=e.execution.debt?.unaddressedIterations??0,A=y!==void 0?`Execute task ${y.id}: ${y.title} (${y.completedTasks}/${y.totalTasks} completed)`:"All tasks completed. Run `"+n("done")+"` to finish.",v;if(t)v="Verification FAILED. Fix the failing tests before continuing.";else if(w&&x.length>0){let p=E>=3?` These items have been outstanding for ${E} iterations.`:"";v=`Task not accepted \u2014 ${x.length} remaining item(s) must be addressed before this task can be completed.${p} Address them, then submit a new status report.`}else v=A;let c={phase:"EXECUTING",instruction:v,task:y,context:{rules:r,concernReminders:k(o)},transition:{onComplete:`${n('next --answer="..."')}`,onBlocked:`${n('block "reason"')}`,iteration:e.execution.iteration}};if(w&&x.length>0&&(c={...c,taskRejected:!0,rejectionReason:`${x.length} remaining item(s) must be addressed.`,rejectionRemaining:x}),e.execution.debt!==null&&e.execution.debt.items.length>0){let p=e.execution.debt.unaddressedIterations??0,b=p>=3?`URGENT: These items have been unaddressed for ${p} iterations. Address them IMMEDIATELY before any new work.`:"These were not completed in a previous iteration. Address them BEFORE starting new work.";c={...c,previousIterationDebt:{fromIteration:e.execution.debt.fromIteration,items:e.execution.debt.items,note:b}}}if(t){let p=h.slice(0,2e3);c={...c,verificationFailed:!0,verificationOutput:p}}u.length>0&&(c={...c,concernTensions:u}),a&&(c={...c,restartRecommended:!0,restartInstruction:`Context may be getting large after ${e.execution.iteration} iterations. Consider starting a new conversation and running \`${n("next")}\` to resume - your progress is saved.`});let g=[...e.decisions].reverse().find(p=>!p.promoted);return g!==void 0&&e.execution.lastProgress?.startsWith("Resolved:")&&(c={...c,promotePrompt:{decisionId:g.id,question:g.question,choice:g.choice,prompt:`You just resolved a decision: "${g.choice}". Ask the user: "Should this be a permanent rule for future specs too?" If yes, run: \`${n(`rule add "${g.choice}"`)}\``}}),c},Y=e=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:e.execution.lastProgress??"Unknown",transition:{onResolved:`${n('next --answer="..."')}`}}),j=e=>({phase:"DONE",summary:{spec:e.spec,iterations:e.execution.iteration,decisionsCount:e.decisions.length}});export{Q as a};
@@ -1 +0,0 @@
1
- import{a as C}from"./chunk-PSXXTDLU.js";import{a as y,b as P}from"./chunk-UXRWSNVZ.js";import{k as g,l as b,m as A,n as x}from"./chunk-OJUA2UZK.js";import{c,d as o,f as u,g as v,o as p,q as m,r as w}from"./chunk-4IFPLK7L.js";import{a,b as d}from"./chunk-2N4GTHXQ.js";import{a as f}from"./chunk-HS6FTDDW.js";import"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var q=async r=>{let e=r?.[0];if(e==="add")return await $(r?.slice(1));if(e==="remove")return await M(r?.slice(1));if(e==="list")return await I();let i=await g(f.process.cwd()),n=P(i),s=p({renderer:w.ansi(),sink:m.stdout()});return s.writeln(`Usage: ${n} concern <add <id> | remove <id> | list>`),await s.close(),a(void 0)},$=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern add open-source",s))),await e.close(),d({exitCode:1});let t=await A(i,n);if(t===null&&(t=(await C()).find(h=>h.id===n)??null,t!==null&&await x(i,t)),t===null){let k=await C();return e.writeln(u(`Unknown concern: ${n}`)),k.length>0&&e.writeln(o(` Available: ${k.map(h=>h.id).join(", ")}`)),await e.close(),d({exitCode:1})}if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is already active.`)),await e.close(),a(void 0);let l={...s,concerns:[...s.concerns,n]};return await b(i,l),e.writeln(v("\u2714")," Activated concern: ",c(n)),e.writeln(o(` ${t.description}`)),await e.close(),a(void 0)},M=async r=>{let e=p({renderer:w.ansi(),sink:m.stdout()}),i=f.process.cwd(),n=r?.[0],s=await g(i);if(n===void 0||n.length===0)return e.writeln(u("Please provide a concern ID: "),c(y("concern remove move-fast",s))),await e.close(),d({exitCode:1});if(s===null)return e.writeln(u("noskills not initialized.")),await e.close(),d({exitCode:1});if(!s.concerns.includes(n))return e.writeln(o(`Concern "${n}" is not active.`)),await e.close(),a(void 0);let t={...s,concerns:s.concerns.filter(l=>l!==n)};return await b(i,t),e.writeln(v("\u2714")," Deactivated concern: ",c(n)),await e.close(),a(void 0)},I=async()=>{let r=p({renderer:w.ansi(),sink:m.stdout()}),e=f.process.cwd(),i=await g(e),n=await C(),s=i?.concerns??[];if(r.writeln(c("Concerns")),r.writeln(""),n.length===0)r.writeln(o(" No concerns defined."));else for(let t of n){let l=s.includes(t.id);r.writeln(" ",l?v("\u25CF"):o("\u25CB")," ",l?c(t.id):o(t.id),o(` ${t.description.slice(0,60)}...`))}return await r.close(),a(void 0)};export{q as main};