@opsydyn/oxlint-effect 0.8.0 → 0.9.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/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{definePlugin as e,defineRule as t}from"@oxlint/plugins";function n(e,t){return typeof e==`object`&&!!e&&e.type===`Identifier`&&typeof e.name==`string`&&(t===void 0||e.name===t)}function r(e,t,r){if(typeof e!=`object`||!e)return!1;let i=e;return i.type===`MemberExpression`&&i.computed!==!0&&n(i.object,t)&&n(i.property,r)}function i(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`Effect`)&&n(t.callee.property)}function a(e){return e.arguments[0]}function o(e,t){if(!i(e))return!1;let r=e.callee;return n(r.property,t)}function s(e){if(!i(e))return!1;let t=a(e);return i(t)?i(a(t)):!1}function ee(e){return i(e)?e.arguments.slice(0,2).some(e=>i(e)):!1}function c(e,t,n=new WeakSet){return o(e,t)?!0:Array.isArray(e)?e.some(e=>c(e,t,n)):typeof e!=`object`||!e||n.has(e)?!1:(n.add(e),Object.entries(e).some(([e,r])=>e!==`parent`&&c(r,t,n)))}function te(e){if(o(e,`flatMap`)&&c(e.arguments,`flatMap`))return`Rule: avoid nested Effect.flatMap. Why: it hides sequencing and pushes laddered control flow. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.`;if(o(e,`flatten`)&&c(a(e),`map`))return`Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.`}const ne=[`flatMap`,`zipRight`,`as`,`tap`];function re(e){if(!o(e,`orElse`))return!1;let t=a(e);return ne.some(e=>c(t,e))}function l(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`CallExpression`)return!1;if(n(t.callee,`pipe`))return!0;let r=t.callee;return typeof r==`object`&&!!r&&r.type===`MemberExpression`&&r.computed!==!0&&n(r.property,`pipe`)}function ie(e,t=new WeakSet){return l(e)?!0:Array.isArray(e)?e.some(e=>ie(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ie(n,t)))}function ae(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`ArrowFunctionExpression`}function oe(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&(t.callee.type===`ArrowFunctionExpression`||t.callee.type===`FunctionExpression`)}function u(e,t=new WeakSet){if(ae(e))return e;if(Array.isArray(e)){for(let n of e){let e=u(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=u(r,t);if(e)return e}}}function d(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>d(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),e.type===`ReturnStatement`?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:d(n,t)))}function se(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&(r(t.callee,`S`,`filter`)||r(t.callee,`Schema`,`filter`))}function ce(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)||se(t)?[]:t.arguments.flatMap(e=>{if(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`)return[];let t=e.body;return typeof t!=`object`||!t||t.type!==`BlockStatement`?[]:d(t)})}function le(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)?[]:t.arguments.flatMap(e=>typeof e!=`object`||!e||e.type!==`FunctionExpression`||e.generator===!0?[]:d(e.body))}function ue(e){return typeof e==`object`&&!!e&&e.type===`FunctionExpression`&&e.generator===!0}function f(e,t){if(!o(e,t))return;let n=a(e);return ue(n)?n:void 0}function de(e,t){return f(e,t)!==void 0}const fe=new Set([`gen`,`sync`,`try`,`tryPromise`,`fn`]);function pe(e){if(i(e)){let t=e.callee.property;if(n(t)&&fe.has(t.name))return!0}if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&o(t.callee,`fn`)}function me(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&r(e.callee,`Date`,`now`)}function he(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>he(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),me(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:he(n,t)))}function ge(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=ge(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`YieldExpression`&&e.delegate!==!0)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=ge(r,t);if(e)return e}}}function _e(e){let t=f(e,`gen`);return t?ge(t.body):void 0}function ve(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>ve(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),e.type===`YieldExpression`&&e.delegate===!0&&l(e.argument)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:ve(n,t)))}function ye(e){let t=f(e,`gen`);if(!t)return;let n=ve(t.body);return n.length>=2?n[1]:void 0}function p(e,t,n=new WeakSet){return Array.isArray(e)?e.some(e=>p(e,t,n)):typeof e!=`object`||!e||n.has(e)?!1:(n.add(e),e.type===t?!0:Object.entries(e).some(([e,r])=>e!==`parent`&&p(r,t,n)))}function m(e,t,r=new WeakSet){return n(e,t)?!0:Array.isArray(e)?e.some(e=>m(e,t,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&m(n,t,r)))}function h(e,t=new WeakSet){return i(e)?!0:Array.isArray(e)?e.some(e=>h(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&h(n,t)))}function be(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return;let t=e.declarations;if(!Array.isArray(t)||t.length!==1)return;let r=t[0];if(!(typeof r!=`object`||!r||r.type!==`VariableDeclarator`||!n(r.id)||typeof r.init!=`object`||r.init===null||r.init.type!==`YieldExpression`||r.init.delegate!==!0))return r.id.name}function xe(e,t){if(typeof e!=`object`||!e||e.type!==`ReturnStatement`)return!1;let r=e.argument;return r!==void 0&&!n(r,t)&&!p(r,`YieldExpression`)&&!p(r,`AwaitExpression`)&&!h(r)&&!m(r,`Promise`)}function Se(e){let t=f(e,`gen`);if(!t||typeof t.body!=`object`||t.body===null)return;let n=t.body,r=Array.isArray(n.body)?n.body:[];if(r.length!==2)return;let i=be(r[0]);return i&&xe(r[1],i)?e:void 0}const Ce=new Set([`andThen`,`flatMap`,`tap`,`zipRight`]);function we(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return[];let t=e,r=Array.isArray(t.arguments)?t.arguments:[];if(n(t.callee,`pipe`))return r.slice(1);let i=t.callee;return typeof i==`object`&&i&&i.type===`MemberExpression`&&i.computed!==!0&&n(i.property,`pipe`)?r:[]}function Te(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Ce.has(t.name)}function Ee(e){if(l(e))return we(e).filter(e=>Te(e)).length>=3?e:void 0}function De(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&n(e.callee,`flow`)}function Oe(e){return De(e)&&e.arguments.length>=5}function ke(e,t=new WeakSet){return typeof e==`object`&&e&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`)&&e.async===!0?!0:Array.isArray(e)?e.some(e=>ke(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ke(n,t)))}function Ae(e){return h(e)||p(e,`YieldExpression`)||p(e,`AwaitExpression`)||ke(e)||A(e)||m(e,`Promise`)||m(e,`Runtime`)}function je(e){if(De(e))return e.arguments.find(e=>Ae(e))}function Me(e){if(!(typeof e!=`object`||!e||e.type!==`CallExpression`))return(e.arguments??[]).find(e=>De(e)&&e.arguments.length>=3)}const Ne=new Set([`annotateLogs`,`as`,`catchAll`,`catchSome`,`catchTag`,`map`,`mapBoth`,`provide`,`retry`,`tap`,`tapError`,`timeout`,`timeoutFail`,`withSpan`]);function g(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Ne.has(t.name)}function Pe(e){return i(e)||l(e)}function Fe(e){if(!g(e))return;let t=e.arguments[0];return Pe(t)?e:void 0}function Ie(e){return typeof e!=`object`||!e||e.type!==`YieldExpression`||e.delegate!==!0||!l(e.argument)?!1:we(e.argument).some(e=>g(e))}function Le(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Le(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),Ie(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:Le(n,t)))}function Re(e){let t=f(e,`gen`);if(!t)return;let n=Le(t.body);return n.length>=2?n[1]:void 0}function ze(e){if(!l(e))return;let t=we(e);if(!t.some(e=>g(e)))return;let n=t.filter(e=>Te(e)).length,r=t.some(e=>p(e,`IfStatement`)||p(e,`SwitchStatement`)||p(e,`ForStatement`)||p(e,`ForInStatement`)||p(e,`ForOfStatement`)||p(e,`WhileStatement`));return n>=2||r?e:void 0}function _(e,t=new Set,n=new WeakSet){if((o(e,`gen`)||Te(e))&&t.add(`workflow`),De(e)&&t.add(`pure`),g(e)&&t.add(`behavior`),(k(e,`Layer`)||r(e,`Layer`,`pipe`))&&t.add(`layer`),Array.isArray(e)){for(let r of e)_(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;n.add(e);for(let[r,i]of Object.entries(e))r!==`parent`&&_(i,t,n);return t}function v(e){return typeof e==`object`&&!!e&&(e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`)}function Be(e){if(!v(e))return;let t=e.body;return _(t).size>=3?e:void 0}function Ve(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,Ve(n,t)),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=Object.entries(e).reduce((e,[n,r])=>n===`parent`?e:Math.max(e,Ve(r,t)),0);return e.type===`CallExpression`?n+1:n}function He(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=_(e),n=oe(e)||u(e)!==void 0;return t.size>=2&&(Ve(e)>=4||n)?e:void 0}function Ue(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;for(let e of t.arguments??[]){if(typeof e!=`object`||!e||!v(e))continue;let t=e.body;if(typeof t==`object`&&t&&t.type===`BlockStatement`&&Array.isArray(t.body)&&t.body.length>=3)return e}}function We(e){return r(e,`Effect`,`Service`)?!0:typeof e!=`object`||!e||e.type!==`CallExpression`?!1:We(e.callee)}function Ge(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(We(t.callee))return[...t.arguments??[]].reverse().find(e=>typeof e==`object`&&!!e&&e.type===`ObjectExpression`)}function y(e){if(!(typeof e!=`object`||!e||e.type!==`ClassDeclaration`))return Ge(e.superClass)}function Ke(e){return k(e,`Context`,`Tag`)||k(e,`Context`,`GenericTag`)}function qe(e,t=new WeakSet){return k(e,`Layer`,`provide`)?!0:Array.isArray(e)?e.some(e=>qe(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&qe(n,t)))}function Je(e){return V(B(e,`accessors`),!0)}function Ye(e){if(!Y(K(e)??``))return;let t=typeof e==`object`&&e?e.specifiers:void 0;return Array.isArray(t)?t.find(e=>typeof e==`object`&&!!e&&e.type===`ImportNamespaceSpecifier`):void 0}function Xe(e){return typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&n(e.argument)&&e.argument.name.endsWith(`Service`)}function b(e,t,n=new WeakSet){if(t(e))return e;if(Array.isArray(e)){for(let r of e){let e=b(r,t,n);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!n.has(e)){n.add(e);for(let[r,i]of Object.entries(e)){if(r===`parent`)continue;let e=b(i,t,n);if(e)return e}}}function x(e,t,n=new WeakSet){let r=t(e)?[e]:[];return Array.isArray(e)?e.flatMap(e=>x(e,t,n)).concat(r):typeof e!=`object`||!e||n.has(e)?r:(n.add(e),Object.entries(e).reduce((e,[r,i])=>r===`parent`?e:e.concat(x(i,t,n)),r))}function Ze(e){if(!B(e,`dependencies`))return b(B(e,`effect`)??B(e,`scoped`),Xe)}function Qe(e){if(!k(e,`Layer`))return!1;let t=e.callee.property;return n(t)&&(t.name===`provide`||t.name.startsWith(`merge`))}function $e(e){if(typeof e!=`object`||!e||e.type!==`FunctionDeclaration`)return!1;let t=e.id;return n(t)&&/(handler|route|request)$/i.test(t.name)}function et(e){if($e(e))return b(e.body,Qe)?e:void 0}function tt(e){if(k(e,`Layer`,`provide`))return b(a(e),t=>t!==e&&k(t,`Layer`,`provide`))}function nt(e){return o(e,`provide`)||k(e,`Layer`,`provide`)}function rt(e){let t=f(e,`gen`);return t?b(t.body,nt):void 0}function it(e){if(k(e,`Layer`,`merge`))return e.arguments?.find(t=>b(t,t=>t!==e&&k(t,`Layer`,`merge`)))}function at(e){return n(e)&&/(Layer|Live)$/.test(e.name)}function ot(e){if(!(typeof e!=`object`||!e||e.type!==`VariableDeclaration`))return e.declarations?.find(e=>typeof e==`object`&&!!e&&at(e.id)&&b(e.init,nt))}function st(e){return v(e)?nr(L(e),`Promise`)||T(e.body)!==void 0:!1}function ct(e){return typeof e==`object`&&!!e&&e.type===`Property`&&st(e.value)}function lt(e){return b(e,ct)}function ut(e){if(typeof e!=`object`||!e||e.type!==`ObjectExpression`)return!1;let t=e.properties;return Array.isArray(t)&&t.some(e=>typeof e==`object`&&!!e&&e.type===`Property`&&(v(e.value)||o(e.value,`fn`)))}function dt(e){if(typeof e!=`object`||!e)return;let t=e.declaration;if(!(typeof t!=`object`||!t)&&t.type===`VariableDeclaration`){for(let e of t.declarations??[])if(typeof e==`object`&&e&&n(e.id)&&e.id.name.endsWith(`Service`)&&ut(e.init))return e}}function ft(e){return typeof e==`object`&&!!e&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`)&&e.async===!0}const S=new Set([`andThen`,`catchAll`,`catchTag`,`filterOrFail`,`flatMap`,`forEach`,`map`,`orElse`,`tap`]);function pt(e){if(!i(e))return;let t=e.callee.property;if(!(!n(t)||!S.has(t.name)))return e.arguments.find(e=>ft(e))}function C(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=C(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`ThrowStatement`)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=C(r,t);if(e)return e}}}function mt(e){let t=f(e,`gen`);if(t)return C(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?C(e):void 0;if(n)return n}}function w(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=w(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`TryStatement`)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=w(r,t);if(e)return e}}}function ht(e){let t=f(e,`gen`);if(t)return w(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?w(e):void 0;if(n)return n}}function gt(e){return k(e,`Promise`,`all`)||k(e,`Promise`,`allSettled`)||k(e,`Promise`,`any`)||k(e,`Promise`,`race`)||k(e,`Promise`,`reject`)||k(e,`Promise`,`resolve`)}function _t(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;return typeof t==`object`&&!!t&&t.type===`MemberExpression`&&t.computed!==!0&&(n(t.property,`then`)||n(t.property,`catch`)||n(t.property,`finally`))}function T(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=T(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),gt(e)||_t(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=T(r,t);if(e)return e}}}function vt(e){let t=f(e,`gen`);if(t)return T(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?T(e):void 0;if(n)return n}}const yt=new Set([`all`,`allSettled`,`any`,`race`]);function bt(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;return typeof t==`object`&&!!t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.object,`Promise`)&&n(t.property)&&yt.has(t.property.name)}function E(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=E(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),bt(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=E(r,t);if(e)return e}}}function xt(e){let t=f(e,`gen`);if(t)return E(t.body);if(o(e,`sync`)){let t=R(a(e));return t?E(t):void 0}if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?E(e):void 0;if(n)return n}}function St(e){if(typeof e!=`object`||!e)return!1;let t=e;return(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)&&Array.isArray(t.params)&&t.params.length>0}function Ct(e){if(!o(e,`tryPromise`))return!1;let t=a(e);return St(t)?!0:St(B(t,`try`))}function wt(e){return o(e,`promise`)?!0:o(e,`tryPromise`)&&!Ct(e)}function Tt(e){if(!o(e,`timeout`))return;let t=a(e);return wt(t)?t:void 0}const Et=new Set([`crypto`,`fs`,`zlib`]);function Dt(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(n(t))return t.name.endsWith(`Sync`);if(typeof t!=`object`||!t||t.type!==`MemberExpression`||t.computed===!0||!n(t.object)||!n(t.property))return!1;let r=t.object.name,i=t.property.name;return Et.has(r)&&i.endsWith(`Sync`)}function Ot(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=Ot(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),Dt(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Ot(r,t);if(e)return e}}}function kt(e){let t=f(e,`gen`);if(t)return Ot(t.body);if(o(e,`sync`)){let t=R(a(e));return t?Ot(t):void 0}}const At=new Set([`runCallback`,`runFork`,`runPromise`,`runPromiseExit`,`runSync`,`runSyncExit`]);function jt(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&At.has(t.name)}function Mt(e){return r(e,`Effect`,`orDie`)||r(e,`Effect`,`orDieWith`)||o(e,`orDie`)||o(e,`orDieWith`)}function Nt(e){if(Mt(e))return e;if(l(e))return F(e).find(e=>Mt(e))}function Pt(e){return o(e,`succeed`)||o(e,`asVoid`)||o(e,`ignore`)||Kr(e)}function Ft(e){if(!o(e,`catchAll`))return;let t=R(a(e));return Pt(t)?t:void 0}function It(e){return r(e,`Effect`,`ignore`)||o(e,`ignore`)}function Lt(e){if(It(e))return e;if(l(e))return F(e).find(e=>It(e))}function D(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`console`)&&n(t.callee.property)}function Rt(e){if(pe(e))return x(e.arguments,D);let t=y(e);return t?x(B(t,`effect`)??B(t,`scoped`),D):[]}const zt=new Set([`catchAll`,`catchTag`,`catchTags`,`tapError`]);function Bt(e){return z(e)||typeof e==`object`&&!!e&&e.type===`TemplateLiteral`}function Vt(e){return o(e,`logError`)||o(e,`logWarning`)}function Ht(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`}function Ut(e,t){return b(e,e=>o(e,`annotateLogs`))?!0:t.arguments.slice(1).some(e=>Ht(e)||!Bt(e))}function Wt(e){return x(e,t=>Vt(t)&&Bt(a(t))&&!Ut(e,t))}function Gt(e){if(!i(e))return[];let t=e.callee.property;return!n(t)||!zt.has(t.name)?[]:e.arguments.map(R).filter(e=>e!==void 0)}function O(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&n(r.callee,t)}function k(e,t,r){if(typeof e!=`object`||!e)return!1;let i=e;return i.type===`CallExpression`&&typeof i.callee==`object`&&i.callee!==null&&i.callee.type===`MemberExpression`&&i.callee.computed!==!0&&n(i.callee.object,t)&&n(i.callee.property)&&(r===void 0||n(i.callee.property,r))}function Kt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`CallExpression`||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0||!n(t.callee.object,`Effect`)||!n(t.callee.property)?!1:t.callee.property.name.startsWith(`log`)}function A(e,t=new WeakSet){return D(e)?!0:Array.isArray(e)?e.some(e=>A(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&A(n,t)))}function qt(e,t=new WeakSet){return O(e,`setState`)||k(e,`Atom`,`set`)||O(e,`invalidate`)||Kt(e)||D(e)?!0:Array.isArray(e)?e.some(e=>qt(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&qt(n,t)))}function Jt(e,t=new WeakSet){return k(e,`Ref`,`set`)||k(e,`Atom`,`set`)||k(e,`SubscriptionRef`,`set`)||k(e,`Reactivity`,`invalidate`)||k(e,`Fiber`,`interrupt`)||Kt(e)?!0:Array.isArray(e)?e.some(e=>Jt(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Jt(n,t)))}function Yt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?!1:t.properties.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e,r=t.key,i=t.value;return(n(r,`concurrency`)||typeof r==`object`&&!!r&&r.value===`concurrency`)&&typeof i==`object`&&!!i&&(i.type===`Literal`||i.type===`NumericLiteral`)&&i.value===1})}function Xt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?!1:t.properties.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e.key;return n(t,`concurrency`)||typeof t==`object`&&!!t&&t.value===`concurrency`})}function Zt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.property,`map`)}function Qt(e){return o(e,`all`)&&Zt(a(e))&&!Xt(e.arguments[1])}function $t(e,t=new WeakSet){if(o(e,`fork`))return e;if(Array.isArray(e)){for(let n of e){let e=$t(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=$t(r,t);if(e)return e}}}function j(e,t,r=new WeakSet){if(i(e)){let r=e.callee.property;if(n(r)&&t.has(r.name))return!0}return Array.isArray(e)?e.some(e=>j(e,t,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&j(n,t,r)))}const en=new Set([`sleep`,`await`,`promise`,`tryPromise`,`fork`,`forkDaemon`,`forkScoped`,`all`,`forEach`,`race`,`raceAll`]),tn=new Set([`modifyEffect`,`modifySomeEffect`,`updateEffect`,`updateAndGetEffect`]);function M(e,t=new WeakSet){if(i(e)){let t=e.callee.property;if(n(t)&&en.has(t.name))return!0}return k(e,`Queue`,`take`)||k(e,`Deferred`,`await`)?!0:Array.isArray(e)?e.some(e=>M(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&M(n,t)))}function N(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&Array.isArray(r.arguments)&&typeof r.callee==`object`&&r.callee!==null&&r.callee.type===`MemberExpression`&&r.callee.computed!==!0&&n(r.callee.property,t)}function nn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Array.isArray(t.arguments)){if(typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`CallExpression`){let e=t.callee;if((N(e,`withPermit`)||N(e,`withPermits`))&&t.arguments.length>0)return t.arguments[0]}if(k(t,`TSemaphore`,`withPermit`)||k(t,`TSemaphore`,`withPermits`))return t.arguments[0];if(N(t,`withPermit`)||N(t,`withPermits`))return t.arguments.at(-1)}}function rn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Array.isArray(t.arguments)){if(typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`CallExpression`){let e=t.callee;if(an(e,`SynchronizedRef`)&&t.arguments.length>0)return e.arguments.at(-1)}if(an(t,`SynchronizedRef`)&&t.arguments.length>1||on(t)&&!sn(t))return t.arguments.at(-1)}}function an(e,t){return[...tn].some(n=>k(e,t,n))}function on(e){return[...tn].some(t=>N(e,t))}function sn(e){return[...tn].some(t=>k(e,`SynchronizedRef`,t))}const cn=new Set([`make`,`unsafeMake`,`makeUnsafe`]),ln=new Set([`timeout`,`timeoutOption`,`timeoutFail`,`timeoutFailCause`,`timeoutTo`]),un=new Set([`race`,`raceFirst`,`raceAll`,`interruptible`,`scoped`]);function dn(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`MemberExpression`&&r.computed!==!0&&n(r.object,`Effect`)&&n(r.property,t)}function fn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(typeof t!=`object`||!t||t.type!==`MemberExpression`)return!1;let r=t;return r.computed!==!0&&n(r.object,`Deferred`)&&n(r.property)&&cn.has(r.property.name)}function pn(e){return k(e,`Deferred`,`await`)&&Array.isArray(e.arguments)}function mn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;if(!(!n(t.id)||!b(t.init,fn)))return t.id.name}function hn(e,t){return!!b(e,e=>{if(!k(e,`Effect`,`addFinalizer`)&&!k(e,`Scope`,`addFinalizer`))return!1;let n=e.arguments;return Array.isArray(n)&&n.some(e=>{let n=R(e);return n!==void 0&&m(n,t)})})}function gn(e){if(!l(e))return!1;let t=e.arguments;return Array.isArray(t)&&t.some(e=>dn(e,`scoped`))}function _n(e,t){let r=typeof e==`object`&&e?e.parent:void 0,a=new WeakSet;for(;typeof r==`object`&&r;){if(a.has(r))return!1;if(a.add(r),i(r)&&(()=>{let e=r.callee.property;return n(e)&&(ln.has(e.name)||un.has(e.name))})()||gn(r)||v(r)&&hn(r,t))return!0;r=r.parent}return!1}const vn=new Set([`acquireRelease`,`acquireUseRelease`,`ensuring`,`forkIn`,`forkScoped`,`scoped`]);function yn(e){return!o(e,`race`)&&!o(e,`raceAll`)?!1:!j(e.arguments,vn)}function bn(e){return o(e,`forEach`)&&!Xt(e.arguments[2])}const xn=new Set([`retry`]);function Sn(e){return(Qt(e)||bn(e))&&j(e.arguments,xn)}function Cn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return[];let t=e.declarations;return Array.isArray(t)?t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)?[t.name]:[]}):[]}function wn(e,t=new Set,n=new WeakSet){if(Array.isArray(e)){for(let r of e)wn(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;if(n.add(e),e.type===`VariableDeclaration`)for(let n of Cn(e))t.add(n);for(let[r,i]of Object.entries(e))r!==`parent`&&wn(i,t,n);return t}const Tn=new Set([`add`,`clear`,`delete`,`pop`,`push`,`reverse`,`set`,`shift`,`sort`,`splice`,`unshift`]);function En(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type===`AssignmentExpression`&&n(t.left))return t.left.name;if(t.type===`UpdateExpression`&&n(t.argument))return t.argument.name;if(t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object)&&n(t.callee.property)&&Tn.has(t.callee.property.name))return t.callee.object.name}function P(e,t,n=wn(e),r=new WeakSet){if(Array.isArray(e)){for(let i of e){let e=P(i,t,n,r);if(e)return e}return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let i=En(e);if(i&&t.has(i)&&!n.has(i))return e;for(let[i,a]of Object.entries(e)){if(i===`parent`)continue;let e=P(a,t,n,r);if(e)return e}}function Dn(e){if(o(e,`fork`)||o(e,`all`)||o(e,`forEach`))return e.arguments}const On=new Set([`fork`,`forkScoped`,`forkDaemon`,`all`,`forEach`,`race`,`raceFirst`,`raceAll`]),kn=new Set([`open`,`connect`,`create`,`start`,`listen`,`subscribe`,`acquire`]),An=new Set([`client`,`connection`,`conn`,`pool`,`db`,`database`,`file`,`socket`,`stream`,`server`,`subscription`,`handle`]),jn=new Set([`close`,`destroy`,`dispose`,`cleanup`]);function Mn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function Nn(e){return Mn(e).some(e=>An.has(e))}function Pn(e){if(n(e))return Nn(e.name);if(!X(e))return!1;let t=e;return t.computed===!0?!1:n(t.property)&&Nn(t.property.name)||Pn(t.object)}function Fn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(typeof t!=`object`||!t||t.type!==`MemberExpression`||t.computed===!0||!n(t.property))return!1;let r=t;return jn.has(r.property.name)&&Pn(r.object)}function In(e){if(!i(e))return;let t=e.callee.property;return n(t)&&On.has(t.name)?e.arguments:void 0}function Ln(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee,r;if(n(t))r=t.name;else if(typeof t==`object`&&t&&t.type===`MemberExpression`){let e=t;e.computed!==!0&&n(e.property)&&(r=e.property.name)}return!r||r===`acquireRelease`||r===`acquireUseRelease`?!1:Mn(r).some(e=>kn.has(e))&&Nn(r)}function Rn(e,t){return o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`scoped`)||gn(e)?!0:t!==void 0&&hn(e,t)}function zn(e){let t=new Set;for(let r of x(e,e=>typeof e==`object`&&!!e&&e.type===`VariableDeclarator`)){let i=r;n(i.id)&&b(i.init,Ln)&&hn(e,i.id.name)&&t.add(i.id.name)}return t}function Bn(e,t,r=new WeakSet,i=new Set,a=!1){if(Array.isArray(e)){for(let n of e)Bn(n,t,r,i,a);return}if(typeof e!=`object`||!e||r.has(e)||(r.add(e),Rn(e)))return;let o=new Set(i);if(v(e))for(let t of zn(e))o.add(t);let s=e.type===`VariableDeclarator`?e:void 0,ee=s&&n(s.id)?s.id.name:void 0,c=ee!==void 0&&o.has(ee);if(Ln(e)&&!a){t.push(e);return}for(let[n,i]of Object.entries(e))n!==`parent`&&Bn(i,t,r,o,a||c)}function Vn(e){let t=[];return Bn(e,t),t}const Hn=new Set([`all`,`forEach`,`fork`,`race`,`raceAll`]);function Un(e,t=new WeakSet){return j(e,Hn)||k(e,`Queue`,`take`)?!0:Array.isArray(e)?e.some(e=>Un(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Un(n,t)))}function Wn(e){return o(e,`uninterruptible`)&&Un(e.arguments[0])}function Gn(e){return k(e,`Queue`,`unbounded`)||k(e,`PubSub`,`unbounded`)}function Kn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`ObjectExpression`||t.type===`ArrayExpression`||t.type===`NewExpression`&&(n(t.callee,`Map`)||n(t.callee,`Set`))||t.type===`CallExpression`&&(n(t.callee,`Map`)||n(t.callee,`Set`))}function qn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return[];let t=e,r=Array.isArray(t.declarations)?t.declarations:[];return t.kind===`let`||t.kind===`var`?Cn(e):r.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)&&Kn(e.init)?[t.name]:[]})}function Jn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;return n(t.id)&&o(t.init,`fork`)?t.id.name:void 0}const Yn=new Set([`await`,`interrupt`,`join`]);function Xn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e,r=t.callee;if(typeof r!=`object`||!r||r.type!==`MemberExpression`||r.computed===!0||!n(r.object,`Fiber`)||!n(r.property)||!Yn.has(r.property.name)||!Array.isArray(t.arguments))return;let[i]=t.arguments;return n(i)?i.name:void 0}function Zn(e){return r(e,`Effect`,`asVoid`)||k(e,`Effect`,`asVoid`)}function Qn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0||!n(t.callee.property,`pipe`)?!1:o(t.callee.object,`all`)&&t.arguments.some(e=>Zn(e))}function F(e){if(typeof e!=`object`||!e||!l(e))return[];let t=e;return n(t.callee,`pipe`)?t.arguments:[t.callee.object,...t.arguments]}function $n(e){let[t]=F(e);return t!==void 0&&h(t)}function er(e){if($n(e))return!0;if(typeof e==`object`&&e&&e.type===`ArrowFunctionExpression`){let t=e.body;return i(t)||$n(t)}return!1}function tr(e){return d(e).some(e=>typeof e==`object`&&!!e&&(er(e.argument)||i(e.argument)))}function I(e,t,r){if(typeof e!=`object`||!e||e.type!==`TSTypeReference`)return!1;let i=e.typeName;return typeof i==`object`&&!!i&&i.type===`TSQualifiedName`&&n(i.left,t)&&n(i.right,r)}function nr(e,t){return typeof e==`object`&&!!e&&e.type===`TSTypeReference`&&n(e.typeName,t)}function rr(e){if(typeof e!=`object`||!e)return[];let t=e.typeParameters??e.typeArguments;if(typeof t!=`object`||!t)return[];let n=t.params??t.arguments;return Array.isArray(n)?n:[]}function ir(e){return n(e,`Error`)||nr(e,`Error`)}function L(e){if(typeof e!=`object`||!e)return;let t=e.returnType;if(!(typeof t!=`object`||!t))return t.typeAnnotation??t}function ar(e,t){return I(L(e),`Effect`,`Effect`)||I(t,`Effect`,`Effect`)}function or(e){if(typeof e!=`object`||!e)return[];let t=e.body;if(typeof t!=`object`||!t)return[];if(t.type!==`BlockStatement`)return[t];let n=(e,t=new WeakSet)=>{if(Array.isArray(e))return e.flatMap(e=>n(e,t));if(typeof e!=`object`||!e||t.has(e))return[];t.add(e);let r=e;return r.type===`ReturnStatement`?[r.argument]:r.type===`ArrowFunctionExpression`||r.type===`FunctionExpression`||r.type===`FunctionDeclaration`?[]:Object.entries(r).flatMap(([e,r])=>e===`parent`?[]:n(r,t))};return n(t)}function sr(e){return or(e).filter(e=>i(e)||$n(e))}function cr(e){return o(e,`withSpan`)||l(e)&&F(e).some(e=>o(e,`withSpan`))}function lr(e,t){if(!ar(e,t))return;let n=sr(e);return n.length===0||n.some(e=>!cr(e))?e:void 0}function ur(e){if(typeof e!=`object`||!e)return;let t=e.typeAnnotation;if(!(typeof t!=`object`||!t))return L(t.typeAnnotation??t)}function dr(e){if(typeof e!=`object`||!e)return[];let t=e;if(t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`)return[];let n=t.declaration;return typeof n!=`object`||!n?[]:n.type===`FunctionDeclaration`?[{functionNode:n}]:n.type===`VariableDeclaration`?(n.declarations??[]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.init;return typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)?[{functionNode:t,declaredReturnType:ur(e.id)}]:[]}):[]}function fr(e){let t=B(e,`effect`)??B(e,`scoped`),n=f(t,`gen`),r=n?or(n).find(Ht):o(t,`succeed`)&&Ht(a(t))?a(t):void 0;if(!r)return[];let i=r.properties;return Array.isArray(i)?i.flatMap(e=>{if(typeof e!=`object`||!e||e.type!==`Property`)return[];let t=e.value;return typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)?[t]:[]}):[]}function pr(e){return sr(e).some(e=>!cr(e))?e:void 0}function mr(e){let t=L(e);if(!I(t,`Effect`,`Effect`))return;let[,n]=rr(t);return ir(n)?t:void 0}function hr(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`)return;let n=t.declaration;if(!(typeof n!=`object`||!n)){if(n.type===`FunctionDeclaration`)return mr(n);if(n.type===`VariableDeclaration`)for(let e of n.declarations??[]){if(typeof e!=`object`||!e)continue;let t=e.init;if(typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)){let e=mr(t);if(e)return e}}}}function gr(e,t,n,r=new WeakSet){return I(e,t,n)?!0:Array.isArray(e)?e.some(e=>gr(e,t,n,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,i])=>e!==`parent`&&gr(i,t,n,r)))}function _r(e,t=new WeakSet){return O(e,`wrapGraphqlCall`)?!0:Array.isArray(e)?e.some(e=>_r(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&_r(n,t)))}function vr(e){return o(e,`flatMap`)&&n(a(e),`applyResponse`)}function yr(e,t=new WeakSet){return vr(e)?!0:Array.isArray(e)?e.some(e=>yr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&yr(n,t)))}function br(e,t=new WeakSet){if(o(e,`catchAll`))return e;if(Array.isArray(e)){for(let n of e){let e=br(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=br(r,t);if(e)return e}}}function xr(e){let t=F(e);if(t.length===0)return;let n=br(t);if(n)return _r(t)||yr(t)?n:void 0}const Sr=new Set([`get`,`set`,`update`,`modify`,`refresh`]);function R(e){if(typeof e!=`object`||!e)return;let t=e;if(!(t.type!==`ArrowFunctionExpression`&&t.type!==`FunctionExpression`))return t.body}function Cr(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`CallExpression`||!Array.isArray(t.arguments)||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0)return!1;let r=t.callee;return(n(r.object,`Atom`)||n(r.object,`atomRegistry`))&&n(r.property)&&Sr.has(r.property.name)}function wr(e,t=new WeakSet){if(Cr(e))return e;if(Array.isArray(e)){for(let n of e){let e=wr(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=wr(r,t);if(e)return e}}}function Tr(e){if(!o(e,`sync`))return;let t=R(a(e));return t?wr(t):void 0}function Er(e){return n(e)?/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name):!1}function Dr(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CallExpression`||!Array.isArray(t.arguments)||!(n(t.callee,`get`)||r(t.callee,`Atom`,`get`)||r(t.callee,`get`,`get`)))return;let[i]=t.arguments;return Er(i)?i:void 0}function Or(e,t=new WeakSet){let n=Dr(e);if(n)return n;if(Array.isArray(e)){for(let n of e){let e=Or(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Or(r,t);if(e)return e}}}function kr(e){return o(e,`provide`)&&e.arguments.length===1}function Ar(e){if(l(e))return F(e).find(e=>kr(e))}function jr(e,t=new WeakSet){return typeof e==`object`&&e&&e.type===`SpreadElement`?!0:Array.isArray(e)?e.some(e=>jr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&jr(n,t)))}function Mr(e){if(!k(e,`Ref`,`update`)&&!k(e,`Ref`,`modify`))return!1;let t=e.arguments[1];return jr(R(t))}function Nr(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`&&Array.isArray(e.properties)&&e.properties.length===0}function Pr(e,t=new WeakSet){return k(e,`Object`,`entries`)?!0:Array.isArray(e)?e.some(e=>Pr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Pr(n,t)))}function Fr(e){if(Mr(e))return!0;if(k(e,`Object`,`assign`)){let t=e.arguments;return t.length>=3&&Nr(t[0])}return k(e,`Object`,`fromEntries`)?Pr(e.arguments[0]):k(e,`JSON`,`stringify`)||k(e,`JSON`,`parse`)}function Ir(e){return n(e)?!0:typeof e==`object`&&!!e&&e.type===`MemberExpression`}function Lr(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e.init;return typeof t==`object`&&!!t&&t.type===`TSAsExpression`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null&&t.typeAnnotation.type!==`TSConstKeyword`})??!1}function Rr(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;if(t.operator!==`===`)return!1;let n=t.left,r=t.right;return typeof n==`object`&&!!n&&n.type===`UnaryExpression`&&n.operator===`typeof`&&typeof r==`object`&&!!r&&(r.type===`Literal`||r.type===`StringLiteral`)&&r.value===`boolean`}function zr(e){return qr(e,`orElse`)&&Pi(H(e.arguments[0]))}function z(e){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`StringLiteral`)&&typeof e.value==`string`}function Br(e){return n(e,`undefined`)}function Vr(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&e.operator===`??`&&(Pi(e.right)||Br(e.right))}function Hr(e){return k(e,`Option`,`fromNullable`)&&Vr(e.arguments[0])}function B(e,t){if(!(typeof e!=`object`||!e||e.type!==`ObjectExpression`))for(let r of e.properties??[]){if(typeof r!=`object`||!r)continue;let e=r.key;if(n(e,t))return r.value}}function Ur(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return t.operator===`===`&&(V(t.left,!0)||V(t.right,!0))}function Wr(e){if(!k(e,`Option`,`match`))return!1;let t=e.arguments[1],n=B(t,`onSome`),r=B(t,`onNone`);return Ur(H(n))&&V(H(r),!1)}function Gr(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>typeof e==`object`&&!!e&&z(e.init))??!1}function V(e,t){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`BooleanLiteral`)&&e.value===t}function Kr(e){return r(e,`Effect`,`void`)}function qr(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&Array.isArray(r.arguments)&&typeof r.callee==`object`&&r.callee!==null&&r.callee.type===`MemberExpression`&&r.callee.computed!==!0&&n(r.callee.object,`Match`)&&n(r.callee.property)&&(t===void 0||n(r.callee.property,t))}function H(e){if(!(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`))return e.body}function Jr(e){if(!qr(e))return!1;let[t,r]=e.arguments;return n(e.callee.property,`when`)?(V(t,!0)||V(t,!1))&&Kr(H(r)):n(e.callee.property,`orElse`)&&Kr(H(t))}const Yr=[`flatMap`,`map`,`andThen`,`tap`,`zipRight`];function Xr(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`Stream`)&&n(t.callee.property)}function Zr(e,t=new WeakSet){return Yr.some(t=>o(e,t))||l(e)||Xr(e)?!0:Array.isArray(e)?e.some(e=>Zr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Zr(n,t)))}function Qr(e){return h(e)&&Zr(e)}function $r(e,t=new WeakSet){return qr(e)&&Qr(n(e.callee.property,`when`)?H(e.arguments[1]):H(e.arguments[0]))?!0:Array.isArray(e)?e.some(e=>$r(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&$r(n,t)))}function ei(e,t=new WeakSet){return qr(e)?!0:Array.isArray(e)?e.some(e=>ei(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ei(n,t)))}function ti(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&r(e.callee,`Option`,`match`)}function ni(e){let t=H(e);return typeof t==`object`&&!!t&&t.type===`CallExpression`}function ri(e,t=new WeakSet){if(o(e,`gen`))return e;if(Array.isArray(e)){for(let n of e){let e=ri(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=ri(r,t);if(e)return e}}}function ii(e){if(!l(e)||typeof e!=`object`||!e)return!1;let t=e.callee.object;return typeof t==`object`&&!!t&&t.type===`CallExpression`&&r(t.callee,`Match`,`value`)}function ai(e){return ii(e)||typeof e==`object`&&!!e&&e.type===`CallExpression`&&(r(e.callee,`Option`,`match`)||r(e.callee,`Either`,`match`))}function oi(e,t=new WeakSet){return ai(e)?!0:Array.isArray(e)?e.some(e=>oi(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&oi(n,t)))}function si(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?[]:t.properties.map(e=>typeof e==`object`&&e?e.value:void 0).filter(e=>e!==void 0)}function ci(e){if(typeof e!=`object`||!e||e.type!==`TSTypeAliasDeclaration`)return!1;let t=e.id,r=e.typeAnnotation;return n(t)&&/(?:Id|ID)$/.test(t.name)&&(r?.type===`TSStringKeyword`||r?.type===`TSNumberKeyword`)}function li(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`TSBooleanKeyword`?!0:t.type===`TSTypeAnnotation`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null&&t.typeAnnotation.type===`TSBooleanKeyword`}function ui(e){if(typeof e!=`object`||!e)return;let t=e;return t.type===`TSTypeAnnotation`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null?t.typeAnnotation:t}function di(e){let t=ui(e);return t?.type===`TSStringKeyword`||t?.type===`TSNumberKeyword`}function fi(e){let t=ui(e);return t?.type===`TSAnyKeyword`||t?.type===`TSObjectKeyword`}function pi(e){let t=ui(e);return t?.type===`TSTypeReference`&&n(t.typeName,`Date`)}function mi(e){if(typeof e!=`object`||!e||!Array.isArray(e.params))return[];let t=/(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;return e.params.filter(e=>n(e)&&di(e.typeAnnotation)&&t.test(e.name))}function hi(e){return mi(e).length>=3}function gi(e){return n(e)?/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&li(e.typeAnnotation):!1}function _i(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(gi)}function vi(e){if(n(e))return e.name;if(typeof e==`object`&&e&&typeof e.value==`string`)return e.value}function yi(e){return/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(e)}function bi(e){if(typeof e!=`object`||!e||e.type!==`TSPropertySignature`)return!1;let t=e,n=vi(t.key),r=t.typeAnnotation;return n!==void 0&&yi(n)&&(di(r)||pi(r))}function xi(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type===`TSInterfaceDeclaration`&&typeof t.body==`object`&&t.body!==null&&Array.isArray(t.body.body)?t.body.body:t.type===`TSTypeLiteral`&&Array.isArray(t.members)?t.members:[]}function Si(e){return xi(e).filter(bi)}function Ci(e){return n(e)?/^(?:opts|options|config)$/i.test(e.name)&&fi(e.typeAnnotation):!1}function wi(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(Ci)}const Ti=new Set([`==`,`===`,`!=`,`!==`,`>`,`>=`,`<`,`<=`]);function U(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+U(n,t),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=e;return n.type===`BinaryExpression`&&Ti.has(String(n.operator))?1:n.type===`LogicalExpression`?U(n.left,t)+U(n.right,t):0}function Ei(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&U(e)>=3}function Di(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return;let t=e;if(t.computed===!0||!n(t.object)||!n(t.property))return;let r=t.property.name;if(/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(r))return{objectName:t.object.name,propertyName:r}}function W(e,t=new Map,n=new WeakSet){let r=Di(e);if(r){let e=t.get(r.objectName)??new Set;return e.add(r.propertyName),t.set(r.objectName,e),t}if(Array.isArray(e)){for(let r of e)W(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;n.add(e);let i=e;return i.type===`LogicalExpression`?(W(i.left,t,n),W(i.right,t,n),t):t}function Oi(e){return typeof e!=`object`||!e||e.type!==`LogicalExpression`?!1:Array.from(W(e).values()).some(e=>e.size>=2)}function ki(e){return o(e,`fail`)&&z(a(e))}function Ai(e){if(typeof e!=`object`||!e||e.type!==`ThrowStatement`)return!1;let t=e.argument;return typeof t==`object`&&!!t&&t.type===`NewExpression`&&n(t.callee,`Error`)&&Array.isArray(t.arguments)&&z(t.arguments[0])}function ji(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?!1:e.params.some(e=>n(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&di(e.typeAnnotation))}function Mi(e){if(typeof e!=`object`||!e||e.type!==`FunctionDeclaration`)return!1;let t=e.id;return n(t)&&/(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(t.name)&&ji(e)}function Ni(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return[`==`,`===`,`!=`,`!==`].includes(String(t.operator))&&(z(t.left)||z(t.right))&&!Rr(t)}function G(e,t,n){e.report({message:n,node:t})}function Pi(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`NullLiteral`||t.type===`Literal`&&t.value===null}function K(e){if(typeof e!=`object`||!e)return;let t=e.source;if(typeof t==`string`)return t;if(typeof t==`object`&&t){let e=t.value;if(typeof e==`string`)return e}}const Fi=[`bin/**`,`scripts/**`,`cli/**`,`**/main.ts`,`app/api/**/route.ts`,`server/**`,`*.test.ts`,`*.spec.ts`],Ii=[`**/*.test.*`,`**/*.spec.*`,`**/__tests__/**`],Li=[`**/config/**`,`**/*Config.ts`,`**/*ConfigLayer.ts`],q=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}],Ri=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}},configPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}];function zi(e){let t=e.options[0];return typeof t==`object`&&t?t:{}}function Bi(e,t){let n=e[t];return Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:void 0}function Vi(e){return e.replace(/\\/g,`/`).replace(/^\.\/+/,``).replace(/\/{2,}/g,`/`).replace(/\/$/,``)}function Hi(e){return e.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`[^/]*`)}function Ui(e){let t=Vi(e);if(t===`**`)return/^.*$/;let n=t.split(`/`),r=n[0]===`**`,i=+!!r,a=r?`(?:.*/)?`:`(?:^|.*/)`;for(let e=i;e<n.length;e+=1){let t=n[e],r=e===n.length-1;if(t===`**`){a+=r?`(?:/.*)?`:`(?:/[^/]+)*`;continue}e>i&&(a+=`/`),a+=Hi(t)}return RegExp(`${a}$`)}function Wi(e,t){return Ui(t).test(Vi(e))}function Gi(e){return Bi(zi(e),`boundaryPaths`)??Fi}function J(e){return Gi(e).some(t=>Wi(e.filename,t))}function Ki(e){return Ii.some(t=>Wi(e.filename,t))}function qi(e){return Bi(zi(e),`configPaths`)??Li}function Ji(e){return qi(e).some(t=>Wi(e.filename,t))}function Y(e){return e===`effect`||e.startsWith(`effect/`)||e===`@effect-atom/atom-react`}function Yi(e){if(!O(e,`it`)&&!O(e,`test`)&&!O(e,`specify`)&&!O(e,`bench`))return;let t=e.arguments?.at(-1);return v(t)?t:void 0}function Xi(e){let t=e.body;if(!o(t,`runPromise`)&&!(typeof t!=`object`||!t||t.type!==`BlockStatement`||!Array.isArray(t.body))){for(let e of t.body)if(typeof e==`object`&&e&&e.type===`ExpressionStatement`&&o(e.expression,`runPromise`))return e.expression}}function Zi(e,t){let n=[],r=new WeakSet;function i(e,a=!1){if(Array.isArray(e)){for(let t of e)i(t);return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let o=e;if(!(!a&&v(o))){t(o)&&n.push(o);for(let[e,t]of Object.entries(o))e!==`parent`&&i(t)}}return i(e,!0),n}function Qi(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`||e.computed===!0||!n(e.property,`rejects`))return!1;let t=e.object;if(!O(t,`expect`))return!1;let r=t.arguments;if(!Array.isArray(r))return!1;let i=r[0];return o(i,`runPromise`)}function $i(e){return typeof e==`object`&&!!e&&e.type===`MemberExpression`&&e.computed!==!0&&n(e.property,`Default`)}function ea(e){return k(e,`Layer`,`succeed`)||k(e,`Layer`,`effect`)}function ta(e){if(!k(e,`Layer`,`provide`))return[];let t=e.arguments;return!Array.isArray(t)||!t.some($i)?[]:t.filter(ea)}function na(e){let t=K(e);if(t===`effect/Schema`)return!0;if(t!==`effect`||typeof e!=`object`||!e)return!1;let r=e.specifiers;return Array.isArray(r)&&r.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`ImportSpecifier`&&n(t.imported,`Schema`)})}function ra(e,n){return t({create(t){let r=!1;return{ImportDeclaration(e){let t=K(e);t&&Y(t)&&(r=!0)},[e](e){r&&G(t,e,n)}}}})}const ia=new Set([`useState`,`useReducer`,`useContext`,`useCallback`,`useEffect`,`useSyncExternalStore`]),aa=t({create(e){return{CallExpression(t){let r=t.callee,i=n(r)?r.name:typeof r==`object`&&r&&r.type===`MemberExpression`&&n(r.property)?r.property.name:void 0;i&&ia.has(i)&&G(e,r,`Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.`)}}}}),oa=ra(`IfStatement`,`Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead.`),sa=ra(`SwitchStatement`,`Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.`),ca=ra(`ConditionalExpression`,`Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/Either.match/Match.value or data combinators, then run one Effect pipeline.`),la=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ReturnStatement(n){t&&Pi(n.argument)&&G(e,n,`Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.`)}}}}),ua=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&r(n.callee,`Option`,`as`)&&G(e,n,`Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly.`)}}}}),da=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},MemberExpression(n){t&&r(n,`Effect`,`never`)&&G(e,n,`Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.`)}}}}),fa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t||!ae(n))return;let r=u(n.callee.body);r&&G(e,r,`Rule: avoid nested IIFEs. Why: they hide sequencing and push wrapper hacks. Fix: bind a named context with const and keep one flat pipeline with a single Match/Option decision.`)}}}}),pa=t({create(e){return{ObjectExpression(t){si(t).some(e=>oi(e))&&G(e,t,`Rule: avoid Match/Option/Either inside object literals. Why: it hides the decision and invites workaround scaffolding. Fix: compute the value first (context), then build the object from named values with one flat decision.`)}}}}),ma=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&oe(n)&&G(e,n,`Rule: avoid immediate invocation of inline functions. Why: it hides decisions and sequencing. Fix: bind a named context with const and keep one Match/Option decision in a flat pipeline.`)}}}}),ha=t({create(e){return{CallExpression(t){for(let n of ce(t))G(e,n,`Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).`)}}}}),ga=t({create(e){return{CallExpression(t){for(let n of le(t))G(e,n,`Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.`)}}}}),_a=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&de(n,`fn`)&&G(e,n,`Rule: avoid Effect.fn generator wrappers. Why: they hide sequencing and dodge ladder rules. Fix: keep a single flat pipeline or use one Effect.gen.`)}}}}),va=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&o(n,`sync`)&&A(a(n))&&G(e,n,`Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.`)}}}}),ya=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Rt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){i(e)},ClassDeclaration(e){i(e)},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.`)}}}}),ba=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Wt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){for(let t of Gt(e))i(t)},ClassDeclaration(e){let t=y(e);t&&i(B(t,`effect`)??B(t,`scoped`))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: add structured context to Effect.logError or Effect.logWarning. Why: static failure messages cannot be correlated. Fix: include an error or context object, or use Effect.annotateLogs(...).`)}}}}),xa=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{typeof e==`object`&&e&&!r.has(e)&&(r.add(e),n.push(e))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExportNamedDeclaration(e){for(let t of dr(e))i(lr(t.functionNode,t.declaredReturnType))},ExportDefaultDeclaration(e){for(let t of dr(e))i(lr(t.functionNode,t.declaredReturnType))},ClassDeclaration(e){let t=y(e);if(t)for(let e of fr(t))i(pr(e))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).`)}}}}),Sa=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(t){if(!Ki(e))return;let r=Yi(t),i=r&&Xi(r);i&&n.push(i)},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: do not discard Effect.runPromise in a test body. Why: the test can finish before the Effect result is observed. Fix: await or return Effect.runPromise so the test framework observes completion.`)}}}}),Ca=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(t){if(!Ki(e))return;let r=Yi(t);r&&n.push(...Zi(r,Qi))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.`)}}}}),wa=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(t){Ki(e)&&n.push(...ta(t))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: avoid a manual test layer beside an explicit service Default layer. Why: the test is already opting into the service's real default composition and the sibling mock can hide that contract. Fix: use the Default layer with its required infrastructure, or remove Default when a replacement is intentional.`)}}}}),Ta=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=f(n,`gen`);if(!t||!r)return;let i=ri(r.body);i&&G(e,i,`Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline.`)}}}}),Ea=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=_e(n);r&&G(e,r,"Rule: use yield* inside Effect.gen. Why: plain yield returns an Effect value without delegating to the Effect interpreter. Fix: replace `yield Effect.x` with `yield* Effect.x`.")}}}}),Da=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ye(n);r&&G(e,r,`Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps.`)}}}}),Oa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Se(n);r&&G(e,r,`Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation.`)}}}}),ka=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ee(n);r&&G(e,r,`Rule: prefer Effect.gen for workflow sequencing. Why: long flatMap/andThen/tap pipelines read like imperative workflow. Fix: move the sequential story into one Effect.gen and keep pipe for behavior decoration.`)}}}}),Aa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Oe(n)&&G(e,n,`Rule: avoid large anonymous flow expressions. Why: long pure transformation chains need a domain name. Fix: extract a named flow or split the transformation into named pure steps.`)}}}}),ja=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=je(n);r&&G(e,r,`Rule: avoid Effect work inside flow. Why: flow should stay a reusable pure transformation boundary. Fix: keep Effect sequencing, logging, retries, and dependency access in Effect pipelines.`)}}}}),Ma=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Me(n);r&&G(e,r,`Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const.`)}}}}),Na=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Fe(n);r&&G(e,r,"Rule: prefer .pipe() for behavior decoration. Why: retry, timeout, spans, logging, recovery, DI, and value transforms decorate an existing effect. Fix: write `program.pipe(Effect.retry(policy))` instead of `Effect.retry(program, policy)`.")}}}}),Pa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Re(n);r&&G(e,r,`Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story.`)}}}}),Fa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ze(n);r&&G(e,r,`Rule: avoid workflow sequencing inside behavior pipes. Why: behavior pipes should answer how an effect behaves, not hide the workflow story. Fix: move multi-step sequencing into Effect.gen and keep retry/timeout/spans/logging as decorators around named effects.`)}}}}),Ia=t({create(e){let t=!1;function n(n){let r=Be(n);t&&r&&G(e,r,`Rule: avoid mixing Effect style pillars in one function. Why: workflow, pure transformation, behavior decoration, and Layer wiring each need a clear boundary. Fix: extract named concepts for each pillar and compose them at the call site.`)}return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),La=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=He(n);t&&r&&G(e,r,`Rule: avoid clever Effect expressions. Why: deeply nested expressions that combine style pillars hide the domain story. Fix: extract named workflow, pure transformation, and behavior steps.`)}}}}),Ra=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=Ue(n);t&&r&&G(e,r,`Rule: prefer extracting named concepts from oversized anonymous callbacks. Why: multi-step inline callbacks hide domain intent. Fix: name the transformation, policy, or workflow step before passing it into Effect.`)}}}}),za=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Ke(n)&&G(e,n,`Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.`)}}}}),Ba=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=y(n);t&&r&&qe(r)&&G(e,r,`Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.`)}}}}),Va=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=y(n);t&&r&&!Je(r)&&G(e,r,`Rule: set accessors: true. Fix: add it to Effect.Service options.`)}}}}),Ha=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=y(n),i=r?Ze(r):void 0;t&&i&&G(e,i,`Rule: declare service dependencies.`)}}}}),Ua=t({create(e){return{ImportDeclaration(t){let n=Ye(t);n&&G(e,n,`Rule: avoid namespace imports from Effect packages.`)}}}}),Wa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?dt(n):void 0;r&&G(e,r,`Rule: avoid exported manual service objects.`)}}}}),Ga=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?tt(n):void 0;r&&G(e,r,`Rule: prefer Layer.pipe for nested layer provisioning.`)}}}}),Ka=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?rt(n):void 0;r&&G(e,r,`Rule: avoid inline layer provisioning inside programs.`)}}}}),qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?it(n):void 0;r&&G(e,r,`Rule: prefer Layer.mergeAll for infrastructure layer groups.`)}}}}),Ja=t({create(e){let t=!1,n=0;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(r){let i=t?ot(r):void 0;i&&(n+=1,n>=3&&G(e,i,`Rule: group service layers by concern.`))}}}}),Ya=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration(n){let r=et(n);t&&r&&G(e,r,`Rule: avoid Layer composition inside request handlers.`)}}}}),Xa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=y(n),i=r?lt(r):void 0;t&&i&&G(e,i,`Rule: return Effect from service methods.`)}}}}),Za=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Jr(n)&&G(e,n,`Rule: avoid void Match branches. Why: they hide guard-style control flow. Fix: remove the no-op branch or select a value and run one Effect pipeline outside the Match.`)}}}}),Qa=t({create(e){return{CallExpression(t){ii(t)&&$r(t.arguments)&&G(e,t,`Rule: avoid multi-step sequencing inside Match branches. Why: it hides control flow. Fix: select a value in Match, then run one Effect pipeline outside. Avoid data-encoded conditionals (Option.toArray/forEach) that only rewrap the branch.`),ti(t)&&Qr(t.arguments)&&G(e,t,`Rule: avoid multi-step sequencing inside Option.match branches. Why: it hides control flow. Prefer selecting a value in Option.match, then run one Effect pipeline outside. Leaf-level flows with local bindings may keep Option.match but should stay linear.`)}}}}),$a=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=a(n),i=H(r);t&&o(n,`sync`)&&ni(r)&&!D(i)&&G(e,n,`Rule: avoid Effect.sync around side effects. Why: it hides intent. Fix: use Effect.log* or an explicit pipeline step for the side effect.`)}}}}),eo=t({create(e){return{CallExpression(t){o(t,`as`)&&qt(a(t))&&G(e,t,`Rule: avoid Effect.as for side effects. Why: it hides side effects and turns them into placeholders. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`),o(t,`zipRight`)&&qt(a(t))&&G(e,t,`Rule: avoid Effect.zipRight for side effects. Why: it hides side effects and discards values. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`)}}}}),to=t({create(e){return{CallExpression(t){o(t,`all`)&&Jt(t.arguments[0])&&Yt(t.arguments[1])&&G(e,t,`Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.`),Qn(t)&&Jt(a(t.callee.object))&&G(e,t,`Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.`)}}}}),no=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=pt(n);r&&G(e,r,`Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: return an Effect and compose with Effect.flatMap/fromPromise at the boundary.`)}}}}),ro=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=mt(n);r&&G(e,r,`Rule: avoid throw inside Effect logic. Why: thrown exceptions bypass typed Effect error channels and interruption semantics. Fix: return Effect.fail with a structured tagged error.`)}}}}),io=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Nt(n);r&&G(e,r,`Rule: avoid Effect.orDie outside runtime boundaries. Why: converting typed failures into defects hides recoverable domain errors. Fix: keep typed errors in domain logic and reserve orDie/orDieWith for explicit application boundaries.`)}}}}),ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ft(n);r&&G(e,r,`Rule: avoid swallowing errors in catchAll. Why: succeed/void recovery can hide failures without telemetry or typed recovery. Fix: log, re-fail with a structured error, or recover through an explicit domain branch.`)}}}}),oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Lt(n);r&&G(e,r,`Rule: avoid Effect.ignore. Why: ignoring failable effects hides failure ownership. Fix: handle the error with typed recovery, log and re-fail, or isolate the ignore at an explicit boundary with a documented reason.`)}}}}),so=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ht(n);r&&G(e,r,`Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.catchAll, Effect.catchTag, or typed error combinators.`)}}}}),co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=vt(n);r&&G(e,r,`Rule: avoid Promise APIs inside Effect logic. Why: Promise APIs bypass Effect scheduling, typed errors, cancellation, and tracing. Fix: use Effect.all, Effect.tryPromise, or move Promise interop to a boundary adapter.`)}}}}),lo=t({create(e){return{TryStatement(t){G(e,t,`Rule: avoid try/catch in Effect files. Why: it bypasses Effect error channels and reintroduces imperative control flow. Fix: model failures in Effect and handle them with typed errors and Effect combinators.`)}}}}),uo=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])er(n.init)&&G(e,t,"Rule: avoid Effect wrapper aliases (`const x = ...Effect...`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")},FunctionDeclaration(t){tr(t.body)&&G(e,t,"Rule: avoid Effect wrapper aliases (`function x(...) { return Effect... }`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")}}}}),fo=t({create(e){return{TSTypeReference(t){(I(t,`Effect`,`Effect`)||I(t,`Layer`,`Layer`))&&G(e,t,"Rule: avoid manual Effect channel tuples (`Effect.Effect<...>` / `Layer.Layer<...>`). Why: channels compose through the Effect pipeline and services; hand-written tuples desync from the real flow. Fix: drop the generic and let the return type infer from the Effect/Layer you return, or expose a service method that returns the effect directly.")}}}}),po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?xr(n):void 0;r&&G(e,r,`Rule: avoid catchAll after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of catchAll.`)}}}}),mo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExpressionStatement(n){t&&ii(n.expression)&&ei(n.expression.arguments)&&G(e,n.expression,`Rule: avoid Match.value(...).pipe(...) as a statement. Why: it runs side effects during render. Fix: move the side effect into an Effect runtime action or event handler, and keep Match as a pure expression.`)}}}}),ho=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?Tr(n):void 0;r&&G(e,r,`Rule: do not wrap Atom/atomRegistry ops in Effect.sync. Why: it hides side effects and breaks atom flow. Fix: call Atom.get/Atom.set/Atom.update/Atom.modify/Atom.refresh directly.`)}}}}),go=t({create(e){return{CallExpression(t){if(!k(t,`Atom`,`family`))return;let n=Or(t.arguments);n&&G(e,n,`Keyed projection atom reads collection atom. Why: Atom.family should project from keyed/source atoms, not broad collection state. Fix: pass the keyed atom into the family or create a keyed source atom before reading.`)}}}}),_o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?Ar(n):void 0;r&&G(e,r,"Rule: do not inline runtime provisioning inside local helper Effect code. Why: `yield* SomeRuntime.pipe(Effect.provide(SomeRuntimeLive))` and equivalent inline provide chains hide dependency assembly instead of owning it at an Effect.Service boundary or one exported Effect boundary. Fix: declare the live dependency on the owning service or provide it once at the exported boundary, then `yield*` the runtime or service directly inside the body.")}}}}),vo=t({create(e){return{CallExpression(t){Fr(t)&&G(e,t,"Rule: avoid naked JS state patching/rebuild and raw JSON shortcuts in Effect transitions. Why: spread/Object.assign/fromEntries and inline JSON parse/stringify hide state intent and bypass explicit model contracts. Fix: use `effect/Record` combinators (`Record.set` / `Record.modify` / `Record.remove`) inside `Struct.evolve`, rebuild with schema constructors (`Schema.make` or field `.make`), and keep serialization at boundaries with schema encode/decode flows. Use `linting.md` guidance when available.")}}}}),yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&o(n,`succeed`)&&Ir(a(n))&&G(e,n,`Rule: avoid Effect.succeed(variable) as a branch placeholder. Why: it hides a decision and turns data into pseudo-control flow. Fix: select a plain value (Option/Match) and then run one Effect pipeline after the decision; if you already read the state, return it as a value. Avoid Option.toArray/forEach hacks that just re-encode the branch.`)}}}}),bo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&gr(n.typeAnnotation,`Effect`,`Effect`)&&G(e,n.typeAnnotation,`Rule: avoid Effect.Effect type aliases. Why: they hide the service surface and make types opaque. Fix: keep Effect types on service methods or inline at the call site.`)}}}}),xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?hr(n):void 0;r&&G(e,r,`Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.`)},ExportDefaultDeclaration(n){let r=t?hr(n):void 0;r&&G(e,r,`Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.`)}}}}),So=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(n){t&&Lr(n)&&G(e,n,"Rule: avoid `as` assertions on decoded model flow. Why: assertions hide schema drift and allow untyped overlays. Fix: decode with the correct schema type and read fields directly.")}}}}),Co=t({create(e){let t=!1,n=!1,r=[],i=new WeakSet,a=t=>{typeof t!=`object`||!t||i.has(t)||(i.add(t),G(e,t,`Rule: avoid local unknown-to-boolean coercion helpers in services. Why: runtime coercion belongs at schema boundary, not in service flow. Fix: decode boolean optionality in schema and read typed booleans in the Effect pipeline.`))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},BinaryExpression(e){!t||!Rr(e)||(n?a(e):r.push(e))},CallExpression(e){if(!(!t||!zr(e))){n=!0;for(let e of r)a(e)}}}}}),wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Hr(n)&&G(e,n,"Rule: avoid nullish re-wrap inside Option.fromNullable. Why: `x ?? null` and `x ?? undefined` add noise and hide source shape. Fix: pass the source directly to Option.fromNullable.")}}}}),To=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Wr(n)&&G(e,n,"Rule: avoid repeated Option boolean normalization (`onSome: value === true, onNone: false`). Why: it scatters coercion rules across services. Fix: normalize once at schema boundary and read booleans directly.")}}}}),Eo=t({create(e){return{CallExpression(t){o(t,`succeed`)&&z(a(t))&&G(e,t,`Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/Either/tagged unions) or real Effect results instead.`)}}}}),Do=t({create(e){return{VariableDeclaration(t){Gr(t)&&G(e,t,`Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/Either, or meaningful domain values instead of string tokens.`)}}}}),Oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&ci(n)&&G(e,n,"Rule: avoid raw primitive domain ID aliases. Why: `type UserId = string` does not protect boundaries from swapped IDs. Fix: use Schema branded IDs or a domain constructor that validates and brands the value.")}}}}),ko=t({create(e){let t=!1,n=n=>{if(t)for(let t of _i(n))G(e,t,"Rule: avoid boolean behavior flags in domain operations. Why: flags like `shouldNotify` hide use cases and create implicit branching. Fix: model intent with a command/tagged union or split the operation into explicit functions.")};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},BinaryExpression(n){t&&Ni(n)&&G(e,n,`Rule: avoid magic domain string comparisons. Why: comparing domain state to raw strings scatters status vocabulary and misses exhaustiveness. Fix: use a tagged union, Schema literal union, or Match over a named domain status.`)}}}}),jo=t({create(e){let t=!1,n=n=>{t&&hi(n)&&G(e,n,`Rule: avoid primitive-heavy domain parameters. Why: clusters of raw string/number domain values are easy to swap and have no invariant boundary. Fix: introduce branded types or a command/schema object with named validated fields.`)};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Mo=t({create(e){let t=!1,n=n=>{if(t)for(let t of Si(n))G(e,t,`Rule: avoid raw time fields in domain models. Why: number and Date fields hide units, clock ownership, and duration semantics. Fix: model durations with Effect Duration and keep raw timestamps at decode/encode boundaries.`)};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),No=new Set([`fs`,`node:fs`,`fs/promises`,`node:fs/promises`]),Po=new Set(`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib`.split(`.`));function Fo(e){return e.startsWith(`node:`)||Po.has(e)}function X(e){return typeof e==`object`&&!!e&&(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)}function Io(e,t){return e.computed!==!0&&n(e.property,t)||e.computed===!0&&z(e.property)&&e.property.value===t}function Lo(e){return X(e)&&n(e.object,`process`)&&Io(e,`env`)}function Ro(e){if(!X(e))return!1;if(Lo(e.object))return!0;if(!Lo(e))return!1;let t=e.parent;return!X(t)||t.object!==e}function zo(e){if(!X(e)||typeof e.parent!=`object`||e.parent===null)return!1;let t=e.parent;return t.type===`AssignmentExpression`&&t.left===e}const Bo=t({meta:{schema:q},create(e){return{ImportDeclaration(t){let n=K(t);n&&Fo(n)&&!J(e)&&G(e,t,`Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.`)}}}}),Vo=t({meta:{schema:Ri},create(e){return{MemberExpression(t){Ro(t)&&!zo(t)&&!J(e)&&!Ji(e)&&G(e,t,`Rule: avoid direct process.env reads outside configuration boundaries. Why: ambient configuration leaks runtime coupling into domain code. Fix: decode environment values in a configured Config service or Layer and depend on that service.`)}}}});function Ho(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`||!n(e.callee,`require`))return;let t=e.arguments?.[0];if(!z(t))return;let r=t.value;return No.has(r)?r:void 0}const Uo=t({create(e){let t=!1,n=0,r=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0),n&&No.has(n)&&r.push({node:e,source:n})},FunctionDeclaration(){n+=1},"FunctionDeclaration:exit"(){--n},FunctionExpression(){n+=1},"FunctionExpression:exit"(){--n},ArrowFunctionExpression(){n+=1},"ArrowFunctionExpression:exit"(){--n},CallExpression(e){if(n!==0)return;let t=Ho(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(let{node:t,source:n}of r)G(e,t,`Rule: avoid Node fs imports or require calls in Effect code (${n}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`)}}}}),Wo=t({meta:{schema:q},create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){jt(e)&&n.push(e)},"Program:exit"(){if(!(!t||J(e)))for(let t of n)G(e,t.callee,`Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.`)}}}}),Go=new Set([`try`,`tryPromise`,`mapError`,`catchAll`,`catchTag`,`catchTags`]);function Ko(e,t=new WeakSet){if(jt(e))return!0;if(i(e)){let t=e.callee.property;if(n(t)&&Go.has(t.name))return!0}return Array.isArray(e)?e.some(e=>Ko(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Ko(n,t)))}const qo=t({meta:{schema:q},create(e){return{TryStatement(t){!t.handler||!J(e)||Ko(t)||G(e,t,`Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, catchAll, or execute a mapped Effect program.`)}}}}),Jo=t({create(e){let t=!1,n=!1,i=[];return{ImportDeclaration(e){let r=K(e);r&&Y(r)&&(t=!0),na(e)&&(n=!0)},CallExpression(e){r(e.callee,`JSON`,`parse`)&&i.push(e)},"Program:exit"(){if(!(!t||n))for(let t of i)G(e,t,`Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: decode unknown input with Schema.decodeUnknown at the boundary.`)}}}}),Yo=t({create(e){let t=!1,n=new WeakSet,r=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){if(pe(e))for(let t of he(e.arguments))n.has(t)||(n.add(t),r.push(t))},"Program:exit"(){if(t)for(let t of r)G(e,t,`Rule: avoid Date.now inside Effect logic. Why: direct wall-clock reads make programs nondeterministic and difficult to test. Fix: obtain time through Effect Clock or DateTime at the boundary.`)}}}}),Xo=t({meta:{schema:q},create(e){let t=!1,r=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},NewExpression(e){n(e.callee,`Date`)&&r.push(e)},"Program:exit"(){if(!(!t||J(e)))for(let t of r)G(e,t,`Rule: avoid new Date in Effect domain logic. Why: direct wall-clock construction makes domain behaviour nondeterministic and difficult to test. Fix: obtain time through Effect Clock or model time at the boundary.`)}}}}),Zo=t({create(e){let t=!1,n=n=>{if(t)for(let t of wi(n))G(e,t,"Rule: avoid overloaded options objects. Why: `opts`, `options`, and `config` typed as any/object hide required fields and validation. Fix: accept unknown at the boundary and decode with Schema, or use a named typed command/config model.")};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},LogicalExpression(n){t&&Ei(n)&&G(e,n,`Rule: avoid embedding domain logic in conditionals. Why: multi-clause business rules become hard to test, reuse, and audit. Fix: extract a named domain predicate or validation Effect and call that from the branch.`)}}}}),$o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},LogicalExpression(n){t&&Oi(n)&&G(e,n,`Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.`)}}}}),es=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&ki(n)&&G(e,n,`Rule: avoid ad hoc domain errors. Why: string failures hide recovery semantics and observability. Fix: use Data.TaggedError or a structured domain error union.`)},ThrowStatement(n){t&&Ai(n)&&G(e,n,`Rule: avoid ad hoc domain errors. Why: thrown string Error values bypass typed Effect error channels. Fix: return Effect.fail with a structured tagged domain error.`)}}}}),ts=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration(n){t&&Mi(n)&&G(e,n,`Rule: avoid domain meaning by folder or context naming alone. Why: admin/public/internal meaning should be represented in types or services, not inferred from helper names. Fix: encode context with branded IDs, commands, policies, or service boundaries.`)}}}}),ns=t({create(e){return{CallExpression(t){r(t.callee,`Effect`,`as`)&&G(e,t.callee,`Rule: avoid Effect.as wrappers. Why: they can hide meaningful sequencing or value flow. Fix: return the intended value directly or use explicit Effect.map/andThen.`)}}}}),rs=t({create(e){return{MemberExpression(t){r(t,`Effect`,`Do`)&&G(e,t,`Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.`)}}}});function is(e,n,i){return t({create(t){return{CallExpression(a){r(a.callee,e,n)&&G(t,a.callee,i)}}}})}const as=is(`Effect`,`bind`,`Rule: avoid Effect.bind. Why: it obscures linear data flow behind builder-style binding. Fix: use Effect.gen or a direct pipe with flatMap/map.`),os=is(`Runtime`,`runFork`,`Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.`),ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&jt(n)&&G(e,n.callee,`Rule: avoid running Effects outside runtime boundaries. Why: direct Effect.run* calls scatter execution ownership. Fix: return Effects from domain logic and run them at the app, CLI, worker, route, or test boundary.`)}}}}),cs=is(`Effect`,`async`,`Rule: avoid Effect.async. Why: manual callback bridges are easy to leak or resume incorrectly. Fix: use scoped Effect APIs or a dedicated platform adapter.`),ls=t({create(e){return{CallExpression(t){s(t)&&G(e,t,`Rule: avoid deeply nested Effect calls (Effect.xx(Effect.yy(Effect.zz(...)))). Why: they hide sequencing and spread flow. Fix: build values first, then run one flat Effect pipeline.`)}}}}),us=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])s(n.init)&&G(e,n.init,`Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.`)},ReturnStatement(t){s(t.argument)&&G(e,t.argument,`Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.`)}}}}),ds=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[]){let t=te(n.init);t&&G(e,n.init,t)}},ReturnStatement(t){let n=te(t.argument);n&&G(e,t.argument,n)}}}}),fs=t({create(e){return{CallExpression(t){l(t)&&ie(t.arguments)&&G(e,t,`Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.`)}}}}),ps=t({create(e){return{CallExpression(t){ee(t)&&G(e,t,`Rule: avoid nested Effect call towers (Effect.fn(Effect.fn(...))). Why: it hides sequencing. Fix: build the inner Effect first, then use pipe/Effect.flatMap/Effect.andThen for a single flat pipeline.`)}}}}),ms=t({create(e){return{CallExpression(t){re(t)&&G(e,t,`Rule: avoid Effect.orElse around sequencing chains. Why: it hides error handling and splits the flow. Fix: move error handling to a single terminal decision after the pipeline.`)}}}}),hs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Qt(n)&&G(e,n,"Rule: avoid unbounded Effect.all over mapped collections. Why: it can launch work for every item at once and fail under load. Fix: pass an explicit `{ concurrency: n }` option or use a bounded batching strategy.")}}}}),gs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExpressionStatement(n){t&&o(n.expression,`fork`)&&G(e,n.expression,`Rule: avoid fire-and-forget Effect.fork. Why: detached fibers hide failure, interruption, and ownership. Fix: bind the fiber and join/await/interrupt it, or use Effect.forkScoped / Effect.forkIn with an explicit scope.`)}}}}),_s=t({create(e){let t=!1,n=n=>{if(!t)return;let r=$t(n.body);r&&G(e,r,`Rule: avoid Effect.fork inside loops. Why: loop-spawned fibers create unbounded concurrency and unclear ownership. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit or a scoped supervisor.`)};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ForStatement:n,ForInStatement:n,ForOfStatement:n,WhileStatement:n,DoWhileStatement:n}}}),vs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&yn(n)&&G(e,n,`Rule: avoid Effect.race without loser cleanup. Why: racing effects without ensuring/scoped cleanup can leak losing work or resources. Fix: wrap raced effects with Effect.ensuring/acquireRelease or use a scoped race boundary.`)}}}}),ys=t({create(e){let t=!1,n=new Map,r=new Set;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclarator(e){let t=Jn(e);t&&n.set(t,e)},CallExpression(e){let t=Xn(e);t&&r.add(t)},"Program:exit"(){if(t)for(let[t,i]of n)r.has(t)||G(e,i,`Rule: avoid unobserved forked fibers. Why: forked fiber failures and interruption should be observed. Fix: pass the fiber to Fiber.join, Fiber.await, Fiber.interrupt, or use scoped fork APIs.`)}}}}),bs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Sn(n)&&G(e,n,`Rule: avoid unbounded concurrent retry. Why: retry inside unbounded parallel collection effects can amplify load and create retry storms. Fix: add an explicit concurrency limit or move retry behind a bounded queue/backoff policy.`)}}}}),xs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=kt(n);r&&G(e,r,`Rule: avoid blocking sync calls inside Effect logic. Why: sync fs/crypto/zlib calls block the runtime worker and hide throughput costs. Fix: use Effect.async/tryPromise at a platform boundary, stream APIs, or a dedicated blocking executor.`)}}}}),Ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=xt(n);r&&G(e,r,`Rule: avoid Promise concurrency APIs inside Effect logic. Why: Promise.all/allSettled/race/any bypass Effect concurrency, interruption, tracing, and error channels. Fix: use Effect.all, Effect.forEach, Effect.race, or a boundary adapter with explicit cancellation ownership.`)}}}}),Cs=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(e){if(!(e.kind!==`let`&&e.kind!==`var`))for(let t of Cn(e))n.add(t)},CallExpression(r){if(!t)return;let i=Dn(r);if(!i)return;let a=P(i,n);a&&G(e,a,`Rule: avoid mutating shared state across fibers. Why: outer let/var state mutated from forked or parallel work creates nondeterministic races. Fix: model shared state with Ref/SynchronizedRef/Queue or aggregate immutable results with bounded Effect.all/forEach.`)}}}}),ws=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Tt(n);r&&G(e,r,`Rule: avoid timeout around noninterruptible Promise effects. Why: timing out Effect.promise or tryPromise without a signal leaves the underlying Promise running after interruption. Fix: use Effect.tryPromise with an AbortSignal parameter and pass it to the async API.`)}}}}),Ts=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Wn(n)&&G(e,n,`Rule: avoid uninterruptible concurrent regions. Why: wrapping fork/race/all/forEach or queue work in uninterruptible blocks cancellation and can strand work under shutdown. Fix: keep only the critical section uninterruptible and leave concurrent work interruptible or scoped.`)}}}}),Es=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Gn(n)&&G(e,n,`Rule: avoid unbounded Queue or PubSub constructors. Why: unbounded buffers hide backpressure and can fail under load. Fix: use Queue.bounded / PubSub.bounded with an explicit capacity at the owning boundary.`)}}}}),Ds=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(e){for(let t of qn(e))n.add(t)},CallExpression(r){if(!t)return;let i=Dn(r);if(!i)return;let a=P(i,n);a&&G(e,a,`Rule: avoid global mutable concurrency state. Why: module-scope mutable state touched from concurrent Effect work behaves like shared mutable global state. Fix: move ownership into Ref/SynchronizedRef/Queue/Layer state or pass immutable values through bounded effects.`)}}}}),Os=t({create(e){let t=!1,r=[new Set],i=new WeakSet;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration(){r.push(new Set)},"FunctionDeclaration:exit"(){r.pop()},FunctionExpression(){r.push(new Set)},"FunctionExpression:exit"(){r.pop()},ArrowFunctionExpression(){r.push(new Set)},"ArrowFunctionExpression:exit"(){r.pop()},VariableDeclarator(e){let t=mn(e);t&&r.at(-1)?.add(t)},CallExpression(o){if(!t||!pn(o))return;let s=a(o);!n(s)||!r.at(-1)?.has(s.name)||_n(o,s.name)||i.has(o)||(i.add(o),G(e,o,`Rule: avoid unbounded manual Deferred coordination. Why: a local latch can wait forever and make shutdown or failure ownership implicit. Fix: bound the await with a timeout/race, keep it interruptible, or tie completion and cleanup to a scope finalizer.`))}}}}),ks=t({create(e){let t=!1,n=new WeakSet;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(r){if(!t)return;let i=In(r);if(i)for(let t of Vn(i))typeof t!=`object`||!t||n.has(t)||(n.add(t),G(e,t,`Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.`))}}}}),As=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=nn(n);r&&M(r)&&G(e,n,`Rule: avoid suspension while holding a semaphore permit. Why: sleeping, awaiting, or forking under a permit holds capacity while unrelated work waits. Fix: narrow the permit-protected section and perform interruptible or concurrent work outside it.`)}}}}),js=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=rn(n);r&&M(r)&&G(e,n,`Rule: avoid suspension while holding synchronized reference coordination. Why: effectful SynchronizedRef modifiers hold internal coordination while the callback sleeps, awaits, or starts concurrent work. Fix: compute the effect outside the modifier and commit a short synchronous state transition.`)}}}}),Ms=t({create(e){return{ImportExpression(t){G(e,t,`Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.`)}}}}),Ns=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||!o(n,`forkDaemon`)||c(a(n),`supervised`)||G(e,n,`Rule: avoid unscoped background fibers. Why: Effect.forkDaemon detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn or make supervisor ownership explicit in the child effect.`)}}}});function Ps(e){if(typeof e!=`object`||!e||!Array.isArray(e.arguments))return[];let t=e.arguments;return o(e,`acquireUseRelease`)?t.slice(2):o(e,`acquireRelease`)||o(e,`acquireReleaseInterruptible`)?t.slice(1):o(e,`addFinalizer`)?t.slice(0,1):k(e,`Scope`,`addFinalizer`)||k(e,`Scope`,`addFinalizerExit`)?t.slice(1):[]}function Fs(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),v(t)){let e=t.parent;if(Ps(e).some(e=>e===t))return!0}t=t.parent}return!1}const Is=t({meta:{schema:q},create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||J(e)||!Fn(n)||Fs(n)||G(e,n,`Rule: avoid manual resource cleanup. Why: direct close/dispose calls can bypass Effect scope ownership. Fix: acquire the resource with Effect.acquireRelease or register cleanup with a Scope finalizer.`)}}}});function Ls(e){return k(e,`Scope`,`make`)&&Array.isArray(e.arguments)}function Rs(e,t){return k(e,`Scope`,`close`)&&n(a(e),t)}const zs=new Set([`BlockStatement`,`CatchClause`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`Program`,`SwitchStatement`]);function Bs(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),zs.has(t.type??``)||v(t))return t;t=t.parent}}function Vs(e,t){let n=e,r=new WeakSet;for(;typeof n==`object`&&n;){if(r.has(n))return!1;if(r.add(n),n===t)return!0;n=n.parent}return!1}function Hs(e){let t=0,n=e,r=new WeakSet;for(;typeof n==`object`&&n;){if(r.has(n))return t;r.add(n),t+=1,n=n.parent}return t}function Z(e){if(n(e))return[e];if(typeof e!=`object`||!e)return[];let t=e;switch(t.type){case`ArrayPattern`:return Array.isArray(t.elements)?t.elements.flatMap(e=>Z(e)):[];case`AssignmentPattern`:return Z(t.left);case`ObjectPattern`:return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e;return t.type===`Property`?Z(t.value):t.type===`RestElement`?Z(t.argument):[]}):[];case`RestElement`:return Z(t.argument);case`TSParameterProperty`:return Z(t.parameter);default:return[]}}function Us(e){return x(e.body,t=>typeof t==`object`&&!!t&&Ws(t).length>0&&Js(t)===e)}function Ws(e){return e.type===`VariableDeclarator`?Z(e.id):e.type===`CatchClause`?Z(e.param):(e.type===`ClassDeclaration`||e.type===`FunctionDeclaration`)&&n(e.id)?[e.id]:[]}function Gs(e){return e.type===`CatchClause`?Bs(e.param):Bs(e)}function Ks(e,t){if(!n(e))return;let r,i=-1;for(let a of Us(t)){if(!Ws(a).some(t=>n(t,e.name)))continue;let t=Gs(a);if(t===void 0||!Vs(e,t))continue;let o=Hs(t);o>i&&(r=a,i=o)}return r}function qs(e,t){return e===t?!0:typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&e.argument===t}function Js(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),v(t))return t;t=t.parent}}function Ys(e){let t=typeof e==`object`&&e?e.parent:void 0,r=new WeakSet;for(;typeof t==`object`&&t;){if(r.has(t))return;if(r.add(t),t.type===`VariableDeclarator`&&n(t.id)&&qs(t.init,e))return t;if(v(t))return;t=t.parent}}function Xs(e){let t=Ys(e),n=Js(e);if(t===void 0||n===void 0)return!1;let r=t.id.name;return x(n.body,e=>Rs(e,r)&&Js(e)===n&&Ks(a(e),n)===t).length>0}function Zs(e){return(o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`acquireReleaseInterruptible`))&&Array.isArray(e.arguments)}function Qs(e,t,r){let i=a(e);return n(i,t.name)?Ks(i,r)===void 0&&Array.isArray(r.params)&&r.params.some(e=>e===t):!1}function $s(e){let t=e.arguments;return(o(e,`acquireUseRelease`)?t.slice(2):t.slice(1)).some(e=>{if(!v(e))return!1;let t=e.params?.[0];return n(t)?x(e.body,n=>Rs(n,t.name)&&Js(n)===e&&Qs(n,t,e)).length>0:!1})}function ec(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),o(t,`scoped`)||k(t,`Layer`,`scoped`)||Zs(t)&&a(t)===e&&$s(t))return!0;t=t.parent}return Xs(e)}const tc={"no-react-state":aa,"no-if-statement":oa,"no-switch-statement":sa,"no-ternary":ca,"no-return-null":la,"no-option-as":ua,"no-effect-never":da,"no-arrow-ladder":fa,"no-branch-in-object":pa,"no-iife-wrapper":ma,"no-return-in-arrow":ha,"no-return-in-callback":ga,"no-effect-fn-generator":_a,"no-effect-sync-console":va,"no-console-in-effect-flow":ya,"no-effect-log-without-structured-context":ba,"require-span-on-public-service-method":xa,"no-runpromise-in-non-async-test-body":Sa,"require-effect-flip-for-error-test":Ca,"no-test-mock-layer-when-default-available":wa,"no-nested-effect-gen":Ta,"no-yield-without-star-in-effect-gen":Ea,"no-piped-yield-in-gen":Da,"no-gen-for-mapping":Oa,"prefer-gen-for-workflow":ka,"no-large-anonymous-flow":Aa,"no-effect-in-flow":ja,"prefer-named-flow":Ma,"prefer-pipe-for-behavior":Na,"prefer-decorated-effect-before-gen":Pa,"no-workflow-in-behavior-pipe":Fa,"no-mixed-pillar-function":Ia,"no-clever-effect-expression":La,"prefer-extracted-concept":Ra,"prefer-effect-service":za,"no-layer-provide-in-service-definition":Ba,"require-service-accessors":Va,"require-service-dependencies":Ha,"no-namespace-effect-import":Ua,"no-manual-service-object-export":Wa,"no-layer-merge-in-request-handler":Ya,"no-service-method-returning-promise":Xa,"prefer-layer-pipe":Ga,"no-inline-layer-provide-in-program":Ka,"prefer-layer-mergeall-for-infrastructure":qa,"no-service-layer-scatter":Ja,"no-match-void-branch":Za,"no-json-parse-without-schema":Jo,"no-date-now-in-effect":Yo,"no-new-date-in-domain-logic":Xo,"no-match-effect-branch":Qa,"warn-effect-sync-wrapper":$a,"no-effect-side-effect-wrapper":eo,"no-effect-all-step-sequencing":to,"no-async-effect-combinator-callback":no,"no-throw-in-effect-logic":ro,"no-or-die-outside-boundary":io,"no-swallowed-catch-all":ao,"no-effect-ignore":oo,"no-try-catch-in-effect-logic":so,"no-promise-api-in-effect-logic":co,"no-try-catch":lo,"no-effect-wrapper-alias":uo,"no-manual-effect-channels":fo,"no-wrapgraphql-catchall":po,"no-render-side-effects":mo,"no-atom-registry-effect-sync":ho,"no-family-collection-read":go,"no-inline-runtime-provide":_o,"no-naked-object-state-update":vo,"no-effect-succeed-variable":yo,"no-effect-type-alias":bo,"no-public-generic-effect-error":xo,"no-model-overlay-cast":So,"no-unknown-boolean-coercion-helper":Co,"no-fromnullable-nullish-coalesce":wo,"no-option-boolean-normalization":To,"no-string-sentinel-return":Eo,"no-string-sentinel-const":Do,"no-raw-domain-id-alias":Oo,"no-boolean-domain-flag":ko,"no-magic-domain-string":Ao,"no-raw-domain-primitive-params":jo,"no-raw-time-domain-field":Mo,"no-hidden-effect-execution":Wo,"no-boundary-try-catch-without-effect-map":qo,"no-node-fs-in-effect-code":Uo,"no-node-platform-in-shared-code":Bo,"no-process-env-direct-read":Vo,"no-overloaded-options-object":Zo,"no-domain-logic-in-conditional":Qo,"no-implicit-state-machine-object":$o,"no-adhoc-domain-error":es,"no-domain-meaning-by-folder-only":ts,"no-effect-as":ns,"no-effect-do":rs,"no-effect-bind":as,"no-runtime-runfork":os,"no-run-effect-outside-boundary":ss,"no-effect-async":cs,"prevent-dynamic-imports":Ms,"no-nested-effect-call":ls,"no-effect-ladder":us,"no-flatmap-ladder":ds,"no-pipe-ladder":fs,"no-call-tower":ps,"no-effect-orElse-ladder":ms,"no-unbounded-effect-all":hs,"no-fire-and-forget-fork":gs,"no-fork-in-loop":_s,"no-race-without-cleanup":vs,"no-unobserved-fiber":ys,"no-unbounded-concurrent-retry":bs,"no-blocking-call-in-effect":xs,"no-promise-concurrency-in-effect":Ss,"no-shared-mutable-state-across-fibers":Cs,"no-timeout-with-noninterruptible-promise":ws,"no-uninterruptible-concurrent-region":Ts,"no-unbounded-queue-or-pubsub":Es,"no-global-mutable-concurrency-state":Ds,"no-manual-deferred-coordination":Os,"no-acquire-without-scoped-release":ks,"no-manual-resource-close":Is,"no-unbound-scope":t({meta:{schema:q},create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||J(e)||!Ls(n)||ec(n)||G(e,n,`Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.`)}}}}),"no-resource-succeed-escape":t({meta:{schema:q},create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||J(e)||!o(n,`succeed`)||!Pn(a(n))||G(e,n,`Rule: do not let live resources escape through Effect.succeed. Why: ordinary success values do not express resource lifetime ownership. Fix: keep the resource inside Effect.acquireRelease, Scope, or a service layer.`)}}}}),"no-yield-with-held-semaphore-permit":As,"no-yield-with-held-mutable-ref":js,"no-unscoped-background-fiber":Ns},nc=[`no-runpromise-in-non-async-test-body`,`require-effect-flip-for-error-test`,`no-test-mock-layer-when-default-available`],rc=[`no-manual-deferred-coordination`,`no-yield-with-held-semaphore-permit`,`no-yield-with-held-mutable-ref`,`no-unscoped-background-fiber`];function Q(e){return Object.fromEntries(e.map(e=>[`linteffect/${e}`,`error`]))}function $(e){return{jsPlugins:ic,rules:e}}const ic=[{name:`linteffect`,specifier:`@opsydyn/oxlint-effect`}],ac=Q([`no-react-state`,`no-runtime-runfork`,`no-run-effect-outside-boundary`,`no-or-die-outside-boundary`,`prevent-dynamic-imports`,`no-render-side-effects`,`no-inline-runtime-provide`]),oc=Q([`no-effect-as`,`no-effect-do`,`no-effect-bind`,`no-effect-async`,`no-effect-ignore`,`no-effect-never`,`no-effect-fn-generator`,`no-nested-effect-gen`,`no-yield-without-star-in-effect-gen`,`no-async-effect-combinator-callback`,`no-throw-in-effect-logic`,`no-try-catch-in-effect-logic`,`no-promise-api-in-effect-logic`,`no-swallowed-catch-all`,`no-manual-effect-channels`,`no-effect-type-alias`,`no-public-generic-effect-error`]),sc=Q([`no-unbounded-effect-all`,`no-fire-and-forget-fork`,`no-fork-in-loop`,`no-race-without-cleanup`,`no-unobserved-fiber`,`no-unbounded-concurrent-retry`,`no-blocking-call-in-effect`,`no-promise-concurrency-in-effect`,`no-shared-mutable-state-across-fibers`,`no-timeout-with-noninterruptible-promise`,`no-uninterruptible-concurrent-region`,`no-unbounded-queue-or-pubsub`,`no-global-mutable-concurrency-state`,...rc,`no-acquire-without-scoped-release`]),cc=Q([`no-manual-resource-close`,`no-unbound-scope`,`no-resource-succeed-escape`]),lc=Q([`no-nested-effect-call`,`no-effect-ladder`,`no-flatmap-ladder`,`no-pipe-ladder`,`no-call-tower`,`no-effect-orElse-ladder`,`no-effect-wrapper-alias`,`warn-effect-sync-wrapper`,`no-effect-side-effect-wrapper`,`no-effect-all-step-sequencing`,`no-effect-succeed-variable`]),uc=Q([`no-if-statement`,`no-switch-statement`,`no-ternary`,`no-try-catch`,`no-arrow-ladder`,`no-iife-wrapper`,`no-return-in-arrow`,`no-return-in-callback`,`no-return-null`,`no-branch-in-object`]),dc=Q([`no-option-as`,`no-match-void-branch`,`no-match-effect-branch`,`no-model-overlay-cast`,`no-unknown-boolean-coercion-helper`,`no-fromnullable-nullish-coalesce`,`no-option-boolean-normalization`,`no-string-sentinel-return`,`no-string-sentinel-const`]),fc=Q([`no-effect-sync-console`,`no-atom-registry-effect-sync`,`no-family-collection-read`,`no-naked-object-state-update`,`no-wrapgraphql-catchall`]),pc=Q([`no-raw-domain-id-alias`,`no-boolean-domain-flag`,`no-magic-domain-string`,`no-raw-domain-primitive-params`,`no-raw-time-domain-field`,`no-overloaded-options-object`,`no-domain-logic-in-conditional`,`no-implicit-state-machine-object`,`no-adhoc-domain-error`,`no-domain-meaning-by-folder-only`,`no-new-date-in-domain-logic`]),mc=Q([`no-piped-yield-in-gen`,`no-gen-for-mapping`,`prefer-gen-for-workflow`]),hc=Q([`no-large-anonymous-flow`,`no-effect-in-flow`,`prefer-named-flow`]),gc=Q([`prefer-pipe-for-behavior`,`prefer-decorated-effect-before-gen`,`no-workflow-in-behavior-pipe`]),_c=Q([`no-mixed-pillar-function`,`no-clever-effect-expression`,`prefer-extracted-concept`]),vc=Q([`prefer-effect-service`,`no-layer-provide-in-service-definition`,`require-service-accessors`,`require-service-dependencies`,`no-namespace-effect-import`,`no-manual-service-object-export`,`no-layer-merge-in-request-handler`,`no-service-method-returning-promise`,`prefer-layer-pipe`,`no-inline-layer-provide-in-program`,`prefer-layer-mergeall-for-infrastructure`,`no-service-layer-scatter`]),yc=Q([`no-hidden-effect-execution`,`no-boundary-try-catch-without-effect-map`,`no-node-fs-in-effect-code`,`no-json-parse-without-schema`,`no-date-now-in-effect`,`no-node-platform-in-shared-code`,`no-process-env-direct-read`]),bc=Q([`no-console-in-effect-flow`,`no-effect-log-without-structured-context`,`require-span-on-public-service-method`,...nc]),xc=Q(Object.keys(tc)),Sc=[...nc,...rc,`no-resource-succeed-escape`],Cc=Q(Object.keys(tc).filter(e=>!Sc.includes(e))),wc={reactAndRuntimeBoundaries:ac,effectComposition:oc,concurrencySafety:sc,resourceLifetime:cc,pipelineShapeAndSequencing:lc,branchingAndLocalControlFlow:uc,optionMatchAndDataNormalization:dc,atomStateAndPlatformBoundaries:fc,domainModeling:pc,effectFlow:mc,pureTransformation:hc,behaviorDecoration:gc,styleSeparation:_c,serviceAndLayerArchitecture:vc,platformAndBoundaryHygiene:yc,testingObservabilityAndQa:bc,ddd:pc},Tc=$(Cc),Ec=$(ac),Dc=$(oc),Oc=$(sc),kc=$(cc),Ac=$(lc),jc=$(uc),Mc=$(dc),Nc=$(fc),Pc=$(pc),Fc=Pc,Ic=$(mc),Lc=$(hc),Rc=$(gc),zc=$(_c),Bc=$(vc),Vc=$(yc),Hc=$(bc),Uc={recommended:Tc,reactAndRuntimeBoundaries:Ec,effectComposition:Dc,concurrencySafety:Oc,resourceLifetime:kc,pipelineShapeAndSequencing:Ac,branchingAndLocalControlFlow:jc,optionMatchAndDataNormalization:Mc,atomStateAndPlatformBoundaries:Nc,domainModeling:Pc,ddd:Fc,effectFlow:Ic,pureTransformation:Lc,behaviorDecoration:Rc,styleSeparation:zc,serviceAndLayerArchitecture:Bc,platformAndBoundaryHygiene:Vc,testingObservabilityAndQa:Hc};var Wc=e({meta:{name:`linteffect`},rules:tc});export{xc as allRules,Nc as atomStateAndPlatformBoundaries,fc as atomStateAndPlatformBoundariesRules,Rc as behaviorDecoration,gc as behaviorDecorationRules,jc as branchingAndLocalControlFlow,uc as branchingAndLocalControlFlowRules,Oc as concurrencySafety,sc as concurrencySafetyRules,Fc as ddd,Wc as default,Pc as domainModeling,pc as domainModelingRules,Dc as effectComposition,oc as effectCompositionRules,Ic as effectFlow,mc as effectFlowRules,ic as jsPlugins,Mc as optionMatchAndDataNormalization,dc as optionMatchAndDataNormalizationRules,Ac as pipelineShapeAndSequencing,lc as pipelineShapeAndSequencingRules,Vc as platformAndBoundaryHygiene,yc as platformAndBoundaryHygieneRules,Uc as presets,Lc as pureTransformation,hc as pureTransformationRules,Ec as reactAndRuntimeBoundaries,ac as reactAndRuntimeBoundariesRules,Tc as recommended,Cc as recommendedRules,kc as resourceLifetime,cc as resourceLifetimeRules,wc as ruleGroups,Bc as serviceAndLayerArchitecture,vc as serviceAndLayerArchitectureRules,zc as styleSeparation,_c as styleSeparationRules,Hc as testingObservabilityAndQa,bc as testingObservabilityAndQaRules};
1
+ import{definePlugin as e,defineRule as t}from"@oxlint/plugins";function n(e,t){return typeof e==`object`&&!!e&&e.type===`Identifier`&&typeof e.name==`string`&&(t===void 0||e.name===t)}function r(e,t,r){if(typeof e!=`object`||!e)return!1;let i=e;return i.type===`MemberExpression`&&i.computed!==!0&&n(i.object,t)&&n(i.property,r)}function i(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`Effect`)&&n(t.callee.property)}function a(e){return e.arguments[0]}function o(e,t){if(!i(e))return!1;let r=e.callee;return n(r.property,t)}function s(e){if(!i(e))return!1;let t=a(e);return i(t)?i(a(t)):!1}function ee(e){return i(e)?e.arguments.slice(0,2).some(e=>i(e)):!1}function c(e,t,n=new WeakSet){return o(e,t)?!0:Array.isArray(e)?e.some(e=>c(e,t,n)):typeof e!=`object`||!e||n.has(e)?!1:(n.add(e),Object.entries(e).some(([e,r])=>e!==`parent`&&c(r,t,n)))}function te(e){if(o(e,`flatMap`)&&c(e.arguments,`flatMap`))return`Rule: avoid nested Effect.flatMap. Why: it hides sequencing and pushes laddered control flow. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.`;if(o(e,`flatten`)&&c(a(e),`map`))return`Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.`}const ne=[`flatMap`,`zipRight`,`as`,`tap`];function re(e){if(!o(e,`orElse`))return!1;let t=a(e);return ne.some(e=>c(t,e))}function l(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`CallExpression`)return!1;if(n(t.callee,`pipe`))return!0;let r=t.callee;return typeof r==`object`&&!!r&&r.type===`MemberExpression`&&r.computed!==!0&&n(r.property,`pipe`)}function ie(e,t=new WeakSet){return l(e)?!0:Array.isArray(e)?e.some(e=>ie(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ie(n,t)))}function ae(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`ArrowFunctionExpression`}function oe(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&(t.callee.type===`ArrowFunctionExpression`||t.callee.type===`FunctionExpression`)}function se(e,t=new WeakSet){if(ae(e))return e;if(Array.isArray(e)){for(let n of e){let e=se(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=se(r,t);if(e)return e}}}function u(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>u(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),e.type===`ReturnStatement`?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:u(n,t)))}function ce(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&(r(t.callee,`S`,`filter`)||r(t.callee,`Schema`,`filter`))}function le(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)||ce(t)?[]:t.arguments.flatMap(e=>{if(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`)return[];let t=e.body;return typeof t!=`object`||!t||t.type!==`BlockStatement`?[]:u(t)})}function ue(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)?[]:t.arguments.flatMap(e=>typeof e!=`object`||!e||e.type!==`FunctionExpression`||e.generator===!0?[]:u(e.body))}function de(e){return typeof e==`object`&&!!e&&e.type===`FunctionExpression`&&e.generator===!0}function d(e,t){if(!o(e,t))return;let n=a(e);return de(n)?n:void 0}function fe(e,t){return d(e,t)!==void 0}const pe=new Set([`gen`,`sync`,`try`,`tryPromise`,`fn`]);function me(e){if(i(e)){let t=e.callee.property;if(n(t)&&pe.has(t.name))return!0}if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&o(t.callee,`fn`)}function he(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&r(e.callee,`Date`,`now`)}function ge(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>ge(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),he(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:ge(n,t)))}function _e(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=_e(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`YieldExpression`&&e.delegate!==!0)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=_e(r,t);if(e)return e}}}function ve(e){let t=d(e,`gen`);return t?_e(t.body):void 0}function ye(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>ye(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),e.type===`YieldExpression`&&e.delegate===!0&&l(e.argument)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:ye(n,t)))}function be(e){let t=d(e,`gen`);if(!t)return;let n=ye(t.body);return n.length>=2?n[1]:void 0}function f(e,t,n=new WeakSet){return Array.isArray(e)?e.some(e=>f(e,t,n)):typeof e!=`object`||!e||n.has(e)?!1:(n.add(e),e.type===t?!0:Object.entries(e).some(([e,r])=>e!==`parent`&&f(r,t,n)))}function p(e,t,r=new WeakSet){return n(e,t)?!0:Array.isArray(e)?e.some(e=>p(e,t,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&p(n,t,r)))}function m(e,t=new WeakSet){return i(e)?!0:Array.isArray(e)?e.some(e=>m(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&m(n,t)))}function xe(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return;let t=e.declarations;if(!Array.isArray(t)||t.length!==1)return;let r=t[0];if(!(typeof r!=`object`||!r||r.type!==`VariableDeclarator`||!n(r.id)||typeof r.init!=`object`||r.init===null||r.init.type!==`YieldExpression`||r.init.delegate!==!0))return r.id.name}function Se(e,t){if(typeof e!=`object`||!e||e.type!==`ReturnStatement`)return!1;let r=e.argument;return r!==void 0&&!n(r,t)&&!f(r,`YieldExpression`)&&!f(r,`AwaitExpression`)&&!m(r)&&!p(r,`Promise`)}function Ce(e){let t=d(e,`gen`);if(!t||typeof t.body!=`object`||t.body===null)return;let n=t.body,r=Array.isArray(n.body)?n.body:[];if(r.length!==2)return;let i=xe(r[0]);return i&&Se(r[1],i)?e:void 0}const we=new Set([`andThen`,`flatMap`,`tap`,`zipRight`]);function Te(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return[];let t=e,r=Array.isArray(t.arguments)?t.arguments:[];if(n(t.callee,`pipe`))return r.slice(1);let i=t.callee;return typeof i==`object`&&i&&i.type===`MemberExpression`&&i.computed!==!0&&n(i.property,`pipe`)?r:[]}function Ee(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&we.has(t.name)}function De(e){if(l(e))return Te(e).filter(e=>Ee(e)).length>=3?e:void 0}function Oe(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&n(e.callee,`flow`)}function ke(e){return Oe(e)&&e.arguments.length>=5}function Ae(e,t=new WeakSet){return typeof e==`object`&&e&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`)&&e.async===!0?!0:Array.isArray(e)?e.some(e=>Ae(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Ae(n,t)))}function je(e){return m(e)||f(e,`YieldExpression`)||f(e,`AwaitExpression`)||Ae(e)||O(e)||p(e,`Promise`)||p(e,`Runtime`)}function Me(e){if(Oe(e))return e.arguments.find(e=>je(e))}function Ne(e){if(!(typeof e!=`object`||!e||e.type!==`CallExpression`))return(e.arguments??[]).find(e=>Oe(e)&&e.arguments.length>=3)}const Pe=new Set([`annotateLogs`,`as`,`catchAll`,`catchSome`,`catchTag`,`map`,`mapBoth`,`provide`,`retry`,`tap`,`tapError`,`timeout`,`timeoutFail`,`withSpan`]);function Fe(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Pe.has(t.name)}function Ie(e){return i(e)||l(e)}function Le(e){if(!Fe(e))return;let t=e.arguments[0];return Ie(t)?e:void 0}function Re(e){return typeof e!=`object`||!e||e.type!==`YieldExpression`||e.delegate!==!0||!l(e.argument)?!1:Te(e.argument).some(e=>Fe(e))}function ze(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>ze(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),Re(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:ze(n,t)))}function Be(e){let t=d(e,`gen`);if(!t)return;let n=ze(t.body);return n.length>=2?n[1]:void 0}function Ve(e){if(!l(e))return;let t=Te(e);if(!t.some(e=>Fe(e)))return;let n=t.filter(e=>Ee(e)).length,r=t.some(e=>f(e,`IfStatement`)||f(e,`SwitchStatement`)||f(e,`ForStatement`)||f(e,`ForInStatement`)||f(e,`ForOfStatement`)||f(e,`WhileStatement`));return n>=2||r?e:void 0}function He(e,t=new Set,n=new WeakSet){if((o(e,`gen`)||Ee(e))&&t.add(`workflow`),Oe(e)&&t.add(`pure`),Fe(e)&&t.add(`behavior`),(D(e,`Layer`)||r(e,`Layer`,`pipe`))&&t.add(`layer`),Array.isArray(e)){for(let r of e)He(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;n.add(e);for(let[r,i]of Object.entries(e))r!==`parent`&&He(i,t,n);return t}function h(e){return typeof e==`object`&&!!e&&(e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`)}function Ue(e){if(!h(e))return;let t=e.body;return He(t).size>=3?e:void 0}function We(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,We(n,t)),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=Object.entries(e).reduce((e,[n,r])=>n===`parent`?e:Math.max(e,We(r,t)),0);return e.type===`CallExpression`?n+1:n}function Ge(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=He(e),n=oe(e)||se(e)!==void 0;return t.size>=2&&(We(e)>=4||n)?e:void 0}function Ke(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;for(let e of t.arguments??[]){if(typeof e!=`object`||!e||!h(e))continue;let t=e.body;if(typeof t==`object`&&t&&t.type===`BlockStatement`&&Array.isArray(t.body)&&t.body.length>=3)return e}}function qe(e){return r(e,`Effect`,`Service`)?!0:typeof e!=`object`||!e||e.type!==`CallExpression`?!1:qe(e.callee)}function Je(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(qe(t.callee))return[...t.arguments??[]].reverse().find(e=>typeof e==`object`&&!!e&&e.type===`ObjectExpression`)}function g(e){if(!(typeof e!=`object`||!e||e.type!==`ClassDeclaration`))return Je(e.superClass)}function Ye(e){return D(e,`Context`,`Tag`)||D(e,`Context`,`GenericTag`)}function Xe(e,t=new WeakSet){return D(e,`Layer`,`provide`)?!0:Array.isArray(e)?e.some(e=>Xe(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Xe(n,t)))}function Ze(e){return V(B(e,`accessors`),!0)}function Qe(e){if(!Y(K(e)??``))return;let t=typeof e==`object`&&e?e.specifiers:void 0;return Array.isArray(t)?t.find(e=>typeof e==`object`&&!!e&&e.type===`ImportNamespaceSpecifier`):void 0}function $e(e){return typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&n(e.argument)&&e.argument.name.endsWith(`Service`)}function _(e,t,n=new WeakSet){if(t(e))return e;if(Array.isArray(e)){for(let r of e){let e=_(r,t,n);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!n.has(e)){n.add(e);for(let[r,i]of Object.entries(e)){if(r===`parent`)continue;let e=_(i,t,n);if(e)return e}}}function v(e,t,n=new WeakSet){let r=t(e)?[e]:[];return Array.isArray(e)?e.flatMap(e=>v(e,t,n)).concat(r):typeof e!=`object`||!e||n.has(e)?r:(n.add(e),Object.entries(e).reduce((e,[r,i])=>r===`parent`?e:e.concat(v(i,t,n)),r))}function et(e){if(!B(e,`dependencies`))return _(B(e,`effect`)??B(e,`scoped`),$e)}function tt(e){if(!D(e,`Layer`))return!1;let t=e.callee.property;return n(t)&&(t.name===`provide`||t.name.startsWith(`merge`))}function nt(e){if(typeof e!=`object`||!e||e.type!==`FunctionDeclaration`)return!1;let t=e.id;return n(t)&&/(handler|route|request)$/i.test(t.name)}function rt(e){if(nt(e))return _(e.body,tt)?e:void 0}function it(e){if(D(e,`Layer`,`provide`))return _(a(e),t=>t!==e&&D(t,`Layer`,`provide`))}function at(e){return o(e,`provide`)||D(e,`Layer`,`provide`)}function ot(e){let t=d(e,`gen`);return t?_(t.body,at):void 0}function st(e){if(D(e,`Layer`,`merge`))return e.arguments?.find(t=>_(t,t=>t!==e&&D(t,`Layer`,`merge`)))}function ct(e){return n(e)&&/(Layer|Live)$/.test(e.name)}function lt(e){if(!(typeof e!=`object`||!e||e.type!==`VariableDeclaration`))return e.declarations?.find(e=>typeof e==`object`&&!!e&&ct(e.id)&&_(e.init,at))}function ut(e){return h(e)?nr(L(e),`Promise`)||S(e.body)!==void 0:!1}function dt(e){return typeof e==`object`&&!!e&&e.type===`Property`&&ut(e.value)}function ft(e){return _(e,dt)}function pt(e){if(typeof e!=`object`||!e||e.type!==`ObjectExpression`)return!1;let t=e.properties;return Array.isArray(t)&&t.some(e=>typeof e==`object`&&!!e&&e.type===`Property`&&(h(e.value)||o(e.value,`fn`)))}function mt(e){if(typeof e!=`object`||!e)return;let t=e.declaration;if(!(typeof t!=`object`||!t)&&t.type===`VariableDeclaration`){for(let e of t.declarations??[])if(typeof e==`object`&&e&&n(e.id)&&e.id.name.endsWith(`Service`)&&pt(e.init))return e}}function ht(e){return typeof e==`object`&&!!e&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`)&&e.async===!0}const y=new Set([`andThen`,`catchAll`,`catchTag`,`filterOrFail`,`flatMap`,`forEach`,`map`,`orElse`,`tap`]);function gt(e){if(!i(e))return;let t=e.callee.property;if(!(!n(t)||!y.has(t.name)))return e.arguments.find(e=>ht(e))}function b(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=b(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`ThrowStatement`)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=b(r,t);if(e)return e}}}function _t(e){let t=d(e,`gen`);if(t)return b(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!y.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?b(e):void 0;if(n)return n}}function x(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=x(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`TryStatement`)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=x(r,t);if(e)return e}}}function vt(e){let t=d(e,`gen`);if(t)return x(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!y.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?x(e):void 0;if(n)return n}}function yt(e){return D(e,`Promise`,`all`)||D(e,`Promise`,`allSettled`)||D(e,`Promise`,`any`)||D(e,`Promise`,`race`)||D(e,`Promise`,`reject`)||D(e,`Promise`,`resolve`)}function bt(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;return typeof t==`object`&&!!t&&t.type===`MemberExpression`&&t.computed!==!0&&(n(t.property,`then`)||n(t.property,`catch`)||n(t.property,`finally`))}function S(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=S(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),yt(e)||bt(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=S(r,t);if(e)return e}}}function xt(e){let t=d(e,`gen`);if(t)return S(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!y.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?S(e):void 0;if(n)return n}}const St=new Set([`all`,`allSettled`,`any`,`race`]);function Ct(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;return typeof t==`object`&&!!t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.object,`Promise`)&&n(t.property)&&St.has(t.property.name)}function C(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=C(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),Ct(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=C(r,t);if(e)return e}}}function wt(e){let t=d(e,`gen`);if(t)return C(t.body);if(o(e,`sync`)){let t=R(a(e));return t?C(t):void 0}if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!y.has(r.name)))for(let t of e.arguments){let e=R(t),n=e?C(e):void 0;if(n)return n}}function Tt(e){if(typeof e!=`object`||!e)return!1;let t=e;return(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)&&Array.isArray(t.params)&&t.params.length>0}function Et(e){if(!o(e,`tryPromise`))return!1;let t=a(e);return Tt(t)?!0:Tt(B(t,`try`))}function Dt(e){return o(e,`promise`)?!0:o(e,`tryPromise`)&&!Et(e)}function Ot(e){if(!o(e,`timeout`))return;let t=a(e);return Dt(t)?t:void 0}const kt=new Set([`crypto`,`fs`,`zlib`]);function At(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(n(t))return t.name.endsWith(`Sync`);if(typeof t!=`object`||!t||t.type!==`MemberExpression`||t.computed===!0||!n(t.object)||!n(t.property))return!1;let r=t.object.name,i=t.property.name;return kt.has(r)&&i.endsWith(`Sync`)}function w(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=w(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),At(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=w(r,t);if(e)return e}}}function jt(e){let t=d(e,`gen`);if(t)return w(t.body);if(o(e,`sync`)){let t=R(a(e));return t?w(t):void 0}}const Mt=new Set([`runCallback`,`runFork`,`runPromise`,`runPromiseExit`,`runSync`,`runSyncExit`]);function Nt(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Mt.has(t.name)}function Pt(e){return r(e,`Effect`,`orDie`)||r(e,`Effect`,`orDieWith`)||o(e,`orDie`)||o(e,`orDieWith`)}function Ft(e){if(Pt(e))return e;if(l(e))return F(e).find(e=>Pt(e))}function It(e){return o(e,`succeed`)||o(e,`asVoid`)||o(e,`ignore`)||Xr(e)}function Lt(e){if(!o(e,`catchAll`))return;let t=R(a(e));return It(t)?t:void 0}function Rt(e){return r(e,`Effect`,`ignore`)||o(e,`ignore`)}function zt(e){if(Rt(e))return e;if(l(e))return F(e).find(e=>Rt(e))}function T(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`console`)&&n(t.callee.property)}function Bt(e){if(me(e))return v(e.arguments,T);let t=g(e);return t?v(B(t,`effect`)??B(t,`scoped`),T):[]}const Vt=new Set([`catchAll`,`catchTag`,`catchTags`,`tapError`]);function Ht(e){return z(e)||typeof e==`object`&&!!e&&e.type===`TemplateLiteral`}function Ut(e){return o(e,`logError`)||o(e,`logWarning`)}function Wt(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`}function Gt(e,t){return _(e,e=>o(e,`annotateLogs`))?!0:t.arguments.slice(1).some(e=>Wt(e)||!Ht(e))}function Kt(e){return v(e,t=>Ut(t)&&Ht(a(t))&&!Gt(e,t))}function qt(e){if(!i(e))return[];let t=e.callee.property;return!n(t)||!Vt.has(t.name)?[]:e.arguments.map(R).filter(e=>e!==void 0)}function E(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&n(r.callee,t)}function D(e,t,r){if(typeof e!=`object`||!e)return!1;let i=e;return i.type===`CallExpression`&&typeof i.callee==`object`&&i.callee!==null&&i.callee.type===`MemberExpression`&&i.callee.computed!==!0&&n(i.callee.object,t)&&n(i.callee.property)&&(r===void 0||n(i.callee.property,r))}function Jt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`CallExpression`||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0||!n(t.callee.object,`Effect`)||!n(t.callee.property)?!1:t.callee.property.name.startsWith(`log`)}function O(e,t=new WeakSet){return T(e)?!0:Array.isArray(e)?e.some(e=>O(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&O(n,t)))}function k(e,t=new WeakSet){return E(e,`setState`)||D(e,`Atom`,`set`)||E(e,`invalidate`)||Jt(e)||T(e)?!0:Array.isArray(e)?e.some(e=>k(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&k(n,t)))}function A(e,t=new WeakSet){return D(e,`Ref`,`set`)||D(e,`Atom`,`set`)||D(e,`SubscriptionRef`,`set`)||D(e,`Reactivity`,`invalidate`)||D(e,`Fiber`,`interrupt`)||Jt(e)?!0:Array.isArray(e)?e.some(e=>A(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&A(n,t)))}function Yt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?!1:t.properties.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e,r=t.key,i=t.value;return(n(r,`concurrency`)||typeof r==`object`&&!!r&&r.value===`concurrency`)&&typeof i==`object`&&!!i&&(i.type===`Literal`||i.type===`NumericLiteral`)&&i.value===1})}function Xt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?!1:t.properties.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e.key;return n(t,`concurrency`)||typeof t==`object`&&!!t&&t.value===`concurrency`})}function Zt(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.property,`map`)}function Qt(e){return o(e,`all`)&&Zt(a(e))&&!Xt(e.arguments[1])}function $t(e,t=new WeakSet){if(o(e,`fork`))return e;if(Array.isArray(e)){for(let n of e){let e=$t(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=$t(r,t);if(e)return e}}}function j(e,t,r=new WeakSet){if(i(e)){let r=e.callee.property;if(n(r)&&t.has(r.name))return!0}return Array.isArray(e)?e.some(e=>j(e,t,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&j(n,t,r)))}const en=new Set([`sleep`,`await`,`promise`,`tryPromise`,`fork`,`forkDaemon`,`forkScoped`,`all`,`forEach`,`race`,`raceAll`]),tn=new Set([`modifyEffect`,`modifySomeEffect`,`updateEffect`,`updateAndGetEffect`]);function M(e,t=new WeakSet){if(i(e)){let t=e.callee.property;if(n(t)&&en.has(t.name))return!0}return D(e,`Queue`,`take`)||D(e,`Deferred`,`await`)?!0:Array.isArray(e)?e.some(e=>M(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&M(n,t)))}function N(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&Array.isArray(r.arguments)&&typeof r.callee==`object`&&r.callee!==null&&r.callee.type===`MemberExpression`&&r.callee.computed!==!0&&n(r.callee.property,t)}function nn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Array.isArray(t.arguments)){if(typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`CallExpression`){let e=t.callee;if((N(e,`withPermit`)||N(e,`withPermits`))&&t.arguments.length>0)return t.arguments[0]}if(D(t,`TSemaphore`,`withPermit`)||D(t,`TSemaphore`,`withPermits`))return t.arguments[0];if(N(t,`withPermit`)||N(t,`withPermits`))return t.arguments.at(-1)}}function rn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Array.isArray(t.arguments)){if(typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`CallExpression`){let e=t.callee;if(an(e,`SynchronizedRef`)&&t.arguments.length>0)return e.arguments.at(-1)}if(an(t,`SynchronizedRef`)&&t.arguments.length>1||on(t)&&!sn(t))return t.arguments.at(-1)}}function an(e,t){return[...tn].some(n=>D(e,t,n))}function on(e){return[...tn].some(t=>N(e,t))}function sn(e){return[...tn].some(t=>D(e,`SynchronizedRef`,t))}const cn=new Set([`make`,`unsafeMake`,`makeUnsafe`]),ln=new Set([`timeout`,`timeoutOption`,`timeoutFail`,`timeoutFailCause`,`timeoutTo`]),un=new Set([`race`,`raceFirst`,`raceAll`,`interruptible`,`scoped`]);function dn(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`MemberExpression`&&r.computed!==!0&&n(r.object,`Effect`)&&n(r.property,t)}function fn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(typeof t!=`object`||!t||t.type!==`MemberExpression`)return!1;let r=t;return r.computed!==!0&&n(r.object,`Deferred`)&&n(r.property)&&cn.has(r.property.name)}function pn(e){return D(e,`Deferred`,`await`)&&Array.isArray(e.arguments)}function mn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;if(!(!n(t.id)||!_(t.init,fn)))return t.id.name}function hn(e,t){return!!_(e,e=>{if(!D(e,`Effect`,`addFinalizer`)&&!D(e,`Scope`,`addFinalizer`))return!1;let n=e.arguments;return Array.isArray(n)&&n.some(e=>{let n=R(e);return n!==void 0&&p(n,t)})})}function gn(e){if(!l(e))return!1;let t=e.arguments;return Array.isArray(t)&&t.some(e=>dn(e,`scoped`))}function _n(e,t){let r=typeof e==`object`&&e?e.parent:void 0,a=new WeakSet;for(;typeof r==`object`&&r;){if(a.has(r))return!1;if(a.add(r),i(r)&&(()=>{let e=r.callee.property;return n(e)&&(ln.has(e.name)||un.has(e.name))})()||gn(r)||h(r)&&hn(r,t))return!0;r=r.parent}return!1}const vn=new Set([`acquireRelease`,`acquireUseRelease`,`ensuring`,`forkIn`,`forkScoped`,`scoped`]);function yn(e){return!o(e,`race`)&&!o(e,`raceAll`)?!1:!j(e.arguments,vn)}function bn(e){return o(e,`forEach`)&&!Xt(e.arguments[2])}const xn=new Set([`retry`]);function Sn(e){return(Qt(e)||bn(e))&&j(e.arguments,xn)}function Cn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return[];let t=e.declarations;return Array.isArray(t)?t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)?[t.name]:[]}):[]}function wn(e,t=new Set,n=new WeakSet){if(Array.isArray(e)){for(let r of e)wn(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;if(n.add(e),e.type===`VariableDeclaration`)for(let n of Cn(e))t.add(n);for(let[r,i]of Object.entries(e))r!==`parent`&&wn(i,t,n);return t}const Tn=new Set([`add`,`clear`,`delete`,`pop`,`push`,`reverse`,`set`,`shift`,`sort`,`splice`,`unshift`]);function En(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type===`AssignmentExpression`&&n(t.left))return t.left.name;if(t.type===`UpdateExpression`&&n(t.argument))return t.argument.name;if(t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object)&&n(t.callee.property)&&Tn.has(t.callee.property.name))return t.callee.object.name}function P(e,t,n=wn(e),r=new WeakSet){if(Array.isArray(e)){for(let i of e){let e=P(i,t,n,r);if(e)return e}return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let i=En(e);if(i&&t.has(i)&&!n.has(i))return e;for(let[i,a]of Object.entries(e)){if(i===`parent`)continue;let e=P(a,t,n,r);if(e)return e}}function Dn(e){if(o(e,`fork`)||o(e,`all`)||o(e,`forEach`))return e.arguments}const On=new Set([`fork`,`forkScoped`,`forkDaemon`,`all`,`forEach`,`race`,`raceFirst`,`raceAll`]),kn=new Set([`open`,`connect`,`create`,`start`,`listen`,`subscribe`,`acquire`]),An=new Set([`client`,`connection`,`conn`,`pool`,`db`,`database`,`file`,`socket`,`stream`,`server`,`subscription`,`handle`]),jn=new Set([`close`,`destroy`,`dispose`,`cleanup`]);function Mn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function Nn(e){return Mn(e).some(e=>An.has(e))}function Pn(e){if(n(e))return Nn(e.name);if(!X(e))return!1;let t=e;return t.computed===!0?!1:n(t.property)&&Nn(t.property.name)||Pn(t.object)}function Fn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(typeof t!=`object`||!t||t.type!==`MemberExpression`||t.computed===!0||!n(t.property))return!1;let r=t;return jn.has(r.property.name)&&Pn(r.object)}function In(e){if(!i(e))return;let t=e.callee.property;return n(t)&&On.has(t.name)?e.arguments:void 0}function Ln(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee,r;if(n(t))r=t.name;else if(typeof t==`object`&&t&&t.type===`MemberExpression`){let e=t;e.computed!==!0&&n(e.property)&&(r=e.property.name)}return!r||r===`acquireRelease`||r===`acquireUseRelease`?!1:Mn(r).some(e=>kn.has(e))&&Nn(r)}function Rn(e,t){return o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`scoped`)||gn(e)?!0:t!==void 0&&hn(e,t)}function zn(e){let t=new Set;for(let r of v(e,e=>typeof e==`object`&&!!e&&e.type===`VariableDeclarator`)){let i=r;n(i.id)&&_(i.init,Ln)&&hn(e,i.id.name)&&t.add(i.id.name)}return t}function Bn(e,t,r=new WeakSet,i=new Set,a=!1){if(Array.isArray(e)){for(let n of e)Bn(n,t,r,i,a);return}if(typeof e!=`object`||!e||r.has(e)||(r.add(e),Rn(e)))return;let o=new Set(i);if(h(e))for(let t of zn(e))o.add(t);let s=e.type===`VariableDeclarator`?e:void 0,ee=s&&n(s.id)?s.id.name:void 0,c=ee!==void 0&&o.has(ee);if(Ln(e)&&!a){t.push(e);return}for(let[n,i]of Object.entries(e))n!==`parent`&&Bn(i,t,r,o,a||c)}function Vn(e){let t=[];return Bn(e,t),t}const Hn=new Set([`all`,`forEach`,`fork`,`race`,`raceAll`]);function Un(e,t=new WeakSet){return j(e,Hn)||D(e,`Queue`,`take`)?!0:Array.isArray(e)?e.some(e=>Un(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Un(n,t)))}function Wn(e){return o(e,`uninterruptible`)&&Un(e.arguments[0])}function Gn(e){return D(e,`Queue`,`unbounded`)||D(e,`PubSub`,`unbounded`)}function Kn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`ObjectExpression`||t.type===`ArrayExpression`||t.type===`NewExpression`&&(n(t.callee,`Map`)||n(t.callee,`Set`))||t.type===`CallExpression`&&(n(t.callee,`Map`)||n(t.callee,`Set`))}function qn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return[];let t=e,r=Array.isArray(t.declarations)?t.declarations:[];return t.kind===`let`||t.kind===`var`?Cn(e):r.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)&&Kn(e.init)?[t.name]:[]})}function Jn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;return n(t.id)&&o(t.init,`fork`)?t.id.name:void 0}const Yn=new Set([`await`,`interrupt`,`join`]);function Xn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e,r=t.callee;if(typeof r!=`object`||!r||r.type!==`MemberExpression`||r.computed===!0||!n(r.object,`Fiber`)||!n(r.property)||!Yn.has(r.property.name)||!Array.isArray(t.arguments))return;let[i]=t.arguments;return n(i)?i.name:void 0}function Zn(e){return r(e,`Effect`,`asVoid`)||D(e,`Effect`,`asVoid`)}function Qn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0||!n(t.callee.property,`pipe`)?!1:o(t.callee.object,`all`)&&t.arguments.some(e=>Zn(e))}function F(e){if(typeof e!=`object`||!e||!l(e))return[];let t=e;return n(t.callee,`pipe`)?t.arguments:[t.callee.object,...t.arguments]}function $n(e){let[t]=F(e);return t!==void 0&&m(t)}function er(e){if($n(e))return!0;if(typeof e==`object`&&e&&e.type===`ArrowFunctionExpression`){let t=e.body;return i(t)||$n(t)}return!1}function tr(e){return u(e).some(e=>typeof e==`object`&&!!e&&(er(e.argument)||i(e.argument)))}function I(e,t,r){if(typeof e!=`object`||!e||e.type!==`TSTypeReference`)return!1;let i=e.typeName;return typeof i==`object`&&!!i&&i.type===`TSQualifiedName`&&n(i.left,t)&&n(i.right,r)}function nr(e,t){return typeof e==`object`&&!!e&&e.type===`TSTypeReference`&&n(e.typeName,t)}function rr(e){if(typeof e!=`object`||!e)return[];let t=e.typeParameters??e.typeArguments;if(typeof t!=`object`||!t)return[];let n=t.params??t.arguments;return Array.isArray(n)?n:[]}function ir(e){return n(e,`Error`)||nr(e,`Error`)}function L(e){if(typeof e!=`object`||!e)return;let t=e.returnType;if(!(typeof t!=`object`||!t))return t.typeAnnotation??t}function ar(e,t){return I(L(e),`Effect`,`Effect`)||I(t,`Effect`,`Effect`)}function or(e){if(typeof e!=`object`||!e)return[];let t=e.body;if(typeof t!=`object`||!t)return[];if(t.type!==`BlockStatement`)return[t];let n=(e,t=new WeakSet)=>{if(Array.isArray(e))return e.flatMap(e=>n(e,t));if(typeof e!=`object`||!e||t.has(e))return[];t.add(e);let r=e;return r.type===`ReturnStatement`?[r.argument]:r.type===`ArrowFunctionExpression`||r.type===`FunctionExpression`||r.type===`FunctionDeclaration`?[]:Object.entries(r).flatMap(([e,r])=>e===`parent`?[]:n(r,t))};return n(t)}function sr(e){return or(e).filter(e=>i(e)||$n(e))}function cr(e){return o(e,`withSpan`)||l(e)&&F(e).some(e=>o(e,`withSpan`))}function lr(e,t){if(!ar(e,t))return;let n=sr(e);return n.length===0||n.some(e=>!cr(e))?e:void 0}function ur(e){if(typeof e!=`object`||!e)return;let t=e.typeAnnotation;if(!(typeof t!=`object`||!t))return L(t.typeAnnotation??t)}function dr(e){if(typeof e!=`object`||!e)return[];let t=e;if(t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`)return[];let n=t.declaration;return typeof n!=`object`||!n?[]:n.type===`FunctionDeclaration`?[{functionNode:n}]:n.type===`VariableDeclaration`?(n.declarations??[]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.init;return typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)?[{functionNode:t,declaredReturnType:ur(e.id)}]:[]}):[]}function fr(e){let t=B(e,`effect`)??B(e,`scoped`),n=d(t,`gen`),r=n?or(n).find(Wt):o(t,`succeed`)&&Wt(a(t))?a(t):void 0;if(!r)return[];let i=r.properties;return Array.isArray(i)?i.flatMap(e=>{if(typeof e!=`object`||!e||e.type!==`Property`)return[];let t=e.value;return typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)?[t]:[]}):[]}function pr(e){return sr(e).some(e=>!cr(e))?e:void 0}function mr(e,t){let n=L(e)??t;if(!I(n,`Effect`,`Effect`))return;let[,r]=rr(n);return r===void 0?void 0:{annotation:n,errorChannel:r}}function hr(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`?[]:dr(t).flatMap(({functionNode:e,declaredReturnType:t})=>{let n=mr(e,t);return n?[n]:[]})}function gr(e){return hr(e).find(e=>ir(e.errorChannel))?.annotation}function _r(e){let t=e,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t)||(n.add(t),t.type!==`TSParenthesizedType`))return t;t=t.typeAnnotation}return t}function vr(e){let t=_r(e);if(ir(t))return`Error`;if(!(typeof t!=`object`||!t))switch(t.type){case`TSUnknownKeyword`:return`unknown`;case`TSStringKeyword`:return`string`;case`TSNumberKeyword`:return`number`;case`TSBooleanKeyword`:return`boolean`;default:return}}function yr(e){let t=_r(e);if(typeof t!=`object`||!t||t.type!==`TSUnionType`)return new Set;let n=t.types;return Array.isArray(n)?new Set(n.flatMap(e=>{let t=vr(e);return t?[t]:[]})):new Set}function br(e,t,n,r=new WeakSet){return I(e,t,n)?!0:Array.isArray(e)?e.some(e=>br(e,t,n,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,i])=>e!==`parent`&&br(i,t,n,r)))}function xr(e,t=new WeakSet){return E(e,`wrapGraphqlCall`)?!0:Array.isArray(e)?e.some(e=>xr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&xr(n,t)))}function Sr(e){return o(e,`flatMap`)&&n(a(e),`applyResponse`)}function Cr(e,t=new WeakSet){return Sr(e)?!0:Array.isArray(e)?e.some(e=>Cr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Cr(n,t)))}function wr(e,t=new WeakSet){if(o(e,`catchAll`))return e;if(Array.isArray(e)){for(let n of e){let e=wr(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=wr(r,t);if(e)return e}}}function Tr(e){let t=F(e);if(t.length===0)return;let n=wr(t);if(n)return xr(t)||Cr(t)?n:void 0}const Er=new Set([`get`,`set`,`update`,`modify`,`refresh`]);function R(e){if(typeof e!=`object`||!e)return;let t=e;if(!(t.type!==`ArrowFunctionExpression`&&t.type!==`FunctionExpression`))return t.body}function Dr(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`CallExpression`||!Array.isArray(t.arguments)||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0)return!1;let r=t.callee;return(n(r.object,`Atom`)||n(r.object,`atomRegistry`))&&n(r.property)&&Er.has(r.property.name)}function Or(e,t=new WeakSet){if(Dr(e))return e;if(Array.isArray(e)){for(let n of e){let e=Or(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Or(r,t);if(e)return e}}}function kr(e){if(!o(e,`sync`))return;let t=R(a(e));return t?Or(t):void 0}function Ar(e){return n(e)?/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name):!1}function jr(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CallExpression`||!Array.isArray(t.arguments)||!(n(t.callee,`get`)||r(t.callee,`Atom`,`get`)||r(t.callee,`get`,`get`)))return;let[i]=t.arguments;return Ar(i)?i:void 0}function Mr(e,t=new WeakSet){let n=jr(e);if(n)return n;if(Array.isArray(e)){for(let n of e){let e=Mr(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Mr(r,t);if(e)return e}}}function Nr(e){return o(e,`provide`)&&e.arguments.length===1}function Pr(e){if(l(e))return F(e).find(e=>Nr(e))}function Fr(e,t=new WeakSet){return typeof e==`object`&&e&&e.type===`SpreadElement`?!0:Array.isArray(e)?e.some(e=>Fr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Fr(n,t)))}function Ir(e){if(!D(e,`Ref`,`update`)&&!D(e,`Ref`,`modify`))return!1;let t=e.arguments[1];return Fr(R(t))}function Lr(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`&&Array.isArray(e.properties)&&e.properties.length===0}function Rr(e,t=new WeakSet){return D(e,`Object`,`entries`)?!0:Array.isArray(e)?e.some(e=>Rr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Rr(n,t)))}function zr(e){if(Ir(e))return!0;if(D(e,`Object`,`assign`)){let t=e.arguments;return t.length>=3&&Lr(t[0])}return D(e,`Object`,`fromEntries`)?Rr(e.arguments[0]):D(e,`JSON`,`stringify`)||D(e,`JSON`,`parse`)}function Br(e){return n(e)?!0:typeof e==`object`&&!!e&&e.type===`MemberExpression`}function Vr(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e.init;return typeof t==`object`&&!!t&&t.type===`TSAsExpression`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null&&t.typeAnnotation.type!==`TSConstKeyword`})??!1}function Hr(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;if(t.operator!==`===`)return!1;let n=t.left,r=t.right;return typeof n==`object`&&!!n&&n.type===`UnaryExpression`&&n.operator===`typeof`&&typeof r==`object`&&!!r&&(r.type===`Literal`||r.type===`StringLiteral`)&&r.value===`boolean`}function Ur(e){return H(e,`orElse`)&&Yi(U(e.arguments[0]))}function z(e){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`StringLiteral`)&&typeof e.value==`string`}function Wr(e){return n(e,`undefined`)}function Gr(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&e.operator===`??`&&(Yi(e.right)||Wr(e.right))}function Kr(e){return D(e,`Option`,`fromNullable`)&&Gr(e.arguments[0])}function B(e,t){if(!(typeof e!=`object`||!e||e.type!==`ObjectExpression`))for(let r of e.properties??[]){if(typeof r!=`object`||!r)continue;let e=r.key;if(n(e,t))return r.value}}function qr(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return t.operator===`===`&&(V(t.left,!0)||V(t.right,!0))}function Jr(e){if(!D(e,`Option`,`match`))return!1;let t=e.arguments[1],n=B(t,`onSome`),r=B(t,`onNone`);return qr(U(n))&&V(U(r),!1)}function Yr(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>typeof e==`object`&&!!e&&z(e.init))??!1}function V(e,t){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`BooleanLiteral`)&&e.value===t}function Xr(e){return r(e,`Effect`,`void`)}function H(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&Array.isArray(r.arguments)&&typeof r.callee==`object`&&r.callee!==null&&r.callee.type===`MemberExpression`&&r.callee.computed!==!0&&n(r.callee.object,`Match`)&&n(r.callee.property)&&(t===void 0||n(r.callee.property,t))}function U(e){if(!(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`))return e.body}function Zr(e){if(!H(e))return!1;let[t,r]=e.arguments;return n(e.callee.property,`when`)?(V(t,!0)||V(t,!1))&&Xr(U(r)):n(e.callee.property,`orElse`)&&Xr(U(t))}const Qr=[`flatMap`,`map`,`andThen`,`tap`,`zipRight`];function $r(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`Stream`)&&n(t.callee.property)}function ei(e,t=new WeakSet){return Qr.some(t=>o(e,t))||l(e)||$r(e)?!0:Array.isArray(e)?e.some(e=>ei(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ei(n,t)))}function ti(e){return m(e)&&ei(e)}function ni(e,t=new WeakSet){return H(e)&&ti(n(e.callee.property,`when`)?U(e.arguments[1]):U(e.arguments[0]))?!0:Array.isArray(e)?e.some(e=>ni(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ni(n,t)))}function ri(e,t=new WeakSet){return H(e)?!0:Array.isArray(e)?e.some(e=>ri(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ri(n,t)))}function ii(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&r(e.callee,`Option`,`match`)}function ai(e){let t=U(e);return typeof t==`object`&&!!t&&t.type===`CallExpression`}function oi(e,t=new WeakSet){if(o(e,`gen`))return e;if(Array.isArray(e)){for(let n of e){let e=oi(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=oi(r,t);if(e)return e}}}function si(e){if(!l(e)||typeof e!=`object`||!e)return!1;let t=e.callee.object;return typeof t==`object`&&!!t&&t.type===`CallExpression`&&r(t.callee,`Match`,`value`)}function ci(e){return si(e)||typeof e==`object`&&!!e&&e.type===`CallExpression`&&(r(e.callee,`Option`,`match`)||r(e.callee,`Either`,`match`))}function li(e,t=new WeakSet){return ci(e)?!0:Array.isArray(e)?e.some(e=>li(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&li(n,t)))}function ui(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?[]:t.properties.map(e=>typeof e==`object`&&e?e.value:void 0).filter(e=>e!==void 0)}function di(e){if(typeof e!=`object`||!e||e.type!==`TSTypeAliasDeclaration`)return!1;let t=e.id,r=e.typeAnnotation;return n(t)&&/(?:Id|ID)$/.test(t.name)&&(r?.type===`TSStringKeyword`||r?.type===`TSNumberKeyword`)}function fi(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`TSBooleanKeyword`?!0:t.type===`TSTypeAnnotation`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null&&t.typeAnnotation.type===`TSBooleanKeyword`}function pi(e){if(typeof e!=`object`||!e)return;let t=e;return t.type===`TSTypeAnnotation`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null?t.typeAnnotation:t}function mi(e){let t=pi(e);return t?.type===`TSStringKeyword`||t?.type===`TSNumberKeyword`}function hi(e){let t=pi(e);return t?.type===`TSAnyKeyword`||t?.type===`TSObjectKeyword`}function gi(e){let t=pi(e);return t?.type===`TSTypeReference`&&n(t.typeName,`Date`)}function _i(e){if(typeof e!=`object`||!e||!Array.isArray(e.params))return[];let t=/(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;return e.params.filter(e=>n(e)&&mi(e.typeAnnotation)&&t.test(e.name))}function vi(e){return _i(e).length>=3}function yi(e){return n(e)?/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&fi(e.typeAnnotation):!1}function bi(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(yi)}function xi(e){if(n(e))return e.name;if(typeof e==`object`&&e&&typeof e.value==`string`)return e.value}function Si(e){return/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(e)}function Ci(e){if(typeof e!=`object`||!e||e.type!==`TSPropertySignature`)return!1;let t=e,n=xi(t.key),r=t.typeAnnotation;return n!==void 0&&Si(n)&&(mi(r)||gi(r))}function wi(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type===`TSInterfaceDeclaration`&&typeof t.body==`object`&&t.body!==null&&Array.isArray(t.body.body)?t.body.body:t.type===`TSTypeLiteral`&&Array.isArray(t.members)?t.members:[]}function Ti(e){return wi(e).filter(Ci)}function Ei(e){return n(e)?/^(?:opts|options|config)$/i.test(e.name)&&hi(e.typeAnnotation):!1}function Di(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(Ei)}const Oi=new Set([`==`,`===`,`!=`,`!==`,`>`,`>=`,`<`,`<=`]);function W(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+W(n,t),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=e;return n.type===`BinaryExpression`&&Oi.has(String(n.operator))?1:n.type===`LogicalExpression`?W(n.left,t)+W(n.right,t):0}function ki(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&W(e)>=3}function Ai(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return;let t=e;if(t.computed===!0||!n(t.object)||!n(t.property))return;let r=t.property.name;if(/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(r))return{objectName:t.object.name,propertyName:r}}function ji(e,t=new Map,n=new WeakSet){let r=Ai(e);if(r){let e=t.get(r.objectName)??new Set;return e.add(r.propertyName),t.set(r.objectName,e),t}if(Array.isArray(e)){for(let r of e)ji(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;n.add(e);let i=e;return i.type===`LogicalExpression`?(ji(i.left,t,n),ji(i.right,t,n),t):t}function Mi(e){return typeof e!=`object`||!e||e.type!==`LogicalExpression`?!1:Array.from(ji(e).values()).some(e=>e.size>=2)}function Ni(e){return o(e,`fail`)&&z(a(e))}function Pi(e){return n(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Fi(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return!1;let t=e;return t.computed!==!0&&n(t.property,`message`)&&Pi(t.object)}function Ii(e){if(Fi(e))return!0;if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`BinaryExpression`&&t.operator===`+`?Ii(t.left)||Ii(t.right):t.type===`TemplateLiteral`&&Array.isArray(t.expressions)&&t.expressions.some(e=>Ii(e))}function Li(e){return o(e,`fail`)&&Ii(a(e))}function Ri(e){return typeof e==`object`&&!!e&&e.type===`NewExpression`&&n(e.callee,`Error`)}function zi(e){return o(e,`fail`)&&Ri(a(e))}function Bi(e,t){if(!i(e))return[];let r=e.callee.property;return!n(r)||!t.has(r.name)?[]:e.arguments.filter(h)}function Vi(e){for(let t of Bi(e,new Set([`catchAll`]))){let e=R(t);if(zi(e))return e;for(let t of u(e))if(zi(t.argument))return t.argument}}const Hi=new Set([`catchSome`,`catchTag`,`catchTags`,`fail`,`mapBoth`,`mapError`]);function Ui(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Hi.has(t.name)}function Wi(e){for(let t of Bi(e,new Set([`catchAll`,`tapError`]))){let e=R(t),n=_(e,Jt);if(n&&!_(e,Ui))return n}}function Gi(e){if(typeof e!=`object`||!e||e.type!==`ThrowStatement`)return!1;let t=e.argument;return typeof t==`object`&&!!t&&t.type===`NewExpression`&&n(t.callee,`Error`)&&Array.isArray(t.arguments)&&z(t.arguments[0])}function Ki(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?!1:e.params.some(e=>n(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&mi(e.typeAnnotation))}function qi(e){if(typeof e!=`object`||!e||e.type!==`FunctionDeclaration`)return!1;let t=e.id;return n(t)&&/(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(t.name)&&Ki(e)}function Ji(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return[`==`,`===`,`!=`,`!==`].includes(String(t.operator))&&(z(t.left)||z(t.right))&&!Hr(t)}function G(e,t,n){e.report({message:n,node:t})}function Yi(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`NullLiteral`||t.type===`Literal`&&t.value===null}function K(e){if(typeof e!=`object`||!e)return;let t=e.source;if(typeof t==`string`)return t;if(typeof t==`object`&&t){let e=t.value;if(typeof e==`string`)return e}}const Xi=[`bin/**`,`scripts/**`,`cli/**`,`**/main.ts`,`app/api/**/route.ts`,`server/**`,`*.test.ts`,`*.spec.ts`],Zi=[`**/*.test.*`,`**/*.spec.*`,`**/__tests__/**`],Qi=[`**/config/**`,`**/*Config.ts`,`**/*ConfigLayer.ts`],q=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}],$i=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}},configPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}];function ea(e){let t=e.options[0];return typeof t==`object`&&t?t:{}}function ta(e,t){let n=e[t];return Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:void 0}function na(e){return e.replace(/\\/g,`/`).replace(/^\.\/+/,``).replace(/\/{2,}/g,`/`).replace(/\/$/,``)}function ra(e){return e.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`[^/]*`)}function ia(e){let t=na(e);if(t===`**`)return/^.*$/;let n=t.split(`/`),r=n[0]===`**`,i=+!!r,a=r?`(?:.*/)?`:`(?:^|.*/)`;for(let e=i;e<n.length;e+=1){let t=n[e],r=e===n.length-1;if(t===`**`){a+=r?`(?:/.*)?`:`(?:/[^/]+)*`;continue}e>i&&(a+=`/`),a+=ra(t)}return RegExp(`${a}$`)}function aa(e,t){return ia(t).test(na(e))}function oa(e){return ta(ea(e),`boundaryPaths`)??Xi}function J(e){return oa(e).some(t=>aa(e.filename,t))}function sa(e){return Zi.some(t=>aa(e.filename,t))}function ca(e){return ta(ea(e),`configPaths`)??Qi}function la(e){return ca(e).some(t=>aa(e.filename,t))}function Y(e){return e===`effect`||e.startsWith(`effect/`)||e===`@effect-atom/atom-react`}function ua(e){if(!E(e,`it`)&&!E(e,`test`)&&!E(e,`specify`)&&!E(e,`bench`))return;let t=e.arguments?.at(-1);return h(t)?t:void 0}function da(e){let t=e.body;if(!o(t,`runPromise`)&&!(typeof t!=`object`||!t||t.type!==`BlockStatement`||!Array.isArray(t.body))){for(let e of t.body)if(typeof e==`object`&&e&&e.type===`ExpressionStatement`&&o(e.expression,`runPromise`))return e.expression}}function fa(e,t){let n=[],r=new WeakSet;function i(e,a=!1){if(Array.isArray(e)){for(let t of e)i(t);return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let o=e;if(!(!a&&h(o))){t(o)&&n.push(o);for(let[e,t]of Object.entries(o))e!==`parent`&&i(t)}}return i(e,!0),n}function pa(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`||e.computed===!0||!n(e.property,`rejects`))return!1;let t=e.object;if(!E(t,`expect`))return!1;let r=t.arguments;if(!Array.isArray(r))return!1;let i=r[0];return o(i,`runPromise`)}function ma(e){return typeof e==`object`&&!!e&&e.type===`MemberExpression`&&e.computed!==!0&&n(e.property,`Default`)}function ha(e){return D(e,`Layer`,`succeed`)||D(e,`Layer`,`effect`)}function ga(e){if(!D(e,`Layer`,`provide`))return[];let t=e.arguments;return!Array.isArray(t)||!t.some(ma)?[]:t.filter(ha)}function _a(e){let t=K(e);if(t===`effect/Schema`)return!0;if(t!==`effect`||typeof e!=`object`||!e)return!1;let r=e.specifiers;return Array.isArray(r)&&r.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`ImportSpecifier`&&n(t.imported,`Schema`)})}function va(e,n){return t({create(t){let r=!1;return{ImportDeclaration(e){let t=K(e);t&&Y(t)&&(r=!0)},[e](e){r&&G(t,e,n)}}}})}const ya=new Set([`useState`,`useReducer`,`useContext`,`useCallback`,`useEffect`,`useSyncExternalStore`]),ba=t({create(e){return{CallExpression(t){let r=t.callee,i=n(r)?r.name:typeof r==`object`&&r&&r.type===`MemberExpression`&&n(r.property)?r.property.name:void 0;i&&ya.has(i)&&G(e,r,`Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.`)}}}}),xa=va(`IfStatement`,`Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead.`),Sa=va(`SwitchStatement`,`Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.`),Ca=va(`ConditionalExpression`,`Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/Either.match/Match.value or data combinators, then run one Effect pipeline.`),wa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ReturnStatement(n){t&&Yi(n.argument)&&G(e,n,`Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.`)}}}}),Ta=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&r(n.callee,`Option`,`as`)&&G(e,n,`Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly.`)}}}}),Ea=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},MemberExpression(n){t&&r(n,`Effect`,`never`)&&G(e,n,`Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.`)}}}}),Da=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t||!ae(n))return;let r=se(n.callee.body);r&&G(e,r,`Rule: avoid nested IIFEs. Why: they hide sequencing and push wrapper hacks. Fix: bind a named context with const and keep one flat pipeline with a single Match/Option decision.`)}}}}),Oa=t({create(e){return{ObjectExpression(t){ui(t).some(e=>li(e))&&G(e,t,`Rule: avoid Match/Option/Either inside object literals. Why: it hides the decision and invites workaround scaffolding. Fix: compute the value first (context), then build the object from named values with one flat decision.`)}}}}),ka=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&oe(n)&&G(e,n,`Rule: avoid immediate invocation of inline functions. Why: it hides decisions and sequencing. Fix: bind a named context with const and keep one Match/Option decision in a flat pipeline.`)}}}}),Aa=t({create(e){return{CallExpression(t){for(let n of le(t))G(e,n,`Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).`)}}}}),ja=t({create(e){return{CallExpression(t){for(let n of ue(t))G(e,n,`Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.`)}}}}),Ma=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&fe(n,`fn`)&&G(e,n,`Rule: avoid Effect.fn generator wrappers. Why: they hide sequencing and dodge ladder rules. Fix: keep a single flat pipeline or use one Effect.gen.`)}}}}),Na=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&o(n,`sync`)&&O(a(n))&&G(e,n,`Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.`)}}}}),Pa=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Bt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){i(e)},ClassDeclaration(e){i(e)},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.`)}}}}),Fa=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Kt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){for(let t of qt(e))i(t)},ClassDeclaration(e){let t=g(e);t&&i(B(t,`effect`)??B(t,`scoped`))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: add structured context to Effect.logError or Effect.logWarning. Why: static failure messages cannot be correlated. Fix: include an error or context object, or use Effect.annotateLogs(...).`)}}}}),Ia=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{typeof e==`object`&&e&&!r.has(e)&&(r.add(e),n.push(e))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExportNamedDeclaration(e){for(let t of dr(e))i(lr(t.functionNode,t.declaredReturnType))},ExportDefaultDeclaration(e){for(let t of dr(e))i(lr(t.functionNode,t.declaredReturnType))},ClassDeclaration(e){let t=g(e);if(t)for(let e of fr(t))i(pr(e))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).`)}}}}),La=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(t){if(!sa(e))return;let r=ua(t),i=r&&da(r);i&&n.push(i)},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: do not discard Effect.runPromise in a test body. Why: the test can finish before the Effect result is observed. Fix: await or return Effect.runPromise so the test framework observes completion.`)}}}}),Ra=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(t){if(!sa(e))return;let r=ua(t);r&&n.push(...fa(r,pa))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.`)}}}}),za=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(t){sa(e)&&n.push(...ga(t))},"Program:exit"(){if(t)for(let t of n)G(e,t,`Rule: avoid a manual test layer beside an explicit service Default layer. Why: the test is already opting into the service's real default composition and the sibling mock can hide that contract. Fix: use the Default layer with its required infrastructure, or remove Default when a replacement is intentional.`)}}}}),Ba=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=d(n,`gen`);if(!t||!r)return;let i=oi(r.body);i&&G(e,i,`Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline.`)}}}}),Va=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ve(n);r&&G(e,r,"Rule: use yield* inside Effect.gen. Why: plain yield returns an Effect value without delegating to the Effect interpreter. Fix: replace `yield Effect.x` with `yield* Effect.x`.")}}}}),Ha=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=be(n);r&&G(e,r,`Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps.`)}}}}),Ua=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ce(n);r&&G(e,r,`Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation.`)}}}}),Wa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=De(n);r&&G(e,r,`Rule: prefer Effect.gen for workflow sequencing. Why: long flatMap/andThen/tap pipelines read like imperative workflow. Fix: move the sequential story into one Effect.gen and keep pipe for behavior decoration.`)}}}}),Ga=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&ke(n)&&G(e,n,`Rule: avoid large anonymous flow expressions. Why: long pure transformation chains need a domain name. Fix: extract a named flow or split the transformation into named pure steps.`)}}}}),Ka=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Me(n);r&&G(e,r,`Rule: avoid Effect work inside flow. Why: flow should stay a reusable pure transformation boundary. Fix: keep Effect sequencing, logging, retries, and dependency access in Effect pipelines.`)}}}}),qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ne(n);r&&G(e,r,`Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const.`)}}}}),Ja=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Le(n);r&&G(e,r,"Rule: prefer .pipe() for behavior decoration. Why: retry, timeout, spans, logging, recovery, DI, and value transforms decorate an existing effect. Fix: write `program.pipe(Effect.retry(policy))` instead of `Effect.retry(program, policy)`.")}}}}),Ya=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Be(n);r&&G(e,r,`Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story.`)}}}}),Xa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ve(n);r&&G(e,r,`Rule: avoid workflow sequencing inside behavior pipes. Why: behavior pipes should answer how an effect behaves, not hide the workflow story. Fix: move multi-step sequencing into Effect.gen and keep retry/timeout/spans/logging as decorators around named effects.`)}}}}),Za=t({create(e){let t=!1;function n(n){let r=Ue(n);t&&r&&G(e,r,`Rule: avoid mixing Effect style pillars in one function. Why: workflow, pure transformation, behavior decoration, and Layer wiring each need a clear boundary. Fix: extract named concepts for each pillar and compose them at the call site.`)}return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=Ge(n);t&&r&&G(e,r,`Rule: avoid clever Effect expressions. Why: deeply nested expressions that combine style pillars hide the domain story. Fix: extract named workflow, pure transformation, and behavior steps.`)}}}}),$a=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=Ke(n);t&&r&&G(e,r,`Rule: prefer extracting named concepts from oversized anonymous callbacks. Why: multi-step inline callbacks hide domain intent. Fix: name the transformation, policy, or workflow step before passing it into Effect.`)}}}}),eo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Ye(n)&&G(e,n,`Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.`)}}}}),to=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=g(n);t&&r&&Xe(r)&&G(e,r,`Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.`)}}}}),no=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=g(n);t&&r&&!Ze(r)&&G(e,r,`Rule: set accessors: true. Fix: add it to Effect.Service options.`)}}}}),ro=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=g(n),i=r?et(r):void 0;t&&i&&G(e,i,`Rule: declare service dependencies.`)}}}}),io=t({create(e){return{ImportDeclaration(t){let n=Qe(t);n&&G(e,n,`Rule: avoid namespace imports from Effect packages.`)}}}}),ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?mt(n):void 0;r&&G(e,r,`Rule: avoid exported manual service objects.`)}}}}),oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?it(n):void 0;r&&G(e,r,`Rule: prefer Layer.pipe for nested layer provisioning.`)}}}}),so=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?ot(n):void 0;r&&G(e,r,`Rule: avoid inline layer provisioning inside programs.`)}}}}),co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?st(n):void 0;r&&G(e,r,`Rule: prefer Layer.mergeAll for infrastructure layer groups.`)}}}}),lo=t({create(e){let t=!1,n=0;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(r){let i=t?lt(r):void 0;i&&(n+=1,n>=3&&G(e,i,`Rule: group service layers by concern.`))}}}}),uo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration(n){let r=rt(n);t&&r&&G(e,r,`Rule: avoid Layer composition inside request handlers.`)}}}}),fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ClassDeclaration(n){let r=g(n),i=r?ft(r):void 0;t&&i&&G(e,i,`Rule: return Effect from service methods.`)}}}}),po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Zr(n)&&G(e,n,`Rule: avoid void Match branches. Why: they hide guard-style control flow. Fix: remove the no-op branch or select a value and run one Effect pipeline outside the Match.`)}}}}),mo=t({create(e){return{CallExpression(t){si(t)&&ni(t.arguments)&&G(e,t,`Rule: avoid multi-step sequencing inside Match branches. Why: it hides control flow. Fix: select a value in Match, then run one Effect pipeline outside. Avoid data-encoded conditionals (Option.toArray/forEach) that only rewrap the branch.`),ii(t)&&ti(t.arguments)&&G(e,t,`Rule: avoid multi-step sequencing inside Option.match branches. Why: it hides control flow. Prefer selecting a value in Option.match, then run one Effect pipeline outside. Leaf-level flows with local bindings may keep Option.match but should stay linear.`)}}}}),ho=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=a(n),i=U(r);t&&o(n,`sync`)&&ai(r)&&!T(i)&&G(e,n,`Rule: avoid Effect.sync around side effects. Why: it hides intent. Fix: use Effect.log* or an explicit pipeline step for the side effect.`)}}}}),go=t({create(e){return{CallExpression(t){o(t,`as`)&&k(a(t))&&G(e,t,`Rule: avoid Effect.as for side effects. Why: it hides side effects and turns them into placeholders. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`),o(t,`zipRight`)&&k(a(t))&&G(e,t,`Rule: avoid Effect.zipRight for side effects. Why: it hides side effects and discards values. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`)}}}}),_o=t({create(e){return{CallExpression(t){o(t,`all`)&&A(t.arguments[0])&&Yt(t.arguments[1])&&G(e,t,`Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.`),Qn(t)&&A(a(t.callee.object))&&G(e,t,`Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.`)}}}}),vo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=gt(n);r&&G(e,r,`Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: return an Effect and compose with Effect.flatMap/fromPromise at the boundary.`)}}}}),yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=_t(n);r&&G(e,r,`Rule: avoid throw inside Effect logic. Why: thrown exceptions bypass typed Effect error channels and interruption semantics. Fix: return Effect.fail with a structured tagged error.`)}}}}),bo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ft(n);r&&G(e,r,`Rule: avoid Effect.orDie outside runtime boundaries. Why: converting typed failures into defects hides recoverable domain errors. Fix: keep typed errors in domain logic and reserve orDie/orDieWith for explicit application boundaries.`)}}}}),xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Lt(n);r&&G(e,r,`Rule: avoid swallowing errors in catchAll. Why: succeed/void recovery can hide failures without telemetry or typed recovery. Fix: log, re-fail with a structured error, or recover through an explicit domain branch.`)}}}}),So=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Li(n)&&G(e,n,`Rule: preserve structured errors instead of strings. Why: converting error.message to a string loses the original tag, cause, and context. Fix: fail with the error or map it to a structured Data.TaggedError.`)}}}}),Co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Vi(n);r&&G(e,r,`Rule: do not rethrow generic Error from catchAll. Why: catchAll should preserve or model the original failure instead of erasing its domain type. Fix: use mapError, catchTag, or Effect.fail with a structured tagged error and cause.`)}}}}),wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Wi(n);r&&G(e,r,`Rule: do not stop at logging an Effect error. Why: logs alone do not preserve a typed failure or define recovery ownership. Fix: map or re-fail with a structured domain error after adding observability.`)}}}}),To=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=zt(n);r&&G(e,r,`Rule: avoid Effect.ignore. Why: ignoring failable effects hides failure ownership. Fix: handle the error with typed recovery, log and re-fail, or isolate the ignore at an explicit boundary with a documented reason.`)}}}}),Eo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=vt(n);r&&G(e,r,`Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.catchAll, Effect.catchTag, or typed error combinators.`)}}}}),Do=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=xt(n);r&&G(e,r,`Rule: avoid Promise APIs inside Effect logic. Why: Promise APIs bypass Effect scheduling, typed errors, cancellation, and tracing. Fix: use Effect.all, Effect.tryPromise, or move Promise interop to a boundary adapter.`)}}}}),Oo=t({create(e){return{TryStatement(t){G(e,t,`Rule: avoid try/catch in Effect files. Why: it bypasses Effect error channels and reintroduces imperative control flow. Fix: model failures in Effect and handle them with typed errors and Effect combinators.`)}}}}),ko=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])er(n.init)&&G(e,t,"Rule: avoid Effect wrapper aliases (`const x = ...Effect...`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")},FunctionDeclaration(t){tr(t.body)&&G(e,t,"Rule: avoid Effect wrapper aliases (`function x(...) { return Effect... }`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")}}}}),Ao=t({create(e){return{TSTypeReference(t){(I(t,`Effect`,`Effect`)||I(t,`Layer`,`Layer`))&&G(e,t,"Rule: avoid manual Effect channel tuples (`Effect.Effect<...>` / `Layer.Layer<...>`). Why: channels compose through the Effect pipeline and services; hand-written tuples desync from the real flow. Fix: drop the generic and let the return type infer from the Effect/Layer you return, or expose a service method that returns the effect directly.")}}}}),jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?Tr(n):void 0;r&&G(e,r,`Rule: avoid catchAll after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of catchAll.`)}}}}),Mo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExpressionStatement(n){t&&si(n.expression)&&ri(n.expression.arguments)&&G(e,n.expression,`Rule: avoid Match.value(...).pipe(...) as a statement. Why: it runs side effects during render. Fix: move the side effect into an Effect runtime action or event handler, and keep Match as a pure expression.`)}}}}),No=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?kr(n):void 0;r&&G(e,r,`Rule: do not wrap Atom/atomRegistry ops in Effect.sync. Why: it hides side effects and breaks atom flow. Fix: call Atom.get/Atom.set/Atom.update/Atom.modify/Atom.refresh directly.`)}}}}),Po=t({create(e){return{CallExpression(t){if(!D(t,`Atom`,`family`))return;let n=Mr(t.arguments);n&&G(e,n,`Keyed projection atom reads collection atom. Why: Atom.family should project from keyed/source atoms, not broad collection state. Fix: pass the keyed atom into the family or create a keyed source atom before reading.`)}}}}),Fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){let r=t?Pr(n):void 0;r&&G(e,r,"Rule: do not inline runtime provisioning inside local helper Effect code. Why: `yield* SomeRuntime.pipe(Effect.provide(SomeRuntimeLive))` and equivalent inline provide chains hide dependency assembly instead of owning it at an Effect.Service boundary or one exported Effect boundary. Fix: declare the live dependency on the owning service or provide it once at the exported boundary, then `yield*` the runtime or service directly inside the body.")}}}}),Io=t({create(e){return{CallExpression(t){zr(t)&&G(e,t,"Rule: avoid naked JS state patching/rebuild and raw JSON shortcuts in Effect transitions. Why: spread/Object.assign/fromEntries and inline JSON parse/stringify hide state intent and bypass explicit model contracts. Fix: use `effect/Record` combinators (`Record.set` / `Record.modify` / `Record.remove`) inside `Struct.evolve`, rebuild with schema constructors (`Schema.make` or field `.make`), and keep serialization at boundaries with schema encode/decode flows. Use `linting.md` guidance when available.")}}}}),Lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&o(n,`succeed`)&&Br(a(n))&&G(e,n,`Rule: avoid Effect.succeed(variable) as a branch placeholder. Why: it hides a decision and turns data into pseudo-control flow. Fix: select a plain value (Option/Match) and then run one Effect pipeline after the decision; if you already read the state, return it as a value. Avoid Option.toArray/forEach hacks that just re-encode the branch.`)}}}}),Ro=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&br(n.typeAnnotation,`Effect`,`Effect`)&&G(e,n.typeAnnotation,`Rule: avoid Effect.Effect type aliases. Why: they hide the service surface and make types opaque. Fix: keep Effect types on service methods or inline at the call site.`)}}}}),zo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?gr(n):void 0;r&&G(e,r,`Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.`)},ExportDefaultDeclaration(n){let r=t?gr(n):void 0;r&&G(e,r,`Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.`)}}}});function Bo(e,t,n){let r=!1,i=i=>{if(r)for(let r of hr(i))t(r)&&G(e,r.annotation,n)};return{ImportDeclaration(e){let t=K(e);t&&Y(t)&&(r=!0)},ExportNamedDeclaration:i,ExportDefaultDeclaration:i}}const Vo=t({create(e){return Bo(e,({errorChannel:e})=>ir(e),`Rule: model public errors as tagged Effect failures, not generic Error. Why: Error hides recovery semantics and domain context. Fix: return a domain-specific Data.TaggedError or tagged error union.`)}}),Ho=t({create(e){return Bo(e,({errorChannel:e})=>vr(e)===`unknown`,`Rule: do not expose unknown as a public Effect error channel. Why: callers cannot recover by tag or type. Fix: return a tagged domain error union with operation-specific context.`)}}),Uo=t({create(e){return Bo(e,({errorChannel:e})=>yr(e).size>1,`Rule: keep the public Effect error channel structurally consistent. Why: mixing Error, primitives, and unknown makes recovery ambiguous. Fix: map failures to one tagged error union.`)}}),Wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(n){t&&Vr(n)&&G(e,n,"Rule: avoid `as` assertions on decoded model flow. Why: assertions hide schema drift and allow untyped overlays. Fix: decode with the correct schema type and read fields directly.")}}}}),Go=t({create(e){let t=!1,n=!1,r=[],i=new WeakSet,a=t=>{typeof t!=`object`||!t||i.has(t)||(i.add(t),G(e,t,`Rule: avoid local unknown-to-boolean coercion helpers in services. Why: runtime coercion belongs at schema boundary, not in service flow. Fix: decode boolean optionality in schema and read typed booleans in the Effect pipeline.`))};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},BinaryExpression(e){!t||!Hr(e)||(n?a(e):r.push(e))},CallExpression(e){if(!(!t||!Ur(e))){n=!0;for(let e of r)a(e)}}}}}),Ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Kr(n)&&G(e,n,"Rule: avoid nullish re-wrap inside Option.fromNullable. Why: `x ?? null` and `x ?? undefined` add noise and hide source shape. Fix: pass the source directly to Option.fromNullable.")}}}}),qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Jr(n)&&G(e,n,"Rule: avoid repeated Option boolean normalization (`onSome: value === true, onNone: false`). Why: it scatters coercion rules across services. Fix: normalize once at schema boundary and read booleans directly.")}}}}),Jo=t({create(e){return{CallExpression(t){o(t,`succeed`)&&z(a(t))&&G(e,t,`Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/Either/tagged unions) or real Effect results instead.`)}}}}),Yo=t({create(e){return{VariableDeclaration(t){Yr(t)&&G(e,t,`Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/Either, or meaningful domain values instead of string tokens.`)}}}}),Xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&di(n)&&G(e,n,"Rule: avoid raw primitive domain ID aliases. Why: `type UserId = string` does not protect boundaries from swapped IDs. Fix: use Schema branded IDs or a domain constructor that validates and brands the value.")}}}}),Zo=t({create(e){let t=!1,n=n=>{if(t)for(let t of bi(n))G(e,t,"Rule: avoid boolean behavior flags in domain operations. Why: flags like `shouldNotify` hide use cases and create implicit branching. Fix: model intent with a command/tagged union or split the operation into explicit functions.")};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},BinaryExpression(n){t&&Ji(n)&&G(e,n,`Rule: avoid magic domain string comparisons. Why: comparing domain state to raw strings scatters status vocabulary and misses exhaustiveness. Fix: use a tagged union, Schema literal union, or Match over a named domain status.`)}}}}),$o=t({create(e){let t=!1,n=n=>{t&&vi(n)&&G(e,n,`Rule: avoid primitive-heavy domain parameters. Why: clusters of raw string/number domain values are easy to swap and have no invariant boundary. Fix: introduce branded types or a command/schema object with named validated fields.`)};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),es=t({create(e){let t=!1,n=n=>{if(t)for(let t of Ti(n))G(e,t,`Rule: avoid raw time fields in domain models. Why: number and Date fields hide units, clock ownership, and duration semantics. Fix: model durations with Effect Duration and keep raw timestamps at decode/encode boundaries.`)};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),ts=new Set([`fs`,`node:fs`,`fs/promises`,`node:fs/promises`]),ns=new Set(`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib`.split(`.`));function rs(e){return e.startsWith(`node:`)||ns.has(e)}function X(e){return typeof e==`object`&&!!e&&(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)}function is(e,t){return e.computed!==!0&&n(e.property,t)||e.computed===!0&&z(e.property)&&e.property.value===t}function as(e){return X(e)&&n(e.object,`process`)&&is(e,`env`)}function os(e){if(!X(e))return!1;if(as(e.object))return!0;if(!as(e))return!1;let t=e.parent;return!X(t)||t.object!==e}function ss(e){if(!X(e)||typeof e.parent!=`object`||e.parent===null)return!1;let t=e.parent;return t.type===`AssignmentExpression`&&t.left===e}const cs=t({meta:{schema:q},create(e){return{ImportDeclaration(t){let n=K(t);n&&rs(n)&&!J(e)&&G(e,t,`Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.`)}}}}),ls=t({meta:{schema:$i},create(e){return{MemberExpression(t){os(t)&&!ss(t)&&!J(e)&&!la(e)&&G(e,t,`Rule: avoid direct process.env reads outside configuration boundaries. Why: ambient configuration leaks runtime coupling into domain code. Fix: decode environment values in a configured Config service or Layer and depend on that service.`)}}}});function us(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`||!n(e.callee,`require`))return;let t=e.arguments?.[0];if(!z(t))return;let r=t.value;return ts.has(r)?r:void 0}const ds=t({create(e){let t=!1,n=0,r=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0),n&&ts.has(n)&&r.push({node:e,source:n})},FunctionDeclaration(){n+=1},"FunctionDeclaration:exit"(){--n},FunctionExpression(){n+=1},"FunctionExpression:exit"(){--n},ArrowFunctionExpression(){n+=1},"ArrowFunctionExpression:exit"(){--n},CallExpression(e){if(n!==0)return;let t=us(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(let{node:t,source:n}of r)G(e,t,`Rule: avoid Node fs imports or require calls in Effect code (${n}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`)}}}}),fs=t({meta:{schema:q},create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){Nt(e)&&n.push(e)},"Program:exit"(){if(!(!t||J(e)))for(let t of n)G(e,t.callee,`Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.`)}}}}),ps=new Set([`try`,`tryPromise`,`mapError`,`catchAll`,`catchTag`,`catchTags`]);function ms(e,t=new WeakSet){if(Nt(e))return!0;if(i(e)){let t=e.callee.property;if(n(t)&&ps.has(t.name))return!0}return Array.isArray(e)?e.some(e=>ms(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ms(n,t)))}const hs=t({meta:{schema:q},create(e){return{TryStatement(t){!t.handler||!J(e)||ms(t)||G(e,t,`Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, catchAll, or execute a mapped Effect program.`)}}}}),gs=t({create(e){let t=!1,n=!1,i=[];return{ImportDeclaration(e){let r=K(e);r&&Y(r)&&(t=!0),_a(e)&&(n=!0)},CallExpression(e){r(e.callee,`JSON`,`parse`)&&i.push(e)},"Program:exit"(){if(!(!t||n))for(let t of i)G(e,t,`Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: decode unknown input with Schema.decodeUnknown at the boundary.`)}}}}),_s=t({create(e){let t=!1,n=new WeakSet,r=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(e){if(me(e))for(let t of ge(e.arguments))n.has(t)||(n.add(t),r.push(t))},"Program:exit"(){if(t)for(let t of r)G(e,t,`Rule: avoid Date.now inside Effect logic. Why: direct wall-clock reads make programs nondeterministic and difficult to test. Fix: obtain time through Effect Clock or DateTime at the boundary.`)}}}}),vs=t({meta:{schema:q},create(e){let t=!1,r=[];return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},NewExpression(e){n(e.callee,`Date`)&&r.push(e)},"Program:exit"(){if(!(!t||J(e)))for(let t of r)G(e,t,`Rule: avoid new Date in Effect domain logic. Why: direct wall-clock construction makes domain behaviour nondeterministic and difficult to test. Fix: obtain time through Effect Clock or model time at the boundary.`)}}}}),ys=t({create(e){let t=!1,n=n=>{if(t)for(let t of Di(n))G(e,t,"Rule: avoid overloaded options objects. Why: `opts`, `options`, and `config` typed as any/object hide required fields and validation. Fix: accept unknown at the boundary and decode with Schema, or use a named typed command/config model.")};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),bs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},LogicalExpression(n){t&&ki(n)&&G(e,n,`Rule: avoid embedding domain logic in conditionals. Why: multi-clause business rules become hard to test, reuse, and audit. Fix: extract a named domain predicate or validation Effect and call that from the branch.`)}}}}),xs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},LogicalExpression(n){t&&Mi(n)&&G(e,n,`Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.`)}}}}),Ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Ni(n)&&G(e,n,`Rule: avoid ad hoc domain errors. Why: string failures hide recovery semantics and observability. Fix: use Data.TaggedError or a structured domain error union.`)},ThrowStatement(n){t&&Gi(n)&&G(e,n,`Rule: avoid ad hoc domain errors. Why: thrown string Error values bypass typed Effect error channels. Fix: return Effect.fail with a structured tagged domain error.`)}}}}),Cs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration(n){t&&qi(n)&&G(e,n,`Rule: avoid domain meaning by folder or context naming alone. Why: admin/public/internal meaning should be represented in types or services, not inferred from helper names. Fix: encode context with branded IDs, commands, policies, or service boundaries.`)}}}}),ws=t({create(e){return{CallExpression(t){r(t.callee,`Effect`,`as`)&&G(e,t.callee,`Rule: avoid Effect.as wrappers. Why: they can hide meaningful sequencing or value flow. Fix: return the intended value directly or use explicit Effect.map/andThen.`)}}}}),Ts=t({create(e){return{MemberExpression(t){r(t,`Effect`,`Do`)&&G(e,t,`Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.`)}}}});function Es(e,n,i){return t({create(t){return{CallExpression(a){r(a.callee,e,n)&&G(t,a.callee,i)}}}})}const Ds=Es(`Effect`,`bind`,`Rule: avoid Effect.bind. Why: it obscures linear data flow behind builder-style binding. Fix: use Effect.gen or a direct pipe with flatMap/map.`),Os=Es(`Runtime`,`runFork`,`Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.`),ks=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Nt(n)&&G(e,n.callee,`Rule: avoid running Effects outside runtime boundaries. Why: direct Effect.run* calls scatter execution ownership. Fix: return Effects from domain logic and run them at the app, CLI, worker, route, or test boundary.`)}}}}),As=Es(`Effect`,`async`,`Rule: avoid Effect.async. Why: manual callback bridges are easy to leak or resume incorrectly. Fix: use scoped Effect APIs or a dedicated platform adapter.`),js=t({create(e){return{CallExpression(t){s(t)&&G(e,t,`Rule: avoid deeply nested Effect calls (Effect.xx(Effect.yy(Effect.zz(...)))). Why: they hide sequencing and spread flow. Fix: build values first, then run one flat Effect pipeline.`)}}}}),Ms=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])s(n.init)&&G(e,n.init,`Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.`)},ReturnStatement(t){s(t.argument)&&G(e,t.argument,`Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.`)}}}}),Ns=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[]){let t=te(n.init);t&&G(e,n.init,t)}},ReturnStatement(t){let n=te(t.argument);n&&G(e,t.argument,n)}}}}),Ps=t({create(e){return{CallExpression(t){l(t)&&ie(t.arguments)&&G(e,t,`Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.`)}}}}),Fs=t({create(e){return{CallExpression(t){ee(t)&&G(e,t,`Rule: avoid nested Effect call towers (Effect.fn(Effect.fn(...))). Why: it hides sequencing. Fix: build the inner Effect first, then use pipe/Effect.flatMap/Effect.andThen for a single flat pipeline.`)}}}}),Is=t({create(e){return{CallExpression(t){re(t)&&G(e,t,`Rule: avoid Effect.orElse around sequencing chains. Why: it hides error handling and splits the flow. Fix: move error handling to a single terminal decision after the pipeline.`)}}}}),Ls=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Qt(n)&&G(e,n,"Rule: avoid unbounded Effect.all over mapped collections. Why: it can launch work for every item at once and fail under load. Fix: pass an explicit `{ concurrency: n }` option or use a bounded batching strategy.")}}}}),Rs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ExpressionStatement(n){t&&o(n.expression,`fork`)&&G(e,n.expression,`Rule: avoid fire-and-forget Effect.fork. Why: detached fibers hide failure, interruption, and ownership. Fix: bind the fiber and join/await/interrupt it, or use Effect.forkScoped / Effect.forkIn with an explicit scope.`)}}}}),zs=t({create(e){let t=!1,n=n=>{if(!t)return;let r=$t(n.body);r&&G(e,r,`Rule: avoid Effect.fork inside loops. Why: loop-spawned fibers create unbounded concurrency and unclear ownership. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit or a scoped supervisor.`)};return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},ForStatement:n,ForInStatement:n,ForOfStatement:n,WhileStatement:n,DoWhileStatement:n}}}),Bs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&yn(n)&&G(e,n,`Rule: avoid Effect.race without loser cleanup. Why: racing effects without ensuring/scoped cleanup can leak losing work or resources. Fix: wrap raced effects with Effect.ensuring/acquireRelease or use a scoped race boundary.`)}}}}),Vs=t({create(e){let t=!1,n=new Map,r=new Set;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclarator(e){let t=Jn(e);t&&n.set(t,e)},CallExpression(e){let t=Xn(e);t&&r.add(t)},"Program:exit"(){if(t)for(let[t,i]of n)r.has(t)||G(e,i,`Rule: avoid unobserved forked fibers. Why: forked fiber failures and interruption should be observed. Fix: pass the fiber to Fiber.join, Fiber.await, Fiber.interrupt, or use scoped fork APIs.`)}}}}),Hs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Sn(n)&&G(e,n,`Rule: avoid unbounded concurrent retry. Why: retry inside unbounded parallel collection effects can amplify load and create retry storms. Fix: add an explicit concurrency limit or move retry behind a bounded queue/backoff policy.`)}}}}),Us=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=jt(n);r&&G(e,r,`Rule: avoid blocking sync calls inside Effect logic. Why: sync fs/crypto/zlib calls block the runtime worker and hide throughput costs. Fix: use Effect.async/tryPromise at a platform boundary, stream APIs, or a dedicated blocking executor.`)}}}}),Ws=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=wt(n);r&&G(e,r,`Rule: avoid Promise concurrency APIs inside Effect logic. Why: Promise.all/allSettled/race/any bypass Effect concurrency, interruption, tracing, and error channels. Fix: use Effect.all, Effect.forEach, Effect.race, or a boundary adapter with explicit cancellation ownership.`)}}}}),Gs=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(e){if(!(e.kind!==`let`&&e.kind!==`var`))for(let t of Cn(e))n.add(t)},CallExpression(r){if(!t)return;let i=Dn(r);if(!i)return;let a=P(i,n);a&&G(e,a,`Rule: avoid mutating shared state across fibers. Why: outer let/var state mutated from forked or parallel work creates nondeterministic races. Fix: model shared state with Ref/SynchronizedRef/Queue or aggregate immutable results with bounded Effect.all/forEach.`)}}}}),Ks=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ot(n);r&&G(e,r,`Rule: avoid timeout around noninterruptible Promise effects. Why: timing out Effect.promise or tryPromise without a signal leaves the underlying Promise running after interruption. Fix: use Effect.tryPromise with an AbortSignal parameter and pass it to the async API.`)}}}}),qs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Wn(n)&&G(e,n,`Rule: avoid uninterruptible concurrent regions. Why: wrapping fork/race/all/forEach or queue work in uninterruptible blocks cancellation and can strand work under shutdown. Fix: keep only the critical section uninterruptible and leave concurrent work interruptible or scoped.`)}}}}),Js=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){t&&Gn(n)&&G(e,n,`Rule: avoid unbounded Queue or PubSub constructors. Why: unbounded buffers hide backpressure and can fail under load. Fix: use Queue.bounded / PubSub.bounded with an explicit capacity at the owning boundary.`)}}}}),Ys=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},VariableDeclaration(e){for(let t of qn(e))n.add(t)},CallExpression(r){if(!t)return;let i=Dn(r);if(!i)return;let a=P(i,n);a&&G(e,a,`Rule: avoid global mutable concurrency state. Why: module-scope mutable state touched from concurrent Effect work behaves like shared mutable global state. Fix: move ownership into Ref/SynchronizedRef/Queue/Layer state or pass immutable values through bounded effects.`)}}}}),Xs=t({create(e){let t=!1,r=[new Set],i=new WeakSet;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},FunctionDeclaration(){r.push(new Set)},"FunctionDeclaration:exit"(){r.pop()},FunctionExpression(){r.push(new Set)},"FunctionExpression:exit"(){r.pop()},ArrowFunctionExpression(){r.push(new Set)},"ArrowFunctionExpression:exit"(){r.pop()},VariableDeclarator(e){let t=mn(e);t&&r.at(-1)?.add(t)},CallExpression(o){if(!t||!pn(o))return;let s=a(o);!n(s)||!r.at(-1)?.has(s.name)||_n(o,s.name)||i.has(o)||(i.add(o),G(e,o,`Rule: avoid unbounded manual Deferred coordination. Why: a local latch can wait forever and make shutdown or failure ownership implicit. Fix: bound the await with a timeout/race, keep it interruptible, or tie completion and cleanup to a scope finalizer.`))}}}}),Zs=t({create(e){let t=!1,n=new WeakSet;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(r){if(!t)return;let i=In(r);if(i)for(let t of Vn(i))typeof t!=`object`||!t||n.has(t)||(n.add(t),G(e,t,`Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.`))}}}}),Qs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=nn(n);r&&M(r)&&G(e,n,`Rule: avoid suspension while holding a semaphore permit. Why: sleeping, awaiting, or forking under a permit holds capacity while unrelated work waits. Fix: narrow the permit-protected section and perform interruptible or concurrent work outside it.`)}}}}),$s=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=rn(n);r&&M(r)&&G(e,n,`Rule: avoid suspension while holding synchronized reference coordination. Why: effectful SynchronizedRef modifiers hold internal coordination while the callback sleeps, awaits, or starts concurrent work. Fix: compute the effect outside the modifier and commit a short synchronous state transition.`)}}}}),ec=t({create(e){return{ImportExpression(t){G(e,t,`Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.`)}}}}),tc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||!o(n,`forkDaemon`)||c(a(n),`supervised`)||G(e,n,`Rule: avoid unscoped background fibers. Why: Effect.forkDaemon detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn or make supervisor ownership explicit in the child effect.`)}}}});function nc(e){if(typeof e!=`object`||!e||!Array.isArray(e.arguments))return[];let t=e.arguments;return o(e,`acquireUseRelease`)?t.slice(2):o(e,`acquireRelease`)||o(e,`acquireReleaseInterruptible`)?t.slice(1):o(e,`addFinalizer`)?t.slice(0,1):D(e,`Scope`,`addFinalizer`)||D(e,`Scope`,`addFinalizerExit`)?t.slice(1):[]}function rc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),h(t)){let e=t.parent;if(nc(e).some(e=>e===t))return!0}t=t.parent}return!1}const ic=t({meta:{schema:q},create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||J(e)||!Fn(n)||rc(n)||G(e,n,`Rule: avoid manual resource cleanup. Why: direct close/dispose calls can bypass Effect scope ownership. Fix: acquire the resource with Effect.acquireRelease or register cleanup with a Scope finalizer.`)}}}});function ac(e){return D(e,`Scope`,`make`)&&Array.isArray(e.arguments)}function oc(e,t){return D(e,`Scope`,`close`)&&n(a(e),t)}const sc=new Set([`BlockStatement`,`CatchClause`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`Program`,`SwitchStatement`]);function cc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),sc.has(t.type??``)||h(t))return t;t=t.parent}}function lc(e,t){let n=e,r=new WeakSet;for(;typeof n==`object`&&n;){if(r.has(n))return!1;if(r.add(n),n===t)return!0;n=n.parent}return!1}function uc(e){let t=0,n=e,r=new WeakSet;for(;typeof n==`object`&&n;){if(r.has(n))return t;r.add(n),t+=1,n=n.parent}return t}function Z(e){if(n(e))return[e];if(typeof e!=`object`||!e)return[];let t=e;switch(t.type){case`ArrayPattern`:return Array.isArray(t.elements)?t.elements.flatMap(e=>Z(e)):[];case`AssignmentPattern`:return Z(t.left);case`ObjectPattern`:return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e;return t.type===`Property`?Z(t.value):t.type===`RestElement`?Z(t.argument):[]}):[];case`RestElement`:return Z(t.argument);case`TSParameterProperty`:return Z(t.parameter);default:return[]}}function dc(e){return v(e.body,t=>typeof t==`object`&&!!t&&fc(t).length>0&&gc(t)===e)}function fc(e){return e.type===`VariableDeclarator`?Z(e.id):e.type===`CatchClause`?Z(e.param):(e.type===`ClassDeclaration`||e.type===`FunctionDeclaration`)&&n(e.id)?[e.id]:[]}function pc(e){return e.type===`CatchClause`?cc(e.param):cc(e)}function mc(e,t){if(!n(e))return;let r,i=-1;for(let a of dc(t)){if(!fc(a).some(t=>n(t,e.name)))continue;let t=pc(a);if(t===void 0||!lc(e,t))continue;let o=uc(t);o>i&&(r=a,i=o)}return r}function hc(e,t){return e===t?!0:typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&e.argument===t}function gc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),h(t))return t;t=t.parent}}function _c(e){let t=typeof e==`object`&&e?e.parent:void 0,r=new WeakSet;for(;typeof t==`object`&&t;){if(r.has(t))return;if(r.add(t),t.type===`VariableDeclarator`&&n(t.id)&&hc(t.init,e))return t;if(h(t))return;t=t.parent}}function vc(e){let t=_c(e),n=gc(e);if(t===void 0||n===void 0)return!1;let r=t.id.name;return v(n.body,e=>oc(e,r)&&gc(e)===n&&mc(a(e),n)===t).length>0}function yc(e){return(o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`acquireReleaseInterruptible`))&&Array.isArray(e.arguments)}function bc(e,t,r){let i=a(e);return n(i,t.name)?mc(i,r)===void 0&&Array.isArray(r.params)&&r.params.some(e=>e===t):!1}function xc(e){let t=e.arguments;return(o(e,`acquireUseRelease`)?t.slice(2):t.slice(1)).some(e=>{if(!h(e))return!1;let t=e.params?.[0];return n(t)?v(e.body,n=>oc(n,t.name)&&gc(n)===e&&bc(n,t,e)).length>0:!1})}function Sc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),o(t,`scoped`)||D(t,`Layer`,`scoped`)||yc(t)&&a(t)===e&&xc(t))return!0;t=t.parent}return vc(e)}const Cc={"no-react-state":ba,"no-if-statement":xa,"no-switch-statement":Sa,"no-ternary":Ca,"no-return-null":wa,"no-option-as":Ta,"no-effect-never":Ea,"no-arrow-ladder":Da,"no-branch-in-object":Oa,"no-iife-wrapper":ka,"no-return-in-arrow":Aa,"no-return-in-callback":ja,"no-effect-fn-generator":Ma,"no-effect-sync-console":Na,"no-console-in-effect-flow":Pa,"no-effect-log-without-structured-context":Fa,"require-span-on-public-service-method":Ia,"no-runpromise-in-non-async-test-body":La,"require-effect-flip-for-error-test":Ra,"no-test-mock-layer-when-default-available":za,"no-nested-effect-gen":Ba,"no-yield-without-star-in-effect-gen":Va,"no-piped-yield-in-gen":Ha,"no-gen-for-mapping":Ua,"prefer-gen-for-workflow":Wa,"no-large-anonymous-flow":Ga,"no-effect-in-flow":Ka,"prefer-named-flow":qa,"prefer-pipe-for-behavior":Ja,"prefer-decorated-effect-before-gen":Ya,"no-workflow-in-behavior-pipe":Xa,"no-mixed-pillar-function":Za,"no-clever-effect-expression":Qa,"prefer-extracted-concept":$a,"prefer-effect-service":eo,"no-layer-provide-in-service-definition":to,"require-service-accessors":no,"require-service-dependencies":ro,"no-namespace-effect-import":io,"no-manual-service-object-export":ao,"no-layer-merge-in-request-handler":uo,"no-service-method-returning-promise":fo,"prefer-layer-pipe":oo,"no-inline-layer-provide-in-program":so,"prefer-layer-mergeall-for-infrastructure":co,"no-service-layer-scatter":lo,"no-match-void-branch":po,"no-json-parse-without-schema":gs,"no-date-now-in-effect":_s,"no-new-date-in-domain-logic":vs,"no-match-effect-branch":mo,"warn-effect-sync-wrapper":ho,"no-effect-side-effect-wrapper":go,"no-effect-all-step-sequencing":_o,"no-async-effect-combinator-callback":vo,"no-throw-in-effect-logic":yo,"no-or-die-outside-boundary":bo,"no-swallowed-catch-all":xo,"no-effect-ignore":To,"no-try-catch-in-effect-logic":Eo,"no-promise-api-in-effect-logic":Do,"no-try-catch":Oo,"no-effect-wrapper-alias":ko,"no-manual-effect-channels":Ao,"no-wrapgraphql-catchall":jo,"no-render-side-effects":Mo,"no-atom-registry-effect-sync":No,"no-family-collection-read":Po,"no-inline-runtime-provide":Fo,"no-naked-object-state-update":Io,"no-effect-succeed-variable":Lo,"no-effect-type-alias":Ro,"no-public-generic-effect-error":zo,"no-effect-fail-error-message":So,"no-catchall-generic-rethrow":Co,"no-log-only-error-handling":wo,"no-error-as-public-effect-error":Vo,"no-unknown-public-error-channel":Ho,"no-mixed-effect-error-shapes":Uo,"no-model-overlay-cast":Wo,"no-unknown-boolean-coercion-helper":Go,"no-fromnullable-nullish-coalesce":Ko,"no-option-boolean-normalization":qo,"no-string-sentinel-return":Jo,"no-string-sentinel-const":Yo,"no-raw-domain-id-alias":Xo,"no-boolean-domain-flag":Zo,"no-magic-domain-string":Qo,"no-raw-domain-primitive-params":$o,"no-raw-time-domain-field":es,"no-hidden-effect-execution":fs,"no-boundary-try-catch-without-effect-map":hs,"no-node-fs-in-effect-code":ds,"no-node-platform-in-shared-code":cs,"no-process-env-direct-read":ls,"no-overloaded-options-object":ys,"no-domain-logic-in-conditional":bs,"no-implicit-state-machine-object":xs,"no-adhoc-domain-error":Ss,"no-domain-meaning-by-folder-only":Cs,"no-effect-as":ws,"no-effect-do":Ts,"no-effect-bind":Ds,"no-runtime-runfork":Os,"no-run-effect-outside-boundary":ks,"no-effect-async":As,"prevent-dynamic-imports":ec,"no-nested-effect-call":js,"no-effect-ladder":Ms,"no-flatmap-ladder":Ns,"no-pipe-ladder":Ps,"no-call-tower":Fs,"no-effect-orElse-ladder":Is,"no-unbounded-effect-all":Ls,"no-fire-and-forget-fork":Rs,"no-fork-in-loop":zs,"no-race-without-cleanup":Bs,"no-unobserved-fiber":Vs,"no-unbounded-concurrent-retry":Hs,"no-blocking-call-in-effect":Us,"no-promise-concurrency-in-effect":Ws,"no-shared-mutable-state-across-fibers":Gs,"no-timeout-with-noninterruptible-promise":Ks,"no-uninterruptible-concurrent-region":qs,"no-unbounded-queue-or-pubsub":Js,"no-global-mutable-concurrency-state":Ys,"no-manual-deferred-coordination":Xs,"no-acquire-without-scoped-release":Zs,"no-manual-resource-close":ic,"no-unbound-scope":t({meta:{schema:q},create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||J(e)||!ac(n)||Sc(n)||G(e,n,`Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.`)}}}}),"no-resource-succeed-escape":t({meta:{schema:q},create(e){let t=!1;return{ImportDeclaration(e){let n=K(e);n&&Y(n)&&(t=!0)},CallExpression(n){!t||J(e)||!o(n,`succeed`)||!Pn(a(n))||G(e,n,`Rule: do not let live resources escape through Effect.succeed. Why: ordinary success values do not express resource lifetime ownership. Fix: keep the resource inside Effect.acquireRelease, Scope, or a service layer.`)}}}}),"no-yield-with-held-semaphore-permit":Qs,"no-yield-with-held-mutable-ref":$s,"no-unscoped-background-fiber":tc},wc=[`no-runpromise-in-non-async-test-body`,`require-effect-flip-for-error-test`,`no-test-mock-layer-when-default-available`],Tc=[`no-manual-deferred-coordination`,`no-yield-with-held-semaphore-permit`,`no-yield-with-held-mutable-ref`,`no-unscoped-background-fiber`];function Q(e){return Object.fromEntries(e.map(e=>[`linteffect/${e}`,`error`]))}function $(e){return{jsPlugins:Ec,rules:e}}const Ec=[{name:`linteffect`,specifier:`@opsydyn/oxlint-effect`}],Dc=Q([`no-react-state`,`no-runtime-runfork`,`no-run-effect-outside-boundary`,`no-or-die-outside-boundary`,`prevent-dynamic-imports`,`no-render-side-effects`,`no-inline-runtime-provide`]),Oc=Q([`no-effect-as`,`no-effect-do`,`no-effect-bind`,`no-effect-async`,`no-effect-ignore`,`no-effect-never`,`no-effect-fn-generator`,`no-nested-effect-gen`,`no-yield-without-star-in-effect-gen`,`no-async-effect-combinator-callback`,`no-throw-in-effect-logic`,`no-try-catch-in-effect-logic`,`no-promise-api-in-effect-logic`,`no-swallowed-catch-all`,`no-manual-effect-channels`,`no-effect-type-alias`,`no-public-generic-effect-error`]),kc=Q([`no-unbounded-effect-all`,`no-fire-and-forget-fork`,`no-fork-in-loop`,`no-race-without-cleanup`,`no-unobserved-fiber`,`no-unbounded-concurrent-retry`,`no-blocking-call-in-effect`,`no-promise-concurrency-in-effect`,`no-shared-mutable-state-across-fibers`,`no-timeout-with-noninterruptible-promise`,`no-uninterruptible-concurrent-region`,`no-unbounded-queue-or-pubsub`,`no-global-mutable-concurrency-state`,...Tc,`no-acquire-without-scoped-release`]),Ac=Q([`no-manual-resource-close`,`no-unbound-scope`,`no-resource-succeed-escape`]),jc=Q([`no-nested-effect-call`,`no-effect-ladder`,`no-flatmap-ladder`,`no-pipe-ladder`,`no-call-tower`,`no-effect-orElse-ladder`,`no-effect-wrapper-alias`,`warn-effect-sync-wrapper`,`no-effect-side-effect-wrapper`,`no-effect-all-step-sequencing`,`no-effect-succeed-variable`]),Mc=Q([`no-if-statement`,`no-switch-statement`,`no-ternary`,`no-try-catch`,`no-arrow-ladder`,`no-iife-wrapper`,`no-return-in-arrow`,`no-return-in-callback`,`no-return-null`,`no-branch-in-object`]),Nc=Q([`no-option-as`,`no-match-void-branch`,`no-match-effect-branch`,`no-model-overlay-cast`,`no-unknown-boolean-coercion-helper`,`no-fromnullable-nullish-coalesce`,`no-option-boolean-normalization`,`no-string-sentinel-return`,`no-string-sentinel-const`]),Pc=Q([`no-effect-sync-console`,`no-atom-registry-effect-sync`,`no-family-collection-read`,`no-naked-object-state-update`,`no-wrapgraphql-catchall`]),Fc=Q([`no-raw-domain-id-alias`,`no-boolean-domain-flag`,`no-magic-domain-string`,`no-raw-domain-primitive-params`,`no-raw-time-domain-field`,`no-overloaded-options-object`,`no-domain-logic-in-conditional`,`no-implicit-state-machine-object`,`no-adhoc-domain-error`,`no-domain-meaning-by-folder-only`,`no-new-date-in-domain-logic`]),Ic=[`no-error-as-public-effect-error`,`no-unknown-public-error-channel`,`no-mixed-effect-error-shapes`],Lc=Q([...Ic,`no-effect-fail-error-message`,`no-catchall-generic-rethrow`,`no-log-only-error-handling`]),Rc={...Fc,...Lc},zc=Q([`no-piped-yield-in-gen`,`no-gen-for-mapping`,`prefer-gen-for-workflow`]),Bc=Q([`no-large-anonymous-flow`,`no-effect-in-flow`,`prefer-named-flow`]),Vc=Q([`prefer-pipe-for-behavior`,`prefer-decorated-effect-before-gen`,`no-workflow-in-behavior-pipe`]),Hc=Q([`no-mixed-pillar-function`,`no-clever-effect-expression`,`prefer-extracted-concept`]),Uc=Q([`prefer-effect-service`,`no-layer-provide-in-service-definition`,`require-service-accessors`,`require-service-dependencies`,`no-namespace-effect-import`,`no-manual-service-object-export`,`no-layer-merge-in-request-handler`,`no-service-method-returning-promise`,`prefer-layer-pipe`,`no-inline-layer-provide-in-program`,`prefer-layer-mergeall-for-infrastructure`,`no-service-layer-scatter`]),Wc=Q([`no-hidden-effect-execution`,`no-boundary-try-catch-without-effect-map`,`no-node-fs-in-effect-code`,`no-json-parse-without-schema`,`no-date-now-in-effect`,`no-node-platform-in-shared-code`,`no-process-env-direct-read`]),Gc=Q([`no-console-in-effect-flow`,`no-effect-log-without-structured-context`,`require-span-on-public-service-method`,...wc]),Kc=Q(Object.keys(Cc)),qc=[...wc,...Tc,...Ic,`no-resource-succeed-escape`],Jc=Q(Object.keys(Cc).filter(e=>!qc.includes(e))),Yc={reactAndRuntimeBoundaries:Dc,effectComposition:Oc,concurrencySafety:kc,resourceLifetime:Ac,pipelineShapeAndSequencing:jc,branchingAndLocalControlFlow:Mc,optionMatchAndDataNormalization:Nc,atomStateAndPlatformBoundaries:Pc,domainModeling:Fc,errorModeling:Lc,ddd:Rc,effectFlow:zc,pureTransformation:Bc,behaviorDecoration:Vc,styleSeparation:Hc,serviceAndLayerArchitecture:Uc,platformAndBoundaryHygiene:Wc,testingObservabilityAndQa:Gc},Xc=$(Jc),Zc=$(Dc),Qc=$(Oc),$c=$(kc),el=$(Ac),tl=$(jc),nl=$(Mc),rl=$(Nc),il=$(Pc),al=$(Fc),ol=$(Lc),sl=$(Rc),cl=$(zc),ll=$(Bc),ul=$(Vc),dl=$(Hc),fl=$(Uc),pl=$(Wc),ml=$(Gc),hl={recommended:Xc,reactAndRuntimeBoundaries:Zc,effectComposition:Qc,concurrencySafety:$c,resourceLifetime:el,pipelineShapeAndSequencing:tl,branchingAndLocalControlFlow:nl,optionMatchAndDataNormalization:rl,atomStateAndPlatformBoundaries:il,domainModeling:al,errorModeling:ol,ddd:sl,effectFlow:cl,pureTransformation:ll,behaviorDecoration:ul,styleSeparation:dl,serviceAndLayerArchitecture:fl,platformAndBoundaryHygiene:pl,testingObservabilityAndQa:ml};var gl=e({meta:{name:`linteffect`},rules:Cc});export{Kc as allRules,il as atomStateAndPlatformBoundaries,Pc as atomStateAndPlatformBoundariesRules,ul as behaviorDecoration,Vc as behaviorDecorationRules,nl as branchingAndLocalControlFlow,Mc as branchingAndLocalControlFlowRules,$c as concurrencySafety,kc as concurrencySafetyRules,sl as ddd,Rc as dddRules,gl as default,al as domainModeling,Fc as domainModelingRules,Qc as effectComposition,Oc as effectCompositionRules,cl as effectFlow,zc as effectFlowRules,ol as errorModeling,Lc as errorModelingRules,Ec as jsPlugins,rl as optionMatchAndDataNormalization,Nc as optionMatchAndDataNormalizationRules,tl as pipelineShapeAndSequencing,jc as pipelineShapeAndSequencingRules,pl as platformAndBoundaryHygiene,Wc as platformAndBoundaryHygieneRules,hl as presets,ll as pureTransformation,Bc as pureTransformationRules,Zc as reactAndRuntimeBoundaries,Dc as reactAndRuntimeBoundariesRules,Xc as recommended,Jc as recommendedRules,el as resourceLifetime,Ac as resourceLifetimeRules,Yc as ruleGroups,fl as serviceAndLayerArchitecture,Uc as serviceAndLayerArchitectureRules,dl as styleSeparation,Hc as styleSeparationRules,ml as testingObservabilityAndQa,Gc as testingObservabilityAndQaRules};
2
2
  //# sourceMappingURL=index.mjs.map