@opsydyn/oxlint-effect 0.10.0 → 1.1.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 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(!J(G(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(!Y(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`)&&aa(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===`??`&&(aa(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 ki(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+ki(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`?ki(n.left,t)+ki(n.right,t):0}function Ai(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&ki(e)>=3}function ji(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 Mi(e,t=new Map,n=new WeakSet){let r=ji(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)Mi(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`?(Mi(i.left,t,n),Mi(i.right,t,n),t):t}function Ni(e){return typeof e!=`object`||!e||e.type!==`LogicalExpression`?!1:Array.from(Mi(e).values()).some(e=>e.size>=2)}function Pi(e){return o(e,`fail`)&&z(a(e))}function Fi(e){return n(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Ii(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return!1;let t=e;return t.computed!==!0&&n(t.property,`message`)&&Fi(t.object)}function Li(e){if(Ii(e))return!0;if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`BinaryExpression`&&t.operator===`+`?Li(t.left)||Li(t.right):t.type===`TemplateLiteral`&&Array.isArray(t.expressions)&&t.expressions.some(e=>Li(e))}function Ri(e){return o(e,`fail`)&&Li(a(e))}function zi(e){return typeof e==`object`&&!!e&&e.type===`NewExpression`&&n(e.callee,`Error`)}function Bi(e){return o(e,`fail`)&&zi(a(e))}function Vi(e,t){if(!i(e))return[];let r=e.callee.property;return!n(r)||!t.has(r.name)?[]:e.arguments.filter(h)}function Hi(e){for(let t of Vi(e,new Set([`catchAll`]))){let e=R(t);if(Bi(e))return e;for(let t of u(e))if(Bi(t.argument))return t.argument}}const Ui=new Set([`catchSome`,`catchTag`,`catchTags`,`fail`,`mapBoth`,`mapError`]);function Wi(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Ui.has(t.name)}function Gi(e){for(let t of Vi(e,new Set([`catchAll`,`tapError`]))){let e=R(t),n=_(e,Jt);if(n&&!_(e,Wi))return n}}const Ki=new Set([`catchAll`]),qi=new Set([`NotFound`,`Missing`,`Empty`,`None`]);function Ji(e){return aa(e)||Wr(e)||n(e)&&/(?:fallback|default)/i.test(e.name)}function Yi(e){return o(e,`succeed`)&&Ji(a(e))}function Xi(e){for(let t of Vi(e,Ki)){let e=R(t);if(Yi(e))return e;for(let t of u(e))if(Yi(t.argument))return t.argument}}function Zi(e){if(!o(e,`fail`))return!1;let t=a(e);return z(t)&&qi.has(String(t.value))}function Qi(e){if(typeof e!=`object`||!e||e.type!==`NewExpression`)return!1;let t=e.callee;return n(t)&&/(?:Error|Exception)$/.test(t.name)}function $i(e){return typeof e!=`object`||!e||e.type!==`ThrowStatement`?!1:Qi(e.argument)}function ea(e){let t=d(e,`gen`);if(t)return _(t.body,$i);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?_(e,$i):void 0;if(n)return n}}function ta(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 na(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 ra(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)&&na(e)}function ia(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 W(e,t,n){e.report({message:n,node:t})}function aa(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`NullLiteral`||t.type===`Literal`&&t.value===null}function G(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 oa=[`bin/**`,`scripts/**`,`cli/**`,`**/main.ts`,`app/api/**/route.ts`,`server/**`,`*.test.ts`,`*.spec.ts`],sa=[`**/*.test.*`,`**/*.spec.*`,`**/__tests__/**`],ca=[`**/config/**`,`**/*Config.ts`,`**/*ConfigLayer.ts`],K=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}],la=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}},configPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}];function ua(e){let t=e.options[0];return typeof t==`object`&&t?t:{}}function da(e,t){let n=e[t];return Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:void 0}function fa(e){return e.replace(/\\/g,`/`).replace(/^\.\/+/,``).replace(/\/{2,}/g,`/`).replace(/\/$/,``)}function pa(e){return e.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`[^/]*`)}function ma(e){let t=fa(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+=pa(t)}return RegExp(`${a}$`)}function ha(e,t){return ma(t).test(fa(e))}function ga(e){return da(ua(e),`boundaryPaths`)??oa}function q(e){return ga(e).some(t=>ha(e.filename,t))}function _a(e){return sa.some(t=>ha(e.filename,t))}function va(e){return da(ua(e),`configPaths`)??ca}function ya(e){return va(e).some(t=>ha(e.filename,t))}function J(e){return e===`effect`||e.startsWith(`effect/`)||e===`@effect-atom/atom-react`}function ba(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 xa(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 Sa(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 Ca(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 wa(e){return typeof e==`object`&&!!e&&e.type===`MemberExpression`&&e.computed!==!0&&n(e.property,`Default`)}function Ta(e){return D(e,`Layer`,`succeed`)||D(e,`Layer`,`effect`)}function Ea(e){if(!D(e,`Layer`,`provide`))return[];let t=e.arguments;return!Array.isArray(t)||!t.some(wa)?[]:t.filter(Ta)}function Da(e){let t=G(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 Oa(e,n){return t({create(t){let r=!1;return{ImportDeclaration(e){let t=G(e);t&&J(t)&&(r=!0)},[e](e){r&&W(t,e,n)}}}})}const ka=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&&ka.has(i)&&W(e,r,`Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.`)}}}}),ja=Oa(`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.`),Ma=Oa(`SwitchStatement`,`Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.`),Na=Oa(`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.`),Pa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ReturnStatement(n){t&&aa(n.argument)&&W(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.`)}}}}),Fa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&r(n.callee,`Option`,`as`)&&W(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.`)}}}}),Ia=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},MemberExpression(n){t&&r(n,`Effect`,`never`)&&W(e,n,`Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.`)}}}}),La=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t||!ae(n))return;let r=se(n.callee.body);r&&W(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.`)}}}}),Ra=t({create(e){return{ObjectExpression(t){ui(t).some(e=>li(e))&&W(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.`)}}}}),za=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&oe(n)&&W(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.`)}}}}),Ba=t({create(e){return{CallExpression(t){for(let n of le(t))W(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).`)}}}}),Va=t({create(e){return{CallExpression(t){for(let n of ue(t))W(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.`)}}}}),Ha=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&fe(n,`fn`)&&W(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.`)}}}}),Ua=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&o(n,`sync`)&&O(a(n))&&W(e,n,`Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.`)}}}}),Wa=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=G(e);n&&J(n)&&(t=!0)},CallExpression(e){i(e)},ClassDeclaration(e){i(e)},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.`)}}}}),Ga=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=G(e);n&&J(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)W(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(...).`)}}}}),Ka=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=G(e);n&&J(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)W(e,t,`Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).`)}}}}),qa=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){if(!_a(e))return;let r=ba(t),i=r&&xa(r);i&&n.push(i)},"Program:exit"(){if(t)for(let t of n)W(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.`)}}}}),Ja=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){if(!_a(e))return;let r=ba(t);r&&n.push(...Sa(r,Ca))},"Program:exit"(){if(t)for(let t of n)W(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.`)}}}}),Ya=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){_a(e)&&n.push(...Ea(t))},"Program:exit"(){if(t)for(let t of n)W(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.`)}}}}),Xa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=d(n,`gen`);if(!t||!r)return;let i=oi(r.body);i&&W(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.`)}}}}),Za=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ve(n);r&&W(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`.")}}}}),Qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=be(n);r&&W(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.`)}}}}),$a=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ce(n);r&&W(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.`)}}}}),eo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=De(n);r&&W(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.`)}}}}),to=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&ke(n)&&W(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.`)}}}}),no=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Me(n);r&&W(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.`)}}}}),ro=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ne(n);r&&W(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.`)}}}}),io=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Le(n);r&&W(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)`.")}}}}),ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Be(n);r&&W(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.`)}}}}),oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ve(n);r&&W(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.`)}}}}),so=t({create(e){let t=!1;function n(n){let r=Ue(n);t&&r&&W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=Ge(n);t&&r&&W(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.`)}}}}),lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=Ke(n);t&&r&&W(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.`)}}}}),uo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Ye(n)&&W(e,n,`Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.`)}}}}),fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=g(n);t&&r&&Xe(r)&&W(e,r,`Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.`)}}}}),po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=g(n);t&&r&&!Ze(r)&&W(e,r,`Rule: set accessors: true. Fix: add it to Effect.Service options.`)}}}}),mo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=g(n),i=r?et(r):void 0;t&&i&&W(e,i,`Rule: declare service dependencies.`)}}}}),ho=t({create(e){return{ImportDeclaration(t){let n=Qe(t);n&&W(e,n,`Rule: avoid namespace imports from Effect packages.`)}}}}),go=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?mt(n):void 0;r&&W(e,r,`Rule: avoid exported manual service objects.`)}}}}),_o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?it(n):void 0;r&&W(e,r,`Rule: prefer Layer.pipe for nested layer provisioning.`)}}}}),vo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?ot(n):void 0;r&&W(e,r,`Rule: avoid inline layer provisioning inside programs.`)}}}}),yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?st(n):void 0;r&&W(e,r,`Rule: prefer Layer.mergeAll for infrastructure layer groups.`)}}}}),bo=t({create(e){let t=!1,n=0;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(r){let i=t?lt(r):void 0;i&&(n+=1,n>=3&&W(e,i,`Rule: group service layers by concern.`))}}}}),xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){let r=rt(n);t&&r&&W(e,r,`Rule: avoid Layer composition inside request handlers.`)}}}}),So=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=g(n),i=r?ft(r):void 0;t&&i&&W(e,i,`Rule: return Effect from service methods.`)}}}}),Co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Zr(n)&&W(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.`)}}}}),wo=t({create(e){return{CallExpression(t){si(t)&&ni(t.arguments)&&W(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)&&W(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.`)}}}}),To=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=a(n),i=U(r);t&&o(n,`sync`)&&ai(r)&&!T(i)&&W(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`)&&k(a(t))&&W(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))&&W(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.`)}}}}),Do=t({create(e){return{CallExpression(t){o(t,`all`)&&A(t.arguments[0])&&Yt(t.arguments[1])&&W(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))&&W(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.`)}}}}),Oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=gt(n);r&&W(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.`)}}}}),ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=_t(n);r&&W(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.`)}}}}),Ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ft(n);r&&W(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.`)}}}}),jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Lt(n);r&&W(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.`)}}}}),Mo=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(t&&!q(e)){let t=Xi(n);t&&W(e,t,`Rule: avoid catching errors too early. Why: null, undefined, or fallback recovery inside domain logic forces higher layers to handle an untyped absence. Fix: let the typed error propagate and recover at a meaningful boundary with catchTag or an explicit Option result.`)}}}}}),No=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Zi(n)&&W(e,n,`Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad catchAll recovery. Fix: return Option, Either, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`)}}}}),Po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ea(n);r&&W(e,r,`Rule: do not use exceptions for domain errors. Why: throw new *Error inside Effect logic bypasses typed failure channels, supervision, and structured recovery. Fix: return Effect.fail with a Data.TaggedError or structured domain error.`)}}}}),Fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Ri(n)&&W(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.`)}}}}),Io=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Hi(n);r&&W(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.`)}}}}),Lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Gi(n);r&&W(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.`)}}}}),Ro=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=zt(n);r&&W(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.`)}}}}),zo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=vt(n);r&&W(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.`)}}}}),Bo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=xt(n);r&&W(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.`)}}}}),Vo=t({create(e){return{TryStatement(t){W(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.`)}}}}),Ho=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])er(n.init)&&W(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)&&W(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.")}}}}),Uo=t({create(e){return{TSTypeReference(t){(I(t,`Effect`,`Effect`)||I(t,`Layer`,`Layer`))&&W(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.")}}}}),Wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Tr(n):void 0;r&&W(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.`)}}}}),Go=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExpressionStatement(n){t&&si(n.expression)&&ri(n.expression.arguments)&&W(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.`)}}}}),Ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?kr(n):void 0;r&&W(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.`)}}}}),qo=t({create(e){return{CallExpression(t){if(!D(t,`Atom`,`family`))return;let n=Mr(t.arguments);n&&W(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.`)}}}}),Jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Pr(n):void 0;r&&W(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.")}}}}),Yo=t({create(e){return{CallExpression(t){zr(t)&&W(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.")}}}}),Xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&o(n,`succeed`)&&Br(a(n))&&W(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.`)}}}}),Zo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&br(n.typeAnnotation,`Effect`,`Effect`)&&W(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.`)}}}}),Qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?gr(n):void 0;r&&W(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&&W(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 $o(e,t,n){let r=!1,i=i=>{if(r)for(let r of hr(i))t(r)&&W(e,r.annotation,n)};return{ImportDeclaration(e){let t=G(e);t&&J(t)&&(r=!0)},ExportNamedDeclaration:i,ExportDefaultDeclaration:i}}const es=t({create(e){return $o(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.`)}}),ts=t({create(e){return $o(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.`)}}),ns=t({create(e){return $o(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.`)}}),rs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(n){t&&Vr(n)&&W(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.")}}}}),is=t({create(e){let t=!1,n=!1,r=[],i=new WeakSet,a=t=>{typeof t!=`object`||!t||i.has(t)||(i.add(t),W(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=G(e);n&&J(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)}}}}}),as=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Kr(n)&&W(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.")}}}}),os=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Jr(n)&&W(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.")}}}}),ss=t({create(e){return{CallExpression(t){o(t,`succeed`)&&z(a(t))&&W(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.`)}}}}),cs=t({create(e){return{VariableDeclaration(t){Yr(t)&&W(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.`)}}}}),ls=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&di(n)&&W(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.")}}}}),us=t({create(e){let t=!1,n=n=>{if(t)for(let t of bi(n))W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),ds=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},BinaryExpression(n){t&&ia(n)&&W(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.`)}}}}),fs=t({create(e){let t=!1,n=n=>{t&&vi(n)&&W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),ps=t({create(e){let t=!1,n=n=>{if(t)for(let t of Ti(n))W(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=G(e);n&&J(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),ms=new Set([`fs`,`node:fs`,`fs/promises`,`node:fs/promises`]),hs=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 gs(e){return e.startsWith(`node:`)||hs.has(e)}function Y(e){return typeof e==`object`&&!!e&&(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)}function _s(e,t){return e.computed!==!0&&n(e.property,t)||e.computed===!0&&z(e.property)&&e.property.value===t}function vs(e){return Y(e)&&n(e.object,`process`)&&_s(e,`env`)}function ys(e){if(!Y(e))return!1;if(vs(e.object))return!0;if(!vs(e))return!1;let t=e.parent;return!Y(t)||t.object!==e}function bs(e){if(!Y(e)||typeof e.parent!=`object`||e.parent===null)return!1;let t=e.parent;return t.type===`AssignmentExpression`&&t.left===e}const xs=t({meta:{schema:K},create(e){return{ImportDeclaration(t){let n=G(t);n&&gs(n)&&!q(e)&&W(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.`)}}}}),Ss=t({meta:{schema:la},create(e){return{MemberExpression(t){ys(t)&&!bs(t)&&!q(e)&&!ya(e)&&W(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 Cs(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 ms.has(r)?r:void 0}const ws=t({create(e){let t=!1,n=0,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0),n&&ms.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=Cs(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(let{node:t,source:n}of r)W(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.`)}}}}),Ts=t({meta:{schema:K},create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){Nt(e)&&n.push(e)},"Program:exit"(){if(!(!t||q(e)))for(let t of n)W(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.`)}}}}),Es=new Set([`try`,`tryPromise`,`mapError`,`catchAll`,`catchTag`,`catchTags`]);function Ds(e,t=new WeakSet){if(Nt(e))return!0;if(i(e)){let t=e.callee.property;if(n(t)&&Es.has(t.name))return!0}return Array.isArray(e)?e.some(e=>Ds(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Ds(n,t)))}const Os=t({meta:{schema:K},create(e){return{TryStatement(t){!t.handler||!q(e)||Ds(t)||W(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.`)}}}}),ks=t({create(e){let t=!1,n=!1,i=[];return{ImportDeclaration(e){let r=G(e);r&&J(r)&&(t=!0),Da(e)&&(n=!0)},CallExpression(e){r(e.callee,`JSON`,`parse`)&&i.push(e)},"Program:exit"(){if(!(!t||n))for(let t of i)W(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.`)}}}}),As=t({create(e){let t=!1,n=new WeakSet,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(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)W(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.`)}}}}),js=t({meta:{schema:K},create(e){let t=!1,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},NewExpression(e){n(e.callee,`Date`)&&r.push(e)},"Program:exit"(){if(!(!t||q(e)))for(let t of r)W(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.`)}}}}),Ms=t({create(e){let t=!1,n=n=>{if(t)for(let t of Di(n))W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Ns=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},LogicalExpression(n){t&&Ai(n)&&W(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.`)}}}}),Ps=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},LogicalExpression(n){t&&Ni(n)&&W(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.`)}}}}),Fs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Pi(n)&&W(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&&ta(n)&&W(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.`)}}}}),Is=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){t&&ra(n)&&W(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.`)}}}}),Ls=t({create(e){return{CallExpression(t){r(t.callee,`Effect`,`as`)&&W(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`)&&W(e,t,`Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.`)}}}});function zs(e,n,i){return t({create(t){return{CallExpression(a){r(a.callee,e,n)&&W(t,a.callee,i)}}}})}const Bs=zs(`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.`),Vs=zs(`Runtime`,`runFork`,`Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.`),Hs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Nt(n)&&W(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.`)}}}}),Us=zs(`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.`),Ws=t({create(e){return{CallExpression(t){s(t)&&W(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.`)}}}}),Gs=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])s(n.init)&&W(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)&&W(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.`)}}}}),Ks=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[]){let t=te(n.init);t&&W(e,n.init,t)}},ReturnStatement(t){let n=te(t.argument);n&&W(e,t.argument,n)}}}}),qs=t({create(e){return{CallExpression(t){l(t)&&ie(t.arguments)&&W(e,t,`Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.`)}}}}),Js=t({create(e){return{CallExpression(t){ee(t)&&W(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.`)}}}}),Ys=t({create(e){return{CallExpression(t){re(t)&&W(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.`)}}}}),Xs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Qt(n)&&W(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.")}}}}),Zs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExpressionStatement(n){t&&o(n.expression,`fork`)&&W(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.`)}}}}),Qs=t({create(e){let t=!1,n=n=>{if(!t)return;let r=$t(n.body);r&&W(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=G(e);n&&J(n)&&(t=!0)},ForStatement:n,ForInStatement:n,ForOfStatement:n,WhileStatement:n,DoWhileStatement:n}}}),$s=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&yn(n)&&W(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.`)}}}}),ec=t({create(e){let t=!1,n=new Map,r=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(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)||W(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.`)}}}}),tc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Sn(n)&&W(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.`)}}}}),nc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=jt(n);r&&W(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.`)}}}}),rc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=wt(n);r&&W(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.`)}}}}),ic=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(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&&W(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.`)}}}}),ac=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ot(n);r&&W(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.`)}}}}),oc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Wn(n)&&W(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.`)}}}}),sc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Gn(n)&&W(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.`)}}}}),cc=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(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&&W(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.`)}}}}),lc=t({create(e){let t=!1,r=[new Set],i=new WeakSet;return{ImportDeclaration(e){let n=G(e);n&&J(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),W(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.`))}}}}),uc=t({create(e){let t=!1,n=new WeakSet;return{ImportDeclaration(e){let n=G(e);n&&J(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),W(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.`))}}}}),dc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=nn(n);r&&M(r)&&W(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.`)}}}}),fc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=rn(n);r&&M(r)&&W(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.`)}}}}),pc=t({create(e){return{ImportExpression(t){W(e,t,`Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.`)}}}}),mc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||!o(n,`forkDaemon`)||c(a(n),`supervised`)||W(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 hc(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 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!1;if(n.add(t),h(t)){let e=t.parent;if(hc(e).some(e=>e===t))return!0}t=t.parent}return!1}const _c=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!Fn(n)||gc(n)||W(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 vc(e){return D(e,`Scope`,`make`)&&Array.isArray(e.arguments)}function yc(e,t){return D(e,`Scope`,`close`)&&n(a(e),t)}const bc=new Set([`BlockStatement`,`CatchClause`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`Program`,`SwitchStatement`]);function xc(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),bc.has(t.type??``)||h(t))return t;t=t.parent}}function Sc(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 Cc(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 X(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=>X(e)):[];case`AssignmentPattern`:return X(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`?X(t.value):t.type===`RestElement`?X(t.argument):[]}):[];case`RestElement`:return X(t.argument);case`TSParameterProperty`:return X(t.parameter);default:return[]}}function wc(e){return v(e.body,t=>typeof t==`object`&&!!t&&Tc(t).length>0&&kc(t)===e)}function Tc(e){return e.type===`VariableDeclarator`?X(e.id):e.type===`CatchClause`?X(e.param):(e.type===`ClassDeclaration`||e.type===`FunctionDeclaration`)&&n(e.id)?[e.id]:[]}function Ec(e){return e.type===`CatchClause`?xc(e.param):xc(e)}function Dc(e,t){if(!n(e))return;let r,i=-1;for(let a of wc(t)){if(!Tc(a).some(t=>n(t,e.name)))continue;let t=Ec(a);if(t===void 0||!Sc(e,t))continue;let o=Cc(t);o>i&&(r=a,i=o)}return r}function Oc(e,t){return e===t?!0:typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&e.argument===t}function kc(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 Ac(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)&&Oc(t.init,e))return t;if(h(t))return;t=t.parent}}function jc(e){let t=Ac(e),n=kc(e);if(t===void 0||n===void 0)return!1;let r=t.id.name;return v(n.body,e=>yc(e,r)&&kc(e)===n&&Dc(a(e),n)===t).length>0}function Mc(e){return(o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`acquireReleaseInterruptible`))&&Array.isArray(e.arguments)}function Nc(e,t,r){let i=a(e);return n(i,t.name)?Dc(i,r)===void 0&&Array.isArray(r.params)&&r.params.some(e=>e===t):!1}function Pc(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=>yc(n,t.name)&&kc(n)===e&&Nc(n,t,e)).length>0:!1})}function Fc(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`)||Mc(t)&&a(t)===e&&Pc(t))return!0;t=t.parent}return jc(e)}const Ic={"no-react-state":Aa,"no-if-statement":ja,"no-switch-statement":Ma,"no-ternary":Na,"no-return-null":Pa,"no-option-as":Fa,"no-effect-never":Ia,"no-arrow-ladder":La,"no-branch-in-object":Ra,"no-iife-wrapper":za,"no-return-in-arrow":Ba,"no-return-in-callback":Va,"no-effect-fn-generator":Ha,"no-effect-sync-console":Ua,"no-console-in-effect-flow":Wa,"no-effect-log-without-structured-context":Ga,"require-span-on-public-service-method":Ka,"no-runpromise-in-non-async-test-body":qa,"require-effect-flip-for-error-test":Ja,"no-test-mock-layer-when-default-available":Ya,"no-nested-effect-gen":Xa,"no-yield-without-star-in-effect-gen":Za,"no-piped-yield-in-gen":Qa,"no-gen-for-mapping":$a,"prefer-gen-for-workflow":eo,"no-large-anonymous-flow":to,"no-effect-in-flow":no,"prefer-named-flow":ro,"prefer-pipe-for-behavior":io,"prefer-decorated-effect-before-gen":ao,"no-workflow-in-behavior-pipe":oo,"no-mixed-pillar-function":so,"no-clever-effect-expression":co,"prefer-extracted-concept":lo,"prefer-effect-service":uo,"no-layer-provide-in-service-definition":fo,"require-service-accessors":po,"require-service-dependencies":mo,"no-namespace-effect-import":ho,"no-manual-service-object-export":go,"no-layer-merge-in-request-handler":xo,"no-service-method-returning-promise":So,"prefer-layer-pipe":_o,"no-inline-layer-provide-in-program":vo,"prefer-layer-mergeall-for-infrastructure":yo,"no-service-layer-scatter":bo,"no-match-void-branch":Co,"no-json-parse-without-schema":ks,"no-date-now-in-effect":As,"no-new-date-in-domain-logic":js,"no-match-effect-branch":wo,"warn-effect-sync-wrapper":To,"no-effect-side-effect-wrapper":Eo,"no-effect-all-step-sequencing":Do,"no-async-effect-combinator-callback":Oo,"no-throw-in-effect-logic":ko,"no-or-die-outside-boundary":Ao,"no-swallowed-catch-all":jo,"no-effect-ignore":Ro,"no-try-catch-in-effect-logic":zo,"no-promise-api-in-effect-logic":Bo,"no-try-catch":Vo,"no-effect-wrapper-alias":Ho,"no-manual-effect-channels":Uo,"no-wrapgraphql-catchall":Wo,"no-render-side-effects":Go,"no-atom-registry-effect-sync":Ko,"no-family-collection-read":qo,"no-inline-runtime-provide":Jo,"no-naked-object-state-update":Yo,"no-effect-succeed-variable":Xo,"no-effect-type-alias":Zo,"no-public-generic-effect-error":Qo,"no-early-catchall-null":Mo,"no-expected-state-as-error":No,"no-exception-domain-error":Po,"no-effect-fail-error-message":Fo,"no-catchall-generic-rethrow":Io,"no-log-only-error-handling":Lo,"no-error-as-public-effect-error":es,"no-unknown-public-error-channel":ts,"no-mixed-effect-error-shapes":ns,"no-model-overlay-cast":rs,"no-unknown-boolean-coercion-helper":is,"no-fromnullable-nullish-coalesce":as,"no-option-boolean-normalization":os,"no-string-sentinel-return":ss,"no-string-sentinel-const":cs,"no-raw-domain-id-alias":ls,"no-boolean-domain-flag":us,"no-magic-domain-string":ds,"no-raw-domain-primitive-params":fs,"no-raw-time-domain-field":ps,"no-hidden-effect-execution":Ts,"no-boundary-try-catch-without-effect-map":Os,"no-node-fs-in-effect-code":ws,"no-node-platform-in-shared-code":xs,"no-process-env-direct-read":Ss,"no-overloaded-options-object":Ms,"no-domain-logic-in-conditional":Ns,"no-implicit-state-machine-object":Ps,"no-adhoc-domain-error":Fs,"no-domain-meaning-by-folder-only":Is,"no-effect-as":Ls,"no-effect-do":Rs,"no-effect-bind":Bs,"no-runtime-runfork":Vs,"no-run-effect-outside-boundary":Hs,"no-effect-async":Us,"prevent-dynamic-imports":pc,"no-nested-effect-call":Ws,"no-effect-ladder":Gs,"no-flatmap-ladder":Ks,"no-pipe-ladder":qs,"no-call-tower":Js,"no-effect-orElse-ladder":Ys,"no-unbounded-effect-all":Xs,"no-fire-and-forget-fork":Zs,"no-fork-in-loop":Qs,"no-race-without-cleanup":$s,"no-unobserved-fiber":ec,"no-unbounded-concurrent-retry":tc,"no-blocking-call-in-effect":nc,"no-promise-concurrency-in-effect":rc,"no-shared-mutable-state-across-fibers":ic,"no-timeout-with-noninterruptible-promise":ac,"no-uninterruptible-concurrent-region":oc,"no-unbounded-queue-or-pubsub":sc,"no-global-mutable-concurrency-state":cc,"no-manual-deferred-coordination":lc,"no-acquire-without-scoped-release":uc,"no-manual-resource-close":_c,"no-unbound-scope":t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!vc(n)||Fc(n)||W(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:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!o(n,`succeed`)||!Pn(a(n))||W(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":dc,"no-yield-with-held-mutable-ref":fc,"no-unscoped-background-fiber":mc},Lc=[`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`],zc=[`no-early-catchall-null`];function Z(e){return Object.fromEntries(e.map(e=>[`linteffect/${e}`,`error`]))}function Q(e){return{jsPlugins:Bc,rules:e}}const Bc=[{name:`linteffect`,specifier:`@opsydyn/oxlint-effect`}],Vc=Z([`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`]),Hc=Z([`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`]),Uc=Z([`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`]),Wc=Z([`no-manual-resource-close`,`no-unbound-scope`,`no-resource-succeed-escape`]),Gc=Z([`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`]),Kc=Z([`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`]),qc=Z([`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`]),Jc=Z([`no-effect-sync-console`,`no-atom-registry-effect-sync`,`no-family-collection-read`,`no-naked-object-state-update`,`no-wrapgraphql-catchall`]),Yc=Z([`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`]),Xc=[`no-error-as-public-effect-error`,`no-unknown-public-error-channel`,`no-mixed-effect-error-shapes`,`no-expected-state-as-error`],$=Z([...Xc,`no-early-catchall-null`,`no-exception-domain-error`,`no-effect-fail-error-message`,`no-catchall-generic-rethrow`,`no-log-only-error-handling`]),Zc={...Yc,...$},Qc=Z([`no-piped-yield-in-gen`,`no-gen-for-mapping`,`prefer-gen-for-workflow`]),$c=Z([`no-large-anonymous-flow`,`no-effect-in-flow`,`prefer-named-flow`]),el=Z([`prefer-pipe-for-behavior`,`prefer-decorated-effect-before-gen`,`no-workflow-in-behavior-pipe`]),tl=Z([`no-mixed-pillar-function`,`no-clever-effect-expression`,`prefer-extracted-concept`]),nl=Z([`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`]),rl=Z([`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`]),il=Z([`no-console-in-effect-flow`,`no-effect-log-without-structured-context`,`require-span-on-public-service-method`,...Lc]),al=Z(Object.keys(Ic)),ol=[...Lc,...Rc,...zc,...Xc,`no-resource-succeed-escape`],sl=Z(Object.keys(Ic).filter(e=>!ol.includes(e))),cl={reactAndRuntimeBoundaries:Vc,effectComposition:Hc,concurrencySafety:Uc,resourceLifetime:Wc,pipelineShapeAndSequencing:Gc,branchingAndLocalControlFlow:Kc,optionMatchAndDataNormalization:qc,atomStateAndPlatformBoundaries:Jc,domainModeling:Yc,errorModeling:$,ddd:Zc,effectFlow:Qc,pureTransformation:$c,behaviorDecoration:el,styleSeparation:tl,serviceAndLayerArchitecture:nl,platformAndBoundaryHygiene:rl,testingObservabilityAndQa:il},ll=Q(sl),ul=Q(Vc),dl=Q(Hc),fl=Q(Uc),pl=Q(Wc),ml=Q(Gc),hl=Q(Kc),gl=Q(qc),_l=Q(Jc),vl=Q(Yc),yl=Q($),bl=Q(Zc),xl=Q(Qc),Sl=Q($c),Cl=Q(el),wl=Q(tl),Tl=Q(nl),El=Q(rl),Dl=Q(il),Ol={recommended:ll,reactAndRuntimeBoundaries:ul,effectComposition:dl,concurrencySafety:fl,resourceLifetime:pl,pipelineShapeAndSequencing:ml,branchingAndLocalControlFlow:hl,optionMatchAndDataNormalization:gl,atomStateAndPlatformBoundaries:_l,domainModeling:vl,errorModeling:yl,ddd:bl,effectFlow:xl,pureTransformation:Sl,behaviorDecoration:Cl,styleSeparation:wl,serviceAndLayerArchitecture:Tl,platformAndBoundaryHygiene:El,testingObservabilityAndQa:Dl};var kl=e({meta:{name:`linteffect`},rules:Ic});export{al as allRules,_l as atomStateAndPlatformBoundaries,Jc as atomStateAndPlatformBoundariesRules,Cl as behaviorDecoration,el as behaviorDecorationRules,hl as branchingAndLocalControlFlow,Kc as branchingAndLocalControlFlowRules,fl as concurrencySafety,Uc as concurrencySafetyRules,bl as ddd,Zc as dddRules,kl as default,vl as domainModeling,Yc as domainModelingRules,dl as effectComposition,Hc as effectCompositionRules,xl as effectFlow,Qc as effectFlowRules,yl as errorModeling,$ as errorModelingRules,Bc as jsPlugins,gl as optionMatchAndDataNormalization,qc as optionMatchAndDataNormalizationRules,ml as pipelineShapeAndSequencing,Gc as pipelineShapeAndSequencingRules,El as platformAndBoundaryHygiene,rl as platformAndBoundaryHygieneRules,Ol as presets,Sl as pureTransformation,$c as pureTransformationRules,ul as reactAndRuntimeBoundaries,Vc as reactAndRuntimeBoundariesRules,ll as recommended,sl as recommendedRules,pl as resourceLifetime,Wc as resourceLifetimeRules,cl as ruleGroups,Tl as serviceAndLayerArchitecture,nl as serviceAndLayerArchitectureRules,wl as styleSeparation,tl as styleSeparationRules,Dl as testingObservabilityAndQa,il 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 h(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)&&we.has(t.name)}function Ee(e){if(l(e))return h(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 m(e)||f(e,`YieldExpression`)||f(e,`AwaitExpression`)||ke(e)||k(e)||p(e,`Promise`)||p(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([`Date`,`Runtime`,`fetch`,`import`,`queueMicrotask`,`require`,`setInterval`,`setTimeout`]);function Pe(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e.callee;if(n(t))return t.name;if(typeof t==`object`&&t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.property))return t.property.name}function Fe(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=Pe(e);return!m(e)&&!f(e,`AwaitExpression`)&&!f(e,`YieldExpression`)&&!p(e,`Promise`)&&!k(e)&&!Ne.has(t??``)&&!(typeof e.callee==`object`&&e.callee!==null&&n(e.callee.object,`console`))}function Ie(e){if(!Fe(e))return 0;let t=e;return[t.callee,...t.arguments??[]].filter(e=>!v(e)).reduce((e,t)=>Math.max(e,Ie(t)),0)+1}function Le(e){if(!(Ie(e)<3))return Fe(typeof e==`object`&&e?e.parent:void 0)?void 0:e}function Re(e){if(l(e))for(let t of h(e)){if(!o(t,`flatMap`))continue;let e=t.arguments.find(v);if(!e)continue;let n=e.body,r=[`IfStatement`,`SwitchStatement`,`ForStatement`,`ForInStatement`,`ForOfStatement`,`WhileStatement`,`DoWhileStatement`].some(e=>f(n,e)),a=b(n,nt)!==void 0,s=x(n,i).length;if(r||a||s>=2)return e}}const ze=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)&&ze.has(t.name)}function Be(e){return i(e)||l(e)}function Ve(e){if(!g(e))return;let t=e.arguments[0];return Be(t)?e:void 0}function He(e){return typeof e!=`object`||!e||e.type!==`YieldExpression`||e.delegate!==!0||!l(e.argument)?!1:h(e.argument).some(e=>g(e))}function Ue(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Ue(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),He(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:Ue(n,t)))}function We(e){let t=d(e,`gen`);if(!t)return;let n=Ue(t.body);return n.length>=2?n[1]:void 0}function Ge(e){if(!l(e))return;let t=h(e);if(!t.some(e=>g(e)))return;let n=t.filter(e=>Te(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 _(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`),(O(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 Ke(e){if(!v(e))return;let t=e.body;return _(t).size>=3?e:void 0}function qe(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,qe(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,qe(r,t)),0);return e.type===`CallExpression`?n+1:n}function Je(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=_(e),n=oe(e)||se(e)!==void 0;return t.size>=2&&(qe(e)>=4||n)?e:void 0}function Ye(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 Xe(e){return r(e,`Effect`,`Service`)?!0:typeof e!=`object`||!e||e.type!==`CallExpression`?!1:Xe(e.callee)}function Ze(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Xe(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 Ze(e.superClass)}function Qe(e){return O(e,`Context`,`Tag`)||O(e,`Context`,`GenericTag`)}function $e(e,t=new WeakSet){return O(e,`Layer`,`provide`)?!0:Array.isArray(e)?e.some(e=>$e(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&$e(n,t)))}function et(e){return R(L(e,`accessors`),!0)}function tt(e){if(!J(G(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 nt(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 rt(e){if(!L(e,`dependencies`))return b(L(e,`effect`)??L(e,`scoped`),nt)}function it(e){if(!O(e,`Layer`))return!1;let t=e.callee.property;return n(t)&&(t.name===`provide`||t.name.startsWith(`merge`))}function at(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 ot(e){if(at(e))return b(e.body,it)?e:void 0}function st(e){if(O(e,`Layer`,`provide`))return b(a(e),t=>t!==e&&O(t,`Layer`,`provide`))}function ct(e){return o(e,`provide`)||O(e,`Layer`,`provide`)}function lt(e){let t=d(e,`gen`);return t?b(t.body,ct):void 0}function ut(e){if(O(e,`Layer`,`merge`))return e.arguments?.find(t=>b(t,t=>t!==e&&O(t,`Layer`,`merge`)))}function dt(e){return n(e)&&/(Layer|Live)$/.test(e.name)}function ft(e){if(!(typeof e!=`object`||!e||e.type!==`VariableDeclaration`))return e.declarations?.find(e=>typeof e==`object`&&!!e&&dt(e.id)&&b(e.init,ct))}function pt(e){return v(e)?ur(pr(e),`Promise`)||C(e.body)!==void 0:!1}function mt(e){return typeof e==`object`&&!!e&&e.type===`Property`&&pt(e.value)}function ht(e){return b(e,mt)}function gt(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 _t(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`)&&gt(e.init))return e}}function vt(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 yt(e){if(!i(e))return;let t=e.callee.property;if(!(!n(t)||!S.has(t.name)))return e.arguments.find(e=>vt(e))}function bt(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=bt(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=bt(r,t);if(e)return e}}}function xt(e){let t=d(e,`gen`);if(t)return bt(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=F(t),n=e?bt(e):void 0;if(n)return n}}function St(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=St(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=St(r,t);if(e)return e}}}function Ct(e){let t=d(e,`gen`);if(t)return St(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=F(t),n=e?St(e):void 0;if(n)return n}}function wt(e){return O(e,`Promise`,`all`)||O(e,`Promise`,`allSettled`)||O(e,`Promise`,`any`)||O(e,`Promise`,`race`)||O(e,`Promise`,`reject`)||O(e,`Promise`,`resolve`)}function Tt(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 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),wt(e)||Tt(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 Et(e){let t=d(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=F(t),n=e?C(e):void 0;if(n)return n}}const Dt=new Set([`all`,`allSettled`,`any`,`race`]);function Ot(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)&&Dt.has(t.property.name)}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),Ot(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 kt(e){let t=d(e,`gen`);if(t)return w(t.body);if(o(e,`sync`)){let t=F(a(e));return t?w(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=F(t),n=e?w(e):void 0;if(n)return n}}function At(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 jt(e){if(!o(e,`tryPromise`))return!1;let t=a(e);return At(t)?!0:At(L(t,`try`))}function Mt(e){return o(e,`promise`)?!0:o(e,`tryPromise`)&&!jt(e)}function Nt(e){if(!o(e,`timeout`))return;let t=a(e);return Mt(t)?t:void 0}const Pt=new Set([`crypto`,`fs`,`zlib`]);function Ft(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 Pt.has(r)&&i.endsWith(`Sync`)}function It(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=It(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),Ft(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=It(r,t);if(e)return e}}}function Lt(e){let t=d(e,`gen`);if(t)return It(t.body);if(o(e,`sync`)){let t=F(a(e));return t?It(t):void 0}}const Rt=new Set([`runCallback`,`runFork`,`runPromise`,`runPromiseExit`,`runSync`,`runSyncExit`]);function T(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Rt.has(t.name)}function zt(e){return r(e,`Effect`,`orDie`)||r(e,`Effect`,`orDieWith`)||o(e,`orDie`)||o(e,`orDieWith`)}function Bt(e){if(zt(e))return e;if(l(e))return N(e).find(e=>zt(e))}function Vt(e){return o(e,`succeed`)||o(e,`asVoid`)||o(e,`ignore`)||ai(e)}function Ht(e){if(!o(e,`catchAll`))return;let t=F(a(e));return Vt(t)?t:void 0}function Ut(e){return r(e,`Effect`,`ignore`)||o(e,`ignore`)}function Wt(e){if(Ut(e))return e;if(l(e))return N(e).find(e=>Ut(e))}function E(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 Gt(e){if(me(e))return x(e.arguments,E);let t=y(e);return t?x(L(t,`effect`)??L(t,`scoped`),E):[]}const Kt=new Set([`catchAll`,`catchTag`,`catchTags`,`tapError`]);function qt(e){return I(e)||typeof e==`object`&&!!e&&e.type===`TemplateLiteral`}function Jt(e){return o(e,`logError`)||o(e,`logWarning`)}function Yt(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`}function Xt(e,t){return b(e,e=>o(e,`annotateLogs`))?!0:t.arguments.slice(1).some(e=>Yt(e)||!qt(e))}function Zt(e){return x(e,t=>Jt(t)&&qt(a(t))&&!Xt(e,t))}function Qt(e){if(!i(e))return[];let t=e.callee.property;return!n(t)||!Kt.has(t.name)?[]:e.arguments.map(F).filter(e=>e!==void 0)}function D(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&n(r.callee,t)}function O(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 $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,`Effect`)||!n(t.callee.property)?!1:t.callee.property.name.startsWith(`log`)}function k(e,t=new WeakSet){return E(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,`setState`)||O(e,`Atom`,`set`)||D(e,`invalidate`)||$t(e)||E(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 en(e,t=new WeakSet){return O(e,`Ref`,`set`)||O(e,`Atom`,`set`)||O(e,`SubscriptionRef`,`set`)||O(e,`Reactivity`,`invalidate`)||O(e,`Fiber`,`interrupt`)||$t(e)?!0:Array.isArray(e)?e.some(e=>en(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&en(n,t)))}function tn(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 nn(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 rn(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 an(e){return o(e,`all`)&&rn(a(e))&&!nn(e.arguments[1])}function on(e,t=new WeakSet){if(o(e,`fork`))return e;if(Array.isArray(e)){for(let n of e){let e=on(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=on(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 sn=new Set([`sleep`,`await`,`promise`,`tryPromise`,`fork`,`forkDaemon`,`forkScoped`,`all`,`forEach`,`race`,`raceAll`]),cn=new Set([`modifyEffect`,`modifySomeEffect`,`updateEffect`,`updateAndGetEffect`]);function ln(e,t=new WeakSet){if(i(e)){let t=e.callee.property;if(n(t)&&sn.has(t.name))return!0}return O(e,`Queue`,`take`)||O(e,`Deferred`,`await`)?!0:Array.isArray(e)?e.some(e=>ln(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ln(n,t)))}function M(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 un(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((M(e,`withPermit`)||M(e,`withPermits`))&&t.arguments.length>0)return t.arguments[0]}if(O(t,`TSemaphore`,`withPermit`)||O(t,`TSemaphore`,`withPermits`))return t.arguments[0];if(M(t,`withPermit`)||M(t,`withPermits`))return t.arguments.at(-1)}}function dn(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(fn(e,`SynchronizedRef`)&&t.arguments.length>0)return e.arguments.at(-1)}if(fn(t,`SynchronizedRef`)&&t.arguments.length>1||pn(t)&&!mn(t))return t.arguments.at(-1)}}function fn(e,t){return[...cn].some(n=>O(e,t,n))}function pn(e){return[...cn].some(t=>M(e,t))}function mn(e){return[...cn].some(t=>O(e,`SynchronizedRef`,t))}const hn=new Set([`make`,`unsafeMake`,`makeUnsafe`]),gn=new Set([`timeout`,`timeoutOption`,`timeoutFail`,`timeoutFailCause`,`timeoutTo`]),_n=new Set([`race`,`raceFirst`,`raceAll`,`interruptible`,`scoped`]);function vn(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 yn(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)&&hn.has(r.property.name)}function bn(e){return O(e,`Deferred`,`await`)&&Array.isArray(e.arguments)}function xn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;if(!(!n(t.id)||!b(t.init,yn)))return t.id.name}function Sn(e,t){return!!b(e,e=>{if(!O(e,`Effect`,`addFinalizer`)&&!O(e,`Scope`,`addFinalizer`))return!1;let n=e.arguments;return Array.isArray(n)&&n.some(e=>{let n=F(e);return n!==void 0&&p(n,t)})})}function Cn(e){if(!l(e))return!1;let t=e.arguments;return Array.isArray(t)&&t.some(e=>vn(e,`scoped`))}function wn(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)&&(gn.has(e.name)||_n.has(e.name))})()||Cn(r)||v(r)&&Sn(r,t))return!0;r=r.parent}return!1}const Tn=new Set([`acquireRelease`,`acquireUseRelease`,`ensuring`,`forkIn`,`forkScoped`,`scoped`]);function En(e){return!o(e,`race`)&&!o(e,`raceAll`)?!1:!j(e.arguments,Tn)}function Dn(e){return o(e,`forEach`)&&!nn(e.arguments[2])}const On=new Set([`retry`]);function kn(e){return(an(e)||Dn(e))&&j(e.arguments,On)}function An(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 jn(e,t=new Set,n=new WeakSet){if(Array.isArray(e)){for(let r of e)jn(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 An(e))t.add(n);for(let[r,i]of Object.entries(e))r!==`parent`&&jn(i,t,n);return t}const Mn=new Set([`add`,`clear`,`delete`,`pop`,`push`,`reverse`,`set`,`shift`,`sort`,`splice`,`unshift`]);function Nn(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)&&Mn.has(t.callee.property.name))return t.callee.object.name}function Pn(e,t,n=jn(e),r=new WeakSet){if(Array.isArray(e)){for(let i of e){let e=Pn(i,t,n,r);if(e)return e}return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let i=Nn(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=Pn(a,t,n,r);if(e)return e}}function Fn(e){if(o(e,`fork`)||o(e,`all`)||o(e,`forEach`))return e.arguments}const In=new Set([`fork`,`forkScoped`,`forkDaemon`,`all`,`forEach`,`race`,`raceFirst`,`raceAll`]),Ln=new Set([`open`,`connect`,`create`,`start`,`listen`,`subscribe`,`acquire`]),Rn=new Set([`client`,`connection`,`conn`,`pool`,`db`,`database`,`file`,`socket`,`stream`,`server`,`subscription`,`handle`]),zn=new Set([`close`,`destroy`,`dispose`,`cleanup`]);function Bn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function Vn(e){return Bn(e).some(e=>Rn.has(e))}function Hn(e){if(n(e))return Vn(e.name);if(!Y(e))return!1;let t=e;return t.computed===!0?!1:n(t.property)&&Vn(t.property.name)||Hn(t.object)}function Un(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 zn.has(r.property.name)&&Hn(r.object)}function Wn(e){if(!i(e))return;let t=e.callee.property;return n(t)&&In.has(t.name)?e.arguments:void 0}function Gn(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:Bn(r).some(e=>Ln.has(e))&&Vn(r)}function Kn(e,t){return o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`scoped`)||Cn(e)?!0:t!==void 0&&Sn(e,t)}function qn(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,Gn)&&Sn(e,i.id.name)&&t.add(i.id.name)}return t}function Jn(e,t,r=new WeakSet,i=new Set,a=!1){if(Array.isArray(e)){for(let n of e)Jn(n,t,r,i,a);return}if(typeof e!=`object`||!e||r.has(e)||(r.add(e),Kn(e)))return;let o=new Set(i);if(v(e))for(let t of qn(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(Gn(e)&&!a){t.push(e);return}for(let[n,i]of Object.entries(e))n!==`parent`&&Jn(i,t,r,o,a||c)}function Yn(e){let t=[];return Jn(e,t),t}const Xn=new Set([`all`,`forEach`,`fork`,`race`,`raceAll`]);function Zn(e,t=new WeakSet){return j(e,Xn)||O(e,`Queue`,`take`)?!0:Array.isArray(e)?e.some(e=>Zn(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Zn(n,t)))}function Qn(e){return o(e,`uninterruptible`)&&Zn(e.arguments[0])}function $n(e){return O(e,`Queue`,`unbounded`)||O(e,`PubSub`,`unbounded`)}function er(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 tr(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`?An(e):r.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)&&er(e.init)?[t.name]:[]})}function nr(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 rr=new Set([`await`,`interrupt`,`join`]);function ir(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)||!rr.has(r.property.name)||!Array.isArray(t.arguments))return;let[i]=t.arguments;return n(i)?i.name:void 0}function ar(e){return r(e,`Effect`,`asVoid`)||O(e,`Effect`,`asVoid`)}function or(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=>ar(e))}function N(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 sr(e){let[t]=N(e);return t!==void 0&&m(t)}function cr(e){if(sr(e))return!0;if(typeof e==`object`&&e&&e.type===`ArrowFunctionExpression`){let t=e.body;return i(t)||sr(t)}return!1}function lr(e){return u(e).some(e=>typeof e==`object`&&!!e&&(cr(e.argument)||i(e.argument)))}function P(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 ur(e,t){return typeof e==`object`&&!!e&&e.type===`TSTypeReference`&&n(e.typeName,t)}function dr(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 fr(e){return n(e,`Error`)||ur(e,`Error`)}function pr(e){if(typeof e!=`object`||!e)return;let t=e.returnType;if(!(typeof t!=`object`||!t))return t.typeAnnotation??t}function mr(e,t){return P(pr(e),`Effect`,`Effect`)||P(t,`Effect`,`Effect`)}function hr(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 gr(e){return hr(e).filter(e=>i(e)||sr(e))}function _r(e){return o(e,`withSpan`)||l(e)&&N(e).some(e=>o(e,`withSpan`))}function vr(e,t){if(!mr(e,t))return;let n=gr(e);return n.length===0||n.some(e=>!_r(e))?e:void 0}function yr(e){if(typeof e!=`object`||!e)return;let t=e.typeAnnotation;if(!(typeof t!=`object`||!t))return pr(t.typeAnnotation??t)}function br(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:yr(e.id)}]:[]}):[]}function xr(e){let t=L(e,`effect`)??L(e,`scoped`),n=d(t,`gen`),r=n?hr(n).find(Yt):o(t,`succeed`)&&Yt(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 Sr(e){return gr(e).some(e=>!_r(e))?e:void 0}function Cr(e,t){let n=pr(e)??t;if(!P(n,`Effect`,`Effect`))return;let[,r]=dr(n);return r===void 0?void 0:{annotation:n,errorChannel:r}}function wr(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`?[]:br(t).flatMap(({functionNode:e,declaredReturnType:t})=>{let n=Cr(e,t);return n?[n]:[]})}function Tr(e){return wr(e).find(e=>fr(e.errorChannel))?.annotation}function Er(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 Dr(e){let t=Er(e);if(fr(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 Or(e){let t=Er(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=Dr(e);return t?[t]:[]})):new Set}function kr(e,t,n,r=new WeakSet){return P(e,t,n)?!0:Array.isArray(e)?e.some(e=>kr(e,t,n,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,i])=>e!==`parent`&&kr(i,t,n,r)))}function Ar(e,t=new WeakSet){return D(e,`wrapGraphqlCall`)?!0:Array.isArray(e)?e.some(e=>Ar(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Ar(n,t)))}function jr(e){return o(e,`flatMap`)&&n(a(e),`applyResponse`)}function Mr(e,t=new WeakSet){return jr(e)?!0:Array.isArray(e)?e.some(e=>Mr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Mr(n,t)))}function Nr(e,t=new WeakSet){if(o(e,`catchAll`))return e;if(Array.isArray(e)){for(let n of e){let e=Nr(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=Nr(r,t);if(e)return e}}}function Pr(e){let t=N(e);if(t.length===0)return;let n=Nr(t);if(n)return Ar(t)||Mr(t)?n:void 0}const Fr=new Set([`get`,`set`,`update`,`modify`,`refresh`]);function F(e){if(typeof e!=`object`||!e)return;let t=e;if(!(t.type!==`ArrowFunctionExpression`&&t.type!==`FunctionExpression`))return t.body}function Ir(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)&&Fr.has(r.property.name)}function Lr(e,t=new WeakSet){if(Ir(e))return e;if(Array.isArray(e)){for(let n of e){let e=Lr(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=Lr(r,t);if(e)return e}}}function Rr(e){if(!o(e,`sync`))return;let t=F(a(e));return t?Lr(t):void 0}function zr(e){return n(e)?/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name):!1}function Br(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 zr(i)?i:void 0}function Vr(e,t=new WeakSet){let n=Br(e);if(n)return n;if(Array.isArray(e)){for(let n of e){let e=Vr(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=Vr(r,t);if(e)return e}}}function Hr(e){return o(e,`provide`)&&e.arguments.length===1}function Ur(e){if(l(e))return N(e).find(e=>Hr(e))}function Wr(e,t=new WeakSet){return typeof e==`object`&&e&&e.type===`SpreadElement`?!0:Array.isArray(e)?e.some(e=>Wr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Wr(n,t)))}function Gr(e){if(!O(e,`Ref`,`update`)&&!O(e,`Ref`,`modify`))return!1;let t=e.arguments[1];return Wr(F(t))}function Kr(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`&&Array.isArray(e.properties)&&e.properties.length===0}function qr(e,t=new WeakSet){return O(e,`Object`,`entries`)?!0:Array.isArray(e)?e.some(e=>qr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&qr(n,t)))}function Jr(e){if(Gr(e))return!0;if(O(e,`Object`,`assign`)){let t=e.arguments;return t.length>=3&&Kr(t[0])}return O(e,`Object`,`fromEntries`)?qr(e.arguments[0]):O(e,`JSON`,`stringify`)||O(e,`JSON`,`parse`)}function Yr(e){return n(e)?!0:typeof e==`object`&&!!e&&e.type===`MemberExpression`}function Xr(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 Zr(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 Qr(e){return z(e,`orElse`)&&ha(B(e.arguments[0]))}function I(e){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`StringLiteral`)&&typeof e.value==`string`}function $r(e){return n(e,`undefined`)}function ei(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&e.operator===`??`&&(ha(e.right)||$r(e.right))}function ti(e){return O(e,`Option`,`fromNullable`)&&ei(e.arguments[0])}function L(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 ni(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return t.operator===`===`&&(R(t.left,!0)||R(t.right,!0))}function ri(e){if(!O(e,`Option`,`match`))return!1;let t=e.arguments[1],n=L(t,`onSome`),r=L(t,`onNone`);return ni(B(n))&&R(B(r),!1)}function ii(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>typeof e==`object`&&!!e&&I(e.init))??!1}function R(e,t){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`BooleanLiteral`)&&e.value===t}function ai(e){return r(e,`Effect`,`void`)}function z(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 B(e){if(!(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`))return e.body}function oi(e){if(!z(e))return!1;let[t,r]=e.arguments;return n(e.callee.property,`when`)?(R(t,!0)||R(t,!1))&&ai(B(r)):n(e.callee.property,`orElse`)&&ai(B(t))}const si=[`flatMap`,`map`,`andThen`,`tap`,`zipRight`];function ci(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 li(e,t=new WeakSet){return si.some(t=>o(e,t))||l(e)||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){return m(e)&&li(e)}function di(e,t=new WeakSet){return z(e)&&ui(n(e.callee.property,`when`)?B(e.arguments[1]):B(e.arguments[0]))?!0:Array.isArray(e)?e.some(e=>di(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&di(n,t)))}function fi(e,t=new WeakSet){return z(e)?!0:Array.isArray(e)?e.some(e=>fi(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&fi(n,t)))}function pi(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&r(e.callee,`Option`,`match`)}function mi(e){let t=B(e);return typeof t==`object`&&!!t&&t.type===`CallExpression`}function hi(e,t=new WeakSet){if(o(e,`gen`))return e;if(Array.isArray(e)){for(let n of e){let e=hi(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=hi(r,t);if(e)return e}}}function gi(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 _i(e){return gi(e)||typeof e==`object`&&!!e&&e.type===`CallExpression`&&(r(e.callee,`Option`,`match`)||r(e.callee,`Either`,`match`))}function vi(e,t=new WeakSet){return _i(e)?!0:Array.isArray(e)?e.some(e=>vi(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&vi(n,t)))}function yi(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 bi(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 xi(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 Si(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 Ci(e){let t=Si(e);return t?.type===`TSStringKeyword`||t?.type===`TSNumberKeyword`}function wi(e){let t=Si(e);return t?.type===`TSAnyKeyword`||t?.type===`TSObjectKeyword`}function Ti(e){let t=Si(e);return t?.type===`TSTypeReference`&&n(t.typeName,`Date`)}function Ei(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)&&Ci(e.typeAnnotation)&&t.test(e.name))}function Di(e){return Ei(e).length>=3}function Oi(e){return n(e)?/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&xi(e.typeAnnotation):!1}function ki(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(Oi)}function Ai(e){if(n(e))return e.name;if(typeof e==`object`&&e&&typeof e.value==`string`)return e.value}function ji(e){return/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(e)}function Mi(e){if(typeof e!=`object`||!e||e.type!==`TSPropertySignature`)return!1;let t=e,n=Ai(t.key),r=t.typeAnnotation;return n!==void 0&&ji(n)&&(Ci(r)||Ti(r))}function Ni(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 Pi(e){return n(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function Fi(e){let t=Ni(e);return t.length===1&&Ai(t[0].key)===`_tag`}function Ii(e){let t=typeof e==`object`&&e?e.superTypeArguments:void 0,n=typeof t==`object`&&t?t.params??t.arguments:void 0,r=Array.isArray(n)?n:dr(e);if(r.length===0)return!0;let i=r[0];return typeof i==`object`&&!!i&&(i.type===`TSObjectKeyword`||i.type===`TSTypeLiteral`&&Ni(i).length===0)}function Li(e){if(typeof e!=`object`||!e)return;let t=e;if((t.type===`TSTypeAliasDeclaration`||t.type===`TSInterfaceDeclaration`)&&Pi(t.id)&&Fi(t.type===`TSTypeAliasDeclaration`?t.typeAnnotation:t)||t.type===`ClassDeclaration`&&O(t.superClass,`Data`,`TaggedError`)&&Ii(t))return e}function Ri(e){return Ni(e).filter(Mi)}function zi(e){return n(e)?/^(?:opts|options|config)$/i.test(e.name)&&wi(e.typeAnnotation):!1}function Bi(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(zi)}const Vi=new Set([`==`,`===`,`!=`,`!==`,`>`,`>=`,`<`,`<=`]);function V(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+V(n,t),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=e;return n.type===`BinaryExpression`&&Vi.has(String(n.operator))?1:n.type===`LogicalExpression`?V(n.left,t)+V(n.right,t):0}function Hi(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&V(e)>=3}function Ui(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 H(e,t=new Map,n=new WeakSet){let r=Ui(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)H(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`?(H(i.left,t,n),H(i.right,t,n),t):t}function Wi(e){return typeof e!=`object`||!e||e.type!==`LogicalExpression`?!1:Array.from(H(e).values()).some(e=>e.size>=2)}function Gi(e){return o(e,`fail`)&&I(a(e))}function Ki(e){return n(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function qi(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return!1;let t=e;return t.computed!==!0&&n(t.property,`message`)&&Ki(t.object)}function U(e){if(qi(e))return!0;if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`BinaryExpression`&&t.operator===`+`?U(t.left)||U(t.right):t.type===`TemplateLiteral`&&Array.isArray(t.expressions)&&t.expressions.some(e=>U(e))}function Ji(e){return o(e,`fail`)&&U(a(e))}function Yi(e){return typeof e==`object`&&!!e&&e.type===`NewExpression`&&n(e.callee,`Error`)}function Xi(e){return o(e,`fail`)&&Yi(a(e))}function Zi(e,t){if(!i(e))return[];let r=e.callee.property;return!n(r)||!t.has(r.name)?[]:e.arguments.filter(v)}function Qi(e){for(let t of Zi(e,new Set([`catchAll`]))){let e=F(t);if(Xi(e))return e;for(let t of u(e))if(Xi(t.argument))return t.argument}}const $i=new Set([`catchSome`,`catchTag`,`catchTags`,`fail`,`mapBoth`,`mapError`]);function ea(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&$i.has(t.name)}function ta(e){for(let t of Zi(e,new Set([`catchAll`,`tapError`]))){let e=F(t),n=b(e,$t);if(n&&!b(e,ea))return n}}const na=new Set([`catchAll`]),ra=new Set([`NotFound`,`Missing`,`Empty`,`None`]);function ia(e){return ha(e)||$r(e)||n(e)&&/(?:fallback|default)/i.test(e.name)}function aa(e){return o(e,`succeed`)&&ia(a(e))}function oa(e){for(let t of Zi(e,na)){let e=F(t);if(aa(e))return e;for(let t of u(e))if(aa(t.argument))return t.argument}}function sa(e){if(!o(e,`fail`))return!1;let t=a(e);return I(t)&&ra.has(String(t.value))}function ca(e){if(typeof e!=`object`||!e||e.type!==`NewExpression`)return!1;let t=e.callee;return n(t)&&/(?:Error|Exception)$/.test(t.name)}function la(e){return typeof e!=`object`||!e||e.type!==`ThrowStatement`?!1:ca(e.argument)}function ua(e){let t=d(e,`gen`);if(t)return b(t.body,la);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=F(t),n=e?b(e,la):void 0;if(n)return n}}function da(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)&&I(t.arguments[0])}function fa(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?!1:e.params.some(e=>n(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&Ci(e.typeAnnotation))}function pa(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)&&fa(e)}function ma(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return[`==`,`===`,`!=`,`!==`].includes(String(t.operator))&&(I(t.left)||I(t.right))&&!Zr(t)}function W(e,t,n){e.report({message:n,node:t})}function ha(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`NullLiteral`||t.type===`Literal`&&t.value===null}function G(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 ga=[`bin/**`,`scripts/**`,`cli/**`,`**/main.ts`,`app/api/**/route.ts`,`server/**`,`*.test.ts`,`*.spec.ts`],_a=[`**/*.test.*`,`**/*.spec.*`,`**/__tests__/**`],va=[`**/config/**`,`**/*Config.ts`,`**/*ConfigLayer.ts`],K=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}],ya=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}},configPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}];function ba(e){let t=e.options[0];return typeof t==`object`&&t?t:{}}function xa(e,t){let n=e[t];return Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:void 0}function Sa(e){return e.replace(/\\/g,`/`).replace(/^\.\/+/,``).replace(/\/{2,}/g,`/`).replace(/\/$/,``)}function Ca(e){return e.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`[^/]*`)}function wa(e){let t=Sa(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+=Ca(t)}return RegExp(`${a}$`)}function Ta(e,t){return wa(t).test(Sa(e))}function Ea(e){return xa(ba(e),`boundaryPaths`)??ga}function q(e){return Ea(e).some(t=>Ta(e.filename,t))}function Da(e){return _a.some(t=>Ta(e.filename,t))}function Oa(e){return xa(ba(e),`configPaths`)??va}function ka(e){return Oa(e).some(t=>Ta(e.filename,t))}function J(e){return e===`effect`||e.startsWith(`effect/`)||e===`@effect-atom/atom-react`}function Aa(e){if(!D(e,`it`)&&!D(e,`test`)&&!D(e,`specify`)&&!D(e,`bench`))return;let t=e.arguments?.at(-1);return v(t)?t:void 0}function ja(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 Ma(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 Na(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`||e.computed===!0||!n(e.property,`rejects`))return!1;let t=e.object;if(!D(t,`expect`))return!1;let r=t.arguments;if(!Array.isArray(r))return!1;let i=r[0];return o(i,`runPromise`)}function Pa(e){return typeof e==`object`&&!!e&&e.type===`MemberExpression`&&e.computed!==!0&&n(e.property,`Default`)}function Fa(e){return O(e,`Layer`,`succeed`)||O(e,`Layer`,`effect`)}function Ia(e){if(!O(e,`Layer`,`provide`))return[];let t=e.arguments;return!Array.isArray(t)||!t.some(Pa)?[]:t.filter(Fa)}function La(e){let t=G(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=G(e);t&&J(t)&&(r=!0)},[e](e){r&&W(t,e,n)}}}})}const za=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&&za.has(i)&&W(e,r,`Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.`)}}}}),Va=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.`),Ha=Ra(`SwitchStatement`,`Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.`),Ua=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.`),Wa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ReturnStatement(n){t&&ha(n.argument)&&W(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.`)}}}}),Ga=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&r(n.callee,`Option`,`as`)&&W(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.`)}}}}),Ka=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},MemberExpression(n){t&&r(n,`Effect`,`never`)&&W(e,n,`Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.`)}}}}),qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t||!ae(n))return;let r=se(n.callee.body);r&&W(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.`)}}}}),Ja=t({create(e){return{ObjectExpression(t){yi(t).some(e=>vi(e))&&W(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.`)}}}}),Ya=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&oe(n)&&W(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.`)}}}}),Xa=t({create(e){return{CallExpression(t){for(let n of le(t))W(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).`)}}}}),Za=t({create(e){return{CallExpression(t){for(let n of ue(t))W(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.`)}}}}),Qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&fe(n,`fn`)&&W(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.`)}}}}),$a=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&o(n,`sync`)&&k(a(n))&&W(e,n,`Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.`)}}}}),eo=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Gt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){i(e)},ClassDeclaration(e){i(e)},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.`)}}}}),to=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Zt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){for(let t of Qt(e))i(t)},ClassDeclaration(e){let t=y(e);t&&i(L(t,`effect`)??L(t,`scoped`))},"Program:exit"(){if(t)for(let t of n)W(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(...).`)}}}}),no=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=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(e){for(let t of br(e))i(vr(t.functionNode,t.declaredReturnType))},ExportDefaultDeclaration(e){for(let t of br(e))i(vr(t.functionNode,t.declaredReturnType))},ClassDeclaration(e){let t=y(e);if(t)for(let e of xr(t))i(Sr(e))},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).`)}}}}),ro=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){if(!Da(e))return;let r=Aa(t),i=r&&ja(r);i&&n.push(i)},"Program:exit"(){if(t)for(let t of n)W(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.`)}}}}),io=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){if(!Da(e))return;let r=Aa(t);r&&n.push(...Ma(r,Na))},"Program:exit"(){if(t)for(let t of n)W(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.`)}}}}),ao=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){Da(e)&&n.push(...Ia(t))},"Program:exit"(){if(t)for(let t of n)W(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.`)}}}}),oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=d(n,`gen`);if(!t||!r)return;let i=hi(r.body);i&&W(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.`)}}}}),so=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ve(n);r&&W(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`.")}}}}),co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=be(n);r&&W(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.`)}}}}),lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ce(n);r&&W(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.`)}}}}),uo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ee(n);r&&W(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.`)}}}}),fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Oe(n)&&W(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.`)}}}}),po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=je(n);r&&W(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.`)}}}}),mo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Me(n);r&&W(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.`)}}}}),ho=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Le(n);r&&W(e,r,`Rule: prefer flow for a deep pure call pipeline. Why: nested transformation towers hide the data pipeline and make reuse difficult. Fix: name the pure steps and compose them with flow, or keep the pipeline short.`)}}}}),go=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Re(n);r&&W(e,r,`Rule: keep business workflow logic out of Effect.pipe callbacks. Why: branching, service lookup, and multi-step effects are hard to read as decoration. Fix: move the workflow into Effect.gen and reserve pipe for behavior around the completed effect.`)}}}}),_o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ve(n);r&&W(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)`.")}}}}),vo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=We(n);r&&W(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.`)}}}}),yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ge(n);r&&W(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.`)}}}}),bo=t({create(e){let t=!1;function n(n){let r=Ke(n);t&&r&&W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=Je(n);t&&r&&W(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.`)}}}}),So=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=Ye(n);t&&r&&W(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.`)}}}}),Co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Qe(n)&&W(e,n,`Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.`)}}}}),wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n);t&&r&&$e(r)&&W(e,r,`Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.`)}}}}),To=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n);t&&r&&!et(r)&&W(e,r,`Rule: set accessors: true. Fix: add it to Effect.Service options.`)}}}}),Eo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n),i=r?rt(r):void 0;t&&i&&W(e,i,`Rule: declare service dependencies.`)}}}}),Do=t({create(e){return{ImportDeclaration(t){let n=tt(t);n&&W(e,n,`Rule: avoid namespace imports from Effect packages.`)}}}}),Oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?_t(n):void 0;r&&W(e,r,`Rule: avoid exported manual service objects.`)}}}}),ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?st(n):void 0;r&&W(e,r,`Rule: prefer Layer.pipe for nested layer provisioning.`)}}}}),Ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?lt(n):void 0;r&&W(e,r,`Rule: avoid inline layer provisioning inside programs.`)}}}}),jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?ut(n):void 0;r&&W(e,r,`Rule: prefer Layer.mergeAll for infrastructure layer groups.`)}}}}),Mo=t({create(e){let t=!1,n=0;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(r){let i=t?ft(r):void 0;i&&(n+=1,n>=3&&W(e,i,`Rule: group service layers by concern.`))}}}}),No=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){let r=ot(n);t&&r&&W(e,r,`Rule: avoid Layer composition inside request handlers.`)}}}}),Po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n),i=r?ht(r):void 0;t&&i&&W(e,i,`Rule: return Effect from service methods.`)}}}}),Fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&oi(n)&&W(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.`)}}}}),Io=t({create(e){return{CallExpression(t){gi(t)&&di(t.arguments)&&W(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.`),pi(t)&&ui(t.arguments)&&W(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.`)}}}}),Lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=a(n),i=B(r);t&&o(n,`sync`)&&mi(r)&&!E(i)&&W(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.`)}}}}),Ro=t({create(e){return{CallExpression(t){o(t,`as`)&&A(a(t))&&W(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`)&&A(a(t))&&W(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.`)}}}}),zo=t({create(e){return{CallExpression(t){o(t,`all`)&&en(t.arguments[0])&&tn(t.arguments[1])&&W(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.`),or(t)&&en(a(t.callee.object))&&W(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.`)}}}}),Bo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=yt(n);r&&W(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.`)}}}}),Vo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=xt(n);r&&W(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.`)}}}}),Ho=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Bt(n);r&&W(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.`)}}}}),Uo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ht(n);r&&W(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.`)}}}}),Wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&Li(n)&&W(e,n,`Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.`)},TSInterfaceDeclaration(n){t&&Li(n)&&W(e,n,`Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.`)},ClassDeclaration(n){t&&Li(n)&&W(e,n,`Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.`)}}}}),Go=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(t&&!q(e)){let t=oa(n);t&&W(e,t,`Rule: avoid catching errors too early. Why: null, undefined, or fallback recovery inside domain logic forces higher layers to handle an untyped absence. Fix: let the typed error propagate and recover at a meaningful boundary with catchTag or an explicit Option result.`)}}}}}),Ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&sa(n)&&W(e,n,`Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad catchAll recovery. Fix: return Option, Either, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`)}}}}),qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ua(n);r&&W(e,r,`Rule: do not use exceptions for domain errors. Why: throw new *Error inside Effect logic bypasses typed failure channels, supervision, and structured recovery. Fix: return Effect.fail with a Data.TaggedError or structured domain error.`)}}}}),Jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Ji(n)&&W(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.`)}}}}),Yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Qi(n);r&&W(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.`)}}}}),Xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ta(n);r&&W(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.`)}}}}),Zo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Wt(n);r&&W(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.`)}}}}),Qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ct(n);r&&W(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.`)}}}}),$o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Et(n);r&&W(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.`)}}}}),es=t({create(e){return{TryStatement(t){W(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.`)}}}}),ts=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])cr(n.init)&&W(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){lr(t.body)&&W(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.")}}}}),ns=t({create(e){return{TSTypeReference(t){(P(t,`Effect`,`Effect`)||P(t,`Layer`,`Layer`))&&W(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.")}}}}),rs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Pr(n):void 0;r&&W(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.`)}}}}),is=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExpressionStatement(n){t&&gi(n.expression)&&fi(n.expression.arguments)&&W(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.`)}}}}),as=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Rr(n):void 0;r&&W(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.`)}}}}),os=t({create(e){return{CallExpression(t){if(!O(t,`Atom`,`family`))return;let n=Vr(t.arguments);n&&W(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.`)}}}}),ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Ur(n):void 0;r&&W(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.")}}}}),cs=t({create(e){return{CallExpression(t){Jr(t)&&W(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.")}}}}),ls=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&o(n,`succeed`)&&Yr(a(n))&&W(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.`)}}}}),us=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&kr(n.typeAnnotation,`Effect`,`Effect`)&&W(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.`)}}}}),ds=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?Tr(n):void 0;r&&W(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?Tr(n):void 0;r&&W(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 fs(e,t,n){let r=!1,i=i=>{if(r)for(let r of wr(i))t(r)&&W(e,r.annotation,n)};return{ImportDeclaration(e){let t=G(e);t&&J(t)&&(r=!0)},ExportNamedDeclaration:i,ExportDefaultDeclaration:i}}const ps=t({create(e){return fs(e,({errorChannel:e})=>fr(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.`)}}),ms=t({create(e){return fs(e,({errorChannel:e})=>Dr(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.`)}}),hs=t({create(e){return fs(e,({errorChannel:e})=>Or(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.`)}}),gs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(n){t&&Xr(n)&&W(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.")}}}}),_s=t({create(e){let t=!1,n=!1,r=[],i=new WeakSet,a=t=>{typeof t!=`object`||!t||i.has(t)||(i.add(t),W(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=G(e);n&&J(n)&&(t=!0)},BinaryExpression(e){!t||!Zr(e)||(n?a(e):r.push(e))},CallExpression(e){if(!(!t||!Qr(e))){n=!0;for(let e of r)a(e)}}}}}),vs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&ti(n)&&W(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.")}}}}),ys=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&ri(n)&&W(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.")}}}}),bs=t({create(e){return{CallExpression(t){o(t,`succeed`)&&I(a(t))&&W(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.`)}}}}),xs=t({create(e){return{VariableDeclaration(t){ii(t)&&W(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.`)}}}}),Ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&bi(n)&&W(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.")}}}}),Cs=t({create(e){let t=!1,n=n=>{if(t)for(let t of ki(n))W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),ws=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},BinaryExpression(n){t&&ma(n)&&W(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.`)}}}}),Ts=t({create(e){let t=!1,n=n=>{t&&Di(n)&&W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Es=t({create(e){let t=!1,n=n=>{if(t)for(let t of Ri(n))W(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=G(e);n&&J(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),Ds=new Set([`fs`,`node:fs`,`fs/promises`,`node:fs/promises`]),Os=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 ks(e){return e.startsWith(`node:`)||Os.has(e)}function Y(e){return typeof e==`object`&&!!e&&(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)}function As(e,t){return e.computed!==!0&&n(e.property,t)||e.computed===!0&&I(e.property)&&e.property.value===t}function js(e){return Y(e)&&n(e.object,`process`)&&As(e,`env`)}function Ms(e){if(!Y(e))return!1;if(js(e.object))return!0;if(!js(e))return!1;let t=e.parent;return!Y(t)||t.object!==e}function Ns(e){if(!Y(e)||typeof e.parent!=`object`||e.parent===null)return!1;let t=e.parent;return t.type===`AssignmentExpression`&&t.left===e}const Ps=t({meta:{schema:K},create(e){return{ImportDeclaration(t){let n=G(t);n&&ks(n)&&!q(e)&&W(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.`)}}}}),Fs=t({meta:{schema:ya},create(e){return{MemberExpression(t){Ms(t)&&!Ns(t)&&!q(e)&&!ka(e)&&W(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 Is(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`||!n(e.callee,`require`))return;let t=e.arguments?.[0];if(!I(t))return;let r=t.value;return Ds.has(r)?r:void 0}const Ls=t({create(e){let t=!1,n=0,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0),n&&Ds.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=Is(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(let{node:t,source:n}of r)W(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.`)}}}}),Rs=t({meta:{schema:K},create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){T(e)&&n.push(e)},"Program:exit"(){if(!(!t||q(e)))for(let t of n)W(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.`)}}}}),zs=new Set([`try`,`tryPromise`,`mapError`,`catchAll`,`catchTag`,`catchTags`]);function Bs(e,t=new WeakSet){if(T(e))return!0;if(i(e)){let t=e.callee.property;if(n(t)&&zs.has(t.name))return!0}return Array.isArray(e)?e.some(e=>Bs(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Bs(n,t)))}const Vs=t({meta:{schema:K},create(e){return{TryStatement(t){!t.handler||!q(e)||Bs(t)||W(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.`)}}}}),Hs=t({create(e){let t=!1,n=!1,i=[];return{ImportDeclaration(e){let r=G(e);r&&J(r)&&(t=!0),La(e)&&(n=!0)},CallExpression(e){r(e.callee,`JSON`,`parse`)&&i.push(e)},"Program:exit"(){if(!(!t||n))for(let t of i)W(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.`)}}}}),Us=t({create(e){let t=!1,n=new WeakSet,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(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)W(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.`)}}}}),Ws=t({meta:{schema:K},create(e){let t=!1,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},NewExpression(e){n(e.callee,`Date`)&&r.push(e)},"Program:exit"(){if(!(!t||q(e)))for(let t of r)W(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.`)}}}}),Gs=t({create(e){let t=!1,n=n=>{if(t)for(let t of Bi(n))W(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=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Ks=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},LogicalExpression(n){t&&Hi(n)&&W(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.`)}}}}),qs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},LogicalExpression(n){t&&Wi(n)&&W(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.`)}}}}),Js=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Gi(n)&&W(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&&da(n)&&W(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.`)}}}}),Ys=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){t&&pa(n)&&W(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.`)}}}}),Xs=t({create(e){return{CallExpression(t){r(t.callee,`Effect`,`as`)&&W(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.`)}}}}),Zs=t({create(e){return{MemberExpression(t){r(t,`Effect`,`Do`)&&W(e,t,`Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.`)}}}});function Qs(e,n,i){return t({create(t){return{CallExpression(a){r(a.callee,e,n)&&W(t,a.callee,i)}}}})}const $s=Qs(`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.`),ec=Qs(`Runtime`,`runFork`,`Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.`),tc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&T(n)&&W(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.`)}}}}),nc=Qs(`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.`),rc=t({create(e){return{CallExpression(t){s(t)&&W(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.`)}}}}),ic=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])s(n.init)&&W(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)&&W(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.`)}}}}),ac=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[]){let t=te(n.init);t&&W(e,n.init,t)}},ReturnStatement(t){let n=te(t.argument);n&&W(e,t.argument,n)}}}}),oc=t({create(e){return{CallExpression(t){l(t)&&ie(t.arguments)&&W(e,t,`Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.`)}}}}),sc=t({create(e){return{CallExpression(t){ee(t)&&W(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.`)}}}}),cc=t({create(e){return{CallExpression(t){re(t)&&W(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.`)}}}}),lc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&an(n)&&W(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.")}}}}),uc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExpressionStatement(n){t&&o(n.expression,`fork`)&&W(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.`)}}}}),dc=t({create(e){let t=!1,n=n=>{if(!t)return;let r=on(n.body);r&&W(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=G(e);n&&J(n)&&(t=!0)},ForStatement:n,ForInStatement:n,ForOfStatement:n,WhileStatement:n,DoWhileStatement:n}}}),fc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&En(n)&&W(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.`)}}}}),pc=t({create(e){let t=!1,n=new Map,r=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclarator(e){let t=nr(e);t&&n.set(t,e)},CallExpression(e){let t=ir(e);t&&r.add(t)},"Program:exit"(){if(t)for(let[t,i]of n)r.has(t)||W(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.`)}}}}),mc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&kn(n)&&W(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.`)}}}}),hc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Lt(n);r&&W(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.`)}}}}),gc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=kt(n);r&&W(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.`)}}}}),_c=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(e){if(!(e.kind!==`let`&&e.kind!==`var`))for(let t of An(e))n.add(t)},CallExpression(r){if(!t)return;let i=Fn(r);if(!i)return;let a=Pn(i,n);a&&W(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.`)}}}}),vc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Nt(n);r&&W(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.`)}}}}),yc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Qn(n)&&W(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.`)}}}}),bc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&$n(n)&&W(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.`)}}}}),xc=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(e){for(let t of tr(e))n.add(t)},CallExpression(r){if(!t)return;let i=Fn(r);if(!i)return;let a=Pn(i,n);a&&W(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.`)}}}}),Sc=t({create(e){let t=!1,r=[new Set],i=new WeakSet;return{ImportDeclaration(e){let n=G(e);n&&J(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=xn(e);t&&r.at(-1)?.add(t)},CallExpression(o){if(!t||!bn(o))return;let s=a(o);!n(s)||!r.at(-1)?.has(s.name)||wn(o,s.name)||i.has(o)||(i.add(o),W(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.`))}}}}),Cc=t({create(e){let t=!1,n=new WeakSet;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(r){if(!t)return;let i=Wn(r);if(i)for(let t of Yn(i))typeof t!=`object`||!t||n.has(t)||(n.add(t),W(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.`))}}}}),wc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=un(n);r&&ln(r)&&W(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.`)}}}}),Tc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=dn(n);r&&ln(r)&&W(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){W(e,t,`Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.`)}}}}),Dc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||!o(n,`forkDaemon`)||c(a(n),`supervised`)||W(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 Oc(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):O(e,`Scope`,`addFinalizer`)||O(e,`Scope`,`addFinalizerExit`)?t.slice(1):[]}function kc(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(Oc(e).some(e=>e===t))return!0}t=t.parent}return!1}const Ac=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!Un(n)||kc(n)||W(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 jc(e){return O(e,`Scope`,`make`)&&Array.isArray(e.arguments)}function Mc(e,t){return O(e,`Scope`,`close`)&&n(a(e),t)}const Nc=new Set([`BlockStatement`,`CatchClause`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`Program`,`SwitchStatement`]);function Pc(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),Nc.has(t.type??``)||v(t))return t;t=t.parent}}function Fc(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 Ic(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 X(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=>X(e)):[];case`AssignmentPattern`:return X(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`?X(t.value):t.type===`RestElement`?X(t.argument):[]}):[];case`RestElement`:return X(t.argument);case`TSParameterProperty`:return X(t.parameter);default:return[]}}function Lc(e){return x(e.body,t=>typeof t==`object`&&!!t&&Rc(t).length>0&&Z(t)===e)}function Rc(e){return e.type===`VariableDeclarator`?X(e.id):e.type===`CatchClause`?X(e.param):(e.type===`ClassDeclaration`||e.type===`FunctionDeclaration`)&&n(e.id)?[e.id]:[]}function zc(e){return e.type===`CatchClause`?Pc(e.param):Pc(e)}function Bc(e,t){if(!n(e))return;let r,i=-1;for(let a of Lc(t)){if(!Rc(a).some(t=>n(t,e.name)))continue;let t=zc(a);if(t===void 0||!Fc(e,t))continue;let o=Ic(t);o>i&&(r=a,i=o)}return r}function Vc(e,t){return e===t?!0:typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&e.argument===t}function Z(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 Hc(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)&&Vc(t.init,e))return t;if(v(t))return;t=t.parent}}function Uc(e){let t=Hc(e),n=Z(e);if(t===void 0||n===void 0)return!1;let r=t.id.name;return x(n.body,e=>Mc(e,r)&&Z(e)===n&&Bc(a(e),n)===t).length>0}function Wc(e){return(o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`acquireReleaseInterruptible`))&&Array.isArray(e.arguments)}function Gc(e,t,r){let i=a(e);return n(i,t.name)?Bc(i,r)===void 0&&Array.isArray(r.params)&&r.params.some(e=>e===t):!1}function Kc(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=>Mc(n,t.name)&&Z(n)===e&&Gc(n,t,e)).length>0:!1})}function qc(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`)||O(t,`Layer`,`scoped`)||Wc(t)&&a(t)===e&&Kc(t))return!0;t=t.parent}return Uc(e)}const Jc=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!jc(n)||qc(n)||W(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.`)}}}}),Yc=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!o(n,`succeed`)||!Hn(a(n))||W(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.`)}}}});function Xc(e){if(typeof e!=`object`||!e||e.type!==`NewExpression`)return!1;let t=e.callee,r;return n(t)?r=t.name:typeof t==`object`&&t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.property)&&(r=t.property.name),r!==void 0&&Vn(r)}function Zc(e){return Gn(e)||Xc(e)}function Qc(e){return o(e,`acquireRelease`)||o(e,`acquireReleaseInterruptible`)||o(e,`acquireUseRelease`)}function $c(e){if(kc(e))return!0;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),Qc(t)||o(t,`scoped`)||O(t,`Layer`,`scoped`)||Cn(t))return!0;t=t.parent}return!1}function el(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)||t.type===`Program`)return t;t=t.parent}}function tl(e){return x(e,t=>Zc(t)&&el(t)===e&&!$c(t))}function nl(e){if(Qc(e))return x(e,Qc).length>=3?e:void 0}function rl(e){if(typeof e!=`object`||!e||!v(e))return;let t=e;if(n(t.id))return t.id.name;let r=t.parent;if(!(typeof r!=`object`||!r)){if(r.type===`VariableDeclarator`&&n(r.id))return r.id.name;if(r.type===`Property`&&n(r.key))return r.key.name}}function il(e){let t=rl(e);return t!==void 0&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function al(e){if(!il(e)||typeof e!=`object`||!e)return[];let t=e;return x(t.body,e=>Zc(e)&&Z(e)===t)}function ol(e){let t=el(e);if(t!==void 0)return tl(t)[0]}function sl(e){if(!n(e))return;let t=Z(e),r=t===void 0?[]:[t],i=typeof e==`object`&&e?e.parent:void 0,a=new WeakSet;for(;typeof i==`object`&&i&&!a.has(i);){if(a.add(i),i.type===`Program`){r.push(i);break}i=i.parent}for(let t of r){let r=b(t,t=>typeof t==`object`&&!!t&&t.type===`VariableDeclarator`&&n(t.id,e.name)&&t.init!==void 0);if(r)return r.init}}function cl(e){if(!T(e))return!1;let t=a(e),n=b(t,nt)===void 0?sl(t)??t:t;return b(n,nt)!==void 0&&b(n,ct)===void 0}const ll={"no-react-state":Ba,"no-if-statement":Va,"no-switch-statement":Ha,"no-ternary":Ua,"no-return-null":Wa,"no-option-as":Ga,"no-effect-never":Ka,"no-arrow-ladder":qa,"no-branch-in-object":Ja,"no-iife-wrapper":Ya,"no-return-in-arrow":Xa,"no-return-in-callback":Za,"no-effect-fn-generator":Qa,"no-effect-sync-console":$a,"no-console-in-effect-flow":eo,"no-effect-log-without-structured-context":to,"require-span-on-public-service-method":no,"no-runpromise-in-non-async-test-body":ro,"require-effect-flip-for-error-test":io,"no-test-mock-layer-when-default-available":ao,"no-nested-effect-gen":oo,"no-yield-without-star-in-effect-gen":so,"no-piped-yield-in-gen":co,"no-gen-for-mapping":lo,"prefer-gen-for-workflow":uo,"no-business-logic-in-pipe":go,"no-large-anonymous-flow":fo,"no-effect-in-flow":po,"prefer-named-flow":mo,"prefer-flow-for-pure-pipeline":ho,"prefer-pipe-for-behavior":_o,"prefer-decorated-effect-before-gen":vo,"no-workflow-in-behavior-pipe":yo,"no-mixed-pillar-function":bo,"no-clever-effect-expression":xo,"prefer-extracted-concept":So,"prefer-effect-service":Co,"no-layer-provide-in-service-definition":wo,"require-service-accessors":To,"require-service-dependencies":Eo,"no-namespace-effect-import":Do,"no-manual-service-object-export":Oo,"no-layer-merge-in-request-handler":No,"no-service-method-returning-promise":Po,"prefer-layer-pipe":ko,"no-inline-layer-provide-in-program":Ao,"prefer-layer-mergeall-for-infrastructure":jo,"no-service-layer-scatter":Mo,"no-match-void-branch":Fo,"no-json-parse-without-schema":Hs,"no-date-now-in-effect":Us,"no-new-date-in-domain-logic":Ws,"no-match-effect-branch":Io,"warn-effect-sync-wrapper":Lo,"no-effect-side-effect-wrapper":Ro,"no-effect-all-step-sequencing":zo,"no-async-effect-combinator-callback":Bo,"no-throw-in-effect-logic":Vo,"no-or-die-outside-boundary":Ho,"no-swallowed-catch-all":Uo,"no-effect-ignore":Zo,"no-try-catch-in-effect-logic":Qo,"no-promise-api-in-effect-logic":$o,"no-try-catch":es,"no-effect-wrapper-alias":ts,"no-manual-effect-channels":ns,"no-wrapgraphql-catchall":rs,"no-render-side-effects":is,"no-atom-registry-effect-sync":as,"no-family-collection-read":os,"no-inline-runtime-provide":ss,"no-naked-object-state-update":cs,"no-effect-succeed-variable":ls,"no-effect-type-alias":us,"no-public-generic-effect-error":ds,"no-early-catchall-null":Go,"no-empty-error-tag":Wo,"no-expected-state-as-error":Ko,"no-exception-domain-error":qo,"no-effect-fail-error-message":Jo,"no-catchall-generic-rethrow":Yo,"no-log-only-error-handling":Xo,"no-error-as-public-effect-error":ps,"no-unknown-public-error-channel":ms,"no-mixed-effect-error-shapes":hs,"no-model-overlay-cast":gs,"no-unknown-boolean-coercion-helper":_s,"no-fromnullable-nullish-coalesce":vs,"no-option-boolean-normalization":ys,"no-string-sentinel-return":bs,"no-string-sentinel-const":xs,"no-raw-domain-id-alias":Ss,"no-boolean-domain-flag":Cs,"no-magic-domain-string":ws,"no-raw-domain-primitive-params":Ts,"no-raw-time-domain-field":Es,"no-hidden-effect-execution":Rs,"no-boundary-try-catch-without-effect-map":Vs,"no-node-fs-in-effect-code":Ls,"no-node-platform-in-shared-code":Ps,"no-process-env-direct-read":Fs,"no-overloaded-options-object":Gs,"no-domain-logic-in-conditional":Ks,"no-implicit-state-machine-object":qs,"no-adhoc-domain-error":Js,"no-domain-meaning-by-folder-only":Ys,"no-effect-as":Xs,"no-effect-do":Zs,"no-effect-bind":$s,"no-runtime-runfork":ec,"no-run-effect-outside-boundary":tc,"no-effect-async":nc,"prevent-dynamic-imports":Ec,"no-nested-effect-call":rc,"no-effect-ladder":ic,"no-flatmap-ladder":ac,"no-pipe-ladder":oc,"no-call-tower":sc,"no-effect-orElse-ladder":cc,"no-unbounded-effect-all":lc,"no-fire-and-forget-fork":uc,"no-fork-in-loop":dc,"no-race-without-cleanup":fc,"no-unobserved-fiber":pc,"no-unbounded-concurrent-retry":mc,"no-blocking-call-in-effect":hc,"no-promise-concurrency-in-effect":gc,"no-shared-mutable-state-across-fibers":_c,"no-timeout-with-noninterruptible-promise":vc,"no-uninterruptible-concurrent-region":yc,"no-unbounded-queue-or-pubsub":bc,"no-global-mutable-concurrency-state":xc,"no-manual-deferred-coordination":Sc,"no-acquire-without-scoped-release":Cc,"no-manual-resource-close":Ac,"no-unbound-scope":Jc,"no-resource-succeed-escape":Yc,"no-resource-without-acquire-release":t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!Gn(n)||$c(n)||W(e,n,`Rule: acquire resources with an Effect release owner. Why: open/connect/create calls can leak across failure and interruption when they are ordinary calls. Fix: use Effect.acquireRelease, Effect.acquireUseRelease, Effect.scoped, or a matching finalizer.`)}}}}),"no-request-scoped-long-lived-resource":t({meta:{schema:K},create(e){let t=!1,n=new WeakSet,r=t=>{for(let r of al(t))typeof r!=`object`||!r||n.has(r)||(n.add(r),W(e,r,`Rule: do not acquire long-lived resources inside request-scoped handlers. Why: per-request clients and pools multiply connections and make shutdown ownership ambiguous. Fix: provide the resource through a Layer or a longer-lived service boundary.`))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){t&&!q(e)&&r(n)},FunctionExpression(n){t&&!q(e)&&r(n)},ArrowFunctionExpression(n){t&&!q(e)&&r(n)}}}}),"no-global-resource-singleton":t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},NewExpression(n){!t||q(e)||Z(n)!==void 0||!Xc(n)||W(e,n,`Rule: do not create global resource singletons in Effect modules. Why: module-level clients and pools bypass Layer ownership and make tests and shutdown order implicit. Fix: construct the resource in a Layer or Effect.Service and provide it at the application boundary.`)}}}}),"no-run-with-open-resource":t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ol(n);T(n)&&r!==void 0&&W(e,n,`Rule: do not run an Effect while an unowned resource is open in the same scope. Why: runtime execution can finish without closing the resource. Fix: move acquisition into acquireRelease/scoped ownership and run only the managed effect.`)}}}}),"no-nested-acquire-release":t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=nl(n);r&&W(e,r,`Rule: avoid deeply nested resource acquisition. Why: nested release stacks are difficult to audit and compose. Fix: build a named Layer or combine independent resources into one managed acquisition boundary.`)}}}}),"no-missing-layer-provision-at-run":t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&cl(n)&&W(e,n,`Rule: provide service layers before running an Effect that retrieves services. Why: an unprovided tag fails at runtime and hides the dependency contract at the boundary. Fix: compose the required Layer and use Effect.provide or Layer.provide before Effect.run*.`)}}}}),"no-yield-with-held-semaphore-permit":wc,"no-yield-with-held-mutable-ref":Tc,"no-unscoped-background-fiber":Dc},ul=[`no-runpromise-in-non-async-test-body`,`require-effect-flip-for-error-test`,`no-test-mock-layer-when-default-available`],dl=[`no-manual-deferred-coordination`,`no-yield-with-held-semaphore-permit`,`no-yield-with-held-mutable-ref`,`no-unscoped-background-fiber`],fl=[`no-early-catchall-null`,`no-empty-error-tag`],pl=[`no-business-logic-in-pipe`],ml=[`prefer-flow-for-pure-pipeline`],hl=[`no-request-scoped-long-lived-resource`,`no-global-resource-singleton`,`no-nested-acquire-release`,`no-missing-layer-provision-at-run`];function Q(e){return Object.fromEntries(e.map(e=>[`linteffect/${e}`,`error`]))}function $(e){return{jsPlugins:gl,rules:e}}const gl=[{name:`linteffect`,specifier:`@opsydyn/oxlint-effect`}],_l=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`]),vl=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`]),yl=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`,...dl,`no-acquire-without-scoped-release`]),bl=Q([`no-manual-resource-close`,`no-unbound-scope`,`no-resource-succeed-escape`,`no-resource-without-acquire-release`,...hl,`no-run-with-open-resource`]),xl=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`]),Sl=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`]),Cl=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`]),wl=Q([`no-effect-sync-console`,`no-atom-registry-effect-sync`,`no-family-collection-read`,`no-naked-object-state-update`,`no-wrapgraphql-catchall`]),Tl=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`]),El=[`no-error-as-public-effect-error`,`no-unknown-public-error-channel`,`no-mixed-effect-error-shapes`,`no-expected-state-as-error`],Dl=Q([...El,`no-early-catchall-null`,`no-empty-error-tag`,`no-exception-domain-error`,`no-effect-fail-error-message`,`no-catchall-generic-rethrow`,`no-log-only-error-handling`]),Ol={...Tl,...Dl},kl=Q([`no-piped-yield-in-gen`,`no-gen-for-mapping`,`prefer-gen-for-workflow`,...pl]),Al=Q([`no-large-anonymous-flow`,`no-effect-in-flow`,`prefer-named-flow`,...ml]),jl=Q([`prefer-pipe-for-behavior`,`prefer-decorated-effect-before-gen`,`no-workflow-in-behavior-pipe`]),Ml=Q([`no-mixed-pillar-function`,`no-clever-effect-expression`,`prefer-extracted-concept`]),Nl=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`]),Pl=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`]),Fl=Q([`no-console-in-effect-flow`,`no-effect-log-without-structured-context`,`require-span-on-public-service-method`,...ul]),Il=Q(Object.keys(ll)),Ll=[...ul,...dl,...fl,...pl,...ml,...hl,...El,`no-resource-succeed-escape`],Rl=Q(Object.keys(ll).filter(e=>!Ll.includes(e))),zl={reactAndRuntimeBoundaries:_l,effectComposition:vl,concurrencySafety:yl,resourceLifetime:bl,pipelineShapeAndSequencing:xl,branchingAndLocalControlFlow:Sl,optionMatchAndDataNormalization:Cl,atomStateAndPlatformBoundaries:wl,domainModeling:Tl,errorModeling:Dl,ddd:Ol,effectFlow:kl,pureTransformation:Al,behaviorDecoration:jl,styleSeparation:Ml,serviceAndLayerArchitecture:Nl,platformAndBoundaryHygiene:Pl,testingObservabilityAndQa:Fl},Bl=$(Rl),Vl={options:{typeAware:!0},jsPlugins:gl,rules:Bl.rules},Hl=$(_l),Ul=$(vl),Wl=$(yl),Gl=$(bl),Kl=$(xl),ql=$(Sl),Jl=$(Cl),Yl=$(wl),Xl=$(Tl),Zl=$(Dl),Ql=$(Ol),$l=$(kl),eu=$(Al),tu=$(jl),nu=$(Ml),ru=$(Nl),iu=$(Pl),au=$(Fl),ou={recommended:Bl,typeAware:Vl,reactAndRuntimeBoundaries:Hl,effectComposition:Ul,concurrencySafety:Wl,resourceLifetime:Gl,pipelineShapeAndSequencing:Kl,branchingAndLocalControlFlow:ql,optionMatchAndDataNormalization:Jl,atomStateAndPlatformBoundaries:Yl,domainModeling:Xl,errorModeling:Zl,ddd:Ql,effectFlow:$l,pureTransformation:eu,behaviorDecoration:tu,styleSeparation:nu,serviceAndLayerArchitecture:ru,platformAndBoundaryHygiene:iu,testingObservabilityAndQa:au};var su=e({meta:{name:`linteffect`},rules:ll});export{Il as allRules,Yl as atomStateAndPlatformBoundaries,wl as atomStateAndPlatformBoundariesRules,tu as behaviorDecoration,jl as behaviorDecorationRules,ql as branchingAndLocalControlFlow,Sl as branchingAndLocalControlFlowRules,Wl as concurrencySafety,yl as concurrencySafetyRules,Ql as ddd,Ol as dddRules,su as default,Xl as domainModeling,Tl as domainModelingRules,Ul as effectComposition,vl as effectCompositionRules,$l as effectFlow,kl as effectFlowRules,Zl as errorModeling,Dl as errorModelingRules,gl as jsPlugins,Jl as optionMatchAndDataNormalization,Cl as optionMatchAndDataNormalizationRules,Kl as pipelineShapeAndSequencing,xl as pipelineShapeAndSequencingRules,iu as platformAndBoundaryHygiene,Pl as platformAndBoundaryHygieneRules,ou as presets,eu as pureTransformation,Al as pureTransformationRules,Hl as reactAndRuntimeBoundaries,_l as reactAndRuntimeBoundariesRules,Bl as recommended,Rl as recommendedRules,Gl as resourceLifetime,bl as resourceLifetimeRules,zl as ruleGroups,ru as serviceAndLayerArchitecture,Nl as serviceAndLayerArchitectureRules,nu as styleSeparation,Ml as styleSeparationRules,au as testingObservabilityAndQa,Fl as testingObservabilityAndQaRules,Vl as typeAware};
2
2
  //# sourceMappingURL=index.mjs.map