@opsydyn/oxlint-effect 2.4.0 → 2.6.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 Qe(e,"Effect")&&Array.isArray(e.arguments)}function a(e){return e.arguments[0]}function s(e,t){return!!i(e)&&r(e.callee.property,t)}function c(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=>s(e,t),n)}function f(e,t){return(s(e,"flatMap")||4===t&&s(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.":s(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(!s(e,"orElse"))return!1;const t=a(e);return Ii.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 E(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 w(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&&s(e.callee,"fn");if(!s(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)&&(Oi.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&&s(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?Li.has(n.name):"flatMapEager"===n.name||"zipRight"!==n.name&&Li.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)||Ni.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=>!_(e)).reduce((e,t)=>Math.max(e,$(t)),0)+1}function B(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?zi.has(o):"catchAll"!==o&&"catchSome"!==o&&"timeoutFail"!==o&&zi.has(o)||$i.includes(o)||"timeoutOption"===o||"timeoutOrElse"===o||"catchNoSuchElement"===o}function V(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=>B(e,t))}function K(e,t,r=new Set,i=new WeakSet){if((s(e,"gen")||q(e,t))&&r.add("workflow"),P(e)&&r.add("pure"),B(e,t)&&r.add("behavior"),(Qe(e,"Layer")||o(e,"Layer","pipe"))&&r.add("layer"),Array.isArray(e)){for(const n of e)K(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&&K(o,t,r,i);return r}function _(e){return n(e)&&("FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)}function Q(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,Q(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,Q(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?$n(e,"effect")??$n(e,"scoped"):$n(e,"make")}function X(e){return Qe(e,"Context","Tag")||Qe(e,"Context","GenericTag")}function ee(e,t=new WeakSet){return void 0!==oe(e,e=>Qe(e,"Layer","provide"),t)}function te(e){return Kn($n(e,"accessors"),!0)}function ne(e){if(!Eo(so(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)&&!_(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&&_(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(!$n(e,"dependencies"))return oe($n(e,"effect")??$n(e,"scoped"),re)}function se(e){if(!Qe(e,"Layer"))return!1;const t=e.callee.property;return r(t)&&("provide"===t.name||t.name.startsWith("merge"))}function ce(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 s(e,"provide")||Qe(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(!_(e))return!1;if(Gt(Xt(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(_(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 c=Array.isArray(i.arguments)?i.arguments[0]:void 0;if(s(e,"succeed")||s(e,"sync"))return o(c);if(d(e)){const e=i.callee;return o("MemberExpression"===e?.type?e.object:c)}};return o($n(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&&(_(e.value)||s(e.value,"fn")))}function he(e){return n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async}function ge(e){return 3===e?Bi:Vi}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=>_(e)?[e]:4!==t||"catchTags"!==n.name&&"catchReasons"!==n.name||!Be(e)?[]:e.properties.map(e=>e.value).filter(_)):[]}function ve(e,t){return oe(e,t,new WeakSet,!0)}function Ee(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(wn(o),n);if(e)return e}}function we(e,t,r){return Ee(e,t,e=>n(e)&&e.type===r)}function xe(e){return Qe(e,"Promise")&&Ui.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)&&Ki.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(!s(e,"tryPromise"))return!1;const t=a(e);return!!Fe(t)||Fe($n(t,"try"))}function De(e){return!!s(e,"promise")||s(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 Qi.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)&&Yi.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 s=o.callee.property;return r(s)&&s.name.endsWith("With")&&Yi.has(s.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")||s(e,"orDie")||3===t&&(o(e,"Effect","orDieWith")||s(e,"orDieWith"))}function Ie(e,t){return Pe(e,t)?e:d(e)?Kt(e).find(e=>Pe(e,t)):void 0}function Oe(e,t=3){return s(e,"succeed")||s(e,"asVoid")&&(3===t||Oe(a(e),t))||s(e,"ignore")||_n(e)}function Le(e){return o(e,"Effect","ignore")||s(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 On(e)||n(e)&&"TemplateLiteral"===e.type}function $e(e){return s(e,"logError")||s(e,"logWarning")}function Be(e){return n(e)&&"ObjectExpression"===e.type}function Ve(e,t){return!!oe(e,e=>s(e,"annotateLogs"))||t.arguments.slice(1).some(e=>Be(e)||!ze(e))}function Ue(e){return ie(e,t=>$e(t)&&ze(a(t))&&!Ve(e,t))}function Ke(e,t=3){if(!i(e))return[];const n=e.callee.property;if(!r(n)||!(3===t?Ji.has(n.name):"tapError"===n.name||"catchNoSuchElement"===n.name||$i.includes(n.name)))return[];const o=e.arguments;return(4===t?o.flatMap(e=>"catchTags"!==n.name&&"catchReasons"!==n.name||!Be(e)?[e]:e.properties.map(e=>e.value).filter(_)):o).map(wn).filter(e=>void 0!==e)}function _e(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&r(o.callee,t)}function Qe(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 Qe(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=>_e(e,"setState")||Qe(e,"Atom","set")||_e(e,"invalidate")||Ye(e)||Ne(e),t)}function He(e,t=new WeakSet){return void 0!==oe(e,e=>Qe(e,"Ref","set")||Qe(e,"Atom","set")||Qe(e,"SubscriptionRef","set")||Qe(e,"Reactivity","invalidate")||Qe(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 s(e,"all")&&Xe(e.arguments[1],t)}function tt(e,t=new WeakSet){return oe(e,e=>s(e,"fork"),t)}function nt(e){if(s(e,"forkChild")||s(e,"forkDetach"))return e;if(n(e)&&"CallExpression"===e.type&&(s(e.callee,"forkChild")||s(e.callee,"forkDetach")))return e;if(!d(e))return;const t=e.arguments?.at(-1);if(s(t,"forkChild")||s(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?s(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)&&Gi.has(e.callee.property.name)||Qe(e,"Queue","take")||Qe(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 st(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=>Qe(e,"TSemaphore","withPermit")||Qe(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 Qe(r,"TSemaphore","withPermit")||Qe(r,"TSemaphore","withPermits")?r.arguments[0]:at(r,"withPermit")||at(r,"withPermits")?r.arguments.at(-1):void 0}}function ct(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[...Hi].some(t=>at(e,t))}function ft(e,t){return o(e,"Effect",t)}function pt(e){return Qe(e,"Deferred")&&Zi.has(e.callee.property.name)}function dt(e){return Qe(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(!Qe(e,"Effect","addFinalizer")&&!Qe(e,"Scope","addFinalizer"))return!1;const n=e.arguments;return Array.isArray(n)&&n.some(e=>{const n=wn(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 c=n(e)?e.parent:void 0;const u=new WeakSet;for(;n(c);){if(u.has(c))return!1;if(u.add(c),i(c)&&(()=>{const e=c.callee.property;return r(e)&&(4===o?_i.has(e.name)||na.has(e.name)||"interruptible"===e.name||"scoped"===e.name:Xi.has(e.name)||ea.has(e.name))})()||(3===o?ht(c):d(c)&&(()=>{const e=c.arguments.at(-1);return[..._i,...na,"interruptible","scoped"].some(t=>s(e,t)||ft(e,t))})())||4===o&&"CallExpression"===c.type&&i(c.callee)&&(()=>{const e=c.callee.callee.property;return r(e)&&(_i.has(e.name)||na.has(e.name))})())return!0;if(_(c)){if(3===o?yt(c,t):a.some(e=>{for(let t=e.identifier.parent;t&&wt(t,c);t=t.parent)if(Qe(t,"Effect","addFinalizer")||Qe(t,"Scope","addFinalizer"))return!0;return!1}))return!0;if(4===o){const e=c.parent;if(S(e,"gen",4)!==c&&S(e,"fn",4)!==c&&!be(e,4).includes(c))return!1}}c=c.parent}return!1}function bt(e,t){return s(e,"forEach")&&Xe(e.arguments.at(-1),t)}function vt(e,t){return(et(e,t)||bt(e,t))&&ot(e.arguments,ra)}function Et(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 wt(e,t){if(Array.isArray(t))return t.some(t=>wt(e,t));for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function xt(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)&&oa.has(n.property.name)){const e=n.parent;if("CallExpression"===e?.type&&e.callee===n)return e}}function St(e,t,n){for(const r of t){if(r.identifiers.some(t=>wt(t,e)))continue;const t=r.references.map(e=>xt(e.identifier)).find(t=>{if(!t||!wt(t,e))return!1;for(let r=t;r;r=r.parent){if(Array.isArray(e)?e.includes(r):r===e)return!0;if(_(r)&&!Qo(r,n))return!1}return!1});if(t)return t}}function kt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function At(e){return kt(e).some(e=>sa.has(e))}function Rt(e){if(r(e))return At(e.name);if(!Po(e))return!1;const t=e;return!0!==t.computed&&(r(t.property)&&At(t.property.name)||Rt(t.object))}function Ft(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 ca.has(o.property.name)&&Rt(o.object)}function Wt(e,t=3){if(4===t){const t=d(e)?e.arguments.at(-1):e?.callee,n=e=>[...la].some(t=>s(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)&&ia.has(n.name)?e.arguments:void 0}function Dt(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)&&kt(o).some(e=>aa.has(e))&&At(o)}function Ct(e,t){return!!(s(e,"acquireRelease")||s(e,"acquireUseRelease")||s(e,"scoped")||ht(e))||void 0!==t&&yt(e,t)}function jt(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,Dt)&&yt(e,n.id.name)&&t.add(n.id.name)}return t}function Mt(e,t,o=new WeakSet,i=new Set,a=!1,c=3){if(Array.isArray(e)){for(const n of e)Mt(n,t,o,i,a,c);return}if(!n(e)||o.has(e))return;if(o.add(e),4===c&&_(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=>s(t,e))&&!at(t,"map"))return}if(Ct(e))return;const u=_(e)?new Set([...i,...jt(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(!Dt(e)||a)for(const[n,r]of Object.entries(e))"parent"!==n&&Mt(r,t,o,u,a||p,c);else t.push(e)}function Tt(e,t=3){const n=[];return Mt(e,n,void 0,void 0,!1,t),n}function qt(e,t=new WeakSet){return!!ot(e,ua)||!!Qe(e,"Queue","take")||(Array.isArray(e)?e.some(e=>qt(e,t)):!!n(e)&&!t.has(e)&&(t.add(e),Object.entries(e).some(([e,n])=>"parent"!==e&&qt(n,t))))}function Pt(e,t=!1){return!!ve(e,e=>{if(Qe(e,"Queue","take")||Qe(e,"PubSub","take")||[...la].some(t=>s(e,t)||ft(e,t))||t&&(["sleep","promise","tryPromise"].some(t=>s(e,t))||Qe(e,"Deferred","await")))return!0;const n=S(e,"gen",4)??S(e,"fn",4);return!(!n||!Pt(n.body,t))||be(e,4).some(e=>Pt(wn(e),t))})}function It(e,t=3){if(4===t){const t=s(e,"uninterruptible")?a(e):d(e)&&ft(e.arguments.at(-1),"uninterruptible")?Ce(e):void 0;return void 0!==t&&Pt(t)}return s(e,"uninterruptible")&&qt(e.arguments[0])}function Ot(e,t=3){if(Qe(e,"Queue","unbounded")||Qe(e,"PubSub","unbounded"))return!0;if(4!==t)return!1;if(Qe(e,"PubSub","makeAtomicUnbounded"))return!0;if(!Qe(e,"Queue","make"))return!1;const o=a(e);if(!o||r(o,"undefined"))return!0;if(!Be(o))return!1;if(o.properties.some(e=>"SpreadElement"===e.type))return!1;const i=$n(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 Lt(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 Nt(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?Et(e):o.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)&&Lt(e.init)?[t.name]:[]})}function zt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&s(t.init,"fork")?t.id.name:void 0}function $t(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)&&fa.has(o.property.name)&&Array.isArray(t.arguments)))return;const[i]=t.arguments;return r(i)?i.name:void 0}function Bt(e){if(!r(e))return!1;const t=e.parent;if(!t)return!1;if("ReturnStatement"===t.type&&t.argument===e)return!0;if($t(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=>[...fa].some(t=>o(e,"Fiber",t)))}function Vt(e){return o(e,"Effect","asVoid")||Qe(e,"Effect","asVoid")}function Ut(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"))&&s(t.callee.object,"all")&&t.arguments.some(e=>Vt(e))}function Kt(e){if(!n(e)||!d(e))return[];const t=e;return r(t.callee,"pipe")?t.arguments:[t.callee.object,...t.arguments]}function _t(e){const[t]=Kt(e);return void 0!==t&&C(t)}function Qt(e){if(_t(e))return!0;if(n(e)&&"ArrowFunctionExpression"===e.type){const t=e.body;return i(t)||_t(t)}return!1}function Yt(e){return b(e).some(e=>n(e)&&(Qt(e.argument)||i(e.argument)))}function Jt(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 Gt(e,t){return n(e)&&"TSTypeReference"===e.type&&r(e.typeName,t)}function Ht(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 Zt(e){return r(e,"Error")||Gt(e,"Error")}function Xt(e){if(!n(e))return;const t=e.returnType;return n(t)?t.typeAnnotation??t:void 0}function en(e,t){return Jt(Xt(e),"Effect","Effect")||Jt(t,"Effect","Effect")}function tn(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 nn(e){return tn(e).filter(e=>i(e)||_t(e))}function rn(e){return s(e,"withSpan")||d(e)&&Kt(e).some(e=>s(e,"withSpan"))}function on(e,t){if(!en(e,t))return;const n=nn(e);return 0===n.length||n.some(e=>!rn(e))?e:void 0}function an(e){if(!n(e))return;const t=e.typeAnnotation;return n(t)?Xt(t.typeAnnotation??t):void 0}function sn(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:an(e.id)}]}):[]}function cn(e,t=3){if(4===t){const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return[];if(r.add(e),Be(e))return[e];if(_(e))return tn(e).flatMap(o);const i=S(e,"gen",t)??S(e,"fn",t);if(i)return o(i);if(s(e,"succeed")||s(e,"sync")||s(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($n(e,"make")).flatMap(e=>e.properties.filter(e=>"Property"===e.type&&_(e.value)).map(e=>e.value))}const r=$n(e,"effect")??$n(e,"scoped"),o=S(r,"gen"),i=o?tn(o).find(Be):s(r,"succeed")&&Be(a(r))?a(r):void 0;if(!i)return[];const c=i.properties;return Array.isArray(c)?c.flatMap(e=>{if(!n(e)||"Property"!==e.type)return[];const t=e.value;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[t]}):[]}function un(e){return nn(e).some(e=>!rn(e))?e:void 0}function ln(e,t){const n=Xt(e)??t;if(!Jt(n,"Effect","Effect"))return;const[,r]=Ht(n);return void 0===r?void 0:{annotation:n,errorChannel:r}}function fn(e){if(!n(e))return[];const t=e;return"ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type?[]:sn(t).flatMap(({functionNode:e,declaredReturnType:t})=>{const n=ln(e,t);return n?[n]:[]})}function pn(e){return fn(e).find(e=>Zt(e.errorChannel))?.annotation}function dn(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 mn(e){const t=dn(e);if(Zt(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 yn(e){const t=dn(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=mn(e);return t?[t]:[]})):new Set}function hn(e,t,n,r=new WeakSet){return void 0!==oe(e,e=>Jt(e,t,n),r)}function gn(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"wrapGraphqlCall"),t)}function bn(e,t){return(s(e,"flatMap")||4===t&&s(e,"flatMapEager"))&&r(a(e),"applyResponse")}function vn(e,t,n=new WeakSet){return void 0!==oe(e,e=>bn(e,t),n)}function En(e,t,n=new WeakSet){return oe(e,e=>i(e)&&Vr(t).has(e.callee.property.name),n)}function wn(e){if(!n(e))return;const t=e;return"ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type?t.body:void 0}function xn(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)&&pa.has(o.property.name)}function Sn(e,t=new WeakSet){return oe(e,xn,t)}function kn(e){return!!r(e)&&/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name)}function An(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 kn(i)?i:void 0}function Rn(e,t=new WeakSet){return An(oe(e,e=>void 0!==An(e),t))}function Fn(e){return s(e,"provide")&&1===e.arguments.length}function Wn(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&"SpreadElement"===e.type,t)}function Dn(e){return!(!Qe(e,"Ref","update")&&!Qe(e,"Ref","modify"))&&Wn(wn(e.arguments[1]))}function Cn(e){return n(e)&&"ObjectExpression"===e.type&&Array.isArray(e.properties)&&0===e.properties.length}function jn(e,t=new WeakSet){return void 0!==oe(e,e=>Qe(e,"Object","entries"),t)}function Mn(e){if(Dn(e))return!0;if(Qe(e,"Object","assign")){const t=e.arguments;return t.length>=3&&Cn(t[0])}return Qe(e,"Object","fromEntries")?jn(e.arguments[0]):Qe(e,"JSON","stringify")||Qe(e,"JSON","parse")}function Tn(e){return!!r(e)||n(e)&&"MemberExpression"===e.type}function qn(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 Pn(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 In(e){return Qn(e,"orElse")&&ao(Yn(e.arguments[0]))}function On(e){return n(e)&&("Literal"===e.type||"StringLiteral"===e.type)&&"string"==typeof e.value}function Ln(e){return r(e,"undefined")}function Nn(e){return n(e)&&"LogicalExpression"===e.type&&"??"===e.operator&&(ao(e.right)||Ln(e.right))}function zn(e,t=3){return Qe(e,"Option",3===t?"fromNullable":"fromNullishOr")&&Nn(e.arguments[0])}function $n(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 Bn(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return"==="===t.operator&&(Kn(t.left,!0)||Kn(t.right,!0))}function Vn(e){if(!Qe(e,"Option","match"))return!1;const t=e.arguments[1],n=$n(t,"onSome"),r=$n(t,"onNone");return Bn(Yn(n))&&Kn(Yn(r),!1)}function Un(e){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>n(e)&&On(e.init))??!1)}function Kn(e,t){return n(e)&&("Literal"===e.type||"BooleanLiteral"===e.type)&&e.value===t}function _n(e){return o(e,"Effect","void")}function Qn(e,t){return Qe(e,"Match",t)&&Array.isArray(e.arguments)}function Yn(e){if(n(e)&&"ArrowFunctionExpression"===e.type)return e.body}function Jn(e){if(!Qn(e))return!1;const[t,n]=e.arguments;return r(e.callee.property,"when")?(Kn(t,!0)||Kn(t,!1))&&_n(Yn(n)):r(e.callee.property,"orElse")&&_n(Yn(t))}function Gn(e){return Qe(e,"Stream")}function Hn(e,t=new WeakSet){return void 0!==oe(e,e=>da.some(t=>s(e,t))||d(e)||Gn(e),t)}function Zn(e){return C(e)&&Hn(e)}function Xn(e,t=new WeakSet){return void 0!==oe(e,e=>Qn(e)&&Zn(r(e.callee.property,"when")?Yn(e.arguments[1]):Yn(e.arguments[0])),t)}function er(e,t=new WeakSet){return void 0!==oe(e,e=>Qn(e),t)}function tr(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&o(e.callee,"Option","match")}function nr(e){const t=Yn(e);return n(t)&&"CallExpression"===t.type}function rr(e){return oe(e,e=>s(e,"gen"))}function or(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 ir(e,t){return or(e)||n(e)&&"CallExpression"===e.type&&(o(e.callee,"Option","match")||o(e.callee,3===t?"Either":"Result","match"))}function ar(e,t,n=new WeakSet){return void 0!==oe(e,e=>ir(e,t),n)}function sr(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 cr(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 ur(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 lr(e){if(!n(e))return;const t=e;return"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation?t.typeAnnotation:t}function fr(e){const t=lr(e);return"TSStringKeyword"===t?.type||"TSNumberKeyword"===t?.type}function pr(e){const t=lr(e);return"TSAnyKeyword"===t?.type||"TSObjectKeyword"===t?.type}function dr(e){const t=lr(e);return"TSTypeReference"===t?.type&&r(t.typeName,"Date")}function mr(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)&&fr(e.typeAnnotation)&&t.test(e.name))}function yr(e){return mr(e).length>=3}function hr(e){return!!r(e)&&/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&ur(e.typeAnnotation)}function gr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(hr):[]}function br(e){return r(e)?e.name:n(e)&&"string"==typeof e.value?e.value:void 0}function vr(e){if(!n(e)||"TSPropertySignature"!==e.type)return!1;const t=e,r=br(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)&&(fr(o)||dr(o))}function Er(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 wr(e){return r(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function xr(e){const t=Er(e);return 1===t.length&&"_tag"===br(t[0].key)}function Sr(e){const t=n(e)?e.superTypeArguments:void 0,r=n(t)?t.params??t.arguments:void 0,o=Array.isArray(r)?r:Ht(e);if(0===o.length)return!0;const i=o[0];return n(i)&&("TSObjectKeyword"===i.type||"TSTypeLiteral"===i.type&&0===Er(i).length)}function kr(e){if(!n(e))return;const t=e;return("TSTypeAliasDeclaration"===t.type||"TSInterfaceDeclaration"===t.type)&&wr(t.id)&&xr("TSTypeAliasDeclaration"===t.type?t.typeAnnotation:t)||"ClassDeclaration"===t.type&&Qe(t.superClass,"Data","TaggedError")&&Sr(t)?e:void 0}function Ar(e){return Er(e).filter(vr)}function Rr(e){return!!r(e)&&/^(?:opts|options|config)$/i.test(e.name)&&pr(e.typeAnnotation)}function Fr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(Rr):[]}function Wr(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+Wr(n,t),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=e;return"BinaryExpression"===r.type&&ma.has(String(r.operator))?1:"LogicalExpression"!==r.type?0:Wr(r.left,t)+Wr(r.right,t)}function Dr(e){return n(e)&&"LogicalExpression"===e.type&&Wr(e)>=3}function Cr(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 jr(e,t=new Map,r=new WeakSet){const o=Cr(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)jr(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||(jr(i.left,t,r),jr(i.right,t,r)),t}function Mr(e){return!(!n(e)||"LogicalExpression"!==e.type)&&Array.from(jr(e).values()).some(e=>e.size>=2)}function Tr(e,t,o){if(!n(t)||"MemberExpression"!==t.type||t.computed||!r(t.property,o)||!r(t.object))return!1;for(let n=e.sourceCode.getScope(t.object);n;n=n.upper){const e=n.set.get(t.object.name);if(!e)continue;const o=e.defs[0];if(1!==e.defs.length||"ImportBinding"!==o?.type)return!1;const i=o.node,a=o.parent;if("type"===i.importKind||"type"===a.importKind)return!1;const s=so(a);return"effect"===s&&"ImportSpecifier"===i.type&&r(i.imported,"Schema")||"effect/Schema"===s&&"ImportNamespaceSpecifier"===i.type}return!1}function qr(e,t,o){if(!n(t)||"ObjectExpression"!==t.type||!Array.isArray(t.properties))return;const i=new Set;for(const o of t.properties){if(!n(o)||"Property"!==o.type||o.computed)return;const t=o.key,a=r(t)?t.name:n(t)&&"Literal"===t.type?t.value:void 0;"string"==typeof a&&(Tr(e,o.value,"Boolean")?i.add(a):i.delete(a))}return o.find(([e,t])=>i.has(e)&&i.has(t))}function Pr(e){return s(e,"fail")&&On(a(e))}function Ir(e){return r(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Or(e){if(!n(e)||"MemberExpression"!==e.type)return!1;const t=e;return!0!==t.computed&&r(t.property,"message")&&Ir(t.object)}function Lr(e){if(Or(e))return!0;if(!n(e))return!1;const t=e;return"BinaryExpression"===t.type&&"+"===t.operator?Lr(t.left)||Lr(t.right):"TemplateLiteral"===t.type&&Array.isArray(t.expressions)&&t.expressions.some(e=>Lr(e))}function Nr(e){return s(e,"fail")&&Lr(a(e))}function zr(e){return n(e)&&"NewExpression"===e.type&&r(e.callee,"Error")}function $r(e){return s(e,"fail")&&zr(a(e))}function Br(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&t.has(n.name)?e.arguments.filter(_):[]}function Vr(e){return 3===e?ba:va}function Ur(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Ur(e,t)):!n(e)||t.has(e)||_(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:Ur(n,t)))}function Kr(e){for(;n(e)&&["ParenthesizedExpression","TSAsExpression","TSTypeAssertion","TSSatisfiesExpression","TSNonNullExpression"].includes(String(e.type));)e=e.expression;return e}function _r(e,t,o){if(!n(e=Kr(e)))return"erased";if(t.has(e))return"retained";if(r(e,"undefined")){for(let t=o.sourceCode.getScope(e);t;t=t.upper){const e=t.set.get("undefined");if(e)return e.defs.length?"unknown":"erased"}return"erased"}if("Literal"===e.type||"UnaryExpression"===e.type)return"erased";if("MemberExpression"===e.type){let r=e;for(;n(r)&&"MemberExpression"===r.type;)r=Kr(r.object);return t.has(r)?"erased":"unknown"}const i=[];if("ArrayExpression"===e.type)i.push(...e.elements.map(e=>_r(e,t,o)));else{if("ObjectExpression"!==e.type)return"unknown";{const n=new Set;for(const a of[...e.properties].reverse()){const e=a.key,s=!0!==a.computed&&r(e)?e.name:e?.value;if("SpreadElement"===a.type||void 0===s){i.push("unknown");break}if(!n.has(String(s))&&(n.add(String(s)),i.push(a.method||a.kind&&"init"!==a.kind?"unknown":_r(a.value,t,o)),"retained"===i.at(-1)))return"retained"}}}return i.includes("retained")?"retained":i.includes("unknown")?"unknown":"erased"}function Qr(e,t,r){return n(e=Kr(e))?"ConditionalExpression"===e.type?[...Qr(e.consequent,t,r),...Qr(e.alternate,t,r)]:t&&"NewExpression"===e.type?[e]:t||"CallExpression"!==e.type||"fail"!==Bo(e.callee,r)?[]:Qr(e.arguments[0],!0,r):[]}function Yr(e){if(!i(e))return!1;const t=e.callee.property;return r(t)&&ha.has(t.name)}function Jr(e){return ao(e)||Ln(e)||r(e)&&/(?:fallback|default)/i.test(e.name)}function Gr(e){return s(e,"succeed")&&Jr(a(e))}function Hr(e,t){for(const n of Br(e,Vr(t))){const e=wn(n);if(Gr(e))return e;for(const t of Ur(e))if(Gr(t.argument))return t.argument}}function Zr(e){if(!s(e,"fail"))return!1;const t=a(e);return On(t)&&Ea.has(String(t.value))}function Xr(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;return r(t)&&/(?:Error|Exception)$/.test(t.name)}function eo(e){return!(!n(e)||"ThrowStatement"!==e.type)&&Xr(e.argument)}function to(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)&&On(t.arguments[0])}function no(e){return!(!n(e)||!Array.isArray(e.params))&&e.params.some(e=>r(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&fr(e.typeAnnotation))}function ro(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)&&no(e)}function oo(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return["==","===","!=","!=="].includes(String(t.operator))&&(On(t.left)||On(t.right))&&!Pn(t)}function io(e,t,n){e.report({message:n,node:t})}function ao(e){if(!n(e))return!1;const t=e;return"NullLiteral"===t.type||"Literal"===t.type&&null===t.value}function so(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 co(e){const t=e.options[0];return n(t)?t:{}}function uo(e,t){const n=e[t];return Array.isArray(n)&&n.every(e=>"string"==typeof e)?n:void 0}function lo(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/{2,}/g,"/").replace(/\/$/,"")}function fo(e){return e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,"[^/]*")}function po(e){const t=lo(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+=fo(t)):i+=r?"(?:/.*)?":"(?:/[^/]+)*"}return new RegExp(`${i}$`)}function mo(e,t){return po(t).test(lo(e))}function yo(e){return uo(co(e),"boundaryPaths")??wa}function ho(e){return yo(e).some(t=>mo(e.filename,t))}function go(e){return xa.some(t=>mo(e.filename,t))}function bo(e){return uo(co(e),"configPaths")??Sa}function vo(e){return bo(e).some(t=>mo(e.filename,t))}function Eo(e){return"effect"===e||e.startsWith("effect/")||"@effect-atom/atom-react"===e}function wo(e){if(!(_e(e,"it")||_e(e,"test")||_e(e,"specify")||_e(e,"bench")))return;const t=e.arguments?.at(-1);return _(t)?t:void 0}function xo(e,t){return s(e,"runPromise")||4===t&&n(e)&&s(e.callee,"runPromiseWith")&&void 0!==Te(e,t)?.program}function So(e,t=3){const r=e.body;if(!xo(r,t)&&n(r)&&"BlockStatement"===r.type&&Array.isArray(r.body))for(const e of r.body)if(n(e)&&"ExpressionStatement"===e.type&&xo(e.expression,t))return e.expression}function ko(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 s=i;if(a||!_(s)){t(s)&&r.push(s);for(const[t,n]of Object.entries(s))"parent"!==t&&e(n)}}(e,!0),r}function Ao(e,t=3){if(!n(e)||"MemberExpression"!==e.type||!0===e.computed||!r(e.property,"rejects"))return!1;const o=e.object;if(!_e(o,"expect"))return!1;const i=o.arguments;return!!Array.isArray(i)&&xo(i[0],t)}function Ro(e){return n(e)&&"MemberExpression"===e.type&&!0!==e.computed&&r(e.property,"Default")}function Fo(e){return Qe(e,"Layer","succeed")||Qe(e,"Layer","effect")}function Wo(e){if(!Qe(e,"Layer","provide"))return[];const t=e.arguments;return Array.isArray(t)&&t.some(Ro)?t.filter(Fo):[]}function Do(e){const t=so(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 Co(t,n){return Ti({create(r){let o=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(o=!0)},[t](t){o&&io(r,t,"string"==typeof n?n:n(e(r.options)))}}}})}function jo(t,r,o){return Ti({create(i){const a=e(i.options);let s=!1;const c=[],u=new WeakSet,l=e=>{for(const r of t(e,a))n(r)&&!u.has(r)&&(u.add(r),c.push(r))};return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(s=!0)},...Object.fromEntries(o.map(e=>[e,l])),"Program:exit"(){if(s)for(const e of c)io(i,e,r)}}}})}function Mo(t,n,r=!1,o=!1,i=["CallExpression"]){return Ti({...o?{meta:{schema:ka}}:{},create(a){const s=e(a.options);let c=!1;const u=r?new WeakSet:void 0,l=e=>{const i=!c||o&&ho(a)?void 0:t(e,s,a);if(i)for(const e of r?i:[i])u?.has(e)||(u?.add(e),io(a,e,n(s)))};return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(c=!0)},...Object.fromEntries(i.map(e=>[e,l]))}}})}function To(e,t,n){let r=!1;const o=o=>{if(r)for(const r of fn(o))t(r)&&io(e,r.annotation,n)};return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},ExportNamedDeclaration:o,ExportDefaultDeclaration:o}}function qo(e){return e.startsWith("node:")||dc.has(e)}function Po(e){return n(e)&&("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)}function Io(e){return Po(e)&&r(e.object,"process")&&(!0!==(t=e).computed&&r(t.property,"env")||!0===t.computed&&On(t.property)&&"env"===t.property.value);var t}function Oo(e){if(!Po(e))return!1;if(Io(e.object))return!0;if(!Io(e))return!1;const t=e.parent;return!Po(t)||t.object!==e}function Lo(e){if(!Po(e)||"object"!=typeof e.parent||null===e.parent)return!1;const t=e.parent;return"AssignmentExpression"===t.type&&t.left===e}function No(e){if(!n(e)||"CallExpression"!==e.type||!r(e.callee,"require"))return;const t=e.arguments?.[0];if(!On(t))return;const o=t.value;return pc.has(o)?o:void 0}function zo(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?bc.has(n.name):"catchAll"!==n.name&&bc.has(n.name)||$i.includes(n.name)||"catchNoSuchElement"===n.name)})}function $o(t,n,r,i=!1){return Ti({create:a=>i&&4===e(a.options)?{}:{CallExpression(e){o(e.callee,t,n)&&io(a,e.callee,r)}}})}function Bo(e,t){if(n(e)){if("MemberExpression"===e.type&&!0!==e.computed&&r(e.property)){const n=Bo(e.object,t);return"Effect"===n?e.property.name:"package"===n&&"Effect"===e.property.name?"Effect":void 0}if(r(e)){if(!t.sourceCode?.getScope)return"Effect"===e.name||"pipe"===e.name?e.name:void 0;for(let n=t.sourceCode.getScope(e);n;n=n.upper){const t=n.set.get(e.name);if(!t)continue;const r=t.defs[0];if(1!==t.defs.length||"ImportBinding"!==r?.type)return;const o=r.node,i=r.parent;if("type"===o.importKind||"type"===i.importKind)return;const a=so(i);if("effect"!==a&&"effect/Effect"!==a)return;if("ImportNamespaceSpecifier"===o.type)return"effect"===a?"package":"Effect";if("ImportSpecifier"!==o.type)return;const s=o.imported,c=s.name??s.value;return"string"!=typeof c||"effect/Effect"!==a&&"Effect"!==c&&"pipe"!==c?void 0:c}}}}function Vo(e,t){const n=e.callee;return"CallExpression"===e.type&&("pipe"===Bo(n,t)||"MemberExpression"===n?.type&&!0!==n.computed&&r(n.property,"pipe"))}function Uo(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=e.callee,o=e.arguments,i=Bo(r,t);if(i&&"pipe"!==i)return{name:i,args:o};if(Vo(e,t)){const e=o.at(-1),n=Bo("CallExpression"===e?.type?e.callee:e,t);if(!n)return;return{name:n,args:["pipe"===Bo(r,t)?o[0]:r.object,...e?.arguments??[]]}}if("CallExpression"===r?.type){const e=Bo(r.callee,t);if(e)return{name:e,args:[...o,...r.arguments]}}}function Ko(e,t){const n=e.parent;return"CallExpression"===n?.type&&(n.callee===e||Vo(n,t)&&n.arguments.at(-1)===e)}function _o(e,t){if(Xe(e,t))return!0;if(!n(e)||"ObjectExpression"!==e.type)return!1;const o=e.properties;for(let e=o.length-1;e>=0;e--){const t=o[e],n=t.key;if("SpreadElement"===t.type||t.computed&&"string"!=typeof n?.value)return!1;if(!r(n,"concurrency")&&"concurrency"!==n?.value)continue;const i=t.value;return"number"==typeof i?.value&&i.value>1}return!1}function Qo(e,t){const n=e.parent,o=Bo(n?.callee,t);return"CallExpression"===n?.type&&(["sync","suspend","gen","fn","flatMap","flatMapEager","map","try","tryPromise","promise","forEach","acquireUseRelease"].includes(o??"")||"CallExpression"===n.callee?.type&&"fn"===Bo(n.callee.callee,t)||Po(n.callee)&&r(n.callee.property,"map"))}function Yo(e,t,n){for(let r=e;r;r=r.parent){if(_(r)&&!Qo(r,n))return!1;const e=Uo(r,n);if(e&&ta.has(e.name))return!1;if(r===t){for(let e=t.parent;e&&(!_(e)||Qo(e,n));e=e.parent){const t=Uo(e,n);if(t&&ta.has(t.name))return!1}return!0}}return!0}function Jo(t){return Ti({create(n){const r=[],o=[];return{VariableDeclaration(e){Nt(e).length&&r.push(e)},CallExpression(t){const r=Uo(t,n);if(r&&!Ko(t,n))if("all"===r.name||"forEach"===r.name){const e="all"===r.name?1:2;_o(r.args[e],n)&&o.push(r.args.slice(0,e))}else(3===e(n.options)?["fork"]:["forkChild","forkDetach"]).includes(r.name)&&o.push(r.args[0])},"Program:exit"(){const e=r.flatMap(e=>n.sourceCode.getDeclaredVariables(e).filter(n=>Nt(e).includes(n.name)&&(!t||"module"===n.scope.type||"global"===n.scope.type)));for(const r of o){const o=St(r,e,n);o&&io(n,o,`Rule: avoid ${t?"global mutable concurrency state":"mutating shared state across fibers"}. Why: shared writes couple parallel workers. Fix: use atomic Ref updates or immutable results. Sequential collections stay clean; unknown budgets are not safety proof.`)}}}}})}function Go(e,t=3){if(!n(e)||!Array.isArray(e.arguments))return[];const r=e.arguments,o=s(e,"acquireUseRelease")?2:vi(e,t)?1:s(e,"addFinalizer")?0:Qe(e,"Scope","addFinalizer")||Qe(e,"Scope","addFinalizerExit")?1:-1;return o<0?[]:r.slice(o,4===t||0===o?o+1:void 0)}function Ho(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 Zo(e,t=3){return void 0!==Ho(e,e=>(4===t||_(e))&&Go(e.parent,t).some(t=>t===e))}function Xo(e,t){return Mo((t,n)=>e(t,n)?t:void 0,t,!1,!0)}function ei(e){return Qe(e,"Scope","make")&&Array.isArray(e.arguments)}function ti(e,t){return Qe(e,"Scope","close")&&r(a(e),t)}function ni(e){return Ho(e,e=>au.has(e.type??"")||_(e))}function ri(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 oi(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 ii(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=>ii(e)):[];case"AssignmentPattern":return ii(t.left);case"ObjectPattern":return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(!n(e))return[];const t=e;return"Property"===t.type?ii(t.value):"RestElement"===t.type?ii(t.argument):[]}):[];case"RestElement":return ii(t.argument);case"TSParameterProperty":return ii(t.parameter);default:return[]}}function ai(e){return ie(e.body,t=>n(t)&&si(t).length>0&&fi(t)===e)}function si(e){return"VariableDeclarator"===e.type?ii(e.id):"CatchClause"===e.type?ii(e.param):"ClassDeclaration"!==e.type&&"FunctionDeclaration"!==e.type||!r(e.id)?[]:[e.id]}function ci(e){return"CatchClause"===e.type?ni(e.param):ni(e)}function ui(e,t){if(!r(e))return;let n,o=-1;for(const i of ai(t)){if(!si(i).some(t=>r(t,e.name)))continue;const t=ci(i);if(void 0===t||!ri(e,t))continue;const a=oi(t);a>o&&(n=i,o=a)}return n}function li(e,t){return e===t||n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&e.argument===t}function fi(e){return Ho(e,_)}function pi(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)&&li(t.init,e))return t;if(_(t))return;t=t.parent}}function di(e){const t=pi(e),n=fi(e);if(void 0===t||void 0===n)return!1;const r=t.id.name;return ie(n.body,e=>ti(e,r)&&fi(e)===n&&ui(a(e),n)===t).length>0}function mi(e,t,n){const o=a(e);return!!r(o,t.name)&&void 0===ui(o,n)&&Array.isArray(n.params)&&n.params.some(e=>e===t)}function yi(e){const t=e.arguments;return(s(e,"acquireUseRelease")?t.slice(2):t.slice(1)).some(e=>{if(!_(e))return!1;const t=e.params?.[0];return!!r(t)&&ie(e.body,n=>ti(n,t.name)&&fi(n)===e&&mi(n,t,e)).length>0})}function hi(e,t=3){return void 0!==Ho(e,n=>3===t&&(s(n,"scoped")||Qe(n,"Layer","scoped"))||vi(n,t)&&a(n)===e&&yi(n))||di(e)}function gi(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&&At(o)}function bi(e){return Dt(e)||gi(e)}function vi(e,t=3){return s(e,"acquireRelease")||3===t&&s(e,"acquireReleaseInterruptible")||s(e,"acquireUseRelease")}function Ei(e,t=3){return!!Zo(e,t)||void 0!==Ho(e,e=>vi(e,t)||s(e,"scoped")||3===t&&Qe(e,"Layer","scoped")||ht(e))}function wi(e){return Ho(e,e=>_(e)||"Program"===e.type)}function xi(e,t=3){return ie(e,n=>bi(n)&&wi(n)===e&&!Ei(n,t))}function Si(e){if(!n(e)||!_(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 ki(e){const t=Si(e);return void 0!==t&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function Ai(e,t){return 3===t?fi(e):Ho(e,e=>{if(!_(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=>s(t,n)&&t.arguments.includes(e))})}function Ri(e,t=3){const n=wi(e);if(void 0!==n)return xi(n,t)[0]}function Fi(e,t=3,o){if(!r(e))return;if(4===t){const t=Ho(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=fi(e),a=void 0===i?[]:[i];let s=n(e)?e.parent:void 0;const c=new WeakSet;for(;n(s)&&!c.has(s);){if(c.add(s),"Program"===s.type){a.push(s);break}s=s.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 Wi(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)&&Ai(t,4)===fi(e)),a=void 0!==i(o,re)?o:Fi(o,t,n)??o;return void 0!==i(a,re)&&void 0===i(a,ue)}function Di(e,t){return Object.fromEntries(e.filter(e=>3===t||!Pi.includes(e)).map(e=>[`linteffect/${e}`,qi.includes(e)?["error",{effectVersion:t}]:"error"]))}function Ci(e){return{jsPlugins:yu,rules:e}}function ji(e){const t=Di(["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=Di(["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=Di(["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",...uu,"no-acquire-without-scoped-release"],e),o=Di(["no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release",...du,"no-run-with-open-resource"],e),i=Di(["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=Di(["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),s=Di(["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),c=Di(["no-effect-sync-console","no-atom-registry-effect-sync","no-family-collection-read","no-naked-object-state-update","no-wrapgraphql-catchall"],e),u=Di(["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=Di(["no-error-cause-loss",...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=Di(["no-piped-yield-in-gen","no-gen-for-mapping","prefer-gen-for-workflow",...fu],e),m=Di(["no-large-anonymous-flow","no-effect-in-flow","prefer-named-flow",...pu],e),y=Di(["prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe"],e),h=Di(["no-mixed-pillar-function","no-clever-effect-expression","prefer-extracted-concept"],e),g=Di(["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=Di(["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=Di(["no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method",...cu],e),E=Di(Object.keys(su),e),w=[...cu,...uu,...lu,...fu,...pu,...du,...mu,...l,"no-resource-succeed-escape"],x=Di(Object.keys(su).filter(e=>!w.includes(e)),e),S={reactAndRuntimeBoundaries:t,effectComposition:n,concurrencySafety:r,resourceLifetime:o,pipelineShapeAndSequencing:i,branchingAndLocalControlFlow:a,optionMatchAndDataNormalization:s,atomStateAndPlatformBoundaries:c,domainModeling:u,errorModeling:f,ddd:p,effectFlow:d,pureTransformation:m,behaviorDecoration:y,styleSeparation:h,serviceAndLayerArchitecture:g,platformAndBoundaryHygiene:b,testingObservabilityAndQa:v},k=Ci(x),A={options:{typeAware:!0},jsPlugins:yu,rules:k.rules},R=Ci(t),F=Ci(n),W=Ci(r),D=Ci(o),C=Ci(i),j=Ci(a),M=Ci(s),T=Ci(c),q=Ci(u),P=Ci(f),I=Ci(p),O=Ci(d),L=Ci(m),N=Ci(y),z=Ci(h),$=Ci(g),B=Ci(b),V=Ci(v);return{jsPlugins:yu,reactAndRuntimeBoundariesRules:t,effectCompositionRules:n,concurrencySafetyRules:r,resourceLifetimeRules:o,pipelineShapeAndSequencingRules:i,branchingAndLocalControlFlowRules:a,optionMatchAndDataNormalizationRules:s,atomStateAndPlatformBoundariesRules:c,domainModelingRules:u,errorModelingRules:f,dddRules:p,effectFlowRules:d,pureTransformationRules:m,behaviorDecorationRules:y,styleSeparationRules:h,serviceAndLayerArchitectureRules:g,platformAndBoundaryHygieneRules:b,testingObservabilityAndQaRules:v,allRules:E,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:B,testingObservabilityAndQa:V,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:B,testingObservabilityAndQa:V}}}import{definePlugin as Mi,defineRule as Ti}from"@oxlint/plugins";const qi=["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-error-cause-loss","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"],Pi=["no-runtime-runfork","require-service-accessors","require-service-dependencies","no-effect-async","no-effect-orElse-ladder"],Ii=["flatMap","zipRight","as","tap"],Oi=new Set(["gen","sync","try","tryPromise","fn"]),Li=new Set(["andThen","flatMap","tap","zipRight"]),Ni=new Set(["Date","Runtime","fetch","import","queueMicrotask","require","setInterval","setTimeout"]),zi=new Set(["annotateLogs","as","catchAll","catchSome","catchTag","map","mapBoth","provide","retry","tap","tapError","timeout","timeoutFail","withSpan"]),$i=["catch","catchEager","catchCause","catchDefect","catchIf","catchFilter","catchCauseIf","catchCauseFilter","catchTag","catchTags","catchReason","catchReasons"],Bi=new Set(["andThen","catchAll","catchTag","filterOrFail","flatMap","forEach","map","orElse","tap"]),Vi=new Set([...[...Bi].filter(e=>"catchAll"!==e&&"orElse"!==e),"mapEager","flatMapEager",...$i]),Ui=new Set(["all","allSettled","any","race","reject","resolve"]),Ki=new Set(["all","allSettled","any","race"]),_i=new Set(["timeout","timeoutOption","timeoutOrElse"]),Qi=new Set(["crypto","fs","zlib"]),Yi=new Set(["runCallback","runFork","runPromise","runPromiseExit","runSync","runSyncExit"]),Ji=new Set(["catchAll","catchTag","catchTags","tapError"]),Gi=new Set(["sleep","await","promise","tryPromise","fork","forkDaemon","forkScoped","all","forEach","race","raceAll"]),Hi=new Set(["modifyEffect","modifySomeEffect","updateEffect","updateAndGetEffect"]),Zi=new Set(["make","unsafeMake","makeUnsafe"]),Xi=new Set(["timeout","timeoutOption","timeoutFail","timeoutFailCause","timeoutTo"]),ea=new Set(["race","raceFirst","raceAll","interruptible","scoped"]),ta=new Set(["acquireRelease","acquireUseRelease","ensuring","forkIn","forkScoped","scoped"]),na=new Set(["race","raceAll","raceFirst","raceAllFirst"]),ra=new Set(["retry"]),oa=new Set(["add","clear","delete","pop","push","reverse","set","shift","sort","splice","unshift"]),ia=new Set(["fork","forkScoped","forkDaemon","all","forEach","race","raceFirst","raceAll"]),aa=new Set(["open","connect","create","start","listen","subscribe","acquire"]),sa=new Set(["client","connection","conn","pool","db","database","file","socket","stream","server","subscription","handle"]),ca=new Set(["close","destroy","dispose","cleanup"]),ua=new Set(["all","forEach","fork","race","raceAll"]),la=new Set(["all","forEach","forkChild","forkDetach","forkScoped","forkIn","race","raceAll","raceFirst","raceAllFirst"]),fa=new Set(["await","interrupt","join"]),pa=new Set(["get","set","update","modify","refresh"]),da=["flatMap","map","andThen","tap","zipRight"],ma=new Set(["==","===","!=","!==",">",">=","<","<="]),ya=Ti({create(t){const n=new Set(3===e(t.options)?["mapError","catchAll","catchAllCause"]:["mapError","mapErrorEager","catch","catchEager","catchCause"]),o=new WeakSet;return{CallExpression(e){const i=Bo(e.callee,t);if(!i||!n.has(i))return;const a=e.arguments.at(-1);if(!_(a)||a.async||a.generator)return;const s=a.params[0];if(s&&!r(s))return;const c=t.sourceCode.getDeclaredVariables(a).find(e=>e.identifiers.some(e=>e===s));if(s&&(!c||c.references.some(e=>e.isWrite())))return;const u=new Set(c?.references.map(e=>e.identifier)??[]),l=a.body,f="BlockStatement"===l.type?Ur(l).map(e=>e.argument):[l];for(const e of f)for(const n of Qr(e,i.startsWith("mapError"),t))o.has(n)||n.arguments.some(e=>"erased"!==_r(e,u,t))||(o.add(n),io(t,n,"Rule: preserve the original error when wrapping it. Why: no constructor input visibly retains it. Fix: pass the original as cause or another owned field. Logging is not retention; opaque inputs remain unknown."))}}}}),ha=new Set(["catchSome","catchTag","catchTags","fail","mapBoth","mapError"]),ga=new Set(["catchAll","tapError"]),ba=new Set(["catchAll"]),va=new Set(["catch","catchEager"]),Ea=new Set(["NotFound","Missing","Empty","None"]),wa=["bin/**","scripts/**","cli/**","**/main.ts","app/api/**/route.ts","server/**","*.test.ts","*.spec.ts"],xa=["**/*.test.*","**/*.spec.*","**/__tests__/**"],Sa=["**/config/**","**/*Config.ts","**/*ConfigLayer.ts"],ka=[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}],Aa=new Set(["useState","useReducer","useContext","useCallback","useEffect","useSyncExternalStore"]),Ra=Ti({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&&Aa.has(a)&&io(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.")}}}}),Fa=Co("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."),Wa=Co("SwitchStatement","Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead."),Da=Co("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.`),Ca=Mo(e=>ao(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"]),ja=Mo(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."),Ma=Mo(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"]),Ta=Mo(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."),qa=Ti({create(t){const n=e(t.options);return{ObjectExpression(e){sr(e).some(e=>ar(e,n))&&io(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.`)}}}}),Pa=Mo(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."),Ia=Ti({create(t){const n=e(t.options);return{CallExpression(e){for(const r of E(e,n))io(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).")}}}}),Oa=Ti({create:e=>({CallExpression(t){for(const n of w(t))io(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.")}})}),La=Mo((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."),Na=Mo(e=>s(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."),za=["CallExpression","ClassDeclaration","ClassExpression"],$a=jo(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.",za),Ba=jo((e,t)=>{const n=H(e,t),r=n&&Z(n,t);return[...Ke(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(...).",za),Va=jo((e,t)=>{const n=H(e,t);return[...sn(e).map(e=>on(e.functionNode,e.declaredReturnType)),...n?cn(n,t).map(un):[]].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(...).",[...za,"ExportNamedDeclaration","ExportDefaultDeclaration"]),Ua=Ti({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(!go(t))return;const r=wo(e),i=r&&So(r,n);i&&o.push(i)},"Program:exit"(){if(r)for(const e of o)io(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.")}}}}),Ka=Ti({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(!go(t))return;const r=wo(e);r&&o.push(...ko(r,e=>Ao(e,n)))},"Program:exit"(){if(r)for(const e of o)io(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=Ti({create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},CallExpression(t){go(e)&&n.push(...Wo(t))},"Program:exit"(){if(t)for(const t of n)io(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.")}}}}),Qa=Mo((e,t)=>{const n=S(e,"gen",t);return n?3===t?rr(n.body):ve(n.body,e=>s(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."),Ya=Mo(function(e,t){return S(e,"gen",t)?Ee(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`."),Ja=Mo(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."),Ga=Mo(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."),Ha=Mo(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."),Za=Mo(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."),Xa=Mo(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."),es=Mo(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."),ts=Mo(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."),ns=Mo(function(e,t=3){if(d(e))for(const n of T(e)){if(!(s(n,"flatMap")||4===t&&s(n,"flatMapEager")))continue;const e=n.arguments.find(_);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),c=ie(r,i).length;if(o||a||c>=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."),rs=Mo(function(e,t){if(B(e,t))return V(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)`."),os=Mo(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."),is=Mo(function(e,t){if(!d(e))return;const n=T(e);if(!n.some(e=>B(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."),as=Mo(function(e,t){if(_(e))return K(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"]),ss=Mo(function(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=K(e,t),o=h(e)||void 0!==g(e);return r.size>=2&&(Q(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."),cs=Mo(function(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e;for(const e of t.arguments??[]){if(!n(e)||!_(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."),us=Mo((e,t)=>X(e)||4===t&&s(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."),ls=Ti({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e);r&&o&&ee(o)&&io(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&&$n(o,"make");i&&ee(i)&&io(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.")}}}}),fs=Ti({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(n=!0)},ClassDeclaration(e){const r=G(e);n&&r&&!te(r)&&io(t,r,"Rule: set accessors: true. Fix: add it to Effect.Service options.")}}}}),ps=Ti({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(n=!0)},ClassDeclaration(e){const r=G(e),o=r?ae(r):void 0;n&&o&&io(t,o,"Rule: declare service dependencies.")}}}}),ds=Ti({create:e=>({ImportDeclaration(t){const n=ne(t);n&&io(e,n,"Rule: avoid namespace imports from Effect packages.")}})}),ms=Mo(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"]),ys=Mo(function(e){if(Qe(e,"Layer","provide"))return oe(a(e),t=>t!==e&&Qe(t,"Layer","provide"))},e=>"Rule: prefer Layer.pipe for nested layer provisioning."),hs=Mo(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."),gs=Mo(function(e){if(Qe(e,"Layer","merge"))return e.arguments?.find(t=>oe(t,t=>t!==e&&Qe(t,"Layer","merge")))},e=>"Rule: prefer Layer.mergeAll for infrastructure layer groups."),bs=Ti({create(e){let t=!1,n=0;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},VariableDeclaration(r){const o=t?fe(r):void 0;o&&(n+=1,n>=3&&io(e,o,"Rule: group service layers by concern."))}}}}),vs=Mo(function(e){if(ce(e))return oe(e.body,se)?e:void 0},e=>"Rule: avoid Layer composition inside request handlers.",!1,!1,["FunctionDeclaration"]),Es=Ti({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e),i=o?me(o):void 0;r&&i&&io(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&&io(t,i,"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.")}}}}),ws=Mo(e=>Jn(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."),xs=Ti({create:e=>({CallExpression(t){or(t)&&Xn(t.arguments)&&io(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."),tr(t)&&Zn(t.arguments)&&io(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.")}})}),Ss=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},CallExpression(n){const r=a(n),o=Yn(r);t&&s(n,"sync")&&nr(r)&&!Ne(o)&&io(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.")}}}}),ks=Ti({create(t){const n=3===e(t.options)?"zipRight":"andThen";return{CallExpression(e){s(e,"as")&&Ge(a(e))&&io(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."),s(e,n)&&Ge(a(e))&&io(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.`)}}}}),As=Ti({create:e=>({CallExpression(t){s(t,"all")&&He(t.arguments[0])&&Ze(t.arguments[1])&&io(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."),Ut(t)&&He(a(t.callee.object))&&io(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.")}})}),Rs=Mo(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."),Fs=Mo((e,t)=>we(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.`),Ws=Ti({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(!r)return;const o=Ie(e,n);o&&io(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.`)}}}}),Ds=Mo(function(e,t){if(3===t){if(!s(e,"catchAll"))return;const t=wn(a(e));return Oe(t)?t:void 0}for(const n of Br(e,Vr(t))){const e=wn(n);if(Oe(e,t))return e;for(const n of Ur(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.`),Cs=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&kr(n)&&io(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&&kr(n)&&io(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&&kr(n)&&io(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.")}}}}),js=Ti({meta:{schema:ka},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(r&&!ho(t)){const r=Hr(e,n);r&&io(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.")}}}}}),Ms=Mo(e=>Zr(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.`),Ts=Mo(function(e,t){return Ee(e,t,eo)},()=>"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."),qs=Mo(e=>Nr(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."),Ps=Mo(function(e,t){for(const n of Br(e,Vr(t))){const e=wn(n);if($r(e))return e;for(const t of Ur(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.`),Is=Mo(function(e,t){const n=3===t?Br(e,ga):be(e,t).filter(()=>/^catch/.test(String(e.callee.property.name)));for(const e of n){const n=wn(e),r=3===t?oe:ve,o=r(n,Ye);if(o&&!r(n,e=>Yr(e)||4===t&&(s(e,"failCause")||s(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."),Os=Mo(function(e){return Le(e)?e:d(e)?Kt(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."),Ls=Mo((e,t)=>we(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.`),Ns=Mo(function(e,t){return Ee(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."),zs=Ti({create:e=>({TryStatement(t){io(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.")}})}),$s=Ti({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])Qt(n.init)&&io(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){Yt(t.body)&&io(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.")}})}),Bs=Ti({create:e=>({TSTypeReference(t){(Jt(t,"Effect","Effect")||Jt(t,"Layer","Layer"))&&io(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.")}})}),Vs=Mo(function(e,t){const n=Kt(e);if(0===n.length)return;const r=En(n,t);return r&&(gn(n)||vn(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"}.`),Us=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},ExpressionStatement(n){t&&or(n.expression)&&er(n.expression.arguments)&&io(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.")}}}}),Ks=Mo(function(e){if(!s(e,"sync"))return;const t=wn(a(e));return t?Sn(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."),_s=Ti({create:e=>({CallExpression(t){if(!Qe(t,"Atom","family"))return;const n=Rn(t.arguments);n&&io(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.")}})}),Qs=Mo(function(e){if(d(e))return Kt(e).find(e=>Fn(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.`),Ys=Ti({create(t){const n=3===e(t.options)?"Schema.make` or field `.make":"schema .make";return{CallExpression(e){Mn(e)&&io(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.`)}}}}),Js=Mo(e=>s(e,"succeed")&&Tn(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."),Gs=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&hn(n.typeAnnotation,"Effect","Effect")&&io(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.")}}}}),Hs=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},ExportNamedDeclaration(n){const r=t?pn(n):void 0;r&&io(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?pn(n):void 0;r&&io(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.")}}}}),Zs=Ti({create:e=>To(e,({errorChannel:e})=>Zt(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.")}),Xs=Ti({create:e=>To(e,({errorChannel:e})=>"unknown"===mn(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.")}),ec=Ti({create:e=>To(e,({errorChannel:e})=>yn(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.")}),tc=Ti({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},VariableDeclaration(e){r&&qn(e,n)&&io(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.")}}}}),nc=Ti({create(e){let t=!1,r=!1;const o=[],i=new WeakSet,a=t=>{n(t)&&!i.has(t)&&(i.add(t),io(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=so(e);n&&Eo(n)&&(t=!0)},BinaryExpression(e){t&&Pn(e)&&(r?a(e):o.push(e))},CallExpression(e){if(t&&In(e)){r=!0;for(const e of o)a(e)}}}}}),rc=Mo((e,t)=>zn(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"}.`),oc=Mo(e=>Vn(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."),ic=Ti({create(t){const n=e(t.options);return{CallExpression(e){s(e,"succeed")&&On(a(e))&&io(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.`)}}}}),ac=Ti({create(t){const n=e(t.options);return{VariableDeclaration(e){Un(e)&&io(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.`)}}}}),sc=Mo(e=>cr(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"]),cc=Ti({create(e){let t=!1;const n=n=>{if(t)for(const t of gr(n))io(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=so(e);n&&Eo(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),uc=Mo(e=>oo(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"]),lc=Mo(e=>yr(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"]),fc=Ti({create(e){let t=!1;const n=n=>{if(t)for(const t of Ar(n))io(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=so(e);n&&Eo(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),pc=new Set(["fs","node:fs","fs/promises","node:fs/promises"]),dc=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"]),mc=Ti({meta:{schema:ka},create:e=>({ImportDeclaration(t){const n=so(t);n&&qo(n)&&!ho(e)&&io(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.")}})}),yc=Ti({meta:{schema:[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}},configPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},create:e=>({MemberExpression(t){!Oo(t)||Lo(t)||ho(e)||vo(e)||io(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.")}})}),hc=Ti({create(e){let t=!1,n=0;const r=[];return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0),n&&pc.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=No(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(const{node:t,source:n}of r)io(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.`)}}}}),gc=Ti({meta:{schema:ka},create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){qe(e,n)&&o.push(e)},"Program:exit"(){if(r&&!ho(t))for(const e of o)io(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.")}}}}),bc=new Set(["try","tryPromise","mapError","catchAll","catchTag","catchTags"]),vc=Ti({meta:{schema:ka},create(t){const n=e(t.options);return{TryStatement(e){e.handler&&ho(t)&&!zo(e,n)&&io(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.")}}}}),Ec=Ti({create(t){const n=e(t.options);let r=!1,i=!1;const a=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0),Do(e)&&(i=!0)},CallExpression(e){o(e.callee,"JSON","parse")&&a.push(e)},"Program:exit"(){if(r&&!i)for(const e of a)io(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.")}}}}),wc=Ti({create(t){const n=e(t.options);let r=!1;const o=new WeakSet,i=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(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)io(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.")}}}}),xc=Ti({meta:{schema:ka},create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},NewExpression(e){r(e.callee,"Date")&&n.push(e)},"Program:exit"(){if(t&&!ho(e))for(const t of n)io(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.")}}}}),Sc=Ti({create(e){let t=!1;const n=n=>{if(t)for(const t of Fr(n))io(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=so(e);n&&Eo(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),kc=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},LogicalExpression(n){t&&Dr(n)&&io(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.")}}}}),Ac=Ti({meta:{schema:[{type:"object",properties:{schemaFlagPairs:{type:"array",items:{type:"array",minItems:2,maxItems:2,uniqueItems:!0,items:{type:"string"}}}},additionalProperties:!1}]},create(e){let t=!1;const n=co(e).schemaFlagPairs,r=Array.isArray(n)?n.filter(e=>Array.isArray(e)&&2===e.length&&e.every(e=>"string"==typeof e)&&e[0]!==e[1]):[];return{CallExpression(t){if(0===r.length||!Tr(e,t.callee,"Struct"))return;const n=qr(e,t.arguments[0],r);n&&io(e,t,`Model lifecycle flags ${n.join(" and ")} as a tagged union.`)},ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},LogicalExpression(n){t&&Mr(n)&&io(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.")}}}}),Rc=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},CallExpression(n){t&&Pr(n)&&io(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&&to(n)&&io(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.")}}}}),Fc=Ti({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},FunctionDeclaration(n){t&&ro(n)&&io(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.")}}}}),Wc=Ti({create:e=>({CallExpression(t){o(t.callee,"Effect","as")&&io(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.")}})}),Dc=Ti({create:e=>({MemberExpression(t){o(t,"Effect","Do")&&io(e,t,"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.")}})}),Cc=$o("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."),jc=$o("Runtime","runFork","Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.",!0),Mc=Ti({meta:{schema:ka},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){r&&!ho(t)&&qe(e,n)&&io(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.")}}}}),Tc=$o("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),qc=Ti({create:e=>({CallExpression(t){c(t)&&io(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.")}})}),Pc=Ti({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])c(n.init)&&io(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){c(t.argument)&&io(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.")}})}),Ic=Ti({create(t){const n=e(t.options);return{VariableDeclaration(e){for(const r of e.declarations??[]){const e=f(r.init,n);e&&io(t,r.init,e)}},ReturnStatement(e){const r=f(e.argument,n);r&&io(t,e.argument,r)}}}}),Oc=Ti({create:e=>({CallExpression(t){d(t)&&m(t.arguments)&&io(e,t,"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.")}})}),Lc=Ti({create:e=>({CallExpression(t){u(t)&&io(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.")}})}),Nc=Ti({create:t=>4===e(t.options)?{}:{CallExpression(e){p(e)&&io(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.")}}}),zc=Mo((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."),$c=Ti({create(t){let n=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(n=!0)},ExpressionStatement(r){const o=e(t.options),i=n?rt(r.expression,o):void 0;i&&io(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.")}}}}),Bc=Ti({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&&io(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=so(e);t&&Eo(t)&&(n=!0)},ForStatement:r,ForInStatement:r,ForOfStatement:r,WhileStatement:r,DoWhileStatement:r}}}),Vc=Ti({create:t=>({CallExpression(n){const o=e(t.options),i=Uo(n,t);i&&na.has(i.name)&&(4===o||"raceAllFirst"!==i.name)&&!Ko(n,t)&&ie(i.args.slice(0,"raceAll"===i.name||"raceAllFirst"===i.name?1:2),e=>{if(Dt(e))return!0;if(!gi(e))return!1;const t=e.callee,n=r(t)?t.name:t.property.name;return!/(?:Error|Exception)$/.test(n)}).some(e=>Yo(e,n,t))&&io(t,n,"Rule: require cleanup for visible race acquisitions. Why: interruption cannot release a manually acquired resource. Fix: use acquireRelease/acquireUseRelease or ensuring on its branch. Pure/opaque tasks need no dummy finalizer; syntax is not proof of release.")}})}),Uc=Ti({create(t){let n=!1;const o=new Map,i=new Set,a=new Set;return{ImportDeclaration(e){const t=so(e);t&&Eo(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=zt(n);i&&o.set(i,n)},CallExpression(n){if(4===e(t.options))return;const r=$t(n);r&&i.add(r)},"Program:exit"(){if(n)if(4!==e(t.options))for(const[e,n]of o)i.has(e)||io(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=>Bt(e.identifier)))||io(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.")}}}}),Kc=Mo((e,t,n)=>vt(e,n)?e:void 0,()=>"Rule: avoid unbounded concurrent retry policies. Fix: use finite collection concurrency and bound retry/backoff separately."),_c=Mo(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(s(e,"sync")){const t=wn(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.`),Qc=Mo(function(e,t=3){if(4===t){const n=S(e,"fn",t)??(s(e,"sync")?a(e):void 0);return(n?ve(wn(n),Ae):void 0)??Ee(e,t,Ae)}const n=S(e,"gen");if(n)return Re(n.body);if(s(e,"sync")){const t=wn(a(e));return t?Re(t):void 0}if(!i(e))return;const o=e.callee.property;if(r(o)&&Bi.has(o.name))for(const t of e.arguments){const e=wn(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.`),Yc=Jo(!1),Jc=Mo(function(e,t=3){if(4===t){let t;return[..._i].some(t=>s(e,t))||n(e)&&"CallExpression"===e.type&&[..._i].some(t=>s(e.callee,t))?t=a(e):d(e)&&[..._i].some(t=>s(e.arguments.at(-1),t))&&(t=Ce(e)),s(t,"promise")?Fe(a(t))?void 0:t:s(t,"tryPromise")&&!We(t)?t:void 0}if(!s(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."),Gc=Mo((e,t)=>It(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."),Hc=Mo((e,t)=>Ot(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."),Zc=Jo(!0),Xc=Ti({create(t){let n=!1;const o=[new Set],i=new WeakSet,s=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(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)&&(Qe(e,"Deferred","make")||Qe(e,"Deferred","makeUnsafe"))&&s.push(n))}const i=mt(n);i&&o.at(-1)?.add(i)},CallExpression(s){if(4===e(t.options))return;if(!n||!dt(s))return;const c=a(s);r(c)&&o.at(-1)?.has(c.name)&&(gt(s,c.name)||i.has(s)||(i.add(s),io(t,s,"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 s)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)&&io(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.")}}}}}),eu=Mo((e,t)=>{const n=Wt(e,t);return n?Tt(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),tu=Mo((e,t)=>{const n=st(e,t);return n&&(4===t?Pt(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."),nu=Mo((e,t)=>{const n=ct(e,t);return n&&(3===t?it(n):Pt(wn(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.")),ru=Ti({create:e=>({ImportExpression(t){io(e,t,"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.")}})}),ou=Mo((e,t)=>{if(3===t)return s(e,"forkDaemon")&&!l(a(e),"supervised")?e:void 0;const n=d(e)?e.arguments.at(-1):e?.callee;if(s(e,"forkDetach")){const t=a(e);return!t||r(t,"undefined")||Be(t)?void 0:e}return s(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."}`),iu=Xo((e,t)=>Ft(e)&&!Zo(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."),au=new Set(["BlockStatement","CatchClause","ForInStatement","ForOfStatement","ForStatement","Program","SwitchStatement"]),su={"no-react-state":Ra,"no-if-statement":Fa,"no-switch-statement":Wa,"no-ternary":Da,"no-return-null":Ca,"no-option-as":ja,"no-effect-never":Ma,"no-arrow-ladder":Ta,"no-branch-in-object":qa,"no-iife-wrapper":Pa,"no-return-in-arrow":Ia,"no-return-in-callback":Oa,"no-effect-fn-generator":La,"no-effect-sync-console":Na,"no-console-in-effect-flow":$a,"no-effect-log-without-structured-context":Ba,"require-span-on-public-service-method":Va,"no-runpromise-in-non-async-test-body":Ua,"require-effect-flip-for-error-test":Ka,"no-test-mock-layer-when-default-available":_a,"no-nested-effect-gen":Qa,"no-yield-without-star-in-effect-gen":Ya,"no-piped-yield-in-gen":Ja,"no-gen-for-mapping":Ga,"prefer-gen-for-workflow":Ha,"no-business-logic-in-pipe":ns,"no-large-anonymous-flow":Za,"no-effect-in-flow":Xa,"prefer-named-flow":es,"prefer-flow-for-pure-pipeline":ts,"prefer-pipe-for-behavior":rs,"prefer-decorated-effect-before-gen":os,"no-workflow-in-behavior-pipe":is,"no-mixed-pillar-function":as,"no-clever-effect-expression":ss,"prefer-extracted-concept":cs,"prefer-effect-service":us,"no-layer-provide-in-service-definition":ls,"require-service-accessors":fs,"require-service-dependencies":ps,"no-namespace-effect-import":ds,"no-manual-service-object-export":ms,"no-layer-merge-in-request-handler":vs,"no-service-method-returning-promise":Es,"prefer-layer-pipe":ys,"no-inline-layer-provide-in-program":hs,"prefer-layer-mergeall-for-infrastructure":gs,"no-service-layer-scatter":bs,"no-match-void-branch":ws,"no-json-parse-without-schema":Ec,"no-date-now-in-effect":wc,"no-new-date-in-domain-logic":xc,"no-match-effect-branch":xs,"warn-effect-sync-wrapper":Ss,"no-effect-side-effect-wrapper":ks,"no-effect-all-step-sequencing":As,"no-async-effect-combinator-callback":Rs,"no-throw-in-effect-logic":Fs,"no-or-die-outside-boundary":Ws,"no-swallowed-catch-all":Ds,"no-effect-ignore":Os,"no-try-catch-in-effect-logic":Ls,"no-promise-api-in-effect-logic":Ns,"no-try-catch":zs,"no-effect-wrapper-alias":$s,"no-manual-effect-channels":Bs,"no-wrapgraphql-catchall":Vs,"no-render-side-effects":Us,"no-atom-registry-effect-sync":Ks,"no-family-collection-read":_s,"no-inline-runtime-provide":Qs,"no-naked-object-state-update":Ys,"no-effect-succeed-variable":Js,"no-effect-type-alias":Gs,"no-public-generic-effect-error":Hs,"no-early-catchall-null":js,"no-empty-error-tag":Cs,"no-expected-state-as-error":Ms,"no-exception-domain-error":Ts,"no-effect-fail-error-message":qs,"no-catchall-generic-rethrow":Ps,"no-error-cause-loss":ya,"no-log-only-error-handling":Is,"no-error-as-public-effect-error":Zs,"no-unknown-public-error-channel":Xs,"no-mixed-effect-error-shapes":ec,"no-model-overlay-cast":tc,"no-unknown-boolean-coercion-helper":nc,"no-fromnullable-nullish-coalesce":rc,"no-option-boolean-normalization":oc,"no-string-sentinel-return":ic,"no-string-sentinel-const":ac,"no-raw-domain-id-alias":sc,"no-boolean-domain-flag":cc,"no-magic-domain-string":uc,"no-raw-domain-primitive-params":lc,"no-raw-time-domain-field":fc,"no-hidden-effect-execution":gc,"no-boundary-try-catch-without-effect-map":vc,"no-node-fs-in-effect-code":hc,"no-node-platform-in-shared-code":mc,"no-process-env-direct-read":yc,"no-overloaded-options-object":Sc,"no-domain-logic-in-conditional":kc,"no-implicit-state-machine-object":Ac,"no-adhoc-domain-error":Rc,"no-domain-meaning-by-folder-only":Fc,"no-effect-as":Wc,"no-effect-do":Dc,"no-effect-bind":Cc,"no-runtime-runfork":jc,"no-run-effect-outside-boundary":Mc,"no-effect-async":Tc,"prevent-dynamic-imports":ru,"no-nested-effect-call":qc,"no-effect-ladder":Pc,"no-flatmap-ladder":Ic,"no-pipe-ladder":Oc,"no-call-tower":Lc,"no-effect-orElse-ladder":Nc,"no-unbounded-effect-all":zc,"no-fire-and-forget-fork":$c,"no-fork-in-loop":Bc,"no-race-without-cleanup":Vc,"no-unobserved-fiber":Uc,"no-unbounded-concurrent-retry":Kc,"no-blocking-call-in-effect":_c,"no-promise-concurrency-in-effect":Qc,"no-shared-mutable-state-across-fibers":Yc,"no-timeout-with-noninterruptible-promise":Jc,"no-uninterruptible-concurrent-region":Gc,"no-unbounded-queue-or-pubsub":Hc,"no-global-mutable-concurrency-state":Zc,"no-manual-deferred-coordination":Xc,"no-acquire-without-scoped-release":eu,"no-manual-resource-close":iu,"no-unbound-scope":Xo((e,t)=>ei(e)&&!hi(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":Xo(e=>s(e,"succeed")&&Rt(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":Xo((e,t)=>Dt(e)&&!Ei(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":Mo(function(e,t=3){if(!ki(e)||!n(e))return[];const r=e;return ie(r.body,e=>bi(e)&&Ai(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":Mo(e=>void 0===fi(e)&&gi(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":Mo((e,t)=>qe(e,t)&&void 0!==Ri(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":Mo(function(e,t=3){if(vi(e,t))return ie(e,e=>vi(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":Mo((e,t,n)=>Wi(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":tu,"no-yield-with-held-mutable-ref":nu,"no-unscoped-background-fiber":ou};for(const e of qi){const n=su[e];n.meta={...n.meta,schema:t(Array.isArray(n.meta?.schema)?n.meta.schema:[])}}const cu=["no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available"],uu=["no-manual-deferred-coordination","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],lu=["no-error-cause-loss","no-early-catchall-null","no-empty-error-tag"],fu=["no-business-logic-in-pipe"],pu=["prefer-flow-for-pure-pipeline"],du=["no-request-scoped-long-lived-resource","no-global-resource-singleton","no-nested-acquire-release","no-missing-layer-provision-at-run"],mu=["no-effect-fn-generator","no-manual-effect-channels","no-effect-type-alias"],yu=[{name:"linteffect",specifier:"@opsydyn/oxlint-effect"}],{reactAndRuntimeBoundariesRules:hu,effectCompositionRules:gu,concurrencySafetyRules:bu,resourceLifetimeRules:vu,pipelineShapeAndSequencingRules:Eu,branchingAndLocalControlFlowRules:wu,optionMatchAndDataNormalizationRules:xu,atomStateAndPlatformBoundariesRules:Su,domainModelingRules:ku,errorModelingRules:Au,dddRules:Ru,effectFlowRules:Fu,pureTransformationRules:Wu,behaviorDecorationRules:Du,styleSeparationRules:Cu,serviceAndLayerArchitectureRules:ju,platformAndBoundaryHygieneRules:Mu,testingObservabilityAndQaRules:Tu,allRules:qu,recommendedRules:Pu,ruleGroups:Iu,recommended:Ou,typeAware:Lu,reactAndRuntimeBoundaries:Nu,effectComposition:zu,concurrencySafety:$u,resourceLifetime:Bu,pipelineShapeAndSequencing:Vu,branchingAndLocalControlFlow:Uu,optionMatchAndDataNormalization:Ku,atomStateAndPlatformBoundaries:_u,domainModeling:Qu,errorModeling:Yu,ddd:Ju,effectFlow:Gu,pureTransformation:Hu,behaviorDecoration:Zu,styleSeparation:Xu,serviceAndLayerArchitecture:el,platformAndBoundaryHygiene:tl,testingObservabilityAndQa:nl,presets:rl}=ji(4),ol=ji(3);var il=Mi({meta:{name:"linteffect"},rules:su});export{qu as allRules,_u as atomStateAndPlatformBoundaries,Su as atomStateAndPlatformBoundariesRules,Zu as behaviorDecoration,Du as behaviorDecorationRules,Uu as branchingAndLocalControlFlow,wu as branchingAndLocalControlFlowRules,$u as concurrencySafety,bu as concurrencySafetyRules,Ju as ddd,Ru as dddRules,il as default,Qu as domainModeling,ku as domainModelingRules,ol as effect3,zu as effectComposition,gu as effectCompositionRules,Gu as effectFlow,Fu as effectFlowRules,Yu as errorModeling,Au as errorModelingRules,yu as jsPlugins,Ku as optionMatchAndDataNormalization,xu as optionMatchAndDataNormalizationRules,Vu as pipelineShapeAndSequencing,Eu as pipelineShapeAndSequencingRules,tl as platformAndBoundaryHygiene,Mu as platformAndBoundaryHygieneRules,rl as presets,Hu as pureTransformation,Wu as pureTransformationRules,Nu as reactAndRuntimeBoundaries,hu as reactAndRuntimeBoundariesRules,Ou as recommended,Pu as recommendedRules,Bu as resourceLifetime,vu as resourceLifetimeRules,Iu as ruleGroups,el as serviceAndLayerArchitecture,ju as serviceAndLayerArchitectureRules,Xu as styleSeparation,Cu as styleSeparationRules,nl as testingObservabilityAndQa,Tu as testingObservabilityAndQaRules,Lu 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 s(e,t){return!!i(e)&&r(e.callee.property,t)}function c(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=>s(e,t),n)}function f(e,t){return(s(e,"flatMap")||4===t&&s(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.":s(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(!s(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 E(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 w(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&&s(e.callee,"fn");if(!s(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)&&(Yi.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&&s(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 C(e,t,n=new WeakSet){return void 0!==oe(e,e=>r(e,t),n)}function D(e,t=new WeakSet){return void 0!==oe(e,e=>i(e),t)}function M(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 j(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")||D(o)||C(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?Hi.has(n.name):"flatMapEager"===n.name||"zipRight"!==n.name&&Hi.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 D(e)||W(e,"YieldExpression")||W(e,"AwaitExpression")||O(e)||Ye(e)||C(e,"Promise")||C(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 $(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=N(e);return!(D(e)||W(e,"AwaitExpression")||W(e,"YieldExpression")||C(e,"Promise")||Ye(e)||Gi.has(t??"")||"object"==typeof e.callee&&null!==e.callee&&r(e.callee.object,"console"))}function z(e){if(!$(e))return 0;const t=e;return[t.callee,...t.arguments??[]].filter(e=>!Q(e)).reduce((e,t)=>Math.max(e,z(t)),0)+1}function B(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?Zi.has(o):"catchAll"!==o&&"catchSome"!==o&&"timeoutFail"!==o&&Zi.has(o)||Xi.includes(o)||"timeoutOption"===o||"timeoutOrElse"===o||"catchNoSuchElement"===o}function V(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=>B(e,t))}function K(e,t,r=new Set,i=new WeakSet){if((s(e,"gen")||q(e,t))&&r.add("workflow"),P(e)&&r.add("pure"),B(e,t)&&r.add("behavior"),(_e(e,"Layer")||o(e,"Layer","pipe"))&&r.add("layer"),Array.isArray(e)){for(const n of e)K(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&&K(o,t,r,i);return r}function Q(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 J(e,t=3){return!!o(e,3===t?"Effect":"Context","Service")||!(!n(e)||"CallExpression"!==e.type)&&J(e.callee,t)}function Y(e,t=3){if(!n(e)||"CallExpression"!==e.type)return;const r=e;return J(r.callee,t)?[...r.arguments??[]].reverse().find(e=>n(e)&&"ObjectExpression"===e.type):void 0}function H(e){if(n(e)&&"ClassDeclaration"===e.type)return Y(e.superClass)}function G(e,t){if(3===t)return H(e);const n=e?.type;return Y("ClassDeclaration"===n||"ClassExpression"===n?e.superClass:e,t)}function Z(e,t){return 3===t?zn(e,"effect")??zn(e,"scoped"):zn(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 Kn(zn(e,"accessors"),!0)}function ne(e){if(!Eo(so(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)&&!Q(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&&Q(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(!zn(e,"dependencies"))return oe(zn(e,"effect")??zn(e,"scoped"),re)}function se(e){if(!_e(e,"Layer"))return!1;const t=e.callee.property;return r(t)&&("provide"===t.name||t.name.startsWith("merge"))}function ce(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 s(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(!Q(e))return!1;if(Ht(Xt(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(Q(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 c=Array.isArray(i.arguments)?i.arguments[0]:void 0;if(s(e,"succeed")||s(e,"sync"))return o(c);if(d(e)){const e=i.callee;return o("MemberExpression"===e?.type?e.object:c)}};return o(zn(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&&(Q(e.value)||s(e.value,"fn")))}function he(e){return n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async}function ge(e){return 3===e?ea:ta}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=>Q(e)?[e]:4!==t||"catchTags"!==n.name&&"catchReasons"!==n.name||!Be(e)?[]:e.properties.map(e=>e.value).filter(Q)):[]}function ve(e,t){return oe(e,t,new WeakSet,!0)}function Ee(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(wn(o),n);if(e)return e}}function we(e,t,r){return Ee(e,t,e=>n(e)&&e.type===r)}function xe(e){return _e(e,"Promise")&&na.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)&&ra.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(!s(e,"tryPromise"))return!1;const t=a(e);return!!Fe(t)||Fe(zn(t,"try"))}function Ce(e){return!!s(e,"promise")||s(e,"tryPromise")&&!We(e)}function De(e){return r(e.callee,"pipe")?e.arguments[0]:e.callee.object}function Me(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 ia.has(o)&&i.endsWith("Sync")}function je(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=je(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),Me(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=je(r,t);if(e)return e}}}function Te(e,t){if(i(e)){const t=e.callee.property;if(r(t)&&aa.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 s=o.callee.property;return r(s)&&s.name.endsWith("With")&&aa.has(s.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")||s(e,"orDie")||3===t&&(o(e,"Effect","orDieWith")||s(e,"orDieWith"))}function Ie(e,t){return Pe(e,t)?e:d(e)?Kt(e).find(e=>Pe(e,t)):void 0}function Oe(e,t=3){return s(e,"succeed")||s(e,"asVoid")&&(3===t||Oe(a(e),t))||s(e,"ignore")||Qn(e)}function Le(e){return o(e,"Effect","ignore")||s(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 $e(e){return On(e)||n(e)&&"TemplateLiteral"===e.type}function ze(e){return s(e,"logError")||s(e,"logWarning")}function Be(e){return n(e)&&"ObjectExpression"===e.type}function Ve(e,t){return!!oe(e,e=>s(e,"annotateLogs"))||t.arguments.slice(1).some(e=>Be(e)||!$e(e))}function Ue(e){return ie(e,t=>ze(t)&&$e(a(t))&&!Ve(e,t))}function Ke(e,t=3){if(!i(e))return[];const n=e.callee.property;if(!r(n)||!(3===t?sa.has(n.name):"tapError"===n.name||"catchNoSuchElement"===n.name||Xi.includes(n.name)))return[];const o=e.arguments;return(4===t?o.flatMap(e=>"catchTags"!==n.name&&"catchReasons"!==n.name||!Be(e)?[e]:e.properties.map(e=>e.value).filter(Q)):o).map(wn).filter(e=>void 0!==e)}function Qe(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 Je(e){return _e(e,"Effect")&&e.callee.property.name.startsWith("log")}function Ye(e,t=new WeakSet){return void 0!==oe(e,Ne,t)}function He(e,t=new WeakSet){return void 0!==oe(e,e=>Qe(e,"setState")||_e(e,"Atom","set")||Qe(e,"invalidate")||Je(e)||Ne(e),t)}function Ge(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")||Je(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 s(e,"all")&&Xe(e.arguments[1],t)}function tt(e,t=new WeakSet){return oe(e,e=>s(e,"fork"),t)}function nt(e){if(s(e,"forkChild")||s(e,"forkDetach"))return e;if(n(e)&&"CallExpression"===e.type&&(s(e.callee,"forkChild")||s(e.callee,"forkDetach")))return e;if(!d(e))return;const t=e.arguments?.at(-1);if(s(t,"forkChild")||s(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?s(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)&&ca.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 st(e,t=3){if(4===t&&d(e)){const t=e.arguments.at(-1);return at(t,"withPermit")||at(t,"withPermits")?De(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 ct(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[...ua].some(t=>at(e,t))}function ft(e,t){return o(e,"Effect",t)}function pt(e){return _e(e,"Deferred")&&la.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=wn(e);return void 0!==n&&C(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 c=n(e)?e.parent:void 0;const u=new WeakSet;for(;n(c);){if(u.has(c))return!1;if(u.add(c),i(c)&&(()=>{const e=c.callee.property;return r(e)&&(4===o?oa.has(e.name)||ma.has(e.name)||"interruptible"===e.name||"scoped"===e.name:fa.has(e.name)||pa.has(e.name))})()||(3===o?ht(c):d(c)&&(()=>{const e=c.arguments.at(-1);return[...oa,...ma,"interruptible","scoped"].some(t=>s(e,t)||ft(e,t))})())||4===o&&"CallExpression"===c.type&&i(c.callee)&&(()=>{const e=c.callee.callee.property;return r(e)&&(oa.has(e.name)||ma.has(e.name))})())return!0;if(Q(c)){if(3===o?yt(c,t):a.some(e=>{for(let t=e.identifier.parent;t&&wt(t,c);t=t.parent)if(_e(t,"Effect","addFinalizer")||_e(t,"Scope","addFinalizer"))return!0;return!1}))return!0;if(4===o){const e=c.parent;if(S(e,"gen",4)!==c&&S(e,"fn",4)!==c&&!be(e,4).includes(c))return!1}}c=c.parent}return!1}function bt(e,t){return s(e,"forEach")&&Xe(e.arguments.at(-1),t)}function vt(e,t){return(et(e,t)||bt(e,t))&&ot(e.arguments,ya)}function Et(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 wt(e,t){if(Array.isArray(t))return t.some(t=>wt(e,t));for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function xt(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)&&ha.has(n.property.name)){const e=n.parent;if("CallExpression"===e?.type&&e.callee===n)return e}}function St(e,t,n){for(const r of t){if(r.identifiers.some(t=>wt(t,e)))continue;const t=r.references.map(e=>xt(e.identifier)).find(t=>{if(!t||!wt(t,e))return!1;for(let r=t;r;r=r.parent){if(Array.isArray(e)?e.includes(r):r===e)return!0;if(Q(r)&&!ri(r,n))return!1}return!1});if(t)return t}}function kt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function At(e){return kt(e).some(e=>va.has(e))}function Rt(e){if(r(e))return At(e.name);if(!Ko(e))return!1;const t=e;return!0!==t.computed&&(r(t.property)&&At(t.property.name)||Rt(t.object))}function Ft(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 Ea.has(o.property.name)&&Rt(o.object)}function Wt(e,t=3){if(4===t){const t=d(e)?e.arguments.at(-1):e?.callee,n=e=>[...xa].some(t=>s(e,t)||ft(e,t));return n(e)?e.arguments:n(t)?[...t.arguments??[],...d(e)?[De(e)]:e.arguments]:void 0}if(!i(e))return;const n=e.callee.property;return r(n)&&ga.has(n.name)?e.arguments:void 0}function Ct(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)&&kt(o).some(e=>ba.has(e))&&At(o)}function Dt(e,t){return!!(s(e,"acquireRelease")||s(e,"acquireUseRelease")||s(e,"scoped")||ht(e))||void 0!==t&&yt(e,t)}function Mt(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,Ct)&&yt(e,n.id.name)&&t.add(n.id.name)}return t}function jt(e,t,o=new WeakSet,i=new Set,a=!1,c=3){if(Array.isArray(e)){for(const n of e)jt(n,t,o,i,a,c);return}if(!n(e)||o.has(e))return;if(o.add(e),4===c&&Q(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=>s(t,e))&&!at(t,"map"))return}if(Dt(e))return;const u=Q(e)?new Set([...i,...Mt(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(!Ct(e)||a)for(const[n,r]of Object.entries(e))"parent"!==n&&jt(r,t,o,u,a||p,c);else t.push(e)}function Tt(e,t=3){const n=[];return jt(e,n,void 0,void 0,!1,t),n}function qt(e,t=new WeakSet){return!!ot(e,wa)||!!_e(e,"Queue","take")||(Array.isArray(e)?e.some(e=>qt(e,t)):!!n(e)&&!t.has(e)&&(t.add(e),Object.entries(e).some(([e,n])=>"parent"!==e&&qt(n,t))))}function Pt(e,t=!1){return!!ve(e,e=>{if(_e(e,"Queue","take")||_e(e,"PubSub","take")||[...xa].some(t=>s(e,t)||ft(e,t))||t&&(["sleep","promise","tryPromise"].some(t=>s(e,t))||_e(e,"Deferred","await")))return!0;const n=S(e,"gen",4)??S(e,"fn",4);return!(!n||!Pt(n.body,t))||be(e,4).some(e=>Pt(wn(e),t))})}function It(e,t=3){if(4===t){const t=s(e,"uninterruptible")?a(e):d(e)&&ft(e.arguments.at(-1),"uninterruptible")?De(e):void 0;return void 0!==t&&Pt(t)}return s(e,"uninterruptible")&&qt(e.arguments[0])}function Ot(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(!Be(o))return!1;if(o.properties.some(e=>"SpreadElement"===e.type))return!1;const i=zn(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 Lt(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 Nt(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?Et(e):o.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)&&Lt(e.init)?[t.name]:[]})}function $t(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&s(t.init,"fork")?t.id.name:void 0}function zt(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)&&Sa.has(o.property.name)&&Array.isArray(t.arguments)))return;const[i]=t.arguments;return r(i)?i.name:void 0}function Bt(e){if(!r(e))return!1;const t=e.parent;if(!t)return!1;if("ReturnStatement"===t.type&&t.argument===e)return!0;if(zt(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=>[...Sa].some(t=>o(e,"Fiber",t)))}function Vt(e){return o(e,"Effect","asVoid")||_e(e,"Effect","asVoid")}function Ut(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"))&&s(t.callee.object,"all")&&t.arguments.some(e=>Vt(e))}function Kt(e){if(!n(e)||!d(e))return[];const t=e;return r(t.callee,"pipe")?t.arguments:[t.callee.object,...t.arguments]}function Qt(e){const[t]=Kt(e);return void 0!==t&&D(t)}function _t(e){if(Qt(e))return!0;if(n(e)&&"ArrowFunctionExpression"===e.type){const t=e.body;return i(t)||Qt(t)}return!1}function Jt(e){return b(e).some(e=>n(e)&&(_t(e.argument)||i(e.argument)))}function Yt(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 Ht(e,t){return n(e)&&"TSTypeReference"===e.type&&r(e.typeName,t)}function Gt(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 Zt(e){return r(e,"Error")||Ht(e,"Error")}function Xt(e){if(!n(e))return;const t=e.returnType;return n(t)?t.typeAnnotation??t:void 0}function en(e,t){return Yt(Xt(e),"Effect","Effect")||Yt(t,"Effect","Effect")}function tn(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 nn(e){return tn(e).filter(e=>i(e)||Qt(e))}function rn(e){return s(e,"withSpan")||d(e)&&Kt(e).some(e=>s(e,"withSpan"))}function on(e,t){if(!en(e,t))return;const n=nn(e);return 0===n.length||n.some(e=>!rn(e))?e:void 0}function an(e){if(!n(e))return;const t=e.typeAnnotation;return n(t)?Xt(t.typeAnnotation??t):void 0}function sn(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:an(e.id)}]}):[]}function cn(e,t=3){if(4===t){const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return[];if(r.add(e),Be(e))return[e];if(Q(e))return tn(e).flatMap(o);const i=S(e,"gen",t)??S(e,"fn",t);if(i)return o(i);if(s(e,"succeed")||s(e,"sync")||s(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(zn(e,"make")).flatMap(e=>e.properties.filter(e=>"Property"===e.type&&Q(e.value)).map(e=>e.value))}const r=zn(e,"effect")??zn(e,"scoped"),o=S(r,"gen"),i=o?tn(o).find(Be):s(r,"succeed")&&Be(a(r))?a(r):void 0;if(!i)return[];const c=i.properties;return Array.isArray(c)?c.flatMap(e=>{if(!n(e)||"Property"!==e.type)return[];const t=e.value;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[t]}):[]}function un(e){return nn(e).some(e=>!rn(e))?e:void 0}function ln(e,t){const n=Xt(e)??t;if(!Yt(n,"Effect","Effect"))return;const[,r]=Gt(n);return void 0===r?void 0:{annotation:n,errorChannel:r}}function fn(e){if(!n(e))return[];const t=e;return"ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type?[]:sn(t).flatMap(({functionNode:e,declaredReturnType:t})=>{const n=ln(e,t);return n?[n]:[]})}function pn(e){return fn(e).find(e=>Zt(e.errorChannel))?.annotation}function dn(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 mn(e){const t=dn(e);if(Zt(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 yn(e){const t=dn(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=mn(e);return t?[t]:[]})):new Set}function hn(e,t,n,r=new WeakSet){return void 0!==oe(e,e=>Yt(e,t,n),r)}function gn(e,t=new WeakSet){return void 0!==oe(e,e=>Qe(e,"wrapGraphqlCall"),t)}function bn(e,t){return(s(e,"flatMap")||4===t&&s(e,"flatMapEager"))&&r(a(e),"applyResponse")}function vn(e,t,n=new WeakSet){return void 0!==oe(e,e=>bn(e,t),n)}function En(e,t,n=new WeakSet){return oe(e,e=>i(e)&&Vr(t).has(e.callee.property.name),n)}function wn(e){if(!n(e))return;const t=e;return"ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type?t.body:void 0}function xn(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)&&ka.has(o.property.name)}function Sn(e,t=new WeakSet){return oe(e,xn,t)}function kn(e){return!!r(e)&&/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name)}function An(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 kn(i)?i:void 0}function Rn(e,t=new WeakSet){return An(oe(e,e=>void 0!==An(e),t))}function Fn(e){return s(e,"provide")&&1===e.arguments.length}function Wn(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&"SpreadElement"===e.type,t)}function Cn(e){return!(!_e(e,"Ref","update")&&!_e(e,"Ref","modify"))&&Wn(wn(e.arguments[1]))}function Dn(e){return n(e)&&"ObjectExpression"===e.type&&Array.isArray(e.properties)&&0===e.properties.length}function Mn(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Object","entries"),t)}function jn(e){if(Cn(e))return!0;if(_e(e,"Object","assign")){const t=e.arguments;return t.length>=3&&Dn(t[0])}return _e(e,"Object","fromEntries")?Mn(e.arguments[0]):_e(e,"JSON","stringify")||_e(e,"JSON","parse")}function Tn(e){return!!r(e)||n(e)&&"MemberExpression"===e.type}function qn(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 Pn(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 In(e){return _n(e,"orElse")&&ao(Jn(e.arguments[0]))}function On(e){return n(e)&&("Literal"===e.type||"StringLiteral"===e.type)&&"string"==typeof e.value}function Ln(e){return r(e,"undefined")}function Nn(e){return n(e)&&"LogicalExpression"===e.type&&"??"===e.operator&&(ao(e.right)||Ln(e.right))}function $n(e,t=3){return _e(e,"Option",3===t?"fromNullable":"fromNullishOr")&&Nn(e.arguments[0])}function zn(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 Bn(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return"==="===t.operator&&(Kn(t.left,!0)||Kn(t.right,!0))}function Vn(e){if(!_e(e,"Option","match"))return!1;const t=e.arguments[1],n=zn(t,"onSome"),r=zn(t,"onNone");return Bn(Jn(n))&&Kn(Jn(r),!1)}function Un(e){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>n(e)&&On(e.init))??!1)}function Kn(e,t){return n(e)&&("Literal"===e.type||"BooleanLiteral"===e.type)&&e.value===t}function Qn(e){return o(e,"Effect","void")}function _n(e,t){return _e(e,"Match",t)&&Array.isArray(e.arguments)}function Jn(e){if(n(e)&&"ArrowFunctionExpression"===e.type)return e.body}function Yn(e){if(!_n(e))return!1;const[t,n]=e.arguments;return r(e.callee.property,"when")?(Kn(t,!0)||Kn(t,!1))&&Qn(Jn(n)):r(e.callee.property,"orElse")&&Qn(Jn(t))}function Hn(e){return _e(e,"Stream")}function Gn(e,t=new WeakSet){return void 0!==oe(e,e=>Aa.some(t=>s(e,t))||d(e)||Hn(e),t)}function Zn(e){return D(e)&&Gn(e)}function Xn(e,t=new WeakSet){return void 0!==oe(e,e=>_n(e)&&Zn(r(e.callee.property,"when")?Jn(e.arguments[1]):Jn(e.arguments[0])),t)}function er(e,t=new WeakSet){return void 0!==oe(e,e=>_n(e),t)}function tr(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&o(e.callee,"Option","match")}function nr(e){const t=Jn(e);return n(t)&&"CallExpression"===t.type}function rr(e){return oe(e,e=>s(e,"gen"))}function or(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 ir(e,t){return or(e)||n(e)&&"CallExpression"===e.type&&(o(e.callee,"Option","match")||o(e.callee,3===t?"Either":"Result","match"))}function ar(e,t,n=new WeakSet){return void 0!==oe(e,e=>ir(e,t),n)}function sr(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 cr(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 ur(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 lr(e){if(!n(e))return;const t=e;return"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation?t.typeAnnotation:t}function fr(e){const t=lr(e);return"TSStringKeyword"===t?.type||"TSNumberKeyword"===t?.type}function pr(e){const t=lr(e);return"TSAnyKeyword"===t?.type||"TSObjectKeyword"===t?.type}function dr(e){const t=lr(e);return"TSTypeReference"===t?.type&&r(t.typeName,"Date")}function mr(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)&&fr(e.typeAnnotation)&&t.test(e.name))}function yr(e){return mr(e).length>=3}function hr(e){return!!r(e)&&/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&ur(e.typeAnnotation)}function gr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(hr):[]}function br(e){return r(e)?e.name:n(e)&&"string"==typeof e.value?e.value:void 0}function vr(e){if(!n(e)||"TSPropertySignature"!==e.type)return!1;const t=e,r=br(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)&&(fr(o)||dr(o))}function Er(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 wr(e){return r(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function xr(e){const t=Er(e);return 1===t.length&&"_tag"===br(t[0].key)}function Sr(e){const t=n(e)?e.superTypeArguments:void 0,r=n(t)?t.params??t.arguments:void 0,o=Array.isArray(r)?r:Gt(e);if(0===o.length)return!0;const i=o[0];return n(i)&&("TSObjectKeyword"===i.type||"TSTypeLiteral"===i.type&&0===Er(i).length)}function kr(e){if(!n(e))return;const t=e;return("TSTypeAliasDeclaration"===t.type||"TSInterfaceDeclaration"===t.type)&&wr(t.id)&&xr("TSTypeAliasDeclaration"===t.type?t.typeAnnotation:t)||"ClassDeclaration"===t.type&&_e(t.superClass,"Data","TaggedError")&&Sr(t)?e:void 0}function Ar(e){return Er(e).filter(vr)}function Rr(e){return!!r(e)&&/^(?:opts|options|config)$/i.test(e.name)&&pr(e.typeAnnotation)}function Fr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(Rr):[]}function Wr(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+Wr(n,t),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=e;return"BinaryExpression"===r.type&&Ra.has(String(r.operator))?1:"LogicalExpression"!==r.type?0:Wr(r.left,t)+Wr(r.right,t)}function Cr(e){return n(e)&&"LogicalExpression"===e.type&&Wr(e)>=3}function Dr(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 Mr(e,t=new Map,r=new WeakSet){const o=Dr(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)Mr(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||(Mr(i.left,t,r),Mr(i.right,t,r)),t}function jr(e){return!(!n(e)||"LogicalExpression"!==e.type)&&Array.from(Mr(e).values()).some(e=>e.size>=2)}function Tr(e,t,o){if(!n(t)||"MemberExpression"!==t.type||t.computed||!r(t.property,o)||!r(t.object))return!1;for(let n=e.sourceCode.getScope(t.object);n;n=n.upper){const e=n.set.get(t.object.name);if(!e)continue;const o=e.defs[0];if(1!==e.defs.length||"ImportBinding"!==o?.type)return!1;const i=o.node,a=o.parent;if("type"===i.importKind||"type"===a.importKind)return!1;const s=so(a);return"effect"===s&&"ImportSpecifier"===i.type&&r(i.imported,"Schema")||"effect/Schema"===s&&"ImportNamespaceSpecifier"===i.type}return!1}function qr(e,t,o){if(!n(t)||"ObjectExpression"!==t.type||!Array.isArray(t.properties))return;const i=new Set;for(const o of t.properties){if(!n(o)||"Property"!==o.type||o.computed)return;const t=o.key,a=r(t)?t.name:n(t)&&"Literal"===t.type?t.value:void 0;"string"==typeof a&&(Tr(e,o.value,"Boolean")?i.add(a):i.delete(a))}return o.find(([e,t])=>i.has(e)&&i.has(t))}function Pr(e){return s(e,"fail")&&On(a(e))}function Ir(e){return r(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Or(e){if(!n(e)||"MemberExpression"!==e.type)return!1;const t=e;return!0!==t.computed&&r(t.property,"message")&&Ir(t.object)}function Lr(e){if(Or(e))return!0;if(!n(e))return!1;const t=e;return"BinaryExpression"===t.type&&"+"===t.operator?Lr(t.left)||Lr(t.right):"TemplateLiteral"===t.type&&Array.isArray(t.expressions)&&t.expressions.some(e=>Lr(e))}function Nr(e){return s(e,"fail")&&Lr(a(e))}function $r(e){return n(e)&&"NewExpression"===e.type&&r(e.callee,"Error")}function zr(e){return s(e,"fail")&&$r(a(e))}function Br(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&t.has(n.name)?e.arguments.filter(Q):[]}function Vr(e){return 3===e?Da:Ma}function Ur(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Ur(e,t)):!n(e)||t.has(e)||Q(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:Ur(n,t)))}function Kr(e){for(;n(e)&&["ParenthesizedExpression","TSAsExpression","TSTypeAssertion","TSSatisfiesExpression","TSNonNullExpression"].includes(String(e.type));)e=e.expression;return e}function Qr(e,t,o){if(!n(e=Kr(e)))return"erased";if(t.has(e))return"retained";if(r(e,"undefined")){for(let t=o.sourceCode.getScope(e);t;t=t.upper){const e=t.set.get("undefined");if(e)return e.defs.length?"unknown":"erased"}return"erased"}if("Literal"===e.type||"UnaryExpression"===e.type)return"erased";if("MemberExpression"===e.type){let r=e;for(;n(r)&&"MemberExpression"===r.type;)r=Kr(r.object);return t.has(r)?"erased":"unknown"}const i=[];if("ArrayExpression"===e.type)i.push(...e.elements.map(e=>Qr(e,t,o)));else{if("ObjectExpression"!==e.type)return"unknown";{const n=new Set;for(const a of[...e.properties].reverse()){const e=a.key,s=!0!==a.computed&&r(e)?e.name:e?.value;if("SpreadElement"===a.type||void 0===s){i.push("unknown");break}if(!n.has(String(s))&&(n.add(String(s)),i.push(a.method||a.kind&&"init"!==a.kind?"unknown":Qr(a.value,t,o)),"retained"===i.at(-1)))return"retained"}}}return i.includes("retained")?"retained":i.includes("unknown")?"unknown":"erased"}function _r(e,t,r){return n(e=Kr(e))?"ConditionalExpression"===e.type?[..._r(e.consequent,t,r),..._r(e.alternate,t,r)]:t&&"NewExpression"===e.type?[e]:t||"CallExpression"!==e.type||"fail"!==Zo(e.callee,r)?[]:_r(e.arguments[0],!0,r):[]}function Jr(e){if(!i(e))return!1;const t=e.callee.property;return r(t)&&Wa.has(t.name)}function Yr(e){return ao(e)||Ln(e)||r(e)&&/(?:fallback|default)/i.test(e.name)}function Hr(e){return s(e,"succeed")&&Yr(a(e))}function Gr(e,t){for(const n of Br(e,Vr(t))){const e=wn(n);if(Hr(e))return e;for(const t of Ur(e))if(Hr(t.argument))return t.argument}}function Zr(e){if(!s(e,"fail"))return!1;const t=a(e);return On(t)&&ja.has(String(t.value))}function Xr(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;return r(t)&&/(?:Error|Exception)$/.test(t.name)}function eo(e){return!(!n(e)||"ThrowStatement"!==e.type)&&Xr(e.argument)}function to(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)&&On(t.arguments[0])}function no(e){return!(!n(e)||!Array.isArray(e.params))&&e.params.some(e=>r(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&fr(e.typeAnnotation))}function ro(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)&&no(e)}function oo(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return["==","===","!=","!=="].includes(String(t.operator))&&(On(t.left)||On(t.right))&&!Pn(t)}function io(e,t,n){e.report({message:n,node:t})}function ao(e){if(!n(e))return!1;const t=e;return"NullLiteral"===t.type||"Literal"===t.type&&null===t.value}function so(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 co(e){const t=e.options[0];return n(t)?t:{}}function uo(e,t){const n=e[t];return Array.isArray(n)&&n.every(e=>"string"==typeof e)?n:void 0}function lo(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/{2,}/g,"/").replace(/\/$/,"")}function fo(e){return e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,"[^/]*")}function po(e){const t=lo(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+=fo(t)):i+=r?"(?:/.*)?":"(?:/[^/]+)*"}return new RegExp(`${i}$`)}function mo(e,t){return po(t).test(lo(e))}function yo(e){return uo(co(e),"boundaryPaths")??Ta}function ho(e){return yo(e).some(t=>mo(e.filename,t))}function go(e){return qa.some(t=>mo(e.filename,t))}function bo(e){return uo(co(e),"configPaths")??Pa}function vo(e){return bo(e).some(t=>mo(e.filename,t))}function Eo(e){return"effect"===e||e.startsWith("effect/")||"@effect-atom/atom-react"===e}function wo(e){if(!(Qe(e,"it")||Qe(e,"test")||Qe(e,"specify")||Qe(e,"bench")))return;const t=e.arguments?.at(-1);return Q(t)?t:void 0}function xo(e,t){return s(e,"runPromise")||4===t&&n(e)&&s(e.callee,"runPromiseWith")&&void 0!==Te(e,t)?.program}function So(e,t=3){const r=e.body;if(!xo(r,t)&&n(r)&&"BlockStatement"===r.type&&Array.isArray(r.body))for(const e of r.body)if(n(e)&&"ExpressionStatement"===e.type&&xo(e.expression,t))return e.expression}function ko(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 s=i;if(a||!Q(s)){t(s)&&r.push(s);for(const[t,n]of Object.entries(s))"parent"!==t&&e(n)}}(e,!0),r}function Ao(e,t=3){if(!n(e)||"MemberExpression"!==e.type||!0===e.computed||!r(e.property,"rejects"))return!1;const o=e.object;if(!Qe(o,"expect"))return!1;const i=o.arguments;return!!Array.isArray(i)&&xo(i[0],t)}function Ro(e){return n(e)&&"MemberExpression"===e.type&&!0!==e.computed&&r(e.property,"Default")}function Fo(e){return _e(e,"Layer","succeed")||_e(e,"Layer","effect")}function Wo(e){if(!_e(e,"Layer","provide"))return[];const t=e.arguments;return Array.isArray(t)&&t.some(Ro)?t.filter(Fo):[]}function Co(e){const t=so(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 Do(t,n){return Vi({create(r){let o=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(o=!0)},[t](t){o&&io(r,t,"string"==typeof n?n:n(e(r.options)))}}}})}function Mo(t,r,o){return Vi({create(i){const a=e(i.options);let s=!1;const c=[],u=new WeakSet,l=e=>{for(const r of t(e,a))n(r)&&!u.has(r)&&(u.add(r),c.push(r))};return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(s=!0)},...Object.fromEntries(o.map(e=>[e,l])),"Program:exit"(){if(s)for(const e of c)io(i,e,r)}}}})}function jo(t,n,r=!1,o=!1,i=["CallExpression"]){return Vi({...o?{meta:{schema:Ia}}:{},create(a){const s=e(a.options);let c=!1;const u=r?new WeakSet:void 0,l=e=>{const i=!c||o&&ho(a)?void 0:t(e,s,a);if(i)for(const e of r?i:[i])u?.has(e)||(u?.add(e),io(a,e,n(s)))};return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(c=!0)},...Object.fromEntries(i.map(e=>[e,l]))}}})}function To(e,t){for(let n=t.sourceCode.getScope(e);n;n=n.upper){const t=n.set.get(e.name);if(t)return t}}function qo(e,t){return!t&&r(e)?e.name:n(e)&&On(e)?e.value:void 0}function Po(e,t){if(!r(e))return;const n=To(e,t),o=n?.defs[0];if(1!==n?.defs.length||"ImportBinding"!==o?.type)return;const i=o.node,a=o.parent;if("type"===i.importKind||"type"===a.importKind)return;const s=i.imported;return{source:so(a)??"",name:"ImportNamespaceSpecifier"===i.type?"*":s?.name??s?.value}}function Io(e,t){if(!n(e))return;if("MemberExpression"===e.type&&!e.computed&&r(e.property))return Io(e.object,t)===`package:${e.property.name}`?e.property.name:void 0;const{source:o,name:i}=Po(e,t)??{},a="@effect/ui"===o?"Component":"@effect/ui/html"===o?"Html":void 0;return a?"*"===i?`package:${a}`:i===a?a:void 0:void 0}function Oo(e,t){if(r(e)){const n=To(e,t),o=n?.defs[0];e=1===n?.defs.length&&"Variable"===o?.type&&"VariableDeclaration"===o.parent?.type&&"const"===o.parent.kind&&"VariableDeclarator"===o.node.type&&r(o.node.id)?o.node.init:void 0}if(!n(e)||"CallExpression"!==e.type)return!1;const o=e.callee;return"MemberExpression"===o.type&&!o.computed&&r(o.property)&&("define"===o.property.name&&"Component"===Io(o.object,t)||"component"===o.property.name&&"Html"===Io(o.object,t))}function Lo(e){const t=new Map;if(!n(e)||"ObjectExpression"!==e.type)return t;for(const n of e.properties){const e=qo(n.key,n.computed);if(void 0===e||"init"!==n.kind)return new Map;t.set(e,n.value)}return t}function No(e,t){const n=e=>r(e)&&!To(e,t)?.defs.length,o="MemberExpression"===e.type?oc:"NewExpression"===e.type?ic:rc,i="MemberExpression"===e.type?e:e.callee;if(r(i)&&o.has(i.name)&&n(i))return i.name;if("MemberExpression"!==i.type)return;const a=i.object;if("MemberExpression"===e.type&&r(a)&&o.has(a.name)&&n(a))return a.name;const s=qo(i.property,i.computed);return s&&o.has(s)&&(r(a,"window")||r(a,"globalThis"))&&n(a)?s:void 0}function $o(e,t){const o=e=>{if(!n(e)||"CallExpression"!==e.type)return ac.test(Zo(e,t)??"");const r=Zo(e.callee,t);return r?.endsWith("With")&&ac.test(r.slice(0,-4))},i=e.callee;if(o(i))return e;const a=e.arguments;if(r(i)&&"pipe"===Zo(i,t))return a.slice(1).find(o);if("MemberExpression"!==i.type||i.computed||!r(i.property,"pipe"))return;const s=i.object;return"package"===Zo(s,t)?a.slice(1).find(o):"CallExpression"===s.type&&/^(?:sync|succeed|gen|fail|promise|tryPromise|suspend)$/.test(Zo(s.callee,t)??"")?a.find(o):void 0}function zo(e,t){const n=e=>{const t=lc.exec(e);return t?.[1]??t?.[2]},o=(e,t)=>("Layer"===t?"effect"===e:"@effect/ui"===e)?t:void 0;if("MemberExpression"===e.type&&r(e.property)&&!e.computed){const i=e.object;let a;if("MemberExpression"===i.type&&r(i.property)&&!i.computed){const e=Po(i.object,t);"*"===e?.name&&(a=o(e.source,i.property.name))}else{const e=Po(i,t);e&&(a="*"===e.name?n(e.source):"string"==typeof e.name?o(e.source,e.name):void 0)}return a?`${a}.${e.property.name}`:""}const i=Po(e,t),a=i&&n(i.source);return a&&"*"!==i?.name?`${a}.${i?.name}`:""}function Bo(e,t){if("MemberExpression"!==e.type||e.computed||!r(e.property,"toLayer"))return!1;const n=e.object;let o;if(r(n)){const e=To(n,t),r=e?.defs[0];1===e?.defs.length&&"ClassName"===r?.type&&(o=r.node)}else if("ThisExpression"===n.type){let t=e;for(let e=t.parent;e;t=e,e=t.parent){if(Q(e)||"ClassBody"===e.type)return!1;if("PropertyDefinition"===e.type){e.static&&e.value===t&&(o=e.parent?.parent);break}}}const i=o?.superClass;return"CallExpression"===i?.type&&"CallExpression"===i.callee.type&&!(o?.body).body.some(e=>e.static&&[void 0,"toLayer"].includes(qo(e.key,e.computed)))&&fc.test(zo(i.callee.callee,t))}function Vo(e,t,n){let r=!1;const o=o=>{if(r)for(const r of fn(o))t(r)&&io(e,r.annotation,n)};return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},ExportNamedDeclaration:o,ExportDefaultDeclaration:o}}function Uo(e){return e.startsWith("node:")||Oc.has(e)}function Ko(e){return n(e)&&("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)}function Qo(e){return Ko(e)&&r(e.object,"process")&&(!0!==(t=e).computed&&r(t.property,"env")||!0===t.computed&&On(t.property)&&"env"===t.property.value);var t}function _o(e){if(!Ko(e))return!1;if(Qo(e.object))return!0;if(!Qo(e))return!1;const t=e.parent;return!Ko(t)||t.object!==e}function Jo(e){if(!Ko(e)||"object"!=typeof e.parent||null===e.parent)return!1;const t=e.parent;return"AssignmentExpression"===t.type&&t.left===e}function Yo(e){if(!n(e)||"CallExpression"!==e.type||!r(e.callee,"require"))return;const t=e.arguments?.[0];if(!On(t))return;const o=t.value;return Ic.has(o)?o:void 0}function Ho(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?Bc.has(n.name):"catchAll"!==n.name&&Bc.has(n.name)||Xi.includes(n.name)||"catchNoSuchElement"===n.name)})}function Go(t,n,r,i=!1){return Vi({create:a=>i&&4===e(a.options)?{}:{CallExpression(e){o(e.callee,t,n)&&io(a,e.callee,r)}}})}function Zo(e,t){if(n(e)){if("MemberExpression"===e.type&&!0!==e.computed&&r(e.property)){const n=Zo(e.object,t);return"Effect"===n?e.property.name:"package"===n&&"Effect"===e.property.name?"Effect":void 0}if(r(e)){if(!t.sourceCode?.getScope)return"Effect"===e.name||"pipe"===e.name?e.name:void 0;for(let n=t.sourceCode.getScope(e);n;n=n.upper){const t=n.set.get(e.name);if(!t)continue;const r=t.defs[0];if(1!==t.defs.length||"ImportBinding"!==r?.type)return;const o=r.node,i=r.parent;if("type"===o.importKind||"type"===i.importKind)return;const a=so(i);if("effect"!==a&&"effect/Effect"!==a)return;if("ImportNamespaceSpecifier"===o.type)return"effect"===a?"package":"Effect";if("ImportSpecifier"!==o.type)return;const s=o.imported,c=s.name??s.value;return"string"!=typeof c||"effect/Effect"!==a&&"Effect"!==c&&"pipe"!==c?void 0:c}}}}function Xo(e,t){const n=e.callee;return"CallExpression"===e.type&&("pipe"===Zo(n,t)||"MemberExpression"===n?.type&&!0!==n.computed&&r(n.property,"pipe"))}function ei(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=e.callee,o=e.arguments,i=Zo(r,t);if(i&&"pipe"!==i)return{name:i,args:o};if(Xo(e,t)){const e=o.at(-1),n=Zo("CallExpression"===e?.type?e.callee:e,t);if(!n)return;return{name:n,args:["pipe"===Zo(r,t)?o[0]:r.object,...e?.arguments??[]]}}if("CallExpression"===r?.type){const e=Zo(r.callee,t);if(e)return{name:e,args:[...o,...r.arguments]}}}function ti(e,t){const n=e.parent;return"CallExpression"===n?.type&&(n.callee===e||Xo(n,t)&&n.arguments.at(-1)===e)}function ni(e,t){if(Xe(e,t))return!0;if(!n(e)||"ObjectExpression"!==e.type)return!1;const o=e.properties;for(let e=o.length-1;e>=0;e--){const t=o[e],n=t.key;if("SpreadElement"===t.type||t.computed&&"string"!=typeof n?.value)return!1;if(!r(n,"concurrency")&&"concurrency"!==n?.value)continue;const i=t.value;return"number"==typeof i?.value&&i.value>1}return!1}function ri(e,t){const n=e.parent,o=Zo(n?.callee,t);return"CallExpression"===n?.type&&(["sync","suspend","gen","fn","flatMap","flatMapEager","map","try","tryPromise","promise","forEach","acquireUseRelease"].includes(o??"")||"CallExpression"===n.callee?.type&&"fn"===Zo(n.callee.callee,t)||Ko(n.callee)&&r(n.callee.property,"map"))}function oi(e,t,n){for(let r=e;r;r=r.parent){if(Q(r)&&!ri(r,n))return!1;const e=ei(r,n);if(e&&da.has(e.name))return!1;if(r===t){for(let e=t.parent;e&&(!Q(e)||ri(e,n));e=e.parent){const t=ei(e,n);if(t&&da.has(t.name))return!1}return!0}}return!0}function ii(t){return Vi({create(n){const r=[],o=[];return{VariableDeclaration(e){Nt(e).length&&r.push(e)},CallExpression(t){const r=ei(t,n);if(r&&!ti(t,n))if("all"===r.name||"forEach"===r.name){const e="all"===r.name?1:2;ni(r.args[e],n)&&o.push(r.args.slice(0,e))}else(3===e(n.options)?["fork"]:["forkChild","forkDetach"]).includes(r.name)&&o.push(r.args[0])},"Program:exit"(){const e=r.flatMap(e=>n.sourceCode.getDeclaredVariables(e).filter(n=>Nt(e).includes(n.name)&&(!t||"module"===n.scope.type||"global"===n.scope.type)));for(const r of o){const o=St(r,e,n);o&&io(n,o,`Rule: avoid ${t?"global mutable concurrency state":"mutating shared state across fibers"}. Why: shared writes couple parallel workers. Fix: use atomic Ref updates or immutable results. Sequential collections stay clean; unknown budgets are not safety proof.`)}}}}})}function ai(e,t=3){if(!n(e)||!Array.isArray(e.arguments))return[];const r=e.arguments,o=s(e,"acquireUseRelease")?2:Ci(e,t)?1:s(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 si(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 ci(e,t=3){return void 0!==si(e,e=>(4===t||Q(e))&&ai(e.parent,t).some(t=>t===e))}function ui(e,t){return jo((t,n)=>e(t,n)?t:void 0,t,!1,!0)}function li(e){return _e(e,"Scope","make")&&Array.isArray(e.arguments)}function fi(e,t){return _e(e,"Scope","close")&&r(a(e),t)}function pi(e){return si(e,e=>Du.has(e.type??"")||Q(e))}function di(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 mi(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 yi(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=>yi(e)):[];case"AssignmentPattern":return yi(t.left);case"ObjectPattern":return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(!n(e))return[];const t=e;return"Property"===t.type?yi(t.value):"RestElement"===t.type?yi(t.argument):[]}):[];case"RestElement":return yi(t.argument);case"TSParameterProperty":return yi(t.parameter);default:return[]}}function hi(e){return ie(e.body,t=>n(t)&&gi(t).length>0&&wi(t)===e)}function gi(e){return"VariableDeclarator"===e.type?yi(e.id):"CatchClause"===e.type?yi(e.param):"ClassDeclaration"!==e.type&&"FunctionDeclaration"!==e.type||!r(e.id)?[]:[e.id]}function bi(e){return"CatchClause"===e.type?pi(e.param):pi(e)}function vi(e,t){if(!r(e))return;let n,o=-1;for(const i of hi(t)){if(!gi(i).some(t=>r(t,e.name)))continue;const t=bi(i);if(void 0===t||!di(e,t))continue;const a=mi(t);a>o&&(n=i,o=a)}return n}function Ei(e,t){return e===t||n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&e.argument===t}function wi(e){return si(e,Q)}function xi(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)&&Ei(t.init,e))return t;if(Q(t))return;t=t.parent}}function Si(e){const t=xi(e),n=wi(e);if(void 0===t||void 0===n)return!1;const r=t.id.name;return ie(n.body,e=>fi(e,r)&&wi(e)===n&&vi(a(e),n)===t).length>0}function ki(e,t,n){const o=a(e);return!!r(o,t.name)&&void 0===vi(o,n)&&Array.isArray(n.params)&&n.params.some(e=>e===t)}function Ai(e){const t=e.arguments;return(s(e,"acquireUseRelease")?t.slice(2):t.slice(1)).some(e=>{if(!Q(e))return!1;const t=e.params?.[0];return!!r(t)&&ie(e.body,n=>fi(n,t.name)&&wi(n)===e&&ki(n,t,e)).length>0})}function Ri(e,t=3){return void 0!==si(e,n=>3===t&&(s(n,"scoped")||_e(n,"Layer","scoped"))||Ci(n,t)&&a(n)===e&&Ai(n))||Si(e)}function Fi(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&&At(o)}function Wi(e){return Ct(e)||Fi(e)}function Ci(e,t=3){return s(e,"acquireRelease")||3===t&&s(e,"acquireReleaseInterruptible")||s(e,"acquireUseRelease")}function Di(e,t=3){return!!ci(e,t)||void 0!==si(e,e=>Ci(e,t)||s(e,"scoped")||3===t&&_e(e,"Layer","scoped")||ht(e))}function Mi(e){return si(e,e=>Q(e)||"Program"===e.type)}function ji(e,t=3){return ie(e,n=>Wi(n)&&Mi(n)===e&&!Di(n,t))}function Ti(e){if(!n(e)||!Q(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 qi(e){const t=Ti(e);return void 0!==t&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function Pi(e,t){return 3===t?wi(e):si(e,e=>{if(!Q(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=>s(t,n)&&t.arguments.includes(e))})}function Ii(e,t=3){const n=Mi(e);if(void 0!==n)return ji(n,t)[0]}function Oi(e,t=3,o){if(!r(e))return;if(4===t){const t=si(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=wi(e),a=void 0===i?[]:[i];let s=n(e)?e.parent:void 0;const c=new WeakSet;for(;n(s)&&!c.has(s);){if(c.add(s),"Program"===s.type){a.push(s);break}s=s.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 Li(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)&&Pi(t,4)===wi(e)),a=void 0!==i(o,re)?o:Oi(o,t,n)??o;return void 0!==i(a,re)&&void 0===i(a,ue)}function Ni(e,t){return Object.fromEntries(e.filter(e=>!(3===t?_i:Ki).includes(e)).map(e=>[`linteffect/${e}`,Ui.includes(e)?["error",{effectVersion:t}]:"error"]))}function $i(e){return{jsPlugins:Nu,rules:e}}function zi(e){const t=Ni(["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=Ni(["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=Ni(["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",...Tu,"no-acquire-without-scoped-release"],e),o=Ni(["no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release",...Ou,"no-run-with-open-resource"],e),i=Ni(["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=Ni(["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),s=Ni(["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),c=Ni(["no-effect-sync-console","no-atom-registry-effect-sync","no-family-collection-read","no-naked-object-state-update","no-wrapgraphql-catchall"],e),u=Ni(["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=Ni(["no-error-cause-loss",...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=Ni(["no-piped-yield-in-gen","no-gen-for-mapping","prefer-gen-for-workflow",...Pu],e),m=Ni(["no-large-anonymous-flow","no-effect-in-flow","prefer-named-flow",...Iu],e),y=Ni(["prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe"],e),h=Ni(["no-mixed-pillar-function","no-clever-effect-expression","prefer-extracted-concept"],e),g=Ni(["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=Ni(["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=Ni(["no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method",...ju],e),E=Ni(Object.keys(Mu),e),w=["no-positional-boolean-literal",...Qi,...ju,...Tu,...qu,...Pu,...Iu,...Ou,...Lu,...l,"no-resource-succeed-escape"],x=Ni(Object.keys(Mu).filter(e=>!w.includes(e)),e),S={reactAndRuntimeBoundaries:t,effectComposition:n,concurrencySafety:r,resourceLifetime:o,pipelineShapeAndSequencing:i,branchingAndLocalControlFlow:a,optionMatchAndDataNormalization:s,atomStateAndPlatformBoundaries:c,domainModeling:u,errorModeling:f,ddd:p,effectFlow:d,pureTransformation:m,behaviorDecoration:y,styleSeparation:h,serviceAndLayerArchitecture:g,platformAndBoundaryHygiene:b,testingObservabilityAndQa:v},k=$i(x),A={options:{typeAware:!0},jsPlugins:Nu,rules:k.rules},R=$i(t),F=$i(n),W=$i(r),C=$i(o),D=$i(i),M=$i(a),j=$i(s),T=$i(c),q=$i(u),P=$i(f),I=$i(p),O=$i(d),L=$i(m),N=$i(y),$=$i(h),z=$i(g),B=$i(b),V=$i(v);return{jsPlugins:Nu,reactAndRuntimeBoundariesRules:t,effectCompositionRules:n,concurrencySafetyRules:r,resourceLifetimeRules:o,pipelineShapeAndSequencingRules:i,branchingAndLocalControlFlowRules:a,optionMatchAndDataNormalizationRules:s,atomStateAndPlatformBoundariesRules:c,domainModelingRules:u,errorModelingRules:f,dddRules:p,effectFlowRules:d,pureTransformationRules:m,behaviorDecorationRules:y,styleSeparationRules:h,serviceAndLayerArchitectureRules:g,platformAndBoundaryHygieneRules:b,testingObservabilityAndQaRules:v,allRules:E,recommendedRules:x,ruleGroups:S,recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:C,pipelineShapeAndSequencing:D,branchingAndLocalControlFlow:M,optionMatchAndDataNormalization:j,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:$,serviceAndLayerArchitecture:z,platformAndBoundaryHygiene:B,testingObservabilityAndQa:V,presets:{recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:C,pipelineShapeAndSequencing:D,branchingAndLocalControlFlow:M,optionMatchAndDataNormalization:j,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:$,serviceAndLayerArchitecture:z,platformAndBoundaryHygiene:B,testingObservabilityAndQa:V}}}import{definePlugin as Bi,defineRule as Vi}from"@oxlint/plugins";const Ui=["no-react-state","no-runtime-runfork","no-or-die-outside-boundary","no-inline-runtime-provide","no-effect-ui-io-in-pure-callbacks","no-effect-ui-runtime-escape","no-effect-ui-eager-boundary-io","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-error-cause-loss","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"],Ki=["no-runtime-runfork","require-service-accessors","require-service-dependencies","no-effect-async","no-effect-orElse-ladder"],Qi=["no-effect-ui-io-in-pure-callbacks","no-effect-ui-runtime-escape","no-effect-ui-eager-boundary-io"],_i=Qi,Ji=["flatMap","zipRight","as","tap"],Yi=new Set(["gen","sync","try","tryPromise","fn"]),Hi=new Set(["andThen","flatMap","tap","zipRight"]),Gi=new Set(["Date","Runtime","fetch","import","queueMicrotask","require","setInterval","setTimeout"]),Zi=new Set(["annotateLogs","as","catchAll","catchSome","catchTag","map","mapBoth","provide","retry","tap","tapError","timeout","timeoutFail","withSpan"]),Xi=["catch","catchEager","catchCause","catchDefect","catchIf","catchFilter","catchCauseIf","catchCauseFilter","catchTag","catchTags","catchReason","catchReasons"],ea=new Set(["andThen","catchAll","catchTag","filterOrFail","flatMap","forEach","map","orElse","tap"]),ta=new Set([...[...ea].filter(e=>"catchAll"!==e&&"orElse"!==e),"mapEager","flatMapEager",...Xi]),na=new Set(["all","allSettled","any","race","reject","resolve"]),ra=new Set(["all","allSettled","any","race"]),oa=new Set(["timeout","timeoutOption","timeoutOrElse"]),ia=new Set(["crypto","fs","zlib"]),aa=new Set(["runCallback","runFork","runPromise","runPromiseExit","runSync","runSyncExit"]),sa=new Set(["catchAll","catchTag","catchTags","tapError"]),ca=new Set(["sleep","await","promise","tryPromise","fork","forkDaemon","forkScoped","all","forEach","race","raceAll"]),ua=new Set(["modifyEffect","modifySomeEffect","updateEffect","updateAndGetEffect"]),la=new Set(["make","unsafeMake","makeUnsafe"]),fa=new Set(["timeout","timeoutOption","timeoutFail","timeoutFailCause","timeoutTo"]),pa=new Set(["race","raceFirst","raceAll","interruptible","scoped"]),da=new Set(["acquireRelease","acquireUseRelease","ensuring","forkIn","forkScoped","scoped"]),ma=new Set(["race","raceAll","raceFirst","raceAllFirst"]),ya=new Set(["retry"]),ha=new Set(["add","clear","delete","pop","push","reverse","set","shift","sort","splice","unshift"]),ga=new Set(["fork","forkScoped","forkDaemon","all","forEach","race","raceFirst","raceAll"]),ba=new Set(["open","connect","create","start","listen","subscribe","acquire"]),va=new Set(["client","connection","conn","pool","db","database","file","socket","stream","server","subscription","handle"]),Ea=new Set(["close","destroy","dispose","cleanup"]),wa=new Set(["all","forEach","fork","race","raceAll"]),xa=new Set(["all","forEach","forkChild","forkDetach","forkScoped","forkIn","race","raceAll","raceFirst","raceAllFirst"]),Sa=new Set(["await","interrupt","join"]),ka=new Set(["get","set","update","modify","refresh"]),Aa=["flatMap","map","andThen","tap","zipRight"],Ra=new Set(["==","===","!=","!==",">",">=","<","<="]),Fa=Vi({create(t){const n=new Set(3===e(t.options)?["mapError","catchAll","catchAllCause"]:["mapError","mapErrorEager","catch","catchEager","catchCause"]),o=new WeakSet;return{CallExpression(e){const i=Zo(e.callee,t);if(!i||!n.has(i))return;const a=e.arguments.at(-1);if(!Q(a)||a.async||a.generator)return;const s=a.params[0];if(s&&!r(s))return;const c=t.sourceCode.getDeclaredVariables(a).find(e=>e.identifiers.some(e=>e===s));if(s&&(!c||c.references.some(e=>e.isWrite())))return;const u=new Set(c?.references.map(e=>e.identifier)??[]),l=a.body,f="BlockStatement"===l.type?Ur(l).map(e=>e.argument):[l];for(const e of f)for(const n of _r(e,i.startsWith("mapError"),t))o.has(n)||n.arguments.some(e=>"erased"!==Qr(e,u,t))||(o.add(n),io(t,n,"Rule: preserve the original error when wrapping it. Why: no constructor input visibly retains it. Fix: pass the original as cause or another owned field. Logging is not retention; opaque inputs remain unknown."))}}}}),Wa=new Set(["catchSome","catchTag","catchTags","fail","mapBoth","mapError"]),Ca=new Set(["catchAll","tapError"]),Da=new Set(["catchAll"]),Ma=new Set(["catch","catchEager"]),ja=new Set(["NotFound","Missing","Empty","None"]),Ta=["bin/**","scripts/**","cli/**","**/main.ts","app/api/**/route.ts","server/**","*.test.ts","*.spec.ts"],qa=["**/*.test.*","**/*.spec.*","**/__tests__/**"],Pa=["**/config/**","**/*Config.ts","**/*ConfigLayer.ts"],Ia=[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}],Oa=new Set(["useState","useReducer","useContext","useCallback","useEffect","useSyncExternalStore"]),La=Vi({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&&Oa.has(a)&&io(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.")}}}}),Na=Do("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."),$a=Do("SwitchStatement","Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead."),za=Do("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.`),Ba=jo(e=>ao(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"]),Va=jo(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."),Ua=jo(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"]),Ka=jo(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."),Qa=Vi({create(t){const n=e(t.options);return{ObjectExpression(e){sr(e).some(e=>ar(e,n))&&io(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.`)}}}}),_a=jo(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=Vi({create(t){const n=e(t.options);return{CallExpression(e){for(const r of E(e,n))io(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).")}}}}),Ya=Vi({create:e=>({CallExpression(t){for(const n of w(t))io(e,n,"Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.")}})}),Ha=jo((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."),Ga=jo(e=>s(e,"sync")&&Ye(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."),Za=["CallExpression","ClassDeclaration","ClassExpression"],Xa=Mo(function(e,t=3){if(A(e,t))return ie(e.arguments,Ne);const n=G(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.",Za),es=Mo((e,t)=>{const n=G(e,t),r=n&&Z(n,t);return[...Ke(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(...).",Za),ts=Mo((e,t)=>{const n=G(e,t);return[...sn(e).map(e=>on(e.functionNode,e.declaredReturnType)),...n?cn(n,t).map(un):[]].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(...).",[...Za,"ExportNamedDeclaration","ExportDefaultDeclaration"]),ns=Vi({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(!go(t))return;const r=wo(e),i=r&&So(r,n);i&&o.push(i)},"Program:exit"(){if(r)for(const e of o)io(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.")}}}}),rs=Vi({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(!go(t))return;const r=wo(e);r&&o.push(...ko(r,e=>Ao(e,n)))},"Program:exit"(){if(r)for(const e of o)io(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.")}}}}),os=Vi({create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},CallExpression(t){go(e)&&n.push(...Wo(t))},"Program:exit"(){if(t)for(const t of n)io(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.")}}}}),is=jo((e,t)=>{const n=S(e,"gen",t);return n?3===t?rr(n.body):ve(n.body,e=>s(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."),as=jo(function(e,t){return S(e,"gen",t)?Ee(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`."),ss=jo(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."),cs=jo(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=M(r[0]);return o&&j(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."),us=jo(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."),ls=jo(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."),fs=jo(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."),ps=jo(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."),ds=jo(function(e){if(!(z(e)<3))return $(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."),ms=jo(function(e,t=3){if(d(e))for(const n of T(e)){if(!(s(n,"flatMap")||4===t&&s(n,"flatMapEager")))continue;const e=n.arguments.find(Q);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),c=ie(r,i).length;if(o||a||c>=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."),ys=jo(function(e,t){if(B(e,t))return V(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)`."),hs=jo(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."),gs=jo(function(e,t){if(!d(e))return;const n=T(e);if(!n.some(e=>B(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."),bs=jo(function(e,t){if(Q(e))return K(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"]),vs=jo(function(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=K(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."),Es=jo(function(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e;for(const e of t.arguments??[]){if(!n(e)||!Q(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."),ws=jo((e,t)=>X(e)||4===t&&s(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."),xs=Vi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=H(e);r&&o&&ee(o)&&io(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=Y(e,n),i=o&&zn(o,"make");i&&ee(i)&&io(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.")}}}}),Ss=Vi({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(n=!0)},ClassDeclaration(e){const r=H(e);n&&r&&!te(r)&&io(t,r,"Rule: set accessors: true. Fix: add it to Effect.Service options.")}}}}),ks=Vi({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(n=!0)},ClassDeclaration(e){const r=H(e),o=r?ae(r):void 0;n&&o&&io(t,o,"Rule: declare service dependencies.")}}}}),As=Vi({create:e=>({ImportDeclaration(t){const n=ne(t);n&&io(e,n,"Rule: avoid namespace imports from Effect packages.")}})}),Rs=jo(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"]),Fs=jo(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."),Ws=jo(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."),Cs=jo(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."),Ds=Vi({create(e){let t=!1,n=0;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},VariableDeclaration(r){const o=t?fe(r):void 0;o&&(n+=1,n>=3&&io(e,o,"Rule: group service layers by concern."))}}}}),Ms=jo(function(e){if(ce(e))return oe(e.body,se)?e:void 0},e=>"Rule: avoid Layer composition inside request handlers.",!1,!1,["FunctionDeclaration"]),js=Vi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=H(e),i=o?me(o):void 0;r&&i&&io(t,i,"Rule: return Effect from service methods.")},CallExpression(e){if(3===n||!r)return;const o=Y(e,n),i=o&&me(o,n);i&&io(t,i,"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.")}}}}),Ts=jo(e=>Yn(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."),qs=Vi({create:e=>({CallExpression(t){or(t)&&Xn(t.arguments)&&io(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."),tr(t)&&Zn(t.arguments)&&io(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.")}})}),Ps=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},CallExpression(n){const r=a(n),o=Jn(r);t&&s(n,"sync")&&nr(r)&&!Ne(o)&&io(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.")}}}}),Is=Vi({create(t){const n=3===e(t.options)?"zipRight":"andThen";return{CallExpression(e){s(e,"as")&&He(a(e))&&io(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."),s(e,n)&&He(a(e))&&io(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.`)}}}}),Os=Vi({create:e=>({CallExpression(t){s(t,"all")&&Ge(t.arguments[0])&&Ze(t.arguments[1])&&io(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."),Ut(t)&&Ge(a(t.callee.object))&&io(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.")}})}),Ls=jo(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."),Ns=jo((e,t)=>we(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.`),$s=Vi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(!r)return;const o=Ie(e,n);o&&io(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.`)}}}}),zs=jo(function(e,t){if(3===t){if(!s(e,"catchAll"))return;const t=wn(a(e));return Oe(t)?t:void 0}for(const n of Br(e,Vr(t))){const e=wn(n);if(Oe(e,t))return e;for(const n of Ur(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.`),Bs=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&kr(n)&&io(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&&kr(n)&&io(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&&kr(n)&&io(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.")}}}}),Vs=Vi({meta:{schema:Ia},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){if(r&&!ho(t)){const r=Gr(e,n);r&&io(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.")}}}}}),Us=jo(e=>Zr(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.`),Ks=jo(function(e,t){return Ee(e,t,eo)},()=>"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."),Qs=jo(e=>Nr(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."),_s=jo(function(e,t){for(const n of Br(e,Vr(t))){const e=wn(n);if(zr(e))return e;for(const t of Ur(e))if(zr(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.`),Js=jo(function(e,t){const n=3===t?Br(e,Ca):be(e,t).filter(()=>/^catch/.test(String(e.callee.property.name)));for(const e of n){const n=wn(e),r=3===t?oe:ve,o=r(n,Je);if(o&&!r(n,e=>Jr(e)||4===t&&(s(e,"failCause")||s(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."),Ys=jo(function(e){return Le(e)?e:d(e)?Kt(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."),Hs=jo((e,t)=>we(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.`),Gs=jo(function(e,t){return Ee(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."),Zs=Vi({create:e=>({TryStatement(t){io(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.")}})}),Xs=Vi({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])_t(n.init)&&io(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){Jt(t.body)&&io(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.")}})}),ec=Vi({create:e=>({TSTypeReference(t){(Yt(t,"Effect","Effect")||Yt(t,"Layer","Layer"))&&io(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.")}})}),tc=jo(function(e,t){const n=Kt(e);if(0===n.length)return;const r=En(n,t);return r&&(gn(n)||vn(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=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},ExpressionStatement(n){t&&or(n.expression)&&er(n.expression.arguments)&&io(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.")}}}}),rc=new Set(["fetch","setTimeout","setInterval","requestAnimationFrame","queueMicrotask","addEventListener","removeEventListener"]),oc=new Set(["document","localStorage","sessionStorage"]),ic=new Set(["WebSocket","XMLHttpRequest","EventSource"]),ac=/^run(?:Sync(?:Exit)?|Promise(?:Exit)?|Fork|Callback)$/,sc=t=>Vi({create(o){if(3===e(o.options))return{};if(!o.sourceCode.ast.body.some(e=>"ImportDeclaration"===e.type&&("@effect/ui"===e.source.value||"@effect/ui/html"===e.source.value)))return{};const i=new WeakMap,a=(e,t)=>{n(e)&&Q(e)&&i.set(e,t)},s=e=>{for(let t=e.parent;t;t=t.parent){if(Q(t))return t;if("ClassBody"===t.type)return}},c=e=>{const t=s(e);return t&&i.get(t)},u=e=>{const t=e,n=No(t,o);if(!n)return;const r=c(t);r&&io(o,t,`Rule: keep Effect UI ${r} callbacks pure. Why: ${n} performs unmanaged host work. Fix: describe the work in an owned Command, Subscription, Mount, Query or Layer.`)};return{CallExpression(e){const n=e.callee;if("MemberExpression"===n.type&&!n.computed&&r(n.property)){const t=n.property.name;if(["make","update","view","fragment"].includes(t)&&Oo(n.object,o))if("make"===t){for(const[t,n]of Lo(e.arguments[0]))if(["init","update","view","subscriptions","head"].includes(t)&&a(n,t),"update"===t)for(const e of Lo(n).values())a(e,t)}else a(e.arguments.at(-1),t);else if("on"===t){const t=s(e),c=t&&i.get(t),u=(t?.params)?.[0];if(("view"===c||"fragment"===c)&&r(u)){let t=n.object;for(;"MemberExpression"===t?.type||"CallExpression"===t?.type;)t="MemberExpression"===t.type?t.object:t.callee;const i=To(u,o);i&&r(t)&&To(t,o)===i&&a(e.arguments[1],"event mapper")}}}if(t){const t=c(e),n=t&&$o(e,o);n&&io(o,n,`Rule: keep Effect runtime calls out of Effect UI ${t} callbacks. Why: a direct runner bypasses UI ownership. Fix: describe UI work with $.run(Command) or an owned Subscription, Mount, Query or Layer.`)}else u(e)},...!t&&{NewExpression:u,MemberExpression:u}}}}),cc=sc(!1),uc=sc(!0),lc=/^(?:@effect\/ui\/(Command|Mount|Query|Subscription)|effect\/(Layer))$/,fc=/^(?:Command\.Service|Query\.(?:Service|InfiniteService|StreamService))$/,pc=/^(?:Command\.make|Mount\.make(?:Stream)?|Subscription\.(?:make|direct)|Layer\.(?:(?:succeed|sync|effect)(?:Context)?|effectDiscard))$/,dc=Vi({create(t){if(3===e(t.options)||!t.sourceCode.ast.body.some(e=>"ImportDeclaration"===e.type&&"type"!==e.importKind&&/^@effect\/ui(?:$|\/)/.test(e.source.value)&&e.specifiers.some(e=>"ImportSpecifier"!==e.type||"type"!==e.importKind)))return{};const n=new WeakSet,r=e=>{const r=e;for(let e=r;e;e=e.parent){if(Q(e)||"ClassBody"===e.type)return;if(!n.has(e))continue;const o=No(r,t)||"CallExpression"===r.type&&$o(r,t);return void(o&&io(t,"string"==typeof o?r:o,"Rule: keep Effect UI boundary arguments free of eager I/O. Why: JavaScript evaluates arguments before the boundary can own the work. Fix: move I/O into the managed callback or a lazy Effect."))}};return{CallExpression(e){const o=e.callee,i="CallExpression"===o.type,a=zo(i?o.callee:o,t);if(pc.test(a)||i&&fc.test(a)||Bo(o,t))for(const t of e.arguments)n.add(t);r(e)},NewExpression:r,MemberExpression:r}}}),mc=jo(function(e){if(!s(e,"sync"))return;const t=wn(a(e));return t?Sn(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."),yc=Vi({create:e=>({CallExpression(t){if(!_e(t,"Atom","family"))return;const n=Rn(t.arguments);n&&io(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.")}})}),hc=jo(function(e){if(d(e))return Kt(e).find(e=>Fn(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.`),gc=Vi({create(t){const n=3===e(t.options)?"Schema.make` or field `.make":"schema .make";return{CallExpression(e){jn(e)&&io(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=jo(e=>s(e,"succeed")&&Tn(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."),vc=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&hn(n.typeAnnotation,"Effect","Effect")&&io(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.")}}}}),Ec=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},ExportNamedDeclaration(n){const r=t?pn(n):void 0;r&&io(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?pn(n):void 0;r&&io(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.")}}}}),wc=Vi({create:e=>Vo(e,({errorChannel:e})=>Zt(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.")}),xc=Vi({create:e=>Vo(e,({errorChannel:e})=>"unknown"===mn(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.")}),Sc=Vi({create:e=>Vo(e,({errorChannel:e})=>yn(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.")}),kc=Vi({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},VariableDeclaration(e){r&&qn(e,n)&&io(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.")}}}}),Ac=Vi({create(e){let t=!1,r=!1;const o=[],i=new WeakSet,a=t=>{n(t)&&!i.has(t)&&(i.add(t),io(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=so(e);n&&Eo(n)&&(t=!0)},BinaryExpression(e){t&&Pn(e)&&(r?a(e):o.push(e))},CallExpression(e){if(t&&In(e)){r=!0;for(const e of o)a(e)}}}}}),Rc=jo((e,t)=>$n(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"}.`),Fc=jo(e=>Vn(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."),Wc=Vi({create(t){const n=e(t.options);return{CallExpression(e){s(e,"succeed")&&On(a(e))&&io(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.`)}}}}),Cc=Vi({create(t){const n=e(t.options);return{VariableDeclaration(e){Un(e)&&io(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.`)}}}}),Dc=jo(e=>cr(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"]),Mc=Vi({create(e){const t=t=>{for(const n of t.arguments)"Literal"===n.type&&"boolean"==typeof n.value&&io(e,n,"Avoid positional boolean literals. Use a named option or value, or separate operations for distinct behaviors.")};return{CallExpression:t,NewExpression:t}}}),jc=Vi({create(e){let t=!1;const n=n=>{if(t)for(const t of gr(n))io(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=so(e);n&&Eo(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Tc=jo(e=>oo(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"]),qc=jo(e=>yr(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"]),Pc=Vi({create(e){let t=!1;const n=n=>{if(t)for(const t of Ar(n))io(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=so(e);n&&Eo(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),Ic=new Set(["fs","node:fs","fs/promises","node:fs/promises"]),Oc=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"]),Lc=Vi({meta:{schema:Ia},create:e=>({ImportDeclaration(t){const n=so(t);n&&Uo(n)&&!ho(e)&&io(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.")}})}),Nc=Vi({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)||Jo(t)||ho(e)||vo(e)||io(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.")}})}),$c=Vi({create(e){let t=!1,n=0;const r=[];return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0),n&&Ic.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=Yo(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(const{node:t,source:n}of r)io(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.`)}}}}),zc=Vi({meta:{schema:Ia},create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){qe(e,n)&&o.push(e)},"Program:exit"(){if(r&&!ho(t))for(const e of o)io(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.")}}}}),Bc=new Set(["try","tryPromise","mapError","catchAll","catchTag","catchTags"]),Vc=Vi({meta:{schema:Ia},create(t){const n=e(t.options);return{TryStatement(e){e.handler&&ho(t)&&!Ho(e,n)&&io(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.")}}}}),Uc=Vi({create(t){const n=e(t.options);let r=!1,i=!1;const a=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0),Co(e)&&(i=!0)},CallExpression(e){o(e.callee,"JSON","parse")&&a.push(e)},"Program:exit"(){if(r&&!i)for(const e of a)io(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.")}}}}),Kc=Vi({create(t){const n=e(t.options);let r=!1;const o=new WeakSet,i=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(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)io(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.")}}}}),Qc=Vi({meta:{schema:Ia},create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},NewExpression(e){r(e.callee,"Date")&&n.push(e)},"Program:exit"(){if(t&&!ho(e))for(const t of n)io(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.")}}}}),_c=Vi({create(e){let t=!1;const n=n=>{if(t)for(const t of Fr(n))io(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=so(e);n&&Eo(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Jc=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},LogicalExpression(n){t&&Cr(n)&&io(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.")}}}}),Yc=Vi({meta:{schema:[{type:"object",properties:{schemaFlagPairs:{type:"array",items:{type:"array",minItems:2,maxItems:2,uniqueItems:!0,items:{type:"string"}}}},additionalProperties:!1}]},create(e){let t=!1;const n=co(e).schemaFlagPairs,r=Array.isArray(n)?n.filter(e=>Array.isArray(e)&&2===e.length&&e.every(e=>"string"==typeof e)&&e[0]!==e[1]):[];return{CallExpression(t){if(0===r.length||!Tr(e,t.callee,"Struct"))return;const n=qr(e,t.arguments[0],r);n&&io(e,t,`Model lifecycle flags ${n.join(" and ")} as a tagged union.`)},ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},LogicalExpression(n){t&&jr(n)&&io(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.")}}}}),Hc=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},CallExpression(n){t&&Pr(n)&&io(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&&to(n)&&io(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.")}}}}),Gc=Vi({create(e){let t=!1;return{ImportDeclaration(e){const n=so(e);n&&Eo(n)&&(t=!0)},FunctionDeclaration(n){t&&ro(n)&&io(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.")}}}}),Zc=Vi({create:e=>({CallExpression(t){o(t.callee,"Effect","as")&&io(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.")}})}),Xc=Vi({create:e=>({MemberExpression(t){o(t,"Effect","Do")&&io(e,t,"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.")}})}),eu=Go("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."),tu=Go("Runtime","runFork","Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.",!0),nu=Vi({meta:{schema:Ia},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(r=!0)},CallExpression(e){r&&!ho(t)&&qe(e,n)&&io(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.")}}}}),ru=Go("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),ou=Vi({create:e=>({CallExpression(t){c(t)&&io(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.")}})}),iu=Vi({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])c(n.init)&&io(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){c(t.argument)&&io(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.")}})}),au=Vi({create(t){const n=e(t.options);return{VariableDeclaration(e){for(const r of e.declarations??[]){const e=f(r.init,n);e&&io(t,r.init,e)}},ReturnStatement(e){const r=f(e.argument,n);r&&io(t,e.argument,r)}}}}),su=Vi({create:e=>({CallExpression(t){d(t)&&m(t.arguments)&&io(e,t,"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.")}})}),cu=Vi({create:e=>({CallExpression(t){u(t)&&io(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.")}})}),uu=Vi({create:t=>4===e(t.options)?{}:{CallExpression(e){p(e)&&io(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.")}}}),lu=jo((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."),fu=Vi({create(t){let n=!1;return{ImportDeclaration(e){const t=so(e);t&&Eo(t)&&(n=!0)},ExpressionStatement(r){const o=e(t.options),i=n?rt(r.expression,o):void 0;i&&io(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.")}}}}),pu=Vi({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&&io(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=so(e);t&&Eo(t)&&(n=!0)},ForStatement:r,ForInStatement:r,ForOfStatement:r,WhileStatement:r,DoWhileStatement:r}}}),du=Vi({create:t=>({CallExpression(n){const o=e(t.options),i=ei(n,t);i&&ma.has(i.name)&&(4===o||"raceAllFirst"!==i.name)&&!ti(n,t)&&ie(i.args.slice(0,"raceAll"===i.name||"raceAllFirst"===i.name?1:2),e=>{if(Ct(e))return!0;if(!Fi(e))return!1;const t=e.callee,n=r(t)?t.name:t.property.name;return!/(?:Error|Exception)$/.test(n)}).some(e=>oi(e,n,t))&&io(t,n,"Rule: require cleanup for visible race acquisitions. Why: interruption cannot release a manually acquired resource. Fix: use acquireRelease/acquireUseRelease or ensuring on its branch. Pure/opaque tasks need no dummy finalizer; syntax is not proof of release.")}})}),mu=Vi({create(t){let n=!1;const o=new Map,i=new Set,a=new Set;return{ImportDeclaration(e){const t=so(e);t&&Eo(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=$t(n);i&&o.set(i,n)},CallExpression(n){if(4===e(t.options))return;const r=zt(n);r&&i.add(r)},"Program:exit"(){if(n)if(4!==e(t.options))for(const[e,n]of o)i.has(e)||io(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=>Bt(e.identifier)))||io(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.")}}}}),yu=jo((e,t,n)=>vt(e,n)?e:void 0,()=>"Rule: avoid unbounded concurrent retry policies. Fix: use finite collection concurrency and bound retry/backoff separately."),hu=jo(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0),r=4===t?e=>ve(e,Me):je;if(n)return r(n.body);if(s(e,"sync")){const t=wn(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.`),gu=jo(function(e,t=3){if(4===t){const n=S(e,"fn",t)??(s(e,"sync")?a(e):void 0);return(n?ve(wn(n),Ae):void 0)??Ee(e,t,Ae)}const n=S(e,"gen");if(n)return Re(n.body);if(s(e,"sync")){const t=wn(a(e));return t?Re(t):void 0}if(!i(e))return;const o=e.callee.property;if(r(o)&&ea.has(o.name))for(const t of e.arguments){const e=wn(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.`),bu=ii(!1),vu=jo(function(e,t=3){if(4===t){let t;return[...oa].some(t=>s(e,t))||n(e)&&"CallExpression"===e.type&&[...oa].some(t=>s(e.callee,t))?t=a(e):d(e)&&[...oa].some(t=>s(e.arguments.at(-1),t))&&(t=De(e)),s(t,"promise")?Fe(a(t))?void 0:t:s(t,"tryPromise")&&!We(t)?t:void 0}if(!s(e,"timeout"))return;const r=a(e);return Ce(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."),Eu=jo((e,t)=>It(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."),wu=jo((e,t)=>Ot(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."),xu=ii(!0),Su=Vi({create(t){let n=!1;const o=[new Set],i=new WeakSet,s=[];return{ImportDeclaration(e){const t=so(e);t&&Eo(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"))&&s.push(n))}const i=mt(n);i&&o.at(-1)?.add(i)},CallExpression(s){if(4===e(t.options))return;if(!n||!dt(s))return;const c=a(s);r(c)&&o.at(-1)?.has(c.name)&&(gt(s,c.name)||i.has(s)||(i.add(s),io(t,s,"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 s)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)&&io(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.")}}}}}),ku=jo((e,t)=>{const n=Wt(e,t);return n?Tt(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),Au=jo((e,t)=>{const n=st(e,t);return n&&(4===t?Pt(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."),Ru=jo((e,t)=>{const n=ct(e,t);return n&&(3===t?it(n):Pt(wn(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.")),Fu=Vi({create:e=>({ImportExpression(t){io(e,t,"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.")}})}),Wu=jo((e,t)=>{if(3===t)return s(e,"forkDaemon")&&!l(a(e),"supervised")?e:void 0;const n=d(e)?e.arguments.at(-1):e?.callee;if(s(e,"forkDetach")){const t=a(e);return!t||r(t,"undefined")||Be(t)?void 0:e}return s(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."}`),Cu=ui((e,t)=>Ft(e)&&!ci(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."),Du=new Set(["BlockStatement","CatchClause","ForInStatement","ForOfStatement","ForStatement","Program","SwitchStatement"]),Mu={"no-react-state":La,"no-if-statement":Na,"no-switch-statement":$a,"no-ternary":za,"no-return-null":Ba,"no-option-as":Va,"no-effect-never":Ua,"no-arrow-ladder":Ka,"no-branch-in-object":Qa,"no-iife-wrapper":_a,"no-return-in-arrow":Ja,"no-return-in-callback":Ya,"no-effect-fn-generator":Ha,"no-effect-sync-console":Ga,"no-console-in-effect-flow":Xa,"no-effect-log-without-structured-context":es,"require-span-on-public-service-method":ts,"no-runpromise-in-non-async-test-body":ns,"require-effect-flip-for-error-test":rs,"no-test-mock-layer-when-default-available":os,"no-nested-effect-gen":is,"no-yield-without-star-in-effect-gen":as,"no-piped-yield-in-gen":ss,"no-gen-for-mapping":cs,"prefer-gen-for-workflow":us,"no-business-logic-in-pipe":ms,"no-large-anonymous-flow":ls,"no-effect-in-flow":fs,"prefer-named-flow":ps,"prefer-flow-for-pure-pipeline":ds,"prefer-pipe-for-behavior":ys,"prefer-decorated-effect-before-gen":hs,"no-workflow-in-behavior-pipe":gs,"no-mixed-pillar-function":bs,"no-clever-effect-expression":vs,"prefer-extracted-concept":Es,"prefer-effect-service":ws,"no-layer-provide-in-service-definition":xs,"require-service-accessors":Ss,"require-service-dependencies":ks,"no-namespace-effect-import":As,"no-manual-service-object-export":Rs,"no-layer-merge-in-request-handler":Ms,"no-service-method-returning-promise":js,"prefer-layer-pipe":Fs,"no-inline-layer-provide-in-program":Ws,"prefer-layer-mergeall-for-infrastructure":Cs,"no-service-layer-scatter":Ds,"no-match-void-branch":Ts,"no-json-parse-without-schema":Uc,"no-date-now-in-effect":Kc,"no-new-date-in-domain-logic":Qc,"no-match-effect-branch":qs,"warn-effect-sync-wrapper":Ps,"no-effect-side-effect-wrapper":Is,"no-effect-all-step-sequencing":Os,"no-async-effect-combinator-callback":Ls,"no-throw-in-effect-logic":Ns,"no-or-die-outside-boundary":$s,"no-swallowed-catch-all":zs,"no-effect-ignore":Ys,"no-try-catch-in-effect-logic":Hs,"no-promise-api-in-effect-logic":Gs,"no-try-catch":Zs,"no-effect-wrapper-alias":Xs,"no-manual-effect-channels":ec,"no-wrapgraphql-catchall":tc,"no-render-side-effects":nc,"no-effect-ui-io-in-pure-callbacks":cc,"no-effect-ui-runtime-escape":uc,"no-effect-ui-eager-boundary-io":dc,"no-atom-registry-effect-sync":mc,"no-family-collection-read":yc,"no-inline-runtime-provide":hc,"no-naked-object-state-update":gc,"no-effect-succeed-variable":bc,"no-effect-type-alias":vc,"no-public-generic-effect-error":Ec,"no-early-catchall-null":Vs,"no-empty-error-tag":Bs,"no-expected-state-as-error":Us,"no-exception-domain-error":Ks,"no-effect-fail-error-message":Qs,"no-catchall-generic-rethrow":_s,"no-error-cause-loss":Fa,"no-log-only-error-handling":Js,"no-error-as-public-effect-error":wc,"no-unknown-public-error-channel":xc,"no-mixed-effect-error-shapes":Sc,"no-model-overlay-cast":kc,"no-unknown-boolean-coercion-helper":Ac,"no-fromnullable-nullish-coalesce":Rc,"no-option-boolean-normalization":Fc,"no-string-sentinel-return":Wc,"no-string-sentinel-const":Cc,"no-raw-domain-id-alias":Dc,"no-boolean-domain-flag":jc,"no-positional-boolean-literal":Mc,"no-magic-domain-string":Tc,"no-raw-domain-primitive-params":qc,"no-raw-time-domain-field":Pc,"no-hidden-effect-execution":zc,"no-boundary-try-catch-without-effect-map":Vc,"no-node-fs-in-effect-code":$c,"no-node-platform-in-shared-code":Lc,"no-process-env-direct-read":Nc,"no-overloaded-options-object":_c,"no-domain-logic-in-conditional":Jc,"no-implicit-state-machine-object":Yc,"no-adhoc-domain-error":Hc,"no-domain-meaning-by-folder-only":Gc,"no-effect-as":Zc,"no-effect-do":Xc,"no-effect-bind":eu,"no-runtime-runfork":tu,"no-run-effect-outside-boundary":nu,"no-effect-async":ru,"prevent-dynamic-imports":Fu,"no-nested-effect-call":ou,"no-effect-ladder":iu,"no-flatmap-ladder":au,"no-pipe-ladder":su,"no-call-tower":cu,"no-effect-orElse-ladder":uu,"no-unbounded-effect-all":lu,"no-fire-and-forget-fork":fu,"no-fork-in-loop":pu,"no-race-without-cleanup":du,"no-unobserved-fiber":mu,"no-unbounded-concurrent-retry":yu,"no-blocking-call-in-effect":hu,"no-promise-concurrency-in-effect":gu,"no-shared-mutable-state-across-fibers":bu,"no-timeout-with-noninterruptible-promise":vu,"no-uninterruptible-concurrent-region":Eu,"no-unbounded-queue-or-pubsub":wu,"no-global-mutable-concurrency-state":xu,"no-manual-deferred-coordination":Su,"no-acquire-without-scoped-release":ku,"no-manual-resource-close":Cu,"no-unbound-scope":ui((e,t)=>li(e)&&!Ri(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":ui(e=>s(e,"succeed")&&Rt(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":ui((e,t)=>Ct(e)&&!Di(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":jo(function(e,t=3){if(!qi(e)||!n(e))return[];const r=e;return ie(r.body,e=>Wi(e)&&Pi(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":jo(e=>void 0===wi(e)&&Fi(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":jo((e,t)=>qe(e,t)&&void 0!==Ii(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":jo(function(e,t=3){if(Ci(e,t))return ie(e,e=>Ci(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":jo((e,t,n)=>Li(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":Au,"no-yield-with-held-mutable-ref":Ru,"no-unscoped-background-fiber":Wu};for(const e of Ui){const n=Mu[e];n.meta={...n.meta,schema:t(Array.isArray(n.meta?.schema)?n.meta.schema:[])}}const ju=["no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available"],Tu=["no-manual-deferred-coordination","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],qu=["no-error-cause-loss","no-early-catchall-null","no-empty-error-tag"],Pu=["no-business-logic-in-pipe"],Iu=["prefer-flow-for-pure-pipeline"],Ou=["no-request-scoped-long-lived-resource","no-global-resource-singleton","no-nested-acquire-release","no-missing-layer-provision-at-run"],Lu=["no-effect-fn-generator","no-manual-effect-channels","no-effect-type-alias"],Nu=[{name:"linteffect",specifier:"@opsydyn/oxlint-effect"}],{reactAndRuntimeBoundariesRules:$u,effectCompositionRules:zu,concurrencySafetyRules:Bu,resourceLifetimeRules:Vu,pipelineShapeAndSequencingRules:Uu,branchingAndLocalControlFlowRules:Ku,optionMatchAndDataNormalizationRules:Qu,atomStateAndPlatformBoundariesRules:_u,domainModelingRules:Ju,errorModelingRules:Yu,dddRules:Hu,effectFlowRules:Gu,pureTransformationRules:Zu,behaviorDecorationRules:Xu,styleSeparationRules:el,serviceAndLayerArchitectureRules:tl,platformAndBoundaryHygieneRules:nl,testingObservabilityAndQaRules:rl,allRules:ol,recommendedRules:il,ruleGroups:al,recommended:sl,typeAware:cl,reactAndRuntimeBoundaries:ul,effectComposition:ll,concurrencySafety:fl,resourceLifetime:pl,pipelineShapeAndSequencing:dl,branchingAndLocalControlFlow:ml,optionMatchAndDataNormalization:yl,atomStateAndPlatformBoundaries:hl,domainModeling:gl,errorModeling:bl,ddd:vl,effectFlow:El,pureTransformation:wl,behaviorDecoration:xl,styleSeparation:Sl,serviceAndLayerArchitecture:kl,platformAndBoundaryHygiene:Al,testingObservabilityAndQa:Rl,presets:Fl}=zi(4),Wl=zi(3),Cl=Ni(Qi,4),Dl=$i(Cl);var Ml=Bi({meta:{name:"linteffect"},rules:Mu});export{ol as allRules,hl as atomStateAndPlatformBoundaries,_u as atomStateAndPlatformBoundariesRules,xl as behaviorDecoration,Xu as behaviorDecorationRules,ml as branchingAndLocalControlFlow,Ku as branchingAndLocalControlFlowRules,fl as concurrencySafety,Bu as concurrencySafetyRules,vl as ddd,Hu as dddRules,Ml as default,gl as domainModeling,Ju as domainModelingRules,Wl as effect3,ll as effectComposition,zu as effectCompositionRules,El as effectFlow,Gu as effectFlowRules,Dl as effectUiStrict,Cl as effectUiStrictRules,bl as errorModeling,Yu as errorModelingRules,Nu as jsPlugins,yl as optionMatchAndDataNormalization,Qu as optionMatchAndDataNormalizationRules,dl as pipelineShapeAndSequencing,Uu as pipelineShapeAndSequencingRules,Al as platformAndBoundaryHygiene,nl as platformAndBoundaryHygieneRules,Fl as presets,wl as pureTransformation,Zu as pureTransformationRules,ul as reactAndRuntimeBoundaries,$u as reactAndRuntimeBoundariesRules,sl as recommended,il as recommendedRules,pl as resourceLifetime,Vu as resourceLifetimeRules,al as ruleGroups,kl as serviceAndLayerArchitecture,tl as serviceAndLayerArchitectureRules,Sl as styleSeparation,el as styleSeparationRules,Rl as testingObservabilityAndQa,rl as testingObservabilityAndQaRules,cl as typeAware};
2
2
  //# sourceMappingURL=index.mjs.map