{"version":3,"sources":["../src/index.ts","../src/rules/no-immediate-execution.ts","../src/rules/require-step-id.ts","../src/rules/require-thunk-for-key.ts","../src/rules/stable-cache-keys.ts","../src/rules/no-floating-workflow.ts","../src/rules/no-floating-result.ts","../src/rules/require-result-handling.ts","../src/rules/no-options-on-executor.ts","../src/rules/no-double-wrap-result.ts","../src/rules/no-dynamic-import.ts","../src/rules/step-no-bare-await.ts","../src/rules/step-no-try-catch-wrap.ts","../src/rules/step-no-deps-bypass.ts","../src/rules/concurrency-no-promise-all.ts","../src/rules/concurrency-no-promise-race.ts","../src/rules/concurrency-no-promise-allsettled.ts","../src/rules/result-no-manual-propagation.ts","../src/rules/result-no-direct-ok-err.ts","../src/rules/workflow-no-callable-form.ts","../src/rules/workflow-callback-shape.ts","../src/rules/error-check-unexpected-first.ts"],"sourcesContent":["import type { ESLint, Linter } from 'eslint';\nimport noImmediateExecution from './rules/no-immediate-execution.js';\nimport requireStepId from './rules/require-step-id.js';\nimport requireThunkForKey from './rules/require-thunk-for-key.js';\nimport stableCacheKeys from './rules/stable-cache-keys.js';\nimport noFloatingWorkflow from './rules/no-floating-workflow.js';\nimport noFloatingResult from './rules/no-floating-result.js';\nimport requireResultHandling from './rules/require-result-handling.js';\nimport noOptionsOnExecutor from './rules/no-options-on-executor.js';\nimport noDoubleWrapResult from './rules/no-double-wrap-result.js';\nimport noDynamicImport from './rules/no-dynamic-import.js';\nimport stepNoBareAwait from './rules/step-no-bare-await.js';\nimport stepNoTryCatchWrap from './rules/step-no-try-catch-wrap.js';\nimport stepNoDepsBypass from './rules/step-no-deps-bypass.js';\nimport concurrencyNoPromiseAll from './rules/concurrency-no-promise-all.js';\nimport concurrencyNoPromiseRace from './rules/concurrency-no-promise-race.js';\nimport concurrencyNoPromiseAllSettled from './rules/concurrency-no-promise-allsettled.js';\nimport resultNoManualPropagation from './rules/result-no-manual-propagation.js';\nimport resultNoDirectOkErr from './rules/result-no-direct-ok-err.js';\nimport workflowNoCallableForm from './rules/workflow-no-callable-form.js';\nimport workflowCallbackShape from './rules/workflow-callback-shape.js';\nimport errorCheckUnexpectedFirst from './rules/error-check-unexpected-first.js';\n\n// Canonical slug-native rule names. No legacy aliases — the rename is a\n// breaking change accompanying the AI-DX slug spine.\nconst rules = {\n  // step-*\n  'step-require-id': requireStepId,\n  'step-no-immediate-execution': noImmediateExecution,\n  'step-require-thunk-for-key': requireThunkForKey,\n  'step-stable-cache-keys': stableCacheKeys,\n  'step-no-bare-await': stepNoBareAwait,\n  'step-no-try-catch-wrap': stepNoTryCatchWrap,\n  'step-no-deps-bypass': stepNoDepsBypass,\n  // workflow-*\n  'workflow-no-floating': noFloatingWorkflow,\n  'workflow-options-position': noOptionsOnExecutor,\n  'workflow-callback-shape': workflowCallbackShape,\n  'workflow-no-callable-form': workflowNoCallableForm,\n  'workflow-no-dynamic-import': noDynamicImport,\n  // Diagrammability: steer raw control flow onto first-class constructs so\n  // the static diagram stays deterministic.\n  // result-*\n  'result-no-floating': noFloatingResult,\n  'result-require-handling': requireResultHandling,\n  'result-no-double-wrap': noDoubleWrapResult,\n  'result-no-manual-propagation': resultNoManualPropagation,\n  'result-no-direct-ok-err': resultNoDirectOkErr,\n  // concurrency-*\n  'concurrency-no-promise-all': concurrencyNoPromiseAll,\n  'concurrency-no-promise-race': concurrencyNoPromiseRace,\n  'concurrency-no-promise-allsettled': concurrencyNoPromiseAllSettled,\n  // error-*\n  'error-check-unexpected-first': errorCheckUnexpectedFirst,\n};\n\nconst configs: Record<string, Linter.Config[]> = {\n  recommended: [\n    {\n      plugins: {\n        awaitly: { rules },\n      },\n      rules: {\n        'awaitly/step-require-id': 'error',\n        'awaitly/step-no-immediate-execution': 'error',\n        'awaitly/step-require-thunk-for-key': 'error',\n        'awaitly/step-stable-cache-keys': 'error',\n        'awaitly/workflow-no-floating': 'error',\n        'awaitly/result-no-floating': 'error',\n        'awaitly/result-require-handling': 'warn',\n        'awaitly/workflow-options-position': 'error',\n        'awaitly/result-no-double-wrap': 'error',\n        'awaitly/workflow-no-dynamic-import': 'error',\n        'awaitly/step-no-bare-await': 'error',\n        'awaitly/step-no-try-catch-wrap': 'error',\n        'awaitly/step-no-deps-bypass': 'error',\n        'awaitly/concurrency-no-promise-all': 'error',\n        'awaitly/concurrency-no-promise-race': 'error',\n        'awaitly/concurrency-no-promise-allsettled': 'error',\n        'awaitly/result-no-manual-propagation': 'error',\n        'awaitly/result-no-direct-ok-err': 'error',\n        'awaitly/workflow-no-callable-form': 'error',\n        'awaitly/workflow-callback-shape': 'error',\n        // 'awaitly/error-check-unexpected-first': 'warn',\n        // ^ deliberately opt-in. The rule uses heuristic AST matching to\n        //   flag `if (result.error._tag === ...)` without an\n        //   `isUnexpectedError(result.error)` guard — false positives are\n        //   inevitable on patterns we didn't anticipate, so it's not in\n        //   `recommended` or `recommended-strict`. Enable it explicitly if\n        //   you want the warning.\n      },\n    },\n  ],\n  \"recommended-strict\": [\n    {\n      plugins: {\n        awaitly: { rules },\n      },\n      rules: {\n        \"awaitly/step-require-id\": \"error\",\n        \"awaitly/step-no-immediate-execution\": \"error\",\n        \"awaitly/step-require-thunk-for-key\": \"error\",\n        \"awaitly/step-stable-cache-keys\": \"error\",\n        \"awaitly/workflow-no-floating\": \"error\",\n        \"awaitly/result-no-floating\": \"error\",\n        \"awaitly/result-require-handling\": \"error\",\n        \"awaitly/workflow-options-position\": \"error\",\n        \"awaitly/result-no-double-wrap\": \"error\",\n        \"awaitly/workflow-no-dynamic-import\": \"error\",\n        \"awaitly/step-no-bare-await\": \"error\",\n        \"awaitly/step-no-try-catch-wrap\": \"error\",\n        \"awaitly/step-no-deps-bypass\": \"error\",\n        \"awaitly/concurrency-no-promise-all\": \"error\",\n        \"awaitly/concurrency-no-promise-race\": \"error\",\n        \"awaitly/concurrency-no-promise-allsettled\": \"error\",\n        \"awaitly/result-no-manual-propagation\": \"error\",\n        \"awaitly/result-no-direct-ok-err\": \"error\",\n        \"awaitly/workflow-no-callable-form\": \"error\",\n        \"awaitly/workflow-callback-shape\": \"error\",\n        // error-check-unexpected-first is opt-in (see note in `recommended`).\n      },\n    },\n  ],\n};\n\nconst plugin: ESLint.Plugin = {\n  meta: {\n    name: 'eslint-plugin-awaitly',\n    version: '0.1.0',\n  },\n  rules,\n  configs,\n};\n\nexport default plugin;\nexport { rules, configs };\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression } from 'estree';\n\n/**\n * Rule: no-immediate-execution\n *\n * Detects `step('id', fn())` patterns where the function is executed immediately\n * instead of being wrapped in a thunk `step('id', () => fn())`.\n *\n * step() requires a string ID as first argument; the executor is the second.\n *\n * BAD:  step('fetchUser', fetchUser('1'))  - executes immediately\n * BAD:  step('fetchUser', deps.fetchUser('1')) - executes immediately\n * GOOD: step('fetchUser', () => fetchUser('1')) - thunk, step controls execution\n */\n\nconst STEP_METHODS = new Set(['step', 'try', 'retry', 'withTimeout', 'fromResult', 'map', 'withFallback', 'withResource', 'workflow']);\n\n// Methods where the executor/function argument is at index 2 (3rd arg) instead of index 1 (2nd arg)\n// step.map('id', items, mapper, options?) - mapper is 3rd arg\nconst EXECUTOR_AT_INDEX_2 = new Set(['map']);\n\nfunction isDirectStepCall(node: CallExpression): boolean {\n  const { callee } = node;\n  return callee.type === 'Identifier' && callee.name === 'step';\n}\n\nfunction getStepMethodName(node: CallExpression): string | null {\n  const { callee } = node;\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee as MemberExpression;\n    if (\n      object.type === 'Identifier' &&\n      object.name === 'step' &&\n      property.type === 'Identifier' &&\n      STEP_METHODS.has(property.name)\n    ) {\n      return property.name;\n    }\n  }\n  return null;\n}\n\nfunction isStepCall(node: CallExpression): boolean {\n  if (isDirectStepCall(node)) return true;\n  return getStepMethodName(node) !== null;\n}\n\nfunction isStringLiteral(node: unknown): node is { type: 'Literal'; value: string } {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string; value?: unknown };\n  return typed.type === 'Literal' && typeof typed.value === 'string';\n}\n\nfunction isThunk(node: unknown): boolean {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string };\n\n  // Arrow function: () => ...\n  if (typed.type === 'ArrowFunctionExpression') return true;\n\n  // Regular function: function() { ... }\n  if (typed.type === 'FunctionExpression') return true;\n\n  return false;\n}\n\nfunction isCallExpression(node: unknown): node is CallExpression {\n  if (!node || typeof node !== 'object') return false;\n  return (node as { type?: string }).type === 'CallExpression';\n}\n\nfunction getCalleeName(node: CallExpression): string {\n  const { callee } = node;\n\n  if (callee.type === 'Identifier') {\n    return callee.name;\n  }\n\n  if (callee.type === 'MemberExpression') {\n    const { property } = callee;\n    if (property.type === 'Identifier') {\n      return property.name;\n    }\n  }\n\n  return 'function';\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow immediate function execution in step() calls. Use thunks: step(() => fn()) instead of step(fn())',\n      recommended: true,\n    },\n    fixable: 'code',\n    schema: [],\n    messages: {\n      immediateExecution:\n        \"Avoid immediate execution in step(). Use a thunk: step('id', () => {{functionName}}(...)) instead of step('id', {{functionName}}(...)). Immediate execution defeats caching, retries, and resume capabilities.\",\n    },\n  },\n\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (!isStepCall(node)) return;\n\n        const args = node.arguments;\n        let executorArg: typeof args[0];\n\n        if (isDirectStepCall(node)) {\n          // step() requires step('id', executor, options?). Executor is second arg when first is string.\n          if (isStringLiteral(args[0])) {\n            executorArg = args[1];\n          } else {\n            // Legacy or missing ID: treat first arg as executor for backward compat\n            executorArg = args[0];\n          }\n        } else {\n          // For step.method calls, determine executor position based on method\n          const methodName = getStepMethodName(node);\n          if (args.length > 0 && isStringLiteral(args[0])) {\n            // step.map('id', items, mapper, opts) - executor at index 2\n            // step.retry('id', fn, opts) / step.try('id', fn, opts) - executor at index 1\n            executorArg = methodName && EXECUTOR_AT_INDEX_2.has(methodName) ? args[2] : args[1];\n          } else {\n            executorArg = args[0];\n          }\n        }\n\n        if (!executorArg) return;\n        if (isThunk(executorArg)) return;\n        if (!isCallExpression(executorArg)) return;\n\n        const functionName = getCalleeName(executorArg);\n\n        context.report({\n          node: executorArg,\n          messageId: 'immediateExecution',\n          data: { functionName },\n          fix(fixer) {\n            const sourceCode = context.sourceCode;\n            const executorText = sourceCode.getText(executorArg!);\n            if (isDirectStepCall(node) && isStringLiteral(args[0])) {\n              return fixer.replaceText(executorArg!, `() => ${executorText}`);\n            }\n            if (!isDirectStepCall(node) && args[0] && isStringLiteral(args[0])) {\n              return fixer.replaceText(executorArg!, `() => ${executorText}`);\n            }\n            // Legacy step(fn()) or step(fn(), opts): fix to step('id', () => fn()[, opts])\n            const suggestedId = functionName !== 'function' ? functionName : 'step';\n            const restArgs = args.length > 1 ? `, ${args.slice(1).map((a) => sourceCode.getText(a)).join(', ')}` : '';\n            return fixer.replaceText(node, `step('${suggestedId}', () => ${executorText}${restArgs})`);\n          },\n        });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression } from 'estree';\n\n/**\n * Rule: require-step-id\n *\n * step() and all step helper methods require a string literal as the first argument (step ID / name).\n *\n * Covers:\n * - step('id', fn, options?)\n * - step.sleep('id', duration, options?)\n * - step.retry('id', fn, options)\n * - step.withTimeout('id', fn, options)\n * - step.try('id', fn, options)\n * - step.fromResult('id', fn, options)\n * - step.race('name', callback)\n * - step.all('name', shape, options?)\n * - step.map('id', items, mapper, options?)\n *\n * BAD:  step(() => fetchUser('1'))           - missing step ID\n * BAD:  step.all({ a: () => ... })           - missing name\n * GOOD: step('fetchUser', () => fetchUser('1'))\n * GOOD: step.all('Fetch data', { a: () => fetchA(), b: () => fetchB() })\n * GOOD: step.race('Fastest API', () => anyAsync([...]))\n */\n\n// Step helper methods that require string (id/name) as first argument\nconst STEP_HELPER_METHODS = ['sleep', 'retry', 'withTimeout', 'try', 'fromResult', 'race', 'all', 'map', 'withFallback', 'withResource', 'workflow'];\n\n/** Saga context param names that may receive step/tryStep (common in createSagaWorkflow / runSaga callbacks). */\nconst SAGA_CONTEXT_NAMES = ['saga', 'ctx', 'sagaContext', 's'];\n\nfunction isDirectStepCall(node: CallExpression): boolean {\n  const { callee } = node;\n  return callee.type === 'Identifier' && callee.name === 'step';\n}\n\n/** Destructured saga: tryStep(...) as identifier (e.g. ({ step, tryStep }) => tryStep(...)). */\nfunction isDirectTryStepCall(node: CallExpression): boolean {\n  const { callee } = node;\n  return callee.type === 'Identifier' && callee.name === 'tryStep';\n}\n\nfunction isStepHelperCall(node: CallExpression): string | null {\n  const { callee } = node;\n  if (callee.type !== 'MemberExpression') return null;\n\n  const memberExpr = callee as MemberExpression;\n\n  // Check if it's step.method or s.method (common alias)\n  if (memberExpr.object.type !== 'Identifier') return null;\n\n  const objectName = memberExpr.object.name;\n  // Support common step parameter names: step, s, runStep\n  if (objectName !== 'step' && objectName !== 's' && objectName !== 'runStep') return null;\n\n  // Check if the property is one of our helper methods\n  if (memberExpr.property.type !== 'Identifier') return null;\n\n  const methodName = memberExpr.property.name;\n  if (STEP_HELPER_METHODS.includes(methodName)) {\n    return methodName;\n  }\n\n  return null;\n}\n\n/** Returns 'step' | 'tryStep' if this is X.step / X.tryStep where X is a known saga param name (caller must also verify via scope that X is the callback's first param). */\nfunction getSagaStepMethod(node: CallExpression): 'step' | 'tryStep' | null {\n  const { callee } = node;\n  if (callee.type !== 'MemberExpression') return null;\n\n  const memberExpr = callee as MemberExpression;\n  if (memberExpr.object.type !== 'Identifier') return null;\n  if (memberExpr.property.type !== 'Identifier') return null;\n\n  const objectName = memberExpr.object.name;\n  const methodName = memberExpr.property.name;\n\n  if (!SAGA_CONTEXT_NAMES.includes(objectName)) return null;\n  if (methodName === 'step') return 'step';\n  if (methodName === 'tryStep') return 'tryStep';\n  return null;\n}\n\n/**\n * False only when the member call's object (saga, s, ctx, etc.) clearly refers to a\n * local variable (const/let/var), so we skip and avoid false positives. Otherwise\n * we enforce (including when unresolved or when it's the first param).\n */\nfunction isSagaContextMemberCall(\n  context: Rule.RuleContext,\n  callNode: CallExpression\n): boolean {\n  if (callNode.callee.type !== 'MemberExpression') return false;\n  const memberExpr = callNode.callee as MemberExpression;\n  if (memberExpr.object.type !== 'Identifier') return false;\n\n  const objName = (memberExpr.object as { name: string }).name;\n  let scope = context.sourceCode.getScope(callNode) as ScopeWithReferences | null;\n  type ResolvedRef = { resolved: { defs: Array<{ type: string }>; scope: ScopeWithReferences } | null };\n  let ref: ResolvedRef | null = null;\n  while (scope) {\n    const r = scope.references.find((x) => x.identifier === memberExpr.object);\n    if (r) {\n      ref = r as unknown as ResolvedRef;\n      break;\n    }\n    scope = scope.upper;\n  }\n  if (!ref || !ref.resolved) return true; // Unresolved: enforce (real saga in callback or standalone)\n  const variable = ref.resolved;\n  if (variable.defs.length === 0) return true;\n  if (variable.defs[0].type === 'Variable' || variable.defs[0].type === 'Function') return false; // Local: skip\n  if (variable.defs[0].type === 'Parameter') {\n    const paramScope = variable.scope;\n    const fn = paramScope.block as { type: string; params?: unknown[] } | undefined;\n    const firstParam = fn?.params?.[0] as { type: string; name?: string } | undefined;\n    if (firstParam?.type === 'Identifier' && firstParam.name !== objName) return false; // Other param: skip\n  }\n  return true;\n}\n\nfunction isStringLiteral(node: unknown): boolean {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string; value?: unknown };\n  return typed.type === 'Literal' && typeof typed.value === 'string';\n}\n\nfunction isTemplateLiteralWithNoExpressions(node: unknown): boolean {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string; expressions?: unknown[] };\n  return typed.type === 'TemplateLiteral' && Array.isArray(typed.expressions) && typed.expressions.length === 0;\n}\n\n/** Returns the string value for Literal or no-substitution TemplateLiteral, or null. Used to reject empty saga step names. */\nfunction getStringLiteralValue(node: unknown): string | null {\n  if (!node || typeof node !== 'object') return null;\n  const typed = node as {\n    type?: string;\n    value?: string;\n    quasis?: Array<{ value?: { cooked?: string } }>;\n    expressions?: unknown[];\n  };\n  if (typed.type === 'Literal' && typeof typed.value === 'string') return typed.value;\n  if (\n    typed.type === 'TemplateLiteral' &&\n    Array.isArray(typed.expressions) &&\n    typed.expressions.length === 0 &&\n    typed.quasis?.[0]\n  ) {\n    const cooked = typed.quasis[0].value?.cooked;\n    return typeof cooked === 'string' ? cooked : null;\n  }\n  return null;\n}\n\nfunction isEmptyStringLiteral(node: unknown): boolean {\n  return getStringLiteralValue(node) === '';\n}\n\n/**\n * True when the call's callee (tryStep) refers to a saga context parameter — i.e. the\n * enclosing callback's first parameter is an object pattern that includes tryStep.\n * Avoids false positives for unrelated local functions named tryStep.\n */\nfunction isSagaContextTryStep(\n  context: Rule.RuleContext,\n  callNode: CallExpression\n): boolean {\n  if (callNode.callee.type !== 'Identifier' || callNode.callee.name !== 'tryStep')\n    return false;\n\n  const scope = context.sourceCode.getScope(callNode) as ScopeWithReferences;\n  const ref = scope.references.find((r) => r.identifier === callNode.callee);\n  if (!ref || !ref.resolved) return false;\n\n  const variable = ref.resolved;\n  if (variable.defs.length === 0) return false;\n  if (variable.defs[0].type !== 'Parameter') return false;\n\n  const paramScope = variable.scope;\n  let current: ScopeWithReferences | null = scope;\n  while (current) {\n    if (current === paramScope) break;\n    current = current.upper;\n  }\n  if (!current) return false;\n\n  const fn = paramScope.block as { type: string; params?: unknown[] };\n  if (\n    fn.type !== 'ArrowFunctionExpression' &&\n    fn.type !== 'FunctionExpression' &&\n    fn.type !== 'FunctionDeclaration'\n  )\n    return false;\n  const firstParam = fn.params?.[0] as { type: string; properties?: Array<{ type: string; key?: { type: string; name?: string } }> } | undefined;\n  if (!firstParam || firstParam.type !== 'ObjectPattern') return false;\n  return (firstParam.properties ?? []).some(\n    (p) =>\n      p.type === 'Property' &&\n      p.key &&\n      (p.key as { type: string }).type === 'Identifier' &&\n      (p.key as { name: string }).name === 'tryStep'\n  );\n}\n\ninterface ScopeWithReferences {\n  references: Array<{ identifier: unknown; resolved: { defs: Array<{ type: string }>; scope: ScopeWithReferences } | null }>;\n  upper: ScopeWithReferences | null;\n  block?: unknown;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        \"Require a string literal as the first argument to step() and step helper methods (sleep, retry, withTimeout, try, fromResult, parallel, race, allSettled, run, andThen, match, all, map, withFallback, withResource, workflow).\",\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      requireStepId:\n        \"step() requires a string literal as the first argument (step ID). Example: step('fetchUser', () => fetchUser(id)).\",\n      requireHelperStepId:\n        \"step.{{method}}() requires a string literal as the first argument (step ID). Example: step.{{method}}('{{example}}', ...).\",\n      requireStepSleepDuration:\n        \"step.sleep() requires two arguments: id and duration (e.g. step.sleep('delay', '5s')). Single-argument step.sleep(duration) is the old API and fails at runtime.\",\n      requireSagaStepName:\n        \"saga.{{method}}() requires a string literal as the first argument (step name). Example: saga.{{method}}('createOrder', () => deps.createOrder(), { compensate: ... }).\",\n    },\n  },\n\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        // Check direct step() call\n        if (isDirectStepCall(node)) {\n          const firstArg = node.arguments[0];\n          if (!firstArg) {\n            context.report({\n              node,\n              messageId: 'requireStepId',\n            });\n            return;\n          }\n\n          if (!isStringLiteral(firstArg) && !isTemplateLiteralWithNoExpressions(firstArg)) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireStepId',\n            });\n          }\n          return;\n        }\n\n        // Check destructured tryStep(...) (name-first required) — only when tryStep refers to saga context param\n        if (isDirectTryStepCall(node) && isSagaContextTryStep(context, node)) {\n          const firstArg = node.arguments[0];\n          if (!firstArg) {\n            context.report({\n              node,\n              messageId: 'requireSagaStepName',\n              data: { method: 'tryStep' },\n            });\n            return;\n          }\n          if (!isStringLiteral(firstArg) && !isTemplateLiteralWithNoExpressions(firstArg)) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireSagaStepName',\n              data: { method: 'tryStep' },\n            });\n            return;\n          }\n          if (isEmptyStringLiteral(firstArg)) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireSagaStepName',\n              data: { method: 'tryStep' },\n            });\n          }\n          return;\n        }\n\n        // Check saga.step / saga.tryStep (name-first required) — only when object is saga context param\n        const sagaMethod = getSagaStepMethod(node);\n        if (sagaMethod && isSagaContextMemberCall(context, node)) {\n          const firstArg = node.arguments[0];\n          if (!firstArg) {\n            context.report({\n              node,\n              messageId: 'requireSagaStepName',\n              data: { method: sagaMethod },\n            });\n            return;\n          }\n          if (!isStringLiteral(firstArg) && !isTemplateLiteralWithNoExpressions(firstArg)) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireSagaStepName',\n              data: { method: sagaMethod },\n            });\n            return;\n          }\n          if (isEmptyStringLiteral(firstArg)) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireSagaStepName',\n              data: { method: sagaMethod },\n            });\n          }\n          return;\n        }\n\n        // Check step helper method calls\n        const helperMethod = isStepHelperCall(node);\n        if (helperMethod) {\n          const firstArg = node.arguments[0];\n\n          // step.sleep(id, duration, opts?) — require at least id and duration\n          if (helperMethod === 'sleep' && node.arguments.length < 2) {\n            context.report({\n              node,\n              messageId: 'requireStepSleepDuration',\n            });\n            return;\n          }\n\n          // Generate example based on method\n          const examples: Record<string, string> = {\n            sleep: 'delay',\n            retry: 'fetchData',\n            withTimeout: 'slowOp',\n            try: 'parse',\n            fromResult: 'callProvider',\n            parallel: 'Fetch data',\n            race: 'Fastest API',\n            allSettled: 'Fetch all',\n            run: 'fetchUser',\n            andThen: 'enrich',\n            match: 'handleUser',\n            all: 'fetchAll',\n            map: 'fetchUsers',\n            withFallback: 'getUser',\n            withResource: 'useDb',\n            workflow: 'child-call',\n          };\n\n          if (!firstArg) {\n            context.report({\n              node,\n              messageId: 'requireHelperStepId',\n              data: {\n                method: helperMethod,\n                example: examples[helperMethod] || 'stepId',\n              },\n            });\n            return;\n          }\n\n          if (!isStringLiteral(firstArg) && !isTemplateLiteralWithNoExpressions(firstArg)) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireHelperStepId',\n              data: {\n                method: helperMethod,\n                example: examples[helperMethod] || 'stepId',\n              },\n            });\n          }\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression, ObjectExpression, Property, Identifier, VariableDeclarator, AssignmentExpression, Node, Pattern } from 'estree';\n\n/**\n * Rule: require-thunk-for-key\n *\n * When using step() with a `key` option, the first argument MUST be a thunk.\n * Otherwise, the function executes immediately BEFORE step() can check the cache.\n *\n * With the direct pattern, the cache IS populated and step_complete events ARE emitted,\n * but the operation runs regardless of cache state - defeating the purpose of caching.\n *\n * BAD:  step(fetchUser('1'), { key: 'user:1' }) - fetchUser() runs immediately, even if cached\n * BAD:  const result = fetchUser('1'); step(result, { key }) - result is pre-computed\n * GOOD: step(() => fetchUser('1'), { key: 'user:1' }) - fetchUser() only runs on cache miss\n * GOOD: step(fetchUser, { key: 'user:1' }) - fetchUser is a function reference (thunk)\n */\n\nconst STEP_METHODS = new Set(['step', 'try', 'retry', 'withTimeout', 'fromResult', 'map', 'withFallback', 'withResource', 'workflow']);\n\n// Methods where the executor/function argument is at index 2 (3rd arg) instead of index 1 (2nd arg)\nconst EXECUTOR_AT_INDEX_2 = new Set(['map']);\n\nfunction getStepMethodName(node: CallExpression): string | null {\n  const { callee } = node;\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee as MemberExpression;\n    if (\n      object.type === 'Identifier' &&\n      object.name === 'step' &&\n      property.type === 'Identifier' &&\n      STEP_METHODS.has(property.name)\n    ) {\n      return property.name;\n    }\n  }\n  return null;\n}\n\nfunction isStepCall(node: CallExpression): boolean {\n  const { callee } = node;\n  if (callee.type === 'Identifier' && callee.name === 'step') return true;\n  return getStepMethodName(node) !== null;\n}\n\nfunction isThunk(node: unknown): boolean {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string };\n  return typed.type === 'ArrowFunctionExpression' || typed.type === 'FunctionExpression';\n}\n\nfunction isStringLiteral(node: unknown): boolean {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string; value?: unknown };\n  return typed.type === 'Literal' && typeof typed.value === 'string';\n}\n\nfunction getCalleeName(node: CallExpression): string {\n  const { callee } = node;\n  if (callee.type === 'Identifier') return callee.name;\n  if (callee.type === 'MemberExpression') {\n    const { property } = callee;\n    if (property.type === 'Identifier') return property.name;\n  }\n  return 'step';\n}\n\nfunction getRootIdentifier(node: MemberExpression): Identifier | null {\n  let current: Node = node.object;\n  while (current.type === 'MemberExpression') {\n    current = (current as MemberExpression).object;\n  }\n  return current.type === 'Identifier' ? current as Identifier : null;\n}\n\n// Variable names that suggest dependency/utility containers (properties are functions)\nconst UTILITY_OBJECT_PATTERNS = [\n  /^deps?$/i,           // deps, dep\n  /^dependencies$/i,    // dependencies\n  /^services?$/i,       // services, service\n  /^context$/i,         // context\n  /^ctx$/i,             // ctx\n  /^di$/i,              // di (dependency injection)\n  /^container$/i,       // container\n  /^providers?$/i,      // providers, provider\n  /^adapters?$/i,       // adapters, adapter\n  /^clients?$/i,        // clients, client\n  /^api$/i,             // api\n  /^sdk$/i,             // sdk\n];\n\nfunction _isUtilityObjectName(name: string): boolean {\n  return UTILITY_OBJECT_PATTERNS.some(pattern => pattern.test(name));\n}\n\n// Property names that look like function references (verbs or common function patterns)\nconst FUNCTION_PROPERTY_PATTERNS = [\n  /^fetch/i,      // fetchUser, fetchData\n  /^get/i,        // getUser, getData\n  /^create/i,     // createUser, createOrder\n  /^update/i,     // updateUser, updateSettings\n  /^delete/i,     // deleteUser, deleteRecord\n  /^remove/i,     // removeItem, removeUser\n  /^add/i,        // addItem, addUser\n  /^set/i,        // setConfig, setValue\n  /^handle/i,     // handleError, handleSubmit\n  /^process/i,    // processData, processOrder\n  /^validate/i,   // validateInput, validateUser\n  /^parse/i,      // parseJSON, parseDate\n  /^format/i,     // formatDate, formatCurrency\n  /^load/i,       // loadData, loadUser\n  /^save/i,       // saveData, saveUser\n  /^send/i,       // sendEmail, sendMessage\n  /^submit/i,     // submitForm, submitOrder\n  /^execute/i,    // executeQuery, executeCommand\n  /^run/i,        // runTask, runJob\n  /^call/i,       // callApi, callService\n  /^invoke/i,     // invokeFunction, invokeMethod\n  /^init/i,       // initApp, initialize\n  /^build/i,      // buildQuery, buildConfig\n  /^generate/i,   // generateReport, generateToken\n  /^compute/i,    // computeValue, computeHash\n  /^calculate/i,  // calculateTotal, calculateTax\n  /^find/i,       // findUser, findById\n  /^search/i,     // searchUsers, searchProducts\n  /^query/i,      // queryDatabase, queryUsers\n  /^list/i,       // listUsers, listItems\n  /^read/i,       // readFile, readData\n  /^write/i,      // writeFile, writeData\n  /^check/i,      // checkStatus, checkPermission\n  /^verify/i,     // verifyToken, verifyUser\n  /^transform/i,  // transformData, transformInput\n  /^convert/i,    // convertDate, convertCurrency\n  /^map/i,        // mapData, mapUsers\n  /^filter/i,     // filterItems, filterUsers\n  /^sort/i,       // sortItems, sortByDate\n  /^merge/i,      // mergeData, mergeObjects\n  /^split/i,      // splitString, splitData\n  /^join/i,       // joinStrings, joinArrays\n  /^render/i,     // renderComponent, renderPage\n  /^dispatch/i,   // dispatchAction, dispatchEvent\n  /^emit/i,       // emitEvent, emitSignal\n  /^subscribe/i,  // subscribeToEvents, subscribeToChannel\n  /^publish/i,    // publishEvent, publishMessage\n  /^notify/i,     // notifyUser, notifyAdmin\n  /^log/i,        // logError, logMessage\n  /^track/i,      // trackEvent, trackUser\n  /^record/i,     // recordEvent, recordMetric\n  /^measure/i,    // measureTime, measurePerformance\n  /^assert/i,     // assertEqual, assertValid\n  /^test/i,       // testConnection, testApi\n  /^mock/i,       // mockResponse, mockData\n  /^stub/i,       // stubMethod, stubFunction\n  /^spy/i,        // spyOn\n  /^clone/i,      // cloneObject, cloneArray\n  /^copy/i,       // copyData, copyFile\n  /^reset/i,      // resetState, resetForm\n  /^clear/i,      // clearCache, clearData\n  /^flush/i,      // flushCache, flushBuffer\n  /^close/i,      // closeConnection, closeFile\n  /^open/i,       // openFile, openConnection\n  /^start/i,      // startServer, startProcess\n  /^stop/i,       // stopServer, stopProcess\n  /^pause/i,      // pauseExecution, pauseTimer\n  /^resume/i,     // resumeExecution, resumeTimer\n  /^retry/i,      // retryOperation, retryRequest\n  /^cancel/i,     // cancelRequest, cancelOperation\n  /^abort/i,      // abortRequest, abortOperation\n  /^connect/i,    // connectToDatabase, connectToServer\n  /^disconnect/i, // disconnectFromDatabase\n  /^authenticate/i, // authenticateUser\n  /^authorize/i,  // authorizeRequest\n  /^login/i,      // loginUser\n  /^logout/i,     // logoutUser\n  /^register/i,   // registerUser\n  /^unregister/i, // unregisterUser\n  /^enable/i,     // enableFeature\n  /^disable/i,    // disableFeature\n  /^toggle/i,     // toggleFeature\n  /^show/i,       // showModal, showMessage\n  /^hide/i,       // hideModal, hideMessage\n  /^display/i,    // displayMessage\n  /^present/i,    // presentView\n  /^dismiss/i,    // dismissModal\n  /^is[A-Z]/,     // isValid, isEmpty (predicates)\n  /^has[A-Z]/,    // hasPermission, hasAccess (predicates)\n  /^can[A-Z]/,    // canEdit, canDelete (predicates)\n  /^should[A-Z]/, // shouldUpdate, shouldRender (predicates)\n  /^will[A-Z]/,   // willChange, willUpdate\n  /^did[A-Z]/,    // didMount, didUpdate\n  /^on[A-Z]/,     // onClick, onSubmit (event handlers)\n];\n\nfunction isFunctionPropertyName(name: string): boolean {\n  return FUNCTION_PROPERTY_PATTERNS.some(pattern => pattern.test(name));\n}\n\nfunction hasKeyOption(node: CallExpression): boolean {\n  // Look for options object with 'key' property\n  for (const arg of node.arguments) {\n    if (arg.type === 'ObjectExpression') {\n      const obj = arg as ObjectExpression;\n      for (const prop of obj.properties) {\n        if (prop.type === 'Property') {\n          const property = prop as Property;\n          if (\n            property.key.type === 'Identifier' &&\n            property.key.name === 'key'\n          ) {\n            return true;\n          }\n        }\n      }\n    }\n  }\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Require thunk when using step() with a key option. Without a thunk, the function executes immediately before the cache can be checked, defeating the purpose of caching.',\n      recommended: true,\n    },\n    fixable: 'code',\n    schema: [],\n    messages: {\n      requireThunkForKey:\n        \"When using step() with a 'key' option, the executor (second argument) must be a thunk: step('id', () => fn(), { key }). Without a thunk, the function executes immediately before step() checks the cache. The cache will still be populated and step_complete events will fire, but the operation runs regardless of cache state.\",\n    },\n  },\n\n  create(context) {\n    // Track definition nodes that are initialized with CallExpressions\n    const preComputedDefs = new WeakSet<Node>();\n\n    // Helper to find a variable by walking up the scope chain\n    function findVariable(name: string, startScope: ReturnType<typeof context.sourceCode.getScope>) {\n      let scope: typeof startScope | null = startScope;\n      while (scope) {\n        const variable = scope.set.get(name);\n        if (variable) return variable;\n        scope = scope.upper;\n      }\n      return null;\n    }\n\n    // Helper to check if an identifier references a precomputed definition\n    function isPrecomputedReference(identifierNode: Identifier): boolean {\n      const scope = context.sourceCode.getScope(identifierNode);\n      const variable = findVariable(identifierNode.name, scope);\n      if (!variable) return false;\n\n      for (const def of variable.defs) {\n        if (def.node && preComputedDefs.has(def.node)) {\n          return true;\n        }\n      }\n      return false;\n    }\n\n    // Helper to check if a pattern contains any identifiers (for destructuring)\n    function hasIdentifiersInPattern(pattern: Pattern): boolean {\n      if (pattern.type === 'Identifier') return true;\n      if (pattern.type === 'ObjectPattern') {\n        return pattern.properties.some(prop => {\n          if (prop.type === 'RestElement') return hasIdentifiersInPattern(prop.argument);\n          return hasIdentifiersInPattern(prop.value);\n        });\n      }\n      if (pattern.type === 'ArrayPattern') {\n        return pattern.elements.some(el => el !== null && hasIdentifiersInPattern(el));\n      }\n      if (pattern.type === 'AssignmentPattern') {\n        return hasIdentifiersInPattern(pattern.left);\n      }\n      if (pattern.type === 'RestElement') {\n        return hasIdentifiersInPattern(pattern.argument);\n      }\n      return false;\n    }\n\n    return {\n      VariableDeclarator(node: VariableDeclarator) {\n        // Track variables initialized with CallExpressions (pre-computed values)\n        // This includes both direct assignment and destructuring\n        if (node.init && node.init.type === 'CallExpression') {\n          if (hasIdentifiersInPattern(node.id)) {\n            preComputedDefs.add(node);\n          }\n        }\n      },\n\n      AssignmentExpression(node: AssignmentExpression) {\n        if (node.left.type !== 'Identifier') return;\n\n        const scope = context.sourceCode.getScope(node);\n        const variable = findVariable(node.left.name, scope);\n        if (!variable) return;\n\n        // If reassigned to a CallExpression, mark as precomputed\n        // If reassigned to something else (function ref, literal, etc.), remove from precomputed\n        if (node.right.type === 'CallExpression') {\n          for (const def of variable.defs) {\n            if (def.node) {\n              preComputedDefs.add(def.node);\n            }\n          }\n        } else {\n          // Reassigned to non-call value - no longer precomputed\n          for (const def of variable.defs) {\n            if (def.node) {\n              preComputedDefs.delete(def.node);\n            }\n          }\n        }\n      },\n\n      CallExpression(node: CallExpression) {\n        if (!isStepCall(node)) return;\n        if (!hasKeyOption(node)) return;\n\n        // Determine which argument is the executor based on API pattern\n        // step('id', executor, options?) - first arg is string literal, executor is second\n        // step.map('id', items, mapper, options?) - executor at index 2\n        // Legacy: step(executor, options) - first arg is the executor\n        const args = node.arguments;\n        let executorArg = args[0];\n        if (!executorArg) return;\n\n        const hasExplicitId = isStringLiteral(args[0]);\n        if (hasExplicitId) {\n          const methodName = getStepMethodName(node);\n          if (methodName === 'withResource') return;\n          executorArg = methodName && EXECUTOR_AT_INDEX_2.has(methodName) ? args[2] : args[1];\n          if (!executorArg) return;\n        }\n\n        // If executor is already a thunk (arrow/function expression), it's fine\n        if (isThunk(executorArg)) return;\n\n        // Use executorArg instead of firstArg for all subsequent checks\n        const firstArg = executorArg;\n\n        // If first argument is a CallExpression, it's an immediate call (bad)\n        if (firstArg.type === 'CallExpression') {\n          context.report({\n            node: firstArg,\n            messageId: 'requireThunkForKey',\n            fix(fixer) {\n              const sourceCode = context.sourceCode;\n              const argText = sourceCode.getText(firstArg);\n              if (hasExplicitId) {\n                return fixer.replaceText(firstArg, `() => ${argText}`);\n              }\n              const suggestedId = getCalleeName(firstArg as CallExpression);\n              const restArgs = args.length > 1 ? `, ${args.slice(1).map((a) => sourceCode.getText(a)).join(', ')}` : '';\n              return fixer.replaceText(node, `step('${suggestedId}', () => ${argText}${restArgs})`);\n            },\n          });\n          return;\n        }\n\n        // If first argument is an Identifier, check if it references a pre-computed value\n        if (firstArg.type === 'Identifier') {\n          const ident = firstArg as Identifier;\n          if (isPrecomputedReference(ident)) {\n            if (!isFunctionPropertyName(ident.name)) {\n              context.report({\n                node: firstArg,\n                messageId: 'requireThunkForKey',\n                fix(fixer) {\n                  const sourceCode = context.sourceCode;\n                  const argText = sourceCode.getText(firstArg);\n                  if (hasExplicitId) return fixer.replaceText(firstArg, `() => ${argText}`);\n                  const restArgs = args.length > 1 ? `, ${args.slice(1).map((a) => sourceCode.getText(a)).join(', ')}` : '';\n                  return fixer.replaceText(node, `step('step', () => ${argText}${restArgs})`);\n                },\n              });\n            }\n          }\n          return;\n        }\n\n        // For MemberExpression, check several cases:\n        // 1. Computed access (result[0], result[key]) is NEVER a function reference - always flag\n        // 2. Root was precomputed from a call WITH arguments (likely returns data)\n        // 3. Dot notation on utility objects (deps.fetchUser) is allowed\n        if (firstArg.type === 'MemberExpression') {\n          const memberExpr = firstArg as MemberExpression;\n\n          // Computed access is never a function reference pattern\n          if (memberExpr.computed) {\n            context.report({\n              node: firstArg,\n              messageId: 'requireThunkForKey',\n              fix(fixer) {\n                const sourceCode = context.sourceCode;\n                const argText = sourceCode.getText(firstArg);\n                if (hasExplicitId) return fixer.replaceText(firstArg, `() => ${argText}`);\n                const restArgs = args.length > 2 ? `, ${args.slice(2).map((a) => sourceCode.getText(a)).join(', ')}` : '';\n                return fixer.replaceText(node, `step('step', () => ${argText}${restArgs})`);\n              },\n            });\n            return;\n          }\n\n          // For dot notation, check if root was precomputed\n          // If precomputed, only allow if property looks like a function (fetchUser, getData, etc.)\n          // The utility object name heuristic only applies to non-precomputed objects\n          const rootIdent = getRootIdentifier(memberExpr);\n          if (rootIdent && isPrecomputedReference(rootIdent)) {\n            // Root is precomputed - it's data, not a utility container\n            // Only allow if property name looks like a function reference\n            const propertyName = memberExpr.property.type === 'Identifier'\n              ? memberExpr.property.name\n              : null;\n            const isFunctionRef = propertyName && isFunctionPropertyName(propertyName);\n\n            // Flag unless property looks like a function\n            if (!isFunctionRef) {\n              context.report({\n                node: firstArg,\n                messageId: 'requireThunkForKey',\n                fix(fixer) {\n                  const sourceCode = context.sourceCode;\n                  const argText = sourceCode.getText(firstArg);\n                  if (hasExplicitId) return fixer.replaceText(firstArg, `() => ${argText}`);\n                  const restArgs = args.length > 1 ? `, ${args.slice(1).map((a) => sourceCode.getText(a)).join(', ')}` : '';\n                  return fixer.replaceText(node, `step('step', () => ${argText}${restArgs})`);\n                },\n              });\n            }\n          }\n          return;\n        }\n\n        // For other expression types, report as potentially problematic\n        context.report({\n          node: firstArg,\n          messageId: 'requireThunkForKey',\n          fix(fixer) {\n            const sourceCode = context.sourceCode;\n            const argText = sourceCode.getText(firstArg);\n            if (hasExplicitId) return fixer.replaceText(firstArg, `() => ${argText}`);\n            const restArgs = args.length > 1 ? `, ${args.slice(1).map((a) => sourceCode.getText(a)).join(', ')}` : '';\n            return fixer.replaceText(node, `step('step', () => ${argText}${restArgs})`);\n          },\n        });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  CallExpression,\n  MemberExpression,\n  ObjectExpression,\n  Property,\n  TemplateLiteral,\n  Expression,\n} from 'estree';\n\n/**\n * Rule: stable-cache-keys\n *\n * Cache keys must be stable and deterministic. Using Date.now(), Math.random(),\n * or crypto.randomUUID() in keys means the cache will never hit.\n *\n * BAD:  { key: `user:${Date.now()}` }      - new key every time\n * BAD:  { key: `user:${Math.random()}` }   - new key every time\n * GOOD: { key: `user:${userId}` }          - stable key\n */\n\nconst STEP_METHODS = new Set([\n  'step', 'try', 'retry', 'withTimeout', 'fromResult',\n  'all', 'map', 'race', 'sleep',\n  'withFallback', 'withResource', 'workflow',\n]);\n\nconst UNSTABLE_CALLS = new Set([\n  'Date.now',\n  'Math.random',\n  'crypto.randomUUID',\n  'randomUUID',\n  'uuid',\n  'uuidv4',\n  'nanoid',\n]);\n\nfunction isStepCall(node: CallExpression): boolean {\n  const { callee } = node;\n\n  if (callee.type === 'Identifier' && callee.name === 'step') {\n    return true;\n  }\n\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee as MemberExpression;\n    if (\n      object.type === 'Identifier' &&\n      object.name === 'step' &&\n      property.type === 'Identifier' &&\n      STEP_METHODS.has(property.name)\n    ) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction getCallName(node: CallExpression): string | null {\n  const { callee } = node;\n\n  if (callee.type === 'Identifier') {\n    return callee.name;\n  }\n\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee as MemberExpression;\n    if (object.type === 'Identifier' && property.type === 'Identifier') {\n      return `${object.name}.${property.name}`;\n    }\n  }\n\n  return null;\n}\n\nfunction containsUnstableCall(node: Expression): { found: boolean; name: string | null } {\n  if (node.type === 'CallExpression') {\n    const name = getCallName(node);\n    if (name && UNSTABLE_CALLS.has(name)) {\n      return { found: true, name };\n    }\n    // Check arguments recursively\n    for (const arg of node.arguments) {\n      if (arg.type !== 'SpreadElement') {\n        const result = containsUnstableCall(arg);\n        if (result.found) return result;\n      }\n    }\n  }\n\n  if (node.type === 'TemplateLiteral') {\n    const template = node as TemplateLiteral;\n    for (const expr of template.expressions) {\n      const result = containsUnstableCall(expr);\n      if (result.found) return result;\n    }\n  }\n\n  if (node.type === 'BinaryExpression') {\n    const left = containsUnstableCall(node.left as Expression);\n    if (left.found) return left;\n    const right = containsUnstableCall(node.right as Expression);\n    if (right.found) return right;\n  }\n\n  return { found: false, name: null };\n}\n\nfunction getKeyValue(node: CallExpression): Expression | null {\n  for (const arg of node.arguments) {\n    if (arg.type === 'ObjectExpression') {\n      const obj = arg as ObjectExpression;\n      for (const prop of obj.properties) {\n        if (prop.type === 'Property') {\n          const property = prop as Property;\n          if (property.key.type === 'Identifier' && property.key.name === 'key') {\n            return property.value as Expression;\n          }\n        }\n      }\n    }\n  }\n  return null;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow non-deterministic values in cache keys. Using Date.now(), Math.random(), etc. means the cache will never hit.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      unstableKey:\n        \"Cache key contains '{{name}}' which produces a different value on each call. Use stable identifiers like user IDs or idempotency keys instead.\",\n    },\n  },\n\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (!isStepCall(node)) return;\n\n        const keyValue = getKeyValue(node);\n        if (!keyValue) return;\n\n        const result = containsUnstableCall(keyValue);\n        if (result.found && result.name) {\n          context.report({\n            node: keyValue,\n            messageId: 'unstableKey',\n            data: { name: result.name },\n          });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, Node } from 'estree';\n\n/**\n * Rule: no-floating-workflow\n *\n * Detects `run()` or workflow calls that are not awaited, returned, or assigned.\n * Floating workflows execute asynchronously without any way to handle their results.\n *\n * BAD:  run(async ({ step }) => { ... });        - fire-and-forget\n * BAD:  myWorkflow(async ({ step }) => { ... }); - fire-and-forget\n * GOOD: await run(async ({ step }) => { ... });\n * GOOD: const result = await run(async ({ step }) => { ... });\n * GOOD: return run(async ({ step }) => { ... });\n */\n\nconst WORKFLOW_FUNCTIONS = new Set(['run']);\n\nfunction isWorkflowCall(node: CallExpression): boolean {\n  const { callee } = node;\n\n  // Direct run() call\n  if (callee.type === 'Identifier' && WORKFLOW_FUNCTIONS.has(callee.name)) {\n    return true;\n  }\n\n  return false;\n}\n\nfunction hasWorkflowCallbackSignature(node: CallExpression): boolean {\n  const firstArg = node.arguments[0];\n  if (!firstArg) return false;\n\n  // Check if first argument is an arrow function or function expression\n  return firstArg.type === 'ArrowFunctionExpression' || firstArg.type === 'FunctionExpression';\n}\n\nfunction isProperlyHandled(node: CallExpression, parent: Node | null): boolean {\n  if (!parent) return false;\n\n  // Awaited: await run(...)\n  if (parent.type === 'AwaitExpression') {\n    return true;\n  }\n\n  // Assigned: const result = run(...)\n  if (parent.type === 'VariableDeclarator') {\n    return true;\n  }\n\n  // Returned: return run(...)\n  if (parent.type === 'ReturnStatement') {\n    return true;\n  }\n\n  // Part of assignment: result = run(...)\n  if (parent.type === 'AssignmentExpression') {\n    return true;\n  }\n\n  // Chained: run(...).then(...)\n  if (parent.type === 'MemberExpression') {\n    return true;\n  }\n\n  // Arrow function implicit return: () => run(...)\n  if (parent.type === 'ArrowFunctionExpression' && parent.body === node) {\n    return true;\n  }\n\n  // Used in logical expressions: condition && run(...)\n  if (parent.type === 'LogicalExpression') {\n    return true;\n  }\n\n  // Used in conditional: condition ? run(...) : other\n  if (parent.type === 'ConditionalExpression') {\n    return true;\n  }\n\n  // Used as argument to another function: Promise.all([run(...)])\n  if (parent.type === 'CallExpression' || parent.type === 'ArrayExpression') {\n    return true;\n  }\n\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow floating workflow calls (run() or workflow functions not awaited/assigned)',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      floatingWorkflow:\n        'Floating workflow call. The result of {{functionName}}() is not awaited, returned, or assigned. This creates a fire-and-forget async operation that cannot be tracked.',\n    },\n  },\n\n  create(context) {\n    const ancestors: Node[] = [];\n\n    return {\n      ':function'(node: Node) {\n        ancestors.push(node);\n      },\n      ':function:exit'() {\n        ancestors.pop();\n      },\n      CallExpression(node: CallExpression) {\n        if (!isWorkflowCall(node)) return;\n        if (!hasWorkflowCallbackSignature(node)) return;\n\n        const parent = (node as unknown as { parent?: Node }).parent || null;\n\n        // Check if it's in an expression statement (floating)\n        if (parent?.type === 'ExpressionStatement') {\n          const callee = node.callee;\n          const functionName = callee.type === 'Identifier' ? callee.name : 'workflow';\n\n          context.report({\n            node,\n            messageId: 'floatingWorkflow',\n            data: { functionName },\n          });\n          return;\n        }\n\n        // Check if properly handled\n        if (!isProperlyHandled(node, parent)) {\n          const callee = node.callee;\n          const functionName = callee.type === 'Identifier' ? callee.name : 'workflow';\n\n          context.report({\n            node,\n            messageId: 'floatingWorkflow',\n            data: { functionName },\n          });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression, Node } from 'estree';\n\n/**\n * Rule: no-floating-result\n *\n * Detects step() calls whose Result is discarded without handling.\n * Results should be assigned or their status checked.\n *\n * BAD:  step(() => fetchUser());             - Result ignored\n * BAD:  await step(() => fetchUser());       - Awaited but ignored\n * GOOD: const result = await step(() => fetchUser());\n * GOOD: return step(() => fetchUser());\n */\n\nconst STEP_METHODS = new Set(['step', 'try', 'retry', 'withTimeout', 'fromResult', 'race', 'all', 'map', 'withFallback', 'withResource', 'workflow']);\n\nfunction isStepCall(node: CallExpression): boolean {\n  const { callee } = node;\n\n  // Direct step() call\n  if (callee.type === 'Identifier' && callee.name === 'step') {\n    return true;\n  }\n\n  // step.try(), step.retry(), step.withTimeout(), step.fromResult(), step.all(), step.race()\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee as MemberExpression;\n    if (\n      object.type === 'Identifier' &&\n      object.name === 'step' &&\n      property.type === 'Identifier' &&\n      STEP_METHODS.has(property.name)\n    ) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction isProperlyHandled(node: CallExpression, parent: Node | null): boolean {\n  if (!parent) return false;\n\n  // Assigned: const result = step(...)\n  if (parent.type === 'VariableDeclarator') {\n    return true;\n  }\n\n  // Returned: return step(...)\n  if (parent.type === 'ReturnStatement') {\n    return true;\n  }\n\n  // Part of assignment: result = step(...)\n  if (parent.type === 'AssignmentExpression') {\n    return true;\n  }\n\n  // Chained: step(...).andThen(...) or step(...).value (though .value is unsafe)\n  if (parent.type === 'MemberExpression') {\n    return true;\n  }\n\n  // Arrow function implicit return: () => step(...)\n  if (parent.type === 'ArrowFunctionExpression' && parent.body === node) {\n    return true;\n  }\n\n  // Used in logical expressions: condition && step(...)\n  if (parent.type === 'LogicalExpression') {\n    return true;\n  }\n\n  // Used in conditional: condition ? step(...) : other\n  if (parent.type === 'ConditionalExpression') {\n    return true;\n  }\n\n  // Used as argument to another function: allAsync([step(...)])\n  if (parent.type === 'CallExpression' || parent.type === 'ArrayExpression') {\n    return true;\n  }\n\n  // Awaited - need to check the parent of await\n  if (parent.type === 'AwaitExpression') {\n    const awaitParent = (parent as unknown as { parent?: Node }).parent || null;\n    return isProperlyHandled(parent as unknown as CallExpression, awaitParent);\n  }\n\n  return false;\n}\n\nfunction getStepMethodName(node: CallExpression): string {\n  const { callee } = node;\n\n  if (callee.type === 'Identifier') {\n    return callee.name;\n  }\n\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee;\n    if (object.type === 'Identifier' && property.type === 'Identifier') {\n      return `${object.name}.${property.name}`;\n    }\n  }\n\n  return 'step';\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow discarding Result values from step() calls. Results must be assigned or returned.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      floatingResult:\n        \"Floating Result from {{methodName}}(). The Result is discarded without checking its status. Assign it to a variable or return it.\",\n    },\n  },\n\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (!isStepCall(node)) return;\n\n        const parent = (node as unknown as { parent?: Node }).parent || null;\n\n        // Check if it's in an expression statement (floating)\n        if (parent?.type === 'ExpressionStatement') {\n          const methodName = getStepMethodName(node);\n          context.report({\n            node,\n            messageId: 'floatingResult',\n            data: { methodName },\n          });\n          return;\n        }\n\n        // Check if properly handled\n        if (!isProperlyHandled(node, parent)) {\n          const methodName = getStepMethodName(node);\n          context.report({\n            node,\n            messageId: 'floatingResult',\n            data: { methodName },\n          });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  CallExpression,\n  MemberExpression,\n  Node,\n  VariableDeclarator,\n} from 'estree';\n\n/**\n * Rule: require-result-handling\n *\n * Warns when accessing `.value` on a Result without checking `.ok` first.\n * This prevents runtime errors when the Result is an Err.\n *\n * BAD:\n *   const result = await run(...);\n *   console.log(result.value);  // Could be Err!\n *\n * GOOD:\n *   const result = await run(...);\n *   if (result.ok) {\n *     console.log(result.value);  // TypeScript knows this is safe\n *   }\n *\n * GOOD:\n *   const result = await run(...);\n *   if (!result.ok) {\n *     return result;  // Early return on error\n *   }\n *   console.log(result.value);  // Safe after guard\n */\n\n// Functions that return Result types\nconst RESULT_FUNCTIONS = new Set(['run', 'step', 'ok', 'err', 'fromPromise', 'fromThrowable']);\n\n// Step methods that return Result types\nconst STEP_METHODS = new Set(['step', 'try', 'retry', 'withTimeout', 'fromResult', 'race', 'all']);\n\ninterface ResultVariable {\n  name: string;\n  node: VariableDeclarator;\n  checkedScopes: Set<Node>; // Scopes where .ok has been checked\n}\n\ninterface SafetyInfo {\n  valueAllowed: boolean;\n  errorAllowed: boolean;\n}\n\ninterface BranchInfo {\n  varName: string;\n  isNegated: boolean; // true for !result.ok\n}\n\n/**\n * Checks if a statement block has an early exit (return, throw).\n * This is used to detect the early return pattern.\n */\nfunction hasEarlyExit(node: Node): boolean {\n  if (node.type === 'BlockStatement') {\n    const body = (node as { body: Node[] }).body;\n    return body.some((stmt) => {\n      if (stmt.type === 'ReturnStatement' || stmt.type === 'ThrowStatement') {\n        return true;\n      }\n      // Check nested if statements for early returns\n      // An if is only an unconditional exit if BOTH branches have early exits\n      if (stmt.type === 'IfStatement') {\n        const ifStmt = stmt as { consequent: Node; alternate?: Node };\n        if (\n          ifStmt.alternate &&\n          hasEarlyExit(ifStmt.consequent) &&\n          hasEarlyExit(ifStmt.alternate)\n        ) {\n          return true;\n        }\n      }\n      return false;\n    });\n  }\n  // Single statement (not a block)\n  return node.type === 'ReturnStatement' || node.type === 'ThrowStatement';\n}\n\nfunction isResultProducingCall(node: CallExpression): boolean {\n  const { callee } = node;\n\n  // Direct run() or step() call\n  if (callee.type === 'Identifier' && RESULT_FUNCTIONS.has(callee.name)) {\n    return true;\n  }\n\n  // step.method() calls\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee as MemberExpression;\n    if (\n      object.type === 'Identifier' &&\n      object.name === 'step' &&\n      property.type === 'Identifier' &&\n      STEP_METHODS.has(property.name)\n    ) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description:\n        'Require checking Result.ok before accessing Result.value to prevent runtime errors',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      unsafeValueAccess:\n        \"Unsafe access to '{{property}}' on Result '{{name}}'. Check '.ok' first: if ({{name}}.ok) { ... {{name}}.{{property}} ... }\",\n    },\n  },\n\n  create(context) {\n    const resultVariables = new Map<string, ResultVariable>();\n    // Track what's allowed per variable: { valueAllowed, errorAllowed }\n    const variableSafety = new Map<string, SafetyInfo>();\n    const safetyStack: Map<string, SafetyInfo>[] = [];\n    // Map from block node to branch info for applying branch-specific rules\n    const branchBlocks = new Map<Node, BranchInfo>();\n\n    function enterScope() {\n      safetyStack.push(new Map(variableSafety));\n    }\n\n    function exitScope() {\n      const previousScope = safetyStack.pop();\n      if (previousScope) {\n        variableSafety.clear();\n        previousScope.forEach((v, k) => variableSafety.set(k, v));\n      }\n    }\n\n    function markSafety(varName: string, info: SafetyInfo) {\n      variableSafety.set(varName, info);\n    }\n\n    function isSafe(varName: string, property: 'value' | 'error'): boolean {\n      const info = variableSafety.get(varName);\n      if (!info) return false;\n      return property === 'value' ? info.valueAllowed : info.errorAllowed;\n    }\n\n    return {\n      // Track scope for proper variable checking\n      BlockStatement(node: Node) {\n        enterScope();\n\n        // Clear safety when entering a function body - the function can execute later\n        // when the .ok check is no longer guaranteed\n        const parent = (node as unknown as { parent?: Node }).parent;\n        if (\n          parent?.type === 'FunctionDeclaration' ||\n          parent?.type === 'FunctionExpression' ||\n          parent?.type === 'ArrowFunctionExpression'\n        ) {\n          variableSafety.clear();\n        }\n\n        // Apply branch-specific safety rules if this block is part of an if statement\n        const branchInfo = branchBlocks.get(node);\n        if (branchInfo) {\n          // Determine what's allowed based on which branch we're in\n          // For consequent: if (result.ok) -> value safe; if (!result.ok) -> error safe\n          // For alternate: if (result.ok) -> error safe; if (!result.ok) -> value safe\n          // branchInfo.isNegated tells us if the test was !result.ok\n          // We need to check if this is consequent or alternate\n          const parent = (node as unknown as { parent?: Node }).parent;\n          if (parent?.type === 'IfStatement') {\n            const ifStmt = parent as { consequent: Node; alternate?: Node };\n            const isConsequent = ifStmt.consequent === node;\n            const isAlternate = ifStmt.alternate === node;\n\n            if (isConsequent) {\n              // In consequent of if (result.ok) -> value allowed\n              // In consequent of if (!result.ok) -> error allowed\n              markSafety(branchInfo.varName, {\n                valueAllowed: !branchInfo.isNegated,\n                errorAllowed: branchInfo.isNegated,\n              });\n            } else if (isAlternate) {\n              // In alternate of if (result.ok) -> error allowed\n              // In alternate of if (!result.ok) -> value allowed\n              markSafety(branchInfo.varName, {\n                valueAllowed: branchInfo.isNegated,\n                errorAllowed: !branchInfo.isNegated,\n              });\n            }\n          }\n        }\n      },\n      'BlockStatement:exit'() {\n        exitScope();\n      },\n\n      // Track Result-producing variable declarations\n      VariableDeclarator(node: VariableDeclarator) {\n        const { id, init } = node;\n        if (!init || id.type !== 'Identifier') return;\n\n        // Unwrap await expressions\n        let valueNode = init;\n        if (valueNode.type === 'AwaitExpression' && valueNode.argument) {\n          valueNode = valueNode.argument;\n        }\n\n        // Check if this is a Result-producing call\n        if (valueNode.type === 'CallExpression' && isResultProducingCall(valueNode)) {\n          resultVariables.set(id.name, {\n            name: id.name,\n            node,\n            checkedScopes: new Set(),\n          });\n        }\n      },\n\n      // Track .ok checks in if statements\n      IfStatement(node) {\n        const { test, consequent, alternate } = node;\n\n        // if (result.ok) or if (!result.ok)\n        let memberExpr: MemberExpression | null = null;\n        let isNegated = false;\n\n        if (test.type === 'MemberExpression') {\n          memberExpr = test;\n        } else if (\n          test.type === 'UnaryExpression' &&\n          test.operator === '!' &&\n          test.argument.type === 'MemberExpression'\n        ) {\n          memberExpr = test.argument;\n          isNegated = true;\n        }\n\n        if (memberExpr) {\n          const { object, property } = memberExpr;\n          if (\n            object.type === 'Identifier' &&\n            property.type === 'Identifier' &&\n            property.name === 'ok' &&\n            resultVariables.has(object.name)\n          ) {\n            const varName = object.name;\n\n            // Only mark as safe for code AFTER the if statement if there's an early exit\n            // Early exit in consequent:\n            //   if (!result.ok) { return; } -> .value is safe after\n            //   if (result.ok) { return; } -> .error is safe after\n            // Early exit in alternate:\n            //   if (result.ok) { ... } else { return; } -> .value is safe after\n            //   if (!result.ok) { ... } else { return; } -> .error is safe after\n            if (hasEarlyExit(consequent)) {\n              if (isNegated) {\n                // if (!result.ok) { return; } - value is safe after\n                markSafety(varName, { valueAllowed: true, errorAllowed: false });\n              } else {\n                // if (result.ok) { return; } - error is safe after\n                markSafety(varName, { valueAllowed: false, errorAllowed: true });\n              }\n            } else if (alternate && hasEarlyExit(alternate)) {\n              if (isNegated) {\n                // if (!result.ok) { ... } else { return; } - error is safe after\n                markSafety(varName, { valueAllowed: false, errorAllowed: true });\n              } else {\n                // if (result.ok) { ... } else { return; } - value is safe after\n                markSafety(varName, { valueAllowed: true, errorAllowed: false });\n              }\n            }\n\n            // Register branches for branch-specific rules (both block and single-statement)\n            const branchInfo: BranchInfo = { varName, isNegated };\n            branchBlocks.set(consequent, branchInfo);\n            if (alternate) {\n              branchBlocks.set(alternate, branchInfo);\n            }\n          }\n        }\n      },\n\n      // Check for unsafe .value or .error access\n      MemberExpression(node: MemberExpression) {\n        const { object, property } = node;\n\n        // Check for result.value or result.error access\n        if (\n          object.type === 'Identifier' &&\n          property.type === 'Identifier' &&\n          (property.name === 'value' || property.name === 'error')\n        ) {\n          const varName = object.name;\n\n          // Only check if this is a tracked Result variable\n          if (!resultVariables.has(varName)) return;\n\n          // Check if we're inside a function that's inside a result.ok branch\n          // If so, don't trust scope-based safety because the function can be called later\n          let insideFunctionInBranch = false;\n          let checkNode: Node | undefined = (node as unknown as { parent?: Node }).parent;\n          let foundFunction = false;\n          while (checkNode) {\n            if (\n              checkNode.type === 'FunctionDeclaration' ||\n              checkNode.type === 'FunctionExpression' ||\n              checkNode.type === 'ArrowFunctionExpression'\n            ) {\n              foundFunction = true;\n            }\n            // If we found a function and then find a branch block, the function is inside the branch\n            if (foundFunction && branchBlocks.has(checkNode)) {\n              insideFunctionInBranch = true;\n              break;\n            }\n            checkNode = (checkNode as unknown as { parent?: Node }).parent;\n          }\n\n          // Skip if this access is safe in current scope (but not if inside a function in a branch)\n          if (!insideFunctionInBranch && isSafe(varName, property.name as 'value' | 'error')) return;\n\n          // Check if we're inside a single-statement branch of an if that checks this variable\n          // Walk up the AST to find if we're in a registered branch\n          // Stop at function boundaries since the function can be called later\n          let current: Node | undefined = node as unknown as Node;\n          while (current) {\n            // Stop at function boundaries - the function can execute later when .ok is no longer guaranteed\n            if (\n              current.type === 'FunctionDeclaration' ||\n              current.type === 'FunctionExpression' ||\n              current.type === 'ArrowFunctionExpression'\n            ) {\n              break;\n            }\n            const branchInfo = branchBlocks.get(current);\n            if (branchInfo && branchInfo.varName === varName) {\n              // We're inside a branch - determine if this access is safe\n              const parent = (current as unknown as { parent?: Node }).parent;\n              if (parent?.type === 'IfStatement') {\n                const ifStmt = parent as { consequent: Node; alternate?: Node };\n                const isConsequent = ifStmt.consequent === current;\n                const isAlternate = ifStmt.alternate === current;\n\n                if (isConsequent) {\n                  // In consequent: value safe if not negated, error safe if negated\n                  if (property.name === 'value' && !branchInfo.isNegated) return;\n                  if (property.name === 'error' && branchInfo.isNegated) return;\n                } else if (isAlternate) {\n                  // In alternate: value safe if negated, error safe if not negated\n                  if (property.name === 'value' && branchInfo.isNegated) return;\n                  if (property.name === 'error' && !branchInfo.isNegated) return;\n                }\n              }\n              break; // Found the branch, stop walking\n            }\n            current = (current as unknown as { parent?: Node }).parent;\n          }\n\n          // Check if this access is within a conditional that checks .ok\n          const parent = (node as unknown as { parent?: Node }).parent;\n\n          // Allow: result.ok && result.value\n          if (\n            parent?.type === 'LogicalExpression' &&\n            parent.operator === '&&'\n          ) {\n            const { left } = parent;\n            if (\n              left.type === 'MemberExpression' &&\n              left.object.type === 'Identifier' &&\n              left.object.name === varName &&\n              left.property.type === 'Identifier' &&\n              left.property.name === 'ok'\n            ) {\n              return; // Safe: checked with &&\n            }\n          }\n\n          // Allow: result.ok ? result.value : ... (value in consequent)\n          // Allow: result.ok ? ... : result.error (error in alternate)\n          if (parent?.type === 'ConditionalExpression') {\n            const { test } = parent;\n            // Check if test is result.ok\n            if (\n              test.type === 'MemberExpression' &&\n              test.object.type === 'Identifier' &&\n              test.object.name === varName &&\n              test.property.type === 'Identifier' &&\n              test.property.name === 'ok'\n            ) {\n              // .value is safe in consequent (result.ok is true)\n              if (parent.consequent === node && property.name === 'value') {\n                return; // Safe: checked in ternary consequent\n              }\n              // .error is safe in alternate (result.ok is false)\n              if (parent.alternate === node && property.name === 'error') {\n                return; // Safe: checked in ternary alternate\n              }\n            }\n            // Check if test is !result.ok\n            if (\n              test.type === 'UnaryExpression' &&\n              test.operator === '!' &&\n              test.argument.type === 'MemberExpression' &&\n              test.argument.object.type === 'Identifier' &&\n              (test.argument.object as { name: string }).name === varName &&\n              test.argument.property.type === 'Identifier' &&\n              (test.argument.property as { name: string }).name === 'ok'\n            ) {\n              // .error is safe in consequent (!result.ok means error case)\n              if (parent.consequent === node && property.name === 'error') {\n                return; // Safe: checked in ternary consequent\n              }\n              // .value is safe in alternate (!result.ok is false means ok is true)\n              if (parent.alternate === node && property.name === 'value') {\n                return; // Safe: checked in ternary alternate\n              }\n            }\n          }\n\n          context.report({\n            node,\n            messageId: 'unsafeValueAccess',\n            data: {\n              name: varName,\n              property: property.name,\n            },\n          });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, Identifier, Literal, ObjectExpression, Property } from 'estree';\n\n/**\n * Rule: no-options-on-executor\n *\n * Detects when workflow options (cache, onEvent, deps, snapshot, etc.) are passed\n * in the wrong place. Execution is via workflow.run(fn) or workflow.run(fn, config).\n *\n * Per-run options (including call-time dependency overrides via `deps`) should be\n * passed after the callback:\n * - workflow.run(fn, config)\n * - workflow.run(name, fn, config)\n *\n * BAD:  workflow({ cache: new Map() }, async ({ step }) => { ... }) // legacy callable form\n * BAD:  workflow.run({ cache: new Map() }, async ({ step }) => { ... }) // wrong order\n * BAD:  workflow.run('run-name', { cache: new Map() }, async ({ step }) => { ... }) // wrong order\n * GOOD: await workflow.run(async ({ step }) => { ... });\n * GOOD: await workflow.run(async ({ step }) => { ... }, { deps: overrideDeps, onEvent });\n */\n\nconst KNOWN_OPTION_KEYS = new Set([\n  'cache',\n  'deps',\n  'onEvent',\n  'resumeState',\n  'snapshot',\n  'serialization',\n  'snapshotSerialization',\n  'onUnknownSteps',\n  'onDefinitionChange',\n  'onError',\n  'onBeforeStart',\n  'onBeforeStep',\n  'onAfterStep',\n  'shouldRun',\n  'createContext',\n  'signal',\n  'strict',\n  'catchUnexpected',\n  'description',\n  'markdown',\n  'streamStore',\n]);\n\n// Names that suggest an awaitly workflow executor (callable form, legacy)\nconst WORKFLOW_CALLEE_PATTERNS = [\n  /workflow/i,\n  /^run$/i,\n];\n\n// .run() and .runWithState() are the canonical execution methods\nconst RUN_METHOD_NAMES = new Set(['run', 'runWithState']);\n\nfunction isLikelyWorkflowCall(node: CallExpression): boolean {\n  const { callee } = node;\n\n  // Direct call: workflow(...) or myWorkflow(...) (legacy callable)\n  if (callee.type === 'Identifier') {\n    return WORKFLOW_CALLEE_PATTERNS.some(pattern => pattern.test(callee.name));\n  }\n\n  // Member expression: this.workflow(...) or obj.workflow(...)\n  if (callee.type === 'MemberExpression' && callee.property.type === 'Identifier') {\n    const propertyName = (callee.property as Identifier).name;\n    return WORKFLOW_CALLEE_PATTERNS.some(pattern => pattern.test(propertyName));\n  }\n\n  return false;\n}\n\nfunction isWorkflowRunCall(node: CallExpression): boolean {\n  if (node.callee.type !== 'MemberExpression' || node.callee.property.type !== 'Identifier') {\n    return false;\n  }\n  return RUN_METHOD_NAMES.has(node.callee.property.name);\n}\n\nfunction isStringLiteral(node: unknown): node is Literal {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string; value?: unknown };\n  return typed.type === 'Literal' && typeof typed.value === 'string';\n}\n\nfunction isThunkOrCallback(node: unknown): boolean {\n  if (!node || typeof node !== 'object') return false;\n  const typed = node as { type?: string };\n  // Accept inline functions or function identifiers (e.g., `workflow({ cache }, handler)`)\n  return (\n    typed.type === 'ArrowFunctionExpression' ||\n    typed.type === 'FunctionExpression' ||\n    typed.type === 'Identifier'\n  );\n}\n\ninterface ObjectKeyAnalysis {\n  optionKeys: string[];\n  nonOptionKeys: string[];\n}\n\nfunction analyzeObjectKeys(node: ObjectExpression): ObjectKeyAnalysis {\n  const optionKeys: string[] = [];\n  const nonOptionKeys: string[] = [];\n\n  for (const prop of node.properties) {\n    if (prop.type === 'Property') {\n      const property = prop as Property;\n      if (property.key.type === 'Identifier') {\n        const keyName = property.key.name;\n        if (KNOWN_OPTION_KEYS.has(keyName)) {\n          optionKeys.push(keyName);\n        } else {\n          nonOptionKeys.push(keyName);\n        }\n      }\n    } else if (prop.type === 'SpreadElement') {\n      // Spread elements mean we can't determine all keys statically\n      // Treat as having non-option keys to avoid false positives\n      nonOptionKeys.push('...');\n    }\n  }\n\n  return { optionKeys, nonOptionKeys };\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow passing workflow options in the wrong argument position. For workflow.run(), pass callback first (or run name then callback), then config.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      optionsOnExecutor:\n        'Workflow options ({{ keys }}) are in the wrong place. Use workflow.run(callback, config) or workflow.run(name, callback, config).',\n      optionsWrongOrderRun:\n        'Workflow options ({{ keys }}) are in the wrong argument position for .run(). The callback must come first (or after run name), then config.',\n    },\n  },\n\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        const args = node.arguments;\n        if (args.length < 2) return;\n\n        if (isWorkflowRunCall(node)) {\n          const firstArg = args[0];\n          const secondArg = args[1];\n\n          // Pattern: workflow.run({ options }, callback)\n          if (firstArg.type === 'ObjectExpression' && isThunkOrCallback(secondArg)) {\n            const { optionKeys, nonOptionKeys } = analyzeObjectKeys(firstArg as ObjectExpression);\n            if (optionKeys.length > 0 && nonOptionKeys.length === 0) {\n              context.report({\n                node: firstArg,\n                messageId: 'optionsWrongOrderRun',\n                data: { keys: optionKeys.join(', ') },\n              });\n            }\n            return;\n          }\n\n          // Pattern: workflow.run('run-name', { options }, callback)\n          if (args.length >= 3) {\n            const thirdArg = args[2];\n            if (\n              isStringLiteral(firstArg) &&\n              secondArg.type === 'ObjectExpression' &&\n              isThunkOrCallback(thirdArg)\n            ) {\n              const { optionKeys, nonOptionKeys } = analyzeObjectKeys(secondArg as ObjectExpression);\n              if (optionKeys.length > 0 && nonOptionKeys.length === 0) {\n                context.report({\n                  node: secondArg,\n                  messageId: 'optionsWrongOrderRun',\n                  data: { keys: optionKeys.join(', ') },\n                });\n              }\n            }\n          }\n          return;\n        }\n\n        // Pattern: workflow({ options }, callback) — legacy callable form, options ignored\n        if (isLikelyWorkflowCall(node)) {\n          const firstArg = args[0];\n          const secondArg = args[1];\n          if (firstArg.type !== 'ObjectExpression') return;\n          if (!isThunkOrCallback(secondArg)) return;\n\n          const { optionKeys, nonOptionKeys } = analyzeObjectKeys(firstArg as ObjectExpression);\n          if (optionKeys.length === 0 || nonOptionKeys.length > 0) return;\n\n          context.report({\n            node: firstArg,\n            messageId: 'optionsOnExecutor',\n            data: { keys: optionKeys.join(', ') },\n          });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  Node,\n  CallExpression,\n  ArrowFunctionExpression,\n  FunctionExpression,\n  ReturnStatement,\n} from 'estree';\n\n/**\n * Rule: no-double-wrap-result\n *\n * Detects returning ok() or err() from workflow executor functions.\n * Workflow executors should return raw values - awaitly wraps them automatically.\n *\n * BAD:  run(async ({ step }) => { return ok({ user }); })      - Double-wrapped\n * BAD:  createWorkflow('workflow', deps)(async ({ step }) => ok(value))    - Double-wrapped\n * GOOD: run(async ({ step }) => { return { user }; })          - Raw value\n * GOOD: createWorkflow('workflow', deps)(async ({ step }) => value)        - Raw value\n */\n\nconst WORKFLOW_CALLERS = new Set(['run', 'createWorkflow']);\nconst RESULT_CONSTRUCTORS = new Set(['ok', 'err']);\n\ntype FunctionNode = ArrowFunctionExpression | FunctionExpression;\n\n/**\n * Trace back through a chain of method calls to find if it originates from createWorkflow().\n * Handles patterns like: createWorkflow('workflow', deps).with(...).run(...)\n */\nfunction tracesToCreateWorkflow(node: Node): boolean {\n  // Direct createWorkflow() call\n  if (\n    node.type === 'CallExpression' &&\n    node.callee.type === 'Identifier' &&\n    node.callee.name === 'createWorkflow'\n  ) {\n    return true;\n  }\n\n  // Method call on something - trace back through the chain\n  // e.g., createWorkflow('workflow', deps).with(...) -> check createWorkflow(...)\n  if (node.type === 'CallExpression' && node.callee.type === 'MemberExpression') {\n    const { object } = node.callee;\n    return tracesToCreateWorkflow(object);\n  }\n\n  return false;\n}\n\nfunction isWorkflowCall(node: CallExpression): boolean {\n  const { callee } = node;\n\n  // Direct: run(async ({ step }) => ...)\n  if (callee.type === 'Identifier' && WORKFLOW_CALLERS.has(callee.name)) {\n    return true;\n  }\n\n  // Chained: createWorkflow('workflow', deps)(async ({ step }) => ...)\n  // The outer call's callee is another CallExpression\n  if (callee.type === 'CallExpression') {\n    const innerCallee = callee.callee;\n    if (innerCallee.type === 'Identifier' && innerCallee.name === 'createWorkflow') {\n      return true;\n    }\n    // Handle createWorkflow('workflow', deps).with(...)(async ({ step }) => ...)\n    // where the inner call is on a member of createWorkflow result\n    if (innerCallee.type === 'MemberExpression') {\n      const { object, property } = innerCallee;\n      if (\n        property.type === 'Identifier' &&\n        (property.name === 'run' || property.name === 'with')\n      ) {\n        // Check if the object traces back to createWorkflow\n        if (\n          object.type === 'CallExpression' &&\n          object.callee.type === 'Identifier' &&\n          object.callee.name === 'createWorkflow'\n        ) {\n          return true;\n        }\n      }\n    }\n  }\n\n  // Member: run.strict(async ({ step }) => ...) or createWorkflow(deps).run(async ({ step }) => ...)\n  if (callee.type === 'MemberExpression') {\n    const { object, property } = callee;\n\n    // run.strict(...) - object is 'run' identifier\n    if (\n      object.type === 'Identifier' &&\n      property.type === 'Identifier' &&\n      WORKFLOW_CALLERS.has(object.name)\n    ) {\n      return true;\n    }\n\n    // createWorkflow('workflow', deps).run(...) or .with(...).run(...)\n    // Trace back through the chain to find createWorkflow\n    if (\n      property.type === 'Identifier' &&\n      (property.name === 'run' || property.name === 'with') &&\n      tracesToCreateWorkflow(object)\n    ) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction getExecutorCallback(node: CallExpression): FunctionNode | null {\n  // Find the executor callback in the arguments\n  // Could be first arg (run(fn)) or second arg (workflow(args, fn))\n  for (const arg of node.arguments) {\n    if (arg.type === 'ArrowFunctionExpression' || arg.type === 'FunctionExpression') {\n      return arg;\n    }\n  }\n  return null;\n}\n\nfunction isResultConstructorCall(node: Node | null | undefined): string | null {\n  if (!node) return null;\n  if (\n    node.type === 'CallExpression' &&\n    node.callee.type === 'Identifier' &&\n    RESULT_CONSTRUCTORS.has(node.callee.name)\n  ) {\n    return node.callee.name;\n  }\n  return null;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow returning ok() or err() from workflow executor functions. Return raw values instead.',\n      recommended: true,\n    },\n    fixable: 'code',\n    schema: [],\n    messages: {\n      doubleWrap:\n        'Do not return {{fn}}() from workflow executor. Return the raw value instead. ' +\n        'awaitly automatically wraps the return value, so this causes double-wrapping where result.value will be a Result object.',\n    },\n  },\n\n  create(context) {\n    // Stack of executor functions we're inside\n    const executorStack: FunctionNode[] = [];\n\n    return {\n      CallExpression(node: CallExpression) {\n        if (isWorkflowCall(node)) {\n          const executor = getExecutorCallback(node);\n          if (executor) {\n            executorStack.push(executor);\n          }\n        }\n      },\n\n      'CallExpression:exit'(node: CallExpression) {\n        if (isWorkflowCall(node)) {\n          const executor = getExecutorCallback(node);\n          if (executor && executorStack.length > 0 && executorStack[executorStack.length - 1] === executor) {\n            executorStack.pop();\n          }\n        }\n      },\n\n      ReturnStatement(node: ReturnStatement) {\n        if (executorStack.length === 0) return;\n\n        // Check if this return is directly inside an executor (not nested function)\n        const currentExecutor = executorStack[executorStack.length - 1];\n\n        // Walk up to find containing function\n        let parent: Node | null = (node as Node & { parent?: Node }).parent ?? null;\n        let containingFunction: FunctionNode | null = null;\n\n        while (parent) {\n          if (parent.type === 'ArrowFunctionExpression' || parent.type === 'FunctionExpression') {\n            containingFunction = parent;\n            break;\n          }\n          if (parent.type === 'FunctionDeclaration') {\n            // Inside a nested function declaration, not the executor\n            return;\n          }\n          parent = (parent as Node & { parent?: Node }).parent ?? null;\n        }\n\n        // Only check returns that are directly in the executor\n        if (containingFunction !== currentExecutor) {\n          return;\n        }\n\n        const fnName = isResultConstructorCall(node.argument);\n        if (fnName) {\n          context.report({\n            node,\n            messageId: 'doubleWrap',\n            data: { fn: fnName },\n            fix(fixer) {\n              // Autofix: return ok(value) -> return value\n              // Autofix: return err(value) -> (can't autofix err, user needs to handle error differently)\n              if (fnName === 'ok') {\n                const call = node.argument as CallExpression;\n                if (call.arguments.length === 1) {\n                  const argText = context.sourceCode.getText(call.arguments[0]);\n                  return fixer.replaceText(node.argument!, argText);\n                }\n              }\n              return null;\n            },\n          });\n        }\n      },\n\n      // Handle implicit returns in arrow functions: () => ok(value)\n      ArrowFunctionExpression(node: ArrowFunctionExpression) {\n        if (executorStack.length === 0) return;\n\n        const currentExecutor = executorStack[executorStack.length - 1];\n        if (node !== currentExecutor) return;\n\n        // Check for implicit return (expression body, not block)\n        if (node.body.type !== 'BlockStatement') {\n          const fnName = isResultConstructorCall(node.body);\n          if (fnName) {\n            context.report({\n              node: node.body,\n              messageId: 'doubleWrap',\n              data: { fn: fnName },\n              fix(fixer) {\n                if (fnName === 'ok') {\n                  const call = node.body as CallExpression;\n                  if (call.arguments.length === 1) {\n                    const argText = context.sourceCode.getText(call.arguments[0]);\n                    return fixer.replaceText(node.body, argText);\n                  }\n                }\n                return null;\n              },\n            });\n          }\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from \"eslint\";\nimport type { CallExpression } from \"estree\";\n\n/**\n * Rule: no-dynamic-import\n *\n * Bans dynamic import() and require() so that bundlers and tree-shaking can\n * rely on static imports. Use static top-level import/export instead.\n *\n * BAD:  const m = await import('pkg');\n * BAD:  const m = require('pkg');\n * GOOD: import m from 'pkg';\n * GOOD: import { x } from 'pkg';\n */\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: \"problem\",\n    docs: {\n      description:\n        \"Disallow dynamic import() and require(). Use static imports for predictable bundling and tree-shaking.\",\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      dynamicImport:\n        \"Dynamic import() is not allowed. Use static import instead.\",\n      require:\n        \"require() is not allowed. Use static import instead.\",\n    },\n  },\n\n  create(context) {\n    return {\n      ImportExpression(node) {\n        context.report({ node, messageId: \"dynamicImport\" });\n      },\n      CallExpression(node: CallExpression) {\n        if (node.callee.type !== \"Identifier\") return;\n        if (node.callee.name !== \"require\") return;\n        context.report({\n          node: node.callee,\n          messageId: \"require\",\n        });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { AwaitExpression, CallExpression, MemberExpression, Node } from 'estree';\n\nfunction isDepsCall(node: CallExpression): boolean {\n  if (node.callee.type !== 'MemberExpression') return false;\n  const m = node.callee as MemberExpression;\n  return m.object.type === 'Identifier' && m.object.name === 'deps';\n}\n\nfunction isInsideStepCall(node: Node): boolean {\n  let current: Node | undefined = (node as Node & { parent?: Node }).parent;\n  while (current) {\n    if (current.type === 'CallExpression') {\n      const call = current as CallExpression;\n      if (call.callee.type === 'Identifier' && call.callee.name === 'step') return true;\n      if (\n        call.callee.type === 'MemberExpression' &&\n        call.callee.object.type === 'Identifier' &&\n        call.callee.object.name === 'step'\n      ) {\n        return true;\n      }\n    }\n    current = (current as Node & { parent?: Node }).parent;\n  }\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description: 'Disallow bare await deps.*() in workflow callbacks. Wrap them in step() or call them through steps.*().',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      noBareAwait:\n        \"Avoid bare await on a raw dependency call — it is invisible to the step engine. Use steps.fn(...), or wrap it: step('id', () => deps.fn(...)).\",\n    },\n  },\n  create(context) {\n    return {\n      AwaitExpression(node: AwaitExpression) {\n        if (!node.argument || node.argument.type !== 'CallExpression') return;\n        if (!isDepsCall(node.argument)) return;\n        if (isInsideStepCall(node)) return;\n        context.report({ node, messageId: 'noBareAwait' });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, Node, TryStatement } from 'estree';\n\n/**\n * Recursively walks `node` looking for a `step(...)` or `step.X(...)` call.\n *\n * Uses a generic property iteration rather than a hand-rolled child list so\n * arbitrary AST shapes (statement bodies, expression operands, switch cases,\n * loop bodies, etc.) are all covered.\n */\nfunction hasStepCall(node: Node): boolean {\n  if (node.type === 'CallExpression') {\n    const call = node as CallExpression;\n    if (call.callee.type === 'Identifier' && call.callee.name === 'step') return true;\n    if (\n      call.callee.type === 'MemberExpression' &&\n      call.callee.object.type === 'Identifier' &&\n      call.callee.object.name === 'step'\n    ) {\n      return true;\n    }\n  }\n\n  // Iterate every property and recurse into anything that looks like an AST\n  // node (an object with a string `type`) or an array of such nodes. Skip\n  // ESLint's runtime `parent` back-reference to avoid infinite recursion.\n  const record = node as unknown as Record<string, unknown>;\n  for (const key of Object.keys(record)) {\n    if (key === 'parent') continue;\n    const v = record[key];\n    if (!v || typeof v !== 'object') continue;\n    if (Array.isArray(v)) {\n      for (const item of v) {\n        if (item && typeof item === 'object' && 'type' in (item as object)) {\n          if (hasStepCall(item as Node)) return true;\n        }\n      }\n    } else if ('type' in (v as object)) {\n      if (hasStepCall(v as Node)) return true;\n    }\n  }\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description: 'Disallow wrapping step calls in try/catch; prefer step.try().',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      wrapStepTry:\n        'Do not wrap step() in try/catch. Use step.try() with explicit error mapping.',\n    },\n  },\n  create(context) {\n    return {\n      TryStatement(node: TryStatement) {\n        if (!node.handler) return;\n        if (hasStepCall(node.block)) {\n          context.report({ node, messageId: 'wrapStepTry' });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  ArrowFunctionExpression,\n  CallExpression,\n  FunctionExpression,\n  Node,\n  ObjectExpression,\n  ObjectPattern,\n  Pattern,\n} from 'estree';\n\ntype WorkflowCallback = FunctionExpression | ArrowFunctionExpression;\n\n/**\n * Names declared in a deps object literal: `{ validateCart, chargeCard }` or\n * `{ validateCart: impl }`. Spread elements are unknowable statically, so a\n * deps object containing one is treated as \"cannot enumerate\" and skipped\n * entirely rather than half-checked.\n */\nfunction collectDepNames(obj: ObjectExpression): Set<string> | null {\n  const names = new Set<string>();\n  for (const prop of obj.properties) {\n    if (prop.type === 'SpreadElement') return null;\n    if (prop.key.type === 'Identifier') {\n      names.add(prop.key.name);\n    } else if (prop.key.type === 'Literal' && typeof prop.key.value === 'string') {\n      names.add(prop.key.value);\n    }\n  }\n  return names.size > 0 ? names : null;\n}\n\nfunction findCallback(node: CallExpression): WorkflowCallback | null {\n  for (const arg of node.arguments) {\n    if (arg.type === 'ArrowFunctionExpression' || arg.type === 'FunctionExpression') {\n      return arg;\n    }\n  }\n  return null;\n}\n\nfunction findObjectArg(node: CallExpression): ObjectExpression | null {\n  for (const arg of node.arguments) {\n    if (arg.type === 'ObjectExpression') return arg;\n  }\n  return null;\n}\n\nfunction isCalleeNamed(node: CallExpression, name: string): boolean {\n  return node.callee.type === 'Identifier' && node.callee.name === name;\n}\n\nfunction isMethodNamed(node: CallExpression, name: string): boolean {\n  return (\n    node.callee.type === 'MemberExpression' &&\n    node.callee.property.type === 'Identifier' &&\n    node.callee.property.name === name\n  );\n}\n\n/** Names bound by the callback's own parameters, which shadow any dep. */\nfunction paramNames(fn: WorkflowCallback): Set<string> {\n  const names = new Set<string>();\n  const visitPattern = (p: Pattern | null): void => {\n    if (!p) return;\n    if (p.type === 'Identifier') {\n      names.add(p.name);\n      return;\n    }\n    if (p.type === 'ObjectPattern') {\n      for (const prop of (p as ObjectPattern).properties) {\n        if (prop.type === 'Property') visitPattern(prop.value as Pattern);\n        else visitPattern(prop.argument as Pattern);\n      }\n      return;\n    }\n    if (p.type === 'ArrayPattern') {\n      for (const el of p.elements) visitPattern(el as Pattern | null);\n      return;\n    }\n    if (p.type === 'AssignmentPattern') visitPattern(p.left as Pattern);\n    if (p.type === 'RestElement') visitPattern(p.argument as Pattern);\n  };\n  for (const param of fn.params) visitPattern(param as Pattern);\n  return names;\n}\n\n/** Depth-first walk over an estree node's child nodes. */\nfunction walk(node: Node, visit: (n: Node) => void): void {\n  visit(node);\n  for (const key of Object.keys(node)) {\n    if (key === 'parent') continue;\n    const value = (node as unknown as Record<string, unknown>)[key];\n    if (Array.isArray(value)) {\n      for (const child of value) {\n        if (child && typeof child === 'object' && typeof (child as Node).type === 'string') {\n          walk(child as Node, visit);\n        }\n      }\n    } else if (value && typeof value === 'object' && typeof (value as Node).type === 'string') {\n      walk(value as Node, visit);\n    }\n  }\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow calling a registered dependency directly inside a workflow callback. Call it through `deps.fn()` or the bound steps parameter so the injected implementation is the one that runs.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      depsBypass:\n        \"'{{name}}' is registered as a workflow dependency but called directly, so the injected implementation is ignored and tests cannot substitute it. Use deps.{{name}}(...) instead.\",\n    },\n  },\n  create(context) {\n    // callback node -> dep names registered for that workflow\n    const depsByCallback = new Map<WorkflowCallback, Set<string>>();\n\n    function register(callback: WorkflowCallback | null, deps: Set<string> | null): void {\n      if (!callback || !deps) return;\n      const existing = depsByCallback.get(callback);\n      if (existing) {\n        for (const name of deps) existing.add(name);\n      } else {\n        depsByCallback.set(callback, new Set(deps));\n      }\n    }\n\n    return {\n      Program(program) {\n        // Variable name -> deps, for `const wf = createWorkflow('n', {...})`\n        const depsByWorkflowVar = new Map<string, Set<string>>();\n\n        // Pass 1: record every createWorkflow/createSagaWorkflow deps object.\n        walk(program as Node, (node) => {\n          if (node.type !== 'CallExpression') return;\n          const call = node as CallExpression;\n          if (\n            !isCalleeNamed(call, 'createWorkflow') &&\n            !isCalleeNamed(call, 'createSagaWorkflow')\n          ) {\n            return;\n          }\n          const obj = findObjectArg(call);\n          if (!obj) return;\n          const deps = collectDepNames(obj);\n          if (!deps) return;\n\n          const parent = (call as Node & { parent?: Node }).parent;\n          if (\n            parent?.type === 'VariableDeclarator' &&\n            parent.id.type === 'Identifier'\n          ) {\n            depsByWorkflowVar.set(parent.id.name, deps);\n          }\n          // Chained: createWorkflow('n', {...}).run(cb)\n          if (\n            parent?.type === 'MemberExpression' &&\n            parent.property.type === 'Identifier' &&\n            parent.property.name === 'run'\n          ) {\n            const grandparent = (parent as Node & { parent?: Node }).parent;\n            if (grandparent?.type === 'CallExpression') {\n              register(findCallback(grandparent as CallExpression), deps);\n            }\n          }\n        });\n\n        // Pass 2: attach deps to each workflow callback.\n        walk(program as Node, (node) => {\n          if (node.type !== 'CallExpression') return;\n          const call = node as CallExpression;\n\n          // `run(deps, fn)` — deps object and callback in the same call.\n          if (isCalleeNamed(call, 'run')) {\n            const obj = findObjectArg(call);\n            if (obj) register(findCallback(call), collectDepNames(obj));\n            return;\n          }\n\n          // `wf.run(cb)` / `wf.run('id', cb)` / `durable.run(deps, fn, opts)`\n          if (isMethodNamed(call, 'run')) {\n            const callee = call.callee;\n            if (\n              callee.type === 'MemberExpression' &&\n              callee.object.type === 'Identifier'\n            ) {\n              const deps = depsByWorkflowVar.get(callee.object.name);\n              if (deps) {\n                register(findCallback(call), deps);\n                return;\n              }\n            }\n            const obj = findObjectArg(call);\n            if (obj) register(findCallback(call), collectDepNames(obj));\n          }\n        });\n      },\n\n      CallExpression(node: CallExpression) {\n        // Only bare `fn(...)` calls can bypass deps; `deps.fn()` and `s.fn()` are fine.\n        if (node.callee.type !== 'Identifier') return;\n        const name = node.callee.name;\n\n        const ancestors = context.sourceCode.getAncestors(node);\n        for (let i = ancestors.length - 1; i >= 0; i--) {\n          const ancestor = ancestors[i] as Node;\n          if (\n            ancestor.type !== 'ArrowFunctionExpression' &&\n            ancestor.type !== 'FunctionExpression'\n          ) {\n            continue;\n          }\n          const deps = depsByCallback.get(ancestor as WorkflowCallback);\n          if (!deps) continue;\n          if (!deps.has(name)) return;\n          // A parameter of the callback with the same name shadows the dep.\n          if (paramNames(ancestor as WorkflowCallback).has(name)) return;\n          context.report({ node: node.callee, messageId: 'depsBypass', data: { name } });\n          return;\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression } from 'estree';\n\nfunction isPromiseMethod(node: CallExpression, method: string): boolean {\n  if (node.callee.type !== 'MemberExpression') return false;\n  const m = node.callee as MemberExpression;\n  return (\n    m.object.type === 'Identifier' &&\n    m.object.name === 'Promise' &&\n    m.property.type === 'Identifier' &&\n    m.property.name === method\n  );\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: { description: 'Disallow Promise.all in workflows; use step.all/step.map.', recommended: true },\n    schema: [],\n    messages: {\n      noPromiseAll: 'Use step.all() or step.map() instead of Promise.all() inside workflows.',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (isPromiseMethod(node, 'all')) {\n          context.report({ node, messageId: 'noPromiseAll' });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression } from 'estree';\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: { description: 'Disallow Promise.race in workflows; use step.race.', recommended: true },\n    schema: [],\n    messages: {\n      noPromiseRace: 'Use step.race() instead of Promise.race() inside workflows.',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (node.callee.type !== 'MemberExpression') return;\n        const m = node.callee as MemberExpression;\n        if (\n          m.object.type === 'Identifier' &&\n          m.object.name === 'Promise' &&\n          m.property.type === 'Identifier' &&\n          m.property.name === 'race'\n        ) {\n          context.report({ node, messageId: 'noPromiseRace' });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type { CallExpression, MemberExpression } from 'estree';\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: { description: 'Disallow Promise.allSettled in workflows; use step.map.', recommended: true },\n    schema: [],\n    messages: {\n      noPromiseAllSettled: 'Use step.map() instead of Promise.allSettled() inside workflows.',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (node.callee.type !== 'MemberExpression') return;\n        const m = node.callee as MemberExpression;\n        if (\n          m.object.type === 'Identifier' &&\n          m.object.name === 'Promise' &&\n          m.property.type === 'Identifier' &&\n          m.property.name === 'allSettled'\n        ) {\n          context.report({ node, messageId: 'noPromiseAllSettled' });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  ArrowFunctionExpression,\n  CallExpression,\n  FunctionDeclaration,\n  FunctionExpression,\n  Node,\n  ReturnStatement,\n} from 'estree';\n\ntype AnyFunction = FunctionExpression | ArrowFunctionExpression | FunctionDeclaration;\n\nfunction isOkErrCall(node: CallExpression): boolean {\n  if (node.callee.type === 'Identifier') {\n    return node.callee.name === 'ok' || node.callee.name === 'err';\n  }\n  if (node.callee.type === 'MemberExpression' && node.callee.property.type === 'Identifier') {\n    return node.callee.property.name === 'ok' || node.callee.property.name === 'err';\n  }\n  return false;\n}\n\nfunction nearestEnclosingFunction(node: Node): AnyFunction | null {\n  let cur: Node | undefined = (node as Node & { parent?: Node }).parent;\n  while (cur) {\n    if (\n      cur.type === 'FunctionExpression' ||\n      cur.type === 'ArrowFunctionExpression' ||\n      cur.type === 'FunctionDeclaration'\n    ) {\n      return cur;\n    }\n    cur = (cur as Node & { parent?: Node }).parent;\n  }\n  return null;\n}\n\nfunction isWorkflowCallback(fn: AnyFunction): boolean {\n  const parent = (fn as Node & { parent?: Node }).parent;\n  if (!parent || parent.type !== 'CallExpression') return false;\n  const call = parent as CallExpression;\n  if (!call.arguments.includes(fn as unknown as CallExpression['arguments'][number])) return false;\n  const callee = call.callee;\n  if (\n    callee.type === 'MemberExpression' &&\n    callee.property.type === 'Identifier' &&\n    callee.property.name === 'run'\n  ) {\n    return true;\n  }\n  if (callee.type === 'Identifier' && callee.name === 'run') return true;\n  if (callee.type === 'Identifier') {\n    const param = fn.params[0];\n    if (\n      param &&\n      param.type === 'ObjectPattern' &&\n      param.properties.some(\n        (p) =>\n          p.type === 'Property' &&\n          p.key.type === 'Identifier' &&\n          p.key.name === 'step'\n      )\n    ) {\n      return true;\n    }\n  }\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description:\n        'Disallow manual Result propagation (return ok()/err()) inside workflow callbacks. Return raw values; the workflow wraps them automatically.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      noManualPropagation:\n        'Do not return ok()/err() inside a workflow callback. Return the raw value; the workflow wraps it automatically.',\n    },\n  },\n  create(context) {\n    return {\n      ReturnStatement(node: ReturnStatement) {\n        if (!node.argument || node.argument.type !== 'CallExpression') return;\n        if (!isOkErrCall(node.argument)) return;\n        const fn = nearestEnclosingFunction(node);\n        if (!fn) return;\n        if (!isWorkflowCallback(fn)) return;\n        context.report({ node, messageId: 'noManualPropagation' });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  ArrowFunctionExpression,\n  CallExpression,\n  FunctionDeclaration,\n  FunctionExpression,\n  Node,\n} from 'estree';\n\ntype AnyFunction = FunctionExpression | ArrowFunctionExpression | FunctionDeclaration;\n\nfunction isOkErrCall(node: CallExpression): boolean {\n  if (node.callee.type === 'Identifier') {\n    return node.callee.name === 'ok' || node.callee.name === 'err';\n  }\n  if (node.callee.type === 'MemberExpression' && node.callee.property.type === 'Identifier') {\n    return node.callee.property.name === 'ok' || node.callee.property.name === 'err';\n  }\n  return false;\n}\n\nfunction nearestEnclosingFunction(node: Node): AnyFunction | null {\n  let cur: Node | undefined = (node as Node & { parent?: Node }).parent;\n  while (cur) {\n    if (\n      cur.type === 'FunctionExpression' ||\n      cur.type === 'ArrowFunctionExpression' ||\n      cur.type === 'FunctionDeclaration'\n    ) {\n      return cur;\n    }\n    cur = (cur as Node & { parent?: Node }).parent;\n  }\n  return null;\n}\n\n/**\n * A workflow callback is a function passed directly as an argument to:\n *   - `something.run(callback)` (e.g. `workflow.run(...)`)\n *   - `run(callback)` (the bare run() entry point)\n *   - `workflow(callback)` / `workflow(args, callback)` (callable form — also a\n *     workflow body, even if `workflow-no-callable-form` flags it separately).\n */\nfunction isWorkflowCallback(fn: AnyFunction): boolean {\n  const parent = (fn as Node & { parent?: Node }).parent;\n  if (!parent || parent.type !== 'CallExpression') return false;\n  const call = parent as CallExpression;\n  if (!call.arguments.includes(fn as unknown as CallExpression['arguments'][number])) return false;\n  const callee = call.callee;\n  if (\n    callee.type === 'MemberExpression' &&\n    callee.property.type === 'Identifier' &&\n    callee.property.name === 'run'\n  ) {\n    return true;\n  }\n  if (callee.type === 'Identifier' && callee.name === 'run') return true;\n  // Heuristic for callable form: callback's first parameter destructures `step`.\n  // This lines up with the awaitly workflow callback signature without\n  // requiring symbol resolution.\n  if (callee.type === 'Identifier') {\n    const param = fn.params[0];\n    if (\n      param &&\n      param.type === 'ObjectPattern' &&\n      param.properties.some(\n        (p) =>\n          p.type === 'Property' &&\n          p.key.type === 'Identifier' &&\n          p.key.name === 'step'\n      )\n    ) {\n      return true;\n    }\n  }\n  return false;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description:\n        'Disallow direct ok()/err() calls inside workflow callbacks. Steps unwrap Results automatically; raw values are returned from the callback.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      noDirectOkErr:\n        'Do not call ok()/err() directly inside a workflow callback. Return raw values; steps unwrap Results automatically.',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (!isOkErrCall(node)) return;\n        const fn = nearestEnclosingFunction(node);\n        if (!fn) return;\n        if (!isWorkflowCallback(fn)) return;\n        context.report({ node, messageId: 'noDirectOkErr' });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  ArrowFunctionExpression,\n  CallExpression,\n  FunctionExpression,\n  ObjectPattern,\n} from 'estree';\n\n/**\n * Detects the awaitly workflow callback signature:\n *   ({ step, ... }) => { ... }\n *\n * The destructured `step` property is the awaitly invariant — generic callbacks\n * (setTimeout, describe, Array.from, ...) do not match this shape, so this is\n * a high-precision way to identify a workflow body without symbol resolution.\n */\nfunction callbackHasStepDestructure(\n  fn: FunctionExpression | ArrowFunctionExpression\n): boolean {\n  const param = fn.params[0];\n  if (!param || param.type !== 'ObjectPattern') return false;\n  return (param as ObjectPattern).properties.some(\n    (p) =>\n      p.type === 'Property' &&\n      p.key.type === 'Identifier' &&\n      p.key.name === 'step'\n  );\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'problem',\n    docs: {\n      description:\n        'Disallow the callable workflow form: workflow(callback). Use workflow.run(callback) instead.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      noCallableForm:\n        'Use workflow.run(...) instead of calling workflow(...) as a function. The callable form is not supported.',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        if (node.callee.type !== 'Identifier') return;\n        // `run(callback)` and `step('id', () => ...)` are legitimate;\n        // they are exempted by name to avoid duplicate diagnostics.\n        if (node.callee.name === 'run' || node.callee.name === 'step') return;\n\n        // Workflow callable form passes the body as the first or second argument\n        // (callable supports `workflow(name, fn)` and `workflow(fn)`).\n        const cb = node.arguments.find(\n          (arg) =>\n            arg.type === 'ArrowFunctionExpression' || arg.type === 'FunctionExpression'\n        ) as FunctionExpression | ArrowFunctionExpression | undefined;\n        if (!cb) return;\n        if (!callbackHasStepDestructure(cb)) return;\n\n        context.report({ node, messageId: 'noCallableForm' });\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  ArrowFunctionExpression,\n  CallExpression,\n  FunctionExpression,\n  ObjectPattern,\n} from 'estree';\n\nfunction getWorkflowCallback(\n  node: CallExpression\n): FunctionExpression | ArrowFunctionExpression | null {\n  for (const arg of node.arguments) {\n    if (arg.type === 'ArrowFunctionExpression' || arg.type === 'FunctionExpression') {\n      return arg;\n    }\n  }\n  return null;\n}\n\n/**\n * Workflow callbacks receive a single destructured object: `{ step, steps?, raw?, ctx? }`.\n *\n * `step` is always present — `steps`, `raw`, and `ctx` are optional depending on the\n * entry point (`run()` vs `createWorkflow().run()` and whether `createContext`\n * is set). Requiring all three is too strict; require only `step` (and accept\n * any superset).\n */\nfunction destructuresStep(pattern: ObjectPattern): boolean {\n  return pattern.properties.some(\n    (p) =>\n      p.type === 'Property' &&\n      p.key.type === 'Identifier' &&\n      p.key.name === 'step'\n  );\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description:\n        'Require workflow callbacks to destructure their context, e.g. ({ step }) or ({ step, deps }) or ({ step, deps, ctx }).',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      callbackShape:\n        'Workflow callback should destructure its context, e.g. ({ step }) => ... or ({ step, deps }) => ...',\n    },\n  },\n  create(context) {\n    return {\n      CallExpression(node: CallExpression) {\n        // Only inspect calls to a function literally named `run` (top-level) or\n        // a `.run(...)` method call.\n        if (node.callee.type === 'Identifier' && node.callee.name !== 'run') {\n          return;\n        }\n        if (\n          node.callee.type === 'MemberExpression' &&\n          !(\n            node.callee.property.type === 'Identifier' &&\n            node.callee.property.name === 'run'\n          )\n        ) {\n          return;\n        }\n\n        const cb = getWorkflowCallback(node);\n        if (!cb) return;\n        const param = cb.params[0];\n        if (!param || param.type !== 'ObjectPattern' || !destructuresStep(param)) {\n          context.report({ node: cb, messageId: 'callbackShape' });\n        }\n      },\n    };\n  },\n};\n\nexport default rule;\n","import type { Rule } from 'eslint';\nimport type {\n  CallExpression,\n  IfStatement,\n  MemberExpression,\n  Node,\n} from 'estree';\n\n/**\n * Returns true if `node` is `<something>.error._tag` or `<something>.error.type`.\n */\nfunction isErrorTagAccess(node: Node): boolean {\n  if (node.type !== 'MemberExpression') return false;\n  const me = node as MemberExpression;\n  if (me.property.type !== 'Identifier') return false;\n  if (me.property.name !== '_tag' && me.property.name !== 'type') return false;\n  if (me.object.type !== 'MemberExpression') return false;\n  const inner = me.object as MemberExpression;\n  return (\n    inner.property.type === 'Identifier' && inner.property.name === 'error'\n  );\n}\n\n/**\n * Returns true if `node` is a call expression whose callee is an Identifier\n * named `isUnexpectedError`.\n */\nfunction isUnexpectedGuardCall(node: Node): boolean {\n  if (node.type !== 'CallExpression') return false;\n  const callee = (node as CallExpression).callee;\n  return callee.type === 'Identifier' && callee.name === 'isUnexpectedError';\n}\n\n/**\n * Walks the AST under `root` looking for any node that satisfies `predicate`.\n * Stops on first match.\n */\nfunction anyDescendant(root: Node, predicate: (n: Node) => boolean): boolean {\n  let found = false;\n  const stack: Node[] = [root];\n  while (stack.length && !found) {\n    const n = stack.pop() as Node;\n    if (predicate(n)) {\n      found = true;\n      break;\n    }\n    for (const key of Object.keys(n)) {\n      // ESLint augments the AST with a `parent` back-reference at runtime;\n      // skip it to avoid infinite loops. The estree types don't declare it,\n      // so this comparison is intentionally loose.\n      if ((key as string) === 'parent') continue;\n      const v = (n as unknown as Record<string, unknown>)[key];\n      if (!v || typeof v !== 'object') continue;\n      if (Array.isArray(v)) {\n        for (const item of v) {\n          if (item && typeof item === 'object' && 'type' in item) {\n            stack.push(item as Node);\n          }\n        }\n      } else if ('type' in (v as object)) {\n        stack.push(v as Node);\n      }\n    }\n  }\n  return found;\n}\n\nconst rule: Rule.RuleModule = {\n  meta: {\n    type: 'suggestion',\n    docs: {\n      description:\n        'When matching on result.error tags, check isUnexpectedError(result.error) first to separate library bugs from typed business errors.',\n      recommended: true,\n    },\n    schema: [],\n    messages: {\n      checkUnexpectedFirst:\n        'Check isUnexpectedError(result.error) before matching on result.error._tag / .type. Without it, library/SDK bugs are silently treated as typed errors.',\n    },\n  },\n  create(context) {\n    return {\n      IfStatement(node: IfStatement) {\n        const test = node.test;\n        if (!anyDescendant(test, isErrorTagAccess)) return;\n        if (anyDescendant(test, isUnexpectedGuardCall)) return;\n        context.report({ node: test, messageId: 'checkUnexpectedFirst' });\n      },\n    };\n  },\n};\n\nexport default rule;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBA,IAAM,eAAe,oBAAI,IAAI,CAAC,QAAQ,OAAO,SAAS,eAAe,cAAc,OAAO,gBAAgB,gBAAgB,UAAU,CAAC;AAIrI,IAAM,sBAAsB,oBAAI,IAAI,CAAC,KAAK,CAAC;AAE3C,SAAS,iBAAiB,MAA+B;AACvD,QAAM,EAAE,OAAO,IAAI;AACnB,SAAO,OAAO,SAAS,gBAAgB,OAAO,SAAS;AACzD;AAEA,SAAS,kBAAkB,MAAqC;AAC9D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,OAAO,SAAS,oBAAoB;AACtC,UAAM,EAAE,QAAQ,SAAS,IAAI;AAC7B,QACE,OAAO,SAAS,gBAChB,OAAO,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C,qCAAqC;AAAA,QACrC,iCAAiC;AAAA,QACjC,sCAAsC;AAAA,QACtC,8BAA8B;AAAA,QAC9B,kCAAkC;AAAA,QAClC,+BAA+B;AAAA,QAC/B,sCAAsC;AAAA,QACtC,uCAAuC;AAAA,QACvC,6CAA6C;AAAA,QAC7C,wCAAwC;AAAA,QACxC,mCAAmC;AAAA,QACnC,qCAAqC;AAAA,QACrC,mCAAmC;AAAA;AAAA,MAErC;AAAA,IACF;AAAA,EACF;AACF;AAEA,IAAM,SAAwB;AAAA,EAC5B,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAO,cAAQ;","names":["isDirectStepCall","isStringLiteral","rule","STEP_METHODS","EXECUTOR_AT_INDEX_2","getStepMethodName","isStepCall","isThunk","isStringLiteral","getCalleeName","rule","isStepCall","isStringLiteral","getStepMethodName","EXECUTOR_AT_INDEX_2","isThunk","getCalleeName","STEP_METHODS","isStepCall","rule","rule","STEP_METHODS","isStepCall","isProperlyHandled","getStepMethodName","rule","STEP_METHODS","rule","parent","isStringLiteral","rule","isWorkflowCall","rule","rule","rule","rule","rule","rule","rule","rule","rule","isOkErrCall","nearestEnclosingFunction","isWorkflowCallback","rule","rule","rule","rule"]}