@systemfsoftware/omp-claude-compat 1.4.1 → 1.5.0
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/dist/CommandExecutor-DwNfyIRs.js +1 -0
- package/dist/{dist-C2rAHz9c.js → dist-BIqX5YHu.js} +3 -3
- package/dist/esm-BMfr1QY2.js +55 -0
- package/dist/hook-dispatcher.executor-DkoSASBk.js +7 -0
- package/dist/index.js +2 -2
- package/dist/inject-instructions.executor-BW-ov0m0.js +3 -0
- package/dist/runtime-BHJBWQgN.js +1 -0
- package/package.json +5 -5
- package/dist/CommandExecutor-WpnYtse1.js +0 -1
- package/dist/esm-CeQhljd9.js +0 -55
- package/dist/hook-dispatcher.executor-ve2Ynf0r.js +0 -7
- package/dist/inject-instructions.executor-Bvgs3Fc8.js +0 -3
- package/dist/runtime-CmfegZ0F.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{En as e,Et as t,In as n,Kn as r,Ln as i,Lt as a,Sn as o,Un as ee,Wn as s,a as c,bn as l,c as u,gn as d,h as f,hn as p,jt as m,l as h,mn as g,o as _,p as v,pipe as y,u as b,vn as x,wn as S,xn as C,yn as w}from"./esm-BMfr1QY2.js";const T=Symbol.for(`@effect/platform/CommandExecutor`),E=Symbol.for(`@effect/platform/Process`),D=e(),O=e(),k=S(`@effect/platform/CommandExecutor`),A=e=>{let n=t=>v(m(e(t),e=>e.stdout)),r=(e,t)=>{let r=new TextDecoder(t);return b(_(n(e),w(e=>r.decode(e))))};return{[T]:T,start:e,exitCode:n=>a(t(e(n),e=>e.exitCode)),stream:n,string:(n,r=`utf-8`)=>{let i=new TextDecoder(r);return y(e(n),t(e=>u(e.stdout,j)),m(e=>i.decode(e)),a)},lines:(e,t=`utf-8`)=>y(r(e,t),h,m(o)),streamLines:r}},j=f(new Uint8Array,(e,t)=>C(t,e,(e,t)=>{let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n})),M=Symbol.for(`@effect/platform/Command`),N=r(2,(e,t)=>{switch(e._tag){case`StandardCommand`:return z({...e,env:d(e.env,p(Object.entries(t).filter(([e])=>e!==void 0)))});case`PipedCommand`:return U(N(e.left,t),N(e.right,t))}}),P=r(2,(e,t)=>G(e,c(l(new TextEncoder().encode(t))))),F=e=>Array.from(I(e)),I=e=>{switch(e._tag){case`StandardCommand`:return l(e);case`PipedCommand`:return x(I(e.left),I(e.right))}},L={[M]:M,pipe(){return ee(this,arguments)},...s},R={...L,_tag:`StandardCommand`,toJSON(){return{_id:`@effect/platform/Command`,_tag:this._tag,command:this.command,args:this.args,env:Object.fromEntries(this.env),cwd:this.cwd.toJSON(),shell:this.shell,gid:this.gid.toJSON(),uid:this.uid.toJSON()}}},z=e=>Object.assign(Object.create(R),e),B={...L,_tag:`PipedCommand`,toJSON(){return{_id:`@effect/platform/Command`,_tag:this._tag,left:this.left.toJSON(),right:this.right.toJSON()}}},V=e=>Object.assign(Object.create(B),e),H=(e,...t)=>z({command:e,args:t,env:g(),cwd:n(),shell:!1,stdin:`pipe`,stdout:`pipe`,stderr:`pipe`,gid:n(),uid:n()}),U=r(2,(e,t)=>V({left:e,right:t})),W=r(2,(e,t)=>{switch(e._tag){case`StandardCommand`:return z({...e,stderr:t});case`PipedCommand`:return V({...e,right:W(e.right,t)})}}),G=r(2,(e,t)=>{switch(e._tag){case`StandardCommand`:return z({...e,stdin:t});case`PipedCommand`:return V({...e,left:G(e.left,t)})}}),K=r(2,(e,t)=>{switch(e._tag){case`StandardCommand`:return z({...e,stdout:t});case`PipedCommand`:return V({...e,right:K(e.right,t)})}}),q=r(2,(e,t)=>{switch(e._tag){case`StandardCommand`:return z({...e,cwd:i(t)});case`PipedCommand`:return U(q(e.left,t),q(e.right,t))}}),J=N,Y=P,X=F,Z=H,Q=W,$=G,te=K,ne=q,re=k,ie=E,ae=D,oe=O,se=A;export{se as a,X as c,$ as d,te as f,ie as i,Z as l,ae as n,J as o,ne as p,oe as r,Y as s,re as t,Q as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as e,A as t,
|
|
1
|
+
import{$ as e,A as t,B as n,D as r,Dt as i,E as a,En as o,Et as s,F as c,Fn as l,Ht as u,I as ee,J as te,Kt as ne,L as d,M as re,Mn as ie,N as ae,Q as oe,S as f,T as p,Tn as m,Tt as h,V as se,Wt as ce,X as le,Y as ue,Z as de,Zt as g,_t as fe,an as pe,bn as me,bt as he,dt as ge,en as _e,ft as ve,g as ye,i as be,identity as xe,in as Se,j as _,jn as Ce,jt as v,k as y,kt as we,mt as Te,n as Ee,nn as b,nt as De,p as Oe,pipe as x,rn as ke,rt as S,st as C,tn as Ae,tt as je,ut as w,v as Me,w as Ne,wn as T,x as E,xt as Pe,y as D,zt as O}from"./esm-BMfr1QY2.js";const k=Symbol.for(`@effect/platform/Error`),A=f(`Clipboard`,`Command`,`FileSystem`,`KeyValueStore`,`Path`,`Stream`,`Terminal`);var j=class extends y(`@effect/platform/Error/BadArgument`)(`BadArgument`,{module:A,method:a,description:d(a),cause:d(E)}){[k]=k;get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:``}`}};const Fe=f(`AlreadyExists`,`BadResource`,`Busy`,`InvalidData`,`NotFound`,`PermissionDenied`,`TimedOut`,`UnexpectedEof`,`Unknown`,`WouldBlock`,`WriteZero`);var Ie=class extends y(`@effect/platform/Error/SystemError`)(`SystemError`,{reason:Fe,module:A,method:a,description:d(a),syscall:d(a),pathOrDescriptor:d(t(a,Ne)),cause:d(E)}){[k]=k;get message(){return`${this.reason}: ${this.module}.${this.method}${this.pathOrDescriptor===void 0?``:` (${this.pathOrDescriptor})`}${this.description?`: ${this.description}`:``}`}};const M=T(`@effect/platform/FileSystem`),N=e=>typeof e==`bigint`?e:BigInt(e),P=BigInt(1024);P*P*P*P*P;const Le=e=>M.of({...e,exists:t=>x(e.access(t),fe(!0),Pe(`SystemError`,e=>e.reason===`NotFound`?O(!1):h(e))),readFileString:(t,n)=>ce(e.readFile(t),{try:e=>new TextDecoder(n).decode(e),catch:e=>new j({module:`FileSystem`,method:`readFileString`,description:`invalid encoding`,cause:e})}),stream:(t,n)=>x(e.open(t,{flag:`r`}),n?.offset?u(e=>e.seek(n.offset,`start`)):xe,v(e=>Re(e,n)),Oe),sink:(t,n)=>x(e.open(t,{flag:`w`,...n}),v(e=>ye(t=>e.writeAll(t))),Me),writeFileString:(t,n,r)=>s(ne({try:()=>new TextEncoder().encode(n),catch:e=>new j({module:`FileSystem`,method:`writeFileString`,description:`could not encode string`,cause:e})}),n=>e.writeFile(t,n,r))}),Re=(e,{bufferSize:t=16,bytesToRead:n,chunkSize:r=N(64*1024)}={})=>{let i=n===void 0?void 0:N(n),a=N(r);function o(t){if(i!==void 0&&i<=t)return w;let n=i!==void 0&&i-t<a?i-t:a;return C(e.readAlloc(n),l({onNone:()=>w,onSome:e=>C(ge(me(e)),n=>o(t+BigInt(e.length)))}))}return Ee(be(o(BigInt(0))),{capacity:t})},ze=N,F=M,Be=Le,Ve=Symbol.for(`@effect/platform/FileSystem/File`),He=o(),Ue=g(`Create`),We=g(`Update`),Ge=g(`Remove`);var Ke=class extends m(`@effect/platform/FileSystem/WatchBackend`)(){};const I=Symbol.for(`@effect/platform/Path`),L=T(`@effect/platform/Path`);function qe(e,t){let n=``,r=0,i=-1,a=0,o;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(i!==s-1&&a!==1)if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function Je(e,t){let n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}function Ye(e){if(e.protocol!==`file:`)return h(new j({module:`Path`,method:`fromFileUrl`,description:`URL must be of scheme file`}));if(e.hostname!==``)return h(new j({module:`Path`,method:`fromFileUrl`,description:`Invalid file URL host`}));let t=e.pathname;for(let e=0;e<t.length;e++)if(t[e]===`%`){let n=t.codePointAt(e+2)|32;if(t[e+1]===`2`&&n===102)return h(new j({module:`Path`,method:`fromFileUrl`,description:`must not include encoded / characters`}))}return O(decodeURIComponent(t))}const Xe=function(){let e=``,t=!1,n;for(let r=arguments.length-1;r>=-1&&!t;r--){let i;if(r>=0)i=arguments[r];else{let e=globalThis.process;n===void 0&&`process`in globalThis&&typeof e==`object`&&e&&typeof e.cwd==`function`&&(n=e.cwd()),i=n}i.length!==0&&(e=i+`/`+e,t=i.charCodeAt(0)===47)}return e=qe(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`};function Ze(e){let t=new URL(`file://`),n=Xe(e);return e.charCodeAt(e.length-1)===47&&n[n.length-1]!==`/`&&(n+=`/`),t.pathname=rt(n),O(t)}const Qe=/%/g,$e=/\\/g,et=/\n/g,tt=/\r/g,nt=/\t/g;function rt(e){return e.includes(`%`)&&(e=e.replace(Qe,`%25`)),e.includes(`\\`)&&(e=e.replace($e,`%5C`)),e.includes(`
|
|
2
2
|
`)&&(e=e.replace(et,`%0A`)),e.includes(`\r`)&&(e=e.replace(tt,`%0D`)),e.includes(` `)&&(e=e.replace(nt,`%09`)),e}const R=L.of({[I]:I,resolve:Xe,normalize(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=qe(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&n&&(e+=`/`),t?`/`+e:e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return`.`;let e;for(let t=0;t<arguments.length;++t){let n=arguments[t];n.length>0&&(e===void 0?e=n:e+=`/`+n)}return e===void 0?`.`:R.normalize(e)},relative(e,t){if(e===t||(e=R.resolve(e),t=R.resolve(t),e===t))return``;let n=1;for(;n<e.length&&e.charCodeAt(n)===47;++n);let r=e.length,i=r-n,a=1;for(;a<t.length&&t.charCodeAt(a)===47;++a);let o=t.length-a,s=i<o?i:o,c=-1,l=0;for(;l<=s;++l){if(l===s){if(o>s){if(t.charCodeAt(a+l)===47)return t.slice(a+l+1);if(l===0)return t.slice(a+l)}else i>s&&(e.charCodeAt(n+l)===47?c=l:l===0&&(c=0));break}let r=e.charCodeAt(n+l);if(r!==t.charCodeAt(a+l))break;r===47&&(c=l)}let u=``;for(l=n+c+1;l<=r;++l)(l===r||e.charCodeAt(l)===47)&&(u.length===0?u+=`..`:u+=`/..`);return u.length>0?u+t.slice(a+c):(a+=c,t.charCodeAt(a)===47&&++a,t.slice(a))},dirname(e){if(e.length===0)return`.`;let t=e.charCodeAt(0),n=t===47,r=-1,i=!0;for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:`.`:n&&r===1?`//`:e.slice(0,r)},basename(e,t){let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}else{for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)}},extname(e){let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return Je(`/`,e)},parse(e){let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.charCodeAt(0),r=n===47,i;r?(t.root=`/`,i=1):i=0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir=`/`),t},sep:`/`,fromFileUrl:Ye,toFileUrl:Ze,toNamespacedPath:xe}),it=Te(L,R),at=L,ot=it,st={arrays:`merge`,sets:`merge`,maps:`merge`};function z(e,t,n){return ct(e,t,new Set,n??st)}function ct(e,t,n,r){let i={},a=new Set([...pt(e),...pt(t)]);for(let o of a){if(o===`__proto__`)continue;let a=e[o];if(!Object.hasOwn(t,o)){i[o]=a;continue}let s=t[o];if(ft(a)&&ft(s)&&!n.has(a)&&!n.has(s)){n.add(a),n.add(s),i[o]=lt(a,s,n,r);continue}i[o]=s}return i}function lt(e,t,n,r){if(ut(e)&&ut(t))return ct(e,t,n,r);if(dt(e)&&dt(t)){if(Array.isArray(e)&&Array.isArray(t))return r.arrays===`merge`?e.concat(t):t;if(e instanceof Map&&t instanceof Map){if(r.maps===`merge`){let n=new Map(e);for(let[e,r]of t)n.set(e,r);return n}return t}if(e instanceof Set&&t instanceof Set){if(r.sets===`merge`){let n=new Set(e);for(let e of t)n.add(e);return n}return t}}return t}function ut(e){return Object.getPrototypeOf(e)===Object.prototype}function dt(e){return typeof e[Symbol.iterator]==`function`}function ft(e){return typeof e==`object`&&!!e}function pt(e){let t=Object.keys(e),n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n)Object.prototype.propertyIsEnumerable.call(e,r)&&t.push(r);return t}function mt(e){return e%4==0&&e%100!=0||e%400==0}var ht=class{#e=/[ \t]/;#t=0;#n;constructor(e){this.#n=e}get position(){return this.#t}get source(){return this.#n}char(e=0){return this.#n[this.#t+e]??``}slice(e,t){return this.#n.slice(this.#t+e,this.#t+t)}next(e=1){this.#t+=e}skipWhitespaces(){for(;this.#e.test(this.char())&&!this.eof();)this.next();if(!this.isCurrentCharEOL()&&/\s/.test(this.char())){let e=`\\u`+this.char().charCodeAt(0).toString(16),t=this.#t;throw SyntaxError(`Cannot parse the TOML: It contains invalid whitespace at position '${t}': \`${e}\``)}}nextUntilChar(e={skipComments:!0}){for(;!this.eof();){let t=this.char();if(this.#e.test(t)||this.isCurrentCharEOL())this.next();else if(e.skipComments&&this.char()===`#`)for(;!this.isCurrentCharEOL()&&!this.eof();)this.next();else break}}eof(){return this.#t>=this.#n.length}isCurrentCharEOL(){return this.char()===`
|
|
3
3
|
`||this.startsWith(`\r
|
|
4
4
|
`)}startsWith(e){return this.#n.startsWith(e,this.#t)}match(e){if(!e.sticky)throw Error(`RegExp ${e} does not have a sticky 'y' flag`);return e.lastIndex=this.#t,this.#n.match(e)}};function B(e){return{ok:!0,body:e}}function V(){return{ok:!1}}function H(e,t={__proto__:null}){return e.reduceRight((e,t)=>({[t]:e}),t)}function gt(e){return typeof e==`object`&&!!e}function _t(e,t){let n=t[0];if(!n)throw Error(`Cannot parse the TOML: key length is not a positive number`);return e[n]}function vt(e,t){let{keys:n,type:r,value:i}=t,a=_t(e,n);if(a===void 0)return Object.assign(e,H(n,i));if(Array.isArray(a))return U(a.at(-1),{type:r,keys:n.slice(1),value:i}),e;if(gt(a))return U(a,{type:r,keys:n.slice(1),value:i}),e;throw Error(`Unexpected assign`)}function yt(e,t){let{type:n,keys:r,value:i}=t,a=_t(e,r);if(a===void 0)return Object.assign(e,H(r,[i]));if(Array.isArray(a))return t.keys.length===1?a.push(i):U(a.at(-1),{type:t.type,keys:t.keys.slice(1),value:t.value}),e;if(gt(a))return U(a,{type:n,keys:r.slice(1),value:i}),e;throw Error(`Unexpected assign`)}function U(e,t){switch(t.type){case`Block`:return z(e,t.value);case`Table`:return vt(e,t);case`TableArray`:return yt(e,t)}}function W(e){return t=>{for(let n of e){let e=n(t);if(e.ok)return e}return V()}}function bt(e,t){let n=K(t);return r=>{let i=[],a=e(r);if(!a.ok)return B(i);for(i.push(a.body);!r.eof()&&n(r).ok;){let n=e(r);if(!n.ok)throw SyntaxError(`Invalid token after "${t}"`);i.push(n.body)}return B(i)}}function xt(e,t){let n=K(t);return r=>{let i=e(r);if(!i.ok)return V();let a=[i.body];for(;!r.eof()&&n(r).ok;){let n=e(r);if(!n.ok)throw SyntaxError(`Invalid token after "${t}"`);a.push(n.body)}return B(a)}}function St(e,t,n){let r=K(t);return i=>{let a=i.position,o=e(i);if(!o.ok)return V();if(!r(i).ok)throw SyntaxError(`key/value pair doesn't have "${t}"`);let s=n(i);if(!s.ok){let e=i.source.indexOf(`
|
|
@@ -14,8 +14,8 @@ import{$ as e,A as t,An as n,B as r,D as i,Dt as a,E as o,En as s,Et as c,F as l
|
|
|
14
14
|
`)&&e.next(2);let t=[];for(;!e.startsWith(`'''`)&&!e.eof();)t.push(e.char()),e.next();if(e.eof())throw SyntaxError(`Multi-line string is not closed:\n${t.join(``)}`);return e.char(3)===`'`&&(t.push(`'`),e.next()),e.next(3),B(t.join(``))}const Mt=/(?:true|false)\b/y;function Nt(e){e.skipWhitespaces();let t=e.match(Mt);if(!t)return V();let n=t[0];return e.next(n.length),B(n===`true`)}const Pt=new Map([[`inf`,1/0],[`+inf`,1/0],[`-inf`,-1/0]]),Ft=/[+-]?inf\b/y;function It(e){e.skipWhitespaces();let t=e.match(Ft);if(!t)return V();let n=t[0];return e.next(n.length),B(Pt.get(n))}const Lt=/[+-]?nan\b/y;function Rt(e){e.skipWhitespaces();let t=e.match(Lt);if(!t)return V();let n=t[0];return e.next(n.length),B(NaN)}const q=xt(W([Et,Ot,kt]),`.`),zt=/0b[01]+(?:_[01]+)*\b/y;function Bt(e){e.skipWhitespaces();let t=e.match(zt)?.[0];if(!t)return V();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,2);return isNaN(r)?V():B(r)}const Vt=/0o[0-7]+(?:_[0-7]+)*\b/y;function Ht(e){e.skipWhitespaces();let t=e.match(Vt)?.[0];if(!t)return V();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,8);return isNaN(r)?V():B(r)}const Ut=/0x[0-9a-f]+(?:_[0-9a-f]+)*\b/iy;function Wt(e){e.skipWhitespaces();let t=e.match(Ut)?.[0];if(!t)return V();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,16);return isNaN(r)?V():B(r)}const Gt=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)\b/y;function Kt(e){e.skipWhitespaces();let t=e.match(Gt)?.[0];if(!t)return V();e.next(t.length);let n=t.replaceAll(`_`,``);return B(parseInt(n,10))}const qt=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)(?:\.[0-9]+(?:_[0-9]+)*)?(?:e[+-]?[0-9]+(?:_[0-9]+)*)?\b/iy;function Jt(e){e.skipWhitespaces();let t=e.match(qt)?.[0];if(!t)return V();e.next(t.length);let n=t.replaceAll(`_`,``),r=parseFloat(n);return isNaN(r)?V():B(r)}const Yt=/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})(?:[ 0-9TZ.:+-]+)?\b/y;function Xt(e){e.skipWhitespaces();let t=e.match(Yt);if(!t)return V();let n=t[0];e.next(n.length);let r=t.groups;if(r.month==`02`){let e=parseInt(r.day);if(e>29)throw SyntaxError(`Invalid date string "${t}"`);let n=parseInt(r.year);if(e>28&&!mt(n))throw SyntaxError(`Invalid date string "${t}"`)}let i=new Date(n.trim());if(isNaN(i.getTime()))throw SyntaxError(`Invalid date string "${t}"`);return B(i)}const Zt=/(\d{2}):(\d{2}):(\d{2})(?:\.[0-9]+)?\b/y;function Qt(e){e.skipWhitespaces();let t=e.match(Zt)?.[0];return t?(e.next(t.length),B(t)):V()}function $t(e){if(e.skipWhitespaces(),e.char()!==`[`)return V();e.next();let t=[];for(;!e.eof();){e.nextUntilChar();let n=tn(e);if(!n.ok||(t.push(n.body),e.skipWhitespaces(),e.char()!==`,`))break;e.next()}if(e.nextUntilChar(),e.char()!==`]`)throw SyntaxError(`Array is not closed`);return e.next(),B(t)}function en(e){if(e.nextUntilChar(),e.char(1)===`}`)return e.next(2),B({__proto__:null});let t=G(`{`,bt(nn,`,`),`}`)(e);if(!t.ok)return V();let n={__proto__:null};for(let e of t.body)n=z(n,e);return B(n)}const tn=W([At,jt,Ot,kt,Nt,It,Rt,Xt,Qt,Bt,Ht,Wt,Jt,Kt,$t,en]),nn=St(q,`=`,tn);function J(e){e.nextUntilChar();let t=Ct(wt(nn))(e);return t.ok?B({type:`Block`,value:t.body}):V()}const rn=G(`[`,q,`]`);function an(e){e.nextUntilChar();let t=rn(e);if(!t.ok)return V();e.nextUntilChar();let n=J(e);return B({type:`Table`,keys:t.body,value:n.ok?n.body.value:{__proto__:null}})}const on=G(`[[`,q,`]]`);function sn(e){e.nextUntilChar();let t=on(e);if(!t.ok)return V();e.nextUntilChar();let n=J(e);return B({type:`TableArray`,keys:t.body,value:n.ok?n.body.value:{__proto__:null}})}function cn(e){let t=wt(W([J,sn,an]))(e);return t.ok?B(t.body.reduce(U,{__proto__:null})):B({__proto__:null})}function Y(e,t){let n=e.source.slice(0,e.position).split(`
|
|
15
15
|
`);return`Parse error on line ${n.length}, column ${n.at(-1)?.length??0}: ${t}`}function ln(e){return t=>{let n=new ht(t);try{let t=e(n);if(t.ok&&n.eof())return t.body;let r=`Unexpected character: "${n.char()}"`;throw SyntaxError(Y(n,r))}catch(e){throw e instanceof Error?SyntaxError(Y(n,e.message)):SyntaxError(Y(n,`Invalid error type caught`))}}}function un(e){return ln(cn)(e)}const dn={ctx_execute:!0,ctx_batch_execute:!0};function fn(e,t){return dn[e]?e!==`ctx_execute`||t.language===`shell`:!1}function pn(e,t){if(fn(e,t)){if(e===`ctx_execute`)return typeof t.code==`string`?t.code:void 0;if(Array.isArray(t.commands))return t.commands.map(e=>typeof e==`object`&&e?e.command:``).filter(e=>typeof e==`string`).join(`
|
|
16
16
|
`)}}const mn=/#[0-9a-fA-F]{4}$/u,hn=/^\*\*\* (?:Add|Update|Delete) File:\s*(.+)$/,gn=/^\*\*\* Move to:\s*(.+)$/,_n={Write:!0,Edit:!0,Read:!0,MultiEdit:!0,Update:!0,Create:!0};function vn(e){let t=e.trim(),n=mn.exec(t)?.index,r=n===void 0?t:t.slice(0,n);if(r.length<2)return r;let i=r[0],a=r[r.length-1];return(i===`"`||i===`'`)&&i===a?r.slice(1,-1):r}function yn(e){let t=e.trimEnd();if(!t.startsWith(`[`))return;let n=t.endsWith(`]`)?t.length-1:t.length,r=vn(t.slice(1,n));return r.length>0?r:void 0}function bn(e){let t=[],n=e.startsWith(``)?e.slice(1):e,r=!1;for(let e of n.split(`
|
|
17
|
-
`)){let n=yn(e);if(n!==void 0){t.push(n),r=!0;continue}let i=hn.exec(e)?.[1];if(i!==void 0){t.push(i.trim());continue}let a=gn.exec(e)?.[1];if(a!==void 0){t.push(a.trim());continue}let o=e.trim();if(r&&o.startsWith(`MV `)){let e=vn(o.slice(3));e.length>0&&t.push(e)}}return t}function xn(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:void 0}function Sn(e,t){if(_n[e]!==!0)return[];let n=t.input,r=typeof n==`string`?bn(n):[];if(r.length>0)return Array.from(new Set(r));let i=xn(t,`file_path`)??xn(t,`path`);return i===void 0?[]:[i]}const X=new Map;function Cn(e,t){if(t===void 0||t.length===0)return!0;let n=t.split(`|`).map(e=>e.trim()).filter(Boolean).join(`|`);if(n.length===0)return!0;let r=X.get(n);if(r!==void 0)return r===!0||r.test(e);let i=wn(n);return X.size>=256&&X.clear(),X.set(n,i),i===!0||i.test(e)}function wn(e){try{return RegExp(`^(?:${e})$`)}catch{return!0}}const Tn=/^\s*([^\s()]+)\s*(?:\(([\s\S]*)\))?\s*$/,En=/\$\(|`|\$\{?\w/,Dn=/\$\(([^()]*)\)|`([^`]*)`/g,On=/^(?:\w+=(?:"[^"]*"|'[^']*'|\S*)\s+)+/,kn=/&&|\|\||[;|]/,An=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function jn(e,t,n,r){let i=Tn.exec(e),a=i?.[1];if(a===void 0)return!0;if(a!==t)return!1;let o=i?.[2]?.trim();return o===void 0||o.length===0?!0:a===`Bash`?Mn(o,n.command):In(o,n.file_path,r)}function Mn(e,t){if(typeof t!=`string`)return!0;let n=Nn(t);return n.length===0||n.some(t=>Fn(e,t))?!0:Pn(e)&&En.test(t)}function Nn(e){let t=[...e.matchAll(Dn)].map(e=>e[1]??e[2]??``);return[e.replace(Dn,` `),...t].flatMap(e=>e.split(kn)).map(e=>e.trim().replace(On,``)).filter(e=>e.length>0)}function Pn(e){return e.replace(/\*+$/,``).trim().split(/\s+/).filter(Boolean).length>1}function Fn(e,t){return RegExp(`^${e.split(`*`).map(An).join(`.*`)}$`).test(t)}function In(e,t,n){if(typeof t!=`string`)return!0;let r=t.startsWith(`${n}/`)?t.slice(n.length+1):t,i=e.replace(/\/+$/,``),a=i.includes(`/`)?r:Ln(r);return RegExp(`^${Rn(i)}$`).test(a)}const Ln=e=>e.slice(e.lastIndexOf(`/`)+1);function Rn(e){let t=zn(e);return e.endsWith(`/**`)?`(?:${zn(e.slice(0,-3))}|${t})`:t}function zn(e){let t=``,n=0;for(;n<e.length;){let r=e.charAt(n);if(r!==`*`){t+=r===`?`?`[^/]`:An(r),n+=1;continue}if(e.charAt(n+1)!==`*`){t+=`[^/]*`,n+=1;continue}let i=e.charAt(n+2)===`/`;t+=i?`(?:[^/]+/)*`:`.*`,n+=i?3:2}return t}function Bn(e){return{session_id:e(),agent_id:null}}const Z=p({key:
|
|
17
|
+
`)){let n=yn(e);if(n!==void 0){t.push(n),r=!0;continue}let i=hn.exec(e)?.[1];if(i!==void 0){t.push(i.trim());continue}let a=gn.exec(e)?.[1];if(a!==void 0){t.push(a.trim());continue}let o=e.trim();if(r&&o.startsWith(`MV `)){let e=vn(o.slice(3));e.length>0&&t.push(e)}}return t}function xn(e,t){let n=e[t];return typeof n==`string`&&n.length>0?n:void 0}function Sn(e,t){if(_n[e]!==!0)return[];let n=t.input,r=typeof n==`string`?bn(n):[];if(r.length>0)return Array.from(new Set(r));let i=xn(t,`file_path`)??xn(t,`path`);return i===void 0?[]:[i]}const X=new Map;function Cn(e,t){if(t===void 0||t.length===0)return!0;let n=t.split(`|`).map(e=>e.trim()).filter(Boolean).join(`|`);if(n.length===0)return!0;let r=X.get(n);if(r!==void 0)return r===!0||r.test(e);let i=wn(n);return X.size>=256&&X.clear(),X.set(n,i),i===!0||i.test(e)}function wn(e){try{return RegExp(`^(?:${e})$`)}catch{return!0}}const Tn=/^\s*([^\s()]+)\s*(?:\(([\s\S]*)\))?\s*$/,En=/\$\(|`|\$\{?\w/,Dn=/\$\(([^()]*)\)|`([^`]*)`/g,On=/^(?:\w+=(?:"[^"]*"|'[^']*'|\S*)\s+)+/,kn=/&&|\|\||[;|]/,An=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function jn(e,t,n,r){let i=Tn.exec(e),a=i?.[1];if(a===void 0)return!0;if(a!==t)return!1;let o=i?.[2]?.trim();return o===void 0||o.length===0?!0:a===`Bash`?Mn(o,n.command):In(o,n.file_path,r)}function Mn(e,t){if(typeof t!=`string`)return!0;let n=Nn(t);return n.length===0||n.some(t=>Fn(e,t))?!0:Pn(e)&&En.test(t)}function Nn(e){let t=[...e.matchAll(Dn)].map(e=>e[1]??e[2]??``);return[e.replace(Dn,` `),...t].flatMap(e=>e.split(kn)).map(e=>e.trim().replace(On,``)).filter(e=>e.length>0)}function Pn(e){return e.replace(/\*+$/,``).trim().split(/\s+/).filter(Boolean).length>1}function Fn(e,t){return RegExp(`^${e.split(`*`).map(An).join(`.*`)}$`).test(t)}function In(e,t,n){if(typeof t!=`string`)return!0;let r=t.startsWith(`${n}/`)?t.slice(n.length+1):t,i=e.replace(/\/+$/,``),a=i.includes(`/`)?r:Ln(r);return RegExp(`^${Rn(i)}$`).test(a)}const Ln=e=>e.slice(e.lastIndexOf(`/`)+1);function Rn(e){let t=zn(e);return e.endsWith(`/**`)?`(?:${zn(e.slice(0,-3))}|${t})`:t}function zn(e){let t=``,n=0;for(;n<e.length;){let r=e.charAt(n);if(r!==`*`){t+=r===`?`?`[^/]`:An(r),n+=1;continue}if(e.charAt(n+1)!==`*`){t+=`[^/]*`,n+=1;continue}let i=e.charAt(n+2)===`/`;t+=i?`(?:[^/]+/)*`:`.*`,n+=i?3:2}return t}function Bn(e){return{session_id:e(),agent_id:null}}const Z=p({key:a,value:D(a)}).pipe(re(`TomlConfig`)),Vn=n(a,se(Z),{strict:!0,decode:e=>le({try:()=>un(e),catch:e=>new ue(e,`TOML parse error`)}).pipe(De(e=>oe(Z)(e))),encode:(e,t,n)=>je(new te(n,e,`TomlConfigFromText is decode-only`))}),Q=de(Z)({});var $=class extends m(`TomlLoader`)(){};const Hn=ve($,we(function*(){let e=yield*Ae(ke()),t=yield*F,n=yield*at;return $.of({load:i(`TomlLoader.load`)(function*(r){let i=Se(yield*_e(e),r);if(ie(i))return i.value;let a=n.join(r,`systemfsoftware.toml`);if(!(yield*t.exists(a)))return yield*b(e,e=>(pe(e,r,Q),e)),Q;let o=yield*t.readFileString(a).pipe(s(ae(Vn)),he(()=>O(Q)));return yield*b(e,e=>(pe(e,r,o),e)),o})})})),Un={Write:!0,Edit:!0,Read:!0,MultiEdit:!0,Update:!0,Create:!0},Wn={Edit:!0,MultiEdit:!0,Update:!0},Gn=S(D(r({old_text:d(_),new_text:d(_)}).pipe(c(e=>`old_text`in e||`new_text`in e))).pipe(ee(1))),Kn=(e,t)=>{let n=e.split(`
|
|
18
18
|
`).filter(e=>e.startsWith(t));return n.length===0?void 0:n.map(e=>e.slice(t.length)).join(`
|
|
19
19
|
`)};function qn(e,t){let n=t;if(Un[e]===!0&&`path`in n&&!(`file_path`in n)){let{path:e,...t}=n;n={file_path:e,...t}}if(Wn[e]===!0&&`edits`in n&&Gn(n.edits)&&!(`new_string`in n)){let e=n.edits.map(e=>({old_string:typeof e.old_text==`string`?e.old_text:``,new_string:typeof e.new_text==`string`?e.new_text:``}));n={...n,edits:e,old_string:e.map(e=>e.old_string).join(`
|
|
20
20
|
`),new_string:e.map(e=>e.new_string).join(`
|
|
21
|
-
`)}}if(Wn[e]===!0&&typeof n.input==`string`&&!(`new_string`in n)){let e=Kn(n.input,`+`),t=Kn(n.input,`-`);n={...n,...e===void 0?{}:{new_string:e},...t===void 0?{}:{old_string:t}}}return n}const Jn=S(D(
|
|
21
|
+
`)}}if(Wn[e]===!0&&typeof n.input==`string`&&!(`new_string`in n)){let e=Kn(n.input,`+`),t=Kn(n.input,`-`);n={...n,...e===void 0?{}:{new_string:e},...t===void 0?{}:{old_string:t}}}return n}const Jn=S(D(r({old_string:d(_),new_string:d(_)}).pipe(c(e=>`old_string`in e||`new_string`in e)))),Yn=e(p({key:a,value:_}));function Xn(e,t){let n=Ce(Yn(t));if(n===null)return{};let r=`file_path`in e||!(`path`in e)?`file_path`:`path`,i={};for(let[t,a]of Object.entries(n)){if(t===`file_path`){i[r]=a;continue}if(!((t===`old_string`||t===`new_string`)&&!(t in e))){if(t===`edits`&&Jn(a)&&Gn(e.edits)){i.edits=a.map(e=>({old_text:typeof e.old_string==`string`?e.old_string:``,new_text:typeof e.new_string==`string`?e.new_string:``}));continue}i[t]=a}}return i}const Zn={read:`Read`,write:`Write`,edit:`Edit`,bash:`Bash`,glob:`Glob`,grep:`Grep`,task:`Task`,todo:`TodoWrite`,web_search:`WebSearch`,ask:`AskUserQuestion`};function Qn(e){if(e.length===0||e.startsWith(`mcp__`))return e;let t=Zn[e];return t===void 0?e.charAt(0).toUpperCase()+e.slice(1):t}export{Ie as C,j as S,Ke as _,pn as a,We as b,qn as c,at as d,ot as f,ze as g,Ve as h,Sn as i,Qn as l,F as m,Hn as n,Cn as o,He as p,Xn as r,jn as s,$ as t,Bn as u,Ue as v,Be as x,Ge as y};
|