noskills 4.1.27 → 4.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +659 -2
- package/chunks/approve-5N5LJ2WQ.js +1 -0
- package/chunks/{ask-Q7AVFBH5.js → ask-TR4ZPBU5.js} +1 -1
- package/chunks/block-WWW3MXHP.js +1 -0
- package/chunks/{browser-XCMD2IZQ.js → browser-JYFQKVFU.js} +1 -1
- package/chunks/bun-KVGAHBUF.js +1 -0
- package/chunks/chunk-4IFPLK7L.js +39 -0
- package/chunks/chunk-5ORUHRWF.js +3 -0
- package/chunks/{chunk-FEWVQ5CW.js → chunk-6C2MLMD6.js} +2 -2
- package/chunks/chunk-6QFROYLO.js +1 -0
- package/chunks/chunk-7ADGJB4H.js +2 -0
- package/chunks/chunk-AB4ZUDV6.js +1 -0
- package/chunks/{chunk-N4POD6ZW.js → chunk-AT7V3AKV.js} +1 -1
- package/chunks/chunk-HLQNHWXS.js +1 -0
- package/chunks/{chunk-FPO2JRU3.js → chunk-HS6FTDDW.js} +1 -1
- package/chunks/chunk-I6ISQXVP.js +1 -0
- package/chunks/chunk-KBNVVXFC.js +3 -0
- package/chunks/chunk-LBOCIPVF.js +1 -0
- package/chunks/{chunk-TNKUKNM4.js → chunk-LZSLKXJE.js} +1 -1
- package/chunks/chunk-M2ZPJN26.js +1 -0
- package/chunks/chunk-OJUA2UZK.js +144 -0
- package/chunks/chunk-QEEZKZXM.js +12 -0
- package/chunks/{chunk-RAI7PS2P.js → chunk-RVIPYZ7F.js} +1 -1
- package/chunks/chunk-TGA7MX5P.js +4 -0
- package/chunks/chunk-UXRWSNVZ.js +1 -0
- package/chunks/{chunk-SG4G3OOO.js → chunk-WV3HK5WR.js} +1 -1
- package/chunks/{claude-code-AFPWU2BS.js → claude-code-3XV3QOZJ.js} +1 -1
- package/chunks/concern-P4L2VWAE.js +1 -0
- package/chunks/{deno-H6NPLC5O.js → deno-5VR3ZY4Z.js} +1 -1
- package/chunks/done-IBA3FUE5.js +1 -0
- package/chunks/init-HS26Q2YL.js +1 -0
- package/chunks/invoke-hook-JZBFLW46.js +9 -0
- package/chunks/{kiro-WSWAMBP2.js → kiro-IXVNKPRT.js} +1 -1
- package/chunks/list-UT3MSC6R.js +1 -0
- package/chunks/mod-LUIKS5KC.js +1 -0
- package/chunks/next-ZZAZ6ZVW.js +3 -0
- package/chunks/node-MZTU6BAB.js +1 -0
- package/chunks/{ollama-ZD3BKKDE.js → ollama-K4QCYLVL.js} +1 -1
- package/chunks/{opencode-TJR46E7H.js → opencode-QBVD5FAD.js} +1 -1
- package/chunks/purge-FBZME5ZJ.js +4 -0
- package/chunks/reset-VZO7YXM6.js +1 -0
- package/chunks/rule-4D2CRBI4.js +2 -0
- package/chunks/run-LEX6S5D7.js +3 -0
- package/chunks/spec-RTBL43T7.js +1 -0
- package/chunks/status-B4YAFCOQ.js +1 -0
- package/chunks/sync-XMUP5YHZ.js +1 -0
- package/chunks/watch-7DNXJAAQ.js +8 -0
- package/chunks/{workerd-LKKH32SO.js → workerd-QUMEG65S.js} +1 -1
- package/noskills.js +1 -1
- package/package.json +1 -1
- package/chunks/approve-JJTQKJU6.js +0 -1
- package/chunks/block-4I5XBXK7.js +0 -1
- package/chunks/bun-YFFBDKUJ.js +0 -1
- package/chunks/chunk-BK2BDHKB.js +0 -1
- package/chunks/chunk-JYJTZEC4.js +0 -32
- package/chunks/chunk-LXVBR775.js +0 -1
- package/chunks/chunk-NGURBONB.js +0 -6
- package/chunks/chunk-PQQKC72V.js +0 -10
- package/chunks/init-QCOPTDGO.js +0 -1
- package/chunks/list-UVJ2Q5KF.js +0 -1
- package/chunks/next-DNJGG34Q.js +0 -3
- package/chunks/node-SMAAGOR3.js +0 -1
- package/chunks/reset-WLKKKEUZ.js +0 -1
- package/chunks/rule-3VERAMM3.js +0 -2
- package/chunks/spec-P6YE224I.js +0 -1
- package/chunks/status-CJMMUOTY.js +0 -1
- package/chunks/sync-BZ3Z5YQP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as G}from"./chunk-T7K64JD5.js";import{b as D,d as Q}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";function X(){let e=globalThis,r=e.Deno?.build?.os;return typeof r=="string"?r==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var A=X();function C(e){if(typeof e!="string")throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function H(e,r){if(r.length>=e.length)return e;let t=e.length-r.length;for(let o=r.length-1;o>=0;--o)if(e.charCodeAt(t+o)!==r.charCodeAt(o))return e;return e.slice(0,-r.length)}function k(e,r,t=0){let o=!1,s=e.length;for(let i=e.length-1;i>=t;--i)if(r(e.charCodeAt(i))){if(o){t=i+1;break}}else o||(o=!0,s=i+1);return e.slice(t,s)}function L(e,r){if(C(e),e.length===0)return e;if(typeof r!="string")throw new TypeError(`Suffix must be a string, received "${JSON.stringify(r)}"`)}function U(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function P(e){return e=U(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function S(e,r){if(e.length<=1)return e;let t=e.length;for(let o=e.length-1;o>0&&r(e.charCodeAt(o));o--)t=o;return e.slice(0,t)}function p(e){return e===47}function Y(e,r=""){e instanceof URL&&(e=P(e)),L(e,r);let t=k(e,p),o=S(t,p);return r?H(o,r):o}function V(e){return e===47}function m(e){return e===47||e===92}function R(e){return e>=97&&e<=122||e>=65&&e<=90}function E(e){e=U(e);let r=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(r=`\\\\${e.hostname}${r}`),r}function q(e,r=""){e instanceof URL&&(e=E(e)),L(e,r);let t=0;if(e.length>=2){let i=e.charCodeAt(0);R(i)&&e.charCodeAt(1)===58&&(t=2)}let o=k(e,m,t),s=S(o,m);return r?H(s,r):s}function ee(e,r=""){return A?q(e,r):Y(e,r)}var re=A?";":":",B=A?"\\":"/";function W(e){if(C(e),e.length===0)return"."}function te(e){e instanceof URL&&(e=P(e)),W(e);let r=-1,t=!1;for(let o=e.length-1;o>=1;--o)if(p(e.charCodeAt(o))){if(t){r=o;break}}else t=!0;return r===-1?p(e.charCodeAt(0))?"/":".":S(e.slice(0,r),p)}function oe(e){e instanceof URL&&(e=E(e)),W(e);let r=e.length,t=-1,o=-1,s=!0,i=0,f=e.charCodeAt(0);if(r>1)if(m(f)){if(t=i=1,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return e;n!==l&&(t=i=n+1)}}}}else R(f)&&e.charCodeAt(1)===58&&(t=i=2,r>2&&m(e.charCodeAt(2))&&(t=i=3));else if(m(f))return e;for(let n=r-1;n>=i;--n)if(m(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return S(e.slice(0,o),V)}function ie(e){return A?oe(e):te(e)}function ne(e){e instanceof URL&&(e=P(e)),C(e);let r=-1,t=0,o=-1,s=!0,i=0;for(let f=e.length-1;f>=0;--f){let n=e.charCodeAt(f);if(p(n)){if(!s){t=f+1;break}continue}o===-1&&(s=!1,o=f+1),n===46?r===-1?r=f:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||o===-1||i===0||i===1&&r===o-1&&r===t+1?"":e.slice(r,o)}function se(e){e instanceof URL&&(e=E(e)),C(e);let r=0,t=-1,o=0,s=-1,i=!0,f=0;e.length>=2&&e.charCodeAt(1)===58&&R(e.charCodeAt(0))&&(r=o=2);for(let n=e.length-1;n>=r;--n){let l=e.charCodeAt(n);if(m(l)){if(!i){o=n+1;break}continue}s===-1&&(i=!1,s=n+1),l===46?t===-1?t=n:f!==1&&(f=1):t!==-1&&(f=-1)}return t===-1||s===-1||f===0||f===1&&t===s-1&&t===o+1?"":e.slice(t,s)}function fe(e){return A?se(e):ne(e)}function N(e,r){let t=r.dir||r.root,o=r.base||(r.name??"")+(r.ext??"");return t?o===e?t:t===r.root?t+o:t+e+o:o}function $(e){if(e===null||typeof e!="object")throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof e}"`)}function ae(e){return $(e),N("/",e)}function le(e){return $(e),N("\\",e)}function ce(e){return A?le(e):ae(e)}function j(e){return C(e),e.length>0&&p(e.charCodeAt(0))}function M(e){C(e);let r=e.length;if(r===0)return!1;let t=e.charCodeAt(0);return m(t)?!0:!!(R(t)&&r>2&&e.charCodeAt(1)===58&&m(e.charCodeAt(2)))}function me(e){return A?M(e):j(e)}function I(e){if(C(e),e.length===0)return"."}function _(e,r,t,o){let s="",i=0,f=-1,n=0,l;for(let a=0;a<=e.length;++a){if(a<e.length)l=e.charCodeAt(a);else{if(o(l))break;l=47}if(o(l)){if(!(f===a-1||n===1))if(f!==a-1&&n===2){if(s.length<2||i!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){let d=s.lastIndexOf(t);d===-1?(s="",i=0):(s=s.slice(0,d),i=s.length-1-s.lastIndexOf(t)),f=a,n=0;continue}else if(s.length===2||s.length===1){s="",i=0,f=a,n=0;continue}}r&&(s.length>0?s+=`${t}..`:s="..",i=2)}else s.length>0?s+=t+e.slice(f+1,a):s=e.slice(f+1,a),i=a-f-1;f=a,n=0}else l===46&&n!==-1?++n:n=-1}return s}function F(e){e instanceof URL&&(e=P(e)),I(e);let r=p(e.charCodeAt(0)),t=p(e.charCodeAt(e.length-1));return e=_(e,!r,"/",p),e.length===0&&!r&&(e="."),e.length>0&&t&&(e+="/"),r?`/${e}`:e}function K(e,...r){if(e===void 0)return".";e instanceof URL&&(e=P(e)),r=e?[e,...r]:r,r.forEach(o=>C(o));let t=r.filter(o=>o.length>0).join("/");return t===""?".":F(t)}function b(e){e instanceof URL&&(e=E(e)),I(e);let r=e.length,t=0,o,s=!1,i=e.charCodeAt(0);if(r>1)if(m(i))if(s=!0,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){let a=e.slice(l,n);for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return`\\\\${a}\\${e.slice(l)}\\`;n!==l&&(o=`\\\\${a}\\${e.slice(l,n)}`,t=n)}}}else t=1;else R(i)&&e.charCodeAt(1)===58&&(o=e.slice(0,2),t=2,r>2&&m(e.charCodeAt(2))&&(s=!0,t=3));else if(m(i))return"\\";let f;return t<r?f=_(e.slice(t),!s,"\\",m):f="",f.length===0&&!s&&(f="."),f.length>0&&m(e.charCodeAt(r-1))&&(f+="\\"),o===void 0?s?f.length>0?`\\${f}`:"\\":f:s?f.length>0?`${o}\\${f}`:`${o}\\`:o+f}function Z(e,...r){if(e instanceof URL&&(e=E(e)),r=e?[e,...r]:r,r.forEach(f=>C(f)),r=r.filter(f=>f.length>0),r.length===0)return".";let t=!0,o=0,s=r[0];if(m(s.charCodeAt(0))){++o;let f=s.length;f>1&&m(s.charCodeAt(1))&&(++o,f>2&&(m(s.charCodeAt(2))?++o:t=!1))}let i=r.join("\\");if(t){for(;o<i.length&&m(i.charCodeAt(o));++o);o>=2&&(i=`\\${i.slice(o)}`)}return b(i)}function J(e,...r){return A?Z(e,...r):K(e,...r)}function de(e){return A?b(e):F(e)}function ue(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;let t=p(e.charCodeAt(0)),o;t?(r.root="/",o=1):o=0;let s=-1,i=0,f=-1,n=!0,l=e.length-1,a=0;for(;l>=o;--l){let d=e.charCodeAt(l);if(p(d)){if(!n){i=l+1;break}continue}f===-1&&(n=!1,f=l+1),d===46?s===-1?s=l:a!==1&&(a=1):s!==-1&&(a=-1)}return s===-1||f===-1||a===0||a===1&&s===f-1&&s===i+1?(f!==-1&&(i===0&&t?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(i,f)),r.base=r.base||"/"):(i===0&&t?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(i,s),r.base=e.slice(i,f)),r.ext=e.slice(s,f)),i>0?r.dir=S(e.slice(0,i-1),p):t&&(r.dir="/"),r}function pe(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""},t=e.length;if(t===0)return r;let o=0,s=e.charCodeAt(0);if(t>1){if(m(s)){if(o=1,m(e.charCodeAt(1))){let u=2,c=u;for(;u<t&&!m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&!m(e.charCodeAt(u));++u);u===t?o=u:u!==c&&(o=u+1)}}}}else if(R(s)&&e.charCodeAt(1)===58)if(o=2,t>2){if(m(e.charCodeAt(2))){if(t===3)return r.root=r.dir=e,r.base="\\",r;o=3}}else return r.root=r.dir=e,r}else if(m(s))return r.root=r.dir=e,r.base="\\",r;o>0&&(r.root=e.slice(0,o));let i=-1,f=o,n=-1,l=!0,a=e.length-1,d=0;for(;a>=o;--a){if(s=e.charCodeAt(a),m(s)){if(!l){f=a+1;break}continue}n===-1&&(l=!1,n=a+1),s===46?i===-1?i=a:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||n===-1||d===0||d===1&&i===n-1&&i===f+1?n!==-1&&(r.base=r.name=e.slice(f,n)):(r.name=e.slice(f,i),r.base=e.slice(f,n),r.ext=e.slice(i,n)),r.base=r.base||"\\",f>0&&f!==o?r.dir=e.slice(0,f-1):r.dir=r.root,r}function Ae(e){return A?pe(e):ue(e)}function O(...e){let r="",t=!1;for(let o=e.length-1;o>=-1&&!t;o--){let s;if(o>=0)s=e[o];else{let{Deno:i}=globalThis;if(typeof i?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");s=i.cwd()}C(s),s.length!==0&&(r=`${s}/${r}`,t=p(s.charCodeAt(0)))}return r=_(r,!t,"/",p),t?r.length>0?`/${r}`:"/":r.length>0?r:"."}function z(e,r){if(C(e),C(r),e===r)return""}function Ce(e,r){if(z(e,r),e=O(e),r=O(r),e===r)return"";let t=1,o=e.length;for(;t<o&&p(e.charCodeAt(t));++t);let s=o-t,i=1,f=r.length;for(;i<f&&p(r.charCodeAt(i));++i);let n=f-i,l=s<n?s:n,a=-1,d=0;for(;d<=l;++d){if(d===l){if(n>l){if(p(r.charCodeAt(i+d)))return r.slice(i+d+1);if(d===0)return r.slice(i+d)}else s>l&&(p(e.charCodeAt(t+d))?a=d:d===0&&(a=0));break}let c=e.charCodeAt(t+d),x=r.charCodeAt(i+d);if(c!==x)break;p(c)&&(a=d)}let u="";for(d=t+a+1;d<=o;++d)(d===o||p(e.charCodeAt(d)))&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(i+a):(i+=a,p(r.charCodeAt(i))&&++i,r.slice(i))}function T(...e){let r="",t="",o=!1;for(let s=e.length-1;s>=-1;s--){let i,{Deno:f}=globalThis;if(s>=0)i=e[s];else if(r){if(typeof f?.env?.get!="function"||typeof f?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");i=f.cwd(),(i===void 0||i.slice(0,3).toLowerCase()!==`${r.toLowerCase()}\\`)&&(i=`${r}\\`)}else{if(typeof f?.cwd!="function")throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");i=f.cwd()}C(i);let n=i.length;if(n===0)continue;let l=0,a="",d=!1,u=i.charCodeAt(0);if(n>1)if(m(u))if(d=!0,m(i.charCodeAt(1))){let c=2,x=c;for(;c<n&&!m(i.charCodeAt(c));++c);if(c<n&&c!==x){let v=i.slice(x,c);for(x=c;c<n&&m(i.charCodeAt(c));++c);if(c<n&&c!==x){for(x=c;c<n&&!m(i.charCodeAt(c));++c);c===n?(a=`\\\\${v}\\${i.slice(x)}`,l=c):c!==x&&(a=`\\\\${v}\\${i.slice(x,c)}`,l=c)}}}else l=1;else R(u)&&i.charCodeAt(1)===58&&(a=i.slice(0,2),l=2,n>2&&m(i.charCodeAt(2))&&(d=!0,l=3));else m(u)&&(l=1,d=!0);if(!(a.length>0&&r.length>0&&a.toLowerCase()!==r.toLowerCase())&&(r.length===0&&a.length>0&&(r=a),o||(t=`${i.slice(l)}\\${t}`,o=d),o&&r.length>0))break}return t=_(t,!o,"\\",m),r+(o?"\\":"")+t||"."}function xe(e,r){z(e,r);let t=T(e),o=T(r);if(t===o||(e=t.toLowerCase(),r=o.toLowerCase(),e===r))return"";let s=0,i=e.length;for(;s<i&&e.charCodeAt(s)===92;++s);for(;i-1>s&&e.charCodeAt(i-1)===92;--i);let f=i-s,n=0,l=r.length;for(;n<l&&r.charCodeAt(n)===92;++n);for(;l-1>n&&r.charCodeAt(l-1)===92;--l);let a=l-n,d=f<a?f:a,u=-1,c=0;for(;c<=d;++c){if(c===d){if(a>d){if(r.charCodeAt(n+c)===92)return o.slice(n+c+1);if(c===2)return o.slice(n+c)}f>d&&(e.charCodeAt(s+c)===92?u=c:c===2&&(u=3));break}let v=e.charCodeAt(s+c),ge=r.charCodeAt(n+c);if(v!==ge)break;v===92&&(u=c)}if(c!==d&&u===-1)return o;let x="";for(u===-1&&(u=0),c=s+u+1;c<=i;++c)(c===i||e.charCodeAt(c)===92)&&(x.length===0?x+="..":x+="\\..");return x.length>0?x+o.slice(n+u,l):(n+=u,o.charCodeAt(n)===92&&++n,o.slice(n,l))}function Re(e,r){return A?xe(e,r):Ce(e,r)}function he(...e){return A?T(...e):O(...e)}var Fe={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},be=()=>{let e=r=>({isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink,size:r.size,mtime:r.mtime,atime:r.atime,birthtime:r.birthtime});return{async readFile(r,t){try{return await Deno.readFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async readTextFile(r,t){try{return await Deno.readTextFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async writeFile(r,t,o){await Deno.writeFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async writeTextFile(r,t,o){await Deno.writeTextFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async exists(r){try{return await Deno.stat(r),!0}catch(t){if(t instanceof Deno.errors.NotFound)return!1;throw t}},async stat(r){try{let t=await Deno.stat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async lstat(r){try{let t=await Deno.lstat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async mkdir(r,t){await Deno.mkdir(r,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(r){try{await Deno.mkdir(r,{recursive:!0})}catch(t){if(!(t instanceof Deno.errors.AlreadyExists))throw t}},async remove(r,t){try{await Deno.remove(r,{recursive:t?.recursive??!1})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async*readDir(r){try{for await(let t of Deno.readDir(r))yield{name:t.name,isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink}}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async copyFile(r,t){await Deno.copyFile(r,t)},async rename(r,t){await Deno.rename(r,t)},async makeTempDir(r){return await Deno.makeTempDir({dir:r?.dir,prefix:r?.prefix,suffix:r?.suffix})},async realPath(r){try{return await Deno.realPath(r)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},watch(r,t){let o=t?.recursive??!0,s=Deno.watchFs(r,{recursive:o}),i=f=>({kind:f.kind,paths:f.paths,flag:f.flag});return{close:()=>s.close(),[Symbol.asyncIterator]:async function*(){for await(let f of s)yield i(f)}}},async*walk(r,t){let o=t?.includeDirs??!0,s=t?.includeFiles??!0,i=t?.exts,f=t?.skip,n=async function*(l){for await(let a of Deno.readDir(l)){let d=J(l,a.name);if(!f?.some(u=>u.test(d))){if(a.isDirectory)o&&(yield{path:d,name:a.name,isFile:!1,isDirectory:!0,isSymlink:a.isSymlink}),yield*n(d);else if(a.isFile||a.isSymlink){if(!s||i&&!i.some(u=>a.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:d,name:a.name,isFile:a.isFile,isDirectory:!1,isSymlink:a.isSymlink}}}}};yield*n(r)},async chmod(r,t){let{chmod:o}=await import("./unstable_chmod-WRDBWEC2.js");await o(r,t)}}},Oe=()=>({join:J,resolve:he,dirname:ie,basename:ee,extname:fe,normalize:de,isAbsolute:me,relative:Re,parse:Ae,format:ce,sep:B,delimiter:re}),He=()=>({async spawn(e,r=[],t){let o=G(t),i=await new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).output();return{success:i.success,code:i.code,stdout:o.stdout==="piped"?i.stdout:new Uint8Array,stderr:o.stderr==="piped"?i.stderr:new Uint8Array}},async exec(e,r=[],t){let o=await this.spawn(e,r,t);if(!o.success){let s=new TextDecoder().decode(o.stderr);throw new Q(e,o.code,s)}return new TextDecoder().decode(o.stdout).trim()},async execJson(e,r=[],t){let o=await this.exec(e,r,t);return JSON.parse(o)},spawnChild(e,r=[],t){let o=G(t),i=new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).spawn(),f=(n,l)=>l!=="piped"||!n?Promise.resolve(new Uint8Array):new Response(n).arrayBuffer().then(a=>new Uint8Array(a));return{pid:i.pid,stdin:o.stdin==="piped"?i.stdin:null,stdout:o.stdout==="piped"?i.stdout:null,stderr:o.stderr==="piped"?i.stderr:null,status:i.status.then(n=>({success:n.success,code:n.code,signal:n.signal??void 0})),output:async()=>{let n=o.stdout==="piped"?i.stdout:null,l=o.stderr==="piped"?i.stderr:null,[a,d,u]=await Promise.all([i.status,f(n,o.stdout),f(l,o.stderr)]);return{success:a.success,code:a.code,stdout:d,stderr:u}},kill:n=>{i.kill(n)}}}}),ke=()=>({get(e){return Deno.env.get(e)},set(e,r){Deno.env.set(e,r)},delete(e){Deno.env.delete(e)},has(e){return Deno.env.get(e)!==void 0},toObject(){return Deno.env.toObject()}}),Le=()=>({exit(e){Deno.exit(e)},setExitCode(e){Deno.exitCode=e},cwd(){return Deno.cwd()},chdir(e){Deno.chdir(e)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable}),En=()=>{let e=be(),r=Oe(),t=He(),o=ke(),s=Le();return{name:"deno",version:Deno.version.deno,capabilities:Fe,fs:e,path:r,exec:t,env:o,process:s}};export{Fe as DENO_CAPABILITIES,En as createDenoRuntime};
|
|
1
|
+
import{a as G}from"./chunk-T7K64JD5.js";import{b as D,d as Q}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";function X(){let e=globalThis,r=e.Deno?.build?.os;return typeof r=="string"?r==="windows":e.navigator?.platform?.startsWith("Win")??e.process?.platform?.startsWith("win")??!1}var A=X();function C(e){if(typeof e!="string")throw new TypeError(`Path must be a string, received "${JSON.stringify(e)}"`)}function H(e,r){if(r.length>=e.length)return e;let t=e.length-r.length;for(let o=r.length-1;o>=0;--o)if(e.charCodeAt(t+o)!==r.charCodeAt(o))return e;return e.slice(0,-r.length)}function k(e,r,t=0){let o=!1,s=e.length;for(let i=e.length-1;i>=t;--i)if(r(e.charCodeAt(i))){if(o){t=i+1;break}}else o||(o=!0,s=i+1);return e.slice(t,s)}function L(e,r){if(C(e),e.length===0)return e;if(typeof r!="string")throw new TypeError(`Suffix must be a string, received "${JSON.stringify(r)}"`)}function U(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function P(e){return e=U(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function S(e,r){if(e.length<=1)return e;let t=e.length;for(let o=e.length-1;o>0&&r(e.charCodeAt(o));o--)t=o;return e.slice(0,t)}function p(e){return e===47}function Y(e,r=""){e instanceof URL&&(e=P(e)),L(e,r);let t=k(e,p),o=S(t,p);return r?H(o,r):o}function V(e){return e===47}function m(e){return e===47||e===92}function R(e){return e>=97&&e<=122||e>=65&&e<=90}function E(e){e=U(e);let r=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(r=`\\\\${e.hostname}${r}`),r}function q(e,r=""){e instanceof URL&&(e=E(e)),L(e,r);let t=0;if(e.length>=2){let i=e.charCodeAt(0);R(i)&&e.charCodeAt(1)===58&&(t=2)}let o=k(e,m,t),s=S(o,m);return r?H(s,r):s}function ee(e,r=""){return A?q(e,r):Y(e,r)}var re=A?";":":",B=A?"\\":"/";function W(e){if(C(e),e.length===0)return"."}function te(e){e instanceof URL&&(e=P(e)),W(e);let r=-1,t=!1;for(let o=e.length-1;o>=1;--o)if(p(e.charCodeAt(o))){if(t){r=o;break}}else t=!0;return r===-1?p(e.charCodeAt(0))?"/":".":S(e.slice(0,r),p)}function oe(e){e instanceof URL&&(e=E(e)),W(e);let r=e.length,t=-1,o=-1,s=!0,i=0,a=e.charCodeAt(0);if(r>1)if(m(a)){if(t=i=1,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return e;n!==l&&(t=i=n+1)}}}}else R(a)&&e.charCodeAt(1)===58&&(t=i=2,r>2&&m(e.charCodeAt(2))&&(t=i=3));else if(m(a))return e;for(let n=r-1;n>=i;--n)if(m(e.charCodeAt(n))){if(!s){o=n;break}}else s=!1;if(o===-1){if(t===-1)return".";o=t}return S(e.slice(0,o),V)}function ie(e){return A?oe(e):te(e)}function ne(e){e instanceof URL&&(e=P(e)),C(e);let r=-1,t=0,o=-1,s=!0,i=0;for(let a=e.length-1;a>=0;--a){let n=e.charCodeAt(a);if(p(n)){if(!s){t=a+1;break}continue}o===-1&&(s=!1,o=a+1),n===46?r===-1?r=a:i!==1&&(i=1):r!==-1&&(i=-1)}return r===-1||o===-1||i===0||i===1&&r===o-1&&r===t+1?"":e.slice(r,o)}function se(e){e instanceof URL&&(e=E(e)),C(e);let r=0,t=-1,o=0,s=-1,i=!0,a=0;e.length>=2&&e.charCodeAt(1)===58&&R(e.charCodeAt(0))&&(r=o=2);for(let n=e.length-1;n>=r;--n){let l=e.charCodeAt(n);if(m(l)){if(!i){o=n+1;break}continue}s===-1&&(i=!1,s=n+1),l===46?t===-1?t=n:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||s===-1||a===0||a===1&&t===s-1&&t===o+1?"":e.slice(t,s)}function ae(e){return A?se(e):ne(e)}function N(e,r){let t=r.dir||r.root,o=r.base||(r.name??"")+(r.ext??"");return t?o===e?t:t===r.root?t+o:t+e+o:o}function $(e){if(e===null||typeof e!="object")throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof e}"`)}function fe(e){return $(e),N("/",e)}function le(e){return $(e),N("\\",e)}function ce(e){return A?le(e):fe(e)}function j(e){return C(e),e.length>0&&p(e.charCodeAt(0))}function M(e){C(e);let r=e.length;if(r===0)return!1;let t=e.charCodeAt(0);return m(t)?!0:!!(R(t)&&r>2&&e.charCodeAt(1)===58&&m(e.charCodeAt(2)))}function me(e){return A?M(e):j(e)}function I(e){if(C(e),e.length===0)return"."}function _(e,r,t,o){let s="",i=0,a=-1,n=0,l;for(let f=0;f<=e.length;++f){if(f<e.length)l=e.charCodeAt(f);else{if(o(l))break;l=47}if(o(l)){if(!(a===f-1||n===1))if(a!==f-1&&n===2){if(s.length<2||i!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){let d=s.lastIndexOf(t);d===-1?(s="",i=0):(s=s.slice(0,d),i=s.length-1-s.lastIndexOf(t)),a=f,n=0;continue}else if(s.length===2||s.length===1){s="",i=0,a=f,n=0;continue}}r&&(s.length>0?s+=`${t}..`:s="..",i=2)}else s.length>0?s+=t+e.slice(a+1,f):s=e.slice(a+1,f),i=f-a-1;a=f,n=0}else l===46&&n!==-1?++n:n=-1}return s}function F(e){e instanceof URL&&(e=P(e)),I(e);let r=p(e.charCodeAt(0)),t=p(e.charCodeAt(e.length-1));return e=_(e,!r,"/",p),e.length===0&&!r&&(e="."),e.length>0&&t&&(e+="/"),r?`/${e}`:e}function K(e,...r){if(e===void 0)return".";e instanceof URL&&(e=P(e)),r=e?[e,...r]:r,r.forEach(o=>C(o));let t=r.filter(o=>o.length>0).join("/");return t===""?".":F(t)}function b(e){e instanceof URL&&(e=E(e)),I(e);let r=e.length,t=0,o,s=!1,i=e.charCodeAt(0);if(r>1)if(m(i))if(s=!0,m(e.charCodeAt(1))){let n=2,l=n;for(;n<r&&!m(e.charCodeAt(n));++n);if(n<r&&n!==l){let f=e.slice(l,n);for(l=n;n<r&&m(e.charCodeAt(n));++n);if(n<r&&n!==l){for(l=n;n<r&&!m(e.charCodeAt(n));++n);if(n===r)return`\\\\${f}\\${e.slice(l)}\\`;n!==l&&(o=`\\\\${f}\\${e.slice(l,n)}`,t=n)}}}else t=1;else R(i)&&e.charCodeAt(1)===58&&(o=e.slice(0,2),t=2,r>2&&m(e.charCodeAt(2))&&(s=!0,t=3));else if(m(i))return"\\";let a;return t<r?a=_(e.slice(t),!s,"\\",m):a="",a.length===0&&!s&&(a="."),a.length>0&&m(e.charCodeAt(r-1))&&(a+="\\"),o===void 0?s?a.length>0?`\\${a}`:"\\":a:s?a.length>0?`${o}\\${a}`:`${o}\\`:o+a}function Z(e,...r){if(e instanceof URL&&(e=E(e)),r=e?[e,...r]:r,r.forEach(a=>C(a)),r=r.filter(a=>a.length>0),r.length===0)return".";let t=!0,o=0,s=r[0];if(m(s.charCodeAt(0))){++o;let a=s.length;a>1&&m(s.charCodeAt(1))&&(++o,a>2&&(m(s.charCodeAt(2))?++o:t=!1))}let i=r.join("\\");if(t){for(;o<i.length&&m(i.charCodeAt(o));++o);o>=2&&(i=`\\${i.slice(o)}`)}return b(i)}function J(e,...r){return A?Z(e,...r):K(e,...r)}function de(e){return A?b(e):F(e)}function ue(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;let t=p(e.charCodeAt(0)),o;t?(r.root="/",o=1):o=0;let s=-1,i=0,a=-1,n=!0,l=e.length-1,f=0;for(;l>=o;--l){let d=e.charCodeAt(l);if(p(d)){if(!n){i=l+1;break}continue}a===-1&&(n=!1,a=l+1),d===46?s===-1?s=l:f!==1&&(f=1):s!==-1&&(f=-1)}return s===-1||a===-1||f===0||f===1&&s===a-1&&s===i+1?(a!==-1&&(i===0&&t?r.base=r.name=e.slice(1,a):r.base=r.name=e.slice(i,a)),r.base=r.base||"/"):(i===0&&t?(r.name=e.slice(1,s),r.base=e.slice(1,a)):(r.name=e.slice(i,s),r.base=e.slice(i,a)),r.ext=e.slice(s,a)),i>0?r.dir=S(e.slice(0,i-1),p):t&&(r.dir="/"),r}function pe(e){C(e);let r={root:"",dir:"",base:"",ext:"",name:""},t=e.length;if(t===0)return r;let o=0,s=e.charCodeAt(0);if(t>1){if(m(s)){if(o=1,m(e.charCodeAt(1))){let u=2,c=u;for(;u<t&&!m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&m(e.charCodeAt(u));++u);if(u<t&&u!==c){for(c=u;u<t&&!m(e.charCodeAt(u));++u);u===t?o=u:u!==c&&(o=u+1)}}}}else if(R(s)&&e.charCodeAt(1)===58)if(o=2,t>2){if(m(e.charCodeAt(2))){if(t===3)return r.root=r.dir=e,r.base="\\",r;o=3}}else return r.root=r.dir=e,r}else if(m(s))return r.root=r.dir=e,r.base="\\",r;o>0&&(r.root=e.slice(0,o));let i=-1,a=o,n=-1,l=!0,f=e.length-1,d=0;for(;f>=o;--f){if(s=e.charCodeAt(f),m(s)){if(!l){a=f+1;break}continue}n===-1&&(l=!1,n=f+1),s===46?i===-1?i=f:d!==1&&(d=1):i!==-1&&(d=-1)}return i===-1||n===-1||d===0||d===1&&i===n-1&&i===a+1?n!==-1&&(r.base=r.name=e.slice(a,n)):(r.name=e.slice(a,i),r.base=e.slice(a,n),r.ext=e.slice(i,n)),r.base=r.base||"\\",a>0&&a!==o?r.dir=e.slice(0,a-1):r.dir=r.root,r}function Ae(e){return A?pe(e):ue(e)}function O(...e){let r="",t=!1;for(let o=e.length-1;o>=-1&&!t;o--){let s;if(o>=0)s=e[o];else{let{Deno:i}=globalThis;if(typeof i?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");s=i.cwd()}C(s),s.length!==0&&(r=`${s}/${r}`,t=p(s.charCodeAt(0)))}return r=_(r,!t,"/",p),t?r.length>0?`/${r}`:"/":r.length>0?r:"."}function z(e,r){if(C(e),C(r),e===r)return""}function Ce(e,r){if(z(e,r),e=O(e),r=O(r),e===r)return"";let t=1,o=e.length;for(;t<o&&p(e.charCodeAt(t));++t);let s=o-t,i=1,a=r.length;for(;i<a&&p(r.charCodeAt(i));++i);let n=a-i,l=s<n?s:n,f=-1,d=0;for(;d<=l;++d){if(d===l){if(n>l){if(p(r.charCodeAt(i+d)))return r.slice(i+d+1);if(d===0)return r.slice(i+d)}else s>l&&(p(e.charCodeAt(t+d))?f=d:d===0&&(f=0));break}let c=e.charCodeAt(t+d),x=r.charCodeAt(i+d);if(c!==x)break;p(c)&&(f=d)}let u="";for(d=t+f+1;d<=o;++d)(d===o||p(e.charCodeAt(d)))&&(u.length===0?u+="..":u+="/..");return u.length>0?u+r.slice(i+f):(i+=f,p(r.charCodeAt(i))&&++i,r.slice(i))}function T(...e){let r="",t="",o=!1;for(let s=e.length-1;s>=-1;s--){let i,{Deno:a}=globalThis;if(s>=0)i=e[s];else if(r){if(typeof a?.env?.get!="function"||typeof a?.cwd!="function")throw new TypeError("Resolved a relative path without a current working directory (CWD)");i=a.cwd(),(i===void 0||i.slice(0,3).toLowerCase()!==`${r.toLowerCase()}\\`)&&(i=`${r}\\`)}else{if(typeof a?.cwd!="function")throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");i=a.cwd()}C(i);let n=i.length;if(n===0)continue;let l=0,f="",d=!1,u=i.charCodeAt(0);if(n>1)if(m(u))if(d=!0,m(i.charCodeAt(1))){let c=2,x=c;for(;c<n&&!m(i.charCodeAt(c));++c);if(c<n&&c!==x){let v=i.slice(x,c);for(x=c;c<n&&m(i.charCodeAt(c));++c);if(c<n&&c!==x){for(x=c;c<n&&!m(i.charCodeAt(c));++c);c===n?(f=`\\\\${v}\\${i.slice(x)}`,l=c):c!==x&&(f=`\\\\${v}\\${i.slice(x,c)}`,l=c)}}}else l=1;else R(u)&&i.charCodeAt(1)===58&&(f=i.slice(0,2),l=2,n>2&&m(i.charCodeAt(2))&&(d=!0,l=3));else m(u)&&(l=1,d=!0);if(!(f.length>0&&r.length>0&&f.toLowerCase()!==r.toLowerCase())&&(r.length===0&&f.length>0&&(r=f),o||(t=`${i.slice(l)}\\${t}`,o=d),o&&r.length>0))break}return t=_(t,!o,"\\",m),r+(o?"\\":"")+t||"."}function xe(e,r){z(e,r);let t=T(e),o=T(r);if(t===o||(e=t.toLowerCase(),r=o.toLowerCase(),e===r))return"";let s=0,i=e.length;for(;s<i&&e.charCodeAt(s)===92;++s);for(;i-1>s&&e.charCodeAt(i-1)===92;--i);let a=i-s,n=0,l=r.length;for(;n<l&&r.charCodeAt(n)===92;++n);for(;l-1>n&&r.charCodeAt(l-1)===92;--l);let f=l-n,d=a<f?a:f,u=-1,c=0;for(;c<=d;++c){if(c===d){if(f>d){if(r.charCodeAt(n+c)===92)return o.slice(n+c+1);if(c===2)return o.slice(n+c)}a>d&&(e.charCodeAt(s+c)===92?u=c:c===2&&(u=3));break}let v=e.charCodeAt(s+c),ge=r.charCodeAt(n+c);if(v!==ge)break;v===92&&(u=c)}if(c!==d&&u===-1)return o;let x="";for(u===-1&&(u=0),c=s+u+1;c<=i;++c)(c===i||e.charCodeAt(c)===92)&&(x.length===0?x+="..":x+="\\..");return x.length>0?x+o.slice(n+u,l):(n+=u,o.charCodeAt(n)===92&&++n,o.slice(n,l))}function Re(e,r){return A?xe(e,r):Ce(e,r)}function he(...e){return A?T(...e):O(...e)}var Fe={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!0},be=()=>{let e=r=>({isFile:r.isFile,isDirectory:r.isDirectory,isSymlink:r.isSymlink,size:r.size,mtime:r.mtime,atime:r.atime,birthtime:r.birthtime});return{async readFile(r,t){try{return await Deno.readFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async readTextFile(r,t){try{return await Deno.readTextFile(r,{signal:t?.signal})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async writeFile(r,t,o){await Deno.writeFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async writeTextFile(r,t,o){await Deno.writeTextFile(r,t,{signal:o?.signal,mode:o?.mode,create:o?.create??!0,append:o?.append??!1})},async exists(r){try{return await Deno.stat(r),!0}catch(t){if(t instanceof Deno.errors.NotFound)return!1;throw t}},async stat(r){try{let t=await Deno.stat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async lstat(r){try{let t=await Deno.lstat(r);return e(t)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async mkdir(r,t){await Deno.mkdir(r,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(r){try{await Deno.mkdir(r,{recursive:!0})}catch(t){if(!(t instanceof Deno.errors.AlreadyExists))throw t}},async remove(r,t){try{await Deno.remove(r,{recursive:t?.recursive??!1})}catch(o){throw o instanceof Deno.errors.NotFound?new D(r):o}},async*readDir(r){try{for await(let t of Deno.readDir(r))yield{name:t.name,isFile:t.isFile,isDirectory:t.isDirectory,isSymlink:t.isSymlink}}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},async copyFile(r,t){await Deno.copyFile(r,t)},async rename(r,t){await Deno.rename(r,t)},async makeTempDir(r){return await Deno.makeTempDir({dir:r?.dir,prefix:r?.prefix,suffix:r?.suffix})},async realPath(r){try{return await Deno.realPath(r)}catch(t){throw t instanceof Deno.errors.NotFound?new D(r):t}},watch(r,t){let o=t?.recursive??!0,s=Deno.watchFs(r,{recursive:o}),i=a=>({kind:a.kind,paths:a.paths,flag:a.flag});return{close:()=>s.close(),[Symbol.asyncIterator]:async function*(){for await(let a of s)yield i(a)}}},async*walk(r,t){let o=t?.includeDirs??!0,s=t?.includeFiles??!0,i=t?.exts,a=t?.skip,n=async function*(l){for await(let f of Deno.readDir(l)){let d=J(l,f.name);if(!a?.some(u=>u.test(d))){if(f.isDirectory)o&&(yield{path:d,name:f.name,isFile:!1,isDirectory:!0,isSymlink:f.isSymlink}),yield*n(d);else if(f.isFile||f.isSymlink){if(!s||i&&!i.some(u=>f.name.endsWith(u.startsWith(".")?u:`.${u}`)))continue;yield{path:d,name:f.name,isFile:f.isFile,isDirectory:!1,isSymlink:f.isSymlink}}}}};yield*n(r)},async chmod(r,t){let{chmod:o}=await import("./unstable_chmod-WRDBWEC2.js");await o(r,t)}}},Oe=()=>({join:J,resolve:he,dirname:ie,basename:ee,extname:ae,normalize:de,isAbsolute:me,relative:Re,parse:Ae,format:ce,sep:B,delimiter:re}),He=()=>({async spawn(e,r=[],t){let o=G(t),i=await new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).output();return{success:i.success,code:i.code,stdout:o.stdout==="piped"?i.stdout:new Uint8Array,stderr:o.stderr==="piped"?i.stderr:new Uint8Array}},async exec(e,r=[],t){let o=await this.spawn(e,r,t);if(!o.success){let s=new TextDecoder().decode(o.stderr);throw new Q(e,o.code,s)}return new TextDecoder().decode(o.stdout).trim()},async execJson(e,r=[],t){let o=await this.exec(e,r,t);return JSON.parse(o)},spawnChild(e,r=[],t){let o=G(t),i=new Deno.Command(e,{args:r,cwd:t?.cwd,env:t?.env,stdin:o.stdin,stdout:o.stdout,stderr:o.stderr,signal:t?.signal}).spawn(),a=(n,l)=>l!=="piped"||!n?Promise.resolve(new Uint8Array):new Response(n).arrayBuffer().then(f=>new Uint8Array(f));return{pid:i.pid,stdin:o.stdin==="piped"?i.stdin:null,stdout:o.stdout==="piped"?i.stdout:null,stderr:o.stderr==="piped"?i.stderr:null,status:i.status.then(n=>({success:n.success,code:n.code,signal:n.signal??void 0})),output:async()=>{let n=o.stdout==="piped"?i.stdout:null,l=o.stderr==="piped"?i.stderr:null,[f,d,u]=await Promise.all([i.status,a(n,o.stdout),a(l,o.stderr)]);return{success:f.success,code:f.code,stdout:d,stderr:u}},kill:n=>{i.kill(n)}}}}),ke=()=>({get(e){return Deno.env.get(e)},set(e,r){Deno.env.set(e,r)},delete(e){Deno.env.delete(e)},has(e){return Deno.env.get(e)!==void 0},toObject(){return Deno.env.toObject()}}),Le=()=>({exit(e){Deno.exit(e)},setExitCode(e){Deno.exitCode=e},cwd(){return Deno.cwd()},chdir(e){Deno.chdir(e)},hostname(){return Deno.hostname()},execPath(){return Deno.execPath()},args:Deno.args,pid:Deno.pid,stdin:Deno.stdin.readable,stdout:Deno.stdout.writable,stderr:Deno.stderr.writable,isTerminal(e){try{switch(e){case"stdin":return Deno.stdin.isTerminal();case"stdout":return Deno.stdout.isTerminal();case"stderr":return Deno.stderr.isTerminal()}}catch{return!1}},setStdinRaw(e){Deno.stdin.setRaw(e)}}),En=()=>{let e=be(),r=Oe(),t=He(),o=ke(),s=Le();return{name:"deno",version:Deno.version.deno,capabilities:Fe,fs:e,path:r,exec:t,env:o,process:s}};export{Fe as DENO_CAPABILITIES,En as createDenoRuntime};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G,b as z}from"./chunk-M2ZPJN26.js";import{a as $,b as R,e as T,f as M,g as j,h as r,i as u}from"./chunk-AB4ZUDV6.js";import{b as q}from"./chunk-QEEZKZXM.js";import"./chunk-AGPCY6XP.js";import{a as v}from"./chunk-RVIPYZ7F.js";import{a as U}from"./chunk-6QFROYLO.js";import{a as w}from"./chunk-UXRWSNVZ.js";import{a as I,b as D,f as E,k as J,l as L,n as F,p as O,r as N}from"./chunk-OJUA2UZK.js";import"./chunk-4IFPLK7L.js";import"./chunk-5MN3MWQN.js";import"./chunk-OLM5RTFK.js";import{a as A}from"./chunk-LZSLKXJE.js";import{a as b}from"./chunk-2N4GTHXQ.js";import"./chunk-6C2MLMD6.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 Y=new A({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-TR4ZPBU5.js")},list:{description:"List available AI providers",load:()=>import("./list-UT3MSC6R.js")}}});var W=v;var te=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},oe=[{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"]}],_=async t=>{let e=[];for(let n of oe)for(let o of n.paths)if(await te(`${t}/${o}`)){e.push(n.id);break}return e};var i=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},H=async(t,e)=>{try{let n=await l.fs.readTextFile(t);return JSON.parse(n)[e]??null}catch{return null}},ne=async t=>{let e=[];return(await i(`${t}/package.json`)||await i(`${t}/deno.json`))&&e.push("typescript"),await i(`${t}/go.mod`)&&e.push("go"),await i(`${t}/Cargo.toml`)&&e.push("rust"),(await i(`${t}/pyproject.toml`)||await i(`${t}/setup.py`))&&e.push("python"),e},re=async t=>{let e=[],n=await H(`${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},ie=async t=>{let e=[];return await i(`${t}/.github/workflows`)&&e.push("github-actions"),await i(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await i(`${t}/Jenkinsfile`)&&e.push("jenkins"),await i(`${t}/.circleci`)&&e.push("circleci"),e},ae=async t=>{if(await i(`${t}/deno.json`))return"deno";let e=await H(`${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},K=async t=>{let[e,n,o,f]=await Promise.all([ne(t),re(t),ie(t),ae(t)]);return{languages:e,frameworks:n,ci:o,testRunner:f}};var at=async t=>{let e=l.process.cwd(),n=G(t),o=R({target:n==="agent"?"non-interactive":"interactive"}),f=z(t),x=le(f,"--concerns"),Q=f.includes("--non-interactive")||n==="agent";if(await N(e)){let s=await J(e);return r.warn(o,"noskills is already initialized in this project."),r.info(o,`Run \`${w("sync",s)}\` to regenerate tool files.`),b(void 0)}M(o,"noskills init");let C=u(o,"Scanning project...");C.start();let d=await K(e);C.succeed("Project scanned");for(let s of d.languages)r.step(o,` ${s}`);for(let s of d.frameworks)r.step(o,` ${s}`);for(let s of d.ci)r.step(o,` ${s}`);d.testRunner!==null&&r.step(o,` test runner: ${d.testRunner}`);let B=u(o,"Detecting coding tools...");B.start();let p=await _(e);B.succeed(`${p.length} coding tool(s) detected`);for(let s of p)r.step(o,` ${s}`);let P=u(o,"Detecting AI providers...");P.start();let m=(await W()).filter(s=>s.available).map(s=>s.name);P.succeed(`${m.length} provider(s) detected`);let h=await U(),c;if(x!==null){let s=h.map(a=>a.id);c=x.filter(a=>s.includes(a)).sort((a,g)=>s.indexOf(a)-s.indexOf(g))}else if(Q)c=[];else{let s=h.map(g=>({value:g.id,label:g.name,hint:g.description.slice(0,60)})),a=await T(o,{message:"What kind of project is this? (space to toggle, enter to confirm)",options:s});c=$(a)?[]:[...a]}c.length>0?r.success(o,`Concerns: ${c.join(", ")}`):r.info(o,"No concerns selected. Add later with `concern add <id>`.");let k=de(),S=u(o,"Initializing...");S.start(),await O(e);let V=h.filter(s=>c.includes(s.id));for(let s of V)await F(e,s);let y={...D(c,p,m,d),command:k};await L(e,y);let X=I();if(await E(e,X),S.succeed("Scaffolded `.eser/`"),p.length>0){let s=u(o,"Syncing tool files...");s.start();let a=await q(e,p,y);s.succeed(`Synced ${a.length} tool(s)`)}return r.success(o,`Done. ${p.length} tool(s), ${m.length} provider(s), ${c.length} concern(s).`),r.info(o,`Command prefix: ${k}`),j(o,`Start a spec with: ${w('spec new "..."',y)}`),b(void 0)},le=(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},de=()=>{try{let e=l.process.args.join(" ");if(e.includes("jsr:@eser/noskills"))return"deno run jsr:@eser/noskills";if(e.includes("noskills/main.ts"))return"deno run --allow-all ./pkg/@eser/noskills/main.ts";if(e.includes("eser")&&e.includes("nos")&&!e.includes("noskills"))return"eser nos";if(e.includes("eser")&&e.includes("noskills"))return"eser noskills"}catch{}return"npx eser noskills"};export{at as main};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as d}from"./chunk-UXRWSNVZ.js";import{d as g,e as x,k as S}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 y=async()=>{let n=i.process.stdin.getReader(),e=[];try{for(;;){let{done:o,value:a}=await n.read();if(o||a===void 0)break;e.push(a)}}finally{n.releaseLock()}let t=0,c=new Uint8Array(e.reduce((o,a)=>o+a.length,0));for(let o of e)c.set(o,t),t+=o.length;let s=new TextDecoder().decode(c);try{return JSON.parse(s)}catch{return{}}},R=async n=>{let e=new TextEncoder,t=i.process.stdout.getWriter();await t.write(e.encode(JSON.stringify(n))),t.releaseLock()},I=async n=>{switch(n?.[0]){case"pre-tool-use":return await D();case"stop":return await T();case"post-file-write":return await v();case"post-bash":return await F();default:return r(void 0)}},D=async()=>{let n=await y(),e=n.tool_name??"unknown",t=n.tool_input??{},c=n.cwd??i.process.cwd(),s=await S(c),o={};try{o=await x(c)}catch{return r(void 0)}let a=async u=>{await R({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",s)}\` before continuing.`),r(void 0);if(e==="Bash"){let u=(t.command??"").trim();if(!(s?.allowGit??!1)){let p=["git add","git commit","git push","git merge","git rebase","git checkout","git stash","git reset","git cherry-pick","git tag","git branch -d","git branch -D","git branch -m","git revert","git am","git mv","git rm"];for(let w of p)if(u.startsWith(w)||u.includes(` && ${w}`)||u.includes(`; ${w}`))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(e))return r(void 0);let h=t.file_path??t.path??"";if(h.includes(".eser/")||h.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",s)}\``,UNINITIALIZED:`noskills not initialized. Run \`${d("init",s)}\``,DISCOVERY:`Discovery in progress. Run \`${d("next",s)}\` to continue.`,SPEC_DRAFT:`Spec needs review. Run \`${d("approve",s)}\``,SPEC_APPROVED:`Start execution first: \`${d('next --answer="start"',s)}\``,BLOCKED:`Execution blocked. Resolve with \`${d('next --answer="resolution"',s)}\``,DONE:`Spec complete. Start a new one or run \`${d("reset",s)}\``};return await a(k[f]??`Run \`${d("next",s)}\` first.`),r(void 0)},T=async()=>{let n=await y();if(n.stop_hook_active===!0)return r(void 0);let e=n.cwd??i.process.cwd(),t;try{let l=await i.fs.readTextFile(`${e}/${g.stateFile}`);t=JSON.parse(l)}catch{return r(void 0)}if(t.phase!=="EXECUTING")return r(void 0);let c=t.execution??{},s=`${e}/${g.stateDir}/files-changed.jsonl`,o=[];try{let p=(await i.fs.readTextFile(s)).trim().split(`
|
|
2
|
+
`).filter(Boolean);o=[...new Set(p.map(w=>{try{return JSON.parse(w).file}catch{return null}}).filter(w=>w!==null))]}catch{}let a=[],m="no changes";try{let{execSync:l}=await import("node:child_process");a=l("git diff --name-only",{cwd:e,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
3
|
+
`).filter(Boolean);let $=l("git diff --stat",{cwd:e,encoding:"utf-8",timeout:5e3}).trim().split(`
|
|
4
|
+
`);m=$[$.length-1]??"no changes"}catch{}let h=[...new Set([...o,...a])],f=(c.iteration??0)+1,k=`${e}/${g.stateDir}/iterations`;try{await i.fs.mkdir(k,{recursive:!0}),await i.fs.writeTextFile(`${k}/iteration-${f}.json`,JSON.stringify({iteration:f,files:h,gitStat:m.trim(),timestamp:new Date().toISOString()},null,2)+`
|
|
5
|
+
`)}catch{}let u=15;try{let l=await S(e);l!==null&&(u=l.maxIterationsBeforeRestart)}catch{}t.execution={...c,iteration:f,modifiedFiles:h,lastProgress:m.trim()||c.lastProgress||null},t.lastCalledAt=new Date().toISOString();try{await i.fs.writeTextFile(`${e}/${g.stateFile}`,JSON.stringify(t,null,2)+`
|
|
6
|
+
`)}catch{}try{await i.fs.writeTextFile(s,"")}catch{}if(f>=u){let l=new TextEncoder,p=i.process.stderr.getWriter();await p.write(l.encode(`noskills: iteration ${f} reached threshold (${u}). Consider starting a fresh conversation.
|
|
7
|
+
`)),p.releaseLock()}return r(void 0)},v=async()=>{let n=await y(),e=n.tool_input??{},t=e.file_path??e.path??"";if(!t||t.includes(".eser/")||t.includes(".claude/"))return r(void 0);let c=n.cwd??i.process.cwd(),s=`${c}/${g.stateDir}/files-changed.jsonl`,o=JSON.stringify({file:t,tool:n.tool_name,ts:new Date().toISOString()});try{await i.fs.mkdir(`${c}/${g.stateDir}`,{recursive:!0});let a="";try{a=await i.fs.readTextFile(s)}catch{}await i.fs.writeTextFile(s,a+o+`
|
|
8
|
+
`)}catch{}return r(void 0)},F=async()=>{let n=await y(),t=(n.tool_input??{}).command??"";if(!t.includes("noskills"))return r(void 0);let c=n.cwd??i.process.cwd(),s=`${c}/${g.stateDir}/noskills-calls.jsonl`,o=JSON.stringify({command:t,ts:new Date().toISOString()});try{await i.fs.mkdir(`${c}/${g.stateDir}`,{recursive:!0});let a="";try{a=await i.fs.readTextFile(s)}catch{}await i.fs.writeTextFile(s,a+o+`
|
|
9
|
+
`)}catch{}return r(void 0)};export{I as main};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as S,b as g,d as T,e as m,f,g as y}from"./chunk-
|
|
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(`
|
|
2
2
|
`);i=x.pop()??"";for(let _ of x){let p=_.trim();if(p.length!==0){try{let A=JSON.parse(p),w=C(A);if(w!==null){yield w;continue}}catch{}yield{kind:"content_delta",textDelta:p+`
|
|
3
3
|
`}}}a=await d.read()}d.releaseLock(),i.trim().length>0&&(yield{kind:"content_delta",textDelta:i.trim()});let E=await s.waitForExit(),b=await u,h=f("kiro",E.code,b);h!==null?yield{kind:"error",error:h}:yield{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:0,outputTokens:0,totalTokens:0}}}catch(t){t instanceof l?yield{kind:"error",error:t}:yield{kind:"error",error:new l(t instanceof Error?t.message:String(t),{provider:"kiro",cause:t instanceof Error?t:void 0})}}}close(){return Promise.resolve()}getRawClient(){return null}},O={provider:"kiro",async createModel(n){let e=await S("kiro",n);return new k(e,n)}},v=(n,e)=>{let r=[];r.push("--output","json"),r.push("--model",n.model),e.maxTokens!==void 0&&r.push("--max-tokens",String(e.maxTokens));let o=n.properties?.args;return o!==void 0&&r.push(...o),r},C=n=>{if(n===null||typeof n!="object")return null;let e=n;if(e.type==="content"||e.type==="text"){let r=e.text??e.content;return r!==void 0?{kind:"content_delta",textDelta:String(r)}:null}return e.type==="done"||e.type==="result"||e.done===!0?{kind:"message_done",stopReason:"end_turn",usage:{inputTokens:e.usage?.input_tokens??0,outputTokens:e.usage?.output_tokens??0,totalTokens:(e.usage?.input_tokens??0)+(e.usage?.output_tokens??0)}}:e.type==="error"?{kind:"error",error:new l(e.error?.message??e.message??"Unknown Kiro error",{provider:"kiro"})}:null};export{k as KiroModel,O as kiroFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p}from"./chunk-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};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +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 A}from"./chunk-LBOCIPVF.js";import{a as j,c as b,d as G,f as J,h as W}from"./chunk-HLQNHWXS.js";import{a as P}from"./chunk-QEEZKZXM.js";import{a as q,b as M,d as x}from"./chunk-TGA7MX5P.js";import{b as L,c as N,d as V}from"./chunk-I6ISQXVP.js";import"./chunk-6QFROYLO.js";import{a as U}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(`
|
|
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: ${U("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 P(e),d=u.spec!==null?await v(e,u.spec):null,R=await K(e,u),X=await k(e,R),Y=A(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 P(e),f=p.spec!==null?await v(e,p.spec):null,w=await K(e,p),C=await k(e,w),S=A(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=b(s,r,c));else{let r=L(a),c=N(r,s.discovery.answers);if(c===null)return e;s=b(s,c.id,n)}return V(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
|
+
`).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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as F}from"./chunk-T7K64JD5.js";import{b as g,d as E}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";import*as n from"node:fs/promises";import*as R from"node:fs";import*as i from"node:path";import*as v from"node:os";import*as b from"node:child_process";import a from"node:process";import{Buffer as p}from"node:buffer";import{Readable as k,Writable as O}from"node:stream";var S={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},x=()=>{let r=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),c=(e,t)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new g(t):e};return{async readFile(e,t){try{let s=await n.readFile(e,{signal:t?.signal});return new Uint8Array(s)}catch(s){return c(s,e)}},async readTextFile(e,t){try{return await n.readFile(e,{encoding:"utf-8",signal:t?.signal})}catch(s){return c(s,e)}},async writeFile(e,t,s){let d=s?.append?"a":"w";await n.writeFile(e,t,{signal:s?.signal,mode:s?.mode,flag:d})},async writeTextFile(e,t,s){let d=s?.append?"a":"w";await n.writeFile(e,t,{encoding:"utf-8",signal:s?.signal,mode:s?.mode,flag:d})},async exists(e){try{return await n.access(e),!0}catch{return!1}},async stat(e){try{let t=await n.stat(e);return r(t)}catch(t){return c(t,e)}},async lstat(e){try{let t=await n.lstat(e);return r(t)}catch(t){return c(t,e)}},async mkdir(e,t){await n.mkdir(e,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(e){await n.mkdir(e,{recursive:!0})},async remove(e,t){try{await n.rm(e,{recursive:t?.recursive??!1,force:!1})}catch(s){c(s,e)}},async*readDir(e){try{let t=await n.readdir(e,{withFileTypes:!0});for(let s of t)yield{name:s.name,isFile:s.isFile(),isDirectory:s.isDirectory(),isSymlink:s.isSymbolicLink()}}catch(t){c(t,e)}},async copyFile(e,t){await n.copyFile(e,t)},async rename(e,t){await n.rename(e,t)},async makeTempDir(e){let t=e?.dir??v.tmpdir(),s=e?.prefix??"",d=e?.suffix??"",u=await n.mkdtemp(i.join(t,s));if(d){let o=u+d;return await n.rename(u,o),o}return u},async realPath(e){try{return await n.realpath(e)}catch(t){throw t instanceof Error&&"code"in t&&t.code==="ENOENT"?new g(e):t}},watch(e,t){let s=t?.recursive??!0,d=[],u=[],o=[],l=!1,P=m=>{l||(o.length>0?o.shift()({value:m,done:!1}):u.push(m))};for(let m of e)try{let f=R.watch(m,{recursive:s},(h,y)=>{y!==null&&P({kind:h==="rename"?"create":"modify",paths:[i.join(m,y)]})});d.push(f)}catch{}return{close:()=>{l=!0;for(let m of d)m.close();for(let m of o)m({value:void 0,done:!0});o=[]},[Symbol.asyncIterator]:()=>({next:()=>l?Promise.resolve({value:void 0,done:!0}):u.length>0?Promise.resolve({value:u.shift(),done:!1}):new Promise(m=>{o.push(m)})})}},async chmod(e,t){await n.chmod(e,t)},async*walk(e,t){let s=t?.includeDirs??!0,d=t?.includeFiles??!0,u=t?.exts,o=t?.skip,l=async function*(P){let m=await n.readdir(P,{withFileTypes:!0});for(let f of m){let h=i.join(P,f.name);if(o?.some(w=>w.test(h)))continue;let y=f.isSymbolicLink();if(f.isDirectory())s&&(yield{path:h,name:f.name,isFile:!1,isDirectory:!0,isSymlink:y}),yield*l(h);else if(f.isFile()||y){if(!d||u&&!u.some(w=>f.name.endsWith(w.startsWith(".")?w:`.${w}`)))continue;yield{path:h,name:f.name,isFile:f.isFile(),isDirectory:!1,isSymlink:y}}}};yield*l(e)}}},W=()=>({join:i.join,resolve:i.resolve,dirname:i.dirname,basename:i.basename,extname:i.extname,normalize:i.normalize,isAbsolute:i.isAbsolute,relative:i.relative,parse:i.parse,format:i.format,sep:i.sep,delimiter:i.delimiter}),T=()=>({spawn(r,c=[],e){return new Promise((t,s)=>{let d=b.spawn(r,c,{cwd:e?.cwd,env:e?.env?{...a.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),u=[],o=[];d.stdout?.on("data",l=>u.push(l)),d.stderr?.on("data",l=>o.push(l)),d.on("error",s),d.on("close",l=>{t({success:l===0,code:l??1,stdout:new Uint8Array(p.concat(u)),stderr:new Uint8Array(p.concat(o))})})})},async exec(r,c=[],e){let t=await this.spawn(r,c,e);if(!t.success){let s=new TextDecoder().decode(t.stderr);throw new E(r,t.code,s)}return new TextDecoder().decode(t.stdout).trim()},async execJson(r,c=[],e){let t=await this.exec(r,c,e);return JSON.parse(t)},spawnChild(r,c=[],e){let t=b.spawn(r,c,{cwd:e?.cwd,env:e?.env?{...a.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),s=[],d=[];t.stdout?.on("data",o=>s.push(o)),t.stderr?.on("data",o=>d.push(o));let u=new Promise((o,l)=>{t.on("error",l),t.on("close",(P,m)=>{o({success:P===0,code:P??1,signal:m??void 0})})});return{pid:t.pid,stdin:t.stdin?O.toWeb(t.stdin):null,stdout:t.stdout?k.toWeb(t.stdout):null,stderr:t.stderr?k.toWeb(t.stderr):null,status:u,output:async()=>{let o=await u;return{success:o.success,code:o.code,stdout:new Uint8Array(p.concat(s)),stderr:new Uint8Array(p.concat(d))}},kill:o=>{t.kill(o)}}}}),A=()=>({get(r){return a.env[r]},set(r,c){a.env[r]=c},delete(r){delete a.env[r]},has(r){return r in a.env},toObject(){let r={};for(let[c,e]of Object.entries(a.env))e!==void 0&&(r[c]=e);return r}}),D=()=>({exit(r){a.exit(r)},setExitCode(r){a.exitCode=r},cwd(){return a.cwd()},chdir(r){a.chdir(r)},hostname(){return v.hostname()},execPath(){return a.execPath},args:a.argv.slice(2),pid:a.pid,stdin:k.toWeb(a.stdin),stdout:O.toWeb(a.stdout),stderr:O.toWeb(a.stderr),isTerminal(r){switch(r){case"stdin":return a.stdin.isTTY===!0;case"stdout":return a.stdout.isTTY===!0;case"stderr":return a.stderr.isTTY===!0}},setStdinRaw(r){a.stdin.setRawMode(r)}}),j=()=>{let r=x(),c=W(),e=T(),t=A(),s=D();return{name:"node",version:a.versions.node,capabilities:S,fs:r,path:c,exec:e,env:t,process:s}};export{S as NODE_CAPABILITIES,j as createNodeRuntime};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as u}from"./chunk-
|
|
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(`
|
|
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-
|
|
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};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as v,b as k}from"./chunk-M2ZPJN26.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()+`
|
|
2
|
+
`+a.slice(f+o.length).trimStart(),await n.fs.writeTextFile(s,a.trimEnd()+`
|
|
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
|
+
`),r.step(e," Removed hooks from `.claude/settings.json`"))}catch{}};export{M as main};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as y,b as k}from"./chunk-QEEZKZXM.js";import{a as g,b as x}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=x(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
|
+
`),e.writeln(h("\u2714")," Rule added: ",o(n)),r!==null&&r.tools.length>0&&(await k(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 y(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};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as L}from"./chunk-LBOCIPVF.js";import{a as V,f as B}from"./chunk-HLQNHWXS.js";import{a as D,b as A,d as N}from"./chunk-AB4ZUDV6.js";import{a as G}from"./chunk-QEEZKZXM.js";import"./chunk-I6ISQXVP.js";import"./chunk-6QFROYLO.js";import{a as M,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: ${M("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=B(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=V(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 G(e),j=L(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(`
|
|
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
|
+
`;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};
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as I,d as w}from"./chunk-TGA7MX5P.js";import{a as h}from"./chunk-I6ISQXVP.js";import"./chunk-6QFROYLO.js";import{a as f}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(f("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:h.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(`${f("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}/${h.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g}from"./chunk-QEEZKZXM.js";import{a as w}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(w("init",e))),await s.close(),a({exitCode:1});s.writeln(r("Syncing tool files..."));let i=await g(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};
|
|
@@ -0,0 +1,8 @@
|
|
|
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(`
|
|
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
|
+
`)},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
|
+
`)),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+`
|
|
5
|
+
`)),h.releaseLock()}else if(l==="markdown"){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(a+`
|
|
6
|
+
---
|
|
7
|
+
`)),h.releaseLock()}else if(a!==o){let g=new TextEncoder,h=m.process.stdout.getWriter();await h.write(g.encode(F+a+`
|
|
8
|
+
`)),h.releaseLock(),o=a}return i.phase==="DONE"};if(await u())return x(void 0);let c=1e3,$=0;for(;;){await new Promise(i=>setTimeout(i,c));try{let a=(await m.fs.stat(`${d}/state.json`)).mtime?.getTime()??0;if(a>$&&($=a,await new Promise(h=>setTimeout(h,100)),await u()))break}catch{}}return x(void 0)};export{D as buildSnapshot,J as main,W as renderJsonLine,R as renderTerminal};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{a,b,c,d}from"./chunk-WV3HK5WR.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";export{a as WORKERD_CAPABILITIES,c as clearEnv,d as createWorkerdRuntime,b as populateEnvFromContext};
|
package/noskills.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as t}from"./chunks/chunk-
|
|
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-HS26Q2YL.js")},status:{description:"Show current state",load:()=>import("./chunks/status-B4YAFCOQ.js")},spec:{description:"Manage specs (new, list)",load:()=>import("./chunks/spec-RTBL43T7.js")},next:{description:"Get next instruction for agent",load:()=>import("./chunks/next-ZZAZ6ZVW.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-P4L2VWAE.js")},run:{description:"Autonomous execution loop (Ralph loop)",load:()=>import("./chunks/run-LEX6S5D7.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-XMUP5YHZ.js")},purge:{description:"Remove all noskills content (specs, rules, concerns, hooks)",load:()=>import("./chunks/purge-FBZME5ZJ.js")},"invoke-hook":{description:"Internal hook handlers (called by agents)",load:()=>import("./chunks/invoke-hook-JZBFLW46.js")},rule:{description:"Manage rules (add, list, promote)",load:()=>import("./chunks/rule-4D2CRBI4.js")}}});var r={name:"@eser/noskills",version:"4.1.30",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 +0,0 @@
|
|
|
1
|
-
import{e as w}from"./chunk-LXVBR775.js";import{d as h,e as u}from"./chunk-NGURBONB.js";import{c as r,d as o,e as i,f as p,i as l,l as m,n as c,o as d}from"./chunk-JYJTZEC4.js";import{a}from"./chunk-2N4GTHXQ.js";import{a as n}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=async g=>{let e=m({renderer:d.ansi(),sink:c.stdout()}),t=n.process.cwd(),s=await h(t);if(s.phase==="SPEC_DRAFT"){let f=w(s);await u(t,f),e.writeln(p("\u2714")," Spec approved. Phase: ",l("BUILDING")),e.writeln("Run ",r("noskills next")," to start building.")}else s.phase==="DISCOVERY"&&s.discovery.completed?(e.writeln(o("Discovery complete. Spec draft already generated.")),e.writeln("Review the spec and run ",r("noskills approve")," again when in SPEC_DRAFT phase.")):e.writeln(i(`Cannot approve in phase: ${s.phase}`));return await e.close(),a(void 0)};export{D as main};
|
package/chunks/block-4I5XBXK7.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as h}from"./chunk-LXVBR775.js";import{d as w,e as f}from"./chunk-NGURBONB.js";import{c as i,d as l,e as m,g as p,l as c,n as d,o as u}from"./chunk-JYJTZEC4.js";import{a as o,b as n}from"./chunk-2N4GTHXQ.js";import{a}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var A=async k=>{let e=c({renderer:u.ansi(),sink:d.stdout()}),t=a.process.cwd(),r=k?.join(" ")??"No reason given",s=await w(t);if(s.phase!=="BUILDING")return e.writeln(m(`Cannot block in phase: ${s.phase}`)),await e.close(),n({exitCode:1});let g=h(s,r);return await f(t,g),e.writeln(p("\u26A0")," Spec blocked: ",l(r)),e.writeln("Resolve with: ",i('noskills next --answer="resolution"')),await e.close(),o(void 0)};export{A as main};
|
package/chunks/bun-YFFBDKUJ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as F}from"./chunk-T7K64JD5.js";import{b as v,d as b}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";import*as n from"node:fs/promises";import*as O from"node:fs";import*as o from"node:path";import*as w from"node:os";import m from"node:process";import{Readable as x,Writable as k}from"node:stream";var E={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},R=()=>{let s=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),a=(e,t)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new v(t):e};return{async readFile(e,t){try{let r=await n.readFile(e,{signal:t?.signal});return new Uint8Array(r)}catch(r){return a(r,e)}},async readTextFile(e,t){try{return await n.readFile(e,{encoding:"utf-8",signal:t?.signal})}catch(r){return a(r,e)}},async writeFile(e,t,r){let d=r?.append?"a":"w";await n.writeFile(e,t,{signal:r?.signal,mode:r?.mode,flag:d})},async writeTextFile(e,t,r){let d=r?.append?"a":"w";await n.writeFile(e,t,{encoding:"utf-8",signal:r?.signal,mode:r?.mode,flag:d})},async exists(e){try{return await n.access(e),!0}catch{return!1}},async stat(e){try{let t=await n.stat(e);return s(t)}catch(t){return a(t,e)}},async lstat(e){try{let t=await n.lstat(e);return s(t)}catch(t){return a(t,e)}},async mkdir(e,t){await n.mkdir(e,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(e){await n.mkdir(e,{recursive:!0})},async remove(e,t){try{await n.rm(e,{recursive:t?.recursive??!1,force:!1})}catch(r){a(r,e)}},async*readDir(e){try{let t=await n.readdir(e,{withFileTypes:!0});for(let r of t)yield{name:r.name,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:r.isSymbolicLink()}}catch(t){a(t,e)}},async copyFile(e,t){await n.copyFile(e,t)},async rename(e,t){await n.rename(e,t)},async makeTempDir(e){let t=e?.dir??w.tmpdir(),r=e?.prefix??"",d=e?.suffix??"",i=await n.mkdtemp(o.join(t,r));if(d){let c=i+d;return await n.rename(i,c),c}return i},async realPath(e){try{return await n.realpath(e)}catch(t){throw t instanceof Error&&"code"in t&&t.code==="ENOENT"?new v(e):t}},watch(e,t){let r=t?.recursive??!0,d=[],i=[],c=[],u=!1,h=l=>{u||(c.length>0?c.shift()({value:l,done:!1}):i.push(l))};for(let l of e)try{let P=O.watch(l,{recursive:r},(y,f)=>{f!==null&&h({kind:y==="rename"?"create":"modify",paths:[o.join(l,f)]})});d.push(P)}catch{}return{close:()=>{u=!0;for(let l of d)l.close();for(let l of c)l({value:void 0,done:!0});c=[]},[Symbol.asyncIterator]:()=>({next:()=>u?Promise.resolve({value:void 0,done:!0}):i.length>0?Promise.resolve({value:i.shift(),done:!1}):new Promise(l=>{c.push(l)})})}},async chmod(e,t){await n.chmod(e,t)},async*walk(e,t){let r=t?.includeDirs??!0,d=t?.includeFiles??!0,i=t?.exts,c=t?.skip,u=async function*(h){let l=await n.readdir(h,{withFileTypes:!0});for(let P of l){let y=o.join(h,P.name);if(c?.some(p=>p.test(y)))continue;let f=P.isSymbolicLink();if(P.isDirectory())r&&(yield{path:y,name:P.name,isFile:!1,isDirectory:!0,isSymlink:f}),yield*u(y);else if(P.isFile()||f){if(!d||i&&!i.some(p=>P.name.endsWith(p.startsWith(".")?p:`.${p}`)))continue;yield{path:y,name:P.name,isFile:P.isFile(),isDirectory:!1,isSymlink:f}}}};yield*u(e)}}},S=()=>({join:o.join,resolve:o.resolve,dirname:o.dirname,basename:o.basename,extname:o.extname,normalize:o.normalize,isAbsolute:o.isAbsolute,relative:o.relative,parse:o.parse,format:o.format,sep:o.sep,delimiter:o.delimiter}),g=async s=>{if(!s)return new Uint8Array(0);let a=[],e=s.getReader();try{for(;;){let{done:i,value:c}=await e.read();if(i)break;a.push(c)}}finally{e.releaseLock()}let t=a.reduce((i,c)=>i+c.length,0),r=new Uint8Array(t),d=0;for(let i of a)r.set(i,d),d+=i.length;return r},A=()=>({async spawn(s,a=[],e){let[t,r,d]=F(e),i=Bun.spawn([s,...a],{cwd:e?.cwd,env:e?.env,stdin:t,stdout:r,stderr:d}),[c,u,h]=await Promise.all([i.exited,g(i.stdout),g(i.stderr)]);return{success:c===0,code:c,stdout:u,stderr:h}},async exec(s,a=[],e){let t=await this.spawn(s,a,e);if(!t.success){let r=new TextDecoder().decode(t.stderr);throw new b(s,t.code,r)}return new TextDecoder().decode(t.stdout).trim()},async execJson(s,a=[],e){let t=await this.exec(s,a,e);return JSON.parse(t)},spawnChild(s,a=[],e){let[t,r,d]=F(e),i=Bun.spawn([s,...a],{cwd:e?.cwd,env:e?.env,stdin:t,stdout:r,stderr:d}),c=i.exited.then(u=>({success:u===0,code:u,signal:void 0}));return{pid:i.pid,stdin:i.stdin,stdout:i.stdout,stderr:i.stderr,status:c,output:async()=>{let[u,h,l]=await Promise.all([c,g(i.stdout),g(i.stderr)]);return{success:u.success,code:u.code,stdout:h,stderr:l}},kill:u=>{i.kill(u)}}}}),W=()=>({get(s){return m.env[s]},set(s,a){m.env[s]=a},delete(s){delete m.env[s]},has(s){return s in m.env},toObject(){let s={};for(let[a,e]of Object.entries(m.env))e!==void 0&&(s[a]=e);return s}}),D=()=>({exit(s){m.exit(s)},setExitCode(s){m.exitCode=s},cwd(){return m.cwd()},chdir(s){m.chdir(s)},hostname(){return w.hostname()},execPath(){return m.execPath},args:m.argv.slice(2),pid:m.pid,stdin:x.toWeb(m.stdin),stdout:k.toWeb(m.stdout),stderr:k.toWeb(m.stderr)}),C=()=>{let s=R(),a=S(),e=A(),t=W(),r=D();return{name:"bun",version:Bun.version,capabilities:E,fs:s,path:a,exec:e,env:t,process:r}};export{E as BUN_CAPABILITIES,C as createBunRuntime};
|
package/chunks/chunk-BK2BDHKB.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var s=[{id:"open-source",name:"Open Source",description:"Community-driven, inclusive, well-documented. Prioritize contributor experience, avoid exclusionary patterns, default to permissive choices.",extras:[{questionId:"status_quo",text:"Is this workaround common in the community?"},{questionId:"user_impact",text:"Does this make contribution harder?"}],specSections:["Contributor Guide","Public API Surface"],reminders:["Endpoint should be documented in API docs","Consider contributor experience for new patterns","Default to permissive, well-documented choices"]},{id:"beautiful-product",name:"Beautiful Product",description:"Design and UX are first-class. Agent critiques UI/UX like a passionate designer. Empty states, error states, loading states, mobile layout \u2014 nothing ships unspecified.",extras:[{questionId:"status_quo",text:"How painful is the current experience?"},{questionId:"ambition",text:"In the 10-star version, what does the user feel?"}],specSections:["Design States (empty, loading, error, success)","Mobile Layout","Interaction Design"],reminders:["Loading state and error state must be designed, not placeholder","No AI slop \u2014 every UI element is intentional","Empty states need clear CTAs with examples"]},{id:"long-lived",name:"Long-Lived",description:"Built to last. Stability, maintainability, and backward compatibility matter. Every shortcut needs justification. Favor boring technology.",extras:[{questionId:"reversibility",text:"Will this decision still be correct in 2 years?"},{questionId:"scope_boundary",text:"What technical debt would this introduce?"}],specSections:["Migration & Deprecation","Backward Compatibility"],reminders:["Favor boring technology over shiny new tools","Every shortcut needs explicit justification","Consider maintenance burden for new dependencies"]},{id:"move-fast",name:"Move Fast",description:"Optimize for shipping speed. Acceptable trade-offs on polish. Good enough is good enough. Reduce ceremony.",extras:[{questionId:"scope_boundary",text:"Which polish items can be deferred to v2?"},{questionId:"ambition",text:"What is the minimum viable 5-star version?"}],specSections:["v1 vs v2 Scope"],reminders:["Good enough is good enough \u2014 ship it","Reduce ceremony, optimize for feedback speed","Mark polish items for v2 explicitly"]},{id:"compliance",name:"Compliance",description:"Audit trails, access controls, data handling rules. Every change is traceable. Verification is mandatory, not optional.",extras:[{questionId:"reversibility",text:"Is the audit trail preserved on rollback?"},{questionId:"verification",text:"Is there an audit/traceability requirement?"}],specSections:["Audit Trail","Access Control","Data Handling"],reminders:["Every state change must be traceable","Verification is mandatory, not optional","Document data handling and retention policies"]},{id:"learning-project",name:"Learning Project",description:"Experimentation is the goal. Encourage trying new patterns, don't punish dead ends. Document learnings over polish.",extras:[{questionId:"ambition",text:"What do you want to learn from building this?"},{questionId:"scope_boundary",text:"What experiments are explicitly allowed?"}],specSections:["Learning Goals","Experiment Log"],reminders:["Document learnings, not just outcomes","Dead ends are acceptable \u2014 document why","Try new patterns freely, polish later"]}],r=(i,t)=>{let e=[];for(let n of i)for(let o of n.extras)o.questionId===t&&e.push(o);return e},a=i=>{let t=[];for(let e of i)for(let n of e.reminders)t.push(`${e.id}: ${n}`);return t},c=i=>{let t=[],e=i.map(n=>n.id);return e.includes("move-fast")&&e.includes("compliance")&&t.push({between:["move-fast","compliance"],issue:"Speed vs traceability \u2014 shortcuts may violate audit requirements."}),e.includes("move-fast")&&e.includes("long-lived")&&t.push({between:["move-fast","long-lived"],issue:"Shipping speed vs maintainability \u2014 tech debt decisions need human approval."}),e.includes("beautiful-product")&&e.includes("move-fast")&&t.push({between:["beautiful-product","move-fast"],issue:"Design polish vs speed \u2014 which UI states can be deferred?"}),t};export{s as a,r as b,a as c,c as d};
|
package/chunks/chunk-JYJTZEC4.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk-FPO2JRU3.js";import{d as B}from"./chunk-DXB73IDG.js";var h=e=>e.map(n=>typeof n=="string"?K(n):n),K=e=>({kind:"text",value:e}),oe=(...e)=>({kind:"bold",children:h(e)}),ae=(...e)=>({kind:"dim",children:h(e)});var b=(e,...n)=>({kind:"color",color:e,children:h(n)}),ie=(...e)=>b("red",...e),se=(...e)=>b("green",...e),pe=(...e)=>b("yellow",...e);var le=(...e)=>b("magenta",...e),ue=(...e)=>b("cyan",...e),de=(...e)=>b("gray",...e);var me=(e,n)=>({kind:"table",headers:h(e),rows:n.map(r=>h(r))});var c=e=>{switch(e.kind){case"text":return e.value.length;case"newline":return 1;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.reduce((n,r)=>n+c(r),0);case"code-block":return e.value.length;case"table":case"list":return 0}};var k=(e,n)=>{let r=typeof e=="string"?"text":e instanceof Uint8Array?"bytes":"structured";return{data:e,meta:{timestamp:Date.now(),kind:r,channel:"stdout",...n}}};var E=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
2
|
-
`;case"bold":case"dim":case"italic":case"underline":case"strikethrough":case"color":case"group":return e.children.map(E).join("");case"code-block":return e.value.split(`
|
|
3
|
-
`).map(n=>` ${n}`).join(`
|
|
4
|
-
`)+`
|
|
5
|
-
`;case"table":{let n=e.headers.map((s,p)=>{let i=e.rows.reduce((C,u)=>{let d=u[p];return Math.max(C,d!==void 0?c(d):0)},0);return Math.max(c(s),i)}),r=(s,p)=>{let i=E(s),C=c(s);return i+" ".repeat(Math.max(0,p-C))},o=e.headers.map((s,p)=>r(s,n[p])).join(" "),t=n.map(s=>"-".repeat(s)).join(" "),m=e.rows.map(s=>s.map((p,i)=>r(p,n[i])).join(" ")).join(`
|
|
6
|
-
`);return`${o}
|
|
7
|
-
${t}
|
|
8
|
-
${m}
|
|
9
|
-
`}case"list":return e.items.map(n=>` - ${n.map(E).join("")}`).join(`
|
|
10
|
-
`)+`
|
|
11
|
-
`}},P=()=>({name:"plain",render:e=>e.map(E).join("")});var $=()=>{let e=[];return{name:"buffer",writable:new WritableStream({write(n){e.push(n)}}),chunks:()=>e,items:()=>e.map(n=>n.data),clear:()=>{e.length=0}}};var V=e=>{console.error(`[streams] Error at chunk #${e.chunkIndex} (${e.pendingCount} pending):`,e.error)},q=e=>{let n=[],r=e?.onError??V,o=e?.renderer??P(),t=!1,m=0,s=!1,p,u=(()=>{let l=e?.sink??$(),f=e?.layers??[];if(f.length===0)return l.writable;let{readable:O,writable:J}=new TransformStream,j=O;for(let R of f)j=j.pipeThrough(R.transform());return j.pipeTo(l.writable).catch(R=>{r({error:R,chunkIndex:m,pendingCount:n.length,lastChunk:n[n.length-1]})}),J})().getWriter(),d=async()=>{for(t=!1;n.length>0;){let l=n.shift();try{await u.ready,await u.write(l),m++}catch(f){r({error:f,chunkIndex:m,pendingCount:n.length,lastChunk:l}),n.length=0;break}}p!==void 0&&(p(),p=void 0)},y=()=>{t||(t=!0,queueMicrotask(d))},g=l=>{s||(n.push(l),y())},v={write:(...l)=>{let f=h(l),O=o.render(f);g(k(O))},writeln:(...l)=>{let f=h(l),O=o.render(f)+`
|
|
12
|
-
`;g(k(O))},flush:()=>n.length===0&&!t?Promise.resolve():new Promise(l=>{p=l,y()}),close:async()=>{s=!0,await v.flush();try{await u.close()}catch{}},pipe:(...l)=>q({sink:e?.sink,renderer:e?.renderer,layers:[...e?.layers??[],...l],onError:r})};return v};var L=class extends Error{constructor(n){super(n),this.name="StreamError"}},w=class extends L{cause;constructor(n,r){super(n),this.name="PipelineError",this.cause=r}},T=class extends L{constructor(n){super(`Pipeline timed out after ${n}ms`),this.name="TimeoutError"}};var X=()=>{let e,n=[],r,o={from:t=>(e=t,o),through:(...t)=>(n.push(...t),o),to:t=>(r=t,o),run:async t=>{if(e===void 0)throw new w("Pipeline has no source. Call .from() first.");if(r===void 0)throw new w("Pipeline has no sink. Call .to() first.");let m=e.readable;for(let i of n)m=m.pipeThrough(i.transform());let s=new AbortController,p;t?.timeout!==void 0&&t.timeout>0&&(p=setTimeout(()=>{s.abort(new T(t.timeout))},t.timeout));try{await m.pipeTo(r.writable,{signal:s.signal})}catch(i){throw i instanceof T?i:i instanceof DOMException&&i.name==="AbortError"?new T(t?.timeout??0):new w(`Pipeline failed: ${i instanceof Error?i.message:String(i)}`,i instanceof Error?i:void 0)}finally{p!==void 0&&clearTimeout(p)}},collect:async()=>{let t=$();return r=t,await o.run(),t.items()}};return o};var _={};B(_,{buffer:()=>$,multiplex:()=>G,nullSink:()=>U,stdout:()=>H,writable:()=>A});var W,Z=()=>(W===void 0&&(W=new TextEncoder),W),H=()=>{let e=D.process.stdout;return{name:"stdout",writable:new WritableStream({async write(n){let r=String(n.data),o=Z().encode(r),t=e.getWriter();try{await t.write(o)}finally{t.releaseLock()}}})}};var U=()=>({name:"null",writable:new WritableStream({write(e){}})});var A=(e,n)=>({name:n??"writable",writable:e});var G=(...e)=>{let n=e.map(r=>({name:r.name,writer:r.writable.getWriter()}));return{name:`multiplex(${e.map(r=>r.name).join(",")})`,writable:new WritableStream({async write(r){await Promise.all(n.map(o=>o.writer.write(r)))},async close(){await Promise.all(n.map(r=>r.writer.close()))},async abort(r){await Promise.all(n.map(o=>o.writer.abort(r)))}})}};var F={};B(F,{ansi:()=>N,markdown:()=>Y,plain:()=>P});var a="\x1B[",ee=`${a}0m`,x={bold:[`${a}1m`,`${a}22m`],dim:[`${a}2m`,`${a}22m`],italic:[`${a}3m`,`${a}23m`],underline:[`${a}4m`,`${a}24m`],strikethrough:[`${a}9m`,`${a}29m`]},z={black:`${a}30m`,red:`${a}31m`,green:`${a}32m`,yellow:`${a}33m`,blue:`${a}34m`,magenta:`${a}35m`,cyan:`${a}36m`,white:`${a}37m`,gray:`${a}90m`},ne=`${a}39m`,I=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
13
|
-
`;case"bold":case"dim":case"italic":case"underline":case"strikethrough":{let[n,r]=x[e.kind];return`${n}${e.children.map(I).join("")}${r}`}case"color":return`${z[e.color]??z.white}${e.children.map(I).join("")}${ne}`;case"group":return e.children.map(I).join("");case"code-block":{let n=x.dim[0],r=x.dim[1];return e.value.split(`
|
|
14
|
-
`).map(o=>`${n} ${o}${r}`).join(`
|
|
15
|
-
`)+`
|
|
16
|
-
`}case"table":{let n=e.headers.map((u,d)=>{let y=e.rows.reduce((g,v)=>{let l=v[d];return Math.max(g,l!==void 0?c(l):0)},0);return Math.max(c(u),y)}),r=x.bold[0],o=x.bold[1],t=x.dim[0],m=x.dim[1],s=(u,d)=>{let y=I(u),g=c(u);return y+" ".repeat(Math.max(0,d-g))},p=e.headers.map((u,d)=>`${r}${s(u,n[d])}${o}`).join(" "),i=`${t}${n.map(u=>"\u2500".repeat(u)).join("\u2500\u2500")}${m}`,C=e.rows.map(u=>u.map((d,y)=>s(d,n[y])).join(" ")).join(`
|
|
17
|
-
`);return`${p}
|
|
18
|
-
${i}
|
|
19
|
-
${C}
|
|
20
|
-
`}case"list":return e.items.map(n=>` \u2022 ${n.map(I).join("")}`).join(`
|
|
21
|
-
`)+`
|
|
22
|
-
`}},N=()=>({name:"ansi",render:e=>{let n=e.map(I).join("");return n.includes(a)?n+ee:n}});var S=e=>{switch(e.kind){case"text":return e.value;case"newline":return`
|
|
23
|
-
`;case"bold":return`**${e.children.map(S).join("")}**`;case"italic":return`*${e.children.map(S).join("")}*`;case"strikethrough":return`~~${e.children.map(S).join("")}~~`;case"dim":case"underline":case"color":case"group":return e.children.map(S).join("");case"code-block":return`\`\`\`${e.language??""}
|
|
24
|
-
${e.value}
|
|
25
|
-
\`\`\`
|
|
26
|
-
`;case"table":{let n=`| ${e.headers.map(S).join(" | ")} |`,r=`| ${e.headers.map(()=>"---").join(" | ")} |`,o=e.rows.map(t=>`| ${t.map(S).join(" | ")} |`).join(`
|
|
27
|
-
`);return`${n}
|
|
28
|
-
${r}
|
|
29
|
-
${o}
|
|
30
|
-
`}case"list":return e.items.map(n=>`- ${n.map(S).join("")}`).join(`
|
|
31
|
-
`)+`
|
|
32
|
-
`}},Y=()=>({name:"markdown",render:e=>e.map(S).join("")});export{k as a,K as b,oe as c,ae as d,ie as e,se as f,pe as g,le as h,ue as i,de as j,me as k,q as l,X as m,_ as n,F as o};
|
package/chunks/chunk-LXVBR775.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var n={UNINITIALIZED:["IDLE"],IDLE:["DISCOVERY"],DISCOVERY:["SPEC_DRAFT"],SPEC_DRAFT:["SPEC_APPROVED"],SPEC_APPROVED:["BUILDING"],BUILDING:["DONE","BLOCKED"],BLOCKED:["BUILDING"],DONE:["IDLE"]},o=(e,s)=>n[e].includes(s),t=(e,s)=>{if(!o(e,s))throw new Error(`Invalid phase transition: ${e} \u2192 ${s}. Allowed: ${n[e].join(", ")}`)},l=(e,s)=>(t(e.phase,s),{...e,phase:s}),h=(e,s,a)=>(t(e.phase,"DISCOVERY"),{...e,phase:"DISCOVERY",spec:s,branch:a,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},building:{iteration:0,lastProgress:null},decisions:[]}),p=(e,s,a)=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot add discovery answer in phase: ${e.phase}`);let r=[...e.discovery.answers.filter(i=>i.questionId!==s),{questionId:s,answer:a}];return{...e,discovery:{answers:r,completed:e.discovery.completed}}},d=e=>{if(e.phase!=="DISCOVERY")throw new Error(`Cannot complete discovery in phase: ${e.phase}`);return{...e,phase:"SPEC_DRAFT",discovery:{...e.discovery,completed:!0},specState:{path:`.nos/specs/${e.spec}/spec.md`,status:"draft"}}},S=e=>(t(e.phase,"SPEC_APPROVED"),{...e,phase:"BUILDING",specState:{...e.specState,status:"approved"},building:{iteration:0,lastProgress:null}}),m=(e,s)=>{if(e.phase!=="BUILDING")throw new Error(`Cannot advance building in phase: ${e.phase}`);return{...e,building:{iteration:e.building.iteration+1,lastProgress:s}}},D=(e,s)=>(t(e.phase,"BLOCKED"),{...e,phase:"BLOCKED",building:{...e.building,lastProgress:`BLOCKED: ${s}`}});var u=e=>({...e,phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},building:{iteration:0,lastProgress:null},decisions:[]});export{l as a,h as b,p as c,d,S as e,m as f,D as g,u as h};
|
package/chunks/chunk-NGURBONB.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-FPO2JRU3.js";var y=()=>({version:"0.1.0",phase:"IDLE",spec:null,branch:null,discovery:{answers:[],completed:!1},specState:{path:null,status:"none"},building:{iteration:0,lastProgress:null},decisions:[]}),D=(e,n,t)=>({version:"0.1.0",concerns:e,tools:n,project:t});var s=".nos",l=`${s}/.state`,d=`${l}/state.json`,c=`${s}/config.json`,o=`${s}/concerns`,g=`${s}/rules`,a=`${s}/specs`,p=`${s}/workflows`,f={nosDir:s,stateDir:l,stateFile:d,configFile:c,concernsDir:o,rulesDir:g,specsDir:a,workflowsDir:p,specDir:e=>`${a}/${e}`,specFile:e=>`${a}/${e}/spec.md`,concernFile:e=>`${o}/${e}.json`,nosGitignore:`${s}/.gitignore`},$=async e=>{let n=`${e}/${d}`;try{let t=await r.fs.readTextFile(n);return JSON.parse(t)}catch{return y()}},S=async(e,n)=>{let t=`${e}/${l}`,i=`${e}/${d}`;await r.fs.mkdir(t,{recursive:!0}),await r.fs.writeTextFile(i,JSON.stringify(n,null,2)+`
|
|
2
|
-
`)},x=async e=>{let n=`${e}/${c}`;try{let t=await r.fs.readTextFile(n);return JSON.parse(t)}catch{return null}},w=async(e,n)=>{let t=`${e}/${c}`;await r.fs.writeTextFile(t,JSON.stringify(n,null,2)+`
|
|
3
|
-
`)};var P=async(e,n)=>{let t=`${e}/${o}`,i=`${e}/${f.concernFile(n.id)}`;await r.fs.mkdir(t,{recursive:!0}),await r.fs.writeTextFile(i,JSON.stringify(n,null,2)+`
|
|
4
|
-
`)},F=async e=>{let n=`${e}/${o}`,t=[];try{for await(let i of r.fs.readDir(n))if(i.isFile&&i.name.endsWith(".json")){let u=await r.fs.readTextFile(`${n}/${i.name}`);t.push(JSON.parse(u))}}catch{}return t},C=async e=>{let n=[s,l,o,g,a,p];for(let t of n)await r.fs.mkdir(`${e}/${t}`,{recursive:!0});await r.fs.writeTextFile(`${e}/${f.nosGitignore}`,`# noskills runtime state \u2014 not tracked by git
|
|
5
|
-
.state/
|
|
6
|
-
`)},I=async e=>{try{return await r.fs.stat(`${e}/${c}`),!0}catch{return!1}};export{y as a,D as b,f as c,$ as d,S as e,x as f,w as g,P as h,F as i,C as j,I as k};
|
package/chunks/chunk-PQQKC72V.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-FPO2JRU3.js";var a="<!-- noskills:start -->",l="<!-- noskills:end -->",h=t=>{let e=[a,"## noskills orchestrator","","This project uses noskills. Do not read skill files, concern files,","or rule files directly.","","At every step, run:",""," npx eser noskills next","","Follow the output. To submit a result or answer:","",' npx eser noskills next --answer="your response here"',"","Do not make architectural decisions independently.","noskills will tell you what to do next."];if(t.length>0){e.push("","### Active Rules","");for(let s of t)e.push(`- ${s}`)}return e.push(l),e.join(`
|
|
2
|
-
`)},u=async(t,e)=>{let s=`${t}/CLAUDE.md`,n=h(e),r;try{r=await o.fs.readTextFile(s);let i=r.indexOf(a),c=r.indexOf(l);i!==-1&&c!==-1?r=r.slice(0,i)+n+r.slice(c+l.length):r=r.trimEnd()+`
|
|
3
|
-
|
|
4
|
-
`+n+`
|
|
5
|
-
`}catch{r=n+`
|
|
6
|
-
`}await o.fs.writeTextFile(s,r)};var d=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",'Follow the JSON output. Submit results with `npx eser noskills next --answer="..."`',""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.writeTextFile(`${t}/.cursorrules`,s.join(`
|
|
7
|
-
`))};var p=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.mkdir(`${t}/.kiro/steering`,{recursive:!0}),await o.fs.writeTextFile(`${t}/.kiro/steering/conventions.md`,s.join(`
|
|
8
|
-
`))};var m=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.mkdir(`${t}/.github`,{recursive:!0}),await o.fs.writeTextFile(`${t}/.github/copilot-instructions.md`,s.join(`
|
|
9
|
-
`))};var f=async(t,e)=>{let s=["# Generated by noskills \u2014 do not edit manually","","## Orchestration","","This project uses noskills for AI orchestration.","Run `npx eser noskills next` at every step.",""];if(e.length>0){s.push("## Rules","");for(let n of e)s.push(`- ${n}`);s.push("")}await o.fs.writeTextFile(`${t}/.windsurfrules`,s.join(`
|
|
10
|
-
`))};var T=async t=>{let e=`${t}/.nos/rules`,s=[];try{for await(let n of o.fs.readDir(e))if(n.isFile&&(n.name.endsWith(".md")||n.name.endsWith(".txt"))){let r=await o.fs.readTextFile(`${e}/${n.name}`);s.push(r.trim())}}catch{}return s},v={"claude-code":u,cursor:d,kiro:p,copilot:m,windsurf:f},F=async(t,e)=>{let s=await T(t),n=[];for(let r of e){let i=v[r];i!==void 0&&(await i(t,s),n.push(r))}return n};export{T as a,F as b};
|
package/chunks/init-QCOPTDGO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-BK2BDHKB.js";import"./chunk-AGPCY6XP.js";import{a as m}from"./chunk-RAI7PS2P.js";import{a as v,b as x,e as B,g as P,h as C,j as k,k as R}from"./chunk-NGURBONB.js";import{c as p,d as n,f as i,g as h,l as w,n as y,o as b}from"./chunk-JYJTZEC4.js";import"./chunk-5MN3MWQN.js";import{a as u}from"./chunk-TNKUKNM4.js";import{a as d}from"./chunk-2N4GTHXQ.js";import"./chunk-FEWVQ5CW.js";import"./chunk-OLM5RTFK.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var D=new u({description:"AI provider interface \u2014 ask questions, generate content",modules:{ask:{description:"Send a prompt to an AI provider",load:()=>import("./ask-Q7AVFBH5.js")},list:{description:"List available AI providers",load:()=>import("./list-UVJ2Q5KF.js")}}});var S=m;var s=async t=>{try{return await l.fs.stat(t),!0}catch{return!1}},A=async(t,e)=>{try{let o=await l.fs.readTextFile(t);return JSON.parse(o)[e]??null}catch{return null}},L=async t=>{let e=[];return(await s(`${t}/package.json`)||await s(`${t}/deno.json`))&&e.push("typescript"),await s(`${t}/go.mod`)&&e.push("go"),await s(`${t}/Cargo.toml`)&&e.push("rust"),(await s(`${t}/pyproject.toml`)||await s(`${t}/setup.py`))&&e.push("python"),e},N=async t=>{let e=[],o=await A(`${t}/package.json`,"dependencies");return o!==null&&("react"in o&&e.push("react"),"vue"in o&&e.push("vue"),"svelte"in o&&e.push("svelte"),"next"in o&&e.push("nextjs"),"express"in o&&e.push("express"),"hono"in o&&e.push("hono")),e},F=async t=>{let e=[];return await s(`${t}/.github/workflows`)&&e.push("github-actions"),await s(`${t}/.gitlab-ci.yml`)&&e.push("gitlab-ci"),await s(`${t}/Jenkinsfile`)&&e.push("jenkins"),await s(`${t}/.circleci`)&&e.push("circleci"),e},O=async t=>{if(await s(`${t}/deno.json`))return"deno";let e=await A(`${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},$=async t=>{let[e,o,a,c]=await Promise.all([L(t),N(t),F(t),O(t)]);return{languages:e,frameworks:o,ci:a,testRunner:c}};var Ee=async t=>{let e=w({renderer:b.ansi(),sink:y.stdout()}),o=l.process.cwd();if(await R(o))return e.writeln(h("noskills is already initialized in this project.")),e.writeln(n("Run `noskills sync` to regenerate tool files.")),await e.close(),d(void 0);e.writeln(p("noskills init")),e.writeln(""),e.writeln(n("Scanning project..."));let a=await $(o);for(let r of a.languages)e.writeln(" ",i("\u2714"),` ${r}`);for(let r of a.frameworks)e.writeln(" ",i("\u2714"),` ${r}`);for(let r of a.ci)e.writeln(" ",i("\u2714"),` ${r}`);a.testRunner!==null&&e.writeln(" ",i("\u2714"),` test runner: ${a.testRunner}`),e.writeln(""),e.writeln(n("Detecting AI providers..."));let c=await S();for(let r of c)r.available?e.writeln(" ",i("\u25CF")," ",p(`${r.name} (${r.alias})`),n(` ${r.detail}`)):e.writeln(" ",n("\u25CB")," ",n(`${r.name} (${r.alias}) ${r.detail}`));let f=c.filter(r=>r.available).map(r=>r.name);e.writeln(""),e.writeln(n("Initializing...")),await k(o),e.writeln(" Created .nos/");for(let r of g)await C(o,r);e.writeln(` Bootstrapped ${g.length} concerns into .nos/concerns/`);let I=x([],f,a);await P(o,I),e.writeln(" Created .nos/config.json");let T=v();await B(o,T),e.writeln(" Created .nos/.state/state.json"),e.writeln("");let j=f.length;return e.writeln(i("Done."),` ${j} AI provider(s) detected.`),e.writeln("Start a spec with: ",p('noskills spec new "..."')),await e.close(),d(void 0)};export{Ee as main};
|
package/chunks/list-UVJ2Q5KF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-RAI7PS2P.js";import{c as t,d as a,f as l,k as n,l as o,n as m,o as d}from"./chunk-JYJTZEC4.js";import{a as i}from"./chunk-2N4GTHXQ.js";import"./chunk-FEWVQ5CW.js";import"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.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};
|
package/chunks/next-DNJGG34Q.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-PQQKC72V.js";import{b as O,c as g,d as E}from"./chunk-BK2BDHKB.js";import{a as k,c as _,d as I,f as q}from"./chunk-LXVBR775.js";import{c as y,d as x,e as D,f as S,i as v,k as C}from"./chunk-NGURBONB.js";import{a as m,b as h}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var B=[{id:"status_quo",text:"What does the user do today without this feature?",concerns:["product:status_quo","eng:replace_scope","qa:regression_risk"]},{id:"ambition",text:"Describe the 1-star and 10-star versions.",concerns:["product:scope_direction","eng:complexity_tier","qa:test_depth"]},{id:"reversibility",text:"Does this change involve an irreversible decision?",concerns:["product:one_way_door","eng:migration_strategy","qa:verification_stringency"]},{id:"user_impact",text:"Does this change affect existing users' behavior?",concerns:["product:breaking_change","eng:backward_compat","qa:regression_tests"]},{id:"verification",text:"How do you verify this works correctly?",concerns:["product:success_metric","eng:test_strategy","qa:acceptance_criteria"]},{id:"scope_boundary",text:"What should this feature NOT do?",concerns:["product:focus","eng:out_of_scope","qa:negative_tests"]}],u=t=>B.map(n=>({...n,extras:O(t,n.id)})),p=(t,n)=>{let s=new Set(n.map(r=>r.questionId));for(let r of t)if(!s.has(r.id))return r;return null},R=t=>{let n=new Set(t.map(s=>s.questionId));return B.every(s=>n.has(s.id))};var w=(t,n,s)=>{switch(t.phase){case"IDLE":return b();case"DISCOVERY":return $(t,n,s);case"SPEC_DRAFT":return W(t);case"SPEC_APPROVED":case"BUILDING":return U(t,n,s);case"BLOCKED":return G(t);case"DONE":return V(t);default:return b()}},b=()=>({phase:"IDLE",instruction:'No active spec. Start one with: noskills spec new "description"'}),$=(t,n,s)=>{let r=u(n),e=p(r,t.discovery.answers);if(e===null)return{phase:"DISCOVERY",instruction:"All discovery questions answered. Run: noskills approve",question:{id:"",text:"",concerns:[],extras:[]},context:{rules:s,concernReminders:[]},transition:{onComplete:"noskills approve",remainingQuestions:0}};let o=t.discovery.answers.length,i=r.length;return{phase:"DISCOVERY",instruction:"Ask the user the following question and relay their answer.",question:{id:e.id,text:e.text,concerns:[...e.concerns],extras:e.extras.map(c=>c.text)},context:{rules:s,concernReminders:g(n)},transition:{onComplete:'noskills next --answer="..."',remainingQuestions:i-o-1}}},W=t=>({phase:"SPEC_DRAFT",instruction:"Spec draft is ready for review. Ask the user to review and approve.",specPath:t.specState.path??"",transition:{onApprove:"noskills approve"}}),U=(t,n,s)=>{let r=E(n),e={phase:"BUILDING",instruction:"Read the spec and implement the next task. Report progress when done.",context:{rules:s,concernReminders:g(n)},transition:{onComplete:'noskills next --answer="..."',onBlocked:'noskills block "reason"',iteration:t.building.iteration}};return r.length>0?{...e,concernTensions:r}:e},G=t=>({phase:"BLOCKED",instruction:"A decision is needed. Ask the user.",reason:t.building.lastProgress??"Unknown",transition:{onResolved:'noskills next --answer="..."'}}),V=t=>({phase:"DONE",summary:{spec:t.spec,iterations:t.building.iteration,decisionsCount:t.decisions.length}});var A=(t,n,s,r)=>{let e=[];e.push(`# Spec: ${t}`),e.push(""),e.push("## Status: draft"),e.push(""),s.length>0&&(e.push(`## Concerns: ${s.map(o=>o.id).join(", ")}`),e.push("")),e.push("## Discovery Answers"),e.push("");for(let o of n)e.push(`### ${o.questionId}`),e.push(""),e.push(o.answer),e.push("");for(let o of s)if(o.specSections.length>0)for(let i of o.specSections)e.push(`## ${i} (${o.id})`),e.push(""),e.push("_To be filled in during implementation._"),e.push("");if(r.length>0){e.push("## Decisions"),e.push(""),e.push("| # | Decision | Choice | Promoted |"),e.push("|---|----------|--------|----------|");for(let o=0;o<r.length;o++){let i=r[o];e.push(`| ${o+1} | ${i.question} | ${i.choice} | ${i.promoted?"yes":"no"} |`)}e.push("")}return e.push("## Tasks"),e.push(""),e.push("_To be generated from discovery answers._"),e.push(""),e.push("## Verification"),e.push(""),e.push("_To be defined based on discovery answers._"),e.push(""),e.join(`
|
|
2
|
-
`)};var Q=async(t,n,s)=>{if(n.spec===null)throw new Error("No active spec");let r=`${t}/${y.specDir(n.spec)}`,e=`${t}/${y.specFile(n.spec)}`;await l.fs.mkdir(r,{recursive:!0});let o=A(n.spec,n.discovery.answers,s,n.decisions);return await l.fs.writeTextFile(e,o),e};var ne=async t=>{let n=l.process.cwd();if(!await C(n)){let a=JSON.stringify({error:"noskills not initialized. Run: noskills init"});return await d(a),h({exitCode:1})}let s=null;if(t!==void 0)for(let a of t)a.startsWith("--answer=")&&(s=a.slice(9));let r=await x(n),e=await S(n);if(e===null){let a=JSON.stringify({error:"No config found"});return await d(a),h({exitCode:1})}let i=(await v(n)).filter(a=>e.concerns.includes(a.id));if(s!==null){let a=await z(n,r,e,i,s);await D(n,a);let F=await f(n),P=w(a,i,F);return await d(JSON.stringify(P,null,2)),m(void 0)}let c=await f(n),T=w(r,i,c);return await d(JSON.stringify(T,null,2)),m(void 0)},z=async(t,n,s,r,e)=>{switch(n.phase){case"DISCOVERY":{let o=u(r),i=p(o,n.discovery.answers);if(i===null)return n;let c=_(n,i.id,e);return R(c.discovery.answers)&&(c=I(c),await Q(t,c,r)),c}case"BUILDING":return q(n,e);case"BLOCKED":return k(n,"BUILDING");default:return n}},d=async t=>{let n=new TextEncoder,s=l.process.stdout.getWriter();await s.write(n.encode(t+`
|
|
3
|
-
`)),s.releaseLock()};export{ne as main};
|
package/chunks/node-SMAAGOR3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as F}from"./chunk-T7K64JD5.js";import{b as v,d as E}from"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";import*as s from"node:fs/promises";import*as x from"node:fs";import*as i from"node:path";import*as g from"node:os";import*as b from"node:child_process";import d from"node:process";import{Buffer as w}from"node:buffer";import{Readable as k,Writable as O}from"node:stream";var S={fs:!0,fsSync:!0,exec:!0,process:!0,env:!0,stdin:!0,stdout:!0,kv:!1},R=()=>{let n=e=>({isFile:e.isFile(),isDirectory:e.isDirectory(),isSymlink:e.isSymbolicLink(),size:e.size,mtime:e.mtime,atime:e.atime,birthtime:e.birthtime}),a=(e,t)=>{throw e instanceof Error&&"code"in e&&e.code==="ENOENT"?new v(t):e};return{async readFile(e,t){try{let r=await s.readFile(e,{signal:t?.signal});return new Uint8Array(r)}catch(r){return a(r,e)}},async readTextFile(e,t){try{return await s.readFile(e,{encoding:"utf-8",signal:t?.signal})}catch(r){return a(r,e)}},async writeFile(e,t,r){let c=r?.append?"a":"w";await s.writeFile(e,t,{signal:r?.signal,mode:r?.mode,flag:c})},async writeTextFile(e,t,r){let c=r?.append?"a":"w";await s.writeFile(e,t,{encoding:"utf-8",signal:r?.signal,mode:r?.mode,flag:c})},async exists(e){try{return await s.access(e),!0}catch{return!1}},async stat(e){try{let t=await s.stat(e);return n(t)}catch(t){return a(t,e)}},async lstat(e){try{let t=await s.lstat(e);return n(t)}catch(t){return a(t,e)}},async mkdir(e,t){await s.mkdir(e,{recursive:t?.recursive??!1,mode:t?.mode})},async ensureDir(e){await s.mkdir(e,{recursive:!0})},async remove(e,t){try{await s.rm(e,{recursive:t?.recursive??!1,force:!1})}catch(r){a(r,e)}},async*readDir(e){try{let t=await s.readdir(e,{withFileTypes:!0});for(let r of t)yield{name:r.name,isFile:r.isFile(),isDirectory:r.isDirectory(),isSymlink:r.isSymbolicLink()}}catch(t){a(t,e)}},async copyFile(e,t){await s.copyFile(e,t)},async rename(e,t){await s.rename(e,t)},async makeTempDir(e){let t=e?.dir??g.tmpdir(),r=e?.prefix??"",c=e?.suffix??"",u=await s.mkdtemp(i.join(t,r));if(c){let o=u+c;return await s.rename(u,o),o}return u},async realPath(e){try{return await s.realpath(e)}catch(t){throw t instanceof Error&&"code"in t&&t.code==="ENOENT"?new v(e):t}},watch(e,t){let r=t?.recursive??!0,c=[],u=[],o=[],l=!1,P=m=>{l||(o.length>0?o.shift()({value:m,done:!1}):u.push(m))};for(let m of e)try{let f=x.watch(m,{recursive:r},(h,y)=>{y!==null&&P({kind:h==="rename"?"create":"modify",paths:[i.join(m,y)]})});c.push(f)}catch{}return{close:()=>{l=!0;for(let m of c)m.close();for(let m of o)m({value:void 0,done:!0});o=[]},[Symbol.asyncIterator]:()=>({next:()=>l?Promise.resolve({value:void 0,done:!0}):u.length>0?Promise.resolve({value:u.shift(),done:!1}):new Promise(m=>{o.push(m)})})}},async chmod(e,t){await s.chmod(e,t)},async*walk(e,t){let r=t?.includeDirs??!0,c=t?.includeFiles??!0,u=t?.exts,o=t?.skip,l=async function*(P){let m=await s.readdir(P,{withFileTypes:!0});for(let f of m){let h=i.join(P,f.name);if(o?.some(p=>p.test(h)))continue;let y=f.isSymbolicLink();if(f.isDirectory())r&&(yield{path:h,name:f.name,isFile:!1,isDirectory:!0,isSymlink:y}),yield*l(h);else if(f.isFile()||y){if(!c||u&&!u.some(p=>f.name.endsWith(p.startsWith(".")?p:`.${p}`)))continue;yield{path:h,name:f.name,isFile:f.isFile(),isDirectory:!1,isSymlink:y}}}};yield*l(e)}}},W=()=>({join:i.join,resolve:i.resolve,dirname:i.dirname,basename:i.basename,extname:i.extname,normalize:i.normalize,isAbsolute:i.isAbsolute,relative:i.relative,parse:i.parse,format:i.format,sep:i.sep,delimiter:i.delimiter}),A=()=>({spawn(n,a=[],e){return new Promise((t,r)=>{let c=b.spawn(n,a,{cwd:e?.cwd,env:e?.env?{...d.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),u=[],o=[];c.stdout?.on("data",l=>u.push(l)),c.stderr?.on("data",l=>o.push(l)),c.on("error",r),c.on("close",l=>{t({success:l===0,code:l??1,stdout:new Uint8Array(w.concat(u)),stderr:new Uint8Array(w.concat(o))})})})},async exec(n,a=[],e){let t=await this.spawn(n,a,e);if(!t.success){let r=new TextDecoder().decode(t.stderr);throw new E(n,t.code,r)}return new TextDecoder().decode(t.stdout).trim()},async execJson(n,a=[],e){let t=await this.exec(n,a,e);return JSON.parse(t)},spawnChild(n,a=[],e){let t=b.spawn(n,a,{cwd:e?.cwd,env:e?.env?{...d.env,...e.env}:void 0,stdio:F(e),signal:e?.signal}),r=[],c=[];t.stdout?.on("data",o=>r.push(o)),t.stderr?.on("data",o=>c.push(o));let u=new Promise((o,l)=>{t.on("error",l),t.on("close",(P,m)=>{o({success:P===0,code:P??1,signal:m??void 0})})});return{pid:t.pid,stdin:t.stdin?O.toWeb(t.stdin):null,stdout:t.stdout?k.toWeb(t.stdout):null,stderr:t.stderr?k.toWeb(t.stderr):null,status:u,output:async()=>{let o=await u;return{success:o.success,code:o.code,stdout:new Uint8Array(w.concat(r)),stderr:new Uint8Array(w.concat(c))}},kill:o=>{t.kill(o)}}}}),D=()=>({get(n){return d.env[n]},set(n,a){d.env[n]=a},delete(n){delete d.env[n]},has(n){return n in d.env},toObject(){let n={};for(let[a,e]of Object.entries(d.env))e!==void 0&&(n[a]=e);return n}}),C=()=>({exit(n){d.exit(n)},setExitCode(n){d.exitCode=n},cwd(){return d.cwd()},chdir(n){d.chdir(n)},hostname(){return g.hostname()},execPath(){return d.execPath},args:d.argv.slice(2),pid:d.pid,stdin:k.toWeb(d.stdin),stdout:O.toWeb(d.stdout),stderr:O.toWeb(d.stderr)}),j=()=>{let n=R(),a=W(),e=A(),t=D(),r=C();return{name:"node",version:d.versions.node,capabilities:S,fs:n,path:a,exec:e,env:t,process:r}};export{S as NODE_CAPABILITIES,j as createNodeRuntime};
|
package/chunks/reset-WLKKKEUZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as u}from"./chunk-LXVBR775.js";import{d as c,e as d}from"./chunk-NGURBONB.js";import{d as a,f as o,l as m,n as p,o as l}from"./chunk-JYJTZEC4.js";import{a as r}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.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()}),n=i.process.cwd(),s=await c(n);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(n,f),e.writeln(o("\u2714")," Reset to IDLE."),t!==null&&e.writeln(a(`Spec "${t}" state cleared. Files in .nos/specs/${t}/ preserved.`)),await e.close(),r(void 0)};export{N as main};
|
package/chunks/rule-3VERAMM3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as h,b as k}from"./chunk-PQQKC72V.js";import{c as f,f as g}from"./chunk-NGURBONB.js";import{c as m,d as n,e as p,f as w,l as o,n as l,o as a}from"./chunk-JYJTZEC4.js";import{a as d,b as c}from"./chunk-2N4GTHXQ.js";import{a as i}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var j=async s=>{let e=s?.[0];if(e==="add")return await y(s?.slice(1));if(e==="list")return await A();if(e==="promote")return await C(s?.slice(1));let t=o({renderer:a.ansi(),sink:l.stdout()});return t.writeln('Usage: noskills rule <add "rule text" | list | promote "decision">'),await t.close(),d(void 0)},y=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=i.process.cwd(),r=s?.join(" ");if(r===void 0||r.length===0)return e.writeln(p("Please provide a rule: "),m('noskills rule add "Use Vitest for all tests"')),await e.close(),c({exitCode:1});let P=r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,50),x=`${t}/${f.rulesDir}/${P}.md`;await i.fs.mkdir(`${t}/${f.rulesDir}`,{recursive:!0}),await i.fs.writeTextFile(x,r+`
|
|
2
|
-
`),e.writeln(w("\u2714")," Rule added: ",n(r));let u=await g(t);return u!==null&&u.tools.length>0&&(await k(t,u.tools),e.writeln(n(" Tool files synced."))),await e.close(),d(void 0)},A=async()=>{let s=o({renderer:a.ansi(),sink:l.stdout()}),e=i.process.cwd(),t=await h(e);if(s.writeln(m("Rules")),s.writeln(""),t.length===0)s.writeln(n(' No rules yet. Add one with: noskills rule add "..."'));else for(let r of t)s.writeln(" ",n("\u2022"),` ${r}`);return await s.close(),d(void 0)},C=async s=>{let e=o({renderer:a.ansi(),sink:l.stdout()}),t=s?.join(" ");return t===void 0||t.length===0?(e.writeln(p("Please provide the decision text to promote.")),await e.close(),c({exitCode:1})):(e.writeln(n("Promoting decision to rule...")),await e.close(),await y(s))};export{j as main};
|
package/chunks/spec-P6YE224I.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as D,h as $}from"./chunk-LXVBR775.js";import{c as k,d as y,e as b,k as C}from"./chunk-NGURBONB.js";import{c as i,d as n,e as m,f as h,g,l as u,n as w,o as f}from"./chunk-JYJTZEC4.js";import{a as p,b as d}from"./chunk-2N4GTHXQ.js";import{a as l}from"./chunk-FPO2JRU3.js";import"./chunk-SG4G3OOO.js";import"./chunk-FDZP7B5Y.js";import"./chunk-ACQUINWH.js";import"./chunk-DXB73IDG.js";var z=async e=>{let s=e?.[0];if(s==="new")return await v(e?.slice(1));if(s==="list")return await N();let t=u({renderer:f.ansi(),sink:w.stdout()});return t.writeln('Usage: noskills spec <new "description" | list>'),await t.close(),p(void 0)},v=async e=>{let s=u({renderer:f.ansi(),sink:w.stdout()}),t=l.process.cwd();if(!await C(t))return s.writeln(m("noskills is not initialized.")," Run: ",i("noskills init")),await s.close(),d({exitCode:1});let a=e?.join(" ");if(a===void 0||a.length===0)return s.writeln(m("Please provide a description: "),i('noskills spec new "photo auto-listing"')),await s.close(),d({exitCode:1});let r=a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),c=`spec/${r}`,o=await y(t);if(o.phase!=="IDLE"&&o.phase!=="DONE")return s.writeln(m(`Cannot start new spec in phase: ${o.phase}`),n(" \u2014 finish or reset the current spec first.")),await s.close(),d({exitCode:1});let S=D(o.phase==="DONE"?$(o):o,r,c);return await l.fs.mkdir(`${t}/${k.specDir(r)}`,{recursive:!0}),await b(t,S),s.writeln(h("\u2714")," Spec started: ",i(r)),s.writeln(" Branch: ",n(c)),s.writeln(" Phase: ",g("DISCOVERY")),s.writeln(""),s.writeln("Run ",i("noskills next")," to begin discovery questions."),await s.close(),p(void 0)},N=async()=>{let e=u({renderer:f.ansi(),sink:w.stdout()}),t=`${l.process.cwd()}/${k.specsDir}`;e.writeln(i("Specs")),e.writeln("");try{let a=0;for await(let r of l.fs.readDir(t))if(r.isDirectory){let c=await l.fs.stat(`${t}/${r.name}/spec.md`).then(()=>!0).catch(()=>!1);e.writeln(" ",c?h("\u25CF"):n("\u25CB")," ",i(r.name),c?n(" spec.md"):n(" (no spec yet)")),a++}a===0&&e.writeln(n(" No specs yet."))}catch{e.writeln(n(" No specs directory."))}return await e.close(),p(void 0)};export{z as main};
|