@opsydyn/oxlint-effect 2.0.0 → 2.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
- function e(e){const t=e[0];if("object"!=typeof t||null===t||!Object.hasOwn(t,"effectVersion"))return 4;const n=t.effectVersion;if(3===n||4===n)return n;throw new Error("effectVersion must be 3 or 4")}function t(e){const t=e[0];return[{type:"object",additionalProperties:!1,...t,properties:{...t?.properties,effectVersion:{type:"integer",enum:[3,4]}}},...e.slice(1)]}function n(e){return"object"==typeof e&&null!==e}function r(e,t){return n(e)&&"Identifier"===e.type&&"string"==typeof e.name&&(void 0===t||e.name===t)}function o(e,t,o){if(!n(e))return!1;const i=e;return"MemberExpression"===i.type&&!0!==i.computed&&r(i.object,t)&&r(i.property,o)}function i(e){return _e(e,"Effect")&&Array.isArray(e.arguments)}function a(e){return e.arguments[0]}function c(e,t){return!!i(e)&&r(e.callee.property,t)}function s(e){if(!i(e))return!1;const t=a(e);return!!i(t)&&i(a(t))}function u(e){return!!i(e)&&e.arguments.slice(0,2).some(e=>i(e))}function l(e,t,n=new WeakSet){return void 0!==oe(e,e=>c(e,t),n)}function f(e,t){return(c(e,"flatMap")||4===t&&c(e,"flatMapEager"))&&(l(e.arguments,"flatMap")||4===t&&l(e.arguments,"flatMapEager"))?"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.":c(e,"flatten")&&l(a(e),"map")?"Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.":void 0}function p(e){if(!c(e,"orElse"))return!1;const t=a(e);return Mi.some(e=>l(t,e))}function d(e){if(!n(e))return!1;const t=e;if("CallExpression"!==t.type)return!1;if(r(t.callee,"pipe"))return!0;const o=t.callee;return n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&r(o.property,"pipe")}function m(e,t=new WeakSet){return void 0!==oe(e,e=>d(e),t)}function y(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)&&"object"==typeof t.callee&&null!==t.callee&&"ArrowFunctionExpression"===t.callee.type}function h(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)&&"object"==typeof t.callee&&null!==t.callee&&("ArrowFunctionExpression"===t.callee.type||"FunctionExpression"===t.callee.type)}function g(e,t=new WeakSet){return oe(e,y,t)}function b(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>b(e,t)):n(e)?t.has(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:b(n,t))):[]}function v(e,t){if(!n(e))return!1;const r=e,i=3===t?"filter":"makeFilter";return"CallExpression"===r.type&&(o(r.callee,"S",i)||o(r.callee,"Schema",i))}function w(e,t){if(!n(e))return[];const r=e;return"CallExpression"!==r.type||!Array.isArray(r.arguments)||v(r,t)?[]:r.arguments.flatMap(e=>{if(!n(e)||"ArrowFunctionExpression"!==e.type)return[];const t=e.body;return n(t)&&"BlockStatement"===t.type?b(t):[]})}function E(e){if(!n(e))return[];const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)?t.arguments.flatMap(e=>n(e)&&"FunctionExpression"===e.type&&!0!==e.generator?b(e.body):[]):[]}function x(e){return n(e)&&"FunctionExpression"===e.type&&!0===e.generator}function S(e,t,r=3){const o=4===r&&"fn"===t&&n(e)&&"CallExpression"===e.type&&c(e.callee,"fn");if(!c(e,t)&&!o)return;const i=4===r?e.arguments.find(x):a(e);return x(i)?i:void 0}function k(e,t,n=3){return void 0!==S(e,t,n)}function A(e,t=3){if(i(e)){const n=e.callee.property;if(r(n)&&(Ti.has(n.name)||4===t&&("fnUntraced"===n.name||"fnUntracedEager"===n.name)))return!0}if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&c(o.callee,"fn")}function R(e){return n(e)&&"CallExpression"===e.type&&o(e.callee,"Date","now")}function F(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>F(e,t)):n(e)?t.has(e)?[]:(t.add(e),"YieldExpression"===e.type&&!0===e.delegate&&d(e.argument)?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:F(n,t))):[]}function W(e,t,r=new WeakSet){return Array.isArray(e)?e.some(e=>W(e,t,r)):!!n(e)&&!r.has(e)&&(r.add(e),e.type===t||Object.entries(e).some(([e,n])=>"parent"!==e&&W(n,t,r)))}function D(e,t,n=new WeakSet){return void 0!==oe(e,e=>r(e,t),n)}function C(e,t=new WeakSet){return void 0!==oe(e,e=>i(e),t)}function j(e){if(!n(e)||"VariableDeclaration"!==e.type)return;const t=e.declarations;if(!Array.isArray(t)||1!==t.length)return;const o=t[0];return n(o)&&"VariableDeclarator"===o.type&&r(o.id)&&"object"==typeof o.init&&null!==o.init&&"YieldExpression"===o.init.type&&!0===o.init.delegate?o.id.name:void 0}function M(e,t){if(!n(e)||"ReturnStatement"!==e.type)return!1;const o=e.argument;return!(void 0===o||r(o,t)||W(o,"YieldExpression")||W(o,"AwaitExpression")||C(o)||D(o,"Promise"))}function T(e){if(!n(e)||"CallExpression"!==e.type)return[];const t=e,o=Array.isArray(t.arguments)?t.arguments:[];if(r(t.callee,"pipe"))return o.slice(1);const i=t.callee;return n(i)&&"MemberExpression"===i.type&&!0!==i.computed&&r(i.property,"pipe")?o:[]}function q(e,t=3){if(!i(e))return!1;const n=e.callee.property;return r(n)&&(3===t?qi.has(n.name):"flatMapEager"===n.name||"zipRight"!==n.name&&qi.has(n.name))}function P(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&r(e.callee,"flow")}function I(e){return P(e)&&e.arguments.length>=5}function O(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async,t)}function L(e){return C(e)||W(e,"YieldExpression")||W(e,"AwaitExpression")||O(e)||Je(e)||D(e,"Promise")||D(e,"Runtime")}function N(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e.callee;return r(t)?t.name:n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.property)?t.property.name:void 0}function z(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=N(e);return!(C(e)||W(e,"AwaitExpression")||W(e,"YieldExpression")||D(e,"Promise")||Je(e)||Pi.has(t??"")||"object"==typeof e.callee&&null!==e.callee&&r(e.callee.object,"console"))}function $(e){if(!z(e))return 0;const t=e;return[t.callee,...t.arguments??[]].filter(e=>!K(e)).reduce((e,t)=>Math.max(e,$(t)),0)+1}function V(e,t=3){if(!i(e))return!1;const n=e.callee.property;if(!r(n))return!1;const o=n.name;return 3===t?Ii.has(o):"catchAll"!==o&&"catchSome"!==o&&"timeoutFail"!==o&&Ii.has(o)||Oi.includes(o)||"timeoutOption"===o||"timeoutOrElse"===o||"catchNoSuchElement"===o}function B(e){return i(e)||d(e)}function U(e,t){return!(!n(e)||"YieldExpression"!==e.type||!0!==e.delegate||!d(e.argument))&&T(e.argument).some(e=>V(e,t))}function Q(e,t,r=new Set,i=new WeakSet){if((c(e,"gen")||q(e,t))&&r.add("workflow"),P(e)&&r.add("pure"),V(e,t)&&r.add("behavior"),(_e(e,"Layer")||o(e,"Layer","pipe"))&&r.add("layer"),Array.isArray(e)){for(const n of e)Q(n,t,r,i);return r}if(!n(e))return r;if(i.has(e))return r;i.add(e);for(const[n,o]of Object.entries(e))"parent"!==n&&Q(o,t,r,i);return r}function K(e){return n(e)&&("FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)}function _(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,_(n,t)),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=Object.entries(e).reduce((e,[n,r])=>"parent"===n?e:Math.max(e,_(r,t)),0);return"CallExpression"===e.type?r+1:r}function Y(e,t=3){return!!o(e,3===t?"Effect":"Context","Service")||!(!n(e)||"CallExpression"!==e.type)&&Y(e.callee,t)}function J(e,t=3){if(!n(e)||"CallExpression"!==e.type)return;const r=e;return Y(r.callee,t)?[...r.arguments??[]].reverse().find(e=>n(e)&&"ObjectExpression"===e.type):void 0}function G(e){if(n(e)&&"ClassDeclaration"===e.type)return J(e.superClass)}function H(e,t){if(3===t)return G(e);const n=e?.type;return J("ClassDeclaration"===n||"ClassExpression"===n?e.superClass:e,t)}function Z(e,t){return 3===t?Gn(e,"effect")??Gn(e,"scoped"):Gn(e,"make")}function X(e){return _e(e,"Context","Tag")||_e(e,"Context","GenericTag")}function ee(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Layer","provide"),t)}function te(e){return er(Gn(e,"accessors"),!0)}function ne(e){if(!ko(fo(e)??""))return;const t=n(e)?e.specifiers:void 0;return Array.isArray(t)?t.find(e=>n(e)&&"ImportNamespaceSpecifier"===e.type):void 0}function re(e){return n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&r(e.argument)&&e.argument.name.endsWith("Service")}function oe(e,t,r=new WeakSet,o=!1){if(!o||n(e)&&!r.has(e)&&!K(e)&&"ClassDeclaration"!==e.type&&"ClassExpression"!==e.type){if(t(e))return e;if(Array.isArray(e))for(const n of e){const e=oe(n,t,r,o);if(e)return e}else if(n(e)&&!r.has(e)){r.add(e);for(const[n,i]of Object.entries(e)){if("parent"===n)continue;const e=oe(i,t,r,o);if(e)return e}}}}function ie(e,t,r=new WeakSet,o=!1,i=!1){if(i&&K(e))return[];if(o&&n(e)&&r.has(e))return[];const a=t(e)?[e]:[];return o&&a.length?a:Array.isArray(e)?e.flatMap(e=>ie(e,t,r,o,i)).concat(a):n(e)?r.has(e)?a:(r.add(e),Object.entries(e).reduce((e,[n,a])=>"parent"===n?e:e.concat(ie(a,t,r,o,i)),a)):a}function ae(e){if(!Gn(e,"dependencies"))return oe(Gn(e,"effect")??Gn(e,"scoped"),re)}function ce(e){if(!_e(e,"Layer"))return!1;const t=e.callee.property;return r(t)&&("provide"===t.name||t.name.startsWith("merge"))}function se(e){if(!n(e)||"FunctionDeclaration"!==e.type)return!1;const t=e.id;return r(t)&&/(handler|route|request)$/i.test(t.name)}function ue(e){return c(e,"provide")||_e(e,"Layer","provide")}function le(e){return r(e)&&/(Layer|Live)$/.test(e.name)}function fe(e){if(n(e)&&"VariableDeclaration"===e.type)return e.declarations?.find(e=>n(e)&&le(e.id)&&oe(e.init,ue))}function pe(e,t=3){if(!K(e))return!1;if(an(un(e),"Promise"))return!0;if(3===t)return void 0!==ke(e.body);if(!0===e.async)return!0;const o=e=>xe(e)||Se(e,t)||n(e)&&"NewExpression"===e.type&&r(e.callee,"Promise"),i=e.body;return o(i)||void 0!==ve(i,e=>n(e)&&"ReturnStatement"===e.type&&o(e.argument))}function de(e,t=3){return n(e)&&"Property"===e.type&&pe(e.value,t)}function me(e,t=3){if(3===t)return oe(e,de);const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return;r.add(e);const i=e;if("ObjectExpression"===i.type)return i.properties?.find(e=>de(e,t));if(K(e)){const e=i.body;if("BlockStatement"!==e?.type)return o(e);for(const t of ie(e,e=>n(e)&&"ReturnStatement"===e.type,new WeakSet,!0,!0)){const e=o(t.argument);if(e)return e}return}const a=S(e,"gen",t)??S(e,"fn",t);if(a)return o(a);const s=Array.isArray(i.arguments)?i.arguments[0]:void 0;if(c(e,"succeed")||c(e,"sync"))return o(s);if(d(e)){const e=i.callee;return o("MemberExpression"===e?.type?e.object:s)}};return o(Gn(e,"make"))}function ye(e){if(!n(e)||"ObjectExpression"!==e.type)return!1;const t=e.properties;return Array.isArray(t)&&t.some(e=>n(e)&&"Property"===e.type&&(K(e.value)||c(e.value,"fn")))}function he(e){return n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async}function ge(e){return 3===e?Li:Ni}function be(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&ge(t).has(n.name)?e.arguments.flatMap(e=>K(e)?[e]:4!==t||"catchTags"!==n.name&&"catchReasons"!==n.name||!Ve(e)?[]:e.properties.map(e=>e.value).filter(K)):[]}function ve(e,t){return oe(e,t,new WeakSet,!0)}function we(e,t,n){const r=3===t?oe:ve,o=S(e,"gen",t);if(o)return r(o.body,n);for(const o of be(e,t)){const e=r(Cn(o),n);if(e)return e}}function Ee(e,t,r){return we(e,t,e=>n(e)&&e.type===r)}function xe(e){return _e(e,"Promise")&&zi.has(String(e.callee.property.name))}function Se(e,t=3){if(!n(e)||"CallExpression"!==e.type)return!1;const o=e.callee,i=o?.object;return n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&(3===t||xe(i)||"NewExpression"===i?.type&&r(i.callee,"Promise")||Se(i,t))&&(r(o.property,"then")||r(o.property,"catch")||r(o.property,"finally"))}function ke(e){return oe(e,e=>xe(e)||Se(e))}function Ae(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;return n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.object,"Promise")&&r(t.property)&&$i.has(t.property.name)}function Re(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=Re(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),Ae(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=Re(r,t);if(e)return e}}}function Fe(e){if(!n(e))return!1;const t=e;return("ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type)&&Array.isArray(t.params)&&t.params.length>0}function We(e){if(!c(e,"tryPromise"))return!1;const t=a(e);return!!Fe(t)||Fe(Gn(t,"try"))}function De(e){return!!c(e,"promise")||c(e,"tryPromise")&&!We(e)}function Ce(e){return r(e.callee,"pipe")?e.arguments[0]:e.callee.object}function je(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;if(r(t))return t.name.endsWith("Sync");if(!n(t)||"MemberExpression"!==t.type||!0===t.computed||!r(t.object)||!r(t.property))return!1;const o=t.object.name,i=t.property.name;return Bi.has(o)&&i.endsWith("Sync")}function Me(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=Me(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),je(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=Me(r,t);if(e)return e}}}function Te(e,t){if(i(e)){const t=e.callee.property;if(r(t)&&Ui.has(t.name))return{program:a(e),hasContext:!1}}if(4!==t||!n(e)||"CallExpression"!==e.type)return;const o=e.callee;if(!i(o))return;const c=o.callee.property;return r(c)&&c.name.endsWith("With")&&Ui.has(c.name.slice(0,-4))?{program:a(e),hasContext:!0}:void 0}function qe(e,t){return void 0!==Te(e,t)}function Pe(e,t){return o(e,"Effect","orDie")||c(e,"orDie")||3===t&&(o(e,"Effect","orDieWith")||c(e,"orDieWith"))}function Ie(e,t){return Pe(e,t)?e:d(e)?en(e).find(e=>Pe(e,t)):void 0}function Oe(e,t=3){return c(e,"succeed")||c(e,"asVoid")&&(3===t||Oe(a(e),t))||c(e,"ignore")||tr(e)}function Le(e){return o(e,"Effect","ignore")||c(e,"ignore")}function Ne(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.object,"console")&&r(t.callee.property)}function ze(e){return Kn(e)||n(e)&&"TemplateLiteral"===e.type}function $e(e){return c(e,"logError")||c(e,"logWarning")}function Ve(e){return n(e)&&"ObjectExpression"===e.type}function Be(e,t){return!!oe(e,e=>c(e,"annotateLogs"))||t.arguments.slice(1).some(e=>Ve(e)||!ze(e))}function Ue(e){return ie(e,t=>$e(t)&&ze(a(t))&&!Be(e,t))}function Qe(e,t=3){if(!i(e))return[];const n=e.callee.property;if(!r(n)||!(3===t?Qi.has(n.name):"tapError"===n.name||"catchNoSuchElement"===n.name||Oi.includes(n.name)))return[];const o=e.arguments;return(4===t?o.flatMap(e=>"catchTags"!==n.name&&"catchReasons"!==n.name||!Ve(e)?[e]:e.properties.map(e=>e.value).filter(K)):o).map(Cn).filter(e=>void 0!==e)}function Ke(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&r(o.callee,t)}function _e(e,t,o){if(!n(e))return!1;const i=e;return"CallExpression"===i.type&&"object"==typeof i.callee&&null!==i.callee&&"MemberExpression"===i.callee.type&&!0!==i.callee.computed&&r(i.callee.object,t)&&r(i.callee.property)&&(void 0===o||r(i.callee.property,o))}function Ye(e){return _e(e,"Effect")&&e.callee.property.name.startsWith("log")}function Je(e,t=new WeakSet){return void 0!==oe(e,Ne,t)}function Ge(e,t=new WeakSet){return void 0!==oe(e,e=>Ke(e,"setState")||_e(e,"Atom","set")||Ke(e,"invalidate")||Ye(e)||Ne(e),t)}function He(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Ref","set")||_e(e,"Atom","set")||_e(e,"SubscriptionRef","set")||_e(e,"Reactivity","invalidate")||_e(e,"Fiber","interrupt")||Ye(e),t)}function Ze(e){if(!n(e))return!1;const t=e;return!("ObjectExpression"!==t.type||!Array.isArray(t.properties))&&t.properties.some(e=>{if(!n(e))return!1;const t=e,o=t.key,i=t.value;return(r(o,"concurrency")||n(o)&&"concurrency"===o.value)&&n(i)&&("Literal"===i.type||"NumericLiteral"===i.type)&&1===i.value})}function Xe(e){if(!n(e))return!1;const t=e;return!("ObjectExpression"!==t.type||!Array.isArray(t.properties))&&t.properties.some(e=>{if(!n(e))return!1;const t=e.key;return r(t,"concurrency")||n(t)&&"concurrency"===t.value})}function et(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.property,"map")}function tt(e){return c(e,"all")&&et(a(e))&&!Xe(e.arguments[1])}function nt(e,t=new WeakSet){return oe(e,e=>c(e,"fork"),t)}function rt(e){if(c(e,"forkChild")||c(e,"forkDetach"))return e;if(n(e)&&"CallExpression"===e.type&&(c(e.callee,"forkChild")||c(e.callee,"forkDetach")))return e;if(!d(e))return;const t=e.arguments?.at(-1);if(c(t,"forkChild")||c(t,"forkDetach"))return t;if(!n(t)||"MemberExpression"!==t.type)return;const o=t;return!0!==o.computed&&r(o.object,"Effect")&&(r(o.property,"forkChild")||r(o.property,"forkDetach"))?t:void 0}function ot(e,t){return 3===t?c(e,"fork")?e:void 0:rt(n(e)&&"YieldExpression"===e.type?e.argument:e)}function it(e,t,n=new WeakSet){return void 0!==oe(e,e=>i(e)&&r(e.callee.property)&&t.has(e.callee.property.name),n)}function at(e,t=new WeakSet){return void 0!==oe(e,e=>i(e)&&r(e.callee.property)&&Ki.has(e.callee.property.name)||_e(e,"Queue","take")||_e(e,"Deferred","await"),t)}function ct(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&Array.isArray(o.arguments)&&"object"==typeof o.callee&&null!==o.callee&&"MemberExpression"===o.callee.type&&!0!==o.callee.computed&&r(o.callee.property,t)}function st(e,t=3){if(4===t&&d(e)){const t=e.arguments.at(-1);return ct(t,"withPermit")||ct(t,"withPermits")?Ce(e):void 0}if(4===t&&[e,n(e)?e.callee:void 0].some(e=>_e(e,"TSemaphore","withPermit")||_e(e,"TSemaphore","withPermits")))return;if(!n(e)||"CallExpression"!==e.type)return;const r=e;if(Array.isArray(r.arguments)){if("object"==typeof r.callee&&null!==r.callee&&"CallExpression"===r.callee.type){const e=r.callee;if((ct(e,"withPermit")||ct(e,"withPermits"))&&r.arguments.length>0)return r.arguments[0]}return _e(r,"TSemaphore","withPermit")||_e(r,"TSemaphore","withPermits")?r.arguments[0]:ct(r,"withPermit")||ct(r,"withPermits")?r.arguments.at(-1):void 0}}function ut(e,t=3){if(4===t){const t=[e,d(e)?e.arguments.at(-1):e?.callee].find(e=>lt(e,"SynchronizedRef")||lt(e,"SubscriptionRef"));if(t){const n=t.arguments;return t!==e||n.length>1?n.at(-1):void 0}return}if(!n(e)||"CallExpression"!==e.type)return;const r=e;return Array.isArray(r.arguments)?lt(r.callee,"SynchronizedRef")&&r.arguments.length>0?r.callee.arguments.at(-1):lt(r,"SynchronizedRef")&&r.arguments.length>1||ft(r)&&!lt(r,"SynchronizedRef")?r.arguments.at(-1):void 0:void 0}function lt(e,t){return ft(e)&&r(e.callee.object,t)}function ft(e){return[..._i].some(t=>ct(e,t))}function pt(e,t){return o(e,"Effect",t)}function dt(e){return _e(e,"Deferred")&&Yi.has(e.callee.property.name)}function mt(e){return _e(e,"Deferred","await")&&Array.isArray(e.arguments)}function yt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&oe(t.init,dt)?t.id.name:void 0}function ht(e,t){return Boolean(oe(e,e=>{if(!_e(e,"Effect","addFinalizer")&&!_e(e,"Scope","addFinalizer"))return!1;const n=e.arguments;return Array.isArray(n)&&n.some(e=>{const n=Cn(e);return void 0!==n&&D(n,t)})}))}function gt(e){if(!d(e))return!1;const t=e.arguments;return Array.isArray(t)&&t.some(e=>pt(e,"scoped"))}function bt(e,t,o=3,a=[]){let s=n(e)?e.parent:void 0;const u=new WeakSet;for(;n(s);){if(u.has(s))return!1;if(u.add(s),i(s)&&(()=>{const e=s.callee.property;return r(e)&&(4===o?Vi.has(e.name)||Zi.has(e.name)||"interruptible"===e.name||"scoped"===e.name:Ji.has(e.name)||Gi.has(e.name))})()||(3===o?gt(s):d(s)&&(()=>{const e=s.arguments.at(-1);return[...Vi,...Zi,"interruptible","scoped"].some(t=>c(e,t)||pt(e,t))})())||4===o&&"CallExpression"===s.type&&i(s.callee)&&(()=>{const e=s.callee.callee.property;return r(e)&&(Vi.has(e.name)||Zi.has(e.name))})())return!0;if(K(s)){if(3===o?ht(s,t):a.some(e=>{for(let t=e.identifier.parent;t&&Ct(t,s);t=t.parent)if(_e(t,"Effect","addFinalizer")||_e(t,"Scope","addFinalizer"))return!0;return!1}))return!0;if(4===o){const e=s.parent;if(S(e,"gen",4)!==s&&S(e,"fn",4)!==s&&!be(e,4).includes(s))return!1}}s=s.parent}return!1}function vt(e){return[...Zi].some(t=>c(e,t)||pt(e,t))}function wt(e){return!(!n(e)||"CallExpression"!==e.type)&&(vt(e)||vt(e.callee)||d(e)&&vt(e.arguments?.at(-1)))}function Et(e,t=3){if(4===t){if(!wt(e))return!1;const t=e.parent;if(n(t)&&wt(t)&&(t.callee===e||d(t)&&t.arguments?.at(-1)===e))return!1;const r=e=>void 0!==oe(e,e=>[...Hi].some(t=>c(e,t)||pt(e,t)));if(r(e.arguments)||r(e.callee?.arguments))return!1;let o=t;const a=new WeakSet;for(;n(o)&&!a.has(o)&&(a.add(o),!K(o)||S(o.parent,"gen",4)===o||S(o.parent,"fn",4)===o||c(o.parent,"acquireUseRelease")&&o.parent.arguments?.[1]===o);){if(i(o)&&Hi.has(o.callee.property.name))return!1;if(d(o)&&r(o.arguments))return!1;o=o.parent}return!0}return!(!c(e,"race")&&!c(e,"raceAll")||it(e.arguments,Hi))}function xt(e){return c(e,"forEach")&&!Xe(e.arguments[2])}function St(e){return(tt(e)||xt(e))&&it(e.arguments,Xi)}function kt(e){if(!n(e)||"VariableDeclaration"!==e.type)return[];const t=e.declarations;return Array.isArray(t)?t.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)?[t.name]:[]}):[]}function At(e,t=new Set,r=new WeakSet){if(Array.isArray(e)){for(const n of e)At(n,t,r);return t}if(!n(e))return t;if(r.has(e))return t;if(r.add(e),"VariableDeclaration"===e.type)for(const n of kt(e))t.add(n);for(const[n,o]of Object.entries(e))"parent"!==n&&At(o,t,r);return t}function Rt(e){if(!n(e))return;const t=e;return"AssignmentExpression"===t.type&&r(t.left)?t.left.name:"UpdateExpression"===t.type&&r(t.argument)?t.argument.name:"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.object)&&r(t.callee.property)&&ea.has(t.callee.property.name)?t.callee.object.name:void 0}function Ft(e,t,r=At(e),o=new WeakSet){if(Array.isArray(e)){for(const n of e){const e=Ft(n,t,r,o);if(e)return e}return}if(!n(e))return;if(o.has(e))return;o.add(e);const i=Rt(e);if(i&&t.has(i)&&!r.has(i))return e;for(const[n,i]of Object.entries(e)){if("parent"===n)continue;const e=Ft(i,t,r,o);if(e)return e}}function Wt(e){if(c(e,"fork")||c(e,"all")||c(e,"forEach"))return e.arguments}function Dt(e){if(c(e,"all")||c(e,"forEach"))return e.arguments;if(!rt(e))return;if(!d(e))return a(e);const t=e.callee.object;return r(e.callee,"pipe")?a(e):t}function Ct(e,t){if(Array.isArray(t))return t.some(t=>Ct(e,t));for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function jt(e){const t=e,n=t.parent;if("AssignmentExpression"===n?.type&&n.left===t)return n;if("UpdateExpression"===n?.type&&n.argument===t)return n;if("MemberExpression"===n?.type&&n.object===t&&!0!==n.computed&&r(n.property)&&ea.has(n.property.name)){const e=n.parent;if("CallExpression"===e?.type&&e.callee===n)return e}}function Mt(e,t){for(const n of t){if(n.identifiers.some(t=>Ct(t,e)))continue;const t=n.references.map(e=>jt(e.identifier)).find(t=>t&&Ct(t,e));if(t)return t}}function Tt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function qt(e){return Tt(e).some(e=>ra.has(e))}function Pt(e){if(r(e))return qt(e.name);if(!No(e))return!1;const t=e;return!0!==t.computed&&(r(t.property)&&qt(t.property.name)||Pt(t.object))}function It(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;if(!n(t)||"MemberExpression"!==t.type||!0===t.computed||!r(t.property))return!1;const o=t;return oa.has(o.property.name)&&Pt(o.object)}function Ot(e,t=3){if(4===t){const t=d(e)?e.arguments.at(-1):e?.callee,n=e=>[...aa].some(t=>c(e,t)||pt(e,t));return n(e)?e.arguments:n(t)?[...t.arguments??[],...d(e)?[Ce(e)]:e.arguments]:void 0}if(!i(e))return;const n=e.callee.property;return r(n)&&ta.has(n.name)?e.arguments:void 0}function Lt(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;let o;if(r(t))o=t.name;else if(n(t)&&"MemberExpression"===t.type){const e=t;!0!==e.computed&&r(e.property)&&(o=e.property.name)}return!(!o||"acquireRelease"===o||"acquireUseRelease"===o)&&Tt(o).some(e=>na.has(e))&&qt(o)}function Nt(e,t){return!!(c(e,"acquireRelease")||c(e,"acquireUseRelease")||c(e,"scoped")||gt(e))||void 0!==t&&ht(e,t)}function zt(e){const t=new Set;for(const o of ie(e,e=>n(e)&&"VariableDeclarator"===e.type)){const n=o;r(n.id)&&oe(n.init,Lt)&&ht(e,n.id.name)&&t.add(n.id.name)}return t}function $t(e,t,o=new WeakSet,i=new Set,a=!1,s=3){if(Array.isArray(e)){for(const n of e)$t(n,t,o,i,a,s);return}if(!n(e)||o.has(e))return;if(o.add(e),4===s&&K(e)){const t=e.parent;if(S(t,"gen",4)!==e&&S(t,"fn",4)!==e&&!be(t,4).includes(e)&&!["sync","suspend","promise","tryPromise"].some(e=>c(t,e))&&!ct(t,"map"))return}if(Nt(e))return;const u=K(e)?new Set([...i,...zt(e)]):i,l="VariableDeclarator"===e.type?e:void 0,f=l&&r(l.id)?l.id.name:void 0,p=void 0!==f&&u.has(f);if(!Lt(e)||a)for(const[n,r]of Object.entries(e))"parent"!==n&&$t(r,t,o,u,a||p,s);else t.push(e)}function Vt(e,t=3){const n=[];return $t(e,n,void 0,void 0,!1,t),n}function Bt(e,t=new WeakSet){return!!it(e,ia)||!!_e(e,"Queue","take")||(Array.isArray(e)?e.some(e=>Bt(e,t)):!!n(e)&&!t.has(e)&&(t.add(e),Object.entries(e).some(([e,n])=>"parent"!==e&&Bt(n,t))))}function Ut(e,t=!1){return!!ve(e,e=>{if(_e(e,"Queue","take")||_e(e,"PubSub","take")||[...aa].some(t=>c(e,t)||pt(e,t))||t&&(["sleep","promise","tryPromise"].some(t=>c(e,t))||_e(e,"Deferred","await")))return!0;const n=S(e,"gen",4)??S(e,"fn",4);return!(!n||!Ut(n.body,t))||be(e,4).some(e=>Ut(Cn(e),t))})}function Qt(e,t=3){if(4===t){const t=c(e,"uninterruptible")?a(e):d(e)&&pt(e.arguments.at(-1),"uninterruptible")?Ce(e):void 0;return void 0!==t&&Ut(t)}return c(e,"uninterruptible")&&Bt(e.arguments[0])}function Kt(e,t=3){if(_e(e,"Queue","unbounded")||_e(e,"PubSub","unbounded"))return!0;if(4!==t)return!1;if(_e(e,"PubSub","makeAtomicUnbounded"))return!0;if(!_e(e,"Queue","make"))return!1;const o=a(e);if(!o||r(o,"undefined"))return!0;if(!Ve(o))return!1;if(o.properties.some(e=>"SpreadElement"===e.type))return!1;const i=Gn(o,"capacity");return!i||r(i,"undefined")||r(i,"Infinity")||n(i)&&"MemberExpression"===i.type&&!0!==i.computed&&r(i.object,"Number")&&r(i.property,"POSITIVE_INFINITY")}function _t(e){if(!n(e))return!1;const t=e;return"ObjectExpression"===t.type||"ArrayExpression"===t.type||"NewExpression"===t.type&&(r(t.callee,"Map")||r(t.callee,"Set"))||"CallExpression"===t.type&&(r(t.callee,"Map")||r(t.callee,"Set"))}function Yt(e){if(!n(e)||"VariableDeclaration"!==e.type)return[];const t=e,o=Array.isArray(t.declarations)?t.declarations:[];return"let"===t.kind||"var"===t.kind?kt(e):o.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)&&_t(e.init)?[t.name]:[]})}function Jt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&c(t.init,"fork")?t.id.name:void 0}function Gt(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e,o=t.callee;if(!(n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&r(o.object,"Fiber")&&r(o.property)&&ca.has(o.property.name)&&Array.isArray(t.arguments)))return;const[i]=t.arguments;return r(i)?i.name:void 0}function Ht(e){if(!r(e))return!1;const t=e.parent;if(!t)return!1;if("ReturnStatement"===t.type&&t.argument===e)return!0;if(Gt(t)===e.name&&a(t)===e)return!0;const n="MemberExpression"===t.type&&t.object===e?t.parent:t;return d(n)&&void 0!==oe(n.arguments,e=>[...ca].some(t=>o(e,"Fiber",t)))}function Zt(e){return o(e,"Effect","asVoid")||_e(e,"Effect","asVoid")}function Xt(e){if(!n(e))return!1;const t=e;return!("CallExpression"!==t.type||!Array.isArray(t.arguments)||"object"!=typeof t.callee||null===t.callee||"MemberExpression"!==t.callee.type||!0===t.callee.computed||!r(t.callee.property,"pipe"))&&c(t.callee.object,"all")&&t.arguments.some(e=>Zt(e))}function en(e){if(!n(e)||!d(e))return[];const t=e;return r(t.callee,"pipe")?t.arguments:[t.callee.object,...t.arguments]}function tn(e){const[t]=en(e);return void 0!==t&&C(t)}function nn(e){if(tn(e))return!0;if(n(e)&&"ArrowFunctionExpression"===e.type){const t=e.body;return i(t)||tn(t)}return!1}function rn(e){return b(e).some(e=>n(e)&&(nn(e.argument)||i(e.argument)))}function on(e,t,o){if(!n(e)||"TSTypeReference"!==e.type)return!1;const i=e.typeName;return n(i)&&"TSQualifiedName"===i.type&&r(i.left,t)&&r(i.right,o)}function an(e,t){return n(e)&&"TSTypeReference"===e.type&&r(e.typeName,t)}function cn(e){if(!n(e))return[];const t=e.typeParameters??e.typeArguments;if(!n(t))return[];const r=t.params??t.arguments;return Array.isArray(r)?r:[]}function sn(e){return r(e,"Error")||an(e,"Error")}function un(e){if(!n(e))return;const t=e.returnType;return n(t)?t.typeAnnotation??t:void 0}function ln(e,t){return on(un(e),"Effect","Effect")||on(t,"Effect","Effect")}function fn(e){if(!n(e))return[];const t=e.body;if(!n(t))return[];if("BlockStatement"!==t.type)return[t];const r=(e,t=new WeakSet)=>{if(Array.isArray(e))return e.flatMap(e=>r(e,t));if(!n(e)||t.has(e))return[];t.add(e);const o=e;return"ReturnStatement"===o.type?[o.argument]:"ArrowFunctionExpression"===o.type||"FunctionExpression"===o.type||"FunctionDeclaration"===o.type?[]:Object.entries(o).flatMap(([e,n])=>"parent"===e?[]:r(n,t))};return r(t)}function pn(e){return fn(e).filter(e=>i(e)||tn(e))}function dn(e){return c(e,"withSpan")||d(e)&&en(e).some(e=>c(e,"withSpan"))}function mn(e,t){if(!ln(e,t))return;const n=pn(e);return 0===n.length||n.some(e=>!dn(e))?e:void 0}function yn(e){if(!n(e))return;const t=e.typeAnnotation;return n(t)?un(t.typeAnnotation??t):void 0}function hn(e){if(!n(e))return[];const t=e;if("ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type)return[];const r=t.declaration;return n(r)?"FunctionDeclaration"===r.type?[{functionNode:r}]:"VariableDeclaration"!==r.type?[]:(r.declarations??[]).flatMap(e=>{if(!n(e))return[];const t=e.init;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[{functionNode:t,declaredReturnType:yn(e.id)}]}):[]}function gn(e,t=3){if(4===t){const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return[];if(r.add(e),Ve(e))return[e];if(K(e))return fn(e).flatMap(o);const i=S(e,"gen",t)??S(e,"fn",t);if(i)return o(i);if(c(e,"succeed")||c(e,"sync")||c(e,"suspend"))return o(a(e));if(d(e)){const t=e.callee;return o("MemberExpression"===t.type?t.object:a(e))}return[]};return o(Gn(e,"make")).flatMap(e=>e.properties.filter(e=>"Property"===e.type&&K(e.value)).map(e=>e.value))}const r=Gn(e,"effect")??Gn(e,"scoped"),o=S(r,"gen"),i=o?fn(o).find(Ve):c(r,"succeed")&&Ve(a(r))?a(r):void 0;if(!i)return[];const s=i.properties;return Array.isArray(s)?s.flatMap(e=>{if(!n(e)||"Property"!==e.type)return[];const t=e.value;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[t]}):[]}function bn(e){return pn(e).some(e=>!dn(e))?e:void 0}function vn(e,t){const n=un(e)??t;if(!on(n,"Effect","Effect"))return;const[,r]=cn(n);return void 0===r?void 0:{annotation:n,errorChannel:r}}function wn(e){if(!n(e))return[];const t=e;return"ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type?[]:hn(t).flatMap(({functionNode:e,declaredReturnType:t})=>{const n=vn(e,t);return n?[n]:[]})}function En(e){return wn(e).find(e=>sn(e.errorChannel))?.annotation}function xn(e){let t=e;const r=new WeakSet;for(;n(t);){if(r.has(t))return t;if(r.add(t),"TSParenthesizedType"!==t.type)return t;t=t.typeAnnotation}return t}function Sn(e){const t=xn(e);if(sn(t))return"Error";if(n(t))switch(t.type){case"TSUnknownKeyword":return"unknown";case"TSStringKeyword":return"string";case"TSNumberKeyword":return"number";case"TSBooleanKeyword":return"boolean";default:return}}function kn(e){const t=xn(e);if(!n(t)||"TSUnionType"!==t.type)return new Set;const r=t.types;return Array.isArray(r)?new Set(r.flatMap(e=>{const t=Sn(e);return t?[t]:[]})):new Set}function An(e,t,n,r=new WeakSet){return void 0!==oe(e,e=>on(e,t,n),r)}function Rn(e,t=new WeakSet){return void 0!==oe(e,e=>Ke(e,"wrapGraphqlCall"),t)}function Fn(e,t){return(c(e,"flatMap")||4===t&&c(e,"flatMapEager"))&&r(a(e),"applyResponse")}function Wn(e,t,n=new WeakSet){return void 0!==oe(e,e=>Fn(e,t),n)}function Dn(e,t,n=new WeakSet){return oe(e,e=>i(e)&&Gr(t).has(e.callee.property.name),n)}function Cn(e){if(!n(e))return;const t=e;return"ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type?t.body:void 0}function jn(e){if(!n(e))return!1;const t=e;if("CallExpression"!==t.type||!Array.isArray(t.arguments)||"object"!=typeof t.callee||null===t.callee||"MemberExpression"!==t.callee.type||!0===t.callee.computed)return!1;const o=t.callee;return(r(o.object,"Atom")||r(o.object,"atomRegistry"))&&r(o.property)&&sa.has(o.property.name)}function Mn(e,t=new WeakSet){return oe(e,jn,t)}function Tn(e){return!!r(e)&&/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name)}function qn(e){if(!n(e))return;const t=e;if("CallExpression"!==t.type||!Array.isArray(t.arguments))return;if(!(r(t.callee,"get")||o(t.callee,"Atom","get")||o(t.callee,"get","get")))return;const[i]=t.arguments;return Tn(i)?i:void 0}function Pn(e,t=new WeakSet){return qn(oe(e,e=>void 0!==qn(e),t))}function In(e){return c(e,"provide")&&1===e.arguments.length}function On(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&"SpreadElement"===e.type,t)}function Ln(e){return!(!_e(e,"Ref","update")&&!_e(e,"Ref","modify"))&&On(Cn(e.arguments[1]))}function Nn(e){return n(e)&&"ObjectExpression"===e.type&&Array.isArray(e.properties)&&0===e.properties.length}function zn(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Object","entries"),t)}function $n(e){if(Ln(e))return!0;if(_e(e,"Object","assign")){const t=e.arguments;return t.length>=3&&Nn(t[0])}return _e(e,"Object","fromEntries")?zn(e.arguments[0]):_e(e,"JSON","stringify")||_e(e,"JSON","parse")}function Vn(e){return!!r(e)||n(e)&&"MemberExpression"===e.type}function Bn(e,t=3){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>{if(!n(e))return!1;const o=e.init;return n(o)&&"TSAsExpression"===o.type&&"object"==typeof o.typeAnnotation&&null!==o.typeAnnotation&&"TSConstKeyword"!==o.typeAnnotation.type&&!(4===t&&"TSTypeReference"===o.typeAnnotation.type&&r(o.typeAnnotation.typeName,"const"))})??!1)}function Un(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;if("==="!==t.operator)return!1;const r=t.left,o=t.right;return n(r)&&"UnaryExpression"===r.type&&"typeof"===r.operator&&n(o)&&("Literal"===o.type||"StringLiteral"===o.type)&&"boolean"===o.value}function Qn(e){return nr(e,"orElse")&&lo(rr(e.arguments[0]))}function Kn(e){return n(e)&&("Literal"===e.type||"StringLiteral"===e.type)&&"string"==typeof e.value}function _n(e){return r(e,"undefined")}function Yn(e){return n(e)&&"LogicalExpression"===e.type&&"??"===e.operator&&(lo(e.right)||_n(e.right))}function Jn(e,t=3){return _e(e,"Option",3===t?"fromNullable":"fromNullishOr")&&Yn(e.arguments[0])}function Gn(e,t){if(n(e)&&"ObjectExpression"===e.type)for(const o of e.properties??[])if(n(o)&&r(o.key,t))return o.value}function Hn(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return"==="===t.operator&&(er(t.left,!0)||er(t.right,!0))}function Zn(e){if(!_e(e,"Option","match"))return!1;const t=e.arguments[1],n=Gn(t,"onSome"),r=Gn(t,"onNone");return Hn(rr(n))&&er(rr(r),!1)}function Xn(e){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>n(e)&&Kn(e.init))??!1)}function er(e,t){return n(e)&&("Literal"===e.type||"BooleanLiteral"===e.type)&&e.value===t}function tr(e){return o(e,"Effect","void")}function nr(e,t){return _e(e,"Match",t)&&Array.isArray(e.arguments)}function rr(e){if(n(e)&&"ArrowFunctionExpression"===e.type)return e.body}function or(e){if(!nr(e))return!1;const[t,n]=e.arguments;return r(e.callee.property,"when")?(er(t,!0)||er(t,!1))&&tr(rr(n)):r(e.callee.property,"orElse")&&tr(rr(t))}function ir(e){return _e(e,"Stream")}function ar(e,t=new WeakSet){return void 0!==oe(e,e=>ua.some(t=>c(e,t))||d(e)||ir(e),t)}function cr(e){return C(e)&&ar(e)}function sr(e,t=new WeakSet){return void 0!==oe(e,e=>nr(e)&&cr(r(e.callee.property,"when")?rr(e.arguments[1]):rr(e.arguments[0])),t)}function ur(e,t=new WeakSet){return void 0!==oe(e,e=>nr(e),t)}function lr(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&o(e.callee,"Option","match")}function fr(e){const t=rr(e);return n(t)&&"CallExpression"===t.type}function pr(e){return oe(e,e=>c(e,"gen"))}function dr(e){if(!d(e)||!n(e))return!1;const t=e.callee.object;return n(t)&&"CallExpression"===t.type&&o(t.callee,"Match","value")}function mr(e,t){return dr(e)||n(e)&&"CallExpression"===e.type&&(o(e.callee,"Option","match")||o(e.callee,3===t?"Either":"Result","match"))}function yr(e,t,n=new WeakSet){return void 0!==oe(e,e=>mr(e,t),n)}function hr(e){if(!n(e))return[];const t=e;return"ObjectExpression"===t.type&&Array.isArray(t.properties)?t.properties.map(e=>n(e)?e.value:void 0).filter(e=>void 0!==e):[]}function gr(e){if(!n(e)||"TSTypeAliasDeclaration"!==e.type)return!1;const t=e.id,o=e.typeAnnotation;return r(t)&&/(?:Id|ID)$/.test(t.name)&&("TSStringKeyword"===o?.type||"TSNumberKeyword"===o?.type)}function br(e){if(!n(e))return!1;const t=e;return"TSBooleanKeyword"===t.type||"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation&&"TSBooleanKeyword"===t.typeAnnotation.type}function vr(e){if(!n(e))return;const t=e;return"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation?t.typeAnnotation:t}function wr(e){const t=vr(e);return"TSStringKeyword"===t?.type||"TSNumberKeyword"===t?.type}function Er(e){const t=vr(e);return"TSAnyKeyword"===t?.type||"TSObjectKeyword"===t?.type}function xr(e){const t=vr(e);return"TSTypeReference"===t?.type&&r(t.typeName,"Date")}function Sr(e){if(!n(e)||!Array.isArray(e.params))return[];const t=/(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;return e.params.filter(e=>r(e)&&wr(e.typeAnnotation)&&t.test(e.name))}function kr(e){return Sr(e).length>=3}function Ar(e){return!!r(e)&&/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&br(e.typeAnnotation)}function Rr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(Ar):[]}function Fr(e){return r(e)?e.name:n(e)&&"string"==typeof e.value?e.value:void 0}function Wr(e){if(!n(e)||"TSPropertySignature"!==e.type)return!1;const t=e,r=Fr(t.key),o=t.typeAnnotation;return void 0!==r&&/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(r)&&(wr(o)||xr(o))}function Dr(e){if(!n(e))return[];const t=e;return"TSInterfaceDeclaration"===t.type&&"object"==typeof t.body&&null!==t.body&&Array.isArray(t.body.body)?t.body.body:"TSTypeLiteral"===t.type&&Array.isArray(t.members)?t.members:[]}function Cr(e){return r(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function jr(e){const t=Dr(e);return 1===t.length&&"_tag"===Fr(t[0].key)}function Mr(e){const t=n(e)?e.superTypeArguments:void 0,r=n(t)?t.params??t.arguments:void 0,o=Array.isArray(r)?r:cn(e);if(0===o.length)return!0;const i=o[0];return n(i)&&("TSObjectKeyword"===i.type||"TSTypeLiteral"===i.type&&0===Dr(i).length)}function Tr(e){if(!n(e))return;const t=e;return("TSTypeAliasDeclaration"===t.type||"TSInterfaceDeclaration"===t.type)&&Cr(t.id)&&jr("TSTypeAliasDeclaration"===t.type?t.typeAnnotation:t)||"ClassDeclaration"===t.type&&_e(t.superClass,"Data","TaggedError")&&Mr(t)?e:void 0}function qr(e){return Dr(e).filter(Wr)}function Pr(e){return!!r(e)&&/^(?:opts|options|config)$/i.test(e.name)&&Er(e.typeAnnotation)}function Ir(e){return n(e)&&Array.isArray(e.params)?e.params.filter(Pr):[]}function Or(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+Or(n,t),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=e;return"BinaryExpression"===r.type&&la.has(String(r.operator))?1:"LogicalExpression"!==r.type?0:Or(r.left,t)+Or(r.right,t)}function Lr(e){return n(e)&&"LogicalExpression"===e.type&&Or(e)>=3}function Nr(e){if(!n(e)||"MemberExpression"!==e.type)return;const t=e;if(!0===t.computed||!r(t.object)||!r(t.property))return;const o=t.property.name;return/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(o)?{objectName:t.object.name,propertyName:o}:void 0}function zr(e,t=new Map,r=new WeakSet){const o=Nr(e);if(o){const e=t.get(o.objectName)??new Set;return e.add(o.propertyName),t.set(o.objectName,e),t}if(Array.isArray(e)){for(const n of e)zr(n,t,r);return t}if(!n(e))return t;if(r.has(e))return t;r.add(e);const i=e;return"LogicalExpression"!==i.type||(zr(i.left,t,r),zr(i.right,t,r)),t}function $r(e){return!(!n(e)||"LogicalExpression"!==e.type)&&Array.from(zr(e).values()).some(e=>e.size>=2)}function Vr(e){return c(e,"fail")&&Kn(a(e))}function Br(e){return r(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Ur(e){if(!n(e)||"MemberExpression"!==e.type)return!1;const t=e;return!0!==t.computed&&r(t.property,"message")&&Br(t.object)}function Qr(e){if(Ur(e))return!0;if(!n(e))return!1;const t=e;return"BinaryExpression"===t.type&&"+"===t.operator?Qr(t.left)||Qr(t.right):"TemplateLiteral"===t.type&&Array.isArray(t.expressions)&&t.expressions.some(e=>Qr(e))}function Kr(e){return c(e,"fail")&&Qr(a(e))}function _r(e){return n(e)&&"NewExpression"===e.type&&r(e.callee,"Error")}function Yr(e){return c(e,"fail")&&_r(a(e))}function Jr(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&t.has(n.name)?e.arguments.filter(K):[]}function Gr(e){return 3===e?da:ma}function Hr(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Hr(e,t)):!n(e)||t.has(e)||K(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:Hr(n,t)))}function Zr(e){if(!i(e))return!1;const t=e.callee.property;return r(t)&&fa.has(t.name)}function Xr(e){return lo(e)||_n(e)||r(e)&&/(?:fallback|default)/i.test(e.name)}function eo(e){return c(e,"succeed")&&Xr(a(e))}function to(e,t){for(const n of Jr(e,Gr(t))){const e=Cn(n);if(eo(e))return e;for(const t of Hr(e))if(eo(t.argument))return t.argument}}function no(e){if(!c(e,"fail"))return!1;const t=a(e);return Kn(t)&&ya.has(String(t.value))}function ro(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;return r(t)&&/(?:Error|Exception)$/.test(t.name)}function oo(e){return!(!n(e)||"ThrowStatement"!==e.type)&&ro(e.argument)}function io(e){if(!n(e)||"ThrowStatement"!==e.type)return!1;const t=e.argument;return n(t)&&"NewExpression"===t.type&&r(t.callee,"Error")&&Array.isArray(t.arguments)&&Kn(t.arguments[0])}function ao(e){return!(!n(e)||!Array.isArray(e.params))&&e.params.some(e=>r(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&wr(e.typeAnnotation))}function co(e){if(!n(e)||"FunctionDeclaration"!==e.type)return!1;const t=e.id;return r(t)&&/(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(t.name)&&ao(e)}function so(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return["==","===","!=","!=="].includes(String(t.operator))&&(Kn(t.left)||Kn(t.right))&&!Un(t)}function uo(e,t,n){e.report({message:n,node:t})}function lo(e){if(!n(e))return!1;const t=e;return"NullLiteral"===t.type||"Literal"===t.type&&null===t.value}function fo(e){if(!n(e))return;const t=e.source;if("string"==typeof t)return t;if(n(t)){const e=t.value;if("string"==typeof e)return e}}function po(e){const t=e.options[0];return n(t)?t:{}}function mo(e,t){const n=e[t];return Array.isArray(n)&&n.every(e=>"string"==typeof e)?n:void 0}function yo(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/{2,}/g,"/").replace(/\/$/,"")}function ho(e){return e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,"[^/]*")}function go(e){const t=yo(e);if("**"===t)return/^.*$/;const n=t.split("/"),r="**"===n[0],o=r?1:0;let i=r?"^(?:.*/)?":"(?:^|.*/)";for(let e=o;e<n.length;e+=1){const t=n[e],r=e===n.length-1;"**"!==t?(e>o&&(i+="/"),i+=ho(t)):i+=r?"(?:/.*)?":"(?:/[^/]+)*"}return new RegExp(`${i}$`)}function bo(e,t){return go(t).test(yo(e))}function vo(e){return mo(po(e),"boundaryPaths")??ha}function wo(e){return vo(e).some(t=>bo(e.filename,t))}function Eo(e){return ga.some(t=>bo(e.filename,t))}function xo(e){return mo(po(e),"configPaths")??ba}function So(e){return xo(e).some(t=>bo(e.filename,t))}function ko(e){return"effect"===e||e.startsWith("effect/")||"@effect-atom/atom-react"===e}function Ao(e){if(!(Ke(e,"it")||Ke(e,"test")||Ke(e,"specify")||Ke(e,"bench")))return;const t=e.arguments?.at(-1);return K(t)?t:void 0}function Ro(e,t){return c(e,"runPromise")||4===t&&n(e)&&c(e.callee,"runPromiseWith")&&void 0!==Te(e,t)?.program}function Fo(e,t=3){const r=e.body;if(!Ro(r,t)&&n(r)&&"BlockStatement"===r.type&&Array.isArray(r.body))for(const e of r.body)if(n(e)&&"ExpressionStatement"===e.type&&Ro(e.expression,t))return e.expression}function Wo(e,t){const r=[],o=new WeakSet;return function e(i,a=!1){if(Array.isArray(i)){for(const t of i)e(t);return}if(!n(i)||o.has(i))return;o.add(i);const c=i;if(a||!K(c)){t(c)&&r.push(c);for(const[t,n]of Object.entries(c))"parent"!==t&&e(n)}}(e,!0),r}function Do(e,t=3){if(!n(e)||"MemberExpression"!==e.type||!0===e.computed||!r(e.property,"rejects"))return!1;const o=e.object;if(!Ke(o,"expect"))return!1;const i=o.arguments;return!!Array.isArray(i)&&Ro(i[0],t)}function Co(e){return n(e)&&"MemberExpression"===e.type&&!0!==e.computed&&r(e.property,"Default")}function jo(e){return _e(e,"Layer","succeed")||_e(e,"Layer","effect")}function Mo(e){if(!_e(e,"Layer","provide"))return[];const t=e.arguments;return Array.isArray(t)&&t.some(Co)?t.filter(jo):[]}function To(e){const t=fo(e);if("effect/Schema"===t)return!0;if("effect"!==t||!n(e))return!1;const o=e.specifiers;return Array.isArray(o)&&o.some(e=>{if(!n(e))return!1;const t=e;return"ImportSpecifier"===t.type&&r(t.imported,"Schema")})}function qo(t,n){return Di({create(r){let o=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(o=!0)},[t](t){o&&uo(r,t,"string"==typeof n?n:n(e(r.options)))}}}})}function Po(t,r,o){return Di({create(i){const a=e(i.options);let c=!1;const s=[],u=new WeakSet,l=e=>{for(const r of t(e,a))n(r)&&!u.has(r)&&(u.add(r),s.push(r))};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(c=!0)},...Object.fromEntries(o.map(e=>[e,l])),"Program:exit"(){if(c)for(const e of s)uo(i,e,r)}}}})}function Io(t,n,r=!1,o=!1,i=["CallExpression"]){return Di({...o?{meta:{schema:va}}:{},create(a){const c=e(a.options);let s=!1;const u=r?new WeakSet:void 0,l=e=>{const i=!s||o&&wo(a)?void 0:t(e,c,a);if(i)for(const e of r?i:[i])u?.has(e)||(u?.add(e),uo(a,e,n(c)))};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(s=!0)},...Object.fromEntries(i.map(e=>[e,l]))}}})}function Oo(e,t,n){let r=!1;const o=o=>{if(r)for(const r of wn(o))t(r)&&uo(e,r.annotation,n)};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},ExportNamedDeclaration:o,ExportDefaultDeclaration:o}}function Lo(e){return e.startsWith("node:")||ss.has(e)}function No(e){return n(e)&&("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)}function zo(e){return No(e)&&r(e.object,"process")&&(!0!==(t=e).computed&&r(t.property,"env")||!0===t.computed&&Kn(t.property)&&"env"===t.property.value);var t}function $o(e){if(!No(e))return!1;if(zo(e.object))return!0;if(!zo(e))return!1;const t=e.parent;return!No(t)||t.object!==e}function Vo(e){if(!No(e)||"object"!=typeof e.parent||null===e.parent)return!1;const t=e.parent;return"AssignmentExpression"===t.type&&t.left===e}function Bo(e){if(!n(e)||"CallExpression"!==e.type||!r(e.callee,"require"))return;const t=e.arguments?.[0];if(!Kn(t))return;const o=t.value;return cs.has(o)?o:void 0}function Uo(e,t){return void 0!==oe(e,e=>{if(qe(e,t))return!0;if(!i(e))return!1;const n=e.callee.property;return!!r(n)&&(3===t?ds.has(n.name):"catchAll"!==n.name&&ds.has(n.name)||Oi.includes(n.name)||"catchNoSuchElement"===n.name)})}function Qo(t,n,r,i=!1){return Di({create:a=>i&&4===e(a.options)?{}:{CallExpression(e){o(e.callee,t,n)&&uo(a,e.callee,r)}}})}function Ko(e,t=3){if(!n(e)||!Array.isArray(e.arguments))return[];const r=e.arguments,o=c(e,"acquireUseRelease")?2:yi(e,t)?1:c(e,"addFinalizer")?0:_e(e,"Scope","addFinalizer")||_e(e,"Scope","addFinalizerExit")?1:-1;return o<0?[]:r.slice(o,4===t||0===o?o+1:void 0)}function _o(e,t){let r=n(e)?e.parent:void 0;const o=new WeakSet;for(;n(r);){if(o.has(r))return;if(o.add(r),t(r))return r;r=r.parent}}function Yo(e,t=3){return void 0!==_o(e,e=>(4===t||K(e))&&Ko(e.parent,t).some(t=>t===e))}function Jo(e,t){return Io((t,n)=>e(t,n)?t:void 0,t,!1,!0)}function Go(e){return _e(e,"Scope","make")&&Array.isArray(e.arguments)}function Ho(e,t){return _e(e,"Scope","close")&&r(a(e),t)}function Zo(e){return _o(e,e=>tu.has(e.type??"")||K(e))}function Xo(e,t){let r=e;const o=new WeakSet;for(;n(r);){if(o.has(r))return!1;if(o.add(r),r===t)return!0;r=r.parent}return!1}function ei(e){let t=0,r=e;const o=new WeakSet;for(;n(r);){if(o.has(r))return t;o.add(r),t+=1,r=r.parent}return t}function ti(e){if(r(e))return[e];if(!n(e))return[];const t=e;switch(t.type){case"ArrayPattern":return Array.isArray(t.elements)?t.elements.flatMap(e=>ti(e)):[];case"AssignmentPattern":return ti(t.left);case"ObjectPattern":return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(!n(e))return[];const t=e;return"Property"===t.type?ti(t.value):"RestElement"===t.type?ti(t.argument):[]}):[];case"RestElement":return ti(t.argument);case"TSParameterProperty":return ti(t.parameter);default:return[]}}function ni(e){return ie(e.body,t=>n(t)&&ri(t).length>0&&ci(t)===e)}function ri(e){return"VariableDeclarator"===e.type?ti(e.id):"CatchClause"===e.type?ti(e.param):"ClassDeclaration"!==e.type&&"FunctionDeclaration"!==e.type||!r(e.id)?[]:[e.id]}function oi(e){return"CatchClause"===e.type?Zo(e.param):Zo(e)}function ii(e,t){if(!r(e))return;let n,o=-1;for(const i of ni(t)){if(!ri(i).some(t=>r(t,e.name)))continue;const t=oi(i);if(void 0===t||!Xo(e,t))continue;const a=ei(t);a>o&&(n=i,o=a)}return n}function ai(e,t){return e===t||n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&e.argument===t}function ci(e){return _o(e,K)}function si(e){let t=n(e)?e.parent:void 0;const o=new WeakSet;for(;n(t);){if(o.has(t))return;if(o.add(t),"VariableDeclarator"===t.type&&r(t.id)&&ai(t.init,e))return t;if(K(t))return;t=t.parent}}function ui(e){const t=si(e),n=ci(e);if(void 0===t||void 0===n)return!1;const r=t.id.name;return ie(n.body,e=>Ho(e,r)&&ci(e)===n&&ii(a(e),n)===t).length>0}function li(e,t,n){const o=a(e);return!!r(o,t.name)&&void 0===ii(o,n)&&Array.isArray(n.params)&&n.params.some(e=>e===t)}function fi(e){const t=e.arguments;return(c(e,"acquireUseRelease")?t.slice(2):t.slice(1)).some(e=>{if(!K(e))return!1;const t=e.params?.[0];return!!r(t)&&ie(e.body,n=>Ho(n,t.name)&&ci(n)===e&&li(n,t,e)).length>0})}function pi(e,t=3){return void 0!==_o(e,n=>3===t&&(c(n,"scoped")||_e(n,"Layer","scoped"))||yi(n,t)&&a(n)===e&&fi(n))||ui(e)}function di(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;let o;return r(t)?o=t.name:n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.property)&&(o=t.property.name),void 0!==o&&qt(o)}function mi(e){return Lt(e)||di(e)}function yi(e,t=3){return c(e,"acquireRelease")||3===t&&c(e,"acquireReleaseInterruptible")||c(e,"acquireUseRelease")}function hi(e,t=3){return!!Yo(e,t)||void 0!==_o(e,e=>yi(e,t)||c(e,"scoped")||3===t&&_e(e,"Layer","scoped")||gt(e))}function gi(e){return _o(e,e=>K(e)||"Program"===e.type)}function bi(e,t=3){return ie(e,n=>mi(n)&&gi(n)===e&&!hi(n,t))}function vi(e){if(!n(e)||!K(e))return;const t=e;if(r(t.id))return t.id.name;const o=t.parent;return n(o)?"VariableDeclarator"===o.type&&r(o.id)?o.id.name:"Property"===o.type&&r(o.key)?o.key.name:void 0:void 0}function wi(e){const t=vi(e);return void 0!==t&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function Ei(e,t){return 3===t?ci(e):_o(e,e=>{if(!K(e))return!1;const t=e.parent;return S(t,"gen",4)!==e&&S(t,"fn",4)!==e&&!be(t,4).includes(e)&&!["sync","suspend","promise","tryPromise"].some(n=>c(t,n)&&t.arguments.includes(e))})}function xi(e,t=3){const n=gi(e);if(void 0!==n)return bi(n,t)[0]}function Si(e,t=3,o){if(!r(e))return;if(4===t){const t=_o(e,e=>"Program"===e.type);if(!t||!o?.sourceCode)return;return ie(t,e=>n(e)&&"VariableDeclarator"===e.type).find(t=>o.sourceCode.getDeclaredVariables(t).some(t=>t.references.some(t=>Object.is(t.identifier,e))))?.init}const i=ci(e),a=void 0===i?[]:[i];let c=n(e)?e.parent:void 0;const s=new WeakSet;for(;n(c)&&!s.has(c);){if(s.add(c),"Program"===c.type){a.push(c);break}c=c.parent}for(const t of a){const o=oe(t,t=>n(t)&&"VariableDeclarator"===t.type&&r(t.id,e.name)&&void 0!==t.init);if(o)return o.init}}function ki(e,t,n){const r=Te(e,t);if(!r)return!1;const o=r.program,i=(e,n)=>oe(e,3===t?n:t=>n(t)&&Ei(t,4)===ci(e)),a=void 0!==i(o,re)?o:Si(o,t,n)??o;return void 0!==i(a,re)&&void 0===i(a,ue)}function Ai(e,t){return Object.fromEntries(e.filter(e=>3===t||!ji.includes(e)).map(e=>[`linteffect/${e}`,Ci.includes(e)?["error",{effectVersion:t}]:"error"]))}function Ri(e){return{jsPlugins:uu,rules:e}}function Fi(e){const t=Ai(["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"],e),n=Ai(["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"],e),r=Ai(["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",...ou,"no-acquire-without-scoped-release"],e),o=Ai(["no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release",...su,"no-run-with-open-resource"],e),i=Ai(["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"],e),a=Ai(["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"],e),c=Ai(["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"],e),s=Ai(["no-effect-sync-console","no-atom-registry-effect-sync","no-family-collection-read","no-naked-object-state-update","no-wrapgraphql-catchall"],e),u=Ai(["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"],e),l=["no-error-as-public-effect-error","no-unknown-public-error-channel","no-mixed-effect-error-shapes","no-expected-state-as-error"],f=Ai([...l,"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"],e),p={...u,...f},d=Ai(["no-piped-yield-in-gen","no-gen-for-mapping","prefer-gen-for-workflow",...au],e),m=Ai(["no-large-anonymous-flow","no-effect-in-flow","prefer-named-flow",...cu],e),y=Ai(["prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe"],e),h=Ai(["no-mixed-pillar-function","no-clever-effect-expression","prefer-extracted-concept"],e),g=Ai(["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"],e),b=Ai(["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"],e),v=Ai(["no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method",...ru],e),w=Ai(Object.keys(nu),e),E=[...ru,...ou,...iu,...au,...cu,...su,...l,"no-resource-succeed-escape"],x=Ai(Object.keys(nu).filter(e=>!E.includes(e)),e),S={reactAndRuntimeBoundaries:t,effectComposition:n,concurrencySafety:r,resourceLifetime:o,pipelineShapeAndSequencing:i,branchingAndLocalControlFlow:a,optionMatchAndDataNormalization:c,atomStateAndPlatformBoundaries:s,domainModeling:u,errorModeling:f,ddd:p,effectFlow:d,pureTransformation:m,behaviorDecoration:y,styleSeparation:h,serviceAndLayerArchitecture:g,platformAndBoundaryHygiene:b,testingObservabilityAndQa:v},k=Ri(x),A={options:{typeAware:!0},jsPlugins:uu,rules:k.rules},R=Ri(t),F=Ri(n),W=Ri(r),D=Ri(o),C=Ri(i),j=Ri(a),M=Ri(c),T=Ri(s),q=Ri(u),P=Ri(f),I=Ri(p),O=Ri(d),L=Ri(m),N=Ri(y),z=Ri(h),$=Ri(g),V=Ri(b),B=Ri(v);return{jsPlugins:uu,reactAndRuntimeBoundariesRules:t,effectCompositionRules:n,concurrencySafetyRules:r,resourceLifetimeRules:o,pipelineShapeAndSequencingRules:i,branchingAndLocalControlFlowRules:a,optionMatchAndDataNormalizationRules:c,atomStateAndPlatformBoundariesRules:s,domainModelingRules:u,errorModelingRules:f,dddRules:p,effectFlowRules:d,pureTransformationRules:m,behaviorDecorationRules:y,styleSeparationRules:h,serviceAndLayerArchitectureRules:g,platformAndBoundaryHygieneRules:b,testingObservabilityAndQaRules:v,allRules:w,recommendedRules:x,ruleGroups:S,recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:D,pipelineShapeAndSequencing:C,branchingAndLocalControlFlow:j,optionMatchAndDataNormalization:M,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:z,serviceAndLayerArchitecture:$,platformAndBoundaryHygiene:V,testingObservabilityAndQa:B,presets:{recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:D,pipelineShapeAndSequencing:C,branchingAndLocalControlFlow:j,optionMatchAndDataNormalization:M,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:z,serviceAndLayerArchitecture:$,platformAndBoundaryHygiene:V,testingObservabilityAndQa:B}}}import{definePlugin as Wi,defineRule as Di}from"@oxlint/plugins";const Ci=["no-react-state","no-runtime-runfork","no-or-die-outside-boundary","no-inline-runtime-provide","no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method","no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available","prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe","no-mixed-pillar-function","no-clever-effect-expression","prefer-effect-service","no-layer-provide-in-service-definition","require-service-accessors","require-service-dependencies","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","no-json-parse-without-schema","no-date-now-in-effect","no-effect-all-step-sequencing","no-async-effect-combinator-callback","no-throw-in-effect-logic","no-swallowed-catch-all","no-try-catch-in-effect-logic","no-promise-api-in-effect-logic","no-wrapgraphql-catchall","no-naked-object-state-update","no-early-catchall-null","no-exception-domain-error","no-expected-state-as-error","no-catchall-generic-rethrow","no-log-only-error-handling","no-fromnullable-nullish-coalesce","no-model-overlay-cast","no-string-sentinel-return","no-string-sentinel-const","prefer-gen-for-workflow","no-business-logic-in-pipe","no-flatmap-ladder","no-effect-side-effect-wrapper","no-ternary","no-return-in-arrow","no-branch-in-object","no-hidden-effect-execution","no-boundary-try-catch-without-effect-map","no-run-effect-outside-boundary","no-effect-async","no-effect-fn-generator","no-nested-effect-gen","no-yield-without-star-in-effect-gen","no-effect-orElse-ladder","no-fire-and-forget-fork","no-fork-in-loop","no-race-without-cleanup","no-unobserved-fiber","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","no-manual-deferred-coordination","no-acquire-without-scoped-release","no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release","no-request-scoped-long-lived-resource","no-global-resource-singleton","no-run-with-open-resource","no-nested-acquire-release","no-missing-layer-provision-at-run","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],ji=["no-runtime-runfork","require-service-accessors","require-service-dependencies","no-effect-async","no-effect-orElse-ladder"],Mi=["flatMap","zipRight","as","tap"],Ti=new Set(["gen","sync","try","tryPromise","fn"]),qi=new Set(["andThen","flatMap","tap","zipRight"]),Pi=new Set(["Date","Runtime","fetch","import","queueMicrotask","require","setInterval","setTimeout"]),Ii=new Set(["annotateLogs","as","catchAll","catchSome","catchTag","map","mapBoth","provide","retry","tap","tapError","timeout","timeoutFail","withSpan"]),Oi=["catch","catchEager","catchCause","catchDefect","catchIf","catchFilter","catchCauseIf","catchCauseFilter","catchTag","catchTags","catchReason","catchReasons"],Li=new Set(["andThen","catchAll","catchTag","filterOrFail","flatMap","forEach","map","orElse","tap"]),Ni=new Set([...[...Li].filter(e=>"catchAll"!==e&&"orElse"!==e),"mapEager","flatMapEager",...Oi]),zi=new Set(["all","allSettled","any","race","reject","resolve"]),$i=new Set(["all","allSettled","any","race"]),Vi=new Set(["timeout","timeoutOption","timeoutOrElse"]),Bi=new Set(["crypto","fs","zlib"]),Ui=new Set(["runCallback","runFork","runPromise","runPromiseExit","runSync","runSyncExit"]),Qi=new Set(["catchAll","catchTag","catchTags","tapError"]),Ki=new Set(["sleep","await","promise","tryPromise","fork","forkDaemon","forkScoped","all","forEach","race","raceAll"]),_i=new Set(["modifyEffect","modifySomeEffect","updateEffect","updateAndGetEffect"]),Yi=new Set(["make","unsafeMake","makeUnsafe"]),Ji=new Set(["timeout","timeoutOption","timeoutFail","timeoutFailCause","timeoutTo"]),Gi=new Set(["race","raceFirst","raceAll","interruptible","scoped"]),Hi=new Set(["acquireRelease","acquireUseRelease","ensuring","forkIn","forkScoped","scoped"]),Zi=new Set(["race","raceAll","raceFirst","raceAllFirst"]),Xi=new Set(["retry"]),ea=new Set(["add","clear","delete","pop","push","reverse","set","shift","sort","splice","unshift"]),ta=new Set(["fork","forkScoped","forkDaemon","all","forEach","race","raceFirst","raceAll"]),na=new Set(["open","connect","create","start","listen","subscribe","acquire"]),ra=new Set(["client","connection","conn","pool","db","database","file","socket","stream","server","subscription","handle"]),oa=new Set(["close","destroy","dispose","cleanup"]),ia=new Set(["all","forEach","fork","race","raceAll"]),aa=new Set(["all","forEach","forkChild","forkDetach","forkScoped","forkIn","race","raceAll","raceFirst","raceAllFirst"]),ca=new Set(["await","interrupt","join"]),sa=new Set(["get","set","update","modify","refresh"]),ua=["flatMap","map","andThen","tap","zipRight"],la=new Set(["==","===","!=","!==",">",">=","<","<="]),fa=new Set(["catchSome","catchTag","catchTags","fail","mapBoth","mapError"]),pa=new Set(["catchAll","tapError"]),da=new Set(["catchAll"]),ma=new Set(["catch","catchEager"]),ya=new Set(["NotFound","Missing","Empty","None"]),ha=["bin/**","scripts/**","cli/**","**/main.ts","app/api/**/route.ts","server/**","*.test.ts","*.spec.ts"],ga=["**/*.test.*","**/*.spec.*","**/__tests__/**"],ba=["**/config/**","**/*Config.ts","**/*ConfigLayer.ts"],va=[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}],wa=new Set(["useState","useReducer","useContext","useCallback","useEffect","useSyncExternalStore"]),Ea=Di({create(t){const o=e(t.options);return{CallExpression(e){const i=e.callee,a=r(i)?i.name:n(i)&&"MemberExpression"===i.type&&r(i.property)?i.property.name:void 0;a&&wa.has(a)&&uo(t,i,3===o?"Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.":"Rule: avoid React state hooks. Why: they bypass externally owned reactive state. Fix: pass explicit state as props or use a compatible reactive adapter at the UI boundary.")}}}}),xa=qo("IfStatement","Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead."),Sa=qo("SwitchStatement","Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead."),ka=qo("ConditionalExpression",e=>`Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/${3===e?"Either":"Result"}.match/Match.value or data combinators, then run one Effect pipeline.`),Aa=Io(e=>lo(e.argument)?e:void 0,()=>"Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.",!1,!1,["ReturnStatement"]),Ra=Io(e=>o(e.callee,"Option","as")?e:void 0,()=>"Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly."),Fa=Io(e=>o(e,"Effect","never")?e:void 0,()=>"Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.",!1,!1,["MemberExpression"]),Wa=Io(e=>y(e)?g(e.callee.body):void 0,e=>"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."),Da=Di({create(t){const n=e(t.options);return{ObjectExpression(e){hr(e).some(e=>yr(e,n))&&uo(t,e,`Rule: avoid Match/Option/${3===n?"Either":"Result"} 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.`)}}}}),Ca=Io(e=>h(e)?e:void 0,()=>"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."),ja=Di({create(t){const n=e(t.options);return{CallExpression(e){for(const r of w(e,n))uo(t,r,"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).")}}}}),Ma=Di({create:e=>({CallExpression(t){for(const n of E(t))uo(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.")}})}),Ta=Io((e,t)=>k(e,"fn",t)?e:void 0,()=>"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."),qa=Io(e=>c(e,"sync")&&Je(a(e))?e:void 0,()=>"Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call."),Pa=["CallExpression","ClassDeclaration","ClassExpression"],Ia=Po(function(e,t=3){if(A(e,t))return ie(e.arguments,Ne);const n=H(e,t);return n?ie(Z(n,t),Ne):[]},"Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.",Pa),Oa=Po((e,t)=>{const n=H(e,t),r=n&&Z(n,t);return[...Qe(e,t),...r?[r]:[]].flatMap(Ue)},"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(...).",Pa),La=Po((e,t)=>{const n=H(e,t);return[...hn(e).map(e=>mn(e.functionNode,e.declaredReturnType)),...n?gn(n,t).map(bn):[]].filter(e=>void 0!==e)},"Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).",[...Pa,"ExportNamedDeclaration","ExportDefaultDeclaration"]),Na=Di({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(!Eo(t))return;const r=Ao(e),i=r&&Fo(r,n);i&&o.push(i)},"Program:exit"(){if(r)for(const e of o)uo(t,e,"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.")}}}}),za=Di({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(!Eo(t))return;const r=Ao(e);r&&o.push(...Wo(r,e=>Do(e,n)))},"Program:exit"(){if(r)for(const e of o)uo(t,e,"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.")}}}}),$a=Di({create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},CallExpression(t){Eo(e)&&n.push(...Mo(t))},"Program:exit"(){if(t)for(const t of n)uo(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.")}}}}),Va=Io((e,t)=>{const n=S(e,"gen",t);return n?3===t?pr(n.body):ve(n.body,e=>c(e,"gen")):void 0},e=>"Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline."),Ba=Io(function(e,t){return S(e,"gen",t)?we(e,t,e=>n(e)&&"YieldExpression"===e.type&&!0!==e.delegate):void 0},e=>3===e?"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`.":"Rule: use yield* inside Effect.gen. Why: delegation preserves the yielded Effect's result typing and keeps workflow style consistent. Fix: replace `yield Effect.x` with `yield* Effect.x`."),Ua=Io(function(e){const t=S(e,"gen");if(!t)return;const n=F(t.body);return n.length>=2?n[1]:void 0},e=>"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."),Qa=Io(function(e){const t=S(e,"gen");if(!t||"object"!=typeof t.body||null===t.body)return;const n=t.body,r=Array.isArray(n.body)?n.body:[];if(2!==r.length)return;const o=j(r[0]);return o&&M(r[1],o)?e:void 0},e=>"Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation."),Ka=Io(function(e,t=3){if(d(e))return T(e).filter(e=>q(e,t)).length>=3?e:void 0},e=>"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."),_a=Io(e=>I(e)?e:void 0,e=>"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."),Ya=Io(function(e){if(P(e))return e.arguments.find(e=>L(e))},e=>"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."),Ja=Io(function(e){if(n(e)&&"CallExpression"===e.type)return(e.arguments??[]).find(e=>P(e)&&e.arguments.length>=3)},e=>"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."),Ga=Io(function(e){if(!($(e)<3))return z(n(e)?e.parent:void 0)?void 0:e},e=>"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."),Ha=Io(function(e,t=3){if(d(e))for(const n of T(e)){if(!(c(n,"flatMap")||4===t&&c(n,"flatMapEager")))continue;const e=n.arguments.find(K);if(!e)continue;const r=e.body,o=["IfStatement","SwitchStatement","ForStatement","ForInStatement","ForOfStatement","WhileStatement","DoWhileStatement"].some(e=>W(r,e)),a=void 0!==oe(r,re),s=ie(r,i).length;if(o||a||s>=2)return e}},e=>"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."),Za=Io(function(e,t){if(V(e,t))return B(e.arguments[0])?e:void 0},()=>"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)`."),Xa=Io(function(e,t){const n=S(e,"gen",t);if(!n)return;const r=ie(n.body,e=>U(e,t),new WeakSet,!0,4===t);return r.length>=2?r[1]:void 0},()=>"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."),ec=Io(function(e,t){if(!d(e))return;const n=T(e);if(!n.some(e=>V(e,t)))return;const r=n.filter(e=>q(e,t)).length,o=n.some(e=>W(e,"IfStatement")||W(e,"SwitchStatement")||W(e,"ForStatement")||W(e,"ForInStatement")||W(e,"ForOfStatement")||W(e,"WhileStatement"));return r>=2||o?e:void 0},()=>"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."),tc=Io(function(e,t){if(K(e))return Q(e.body,t).size>=3?e:void 0},e=>"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.",!1,!1,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),nc=Io(function(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=Q(e,t),o=h(e)||void 0!==g(e);return r.size>=2&&(_(e)>=4||o)?e:void 0},e=>"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."),rc=Io(function(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e;for(const e of t.arguments??[]){if(!n(e)||!K(e))continue;const t=e.body;if(n(t)&&"BlockStatement"===t.type&&Array.isArray(t.body)&&t.body.length>=3)return e}},e=>"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."),oc=Io((e,t)=>X(e)||4===t&&c(e,"Service")?e:void 0,e=>3===e?"Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.":"Rule: prefer Context.Service. Fix: migrate legacy Context.Tag, Context.GenericTag or Effect.Service definitions to Context.Service; construct implementations with make and explicit Layer wiring where needed."),ic=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e);r&&o&&ee(o)&&uo(t,o,"Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.")},CallExpression(e){if(3===n||!r)return;const o=J(e,n),i=o&&Gn(o,"make");i&&ee(i)&&uo(t,o,"Rule: do not assemble layers inside Context.Service make. Fix: keep make focused on constructing the implementation and compose Layer.provide at app/test boundaries.")}}}}),ac=Di({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ClassDeclaration(e){const r=G(e);n&&r&&!te(r)&&uo(t,r,"Rule: set accessors: true. Fix: add it to Effect.Service options.")}}}}),cc=Di({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ClassDeclaration(e){const r=G(e),o=r?ae(r):void 0;n&&o&&uo(t,o,"Rule: declare service dependencies.")}}}}),sc=Di({create:e=>({ImportDeclaration(t){const n=ne(t);n&&uo(e,n,"Rule: avoid namespace imports from Effect packages.")}})}),uc=Io(function(e){if(!n(e))return;const t=e.declaration;if(n(t)&&"VariableDeclaration"===t.type)for(const e of t.declarations??[])if(n(e)&&r(e.id)&&e.id.name.endsWith("Service")&&ye(e.init))return e},e=>"Rule: avoid exported manual service objects.",!1,!1,["ExportNamedDeclaration"]),lc=Io(function(e){if(_e(e,"Layer","provide"))return oe(a(e),t=>t!==e&&_e(t,"Layer","provide"))},e=>"Rule: prefer Layer.pipe for nested layer provisioning."),fc=Io(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0);return n?4===t?ve(n.body,ue):oe(n.body,ue):void 0},e=>"Rule: avoid inline layer provisioning inside programs."),pc=Io(function(e){if(_e(e,"Layer","merge"))return e.arguments?.find(t=>oe(t,t=>t!==e&&_e(t,"Layer","merge")))},e=>"Rule: prefer Layer.mergeAll for infrastructure layer groups."),dc=Di({create(e){let t=!1,n=0;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},VariableDeclaration(r){const o=t?fe(r):void 0;o&&(n+=1,n>=3&&uo(e,o,"Rule: group service layers by concern."))}}}}),mc=Io(function(e){if(se(e))return oe(e.body,ce)?e:void 0},e=>"Rule: avoid Layer composition inside request handlers.",!1,!1,["FunctionDeclaration"]),yc=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e),i=o?me(o):void 0;r&&i&&uo(t,i,"Rule: return Effect from service methods.")},CallExpression(e){if(3===n||!r)return;const o=J(e,n),i=o&&me(o,n);i&&uo(t,i,"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.")}}}}),hc=Io(e=>or(e)?e:void 0,e=>"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."),gc=Di({create:e=>({CallExpression(t){dr(t)&&sr(t.arguments)&&uo(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."),lr(t)&&cr(t.arguments)&&uo(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.")}})}),bc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},CallExpression(n){const r=a(n),o=rr(r);t&&c(n,"sync")&&fr(r)&&!Ne(o)&&uo(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.")}}}}),vc=Di({create(t){const n=3===e(t.options)?"zipRight":"andThen";return{CallExpression(e){c(e,"as")&&Ge(a(e))&&uo(t,e,"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."),c(e,n)&&Ge(a(e))&&uo(t,e,`Rule: avoid Effect.${n} 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.`)}}}}),wc=Di({create:e=>({CallExpression(t){c(t,"all")&&He(t.arguments[0])&&Ze(t.arguments[1])&&uo(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."),Xt(t)&&He(a(t.callee.object))&&uo(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.")}})}),Ec=Io(function(e,t){return be(e,t).find(he)},()=>"Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: adapt with Effect.tryPromise, compose with gen/flatMap, and keep map pure."),xc=Io((e,t)=>Ee(e,t,"ThrowStatement"),e=>`Rule: avoid throw inside Effect logic. Why: thrown exceptions ${3===e?"bypass typed Effect error channels and interruption semantics":"are not typed domain failures"}. Fix: yield* Effect.fail(taggedError) in gen, or return it from flatMap; keep map pure.`),Sc=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(!r)return;const o=Ie(e,n);o&&uo(t,o,`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 ${3===n?"orDie/orDieWith":"orDie"} for explicit application boundaries.`)}}}}),kc=Io(function(e,t){if(3===t){if(!c(e,"catchAll"))return;const t=Cn(a(e));return Oe(t)?t:void 0}for(const n of Jr(e,Gr(t))){const e=Cn(n);if(Oe(e,t))return e;for(const n of Hr(e))if(Oe(n.argument,t))return n.argument}},e=>`Rule: avoid swallowing errors in ${3===e?"catchAll":"catch/catchEager"}. 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.`),Ac=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&Tr(n)&&uo(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&&Tr(n)&&uo(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&&Tr(n)&&uo(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.")}}}}),Rc=Di({meta:{schema:va},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(r&&!wo(t)){const r=to(e,n);r&&uo(t,r,"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.")}}}}}),Fc=Io(e=>no(e)?e:void 0,e=>`Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad ${3===e?"catchAll":"catch"} recovery. Fix: return Option, ${3===e?"Either":"Result"}, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`),Wc=Io(function(e,t){return we(e,t,oo)},()=>"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."),Dc=Io(e=>Kr(e)?e:void 0,()=>"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."),Cc=Io(function(e,t){for(const n of Jr(e,Gr(t))){const e=Cn(n);if(Yr(e))return e;for(const t of Hr(e))if(Yr(t.argument))return t.argument}},e=>`Rule: do not rethrow generic Error from ${3===e?"catchAll":"catch"}. Why: ${3===e?"catchAll":"catch"} 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.`),jc=Io(function(e,t){const n=3===t?Jr(e,pa):be(e,t).filter(()=>/^catch/.test(String(e.callee.property.name)));for(const e of n){const n=Cn(e),r=3===t?oe:ve,o=r(n,Ye);if(o&&!r(n,e=>Zr(e)||4===t&&(c(e,"failCause")||c(e,"die"))))return o}},()=>"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."),Mc=Io(function(e){return Le(e)?e:d(e)?en(e).find(e=>Le(e)):void 0},()=>"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."),Tc=Io((e,t)=>Ee(e,t,"TryStatement"),e=>`Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.${3===e?"catchAll":"catch"}, Effect.catchTag, or typed error combinators.`),qc=Io(function(e,t){return we(e,t,e=>xe(e)||Se(e,t))},()=>"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."),Pc=Di({create:e=>({TryStatement(t){uo(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.")}})}),Ic=Di({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])nn(n.init)&&uo(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){rn(t.body)&&uo(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.")}})}),Oc=Di({create:e=>({TSTypeReference(t){(on(t,"Effect","Effect")||on(t,"Layer","Layer"))&&uo(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.")}})}),Lc=Io(function(e,t){const n=en(e);if(0===n.length)return;const r=Dn(n,t);return r&&(Rn(n)||Wn(n,t))?r:void 0},e=>`Rule: avoid ${3===e?"catchAll":"catch/catchEager"} after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of ${3===e?"catchAll":"catch/catchEager"}.`),Nc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},ExpressionStatement(n){t&&dr(n.expression)&&ur(n.expression.arguments)&&uo(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.")}}}}),zc=Io(function(e){if(!c(e,"sync"))return;const t=Cn(a(e));return t?Mn(t):void 0},()=>"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."),$c=Di({create:e=>({CallExpression(t){if(!_e(t,"Atom","family"))return;const n=Pn(t.arguments);n&&uo(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.")}})}),Vc=Io(function(e){if(d(e))return en(e).find(e=>In(e))},e=>`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 ${3===e?"an Effect.Service":"a Context.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.`),Bc=Di({create(t){const n=3===e(t.options)?"Schema.make` or field `.make":"schema .make";return{CallExpression(e){$n(e)&&uo(t,e,`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 (\`${n}\`), and keep serialization at boundaries with schema encode/decode flows. Use \`linting.md\` guidance when available.`)}}}}),Uc=Io(e=>c(e,"succeed")&&Vn(a(e))?e:void 0,()=>"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."),Qc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&An(n.typeAnnotation,"Effect","Effect")&&uo(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.")}}}}),Kc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},ExportNamedDeclaration(n){const r=t?En(n):void 0;r&&uo(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){const r=t?En(n):void 0;r&&uo(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.")}}}}),_c=Di({create:e=>Oo(e,({errorChannel:e})=>sn(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.")}),Yc=Di({create:e=>Oo(e,({errorChannel:e})=>"unknown"===Sn(e),"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.")}),Jc=Di({create:e=>Oo(e,({errorChannel:e})=>kn(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.")}),Gc=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},VariableDeclaration(e){r&&Bn(e,n)&&uo(t,e,"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.")}}}}),Hc=Di({create(e){let t=!1,r=!1;const o=[],i=new WeakSet,a=t=>{n(t)&&!i.has(t)&&(i.add(t),uo(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){const n=fo(e);n&&ko(n)&&(t=!0)},BinaryExpression(e){t&&Un(e)&&(r?a(e):o.push(e))},CallExpression(e){if(t&&Qn(e)){r=!0;for(const e of o)a(e)}}}}}),Zc=Io((e,t)=>Jn(e,t)?e:void 0,e=>`Rule: avoid nullish re-wrap inside Option.${3===e?"fromNullable":"fromNullishOr"}. Why: \`x ?? null\` and \`x ?? undefined\` add noise and hide source shape. Fix: pass the source directly to Option.${3===e?"fromNullable":"fromNullishOr"}.`),Xc=Io(e=>Zn(e)?e:void 0,e=>"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."),es=Di({create(t){const n=e(t.options);return{CallExpression(e){c(e,"succeed")&&Kn(a(e))&&uo(t,e,`Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/${3===n?"Either":"Result"}/tagged unions) or real Effect results instead.`)}}}}),ts=Di({create(t){const n=e(t.options);return{VariableDeclaration(e){Xn(e)&&uo(t,e,`Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/${3===n?"Either":"Result"}, or meaningful domain values instead of string tokens.`)}}}}),ns=Io(e=>gr(e)?e:void 0,e=>"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.",!1,!1,["TSTypeAliasDeclaration"]),rs=Di({create(e){let t=!1;const n=n=>{if(t)for(const t of Rr(n))uo(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){const n=fo(e);n&&ko(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),os=Io(e=>so(e)?e:void 0,e=>"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.",!1,!1,["BinaryExpression"]),is=Io(e=>kr(e)?e:void 0,e=>"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.",!1,!1,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),as=Di({create(e){let t=!1;const n=n=>{if(t)for(const t of qr(n))uo(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){const n=fo(e);n&&ko(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),cs=new Set(["fs","node:fs","fs/promises","node:fs/promises"]),ss=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"]),us=Di({meta:{schema:va},create:e=>({ImportDeclaration(t){const n=fo(t);n&&Lo(n)&&!wo(e)&&uo(e,t,"Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.")}})}),ls=Di({meta:{schema:[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}},configPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},create:e=>({MemberExpression(t){!$o(t)||Vo(t)||wo(e)||So(e)||uo(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.")}})}),fs=Di({create(e){let t=!1,n=0;const r=[];return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0),n&&cs.has(n)&&r.push({node:e,source:n})},FunctionDeclaration(){n+=1},"FunctionDeclaration:exit"(){n-=1},FunctionExpression(){n+=1},"FunctionExpression:exit"(){n-=1},ArrowFunctionExpression(){n+=1},"ArrowFunctionExpression:exit"(){n-=1},CallExpression(e){if(0!==n)return;const t=Bo(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(const{node:t,source:n}of r)uo(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.`)}}}}),ps=Di({meta:{schema:va},create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){qe(e,n)&&o.push(e)},"Program:exit"(){if(r&&!wo(t))for(const e of o)uo(t,e.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.")}}}}),ds=new Set(["try","tryPromise","mapError","catchAll","catchTag","catchTags"]),ms=Di({meta:{schema:va},create(t){const n=e(t.options);return{TryStatement(e){e.handler&&wo(t)&&!Uo(e,n)&&uo(t,e,3===n?"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.":"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, Effect.catch, or execute a mapped Effect program.")}}}}),ys=Di({create(t){const n=e(t.options);let r=!1,i=!1;const a=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0),To(e)&&(i=!0)},CallExpression(e){o(e.callee,"JSON","parse")&&a.push(e)},"Program:exit"(){if(r&&!i)for(const e of a)uo(t,e,3===n?"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.":"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: use Schema.fromJsonString with Schema.decodeUnknownEffect at the boundary.")}}}}),hs=Di({create(t){const n=e(t.options);let r=!1;const o=new WeakSet,i=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(A(e,n))for(const t of ie(e.arguments,R))o.has(t)||(o.add(t),i.push(t))},"Program:exit"(){if(r)for(const e of i)uo(t,e,"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.")}}}}),gs=Di({meta:{schema:va},create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},NewExpression(e){r(e.callee,"Date")&&n.push(e)},"Program:exit"(){if(t&&!wo(e))for(const t of n)uo(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.")}}}}),bs=Di({create(e){let t=!1;const n=n=>{if(t)for(const t of Ir(n))uo(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){const n=fo(e);n&&ko(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),vs=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},LogicalExpression(n){t&&Lr(n)&&uo(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.")}}}}),ws=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},LogicalExpression(n){t&&$r(n)&&uo(e,n,"Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.")}}}}),Es=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},CallExpression(n){t&&Vr(n)&&uo(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&&io(n)&&uo(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.")}}}}),xs=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},FunctionDeclaration(n){t&&co(n)&&uo(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.")}}}}),Ss=Di({create:e=>({CallExpression(t){o(t.callee,"Effect","as")&&uo(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.")}})}),ks=Di({create:e=>({MemberExpression(t){o(t,"Effect","Do")&&uo(e,t,"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.")}})}),As=Qo("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."),Rs=Qo("Runtime","runFork","Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.",!0),Fs=Di({meta:{schema:va},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){r&&!wo(t)&&qe(e,n)&&uo(t,e.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.")}}}}),Ws=Qo("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.",!0),Ds=Di({create:e=>({CallExpression(t){s(t)&&uo(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.")}})}),Cs=Di({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])s(n.init)&&uo(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)&&uo(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.")}})}),js=Di({create(t){const n=e(t.options);return{VariableDeclaration(e){for(const r of e.declarations??[]){const e=f(r.init,n);e&&uo(t,r.init,e)}},ReturnStatement(e){const r=f(e.argument,n);r&&uo(t,e.argument,r)}}}}),Ms=Di({create:e=>({CallExpression(t){d(t)&&m(t.arguments)&&uo(e,t,"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.")}})}),Ts=Di({create:e=>({CallExpression(t){u(t)&&uo(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.")}})}),qs=Di({create:t=>4===e(t.options)?{}:{CallExpression(e){p(e)&&uo(t,e,"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.")}}}),Ps=Io(e=>tt(e)?e:void 0,e=>"Rule: avoid unbounded Effect.all policies over mapped collections. Why: an explicit concurrency option makes scheduling policy visible; omission defaults to sequential execution, not unlimited parallelism. Fix: pass an explicit `{ concurrency: n }` option or use a bounded batching strategy."),Is=Di({create(t){let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ExpressionStatement(r){const o=e(t.options),i=n?ot(r.expression,o):void 0;i&&uo(t,i,3===o?"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.":"Rule: avoid discarded Effect.forkChild / Effect.forkDetach constructions or handles. Why: a bare construction is lazy and starts no work; yielding then discarding the fiber loses explicit observation. Child fibers follow parent lifetime, detached fibers do not. Fix: retain and join/await/interrupt the fiber, or use forkScoped / forkIn with explicit scope ownership.")}}}}),Os=Di({create(t){let n=!1;const r=r=>{if(!n)return;const o=e(t.options),i=3===o?nt(r.body):ve(r.body,e=>void 0!==rt(e));i&&uo(t,4===o?rt(i):i,3===o?"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.":"Rule: avoid Effect.forkChild / Effect.forkDetach inside loops. Why: per-item forks lack a collection-wide concurrency budget even when handles are retained. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit; preserve observation and lifetime ownership.")};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ForStatement:r,ForInStatement:r,ForOfStatement:r,WhileStatement:r,DoWhileStatement:r}}}),Ls=Di({create(t){let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},CallExpression(r){const o=e(t.options);n&&Et(r,o)&&uo(t,r,3===o?"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.":"Rule: require visible cleanup ownership around Effect races. Why: race operators interrupt losers, but resource release still needs a finalizer or scope. Fix: expose ensuring/acquireRelease or a scoped race boundary; race/raceAll select success, raceFirst/raceAllFirst select first completion.")}}}}),Ns=Di({create(t){let n=!1;const o=new Map,i=new Set,a=new Set;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},VariableDeclarator(n){if(4===e(t.options))return void(r(n.id)&&"YieldExpression"===n.init?.type&&rt(n.init.argument)&&a.add(n));const i=Jt(n);i&&o.set(i,n)},CallExpression(n){if(4===e(t.options))return;const r=Gt(n);r&&i.add(r)},"Program:exit"(){if(n)if(4!==e(t.options))for(const[e,n]of o)i.has(e)||uo(t,n,"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.");else for(const e of a)(t.sourceCode?.getDeclaredVariables(e)??[]).some(e=>e.references.some(e=>Ht(e.identifier)))||uo(t,e,"Rule: avoid unobserved forked fibers. Why: yielded child/detached handles need explicit observation or ownership transfer. Fix: join/await/interrupt the same lexical binding, return it to its owner, or use scoped fork APIs. This checks reference syntax, not whether observation executes.")}}}}),zs=Io(e=>St(e)?e:void 0,()=>"Rule: avoid unbounded concurrent retry policies. Why: inline retries need an explicit collection scheduling policy; omitted concurrency defaults to sequential execution, not unlimited parallelism. Fix: add an explicit concurrency limit and a bounded retry/backoff policy. This heuristic checks option presence, not its bound or retry count."),$s=Io(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0),r=4===t?e=>ve(e,je):Me;if(n)return r(n.body);if(c(e,"sync")){const t=Cn(a(e));return t?r(t):void 0}},e=>`Rule: avoid blocking sync calls inside Effect logic. Why: synchronous I/O or CPU work blocks the executing JavaScript thread; wrapping it in a Promise does not offload it. Fix: use genuinely asynchronous platform APIs via Effect.${4===e?"callback":"async"}/tryPromise, or a dedicated worker for blocking work. Sync suffix recognition is a heuristic.`),Vs=Io(function(e,t=3){if(4===t){const n=S(e,"fn",t)??(c(e,"sync")?a(e):void 0);return(n?ve(Cn(n),Ae):void 0)??we(e,t,Ae)}const n=S(e,"gen");if(n)return Re(n.body);if(c(e,"sync")){const t=Cn(a(e));return t?Re(t):void 0}if(!i(e))return;const o=e.callee.property;if(r(o)&&Li.has(o.name))for(const t of e.arguments){const e=Cn(t),n=e?Re(e):void 0;if(n)return n}},e=>`Rule: avoid Promise concurrency APIs inside Effect logic. Why: raw Promise aggregation does not own interruption of its underlying operations. Fix: use bounded Effect.all/forEach, Effect.${4===e?"result":"either"} for settled outcomes, raceFirst for first completion or race for first success, with signal-aware boundary adapters. Preserve application error semantics explicitly.`),Bs=Di({create(t){let n=!1;const r=new Set,o=[],i=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},VariableDeclaration(n){if("let"===n.kind||"var"===n.kind)if(4!==e(t.options))for(const e of kt(n))r.add(e);else o.push(n)},CallExpression(o){if(!n)return;if(4===e(t.options)){const e=Dt(o);return void(e&&i.push(e))}const a=Wt(o);if(!a)return;const c=Ft(a,r);c&&uo(t,c,"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.")},"Program:exit"(){if(!n||4!==e(t.options))return;const r=o.flatMap(e=>t.sourceCode.getDeclaredVariables(e));for(const e of i){const n=Mt(e,r);n&&uo(t,n,"Rule: avoid mutating shared state across fibers. Why: outer let/var writes in child/detached or collection work couple workers through mutable state. Fix: use Ref updates or aggregate immutable results. This checks lexical inline work, not execution or a proven data race; collections default to sequential execution.")}}}}}),Us=Io(function(e,t=3){if(4===t){let t;return[...Vi].some(t=>c(e,t))||n(e)&&"CallExpression"===e.type&&[...Vi].some(t=>c(e.callee,t))?t=a(e):d(e)&&[...Vi].some(t=>c(e.arguments.at(-1),t))&&(t=Ce(e)),c(t,"promise")?Fe(a(t))?void 0:t:c(t,"tryPromise")&&!We(t)?t:void 0}if(!c(e,"timeout"))return;const r=a(e);return De(r)?r:void 0},()=>"Rule: avoid timeout around noninterruptible Promise effects. Why: Effect timeout interrupts the wrapper, but the underlying operation stops only if it observes cancellation. Fix: accept and forward AbortSignal in the adapter to an API that honours it. Parameter presence is a syntax heuristic, not proof of cancellation."),Qs=Io((e,t)=>Qt(e,t)?e:void 0,()=>"Rule: avoid uninterruptible concurrent regions. Why: broad masking around collection, fork, race or waiting work can defer cancellation and shutdown. Fix: keep only a short critical section masked and explicitly restore interruption for long-running work. Scoping alone does not restore interruptibility; syntax does not prove the mask is actually executed."),Ks=Io((e,t)=>Kt(e,t)?e:void 0,()=>"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."),_s=Di({create(t){let n=!1;const r=new Set,o=[],i=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},VariableDeclaration(n){if(4!==e(t.options))for(const e of Yt(n))r.add(e);else o.push(n)},CallExpression(o){if(!n)return;if(4===e(t.options)){const e=Dt(o);return void(e&&i.push(e))}const a=Wt(o);if(!a)return;const c=Ft(a,r);c&&uo(t,c,"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.")},"Program:exit"(){if(!n||4!==e(t.options))return;const r=o.flatMap(e=>t.sourceCode.getDeclaredVariables(e).filter(t=>("module"===t.scope.type||"global"===t.scope.type)&&Yt(e).includes(t.name)));for(const e of i){const n=Mt(e,r);n&&uo(t,n,"Rule: avoid global mutable concurrency state. Why: module-owned let/var or mutable containers couple inline workers. Fix: own Ref or immutable results in a service/layer. Lexical syntax does not prove execution or a data race; default collections are sequential.")}}}}}),Ys=Di({create(t){let n=!1;const o=[new Set],i=new WeakSet,c=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},FunctionDeclaration(){o.push(new Set)},"FunctionDeclaration:exit"(){o.pop()},FunctionExpression(){o.push(new Set)},"FunctionExpression:exit"(){o.pop()},ArrowFunctionExpression(){o.push(new Set)},"ArrowFunctionExpression:exit"(){o.pop()},VariableDeclarator(n){if(4===e(t.options)){const e="YieldExpression"===n.init?.type?n.init.argument:n.init;return void(r(n.id)&&(_e(e,"Deferred","make")||_e(e,"Deferred","makeUnsafe"))&&c.push(n))}const i=yt(n);i&&o.at(-1)?.add(i)},CallExpression(c){if(4===e(t.options))return;if(!n||!mt(c))return;const s=a(c);r(s)&&o.at(-1)?.has(s.name)&&(bt(c,s.name)||i.has(c)||(i.add(c),uo(t,c,"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.")))},"Program:exit"(){if(n&&4===e(t.options))for(const e of c)for(const n of t.sourceCode.getDeclaredVariables(e))for(const e of n.references){const r=e.identifier.parent;mt(r)&&a(r)===e.identifier&&!bt(r,n.name,4,n.references)&&uo(t,r,"Rule: avoid unbounded manual Deferred coordination. Why: a local latch needs visible completion or cancellation ownership. Fix: use a timeout/race or an interruptible owner with a same-binding finalizer. Scope/interruptibility/finalizer markers alone do not prove eventual completion.")}}}}}),Js=Io((e,t)=>{const n=Ot(e,t);return n?Vt(n,t):void 0},e=>"Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: "+(3===e?"wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.":"own release; a scope marker is insufficient."),!0),Gs=Io((e,t)=>{const n=st(e,t);return n&&(4===t?Ut(n,!0):at(n))?e:void 0},()=>"Rule: avoid suspension while holding a semaphore permit. Why: unrelated waits hold capacity needed by other work. Fix: narrow coordination critical sections when semantics allow. Async work may intentionally be permit-bound; moving it outside changes concurrency limits. This strict policy is not leak detection."),Hs=Io((e,t)=>{const n=ut(e,t);return n&&(3===t?at(n):Ut(Cn(n)??n,!0))?e:void 0},e=>"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: "+(3===e?"compute the effect outside the modifier and commit a short synchronous state transition.":"move independent work outside; retain atomicity.")),Zs=Di({create:e=>({ImportExpression(t){uo(e,t,"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.")}})}),Xs=Io((e,t)=>{if(3===t)return c(e,"forkDaemon")&&!l(a(e),"supervised")?e:void 0;const n=d(e)?e.arguments.at(-1):e?.callee;if(c(e,"forkDetach")){const t=a(e);return!t||r(t,"undefined")||Ve(t)?void 0:e}return c(n,"forkDetach")||pt(n,"forkDetach")?e:void 0},e=>`Rule: avoid unscoped background fibers. Why: Effect.${3===e?"forkDaemon":"forkDetach"} detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn ${3===e?"or make supervisor ownership explicit in the child effect.":"or child ownership; join is not lifetime ownership."}`),eu=Jo((e,t)=>It(e)&&!Yo(e,t),()=>"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."),tu=new Set(["BlockStatement","CatchClause","ForInStatement","ForOfStatement","ForStatement","Program","SwitchStatement"]),nu={"no-react-state":Ea,"no-if-statement":xa,"no-switch-statement":Sa,"no-ternary":ka,"no-return-null":Aa,"no-option-as":Ra,"no-effect-never":Fa,"no-arrow-ladder":Wa,"no-branch-in-object":Da,"no-iife-wrapper":Ca,"no-return-in-arrow":ja,"no-return-in-callback":Ma,"no-effect-fn-generator":Ta,"no-effect-sync-console":qa,"no-console-in-effect-flow":Ia,"no-effect-log-without-structured-context":Oa,"require-span-on-public-service-method":La,"no-runpromise-in-non-async-test-body":Na,"require-effect-flip-for-error-test":za,"no-test-mock-layer-when-default-available":$a,"no-nested-effect-gen":Va,"no-yield-without-star-in-effect-gen":Ba,"no-piped-yield-in-gen":Ua,"no-gen-for-mapping":Qa,"prefer-gen-for-workflow":Ka,"no-business-logic-in-pipe":Ha,"no-large-anonymous-flow":_a,"no-effect-in-flow":Ya,"prefer-named-flow":Ja,"prefer-flow-for-pure-pipeline":Ga,"prefer-pipe-for-behavior":Za,"prefer-decorated-effect-before-gen":Xa,"no-workflow-in-behavior-pipe":ec,"no-mixed-pillar-function":tc,"no-clever-effect-expression":nc,"prefer-extracted-concept":rc,"prefer-effect-service":oc,"no-layer-provide-in-service-definition":ic,"require-service-accessors":ac,"require-service-dependencies":cc,"no-namespace-effect-import":sc,"no-manual-service-object-export":uc,"no-layer-merge-in-request-handler":mc,"no-service-method-returning-promise":yc,"prefer-layer-pipe":lc,"no-inline-layer-provide-in-program":fc,"prefer-layer-mergeall-for-infrastructure":pc,"no-service-layer-scatter":dc,"no-match-void-branch":hc,"no-json-parse-without-schema":ys,"no-date-now-in-effect":hs,"no-new-date-in-domain-logic":gs,"no-match-effect-branch":gc,"warn-effect-sync-wrapper":bc,"no-effect-side-effect-wrapper":vc,"no-effect-all-step-sequencing":wc,"no-async-effect-combinator-callback":Ec,"no-throw-in-effect-logic":xc,"no-or-die-outside-boundary":Sc,"no-swallowed-catch-all":kc,"no-effect-ignore":Mc,"no-try-catch-in-effect-logic":Tc,"no-promise-api-in-effect-logic":qc,"no-try-catch":Pc,"no-effect-wrapper-alias":Ic,"no-manual-effect-channels":Oc,"no-wrapgraphql-catchall":Lc,"no-render-side-effects":Nc,"no-atom-registry-effect-sync":zc,"no-family-collection-read":$c,"no-inline-runtime-provide":Vc,"no-naked-object-state-update":Bc,"no-effect-succeed-variable":Uc,"no-effect-type-alias":Qc,"no-public-generic-effect-error":Kc,"no-early-catchall-null":Rc,"no-empty-error-tag":Ac,"no-expected-state-as-error":Fc,"no-exception-domain-error":Wc,"no-effect-fail-error-message":Dc,"no-catchall-generic-rethrow":Cc,"no-log-only-error-handling":jc,"no-error-as-public-effect-error":_c,"no-unknown-public-error-channel":Yc,"no-mixed-effect-error-shapes":Jc,"no-model-overlay-cast":Gc,"no-unknown-boolean-coercion-helper":Hc,"no-fromnullable-nullish-coalesce":Zc,"no-option-boolean-normalization":Xc,"no-string-sentinel-return":es,"no-string-sentinel-const":ts,"no-raw-domain-id-alias":ns,"no-boolean-domain-flag":rs,"no-magic-domain-string":os,"no-raw-domain-primitive-params":is,"no-raw-time-domain-field":as,"no-hidden-effect-execution":ps,"no-boundary-try-catch-without-effect-map":ms,"no-node-fs-in-effect-code":fs,"no-node-platform-in-shared-code":us,"no-process-env-direct-read":ls,"no-overloaded-options-object":bs,"no-domain-logic-in-conditional":vs,"no-implicit-state-machine-object":ws,"no-adhoc-domain-error":Es,"no-domain-meaning-by-folder-only":xs,"no-effect-as":Ss,"no-effect-do":ks,"no-effect-bind":As,"no-runtime-runfork":Rs,"no-run-effect-outside-boundary":Fs,"no-effect-async":Ws,"prevent-dynamic-imports":Zs,"no-nested-effect-call":Ds,"no-effect-ladder":Cs,"no-flatmap-ladder":js,"no-pipe-ladder":Ms,"no-call-tower":Ts,"no-effect-orElse-ladder":qs,"no-unbounded-effect-all":Ps,"no-fire-and-forget-fork":Is,"no-fork-in-loop":Os,"no-race-without-cleanup":Ls,"no-unobserved-fiber":Ns,"no-unbounded-concurrent-retry":zs,"no-blocking-call-in-effect":$s,"no-promise-concurrency-in-effect":Vs,"no-shared-mutable-state-across-fibers":Bs,"no-timeout-with-noninterruptible-promise":Us,"no-uninterruptible-concurrent-region":Qs,"no-unbounded-queue-or-pubsub":Ks,"no-global-mutable-concurrency-state":_s,"no-manual-deferred-coordination":Ys,"no-acquire-without-scoped-release":Js,"no-manual-resource-close":eu,"no-unbound-scope":Jo((e,t)=>Go(e)&&!pi(e,t),e=>"Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: "+(3===e?"use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.":"use Effect.scope or acquire it with a matching Scope.close release callback. Effect.scoped alone does not own a separate scope.")),"no-resource-succeed-escape":Jo(e=>c(e,"succeed")&&Pt(a(e)),()=>"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-resource-without-acquire-release":Jo((e,t)=>Lt(e)&&!hi(e,t),e=>`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, ${3===e?"Effect.scoped, ":""}or a matching finalizer.`),"no-request-scoped-long-lived-resource":Io(function(e,t=3){if(!wi(e)||!n(e))return[];const r=e;return ie(r.body,e=>mi(e)&&Ei(e,t)===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.",!0,!0,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),"no-global-resource-singleton":Io(e=>void 0===ci(e)&&di(e)?e:void 0,e=>`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${3===e?" or Effect.Service":" using Context.Service"} and provide it at the application boundary.`,!1,!0,["NewExpression"]),"no-run-with-open-resource":Io((e,t)=>qe(e,t)&&void 0!==xi(e,t)?e:void 0,()=>"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":Io(function(e,t=3){if(yi(e,t))return ie(e,e=>yi(e,t)).length>=3?e:void 0},()=>"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":Io((e,t,n)=>ki(e,t,n)?e:void 0,e=>3===e?"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*.":"Rule: make service layer provision visible before running. Why: a context argument or Service-shaped yield does not prove Layer ownership. Fix: provide the required Layer before Effect.run*. This is syntax policy, not dependency type checking."),"no-yield-with-held-semaphore-permit":Gs,"no-yield-with-held-mutable-ref":Hs,"no-unscoped-background-fiber":Xs};for(const e of Ci){const n=nu[e];n.meta={...n.meta,schema:t(Array.isArray(n.meta?.schema)?n.meta.schema:[])}}const ru=["no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available"],ou=["no-manual-deferred-coordination","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],iu=["no-early-catchall-null","no-empty-error-tag"],au=["no-business-logic-in-pipe"],cu=["prefer-flow-for-pure-pipeline"],su=["no-request-scoped-long-lived-resource","no-global-resource-singleton","no-nested-acquire-release","no-missing-layer-provision-at-run"],uu=[{name:"linteffect",specifier:"@opsydyn/oxlint-effect"}],{reactAndRuntimeBoundariesRules:lu,effectCompositionRules:fu,concurrencySafetyRules:pu,resourceLifetimeRules:du,pipelineShapeAndSequencingRules:mu,branchingAndLocalControlFlowRules:yu,optionMatchAndDataNormalizationRules:hu,atomStateAndPlatformBoundariesRules:gu,domainModelingRules:bu,errorModelingRules:vu,dddRules:wu,effectFlowRules:Eu,pureTransformationRules:xu,behaviorDecorationRules:Su,styleSeparationRules:ku,serviceAndLayerArchitectureRules:Au,platformAndBoundaryHygieneRules:Ru,testingObservabilityAndQaRules:Fu,allRules:Wu,recommendedRules:Du,ruleGroups:Cu,recommended:ju,typeAware:Mu,reactAndRuntimeBoundaries:Tu,effectComposition:qu,concurrencySafety:Pu,resourceLifetime:Iu,pipelineShapeAndSequencing:Ou,branchingAndLocalControlFlow:Lu,optionMatchAndDataNormalization:Nu,atomStateAndPlatformBoundaries:zu,domainModeling:$u,errorModeling:Vu,ddd:Bu,effectFlow:Uu,pureTransformation:Qu,behaviorDecoration:Ku,styleSeparation:_u,serviceAndLayerArchitecture:Yu,platformAndBoundaryHygiene:Ju,testingObservabilityAndQa:Gu,presets:Hu}=Fi(4),Zu=Fi(3);var Xu=Wi({meta:{name:"linteffect"},rules:nu});export{Wu as allRules,zu as atomStateAndPlatformBoundaries,gu as atomStateAndPlatformBoundariesRules,Ku as behaviorDecoration,Su as behaviorDecorationRules,Lu as branchingAndLocalControlFlow,yu as branchingAndLocalControlFlowRules,Pu as concurrencySafety,pu as concurrencySafetyRules,Bu as ddd,wu as dddRules,Xu as default,$u as domainModeling,bu as domainModelingRules,Zu as effect3,qu as effectComposition,fu as effectCompositionRules,Uu as effectFlow,Eu as effectFlowRules,Vu as errorModeling,vu as errorModelingRules,uu as jsPlugins,Nu as optionMatchAndDataNormalization,hu as optionMatchAndDataNormalizationRules,Ou as pipelineShapeAndSequencing,mu as pipelineShapeAndSequencingRules,Ju as platformAndBoundaryHygiene,Ru as platformAndBoundaryHygieneRules,Hu as presets,Qu as pureTransformation,xu as pureTransformationRules,Tu as reactAndRuntimeBoundaries,lu as reactAndRuntimeBoundariesRules,ju as recommended,Du as recommendedRules,Iu as resourceLifetime,du as resourceLifetimeRules,Cu as ruleGroups,Yu as serviceAndLayerArchitecture,Au as serviceAndLayerArchitectureRules,_u as styleSeparation,ku as styleSeparationRules,Gu as testingObservabilityAndQa,Fu as testingObservabilityAndQaRules,Mu as typeAware};
1
+ function e(e){const t=e[0];if("object"!=typeof t||null===t||!Object.hasOwn(t,"effectVersion"))return 4;const n=t.effectVersion;if(3===n||4===n)return n;throw new Error("effectVersion must be 3 or 4")}function t(e){const t=e[0];return[{type:"object",additionalProperties:!1,...t,properties:{...t?.properties,effectVersion:{type:"integer",enum:[3,4]}}},...e.slice(1)]}function n(e){return"object"==typeof e&&null!==e}function r(e,t){return n(e)&&"Identifier"===e.type&&"string"==typeof e.name&&(void 0===t||e.name===t)}function o(e,t,o){if(!n(e))return!1;const i=e;return"MemberExpression"===i.type&&!0!==i.computed&&r(i.object,t)&&r(i.property,o)}function i(e){return _e(e,"Effect")&&Array.isArray(e.arguments)}function a(e){return e.arguments[0]}function c(e,t){return!!i(e)&&r(e.callee.property,t)}function s(e){if(!i(e))return!1;const t=a(e);return!!i(t)&&i(a(t))}function u(e){return!!i(e)&&e.arguments.slice(0,2).some(e=>i(e))}function l(e,t,n=new WeakSet){return void 0!==oe(e,e=>c(e,t),n)}function f(e,t){return(c(e,"flatMap")||4===t&&c(e,"flatMapEager"))&&(l(e.arguments,"flatMap")||4===t&&l(e.arguments,"flatMapEager"))?"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.":c(e,"flatten")&&l(a(e),"map")?"Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.":void 0}function p(e){if(!c(e,"orElse"))return!1;const t=a(e);return ji.some(e=>l(t,e))}function d(e){if(!n(e))return!1;const t=e;if("CallExpression"!==t.type)return!1;if(r(t.callee,"pipe"))return!0;const o=t.callee;return n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&r(o.property,"pipe")}function m(e,t=new WeakSet){return void 0!==oe(e,e=>d(e),t)}function y(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)&&"object"==typeof t.callee&&null!==t.callee&&"ArrowFunctionExpression"===t.callee.type}function h(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)&&"object"==typeof t.callee&&null!==t.callee&&("ArrowFunctionExpression"===t.callee.type||"FunctionExpression"===t.callee.type)}function g(e,t=new WeakSet){return oe(e,y,t)}function b(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>b(e,t)):n(e)?t.has(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:b(n,t))):[]}function v(e,t){if(!n(e))return!1;const r=e,i=3===t?"filter":"makeFilter";return"CallExpression"===r.type&&(o(r.callee,"S",i)||o(r.callee,"Schema",i))}function w(e,t){if(!n(e))return[];const r=e;return"CallExpression"!==r.type||!Array.isArray(r.arguments)||v(r,t)?[]:r.arguments.flatMap(e=>{if(!n(e)||"ArrowFunctionExpression"!==e.type)return[];const t=e.body;return n(t)&&"BlockStatement"===t.type?b(t):[]})}function E(e){if(!n(e))return[];const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)?t.arguments.flatMap(e=>n(e)&&"FunctionExpression"===e.type&&!0!==e.generator?b(e.body):[]):[]}function x(e){return n(e)&&"FunctionExpression"===e.type&&!0===e.generator}function S(e,t,r=3){const o=4===r&&"fn"===t&&n(e)&&"CallExpression"===e.type&&c(e.callee,"fn");if(!c(e,t)&&!o)return;const i=4===r?e.arguments.find(x):a(e);return x(i)?i:void 0}function k(e,t,n=3){return void 0!==S(e,t,n)}function A(e,t=3){if(i(e)){const n=e.callee.property;if(r(n)&&(Mi.has(n.name)||4===t&&("fnUntraced"===n.name||"fnUntracedEager"===n.name)))return!0}if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&c(o.callee,"fn")}function R(e){return n(e)&&"CallExpression"===e.type&&o(e.callee,"Date","now")}function F(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>F(e,t)):n(e)?t.has(e)?[]:(t.add(e),"YieldExpression"===e.type&&!0===e.delegate&&d(e.argument)?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:F(n,t))):[]}function W(e,t,r=new WeakSet){return Array.isArray(e)?e.some(e=>W(e,t,r)):!!n(e)&&!r.has(e)&&(r.add(e),e.type===t||Object.entries(e).some(([e,n])=>"parent"!==e&&W(n,t,r)))}function D(e,t,n=new WeakSet){return void 0!==oe(e,e=>r(e,t),n)}function C(e,t=new WeakSet){return void 0!==oe(e,e=>i(e),t)}function j(e){if(!n(e)||"VariableDeclaration"!==e.type)return;const t=e.declarations;if(!Array.isArray(t)||1!==t.length)return;const o=t[0];return n(o)&&"VariableDeclarator"===o.type&&r(o.id)&&"object"==typeof o.init&&null!==o.init&&"YieldExpression"===o.init.type&&!0===o.init.delegate?o.id.name:void 0}function M(e,t){if(!n(e)||"ReturnStatement"!==e.type)return!1;const o=e.argument;return!(void 0===o||r(o,t)||W(o,"YieldExpression")||W(o,"AwaitExpression")||C(o)||D(o,"Promise"))}function T(e){if(!n(e)||"CallExpression"!==e.type)return[];const t=e,o=Array.isArray(t.arguments)?t.arguments:[];if(r(t.callee,"pipe"))return o.slice(1);const i=t.callee;return n(i)&&"MemberExpression"===i.type&&!0!==i.computed&&r(i.property,"pipe")?o:[]}function q(e,t=3){if(!i(e))return!1;const n=e.callee.property;return r(n)&&(3===t?Ti.has(n.name):"flatMapEager"===n.name||"zipRight"!==n.name&&Ti.has(n.name))}function P(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&r(e.callee,"flow")}function I(e){return P(e)&&e.arguments.length>=5}function O(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async,t)}function L(e){return C(e)||W(e,"YieldExpression")||W(e,"AwaitExpression")||O(e)||Je(e)||D(e,"Promise")||D(e,"Runtime")}function N(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e.callee;return r(t)?t.name:n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.property)?t.property.name:void 0}function z(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=N(e);return!(C(e)||W(e,"AwaitExpression")||W(e,"YieldExpression")||D(e,"Promise")||Je(e)||qi.has(t??"")||"object"==typeof e.callee&&null!==e.callee&&r(e.callee.object,"console"))}function $(e){if(!z(e))return 0;const t=e;return[t.callee,...t.arguments??[]].filter(e=>!K(e)).reduce((e,t)=>Math.max(e,$(t)),0)+1}function V(e,t=3){if(!i(e))return!1;const n=e.callee.property;if(!r(n))return!1;const o=n.name;return 3===t?Pi.has(o):"catchAll"!==o&&"catchSome"!==o&&"timeoutFail"!==o&&Pi.has(o)||Ii.includes(o)||"timeoutOption"===o||"timeoutOrElse"===o||"catchNoSuchElement"===o}function B(e){return i(e)||d(e)}function U(e,t){return!(!n(e)||"YieldExpression"!==e.type||!0!==e.delegate||!d(e.argument))&&T(e.argument).some(e=>V(e,t))}function Q(e,t,r=new Set,i=new WeakSet){if((c(e,"gen")||q(e,t))&&r.add("workflow"),P(e)&&r.add("pure"),V(e,t)&&r.add("behavior"),(_e(e,"Layer")||o(e,"Layer","pipe"))&&r.add("layer"),Array.isArray(e)){for(const n of e)Q(n,t,r,i);return r}if(!n(e))return r;if(i.has(e))return r;i.add(e);for(const[n,o]of Object.entries(e))"parent"!==n&&Q(o,t,r,i);return r}function K(e){return n(e)&&("FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)}function _(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,_(n,t)),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=Object.entries(e).reduce((e,[n,r])=>"parent"===n?e:Math.max(e,_(r,t)),0);return"CallExpression"===e.type?r+1:r}function Y(e,t=3){return!!o(e,3===t?"Effect":"Context","Service")||!(!n(e)||"CallExpression"!==e.type)&&Y(e.callee,t)}function J(e,t=3){if(!n(e)||"CallExpression"!==e.type)return;const r=e;return Y(r.callee,t)?[...r.arguments??[]].reverse().find(e=>n(e)&&"ObjectExpression"===e.type):void 0}function G(e){if(n(e)&&"ClassDeclaration"===e.type)return J(e.superClass)}function H(e,t){if(3===t)return G(e);const n=e?.type;return J("ClassDeclaration"===n||"ClassExpression"===n?e.superClass:e,t)}function Z(e,t){return 3===t?Jn(e,"effect")??Jn(e,"scoped"):Jn(e,"make")}function X(e){return _e(e,"Context","Tag")||_e(e,"Context","GenericTag")}function ee(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Layer","provide"),t)}function te(e){return Xn(Jn(e,"accessors"),!0)}function ne(e){if(!So(lo(e)??""))return;const t=n(e)?e.specifiers:void 0;return Array.isArray(t)?t.find(e=>n(e)&&"ImportNamespaceSpecifier"===e.type):void 0}function re(e){return n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&r(e.argument)&&e.argument.name.endsWith("Service")}function oe(e,t,r=new WeakSet,o=!1){if(!o||n(e)&&!r.has(e)&&!K(e)&&"ClassDeclaration"!==e.type&&"ClassExpression"!==e.type){if(t(e))return e;if(Array.isArray(e))for(const n of e){const e=oe(n,t,r,o);if(e)return e}else if(n(e)&&!r.has(e)){r.add(e);for(const[n,i]of Object.entries(e)){if("parent"===n)continue;const e=oe(i,t,r,o);if(e)return e}}}}function ie(e,t,r=new WeakSet,o=!1,i=!1){if(i&&K(e))return[];if(o&&n(e)&&r.has(e))return[];const a=t(e)?[e]:[];return o&&a.length?a:Array.isArray(e)?e.flatMap(e=>ie(e,t,r,o,i)).concat(a):n(e)?r.has(e)?a:(r.add(e),Object.entries(e).reduce((e,[n,a])=>"parent"===n?e:e.concat(ie(a,t,r,o,i)),a)):a}function ae(e){if(!Jn(e,"dependencies"))return oe(Jn(e,"effect")??Jn(e,"scoped"),re)}function ce(e){if(!_e(e,"Layer"))return!1;const t=e.callee.property;return r(t)&&("provide"===t.name||t.name.startsWith("merge"))}function se(e){if(!n(e)||"FunctionDeclaration"!==e.type)return!1;const t=e.id;return r(t)&&/(handler|route|request)$/i.test(t.name)}function ue(e){return c(e,"provide")||_e(e,"Layer","provide")}function le(e){return r(e)&&/(Layer|Live)$/.test(e.name)}function fe(e){if(n(e)&&"VariableDeclaration"===e.type)return e.declarations?.find(e=>n(e)&&le(e.id)&&oe(e.init,ue))}function pe(e,t=3){if(!K(e))return!1;if(on(sn(e),"Promise"))return!0;if(3===t)return void 0!==ke(e.body);if(!0===e.async)return!0;const o=e=>xe(e)||Se(e,t)||n(e)&&"NewExpression"===e.type&&r(e.callee,"Promise"),i=e.body;return o(i)||void 0!==ve(i,e=>n(e)&&"ReturnStatement"===e.type&&o(e.argument))}function de(e,t=3){return n(e)&&"Property"===e.type&&pe(e.value,t)}function me(e,t=3){if(3===t)return oe(e,de);const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return;r.add(e);const i=e;if("ObjectExpression"===i.type)return i.properties?.find(e=>de(e,t));if(K(e)){const e=i.body;if("BlockStatement"!==e?.type)return o(e);for(const t of ie(e,e=>n(e)&&"ReturnStatement"===e.type,new WeakSet,!0,!0)){const e=o(t.argument);if(e)return e}return}const a=S(e,"gen",t)??S(e,"fn",t);if(a)return o(a);const s=Array.isArray(i.arguments)?i.arguments[0]:void 0;if(c(e,"succeed")||c(e,"sync"))return o(s);if(d(e)){const e=i.callee;return o("MemberExpression"===e?.type?e.object:s)}};return o(Jn(e,"make"))}function ye(e){if(!n(e)||"ObjectExpression"!==e.type)return!1;const t=e.properties;return Array.isArray(t)&&t.some(e=>n(e)&&"Property"===e.type&&(K(e.value)||c(e.value,"fn")))}function he(e){return n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async}function ge(e){return 3===e?Oi:Li}function be(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&ge(t).has(n.name)?e.arguments.flatMap(e=>K(e)?[e]:4!==t||"catchTags"!==n.name&&"catchReasons"!==n.name||!Ve(e)?[]:e.properties.map(e=>e.value).filter(K)):[]}function ve(e,t){return oe(e,t,new WeakSet,!0)}function we(e,t,n){const r=3===t?oe:ve,o=S(e,"gen",t);if(o)return r(o.body,n);const i=S(e,"fn",4);if(i)return ve(i.body,n);for(const o of be(e,t)){const e=r(Dn(o),n);if(e)return e}}function Ee(e,t,r){return we(e,t,e=>n(e)&&e.type===r)}function xe(e){return _e(e,"Promise")&&Ni.has(String(e.callee.property.name))}function Se(e,t=3){if(!n(e)||"CallExpression"!==e.type)return!1;const o=e.callee,i=o?.object;return n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&(3===t||xe(i)||"NewExpression"===i?.type&&r(i.callee,"Promise")||Se(i,t))&&(r(o.property,"then")||r(o.property,"catch")||r(o.property,"finally"))}function ke(e){return oe(e,e=>xe(e)||Se(e))}function Ae(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;return n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.object,"Promise")&&r(t.property)&&zi.has(t.property.name)}function Re(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=Re(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),Ae(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=Re(r,t);if(e)return e}}}function Fe(e){if(!n(e))return!1;const t=e;return("ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type)&&Array.isArray(t.params)&&t.params.length>0}function We(e){if(!c(e,"tryPromise"))return!1;const t=a(e);return!!Fe(t)||Fe(Jn(t,"try"))}function De(e){return!!c(e,"promise")||c(e,"tryPromise")&&!We(e)}function Ce(e){return r(e.callee,"pipe")?e.arguments[0]:e.callee.object}function je(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;if(r(t))return t.name.endsWith("Sync");if(!n(t)||"MemberExpression"!==t.type||!0===t.computed||!r(t.object)||!r(t.property))return!1;const o=t.object.name,i=t.property.name;return Vi.has(o)&&i.endsWith("Sync")}function Me(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=Me(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),je(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=Me(r,t);if(e)return e}}}function Te(e,t){if(i(e)){const t=e.callee.property;if(r(t)&&Bi.has(t.name))return{program:a(e),hasContext:!1}}if(4!==t||!n(e)||"CallExpression"!==e.type)return;const o=e.callee;if(!i(o))return;const c=o.callee.property;return r(c)&&c.name.endsWith("With")&&Bi.has(c.name.slice(0,-4))?{program:a(e),hasContext:!0}:void 0}function qe(e,t){return void 0!==Te(e,t)}function Pe(e,t){return o(e,"Effect","orDie")||c(e,"orDie")||3===t&&(o(e,"Effect","orDieWith")||c(e,"orDieWith"))}function Ie(e,t){return Pe(e,t)?e:d(e)?Xt(e).find(e=>Pe(e,t)):void 0}function Oe(e,t=3){return c(e,"succeed")||c(e,"asVoid")&&(3===t||Oe(a(e),t))||c(e,"ignore")||er(e)}function Le(e){return o(e,"Effect","ignore")||c(e,"ignore")}function Ne(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.object,"console")&&r(t.callee.property)}function ze(e){return Qn(e)||n(e)&&"TemplateLiteral"===e.type}function $e(e){return c(e,"logError")||c(e,"logWarning")}function Ve(e){return n(e)&&"ObjectExpression"===e.type}function Be(e,t){return!!oe(e,e=>c(e,"annotateLogs"))||t.arguments.slice(1).some(e=>Ve(e)||!ze(e))}function Ue(e){return ie(e,t=>$e(t)&&ze(a(t))&&!Be(e,t))}function Qe(e,t=3){if(!i(e))return[];const n=e.callee.property;if(!r(n)||!(3===t?Ui.has(n.name):"tapError"===n.name||"catchNoSuchElement"===n.name||Ii.includes(n.name)))return[];const o=e.arguments;return(4===t?o.flatMap(e=>"catchTags"!==n.name&&"catchReasons"!==n.name||!Ve(e)?[e]:e.properties.map(e=>e.value).filter(K)):o).map(Dn).filter(e=>void 0!==e)}function Ke(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&r(o.callee,t)}function _e(e,t,o){if(!n(e))return!1;const i=e;return"CallExpression"===i.type&&"object"==typeof i.callee&&null!==i.callee&&"MemberExpression"===i.callee.type&&!0!==i.callee.computed&&r(i.callee.object,t)&&r(i.callee.property)&&(void 0===o||r(i.callee.property,o))}function Ye(e){return _e(e,"Effect")&&e.callee.property.name.startsWith("log")}function Je(e,t=new WeakSet){return void 0!==oe(e,Ne,t)}function Ge(e,t=new WeakSet){return void 0!==oe(e,e=>Ke(e,"setState")||_e(e,"Atom","set")||Ke(e,"invalidate")||Ye(e)||Ne(e),t)}function He(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Ref","set")||_e(e,"Atom","set")||_e(e,"SubscriptionRef","set")||_e(e,"Reactivity","invalidate")||_e(e,"Fiber","interrupt")||Ye(e),t)}function Ze(e){if(!n(e))return!1;const t=e;return!("ObjectExpression"!==t.type||!Array.isArray(t.properties))&&t.properties.some(e=>{if(!n(e))return!1;const t=e,o=t.key,i=t.value;return(r(o,"concurrency")||n(o)&&"concurrency"===o.value)&&n(i)&&("Literal"===i.type||"NumericLiteral"===i.type)&&1===i.value})}function Xe(e,t){if(!n(e))return!1;const o=e;if("ObjectExpression"!==o.type||!Array.isArray(o.properties))return!1;for(let e=o.properties.length-1;e>=0;e--){const n=o.properties[e],i=n.key;if("SpreadElement"===n.type||n.computed&&"string"!=typeof i?.value)return!1;if(!r(i,"concurrency")&&"concurrency"!==i?.value)continue;const a=n.value;if(r(a,"Infinity")&&t?.sourceCode?.getScope)for(let e=t.sourceCode.getScope(a);e;e=e.upper){const t=e.set.get("Infinity");if(t)return 0===t.defs.length}return r(a,"Infinity")||"unbounded"===a?.value||a?.value===1/0}return!1}function et(e,t){return c(e,"all")&&Xe(e.arguments[1],t)}function tt(e,t=new WeakSet){return oe(e,e=>c(e,"fork"),t)}function nt(e){if(c(e,"forkChild")||c(e,"forkDetach"))return e;if(n(e)&&"CallExpression"===e.type&&(c(e.callee,"forkChild")||c(e.callee,"forkDetach")))return e;if(!d(e))return;const t=e.arguments?.at(-1);if(c(t,"forkChild")||c(t,"forkDetach"))return t;if(!n(t)||"MemberExpression"!==t.type)return;const o=t;return!0!==o.computed&&r(o.object,"Effect")&&(r(o.property,"forkChild")||r(o.property,"forkDetach"))?t:void 0}function rt(e,t){return 3===t?c(e,"fork")?e:void 0:nt(n(e)&&"YieldExpression"===e.type?e.argument:e)}function ot(e,t,n=new WeakSet){return void 0!==oe(e,e=>i(e)&&r(e.callee.property)&&t.has(e.callee.property.name),n)}function it(e,t=new WeakSet){return void 0!==oe(e,e=>i(e)&&r(e.callee.property)&&Qi.has(e.callee.property.name)||_e(e,"Queue","take")||_e(e,"Deferred","await"),t)}function at(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&Array.isArray(o.arguments)&&"object"==typeof o.callee&&null!==o.callee&&"MemberExpression"===o.callee.type&&!0!==o.callee.computed&&r(o.callee.property,t)}function ct(e,t=3){if(4===t&&d(e)){const t=e.arguments.at(-1);return at(t,"withPermit")||at(t,"withPermits")?Ce(e):void 0}if(4===t&&[e,n(e)?e.callee:void 0].some(e=>_e(e,"TSemaphore","withPermit")||_e(e,"TSemaphore","withPermits")))return;if(!n(e)||"CallExpression"!==e.type)return;const r=e;if(Array.isArray(r.arguments)){if("object"==typeof r.callee&&null!==r.callee&&"CallExpression"===r.callee.type){const e=r.callee;if((at(e,"withPermit")||at(e,"withPermits"))&&r.arguments.length>0)return r.arguments[0]}return _e(r,"TSemaphore","withPermit")||_e(r,"TSemaphore","withPermits")?r.arguments[0]:at(r,"withPermit")||at(r,"withPermits")?r.arguments.at(-1):void 0}}function st(e,t=3){if(4===t){const t=[e,d(e)?e.arguments.at(-1):e?.callee].find(e=>ut(e,"SynchronizedRef")||ut(e,"SubscriptionRef"));if(t){const n=t.arguments;return t!==e||n.length>1?n.at(-1):void 0}return}if(!n(e)||"CallExpression"!==e.type)return;const r=e;return Array.isArray(r.arguments)?ut(r.callee,"SynchronizedRef")&&r.arguments.length>0?r.callee.arguments.at(-1):ut(r,"SynchronizedRef")&&r.arguments.length>1||lt(r)&&!ut(r,"SynchronizedRef")?r.arguments.at(-1):void 0:void 0}function ut(e,t){return lt(e)&&r(e.callee.object,t)}function lt(e){return[...Ki].some(t=>at(e,t))}function ft(e,t){return o(e,"Effect",t)}function pt(e){return _e(e,"Deferred")&&_i.has(e.callee.property.name)}function dt(e){return _e(e,"Deferred","await")&&Array.isArray(e.arguments)}function mt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&oe(t.init,pt)?t.id.name:void 0}function yt(e,t){return Boolean(oe(e,e=>{if(!_e(e,"Effect","addFinalizer")&&!_e(e,"Scope","addFinalizer"))return!1;const n=e.arguments;return Array.isArray(n)&&n.some(e=>{const n=Dn(e);return void 0!==n&&D(n,t)})}))}function ht(e){if(!d(e))return!1;const t=e.arguments;return Array.isArray(t)&&t.some(e=>ft(e,"scoped"))}function gt(e,t,o=3,a=[]){let s=n(e)?e.parent:void 0;const u=new WeakSet;for(;n(s);){if(u.has(s))return!1;if(u.add(s),i(s)&&(()=>{const e=s.callee.property;return r(e)&&(4===o?$i.has(e.name)||Hi.has(e.name)||"interruptible"===e.name||"scoped"===e.name:Yi.has(e.name)||Ji.has(e.name))})()||(3===o?ht(s):d(s)&&(()=>{const e=s.arguments.at(-1);return[...$i,...Hi,"interruptible","scoped"].some(t=>c(e,t)||ft(e,t))})())||4===o&&"CallExpression"===s.type&&i(s.callee)&&(()=>{const e=s.callee.callee.property;return r(e)&&($i.has(e.name)||Hi.has(e.name))})())return!0;if(K(s)){if(3===o?yt(s,t):a.some(e=>{for(let t=e.identifier.parent;t&&Dt(t,s);t=t.parent)if(_e(t,"Effect","addFinalizer")||_e(t,"Scope","addFinalizer"))return!0;return!1}))return!0;if(4===o){const e=s.parent;if(S(e,"gen",4)!==s&&S(e,"fn",4)!==s&&!be(e,4).includes(s))return!1}}s=s.parent}return!1}function bt(e){return[...Hi].some(t=>c(e,t)||ft(e,t))}function vt(e){return!(!n(e)||"CallExpression"!==e.type)&&(bt(e)||bt(e.callee)||d(e)&&bt(e.arguments?.at(-1)))}function wt(e,t=3){if(4===t){if(!vt(e))return!1;const t=e.parent;if(n(t)&&vt(t)&&(t.callee===e||d(t)&&t.arguments?.at(-1)===e))return!1;const r=e=>void 0!==oe(e,e=>[...Gi].some(t=>c(e,t)||ft(e,t)));if(r(e.arguments)||r(e.callee?.arguments))return!1;let o=t;const a=new WeakSet;for(;n(o)&&!a.has(o)&&(a.add(o),!K(o)||S(o.parent,"gen",4)===o||S(o.parent,"fn",4)===o||c(o.parent,"acquireUseRelease")&&o.parent.arguments?.[1]===o);){if(i(o)&&Gi.has(o.callee.property.name))return!1;if(d(o)&&r(o.arguments))return!1;o=o.parent}return!0}return!(!c(e,"race")&&!c(e,"raceAll")||ot(e.arguments,Gi))}function Et(e,t){return c(e,"forEach")&&Xe(e.arguments.at(-1),t)}function xt(e,t){return(et(e,t)||Et(e,t))&&ot(e.arguments,Zi)}function St(e){if(!n(e)||"VariableDeclaration"!==e.type)return[];const t=e.declarations;return Array.isArray(t)?t.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)?[t.name]:[]}):[]}function kt(e,t=new Set,r=new WeakSet){if(Array.isArray(e)){for(const n of e)kt(n,t,r);return t}if(!n(e))return t;if(r.has(e))return t;if(r.add(e),"VariableDeclaration"===e.type)for(const n of St(e))t.add(n);for(const[n,o]of Object.entries(e))"parent"!==n&&kt(o,t,r);return t}function At(e){if(!n(e))return;const t=e;return"AssignmentExpression"===t.type&&r(t.left)?t.left.name:"UpdateExpression"===t.type&&r(t.argument)?t.argument.name:"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.object)&&r(t.callee.property)&&Xi.has(t.callee.property.name)?t.callee.object.name:void 0}function Rt(e,t,r=kt(e),o=new WeakSet){if(Array.isArray(e)){for(const n of e){const e=Rt(n,t,r,o);if(e)return e}return}if(!n(e))return;if(o.has(e))return;o.add(e);const i=At(e);if(i&&t.has(i)&&!r.has(i))return e;for(const[n,i]of Object.entries(e)){if("parent"===n)continue;const e=Rt(i,t,r,o);if(e)return e}}function Ft(e){if(c(e,"fork")||c(e,"all")||c(e,"forEach"))return e.arguments}function Wt(e){if(c(e,"all")||c(e,"forEach"))return e.arguments;if(!nt(e))return;if(!d(e))return a(e);const t=e.callee.object;return r(e.callee,"pipe")?a(e):t}function Dt(e,t){if(Array.isArray(t))return t.some(t=>Dt(e,t));for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function Ct(e){const t=e,n=t.parent;if("AssignmentExpression"===n?.type&&n.left===t)return n;if("UpdateExpression"===n?.type&&n.argument===t)return n;if("MemberExpression"===n?.type&&n.object===t&&!0!==n.computed&&r(n.property)&&Xi.has(n.property.name)){const e=n.parent;if("CallExpression"===e?.type&&e.callee===n)return e}}function jt(e,t){for(const n of t){if(n.identifiers.some(t=>Dt(t,e)))continue;const t=n.references.map(e=>Ct(e.identifier)).find(t=>t&&Dt(t,e));if(t)return t}}function Mt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function Tt(e){return Mt(e).some(e=>na.has(e))}function qt(e){if(r(e))return Tt(e.name);if(!Lo(e))return!1;const t=e;return!0!==t.computed&&(r(t.property)&&Tt(t.property.name)||qt(t.object))}function Pt(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;if(!n(t)||"MemberExpression"!==t.type||!0===t.computed||!r(t.property))return!1;const o=t;return ra.has(o.property.name)&&qt(o.object)}function It(e,t=3){if(4===t){const t=d(e)?e.arguments.at(-1):e?.callee,n=e=>[...ia].some(t=>c(e,t)||ft(e,t));return n(e)?e.arguments:n(t)?[...t.arguments??[],...d(e)?[Ce(e)]:e.arguments]:void 0}if(!i(e))return;const n=e.callee.property;return r(n)&&ea.has(n.name)?e.arguments:void 0}function Ot(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;let o;if(r(t))o=t.name;else if(n(t)&&"MemberExpression"===t.type){const e=t;!0!==e.computed&&r(e.property)&&(o=e.property.name)}return!(!o||"acquireRelease"===o||"acquireUseRelease"===o)&&Mt(o).some(e=>ta.has(e))&&Tt(o)}function Lt(e,t){return!!(c(e,"acquireRelease")||c(e,"acquireUseRelease")||c(e,"scoped")||ht(e))||void 0!==t&&yt(e,t)}function Nt(e){const t=new Set;for(const o of ie(e,e=>n(e)&&"VariableDeclarator"===e.type)){const n=o;r(n.id)&&oe(n.init,Ot)&&yt(e,n.id.name)&&t.add(n.id.name)}return t}function zt(e,t,o=new WeakSet,i=new Set,a=!1,s=3){if(Array.isArray(e)){for(const n of e)zt(n,t,o,i,a,s);return}if(!n(e)||o.has(e))return;if(o.add(e),4===s&&K(e)){const t=e.parent;if(S(t,"gen",4)!==e&&S(t,"fn",4)!==e&&!be(t,4).includes(e)&&!["sync","suspend","promise","tryPromise"].some(e=>c(t,e))&&!at(t,"map"))return}if(Lt(e))return;const u=K(e)?new Set([...i,...Nt(e)]):i,l="VariableDeclarator"===e.type?e:void 0,f=l&&r(l.id)?l.id.name:void 0,p=void 0!==f&&u.has(f);if(!Ot(e)||a)for(const[n,r]of Object.entries(e))"parent"!==n&&zt(r,t,o,u,a||p,s);else t.push(e)}function $t(e,t=3){const n=[];return zt(e,n,void 0,void 0,!1,t),n}function Vt(e,t=new WeakSet){return!!ot(e,oa)||!!_e(e,"Queue","take")||(Array.isArray(e)?e.some(e=>Vt(e,t)):!!n(e)&&!t.has(e)&&(t.add(e),Object.entries(e).some(([e,n])=>"parent"!==e&&Vt(n,t))))}function Bt(e,t=!1){return!!ve(e,e=>{if(_e(e,"Queue","take")||_e(e,"PubSub","take")||[...ia].some(t=>c(e,t)||ft(e,t))||t&&(["sleep","promise","tryPromise"].some(t=>c(e,t))||_e(e,"Deferred","await")))return!0;const n=S(e,"gen",4)??S(e,"fn",4);return!(!n||!Bt(n.body,t))||be(e,4).some(e=>Bt(Dn(e),t))})}function Ut(e,t=3){if(4===t){const t=c(e,"uninterruptible")?a(e):d(e)&&ft(e.arguments.at(-1),"uninterruptible")?Ce(e):void 0;return void 0!==t&&Bt(t)}return c(e,"uninterruptible")&&Vt(e.arguments[0])}function Qt(e,t=3){if(_e(e,"Queue","unbounded")||_e(e,"PubSub","unbounded"))return!0;if(4!==t)return!1;if(_e(e,"PubSub","makeAtomicUnbounded"))return!0;if(!_e(e,"Queue","make"))return!1;const o=a(e);if(!o||r(o,"undefined"))return!0;if(!Ve(o))return!1;if(o.properties.some(e=>"SpreadElement"===e.type))return!1;const i=Jn(o,"capacity");return!i||r(i,"undefined")||r(i,"Infinity")||n(i)&&"MemberExpression"===i.type&&!0!==i.computed&&r(i.object,"Number")&&r(i.property,"POSITIVE_INFINITY")}function Kt(e){if(!n(e))return!1;const t=e;return"ObjectExpression"===t.type||"ArrayExpression"===t.type||"NewExpression"===t.type&&(r(t.callee,"Map")||r(t.callee,"Set"))||"CallExpression"===t.type&&(r(t.callee,"Map")||r(t.callee,"Set"))}function _t(e){if(!n(e)||"VariableDeclaration"!==e.type)return[];const t=e,o=Array.isArray(t.declarations)?t.declarations:[];return"let"===t.kind||"var"===t.kind?St(e):o.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)&&Kt(e.init)?[t.name]:[]})}function Yt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&c(t.init,"fork")?t.id.name:void 0}function Jt(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e,o=t.callee;if(!(n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&r(o.object,"Fiber")&&r(o.property)&&aa.has(o.property.name)&&Array.isArray(t.arguments)))return;const[i]=t.arguments;return r(i)?i.name:void 0}function Gt(e){if(!r(e))return!1;const t=e.parent;if(!t)return!1;if("ReturnStatement"===t.type&&t.argument===e)return!0;if(Jt(t)===e.name&&a(t)===e)return!0;const n="MemberExpression"===t.type&&t.object===e?t.parent:t;return d(n)&&void 0!==oe(n.arguments,e=>[...aa].some(t=>o(e,"Fiber",t)))}function Ht(e){return o(e,"Effect","asVoid")||_e(e,"Effect","asVoid")}function Zt(e){if(!n(e))return!1;const t=e;return!("CallExpression"!==t.type||!Array.isArray(t.arguments)||"object"!=typeof t.callee||null===t.callee||"MemberExpression"!==t.callee.type||!0===t.callee.computed||!r(t.callee.property,"pipe"))&&c(t.callee.object,"all")&&t.arguments.some(e=>Ht(e))}function Xt(e){if(!n(e)||!d(e))return[];const t=e;return r(t.callee,"pipe")?t.arguments:[t.callee.object,...t.arguments]}function en(e){const[t]=Xt(e);return void 0!==t&&C(t)}function tn(e){if(en(e))return!0;if(n(e)&&"ArrowFunctionExpression"===e.type){const t=e.body;return i(t)||en(t)}return!1}function nn(e){return b(e).some(e=>n(e)&&(tn(e.argument)||i(e.argument)))}function rn(e,t,o){if(!n(e)||"TSTypeReference"!==e.type)return!1;const i=e.typeName;return n(i)&&"TSQualifiedName"===i.type&&r(i.left,t)&&r(i.right,o)}function on(e,t){return n(e)&&"TSTypeReference"===e.type&&r(e.typeName,t)}function an(e){if(!n(e))return[];const t=e.typeParameters??e.typeArguments;if(!n(t))return[];const r=t.params??t.arguments;return Array.isArray(r)?r:[]}function cn(e){return r(e,"Error")||on(e,"Error")}function sn(e){if(!n(e))return;const t=e.returnType;return n(t)?t.typeAnnotation??t:void 0}function un(e,t){return rn(sn(e),"Effect","Effect")||rn(t,"Effect","Effect")}function ln(e){if(!n(e))return[];const t=e.body;if(!n(t))return[];if("BlockStatement"!==t.type)return[t];const r=(e,t=new WeakSet)=>{if(Array.isArray(e))return e.flatMap(e=>r(e,t));if(!n(e)||t.has(e))return[];t.add(e);const o=e;return"ReturnStatement"===o.type?[o.argument]:"ArrowFunctionExpression"===o.type||"FunctionExpression"===o.type||"FunctionDeclaration"===o.type?[]:Object.entries(o).flatMap(([e,n])=>"parent"===e?[]:r(n,t))};return r(t)}function fn(e){return ln(e).filter(e=>i(e)||en(e))}function pn(e){return c(e,"withSpan")||d(e)&&Xt(e).some(e=>c(e,"withSpan"))}function dn(e,t){if(!un(e,t))return;const n=fn(e);return 0===n.length||n.some(e=>!pn(e))?e:void 0}function mn(e){if(!n(e))return;const t=e.typeAnnotation;return n(t)?sn(t.typeAnnotation??t):void 0}function yn(e){if(!n(e))return[];const t=e;if("ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type)return[];const r=t.declaration;return n(r)?"FunctionDeclaration"===r.type?[{functionNode:r}]:"VariableDeclaration"!==r.type?[]:(r.declarations??[]).flatMap(e=>{if(!n(e))return[];const t=e.init;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[{functionNode:t,declaredReturnType:mn(e.id)}]}):[]}function hn(e,t=3){if(4===t){const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return[];if(r.add(e),Ve(e))return[e];if(K(e))return ln(e).flatMap(o);const i=S(e,"gen",t)??S(e,"fn",t);if(i)return o(i);if(c(e,"succeed")||c(e,"sync")||c(e,"suspend"))return o(a(e));if(d(e)){const t=e.callee;return o("MemberExpression"===t.type?t.object:a(e))}return[]};return o(Jn(e,"make")).flatMap(e=>e.properties.filter(e=>"Property"===e.type&&K(e.value)).map(e=>e.value))}const r=Jn(e,"effect")??Jn(e,"scoped"),o=S(r,"gen"),i=o?ln(o).find(Ve):c(r,"succeed")&&Ve(a(r))?a(r):void 0;if(!i)return[];const s=i.properties;return Array.isArray(s)?s.flatMap(e=>{if(!n(e)||"Property"!==e.type)return[];const t=e.value;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[t]}):[]}function gn(e){return fn(e).some(e=>!pn(e))?e:void 0}function bn(e,t){const n=sn(e)??t;if(!rn(n,"Effect","Effect"))return;const[,r]=an(n);return void 0===r?void 0:{annotation:n,errorChannel:r}}function vn(e){if(!n(e))return[];const t=e;return"ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type?[]:yn(t).flatMap(({functionNode:e,declaredReturnType:t})=>{const n=bn(e,t);return n?[n]:[]})}function wn(e){return vn(e).find(e=>cn(e.errorChannel))?.annotation}function En(e){let t=e;const r=new WeakSet;for(;n(t);){if(r.has(t))return t;if(r.add(t),"TSParenthesizedType"!==t.type)return t;t=t.typeAnnotation}return t}function xn(e){const t=En(e);if(cn(t))return"Error";if(n(t))switch(t.type){case"TSUnknownKeyword":return"unknown";case"TSStringKeyword":return"string";case"TSNumberKeyword":return"number";case"TSBooleanKeyword":return"boolean";default:return}}function Sn(e){const t=En(e);if(!n(t)||"TSUnionType"!==t.type)return new Set;const r=t.types;return Array.isArray(r)?new Set(r.flatMap(e=>{const t=xn(e);return t?[t]:[]})):new Set}function kn(e,t,n,r=new WeakSet){return void 0!==oe(e,e=>rn(e,t,n),r)}function An(e,t=new WeakSet){return void 0!==oe(e,e=>Ke(e,"wrapGraphqlCall"),t)}function Rn(e,t){return(c(e,"flatMap")||4===t&&c(e,"flatMapEager"))&&r(a(e),"applyResponse")}function Fn(e,t,n=new WeakSet){return void 0!==oe(e,e=>Rn(e,t),n)}function Wn(e,t,n=new WeakSet){return oe(e,e=>i(e)&&Jr(t).has(e.callee.property.name),n)}function Dn(e){if(!n(e))return;const t=e;return"ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type?t.body:void 0}function Cn(e){if(!n(e))return!1;const t=e;if("CallExpression"!==t.type||!Array.isArray(t.arguments)||"object"!=typeof t.callee||null===t.callee||"MemberExpression"!==t.callee.type||!0===t.callee.computed)return!1;const o=t.callee;return(r(o.object,"Atom")||r(o.object,"atomRegistry"))&&r(o.property)&&ca.has(o.property.name)}function jn(e,t=new WeakSet){return oe(e,Cn,t)}function Mn(e){return!!r(e)&&/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name)}function Tn(e){if(!n(e))return;const t=e;if("CallExpression"!==t.type||!Array.isArray(t.arguments))return;if(!(r(t.callee,"get")||o(t.callee,"Atom","get")||o(t.callee,"get","get")))return;const[i]=t.arguments;return Mn(i)?i:void 0}function qn(e,t=new WeakSet){return Tn(oe(e,e=>void 0!==Tn(e),t))}function Pn(e){return c(e,"provide")&&1===e.arguments.length}function In(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&"SpreadElement"===e.type,t)}function On(e){return!(!_e(e,"Ref","update")&&!_e(e,"Ref","modify"))&&In(Dn(e.arguments[1]))}function Ln(e){return n(e)&&"ObjectExpression"===e.type&&Array.isArray(e.properties)&&0===e.properties.length}function Nn(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Object","entries"),t)}function zn(e){if(On(e))return!0;if(_e(e,"Object","assign")){const t=e.arguments;return t.length>=3&&Ln(t[0])}return _e(e,"Object","fromEntries")?Nn(e.arguments[0]):_e(e,"JSON","stringify")||_e(e,"JSON","parse")}function $n(e){return!!r(e)||n(e)&&"MemberExpression"===e.type}function Vn(e,t=3){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>{if(!n(e))return!1;const o=e.init;return n(o)&&"TSAsExpression"===o.type&&"object"==typeof o.typeAnnotation&&null!==o.typeAnnotation&&"TSConstKeyword"!==o.typeAnnotation.type&&!(4===t&&"TSTypeReference"===o.typeAnnotation.type&&r(o.typeAnnotation.typeName,"const"))})??!1)}function Bn(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;if("==="!==t.operator)return!1;const r=t.left,o=t.right;return n(r)&&"UnaryExpression"===r.type&&"typeof"===r.operator&&n(o)&&("Literal"===o.type||"StringLiteral"===o.type)&&"boolean"===o.value}function Un(e){return tr(e,"orElse")&&uo(nr(e.arguments[0]))}function Qn(e){return n(e)&&("Literal"===e.type||"StringLiteral"===e.type)&&"string"==typeof e.value}function Kn(e){return r(e,"undefined")}function _n(e){return n(e)&&"LogicalExpression"===e.type&&"??"===e.operator&&(uo(e.right)||Kn(e.right))}function Yn(e,t=3){return _e(e,"Option",3===t?"fromNullable":"fromNullishOr")&&_n(e.arguments[0])}function Jn(e,t){if(n(e)&&"ObjectExpression"===e.type)for(const o of e.properties??[])if(n(o)&&r(o.key,t))return o.value}function Gn(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return"==="===t.operator&&(Xn(t.left,!0)||Xn(t.right,!0))}function Hn(e){if(!_e(e,"Option","match"))return!1;const t=e.arguments[1],n=Jn(t,"onSome"),r=Jn(t,"onNone");return Gn(nr(n))&&Xn(nr(r),!1)}function Zn(e){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>n(e)&&Qn(e.init))??!1)}function Xn(e,t){return n(e)&&("Literal"===e.type||"BooleanLiteral"===e.type)&&e.value===t}function er(e){return o(e,"Effect","void")}function tr(e,t){return _e(e,"Match",t)&&Array.isArray(e.arguments)}function nr(e){if(n(e)&&"ArrowFunctionExpression"===e.type)return e.body}function rr(e){if(!tr(e))return!1;const[t,n]=e.arguments;return r(e.callee.property,"when")?(Xn(t,!0)||Xn(t,!1))&&er(nr(n)):r(e.callee.property,"orElse")&&er(nr(t))}function or(e){return _e(e,"Stream")}function ir(e,t=new WeakSet){return void 0!==oe(e,e=>sa.some(t=>c(e,t))||d(e)||or(e),t)}function ar(e){return C(e)&&ir(e)}function cr(e,t=new WeakSet){return void 0!==oe(e,e=>tr(e)&&ar(r(e.callee.property,"when")?nr(e.arguments[1]):nr(e.arguments[0])),t)}function sr(e,t=new WeakSet){return void 0!==oe(e,e=>tr(e),t)}function ur(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&o(e.callee,"Option","match")}function lr(e){const t=nr(e);return n(t)&&"CallExpression"===t.type}function fr(e){return oe(e,e=>c(e,"gen"))}function pr(e){if(!d(e)||!n(e))return!1;const t=e.callee.object;return n(t)&&"CallExpression"===t.type&&o(t.callee,"Match","value")}function dr(e,t){return pr(e)||n(e)&&"CallExpression"===e.type&&(o(e.callee,"Option","match")||o(e.callee,3===t?"Either":"Result","match"))}function mr(e,t,n=new WeakSet){return void 0!==oe(e,e=>dr(e,t),n)}function yr(e){if(!n(e))return[];const t=e;return"ObjectExpression"===t.type&&Array.isArray(t.properties)?t.properties.map(e=>n(e)?e.value:void 0).filter(e=>void 0!==e):[]}function hr(e){if(!n(e)||"TSTypeAliasDeclaration"!==e.type)return!1;const t=e.id,o=e.typeAnnotation;return r(t)&&/(?:Id|ID)$/.test(t.name)&&("TSStringKeyword"===o?.type||"TSNumberKeyword"===o?.type)}function gr(e){if(!n(e))return!1;const t=e;return"TSBooleanKeyword"===t.type||"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation&&"TSBooleanKeyword"===t.typeAnnotation.type}function br(e){if(!n(e))return;const t=e;return"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation?t.typeAnnotation:t}function vr(e){const t=br(e);return"TSStringKeyword"===t?.type||"TSNumberKeyword"===t?.type}function wr(e){const t=br(e);return"TSAnyKeyword"===t?.type||"TSObjectKeyword"===t?.type}function Er(e){const t=br(e);return"TSTypeReference"===t?.type&&r(t.typeName,"Date")}function xr(e){if(!n(e)||!Array.isArray(e.params))return[];const t=/(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;return e.params.filter(e=>r(e)&&vr(e.typeAnnotation)&&t.test(e.name))}function Sr(e){return xr(e).length>=3}function kr(e){return!!r(e)&&/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&gr(e.typeAnnotation)}function Ar(e){return n(e)&&Array.isArray(e.params)?e.params.filter(kr):[]}function Rr(e){return r(e)?e.name:n(e)&&"string"==typeof e.value?e.value:void 0}function Fr(e){if(!n(e)||"TSPropertySignature"!==e.type)return!1;const t=e,r=Rr(t.key),o=t.typeAnnotation;return void 0!==r&&/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(r)&&(vr(o)||Er(o))}function Wr(e){if(!n(e))return[];const t=e;return"TSInterfaceDeclaration"===t.type&&"object"==typeof t.body&&null!==t.body&&Array.isArray(t.body.body)?t.body.body:"TSTypeLiteral"===t.type&&Array.isArray(t.members)?t.members:[]}function Dr(e){return r(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function Cr(e){const t=Wr(e);return 1===t.length&&"_tag"===Rr(t[0].key)}function jr(e){const t=n(e)?e.superTypeArguments:void 0,r=n(t)?t.params??t.arguments:void 0,o=Array.isArray(r)?r:an(e);if(0===o.length)return!0;const i=o[0];return n(i)&&("TSObjectKeyword"===i.type||"TSTypeLiteral"===i.type&&0===Wr(i).length)}function Mr(e){if(!n(e))return;const t=e;return("TSTypeAliasDeclaration"===t.type||"TSInterfaceDeclaration"===t.type)&&Dr(t.id)&&Cr("TSTypeAliasDeclaration"===t.type?t.typeAnnotation:t)||"ClassDeclaration"===t.type&&_e(t.superClass,"Data","TaggedError")&&jr(t)?e:void 0}function Tr(e){return Wr(e).filter(Fr)}function qr(e){return!!r(e)&&/^(?:opts|options|config)$/i.test(e.name)&&wr(e.typeAnnotation)}function Pr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(qr):[]}function Ir(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+Ir(n,t),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=e;return"BinaryExpression"===r.type&&ua.has(String(r.operator))?1:"LogicalExpression"!==r.type?0:Ir(r.left,t)+Ir(r.right,t)}function Or(e){return n(e)&&"LogicalExpression"===e.type&&Ir(e)>=3}function Lr(e){if(!n(e)||"MemberExpression"!==e.type)return;const t=e;if(!0===t.computed||!r(t.object)||!r(t.property))return;const o=t.property.name;return/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(o)?{objectName:t.object.name,propertyName:o}:void 0}function Nr(e,t=new Map,r=new WeakSet){const o=Lr(e);if(o){const e=t.get(o.objectName)??new Set;return e.add(o.propertyName),t.set(o.objectName,e),t}if(Array.isArray(e)){for(const n of e)Nr(n,t,r);return t}if(!n(e))return t;if(r.has(e))return t;r.add(e);const i=e;return"LogicalExpression"!==i.type||(Nr(i.left,t,r),Nr(i.right,t,r)),t}function zr(e){return!(!n(e)||"LogicalExpression"!==e.type)&&Array.from(Nr(e).values()).some(e=>e.size>=2)}function $r(e){return c(e,"fail")&&Qn(a(e))}function Vr(e){return r(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Br(e){if(!n(e)||"MemberExpression"!==e.type)return!1;const t=e;return!0!==t.computed&&r(t.property,"message")&&Vr(t.object)}function Ur(e){if(Br(e))return!0;if(!n(e))return!1;const t=e;return"BinaryExpression"===t.type&&"+"===t.operator?Ur(t.left)||Ur(t.right):"TemplateLiteral"===t.type&&Array.isArray(t.expressions)&&t.expressions.some(e=>Ur(e))}function Qr(e){return c(e,"fail")&&Ur(a(e))}function Kr(e){return n(e)&&"NewExpression"===e.type&&r(e.callee,"Error")}function _r(e){return c(e,"fail")&&Kr(a(e))}function Yr(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&t.has(n.name)?e.arguments.filter(K):[]}function Jr(e){return 3===e?pa:da}function Gr(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Gr(e,t)):!n(e)||t.has(e)||K(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:Gr(n,t)))}function Hr(e){if(!i(e))return!1;const t=e.callee.property;return r(t)&&la.has(t.name)}function Zr(e){return uo(e)||Kn(e)||r(e)&&/(?:fallback|default)/i.test(e.name)}function Xr(e){return c(e,"succeed")&&Zr(a(e))}function eo(e,t){for(const n of Yr(e,Jr(t))){const e=Dn(n);if(Xr(e))return e;for(const t of Gr(e))if(Xr(t.argument))return t.argument}}function to(e){if(!c(e,"fail"))return!1;const t=a(e);return Qn(t)&&ma.has(String(t.value))}function no(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;return r(t)&&/(?:Error|Exception)$/.test(t.name)}function ro(e){return!(!n(e)||"ThrowStatement"!==e.type)&&no(e.argument)}function oo(e){if(!n(e)||"ThrowStatement"!==e.type)return!1;const t=e.argument;return n(t)&&"NewExpression"===t.type&&r(t.callee,"Error")&&Array.isArray(t.arguments)&&Qn(t.arguments[0])}function io(e){return!(!n(e)||!Array.isArray(e.params))&&e.params.some(e=>r(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&vr(e.typeAnnotation))}function ao(e){if(!n(e)||"FunctionDeclaration"!==e.type)return!1;const t=e.id;return r(t)&&/(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(t.name)&&io(e)}function co(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return["==","===","!=","!=="].includes(String(t.operator))&&(Qn(t.left)||Qn(t.right))&&!Bn(t)}function so(e,t,n){e.report({message:n,node:t})}function uo(e){if(!n(e))return!1;const t=e;return"NullLiteral"===t.type||"Literal"===t.type&&null===t.value}function lo(e){if(!n(e))return;const t=e.source;if("string"==typeof t)return t;if(n(t)){const e=t.value;if("string"==typeof e)return e}}function fo(e){const t=e.options[0];return n(t)?t:{}}function po(e,t){const n=e[t];return Array.isArray(n)&&n.every(e=>"string"==typeof e)?n:void 0}function mo(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/{2,}/g,"/").replace(/\/$/,"")}function yo(e){return e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,"[^/]*")}function ho(e){const t=mo(e);if("**"===t)return/^.*$/;const n=t.split("/"),r="**"===n[0],o=r?1:0;let i=r?"^(?:.*/)?":"(?:^|.*/)";for(let e=o;e<n.length;e+=1){const t=n[e],r=e===n.length-1;"**"!==t?(e>o&&(i+="/"),i+=yo(t)):i+=r?"(?:/.*)?":"(?:/[^/]+)*"}return new RegExp(`${i}$`)}function go(e,t){return ho(t).test(mo(e))}function bo(e){return po(fo(e),"boundaryPaths")??ya}function vo(e){return bo(e).some(t=>go(e.filename,t))}function wo(e){return ha.some(t=>go(e.filename,t))}function Eo(e){return po(fo(e),"configPaths")??ga}function xo(e){return Eo(e).some(t=>go(e.filename,t))}function So(e){return"effect"===e||e.startsWith("effect/")||"@effect-atom/atom-react"===e}function ko(e){if(!(Ke(e,"it")||Ke(e,"test")||Ke(e,"specify")||Ke(e,"bench")))return;const t=e.arguments?.at(-1);return K(t)?t:void 0}function Ao(e,t){return c(e,"runPromise")||4===t&&n(e)&&c(e.callee,"runPromiseWith")&&void 0!==Te(e,t)?.program}function Ro(e,t=3){const r=e.body;if(!Ao(r,t)&&n(r)&&"BlockStatement"===r.type&&Array.isArray(r.body))for(const e of r.body)if(n(e)&&"ExpressionStatement"===e.type&&Ao(e.expression,t))return e.expression}function Fo(e,t){const r=[],o=new WeakSet;return function e(i,a=!1){if(Array.isArray(i)){for(const t of i)e(t);return}if(!n(i)||o.has(i))return;o.add(i);const c=i;if(a||!K(c)){t(c)&&r.push(c);for(const[t,n]of Object.entries(c))"parent"!==t&&e(n)}}(e,!0),r}function Wo(e,t=3){if(!n(e)||"MemberExpression"!==e.type||!0===e.computed||!r(e.property,"rejects"))return!1;const o=e.object;if(!Ke(o,"expect"))return!1;const i=o.arguments;return!!Array.isArray(i)&&Ao(i[0],t)}function Do(e){return n(e)&&"MemberExpression"===e.type&&!0!==e.computed&&r(e.property,"Default")}function Co(e){return _e(e,"Layer","succeed")||_e(e,"Layer","effect")}function jo(e){if(!_e(e,"Layer","provide"))return[];const t=e.arguments;return Array.isArray(t)&&t.some(Do)?t.filter(Co):[]}function Mo(e){const t=lo(e);if("effect/Schema"===t)return!0;if("effect"!==t||!n(e))return!1;const o=e.specifiers;return Array.isArray(o)&&o.some(e=>{if(!n(e))return!1;const t=e;return"ImportSpecifier"===t.type&&r(t.imported,"Schema")})}function To(t,n){return Wi({create(r){let o=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(o=!0)},[t](t){o&&so(r,t,"string"==typeof n?n:n(e(r.options)))}}}})}function qo(t,r,o){return Wi({create(i){const a=e(i.options);let c=!1;const s=[],u=new WeakSet,l=e=>{for(const r of t(e,a))n(r)&&!u.has(r)&&(u.add(r),s.push(r))};return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(c=!0)},...Object.fromEntries(o.map(e=>[e,l])),"Program:exit"(){if(c)for(const e of s)so(i,e,r)}}}})}function Po(t,n,r=!1,o=!1,i=["CallExpression"]){return Wi({...o?{meta:{schema:ba}}:{},create(a){const c=e(a.options);let s=!1;const u=r?new WeakSet:void 0,l=e=>{const i=!s||o&&vo(a)?void 0:t(e,c,a);if(i)for(const e of r?i:[i])u?.has(e)||(u?.add(e),so(a,e,n(c)))};return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(s=!0)},...Object.fromEntries(i.map(e=>[e,l]))}}})}function Io(e,t,n){let r=!1;const o=o=>{if(r)for(const r of vn(o))t(r)&&so(e,r.annotation,n)};return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},ExportNamedDeclaration:o,ExportDefaultDeclaration:o}}function Oo(e){return e.startsWith("node:")||cs.has(e)}function Lo(e){return n(e)&&("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)}function No(e){return Lo(e)&&r(e.object,"process")&&(!0!==(t=e).computed&&r(t.property,"env")||!0===t.computed&&Qn(t.property)&&"env"===t.property.value);var t}function zo(e){if(!Lo(e))return!1;if(No(e.object))return!0;if(!No(e))return!1;const t=e.parent;return!Lo(t)||t.object!==e}function $o(e){if(!Lo(e)||"object"!=typeof e.parent||null===e.parent)return!1;const t=e.parent;return"AssignmentExpression"===t.type&&t.left===e}function Vo(e){if(!n(e)||"CallExpression"!==e.type||!r(e.callee,"require"))return;const t=e.arguments?.[0];if(!Qn(t))return;const o=t.value;return as.has(o)?o:void 0}function Bo(e,t){return void 0!==oe(e,e=>{if(qe(e,t))return!0;if(!i(e))return!1;const n=e.callee.property;return!!r(n)&&(3===t?ps.has(n.name):"catchAll"!==n.name&&ps.has(n.name)||Ii.includes(n.name)||"catchNoSuchElement"===n.name)})}function Uo(t,n,r,i=!1){return Wi({create:a=>i&&4===e(a.options)?{}:{CallExpression(e){o(e.callee,t,n)&&so(a,e.callee,r)}}})}function Qo(e,t=3){if(!n(e)||!Array.isArray(e.arguments))return[];const r=e.arguments,o=c(e,"acquireUseRelease")?2:mi(e,t)?1:c(e,"addFinalizer")?0:_e(e,"Scope","addFinalizer")||_e(e,"Scope","addFinalizerExit")?1:-1;return o<0?[]:r.slice(o,4===t||0===o?o+1:void 0)}function Ko(e,t){let r=n(e)?e.parent:void 0;const o=new WeakSet;for(;n(r);){if(o.has(r))return;if(o.add(r),t(r))return r;r=r.parent}}function _o(e,t=3){return void 0!==Ko(e,e=>(4===t||K(e))&&Qo(e.parent,t).some(t=>t===e))}function Yo(e,t){return Po((t,n)=>e(t,n)?t:void 0,t,!1,!0)}function Jo(e){return _e(e,"Scope","make")&&Array.isArray(e.arguments)}function Go(e,t){return _e(e,"Scope","close")&&r(a(e),t)}function Ho(e){return Ko(e,e=>eu.has(e.type??"")||K(e))}function Zo(e,t){let r=e;const o=new WeakSet;for(;n(r);){if(o.has(r))return!1;if(o.add(r),r===t)return!0;r=r.parent}return!1}function Xo(e){let t=0,r=e;const o=new WeakSet;for(;n(r);){if(o.has(r))return t;o.add(r),t+=1,r=r.parent}return t}function ei(e){if(r(e))return[e];if(!n(e))return[];const t=e;switch(t.type){case"ArrayPattern":return Array.isArray(t.elements)?t.elements.flatMap(e=>ei(e)):[];case"AssignmentPattern":return ei(t.left);case"ObjectPattern":return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(!n(e))return[];const t=e;return"Property"===t.type?ei(t.value):"RestElement"===t.type?ei(t.argument):[]}):[];case"RestElement":return ei(t.argument);case"TSParameterProperty":return ei(t.parameter);default:return[]}}function ti(e){return ie(e.body,t=>n(t)&&ni(t).length>0&&ai(t)===e)}function ni(e){return"VariableDeclarator"===e.type?ei(e.id):"CatchClause"===e.type?ei(e.param):"ClassDeclaration"!==e.type&&"FunctionDeclaration"!==e.type||!r(e.id)?[]:[e.id]}function ri(e){return"CatchClause"===e.type?Ho(e.param):Ho(e)}function oi(e,t){if(!r(e))return;let n,o=-1;for(const i of ti(t)){if(!ni(i).some(t=>r(t,e.name)))continue;const t=ri(i);if(void 0===t||!Zo(e,t))continue;const a=Xo(t);a>o&&(n=i,o=a)}return n}function ii(e,t){return e===t||n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&e.argument===t}function ai(e){return Ko(e,K)}function ci(e){let t=n(e)?e.parent:void 0;const o=new WeakSet;for(;n(t);){if(o.has(t))return;if(o.add(t),"VariableDeclarator"===t.type&&r(t.id)&&ii(t.init,e))return t;if(K(t))return;t=t.parent}}function si(e){const t=ci(e),n=ai(e);if(void 0===t||void 0===n)return!1;const r=t.id.name;return ie(n.body,e=>Go(e,r)&&ai(e)===n&&oi(a(e),n)===t).length>0}function ui(e,t,n){const o=a(e);return!!r(o,t.name)&&void 0===oi(o,n)&&Array.isArray(n.params)&&n.params.some(e=>e===t)}function li(e){const t=e.arguments;return(c(e,"acquireUseRelease")?t.slice(2):t.slice(1)).some(e=>{if(!K(e))return!1;const t=e.params?.[0];return!!r(t)&&ie(e.body,n=>Go(n,t.name)&&ai(n)===e&&ui(n,t,e)).length>0})}function fi(e,t=3){return void 0!==Ko(e,n=>3===t&&(c(n,"scoped")||_e(n,"Layer","scoped"))||mi(n,t)&&a(n)===e&&li(n))||si(e)}function pi(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;let o;return r(t)?o=t.name:n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.property)&&(o=t.property.name),void 0!==o&&Tt(o)}function di(e){return Ot(e)||pi(e)}function mi(e,t=3){return c(e,"acquireRelease")||3===t&&c(e,"acquireReleaseInterruptible")||c(e,"acquireUseRelease")}function yi(e,t=3){return!!_o(e,t)||void 0!==Ko(e,e=>mi(e,t)||c(e,"scoped")||3===t&&_e(e,"Layer","scoped")||ht(e))}function hi(e){return Ko(e,e=>K(e)||"Program"===e.type)}function gi(e,t=3){return ie(e,n=>di(n)&&hi(n)===e&&!yi(n,t))}function bi(e){if(!n(e)||!K(e))return;const t=e;if(r(t.id))return t.id.name;const o=t.parent;return n(o)?"VariableDeclarator"===o.type&&r(o.id)?o.id.name:"Property"===o.type&&r(o.key)?o.key.name:void 0:void 0}function vi(e){const t=bi(e);return void 0!==t&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function wi(e,t){return 3===t?ai(e):Ko(e,e=>{if(!K(e))return!1;const t=e.parent;return S(t,"gen",4)!==e&&S(t,"fn",4)!==e&&!be(t,4).includes(e)&&!["sync","suspend","promise","tryPromise"].some(n=>c(t,n)&&t.arguments.includes(e))})}function Ei(e,t=3){const n=hi(e);if(void 0!==n)return gi(n,t)[0]}function xi(e,t=3,o){if(!r(e))return;if(4===t){const t=Ko(e,e=>"Program"===e.type);if(!t||!o?.sourceCode)return;return ie(t,e=>n(e)&&"VariableDeclarator"===e.type).find(t=>o.sourceCode.getDeclaredVariables(t).some(t=>t.references.some(t=>Object.is(t.identifier,e))))?.init}const i=ai(e),a=void 0===i?[]:[i];let c=n(e)?e.parent:void 0;const s=new WeakSet;for(;n(c)&&!s.has(c);){if(s.add(c),"Program"===c.type){a.push(c);break}c=c.parent}for(const t of a){const o=oe(t,t=>n(t)&&"VariableDeclarator"===t.type&&r(t.id,e.name)&&void 0!==t.init);if(o)return o.init}}function Si(e,t,n){const r=Te(e,t);if(!r)return!1;const o=r.program,i=(e,n)=>oe(e,3===t?n:t=>n(t)&&wi(t,4)===ai(e)),a=void 0!==i(o,re)?o:xi(o,t,n)??o;return void 0!==i(a,re)&&void 0===i(a,ue)}function ki(e,t){return Object.fromEntries(e.filter(e=>3===t||!Ci.includes(e)).map(e=>[`linteffect/${e}`,Di.includes(e)?["error",{effectVersion:t}]:"error"]))}function Ai(e){return{jsPlugins:uu,rules:e}}function Ri(e){const t=ki(["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"],e),n=ki(["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"],e),r=ki(["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",...ru,"no-acquire-without-scoped-release"],e),o=ki(["no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release",...cu,"no-run-with-open-resource"],e),i=ki(["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"],e),a=ki(["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"],e),c=ki(["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"],e),s=ki(["no-effect-sync-console","no-atom-registry-effect-sync","no-family-collection-read","no-naked-object-state-update","no-wrapgraphql-catchall"],e),u=ki(["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"],e),l=["no-error-as-public-effect-error","no-unknown-public-error-channel","no-mixed-effect-error-shapes","no-expected-state-as-error"],f=ki([...l,"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"],e),p={...u,...f},d=ki(["no-piped-yield-in-gen","no-gen-for-mapping","prefer-gen-for-workflow",...iu],e),m=ki(["no-large-anonymous-flow","no-effect-in-flow","prefer-named-flow",...au],e),y=ki(["prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe"],e),h=ki(["no-mixed-pillar-function","no-clever-effect-expression","prefer-extracted-concept"],e),g=ki(["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"],e),b=ki(["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"],e),v=ki(["no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method",...nu],e),w=ki(Object.keys(tu),e),E=[...nu,...ru,...ou,...iu,...au,...cu,...su,...l,"no-resource-succeed-escape"],x=ki(Object.keys(tu).filter(e=>!E.includes(e)),e),S={reactAndRuntimeBoundaries:t,effectComposition:n,concurrencySafety:r,resourceLifetime:o,pipelineShapeAndSequencing:i,branchingAndLocalControlFlow:a,optionMatchAndDataNormalization:c,atomStateAndPlatformBoundaries:s,domainModeling:u,errorModeling:f,ddd:p,effectFlow:d,pureTransformation:m,behaviorDecoration:y,styleSeparation:h,serviceAndLayerArchitecture:g,platformAndBoundaryHygiene:b,testingObservabilityAndQa:v},k=Ai(x),A={options:{typeAware:!0},jsPlugins:uu,rules:k.rules},R=Ai(t),F=Ai(n),W=Ai(r),D=Ai(o),C=Ai(i),j=Ai(a),M=Ai(c),T=Ai(s),q=Ai(u),P=Ai(f),I=Ai(p),O=Ai(d),L=Ai(m),N=Ai(y),z=Ai(h),$=Ai(g),V=Ai(b),B=Ai(v);return{jsPlugins:uu,reactAndRuntimeBoundariesRules:t,effectCompositionRules:n,concurrencySafetyRules:r,resourceLifetimeRules:o,pipelineShapeAndSequencingRules:i,branchingAndLocalControlFlowRules:a,optionMatchAndDataNormalizationRules:c,atomStateAndPlatformBoundariesRules:s,domainModelingRules:u,errorModelingRules:f,dddRules:p,effectFlowRules:d,pureTransformationRules:m,behaviorDecorationRules:y,styleSeparationRules:h,serviceAndLayerArchitectureRules:g,platformAndBoundaryHygieneRules:b,testingObservabilityAndQaRules:v,allRules:w,recommendedRules:x,ruleGroups:S,recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:D,pipelineShapeAndSequencing:C,branchingAndLocalControlFlow:j,optionMatchAndDataNormalization:M,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:z,serviceAndLayerArchitecture:$,platformAndBoundaryHygiene:V,testingObservabilityAndQa:B,presets:{recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:D,pipelineShapeAndSequencing:C,branchingAndLocalControlFlow:j,optionMatchAndDataNormalization:M,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:z,serviceAndLayerArchitecture:$,platformAndBoundaryHygiene:V,testingObservabilityAndQa:B}}}import{definePlugin as Fi,defineRule as Wi}from"@oxlint/plugins";const Di=["no-react-state","no-runtime-runfork","no-or-die-outside-boundary","no-inline-runtime-provide","no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method","no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available","prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe","no-mixed-pillar-function","no-clever-effect-expression","prefer-effect-service","no-layer-provide-in-service-definition","require-service-accessors","require-service-dependencies","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","no-json-parse-without-schema","no-date-now-in-effect","no-effect-all-step-sequencing","no-async-effect-combinator-callback","no-throw-in-effect-logic","no-swallowed-catch-all","no-try-catch-in-effect-logic","no-promise-api-in-effect-logic","no-wrapgraphql-catchall","no-naked-object-state-update","no-early-catchall-null","no-exception-domain-error","no-expected-state-as-error","no-catchall-generic-rethrow","no-log-only-error-handling","no-fromnullable-nullish-coalesce","no-model-overlay-cast","no-string-sentinel-return","no-string-sentinel-const","prefer-gen-for-workflow","no-business-logic-in-pipe","no-flatmap-ladder","no-effect-side-effect-wrapper","no-ternary","no-return-in-arrow","no-branch-in-object","no-hidden-effect-execution","no-boundary-try-catch-without-effect-map","no-run-effect-outside-boundary","no-effect-async","no-effect-fn-generator","no-nested-effect-gen","no-yield-without-star-in-effect-gen","no-effect-orElse-ladder","no-fire-and-forget-fork","no-fork-in-loop","no-race-without-cleanup","no-unobserved-fiber","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","no-manual-deferred-coordination","no-acquire-without-scoped-release","no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release","no-request-scoped-long-lived-resource","no-global-resource-singleton","no-run-with-open-resource","no-nested-acquire-release","no-missing-layer-provision-at-run","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],Ci=["no-runtime-runfork","require-service-accessors","require-service-dependencies","no-effect-async","no-effect-orElse-ladder"],ji=["flatMap","zipRight","as","tap"],Mi=new Set(["gen","sync","try","tryPromise","fn"]),Ti=new Set(["andThen","flatMap","tap","zipRight"]),qi=new Set(["Date","Runtime","fetch","import","queueMicrotask","require","setInterval","setTimeout"]),Pi=new Set(["annotateLogs","as","catchAll","catchSome","catchTag","map","mapBoth","provide","retry","tap","tapError","timeout","timeoutFail","withSpan"]),Ii=["catch","catchEager","catchCause","catchDefect","catchIf","catchFilter","catchCauseIf","catchCauseFilter","catchTag","catchTags","catchReason","catchReasons"],Oi=new Set(["andThen","catchAll","catchTag","filterOrFail","flatMap","forEach","map","orElse","tap"]),Li=new Set([...[...Oi].filter(e=>"catchAll"!==e&&"orElse"!==e),"mapEager","flatMapEager",...Ii]),Ni=new Set(["all","allSettled","any","race","reject","resolve"]),zi=new Set(["all","allSettled","any","race"]),$i=new Set(["timeout","timeoutOption","timeoutOrElse"]),Vi=new Set(["crypto","fs","zlib"]),Bi=new Set(["runCallback","runFork","runPromise","runPromiseExit","runSync","runSyncExit"]),Ui=new Set(["catchAll","catchTag","catchTags","tapError"]),Qi=new Set(["sleep","await","promise","tryPromise","fork","forkDaemon","forkScoped","all","forEach","race","raceAll"]),Ki=new Set(["modifyEffect","modifySomeEffect","updateEffect","updateAndGetEffect"]),_i=new Set(["make","unsafeMake","makeUnsafe"]),Yi=new Set(["timeout","timeoutOption","timeoutFail","timeoutFailCause","timeoutTo"]),Ji=new Set(["race","raceFirst","raceAll","interruptible","scoped"]),Gi=new Set(["acquireRelease","acquireUseRelease","ensuring","forkIn","forkScoped","scoped"]),Hi=new Set(["race","raceAll","raceFirst","raceAllFirst"]),Zi=new Set(["retry"]),Xi=new Set(["add","clear","delete","pop","push","reverse","set","shift","sort","splice","unshift"]),ea=new Set(["fork","forkScoped","forkDaemon","all","forEach","race","raceFirst","raceAll"]),ta=new Set(["open","connect","create","start","listen","subscribe","acquire"]),na=new Set(["client","connection","conn","pool","db","database","file","socket","stream","server","subscription","handle"]),ra=new Set(["close","destroy","dispose","cleanup"]),oa=new Set(["all","forEach","fork","race","raceAll"]),ia=new Set(["all","forEach","forkChild","forkDetach","forkScoped","forkIn","race","raceAll","raceFirst","raceAllFirst"]),aa=new Set(["await","interrupt","join"]),ca=new Set(["get","set","update","modify","refresh"]),sa=["flatMap","map","andThen","tap","zipRight"],ua=new Set(["==","===","!=","!==",">",">=","<","<="]),la=new Set(["catchSome","catchTag","catchTags","fail","mapBoth","mapError"]),fa=new Set(["catchAll","tapError"]),pa=new Set(["catchAll"]),da=new Set(["catch","catchEager"]),ma=new Set(["NotFound","Missing","Empty","None"]),ya=["bin/**","scripts/**","cli/**","**/main.ts","app/api/**/route.ts","server/**","*.test.ts","*.spec.ts"],ha=["**/*.test.*","**/*.spec.*","**/__tests__/**"],ga=["**/config/**","**/*Config.ts","**/*ConfigLayer.ts"],ba=[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}],va=new Set(["useState","useReducer","useContext","useCallback","useEffect","useSyncExternalStore"]),wa=Wi({create(t){const o=e(t.options);return{CallExpression(e){const i=e.callee,a=r(i)?i.name:n(i)&&"MemberExpression"===i.type&&r(i.property)?i.property.name:void 0;a&&va.has(a)&&so(t,i,3===o?"Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.":"Rule: avoid React state hooks. Why: they bypass externally owned reactive state. Fix: pass explicit state as props or use a compatible reactive adapter at the UI boundary.")}}}}),Ea=To("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."),xa=To("SwitchStatement","Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead."),Sa=To("ConditionalExpression",e=>`Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/${3===e?"Either":"Result"}.match/Match.value or data combinators, then run one Effect pipeline.`),ka=Po(e=>uo(e.argument)?e:void 0,()=>"Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.",!1,!1,["ReturnStatement"]),Aa=Po(e=>o(e.callee,"Option","as")?e:void 0,()=>"Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly."),Ra=Po(e=>o(e,"Effect","never")?e:void 0,()=>"Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.",!1,!1,["MemberExpression"]),Fa=Po(e=>y(e)?g(e.callee.body):void 0,e=>"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."),Wa=Wi({create(t){const n=e(t.options);return{ObjectExpression(e){yr(e).some(e=>mr(e,n))&&so(t,e,`Rule: avoid Match/Option/${3===n?"Either":"Result"} 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.`)}}}}),Da=Po(e=>h(e)?e:void 0,()=>"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."),Ca=Wi({create(t){const n=e(t.options);return{CallExpression(e){for(const r of w(e,n))so(t,r,"Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).")}}}}),ja=Wi({create:e=>({CallExpression(t){for(const n of E(t))so(e,n,"Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.")}})}),Ma=Po((e,t)=>k(e,"fn",t)?e:void 0,()=>"Rule: avoid Effect.fn generator wrappers under this opt-in style policy. Fix: disable this rule for traced operations, or use Effect.gen."),Ta=Po(e=>c(e,"sync")&&Je(a(e))?e:void 0,()=>"Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call."),qa=["CallExpression","ClassDeclaration","ClassExpression"],Pa=qo(function(e,t=3){if(A(e,t))return ie(e.arguments,Ne);const n=H(e,t);return n?ie(Z(n,t),Ne):[]},"Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.",qa),Ia=qo((e,t)=>{const n=H(e,t),r=n&&Z(n,t);return[...Qe(e,t),...r?[r]:[]].flatMap(Ue)},"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(...).",qa),Oa=qo((e,t)=>{const n=H(e,t);return[...yn(e).map(e=>dn(e.functionNode,e.declaredReturnType)),...n?hn(n,t).map(gn):[]].filter(e=>void 0!==e)},"Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).",[...qa,"ExportNamedDeclaration","ExportDefaultDeclaration"]),La=Wi({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){if(!wo(t))return;const r=ko(e),i=r&&Ro(r,n);i&&o.push(i)},"Program:exit"(){if(r)for(const e of o)so(t,e,"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.")}}}}),Na=Wi({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){if(!wo(t))return;const r=ko(e);r&&o.push(...Fo(r,e=>Wo(e,n)))},"Program:exit"(){if(r)for(const e of o)so(t,e,"Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.")}}}}),za=Wi({create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},CallExpression(t){wo(e)&&n.push(...jo(t))},"Program:exit"(){if(t)for(const t of n)so(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.")}}}}),$a=Po((e,t)=>{const n=S(e,"gen",t);return n?3===t?fr(n.body):ve(n.body,e=>c(e,"gen")):void 0},e=>"Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline."),Va=Po(function(e,t){return S(e,"gen",t)?we(e,t,e=>n(e)&&"YieldExpression"===e.type&&!0!==e.delegate):void 0},e=>3===e?"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`.":"Rule: use yield* inside Effect.gen. Why: delegation preserves the yielded Effect's result typing and keeps workflow style consistent. Fix: replace `yield Effect.x` with `yield* Effect.x`."),Ba=Po(function(e){const t=S(e,"gen");if(!t)return;const n=F(t.body);return n.length>=2?n[1]:void 0},e=>"Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps."),Ua=Po(function(e){const t=S(e,"gen");if(!t||"object"!=typeof t.body||null===t.body)return;const n=t.body,r=Array.isArray(n.body)?n.body:[];if(2!==r.length)return;const o=j(r[0]);return o&&M(r[1],o)?e:void 0},e=>"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."),Qa=Po(function(e,t=3){if(d(e))return T(e).filter(e=>q(e,t)).length>=3?e:void 0},e=>"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."),Ka=Po(e=>I(e)?e:void 0,e=>"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."),_a=Po(function(e){if(P(e))return e.arguments.find(e=>L(e))},e=>"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."),Ya=Po(function(e){if(n(e)&&"CallExpression"===e.type)return(e.arguments??[]).find(e=>P(e)&&e.arguments.length>=3)},e=>"Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const."),Ja=Po(function(e){if(!($(e)<3))return z(n(e)?e.parent:void 0)?void 0:e},e=>"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."),Ga=Po(function(e,t=3){if(d(e))for(const n of T(e)){if(!(c(n,"flatMap")||4===t&&c(n,"flatMapEager")))continue;const e=n.arguments.find(K);if(!e)continue;const r=e.body,o=["IfStatement","SwitchStatement","ForStatement","ForInStatement","ForOfStatement","WhileStatement","DoWhileStatement"].some(e=>W(r,e)),a=void 0!==oe(r,re),s=ie(r,i).length;if(o||a||s>=2)return e}},e=>"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."),Ha=Po(function(e,t){if(V(e,t))return B(e.arguments[0])?e:void 0},()=>"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)`."),Za=Po(function(e,t){const n=S(e,"gen",t);if(!n)return;const r=ie(n.body,e=>U(e,t),new WeakSet,!0,4===t);return r.length>=2?r[1]:void 0},()=>"Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story."),Xa=Po(function(e,t){if(!d(e))return;const n=T(e);if(!n.some(e=>V(e,t)))return;const r=n.filter(e=>q(e,t)).length,o=n.some(e=>W(e,"IfStatement")||W(e,"SwitchStatement")||W(e,"ForStatement")||W(e,"ForInStatement")||W(e,"ForOfStatement")||W(e,"WhileStatement"));return r>=2||o?e:void 0},()=>"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."),ec=Po(function(e,t){if(K(e))return Q(e.body,t).size>=3?e:void 0},e=>"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.",!1,!1,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),tc=Po(function(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=Q(e,t),o=h(e)||void 0!==g(e);return r.size>=2&&(_(e)>=4||o)?e:void 0},e=>"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."),nc=Po(function(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e;for(const e of t.arguments??[]){if(!n(e)||!K(e))continue;const t=e.body;if(n(t)&&"BlockStatement"===t.type&&Array.isArray(t.body)&&t.body.length>=3)return e}},e=>"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."),rc=Po((e,t)=>X(e)||4===t&&c(e,"Service")?e:void 0,e=>3===e?"Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.":"Rule: prefer Context.Service. Fix: migrate legacy Context.Tag, Context.GenericTag or Effect.Service definitions to Context.Service; construct implementations with make and explicit Layer wiring where needed."),oc=Wi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e);r&&o&&ee(o)&&so(t,o,"Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.")},CallExpression(e){if(3===n||!r)return;const o=J(e,n),i=o&&Jn(o,"make");i&&ee(i)&&so(t,o,"Rule: do not assemble layers inside Context.Service make. Fix: keep make focused on constructing the implementation and compose Layer.provide at app/test boundaries.")}}}}),ic=Wi({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},ClassDeclaration(e){const r=G(e);n&&r&&!te(r)&&so(t,r,"Rule: set accessors: true. Fix: add it to Effect.Service options.")}}}}),ac=Wi({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},ClassDeclaration(e){const r=G(e),o=r?ae(r):void 0;n&&o&&so(t,o,"Rule: declare service dependencies.")}}}}),cc=Wi({create:e=>({ImportDeclaration(t){const n=ne(t);n&&so(e,n,"Rule: avoid namespace imports from Effect packages.")}})}),sc=Po(function(e){if(!n(e))return;const t=e.declaration;if(n(t)&&"VariableDeclaration"===t.type)for(const e of t.declarations??[])if(n(e)&&r(e.id)&&e.id.name.endsWith("Service")&&ye(e.init))return e},e=>"Rule: avoid exported manual service objects.",!1,!1,["ExportNamedDeclaration"]),uc=Po(function(e){if(_e(e,"Layer","provide"))return oe(a(e),t=>t!==e&&_e(t,"Layer","provide"))},e=>"Rule: prefer Layer.pipe for nested layer provisioning."),lc=Po(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0);return n?4===t?ve(n.body,ue):oe(n.body,ue):void 0},e=>"Rule: avoid inline layer provisioning inside programs."),fc=Po(function(e){if(_e(e,"Layer","merge"))return e.arguments?.find(t=>oe(t,t=>t!==e&&_e(t,"Layer","merge")))},e=>"Rule: prefer Layer.mergeAll for infrastructure layer groups."),pc=Wi({create(e){let t=!1,n=0;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},VariableDeclaration(r){const o=t?fe(r):void 0;o&&(n+=1,n>=3&&so(e,o,"Rule: group service layers by concern."))}}}}),dc=Po(function(e){if(se(e))return oe(e.body,ce)?e:void 0},e=>"Rule: avoid Layer composition inside request handlers.",!1,!1,["FunctionDeclaration"]),mc=Wi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e),i=o?me(o):void 0;r&&i&&so(t,i,"Rule: return Effect from service methods.")},CallExpression(e){if(3===n||!r)return;const o=J(e,n),i=o&&me(o,n);i&&so(t,i,"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.")}}}}),yc=Po(e=>rr(e)?e:void 0,e=>"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."),hc=Wi({create:e=>({CallExpression(t){pr(t)&&cr(t.arguments)&&so(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."),ur(t)&&ar(t.arguments)&&so(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.")}})}),gc=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},CallExpression(n){const r=a(n),o=nr(r);t&&c(n,"sync")&&lr(r)&&!Ne(o)&&so(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.")}}}}),bc=Wi({create(t){const n=3===e(t.options)?"zipRight":"andThen";return{CallExpression(e){c(e,"as")&&Ge(a(e))&&so(t,e,"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."),c(e,n)&&Ge(a(e))&&so(t,e,`Rule: avoid Effect.${n} 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.`)}}}}),vc=Wi({create:e=>({CallExpression(t){c(t,"all")&&He(t.arguments[0])&&Ze(t.arguments[1])&&so(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."),Zt(t)&&He(a(t.callee.object))&&so(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.")}})}),wc=Po(function(e,t){return be(e,t).find(he)},()=>"Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: adapt with Effect.tryPromise, compose with gen/flatMap, and keep map pure."),Ec=Po((e,t)=>Ee(e,t,"ThrowStatement"),e=>`Rule: avoid throw inside Effect logic. Why: thrown exceptions ${3===e?"bypass typed Effect error channels and interruption semantics":"are not typed domain failures"}. Fix: yield* Effect.fail(taggedError) in gen, or return it from flatMap; keep map pure.`),xc=Wi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){if(!r)return;const o=Ie(e,n);o&&so(t,o,`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 ${3===n?"orDie/orDieWith":"orDie"} for explicit application boundaries.`)}}}}),Sc=Po(function(e,t){if(3===t){if(!c(e,"catchAll"))return;const t=Dn(a(e));return Oe(t)?t:void 0}for(const n of Yr(e,Jr(t))){const e=Dn(n);if(Oe(e,t))return e;for(const n of Gr(e))if(Oe(n.argument,t))return n.argument}},e=>`Rule: avoid swallowing errors in ${3===e?"catchAll":"catch/catchEager"}. 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.`),kc=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&Mr(n)&&so(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&&Mr(n)&&so(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&&Mr(n)&&so(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.")}}}}),Ac=Wi({meta:{schema:ba},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){if(r&&!vo(t)){const r=eo(e,n);r&&so(t,r,"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.")}}}}}),Rc=Po(e=>to(e)?e:void 0,e=>`Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad ${3===e?"catchAll":"catch"} recovery. Fix: return Option, ${3===e?"Either":"Result"}, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`),Fc=Po(function(e,t){return we(e,t,ro)},()=>"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."),Wc=Po(e=>Qr(e)?e:void 0,()=>"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."),Dc=Po(function(e,t){for(const n of Yr(e,Jr(t))){const e=Dn(n);if(_r(e))return e;for(const t of Gr(e))if(_r(t.argument))return t.argument}},e=>`Rule: do not rethrow generic Error from ${3===e?"catchAll":"catch"}. Why: ${3===e?"catchAll":"catch"} 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.`),Cc=Po(function(e,t){const n=3===t?Yr(e,fa):be(e,t).filter(()=>/^catch/.test(String(e.callee.property.name)));for(const e of n){const n=Dn(e),r=3===t?oe:ve,o=r(n,Ye);if(o&&!r(n,e=>Hr(e)||4===t&&(c(e,"failCause")||c(e,"die"))))return o}},()=>"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."),jc=Po(function(e){return Le(e)?e:d(e)?Xt(e).find(e=>Le(e)):void 0},()=>"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."),Mc=Po((e,t)=>Ee(e,t,"TryStatement"),e=>`Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.${3===e?"catchAll":"catch"}, Effect.catchTag, or typed error combinators.`),Tc=Po(function(e,t){return we(e,t,e=>xe(e)||Se(e,t))},()=>"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."),qc=Wi({create:e=>({TryStatement(t){so(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.")}})}),Pc=Wi({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])tn(n.init)&&so(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){nn(t.body)&&so(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.")}})}),Ic=Wi({create:e=>({TSTypeReference(t){(rn(t,"Effect","Effect")||rn(t,"Layer","Layer"))&&so(e,t,"Rule: avoid manual Effect channel tuples under this opt-in inference-only policy. Explicit Effect/Layer types are valid contracts; disable this rule to retain them.")}})}),Oc=Po(function(e,t){const n=Xt(e);if(0===n.length)return;const r=Wn(n,t);return r&&(An(n)||Fn(n,t))?r:void 0},e=>`Rule: avoid ${3===e?"catchAll":"catch/catchEager"} after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of ${3===e?"catchAll":"catch/catchEager"}.`),Lc=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},ExpressionStatement(n){t&&pr(n.expression)&&sr(n.expression.arguments)&&so(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.")}}}}),Nc=Po(function(e){if(!c(e,"sync"))return;const t=Dn(a(e));return t?jn(t):void 0},()=>"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."),zc=Wi({create:e=>({CallExpression(t){if(!_e(t,"Atom","family"))return;const n=qn(t.arguments);n&&so(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.")}})}),$c=Po(function(e){if(d(e))return Xt(e).find(e=>Pn(e))},e=>`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 ${3===e?"an Effect.Service":"a Context.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.`),Vc=Wi({create(t){const n=3===e(t.options)?"Schema.make` or field `.make":"schema .make";return{CallExpression(e){zn(e)&&so(t,e,`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 (\`${n}\`), and keep serialization at boundaries with schema encode/decode flows. Use \`linting.md\` guidance when available.`)}}}}),Bc=Po(e=>c(e,"succeed")&&$n(a(e))?e:void 0,()=>"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."),Uc=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&kn(n.typeAnnotation,"Effect","Effect")&&so(e,n.typeAnnotation,"Rule: avoid Effect.Effect type aliases under this opt-in style policy. Explicit aliases are valid; disable this rule to retain public contracts.")}}}}),Qc=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},ExportNamedDeclaration(n){const r=t?wn(n):void 0;r&&so(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){const r=t?wn(n):void 0;r&&so(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.")}}}}),Kc=Wi({create:e=>Io(e,({errorChannel:e})=>cn(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.")}),_c=Wi({create:e=>Io(e,({errorChannel:e})=>"unknown"===xn(e),"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.")}),Yc=Wi({create:e=>Io(e,({errorChannel:e})=>Sn(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.")}),Jc=Wi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},VariableDeclaration(e){r&&Vn(e,n)&&so(t,e,"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.")}}}}),Gc=Wi({create(e){let t=!1,r=!1;const o=[],i=new WeakSet,a=t=>{n(t)&&!i.has(t)&&(i.add(t),so(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){const n=lo(e);n&&So(n)&&(t=!0)},BinaryExpression(e){t&&Bn(e)&&(r?a(e):o.push(e))},CallExpression(e){if(t&&Un(e)){r=!0;for(const e of o)a(e)}}}}}),Hc=Po((e,t)=>Yn(e,t)?e:void 0,e=>`Rule: avoid nullish re-wrap inside Option.${3===e?"fromNullable":"fromNullishOr"}. Why: \`x ?? null\` and \`x ?? undefined\` add noise and hide source shape. Fix: pass the source directly to Option.${3===e?"fromNullable":"fromNullishOr"}.`),Zc=Po(e=>Hn(e)?e:void 0,e=>"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."),Xc=Wi({create(t){const n=e(t.options);return{CallExpression(e){c(e,"succeed")&&Qn(a(e))&&so(t,e,`Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/${3===n?"Either":"Result"}/tagged unions) or real Effect results instead.`)}}}}),es=Wi({create(t){const n=e(t.options);return{VariableDeclaration(e){Zn(e)&&so(t,e,`Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/${3===n?"Either":"Result"}, or meaningful domain values instead of string tokens.`)}}}}),ts=Po(e=>hr(e)?e:void 0,e=>"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.",!1,!1,["TSTypeAliasDeclaration"]),ns=Wi({create(e){let t=!1;const n=n=>{if(t)for(const t of Ar(n))so(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){const n=lo(e);n&&So(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),rs=Po(e=>co(e)?e:void 0,e=>"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.",!1,!1,["BinaryExpression"]),os=Po(e=>Sr(e)?e:void 0,e=>"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.",!1,!1,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),is=Wi({create(e){let t=!1;const n=n=>{if(t)for(const t of Tr(n))so(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){const n=lo(e);n&&So(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),as=new Set(["fs","node:fs","fs/promises","node:fs/promises"]),cs=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"]),ss=Wi({meta:{schema:ba},create:e=>({ImportDeclaration(t){const n=lo(t);n&&Oo(n)&&!vo(e)&&so(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.")}})}),us=Wi({meta:{schema:[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}},configPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},create:e=>({MemberExpression(t){!zo(t)||$o(t)||vo(e)||xo(e)||so(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.")}})}),ls=Wi({create(e){let t=!1,n=0;const r=[];return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0),n&&as.has(n)&&r.push({node:e,source:n})},FunctionDeclaration(){n+=1},"FunctionDeclaration:exit"(){n-=1},FunctionExpression(){n+=1},"FunctionExpression:exit"(){n-=1},ArrowFunctionExpression(){n+=1},"ArrowFunctionExpression:exit"(){n-=1},CallExpression(e){if(0!==n)return;const t=Vo(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(const{node:t,source:n}of r)so(e,t,`Rule: avoid Node fs imports or require calls in Effect code (${n}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`)}}}}),fs=Wi({meta:{schema:ba},create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){qe(e,n)&&o.push(e)},"Program:exit"(){if(r&&!vo(t))for(const e of o)so(t,e.callee,"Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.")}}}}),ps=new Set(["try","tryPromise","mapError","catchAll","catchTag","catchTags"]),ds=Wi({meta:{schema:ba},create(t){const n=e(t.options);return{TryStatement(e){e.handler&&vo(t)&&!Bo(e,n)&&so(t,e,3===n?"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.":"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, Effect.catch, or execute a mapped Effect program.")}}}}),ms=Wi({create(t){const n=e(t.options);let r=!1,i=!1;const a=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0),Mo(e)&&(i=!0)},CallExpression(e){o(e.callee,"JSON","parse")&&a.push(e)},"Program:exit"(){if(r&&!i)for(const e of a)so(t,e,3===n?"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.":"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: use Schema.fromJsonString with Schema.decodeUnknownEffect at the boundary.")}}}}),ys=Wi({create(t){const n=e(t.options);let r=!1;const o=new WeakSet,i=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){if(A(e,n))for(const t of ie(e.arguments,R))o.has(t)||(o.add(t),i.push(t))},"Program:exit"(){if(r)for(const e of i)so(t,e,"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.")}}}}),hs=Wi({meta:{schema:ba},create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},NewExpression(e){r(e.callee,"Date")&&n.push(e)},"Program:exit"(){if(t&&!vo(e))for(const t of n)so(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=Wi({create(e){let t=!1;const n=n=>{if(t)for(const t of Pr(n))so(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){const n=lo(e);n&&So(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),bs=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},LogicalExpression(n){t&&Or(n)&&so(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.")}}}}),vs=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},LogicalExpression(n){t&&zr(n)&&so(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.")}}}}),ws=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},CallExpression(n){t&&$r(n)&&so(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&&oo(n)&&so(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.")}}}}),Es=Wi({create(e){let t=!1;return{ImportDeclaration(e){const n=lo(e);n&&So(n)&&(t=!0)},FunctionDeclaration(n){t&&ao(n)&&so(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=Wi({create:e=>({CallExpression(t){o(t.callee,"Effect","as")&&so(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.")}})}),Ss=Wi({create:e=>({MemberExpression(t){o(t,"Effect","Do")&&so(e,t,"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.")}})}),ks=Uo("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."),As=Uo("Runtime","runFork","Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.",!0),Rs=Wi({meta:{schema:ba},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(r=!0)},CallExpression(e){r&&!vo(t)&&qe(e,n)&&so(t,e.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.")}}}}),Fs=Uo("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.",!0),Ws=Wi({create:e=>({CallExpression(t){s(t)&&so(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.")}})}),Ds=Wi({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])s(n.init)&&so(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)&&so(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.")}})}),Cs=Wi({create(t){const n=e(t.options);return{VariableDeclaration(e){for(const r of e.declarations??[]){const e=f(r.init,n);e&&so(t,r.init,e)}},ReturnStatement(e){const r=f(e.argument,n);r&&so(t,e.argument,r)}}}}),js=Wi({create:e=>({CallExpression(t){d(t)&&m(t.arguments)&&so(e,t,"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.")}})}),Ms=Wi({create:e=>({CallExpression(t){u(t)&&so(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.")}})}),Ts=Wi({create:t=>4===e(t.options)?{}:{CallExpression(e){p(e)&&so(t,e,"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.")}}}),qs=Po((e,t,n)=>et(e,n)?e:void 0,()=>"Rule: avoid unbounded Effect.all concurrency. Fix: use a finite concurrency budget or omit the option for sequential execution."),Ps=Wi({create(t){let n=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},ExpressionStatement(r){const o=e(t.options),i=n?rt(r.expression,o):void 0;i&&so(t,i,3===o?"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.":"Rule: avoid discarded Effect.forkChild / Effect.forkDetach constructions or handles. Why: a bare construction is lazy and starts no work; yielding then discarding the fiber loses explicit observation. Child fibers follow parent lifetime, detached fibers do not. Fix: retain and join/await/interrupt the fiber, or use forkScoped / forkIn with explicit scope ownership.")}}}}),Is=Wi({create(t){let n=!1;const r=r=>{if(!n)return;const o=e(t.options),i=3===o?tt(r.body):ve(r.body,e=>void 0!==nt(e));i&&so(t,4===o?nt(i):i,3===o?"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.":"Rule: avoid Effect.forkChild / Effect.forkDetach inside loops. Why: per-item forks lack a collection-wide concurrency budget even when handles are retained. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit; preserve observation and lifetime ownership.")};return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},ForStatement:r,ForInStatement:r,ForOfStatement:r,WhileStatement:r,DoWhileStatement:r}}}),Os=Wi({create(t){let n=!1;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},CallExpression(r){const o=e(t.options);n&&wt(r,o)&&so(t,r,3===o?"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.":"Rule: require visible cleanup ownership around Effect races. Why: race operators interrupt losers, but resource release still needs a finalizer or scope. Fix: expose ensuring/acquireRelease or a scoped race boundary; race/raceAll select success, raceFirst/raceAllFirst select first completion.")}}}}),Ls=Wi({create(t){let n=!1;const o=new Map,i=new Set,a=new Set;return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},VariableDeclarator(n){if(4===e(t.options))return void(r(n.id)&&"YieldExpression"===n.init?.type&&nt(n.init.argument)&&a.add(n));const i=Yt(n);i&&o.set(i,n)},CallExpression(n){if(4===e(t.options))return;const r=Jt(n);r&&i.add(r)},"Program:exit"(){if(n)if(4!==e(t.options))for(const[e,n]of o)i.has(e)||so(t,n,"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.");else for(const e of a)(t.sourceCode?.getDeclaredVariables(e)??[]).some(e=>e.references.some(e=>Gt(e.identifier)))||so(t,e,"Rule: avoid unobserved forked fibers. Why: yielded child/detached handles need explicit observation or ownership transfer. Fix: join/await/interrupt the same lexical binding, return it to its owner, or use scoped fork APIs. This checks reference syntax, not whether observation executes.")}}}}),Ns=Po((e,t,n)=>xt(e,n)?e:void 0,()=>"Rule: avoid unbounded concurrent retry policies. Fix: use finite collection concurrency and bound retry/backoff separately."),zs=Po(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0),r=4===t?e=>ve(e,je):Me;if(n)return r(n.body);if(c(e,"sync")){const t=Dn(a(e));return t?r(t):void 0}},e=>`Rule: avoid blocking sync calls inside Effect logic. Why: synchronous I/O or CPU work blocks the executing JavaScript thread; wrapping it in a Promise does not offload it. Fix: use genuinely asynchronous platform APIs via Effect.${4===e?"callback":"async"}/tryPromise, or a dedicated worker for blocking work. Sync suffix recognition is a heuristic.`),$s=Po(function(e,t=3){if(4===t){const n=S(e,"fn",t)??(c(e,"sync")?a(e):void 0);return(n?ve(Dn(n),Ae):void 0)??we(e,t,Ae)}const n=S(e,"gen");if(n)return Re(n.body);if(c(e,"sync")){const t=Dn(a(e));return t?Re(t):void 0}if(!i(e))return;const o=e.callee.property;if(r(o)&&Oi.has(o.name))for(const t of e.arguments){const e=Dn(t),n=e?Re(e):void 0;if(n)return n}},e=>`Rule: avoid Promise concurrency APIs inside Effect logic. Why: raw Promise aggregation does not own interruption of its underlying operations. Fix: use bounded Effect.all/forEach, Effect.${4===e?"result":"either"} for settled outcomes, raceFirst for first completion or race for first success, with signal-aware boundary adapters. Preserve application error semantics explicitly.`),Vs=Wi({create(t){let n=!1;const r=new Set,o=[],i=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},VariableDeclaration(n){if("let"===n.kind||"var"===n.kind)if(4!==e(t.options))for(const e of St(n))r.add(e);else o.push(n)},CallExpression(o){if(!n)return;if(4===e(t.options)){const e=Wt(o);return void(e&&i.push(e))}const a=Ft(o);if(!a)return;const c=Rt(a,r);c&&so(t,c,"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.")},"Program:exit"(){if(!n||4!==e(t.options))return;const r=o.flatMap(e=>t.sourceCode.getDeclaredVariables(e));for(const e of i){const n=jt(e,r);n&&so(t,n,"Rule: avoid mutating shared state across fibers. Why: outer let/var writes in child/detached or collection work couple workers through mutable state. Fix: use Ref updates or aggregate immutable results. This checks lexical inline work, not execution or a proven data race; collections default to sequential execution.")}}}}}),Bs=Po(function(e,t=3){if(4===t){let t;return[...$i].some(t=>c(e,t))||n(e)&&"CallExpression"===e.type&&[...$i].some(t=>c(e.callee,t))?t=a(e):d(e)&&[...$i].some(t=>c(e.arguments.at(-1),t))&&(t=Ce(e)),c(t,"promise")?Fe(a(t))?void 0:t:c(t,"tryPromise")&&!We(t)?t:void 0}if(!c(e,"timeout"))return;const r=a(e);return De(r)?r:void 0},()=>"Rule: avoid timeout around noninterruptible Promise effects. Why: Effect timeout interrupts the wrapper, but the underlying operation stops only if it observes cancellation. Fix: accept and forward AbortSignal in the adapter to an API that honours it. Parameter presence is a syntax heuristic, not proof of cancellation."),Us=Po((e,t)=>Ut(e,t)?e:void 0,()=>"Rule: avoid uninterruptible concurrent regions. Why: broad masking around collection, fork, race or waiting work can defer cancellation and shutdown. Fix: keep only a short critical section masked and explicitly restore interruption for long-running work. Scoping alone does not restore interruptibility; syntax does not prove the mask is actually executed."),Qs=Po((e,t)=>Qt(e,t)?e:void 0,()=>"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."),Ks=Wi({create(t){let n=!1;const r=new Set,o=[],i=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},VariableDeclaration(n){if(4!==e(t.options))for(const e of _t(n))r.add(e);else o.push(n)},CallExpression(o){if(!n)return;if(4===e(t.options)){const e=Wt(o);return void(e&&i.push(e))}const a=Ft(o);if(!a)return;const c=Rt(a,r);c&&so(t,c,"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.")},"Program:exit"(){if(!n||4!==e(t.options))return;const r=o.flatMap(e=>t.sourceCode.getDeclaredVariables(e).filter(t=>("module"===t.scope.type||"global"===t.scope.type)&&_t(e).includes(t.name)));for(const e of i){const n=jt(e,r);n&&so(t,n,"Rule: avoid global mutable concurrency state. Why: module-owned let/var or mutable containers couple inline workers. Fix: own Ref or immutable results in a service/layer. Lexical syntax does not prove execution or a data race; default collections are sequential.")}}}}}),_s=Wi({create(t){let n=!1;const o=[new Set],i=new WeakSet,c=[];return{ImportDeclaration(e){const t=lo(e);t&&So(t)&&(n=!0)},FunctionDeclaration(){o.push(new Set)},"FunctionDeclaration:exit"(){o.pop()},FunctionExpression(){o.push(new Set)},"FunctionExpression:exit"(){o.pop()},ArrowFunctionExpression(){o.push(new Set)},"ArrowFunctionExpression:exit"(){o.pop()},VariableDeclarator(n){if(4===e(t.options)){const e="YieldExpression"===n.init?.type?n.init.argument:n.init;return void(r(n.id)&&(_e(e,"Deferred","make")||_e(e,"Deferred","makeUnsafe"))&&c.push(n))}const i=mt(n);i&&o.at(-1)?.add(i)},CallExpression(c){if(4===e(t.options))return;if(!n||!dt(c))return;const s=a(c);r(s)&&o.at(-1)?.has(s.name)&&(gt(c,s.name)||i.has(c)||(i.add(c),so(t,c,"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.")))},"Program:exit"(){if(n&&4===e(t.options))for(const e of c)for(const n of t.sourceCode.getDeclaredVariables(e))for(const e of n.references){const r=e.identifier.parent;dt(r)&&a(r)===e.identifier&&!gt(r,n.name,4,n.references)&&so(t,r,"Rule: avoid unbounded manual Deferred coordination. Why: a local latch needs visible completion or cancellation ownership. Fix: use a timeout/race or an interruptible owner with a same-binding finalizer. Scope/interruptibility/finalizer markers alone do not prove eventual completion.")}}}}}),Ys=Po((e,t)=>{const n=It(e,t);return n?$t(n,t):void 0},e=>"Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: "+(3===e?"wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.":"own release; a scope marker is insufficient."),!0),Js=Po((e,t)=>{const n=ct(e,t);return n&&(4===t?Bt(n,!0):it(n))?e:void 0},()=>"Rule: avoid suspension while holding a semaphore permit. Why: unrelated waits hold capacity needed by other work. Fix: narrow coordination critical sections when semantics allow. Async work may intentionally be permit-bound; moving it outside changes concurrency limits. This strict policy is not leak detection."),Gs=Po((e,t)=>{const n=st(e,t);return n&&(3===t?it(n):Bt(Dn(n)??n,!0))?e:void 0},e=>"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: "+(3===e?"compute the effect outside the modifier and commit a short synchronous state transition.":"move independent work outside; retain atomicity.")),Hs=Wi({create:e=>({ImportExpression(t){so(e,t,"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.")}})}),Zs=Po((e,t)=>{if(3===t)return c(e,"forkDaemon")&&!l(a(e),"supervised")?e:void 0;const n=d(e)?e.arguments.at(-1):e?.callee;if(c(e,"forkDetach")){const t=a(e);return!t||r(t,"undefined")||Ve(t)?void 0:e}return c(n,"forkDetach")||ft(n,"forkDetach")?e:void 0},e=>`Rule: avoid unscoped background fibers. Why: Effect.${3===e?"forkDaemon":"forkDetach"} detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn ${3===e?"or make supervisor ownership explicit in the child effect.":"or child ownership; join is not lifetime ownership."}`),Xs=Yo((e,t)=>Pt(e)&&!_o(e,t),()=>"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."),eu=new Set(["BlockStatement","CatchClause","ForInStatement","ForOfStatement","ForStatement","Program","SwitchStatement"]),tu={"no-react-state":wa,"no-if-statement":Ea,"no-switch-statement":xa,"no-ternary":Sa,"no-return-null":ka,"no-option-as":Aa,"no-effect-never":Ra,"no-arrow-ladder":Fa,"no-branch-in-object":Wa,"no-iife-wrapper":Da,"no-return-in-arrow":Ca,"no-return-in-callback":ja,"no-effect-fn-generator":Ma,"no-effect-sync-console":Ta,"no-console-in-effect-flow":Pa,"no-effect-log-without-structured-context":Ia,"require-span-on-public-service-method":Oa,"no-runpromise-in-non-async-test-body":La,"require-effect-flip-for-error-test":Na,"no-test-mock-layer-when-default-available":za,"no-nested-effect-gen":$a,"no-yield-without-star-in-effect-gen":Va,"no-piped-yield-in-gen":Ba,"no-gen-for-mapping":Ua,"prefer-gen-for-workflow":Qa,"no-business-logic-in-pipe":Ga,"no-large-anonymous-flow":Ka,"no-effect-in-flow":_a,"prefer-named-flow":Ya,"prefer-flow-for-pure-pipeline":Ja,"prefer-pipe-for-behavior":Ha,"prefer-decorated-effect-before-gen":Za,"no-workflow-in-behavior-pipe":Xa,"no-mixed-pillar-function":ec,"no-clever-effect-expression":tc,"prefer-extracted-concept":nc,"prefer-effect-service":rc,"no-layer-provide-in-service-definition":oc,"require-service-accessors":ic,"require-service-dependencies":ac,"no-namespace-effect-import":cc,"no-manual-service-object-export":sc,"no-layer-merge-in-request-handler":dc,"no-service-method-returning-promise":mc,"prefer-layer-pipe":uc,"no-inline-layer-provide-in-program":lc,"prefer-layer-mergeall-for-infrastructure":fc,"no-service-layer-scatter":pc,"no-match-void-branch":yc,"no-json-parse-without-schema":ms,"no-date-now-in-effect":ys,"no-new-date-in-domain-logic":hs,"no-match-effect-branch":hc,"warn-effect-sync-wrapper":gc,"no-effect-side-effect-wrapper":bc,"no-effect-all-step-sequencing":vc,"no-async-effect-combinator-callback":wc,"no-throw-in-effect-logic":Ec,"no-or-die-outside-boundary":xc,"no-swallowed-catch-all":Sc,"no-effect-ignore":jc,"no-try-catch-in-effect-logic":Mc,"no-promise-api-in-effect-logic":Tc,"no-try-catch":qc,"no-effect-wrapper-alias":Pc,"no-manual-effect-channels":Ic,"no-wrapgraphql-catchall":Oc,"no-render-side-effects":Lc,"no-atom-registry-effect-sync":Nc,"no-family-collection-read":zc,"no-inline-runtime-provide":$c,"no-naked-object-state-update":Vc,"no-effect-succeed-variable":Bc,"no-effect-type-alias":Uc,"no-public-generic-effect-error":Qc,"no-early-catchall-null":Ac,"no-empty-error-tag":kc,"no-expected-state-as-error":Rc,"no-exception-domain-error":Fc,"no-effect-fail-error-message":Wc,"no-catchall-generic-rethrow":Dc,"no-log-only-error-handling":Cc,"no-error-as-public-effect-error":Kc,"no-unknown-public-error-channel":_c,"no-mixed-effect-error-shapes":Yc,"no-model-overlay-cast":Jc,"no-unknown-boolean-coercion-helper":Gc,"no-fromnullable-nullish-coalesce":Hc,"no-option-boolean-normalization":Zc,"no-string-sentinel-return":Xc,"no-string-sentinel-const":es,"no-raw-domain-id-alias":ts,"no-boolean-domain-flag":ns,"no-magic-domain-string":rs,"no-raw-domain-primitive-params":os,"no-raw-time-domain-field":is,"no-hidden-effect-execution":fs,"no-boundary-try-catch-without-effect-map":ds,"no-node-fs-in-effect-code":ls,"no-node-platform-in-shared-code":ss,"no-process-env-direct-read":us,"no-overloaded-options-object":gs,"no-domain-logic-in-conditional":bs,"no-implicit-state-machine-object":vs,"no-adhoc-domain-error":ws,"no-domain-meaning-by-folder-only":Es,"no-effect-as":xs,"no-effect-do":Ss,"no-effect-bind":ks,"no-runtime-runfork":As,"no-run-effect-outside-boundary":Rs,"no-effect-async":Fs,"prevent-dynamic-imports":Hs,"no-nested-effect-call":Ws,"no-effect-ladder":Ds,"no-flatmap-ladder":Cs,"no-pipe-ladder":js,"no-call-tower":Ms,"no-effect-orElse-ladder":Ts,"no-unbounded-effect-all":qs,"no-fire-and-forget-fork":Ps,"no-fork-in-loop":Is,"no-race-without-cleanup":Os,"no-unobserved-fiber":Ls,"no-unbounded-concurrent-retry":Ns,"no-blocking-call-in-effect":zs,"no-promise-concurrency-in-effect":$s,"no-shared-mutable-state-across-fibers":Vs,"no-timeout-with-noninterruptible-promise":Bs,"no-uninterruptible-concurrent-region":Us,"no-unbounded-queue-or-pubsub":Qs,"no-global-mutable-concurrency-state":Ks,"no-manual-deferred-coordination":_s,"no-acquire-without-scoped-release":Ys,"no-manual-resource-close":Xs,"no-unbound-scope":Yo((e,t)=>Jo(e)&&!fi(e,t),e=>"Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: "+(3===e?"use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.":"use Effect.scope or acquire it with a matching Scope.close release callback. Effect.scoped alone does not own a separate scope.")),"no-resource-succeed-escape":Yo(e=>c(e,"succeed")&&qt(a(e)),()=>"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-resource-without-acquire-release":Yo((e,t)=>Ot(e)&&!yi(e,t),e=>`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, ${3===e?"Effect.scoped, ":""}or a matching finalizer.`),"no-request-scoped-long-lived-resource":Po(function(e,t=3){if(!vi(e)||!n(e))return[];const r=e;return ie(r.body,e=>di(e)&&wi(e,t)===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.",!0,!0,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),"no-global-resource-singleton":Po(e=>void 0===ai(e)&&pi(e)?e:void 0,e=>`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${3===e?" or Effect.Service":" using Context.Service"} and provide it at the application boundary.`,!1,!0,["NewExpression"]),"no-run-with-open-resource":Po((e,t)=>qe(e,t)&&void 0!==Ei(e,t)?e:void 0,()=>"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":Po(function(e,t=3){if(mi(e,t))return ie(e,e=>mi(e,t)).length>=3?e:void 0},()=>"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":Po((e,t,n)=>Si(e,t,n)?e:void 0,e=>3===e?"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*.":"Rule: make service layer provision visible before running. Why: a context argument or Service-shaped yield does not prove Layer ownership. Fix: provide the required Layer before Effect.run*. This is syntax policy, not dependency type checking."),"no-yield-with-held-semaphore-permit":Js,"no-yield-with-held-mutable-ref":Gs,"no-unscoped-background-fiber":Zs};for(const e of Di){const n=tu[e];n.meta={...n.meta,schema:t(Array.isArray(n.meta?.schema)?n.meta.schema:[])}}const nu=["no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available"],ru=["no-manual-deferred-coordination","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],ou=["no-early-catchall-null","no-empty-error-tag"],iu=["no-business-logic-in-pipe"],au=["prefer-flow-for-pure-pipeline"],cu=["no-request-scoped-long-lived-resource","no-global-resource-singleton","no-nested-acquire-release","no-missing-layer-provision-at-run"],su=["no-effect-fn-generator","no-manual-effect-channels","no-effect-type-alias"],uu=[{name:"linteffect",specifier:"@opsydyn/oxlint-effect"}],{reactAndRuntimeBoundariesRules:lu,effectCompositionRules:fu,concurrencySafetyRules:pu,resourceLifetimeRules:du,pipelineShapeAndSequencingRules:mu,branchingAndLocalControlFlowRules:yu,optionMatchAndDataNormalizationRules:hu,atomStateAndPlatformBoundariesRules:gu,domainModelingRules:bu,errorModelingRules:vu,dddRules:wu,effectFlowRules:Eu,pureTransformationRules:xu,behaviorDecorationRules:Su,styleSeparationRules:ku,serviceAndLayerArchitectureRules:Au,platformAndBoundaryHygieneRules:Ru,testingObservabilityAndQaRules:Fu,allRules:Wu,recommendedRules:Du,ruleGroups:Cu,recommended:ju,typeAware:Mu,reactAndRuntimeBoundaries:Tu,effectComposition:qu,concurrencySafety:Pu,resourceLifetime:Iu,pipelineShapeAndSequencing:Ou,branchingAndLocalControlFlow:Lu,optionMatchAndDataNormalization:Nu,atomStateAndPlatformBoundaries:zu,domainModeling:$u,errorModeling:Vu,ddd:Bu,effectFlow:Uu,pureTransformation:Qu,behaviorDecoration:Ku,styleSeparation:_u,serviceAndLayerArchitecture:Yu,platformAndBoundaryHygiene:Ju,testingObservabilityAndQa:Gu,presets:Hu}=Ri(4),Zu=Ri(3);var Xu=Fi({meta:{name:"linteffect"},rules:tu});export{Wu as allRules,zu as atomStateAndPlatformBoundaries,gu as atomStateAndPlatformBoundariesRules,Ku as behaviorDecoration,Su as behaviorDecorationRules,Lu as branchingAndLocalControlFlow,yu as branchingAndLocalControlFlowRules,Pu as concurrencySafety,pu as concurrencySafetyRules,Bu as ddd,wu as dddRules,Xu as default,$u as domainModeling,bu as domainModelingRules,Zu as effect3,qu as effectComposition,fu as effectCompositionRules,Uu as effectFlow,Eu as effectFlowRules,Vu as errorModeling,vu as errorModelingRules,uu as jsPlugins,Nu as optionMatchAndDataNormalization,hu as optionMatchAndDataNormalizationRules,Ou as pipelineShapeAndSequencing,mu as pipelineShapeAndSequencingRules,Ju as platformAndBoundaryHygiene,Ru as platformAndBoundaryHygieneRules,Hu as presets,Qu as pureTransformation,xu as pureTransformationRules,Tu as reactAndRuntimeBoundaries,lu as reactAndRuntimeBoundariesRules,ju as recommended,Du as recommendedRules,Iu as resourceLifetime,du as resourceLifetimeRules,Cu as ruleGroups,Yu as serviceAndLayerArchitecture,Au as serviceAndLayerArchitectureRules,_u as styleSeparation,ku as styleSeparationRules,Gu as testingObservabilityAndQa,Fu as testingObservabilityAndQaRules,Mu as typeAware};
2
2
  //# sourceMappingURL=index.mjs.map