@opsydyn/oxlint-effect 1.0.0 → 2.0.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.
Files changed (44) hide show
  1. package/README.md +458 -80
  2. package/dist/index.d.mts +6596 -279
  3. package/dist/index.mjs +1 -1
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +12 -6
  6. package/skills/oxlint-effect/SKILL.md +114 -0
  7. package/skills/oxlint-effect/assets/contracts.ts +39 -0
  8. package/skills/oxlint-effect/assets/domain-context.bad.ts +18 -0
  9. package/skills/oxlint-effect/assets/domain-context.good.ts +32 -0
  10. package/skills/oxlint-effect/assets/domain-decisions.bad.ts +26 -0
  11. package/skills/oxlint-effect/assets/domain-decisions.good.ts +71 -0
  12. package/skills/oxlint-effect/assets/domain-shapes.bad.ts +22 -0
  13. package/skills/oxlint-effect/assets/domain-shapes.good.ts +39 -0
  14. package/skills/oxlint-effect/assets/domain.bad.ts +16 -0
  15. package/skills/oxlint-effect/assets/domain.good.ts +32 -0
  16. package/skills/oxlint-effect/assets/effect4/contracts.ts +39 -0
  17. package/skills/oxlint-effect/assets/effect4/domain-context.bad.ts +18 -0
  18. package/skills/oxlint-effect/assets/effect4/domain-context.good.ts +32 -0
  19. package/skills/oxlint-effect/assets/effect4/domain-decisions.bad.ts +26 -0
  20. package/skills/oxlint-effect/assets/effect4/domain-decisions.good.ts +71 -0
  21. package/skills/oxlint-effect/assets/effect4/domain-shapes.bad.ts +22 -0
  22. package/skills/oxlint-effect/assets/effect4/domain-shapes.good.ts +39 -0
  23. package/skills/oxlint-effect/assets/effect4/domain.bad.ts +16 -0
  24. package/skills/oxlint-effect/assets/effect4/domain.good.ts +32 -0
  25. package/skills/oxlint-effect/assets/effect4/error-preservation.bad.ts +21 -0
  26. package/skills/oxlint-effect/assets/effect4/error-preservation.good.ts +18 -0
  27. package/skills/oxlint-effect/assets/effect4/expected-state.bad.ts +28 -0
  28. package/skills/oxlint-effect/assets/effect4/expected-state.good.ts +19 -0
  29. package/skills/oxlint-effect/assets/effect4/public-errors.bad.ts +20 -0
  30. package/skills/oxlint-effect/assets/effect4/public-errors.good.ts +33 -0
  31. package/skills/oxlint-effect/assets/error-preservation.bad.ts +21 -0
  32. package/skills/oxlint-effect/assets/error-preservation.good.ts +18 -0
  33. package/skills/oxlint-effect/assets/expected-state.bad.ts +28 -0
  34. package/skills/oxlint-effect/assets/expected-state.good.ts +19 -0
  35. package/skills/oxlint-effect/assets/public-errors.bad.ts +20 -0
  36. package/skills/oxlint-effect/assets/public-errors.good.ts +33 -0
  37. package/skills/oxlint-effect/references/configuration.md +117 -0
  38. package/skills/oxlint-effect/references/domain-context.md +84 -0
  39. package/skills/oxlint-effect/references/domain-decisions.md +93 -0
  40. package/skills/oxlint-effect/references/domain-modeling.md +140 -0
  41. package/skills/oxlint-effect/references/error-preservation.md +76 -0
  42. package/skills/oxlint-effect/references/expected-state.md +78 -0
  43. package/skills/oxlint-effect/references/public-errors.md +80 -0
  44. package/skills/oxlint-effect/references/versioned-rules.md +309 -0
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{definePlugin as e,defineRule as t}from"@oxlint/plugins";function n(e,t){return typeof e==`object`&&!!e&&e.type===`Identifier`&&typeof e.name==`string`&&(t===void 0||e.name===t)}function r(e,t,r){if(typeof e!=`object`||!e)return!1;let i=e;return i.type===`MemberExpression`&&i.computed!==!0&&n(i.object,t)&&n(i.property,r)}function i(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`Effect`)&&n(t.callee.property)}function a(e){return e.arguments[0]}function o(e,t){if(!i(e))return!1;let r=e.callee;return n(r.property,t)}function s(e){if(!i(e))return!1;let t=a(e);return i(t)?i(a(t)):!1}function ee(e){return i(e)?e.arguments.slice(0,2).some(e=>i(e)):!1}function c(e,t,n=new WeakSet){return o(e,t)?!0:Array.isArray(e)?e.some(e=>c(e,t,n)):typeof e!=`object`||!e||n.has(e)?!1:(n.add(e),Object.entries(e).some(([e,r])=>e!==`parent`&&c(r,t,n)))}function te(e){if(o(e,`flatMap`)&&c(e.arguments,`flatMap`))return`Rule: avoid nested Effect.flatMap. Why: it hides sequencing and pushes laddered control flow. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.`;if(o(e,`flatten`)&&c(a(e),`map`))return`Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.`}const ne=[`flatMap`,`zipRight`,`as`,`tap`];function re(e){if(!o(e,`orElse`))return!1;let t=a(e);return ne.some(e=>c(t,e))}function l(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`CallExpression`)return!1;if(n(t.callee,`pipe`))return!0;let r=t.callee;return typeof r==`object`&&!!r&&r.type===`MemberExpression`&&r.computed!==!0&&n(r.property,`pipe`)}function ie(e,t=new WeakSet){return l(e)?!0:Array.isArray(e)?e.some(e=>ie(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ie(n,t)))}function ae(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`ArrowFunctionExpression`}function oe(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&Array.isArray(t.arguments)&&typeof t.callee==`object`&&t.callee!==null&&(t.callee.type===`ArrowFunctionExpression`||t.callee.type===`FunctionExpression`)}function se(e,t=new WeakSet){if(ae(e))return e;if(Array.isArray(e)){for(let n of e){let e=se(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=se(r,t);if(e)return e}}}function u(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>u(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),e.type===`ReturnStatement`?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:u(n,t)))}function ce(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&(r(t.callee,`S`,`filter`)||r(t.callee,`Schema`,`filter`))}function le(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)||ce(t)?[]:t.arguments.flatMap(e=>{if(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`)return[];let t=e.body;return typeof t!=`object`||!t||t.type!==`BlockStatement`?[]:u(t)})}function ue(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)?[]:t.arguments.flatMap(e=>typeof e!=`object`||!e||e.type!==`FunctionExpression`||e.generator===!0?[]:u(e.body))}function de(e){return typeof e==`object`&&!!e&&e.type===`FunctionExpression`&&e.generator===!0}function d(e,t){if(!o(e,t))return;let n=a(e);return de(n)?n:void 0}function fe(e,t){return d(e,t)!==void 0}const pe=new Set([`gen`,`sync`,`try`,`tryPromise`,`fn`]);function me(e){if(i(e)){let t=e.callee.property;if(n(t)&&pe.has(t.name))return!0}if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&o(t.callee,`fn`)}function he(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&r(e.callee,`Date`,`now`)}function ge(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>ge(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),he(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:ge(n,t)))}function _e(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=_e(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`YieldExpression`&&e.delegate!==!0)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=_e(r,t);if(e)return e}}}function ve(e){let t=d(e,`gen`);return t?_e(t.body):void 0}function ye(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>ye(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),e.type===`YieldExpression`&&e.delegate===!0&&l(e.argument)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:ye(n,t)))}function be(e){let t=d(e,`gen`);if(!t)return;let n=ye(t.body);return n.length>=2?n[1]:void 0}function f(e,t,n=new WeakSet){return Array.isArray(e)?e.some(e=>f(e,t,n)):typeof e!=`object`||!e||n.has(e)?!1:(n.add(e),e.type===t?!0:Object.entries(e).some(([e,r])=>e!==`parent`&&f(r,t,n)))}function p(e,t,r=new WeakSet){return n(e,t)?!0:Array.isArray(e)?e.some(e=>p(e,t,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&p(n,t,r)))}function m(e,t=new WeakSet){return i(e)?!0:Array.isArray(e)?e.some(e=>m(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&m(n,t)))}function xe(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return;let t=e.declarations;if(!Array.isArray(t)||t.length!==1)return;let r=t[0];if(!(typeof r!=`object`||!r||r.type!==`VariableDeclarator`||!n(r.id)||typeof r.init!=`object`||r.init===null||r.init.type!==`YieldExpression`||r.init.delegate!==!0))return r.id.name}function Se(e,t){if(typeof e!=`object`||!e||e.type!==`ReturnStatement`)return!1;let r=e.argument;return r!==void 0&&!n(r,t)&&!f(r,`YieldExpression`)&&!f(r,`AwaitExpression`)&&!m(r)&&!p(r,`Promise`)}function Ce(e){let t=d(e,`gen`);if(!t||typeof t.body!=`object`||t.body===null)return;let n=t.body,r=Array.isArray(n.body)?n.body:[];if(r.length!==2)return;let i=xe(r[0]);return i&&Se(r[1],i)?e:void 0}const we=new Set([`andThen`,`flatMap`,`tap`,`zipRight`]);function h(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return[];let t=e,r=Array.isArray(t.arguments)?t.arguments:[];if(n(t.callee,`pipe`))return r.slice(1);let i=t.callee;return typeof i==`object`&&i&&i.type===`MemberExpression`&&i.computed!==!0&&n(i.property,`pipe`)?r:[]}function Te(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&we.has(t.name)}function Ee(e){if(l(e))return h(e).filter(e=>Te(e)).length>=3?e:void 0}function De(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&n(e.callee,`flow`)}function Oe(e){return De(e)&&e.arguments.length>=5}function ke(e,t=new WeakSet){return typeof e==`object`&&e&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`)&&e.async===!0?!0:Array.isArray(e)?e.some(e=>ke(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ke(n,t)))}function Ae(e){return m(e)||f(e,`YieldExpression`)||f(e,`AwaitExpression`)||ke(e)||k(e)||p(e,`Promise`)||p(e,`Runtime`)}function je(e){if(De(e))return e.arguments.find(e=>Ae(e))}function Me(e){if(!(typeof e!=`object`||!e||e.type!==`CallExpression`))return(e.arguments??[]).find(e=>De(e)&&e.arguments.length>=3)}const Ne=new Set([`Date`,`Runtime`,`fetch`,`import`,`queueMicrotask`,`require`,`setInterval`,`setTimeout`]);function Pe(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e.callee;if(n(t))return t.name;if(typeof t==`object`&&t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.property))return t.property.name}function Fe(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=Pe(e);return!m(e)&&!f(e,`AwaitExpression`)&&!f(e,`YieldExpression`)&&!p(e,`Promise`)&&!k(e)&&!Ne.has(t??``)&&!(typeof e.callee==`object`&&e.callee!==null&&n(e.callee.object,`console`))}function Ie(e){if(!Fe(e))return 0;let t=e;return[t.callee,...t.arguments??[]].filter(e=>!v(e)).reduce((e,t)=>Math.max(e,Ie(t)),0)+1}function Le(e){if(!(Ie(e)<3))return Fe(typeof e==`object`&&e?e.parent:void 0)?void 0:e}function Re(e){if(l(e))for(let t of h(e)){if(!o(t,`flatMap`))continue;let e=t.arguments.find(v);if(!e)continue;let n=e.body,r=[`IfStatement`,`SwitchStatement`,`ForStatement`,`ForInStatement`,`ForOfStatement`,`WhileStatement`,`DoWhileStatement`].some(e=>f(n,e)),a=b(n,nt)!==void 0,s=x(n,i).length;if(r||a||s>=2)return e}}const ze=new Set([`annotateLogs`,`as`,`catchAll`,`catchSome`,`catchTag`,`map`,`mapBoth`,`provide`,`retry`,`tap`,`tapError`,`timeout`,`timeoutFail`,`withSpan`]);function g(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&ze.has(t.name)}function Be(e){return i(e)||l(e)}function Ve(e){if(!g(e))return;let t=e.arguments[0];return Be(t)?e:void 0}function He(e){return typeof e!=`object`||!e||e.type!==`YieldExpression`||e.delegate!==!0||!l(e.argument)?!1:h(e.argument).some(e=>g(e))}function Ue(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Ue(e,t)):typeof e!=`object`||!e||t.has(e)?[]:(t.add(e),He(e)?[e]:Object.entries(e).flatMap(([e,n])=>e===`parent`?[]:Ue(n,t)))}function We(e){let t=d(e,`gen`);if(!t)return;let n=Ue(t.body);return n.length>=2?n[1]:void 0}function Ge(e){if(!l(e))return;let t=h(e);if(!t.some(e=>g(e)))return;let n=t.filter(e=>Te(e)).length,r=t.some(e=>f(e,`IfStatement`)||f(e,`SwitchStatement`)||f(e,`ForStatement`)||f(e,`ForInStatement`)||f(e,`ForOfStatement`)||f(e,`WhileStatement`));return n>=2||r?e:void 0}function _(e,t=new Set,n=new WeakSet){if((o(e,`gen`)||Te(e))&&t.add(`workflow`),De(e)&&t.add(`pure`),g(e)&&t.add(`behavior`),(O(e,`Layer`)||r(e,`Layer`,`pipe`))&&t.add(`layer`),Array.isArray(e)){for(let r of e)_(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;n.add(e);for(let[r,i]of Object.entries(e))r!==`parent`&&_(i,t,n);return t}function v(e){return typeof e==`object`&&!!e&&(e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`)}function Ke(e){if(!v(e))return;let t=e.body;return _(t).size>=3?e:void 0}function qe(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,qe(n,t)),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=Object.entries(e).reduce((e,[n,r])=>n===`parent`?e:Math.max(e,qe(r,t)),0);return e.type===`CallExpression`?n+1:n}function Je(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=_(e),n=oe(e)||se(e)!==void 0;return t.size>=2&&(qe(e)>=4||n)?e:void 0}function Ye(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;for(let e of t.arguments??[]){if(typeof e!=`object`||!e||!v(e))continue;let t=e.body;if(typeof t==`object`&&t&&t.type===`BlockStatement`&&Array.isArray(t.body)&&t.body.length>=3)return e}}function Xe(e){return r(e,`Effect`,`Service`)?!0:typeof e!=`object`||!e||e.type!==`CallExpression`?!1:Xe(e.callee)}function Ze(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Xe(t.callee))return[...t.arguments??[]].reverse().find(e=>typeof e==`object`&&!!e&&e.type===`ObjectExpression`)}function y(e){if(!(typeof e!=`object`||!e||e.type!==`ClassDeclaration`))return Ze(e.superClass)}function Qe(e){return O(e,`Context`,`Tag`)||O(e,`Context`,`GenericTag`)}function $e(e,t=new WeakSet){return O(e,`Layer`,`provide`)?!0:Array.isArray(e)?e.some(e=>$e(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&$e(n,t)))}function et(e){return R(L(e,`accessors`),!0)}function tt(e){if(!J(G(e)??``))return;let t=typeof e==`object`&&e?e.specifiers:void 0;return Array.isArray(t)?t.find(e=>typeof e==`object`&&!!e&&e.type===`ImportNamespaceSpecifier`):void 0}function nt(e){return typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&n(e.argument)&&e.argument.name.endsWith(`Service`)}function b(e,t,n=new WeakSet){if(t(e))return e;if(Array.isArray(e)){for(let r of e){let e=b(r,t,n);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!n.has(e)){n.add(e);for(let[r,i]of Object.entries(e)){if(r===`parent`)continue;let e=b(i,t,n);if(e)return e}}}function x(e,t,n=new WeakSet){let r=t(e)?[e]:[];return Array.isArray(e)?e.flatMap(e=>x(e,t,n)).concat(r):typeof e!=`object`||!e||n.has(e)?r:(n.add(e),Object.entries(e).reduce((e,[r,i])=>r===`parent`?e:e.concat(x(i,t,n)),r))}function rt(e){if(!L(e,`dependencies`))return b(L(e,`effect`)??L(e,`scoped`),nt)}function it(e){if(!O(e,`Layer`))return!1;let t=e.callee.property;return n(t)&&(t.name===`provide`||t.name.startsWith(`merge`))}function at(e){if(typeof e!=`object`||!e||e.type!==`FunctionDeclaration`)return!1;let t=e.id;return n(t)&&/(handler|route|request)$/i.test(t.name)}function ot(e){if(at(e))return b(e.body,it)?e:void 0}function st(e){if(O(e,`Layer`,`provide`))return b(a(e),t=>t!==e&&O(t,`Layer`,`provide`))}function ct(e){return o(e,`provide`)||O(e,`Layer`,`provide`)}function lt(e){let t=d(e,`gen`);return t?b(t.body,ct):void 0}function ut(e){if(O(e,`Layer`,`merge`))return e.arguments?.find(t=>b(t,t=>t!==e&&O(t,`Layer`,`merge`)))}function dt(e){return n(e)&&/(Layer|Live)$/.test(e.name)}function ft(e){if(!(typeof e!=`object`||!e||e.type!==`VariableDeclaration`))return e.declarations?.find(e=>typeof e==`object`&&!!e&&dt(e.id)&&b(e.init,ct))}function pt(e){return v(e)?ur(pr(e),`Promise`)||C(e.body)!==void 0:!1}function mt(e){return typeof e==`object`&&!!e&&e.type===`Property`&&pt(e.value)}function ht(e){return b(e,mt)}function gt(e){if(typeof e!=`object`||!e||e.type!==`ObjectExpression`)return!1;let t=e.properties;return Array.isArray(t)&&t.some(e=>typeof e==`object`&&!!e&&e.type===`Property`&&(v(e.value)||o(e.value,`fn`)))}function _t(e){if(typeof e!=`object`||!e)return;let t=e.declaration;if(!(typeof t!=`object`||!t)&&t.type===`VariableDeclaration`){for(let e of t.declarations??[])if(typeof e==`object`&&e&&n(e.id)&&e.id.name.endsWith(`Service`)&&gt(e.init))return e}}function vt(e){return typeof e==`object`&&!!e&&(e.type===`ArrowFunctionExpression`||e.type===`FunctionExpression`)&&e.async===!0}const S=new Set([`andThen`,`catchAll`,`catchTag`,`filterOrFail`,`flatMap`,`forEach`,`map`,`orElse`,`tap`]);function yt(e){if(!i(e))return;let t=e.callee.property;if(!(!n(t)||!S.has(t.name)))return e.arguments.find(e=>vt(e))}function bt(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=bt(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`ThrowStatement`)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=bt(r,t);if(e)return e}}}function xt(e){let t=d(e,`gen`);if(t)return bt(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=F(t),n=e?bt(e):void 0;if(n)return n}}function St(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=St(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),e.type===`TryStatement`)return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=St(r,t);if(e)return e}}}function Ct(e){let t=d(e,`gen`);if(t)return St(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=F(t),n=e?St(e):void 0;if(n)return n}}function wt(e){return O(e,`Promise`,`all`)||O(e,`Promise`,`allSettled`)||O(e,`Promise`,`any`)||O(e,`Promise`,`race`)||O(e,`Promise`,`reject`)||O(e,`Promise`,`resolve`)}function Tt(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;return typeof t==`object`&&!!t&&t.type===`MemberExpression`&&t.computed!==!0&&(n(t.property,`then`)||n(t.property,`catch`)||n(t.property,`finally`))}function C(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=C(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),wt(e)||Tt(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=C(r,t);if(e)return e}}}function Et(e){let t=d(e,`gen`);if(t)return C(t.body);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=F(t),n=e?C(e):void 0;if(n)return n}}const Dt=new Set([`all`,`allSettled`,`any`,`race`]);function Ot(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;return typeof t==`object`&&!!t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.object,`Promise`)&&n(t.property)&&Dt.has(t.property.name)}function w(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=w(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),Ot(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=w(r,t);if(e)return e}}}function kt(e){let t=d(e,`gen`);if(t)return w(t.body);if(o(e,`sync`)){let t=F(a(e));return t?w(t):void 0}if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=F(t),n=e?w(e):void 0;if(n)return n}}function At(e){if(typeof e!=`object`||!e)return!1;let t=e;return(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)&&Array.isArray(t.params)&&t.params.length>0}function jt(e){if(!o(e,`tryPromise`))return!1;let t=a(e);return At(t)?!0:At(L(t,`try`))}function Mt(e){return o(e,`promise`)?!0:o(e,`tryPromise`)&&!jt(e)}function Nt(e){if(!o(e,`timeout`))return;let t=a(e);return Mt(t)?t:void 0}const Pt=new Set([`crypto`,`fs`,`zlib`]);function Ft(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(n(t))return t.name.endsWith(`Sync`);if(typeof t!=`object`||!t||t.type!==`MemberExpression`||t.computed===!0||!n(t.object)||!n(t.property))return!1;let r=t.object.name,i=t.property.name;return Pt.has(r)&&i.endsWith(`Sync`)}function It(e,t=new WeakSet){if(Array.isArray(e)){for(let n of e){let e=It(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){if(t.add(e),Ft(e))return e;for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=It(r,t);if(e)return e}}}function Lt(e){let t=d(e,`gen`);if(t)return It(t.body);if(o(e,`sync`)){let t=F(a(e));return t?It(t):void 0}}const Rt=new Set([`runCallback`,`runFork`,`runPromise`,`runPromiseExit`,`runSync`,`runSyncExit`]);function T(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&Rt.has(t.name)}function zt(e){return r(e,`Effect`,`orDie`)||r(e,`Effect`,`orDieWith`)||o(e,`orDie`)||o(e,`orDieWith`)}function Bt(e){if(zt(e))return e;if(l(e))return N(e).find(e=>zt(e))}function Vt(e){return o(e,`succeed`)||o(e,`asVoid`)||o(e,`ignore`)||ai(e)}function Ht(e){if(!o(e,`catchAll`))return;let t=F(a(e));return Vt(t)?t:void 0}function Ut(e){return r(e,`Effect`,`ignore`)||o(e,`ignore`)}function Wt(e){if(Ut(e))return e;if(l(e))return N(e).find(e=>Ut(e))}function E(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`console`)&&n(t.callee.property)}function Gt(e){if(me(e))return x(e.arguments,E);let t=y(e);return t?x(L(t,`effect`)??L(t,`scoped`),E):[]}const Kt=new Set([`catchAll`,`catchTag`,`catchTags`,`tapError`]);function qt(e){return I(e)||typeof e==`object`&&!!e&&e.type===`TemplateLiteral`}function Jt(e){return o(e,`logError`)||o(e,`logWarning`)}function Yt(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`}function Xt(e,t){return b(e,e=>o(e,`annotateLogs`))?!0:t.arguments.slice(1).some(e=>Yt(e)||!qt(e))}function Zt(e){return x(e,t=>Jt(t)&&qt(a(t))&&!Xt(e,t))}function Qt(e){if(!i(e))return[];let t=e.callee.property;return!n(t)||!Kt.has(t.name)?[]:e.arguments.map(F).filter(e=>e!==void 0)}function D(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&n(r.callee,t)}function O(e,t,r){if(typeof e!=`object`||!e)return!1;let i=e;return i.type===`CallExpression`&&typeof i.callee==`object`&&i.callee!==null&&i.callee.type===`MemberExpression`&&i.callee.computed!==!0&&n(i.callee.object,t)&&n(i.callee.property)&&(r===void 0||n(i.callee.property,r))}function $t(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`CallExpression`||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0||!n(t.callee.object,`Effect`)||!n(t.callee.property)?!1:t.callee.property.name.startsWith(`log`)}function k(e,t=new WeakSet){return E(e)?!0:Array.isArray(e)?e.some(e=>k(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&k(n,t)))}function A(e,t=new WeakSet){return D(e,`setState`)||O(e,`Atom`,`set`)||D(e,`invalidate`)||$t(e)||E(e)?!0:Array.isArray(e)?e.some(e=>A(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&A(n,t)))}function en(e,t=new WeakSet){return O(e,`Ref`,`set`)||O(e,`Atom`,`set`)||O(e,`SubscriptionRef`,`set`)||O(e,`Reactivity`,`invalidate`)||O(e,`Fiber`,`interrupt`)||$t(e)?!0:Array.isArray(e)?e.some(e=>en(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&en(n,t)))}function tn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?!1:t.properties.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e,r=t.key,i=t.value;return(n(r,`concurrency`)||typeof r==`object`&&!!r&&r.value===`concurrency`)&&typeof i==`object`&&!!i&&(i.type===`Literal`||i.type===`NumericLiteral`)&&i.value===1})}function nn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?!1:t.properties.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e.key;return n(t,`concurrency`)||typeof t==`object`&&!!t&&t.value===`concurrency`})}function rn(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.property,`map`)}function an(e){return o(e,`all`)&&rn(a(e))&&!nn(e.arguments[1])}function on(e,t=new WeakSet){if(o(e,`fork`))return e;if(Array.isArray(e)){for(let n of e){let e=on(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=on(r,t);if(e)return e}}}function j(e,t,r=new WeakSet){if(i(e)){let r=e.callee.property;if(n(r)&&t.has(r.name))return!0}return Array.isArray(e)?e.some(e=>j(e,t,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&j(n,t,r)))}const sn=new Set([`sleep`,`await`,`promise`,`tryPromise`,`fork`,`forkDaemon`,`forkScoped`,`all`,`forEach`,`race`,`raceAll`]),cn=new Set([`modifyEffect`,`modifySomeEffect`,`updateEffect`,`updateAndGetEffect`]);function ln(e,t=new WeakSet){if(i(e)){let t=e.callee.property;if(n(t)&&sn.has(t.name))return!0}return O(e,`Queue`,`take`)||O(e,`Deferred`,`await`)?!0:Array.isArray(e)?e.some(e=>ln(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&ln(n,t)))}function M(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&Array.isArray(r.arguments)&&typeof r.callee==`object`&&r.callee!==null&&r.callee.type===`MemberExpression`&&r.callee.computed!==!0&&n(r.callee.property,t)}function un(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Array.isArray(t.arguments)){if(typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`CallExpression`){let e=t.callee;if((M(e,`withPermit`)||M(e,`withPermits`))&&t.arguments.length>0)return t.arguments[0]}if(O(t,`TSemaphore`,`withPermit`)||O(t,`TSemaphore`,`withPermits`))return t.arguments[0];if(M(t,`withPermit`)||M(t,`withPermits`))return t.arguments.at(-1)}}function dn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e;if(Array.isArray(t.arguments)){if(typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`CallExpression`){let e=t.callee;if(fn(e,`SynchronizedRef`)&&t.arguments.length>0)return e.arguments.at(-1)}if(fn(t,`SynchronizedRef`)&&t.arguments.length>1||pn(t)&&!mn(t))return t.arguments.at(-1)}}function fn(e,t){return[...cn].some(n=>O(e,t,n))}function pn(e){return[...cn].some(t=>M(e,t))}function mn(e){return[...cn].some(t=>O(e,`SynchronizedRef`,t))}const hn=new Set([`make`,`unsafeMake`,`makeUnsafe`]),gn=new Set([`timeout`,`timeoutOption`,`timeoutFail`,`timeoutFailCause`,`timeoutTo`]),_n=new Set([`race`,`raceFirst`,`raceAll`,`interruptible`,`scoped`]);function vn(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`MemberExpression`&&r.computed!==!0&&n(r.object,`Effect`)&&n(r.property,t)}function yn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(typeof t!=`object`||!t||t.type!==`MemberExpression`)return!1;let r=t;return r.computed!==!0&&n(r.object,`Deferred`)&&n(r.property)&&hn.has(r.property.name)}function bn(e){return O(e,`Deferred`,`await`)&&Array.isArray(e.arguments)}function xn(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;if(!(!n(t.id)||!b(t.init,yn)))return t.id.name}function Sn(e,t){return!!b(e,e=>{if(!O(e,`Effect`,`addFinalizer`)&&!O(e,`Scope`,`addFinalizer`))return!1;let n=e.arguments;return Array.isArray(n)&&n.some(e=>{let n=F(e);return n!==void 0&&p(n,t)})})}function Cn(e){if(!l(e))return!1;let t=e.arguments;return Array.isArray(t)&&t.some(e=>vn(e,`scoped`))}function wn(e,t){let r=typeof e==`object`&&e?e.parent:void 0,a=new WeakSet;for(;typeof r==`object`&&r;){if(a.has(r))return!1;if(a.add(r),i(r)&&(()=>{let e=r.callee.property;return n(e)&&(gn.has(e.name)||_n.has(e.name))})()||Cn(r)||v(r)&&Sn(r,t))return!0;r=r.parent}return!1}const Tn=new Set([`acquireRelease`,`acquireUseRelease`,`ensuring`,`forkIn`,`forkScoped`,`scoped`]);function En(e){return!o(e,`race`)&&!o(e,`raceAll`)?!1:!j(e.arguments,Tn)}function Dn(e){return o(e,`forEach`)&&!nn(e.arguments[2])}const On=new Set([`retry`]);function kn(e){return(an(e)||Dn(e))&&j(e.arguments,On)}function An(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return[];let t=e.declarations;return Array.isArray(t)?t.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)?[t.name]:[]}):[]}function jn(e,t=new Set,n=new WeakSet){if(Array.isArray(e)){for(let r of e)jn(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;if(n.add(e),e.type===`VariableDeclaration`)for(let n of An(e))t.add(n);for(let[r,i]of Object.entries(e))r!==`parent`&&jn(i,t,n);return t}const Mn=new Set([`add`,`clear`,`delete`,`pop`,`push`,`reverse`,`set`,`shift`,`sort`,`splice`,`unshift`]);function Nn(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type===`AssignmentExpression`&&n(t.left))return t.left.name;if(t.type===`UpdateExpression`&&n(t.argument))return t.argument.name;if(t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object)&&n(t.callee.property)&&Mn.has(t.callee.property.name))return t.callee.object.name}function Pn(e,t,n=jn(e),r=new WeakSet){if(Array.isArray(e)){for(let i of e){let e=Pn(i,t,n,r);if(e)return e}return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let i=Nn(e);if(i&&t.has(i)&&!n.has(i))return e;for(let[i,a]of Object.entries(e)){if(i===`parent`)continue;let e=Pn(a,t,n,r);if(e)return e}}function Fn(e){if(o(e,`fork`)||o(e,`all`)||o(e,`forEach`))return e.arguments}const In=new Set([`fork`,`forkScoped`,`forkDaemon`,`all`,`forEach`,`race`,`raceFirst`,`raceAll`]),Ln=new Set([`open`,`connect`,`create`,`start`,`listen`,`subscribe`,`acquire`]),Rn=new Set([`client`,`connection`,`conn`,`pool`,`db`,`database`,`file`,`socket`,`stream`,`server`,`subscription`,`handle`]),zn=new Set([`close`,`destroy`,`dispose`,`cleanup`]);function Bn(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function Vn(e){return Bn(e).some(e=>Rn.has(e))}function Hn(e){if(n(e))return Vn(e.name);if(!Y(e))return!1;let t=e;return t.computed===!0?!1:n(t.property)&&Vn(t.property.name)||Hn(t.object)}function Un(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee;if(typeof t!=`object`||!t||t.type!==`MemberExpression`||t.computed===!0||!n(t.property))return!1;let r=t;return zn.has(r.property.name)&&Hn(r.object)}function Wn(e){if(!i(e))return;let t=e.callee.property;return n(t)&&In.has(t.name)?e.arguments:void 0}function Gn(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return!1;let t=e.callee,r;if(n(t))r=t.name;else if(typeof t==`object`&&t&&t.type===`MemberExpression`){let e=t;e.computed!==!0&&n(e.property)&&(r=e.property.name)}return!r||r===`acquireRelease`||r===`acquireUseRelease`?!1:Bn(r).some(e=>Ln.has(e))&&Vn(r)}function Kn(e,t){return o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`scoped`)||Cn(e)?!0:t!==void 0&&Sn(e,t)}function qn(e){let t=new Set;for(let r of x(e,e=>typeof e==`object`&&!!e&&e.type===`VariableDeclarator`)){let i=r;n(i.id)&&b(i.init,Gn)&&Sn(e,i.id.name)&&t.add(i.id.name)}return t}function Jn(e,t,r=new WeakSet,i=new Set,a=!1){if(Array.isArray(e)){for(let n of e)Jn(n,t,r,i,a);return}if(typeof e!=`object`||!e||r.has(e)||(r.add(e),Kn(e)))return;let o=new Set(i);if(v(e))for(let t of qn(e))o.add(t);let s=e.type===`VariableDeclarator`?e:void 0,ee=s&&n(s.id)?s.id.name:void 0,c=ee!==void 0&&o.has(ee);if(Gn(e)&&!a){t.push(e);return}for(let[n,i]of Object.entries(e))n!==`parent`&&Jn(i,t,r,o,a||c)}function Yn(e){let t=[];return Jn(e,t),t}const Xn=new Set([`all`,`forEach`,`fork`,`race`,`raceAll`]);function Zn(e,t=new WeakSet){return j(e,Xn)||O(e,`Queue`,`take`)?!0:Array.isArray(e)?e.some(e=>Zn(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Zn(n,t)))}function Qn(e){return o(e,`uninterruptible`)&&Zn(e.arguments[0])}function $n(e){return O(e,`Queue`,`unbounded`)||O(e,`PubSub`,`unbounded`)}function er(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`ObjectExpression`||t.type===`ArrayExpression`||t.type===`NewExpression`&&(n(t.callee,`Map`)||n(t.callee,`Set`))||t.type===`CallExpression`&&(n(t.callee,`Map`)||n(t.callee,`Set`))}function tr(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclaration`)return[];let t=e,r=Array.isArray(t.declarations)?t.declarations:[];return t.kind===`let`||t.kind===`var`?An(e):r.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.id;return n(t)&&er(e.init)?[t.name]:[]})}function nr(e){if(typeof e!=`object`||!e||e.type!==`VariableDeclarator`)return;let t=e;return n(t.id)&&o(t.init,`fork`)?t.id.name:void 0}const rr=new Set([`await`,`interrupt`,`join`]);function ir(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`)return;let t=e,r=t.callee;if(typeof r!=`object`||!r||r.type!==`MemberExpression`||r.computed===!0||!n(r.object,`Fiber`)||!n(r.property)||!rr.has(r.property.name)||!Array.isArray(t.arguments))return;let[i]=t.arguments;return n(i)?i.name:void 0}function ar(e){return r(e,`Effect`,`asVoid`)||O(e,`Effect`,`asVoid`)}function or(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type!==`CallExpression`||!Array.isArray(t.arguments)||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0||!n(t.callee.property,`pipe`)?!1:o(t.callee.object,`all`)&&t.arguments.some(e=>ar(e))}function N(e){if(typeof e!=`object`||!e||!l(e))return[];let t=e;return n(t.callee,`pipe`)?t.arguments:[t.callee.object,...t.arguments]}function sr(e){let[t]=N(e);return t!==void 0&&m(t)}function cr(e){if(sr(e))return!0;if(typeof e==`object`&&e&&e.type===`ArrowFunctionExpression`){let t=e.body;return i(t)||sr(t)}return!1}function lr(e){return u(e).some(e=>typeof e==`object`&&!!e&&(cr(e.argument)||i(e.argument)))}function P(e,t,r){if(typeof e!=`object`||!e||e.type!==`TSTypeReference`)return!1;let i=e.typeName;return typeof i==`object`&&!!i&&i.type===`TSQualifiedName`&&n(i.left,t)&&n(i.right,r)}function ur(e,t){return typeof e==`object`&&!!e&&e.type===`TSTypeReference`&&n(e.typeName,t)}function dr(e){if(typeof e!=`object`||!e)return[];let t=e.typeParameters??e.typeArguments;if(typeof t!=`object`||!t)return[];let n=t.params??t.arguments;return Array.isArray(n)?n:[]}function fr(e){return n(e,`Error`)||ur(e,`Error`)}function pr(e){if(typeof e!=`object`||!e)return;let t=e.returnType;if(!(typeof t!=`object`||!t))return t.typeAnnotation??t}function mr(e,t){return P(pr(e),`Effect`,`Effect`)||P(t,`Effect`,`Effect`)}function hr(e){if(typeof e!=`object`||!e)return[];let t=e.body;if(typeof t!=`object`||!t)return[];if(t.type!==`BlockStatement`)return[t];let n=(e,t=new WeakSet)=>{if(Array.isArray(e))return e.flatMap(e=>n(e,t));if(typeof e!=`object`||!e||t.has(e))return[];t.add(e);let r=e;return r.type===`ReturnStatement`?[r.argument]:r.type===`ArrowFunctionExpression`||r.type===`FunctionExpression`||r.type===`FunctionDeclaration`?[]:Object.entries(r).flatMap(([e,r])=>e===`parent`?[]:n(r,t))};return n(t)}function gr(e){return hr(e).filter(e=>i(e)||sr(e))}function _r(e){return o(e,`withSpan`)||l(e)&&N(e).some(e=>o(e,`withSpan`))}function vr(e,t){if(!mr(e,t))return;let n=gr(e);return n.length===0||n.some(e=>!_r(e))?e:void 0}function yr(e){if(typeof e!=`object`||!e)return;let t=e.typeAnnotation;if(!(typeof t!=`object`||!t))return pr(t.typeAnnotation??t)}function br(e){if(typeof e!=`object`||!e)return[];let t=e;if(t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`)return[];let n=t.declaration;return typeof n!=`object`||!n?[]:n.type===`FunctionDeclaration`?[{functionNode:n}]:n.type===`VariableDeclaration`?(n.declarations??[]).flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e.init;return typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)?[{functionNode:t,declaredReturnType:yr(e.id)}]:[]}):[]}function xr(e){let t=L(e,`effect`)??L(e,`scoped`),n=d(t,`gen`),r=n?hr(n).find(Yt):o(t,`succeed`)&&Yt(a(t))?a(t):void 0;if(!r)return[];let i=r.properties;return Array.isArray(i)?i.flatMap(e=>{if(typeof e!=`object`||!e||e.type!==`Property`)return[];let t=e.value;return typeof t==`object`&&t&&(t.type===`ArrowFunctionExpression`||t.type===`FunctionExpression`)?[t]:[]}):[]}function Sr(e){return gr(e).some(e=>!_r(e))?e:void 0}function Cr(e,t){let n=pr(e)??t;if(!P(n,`Effect`,`Effect`))return;let[,r]=dr(n);return r===void 0?void 0:{annotation:n,errorChannel:r}}function wr(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`ExportNamedDeclaration`&&t.type!==`ExportDefaultDeclaration`?[]:br(t).flatMap(({functionNode:e,declaredReturnType:t})=>{let n=Cr(e,t);return n?[n]:[]})}function Tr(e){return wr(e).find(e=>fr(e.errorChannel))?.annotation}function Er(e){let t=e,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t)||(n.add(t),t.type!==`TSParenthesizedType`))return t;t=t.typeAnnotation}return t}function Dr(e){let t=Er(e);if(fr(t))return`Error`;if(!(typeof t!=`object`||!t))switch(t.type){case`TSUnknownKeyword`:return`unknown`;case`TSStringKeyword`:return`string`;case`TSNumberKeyword`:return`number`;case`TSBooleanKeyword`:return`boolean`;default:return}}function Or(e){let t=Er(e);if(typeof t!=`object`||!t||t.type!==`TSUnionType`)return new Set;let n=t.types;return Array.isArray(n)?new Set(n.flatMap(e=>{let t=Dr(e);return t?[t]:[]})):new Set}function kr(e,t,n,r=new WeakSet){return P(e,t,n)?!0:Array.isArray(e)?e.some(e=>kr(e,t,n,r)):typeof e!=`object`||!e||r.has(e)?!1:(r.add(e),Object.entries(e).some(([e,i])=>e!==`parent`&&kr(i,t,n,r)))}function Ar(e,t=new WeakSet){return D(e,`wrapGraphqlCall`)?!0:Array.isArray(e)?e.some(e=>Ar(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Ar(n,t)))}function jr(e){return o(e,`flatMap`)&&n(a(e),`applyResponse`)}function Mr(e,t=new WeakSet){return jr(e)?!0:Array.isArray(e)?e.some(e=>Mr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Mr(n,t)))}function Nr(e,t=new WeakSet){if(o(e,`catchAll`))return e;if(Array.isArray(e)){for(let n of e){let e=Nr(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Nr(r,t);if(e)return e}}}function Pr(e){let t=N(e);if(t.length===0)return;let n=Nr(t);if(n)return Ar(t)||Mr(t)?n:void 0}const Fr=new Set([`get`,`set`,`update`,`modify`,`refresh`]);function F(e){if(typeof e!=`object`||!e)return;let t=e;if(!(t.type!==`ArrowFunctionExpression`&&t.type!==`FunctionExpression`))return t.body}function Ir(e){if(typeof e!=`object`||!e)return!1;let t=e;if(t.type!==`CallExpression`||!Array.isArray(t.arguments)||typeof t.callee!=`object`||t.callee===null||t.callee.type!==`MemberExpression`||t.callee.computed===!0)return!1;let r=t.callee;return(n(r.object,`Atom`)||n(r.object,`atomRegistry`))&&n(r.property)&&Fr.has(r.property.name)}function Lr(e,t=new WeakSet){if(Ir(e))return e;if(Array.isArray(e)){for(let n of e){let e=Lr(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Lr(r,t);if(e)return e}}}function Rr(e){if(!o(e,`sync`))return;let t=F(a(e));return t?Lr(t):void 0}function zr(e){return n(e)?/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name):!1}function Br(e){if(typeof e!=`object`||!e)return;let t=e;if(t.type!==`CallExpression`||!Array.isArray(t.arguments)||!(n(t.callee,`get`)||r(t.callee,`Atom`,`get`)||r(t.callee,`get`,`get`)))return;let[i]=t.arguments;return zr(i)?i:void 0}function Vr(e,t=new WeakSet){let n=Br(e);if(n)return n;if(Array.isArray(e)){for(let n of e){let e=Vr(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=Vr(r,t);if(e)return e}}}function Hr(e){return o(e,`provide`)&&e.arguments.length===1}function Ur(e){if(l(e))return N(e).find(e=>Hr(e))}function Wr(e,t=new WeakSet){return typeof e==`object`&&e&&e.type===`SpreadElement`?!0:Array.isArray(e)?e.some(e=>Wr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Wr(n,t)))}function Gr(e){if(!O(e,`Ref`,`update`)&&!O(e,`Ref`,`modify`))return!1;let t=e.arguments[1];return Wr(F(t))}function Kr(e){return typeof e==`object`&&!!e&&e.type===`ObjectExpression`&&Array.isArray(e.properties)&&e.properties.length===0}function qr(e,t=new WeakSet){return O(e,`Object`,`entries`)?!0:Array.isArray(e)?e.some(e=>qr(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&qr(n,t)))}function Jr(e){if(Gr(e))return!0;if(O(e,`Object`,`assign`)){let t=e.arguments;return t.length>=3&&Kr(t[0])}return O(e,`Object`,`fromEntries`)?qr(e.arguments[0]):O(e,`JSON`,`stringify`)||O(e,`JSON`,`parse`)}function Yr(e){return n(e)?!0:typeof e==`object`&&!!e&&e.type===`MemberExpression`}function Xr(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e.init;return typeof t==`object`&&!!t&&t.type===`TSAsExpression`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null&&t.typeAnnotation.type!==`TSConstKeyword`})??!1}function Zr(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;if(t.operator!==`===`)return!1;let n=t.left,r=t.right;return typeof n==`object`&&!!n&&n.type===`UnaryExpression`&&n.operator===`typeof`&&typeof r==`object`&&!!r&&(r.type===`Literal`||r.type===`StringLiteral`)&&r.value===`boolean`}function Qr(e){return z(e,`orElse`)&&ha(B(e.arguments[0]))}function I(e){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`StringLiteral`)&&typeof e.value==`string`}function $r(e){return n(e,`undefined`)}function ei(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&e.operator===`??`&&(ha(e.right)||$r(e.right))}function ti(e){return O(e,`Option`,`fromNullable`)&&ei(e.arguments[0])}function L(e,t){if(!(typeof e!=`object`||!e||e.type!==`ObjectExpression`))for(let r of e.properties??[]){if(typeof r!=`object`||!r)continue;let e=r.key;if(n(e,t))return r.value}}function ni(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return t.operator===`===`&&(R(t.left,!0)||R(t.right,!0))}function ri(e){if(!O(e,`Option`,`match`))return!1;let t=e.arguments[1],n=L(t,`onSome`),r=L(t,`onNone`);return ni(B(n))&&R(B(r),!1)}function ii(e){return typeof e!=`object`||!e||e.type!==`VariableDeclaration`?!1:e.declarations?.some(e=>typeof e==`object`&&!!e&&I(e.init))??!1}function R(e,t){return typeof e==`object`&&!!e&&(e.type===`Literal`||e.type===`BooleanLiteral`)&&e.value===t}function ai(e){return r(e,`Effect`,`void`)}function z(e,t){if(typeof e!=`object`||!e)return!1;let r=e;return r.type===`CallExpression`&&Array.isArray(r.arguments)&&typeof r.callee==`object`&&r.callee!==null&&r.callee.type===`MemberExpression`&&r.callee.computed!==!0&&n(r.callee.object,`Match`)&&n(r.callee.property)&&(t===void 0||n(r.callee.property,t))}function B(e){if(!(typeof e!=`object`||!e||e.type!==`ArrowFunctionExpression`))return e.body}function oi(e){if(!z(e))return!1;let[t,r]=e.arguments;return n(e.callee.property,`when`)?(R(t,!0)||R(t,!1))&&ai(B(r)):n(e.callee.property,`orElse`)&&ai(B(t))}const si=[`flatMap`,`map`,`andThen`,`tap`,`zipRight`];function ci(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`CallExpression`&&typeof t.callee==`object`&&t.callee!==null&&t.callee.type===`MemberExpression`&&t.callee.computed!==!0&&n(t.callee.object,`Stream`)&&n(t.callee.property)}function li(e,t=new WeakSet){return si.some(t=>o(e,t))||l(e)||ci(e)?!0:Array.isArray(e)?e.some(e=>li(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&li(n,t)))}function ui(e){return m(e)&&li(e)}function di(e,t=new WeakSet){return z(e)&&ui(n(e.callee.property,`when`)?B(e.arguments[1]):B(e.arguments[0]))?!0:Array.isArray(e)?e.some(e=>di(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&di(n,t)))}function fi(e,t=new WeakSet){return z(e)?!0:Array.isArray(e)?e.some(e=>fi(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&fi(n,t)))}function pi(e){return typeof e==`object`&&!!e&&e.type===`CallExpression`&&Array.isArray(e.arguments)&&r(e.callee,`Option`,`match`)}function mi(e){let t=B(e);return typeof t==`object`&&!!t&&t.type===`CallExpression`}function hi(e,t=new WeakSet){if(o(e,`gen`))return e;if(Array.isArray(e)){for(let n of e){let e=hi(n,t);if(e)return e}return}if(!(typeof e!=`object`||!e)&&!t.has(e)){t.add(e);for(let[n,r]of Object.entries(e)){if(n===`parent`)continue;let e=hi(r,t);if(e)return e}}}function gi(e){if(!l(e)||typeof e!=`object`||!e)return!1;let t=e.callee.object;return typeof t==`object`&&!!t&&t.type===`CallExpression`&&r(t.callee,`Match`,`value`)}function _i(e){return gi(e)||typeof e==`object`&&!!e&&e.type===`CallExpression`&&(r(e.callee,`Option`,`match`)||r(e.callee,`Either`,`match`))}function vi(e,t=new WeakSet){return _i(e)?!0:Array.isArray(e)?e.some(e=>vi(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&vi(n,t)))}function yi(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type!==`ObjectExpression`||!Array.isArray(t.properties)?[]:t.properties.map(e=>typeof e==`object`&&e?e.value:void 0).filter(e=>e!==void 0)}function bi(e){if(typeof e!=`object`||!e||e.type!==`TSTypeAliasDeclaration`)return!1;let t=e.id,r=e.typeAnnotation;return n(t)&&/(?:Id|ID)$/.test(t.name)&&(r?.type===`TSStringKeyword`||r?.type===`TSNumberKeyword`)}function xi(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`TSBooleanKeyword`?!0:t.type===`TSTypeAnnotation`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null&&t.typeAnnotation.type===`TSBooleanKeyword`}function Si(e){if(typeof e!=`object`||!e)return;let t=e;return t.type===`TSTypeAnnotation`&&typeof t.typeAnnotation==`object`&&t.typeAnnotation!==null?t.typeAnnotation:t}function Ci(e){let t=Si(e);return t?.type===`TSStringKeyword`||t?.type===`TSNumberKeyword`}function wi(e){let t=Si(e);return t?.type===`TSAnyKeyword`||t?.type===`TSObjectKeyword`}function Ti(e){let t=Si(e);return t?.type===`TSTypeReference`&&n(t.typeName,`Date`)}function Ei(e){if(typeof e!=`object`||!e||!Array.isArray(e.params))return[];let t=/(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;return e.params.filter(e=>n(e)&&Ci(e.typeAnnotation)&&t.test(e.name))}function Di(e){return Ei(e).length>=3}function Oi(e){return n(e)?/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&xi(e.typeAnnotation):!1}function ki(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(Oi)}function Ai(e){if(n(e))return e.name;if(typeof e==`object`&&e&&typeof e.value==`string`)return e.value}function ji(e){return/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(e)}function Mi(e){if(typeof e!=`object`||!e||e.type!==`TSPropertySignature`)return!1;let t=e,n=Ai(t.key),r=t.typeAnnotation;return n!==void 0&&ji(n)&&(Ci(r)||Ti(r))}function Ni(e){if(typeof e!=`object`||!e)return[];let t=e;return t.type===`TSInterfaceDeclaration`&&typeof t.body==`object`&&t.body!==null&&Array.isArray(t.body.body)?t.body.body:t.type===`TSTypeLiteral`&&Array.isArray(t.members)?t.members:[]}function Pi(e){return n(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function Fi(e){let t=Ni(e);return t.length===1&&Ai(t[0].key)===`_tag`}function Ii(e){let t=typeof e==`object`&&e?e.superTypeArguments:void 0,n=typeof t==`object`&&t?t.params??t.arguments:void 0,r=Array.isArray(n)?n:dr(e);if(r.length===0)return!0;let i=r[0];return typeof i==`object`&&!!i&&(i.type===`TSObjectKeyword`||i.type===`TSTypeLiteral`&&Ni(i).length===0)}function Li(e){if(typeof e!=`object`||!e)return;let t=e;if((t.type===`TSTypeAliasDeclaration`||t.type===`TSInterfaceDeclaration`)&&Pi(t.id)&&Fi(t.type===`TSTypeAliasDeclaration`?t.typeAnnotation:t)||t.type===`ClassDeclaration`&&O(t.superClass,`Data`,`TaggedError`)&&Ii(t))return e}function Ri(e){return Ni(e).filter(Mi)}function zi(e){return n(e)?/^(?:opts|options|config)$/i.test(e.name)&&wi(e.typeAnnotation):!1}function Bi(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?[]:e.params.filter(zi)}const Vi=new Set([`==`,`===`,`!=`,`!==`,`>`,`>=`,`<`,`<=`]);function V(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+V(n,t),0);if(typeof e!=`object`||!e||t.has(e))return 0;t.add(e);let n=e;return n.type===`BinaryExpression`&&Vi.has(String(n.operator))?1:n.type===`LogicalExpression`?V(n.left,t)+V(n.right,t):0}function Hi(e){return typeof e==`object`&&!!e&&e.type===`LogicalExpression`&&V(e)>=3}function Ui(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return;let t=e;if(t.computed===!0||!n(t.object)||!n(t.property))return;let r=t.property.name;if(/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(r))return{objectName:t.object.name,propertyName:r}}function H(e,t=new Map,n=new WeakSet){let r=Ui(e);if(r){let e=t.get(r.objectName)??new Set;return e.add(r.propertyName),t.set(r.objectName,e),t}if(Array.isArray(e)){for(let r of e)H(r,t,n);return t}if(typeof e!=`object`||!e||n.has(e))return t;n.add(e);let i=e;return i.type===`LogicalExpression`?(H(i.left,t,n),H(i.right,t,n),t):t}function Wi(e){return typeof e!=`object`||!e||e.type!==`LogicalExpression`?!1:Array.from(H(e).values()).some(e=>e.size>=2)}function Gi(e){return o(e,`fail`)&&I(a(e))}function Ki(e){return n(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function qi(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`)return!1;let t=e;return t.computed!==!0&&n(t.property,`message`)&&Ki(t.object)}function U(e){if(qi(e))return!0;if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`BinaryExpression`&&t.operator===`+`?U(t.left)||U(t.right):t.type===`TemplateLiteral`&&Array.isArray(t.expressions)&&t.expressions.some(e=>U(e))}function Ji(e){return o(e,`fail`)&&U(a(e))}function Yi(e){return typeof e==`object`&&!!e&&e.type===`NewExpression`&&n(e.callee,`Error`)}function Xi(e){return o(e,`fail`)&&Yi(a(e))}function Zi(e,t){if(!i(e))return[];let r=e.callee.property;return!n(r)||!t.has(r.name)?[]:e.arguments.filter(v)}function Qi(e){for(let t of Zi(e,new Set([`catchAll`]))){let e=F(t);if(Xi(e))return e;for(let t of u(e))if(Xi(t.argument))return t.argument}}const $i=new Set([`catchSome`,`catchTag`,`catchTags`,`fail`,`mapBoth`,`mapError`]);function ea(e){if(!i(e))return!1;let t=e.callee.property;return n(t)&&$i.has(t.name)}function ta(e){for(let t of Zi(e,new Set([`catchAll`,`tapError`]))){let e=F(t),n=b(e,$t);if(n&&!b(e,ea))return n}}const na=new Set([`catchAll`]),ra=new Set([`NotFound`,`Missing`,`Empty`,`None`]);function ia(e){return ha(e)||$r(e)||n(e)&&/(?:fallback|default)/i.test(e.name)}function aa(e){return o(e,`succeed`)&&ia(a(e))}function oa(e){for(let t of Zi(e,na)){let e=F(t);if(aa(e))return e;for(let t of u(e))if(aa(t.argument))return t.argument}}function sa(e){if(!o(e,`fail`))return!1;let t=a(e);return I(t)&&ra.has(String(t.value))}function ca(e){if(typeof e!=`object`||!e||e.type!==`NewExpression`)return!1;let t=e.callee;return n(t)&&/(?:Error|Exception)$/.test(t.name)}function la(e){return typeof e!=`object`||!e||e.type!==`ThrowStatement`?!1:ca(e.argument)}function ua(e){let t=d(e,`gen`);if(t)return b(t.body,la);if(!i(e))return;let r=e.callee.property;if(!(!n(r)||!S.has(r.name)))for(let t of e.arguments){let e=F(t),n=e?b(e,la):void 0;if(n)return n}}function da(e){if(typeof e!=`object`||!e||e.type!==`ThrowStatement`)return!1;let t=e.argument;return typeof t==`object`&&!!t&&t.type===`NewExpression`&&n(t.callee,`Error`)&&Array.isArray(t.arguments)&&I(t.arguments[0])}function fa(e){return typeof e!=`object`||!e||!Array.isArray(e.params)?!1:e.params.some(e=>n(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&Ci(e.typeAnnotation))}function pa(e){if(typeof e!=`object`||!e||e.type!==`FunctionDeclaration`)return!1;let t=e.id;return n(t)&&/(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(t.name)&&fa(e)}function ma(e){if(typeof e!=`object`||!e||e.type!==`BinaryExpression`)return!1;let t=e;return[`==`,`===`,`!=`,`!==`].includes(String(t.operator))&&(I(t.left)||I(t.right))&&!Zr(t)}function W(e,t,n){e.report({message:n,node:t})}function ha(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`NullLiteral`||t.type===`Literal`&&t.value===null}function G(e){if(typeof e!=`object`||!e)return;let t=e.source;if(typeof t==`string`)return t;if(typeof t==`object`&&t){let e=t.value;if(typeof e==`string`)return e}}const ga=[`bin/**`,`scripts/**`,`cli/**`,`**/main.ts`,`app/api/**/route.ts`,`server/**`,`*.test.ts`,`*.spec.ts`],_a=[`**/*.test.*`,`**/*.spec.*`,`**/__tests__/**`],va=[`**/config/**`,`**/*Config.ts`,`**/*ConfigLayer.ts`],K=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}],ya=[{type:`object`,properties:{boundaryPaths:{type:`array`,items:{type:`string`}},configPaths:{type:`array`,items:{type:`string`}}},additionalProperties:!1}];function ba(e){let t=e.options[0];return typeof t==`object`&&t?t:{}}function xa(e,t){let n=e[t];return Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:void 0}function Sa(e){return e.replace(/\\/g,`/`).replace(/^\.\/+/,``).replace(/\/{2,}/g,`/`).replace(/\/$/,``)}function Ca(e){return e.replace(/[|\\{}()[\]^$+?.]/g,`\\$&`).replace(/\*/g,`[^/]*`)}function wa(e){let t=Sa(e);if(t===`**`)return/^.*$/;let n=t.split(`/`),r=n[0]===`**`,i=+!!r,a=r?`(?:.*/)?`:`(?:^|.*/)`;for(let e=i;e<n.length;e+=1){let t=n[e],r=e===n.length-1;if(t===`**`){a+=r?`(?:/.*)?`:`(?:/[^/]+)*`;continue}e>i&&(a+=`/`),a+=Ca(t)}return RegExp(`${a}$`)}function Ta(e,t){return wa(t).test(Sa(e))}function Ea(e){return xa(ba(e),`boundaryPaths`)??ga}function q(e){return Ea(e).some(t=>Ta(e.filename,t))}function Da(e){return _a.some(t=>Ta(e.filename,t))}function Oa(e){return xa(ba(e),`configPaths`)??va}function ka(e){return Oa(e).some(t=>Ta(e.filename,t))}function J(e){return e===`effect`||e.startsWith(`effect/`)||e===`@effect-atom/atom-react`}function Aa(e){if(!D(e,`it`)&&!D(e,`test`)&&!D(e,`specify`)&&!D(e,`bench`))return;let t=e.arguments?.at(-1);return v(t)?t:void 0}function ja(e){let t=e.body;if(!o(t,`runPromise`)&&!(typeof t!=`object`||!t||t.type!==`BlockStatement`||!Array.isArray(t.body))){for(let e of t.body)if(typeof e==`object`&&e&&e.type===`ExpressionStatement`&&o(e.expression,`runPromise`))return e.expression}}function Ma(e,t){let n=[],r=new WeakSet;function i(e,a=!1){if(Array.isArray(e)){for(let t of e)i(t);return}if(typeof e!=`object`||!e||r.has(e))return;r.add(e);let o=e;if(!(!a&&v(o))){t(o)&&n.push(o);for(let[e,t]of Object.entries(o))e!==`parent`&&i(t)}}return i(e,!0),n}function Na(e){if(typeof e!=`object`||!e||e.type!==`MemberExpression`||e.computed===!0||!n(e.property,`rejects`))return!1;let t=e.object;if(!D(t,`expect`))return!1;let r=t.arguments;if(!Array.isArray(r))return!1;let i=r[0];return o(i,`runPromise`)}function Pa(e){return typeof e==`object`&&!!e&&e.type===`MemberExpression`&&e.computed!==!0&&n(e.property,`Default`)}function Fa(e){return O(e,`Layer`,`succeed`)||O(e,`Layer`,`effect`)}function Ia(e){if(!O(e,`Layer`,`provide`))return[];let t=e.arguments;return!Array.isArray(t)||!t.some(Pa)?[]:t.filter(Fa)}function La(e){let t=G(e);if(t===`effect/Schema`)return!0;if(t!==`effect`||typeof e!=`object`||!e)return!1;let r=e.specifiers;return Array.isArray(r)&&r.some(e=>{if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`ImportSpecifier`&&n(t.imported,`Schema`)})}function Ra(e,n){return t({create(t){let r=!1;return{ImportDeclaration(e){let t=G(e);t&&J(t)&&(r=!0)},[e](e){r&&W(t,e,n)}}}})}const za=new Set([`useState`,`useReducer`,`useContext`,`useCallback`,`useEffect`,`useSyncExternalStore`]),Ba=t({create(e){return{CallExpression(t){let r=t.callee,i=n(r)?r.name:typeof r==`object`&&r&&r.type===`MemberExpression`&&n(r.property)?r.property.name:void 0;i&&za.has(i)&&W(e,r,`Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.`)}}}}),Va=Ra(`IfStatement`,`Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead.`),Ha=Ra(`SwitchStatement`,`Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead.`),Ua=Ra(`ConditionalExpression`,`Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/Either.match/Match.value or data combinators, then run one Effect pipeline.`),Wa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ReturnStatement(n){t&&ha(n.argument)&&W(e,n,`Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.`)}}}}),Ga=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&r(n.callee,`Option`,`as`)&&W(e,n,`Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly.`)}}}}),Ka=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},MemberExpression(n){t&&r(n,`Effect`,`never`)&&W(e,n,`Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.`)}}}}),qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t||!ae(n))return;let r=se(n.callee.body);r&&W(e,r,`Rule: avoid nested IIFEs. Why: they hide sequencing and push wrapper hacks. Fix: bind a named context with const and keep one flat pipeline with a single Match/Option decision.`)}}}}),Ja=t({create(e){return{ObjectExpression(t){yi(t).some(e=>vi(e))&&W(e,t,`Rule: avoid Match/Option/Either inside object literals. Why: it hides the decision and invites workaround scaffolding. Fix: compute the value first (context), then build the object from named values with one flat decision.`)}}}}),Ya=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&oe(n)&&W(e,n,`Rule: avoid immediate invocation of inline functions. Why: it hides decisions and sequencing. Fix: bind a named context with const and keep one Match/Option decision in a flat pipeline.`)}}}}),Xa=t({create(e){return{CallExpression(t){for(let n of le(t))W(e,n,`Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).`)}}}}),Za=t({create(e){return{CallExpression(t){for(let n of ue(t))W(e,n,`Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.`)}}}}),Qa=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&fe(n,`fn`)&&W(e,n,`Rule: avoid Effect.fn generator wrappers. Why: they hide sequencing and dodge ladder rules. Fix: keep a single flat pipeline or use one Effect.gen.`)}}}}),$a=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&o(n,`sync`)&&k(a(n))&&W(e,n,`Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call.`)}}}}),eo=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Gt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){i(e)},ClassDeclaration(e){i(e)},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.`)}}}}),to=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{for(let t of Zt(e))typeof t!=`object`||!t||r.has(t)||(r.add(t),n.push(t))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){for(let t of Qt(e))i(t)},ClassDeclaration(e){let t=y(e);t&&i(L(t,`effect`)??L(t,`scoped`))},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: add structured context to Effect.logError or Effect.logWarning. Why: static failure messages cannot be correlated. Fix: include an error or context object, or use Effect.annotateLogs(...).`)}}}}),no=t({create(e){let t=!1,n=[],r=new WeakSet,i=e=>{typeof e==`object`&&e&&!r.has(e)&&(r.add(e),n.push(e))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(e){for(let t of br(e))i(vr(t.functionNode,t.declaredReturnType))},ExportDefaultDeclaration(e){for(let t of br(e))i(vr(t.functionNode,t.declaredReturnType))},ClassDeclaration(e){let t=y(e);if(t)for(let e of xr(t))i(Sr(e))},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).`)}}}}),ro=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){if(!Da(e))return;let r=Aa(t),i=r&&ja(r);i&&n.push(i)},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: do not discard Effect.runPromise in a test body. Why: the test can finish before the Effect result is observed. Fix: await or return Effect.runPromise so the test framework observes completion.`)}}}}),io=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){if(!Da(e))return;let r=Aa(t);r&&n.push(...Ma(r,Na))},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.`)}}}}),ao=t({create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(t){Da(e)&&n.push(...Ia(t))},"Program:exit"(){if(t)for(let t of n)W(e,t,`Rule: avoid a manual test layer beside an explicit service Default layer. Why: the test is already opting into the service's real default composition and the sibling mock can hide that contract. Fix: use the Default layer with its required infrastructure, or remove Default when a replacement is intentional.`)}}}}),oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=d(n,`gen`);if(!t||!r)return;let i=hi(r.body);i&&W(e,i,`Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline.`)}}}}),so=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ve(n);r&&W(e,r,"Rule: use yield* inside Effect.gen. Why: plain yield returns an Effect value without delegating to the Effect interpreter. Fix: replace `yield Effect.x` with `yield* Effect.x`.")}}}}),co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=be(n);r&&W(e,r,`Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps.`)}}}}),lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ce(n);r&&W(e,r,`Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation.`)}}}}),uo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ee(n);r&&W(e,r,`Rule: prefer Effect.gen for workflow sequencing. Why: long flatMap/andThen/tap pipelines read like imperative workflow. Fix: move the sequential story into one Effect.gen and keep pipe for behavior decoration.`)}}}}),fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Oe(n)&&W(e,n,`Rule: avoid large anonymous flow expressions. Why: long pure transformation chains need a domain name. Fix: extract a named flow or split the transformation into named pure steps.`)}}}}),po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=je(n);r&&W(e,r,`Rule: avoid Effect work inside flow. Why: flow should stay a reusable pure transformation boundary. Fix: keep Effect sequencing, logging, retries, and dependency access in Effect pipelines.`)}}}}),mo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Me(n);r&&W(e,r,`Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const.`)}}}}),ho=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Le(n);r&&W(e,r,`Rule: prefer flow for a deep pure call pipeline. Why: nested transformation towers hide the data pipeline and make reuse difficult. Fix: name the pure steps and compose them with flow, or keep the pipeline short.`)}}}}),go=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Re(n);r&&W(e,r,`Rule: keep business workflow logic out of Effect.pipe callbacks. Why: branching, service lookup, and multi-step effects are hard to read as decoration. Fix: move the workflow into Effect.gen and reserve pipe for behavior around the completed effect.`)}}}}),_o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ve(n);r&&W(e,r,"Rule: prefer .pipe() for behavior decoration. Why: retry, timeout, spans, logging, recovery, DI, and value transforms decorate an existing effect. Fix: write `program.pipe(Effect.retry(policy))` instead of `Effect.retry(program, policy)`.")}}}}),vo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=We(n);r&&W(e,r,`Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story.`)}}}}),yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ge(n);r&&W(e,r,`Rule: avoid workflow sequencing inside behavior pipes. Why: behavior pipes should answer how an effect behaves, not hide the workflow story. Fix: move multi-step sequencing into Effect.gen and keep retry/timeout/spans/logging as decorators around named effects.`)}}}}),bo=t({create(e){let t=!1;function n(n){let r=Ke(n);t&&r&&W(e,r,`Rule: avoid mixing Effect style pillars in one function. Why: workflow, pure transformation, behavior decoration, and Layer wiring each need a clear boundary. Fix: extract named concepts for each pillar and compose them at the call site.`)}return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=Je(n);t&&r&&W(e,r,`Rule: avoid clever Effect expressions. Why: deeply nested expressions that combine style pillars hide the domain story. Fix: extract named workflow, pure transformation, and behavior steps.`)}}}}),So=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=Ye(n);t&&r&&W(e,r,`Rule: prefer extracting named concepts from oversized anonymous callbacks. Why: multi-step inline callbacks hide domain intent. Fix: name the transformation, policy, or workflow step before passing it into Effect.`)}}}}),Co=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Qe(n)&&W(e,n,`Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.`)}}}}),wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n);t&&r&&$e(r)&&W(e,r,`Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.`)}}}}),To=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n);t&&r&&!et(r)&&W(e,r,`Rule: set accessors: true. Fix: add it to Effect.Service options.`)}}}}),Eo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n),i=r?rt(r):void 0;t&&i&&W(e,i,`Rule: declare service dependencies.`)}}}}),Do=t({create(e){return{ImportDeclaration(t){let n=tt(t);n&&W(e,n,`Rule: avoid namespace imports from Effect packages.`)}}}}),Oo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?_t(n):void 0;r&&W(e,r,`Rule: avoid exported manual service objects.`)}}}}),ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?st(n):void 0;r&&W(e,r,`Rule: prefer Layer.pipe for nested layer provisioning.`)}}}}),Ao=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?lt(n):void 0;r&&W(e,r,`Rule: avoid inline layer provisioning inside programs.`)}}}}),jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?ut(n):void 0;r&&W(e,r,`Rule: prefer Layer.mergeAll for infrastructure layer groups.`)}}}}),Mo=t({create(e){let t=!1,n=0;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(r){let i=t?ft(r):void 0;i&&(n+=1,n>=3&&W(e,i,`Rule: group service layers by concern.`))}}}}),No=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){let r=ot(n);t&&r&&W(e,r,`Rule: avoid Layer composition inside request handlers.`)}}}}),Po=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ClassDeclaration(n){let r=y(n),i=r?ht(r):void 0;t&&i&&W(e,i,`Rule: return Effect from service methods.`)}}}}),Fo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&oi(n)&&W(e,n,`Rule: avoid void Match branches. Why: they hide guard-style control flow. Fix: remove the no-op branch or select a value and run one Effect pipeline outside the Match.`)}}}}),Io=t({create(e){return{CallExpression(t){gi(t)&&di(t.arguments)&&W(e,t,`Rule: avoid multi-step sequencing inside Match branches. Why: it hides control flow. Fix: select a value in Match, then run one Effect pipeline outside. Avoid data-encoded conditionals (Option.toArray/forEach) that only rewrap the branch.`),pi(t)&&ui(t.arguments)&&W(e,t,`Rule: avoid multi-step sequencing inside Option.match branches. Why: it hides control flow. Prefer selecting a value in Option.match, then run one Effect pipeline outside. Leaf-level flows with local bindings may keep Option.match but should stay linear.`)}}}}),Lo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=a(n),i=B(r);t&&o(n,`sync`)&&mi(r)&&!E(i)&&W(e,n,`Rule: avoid Effect.sync around side effects. Why: it hides intent. Fix: use Effect.log* or an explicit pipeline step for the side effect.`)}}}}),Ro=t({create(e){return{CallExpression(t){o(t,`as`)&&A(a(t))&&W(e,t,`Rule: avoid Effect.as for side effects. Why: it hides side effects and turns them into placeholders. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`),o(t,`zipRight`)&&A(a(t))&&W(e,t,`Rule: avoid Effect.zipRight for side effects. Why: it hides side effects and discards values. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`)}}}}),zo=t({create(e){return{CallExpression(t){o(t,`all`)&&en(t.arguments[0])&&tn(t.arguments[1])&&W(e,t,`Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.`),or(t)&&en(a(t.callee.object))&&W(e,t,`Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.`)}}}}),Bo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=yt(n);r&&W(e,r,`Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: return an Effect and compose with Effect.flatMap/fromPromise at the boundary.`)}}}}),Vo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=xt(n);r&&W(e,r,`Rule: avoid throw inside Effect logic. Why: thrown exceptions bypass typed Effect error channels and interruption semantics. Fix: return Effect.fail with a structured tagged error.`)}}}}),Ho=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Bt(n);r&&W(e,r,`Rule: avoid Effect.orDie outside runtime boundaries. Why: converting typed failures into defects hides recoverable domain errors. Fix: keep typed errors in domain logic and reserve orDie/orDieWith for explicit application boundaries.`)}}}}),Uo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ht(n);r&&W(e,r,`Rule: avoid swallowing errors in catchAll. Why: succeed/void recovery can hide failures without telemetry or typed recovery. Fix: log, re-fail with a structured error, or recover through an explicit domain branch.`)}}}}),Wo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&Li(n)&&W(e,n,`Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.`)},TSInterfaceDeclaration(n){t&&Li(n)&&W(e,n,`Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.`)},ClassDeclaration(n){t&&Li(n)&&W(e,n,`Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.`)}}}}),Go=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(t&&!q(e)){let t=oa(n);t&&W(e,t,`Rule: avoid catching errors too early. Why: null, undefined, or fallback recovery inside domain logic forces higher layers to handle an untyped absence. Fix: let the typed error propagate and recover at a meaningful boundary with catchTag or an explicit Option result.`)}}}}}),Ko=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&sa(n)&&W(e,n,`Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad catchAll recovery. Fix: return Option, Either, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`)}}}}),qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ua(n);r&&W(e,r,`Rule: do not use exceptions for domain errors. Why: throw new *Error inside Effect logic bypasses typed failure channels, supervision, and structured recovery. Fix: return Effect.fail with a Data.TaggedError or structured domain error.`)}}}}),Jo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Ji(n)&&W(e,n,`Rule: preserve structured errors instead of strings. Why: converting error.message to a string loses the original tag, cause, and context. Fix: fail with the error or map it to a structured Data.TaggedError.`)}}}}),Yo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Qi(n);r&&W(e,r,`Rule: do not rethrow generic Error from catchAll. Why: catchAll should preserve or model the original failure instead of erasing its domain type. Fix: use mapError, catchTag, or Effect.fail with a structured tagged error and cause.`)}}}}),Xo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ta(n);r&&W(e,r,`Rule: do not stop at logging an Effect error. Why: logs alone do not preserve a typed failure or define recovery ownership. Fix: map or re-fail with a structured domain error after adding observability.`)}}}}),Zo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Wt(n);r&&W(e,r,`Rule: avoid Effect.ignore. Why: ignoring failable effects hides failure ownership. Fix: handle the error with typed recovery, log and re-fail, or isolate the ignore at an explicit boundary with a documented reason.`)}}}}),Qo=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Ct(n);r&&W(e,r,`Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.catchAll, Effect.catchTag, or typed error combinators.`)}}}}),$o=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Et(n);r&&W(e,r,`Rule: avoid Promise APIs inside Effect logic. Why: Promise APIs bypass Effect scheduling, typed errors, cancellation, and tracing. Fix: use Effect.all, Effect.tryPromise, or move Promise interop to a boundary adapter.`)}}}}),es=t({create(e){return{TryStatement(t){W(e,t,`Rule: avoid try/catch in Effect files. Why: it bypasses Effect error channels and reintroduces imperative control flow. Fix: model failures in Effect and handle them with typed errors and Effect combinators.`)}}}}),ts=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])cr(n.init)&&W(e,t,"Rule: avoid Effect wrapper aliases (`const x = ...Effect...`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")},FunctionDeclaration(t){lr(t.body)&&W(e,t,"Rule: avoid Effect wrapper aliases (`function x(...) { return Effect... }`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")}}}}),ns=t({create(e){return{TSTypeReference(t){(P(t,`Effect`,`Effect`)||P(t,`Layer`,`Layer`))&&W(e,t,"Rule: avoid manual Effect channel tuples (`Effect.Effect<...>` / `Layer.Layer<...>`). Why: channels compose through the Effect pipeline and services; hand-written tuples desync from the real flow. Fix: drop the generic and let the return type infer from the Effect/Layer you return, or expose a service method that returns the effect directly.")}}}}),rs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Pr(n):void 0;r&&W(e,r,`Rule: avoid catchAll after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of catchAll.`)}}}}),is=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExpressionStatement(n){t&&gi(n.expression)&&fi(n.expression.arguments)&&W(e,n.expression,`Rule: avoid Match.value(...).pipe(...) as a statement. Why: it runs side effects during render. Fix: move the side effect into an Effect runtime action or event handler, and keep Match as a pure expression.`)}}}}),as=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Rr(n):void 0;r&&W(e,r,`Rule: do not wrap Atom/atomRegistry ops in Effect.sync. Why: it hides side effects and breaks atom flow. Fix: call Atom.get/Atom.set/Atom.update/Atom.modify/Atom.refresh directly.`)}}}}),os=t({create(e){return{CallExpression(t){if(!O(t,`Atom`,`family`))return;let n=Vr(t.arguments);n&&W(e,n,`Keyed projection atom reads collection atom. Why: Atom.family should project from keyed/source atoms, not broad collection state. Fix: pass the keyed atom into the family or create a keyed source atom before reading.`)}}}}),ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){let r=t?Ur(n):void 0;r&&W(e,r,"Rule: do not inline runtime provisioning inside local helper Effect code. Why: `yield* SomeRuntime.pipe(Effect.provide(SomeRuntimeLive))` and equivalent inline provide chains hide dependency assembly instead of owning it at an Effect.Service boundary or one exported Effect boundary. Fix: declare the live dependency on the owning service or provide it once at the exported boundary, then `yield*` the runtime or service directly inside the body.")}}}}),cs=t({create(e){return{CallExpression(t){Jr(t)&&W(e,t,"Rule: avoid naked JS state patching/rebuild and raw JSON shortcuts in Effect transitions. Why: spread/Object.assign/fromEntries and inline JSON parse/stringify hide state intent and bypass explicit model contracts. Fix: use `effect/Record` combinators (`Record.set` / `Record.modify` / `Record.remove`) inside `Struct.evolve`, rebuild with schema constructors (`Schema.make` or field `.make`), and keep serialization at boundaries with schema encode/decode flows. Use `linting.md` guidance when available.")}}}}),ls=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&o(n,`succeed`)&&Yr(a(n))&&W(e,n,`Rule: avoid Effect.succeed(variable) as a branch placeholder. Why: it hides a decision and turns data into pseudo-control flow. Fix: select a plain value (Option/Match) and then run one Effect pipeline after the decision; if you already read the state, return it as a value. Avoid Option.toArray/forEach hacks that just re-encode the branch.`)}}}}),us=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&kr(n.typeAnnotation,`Effect`,`Effect`)&&W(e,n.typeAnnotation,`Rule: avoid Effect.Effect type aliases. Why: they hide the service surface and make types opaque. Fix: keep Effect types on service methods or inline at the call site.`)}}}}),ds=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExportNamedDeclaration(n){let r=t?Tr(n):void 0;r&&W(e,r,`Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.`)},ExportDefaultDeclaration(n){let r=t?Tr(n):void 0;r&&W(e,r,`Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.`)}}}});function fs(e,t,n){let r=!1,i=i=>{if(r)for(let r of wr(i))t(r)&&W(e,r.annotation,n)};return{ImportDeclaration(e){let t=G(e);t&&J(t)&&(r=!0)},ExportNamedDeclaration:i,ExportDefaultDeclaration:i}}const ps=t({create(e){return fs(e,({errorChannel:e})=>fr(e),`Rule: model public errors as tagged Effect failures, not generic Error. Why: Error hides recovery semantics and domain context. Fix: return a domain-specific Data.TaggedError or tagged error union.`)}}),ms=t({create(e){return fs(e,({errorChannel:e})=>Dr(e)===`unknown`,`Rule: do not expose unknown as a public Effect error channel. Why: callers cannot recover by tag or type. Fix: return a tagged domain error union with operation-specific context.`)}}),hs=t({create(e){return fs(e,({errorChannel:e})=>Or(e).size>1,`Rule: keep the public Effect error channel structurally consistent. Why: mixing Error, primitives, and unknown makes recovery ambiguous. Fix: map failures to one tagged error union.`)}}),gs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(n){t&&Xr(n)&&W(e,n,"Rule: avoid `as` assertions on decoded model flow. Why: assertions hide schema drift and allow untyped overlays. Fix: decode with the correct schema type and read fields directly.")}}}}),_s=t({create(e){let t=!1,n=!1,r=[],i=new WeakSet,a=t=>{typeof t!=`object`||!t||i.has(t)||(i.add(t),W(e,t,`Rule: avoid local unknown-to-boolean coercion helpers in services. Why: runtime coercion belongs at schema boundary, not in service flow. Fix: decode boolean optionality in schema and read typed booleans in the Effect pipeline.`))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},BinaryExpression(e){!t||!Zr(e)||(n?a(e):r.push(e))},CallExpression(e){if(!(!t||!Qr(e))){n=!0;for(let e of r)a(e)}}}}}),vs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&ti(n)&&W(e,n,"Rule: avoid nullish re-wrap inside Option.fromNullable. Why: `x ?? null` and `x ?? undefined` add noise and hide source shape. Fix: pass the source directly to Option.fromNullable.")}}}}),ys=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&ri(n)&&W(e,n,"Rule: avoid repeated Option boolean normalization (`onSome: value === true, onNone: false`). Why: it scatters coercion rules across services. Fix: normalize once at schema boundary and read booleans directly.")}}}}),bs=t({create(e){return{CallExpression(t){o(t,`succeed`)&&I(a(t))&&W(e,t,`Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/Either/tagged unions) or real Effect results instead.`)}}}}),xs=t({create(e){return{VariableDeclaration(t){ii(t)&&W(e,t,`Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/Either, or meaningful domain values instead of string tokens.`)}}}}),Ss=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&bi(n)&&W(e,n,"Rule: avoid raw primitive domain ID aliases. Why: `type UserId = string` does not protect boundaries from swapped IDs. Fix: use Schema branded IDs or a domain constructor that validates and brands the value.")}}}}),Cs=t({create(e){let t=!1,n=n=>{if(t)for(let t of ki(n))W(e,t,"Rule: avoid boolean behavior flags in domain operations. Why: flags like `shouldNotify` hide use cases and create implicit branching. Fix: model intent with a command/tagged union or split the operation into explicit functions.")};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),ws=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},BinaryExpression(n){t&&ma(n)&&W(e,n,`Rule: avoid magic domain string comparisons. Why: comparing domain state to raw strings scatters status vocabulary and misses exhaustiveness. Fix: use a tagged union, Schema literal union, or Match over a named domain status.`)}}}}),Ts=t({create(e){let t=!1,n=n=>{t&&Di(n)&&W(e,n,`Rule: avoid primitive-heavy domain parameters. Why: clusters of raw string/number domain values are easy to swap and have no invariant boundary. Fix: introduce branded types or a command/schema object with named validated fields.`)};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Es=t({create(e){let t=!1,n=n=>{if(t)for(let t of Ri(n))W(e,t,`Rule: avoid raw time fields in domain models. Why: number and Date fields hide units, clock ownership, and duration semantics. Fix: model durations with Effect Duration and keep raw timestamps at decode/encode boundaries.`)};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),Ds=new Set([`fs`,`node:fs`,`fs/promises`,`node:fs/promises`]),Os=new Set(`assert.assert/strict.async_hooks.buffer.child_process.cluster.console.constants.crypto.dgram.diagnostics_channel.dns.dns/promises.domain.events.fs.fs/promises.http.http2.https.inspector.inspector/promises.module.net.os.path.path/posix.path/win32.perf_hooks.process.punycode.querystring.readline.readline/promises.repl.stream.stream/consumers.stream/promises.stream/web.string_decoder.sys.timers.timers/promises.tls.trace_events.tty.url.util.util/types.v8.vm.wasi.worker_threads.zlib`.split(`.`));function ks(e){return e.startsWith(`node:`)||Os.has(e)}function Y(e){return typeof e==`object`&&!!e&&(e.type===`MemberExpression`||e.type===`OptionalMemberExpression`)}function As(e,t){return e.computed!==!0&&n(e.property,t)||e.computed===!0&&I(e.property)&&e.property.value===t}function js(e){return Y(e)&&n(e.object,`process`)&&As(e,`env`)}function Ms(e){if(!Y(e))return!1;if(js(e.object))return!0;if(!js(e))return!1;let t=e.parent;return!Y(t)||t.object!==e}function Ns(e){if(!Y(e)||typeof e.parent!=`object`||e.parent===null)return!1;let t=e.parent;return t.type===`AssignmentExpression`&&t.left===e}const Ps=t({meta:{schema:K},create(e){return{ImportDeclaration(t){let n=G(t);n&&ks(n)&&!q(e)&&W(e,t,`Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.`)}}}}),Fs=t({meta:{schema:ya},create(e){return{MemberExpression(t){Ms(t)&&!Ns(t)&&!q(e)&&!ka(e)&&W(e,t,`Rule: avoid direct process.env reads outside configuration boundaries. Why: ambient configuration leaks runtime coupling into domain code. Fix: decode environment values in a configured Config service or Layer and depend on that service.`)}}}});function Is(e){if(typeof e!=`object`||!e||e.type!==`CallExpression`||!n(e.callee,`require`))return;let t=e.arguments?.[0];if(!I(t))return;let r=t.value;return Ds.has(r)?r:void 0}const Ls=t({create(e){let t=!1,n=0,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0),n&&Ds.has(n)&&r.push({node:e,source:n})},FunctionDeclaration(){n+=1},"FunctionDeclaration:exit"(){--n},FunctionExpression(){n+=1},"FunctionExpression:exit"(){--n},ArrowFunctionExpression(){n+=1},"ArrowFunctionExpression:exit"(){--n},CallExpression(e){if(n!==0)return;let t=Is(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(let{node:t,source:n}of r)W(e,t,`Rule: avoid Node fs imports or require calls in Effect code (${n}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`)}}}}),Rs=t({meta:{schema:K},create(e){let t=!1,n=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){T(e)&&n.push(e)},"Program:exit"(){if(!(!t||q(e)))for(let t of n)W(e,t.callee,`Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.`)}}}}),zs=new Set([`try`,`tryPromise`,`mapError`,`catchAll`,`catchTag`,`catchTags`]);function Bs(e,t=new WeakSet){if(T(e))return!0;if(i(e)){let t=e.callee.property;if(n(t)&&zs.has(t.name))return!0}return Array.isArray(e)?e.some(e=>Bs(e,t)):typeof e!=`object`||!e||t.has(e)?!1:(t.add(e),Object.entries(e).some(([e,n])=>e!==`parent`&&Bs(n,t)))}const Vs=t({meta:{schema:K},create(e){return{TryStatement(t){!t.handler||!q(e)||Bs(t)||W(e,t,`Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, catchAll, or execute a mapped Effect program.`)}}}}),Hs=t({create(e){let t=!1,n=!1,i=[];return{ImportDeclaration(e){let r=G(e);r&&J(r)&&(t=!0),La(e)&&(n=!0)},CallExpression(e){r(e.callee,`JSON`,`parse`)&&i.push(e)},"Program:exit"(){if(!(!t||n))for(let t of i)W(e,t,`Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: decode unknown input with Schema.decodeUnknown at the boundary.`)}}}}),Us=t({create(e){let t=!1,n=new WeakSet,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(e){if(me(e))for(let t of ge(e.arguments))n.has(t)||(n.add(t),r.push(t))},"Program:exit"(){if(t)for(let t of r)W(e,t,`Rule: avoid Date.now inside Effect logic. Why: direct wall-clock reads make programs nondeterministic and difficult to test. Fix: obtain time through Effect Clock or DateTime at the boundary.`)}}}}),Ws=t({meta:{schema:K},create(e){let t=!1,r=[];return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},NewExpression(e){n(e.callee,`Date`)&&r.push(e)},"Program:exit"(){if(!(!t||q(e)))for(let t of r)W(e,t,`Rule: avoid new Date in Effect domain logic. Why: direct wall-clock construction makes domain behaviour nondeterministic and difficult to test. Fix: obtain time through Effect Clock or model time at the boundary.`)}}}}),Gs=t({create(e){let t=!1,n=n=>{if(t)for(let t of Bi(n))W(e,t,"Rule: avoid overloaded options objects. Why: `opts`, `options`, and `config` typed as any/object hide required fields and validation. Fix: accept unknown at the boundary and decode with Schema, or use a named typed command/config model.")};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),Ks=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},LogicalExpression(n){t&&Hi(n)&&W(e,n,`Rule: avoid embedding domain logic in conditionals. Why: multi-clause business rules become hard to test, reuse, and audit. Fix: extract a named domain predicate or validation Effect and call that from the branch.`)}}}}),qs=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},LogicalExpression(n){t&&Wi(n)&&W(e,n,`Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.`)}}}}),Js=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Gi(n)&&W(e,n,`Rule: avoid ad hoc domain errors. Why: string failures hide recovery semantics and observability. Fix: use Data.TaggedError or a structured domain error union.`)},ThrowStatement(n){t&&da(n)&&W(e,n,`Rule: avoid ad hoc domain errors. Why: thrown string Error values bypass typed Effect error channels. Fix: return Effect.fail with a structured tagged domain error.`)}}}}),Ys=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){t&&pa(n)&&W(e,n,`Rule: avoid domain meaning by folder or context naming alone. Why: admin/public/internal meaning should be represented in types or services, not inferred from helper names. Fix: encode context with branded IDs, commands, policies, or service boundaries.`)}}}}),Xs=t({create(e){return{CallExpression(t){r(t.callee,`Effect`,`as`)&&W(e,t.callee,`Rule: avoid Effect.as wrappers. Why: they can hide meaningful sequencing or value flow. Fix: return the intended value directly or use explicit Effect.map/andThen.`)}}}}),Zs=t({create(e){return{MemberExpression(t){r(t,`Effect`,`Do`)&&W(e,t,`Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.`)}}}});function Qs(e,n,i){return t({create(t){return{CallExpression(a){r(a.callee,e,n)&&W(t,a.callee,i)}}}})}const $s=Qs(`Effect`,`bind`,`Rule: avoid Effect.bind. Why: it obscures linear data flow behind builder-style binding. Fix: use Effect.gen or a direct pipe with flatMap/map.`),ec=Qs(`Runtime`,`runFork`,`Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.`),tc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&T(n)&&W(e,n.callee,`Rule: avoid running Effects outside runtime boundaries. Why: direct Effect.run* calls scatter execution ownership. Fix: return Effects from domain logic and run them at the app, CLI, worker, route, or test boundary.`)}}}}),nc=Qs(`Effect`,`async`,`Rule: avoid Effect.async. Why: manual callback bridges are easy to leak or resume incorrectly. Fix: use scoped Effect APIs or a dedicated platform adapter.`),rc=t({create(e){return{CallExpression(t){s(t)&&W(e,t,`Rule: avoid deeply nested Effect calls (Effect.xx(Effect.yy(Effect.zz(...)))). Why: they hide sequencing and spread flow. Fix: build values first, then run one flat Effect pipeline.`)}}}}),ic=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[])s(n.init)&&W(e,n.init,`Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.`)},ReturnStatement(t){s(t.argument)&&W(e,t.argument,`Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.`)}}}}),ac=t({create(e){return{VariableDeclaration(t){for(let n of t.declarations??[]){let t=te(n.init);t&&W(e,n.init,t)}},ReturnStatement(t){let n=te(t.argument);n&&W(e,t.argument,n)}}}}),oc=t({create(e){return{CallExpression(t){l(t)&&ie(t.arguments)&&W(e,t,`Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.`)}}}}),sc=t({create(e){return{CallExpression(t){ee(t)&&W(e,t,`Rule: avoid nested Effect call towers (Effect.fn(Effect.fn(...))). Why: it hides sequencing. Fix: build the inner Effect first, then use pipe/Effect.flatMap/Effect.andThen for a single flat pipeline.`)}}}}),cc=t({create(e){return{CallExpression(t){re(t)&&W(e,t,`Rule: avoid Effect.orElse around sequencing chains. Why: it hides error handling and splits the flow. Fix: move error handling to a single terminal decision after the pipeline.`)}}}}),lc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&an(n)&&W(e,n,"Rule: avoid unbounded Effect.all over mapped collections. Why: it can launch work for every item at once and fail under load. Fix: pass an explicit `{ concurrency: n }` option or use a bounded batching strategy.")}}}}),uc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ExpressionStatement(n){t&&o(n.expression,`fork`)&&W(e,n.expression,`Rule: avoid fire-and-forget Effect.fork. Why: detached fibers hide failure, interruption, and ownership. Fix: bind the fiber and join/await/interrupt it, or use Effect.forkScoped / Effect.forkIn with an explicit scope.`)}}}}),dc=t({create(e){let t=!1,n=n=>{if(!t)return;let r=on(n.body);r&&W(e,r,`Rule: avoid Effect.fork inside loops. Why: loop-spawned fibers create unbounded concurrency and unclear ownership. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit or a scoped supervisor.`)};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},ForStatement:n,ForInStatement:n,ForOfStatement:n,WhileStatement:n,DoWhileStatement:n}}}),fc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&En(n)&&W(e,n,`Rule: avoid Effect.race without loser cleanup. Why: racing effects without ensuring/scoped cleanup can leak losing work or resources. Fix: wrap raced effects with Effect.ensuring/acquireRelease or use a scoped race boundary.`)}}}}),pc=t({create(e){let t=!1,n=new Map,r=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclarator(e){let t=nr(e);t&&n.set(t,e)},CallExpression(e){let t=ir(e);t&&r.add(t)},"Program:exit"(){if(t)for(let[t,i]of n)r.has(t)||W(e,i,`Rule: avoid unobserved forked fibers. Why: forked fiber failures and interruption should be observed. Fix: pass the fiber to Fiber.join, Fiber.await, Fiber.interrupt, or use scoped fork APIs.`)}}}}),mc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&kn(n)&&W(e,n,`Rule: avoid unbounded concurrent retry. Why: retry inside unbounded parallel collection effects can amplify load and create retry storms. Fix: add an explicit concurrency limit or move retry behind a bounded queue/backoff policy.`)}}}}),hc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Lt(n);r&&W(e,r,`Rule: avoid blocking sync calls inside Effect logic. Why: sync fs/crypto/zlib calls block the runtime worker and hide throughput costs. Fix: use Effect.async/tryPromise at a platform boundary, stream APIs, or a dedicated blocking executor.`)}}}}),gc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=kt(n);r&&W(e,r,`Rule: avoid Promise concurrency APIs inside Effect logic. Why: Promise.all/allSettled/race/any bypass Effect concurrency, interruption, tracing, and error channels. Fix: use Effect.all, Effect.forEach, Effect.race, or a boundary adapter with explicit cancellation ownership.`)}}}}),_c=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(e){if(!(e.kind!==`let`&&e.kind!==`var`))for(let t of An(e))n.add(t)},CallExpression(r){if(!t)return;let i=Fn(r);if(!i)return;let a=Pn(i,n);a&&W(e,a,`Rule: avoid mutating shared state across fibers. Why: outer let/var state mutated from forked or parallel work creates nondeterministic races. Fix: model shared state with Ref/SynchronizedRef/Queue or aggregate immutable results with bounded Effect.all/forEach.`)}}}}),vc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=Nt(n);r&&W(e,r,`Rule: avoid timeout around noninterruptible Promise effects. Why: timing out Effect.promise or tryPromise without a signal leaves the underlying Promise running after interruption. Fix: use Effect.tryPromise with an AbortSignal parameter and pass it to the async API.`)}}}}),yc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&Qn(n)&&W(e,n,`Rule: avoid uninterruptible concurrent regions. Why: wrapping fork/race/all/forEach or queue work in uninterruptible blocks cancellation and can strand work under shutdown. Fix: keep only the critical section uninterruptible and leave concurrent work interruptible or scoped.`)}}}}),bc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&$n(n)&&W(e,n,`Rule: avoid unbounded Queue or PubSub constructors. Why: unbounded buffers hide backpressure and can fail under load. Fix: use Queue.bounded / PubSub.bounded with an explicit capacity at the owning boundary.`)}}}}),xc=t({create(e){let t=!1,n=new Set;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},VariableDeclaration(e){for(let t of tr(e))n.add(t)},CallExpression(r){if(!t)return;let i=Fn(r);if(!i)return;let a=Pn(i,n);a&&W(e,a,`Rule: avoid global mutable concurrency state. Why: module-scope mutable state touched from concurrent Effect work behaves like shared mutable global state. Fix: move ownership into Ref/SynchronizedRef/Queue/Layer state or pass immutable values through bounded effects.`)}}}}),Sc=t({create(e){let t=!1,r=[new Set],i=new WeakSet;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(){r.push(new Set)},"FunctionDeclaration:exit"(){r.pop()},FunctionExpression(){r.push(new Set)},"FunctionExpression:exit"(){r.pop()},ArrowFunctionExpression(){r.push(new Set)},"ArrowFunctionExpression:exit"(){r.pop()},VariableDeclarator(e){let t=xn(e);t&&r.at(-1)?.add(t)},CallExpression(o){if(!t||!bn(o))return;let s=a(o);!n(s)||!r.at(-1)?.has(s.name)||wn(o,s.name)||i.has(o)||(i.add(o),W(e,o,`Rule: avoid unbounded manual Deferred coordination. Why: a local latch can wait forever and make shutdown or failure ownership implicit. Fix: bound the await with a timeout/race, keep it interruptible, or tie completion and cleanup to a scope finalizer.`))}}}}),Cc=t({create(e){let t=!1,n=new WeakSet;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(r){if(!t)return;let i=Wn(r);if(i)for(let t of Yn(i))typeof t!=`object`||!t||n.has(t)||(n.add(t),W(e,t,`Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.`))}}}}),wc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=un(n);r&&ln(r)&&W(e,n,`Rule: avoid suspension while holding a semaphore permit. Why: sleeping, awaiting, or forking under a permit holds capacity while unrelated work waits. Fix: narrow the permit-protected section and perform interruptible or concurrent work outside it.`)}}}}),Tc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=dn(n);r&&ln(r)&&W(e,n,`Rule: avoid suspension while holding synchronized reference coordination. Why: effectful SynchronizedRef modifiers hold internal coordination while the callback sleeps, awaits, or starts concurrent work. Fix: compute the effect outside the modifier and commit a short synchronous state transition.`)}}}}),Ec=t({create(e){return{ImportExpression(t){W(e,t,`Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.`)}}}}),Dc=t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||!o(n,`forkDaemon`)||c(a(n),`supervised`)||W(e,n,`Rule: avoid unscoped background fibers. Why: Effect.forkDaemon detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn or make supervisor ownership explicit in the child effect.`)}}}});function Oc(e){if(typeof e!=`object`||!e||!Array.isArray(e.arguments))return[];let t=e.arguments;return o(e,`acquireUseRelease`)?t.slice(2):o(e,`acquireRelease`)||o(e,`acquireReleaseInterruptible`)?t.slice(1):o(e,`addFinalizer`)?t.slice(0,1):O(e,`Scope`,`addFinalizer`)||O(e,`Scope`,`addFinalizerExit`)?t.slice(1):[]}function kc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),v(t)){let e=t.parent;if(Oc(e).some(e=>e===t))return!0}t=t.parent}return!1}const Ac=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!Un(n)||kc(n)||W(e,n,`Rule: avoid manual resource cleanup. Why: direct close/dispose calls can bypass Effect scope ownership. Fix: acquire the resource with Effect.acquireRelease or register cleanup with a Scope finalizer.`)}}}});function jc(e){return O(e,`Scope`,`make`)&&Array.isArray(e.arguments)}function Mc(e,t){return O(e,`Scope`,`close`)&&n(a(e),t)}const Nc=new Set([`BlockStatement`,`CatchClause`,`ForInStatement`,`ForOfStatement`,`ForStatement`,`Program`,`SwitchStatement`]);function Pc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),Nc.has(t.type??``)||v(t))return t;t=t.parent}}function Fc(e,t){let n=e,r=new WeakSet;for(;typeof n==`object`&&n;){if(r.has(n))return!1;if(r.add(n),n===t)return!0;n=n.parent}return!1}function Ic(e){let t=0,n=e,r=new WeakSet;for(;typeof n==`object`&&n;){if(r.has(n))return t;r.add(n),t+=1,n=n.parent}return t}function X(e){if(n(e))return[e];if(typeof e!=`object`||!e)return[];let t=e;switch(t.type){case`ArrayPattern`:return Array.isArray(t.elements)?t.elements.flatMap(e=>X(e)):[];case`AssignmentPattern`:return X(t.left);case`ObjectPattern`:return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(typeof e!=`object`||!e)return[];let t=e;return t.type===`Property`?X(t.value):t.type===`RestElement`?X(t.argument):[]}):[];case`RestElement`:return X(t.argument);case`TSParameterProperty`:return X(t.parameter);default:return[]}}function Lc(e){return x(e.body,t=>typeof t==`object`&&!!t&&Rc(t).length>0&&Z(t)===e)}function Rc(e){return e.type===`VariableDeclarator`?X(e.id):e.type===`CatchClause`?X(e.param):(e.type===`ClassDeclaration`||e.type===`FunctionDeclaration`)&&n(e.id)?[e.id]:[]}function zc(e){return e.type===`CatchClause`?Pc(e.param):Pc(e)}function Bc(e,t){if(!n(e))return;let r,i=-1;for(let a of Lc(t)){if(!Rc(a).some(t=>n(t,e.name)))continue;let t=zc(a);if(t===void 0||!Fc(e,t))continue;let o=Ic(t);o>i&&(r=a,i=o)}return r}function Vc(e,t){return e===t?!0:typeof e==`object`&&!!e&&e.type===`YieldExpression`&&e.delegate===!0&&e.argument===t}function Z(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),v(t))return t;t=t.parent}}function Hc(e){let t=typeof e==`object`&&e?e.parent:void 0,r=new WeakSet;for(;typeof t==`object`&&t;){if(r.has(t))return;if(r.add(t),t.type===`VariableDeclarator`&&n(t.id)&&Vc(t.init,e))return t;if(v(t))return;t=t.parent}}function Uc(e){let t=Hc(e),n=Z(e);if(t===void 0||n===void 0)return!1;let r=t.id.name;return x(n.body,e=>Mc(e,r)&&Z(e)===n&&Bc(a(e),n)===t).length>0}function Wc(e){return(o(e,`acquireRelease`)||o(e,`acquireUseRelease`)||o(e,`acquireReleaseInterruptible`))&&Array.isArray(e.arguments)}function Gc(e,t,r){let i=a(e);return n(i,t.name)?Bc(i,r)===void 0&&Array.isArray(r.params)&&r.params.some(e=>e===t):!1}function Kc(e){let t=e.arguments;return(o(e,`acquireUseRelease`)?t.slice(2):t.slice(1)).some(e=>{if(!v(e))return!1;let t=e.params?.[0];return n(t)?x(e.body,n=>Mc(n,t.name)&&Z(n)===e&&Gc(n,t,e)).length>0:!1})}function qc(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),o(t,`scoped`)||O(t,`Layer`,`scoped`)||Wc(t)&&a(t)===e&&Kc(t))return!0;t=t.parent}return Uc(e)}const Jc=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!jc(n)||qc(n)||W(e,n,`Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.`)}}}}),Yc=t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!o(n,`succeed`)||!Hn(a(n))||W(e,n,`Rule: do not let live resources escape through Effect.succeed. Why: ordinary success values do not express resource lifetime ownership. Fix: keep the resource inside Effect.acquireRelease, Scope, or a service layer.`)}}}});function Xc(e){if(typeof e!=`object`||!e||e.type!==`NewExpression`)return!1;let t=e.callee,r;return n(t)?r=t.name:typeof t==`object`&&t&&t.type===`MemberExpression`&&t.computed!==!0&&n(t.property)&&(r=t.property.name),r!==void 0&&Vn(r)}function Zc(e){return Gn(e)||Xc(e)}function Qc(e){return o(e,`acquireRelease`)||o(e,`acquireReleaseInterruptible`)||o(e,`acquireUseRelease`)}function $c(e){if(kc(e))return!0;let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return!1;if(n.add(t),Qc(t)||o(t,`scoped`)||O(t,`Layer`,`scoped`)||Cn(t))return!0;t=t.parent}return!1}function el(e){let t=typeof e==`object`&&e?e.parent:void 0,n=new WeakSet;for(;typeof t==`object`&&t;){if(n.has(t))return;if(n.add(t),v(t)||t.type===`Program`)return t;t=t.parent}}function tl(e){return x(e,t=>Zc(t)&&el(t)===e&&!$c(t))}function nl(e){if(Qc(e))return x(e,Qc).length>=3?e:void 0}function rl(e){if(typeof e!=`object`||!e||!v(e))return;let t=e;if(n(t.id))return t.id.name;let r=t.parent;if(!(typeof r!=`object`||!r)){if(r.type===`VariableDeclarator`&&n(r.id))return r.id.name;if(r.type===`Property`&&n(r.key))return r.key.name}}function il(e){let t=rl(e);return t!==void 0&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function al(e){if(!il(e)||typeof e!=`object`||!e)return[];let t=e;return x(t.body,e=>Zc(e)&&Z(e)===t)}function ol(e){let t=el(e);if(t!==void 0)return tl(t)[0]}function sl(e){if(!n(e))return;let t=Z(e),r=t===void 0?[]:[t],i=typeof e==`object`&&e?e.parent:void 0,a=new WeakSet;for(;typeof i==`object`&&i&&!a.has(i);){if(a.add(i),i.type===`Program`){r.push(i);break}i=i.parent}for(let t of r){let r=b(t,t=>typeof t==`object`&&!!t&&t.type===`VariableDeclarator`&&n(t.id,e.name)&&t.init!==void 0);if(r)return r.init}}function cl(e){if(!T(e))return!1;let t=a(e),n=b(t,nt)===void 0?sl(t)??t:t;return b(n,nt)!==void 0&&b(n,ct)===void 0}const ll={"no-react-state":Ba,"no-if-statement":Va,"no-switch-statement":Ha,"no-ternary":Ua,"no-return-null":Wa,"no-option-as":Ga,"no-effect-never":Ka,"no-arrow-ladder":qa,"no-branch-in-object":Ja,"no-iife-wrapper":Ya,"no-return-in-arrow":Xa,"no-return-in-callback":Za,"no-effect-fn-generator":Qa,"no-effect-sync-console":$a,"no-console-in-effect-flow":eo,"no-effect-log-without-structured-context":to,"require-span-on-public-service-method":no,"no-runpromise-in-non-async-test-body":ro,"require-effect-flip-for-error-test":io,"no-test-mock-layer-when-default-available":ao,"no-nested-effect-gen":oo,"no-yield-without-star-in-effect-gen":so,"no-piped-yield-in-gen":co,"no-gen-for-mapping":lo,"prefer-gen-for-workflow":uo,"no-business-logic-in-pipe":go,"no-large-anonymous-flow":fo,"no-effect-in-flow":po,"prefer-named-flow":mo,"prefer-flow-for-pure-pipeline":ho,"prefer-pipe-for-behavior":_o,"prefer-decorated-effect-before-gen":vo,"no-workflow-in-behavior-pipe":yo,"no-mixed-pillar-function":bo,"no-clever-effect-expression":xo,"prefer-extracted-concept":So,"prefer-effect-service":Co,"no-layer-provide-in-service-definition":wo,"require-service-accessors":To,"require-service-dependencies":Eo,"no-namespace-effect-import":Do,"no-manual-service-object-export":Oo,"no-layer-merge-in-request-handler":No,"no-service-method-returning-promise":Po,"prefer-layer-pipe":ko,"no-inline-layer-provide-in-program":Ao,"prefer-layer-mergeall-for-infrastructure":jo,"no-service-layer-scatter":Mo,"no-match-void-branch":Fo,"no-json-parse-without-schema":Hs,"no-date-now-in-effect":Us,"no-new-date-in-domain-logic":Ws,"no-match-effect-branch":Io,"warn-effect-sync-wrapper":Lo,"no-effect-side-effect-wrapper":Ro,"no-effect-all-step-sequencing":zo,"no-async-effect-combinator-callback":Bo,"no-throw-in-effect-logic":Vo,"no-or-die-outside-boundary":Ho,"no-swallowed-catch-all":Uo,"no-effect-ignore":Zo,"no-try-catch-in-effect-logic":Qo,"no-promise-api-in-effect-logic":$o,"no-try-catch":es,"no-effect-wrapper-alias":ts,"no-manual-effect-channels":ns,"no-wrapgraphql-catchall":rs,"no-render-side-effects":is,"no-atom-registry-effect-sync":as,"no-family-collection-read":os,"no-inline-runtime-provide":ss,"no-naked-object-state-update":cs,"no-effect-succeed-variable":ls,"no-effect-type-alias":us,"no-public-generic-effect-error":ds,"no-early-catchall-null":Go,"no-empty-error-tag":Wo,"no-expected-state-as-error":Ko,"no-exception-domain-error":qo,"no-effect-fail-error-message":Jo,"no-catchall-generic-rethrow":Yo,"no-log-only-error-handling":Xo,"no-error-as-public-effect-error":ps,"no-unknown-public-error-channel":ms,"no-mixed-effect-error-shapes":hs,"no-model-overlay-cast":gs,"no-unknown-boolean-coercion-helper":_s,"no-fromnullable-nullish-coalesce":vs,"no-option-boolean-normalization":ys,"no-string-sentinel-return":bs,"no-string-sentinel-const":xs,"no-raw-domain-id-alias":Ss,"no-boolean-domain-flag":Cs,"no-magic-domain-string":ws,"no-raw-domain-primitive-params":Ts,"no-raw-time-domain-field":Es,"no-hidden-effect-execution":Rs,"no-boundary-try-catch-without-effect-map":Vs,"no-node-fs-in-effect-code":Ls,"no-node-platform-in-shared-code":Ps,"no-process-env-direct-read":Fs,"no-overloaded-options-object":Gs,"no-domain-logic-in-conditional":Ks,"no-implicit-state-machine-object":qs,"no-adhoc-domain-error":Js,"no-domain-meaning-by-folder-only":Ys,"no-effect-as":Xs,"no-effect-do":Zs,"no-effect-bind":$s,"no-runtime-runfork":ec,"no-run-effect-outside-boundary":tc,"no-effect-async":nc,"prevent-dynamic-imports":Ec,"no-nested-effect-call":rc,"no-effect-ladder":ic,"no-flatmap-ladder":ac,"no-pipe-ladder":oc,"no-call-tower":sc,"no-effect-orElse-ladder":cc,"no-unbounded-effect-all":lc,"no-fire-and-forget-fork":uc,"no-fork-in-loop":dc,"no-race-without-cleanup":fc,"no-unobserved-fiber":pc,"no-unbounded-concurrent-retry":mc,"no-blocking-call-in-effect":hc,"no-promise-concurrency-in-effect":gc,"no-shared-mutable-state-across-fibers":_c,"no-timeout-with-noninterruptible-promise":vc,"no-uninterruptible-concurrent-region":yc,"no-unbounded-queue-or-pubsub":bc,"no-global-mutable-concurrency-state":xc,"no-manual-deferred-coordination":Sc,"no-acquire-without-scoped-release":Cc,"no-manual-resource-close":Ac,"no-unbound-scope":Jc,"no-resource-succeed-escape":Yc,"no-resource-without-acquire-release":t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){!t||q(e)||!Gn(n)||$c(n)||W(e,n,`Rule: acquire resources with an Effect release owner. Why: open/connect/create calls can leak across failure and interruption when they are ordinary calls. Fix: use Effect.acquireRelease, Effect.acquireUseRelease, Effect.scoped, or a matching finalizer.`)}}}}),"no-request-scoped-long-lived-resource":t({meta:{schema:K},create(e){let t=!1,n=new WeakSet,r=t=>{for(let r of al(t))typeof r!=`object`||!r||n.has(r)||(n.add(r),W(e,r,`Rule: do not acquire long-lived resources inside request-scoped handlers. Why: per-request clients and pools multiply connections and make shutdown ownership ambiguous. Fix: provide the resource through a Layer or a longer-lived service boundary.`))};return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},FunctionDeclaration(n){t&&!q(e)&&r(n)},FunctionExpression(n){t&&!q(e)&&r(n)},ArrowFunctionExpression(n){t&&!q(e)&&r(n)}}}}),"no-global-resource-singleton":t({meta:{schema:K},create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},NewExpression(n){!t||q(e)||Z(n)!==void 0||!Xc(n)||W(e,n,`Rule: do not create global resource singletons in Effect modules. Why: module-level clients and pools bypass Layer ownership and make tests and shutdown order implicit. Fix: construct the resource in a Layer or Effect.Service and provide it at the application boundary.`)}}}}),"no-run-with-open-resource":t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=ol(n);T(n)&&r!==void 0&&W(e,n,`Rule: do not run an Effect while an unowned resource is open in the same scope. Why: runtime execution can finish without closing the resource. Fix: move acquisition into acquireRelease/scoped ownership and run only the managed effect.`)}}}}),"no-nested-acquire-release":t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){if(!t)return;let r=nl(n);r&&W(e,r,`Rule: avoid deeply nested resource acquisition. Why: nested release stacks are difficult to audit and compose. Fix: build a named Layer or combine independent resources into one managed acquisition boundary.`)}}}}),"no-missing-layer-provision-at-run":t({create(e){let t=!1;return{ImportDeclaration(e){let n=G(e);n&&J(n)&&(t=!0)},CallExpression(n){t&&cl(n)&&W(e,n,`Rule: provide service layers before running an Effect that retrieves services. Why: an unprovided tag fails at runtime and hides the dependency contract at the boundary. Fix: compose the required Layer and use Effect.provide or Layer.provide before Effect.run*.`)}}}}),"no-yield-with-held-semaphore-permit":wc,"no-yield-with-held-mutable-ref":Tc,"no-unscoped-background-fiber":Dc},ul=[`no-runpromise-in-non-async-test-body`,`require-effect-flip-for-error-test`,`no-test-mock-layer-when-default-available`],dl=[`no-manual-deferred-coordination`,`no-yield-with-held-semaphore-permit`,`no-yield-with-held-mutable-ref`,`no-unscoped-background-fiber`],fl=[`no-early-catchall-null`,`no-empty-error-tag`],pl=[`no-business-logic-in-pipe`],ml=[`prefer-flow-for-pure-pipeline`],hl=[`no-request-scoped-long-lived-resource`,`no-global-resource-singleton`,`no-nested-acquire-release`,`no-missing-layer-provision-at-run`];function Q(e){return Object.fromEntries(e.map(e=>[`linteffect/${e}`,`error`]))}function $(e){return{jsPlugins:gl,rules:e}}const gl=[{name:`linteffect`,specifier:`@opsydyn/oxlint-effect`}],_l=Q([`no-react-state`,`no-runtime-runfork`,`no-run-effect-outside-boundary`,`no-or-die-outside-boundary`,`prevent-dynamic-imports`,`no-render-side-effects`,`no-inline-runtime-provide`]),vl=Q([`no-effect-as`,`no-effect-do`,`no-effect-bind`,`no-effect-async`,`no-effect-ignore`,`no-effect-never`,`no-effect-fn-generator`,`no-nested-effect-gen`,`no-yield-without-star-in-effect-gen`,`no-async-effect-combinator-callback`,`no-throw-in-effect-logic`,`no-try-catch-in-effect-logic`,`no-promise-api-in-effect-logic`,`no-swallowed-catch-all`,`no-manual-effect-channels`,`no-effect-type-alias`,`no-public-generic-effect-error`]),yl=Q([`no-unbounded-effect-all`,`no-fire-and-forget-fork`,`no-fork-in-loop`,`no-race-without-cleanup`,`no-unobserved-fiber`,`no-unbounded-concurrent-retry`,`no-blocking-call-in-effect`,`no-promise-concurrency-in-effect`,`no-shared-mutable-state-across-fibers`,`no-timeout-with-noninterruptible-promise`,`no-uninterruptible-concurrent-region`,`no-unbounded-queue-or-pubsub`,`no-global-mutable-concurrency-state`,...dl,`no-acquire-without-scoped-release`]),bl=Q([`no-manual-resource-close`,`no-unbound-scope`,`no-resource-succeed-escape`,`no-resource-without-acquire-release`,...hl,`no-run-with-open-resource`]),xl=Q([`no-nested-effect-call`,`no-effect-ladder`,`no-flatmap-ladder`,`no-pipe-ladder`,`no-call-tower`,`no-effect-orElse-ladder`,`no-effect-wrapper-alias`,`warn-effect-sync-wrapper`,`no-effect-side-effect-wrapper`,`no-effect-all-step-sequencing`,`no-effect-succeed-variable`]),Sl=Q([`no-if-statement`,`no-switch-statement`,`no-ternary`,`no-try-catch`,`no-arrow-ladder`,`no-iife-wrapper`,`no-return-in-arrow`,`no-return-in-callback`,`no-return-null`,`no-branch-in-object`]),Cl=Q([`no-option-as`,`no-match-void-branch`,`no-match-effect-branch`,`no-model-overlay-cast`,`no-unknown-boolean-coercion-helper`,`no-fromnullable-nullish-coalesce`,`no-option-boolean-normalization`,`no-string-sentinel-return`,`no-string-sentinel-const`]),wl=Q([`no-effect-sync-console`,`no-atom-registry-effect-sync`,`no-family-collection-read`,`no-naked-object-state-update`,`no-wrapgraphql-catchall`]),Tl=Q([`no-raw-domain-id-alias`,`no-boolean-domain-flag`,`no-magic-domain-string`,`no-raw-domain-primitive-params`,`no-raw-time-domain-field`,`no-overloaded-options-object`,`no-domain-logic-in-conditional`,`no-implicit-state-machine-object`,`no-adhoc-domain-error`,`no-domain-meaning-by-folder-only`,`no-new-date-in-domain-logic`]),El=[`no-error-as-public-effect-error`,`no-unknown-public-error-channel`,`no-mixed-effect-error-shapes`,`no-expected-state-as-error`],Dl=Q([...El,`no-early-catchall-null`,`no-empty-error-tag`,`no-exception-domain-error`,`no-effect-fail-error-message`,`no-catchall-generic-rethrow`,`no-log-only-error-handling`]),Ol={...Tl,...Dl},kl=Q([`no-piped-yield-in-gen`,`no-gen-for-mapping`,`prefer-gen-for-workflow`,...pl]),Al=Q([`no-large-anonymous-flow`,`no-effect-in-flow`,`prefer-named-flow`,...ml]),jl=Q([`prefer-pipe-for-behavior`,`prefer-decorated-effect-before-gen`,`no-workflow-in-behavior-pipe`]),Ml=Q([`no-mixed-pillar-function`,`no-clever-effect-expression`,`prefer-extracted-concept`]),Nl=Q([`prefer-effect-service`,`no-layer-provide-in-service-definition`,`require-service-accessors`,`require-service-dependencies`,`no-namespace-effect-import`,`no-manual-service-object-export`,`no-layer-merge-in-request-handler`,`no-service-method-returning-promise`,`prefer-layer-pipe`,`no-inline-layer-provide-in-program`,`prefer-layer-mergeall-for-infrastructure`,`no-service-layer-scatter`]),Pl=Q([`no-hidden-effect-execution`,`no-boundary-try-catch-without-effect-map`,`no-node-fs-in-effect-code`,`no-json-parse-without-schema`,`no-date-now-in-effect`,`no-node-platform-in-shared-code`,`no-process-env-direct-read`]),Fl=Q([`no-console-in-effect-flow`,`no-effect-log-without-structured-context`,`require-span-on-public-service-method`,...ul]),Il=Q(Object.keys(ll)),Ll=[...ul,...dl,...fl,...pl,...ml,...hl,...El,`no-resource-succeed-escape`],Rl=Q(Object.keys(ll).filter(e=>!Ll.includes(e))),zl={reactAndRuntimeBoundaries:_l,effectComposition:vl,concurrencySafety:yl,resourceLifetime:bl,pipelineShapeAndSequencing:xl,branchingAndLocalControlFlow:Sl,optionMatchAndDataNormalization:Cl,atomStateAndPlatformBoundaries:wl,domainModeling:Tl,errorModeling:Dl,ddd:Ol,effectFlow:kl,pureTransformation:Al,behaviorDecoration:jl,styleSeparation:Ml,serviceAndLayerArchitecture:Nl,platformAndBoundaryHygiene:Pl,testingObservabilityAndQa:Fl},Bl=$(Rl),Vl=$(_l),Hl=$(vl),Ul=$(yl),Wl=$(bl),Gl=$(xl),Kl=$(Sl),ql=$(Cl),Jl=$(wl),Yl=$(Tl),Xl=$(Dl),Zl=$(Ol),Ql=$(kl),$l=$(Al),eu=$(jl),tu=$(Ml),nu=$(Nl),ru=$(Pl),iu=$(Fl),au={recommended:Bl,reactAndRuntimeBoundaries:Vl,effectComposition:Hl,concurrencySafety:Ul,resourceLifetime:Wl,pipelineShapeAndSequencing:Gl,branchingAndLocalControlFlow:Kl,optionMatchAndDataNormalization:ql,atomStateAndPlatformBoundaries:Jl,domainModeling:Yl,errorModeling:Xl,ddd:Zl,effectFlow:Ql,pureTransformation:$l,behaviorDecoration:eu,styleSeparation:tu,serviceAndLayerArchitecture:nu,platformAndBoundaryHygiene:ru,testingObservabilityAndQa:iu};var ou=e({meta:{name:`linteffect`},rules:ll});export{Il as allRules,Jl as atomStateAndPlatformBoundaries,wl as atomStateAndPlatformBoundariesRules,eu as behaviorDecoration,jl as behaviorDecorationRules,Kl as branchingAndLocalControlFlow,Sl as branchingAndLocalControlFlowRules,Ul as concurrencySafety,yl as concurrencySafetyRules,Zl as ddd,Ol as dddRules,ou as default,Yl as domainModeling,Tl as domainModelingRules,Hl as effectComposition,vl as effectCompositionRules,Ql as effectFlow,kl as effectFlowRules,Xl as errorModeling,Dl as errorModelingRules,gl as jsPlugins,ql as optionMatchAndDataNormalization,Cl as optionMatchAndDataNormalizationRules,Gl as pipelineShapeAndSequencing,xl as pipelineShapeAndSequencingRules,ru as platformAndBoundaryHygiene,Pl as platformAndBoundaryHygieneRules,au as presets,$l as pureTransformation,Al as pureTransformationRules,Vl as reactAndRuntimeBoundaries,_l as reactAndRuntimeBoundariesRules,Bl as recommended,Rl as recommendedRules,Wl as resourceLifetime,bl as resourceLifetimeRules,zl as ruleGroups,nu as serviceAndLayerArchitecture,Nl as serviceAndLayerArchitectureRules,tu as styleSeparation,Ml as styleSeparationRules,iu as testingObservabilityAndQa,Fl as testingObservabilityAndQaRules};
1
+ function e(e){const t=e[0];if("object"!=typeof t||null===t||!Object.hasOwn(t,"effectVersion"))return 4;const n=t.effectVersion;if(3===n||4===n)return n;throw new Error("effectVersion must be 3 or 4")}function t(e){const t=e[0];return[{type:"object",additionalProperties:!1,...t,properties:{...t?.properties,effectVersion:{type:"integer",enum:[3,4]}}},...e.slice(1)]}function n(e){return"object"==typeof e&&null!==e}function r(e,t){return n(e)&&"Identifier"===e.type&&"string"==typeof e.name&&(void 0===t||e.name===t)}function o(e,t,o){if(!n(e))return!1;const i=e;return"MemberExpression"===i.type&&!0!==i.computed&&r(i.object,t)&&r(i.property,o)}function i(e){return _e(e,"Effect")&&Array.isArray(e.arguments)}function a(e){return e.arguments[0]}function c(e,t){return!!i(e)&&r(e.callee.property,t)}function s(e){if(!i(e))return!1;const t=a(e);return!!i(t)&&i(a(t))}function u(e){return!!i(e)&&e.arguments.slice(0,2).some(e=>i(e))}function l(e,t,n=new WeakSet){return void 0!==oe(e,e=>c(e,t),n)}function f(e,t){return(c(e,"flatMap")||4===t&&c(e,"flatMapEager"))&&(l(e.arguments,"flatMap")||4===t&&l(e.arguments,"flatMapEager"))?"Rule: avoid nested Effect.flatMap. Why: it hides sequencing and pushes laddered control flow. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.":c(e,"flatten")&&l(a(e),"map")?"Rule: avoid map+flatten ladders. Why: they hide sequencing. Fix: build context once (Effect.all/Effect.map) and run a single flatMap.":void 0}function p(e){if(!c(e,"orElse"))return!1;const t=a(e);return Mi.some(e=>l(t,e))}function d(e){if(!n(e))return!1;const t=e;if("CallExpression"!==t.type)return!1;if(r(t.callee,"pipe"))return!0;const o=t.callee;return n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&r(o.property,"pipe")}function m(e,t=new WeakSet){return void 0!==oe(e,e=>d(e),t)}function y(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)&&"object"==typeof t.callee&&null!==t.callee&&"ArrowFunctionExpression"===t.callee.type}function h(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)&&"object"==typeof t.callee&&null!==t.callee&&("ArrowFunctionExpression"===t.callee.type||"FunctionExpression"===t.callee.type)}function g(e,t=new WeakSet){return oe(e,y,t)}function b(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>b(e,t)):n(e)?t.has(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:b(n,t))):[]}function v(e,t){if(!n(e))return!1;const r=e,i=3===t?"filter":"makeFilter";return"CallExpression"===r.type&&(o(r.callee,"S",i)||o(r.callee,"Schema",i))}function w(e,t){if(!n(e))return[];const r=e;return"CallExpression"!==r.type||!Array.isArray(r.arguments)||v(r,t)?[]:r.arguments.flatMap(e=>{if(!n(e)||"ArrowFunctionExpression"!==e.type)return[];const t=e.body;return n(t)&&"BlockStatement"===t.type?b(t):[]})}function E(e){if(!n(e))return[];const t=e;return"CallExpression"===t.type&&Array.isArray(t.arguments)?t.arguments.flatMap(e=>n(e)&&"FunctionExpression"===e.type&&!0!==e.generator?b(e.body):[]):[]}function x(e){return n(e)&&"FunctionExpression"===e.type&&!0===e.generator}function S(e,t,r=3){const o=4===r&&"fn"===t&&n(e)&&"CallExpression"===e.type&&c(e.callee,"fn");if(!c(e,t)&&!o)return;const i=4===r?e.arguments.find(x):a(e);return x(i)?i:void 0}function k(e,t,n=3){return void 0!==S(e,t,n)}function A(e,t=3){if(i(e)){const n=e.callee.property;if(r(n)&&(Ti.has(n.name)||4===t&&("fnUntraced"===n.name||"fnUntracedEager"===n.name)))return!0}if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&c(o.callee,"fn")}function R(e){return n(e)&&"CallExpression"===e.type&&o(e.callee,"Date","now")}function F(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>F(e,t)):n(e)?t.has(e)?[]:(t.add(e),"YieldExpression"===e.type&&!0===e.delegate&&d(e.argument)?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:F(n,t))):[]}function W(e,t,r=new WeakSet){return Array.isArray(e)?e.some(e=>W(e,t,r)):!!n(e)&&!r.has(e)&&(r.add(e),e.type===t||Object.entries(e).some(([e,n])=>"parent"!==e&&W(n,t,r)))}function D(e,t,n=new WeakSet){return void 0!==oe(e,e=>r(e,t),n)}function C(e,t=new WeakSet){return void 0!==oe(e,e=>i(e),t)}function j(e){if(!n(e)||"VariableDeclaration"!==e.type)return;const t=e.declarations;if(!Array.isArray(t)||1!==t.length)return;const o=t[0];return n(o)&&"VariableDeclarator"===o.type&&r(o.id)&&"object"==typeof o.init&&null!==o.init&&"YieldExpression"===o.init.type&&!0===o.init.delegate?o.id.name:void 0}function M(e,t){if(!n(e)||"ReturnStatement"!==e.type)return!1;const o=e.argument;return!(void 0===o||r(o,t)||W(o,"YieldExpression")||W(o,"AwaitExpression")||C(o)||D(o,"Promise"))}function T(e){if(!n(e)||"CallExpression"!==e.type)return[];const t=e,o=Array.isArray(t.arguments)?t.arguments:[];if(r(t.callee,"pipe"))return o.slice(1);const i=t.callee;return n(i)&&"MemberExpression"===i.type&&!0!==i.computed&&r(i.property,"pipe")?o:[]}function q(e,t=3){if(!i(e))return!1;const n=e.callee.property;return r(n)&&(3===t?qi.has(n.name):"flatMapEager"===n.name||"zipRight"!==n.name&&qi.has(n.name))}function P(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&r(e.callee,"flow")}function I(e){return P(e)&&e.arguments.length>=5}function O(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async,t)}function L(e){return C(e)||W(e,"YieldExpression")||W(e,"AwaitExpression")||O(e)||Je(e)||D(e,"Promise")||D(e,"Runtime")}function N(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e.callee;return r(t)?t.name:n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.property)?t.property.name:void 0}function z(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=N(e);return!(C(e)||W(e,"AwaitExpression")||W(e,"YieldExpression")||D(e,"Promise")||Je(e)||Pi.has(t??"")||"object"==typeof e.callee&&null!==e.callee&&r(e.callee.object,"console"))}function $(e){if(!z(e))return 0;const t=e;return[t.callee,...t.arguments??[]].filter(e=>!K(e)).reduce((e,t)=>Math.max(e,$(t)),0)+1}function V(e,t=3){if(!i(e))return!1;const n=e.callee.property;if(!r(n))return!1;const o=n.name;return 3===t?Ii.has(o):"catchAll"!==o&&"catchSome"!==o&&"timeoutFail"!==o&&Ii.has(o)||Oi.includes(o)||"timeoutOption"===o||"timeoutOrElse"===o||"catchNoSuchElement"===o}function B(e){return i(e)||d(e)}function U(e,t){return!(!n(e)||"YieldExpression"!==e.type||!0!==e.delegate||!d(e.argument))&&T(e.argument).some(e=>V(e,t))}function Q(e,t,r=new Set,i=new WeakSet){if((c(e,"gen")||q(e,t))&&r.add("workflow"),P(e)&&r.add("pure"),V(e,t)&&r.add("behavior"),(_e(e,"Layer")||o(e,"Layer","pipe"))&&r.add("layer"),Array.isArray(e)){for(const n of e)Q(n,t,r,i);return r}if(!n(e))return r;if(i.has(e))return r;i.add(e);for(const[n,o]of Object.entries(e))"parent"!==n&&Q(o,t,r,i);return r}function K(e){return n(e)&&("FunctionDeclaration"===e.type||"FunctionExpression"===e.type||"ArrowFunctionExpression"===e.type)}function _(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>Math.max(e,_(n,t)),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=Object.entries(e).reduce((e,[n,r])=>"parent"===n?e:Math.max(e,_(r,t)),0);return"CallExpression"===e.type?r+1:r}function Y(e,t=3){return!!o(e,3===t?"Effect":"Context","Service")||!(!n(e)||"CallExpression"!==e.type)&&Y(e.callee,t)}function J(e,t=3){if(!n(e)||"CallExpression"!==e.type)return;const r=e;return Y(r.callee,t)?[...r.arguments??[]].reverse().find(e=>n(e)&&"ObjectExpression"===e.type):void 0}function G(e){if(n(e)&&"ClassDeclaration"===e.type)return J(e.superClass)}function H(e,t){if(3===t)return G(e);const n=e?.type;return J("ClassDeclaration"===n||"ClassExpression"===n?e.superClass:e,t)}function Z(e,t){return 3===t?Gn(e,"effect")??Gn(e,"scoped"):Gn(e,"make")}function X(e){return _e(e,"Context","Tag")||_e(e,"Context","GenericTag")}function ee(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Layer","provide"),t)}function te(e){return er(Gn(e,"accessors"),!0)}function ne(e){if(!ko(fo(e)??""))return;const t=n(e)?e.specifiers:void 0;return Array.isArray(t)?t.find(e=>n(e)&&"ImportNamespaceSpecifier"===e.type):void 0}function re(e){return n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&r(e.argument)&&e.argument.name.endsWith("Service")}function oe(e,t,r=new WeakSet,o=!1){if(!o||n(e)&&!r.has(e)&&!K(e)&&"ClassDeclaration"!==e.type&&"ClassExpression"!==e.type){if(t(e))return e;if(Array.isArray(e))for(const n of e){const e=oe(n,t,r,o);if(e)return e}else if(n(e)&&!r.has(e)){r.add(e);for(const[n,i]of Object.entries(e)){if("parent"===n)continue;const e=oe(i,t,r,o);if(e)return e}}}}function ie(e,t,r=new WeakSet,o=!1,i=!1){if(i&&K(e))return[];if(o&&n(e)&&r.has(e))return[];const a=t(e)?[e]:[];return o&&a.length?a:Array.isArray(e)?e.flatMap(e=>ie(e,t,r,o,i)).concat(a):n(e)?r.has(e)?a:(r.add(e),Object.entries(e).reduce((e,[n,a])=>"parent"===n?e:e.concat(ie(a,t,r,o,i)),a)):a}function ae(e){if(!Gn(e,"dependencies"))return oe(Gn(e,"effect")??Gn(e,"scoped"),re)}function ce(e){if(!_e(e,"Layer"))return!1;const t=e.callee.property;return r(t)&&("provide"===t.name||t.name.startsWith("merge"))}function se(e){if(!n(e)||"FunctionDeclaration"!==e.type)return!1;const t=e.id;return r(t)&&/(handler|route|request)$/i.test(t.name)}function ue(e){return c(e,"provide")||_e(e,"Layer","provide")}function le(e){return r(e)&&/(Layer|Live)$/.test(e.name)}function fe(e){if(n(e)&&"VariableDeclaration"===e.type)return e.declarations?.find(e=>n(e)&&le(e.id)&&oe(e.init,ue))}function pe(e,t=3){if(!K(e))return!1;if(an(un(e),"Promise"))return!0;if(3===t)return void 0!==ke(e.body);if(!0===e.async)return!0;const o=e=>xe(e)||Se(e,t)||n(e)&&"NewExpression"===e.type&&r(e.callee,"Promise"),i=e.body;return o(i)||void 0!==ve(i,e=>n(e)&&"ReturnStatement"===e.type&&o(e.argument))}function de(e,t=3){return n(e)&&"Property"===e.type&&pe(e.value,t)}function me(e,t=3){if(3===t)return oe(e,de);const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return;r.add(e);const i=e;if("ObjectExpression"===i.type)return i.properties?.find(e=>de(e,t));if(K(e)){const e=i.body;if("BlockStatement"!==e?.type)return o(e);for(const t of ie(e,e=>n(e)&&"ReturnStatement"===e.type,new WeakSet,!0,!0)){const e=o(t.argument);if(e)return e}return}const a=S(e,"gen",t)??S(e,"fn",t);if(a)return o(a);const s=Array.isArray(i.arguments)?i.arguments[0]:void 0;if(c(e,"succeed")||c(e,"sync"))return o(s);if(d(e)){const e=i.callee;return o("MemberExpression"===e?.type?e.object:s)}};return o(Gn(e,"make"))}function ye(e){if(!n(e)||"ObjectExpression"!==e.type)return!1;const t=e.properties;return Array.isArray(t)&&t.some(e=>n(e)&&"Property"===e.type&&(K(e.value)||c(e.value,"fn")))}function he(e){return n(e)&&("ArrowFunctionExpression"===e.type||"FunctionExpression"===e.type)&&!0===e.async}function ge(e){return 3===e?Li:Ni}function be(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&ge(t).has(n.name)?e.arguments.flatMap(e=>K(e)?[e]:4!==t||"catchTags"!==n.name&&"catchReasons"!==n.name||!Ve(e)?[]:e.properties.map(e=>e.value).filter(K)):[]}function ve(e,t){return oe(e,t,new WeakSet,!0)}function we(e,t,n){const r=3===t?oe:ve,o=S(e,"gen",t);if(o)return r(o.body,n);for(const o of be(e,t)){const e=r(Cn(o),n);if(e)return e}}function Ee(e,t,r){return we(e,t,e=>n(e)&&e.type===r)}function xe(e){return _e(e,"Promise")&&zi.has(String(e.callee.property.name))}function Se(e,t=3){if(!n(e)||"CallExpression"!==e.type)return!1;const o=e.callee,i=o?.object;return n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&(3===t||xe(i)||"NewExpression"===i?.type&&r(i.callee,"Promise")||Se(i,t))&&(r(o.property,"then")||r(o.property,"catch")||r(o.property,"finally"))}function ke(e){return oe(e,e=>xe(e)||Se(e))}function Ae(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;return n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.object,"Promise")&&r(t.property)&&$i.has(t.property.name)}function Re(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=Re(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),Ae(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=Re(r,t);if(e)return e}}}function Fe(e){if(!n(e))return!1;const t=e;return("ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type)&&Array.isArray(t.params)&&t.params.length>0}function We(e){if(!c(e,"tryPromise"))return!1;const t=a(e);return!!Fe(t)||Fe(Gn(t,"try"))}function De(e){return!!c(e,"promise")||c(e,"tryPromise")&&!We(e)}function Ce(e){return r(e.callee,"pipe")?e.arguments[0]:e.callee.object}function je(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;if(r(t))return t.name.endsWith("Sync");if(!n(t)||"MemberExpression"!==t.type||!0===t.computed||!r(t.object)||!r(t.property))return!1;const o=t.object.name,i=t.property.name;return Bi.has(o)&&i.endsWith("Sync")}function Me(e,t=new WeakSet){if(Array.isArray(e))for(const n of e){const e=Me(n,t);if(e)return e}else if(n(e)&&!t.has(e)){if(t.add(e),je(e))return e;for(const[n,r]of Object.entries(e)){if("parent"===n)continue;const e=Me(r,t);if(e)return e}}}function Te(e,t){if(i(e)){const t=e.callee.property;if(r(t)&&Ui.has(t.name))return{program:a(e),hasContext:!1}}if(4!==t||!n(e)||"CallExpression"!==e.type)return;const o=e.callee;if(!i(o))return;const c=o.callee.property;return r(c)&&c.name.endsWith("With")&&Ui.has(c.name.slice(0,-4))?{program:a(e),hasContext:!0}:void 0}function qe(e,t){return void 0!==Te(e,t)}function Pe(e,t){return o(e,"Effect","orDie")||c(e,"orDie")||3===t&&(o(e,"Effect","orDieWith")||c(e,"orDieWith"))}function Ie(e,t){return Pe(e,t)?e:d(e)?en(e).find(e=>Pe(e,t)):void 0}function Oe(e,t=3){return c(e,"succeed")||c(e,"asVoid")&&(3===t||Oe(a(e),t))||c(e,"ignore")||tr(e)}function Le(e){return o(e,"Effect","ignore")||c(e,"ignore")}function Ne(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.object,"console")&&r(t.callee.property)}function ze(e){return Kn(e)||n(e)&&"TemplateLiteral"===e.type}function $e(e){return c(e,"logError")||c(e,"logWarning")}function Ve(e){return n(e)&&"ObjectExpression"===e.type}function Be(e,t){return!!oe(e,e=>c(e,"annotateLogs"))||t.arguments.slice(1).some(e=>Ve(e)||!ze(e))}function Ue(e){return ie(e,t=>$e(t)&&ze(a(t))&&!Be(e,t))}function Qe(e,t=3){if(!i(e))return[];const n=e.callee.property;if(!r(n)||!(3===t?Qi.has(n.name):"tapError"===n.name||"catchNoSuchElement"===n.name||Oi.includes(n.name)))return[];const o=e.arguments;return(4===t?o.flatMap(e=>"catchTags"!==n.name&&"catchReasons"!==n.name||!Ve(e)?[e]:e.properties.map(e=>e.value).filter(K)):o).map(Cn).filter(e=>void 0!==e)}function Ke(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&r(o.callee,t)}function _e(e,t,o){if(!n(e))return!1;const i=e;return"CallExpression"===i.type&&"object"==typeof i.callee&&null!==i.callee&&"MemberExpression"===i.callee.type&&!0!==i.callee.computed&&r(i.callee.object,t)&&r(i.callee.property)&&(void 0===o||r(i.callee.property,o))}function Ye(e){return _e(e,"Effect")&&e.callee.property.name.startsWith("log")}function Je(e,t=new WeakSet){return void 0!==oe(e,Ne,t)}function Ge(e,t=new WeakSet){return void 0!==oe(e,e=>Ke(e,"setState")||_e(e,"Atom","set")||Ke(e,"invalidate")||Ye(e)||Ne(e),t)}function He(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Ref","set")||_e(e,"Atom","set")||_e(e,"SubscriptionRef","set")||_e(e,"Reactivity","invalidate")||_e(e,"Fiber","interrupt")||Ye(e),t)}function Ze(e){if(!n(e))return!1;const t=e;return!("ObjectExpression"!==t.type||!Array.isArray(t.properties))&&t.properties.some(e=>{if(!n(e))return!1;const t=e,o=t.key,i=t.value;return(r(o,"concurrency")||n(o)&&"concurrency"===o.value)&&n(i)&&("Literal"===i.type||"NumericLiteral"===i.type)&&1===i.value})}function Xe(e){if(!n(e))return!1;const t=e;return!("ObjectExpression"!==t.type||!Array.isArray(t.properties))&&t.properties.some(e=>{if(!n(e))return!1;const t=e.key;return r(t,"concurrency")||n(t)&&"concurrency"===t.value})}function et(e){if(!n(e))return!1;const t=e;return"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.property,"map")}function tt(e){return c(e,"all")&&et(a(e))&&!Xe(e.arguments[1])}function nt(e,t=new WeakSet){return oe(e,e=>c(e,"fork"),t)}function rt(e){if(c(e,"forkChild")||c(e,"forkDetach"))return e;if(n(e)&&"CallExpression"===e.type&&(c(e.callee,"forkChild")||c(e.callee,"forkDetach")))return e;if(!d(e))return;const t=e.arguments?.at(-1);if(c(t,"forkChild")||c(t,"forkDetach"))return t;if(!n(t)||"MemberExpression"!==t.type)return;const o=t;return!0!==o.computed&&r(o.object,"Effect")&&(r(o.property,"forkChild")||r(o.property,"forkDetach"))?t:void 0}function ot(e,t){return 3===t?c(e,"fork")?e:void 0:rt(n(e)&&"YieldExpression"===e.type?e.argument:e)}function it(e,t,n=new WeakSet){return void 0!==oe(e,e=>i(e)&&r(e.callee.property)&&t.has(e.callee.property.name),n)}function at(e,t=new WeakSet){return void 0!==oe(e,e=>i(e)&&r(e.callee.property)&&Ki.has(e.callee.property.name)||_e(e,"Queue","take")||_e(e,"Deferred","await"),t)}function ct(e,t){if(!n(e))return!1;const o=e;return"CallExpression"===o.type&&Array.isArray(o.arguments)&&"object"==typeof o.callee&&null!==o.callee&&"MemberExpression"===o.callee.type&&!0!==o.callee.computed&&r(o.callee.property,t)}function st(e,t=3){if(4===t&&d(e)){const t=e.arguments.at(-1);return ct(t,"withPermit")||ct(t,"withPermits")?Ce(e):void 0}if(4===t&&[e,n(e)?e.callee:void 0].some(e=>_e(e,"TSemaphore","withPermit")||_e(e,"TSemaphore","withPermits")))return;if(!n(e)||"CallExpression"!==e.type)return;const r=e;if(Array.isArray(r.arguments)){if("object"==typeof r.callee&&null!==r.callee&&"CallExpression"===r.callee.type){const e=r.callee;if((ct(e,"withPermit")||ct(e,"withPermits"))&&r.arguments.length>0)return r.arguments[0]}return _e(r,"TSemaphore","withPermit")||_e(r,"TSemaphore","withPermits")?r.arguments[0]:ct(r,"withPermit")||ct(r,"withPermits")?r.arguments.at(-1):void 0}}function ut(e,t=3){if(4===t){const t=[e,d(e)?e.arguments.at(-1):e?.callee].find(e=>lt(e,"SynchronizedRef")||lt(e,"SubscriptionRef"));if(t){const n=t.arguments;return t!==e||n.length>1?n.at(-1):void 0}return}if(!n(e)||"CallExpression"!==e.type)return;const r=e;return Array.isArray(r.arguments)?lt(r.callee,"SynchronizedRef")&&r.arguments.length>0?r.callee.arguments.at(-1):lt(r,"SynchronizedRef")&&r.arguments.length>1||ft(r)&&!lt(r,"SynchronizedRef")?r.arguments.at(-1):void 0:void 0}function lt(e,t){return ft(e)&&r(e.callee.object,t)}function ft(e){return[..._i].some(t=>ct(e,t))}function pt(e,t){return o(e,"Effect",t)}function dt(e){return _e(e,"Deferred")&&Yi.has(e.callee.property.name)}function mt(e){return _e(e,"Deferred","await")&&Array.isArray(e.arguments)}function yt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&oe(t.init,dt)?t.id.name:void 0}function ht(e,t){return Boolean(oe(e,e=>{if(!_e(e,"Effect","addFinalizer")&&!_e(e,"Scope","addFinalizer"))return!1;const n=e.arguments;return Array.isArray(n)&&n.some(e=>{const n=Cn(e);return void 0!==n&&D(n,t)})}))}function gt(e){if(!d(e))return!1;const t=e.arguments;return Array.isArray(t)&&t.some(e=>pt(e,"scoped"))}function bt(e,t,o=3,a=[]){let s=n(e)?e.parent:void 0;const u=new WeakSet;for(;n(s);){if(u.has(s))return!1;if(u.add(s),i(s)&&(()=>{const e=s.callee.property;return r(e)&&(4===o?Vi.has(e.name)||Zi.has(e.name)||"interruptible"===e.name||"scoped"===e.name:Ji.has(e.name)||Gi.has(e.name))})()||(3===o?gt(s):d(s)&&(()=>{const e=s.arguments.at(-1);return[...Vi,...Zi,"interruptible","scoped"].some(t=>c(e,t)||pt(e,t))})())||4===o&&"CallExpression"===s.type&&i(s.callee)&&(()=>{const e=s.callee.callee.property;return r(e)&&(Vi.has(e.name)||Zi.has(e.name))})())return!0;if(K(s)){if(3===o?ht(s,t):a.some(e=>{for(let t=e.identifier.parent;t&&Ct(t,s);t=t.parent)if(_e(t,"Effect","addFinalizer")||_e(t,"Scope","addFinalizer"))return!0;return!1}))return!0;if(4===o){const e=s.parent;if(S(e,"gen",4)!==s&&S(e,"fn",4)!==s&&!be(e,4).includes(s))return!1}}s=s.parent}return!1}function vt(e){return[...Zi].some(t=>c(e,t)||pt(e,t))}function wt(e){return!(!n(e)||"CallExpression"!==e.type)&&(vt(e)||vt(e.callee)||d(e)&&vt(e.arguments?.at(-1)))}function Et(e,t=3){if(4===t){if(!wt(e))return!1;const t=e.parent;if(n(t)&&wt(t)&&(t.callee===e||d(t)&&t.arguments?.at(-1)===e))return!1;const r=e=>void 0!==oe(e,e=>[...Hi].some(t=>c(e,t)||pt(e,t)));if(r(e.arguments)||r(e.callee?.arguments))return!1;let o=t;const a=new WeakSet;for(;n(o)&&!a.has(o)&&(a.add(o),!K(o)||S(o.parent,"gen",4)===o||S(o.parent,"fn",4)===o||c(o.parent,"acquireUseRelease")&&o.parent.arguments?.[1]===o);){if(i(o)&&Hi.has(o.callee.property.name))return!1;if(d(o)&&r(o.arguments))return!1;o=o.parent}return!0}return!(!c(e,"race")&&!c(e,"raceAll")||it(e.arguments,Hi))}function xt(e){return c(e,"forEach")&&!Xe(e.arguments[2])}function St(e){return(tt(e)||xt(e))&&it(e.arguments,Xi)}function kt(e){if(!n(e)||"VariableDeclaration"!==e.type)return[];const t=e.declarations;return Array.isArray(t)?t.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)?[t.name]:[]}):[]}function At(e,t=new Set,r=new WeakSet){if(Array.isArray(e)){for(const n of e)At(n,t,r);return t}if(!n(e))return t;if(r.has(e))return t;if(r.add(e),"VariableDeclaration"===e.type)for(const n of kt(e))t.add(n);for(const[n,o]of Object.entries(e))"parent"!==n&&At(o,t,r);return t}function Rt(e){if(!n(e))return;const t=e;return"AssignmentExpression"===t.type&&r(t.left)?t.left.name:"UpdateExpression"===t.type&&r(t.argument)?t.argument.name:"CallExpression"===t.type&&"object"==typeof t.callee&&null!==t.callee&&"MemberExpression"===t.callee.type&&!0!==t.callee.computed&&r(t.callee.object)&&r(t.callee.property)&&ea.has(t.callee.property.name)?t.callee.object.name:void 0}function Ft(e,t,r=At(e),o=new WeakSet){if(Array.isArray(e)){for(const n of e){const e=Ft(n,t,r,o);if(e)return e}return}if(!n(e))return;if(o.has(e))return;o.add(e);const i=Rt(e);if(i&&t.has(i)&&!r.has(i))return e;for(const[n,i]of Object.entries(e)){if("parent"===n)continue;const e=Ft(i,t,r,o);if(e)return e}}function Wt(e){if(c(e,"fork")||c(e,"all")||c(e,"forEach"))return e.arguments}function Dt(e){if(c(e,"all")||c(e,"forEach"))return e.arguments;if(!rt(e))return;if(!d(e))return a(e);const t=e.callee.object;return r(e.callee,"pipe")?a(e):t}function Ct(e,t){if(Array.isArray(t))return t.some(t=>Ct(e,t));for(let n=e;n;n=n.parent)if(n===t)return!0;return!1}function jt(e){const t=e,n=t.parent;if("AssignmentExpression"===n?.type&&n.left===t)return n;if("UpdateExpression"===n?.type&&n.argument===t)return n;if("MemberExpression"===n?.type&&n.object===t&&!0!==n.computed&&r(n.property)&&ea.has(n.property.name)){const e=n.parent;if("CallExpression"===e?.type&&e.callee===n)return e}}function Mt(e,t){for(const n of t){if(n.identifiers.some(t=>Ct(t,e)))continue;const t=n.references.map(e=>jt(e.identifier)).find(t=>t&&Ct(t,e));if(t)return t}}function Tt(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean).map(e=>e.toLowerCase())}function qt(e){return Tt(e).some(e=>ra.has(e))}function Pt(e){if(r(e))return qt(e.name);if(!No(e))return!1;const t=e;return!0!==t.computed&&(r(t.property)&&qt(t.property.name)||Pt(t.object))}function It(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;if(!n(t)||"MemberExpression"!==t.type||!0===t.computed||!r(t.property))return!1;const o=t;return oa.has(o.property.name)&&Pt(o.object)}function Ot(e,t=3){if(4===t){const t=d(e)?e.arguments.at(-1):e?.callee,n=e=>[...aa].some(t=>c(e,t)||pt(e,t));return n(e)?e.arguments:n(t)?[...t.arguments??[],...d(e)?[Ce(e)]:e.arguments]:void 0}if(!i(e))return;const n=e.callee.property;return r(n)&&ta.has(n.name)?e.arguments:void 0}function Lt(e){if(!n(e)||"CallExpression"!==e.type)return!1;const t=e.callee;let o;if(r(t))o=t.name;else if(n(t)&&"MemberExpression"===t.type){const e=t;!0!==e.computed&&r(e.property)&&(o=e.property.name)}return!(!o||"acquireRelease"===o||"acquireUseRelease"===o)&&Tt(o).some(e=>na.has(e))&&qt(o)}function Nt(e,t){return!!(c(e,"acquireRelease")||c(e,"acquireUseRelease")||c(e,"scoped")||gt(e))||void 0!==t&&ht(e,t)}function zt(e){const t=new Set;for(const o of ie(e,e=>n(e)&&"VariableDeclarator"===e.type)){const n=o;r(n.id)&&oe(n.init,Lt)&&ht(e,n.id.name)&&t.add(n.id.name)}return t}function $t(e,t,o=new WeakSet,i=new Set,a=!1,s=3){if(Array.isArray(e)){for(const n of e)$t(n,t,o,i,a,s);return}if(!n(e)||o.has(e))return;if(o.add(e),4===s&&K(e)){const t=e.parent;if(S(t,"gen",4)!==e&&S(t,"fn",4)!==e&&!be(t,4).includes(e)&&!["sync","suspend","promise","tryPromise"].some(e=>c(t,e))&&!ct(t,"map"))return}if(Nt(e))return;const u=K(e)?new Set([...i,...zt(e)]):i,l="VariableDeclarator"===e.type?e:void 0,f=l&&r(l.id)?l.id.name:void 0,p=void 0!==f&&u.has(f);if(!Lt(e)||a)for(const[n,r]of Object.entries(e))"parent"!==n&&$t(r,t,o,u,a||p,s);else t.push(e)}function Vt(e,t=3){const n=[];return $t(e,n,void 0,void 0,!1,t),n}function Bt(e,t=new WeakSet){return!!it(e,ia)||!!_e(e,"Queue","take")||(Array.isArray(e)?e.some(e=>Bt(e,t)):!!n(e)&&!t.has(e)&&(t.add(e),Object.entries(e).some(([e,n])=>"parent"!==e&&Bt(n,t))))}function Ut(e,t=!1){return!!ve(e,e=>{if(_e(e,"Queue","take")||_e(e,"PubSub","take")||[...aa].some(t=>c(e,t)||pt(e,t))||t&&(["sleep","promise","tryPromise"].some(t=>c(e,t))||_e(e,"Deferred","await")))return!0;const n=S(e,"gen",4)??S(e,"fn",4);return!(!n||!Ut(n.body,t))||be(e,4).some(e=>Ut(Cn(e),t))})}function Qt(e,t=3){if(4===t){const t=c(e,"uninterruptible")?a(e):d(e)&&pt(e.arguments.at(-1),"uninterruptible")?Ce(e):void 0;return void 0!==t&&Ut(t)}return c(e,"uninterruptible")&&Bt(e.arguments[0])}function Kt(e,t=3){if(_e(e,"Queue","unbounded")||_e(e,"PubSub","unbounded"))return!0;if(4!==t)return!1;if(_e(e,"PubSub","makeAtomicUnbounded"))return!0;if(!_e(e,"Queue","make"))return!1;const o=a(e);if(!o||r(o,"undefined"))return!0;if(!Ve(o))return!1;if(o.properties.some(e=>"SpreadElement"===e.type))return!1;const i=Gn(o,"capacity");return!i||r(i,"undefined")||r(i,"Infinity")||n(i)&&"MemberExpression"===i.type&&!0!==i.computed&&r(i.object,"Number")&&r(i.property,"POSITIVE_INFINITY")}function _t(e){if(!n(e))return!1;const t=e;return"ObjectExpression"===t.type||"ArrayExpression"===t.type||"NewExpression"===t.type&&(r(t.callee,"Map")||r(t.callee,"Set"))||"CallExpression"===t.type&&(r(t.callee,"Map")||r(t.callee,"Set"))}function Yt(e){if(!n(e)||"VariableDeclaration"!==e.type)return[];const t=e,o=Array.isArray(t.declarations)?t.declarations:[];return"let"===t.kind||"var"===t.kind?kt(e):o.flatMap(e=>{if(!n(e))return[];const t=e.id;return r(t)&&_t(e.init)?[t.name]:[]})}function Jt(e){if(!n(e)||"VariableDeclarator"!==e.type)return;const t=e;return r(t.id)&&c(t.init,"fork")?t.id.name:void 0}function Gt(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e,o=t.callee;if(!(n(o)&&"MemberExpression"===o.type&&!0!==o.computed&&r(o.object,"Fiber")&&r(o.property)&&ca.has(o.property.name)&&Array.isArray(t.arguments)))return;const[i]=t.arguments;return r(i)?i.name:void 0}function Ht(e){if(!r(e))return!1;const t=e.parent;if(!t)return!1;if("ReturnStatement"===t.type&&t.argument===e)return!0;if(Gt(t)===e.name&&a(t)===e)return!0;const n="MemberExpression"===t.type&&t.object===e?t.parent:t;return d(n)&&void 0!==oe(n.arguments,e=>[...ca].some(t=>o(e,"Fiber",t)))}function Zt(e){return o(e,"Effect","asVoid")||_e(e,"Effect","asVoid")}function Xt(e){if(!n(e))return!1;const t=e;return!("CallExpression"!==t.type||!Array.isArray(t.arguments)||"object"!=typeof t.callee||null===t.callee||"MemberExpression"!==t.callee.type||!0===t.callee.computed||!r(t.callee.property,"pipe"))&&c(t.callee.object,"all")&&t.arguments.some(e=>Zt(e))}function en(e){if(!n(e)||!d(e))return[];const t=e;return r(t.callee,"pipe")?t.arguments:[t.callee.object,...t.arguments]}function tn(e){const[t]=en(e);return void 0!==t&&C(t)}function nn(e){if(tn(e))return!0;if(n(e)&&"ArrowFunctionExpression"===e.type){const t=e.body;return i(t)||tn(t)}return!1}function rn(e){return b(e).some(e=>n(e)&&(nn(e.argument)||i(e.argument)))}function on(e,t,o){if(!n(e)||"TSTypeReference"!==e.type)return!1;const i=e.typeName;return n(i)&&"TSQualifiedName"===i.type&&r(i.left,t)&&r(i.right,o)}function an(e,t){return n(e)&&"TSTypeReference"===e.type&&r(e.typeName,t)}function cn(e){if(!n(e))return[];const t=e.typeParameters??e.typeArguments;if(!n(t))return[];const r=t.params??t.arguments;return Array.isArray(r)?r:[]}function sn(e){return r(e,"Error")||an(e,"Error")}function un(e){if(!n(e))return;const t=e.returnType;return n(t)?t.typeAnnotation??t:void 0}function ln(e,t){return on(un(e),"Effect","Effect")||on(t,"Effect","Effect")}function fn(e){if(!n(e))return[];const t=e.body;if(!n(t))return[];if("BlockStatement"!==t.type)return[t];const r=(e,t=new WeakSet)=>{if(Array.isArray(e))return e.flatMap(e=>r(e,t));if(!n(e)||t.has(e))return[];t.add(e);const o=e;return"ReturnStatement"===o.type?[o.argument]:"ArrowFunctionExpression"===o.type||"FunctionExpression"===o.type||"FunctionDeclaration"===o.type?[]:Object.entries(o).flatMap(([e,n])=>"parent"===e?[]:r(n,t))};return r(t)}function pn(e){return fn(e).filter(e=>i(e)||tn(e))}function dn(e){return c(e,"withSpan")||d(e)&&en(e).some(e=>c(e,"withSpan"))}function mn(e,t){if(!ln(e,t))return;const n=pn(e);return 0===n.length||n.some(e=>!dn(e))?e:void 0}function yn(e){if(!n(e))return;const t=e.typeAnnotation;return n(t)?un(t.typeAnnotation??t):void 0}function hn(e){if(!n(e))return[];const t=e;if("ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type)return[];const r=t.declaration;return n(r)?"FunctionDeclaration"===r.type?[{functionNode:r}]:"VariableDeclaration"!==r.type?[]:(r.declarations??[]).flatMap(e=>{if(!n(e))return[];const t=e.init;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[{functionNode:t,declaredReturnType:yn(e.id)}]}):[]}function gn(e,t=3){if(4===t){const r=new WeakSet,o=e=>{if(!n(e)||r.has(e))return[];if(r.add(e),Ve(e))return[e];if(K(e))return fn(e).flatMap(o);const i=S(e,"gen",t)??S(e,"fn",t);if(i)return o(i);if(c(e,"succeed")||c(e,"sync")||c(e,"suspend"))return o(a(e));if(d(e)){const t=e.callee;return o("MemberExpression"===t.type?t.object:a(e))}return[]};return o(Gn(e,"make")).flatMap(e=>e.properties.filter(e=>"Property"===e.type&&K(e.value)).map(e=>e.value))}const r=Gn(e,"effect")??Gn(e,"scoped"),o=S(r,"gen"),i=o?fn(o).find(Ve):c(r,"succeed")&&Ve(a(r))?a(r):void 0;if(!i)return[];const s=i.properties;return Array.isArray(s)?s.flatMap(e=>{if(!n(e)||"Property"!==e.type)return[];const t=e.value;return!n(t)||"ArrowFunctionExpression"!==t.type&&"FunctionExpression"!==t.type?[]:[t]}):[]}function bn(e){return pn(e).some(e=>!dn(e))?e:void 0}function vn(e,t){const n=un(e)??t;if(!on(n,"Effect","Effect"))return;const[,r]=cn(n);return void 0===r?void 0:{annotation:n,errorChannel:r}}function wn(e){if(!n(e))return[];const t=e;return"ExportNamedDeclaration"!==t.type&&"ExportDefaultDeclaration"!==t.type?[]:hn(t).flatMap(({functionNode:e,declaredReturnType:t})=>{const n=vn(e,t);return n?[n]:[]})}function En(e){return wn(e).find(e=>sn(e.errorChannel))?.annotation}function xn(e){let t=e;const r=new WeakSet;for(;n(t);){if(r.has(t))return t;if(r.add(t),"TSParenthesizedType"!==t.type)return t;t=t.typeAnnotation}return t}function Sn(e){const t=xn(e);if(sn(t))return"Error";if(n(t))switch(t.type){case"TSUnknownKeyword":return"unknown";case"TSStringKeyword":return"string";case"TSNumberKeyword":return"number";case"TSBooleanKeyword":return"boolean";default:return}}function kn(e){const t=xn(e);if(!n(t)||"TSUnionType"!==t.type)return new Set;const r=t.types;return Array.isArray(r)?new Set(r.flatMap(e=>{const t=Sn(e);return t?[t]:[]})):new Set}function An(e,t,n,r=new WeakSet){return void 0!==oe(e,e=>on(e,t,n),r)}function Rn(e,t=new WeakSet){return void 0!==oe(e,e=>Ke(e,"wrapGraphqlCall"),t)}function Fn(e,t){return(c(e,"flatMap")||4===t&&c(e,"flatMapEager"))&&r(a(e),"applyResponse")}function Wn(e,t,n=new WeakSet){return void 0!==oe(e,e=>Fn(e,t),n)}function Dn(e,t,n=new WeakSet){return oe(e,e=>i(e)&&Gr(t).has(e.callee.property.name),n)}function Cn(e){if(!n(e))return;const t=e;return"ArrowFunctionExpression"===t.type||"FunctionExpression"===t.type?t.body:void 0}function jn(e){if(!n(e))return!1;const t=e;if("CallExpression"!==t.type||!Array.isArray(t.arguments)||"object"!=typeof t.callee||null===t.callee||"MemberExpression"!==t.callee.type||!0===t.callee.computed)return!1;const o=t.callee;return(r(o.object,"Atom")||r(o.object,"atomRegistry"))&&r(o.property)&&sa.has(o.property.name)}function Mn(e,t=new WeakSet){return oe(e,jn,t)}function Tn(e){return!!r(e)&&/(CollectionAtom|ListAtom|Visible.*Atom|ResultsAtom|ReadStateAtom)$/.test(e.name)}function qn(e){if(!n(e))return;const t=e;if("CallExpression"!==t.type||!Array.isArray(t.arguments))return;if(!(r(t.callee,"get")||o(t.callee,"Atom","get")||o(t.callee,"get","get")))return;const[i]=t.arguments;return Tn(i)?i:void 0}function Pn(e,t=new WeakSet){return qn(oe(e,e=>void 0!==qn(e),t))}function In(e){return c(e,"provide")&&1===e.arguments.length}function On(e,t=new WeakSet){return void 0!==oe(e,e=>n(e)&&"SpreadElement"===e.type,t)}function Ln(e){return!(!_e(e,"Ref","update")&&!_e(e,"Ref","modify"))&&On(Cn(e.arguments[1]))}function Nn(e){return n(e)&&"ObjectExpression"===e.type&&Array.isArray(e.properties)&&0===e.properties.length}function zn(e,t=new WeakSet){return void 0!==oe(e,e=>_e(e,"Object","entries"),t)}function $n(e){if(Ln(e))return!0;if(_e(e,"Object","assign")){const t=e.arguments;return t.length>=3&&Nn(t[0])}return _e(e,"Object","fromEntries")?zn(e.arguments[0]):_e(e,"JSON","stringify")||_e(e,"JSON","parse")}function Vn(e){return!!r(e)||n(e)&&"MemberExpression"===e.type}function Bn(e,t=3){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>{if(!n(e))return!1;const o=e.init;return n(o)&&"TSAsExpression"===o.type&&"object"==typeof o.typeAnnotation&&null!==o.typeAnnotation&&"TSConstKeyword"!==o.typeAnnotation.type&&!(4===t&&"TSTypeReference"===o.typeAnnotation.type&&r(o.typeAnnotation.typeName,"const"))})??!1)}function Un(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;if("==="!==t.operator)return!1;const r=t.left,o=t.right;return n(r)&&"UnaryExpression"===r.type&&"typeof"===r.operator&&n(o)&&("Literal"===o.type||"StringLiteral"===o.type)&&"boolean"===o.value}function Qn(e){return nr(e,"orElse")&&lo(rr(e.arguments[0]))}function Kn(e){return n(e)&&("Literal"===e.type||"StringLiteral"===e.type)&&"string"==typeof e.value}function _n(e){return r(e,"undefined")}function Yn(e){return n(e)&&"LogicalExpression"===e.type&&"??"===e.operator&&(lo(e.right)||_n(e.right))}function Jn(e,t=3){return _e(e,"Option",3===t?"fromNullable":"fromNullishOr")&&Yn(e.arguments[0])}function Gn(e,t){if(n(e)&&"ObjectExpression"===e.type)for(const o of e.properties??[])if(n(o)&&r(o.key,t))return o.value}function Hn(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return"==="===t.operator&&(er(t.left,!0)||er(t.right,!0))}function Zn(e){if(!_e(e,"Option","match"))return!1;const t=e.arguments[1],n=Gn(t,"onSome"),r=Gn(t,"onNone");return Hn(rr(n))&&er(rr(r),!1)}function Xn(e){return!(!n(e)||"VariableDeclaration"!==e.type)&&(e.declarations?.some(e=>n(e)&&Kn(e.init))??!1)}function er(e,t){return n(e)&&("Literal"===e.type||"BooleanLiteral"===e.type)&&e.value===t}function tr(e){return o(e,"Effect","void")}function nr(e,t){return _e(e,"Match",t)&&Array.isArray(e.arguments)}function rr(e){if(n(e)&&"ArrowFunctionExpression"===e.type)return e.body}function or(e){if(!nr(e))return!1;const[t,n]=e.arguments;return r(e.callee.property,"when")?(er(t,!0)||er(t,!1))&&tr(rr(n)):r(e.callee.property,"orElse")&&tr(rr(t))}function ir(e){return _e(e,"Stream")}function ar(e,t=new WeakSet){return void 0!==oe(e,e=>ua.some(t=>c(e,t))||d(e)||ir(e),t)}function cr(e){return C(e)&&ar(e)}function sr(e,t=new WeakSet){return void 0!==oe(e,e=>nr(e)&&cr(r(e.callee.property,"when")?rr(e.arguments[1]):rr(e.arguments[0])),t)}function ur(e,t=new WeakSet){return void 0!==oe(e,e=>nr(e),t)}function lr(e){return n(e)&&"CallExpression"===e.type&&Array.isArray(e.arguments)&&o(e.callee,"Option","match")}function fr(e){const t=rr(e);return n(t)&&"CallExpression"===t.type}function pr(e){return oe(e,e=>c(e,"gen"))}function dr(e){if(!d(e)||!n(e))return!1;const t=e.callee.object;return n(t)&&"CallExpression"===t.type&&o(t.callee,"Match","value")}function mr(e,t){return dr(e)||n(e)&&"CallExpression"===e.type&&(o(e.callee,"Option","match")||o(e.callee,3===t?"Either":"Result","match"))}function yr(e,t,n=new WeakSet){return void 0!==oe(e,e=>mr(e,t),n)}function hr(e){if(!n(e))return[];const t=e;return"ObjectExpression"===t.type&&Array.isArray(t.properties)?t.properties.map(e=>n(e)?e.value:void 0).filter(e=>void 0!==e):[]}function gr(e){if(!n(e)||"TSTypeAliasDeclaration"!==e.type)return!1;const t=e.id,o=e.typeAnnotation;return r(t)&&/(?:Id|ID)$/.test(t.name)&&("TSStringKeyword"===o?.type||"TSNumberKeyword"===o?.type)}function br(e){if(!n(e))return!1;const t=e;return"TSBooleanKeyword"===t.type||"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation&&"TSBooleanKeyword"===t.typeAnnotation.type}function vr(e){if(!n(e))return;const t=e;return"TSTypeAnnotation"===t.type&&"object"==typeof t.typeAnnotation&&null!==t.typeAnnotation?t.typeAnnotation:t}function wr(e){const t=vr(e);return"TSStringKeyword"===t?.type||"TSNumberKeyword"===t?.type}function Er(e){const t=vr(e);return"TSAnyKeyword"===t?.type||"TSObjectKeyword"===t?.type}function xr(e){const t=vr(e);return"TSTypeReference"===t?.type&&r(t.typeName,"Date")}function Sr(e){if(!n(e)||!Array.isArray(e.params))return[];const t=/(?:id|amount|currency|account|user|order|customer|invoice|payment|price|total|quantity|transfer|fund|balance)/i;return e.params.filter(e=>r(e)&&wr(e.typeAnnotation)&&t.test(e.name))}function kr(e){return Sr(e).length>=3}function Ar(e){return!!r(e)&&/^(?:is|has|should|with|allow|enable|can|use)[A-Z0-9_]/.test(e.name)&&br(e.typeAnnotation)}function Rr(e){return n(e)&&Array.isArray(e.params)?e.params.filter(Ar):[]}function Fr(e){return r(e)?e.name:n(e)&&"string"==typeof e.value?e.value:void 0}function Wr(e){if(!n(e)||"TSPropertySignature"!==e.type)return!1;const t=e,r=Fr(t.key),o=t.typeAnnotation;return void 0!==r&&/(?:createdAt|updatedAt|expiresAt|expiredAt|renewedAt|startedAt|endedAt|deletedAt|timestamp|timeoutMs|durationMs|ttlMs|ttl)$/i.test(r)&&(wr(o)||xr(o))}function Dr(e){if(!n(e))return[];const t=e;return"TSInterfaceDeclaration"===t.type&&"object"==typeof t.body&&null!==t.body&&Array.isArray(t.body.body)?t.body.body:"TSTypeLiteral"===t.type&&Array.isArray(t.members)?t.members:[]}function Cr(e){return r(e)&&/(?:Error|Failure|Fault)$/i.test(e.name)}function jr(e){const t=Dr(e);return 1===t.length&&"_tag"===Fr(t[0].key)}function Mr(e){const t=n(e)?e.superTypeArguments:void 0,r=n(t)?t.params??t.arguments:void 0,o=Array.isArray(r)?r:cn(e);if(0===o.length)return!0;const i=o[0];return n(i)&&("TSObjectKeyword"===i.type||"TSTypeLiteral"===i.type&&0===Dr(i).length)}function Tr(e){if(!n(e))return;const t=e;return("TSTypeAliasDeclaration"===t.type||"TSInterfaceDeclaration"===t.type)&&Cr(t.id)&&jr("TSTypeAliasDeclaration"===t.type?t.typeAnnotation:t)||"ClassDeclaration"===t.type&&_e(t.superClass,"Data","TaggedError")&&Mr(t)?e:void 0}function qr(e){return Dr(e).filter(Wr)}function Pr(e){return!!r(e)&&/^(?:opts|options|config)$/i.test(e.name)&&Er(e.typeAnnotation)}function Ir(e){return n(e)&&Array.isArray(e.params)?e.params.filter(Pr):[]}function Or(e,t=new WeakSet){if(Array.isArray(e))return e.reduce((e,n)=>e+Or(n,t),0);if(!n(e))return 0;if(t.has(e))return 0;t.add(e);const r=e;return"BinaryExpression"===r.type&&la.has(String(r.operator))?1:"LogicalExpression"!==r.type?0:Or(r.left,t)+Or(r.right,t)}function Lr(e){return n(e)&&"LogicalExpression"===e.type&&Or(e)>=3}function Nr(e){if(!n(e)||"MemberExpression"!==e.type)return;const t=e;if(!0===t.computed||!r(t.object)||!r(t.property))return;const o=t.property.name;return/(?:cancelled|canceled|shipped|approved|rejected|pending|active|inactive|enabled|disabled|locked|archived|deleted|submitted|processing|failed|complete|completed)$/i.test(o)?{objectName:t.object.name,propertyName:o}:void 0}function zr(e,t=new Map,r=new WeakSet){const o=Nr(e);if(o){const e=t.get(o.objectName)??new Set;return e.add(o.propertyName),t.set(o.objectName,e),t}if(Array.isArray(e)){for(const n of e)zr(n,t,r);return t}if(!n(e))return t;if(r.has(e))return t;r.add(e);const i=e;return"LogicalExpression"!==i.type||(zr(i.left,t,r),zr(i.right,t,r)),t}function $r(e){return!(!n(e)||"LogicalExpression"!==e.type)&&Array.from(zr(e).values()).some(e=>e.size>=2)}function Vr(e){return c(e,"fail")&&Kn(a(e))}function Br(e){return r(e)&&/(?:error|err|cause|failure|reason)/i.test(e.name)}function Ur(e){if(!n(e)||"MemberExpression"!==e.type)return!1;const t=e;return!0!==t.computed&&r(t.property,"message")&&Br(t.object)}function Qr(e){if(Ur(e))return!0;if(!n(e))return!1;const t=e;return"BinaryExpression"===t.type&&"+"===t.operator?Qr(t.left)||Qr(t.right):"TemplateLiteral"===t.type&&Array.isArray(t.expressions)&&t.expressions.some(e=>Qr(e))}function Kr(e){return c(e,"fail")&&Qr(a(e))}function _r(e){return n(e)&&"NewExpression"===e.type&&r(e.callee,"Error")}function Yr(e){return c(e,"fail")&&_r(a(e))}function Jr(e,t){if(!i(e))return[];const n=e.callee.property;return r(n)&&t.has(n.name)?e.arguments.filter(K):[]}function Gr(e){return 3===e?da:ma}function Hr(e,t=new WeakSet){return Array.isArray(e)?e.flatMap(e=>Hr(e,t)):!n(e)||t.has(e)||K(e)?[]:(t.add(e),"ReturnStatement"===e.type?[e]:Object.entries(e).flatMap(([e,n])=>"parent"===e?[]:Hr(n,t)))}function Zr(e){if(!i(e))return!1;const t=e.callee.property;return r(t)&&fa.has(t.name)}function Xr(e){return lo(e)||_n(e)||r(e)&&/(?:fallback|default)/i.test(e.name)}function eo(e){return c(e,"succeed")&&Xr(a(e))}function to(e,t){for(const n of Jr(e,Gr(t))){const e=Cn(n);if(eo(e))return e;for(const t of Hr(e))if(eo(t.argument))return t.argument}}function no(e){if(!c(e,"fail"))return!1;const t=a(e);return Kn(t)&&ya.has(String(t.value))}function ro(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;return r(t)&&/(?:Error|Exception)$/.test(t.name)}function oo(e){return!(!n(e)||"ThrowStatement"!==e.type)&&ro(e.argument)}function io(e){if(!n(e)||"ThrowStatement"!==e.type)return!1;const t=e.argument;return n(t)&&"NewExpression"===t.type&&r(t.callee,"Error")&&Array.isArray(t.arguments)&&Kn(t.arguments[0])}function ao(e){return!(!n(e)||!Array.isArray(e.params))&&e.params.some(e=>r(e)&&/(?:^id$|Id$|ID$)/.test(e.name)&&wr(e.typeAnnotation))}function co(e){if(!n(e)||"FunctionDeclaration"!==e.type)return!1;const t=e.id;return r(t)&&/(?:Admin|Public|Internal|External|Private|Backoffice|Panel)/.test(t.name)&&ao(e)}function so(e){if(!n(e)||"BinaryExpression"!==e.type)return!1;const t=e;return["==","===","!=","!=="].includes(String(t.operator))&&(Kn(t.left)||Kn(t.right))&&!Un(t)}function uo(e,t,n){e.report({message:n,node:t})}function lo(e){if(!n(e))return!1;const t=e;return"NullLiteral"===t.type||"Literal"===t.type&&null===t.value}function fo(e){if(!n(e))return;const t=e.source;if("string"==typeof t)return t;if(n(t)){const e=t.value;if("string"==typeof e)return e}}function po(e){const t=e.options[0];return n(t)?t:{}}function mo(e,t){const n=e[t];return Array.isArray(n)&&n.every(e=>"string"==typeof e)?n:void 0}function yo(e){return e.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/{2,}/g,"/").replace(/\/$/,"")}function ho(e){return e.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,"[^/]*")}function go(e){const t=yo(e);if("**"===t)return/^.*$/;const n=t.split("/"),r="**"===n[0],o=r?1:0;let i=r?"^(?:.*/)?":"(?:^|.*/)";for(let e=o;e<n.length;e+=1){const t=n[e],r=e===n.length-1;"**"!==t?(e>o&&(i+="/"),i+=ho(t)):i+=r?"(?:/.*)?":"(?:/[^/]+)*"}return new RegExp(`${i}$`)}function bo(e,t){return go(t).test(yo(e))}function vo(e){return mo(po(e),"boundaryPaths")??ha}function wo(e){return vo(e).some(t=>bo(e.filename,t))}function Eo(e){return ga.some(t=>bo(e.filename,t))}function xo(e){return mo(po(e),"configPaths")??ba}function So(e){return xo(e).some(t=>bo(e.filename,t))}function ko(e){return"effect"===e||e.startsWith("effect/")||"@effect-atom/atom-react"===e}function Ao(e){if(!(Ke(e,"it")||Ke(e,"test")||Ke(e,"specify")||Ke(e,"bench")))return;const t=e.arguments?.at(-1);return K(t)?t:void 0}function Ro(e,t){return c(e,"runPromise")||4===t&&n(e)&&c(e.callee,"runPromiseWith")&&void 0!==Te(e,t)?.program}function Fo(e,t=3){const r=e.body;if(!Ro(r,t)&&n(r)&&"BlockStatement"===r.type&&Array.isArray(r.body))for(const e of r.body)if(n(e)&&"ExpressionStatement"===e.type&&Ro(e.expression,t))return e.expression}function Wo(e,t){const r=[],o=new WeakSet;return function e(i,a=!1){if(Array.isArray(i)){for(const t of i)e(t);return}if(!n(i)||o.has(i))return;o.add(i);const c=i;if(a||!K(c)){t(c)&&r.push(c);for(const[t,n]of Object.entries(c))"parent"!==t&&e(n)}}(e,!0),r}function Do(e,t=3){if(!n(e)||"MemberExpression"!==e.type||!0===e.computed||!r(e.property,"rejects"))return!1;const o=e.object;if(!Ke(o,"expect"))return!1;const i=o.arguments;return!!Array.isArray(i)&&Ro(i[0],t)}function Co(e){return n(e)&&"MemberExpression"===e.type&&!0!==e.computed&&r(e.property,"Default")}function jo(e){return _e(e,"Layer","succeed")||_e(e,"Layer","effect")}function Mo(e){if(!_e(e,"Layer","provide"))return[];const t=e.arguments;return Array.isArray(t)&&t.some(Co)?t.filter(jo):[]}function To(e){const t=fo(e);if("effect/Schema"===t)return!0;if("effect"!==t||!n(e))return!1;const o=e.specifiers;return Array.isArray(o)&&o.some(e=>{if(!n(e))return!1;const t=e;return"ImportSpecifier"===t.type&&r(t.imported,"Schema")})}function qo(t,n){return Di({create(r){let o=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(o=!0)},[t](t){o&&uo(r,t,"string"==typeof n?n:n(e(r.options)))}}}})}function Po(t,r,o){return Di({create(i){const a=e(i.options);let c=!1;const s=[],u=new WeakSet,l=e=>{for(const r of t(e,a))n(r)&&!u.has(r)&&(u.add(r),s.push(r))};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(c=!0)},...Object.fromEntries(o.map(e=>[e,l])),"Program:exit"(){if(c)for(const e of s)uo(i,e,r)}}}})}function Io(t,n,r=!1,o=!1,i=["CallExpression"]){return Di({...o?{meta:{schema:va}}:{},create(a){const c=e(a.options);let s=!1;const u=r?new WeakSet:void 0,l=e=>{const i=!s||o&&wo(a)?void 0:t(e,c,a);if(i)for(const e of r?i:[i])u?.has(e)||(u?.add(e),uo(a,e,n(c)))};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(s=!0)},...Object.fromEntries(i.map(e=>[e,l]))}}})}function Oo(e,t,n){let r=!1;const o=o=>{if(r)for(const r of wn(o))t(r)&&uo(e,r.annotation,n)};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},ExportNamedDeclaration:o,ExportDefaultDeclaration:o}}function Lo(e){return e.startsWith("node:")||ss.has(e)}function No(e){return n(e)&&("MemberExpression"===e.type||"OptionalMemberExpression"===e.type)}function zo(e){return No(e)&&r(e.object,"process")&&(!0!==(t=e).computed&&r(t.property,"env")||!0===t.computed&&Kn(t.property)&&"env"===t.property.value);var t}function $o(e){if(!No(e))return!1;if(zo(e.object))return!0;if(!zo(e))return!1;const t=e.parent;return!No(t)||t.object!==e}function Vo(e){if(!No(e)||"object"!=typeof e.parent||null===e.parent)return!1;const t=e.parent;return"AssignmentExpression"===t.type&&t.left===e}function Bo(e){if(!n(e)||"CallExpression"!==e.type||!r(e.callee,"require"))return;const t=e.arguments?.[0];if(!Kn(t))return;const o=t.value;return cs.has(o)?o:void 0}function Uo(e,t){return void 0!==oe(e,e=>{if(qe(e,t))return!0;if(!i(e))return!1;const n=e.callee.property;return!!r(n)&&(3===t?ds.has(n.name):"catchAll"!==n.name&&ds.has(n.name)||Oi.includes(n.name)||"catchNoSuchElement"===n.name)})}function Qo(t,n,r,i=!1){return Di({create:a=>i&&4===e(a.options)?{}:{CallExpression(e){o(e.callee,t,n)&&uo(a,e.callee,r)}}})}function Ko(e,t=3){if(!n(e)||!Array.isArray(e.arguments))return[];const r=e.arguments,o=c(e,"acquireUseRelease")?2:yi(e,t)?1:c(e,"addFinalizer")?0:_e(e,"Scope","addFinalizer")||_e(e,"Scope","addFinalizerExit")?1:-1;return o<0?[]:r.slice(o,4===t||0===o?o+1:void 0)}function _o(e,t){let r=n(e)?e.parent:void 0;const o=new WeakSet;for(;n(r);){if(o.has(r))return;if(o.add(r),t(r))return r;r=r.parent}}function Yo(e,t=3){return void 0!==_o(e,e=>(4===t||K(e))&&Ko(e.parent,t).some(t=>t===e))}function Jo(e,t){return Io((t,n)=>e(t,n)?t:void 0,t,!1,!0)}function Go(e){return _e(e,"Scope","make")&&Array.isArray(e.arguments)}function Ho(e,t){return _e(e,"Scope","close")&&r(a(e),t)}function Zo(e){return _o(e,e=>tu.has(e.type??"")||K(e))}function Xo(e,t){let r=e;const o=new WeakSet;for(;n(r);){if(o.has(r))return!1;if(o.add(r),r===t)return!0;r=r.parent}return!1}function ei(e){let t=0,r=e;const o=new WeakSet;for(;n(r);){if(o.has(r))return t;o.add(r),t+=1,r=r.parent}return t}function ti(e){if(r(e))return[e];if(!n(e))return[];const t=e;switch(t.type){case"ArrayPattern":return Array.isArray(t.elements)?t.elements.flatMap(e=>ti(e)):[];case"AssignmentPattern":return ti(t.left);case"ObjectPattern":return Array.isArray(t.properties)?t.properties.flatMap(e=>{if(!n(e))return[];const t=e;return"Property"===t.type?ti(t.value):"RestElement"===t.type?ti(t.argument):[]}):[];case"RestElement":return ti(t.argument);case"TSParameterProperty":return ti(t.parameter);default:return[]}}function ni(e){return ie(e.body,t=>n(t)&&ri(t).length>0&&ci(t)===e)}function ri(e){return"VariableDeclarator"===e.type?ti(e.id):"CatchClause"===e.type?ti(e.param):"ClassDeclaration"!==e.type&&"FunctionDeclaration"!==e.type||!r(e.id)?[]:[e.id]}function oi(e){return"CatchClause"===e.type?Zo(e.param):Zo(e)}function ii(e,t){if(!r(e))return;let n,o=-1;for(const i of ni(t)){if(!ri(i).some(t=>r(t,e.name)))continue;const t=oi(i);if(void 0===t||!Xo(e,t))continue;const a=ei(t);a>o&&(n=i,o=a)}return n}function ai(e,t){return e===t||n(e)&&"YieldExpression"===e.type&&!0===e.delegate&&e.argument===t}function ci(e){return _o(e,K)}function si(e){let t=n(e)?e.parent:void 0;const o=new WeakSet;for(;n(t);){if(o.has(t))return;if(o.add(t),"VariableDeclarator"===t.type&&r(t.id)&&ai(t.init,e))return t;if(K(t))return;t=t.parent}}function ui(e){const t=si(e),n=ci(e);if(void 0===t||void 0===n)return!1;const r=t.id.name;return ie(n.body,e=>Ho(e,r)&&ci(e)===n&&ii(a(e),n)===t).length>0}function li(e,t,n){const o=a(e);return!!r(o,t.name)&&void 0===ii(o,n)&&Array.isArray(n.params)&&n.params.some(e=>e===t)}function fi(e){const t=e.arguments;return(c(e,"acquireUseRelease")?t.slice(2):t.slice(1)).some(e=>{if(!K(e))return!1;const t=e.params?.[0];return!!r(t)&&ie(e.body,n=>Ho(n,t.name)&&ci(n)===e&&li(n,t,e)).length>0})}function pi(e,t=3){return void 0!==_o(e,n=>3===t&&(c(n,"scoped")||_e(n,"Layer","scoped"))||yi(n,t)&&a(n)===e&&fi(n))||ui(e)}function di(e){if(!n(e)||"NewExpression"!==e.type)return!1;const t=e.callee;let o;return r(t)?o=t.name:n(t)&&"MemberExpression"===t.type&&!0!==t.computed&&r(t.property)&&(o=t.property.name),void 0!==o&&qt(o)}function mi(e){return Lt(e)||di(e)}function yi(e,t=3){return c(e,"acquireRelease")||3===t&&c(e,"acquireReleaseInterruptible")||c(e,"acquireUseRelease")}function hi(e,t=3){return!!Yo(e,t)||void 0!==_o(e,e=>yi(e,t)||c(e,"scoped")||3===t&&_e(e,"Layer","scoped")||gt(e))}function gi(e){return _o(e,e=>K(e)||"Program"===e.type)}function bi(e,t=3){return ie(e,n=>mi(n)&&gi(n)===e&&!hi(n,t))}function vi(e){if(!n(e)||!K(e))return;const t=e;if(r(t.id))return t.id.name;const o=t.parent;return n(o)?"VariableDeclarator"===o.type&&r(o.id)?o.id.name:"Property"===o.type&&r(o.key)?o.key.name:void 0:void 0}function wi(e){const t=vi(e);return void 0!==t&&/(?:handler|route|request|endpoint|controller)$/i.test(t)}function Ei(e,t){return 3===t?ci(e):_o(e,e=>{if(!K(e))return!1;const t=e.parent;return S(t,"gen",4)!==e&&S(t,"fn",4)!==e&&!be(t,4).includes(e)&&!["sync","suspend","promise","tryPromise"].some(n=>c(t,n)&&t.arguments.includes(e))})}function xi(e,t=3){const n=gi(e);if(void 0!==n)return bi(n,t)[0]}function Si(e,t=3,o){if(!r(e))return;if(4===t){const t=_o(e,e=>"Program"===e.type);if(!t||!o?.sourceCode)return;return ie(t,e=>n(e)&&"VariableDeclarator"===e.type).find(t=>o.sourceCode.getDeclaredVariables(t).some(t=>t.references.some(t=>Object.is(t.identifier,e))))?.init}const i=ci(e),a=void 0===i?[]:[i];let c=n(e)?e.parent:void 0;const s=new WeakSet;for(;n(c)&&!s.has(c);){if(s.add(c),"Program"===c.type){a.push(c);break}c=c.parent}for(const t of a){const o=oe(t,t=>n(t)&&"VariableDeclarator"===t.type&&r(t.id,e.name)&&void 0!==t.init);if(o)return o.init}}function ki(e,t,n){const r=Te(e,t);if(!r)return!1;const o=r.program,i=(e,n)=>oe(e,3===t?n:t=>n(t)&&Ei(t,4)===ci(e)),a=void 0!==i(o,re)?o:Si(o,t,n)??o;return void 0!==i(a,re)&&void 0===i(a,ue)}function Ai(e,t){return Object.fromEntries(e.filter(e=>3===t||!ji.includes(e)).map(e=>[`linteffect/${e}`,Ci.includes(e)?["error",{effectVersion:t}]:"error"]))}function Ri(e){return{jsPlugins:uu,rules:e}}function Fi(e){const t=Ai(["no-react-state","no-runtime-runfork","no-run-effect-outside-boundary","no-or-die-outside-boundary","prevent-dynamic-imports","no-render-side-effects","no-inline-runtime-provide"],e),n=Ai(["no-effect-as","no-effect-do","no-effect-bind","no-effect-async","no-effect-ignore","no-effect-never","no-effect-fn-generator","no-nested-effect-gen","no-yield-without-star-in-effect-gen","no-async-effect-combinator-callback","no-throw-in-effect-logic","no-try-catch-in-effect-logic","no-promise-api-in-effect-logic","no-swallowed-catch-all","no-manual-effect-channels","no-effect-type-alias","no-public-generic-effect-error"],e),r=Ai(["no-unbounded-effect-all","no-fire-and-forget-fork","no-fork-in-loop","no-race-without-cleanup","no-unobserved-fiber","no-unbounded-concurrent-retry","no-blocking-call-in-effect","no-promise-concurrency-in-effect","no-shared-mutable-state-across-fibers","no-timeout-with-noninterruptible-promise","no-uninterruptible-concurrent-region","no-unbounded-queue-or-pubsub","no-global-mutable-concurrency-state",...ou,"no-acquire-without-scoped-release"],e),o=Ai(["no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release",...su,"no-run-with-open-resource"],e),i=Ai(["no-nested-effect-call","no-effect-ladder","no-flatmap-ladder","no-pipe-ladder","no-call-tower","no-effect-orElse-ladder","no-effect-wrapper-alias","warn-effect-sync-wrapper","no-effect-side-effect-wrapper","no-effect-all-step-sequencing","no-effect-succeed-variable"],e),a=Ai(["no-if-statement","no-switch-statement","no-ternary","no-try-catch","no-arrow-ladder","no-iife-wrapper","no-return-in-arrow","no-return-in-callback","no-return-null","no-branch-in-object"],e),c=Ai(["no-option-as","no-match-void-branch","no-match-effect-branch","no-model-overlay-cast","no-unknown-boolean-coercion-helper","no-fromnullable-nullish-coalesce","no-option-boolean-normalization","no-string-sentinel-return","no-string-sentinel-const"],e),s=Ai(["no-effect-sync-console","no-atom-registry-effect-sync","no-family-collection-read","no-naked-object-state-update","no-wrapgraphql-catchall"],e),u=Ai(["no-raw-domain-id-alias","no-boolean-domain-flag","no-magic-domain-string","no-raw-domain-primitive-params","no-raw-time-domain-field","no-overloaded-options-object","no-domain-logic-in-conditional","no-implicit-state-machine-object","no-adhoc-domain-error","no-domain-meaning-by-folder-only","no-new-date-in-domain-logic"],e),l=["no-error-as-public-effect-error","no-unknown-public-error-channel","no-mixed-effect-error-shapes","no-expected-state-as-error"],f=Ai([...l,"no-early-catchall-null","no-empty-error-tag","no-exception-domain-error","no-effect-fail-error-message","no-catchall-generic-rethrow","no-log-only-error-handling"],e),p={...u,...f},d=Ai(["no-piped-yield-in-gen","no-gen-for-mapping","prefer-gen-for-workflow",...au],e),m=Ai(["no-large-anonymous-flow","no-effect-in-flow","prefer-named-flow",...cu],e),y=Ai(["prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe"],e),h=Ai(["no-mixed-pillar-function","no-clever-effect-expression","prefer-extracted-concept"],e),g=Ai(["prefer-effect-service","no-layer-provide-in-service-definition","require-service-accessors","require-service-dependencies","no-namespace-effect-import","no-manual-service-object-export","no-layer-merge-in-request-handler","no-service-method-returning-promise","prefer-layer-pipe","no-inline-layer-provide-in-program","prefer-layer-mergeall-for-infrastructure","no-service-layer-scatter"],e),b=Ai(["no-hidden-effect-execution","no-boundary-try-catch-without-effect-map","no-node-fs-in-effect-code","no-json-parse-without-schema","no-date-now-in-effect","no-node-platform-in-shared-code","no-process-env-direct-read"],e),v=Ai(["no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method",...ru],e),w=Ai(Object.keys(nu),e),E=[...ru,...ou,...iu,...au,...cu,...su,...l,"no-resource-succeed-escape"],x=Ai(Object.keys(nu).filter(e=>!E.includes(e)),e),S={reactAndRuntimeBoundaries:t,effectComposition:n,concurrencySafety:r,resourceLifetime:o,pipelineShapeAndSequencing:i,branchingAndLocalControlFlow:a,optionMatchAndDataNormalization:c,atomStateAndPlatformBoundaries:s,domainModeling:u,errorModeling:f,ddd:p,effectFlow:d,pureTransformation:m,behaviorDecoration:y,styleSeparation:h,serviceAndLayerArchitecture:g,platformAndBoundaryHygiene:b,testingObservabilityAndQa:v},k=Ri(x),A={options:{typeAware:!0},jsPlugins:uu,rules:k.rules},R=Ri(t),F=Ri(n),W=Ri(r),D=Ri(o),C=Ri(i),j=Ri(a),M=Ri(c),T=Ri(s),q=Ri(u),P=Ri(f),I=Ri(p),O=Ri(d),L=Ri(m),N=Ri(y),z=Ri(h),$=Ri(g),V=Ri(b),B=Ri(v);return{jsPlugins:uu,reactAndRuntimeBoundariesRules:t,effectCompositionRules:n,concurrencySafetyRules:r,resourceLifetimeRules:o,pipelineShapeAndSequencingRules:i,branchingAndLocalControlFlowRules:a,optionMatchAndDataNormalizationRules:c,atomStateAndPlatformBoundariesRules:s,domainModelingRules:u,errorModelingRules:f,dddRules:p,effectFlowRules:d,pureTransformationRules:m,behaviorDecorationRules:y,styleSeparationRules:h,serviceAndLayerArchitectureRules:g,platformAndBoundaryHygieneRules:b,testingObservabilityAndQaRules:v,allRules:w,recommendedRules:x,ruleGroups:S,recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:D,pipelineShapeAndSequencing:C,branchingAndLocalControlFlow:j,optionMatchAndDataNormalization:M,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:z,serviceAndLayerArchitecture:$,platformAndBoundaryHygiene:V,testingObservabilityAndQa:B,presets:{recommended:k,typeAware:A,reactAndRuntimeBoundaries:R,effectComposition:F,concurrencySafety:W,resourceLifetime:D,pipelineShapeAndSequencing:C,branchingAndLocalControlFlow:j,optionMatchAndDataNormalization:M,atomStateAndPlatformBoundaries:T,domainModeling:q,errorModeling:P,ddd:I,effectFlow:O,pureTransformation:L,behaviorDecoration:N,styleSeparation:z,serviceAndLayerArchitecture:$,platformAndBoundaryHygiene:V,testingObservabilityAndQa:B}}}import{definePlugin as Wi,defineRule as Di}from"@oxlint/plugins";const Ci=["no-react-state","no-runtime-runfork","no-or-die-outside-boundary","no-inline-runtime-provide","no-console-in-effect-flow","no-effect-log-without-structured-context","require-span-on-public-service-method","no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available","prefer-pipe-for-behavior","prefer-decorated-effect-before-gen","no-workflow-in-behavior-pipe","no-mixed-pillar-function","no-clever-effect-expression","prefer-effect-service","no-layer-provide-in-service-definition","require-service-accessors","require-service-dependencies","no-manual-service-object-export","no-layer-merge-in-request-handler","no-service-method-returning-promise","prefer-layer-pipe","no-inline-layer-provide-in-program","prefer-layer-mergeall-for-infrastructure","no-service-layer-scatter","no-json-parse-without-schema","no-date-now-in-effect","no-effect-all-step-sequencing","no-async-effect-combinator-callback","no-throw-in-effect-logic","no-swallowed-catch-all","no-try-catch-in-effect-logic","no-promise-api-in-effect-logic","no-wrapgraphql-catchall","no-naked-object-state-update","no-early-catchall-null","no-exception-domain-error","no-expected-state-as-error","no-catchall-generic-rethrow","no-log-only-error-handling","no-fromnullable-nullish-coalesce","no-model-overlay-cast","no-string-sentinel-return","no-string-sentinel-const","prefer-gen-for-workflow","no-business-logic-in-pipe","no-flatmap-ladder","no-effect-side-effect-wrapper","no-ternary","no-return-in-arrow","no-branch-in-object","no-hidden-effect-execution","no-boundary-try-catch-without-effect-map","no-run-effect-outside-boundary","no-effect-async","no-effect-fn-generator","no-nested-effect-gen","no-yield-without-star-in-effect-gen","no-effect-orElse-ladder","no-fire-and-forget-fork","no-fork-in-loop","no-race-without-cleanup","no-unobserved-fiber","no-blocking-call-in-effect","no-promise-concurrency-in-effect","no-shared-mutable-state-across-fibers","no-timeout-with-noninterruptible-promise","no-uninterruptible-concurrent-region","no-unbounded-queue-or-pubsub","no-global-mutable-concurrency-state","no-manual-deferred-coordination","no-acquire-without-scoped-release","no-manual-resource-close","no-unbound-scope","no-resource-succeed-escape","no-resource-without-acquire-release","no-request-scoped-long-lived-resource","no-global-resource-singleton","no-run-with-open-resource","no-nested-acquire-release","no-missing-layer-provision-at-run","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],ji=["no-runtime-runfork","require-service-accessors","require-service-dependencies","no-effect-async","no-effect-orElse-ladder"],Mi=["flatMap","zipRight","as","tap"],Ti=new Set(["gen","sync","try","tryPromise","fn"]),qi=new Set(["andThen","flatMap","tap","zipRight"]),Pi=new Set(["Date","Runtime","fetch","import","queueMicrotask","require","setInterval","setTimeout"]),Ii=new Set(["annotateLogs","as","catchAll","catchSome","catchTag","map","mapBoth","provide","retry","tap","tapError","timeout","timeoutFail","withSpan"]),Oi=["catch","catchEager","catchCause","catchDefect","catchIf","catchFilter","catchCauseIf","catchCauseFilter","catchTag","catchTags","catchReason","catchReasons"],Li=new Set(["andThen","catchAll","catchTag","filterOrFail","flatMap","forEach","map","orElse","tap"]),Ni=new Set([...[...Li].filter(e=>"catchAll"!==e&&"orElse"!==e),"mapEager","flatMapEager",...Oi]),zi=new Set(["all","allSettled","any","race","reject","resolve"]),$i=new Set(["all","allSettled","any","race"]),Vi=new Set(["timeout","timeoutOption","timeoutOrElse"]),Bi=new Set(["crypto","fs","zlib"]),Ui=new Set(["runCallback","runFork","runPromise","runPromiseExit","runSync","runSyncExit"]),Qi=new Set(["catchAll","catchTag","catchTags","tapError"]),Ki=new Set(["sleep","await","promise","tryPromise","fork","forkDaemon","forkScoped","all","forEach","race","raceAll"]),_i=new Set(["modifyEffect","modifySomeEffect","updateEffect","updateAndGetEffect"]),Yi=new Set(["make","unsafeMake","makeUnsafe"]),Ji=new Set(["timeout","timeoutOption","timeoutFail","timeoutFailCause","timeoutTo"]),Gi=new Set(["race","raceFirst","raceAll","interruptible","scoped"]),Hi=new Set(["acquireRelease","acquireUseRelease","ensuring","forkIn","forkScoped","scoped"]),Zi=new Set(["race","raceAll","raceFirst","raceAllFirst"]),Xi=new Set(["retry"]),ea=new Set(["add","clear","delete","pop","push","reverse","set","shift","sort","splice","unshift"]),ta=new Set(["fork","forkScoped","forkDaemon","all","forEach","race","raceFirst","raceAll"]),na=new Set(["open","connect","create","start","listen","subscribe","acquire"]),ra=new Set(["client","connection","conn","pool","db","database","file","socket","stream","server","subscription","handle"]),oa=new Set(["close","destroy","dispose","cleanup"]),ia=new Set(["all","forEach","fork","race","raceAll"]),aa=new Set(["all","forEach","forkChild","forkDetach","forkScoped","forkIn","race","raceAll","raceFirst","raceAllFirst"]),ca=new Set(["await","interrupt","join"]),sa=new Set(["get","set","update","modify","refresh"]),ua=["flatMap","map","andThen","tap","zipRight"],la=new Set(["==","===","!=","!==",">",">=","<","<="]),fa=new Set(["catchSome","catchTag","catchTags","fail","mapBoth","mapError"]),pa=new Set(["catchAll","tapError"]),da=new Set(["catchAll"]),ma=new Set(["catch","catchEager"]),ya=new Set(["NotFound","Missing","Empty","None"]),ha=["bin/**","scripts/**","cli/**","**/main.ts","app/api/**/route.ts","server/**","*.test.ts","*.spec.ts"],ga=["**/*.test.*","**/*.spec.*","**/__tests__/**"],ba=["**/config/**","**/*Config.ts","**/*ConfigLayer.ts"],va=[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}],wa=new Set(["useState","useReducer","useContext","useCallback","useEffect","useSyncExternalStore"]),Ea=Di({create(t){const o=e(t.options);return{CallExpression(e){const i=e.callee,a=r(i)?i.name:n(i)&&"MemberExpression"===i.type&&r(i.property)?i.property.name:void 0;a&&wa.has(a)&&uo(t,i,3===o?"Rule: avoid React state hooks. Why: they bypass the atom runtime and break reactive flow. Fix: use @effect-atom/atom-react instead.":"Rule: avoid React state hooks. Why: they bypass externally owned reactive state. Fix: pass explicit state as props or use a compatible reactive adapter at the UI boundary.")}}}}),xa=qo("IfStatement","Rule: avoid imperative if branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type or Effect combinators instead."),Sa=qo("SwitchStatement","Rule: avoid imperative switch branching. Why: Effect code should keep branching explicit and typed. Fix: use Match.value/Match.type instead."),ka=qo("ConditionalExpression",e=>`Rule: avoid ternary expressions. Why: they hide control flow inside expressions. Fix: use Option.match/${3===e?"Either":"Result"}.match/Match.value or data combinators, then run one Effect pipeline.`),Aa=Io(e=>lo(e.argument)?e:void 0,()=>"Rule: avoid returning null. Why: null is a sentinel that forces defensive guards. Fix: use Option.none for absence or Effect.fail for errors.",!1,!1,["ReturnStatement"]),Ra=Io(e=>o(e.callee,"Option","as")?e:void 0,()=>"Rule: avoid Option.as. Why: it hides selection and encourages placeholder flows. Fix: use Option.map or Option.match and return the value explicitly."),Fa=Io(e=>o(e,"Effect","never")?e:void 0,()=>"Rule: avoid Effect.never. Why: it hides lifecycle and leaks resources. Fix: use Stream or explicit acquire/release lifecycles with clear teardown.",!1,!1,["MemberExpression"]),Wa=Io(e=>y(e)?g(e.callee.body):void 0,e=>"Rule: avoid nested IIFEs. Why: they hide sequencing and push wrapper hacks. Fix: bind a named context with const and keep one flat pipeline with a single Match/Option decision."),Da=Di({create(t){const n=e(t.options);return{ObjectExpression(e){hr(e).some(e=>yr(e,n))&&uo(t,e,`Rule: avoid Match/Option/${3===n?"Either":"Result"} inside object literals. Why: it hides the decision and invites workaround scaffolding. Fix: compute the value first (context), then build the object from named values with one flat decision.`)}}}}),Ca=Io(e=>h(e)?e:void 0,()=>"Rule: avoid immediate invocation of inline functions. Why: it hides decisions and sequencing. Fix: bind a named context with const and keep one Match/Option decision in a flat pipeline."),ja=Di({create(t){const n=e(t.options);return{CallExpression(e){for(const r of w(e,n))uo(t,r,"Rule: avoid block-bodied arrow callbacks with returns. Why: they hide local control flow. Fix: use expression-only callbacks and move the logic into a single pipeline (pipe/Match/Option/A.map).")}}}}),Ma=Di({create:e=>({CallExpression(t){for(const n of E(t))uo(e,n,"Rule: avoid returns inside inline callbacks. Why: they hide control flow. Prefer expression-only callbacks, but leaf-level Effect branches with local bindings may use returns when needed.")}})}),Ta=Io((e,t)=>k(e,"fn",t)?e:void 0,()=>"Rule: avoid Effect.fn generator wrappers. Why: they hide sequencing and dodge ladder rules. Fix: keep a single flat pipeline or use one Effect.gen."),qa=Io(e=>c(e,"sync")&&Je(a(e))?e:void 0,()=>"Rule: avoid console.* inside Effect.sync. Why: it hides side effects. Fix: replace with Effect.log* or remove the console call."),Pa=["CallExpression","ClassDeclaration","ClassExpression"],Ia=Po(function(e,t=3){if(A(e,t))return ie(e.arguments,Ne);const n=H(e,t);return n?ie(Z(n,t),Ne):[]},"Rule: avoid console.* in Effect flow. Why: console output bypasses Effect observability. Fix: use Effect.log* with structured context.",Pa),Oa=Po((e,t)=>{const n=H(e,t),r=n&&Z(n,t);return[...Qe(e,t),...r?[r]:[]].flatMap(Ue)},"Rule: add structured context to Effect.logError or Effect.logWarning. Why: static failure messages cannot be correlated. Fix: include an error or context object, or use Effect.annotateLogs(...).",Pa),La=Po((e,t)=>{const n=H(e,t);return[...hn(e).map(e=>mn(e.functionNode,e.declaredReturnType)),...n?gn(n,t).map(bn):[]].filter(e=>void 0!==e)},"Rule: add Effect.withSpan to public Effect operations. Why: service work needs trace boundaries. Fix: wrap the returned Effect with Effect.withSpan(...).",[...Pa,"ExportNamedDeclaration","ExportDefaultDeclaration"]),Na=Di({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(!Eo(t))return;const r=Ao(e),i=r&&Fo(r,n);i&&o.push(i)},"Program:exit"(){if(r)for(const e of o)uo(t,e,"Rule: do not discard Effect.runPromise in a test body. Why: the test can finish before the Effect result is observed. Fix: await or return Effect.runPromise so the test framework observes completion.")}}}}),za=Di({create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(!Eo(t))return;const r=Ao(e);r&&o.push(...Wo(r,e=>Do(e,n)))},"Program:exit"(){if(r)for(const e of o)uo(t,e,"Rule: prefer Effect.flip for expected typed Effect failures in tests. Why: it turns the expected failure into a successful error value for structural assertions. Fix: flip the Effect, then assert the error _tag, message, and fields.")}}}}),$a=Di({create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},CallExpression(t){Eo(e)&&n.push(...Mo(t))},"Program:exit"(){if(t)for(const t of n)uo(e,t,"Rule: avoid a manual test layer beside an explicit service Default layer. Why: the test is already opting into the service's real default composition and the sibling mock can hide that contract. Fix: use the Default layer with its required infrastructure, or remove Default when a replacement is intentional.")}}}}),Va=Io((e,t)=>{const n=S(e,"gen",t);return n?3===t?pr(n.body):ve(n.body,e=>c(e,"gen")):void 0},e=>"Rule: avoid nested Effect.gen. Why: nested generators hide sequencing. Fix: flatten to a single Effect.gen per method or a single flat pipeline."),Ba=Io(function(e,t){return S(e,"gen",t)?we(e,t,e=>n(e)&&"YieldExpression"===e.type&&!0!==e.delegate):void 0},e=>3===e?"Rule: use yield* inside Effect.gen. Why: plain yield returns an Effect value without delegating to the Effect interpreter. Fix: replace `yield Effect.x` with `yield* Effect.x`.":"Rule: use yield* inside Effect.gen. Why: delegation preserves the yielded Effect's result typing and keeps workflow style consistent. Fix: replace `yield Effect.x` with `yield* Effect.x`."),Ua=Io(function(e){const t=S(e,"gen");if(!t)return;const n=F(t.body);return n.length>=2?n[1]:void 0},e=>"Rule: avoid repeated piped yields inside Effect.gen. Why: decorated effects hidden inside generator steps obscure the workflow. Fix: extract decorated effects first, then yield the named workflow steps."),Qa=Io(function(e){const t=S(e,"gen");if(!t||"object"!=typeof t.body||null===t.body)return;const n=t.body,r=Array.isArray(n.body)?n.body:[];if(2!==r.length)return;const o=j(r[0]);return o&&M(r[1],o)?e:void 0},e=>"Rule: avoid Effect.gen for simple mapping. Why: tiny generators hide pure transformations behind workflow syntax. Fix: map the yielded effect with Effect.map or a named pure transformation."),Ka=Io(function(e,t=3){if(d(e))return T(e).filter(e=>q(e,t)).length>=3?e:void 0},e=>"Rule: prefer Effect.gen for workflow sequencing. Why: long flatMap/andThen/tap pipelines read like imperative workflow. Fix: move the sequential story into one Effect.gen and keep pipe for behavior decoration."),_a=Io(e=>I(e)?e:void 0,e=>"Rule: avoid large anonymous flow expressions. Why: long pure transformation chains need a domain name. Fix: extract a named flow or split the transformation into named pure steps."),Ya=Io(function(e){if(P(e))return e.arguments.find(e=>L(e))},e=>"Rule: avoid Effect work inside flow. Why: flow should stay a reusable pure transformation boundary. Fix: keep Effect sequencing, logging, retries, and dependency access in Effect pipelines."),Ja=Io(function(e){if(n(e)&&"CallExpression"===e.type)return(e.arguments??[]).find(e=>P(e)&&e.arguments.length>=3)},e=>"Rule: prefer named flow transformations. Why: non-trivial pure transformations passed inline are hard to reuse and review. Fix: extract the flow to a named const."),Ga=Io(function(e){if(!($(e)<3))return z(n(e)?e.parent:void 0)?void 0:e},e=>"Rule: prefer flow for a deep pure call pipeline. Why: nested transformation towers hide the data pipeline and make reuse difficult. Fix: name the pure steps and compose them with flow, or keep the pipeline short."),Ha=Io(function(e,t=3){if(d(e))for(const n of T(e)){if(!(c(n,"flatMap")||4===t&&c(n,"flatMapEager")))continue;const e=n.arguments.find(K);if(!e)continue;const r=e.body,o=["IfStatement","SwitchStatement","ForStatement","ForInStatement","ForOfStatement","WhileStatement","DoWhileStatement"].some(e=>W(r,e)),a=void 0!==oe(r,re),s=ie(r,i).length;if(o||a||s>=2)return e}},e=>"Rule: keep business workflow logic out of Effect.pipe callbacks. Why: branching, service lookup, and multi-step effects are hard to read as decoration. Fix: move the workflow into Effect.gen and reserve pipe for behavior around the completed effect."),Za=Io(function(e,t){if(V(e,t))return B(e.arguments[0])?e:void 0},()=>"Rule: prefer .pipe() for behavior decoration. Why: retry, timeout, spans, logging, recovery, DI, and value transforms decorate an existing effect. Fix: write `program.pipe(Effect.retry(policy))` instead of `Effect.retry(program, policy)`."),Xa=Io(function(e,t){const n=S(e,"gen",t);if(!n)return;const r=ie(n.body,e=>U(e,t),new WeakSet,!0,4===t);return r.length>=2?r[1]:void 0},()=>"Rule: extract decorated effects before Effect.gen. Why: repeated retry/timeout/span/logging decorators inside generator yields bury behavior policy in workflow steps. Fix: name the decorated effects first, then yield the workflow story."),ec=Io(function(e,t){if(!d(e))return;const n=T(e);if(!n.some(e=>V(e,t)))return;const r=n.filter(e=>q(e,t)).length,o=n.some(e=>W(e,"IfStatement")||W(e,"SwitchStatement")||W(e,"ForStatement")||W(e,"ForInStatement")||W(e,"ForOfStatement")||W(e,"WhileStatement"));return r>=2||o?e:void 0},()=>"Rule: avoid workflow sequencing inside behavior pipes. Why: behavior pipes should answer how an effect behaves, not hide the workflow story. Fix: move multi-step sequencing into Effect.gen and keep retry/timeout/spans/logging as decorators around named effects."),tc=Io(function(e,t){if(K(e))return Q(e.body,t).size>=3?e:void 0},e=>"Rule: avoid mixing Effect style pillars in one function. Why: workflow, pure transformation, behavior decoration, and Layer wiring each need a clear boundary. Fix: extract named concepts for each pillar and compose them at the call site.",!1,!1,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),nc=Io(function(e,t){if(!n(e)||"CallExpression"!==e.type)return;const r=Q(e,t),o=h(e)||void 0!==g(e);return r.size>=2&&(_(e)>=4||o)?e:void 0},e=>"Rule: avoid clever Effect expressions. Why: deeply nested expressions that combine style pillars hide the domain story. Fix: extract named workflow, pure transformation, and behavior steps."),rc=Io(function(e){if(!n(e)||"CallExpression"!==e.type)return;const t=e;for(const e of t.arguments??[]){if(!n(e)||!K(e))continue;const t=e.body;if(n(t)&&"BlockStatement"===t.type&&Array.isArray(t.body)&&t.body.length>=3)return e}},e=>"Rule: prefer extracting named concepts from oversized anonymous callbacks. Why: multi-step inline callbacks hide domain intent. Fix: name the transformation, policy, or workflow step before passing it into Effect."),oc=Io((e,t)=>X(e)||4===t&&c(e,"Service")?e:void 0,e=>3===e?"Rule: prefer Effect.Service. Fix: replace Context.Tag service definitions.":"Rule: prefer Context.Service. Fix: migrate legacy Context.Tag, Context.GenericTag or Effect.Service definitions to Context.Service; construct implementations with make and explicit Layer wiring where needed."),ic=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e);r&&o&&ee(o)&&uo(t,o,"Rule: do not call Layer.provide inside Effect.Service. Fix: move layer wiring to app/test boundaries.")},CallExpression(e){if(3===n||!r)return;const o=J(e,n),i=o&&Gn(o,"make");i&&ee(i)&&uo(t,o,"Rule: do not assemble layers inside Context.Service make. Fix: keep make focused on constructing the implementation and compose Layer.provide at app/test boundaries.")}}}}),ac=Di({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ClassDeclaration(e){const r=G(e);n&&r&&!te(r)&&uo(t,r,"Rule: set accessors: true. Fix: add it to Effect.Service options.")}}}}),cc=Di({create(t){if(4===e(t.options))return{};let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ClassDeclaration(e){const r=G(e),o=r?ae(r):void 0;n&&o&&uo(t,o,"Rule: declare service dependencies.")}}}}),sc=Di({create:e=>({ImportDeclaration(t){const n=ne(t);n&&uo(e,n,"Rule: avoid namespace imports from Effect packages.")}})}),uc=Io(function(e){if(!n(e))return;const t=e.declaration;if(n(t)&&"VariableDeclaration"===t.type)for(const e of t.declarations??[])if(n(e)&&r(e.id)&&e.id.name.endsWith("Service")&&ye(e.init))return e},e=>"Rule: avoid exported manual service objects.",!1,!1,["ExportNamedDeclaration"]),lc=Io(function(e){if(_e(e,"Layer","provide"))return oe(a(e),t=>t!==e&&_e(t,"Layer","provide"))},e=>"Rule: prefer Layer.pipe for nested layer provisioning."),fc=Io(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0);return n?4===t?ve(n.body,ue):oe(n.body,ue):void 0},e=>"Rule: avoid inline layer provisioning inside programs."),pc=Io(function(e){if(_e(e,"Layer","merge"))return e.arguments?.find(t=>oe(t,t=>t!==e&&_e(t,"Layer","merge")))},e=>"Rule: prefer Layer.mergeAll for infrastructure layer groups."),dc=Di({create(e){let t=!1,n=0;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},VariableDeclaration(r){const o=t?fe(r):void 0;o&&(n+=1,n>=3&&uo(e,o,"Rule: group service layers by concern."))}}}}),mc=Io(function(e){if(se(e))return oe(e.body,ce)?e:void 0},e=>"Rule: avoid Layer composition inside request handlers.",!1,!1,["FunctionDeclaration"]),yc=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},ClassDeclaration(e){if(4===n)return;const o=G(e),i=o?me(o):void 0;r&&i&&uo(t,i,"Rule: return Effect from service methods.")},CallExpression(e){if(3===n||!r)return;const o=J(e,n),i=o&&me(o,n);i&&uo(t,i,"Rule: return Effect from service methods. Fix: expose an Effect-returning Context.Service method and keep Promise interop inside an Effect adapter.")}}}}),hc=Io(e=>or(e)?e:void 0,e=>"Rule: avoid void Match branches. Why: they hide guard-style control flow. Fix: remove the no-op branch or select a value and run one Effect pipeline outside the Match."),gc=Di({create:e=>({CallExpression(t){dr(t)&&sr(t.arguments)&&uo(e,t,"Rule: avoid multi-step sequencing inside Match branches. Why: it hides control flow. Fix: select a value in Match, then run one Effect pipeline outside. Avoid data-encoded conditionals (Option.toArray/forEach) that only rewrap the branch."),lr(t)&&cr(t.arguments)&&uo(e,t,"Rule: avoid multi-step sequencing inside Option.match branches. Why: it hides control flow. Prefer selecting a value in Option.match, then run one Effect pipeline outside. Leaf-level flows with local bindings may keep Option.match but should stay linear.")}})}),bc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},CallExpression(n){const r=a(n),o=rr(r);t&&c(n,"sync")&&fr(r)&&!Ne(o)&&uo(e,n,"Rule: avoid Effect.sync around side effects. Why: it hides intent. Fix: use Effect.log* or an explicit pipeline step for the side effect.")}}}}),vc=Di({create(t){const n=3===e(t.options)?"zipRight":"andThen";return{CallExpression(e){c(e,"as")&&Ge(a(e))&&uo(t,e,"Rule: avoid Effect.as for side effects. Why: it hides side effects and turns them into placeholders. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap."),c(e,n)&&Ge(a(e))&&uo(t,e,`Rule: avoid Effect.${n} for side effects. Why: it hides side effects and discards values. Fix: use explicit pipeline steps that return real values with Effect.flatMap, Effect.andThen, or Effect.tap.`)}}}}),wc=Di({create:e=>({CallExpression(t){c(t,"all")&&He(t.arguments[0])&&Ze(t.arguments[1])&&uo(e,t,"Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation."),Xt(t)&&He(a(t.callee.object))&&uo(e,t,"Rule: avoid Effect.all for sequential side-effect steps. Why: it hides imperative sequencing in an array. Fix: use one explicit linear pipeline with Effect.andThen/flatMap and reserve Effect.all for real value aggregation.")}})}),Ec=Io(function(e,t){return be(e,t).find(he)},()=>"Rule: avoid async callbacks in Effect combinators. Why: async callbacks return Promises and bypass Effect failure, interruption, and tracing semantics. Fix: adapt with Effect.tryPromise, compose with gen/flatMap, and keep map pure."),xc=Io((e,t)=>Ee(e,t,"ThrowStatement"),e=>`Rule: avoid throw inside Effect logic. Why: thrown exceptions ${3===e?"bypass typed Effect error channels and interruption semantics":"are not typed domain failures"}. Fix: yield* Effect.fail(taggedError) in gen, or return it from flatMap; keep map pure.`),Sc=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(!r)return;const o=Ie(e,n);o&&uo(t,o,`Rule: avoid Effect.orDie outside runtime boundaries. Why: converting typed failures into defects hides recoverable domain errors. Fix: keep typed errors in domain logic and reserve ${3===n?"orDie/orDieWith":"orDie"} for explicit application boundaries.`)}}}}),kc=Io(function(e,t){if(3===t){if(!c(e,"catchAll"))return;const t=Cn(a(e));return Oe(t)?t:void 0}for(const n of Jr(e,Gr(t))){const e=Cn(n);if(Oe(e,t))return e;for(const n of Hr(e))if(Oe(n.argument,t))return n.argument}},e=>`Rule: avoid swallowing errors in ${3===e?"catchAll":"catch/catchEager"}. Why: succeed/void recovery can hide failures without telemetry or typed recovery. Fix: log, re-fail with a structured error, or recover through an explicit domain branch.`),Ac=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&Tr(n)&&uo(e,n,"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.")},TSInterfaceDeclaration(n){t&&Tr(n)&&uo(e,n,"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.")},ClassDeclaration(n){t&&Tr(n)&&uo(e,n,"Rule: give tagged domain errors meaningful payloads. Why: a tag-only error loses operation context and recovery detail. Fix: add structured fields or use a more appropriate expected-state model when no context is needed.")}}}}),Rc=Di({meta:{schema:va},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(r&&!wo(t)){const r=to(e,n);r&&uo(t,r,"Rule: avoid catching errors too early. Why: null, undefined, or fallback recovery inside domain logic forces higher layers to handle an untyped absence. Fix: let the typed error propagate and recover at a meaningful boundary with catchTag or an explicit Option result.")}}}}}),Fc=Io(e=>no(e)?e:void 0,e=>`Rule: model expected domain states as data. Why: failing with NotFound, Missing, Empty, or None overloads the error channel and encourages broad ${3===e?"catchAll":"catch"} recovery. Fix: return Option, ${3===e?"Either":"Result"}, or a tagged result for expected state and reserve Effect.fail for exceptional failures.`),Wc=Io(function(e,t){return we(e,t,oo)},()=>"Rule: do not use exceptions for domain errors. Why: throw new *Error inside Effect logic bypasses typed failure channels, supervision, and structured recovery. Fix: return Effect.fail with a Data.TaggedError or structured domain error."),Dc=Io(e=>Kr(e)?e:void 0,()=>"Rule: preserve structured errors instead of strings. Why: converting error.message to a string loses the original tag, cause, and context. Fix: fail with the error or map it to a structured Data.TaggedError."),Cc=Io(function(e,t){for(const n of Jr(e,Gr(t))){const e=Cn(n);if(Yr(e))return e;for(const t of Hr(e))if(Yr(t.argument))return t.argument}},e=>`Rule: do not rethrow generic Error from ${3===e?"catchAll":"catch"}. Why: ${3===e?"catchAll":"catch"} should preserve or model the original failure instead of erasing its domain type. Fix: use mapError, catchTag, or Effect.fail with a structured tagged error and cause.`),jc=Io(function(e,t){const n=3===t?Jr(e,pa):be(e,t).filter(()=>/^catch/.test(String(e.callee.property.name)));for(const e of n){const n=Cn(e),r=3===t?oe:ve,o=r(n,Ye);if(o&&!r(n,e=>Zr(e)||4===t&&(c(e,"failCause")||c(e,"die"))))return o}},()=>"Rule: do not stop at logging an Effect error. Why: logs alone do not preserve a typed failure or define recovery ownership. Fix: map or re-fail with a structured domain error after adding observability."),Mc=Io(function(e){return Le(e)?e:d(e)?en(e).find(e=>Le(e)):void 0},()=>"Rule: avoid Effect.ignore. Why: ignoring failable effects hides failure ownership. Fix: handle the error with typed recovery, log and re-fail, or isolate the ignore at an explicit boundary with a documented reason."),Tc=Io((e,t)=>Ee(e,t,"TryStatement"),e=>`Rule: avoid try/catch inside Effect logic. Why: it bypasses typed error channels and can miss interruption/cause semantics. Fix: use Effect.try, Effect.${3===e?"catchAll":"catch"}, Effect.catchTag, or typed error combinators.`),qc=Io(function(e,t){return we(e,t,e=>xe(e)||Se(e,t))},()=>"Rule: avoid Promise APIs inside Effect logic. Why: Promise APIs bypass Effect scheduling, typed errors, cancellation, and tracing. Fix: use Effect.all, Effect.tryPromise, or move Promise interop to a boundary adapter."),Pc=Di({create:e=>({TryStatement(t){uo(e,t,"Rule: avoid try/catch in Effect files. Why: it bypasses Effect error channels and reintroduces imperative control flow. Fix: model failures in Effect and handle them with typed errors and Effect combinators.")}})}),Ic=Di({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])nn(n.init)&&uo(e,t,"Rule: avoid Effect wrapper aliases (`const x = ...Effect...`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")},FunctionDeclaration(t){rn(t.body)&&uo(e,t,"Rule: avoid Effect wrapper aliases (`function x(...) { return Effect... }`). Why: it creates wrapper choreography and bloats consts. Fix: inline the pipeline at the call site or define a real domain function that returns data, not an Effect wrapper.")}})}),Oc=Di({create:e=>({TSTypeReference(t){(on(t,"Effect","Effect")||on(t,"Layer","Layer"))&&uo(e,t,"Rule: avoid manual Effect channel tuples (`Effect.Effect<...>` / `Layer.Layer<...>`). Why: channels compose through the Effect pipeline and services; hand-written tuples desync from the real flow. Fix: drop the generic and let the return type infer from the Effect/Layer you return, or expose a service method that returns the effect directly.")}})}),Lc=Io(function(e,t){const n=en(e);if(0===n.length)return;const r=Dn(n,t);return r&&(Rn(n)||Wn(n,t))?r:void 0},e=>`Rule: avoid ${3===e?"catchAll":"catch/catchEager"} after wrapGraphqlCall/applyResponse. Why: the envelope already surfaces structured errors. Fix: handle errors in the response mapping instead of ${3===e?"catchAll":"catch/catchEager"}.`),Nc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},ExpressionStatement(n){t&&dr(n.expression)&&ur(n.expression.arguments)&&uo(e,n.expression,"Rule: avoid Match.value(...).pipe(...) as a statement. Why: it runs side effects during render. Fix: move the side effect into an Effect runtime action or event handler, and keep Match as a pure expression.")}}}}),zc=Io(function(e){if(!c(e,"sync"))return;const t=Cn(a(e));return t?Mn(t):void 0},()=>"Rule: do not wrap Atom/atomRegistry ops in Effect.sync. Why: it hides side effects and breaks atom flow. Fix: call Atom.get/Atom.set/Atom.update/Atom.modify/Atom.refresh directly."),$c=Di({create:e=>({CallExpression(t){if(!_e(t,"Atom","family"))return;const n=Pn(t.arguments);n&&uo(e,n,"Keyed projection atom reads collection atom. Why: Atom.family should project from keyed/source atoms, not broad collection state. Fix: pass the keyed atom into the family or create a keyed source atom before reading.")}})}),Vc=Io(function(e){if(d(e))return en(e).find(e=>In(e))},e=>`Rule: do not inline runtime provisioning inside local helper Effect code. Why: \`yield* SomeRuntime.pipe(Effect.provide(SomeRuntimeLive))\` and equivalent inline provide chains hide dependency assembly instead of owning it at ${3===e?"an Effect.Service":"a Context.Service"} boundary or one exported Effect boundary. Fix: declare the live dependency on the owning service or provide it once at the exported boundary, then \`yield*\` the runtime or service directly inside the body.`),Bc=Di({create(t){const n=3===e(t.options)?"Schema.make` or field `.make":"schema .make";return{CallExpression(e){$n(e)&&uo(t,e,`Rule: avoid naked JS state patching/rebuild and raw JSON shortcuts in Effect transitions. Why: spread/Object.assign/fromEntries and inline JSON parse/stringify hide state intent and bypass explicit model contracts. Fix: use \`effect/Record\` combinators (\`Record.set\` / \`Record.modify\` / \`Record.remove\`) inside \`Struct.evolve\`, rebuild with schema constructors (\`${n}\`), and keep serialization at boundaries with schema encode/decode flows. Use \`linting.md\` guidance when available.`)}}}}),Uc=Io(e=>c(e,"succeed")&&Vn(a(e))?e:void 0,()=>"Rule: avoid Effect.succeed(variable) as a branch placeholder. Why: it hides a decision and turns data into pseudo-control flow. Fix: select a plain value (Option/Match) and then run one Effect pipeline after the decision; if you already read the state, return it as a value. Avoid Option.toArray/forEach hacks that just re-encode the branch."),Qc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},TSTypeAliasDeclaration(n){t&&An(n.typeAnnotation,"Effect","Effect")&&uo(e,n.typeAnnotation,"Rule: avoid Effect.Effect type aliases. Why: they hide the service surface and make types opaque. Fix: keep Effect types on service methods or inline at the call site.")}}}}),Kc=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},ExportNamedDeclaration(n){const r=t?En(n):void 0;r&&uo(e,r,"Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.")},ExportDefaultDeclaration(n){const r=t?En(n):void 0;r&&uo(e,r,"Rule: avoid public Effect APIs with generic Error. Why: public services need recoverable, typed error contracts. Fix: expose tagged domain errors instead of Error.")}}}}),_c=Di({create:e=>Oo(e,({errorChannel:e})=>sn(e),"Rule: model public errors as tagged Effect failures, not generic Error. Why: Error hides recovery semantics and domain context. Fix: return a domain-specific Data.TaggedError or tagged error union.")}),Yc=Di({create:e=>Oo(e,({errorChannel:e})=>"unknown"===Sn(e),"Rule: do not expose unknown as a public Effect error channel. Why: callers cannot recover by tag or type. Fix: return a tagged domain error union with operation-specific context.")}),Jc=Di({create:e=>Oo(e,({errorChannel:e})=>kn(e).size>1,"Rule: keep the public Effect error channel structurally consistent. Why: mixing Error, primitives, and unknown makes recovery ambiguous. Fix: map failures to one tagged error union.")}),Gc=Di({create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},VariableDeclaration(e){r&&Bn(e,n)&&uo(t,e,"Rule: avoid `as` assertions on decoded model flow. Why: assertions hide schema drift and allow untyped overlays. Fix: decode with the correct schema type and read fields directly.")}}}}),Hc=Di({create(e){let t=!1,r=!1;const o=[],i=new WeakSet,a=t=>{n(t)&&!i.has(t)&&(i.add(t),uo(e,t,"Rule: avoid local unknown-to-boolean coercion helpers in services. Why: runtime coercion belongs at schema boundary, not in service flow. Fix: decode boolean optionality in schema and read typed booleans in the Effect pipeline."))};return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},BinaryExpression(e){t&&Un(e)&&(r?a(e):o.push(e))},CallExpression(e){if(t&&Qn(e)){r=!0;for(const e of o)a(e)}}}}}),Zc=Io((e,t)=>Jn(e,t)?e:void 0,e=>`Rule: avoid nullish re-wrap inside Option.${3===e?"fromNullable":"fromNullishOr"}. Why: \`x ?? null\` and \`x ?? undefined\` add noise and hide source shape. Fix: pass the source directly to Option.${3===e?"fromNullable":"fromNullishOr"}.`),Xc=Io(e=>Zn(e)?e:void 0,e=>"Rule: avoid repeated Option boolean normalization (`onSome: value === true, onNone: false`). Why: it scatters coercion rules across services. Fix: normalize once at schema boundary and read booleans directly."),es=Di({create(t){const n=e(t.options);return{CallExpression(e){c(e,"succeed")&&Kn(a(e))&&uo(t,e,`Rule: avoid returning string tokens. Why: it encodes control flow and forces defensive branching. Fix: return domain values (Option/${3===n?"Either":"Result"}/tagged unions) or real Effect results instead.`)}}}}),ts=Di({create(t){const n=e(t.options);return{VariableDeclaration(e){Xn(e)&&uo(t,e,`Rule: avoid string status constants. Why: they encode control flow and force defensive branching. Fix: use tagged unions, Option/${3===n?"Either":"Result"}, or meaningful domain values instead of string tokens.`)}}}}),ns=Io(e=>gr(e)?e:void 0,e=>"Rule: avoid raw primitive domain ID aliases. Why: `type UserId = string` does not protect boundaries from swapped IDs. Fix: use Schema branded IDs or a domain constructor that validates and brands the value.",!1,!1,["TSTypeAliasDeclaration"]),rs=Di({create(e){let t=!1;const n=n=>{if(t)for(const t of Rr(n))uo(e,t,"Rule: avoid boolean behavior flags in domain operations. Why: flags like `shouldNotify` hide use cases and create implicit branching. Fix: model intent with a command/tagged union or split the operation into explicit functions.")};return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),os=Io(e=>so(e)?e:void 0,e=>"Rule: avoid magic domain string comparisons. Why: comparing domain state to raw strings scatters status vocabulary and misses exhaustiveness. Fix: use a tagged union, Schema literal union, or Match over a named domain status.",!1,!1,["BinaryExpression"]),is=Io(e=>kr(e)?e:void 0,e=>"Rule: avoid primitive-heavy domain parameters. Why: clusters of raw string/number domain values are easy to swap and have no invariant boundary. Fix: introduce branded types or a command/schema object with named validated fields.",!1,!1,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),as=Di({create(e){let t=!1;const n=n=>{if(t)for(const t of qr(n))uo(e,t,"Rule: avoid raw time fields in domain models. Why: number and Date fields hide units, clock ownership, and duration semantics. Fix: model durations with Effect Duration and keep raw timestamps at decode/encode boundaries.")};return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},TSInterfaceDeclaration:n,TSTypeLiteral:n}}}),cs=new Set(["fs","node:fs","fs/promises","node:fs/promises"]),ss=new Set(["assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib"]),us=Di({meta:{schema:va},create:e=>({ImportDeclaration(t){const n=fo(t);n&&Lo(n)&&!wo(e)&&uo(e,t,"Rule: avoid Node platform imports in shared code. Why: reusable modules must not require a Node runtime. Fix: move the import behind a configured application boundary or an Effect platform service.")}})}),ls=Di({meta:{schema:[{type:"object",properties:{boundaryPaths:{type:"array",items:{type:"string"}},configPaths:{type:"array",items:{type:"string"}}},additionalProperties:!1}]},create:e=>({MemberExpression(t){!$o(t)||Vo(t)||wo(e)||So(e)||uo(e,t,"Rule: avoid direct process.env reads outside configuration boundaries. Why: ambient configuration leaks runtime coupling into domain code. Fix: decode environment values in a configured Config service or Layer and depend on that service.")}})}),fs=Di({create(e){let t=!1,n=0;const r=[];return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0),n&&cs.has(n)&&r.push({node:e,source:n})},FunctionDeclaration(){n+=1},"FunctionDeclaration:exit"(){n-=1},FunctionExpression(){n+=1},"FunctionExpression:exit"(){n-=1},ArrowFunctionExpression(){n+=1},"ArrowFunctionExpression:exit"(){n-=1},CallExpression(e){if(0!==n)return;const t=Bo(e);t&&r.push({node:e,source:t})},"Program:exit"(){if(t)for(const{node:t,source:n}of r)uo(e,t,`Rule: avoid Node fs imports or require calls in Effect code (${n}). Why: direct Node filesystem APIs make reusable Effect modules platform-specific. Fix: move filesystem work behind an Effect platform service at the application boundary.`)}}}}),ps=Di({meta:{schema:va},create(t){const n=e(t.options);let r=!1;const o=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){qe(e,n)&&o.push(e)},"Program:exit"(){if(r&&!wo(t))for(const e of o)uo(t,e.callee,"Rule: avoid hidden Effect execution. Why: Effect.run* fixes runtime ownership inside reusable code. Fix: return the Effect and execute it from a configured application, CLI, worker, route, or test boundary.")}}}}),ds=new Set(["try","tryPromise","mapError","catchAll","catchTag","catchTags"]),ms=Di({meta:{schema:va},create(t){const n=e(t.options);return{TryStatement(e){e.handler&&wo(t)&&!Uo(e,n)&&uo(t,e,3===n?"Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, catchAll, or execute a mapped Effect program.":"Rule: map failures through Effect at application boundaries. Why: imperative try/catch hides typed failure handling and recovery policy. Fix: use Effect.try, Effect.tryPromise, mapError, Effect.catch, or execute a mapped Effect program.")}}}}),ys=Di({create(t){const n=e(t.options);let r=!1,i=!1;const a=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0),To(e)&&(i=!0)},CallExpression(e){o(e.callee,"JSON","parse")&&a.push(e)},"Program:exit"(){if(r&&!i)for(const e of a)uo(t,e,3===n?"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: decode unknown input with Schema.decodeUnknown at the boundary.":"Rule: avoid JSON.parse without an Effect Schema boundary. Why: parsed JSON is unknown input and unchecked casts hide malformed data. Fix: use Schema.fromJsonString with Schema.decodeUnknownEffect at the boundary.")}}}}),hs=Di({create(t){const n=e(t.options);let r=!1;const o=new WeakSet,i=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){if(A(e,n))for(const t of ie(e.arguments,R))o.has(t)||(o.add(t),i.push(t))},"Program:exit"(){if(r)for(const e of i)uo(t,e,"Rule: avoid Date.now inside Effect logic. Why: direct wall-clock reads make programs nondeterministic and difficult to test. Fix: obtain time through Effect Clock or DateTime at the boundary.")}}}}),gs=Di({meta:{schema:va},create(e){let t=!1;const n=[];return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},NewExpression(e){r(e.callee,"Date")&&n.push(e)},"Program:exit"(){if(t&&!wo(e))for(const t of n)uo(e,t,"Rule: avoid new Date in Effect domain logic. Why: direct wall-clock construction makes domain behaviour nondeterministic and difficult to test. Fix: obtain time through Effect Clock or model time at the boundary.")}}}}),bs=Di({create(e){let t=!1;const n=n=>{if(t)for(const t of Ir(n))uo(e,t,"Rule: avoid overloaded options objects. Why: `opts`, `options`, and `config` typed as any/object hide required fields and validation. Fix: accept unknown at the boundary and decode with Schema, or use a named typed command/config model.")};return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},FunctionDeclaration:n,FunctionExpression:n,ArrowFunctionExpression:n}}}),vs=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},LogicalExpression(n){t&&Lr(n)&&uo(e,n,"Rule: avoid embedding domain logic in conditionals. Why: multi-clause business rules become hard to test, reuse, and audit. Fix: extract a named domain predicate or validation Effect and call that from the branch.")}}}}),ws=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},LogicalExpression(n){t&&$r(n)&&uo(e,n,"Rule: avoid implicit state machines made from boolean flags. Why: multiple flags on one domain object allow impossible states. Fix: model the lifecycle as a tagged union or Data.TaggedEnum.")}}}}),Es=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},CallExpression(n){t&&Vr(n)&&uo(e,n,"Rule: avoid ad hoc domain errors. Why: string failures hide recovery semantics and observability. Fix: use Data.TaggedError or a structured domain error union.")},ThrowStatement(n){t&&io(n)&&uo(e,n,"Rule: avoid ad hoc domain errors. Why: thrown string Error values bypass typed Effect error channels. Fix: return Effect.fail with a structured tagged domain error.")}}}}),xs=Di({create(e){let t=!1;return{ImportDeclaration(e){const n=fo(e);n&&ko(n)&&(t=!0)},FunctionDeclaration(n){t&&co(n)&&uo(e,n,"Rule: avoid domain meaning by folder or context naming alone. Why: admin/public/internal meaning should be represented in types or services, not inferred from helper names. Fix: encode context with branded IDs, commands, policies, or service boundaries.")}}}}),Ss=Di({create:e=>({CallExpression(t){o(t.callee,"Effect","as")&&uo(e,t.callee,"Rule: avoid Effect.as wrappers. Why: they can hide meaningful sequencing or value flow. Fix: return the intended value directly or use explicit Effect.map/andThen.")}})}),ks=Di({create:e=>({MemberExpression(t){o(t,"Effect","Do")&&uo(e,t,"Rule: avoid Effect.Do. Why: it hides sequencing behind builder state. Fix: use Effect.gen or a direct pipe.")}})}),As=Qo("Effect","bind","Rule: avoid Effect.bind. Why: it obscures linear data flow behind builder-style binding. Fix: use Effect.gen or a direct pipe with flatMap/map."),Rs=Qo("Runtime","runFork","Rule: avoid Runtime.runFork. Why: detached fibers hide lifetime and interruption ownership. Fix: run effects through the application runtime boundary.",!0),Fs=Di({meta:{schema:va},create(t){const n=e(t.options);let r=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(r=!0)},CallExpression(e){r&&!wo(t)&&qe(e,n)&&uo(t,e.callee,"Rule: avoid running Effects outside runtime boundaries. Why: direct Effect.run* calls scatter execution ownership. Fix: return Effects from domain logic and run them at the app, CLI, worker, route, or test boundary.")}}}}),Ws=Qo("Effect","async","Rule: avoid Effect.async. Why: manual callback bridges are easy to leak or resume incorrectly. Fix: use scoped Effect APIs or a dedicated platform adapter.",!0),Ds=Di({create:e=>({CallExpression(t){s(t)&&uo(e,t,"Rule: avoid deeply nested Effect calls (Effect.xx(Effect.yy(Effect.zz(...)))). Why: they hide sequencing and spread flow. Fix: build values first, then run one flat Effect pipeline.")}})}),Cs=Di({create:e=>({VariableDeclaration(t){for(const n of t.declarations??[])s(n.init)&&uo(e,n.init,"Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.")},ReturnStatement(t){s(t.argument)&&uo(e,t.argument,"Rule: avoid nested Effect combinators. Why: they hide sequencing and create laddered control flow. Fix: build context once (Effect.all/Effect.map) and then run a single flat pipeline.")}})}),js=Di({create(t){const n=e(t.options);return{VariableDeclaration(e){for(const r of e.declarations??[]){const e=f(r.init,n);e&&uo(t,r.init,e)}},ReturnStatement(e){const r=f(e.argument,n);r&&uo(t,e.argument,r)}}}}),Ms=Di({create:e=>({CallExpression(t){d(t)&&m(t.arguments)&&uo(e,t,"Rule: avoid nested pipe() chains. Why: they hide sequencing. Fix: refactor into one flat pipeline with a single decision point.")}})}),Ts=Di({create:e=>({CallExpression(t){u(t)&&uo(e,t,"Rule: avoid nested Effect call towers (Effect.fn(Effect.fn(...))). Why: it hides sequencing. Fix: build the inner Effect first, then use pipe/Effect.flatMap/Effect.andThen for a single flat pipeline.")}})}),qs=Di({create:t=>4===e(t.options)?{}:{CallExpression(e){p(e)&&uo(t,e,"Rule: avoid Effect.orElse around sequencing chains. Why: it hides error handling and splits the flow. Fix: move error handling to a single terminal decision after the pipeline.")}}}),Ps=Io(e=>tt(e)?e:void 0,e=>"Rule: avoid unbounded Effect.all policies over mapped collections. Why: an explicit concurrency option makes scheduling policy visible; omission defaults to sequential execution, not unlimited parallelism. Fix: pass an explicit `{ concurrency: n }` option or use a bounded batching strategy."),Is=Di({create(t){let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ExpressionStatement(r){const o=e(t.options),i=n?ot(r.expression,o):void 0;i&&uo(t,i,3===o?"Rule: avoid fire-and-forget Effect.fork. Why: detached fibers hide failure, interruption, and ownership. Fix: bind the fiber and join/await/interrupt it, or use Effect.forkScoped / Effect.forkIn with an explicit scope.":"Rule: avoid discarded Effect.forkChild / Effect.forkDetach constructions or handles. Why: a bare construction is lazy and starts no work; yielding then discarding the fiber loses explicit observation. Child fibers follow parent lifetime, detached fibers do not. Fix: retain and join/await/interrupt the fiber, or use forkScoped / forkIn with explicit scope ownership.")}}}}),Os=Di({create(t){let n=!1;const r=r=>{if(!n)return;const o=e(t.options),i=3===o?nt(r.body):ve(r.body,e=>void 0!==rt(e));i&&uo(t,4===o?rt(i):i,3===o?"Rule: avoid Effect.fork inside loops. Why: loop-spawned fibers create unbounded concurrency and unclear ownership. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit or a scoped supervisor.":"Rule: avoid Effect.forkChild / Effect.forkDetach inside loops. Why: per-item forks lack a collection-wide concurrency budget even when handles are retained. Fix: use Effect.forEach / Effect.all with an explicit concurrency limit; preserve observation and lifetime ownership.")};return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},ForStatement:r,ForInStatement:r,ForOfStatement:r,WhileStatement:r,DoWhileStatement:r}}}),Ls=Di({create(t){let n=!1;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},CallExpression(r){const o=e(t.options);n&&Et(r,o)&&uo(t,r,3===o?"Rule: avoid Effect.race without loser cleanup. Why: racing effects without ensuring/scoped cleanup can leak losing work or resources. Fix: wrap raced effects with Effect.ensuring/acquireRelease or use a scoped race boundary.":"Rule: require visible cleanup ownership around Effect races. Why: race operators interrupt losers, but resource release still needs a finalizer or scope. Fix: expose ensuring/acquireRelease or a scoped race boundary; race/raceAll select success, raceFirst/raceAllFirst select first completion.")}}}}),Ns=Di({create(t){let n=!1;const o=new Map,i=new Set,a=new Set;return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},VariableDeclarator(n){if(4===e(t.options))return void(r(n.id)&&"YieldExpression"===n.init?.type&&rt(n.init.argument)&&a.add(n));const i=Jt(n);i&&o.set(i,n)},CallExpression(n){if(4===e(t.options))return;const r=Gt(n);r&&i.add(r)},"Program:exit"(){if(n)if(4!==e(t.options))for(const[e,n]of o)i.has(e)||uo(t,n,"Rule: avoid unobserved forked fibers. Why: forked fiber failures and interruption should be observed. Fix: pass the fiber to Fiber.join, Fiber.await, Fiber.interrupt, or use scoped fork APIs.");else for(const e of a)(t.sourceCode?.getDeclaredVariables(e)??[]).some(e=>e.references.some(e=>Ht(e.identifier)))||uo(t,e,"Rule: avoid unobserved forked fibers. Why: yielded child/detached handles need explicit observation or ownership transfer. Fix: join/await/interrupt the same lexical binding, return it to its owner, or use scoped fork APIs. This checks reference syntax, not whether observation executes.")}}}}),zs=Io(e=>St(e)?e:void 0,()=>"Rule: avoid unbounded concurrent retry policies. Why: inline retries need an explicit collection scheduling policy; omitted concurrency defaults to sequential execution, not unlimited parallelism. Fix: add an explicit concurrency limit and a bounded retry/backoff policy. This heuristic checks option presence, not its bound or retry count."),$s=Io(function(e,t=3){const n=S(e,"gen",t)??(4===t?S(e,"fn",t):void 0),r=4===t?e=>ve(e,je):Me;if(n)return r(n.body);if(c(e,"sync")){const t=Cn(a(e));return t?r(t):void 0}},e=>`Rule: avoid blocking sync calls inside Effect logic. Why: synchronous I/O or CPU work blocks the executing JavaScript thread; wrapping it in a Promise does not offload it. Fix: use genuinely asynchronous platform APIs via Effect.${4===e?"callback":"async"}/tryPromise, or a dedicated worker for blocking work. Sync suffix recognition is a heuristic.`),Vs=Io(function(e,t=3){if(4===t){const n=S(e,"fn",t)??(c(e,"sync")?a(e):void 0);return(n?ve(Cn(n),Ae):void 0)??we(e,t,Ae)}const n=S(e,"gen");if(n)return Re(n.body);if(c(e,"sync")){const t=Cn(a(e));return t?Re(t):void 0}if(!i(e))return;const o=e.callee.property;if(r(o)&&Li.has(o.name))for(const t of e.arguments){const e=Cn(t),n=e?Re(e):void 0;if(n)return n}},e=>`Rule: avoid Promise concurrency APIs inside Effect logic. Why: raw Promise aggregation does not own interruption of its underlying operations. Fix: use bounded Effect.all/forEach, Effect.${4===e?"result":"either"} for settled outcomes, raceFirst for first completion or race for first success, with signal-aware boundary adapters. Preserve application error semantics explicitly.`),Bs=Di({create(t){let n=!1;const r=new Set,o=[],i=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},VariableDeclaration(n){if("let"===n.kind||"var"===n.kind)if(4!==e(t.options))for(const e of kt(n))r.add(e);else o.push(n)},CallExpression(o){if(!n)return;if(4===e(t.options)){const e=Dt(o);return void(e&&i.push(e))}const a=Wt(o);if(!a)return;const c=Ft(a,r);c&&uo(t,c,"Rule: avoid mutating shared state across fibers. Why: outer let/var state mutated from forked or parallel work creates nondeterministic races. Fix: model shared state with Ref/SynchronizedRef/Queue or aggregate immutable results with bounded Effect.all/forEach.")},"Program:exit"(){if(!n||4!==e(t.options))return;const r=o.flatMap(e=>t.sourceCode.getDeclaredVariables(e));for(const e of i){const n=Mt(e,r);n&&uo(t,n,"Rule: avoid mutating shared state across fibers. Why: outer let/var writes in child/detached or collection work couple workers through mutable state. Fix: use Ref updates or aggregate immutable results. This checks lexical inline work, not execution or a proven data race; collections default to sequential execution.")}}}}}),Us=Io(function(e,t=3){if(4===t){let t;return[...Vi].some(t=>c(e,t))||n(e)&&"CallExpression"===e.type&&[...Vi].some(t=>c(e.callee,t))?t=a(e):d(e)&&[...Vi].some(t=>c(e.arguments.at(-1),t))&&(t=Ce(e)),c(t,"promise")?Fe(a(t))?void 0:t:c(t,"tryPromise")&&!We(t)?t:void 0}if(!c(e,"timeout"))return;const r=a(e);return De(r)?r:void 0},()=>"Rule: avoid timeout around noninterruptible Promise effects. Why: Effect timeout interrupts the wrapper, but the underlying operation stops only if it observes cancellation. Fix: accept and forward AbortSignal in the adapter to an API that honours it. Parameter presence is a syntax heuristic, not proof of cancellation."),Qs=Io((e,t)=>Qt(e,t)?e:void 0,()=>"Rule: avoid uninterruptible concurrent regions. Why: broad masking around collection, fork, race or waiting work can defer cancellation and shutdown. Fix: keep only a short critical section masked and explicitly restore interruption for long-running work. Scoping alone does not restore interruptibility; syntax does not prove the mask is actually executed."),Ks=Io((e,t)=>Kt(e,t)?e:void 0,()=>"Rule: avoid unbounded Queue or PubSub constructors. Why: unbounded buffers hide backpressure and can fail under load. Fix: use Queue.bounded / PubSub.bounded with an explicit capacity at the owning boundary."),_s=Di({create(t){let n=!1;const r=new Set,o=[],i=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},VariableDeclaration(n){if(4!==e(t.options))for(const e of Yt(n))r.add(e);else o.push(n)},CallExpression(o){if(!n)return;if(4===e(t.options)){const e=Dt(o);return void(e&&i.push(e))}const a=Wt(o);if(!a)return;const c=Ft(a,r);c&&uo(t,c,"Rule: avoid global mutable concurrency state. Why: module-scope mutable state touched from concurrent Effect work behaves like shared mutable global state. Fix: move ownership into Ref/SynchronizedRef/Queue/Layer state or pass immutable values through bounded effects.")},"Program:exit"(){if(!n||4!==e(t.options))return;const r=o.flatMap(e=>t.sourceCode.getDeclaredVariables(e).filter(t=>("module"===t.scope.type||"global"===t.scope.type)&&Yt(e).includes(t.name)));for(const e of i){const n=Mt(e,r);n&&uo(t,n,"Rule: avoid global mutable concurrency state. Why: module-owned let/var or mutable containers couple inline workers. Fix: own Ref or immutable results in a service/layer. Lexical syntax does not prove execution or a data race; default collections are sequential.")}}}}}),Ys=Di({create(t){let n=!1;const o=[new Set],i=new WeakSet,c=[];return{ImportDeclaration(e){const t=fo(e);t&&ko(t)&&(n=!0)},FunctionDeclaration(){o.push(new Set)},"FunctionDeclaration:exit"(){o.pop()},FunctionExpression(){o.push(new Set)},"FunctionExpression:exit"(){o.pop()},ArrowFunctionExpression(){o.push(new Set)},"ArrowFunctionExpression:exit"(){o.pop()},VariableDeclarator(n){if(4===e(t.options)){const e="YieldExpression"===n.init?.type?n.init.argument:n.init;return void(r(n.id)&&(_e(e,"Deferred","make")||_e(e,"Deferred","makeUnsafe"))&&c.push(n))}const i=yt(n);i&&o.at(-1)?.add(i)},CallExpression(c){if(4===e(t.options))return;if(!n||!mt(c))return;const s=a(c);r(s)&&o.at(-1)?.has(s.name)&&(bt(c,s.name)||i.has(c)||(i.add(c),uo(t,c,"Rule: avoid unbounded manual Deferred coordination. Why: a local latch can wait forever and make shutdown or failure ownership implicit. Fix: bound the await with a timeout/race, keep it interruptible, or tie completion and cleanup to a scope finalizer.")))},"Program:exit"(){if(n&&4===e(t.options))for(const e of c)for(const n of t.sourceCode.getDeclaredVariables(e))for(const e of n.references){const r=e.identifier.parent;mt(r)&&a(r)===e.identifier&&!bt(r,n.name,4,n.references)&&uo(t,r,"Rule: avoid unbounded manual Deferred coordination. Why: a local latch needs visible completion or cancellation ownership. Fix: use a timeout/race or an interruptible owner with a same-binding finalizer. Scope/interruptibility/finalizer markers alone do not prove eventual completion.")}}}}}),Js=Io((e,t)=>{const n=Ot(e,t);return n?Vt(n,t):void 0},e=>"Rule: avoid resource acquisition without scoped release. Why: acquiring a client, connection, file, or handle inside concurrent work can outlive failures and interruption. Fix: "+(3===e?"wrap acquisition in acquireRelease/acquireUseRelease, use Effect.scoped, or register a matching finalizer.":"own release; a scope marker is insufficient."),!0),Gs=Io((e,t)=>{const n=st(e,t);return n&&(4===t?Ut(n,!0):at(n))?e:void 0},()=>"Rule: avoid suspension while holding a semaphore permit. Why: unrelated waits hold capacity needed by other work. Fix: narrow coordination critical sections when semantics allow. Async work may intentionally be permit-bound; moving it outside changes concurrency limits. This strict policy is not leak detection."),Hs=Io((e,t)=>{const n=ut(e,t);return n&&(3===t?at(n):Ut(Cn(n)??n,!0))?e:void 0},e=>"Rule: avoid suspension while holding synchronized reference coordination. Why: effectful SynchronizedRef modifiers hold internal coordination while the callback sleeps, awaits, or starts concurrent work. Fix: "+(3===e?"compute the effect outside the modifier and commit a short synchronous state transition.":"move independent work outside; retain atomicity.")),Zs=Di({create:e=>({ImportExpression(t){uo(e,t,"Rule: avoid dynamic imports. Why: runtime module loading obscures dependency boundaries. Fix: use static imports.")}})}),Xs=Io((e,t)=>{if(3===t)return c(e,"forkDaemon")&&!l(a(e),"supervised")?e:void 0;const n=d(e)?e.arguments.at(-1):e?.callee;if(c(e,"forkDetach")){const t=a(e);return!t||r(t,"undefined")||Ve(t)?void 0:e}return c(n,"forkDetach")||pt(n,"forkDetach")?e:void 0},e=>`Rule: avoid unscoped background fibers. Why: Effect.${3===e?"forkDaemon":"forkDetach"} detaches work from the caller's scope and can outlive failures and shutdown. Fix: use forkScoped/forkIn ${3===e?"or make supervisor ownership explicit in the child effect.":"or child ownership; join is not lifetime ownership."}`),eu=Jo((e,t)=>It(e)&&!Yo(e,t),()=>"Rule: avoid manual resource cleanup. Why: direct close/dispose calls can bypass Effect scope ownership. Fix: acquire the resource with Effect.acquireRelease or register cleanup with a Scope finalizer."),tu=new Set(["BlockStatement","CatchClause","ForInStatement","ForOfStatement","ForStatement","Program","SwitchStatement"]),nu={"no-react-state":Ea,"no-if-statement":xa,"no-switch-statement":Sa,"no-ternary":ka,"no-return-null":Aa,"no-option-as":Ra,"no-effect-never":Fa,"no-arrow-ladder":Wa,"no-branch-in-object":Da,"no-iife-wrapper":Ca,"no-return-in-arrow":ja,"no-return-in-callback":Ma,"no-effect-fn-generator":Ta,"no-effect-sync-console":qa,"no-console-in-effect-flow":Ia,"no-effect-log-without-structured-context":Oa,"require-span-on-public-service-method":La,"no-runpromise-in-non-async-test-body":Na,"require-effect-flip-for-error-test":za,"no-test-mock-layer-when-default-available":$a,"no-nested-effect-gen":Va,"no-yield-without-star-in-effect-gen":Ba,"no-piped-yield-in-gen":Ua,"no-gen-for-mapping":Qa,"prefer-gen-for-workflow":Ka,"no-business-logic-in-pipe":Ha,"no-large-anonymous-flow":_a,"no-effect-in-flow":Ya,"prefer-named-flow":Ja,"prefer-flow-for-pure-pipeline":Ga,"prefer-pipe-for-behavior":Za,"prefer-decorated-effect-before-gen":Xa,"no-workflow-in-behavior-pipe":ec,"no-mixed-pillar-function":tc,"no-clever-effect-expression":nc,"prefer-extracted-concept":rc,"prefer-effect-service":oc,"no-layer-provide-in-service-definition":ic,"require-service-accessors":ac,"require-service-dependencies":cc,"no-namespace-effect-import":sc,"no-manual-service-object-export":uc,"no-layer-merge-in-request-handler":mc,"no-service-method-returning-promise":yc,"prefer-layer-pipe":lc,"no-inline-layer-provide-in-program":fc,"prefer-layer-mergeall-for-infrastructure":pc,"no-service-layer-scatter":dc,"no-match-void-branch":hc,"no-json-parse-without-schema":ys,"no-date-now-in-effect":hs,"no-new-date-in-domain-logic":gs,"no-match-effect-branch":gc,"warn-effect-sync-wrapper":bc,"no-effect-side-effect-wrapper":vc,"no-effect-all-step-sequencing":wc,"no-async-effect-combinator-callback":Ec,"no-throw-in-effect-logic":xc,"no-or-die-outside-boundary":Sc,"no-swallowed-catch-all":kc,"no-effect-ignore":Mc,"no-try-catch-in-effect-logic":Tc,"no-promise-api-in-effect-logic":qc,"no-try-catch":Pc,"no-effect-wrapper-alias":Ic,"no-manual-effect-channels":Oc,"no-wrapgraphql-catchall":Lc,"no-render-side-effects":Nc,"no-atom-registry-effect-sync":zc,"no-family-collection-read":$c,"no-inline-runtime-provide":Vc,"no-naked-object-state-update":Bc,"no-effect-succeed-variable":Uc,"no-effect-type-alias":Qc,"no-public-generic-effect-error":Kc,"no-early-catchall-null":Rc,"no-empty-error-tag":Ac,"no-expected-state-as-error":Fc,"no-exception-domain-error":Wc,"no-effect-fail-error-message":Dc,"no-catchall-generic-rethrow":Cc,"no-log-only-error-handling":jc,"no-error-as-public-effect-error":_c,"no-unknown-public-error-channel":Yc,"no-mixed-effect-error-shapes":Jc,"no-model-overlay-cast":Gc,"no-unknown-boolean-coercion-helper":Hc,"no-fromnullable-nullish-coalesce":Zc,"no-option-boolean-normalization":Xc,"no-string-sentinel-return":es,"no-string-sentinel-const":ts,"no-raw-domain-id-alias":ns,"no-boolean-domain-flag":rs,"no-magic-domain-string":os,"no-raw-domain-primitive-params":is,"no-raw-time-domain-field":as,"no-hidden-effect-execution":ps,"no-boundary-try-catch-without-effect-map":ms,"no-node-fs-in-effect-code":fs,"no-node-platform-in-shared-code":us,"no-process-env-direct-read":ls,"no-overloaded-options-object":bs,"no-domain-logic-in-conditional":vs,"no-implicit-state-machine-object":ws,"no-adhoc-domain-error":Es,"no-domain-meaning-by-folder-only":xs,"no-effect-as":Ss,"no-effect-do":ks,"no-effect-bind":As,"no-runtime-runfork":Rs,"no-run-effect-outside-boundary":Fs,"no-effect-async":Ws,"prevent-dynamic-imports":Zs,"no-nested-effect-call":Ds,"no-effect-ladder":Cs,"no-flatmap-ladder":js,"no-pipe-ladder":Ms,"no-call-tower":Ts,"no-effect-orElse-ladder":qs,"no-unbounded-effect-all":Ps,"no-fire-and-forget-fork":Is,"no-fork-in-loop":Os,"no-race-without-cleanup":Ls,"no-unobserved-fiber":Ns,"no-unbounded-concurrent-retry":zs,"no-blocking-call-in-effect":$s,"no-promise-concurrency-in-effect":Vs,"no-shared-mutable-state-across-fibers":Bs,"no-timeout-with-noninterruptible-promise":Us,"no-uninterruptible-concurrent-region":Qs,"no-unbounded-queue-or-pubsub":Ks,"no-global-mutable-concurrency-state":_s,"no-manual-deferred-coordination":Ys,"no-acquire-without-scoped-release":Js,"no-manual-resource-close":eu,"no-unbound-scope":Jo((e,t)=>Go(e)&&!pi(e,t),e=>"Rule: bind Scope.make to an owned lifecycle. Why: an unbound Scope can leak resources and finalizers. Fix: "+(3===e?"use Effect.scoped/Layer.scoped, close the scope explicitly, or acquire it with a matching release callback.":"use Effect.scope or acquire it with a matching Scope.close release callback. Effect.scoped alone does not own a separate scope.")),"no-resource-succeed-escape":Jo(e=>c(e,"succeed")&&Pt(a(e)),()=>"Rule: do not let live resources escape through Effect.succeed. Why: ordinary success values do not express resource lifetime ownership. Fix: keep the resource inside Effect.acquireRelease, Scope, or a service layer."),"no-resource-without-acquire-release":Jo((e,t)=>Lt(e)&&!hi(e,t),e=>`Rule: acquire resources with an Effect release owner. Why: open/connect/create calls can leak across failure and interruption when they are ordinary calls. Fix: use Effect.acquireRelease, Effect.acquireUseRelease, ${3===e?"Effect.scoped, ":""}or a matching finalizer.`),"no-request-scoped-long-lived-resource":Io(function(e,t=3){if(!wi(e)||!n(e))return[];const r=e;return ie(r.body,e=>mi(e)&&Ei(e,t)===r)},()=>"Rule: do not acquire long-lived resources inside request-scoped handlers. Why: per-request clients and pools multiply connections and make shutdown ownership ambiguous. Fix: provide the resource through a Layer or a longer-lived service boundary.",!0,!0,["FunctionDeclaration","FunctionExpression","ArrowFunctionExpression"]),"no-global-resource-singleton":Io(e=>void 0===ci(e)&&di(e)?e:void 0,e=>`Rule: do not create global resource singletons in Effect modules. Why: module-level clients and pools bypass Layer ownership and make tests and shutdown order implicit. Fix: construct the resource in a Layer${3===e?" or Effect.Service":" using Context.Service"} and provide it at the application boundary.`,!1,!0,["NewExpression"]),"no-run-with-open-resource":Io((e,t)=>qe(e,t)&&void 0!==xi(e,t)?e:void 0,()=>"Rule: do not run an Effect while an unowned resource is open in the same scope. Why: runtime execution can finish without closing the resource. Fix: move acquisition into acquireRelease/scoped ownership and run only the managed effect."),"no-nested-acquire-release":Io(function(e,t=3){if(yi(e,t))return ie(e,e=>yi(e,t)).length>=3?e:void 0},()=>"Rule: avoid deeply nested resource acquisition. Why: nested release stacks are difficult to audit and compose. Fix: build a named Layer or combine independent resources into one managed acquisition boundary."),"no-missing-layer-provision-at-run":Io((e,t,n)=>ki(e,t,n)?e:void 0,e=>3===e?"Rule: provide service layers before running an Effect that retrieves services. Why: an unprovided tag fails at runtime and hides the dependency contract at the boundary. Fix: compose the required Layer and use Effect.provide or Layer.provide before Effect.run*.":"Rule: make service layer provision visible before running. Why: a context argument or Service-shaped yield does not prove Layer ownership. Fix: provide the required Layer before Effect.run*. This is syntax policy, not dependency type checking."),"no-yield-with-held-semaphore-permit":Gs,"no-yield-with-held-mutable-ref":Hs,"no-unscoped-background-fiber":Xs};for(const e of Ci){const n=nu[e];n.meta={...n.meta,schema:t(Array.isArray(n.meta?.schema)?n.meta.schema:[])}}const ru=["no-runpromise-in-non-async-test-body","require-effect-flip-for-error-test","no-test-mock-layer-when-default-available"],ou=["no-manual-deferred-coordination","no-yield-with-held-semaphore-permit","no-yield-with-held-mutable-ref","no-unscoped-background-fiber"],iu=["no-early-catchall-null","no-empty-error-tag"],au=["no-business-logic-in-pipe"],cu=["prefer-flow-for-pure-pipeline"],su=["no-request-scoped-long-lived-resource","no-global-resource-singleton","no-nested-acquire-release","no-missing-layer-provision-at-run"],uu=[{name:"linteffect",specifier:"@opsydyn/oxlint-effect"}],{reactAndRuntimeBoundariesRules:lu,effectCompositionRules:fu,concurrencySafetyRules:pu,resourceLifetimeRules:du,pipelineShapeAndSequencingRules:mu,branchingAndLocalControlFlowRules:yu,optionMatchAndDataNormalizationRules:hu,atomStateAndPlatformBoundariesRules:gu,domainModelingRules:bu,errorModelingRules:vu,dddRules:wu,effectFlowRules:Eu,pureTransformationRules:xu,behaviorDecorationRules:Su,styleSeparationRules:ku,serviceAndLayerArchitectureRules:Au,platformAndBoundaryHygieneRules:Ru,testingObservabilityAndQaRules:Fu,allRules:Wu,recommendedRules:Du,ruleGroups:Cu,recommended:ju,typeAware:Mu,reactAndRuntimeBoundaries:Tu,effectComposition:qu,concurrencySafety:Pu,resourceLifetime:Iu,pipelineShapeAndSequencing:Ou,branchingAndLocalControlFlow:Lu,optionMatchAndDataNormalization:Nu,atomStateAndPlatformBoundaries:zu,domainModeling:$u,errorModeling:Vu,ddd:Bu,effectFlow:Uu,pureTransformation:Qu,behaviorDecoration:Ku,styleSeparation:_u,serviceAndLayerArchitecture:Yu,platformAndBoundaryHygiene:Ju,testingObservabilityAndQa:Gu,presets:Hu}=Fi(4),Zu=Fi(3);var Xu=Wi({meta:{name:"linteffect"},rules:nu});export{Wu as allRules,zu as atomStateAndPlatformBoundaries,gu as atomStateAndPlatformBoundariesRules,Ku as behaviorDecoration,Su as behaviorDecorationRules,Lu as branchingAndLocalControlFlow,yu as branchingAndLocalControlFlowRules,Pu as concurrencySafety,pu as concurrencySafetyRules,Bu as ddd,wu as dddRules,Xu as default,$u as domainModeling,bu as domainModelingRules,Zu as effect3,qu as effectComposition,fu as effectCompositionRules,Uu as effectFlow,Eu as effectFlowRules,Vu as errorModeling,vu as errorModelingRules,uu as jsPlugins,Nu as optionMatchAndDataNormalization,hu as optionMatchAndDataNormalizationRules,Ou as pipelineShapeAndSequencing,mu as pipelineShapeAndSequencingRules,Ju as platformAndBoundaryHygiene,Ru as platformAndBoundaryHygieneRules,Hu as presets,Qu as pureTransformation,xu as pureTransformationRules,Tu as reactAndRuntimeBoundaries,lu as reactAndRuntimeBoundariesRules,ju as recommended,Du as recommendedRules,Iu as resourceLifetime,du as resourceLifetimeRules,Cu as ruleGroups,Yu as serviceAndLayerArchitecture,Au as serviceAndLayerArchitectureRules,_u as styleSeparation,ku as styleSeparationRules,Gu as testingObservabilityAndQa,Fu as testingObservabilityAndQaRules,Mu as typeAware};
2
2
  //# sourceMappingURL=index.mjs.map