@workflow/builders 5.0.0-beta.7 → 5.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/apply-swc-transform.js +1 -1
  2. package/dist/base-builder.d.ts.map +1 -1
  3. package/dist/base-builder.js +2 -1
  4. package/dist/build-queue.js +1 -1
  5. package/dist/config-helpers.js +1 -1
  6. package/dist/constants.js +1 -1
  7. package/dist/discover-entries-esbuild-plugin.d.ts.map +1 -1
  8. package/dist/discover-entries-esbuild-plugin.js +3 -2
  9. package/dist/discover-entries-esbuild-plugin.test.js +1 -1
  10. package/dist/esbuild-tsconfig.js +1 -1
  11. package/dist/esbuild-tsconfig.test.js +1 -1
  12. package/dist/external-package-warning.test.js +1 -1
  13. package/dist/get-input-files.test.js +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/module-specifier.js +1 -1
  16. package/dist/module-specifier.test.js +1 -1
  17. package/dist/node-module-esbuild-plugin.js +1 -1
  18. package/dist/node-module-esbuild-plugin.test.js +1 -1
  19. package/dist/pseudo-package-esbuild-plugin.js +1 -1
  20. package/dist/pseudo-package-esbuild-plugin.test.js +1 -1
  21. package/dist/request-converter.js +1 -1
  22. package/dist/resolve-sourcemap.test.js +1 -1
  23. package/dist/serde-checker.js +1 -1
  24. package/dist/standalone.js +1 -1
  25. package/dist/swc-esbuild-plugin.js +1 -1
  26. package/dist/swc-esbuild-plugin.test.js +1 -1
  27. package/dist/transform-utils.js +1 -1
  28. package/dist/transform-utils.test.js +1 -1
  29. package/dist/types.js +1 -1
  30. package/dist/vercel-build-output-api.d.ts.map +1 -1
  31. package/dist/vercel-build-output-api.js +4 -1
  32. package/dist/workflow-alias.js +1 -1
  33. package/dist/workflow-alias.test.js +1 -1
  34. package/dist/workflows-extractor.js +1 -1
  35. package/package.json +4 -4
  36. package/dist/apply-swc-transform.js.map +0 -1
  37. package/dist/base-builder.js.map +0 -1
  38. package/dist/build-queue.js.map +0 -1
  39. package/dist/config-helpers.js.map +0 -1
  40. package/dist/constants.js.map +0 -1
  41. package/dist/discover-entries-esbuild-plugin.js.map +0 -1
  42. package/dist/discover-entries-esbuild-plugin.test.js.map +0 -1
  43. package/dist/esbuild-tsconfig.js.map +0 -1
  44. package/dist/esbuild-tsconfig.test.js.map +0 -1
  45. package/dist/external-package-warning.test.js.map +0 -1
  46. package/dist/get-input-files.test.js.map +0 -1
  47. package/dist/index.js.map +0 -1
  48. package/dist/module-specifier.js.map +0 -1
  49. package/dist/module-specifier.test.js.map +0 -1
  50. package/dist/node-module-esbuild-plugin.js.map +0 -1
  51. package/dist/node-module-esbuild-plugin.test.js.map +0 -1
  52. package/dist/pseudo-package-esbuild-plugin.js.map +0 -1
  53. package/dist/pseudo-package-esbuild-plugin.test.js.map +0 -1
  54. package/dist/request-converter.js.map +0 -1
  55. package/dist/resolve-sourcemap.test.js.map +0 -1
  56. package/dist/serde-checker.js.map +0 -1
  57. package/dist/standalone.js.map +0 -1
  58. package/dist/swc-esbuild-plugin.js.map +0 -1
  59. package/dist/swc-esbuild-plugin.test.js.map +0 -1
  60. package/dist/transform-utils.js.map +0 -1
  61. package/dist/transform-utils.test.js.map +0 -1
  62. package/dist/types.js.map +0 -1
  63. package/dist/vercel-build-output-api.js.map +0 -1
  64. package/dist/workflow-alias.js.map +0 -1
  65. package/dist/workflow-alias.test.js.map +0 -1
  66. package/dist/workflows-extractor.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"swc-esbuild-plugin.test.js","sourceRoot":"","sources":["../src/swc-esbuild-plugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,YAAY,EACZ,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,KAAK,OAAO,MA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C,qBAAqB,CAAC,CAAC,oBAAoB,CAChD,iDAAiD,EACjD,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EACzC,UAAU,EACV,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,OAAO,CAChB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,OAAO,GAAG,YAAY,EAAE,CAAC;QAE/B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC;YACjC,WAAW,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;YACnC,aAAa,EAAE,OAAO,CAAC,WAAW;YAClC,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE;gBACP,eAAe,CAAC;oBACd,IAAI,EAAE,UAAU;oBAChB,gBAAgB,EAAE,EAAE;iBACrB,CAAC;aACH;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,CAAC,qBAAqB,CAAC,CAAC,oBAAoB,CAChD,iDAAiD,EACjD,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EACzC,UAAU,EACV,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,WAAW,CACpB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n mkdirSync,\n mkdtempSync,\n realpathSync,\n rmSync,\n writeFileSync,\n} from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport * as esbuild from 'esbuild';\nimport { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';\n\nconst { applySwcTransformMock } = vi.hoisted(() => ({\n applySwcTransformMock: vi.fn(),\n}));\n\nvi.mock('./apply-swc-transform.js', () => ({\n applySwcTransform: applySwcTransformMock,\n}));\n\nimport {\n createDiscoverEntriesPlugin,\n importParents,\n} from './discover-entries-esbuild-plugin.js';\nimport { createSwcPlugin } from './swc-esbuild-plugin.js';\n\nconst realTmpdir = realpathSync(tmpdir());\n\nfunction writeFile(path: string, contents = ''): void {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, contents, 'utf-8');\n}\n\ndescribe('createSwcPlugin externalizeNonSteps', () => {\n let testRoot: string;\n\n beforeEach(() => {\n testRoot = mkdtempSync(join(realTmpdir, 'workflow-swc-plugin-'));\n importParents.clear();\n applySwcTransformMock.mockReset();\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n });\n\n afterEach(() => {\n importParents.clear();\n rmSync(testRoot, { recursive: true, force: true });\n });\n\n it.each([\n { inputExt: '.ts', outputExt: '.js' },\n { inputExt: '.tsx', outputExt: '.js' },\n { inputExt: '.mts', outputExt: '.mjs' },\n { inputExt: '.cts', outputExt: '.cjs' },\n ])('rewrites externalized $inputExt imports to $outputExt when rewriteTsExtensions is enabled', async ({\n inputExt,\n outputExt,\n }) => {\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const stepFile = join(srcDir, 'step.ts');\n\n writeFile(join(srcDir, `dep${inputExt}`), 'export const dep = {};');\n writeFile(stepFile, `import { dep } from './dep';\\nconsole.log(dep);`);\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n rewriteTsExtensions: true,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toContain(`/dep${outputExt}`);\n expect(output).not.toContain(`/dep${inputExt}`);\n });\n\n it('bundles path-aliased project-local imports inline', async () => {\n // Aliased project-local files must be bundled inline (not externalized\n // as relative paths) because their source on disk may contain further\n // alias imports that Node's ESM loader cannot resolve at runtime.\n // See packages/builders/src/swc-esbuild-plugin.ts for full reasoning.\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const libDir = join(srcDir, 'lib');\n const stepFile = join(srcDir, 'step.ts');\n\n writeFile(\n join(libDir, 'config.ts'),\n 'export const config = { value: \"hello-from-config\" };'\n );\n writeFile(\n stepFile,\n `import { config } from '@/lib/config';\\nconsole.log(config);`\n );\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n alias: { '@': srcDir },\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n rewriteTsExtensions: true,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // The aliased helper should be bundled inline (its content is in the\n // output), not externalized as a relative path or left as a bare alias.\n expect(output).toContain('hello-from-config');\n expect(output).not.toContain('@/lib/config');\n expect(output).not.toMatch(/from\\s+[\"'][^\"']*\\/lib\\/config\\.(js|ts)[\"']/);\n });\n\n it('bundles transitive aliased imports inside aliased helpers (Mux self-referencing package regression)', async () => {\n // Regression test for https://github.com/muxinc/ai/pull/193.\n //\n // A package self-references its own subpath via tsconfig `paths` (e.g.\n // `@my-pkg/lib/foo` → `src/lib/foo.ts`). A step file imports a helper\n // via the alias, and that helper imports another helper via the alias.\n //\n // Previously the helpers were externalized as relative paths, but their\n // source on disk still contained `import \"@my-pkg/lib/...\"`. At runtime,\n // Node's ESM loader didn't know about tsconfig paths, fell through to\n // the package's `exports` map, and threw `Package subpath ... is not\n // defined by \"exports\"`.\n //\n // With the fix, aliased project-local files are bundled inline, so\n // their alias imports are resolved at build time.\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const libDir = join(srcDir, 'lib');\n const stepFile = join(srcDir, 'step.ts');\n\n writeFile(\n join(libDir, 'providers.ts'),\n 'export const providerName = \"anthropic\";'\n );\n writeFile(\n join(libDir, 'client-factory.ts'),\n // Helper uses the same alias to reach a sibling — this is the case\n // that broke the Mux build with workflow >= 4.2.0-beta.78.\n `import { providerName } from '@my-pkg/lib/providers';\nexport const client = { provider: providerName };`\n );\n writeFile(\n stepFile,\n `import { client } from '@my-pkg/lib/client-factory';\\nconsole.log(client);`\n );\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n alias: { '@my-pkg': srcDir },\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n rewriteTsExtensions: true,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // Both helpers should be bundled inline — no aliased specifiers should\n // leak into the output, where Node's ESM loader would choke on them.\n expect(output).toContain('anthropic');\n expect(output).not.toContain('@my-pkg/lib/providers');\n expect(output).not.toContain('@my-pkg/lib/client-factory');\n });\n\n it('does not relativize Node.js builtin imports', async () => {\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const stepFile = join(srcDir, 'step.ts');\n\n writeFile(\n stepFile,\n `import { createHash } from 'crypto';\\nimport { join } from 'node:path';\\nconsole.log(createHash, join);`\n );\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // Builtins should remain as bare specifiers, not relativized paths\n expect(output).toMatch(/from\\s+[\"']crypto[\"']/);\n expect(output).toMatch(/from\\s+[\"']node:path[\"']/);\n expect(output).not.toMatch(/from\\s+[\"']\\..*crypto[\"']/);\n expect(output).not.toMatch(/from\\s+[\"']\\..*node:path[\"']/);\n });\n\n it('does not externalize aliased imports that resolve into node_modules', async () => {\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const stepFile = join(srcDir, 'step.ts');\n const nodeModulesDir = join(testRoot, 'node_modules', 'some-pkg');\n\n writeFile(join(nodeModulesDir, 'index.js'), 'export const pkg = \"hello\";');\n writeFile(stepFile, `import { pkg } from '@pkg';\\nconsole.log(pkg);`);\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n alias: { '@pkg': join(nodeModulesDir, 'index.js') },\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // Should be bundled (inlined), not externalized as a relative node_modules path\n expect(output).toContain('hello');\n expect(output).not.toMatch(/from\\s+[\"'].*node_modules/);\n });\n\n it('externalizes nested bare package imports that only resolve from a bundled package', async () => {\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const stepFile = join(srcDir, 'step.ts');\n const parentPkgDir = join(testRoot, 'node_modules', 'parent-pkg');\n const parentPkgIndex = join(parentPkgDir, 'index.js');\n const nativePkgDir = join(parentPkgDir, 'node_modules', 'optional-native');\n\n writeFile(\n join(parentPkgDir, 'package.json'),\n JSON.stringify({ name: 'parent-pkg', main: 'index.js' })\n );\n writeFile(\n parentPkgIndex,\n `const native = require('optional-native');\\nexports.value = native.value;`\n );\n writeFile(\n join(nativePkgDir, 'package.json'),\n JSON.stringify({ name: 'optional-native', main: 'binding.node' })\n );\n writeFile(join(nativePkgDir, 'binding.node'), '');\n writeFile(\n stepFile,\n `import { value } from 'parent-pkg';\\nconsole.log(value);`\n );\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile, parentPkgIndex],\n outdir,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toContain('optional-native');\n expect(output).not.toContain('binding.node');\n });\n\n it.each([\n '.ts',\n '.tsx',\n '.mts',\n '.cts',\n ])('preserves externalized %s extensions by default', async (inputExt) => {\n const outdir = join(testRoot, 'out');\n const srcDir = join(testRoot, 'src');\n const stepFile = join(srcDir, 'step.ts');\n\n writeFile(join(srcDir, `dep${inputExt}`), 'export const dep = {};');\n writeFile(stepFile, `import { dep } from './dep';\\nconsole.log(dep);`);\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toContain(`/dep${inputExt}`);\n });\n\n it('bundles transitive local TypeScript dependencies with extensionless imports', async () => {\n const outdir = join(testRoot, 'out');\n const stepFile = join(testRoot, 'server', 'workflows', 'my-workflow.ts');\n const constantsFile = join(testRoot, 'shared', 'constants.ts');\n const helpersFile = join(testRoot, 'shared', 'helpers.ts');\n\n writeFile(helpersFile, `export const HELPER_VALUE = \"from-helper\";`);\n writeFile(\n constantsFile,\n `import { HELPER_VALUE } from './helpers';\\nexport const CATEGORIES = [HELPER_VALUE];`\n );\n writeFile(\n stepFile,\n `import { CATEGORIES } from '../../shared/constants';\\nexport async function myStep() {\\n 'use step';\\n return CATEGORIES[0];\\n}`\n );\n\n const state = {\n discoveredSteps: new Set<string>(),\n discoveredWorkflows: new Set<string>(),\n discoveredSerdeFiles: new Set<string>(),\n };\n await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],\n plugins: [createDiscoverEntriesPlugin(state, testRoot)],\n });\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n bundleTransitiveLocalStepDependencies: true,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toContain('from-helper');\n expect(output).not.toMatch(/from\\s+[\"'][^\"']*shared\\/constants/);\n expect(output).not.toMatch(/from\\s+[\"'][^\"']*shared\\/helpers/);\n });\n\n it('externalizes transitive local TypeScript dependencies by default', async () => {\n const outdir = join(testRoot, 'out');\n const stepFile = join(testRoot, 'server', 'workflows', 'my-workflow.ts');\n const constantsFile = join(testRoot, 'shared', 'constants.ts');\n const helpersFile = join(testRoot, 'shared', 'helpers.ts');\n\n writeFile(helpersFile, `export const HELPER_VALUE = \"from-helper\";`);\n writeFile(\n constantsFile,\n `import { HELPER_VALUE } from './helpers';\\nexport const CATEGORIES = [HELPER_VALUE];`\n );\n writeFile(\n stepFile,\n `import { CATEGORIES } from '../../shared/constants';\\nexport async function myStep() {\\n 'use step';\\n return CATEGORIES[0];\\n}`\n );\n\n const state = {\n discoveredSteps: new Set<string>(),\n discoveredWorkflows: new Set<string>(),\n discoveredSerdeFiles: new Set<string>(),\n };\n await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],\n plugins: [createDiscoverEntriesPlugin(state, testRoot)],\n });\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n resolveExtensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'],\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).not.toContain('from-helper');\n expect(output).toMatch(/from\\s+[\"'][^\"']*shared\\/constants\\.ts[\"']/);\n });\n\n it('keeps ordinary package dependencies external when reachable from a bundled step', async () => {\n const outdir = join(testRoot, 'out');\n const stepFile = join(testRoot, 'server', 'workflows', 'my-workflow.ts');\n const pkgDir = join(testRoot, 'node_modules', 'plain-pkg');\n const pkgIndex = join(pkgDir, 'index.js');\n\n writeFile(\n join(pkgDir, 'package.json'),\n JSON.stringify({ name: 'plain-pkg', main: 'index.js' })\n );\n writeFile(pkgIndex, `export const value = \"from-package\";`);\n writeFile(\n stepFile,\n `import { value } from 'plain-pkg';\\nexport async function myStep() {\\n 'use step';\\n return value;\\n}`\n );\n\n const state = {\n discoveredSteps: new Set<string>(),\n discoveredWorkflows: new Set<string>(),\n discoveredSerdeFiles: new Set<string>(),\n };\n await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [createDiscoverEntriesPlugin(state, testRoot)],\n });\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile],\n outdir,\n bundleTransitiveLocalStepDependencies: true,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toMatch(/from\\s+[\"']plain-pkg[\"']/);\n expect(output).not.toContain('from-package');\n });\n\n it('bundles package parents when they lead to discovered workflow-related entries', async () => {\n const outdir = join(testRoot, 'out');\n const stepFile = join(testRoot, 'server', 'workflows', 'my-workflow.ts');\n const pkgDir = join(testRoot, 'node_modules', 'workflow-pkg');\n const pkgIndex = join(pkgDir, 'index.js');\n const pkgSerde = join(pkgDir, 'serde.js');\n\n writeFile(\n join(pkgDir, 'package.json'),\n JSON.stringify({ name: 'workflow-pkg', main: 'index.js' })\n );\n writeFile(pkgSerde, `export const value = \"from-serde\";`);\n writeFile(pkgIndex, `export { value } from './serde.js';`);\n writeFile(\n stepFile,\n `import { value } from 'workflow-pkg';\\nexport async function myStep() {\\n 'use step';\\n return value;\\n}`\n );\n\n const state = {\n discoveredSteps: new Set<string>(),\n discoveredWorkflows: new Set<string>(),\n discoveredSerdeFiles: new Set<string>(),\n };\n await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [createDiscoverEntriesPlugin(state, testRoot)],\n });\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile, pkgSerde],\n outdir,\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toContain('from-serde');\n expect(output).not.toMatch(/from\\s+[\"']workflow-pkg[\"']/);\n });\n});\n\ndescribe('createSwcPlugin sideEffectEntries', () => {\n let testRoot: string;\n\n beforeEach(() => {\n testRoot = mkdtempSync(join(realTmpdir, 'workflow-swc-plugin-'));\n applySwcTransformMock.mockReset();\n });\n\n afterEach(() => {\n rmSync(testRoot, { recursive: true, force: true });\n });\n\n /**\n * Helper: creates a fake node_modules package with `\"sideEffects\": false`\n * in its package.json and a single entry file that exports a side-effectful\n * registration call (simulating what the SWC transform produces).\n */\n function createSideEffectsFalsePackage(\n packageName: string,\n entryCode: string\n ): string {\n const pkgDir = join(testRoot, 'node_modules', packageName);\n writeFile(\n join(pkgDir, 'package.json'),\n JSON.stringify({\n name: packageName,\n version: '1.0.0',\n sideEffects: false,\n main: 'index.js',\n })\n );\n const entryPath = join(pkgDir, 'index.js');\n writeFile(entryPath, entryCode);\n return entryPath;\n }\n\n it('preserves bare imports of sideEffectEntries packages when bundling without entriesToBundle', async () => {\n const sideEffectCode =\n 'globalThis.__registered = globalThis.__registered || [];\\nglobalThis.__registered.push(\"my-pkg\");';\n const entryPath = createSideEffectsFalsePackage(\n 'my-side-effect-pkg',\n sideEffectCode\n );\n\n // SWC mock: return the code unchanged (the side effects are already there)\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n\n const result = await esbuild.build({\n stdin: {\n contents: `import 'my-side-effect-pkg';`,\n resolveDir: testRoot,\n sourcefile: 'virtual-entry.js',\n loader: 'js',\n },\n absWorkingDir: testRoot,\n bundle: true,\n format: 'cjs',\n platform: 'node',\n write: false,\n treeShaking: true,\n logLevel: 'silent',\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n sideEffectEntries: [entryPath],\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // The registration code should be present in the bundle\n expect(output).toContain('__registered');\n });\n\n it('drops bare imports when sideEffectEntries is NOT provided for sideEffects:false packages', async () => {\n const sideEffectCode =\n 'globalThis.__registered = globalThis.__registered || [];\\nglobalThis.__registered.push(\"my-pkg\");';\n createSideEffectsFalsePackage('my-dropped-pkg', sideEffectCode);\n\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n\n const result = await esbuild.build({\n stdin: {\n contents: `import 'my-dropped-pkg';`,\n resolveDir: testRoot,\n sourcefile: 'virtual-entry.js',\n loader: 'js',\n },\n absWorkingDir: testRoot,\n bundle: true,\n format: 'cjs',\n platform: 'node',\n write: false,\n treeShaking: true,\n logLevel: 'silent',\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // Without sideEffectEntries, esbuild drops the bare import\n expect(output).not.toContain('__registered');\n });\n\n it('produces no warnings for sideEffectEntries packages', async () => {\n const sideEffectCode =\n 'globalThis.__registered = globalThis.__registered || [];\\nglobalThis.__registered.push(\"warned-pkg\");';\n const entryPath = createSideEffectsFalsePackage(\n 'my-warned-pkg',\n sideEffectCode\n );\n\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n\n const result = await esbuild.build({\n stdin: {\n contents: `import 'my-warned-pkg';`,\n resolveDir: testRoot,\n sourcefile: 'virtual-entry.js',\n loader: 'js',\n },\n absWorkingDir: testRoot,\n bundle: true,\n format: 'cjs',\n platform: 'node',\n write: false,\n treeShaking: true,\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n sideEffectEntries: [entryPath],\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n // No \"ignored-bare-import\" warnings should be produced\n const sideEffectWarnings = result.warnings.filter(\n (w) => w.id === 'ignored-bare-import'\n );\n expect(sideEffectWarnings).toHaveLength(0);\n });\n\n it('preserves bare imports with entriesToBundle and sideEffectEntries together', async () => {\n const sideEffectCode =\n 'globalThis.__registered = globalThis.__registered || [];\\nglobalThis.__registered.push(\"bundled-pkg\");';\n const entryPath = createSideEffectsFalsePackage(\n 'my-bundled-pkg',\n sideEffectCode\n );\n\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n\n const outdir = join(testRoot, 'out');\n const stepFile = join(testRoot, 'src', 'step.ts');\n writeFile(\n stepFile,\n `import 'my-bundled-pkg';\\nexport const POST = () => {};`\n );\n\n const result = await esbuild.build({\n entryPoints: [stepFile],\n absWorkingDir: testRoot,\n outdir,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n treeShaking: true,\n logLevel: 'silent',\n plugins: [\n createSwcPlugin({\n mode: 'step',\n entriesToBundle: [stepFile, entryPath],\n outdir,\n sideEffectEntries: [entryPath],\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // The registration code should be bundled in\n expect(output).toContain('__registered');\n });\n\n it('preserves bare imports for local files with sideEffects:false in their parent package.json', async () => {\n // Simulate a workspace package with sideEffects: false\n const pkgDir = join(testRoot, 'packages', 'shared');\n writeFile(\n join(pkgDir, 'package.json'),\n JSON.stringify({\n name: '@myorg/shared',\n version: '1.0.0',\n sideEffects: false,\n main: 'index.js',\n })\n );\n const sharedEntry = join(pkgDir, 'index.js');\n writeFile(sharedEntry, 'globalThis.__sharedRegistered = true;');\n\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n\n // Use a relative import to the local file (like the virtual entry does for local files)\n const result = await esbuild.build({\n stdin: {\n contents: `import './packages/shared/index.js';`,\n resolveDir: testRoot,\n sourcefile: 'virtual-entry.js',\n loader: 'js',\n },\n absWorkingDir: testRoot,\n bundle: true,\n format: 'cjs',\n platform: 'node',\n write: false,\n treeShaking: true,\n logLevel: 'silent',\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n sideEffectEntries: [sharedEntry],\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n expect(output).toContain('__sharedRegistered');\n });\n\n it('does not override sideEffects for non-entry modules', async () => {\n // Create two packages - one is a side-effect entry, one is not\n const sideEffectCode = 'globalThis.__entryRegistered = true;';\n const entryPath = createSideEffectsFalsePackage(\n 'entry-pkg',\n sideEffectCode\n );\n\n const nonEntryCode = 'globalThis.__nonEntryRegistered = true;';\n createSideEffectsFalsePackage('non-entry-pkg', nonEntryCode);\n\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n\n const result = await esbuild.build({\n stdin: {\n contents: `import 'entry-pkg';\\nimport 'non-entry-pkg';`,\n resolveDir: testRoot,\n sourcefile: 'virtual-entry.js',\n loader: 'js',\n },\n absWorkingDir: testRoot,\n bundle: true,\n format: 'cjs',\n platform: 'node',\n write: false,\n treeShaking: true,\n logLevel: 'silent',\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n // Only entry-pkg is listed, non-entry-pkg is not\n sideEffectEntries: [entryPath],\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n const output = result.outputFiles[0].text;\n // entry-pkg should be preserved\n expect(output).toContain('__entryRegistered');\n // non-entry-pkg should be dropped (sideEffects: false is respected)\n expect(output).not.toContain('__nonEntryRegistered');\n });\n});\n\ndescribe('createSwcPlugin projectRoot', () => {\n let testRoot: string;\n\n beforeEach(() => {\n testRoot = mkdtempSync(join(realTmpdir, 'workflow-swc-plugin-'));\n applySwcTransformMock.mockReset();\n applySwcTransformMock.mockImplementation(\n async (_filename: string, source: string) => ({\n code: source,\n workflowManifest: {},\n })\n );\n });\n\n afterEach(() => {\n rmSync(testRoot, { recursive: true, force: true });\n });\n\n function setupFixture() {\n const appRoot = join(testRoot, 'apps', 'chat');\n const packageRoot = join(testRoot, 'packages', 'vade');\n const workflowFile = join(\n packageRoot,\n 'src',\n 'internal',\n 'message',\n 'workflow',\n 'handle-message.ts'\n );\n\n writeFile(\n workflowFile,\n `export async function handleMessageWorkflow(message) {\n \"use workflow\";\n\n return message;\n}\n`\n );\n\n return {\n appRoot,\n packageRoot,\n workflowFile,\n };\n }\n\n it('passes the explicit projectRoot through to applySwcTransform', async () => {\n const fixture = setupFixture();\n\n const result = await esbuild.build({\n entryPoints: [fixture.workflowFile],\n absWorkingDir: fixture.packageRoot,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n projectRoot: fixture.appRoot,\n workflowManifest: {},\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n expect(applySwcTransformMock).toHaveBeenCalledWith(\n 'src/internal/message/workflow/handle-message.ts',\n expect.stringContaining('\"use workflow\"'),\n 'workflow',\n fixture.workflowFile,\n fixture.appRoot\n );\n });\n\n it('defaults the transform projectRoot to absWorkingDir', async () => {\n const fixture = setupFixture();\n\n const result = await esbuild.build({\n entryPoints: [fixture.workflowFile],\n absWorkingDir: fixture.packageRoot,\n bundle: true,\n format: 'esm',\n platform: 'node',\n write: false,\n plugins: [\n createSwcPlugin({\n mode: 'workflow',\n workflowManifest: {},\n }),\n ],\n });\n\n expect(result.errors).toHaveLength(0);\n expect(applySwcTransformMock).toHaveBeenCalledWith(\n 'src/internal/message/workflow/handle-message.ts',\n expect.stringContaining('\"use workflow\"'),\n 'workflow',\n fixture.workflowFile,\n fixture.packageRoot\n );\n });\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-utils.js","sourceRoot":"","sources":["../src/transform-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0GAA0G;AAC1G,MAAM,CAAC,MAAM,kBAAkB,GAAG,iCAAiC,CAAC;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,6BAA6B,CAAC;AAE5D,0EAA0E;AAC1E,8DAA8D;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAE5E,iGAAiG;AACjG,oEAAoE;AACpE,MAAM,CAAC,MAAM,0BAA0B,GACrC,oEAAoE,CAAC;AAEvE,yFAAyF;AACzF,sDAAsD;AACtD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,oCAAoC,GAC/C,8CAA8C,CAAC;AAEjD,2EAA2E;AAC3E,gFAAgF;AAChF,MAAM,CAAC,MAAM,4BAA4B,GACvC,qCAAqC,CAAC;AAoBxC;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,MAAM,cAAc,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,cAAc,GAAG,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,wBAAwB,GAC5B,oCAAoC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEpD,OAAO;QACL,cAAc;QACd,UAAU;QACV,cAAc;QACd,cAAc;QACd,YAAY,EAAE,cAAc,IAAI,UAAU;QAC1C,QAAQ,EAAE,cAAc,IAAI,cAAc,IAAI,wBAAwB;KACvE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAgB;IACtD,OAAO,4BAA4B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAgB,EAChB,QAA8B;IAE9B,iDAAiD;IACjD,IAAI,uBAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,YAAY,IAAI,QAAQ,CAAC,QAAQ,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAClC,yKAAyK,CAAC","sourcesContent":["/**\n * Shared utilities for detecting files that need workflow transformation.\n * Used by builders, rollup plugin, Next.js loader, and vite plugin.\n */\n\n// Matches: 'use workflow'; \"use workflow\"; 'use step'; \"use step\"; at line start with optional whitespace\nexport const useWorkflowPattern = /^\\s*(['\"])use workflow\\1;?\\s*$/m;\nexport const useStepPattern = /^\\s*(['\"])use step\\1;?\\s*$/m;\n\n// Matches imports from '@workflow/serde' (for custom class serialization)\n// e.g.: import { WORKFLOW_SERIALIZE } from '@workflow/serde';\nexport const workflowSerdeImportPattern = /from\\s+(['\"])@workflow\\/serde\\1/;\n\n// Matches direct usage of Symbol.for('workflow-serialize') or Symbol.for('workflow-deserialize')\n// e.g.: static [Symbol.for('workflow-serialize')](instance) { ... }\nexport const workflowSerdeSymbolPattern =\n /Symbol\\.for\\s*\\(\\s*(['\"])workflow-(?:serialize|deserialize)\\1\\s*\\)/;\n\n// Matches usage of WORKFLOW_SERIALIZE or WORKFLOW_DESERIALIZE as computed property names\n// e.g.: static [WORKFLOW_SERIALIZE](instance) { ... }\n// This catches cases where the symbols are imported and used (even if bundled/re-exported)\nexport const workflowSerdeComputedPropertyPattern =\n /\\[\\s*WORKFLOW_(?:SERIALIZE|DESERIALIZE)\\s*\\]/;\n\n// Pattern to detect generated workflow route files that should be excluded\n// These files are generated by the build process and should not be re-processed\nexport const generatedWorkflowPathPattern =\n /[/\\\\]\\.well-known[/\\\\]workflow[/\\\\]/;\n\n/**\n * Detects workflow-related patterns in source code.\n */\nexport interface WorkflowPatternMatch {\n /** File contains 'use workflow' directive */\n hasUseWorkflow: boolean;\n /** File contains 'use step' directive */\n hasUseStep: boolean;\n /** File contains @workflow/serde import */\n hasSerdeImport: boolean;\n /** File contains Symbol.for('workflow-serialize') or Symbol.for('workflow-deserialize') */\n hasSerdeSymbol: boolean;\n /** File contains any directive ('use workflow' or 'use step') */\n hasDirective: boolean;\n /** File contains any serde pattern (import or Symbol.for) */\n hasSerde: boolean;\n}\n\n/**\n * Detects workflow-related patterns in source code.\n * @param source - The source code to analyze\n * @returns Object with flags for each detected pattern\n */\nexport function detectWorkflowPatterns(source: string): WorkflowPatternMatch {\n const hasUseWorkflow = useWorkflowPattern.test(source);\n const hasUseStep = useStepPattern.test(source);\n const hasSerdeImport = workflowSerdeImportPattern.test(source);\n const hasSerdeSymbol = workflowSerdeSymbolPattern.test(source);\n const hasSerdeComputedProperty =\n workflowSerdeComputedPropertyPattern.test(source);\n\n return {\n hasUseWorkflow,\n hasUseStep,\n hasSerdeImport,\n hasSerdeSymbol,\n hasDirective: hasUseWorkflow || hasUseStep,\n hasSerde: hasSerdeImport || hasSerdeSymbol || hasSerdeComputedProperty,\n };\n}\n\n/**\n * Determines if a file path is a generated workflow route file.\n * @param filePath - The file path to check\n * @returns true if the file is a generated workflow route\n */\nexport function isGeneratedWorkflowFile(filePath: string): boolean {\n return generatedWorkflowPathPattern.test(filePath);\n}\n\n/**\n * Determines if a file should be transformed based on its path and content patterns.\n *\n * Logic:\n * - Generated workflow route files are never transformed\n * - Files with directives ('use workflow' or 'use step') are always transformed\n * - Files with serde patterns are always transformed; the SWC plugin performs\n * AST-level extraction/filtering to determine whether they actually define\n * serde classes\n *\n * @param filePath - The file path to check\n * @param patterns - The detected patterns from detectWorkflowPatterns()\n * @returns true if the file should be transformed\n */\nexport function shouldTransformFile(\n filePath: string,\n patterns: WorkflowPatternMatch\n): boolean {\n // Never transform generated workflow route files\n if (isGeneratedWorkflowFile(filePath)) {\n return false;\n }\n\n return patterns.hasDirective || patterns.hasSerde;\n}\n\n/**\n * Combined regex pattern for turbopack content matching.\n * Uses backreferences to ensure matching quote types.\n * Matches: 'use workflow', 'use step', @workflow/serde imports, Symbol.for serialization symbols,\n * and WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE computed property usage\n */\nexport const turbopackContentPattern =\n /(use workflow|use step|from\\s+(['\"])@workflow\\/serde\\2|Symbol\\.for\\s*\\(\\s*(['\"])workflow-(?:serialize|deserialize)\\3\\s*\\)|\\[\\s*WORKFLOW_(?:SERIALIZE|DESERIALIZE)\\s*\\])/;\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-utils.test.js","sourceRoot":"","sources":["../src/transform-utils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,oCAAoC,EACpC,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,QAAQ,CAAC,oBAAoB,EAAE,GAAG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EAAE,IAAI;aACnB,CAAC,CACH,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,CACJ,mBAAmB,CAAC,+BAA+B,EAAE;gBACnD,GAAG,UAAU;gBACb,cAAc,EAAE,IAAI;gBACpB,YAAY,EAAE,IAAI;aACnB,CAAC,CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;YAC9C,MAAM,CACJ,mBAAmB,CAAC,sBAAsB,EAAE;gBAC1C,GAAG,UAAU;gBACb,cAAc,EAAE,IAAI;gBACpB,QAAQ,EAAE,IAAI;aACf,CAAC,CACH,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACvE,MAAM,CACJ,mBAAmB,CACjB,wDAAwD,EACxD,EAAE,GAAG,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CACxD,CACF,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACvE,MAAM,CAAC,mBAAmB,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, expect, it } from 'vitest';\nimport {\n detectWorkflowPatterns,\n shouldTransformFile,\n useStepPattern,\n useWorkflowPattern,\n workflowSerdeComputedPropertyPattern,\n workflowSerdeImportPattern,\n workflowSerdeSymbolPattern,\n} from './transform-utils.js';\n\ndescribe('transform-utils patterns', () => {\n describe('useWorkflowPattern', () => {\n it('should match \"use workflow\" with single quotes', () => {\n expect(useWorkflowPattern.test(`'use workflow';`)).toBe(true);\n expect(useWorkflowPattern.test(`'use workflow'`)).toBe(true);\n });\n\n it('should match \"use workflow\" with double quotes', () => {\n expect(useWorkflowPattern.test(`\"use workflow\";`)).toBe(true);\n expect(useWorkflowPattern.test(`\"use workflow\"`)).toBe(true);\n });\n\n it('should match with leading whitespace', () => {\n expect(useWorkflowPattern.test(` 'use workflow';`)).toBe(true);\n expect(useWorkflowPattern.test(`\\t\"use workflow\";`)).toBe(true);\n });\n\n it('should not match inline usage', () => {\n expect(useWorkflowPattern.test(`const x = 'use workflow';`)).toBe(false);\n });\n });\n\n describe('useStepPattern', () => {\n it('should match \"use step\" with single quotes', () => {\n expect(useStepPattern.test(`'use step';`)).toBe(true);\n expect(useStepPattern.test(`'use step'`)).toBe(true);\n });\n\n it('should match \"use step\" with double quotes', () => {\n expect(useStepPattern.test(`\"use step\";`)).toBe(true);\n expect(useStepPattern.test(`\"use step\"`)).toBe(true);\n });\n });\n\n describe('workflowSerdeImportPattern', () => {\n it('should match import from @workflow/serde with single quotes', () => {\n const source = `import { WORKFLOW_SERIALIZE } from '@workflow/serde';`;\n expect(workflowSerdeImportPattern.test(source)).toBe(true);\n });\n\n it('should match import from @workflow/serde with double quotes', () => {\n const source = `import { WORKFLOW_SERIALIZE } from \"@workflow/serde\";`;\n expect(workflowSerdeImportPattern.test(source)).toBe(true);\n });\n\n it('should match import with multiple specifiers', () => {\n const source = `import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';`;\n expect(workflowSerdeImportPattern.test(source)).toBe(true);\n });\n\n it('should match import with type', () => {\n const source = `import type { SerializationSymbol } from '@workflow/serde';`;\n expect(workflowSerdeImportPattern.test(source)).toBe(true);\n });\n\n it('should not match similar but different packages', () => {\n expect(\n workflowSerdeImportPattern.test(`import { x } from '@other/serde';`)\n ).toBe(false);\n expect(\n workflowSerdeImportPattern.test(\n `import { x } from '@workflow/serde-utils';`\n )\n ).toBe(false);\n });\n });\n\n describe('workflowSerdeSymbolPattern', () => {\n it('should match Symbol.for with workflow-serialize', () => {\n const source = `static [Symbol.for('workflow-serialize')](instance) {}`;\n expect(workflowSerdeSymbolPattern.test(source)).toBe(true);\n });\n\n it('should match Symbol.for with workflow-deserialize', () => {\n const source = `static [Symbol.for('workflow-deserialize')](data) {}`;\n expect(workflowSerdeSymbolPattern.test(source)).toBe(true);\n });\n\n it('should match with double quotes', () => {\n const source = `static [Symbol.for(\"workflow-serialize\")](instance) {}`;\n expect(workflowSerdeSymbolPattern.test(source)).toBe(true);\n });\n\n it('should match with whitespace variations', () => {\n expect(\n workflowSerdeSymbolPattern.test(`Symbol.for( 'workflow-serialize' )`)\n ).toBe(true);\n expect(\n workflowSerdeSymbolPattern.test(`Symbol.for('workflow-deserialize')`)\n ).toBe(true);\n });\n\n it('should match in a full class definition', () => {\n const source = `\n export class Point {\n constructor(x, y) {\n this.x = x;\n this.y = y;\n }\n\n static [Symbol.for('workflow-serialize')](instance) {\n return { x: instance.x, y: instance.y };\n }\n\n static [Symbol.for('workflow-deserialize')](data) {\n return new Point(data.x, data.y);\n }\n }\n `;\n expect(workflowSerdeSymbolPattern.test(source)).toBe(true);\n });\n\n it('should not match other Symbol.for usage', () => {\n expect(\n workflowSerdeSymbolPattern.test(`Symbol.for('other-symbol')`)\n ).toBe(false);\n expect(\n workflowSerdeSymbolPattern.test(`Symbol.for('workflow-something-else')`)\n ).toBe(false);\n });\n\n it('should not match non-Symbol.for patterns', () => {\n expect(workflowSerdeSymbolPattern.test(`'workflow-serialize'`)).toBe(\n false\n );\n expect(workflowSerdeSymbolPattern.test(`workflow-deserialize`)).toBe(\n false\n );\n });\n });\n\n describe('combined detection', () => {\n it('should detect file using imported symbols', () => {\n const source = `\n import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';\n\n export class MyClass {\n static [WORKFLOW_SERIALIZE](instance) {\n return { value: instance.value };\n }\n\n static [WORKFLOW_DESERIALIZE](data) {\n return new MyClass(data.value);\n }\n }\n `;\n expect(workflowSerdeImportPattern.test(source)).toBe(true);\n // Note: workflowSerdeSymbolPattern won't match here because the symbols\n // are referenced by identifier, not directly as Symbol.for()\n expect(workflowSerdeSymbolPattern.test(source)).toBe(false);\n });\n\n it('should detect file using direct Symbol.for', () => {\n const source = `\n export class Point {\n static [Symbol.for('workflow-serialize')](instance) {\n return { x: instance.x };\n }\n\n static [Symbol.for('workflow-deserialize')](data) {\n return new Point(data.x);\n }\n }\n `;\n expect(workflowSerdeImportPattern.test(source)).toBe(false);\n expect(workflowSerdeSymbolPattern.test(source)).toBe(true);\n });\n\n it('should detect file with both patterns', () => {\n // This would be unusual but valid\n const source = `\n import { WORKFLOW_SERIALIZE } from '@workflow/serde';\n\n export class Point {\n // Using imported symbol\n static [WORKFLOW_SERIALIZE](instance) {\n return { x: instance.x };\n }\n\n // Using direct Symbol.for\n static [Symbol.for('workflow-deserialize')](data) {\n return new Point(data.x);\n }\n }\n `;\n expect(workflowSerdeImportPattern.test(source)).toBe(true);\n expect(workflowSerdeSymbolPattern.test(source)).toBe(true);\n });\n });\n\n describe('workflowSerdeComputedPropertyPattern', () => {\n it('should match [WORKFLOW_SERIALIZE] computed property', () => {\n const source = `static [WORKFLOW_SERIALIZE](instance) {}`;\n expect(workflowSerdeComputedPropertyPattern.test(source)).toBe(true);\n });\n\n it('should match [WORKFLOW_DESERIALIZE] computed property', () => {\n const source = `static [WORKFLOW_DESERIALIZE](data) {}`;\n expect(workflowSerdeComputedPropertyPattern.test(source)).toBe(true);\n });\n\n it('should match with whitespace inside brackets', () => {\n expect(\n workflowSerdeComputedPropertyPattern.test(`[ WORKFLOW_SERIALIZE ]`)\n ).toBe(true);\n expect(\n workflowSerdeComputedPropertyPattern.test(`[ WORKFLOW_DESERIALIZE ]`)\n ).toBe(true);\n });\n\n it('should match in bundled code where symbols are imported from chunks', () => {\n // This is the pattern seen in bundled packages like just-bash\n const source = `\n import {\n WORKFLOW_DESERIALIZE,\n WORKFLOW_SERIALIZE\n } from \"./chunks/chunk-453323QY.js\";\n\n var Bash = class _Bash {\n static [WORKFLOW_SERIALIZE](instance) {\n return { fs: instance.fs };\n }\n static [WORKFLOW_DESERIALIZE](serialized) {\n return Object.create(_Bash.prototype, {\n fs: { value: serialized.fs }\n });\n }\n };\n `;\n expect(workflowSerdeComputedPropertyPattern.test(source)).toBe(true);\n // Note: import pattern won't match because it's from a chunk, not @workflow/serde\n expect(workflowSerdeImportPattern.test(source)).toBe(false);\n });\n\n it('should not match partial names', () => {\n expect(\n workflowSerdeComputedPropertyPattern.test(`[WORKFLOW_SERIALIZE_EXTRA]`)\n ).toBe(false);\n expect(\n workflowSerdeComputedPropertyPattern.test(`[MY_WORKFLOW_SERIALIZE]`)\n ).toBe(false);\n });\n\n it('should not match string literals', () => {\n expect(\n workflowSerdeComputedPropertyPattern.test(`['WORKFLOW_SERIALIZE']`)\n ).toBe(false);\n expect(\n workflowSerdeComputedPropertyPattern.test(`[\"WORKFLOW_DESERIALIZE\"]`)\n ).toBe(false);\n });\n });\n\n describe('detectWorkflowPatterns', () => {\n it('should detect hasSerde for @workflow/serde import', () => {\n const source = `import { WORKFLOW_SERIALIZE } from '@workflow/serde';`;\n const result = detectWorkflowPatterns(source);\n expect(result.hasSerde).toBe(true);\n expect(result.hasSerdeImport).toBe(true);\n });\n\n it('should detect hasSerde for Symbol.for pattern', () => {\n const source = `static [Symbol.for('workflow-serialize')](instance) {}`;\n const result = detectWorkflowPatterns(source);\n expect(result.hasSerde).toBe(true);\n expect(result.hasSerdeSymbol).toBe(true);\n });\n\n it('should detect hasSerde for computed property pattern', () => {\n const source = `static [WORKFLOW_SERIALIZE](instance) {}`;\n const result = detectWorkflowPatterns(source);\n expect(result.hasSerde).toBe(true);\n });\n\n it('should detect hasSerde for bundled third-party packages', () => {\n // Simulates bundled output from packages like just-bash\n const source = `\n import {\n WORKFLOW_DESERIALIZE,\n WORKFLOW_SERIALIZE\n } from \"./chunks/chunk-ABC123.js\";\n\n var MyClass = class {\n static [WORKFLOW_SERIALIZE](instance) {\n return { data: instance.data };\n }\n static [WORKFLOW_DESERIALIZE](serialized) {\n return new MyClass(serialized.data);\n }\n };\n `;\n const result = detectWorkflowPatterns(source);\n expect(result.hasSerde).toBe(true);\n });\n\n it('should not detect hasSerde for unrelated code', () => {\n const source = `\n export class RegularClass {\n constructor(value) {\n this.value = value;\n }\n }\n `;\n const result = detectWorkflowPatterns(source);\n expect(result.hasSerde).toBe(false);\n });\n\n it('should detect both directive and serde patterns', () => {\n const source = `\n 'use step';\n import { WORKFLOW_SERIALIZE } from '@workflow/serde';\n \n export class Point {\n static [WORKFLOW_SERIALIZE](instance) {\n return { x: instance.x };\n }\n }\n `;\n const result = detectWorkflowPatterns(source);\n expect(result.hasDirective).toBe(true);\n expect(result.hasUseStep).toBe(true);\n expect(result.hasSerde).toBe(true);\n });\n\n it('regexp detection matches directives inside template literals (false positive)', () => {\n // detectWorkflowPatterns uses regexp and will match directive-like\n // strings inside template literals. The discover-entries plugin\n // handles this by using the SWC plugin manifest (AST-level) for\n // directive discovery instead of relying on regexp alone.\n const source = `'use client';\nconst CODE_SNIPPET = \\`import { sleep } from \"workflow\";\n\nexport async function handleUserSignup(email: string) {\n \"use workflow\";\n const user = await createUser(email);\n}\n\\`;\nexport default function Page() { return null; }\n`;\n const result = detectWorkflowPatterns(source);\n expect(result.hasUseWorkflow).toBe(true);\n expect(result.hasDirective).toBe(true);\n });\n });\n\n describe('shouldTransformFile', () => {\n const noPatterns = {\n hasUseWorkflow: false,\n hasUseStep: false,\n hasSerdeImport: false,\n hasSerdeSymbol: false,\n hasDirective: false,\n hasSerde: false,\n };\n\n it('excludes generated workflow route files even with directives', () => {\n expect(\n shouldTransformFile('/app/.well-known/workflow/v1/route.ts', {\n ...noPatterns,\n hasUseWorkflow: true,\n hasDirective: true,\n })\n ).toBe(false);\n });\n\n it('transforms files with directive patterns', () => {\n expect(\n shouldTransformFile('/app/workflows/my-workflow.ts', {\n ...noPatterns,\n hasUseWorkflow: true,\n hasDirective: true,\n })\n ).toBe(true);\n });\n\n it('transforms files with serde patterns', () => {\n expect(\n shouldTransformFile('/app/lib/my-class.ts', {\n ...noPatterns,\n hasSerdeImport: true,\n hasSerde: true,\n })\n ).toBe(true);\n });\n\n it('transforms SDK files with serde patterns (no longer excluded)', () => {\n expect(\n shouldTransformFile(\n '/app/node_modules/@workflow/core/dist/serialization.js',\n { ...noPatterns, hasSerdeSymbol: true, hasSerde: true }\n )\n ).toBe(true);\n });\n\n it('does not transform files without directives or serde patterns', () => {\n expect(shouldTransformFile('/app/lib/utils.ts', noPatterns)).toBe(false);\n });\n });\n});\n"]}
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,YAAY;IACZ,yBAAyB;IACzB,MAAM;IACN,MAAM;IACN,WAAW;IACX,OAAO;CACC,CAAC;AA+JX,MAAM,UAAU,kBAAkB,CAChC,MAA0B;IAE1B,OAAO,CAAC,CAAC,MAAM,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAqB,CAAC,CAAC;AACvE,CAAC","sourcesContent":["export const validBuildTargets = [\n 'standalone',\n 'vercel-build-output-api',\n 'next',\n 'nest',\n 'sveltekit',\n 'astro',\n] as const;\nexport type BuildTarget = (typeof validBuildTargets)[number];\n\n/**\n * Source map emission mode for generated workflow bundles. Matches esbuild's\n * `sourcemap` option vocabulary:\n *\n * - `true` / `'linked'`: write a separate `.map` file and add a `sourceMappingURL` comment\n * - `'inline'`: emit a base64-encoded source map at the end of the bundle\n * - `'external'`: write a separate `.map` file without the comment\n * - `'both'`: emit both inline and external source maps\n * - `false`: omit source maps entirely\n */\nexport type SourcemapMode = boolean | 'inline' | 'linked' | 'external' | 'both';\n\n/**\n * Common configuration options shared across all builder types.\n */\ninterface BaseWorkflowConfig {\n watch?: boolean;\n dirs: string[];\n workingDir: string;\n /**\n * Project root used for package and workspace module-specifier resolution\n * during SWC transforms. Defaults to `workingDir`.\n */\n projectRoot?: string;\n\n // Optionally generate a client library for workflow execution. The preferred\n // method of using workflow is to use a loader within a framework (like\n // NextJS) that resolves client bindings on the fly.\n clientBundlePath?: string;\n\n externalPackages?: string[];\n\n workflowManifestPath?: string;\n\n // Optional prefix for debug files (e.g., \"_\" for Astro to ignore them)\n debugFilePrefix?: string;\n\n // Optional directory where diagnostics artifacts should be written.\n // The workflow manifest is written to workflows-manifest.json inside this dir.\n diagnosticsDir?: string;\n\n // Optional framework output directory, used by builders that mirror framework\n // artifact locations.\n distDir?: string;\n\n // Suppress informational logs emitted by createWorkflowsBundle()\n // (e.g. intermediate/final workflow bundle timing logs).\n suppressCreateWorkflowsBundleLogs?: boolean;\n\n // Suppress esbuild warnings emitted by createWorkflowsBundle().\n suppressCreateWorkflowsBundleWarnings?: boolean;\n\n // Suppress informational logs emitted by createWebhookBundle().\n suppressCreateWebhookBundleLogs?: boolean;\n\n // Suppress informational logs emitted by createManifest().\n suppressCreateManifestLogs?: boolean;\n\n // Node.js runtime version for Vercel Functions (e.g., \"nodejs22.x\", \"nodejs24.x\")\n runtime?: string;\n\n /**\n * Controls how source maps are emitted for workflow bundles. Accepts the\n * same values as esbuild's `sourcemap` option.\n *\n * Default is `'inline'` for the step bundle and intermediate workflow\n * bundle (gives readable stack traces for step errors and workflow VM\n * errors). Setting `false` omits source maps entirely, which produces\n * smaller bundles — useful for staying under the Vercel 250MB function\n * limit — at the cost of stack traces that reference generated code.\n *\n * `'external'` and `'linked'` write a separate `.map` file; use these\n * when you want to ship source maps to observability tooling but keep\n * them out of the function bundle.\n *\n * Can also be set via the `WORKFLOW_SOURCEMAP` environment variable;\n * config wins over env var, env var wins over the default.\n */\n sourcemap?: SourcemapMode;\n}\n\n/**\n * Configuration for standalone (CLI-based) builds.\n */\nexport interface StandaloneConfig extends BaseWorkflowConfig {\n buildTarget: 'standalone';\n stepsBundlePath: string;\n workflowsBundlePath: string;\n webhookBundlePath: string;\n}\n\n/**\n * Configuration for Vercel Build Output API builds.\n */\nexport interface VercelBuildOutputConfig extends BaseWorkflowConfig {\n buildTarget: 'vercel-build-output-api';\n stepsBundlePath: string;\n workflowsBundlePath: string;\n webhookBundlePath: string;\n}\n\n/**\n * Configuration for Next.js builds.\n */\nexport interface NextConfig extends BaseWorkflowConfig {\n buildTarget: 'next';\n // Next.js builder computes paths dynamically, so these are not used\n stepsBundlePath: string;\n workflowsBundlePath: string;\n webhookBundlePath: string;\n}\n\n/**\n * Configuration for SvelteKit builds.\n */\nexport interface SvelteKitConfig extends BaseWorkflowConfig {\n buildTarget: 'sveltekit';\n // SvelteKit builder computes paths dynamically, so these are not used\n stepsBundlePath: string;\n workflowsBundlePath: string;\n webhookBundlePath: string;\n}\n\n/**\n * Configuration for Astro builds.\n */\nexport interface AstroConfig extends BaseWorkflowConfig {\n buildTarget: 'astro';\n // Astro builder computes paths dynamically, so these are not used\n stepsBundlePath: string;\n workflowsBundlePath: string;\n webhookBundlePath: string;\n}\n\n/**\n * Configuration for NestJS builds.\n */\nexport interface NestConfig extends BaseWorkflowConfig {\n buildTarget: 'nest';\n // NestJS builder computes paths dynamically, so these are not used\n stepsBundlePath: string;\n workflowsBundlePath: string;\n webhookBundlePath: string;\n}\n\n/**\n * Discriminated union of all builder configuration types.\n */\nexport type WorkflowConfig =\n | StandaloneConfig\n | VercelBuildOutputConfig\n | NextConfig\n | NestConfig\n | SvelteKitConfig\n | AstroConfig;\n\nexport function isValidBuildTarget(\n target: string | undefined\n): target is BuildTarget {\n return !!target && validBuildTargets.includes(target as BuildTarget);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"vercel-build-output-api.js","sourceRoot":"","sources":["../src/vercel-build-output-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,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,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;QAE1E,sDAAsD;QACtD,MAAM,IAAI,CAAC,mBAAmB,CAAC;YAC7B,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC;YAC1C,MAAM,EAAE,oDAAoD;SAC7D,CAAC,CAAC;QAEH,+DAA+D;QAC/D,MAAM,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACvD,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;YACxC,OAAO,EAAE,WAAW;YACpB,gBAAgB,EAAE,KAAK;YACvB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;SAC7B,CAAC,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,uBAAuB,CAAC,SAAiB;QACrD,0CAA0C;QAC1C,MAAM,iBAAiB,GAAG;YACxB,OAAO,EAAE,CAAC;YACV,MAAM,EAAE;gBACN;oBACE,GAAG,EAAE,0DAA0D;oBAC/D,IAAI,EAAE,0CAA0C;iBACjD;aACF;SACF,CAAC;QAEF,MAAM,SAAS,CACb,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,EAC9B,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAC3C,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,+BAA+B,SAAS,EAAE,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,8DAA8D,CAAC,CAAC;QAC5E,OAAO,CAAC,GAAG,CACT,wEAAwE,CACzE,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { copyFile, mkdir, writeFile } from 'node:fs/promises';\nimport { join, resolve } from 'node:path';\nimport { BaseBuilder } from './base-builder.js';\nimport { WORKFLOW_QUEUE_TRIGGER } from './constants.js';\n\nexport class VercelBuildOutputAPIBuilder extends BaseBuilder {\n async build(): Promise<void> {\n const outputDir = resolve(this.config.workingDir, '.vercel/output');\n const functionsDir = join(outputDir, 'functions');\n const workflowGeneratedDir = join(functionsDir, '.well-known/workflow/v1');\n\n // Ensure output directories exist\n await mkdir(workflowGeneratedDir, { recursive: true });\n\n const inputFiles = await this.getInputFiles();\n const tsconfigPath = await this.findTsConfigPath();\n // Create combined bundle in flow.func/\n console.log('Creating Vercel Build Output API combined function');\n const workflowsFuncDir = join(workflowGeneratedDir, 'flow.func');\n await mkdir(workflowsFuncDir, { recursive: true });\n\n const { manifest } = await this.createCombinedBundle({\n inputFiles,\n stepsOutfile: join(workflowsFuncDir, '__step_registrations.mjs'),\n flowOutfile: join(workflowsFuncDir, 'index.mjs'),\n tsconfigPath,\n bundleFinalOutput: true,\n });\n\n // Create package.json and .vc-config.json for combined function\n await this.createPackageJson(workflowsFuncDir, 'module');\n await this.createVcConfig(workflowsFuncDir, {\n handler: 'index.mjs',\n // Skip the source-map-support runtime shim when sourcemaps are\n // disabled — it's a meaningful chunk of the function bundle and\n // serves no purpose without maps.\n shouldAddSourcemapSupport: this.sourcemapsEnabled,\n maxDuration: 'max',\n experimentalTriggers: [WORKFLOW_QUEUE_TRIGGER],\n runtime: this.config.runtime,\n });\n\n await this.buildWebhookFunction({ workflowGeneratedDir });\n await this.createBuildOutputConfig(outputDir);\n\n // Generate unified manifest\n const workflowBundlePath = join(\n workflowGeneratedDir,\n 'flow.func/index.mjs'\n );\n const manifestJson = await this.createManifest({\n workflowBundlePath,\n manifestDir: workflowGeneratedDir,\n manifest,\n });\n\n // Expose manifest as a static file when WORKFLOW_PUBLIC_MANIFEST=1.\n // Vercel Build Output API serves static files from .vercel/output/static/\n if (this.shouldExposePublicManifest && manifestJson) {\n const staticManifestDir = join(\n outputDir,\n 'static/.well-known/workflow/v1'\n );\n await mkdir(staticManifestDir, { recursive: true });\n await copyFile(\n join(workflowGeneratedDir, 'manifest.json'),\n join(staticManifestDir, 'manifest.json')\n );\n }\n\n await this.createClientLibrary();\n }\n\n private async buildWebhookFunction({\n workflowGeneratedDir,\n bundle = true,\n }: {\n workflowGeneratedDir: string;\n bundle?: boolean;\n }): Promise<void> {\n console.log('Creating Vercel Build Output API webhook function');\n const webhookFuncDir = join(workflowGeneratedDir, 'webhook/[token].func');\n\n // Bundle the webhook route with dependencies resolved\n await this.createWebhookBundle({\n outfile: join(webhookFuncDir, 'index.mjs'),\n bundle, // Build Output API needs bundling (except in tests)\n });\n\n // Create package.json and .vc-config.json for webhook function\n await this.createPackageJson(webhookFuncDir, 'module');\n await this.createVcConfig(webhookFuncDir, {\n handler: 'index.mjs',\n shouldAddHelpers: false,\n runtime: this.config.runtime,\n });\n }\n\n private async createBuildOutputConfig(outputDir: string): Promise<void> {\n // Create config.json for Build Output API\n const buildOutputConfig = {\n version: 3,\n routes: [\n {\n src: '^\\\\/\\\\.well-known\\\\/workflow\\\\/v1\\\\/webhook\\\\/([^\\\\/]+)$',\n dest: '/.well-known/workflow/v1/webhook/[token]',\n },\n ],\n };\n\n await writeFile(\n join(outputDir, 'config.json'),\n JSON.stringify(buildOutputConfig, null, 2)\n );\n\n console.log(`Build Output API created at ${outputDir}`);\n console.log('Combined function available at /.well-known/workflow/v1/flow');\n console.log(\n 'Webhook function available at /.well-known/workflow/v1/webhook/[token]'\n );\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-alias.js","sourceRoot":"","sources":["../src/workflow-alias.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,4BAA4B,GAAG,IAAI,GAAG,EAGzC,CAAC;AAEJ,MAAM,oBAAoB,GAAG;IAC3B,eAAe;IACf,WAAW;IACX,SAAS;IACT,KAAK;IACL,WAAW;IACX,OAAO;CACC,CAAC;AAEX,SAAS,8BAA8B,CACrC,sBAA8B;IAE9B,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,SAAS,IAAI,oBAAoB,E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C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,KAAK,MAAM,iBAAiB,IAAI,eAAe,EAAE,CAAC;YAChD,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;YAC7D,IAAI,CAAC;gBACH,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;YACD,MAAM,qBAAqB,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,CAAC,KAAK,CAC/D,GAAG,EAAE,CAAC,SAAS,CAChB,CAAC;YACF,IAAI,CAAC,qBAAqB,EAAE,CAAC;gBAC3B,SAAS;YACX,CAAC;YACD,IACE,qBAAqB,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,0BAA0B,EACxE,CAAC;gBACD,OAAO,iBAAiB,CAAC;YAC3B,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,EAAE,CAAC;IAEL,4BAA4B,CAAC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;IAC9D,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["import { access, realpath } from 'node:fs/promises';\nimport { resolve } from 'node:path';\n\nconst workflowAliasResolutionCache = new Map<\n string,\n Promise<string | undefined>\n>();\n\nconst WORKFLOW_ALIAS_ROOTS = [\n 'src/workflows',\n 'workflows',\n 'src/app',\n 'app',\n 'src/pages',\n 'pages',\n] as const;\n\nfunction getAliasRelativePathCandidates(\n normalizedAbsolutePath: string\n): string[] {\n const candidates = new Set<string>();\n for (const aliasRoot of WORKFLOW_ALIAS_ROOTS) {\n const marker = `/${aliasRoot}/`;\n const markerIndex = normalizedAbsolutePath.lastIndexOf(marker);\n if (markerIndex === -1) {\n continue;\n }\n candidates.add(normalizedAbsolutePath.slice(markerIndex + 1));\n }\n return Array.from(candidates);\n}\n\nexport function clearWorkflowAliasResolutionCache(): void {\n workflowAliasResolutionCache.clear();\n}\n\nexport async function resolveWorkflowAliasRelativePath(\n absoluteFilePath: string,\n workingDir: string\n): Promise<string | undefined> {\n const normalizedAbsolutePath = absoluteFilePath.replace(/\\\\/g, '/');\n\n const cacheKey = `${workingDir}::${normalizedAbsolutePath}`;\n const cached = workflowAliasResolutionCache.get(cacheKey);\n if (cached) {\n return cached;\n }\n\n const resolutionPromise = (async () => {\n const resolvedFilePath = await realpath(absoluteFilePath).catch(\n () => undefined\n );\n if (!resolvedFilePath) {\n return undefined;\n }\n const normalizedResolvedFilePath = resolvedFilePath.replace(/\\\\/g, '/');\n const aliasCandidates = getAliasRelativePathCandidates(\n normalizedAbsolutePath\n );\n if (aliasCandidates.length === 0) {\n return undefined;\n }\n\n for (const aliasRelativePath of aliasCandidates) {\n const candidatePath = resolve(workingDir, aliasRelativePath);\n try {\n await access(candidatePath);\n } catch {\n continue;\n }\n const resolvedCandidatePath = await realpath(candidatePath).catch(\n () => undefined\n );\n if (!resolvedCandidatePath) {\n continue;\n }\n if (\n resolvedCandidatePath.replace(/\\\\/g, '/') === normalizedResolvedFilePath\n ) {\n return aliasRelativePath;\n }\n }\n return undefined;\n })();\n\n workflowAliasResolutionCache.set(cacheKey, resolutionPromise);\n return resolutionPromise;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-alias.test.js","sourceRoot":"","sources":["../src/workflow-alias.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,MAAM,EACN,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GACjC,MAA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,cAAc,EACd,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,EACvB,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAClD,CAAC;QAEF,MAAM,MAAM,CACV,gCAAgC,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAC/D,CAAC,QAAQ,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import {\n mkdtempSync,\n mkdirSync,\n rmSync,\n symlinkSync,\n writeFileSync,\n} from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { dirname, join } from 'node:path';\nimport { afterEach, beforeEach, describe, expect, it } from 'vitest';\nimport {\n clearWorkflowAliasResolutionCache,\n resolveWorkflowAliasRelativePath,\n} from './workflow-alias.js';\n\nfunction writeFile(path: string): void {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, \"'use workflow';\\n\", 'utf-8');\n}\n\ndescribe('resolveWorkflowAliasRelativePath', () => {\n let testRoot: string;\n let workingDir: string;\n\n beforeEach(() => {\n clearWorkflowAliasResolutionCache();\n testRoot = mkdtempSync(join(tmpdir(), 'workflow-alias-'));\n workingDir = join(testRoot, 'project');\n mkdirSync(workingDir, { recursive: true });\n });\n\n afterEach(() => {\n clearWorkflowAliasResolutionCache();\n rmSync(testRoot, { recursive: true, force: true });\n });\n\n it('maps files in workflows/ to workflows/* aliases', async () => {\n const filePath = join(workingDir, 'workflows', 'foo.ts');\n writeFile(filePath);\n\n await expect(\n resolveWorkflowAliasRelativePath(filePath, workingDir)\n ).resolves.toBe('workflows/foo.ts');\n });\n\n it('maps files in src/workflows/ to src/workflows/* aliases', async () => {\n const filePath = join(workingDir, 'src', 'workflows', 'foo.ts');\n writeFile(filePath);\n\n await expect(\n resolveWorkflowAliasRelativePath(filePath, workingDir)\n ).resolves.toBe('src/workflows/foo.ts');\n });\n\n it('returns undefined for files that are not under workflows paths', async () => {\n const filePath = join(workingDir, 'lib', 'foo.ts');\n writeFile(filePath);\n\n await expect(\n resolveWorkflowAliasRelativePath(filePath, workingDir)\n ).resolves.toBeUndefined();\n });\n\n it('returns undefined when basename matches but realpath differs', async () => {\n const workflowFilePath = join(workingDir, 'workflows', 'foo.ts');\n const externalFilePath = join(testRoot, 'external', 'workflows', 'foo.ts');\n writeFile(workflowFilePath);\n writeFile(externalFilePath);\n\n await expect(\n resolveWorkflowAliasRelativePath(externalFilePath, workingDir)\n ).resolves.toBeUndefined();\n });\n\n it('maps symlinked app files to app/* aliases', async () => {\n const externalAppDir = join(testRoot, 'external', 'app');\n const externalFilePath = join(\n externalAppDir,\n '.well-known',\n 'agent',\n 'v1',\n 'steps.ts'\n );\n writeFile(externalFilePath);\n\n symlinkSync(\n externalAppDir,\n join(workingDir, 'app'),\n process.platform === 'win32' ? 'junction' : 'dir'\n );\n\n await expect(\n resolveWorkflowAliasRelativePath(externalFilePath, workingDir)\n ).resolves.toBe('app/.well-known/agent/v1/steps.ts');\n });\n});\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflows-extractor.js","sourceRoot":"","sources":["../src/workflows-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAc5C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,SAAS,mBAAmB,CAAC,MAAc,EAAE,YAAoB;IAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,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C9C,WAAW,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AACrD,CAAC","sourcesContent":["import { readFile } from 'node:fs/promises';\nimport type {\n ArrowFunctionExpression,\n BlockStatement,\n CallExpression,\n Expression,\n FunctionDeclaration,\n FunctionExpression,\n Identifier,\n MemberExpression,\n Program,\n Statement,\n VariableDeclaration,\n} from '@swc/core';\nimport { parseSync } from '@swc/core';\n\n// ============================================================================\n// Constants\n// ============================================================================\n\n/**\n * Workflow primitives that should be shown as nodes in the graph.\n * These are built-in workflow functions that represent meaningful\n * pauses or wait points in the workflow execution.\n */\nconst WORKFLOW_PRIMITIVES = new Set(['sleep', 'createHook', 'createWebhook']);\n\n/**\n * Extract the original function name from a stepId.\n * stepId format: \"step//path/to/file.ts//functionName\"\n * The bundler may rename functions to avoid collisions (e.g. add -> add2),\n * but the stepId contains the original TypeScript function name.\n */\nfunction getOriginalStepName(stepId: string, fallbackName: string): string {\n const parts = stepId.split('//');\n return parts.length > 2 ? parts[2] : fallbackName;\n}\n\n/**\n * Extract a readable condition text from an Expression AST node.\n * Recursively builds a string representation of the condition.\n */\nfunction getConditionText(expr: Expression): string {\n switch (expr.type) {\n case 'Identifier':\n return (expr as Identifier).value;\n\n case 'BooleanLiteral':\n return String((expr as any).value);\n\n case 'NumericLiteral':\n return String((expr as any).value);\n\n case 'StringLiteral':\n return `\"${(expr as any).value}\"`;\n\n case 'BinaryExpression': {\n const bin = expr as any;\n const left = getConditionText(bin.left);\n const right = getConditionText(bin.right);\n return `${left} ${bin.operator} ${right}`;\n }\n\n case 'UnaryExpression': {\n const unary = expr as any;\n const arg = getConditionText(unary.argument);\n return `${unary.operator}${arg}`;\n }\n\n case 'MemberExpression': {\n const member = expr as MemberExpression;\n const obj = getConditionText(member.object);\n if (member.property.type === 'Identifier') {\n return `${obj}.${(member.property as Identifier).value}`;\n }\n if (member.property.type === 'Computed') {\n const computed = (member.property as any).expression;\n return `${obj}[${getConditionText(computed)}]`;\n }\n return obj;\n }\n\n case 'CallExpression': {\n const call = expr as CallExpression;\n const callee = call.callee;\n // Handle callee which could be Expression, Super, or Import\n if (callee.type === 'Super' || callee.type === 'Import') {\n return `${callee.type.toLowerCase()}()`;\n }\n return `${getConditionText(callee as Expression)}()`;\n }\n\n case 'ParenthesisExpression': {\n const paren = expr as any;\n return `(${getConditionText(paren.expression)})`;\n }\n\n default:\n return 'condition';\n }\n}\n\n// ============================================================================\n// Internal Types (used during extraction only)\n// ============================================================================\n\ninterface FunctionInfo {\n name: string;\n body: BlockStatement | Expression | null | undefined;\n isStep: boolean;\n stepId?: string;\n}\n\ninterface AnalysisContext {\n parallelCounter: number;\n loopCounter: number;\n conditionalCounter: number;\n nodeCounter: number;\n inLoop: string | null;\n inConditional: string | null;\n /** Tracks variables assigned from createWebhook() or createHook() */\n webhookVariables: Set<string>;\n /** Tracks array variables that have step calls pushed into them (for Promise.all pattern) */\n promiseArrays: Map<string, ManifestNode[]>; // arrayName -> list of nodes\n}\n\ninterface AnalysisResult {\n nodes: ManifestNode[];\n edges: ManifestEdge[];\n entryNodeIds: string[];\n exitNodeIds: string[];\n}\n\n/**\n * Node metadata for control flow semantics\n */\nexport interface NodeMetadata {\n loopId?: string;\n loopIsAwait?: boolean;\n conditionalId?: string;\n conditionalBranch?: 'Then' | 'Else';\n parallelGroupId?: string;\n parallelMethod?: string;\n /** Step is passed as a reference (callback/tool) rather than directly called */\n isStepReference?: boolean;\n /** Context where the step reference was found (e.g., \"tools.getWeather.execute\") */\n referenceContext?: string;\n /** This node is a tool step connected to a DurableAgent */\n isTool?: boolean;\n /** The name of the tool (key in tools object) */\n toolName?: string;\n /** This node represents a collection of tools (imported variable) */\n isToolsCollection?: boolean;\n /** The variable name of the tools collection */\n toolsVariable?: string;\n}\n\n/**\n * Graph node for workflow visualization\n */\nexport interface ManifestNode {\n id: string;\n type: string;\n data: {\n label: string;\n nodeKind: string;\n stepId?: string;\n };\n metadata?: NodeMetadata;\n}\n\n/**\n * Graph edge for workflow control flow\n */\nexport interface ManifestEdge {\n id: string;\n source: string;\n target: string;\n type: 'default' | 'loop' | 'conditional' | 'parallel' | 'tool';\n label?: string;\n}\n\n/**\n * Graph data for a single workflow\n */\nexport interface WorkflowGraphData {\n nodes: ManifestNode[];\n edges: ManifestEdge[];\n}\n\n/**\n * Step entry in the manifest\n */\nexport interface ManifestStepEntry {\n stepId: string;\n}\n\n/**\n * Workflow entry in the manifest (includes graph data)\n */\nexport interface ManifestWorkflowEntry {\n workflowId: string;\n graph: WorkflowGraphData;\n}\n\n/**\n * Manifest structure - single source of truth for all workflow metadata\n */\nexport interface Manifest {\n version: string;\n steps: {\n [filePath: string]: {\n [stepName: string]: ManifestStepEntry;\n };\n };\n workflows: {\n [filePath: string]: {\n [workflowName: string]: ManifestWorkflowEntry;\n };\n };\n}\n\n// =============================================================================\n// Extraction Functions\n// =============================================================================\n\n/**\n * Extracts workflow graphs from a bundled workflow file.\n * Returns workflow entries organized by file path, ready for merging into Manifest.\n */\nexport async function extractWorkflowGraphs(bundlePath: string): Promise<{\n [filePath: string]: {\n [workflowName: string]: ManifestWorkflowEntry;\n };\n}> {\n const bundleCode = await readFile(bundlePath, 'utf-8');\n\n try {\n let actualWorkflowCode = bundleCode;\n\n const bundleAst = parseSync(bundleCode, {\n syntax: 'ecmascript',\n target: 'es2022',\n });\n\n const workflowCodeValue = extractWorkflowCodeFromBundle(bundleAst);\n if (workflowCodeValue) {\n actualWorkflowCode = workflowCodeValue;\n }\n\n const ast = parseSync(actualWorkflowCode, {\n syntax: 'ecmascript',\n target: 'es2022',\n });\n\n const stepDeclarations = extractStepDeclarations(actualWorkflowCode);\n const functionMap = buildFunctionMap(ast, stepDeclarations);\n const variableMap = buildVariableMap(ast);\n\n return extractWorkflows(ast, stepDeclarations, functionMap, variableMap);\n } catch (error) {\n console.error('Failed to extract workflow graphs from bundle:', error);\n return {};\n }\n}\n\n/**\n * Extract the workflowCode string value from a parsed bundle AST\n */\nfunction extractWorkflowCodeFromBundle(ast: Program): string | null {\n for (const item of ast.body) {\n if (item.type === 'VariableDeclaration') {\n for (const decl of item.declarations) {\n if (\n decl.id.type === 'Identifier' &&\n decl.id.value === 'workflowCode' &&\n decl.init\n ) {\n if (decl.init.type === 'TemplateLiteral') {\n return decl.init.quasis.map((q) => q.cooked || q.raw).join('');\n }\n if (decl.init.type === 'StringLiteral') {\n return decl.init.value;\n }\n }\n }\n }\n }\n return null;\n}\n\n/**\n * Extract step declarations using regex for speed\n */\nfunction extractStepDeclarations(\n bundleCode: string\n): Map<string, { stepId: string }> {\n const stepDeclarations = new Map<string, { stepId: string }>();\n\n const stepPattern =\n /var (\\w+) = globalThis\\[Symbol\\.for\\(\"WORKFLOW_USE_STEP\"\\)\\]\\(\"([^\"]+)\"\\)/g;\n\n const lines = bundleCode.split('\\n');\n for (const line of lines) {\n stepPattern.lastIndex = 0;\n const match = stepPattern.exec(line);\n if (match) {\n const [, varName, stepId] = match;\n stepDeclarations.set(varName, { stepId });\n }\n }\n\n return stepDeclarations;\n}\n\n/**\n * Extract inline step declarations from within a function body.\n * These are steps defined as variable declarations inside a workflow function.\n * Pattern: var/const varName = globalThis[Symbol.for(\"WORKFLOW_USE_STEP\")](\"stepId\")\n */\nfunction extractInlineStepDeclarations(\n stmts: Statement[]\n): Map<string, { stepId: string }> {\n const inlineSteps = new Map<string, { stepId: string }>();\n\n for (const stmt of stmts) {\n if (stmt.type === 'VariableDeclaration') {\n const varDecl = stmt as VariableDeclaration;\n for (const decl of varDecl.declarations) {\n if (\n decl.id.type === 'Identifier' &&\n decl.init?.type === 'CallExpression'\n ) {\n const callExpr = decl.init as CallExpression;\n // Check for globalThis[Symbol.for(\"WORKFLOW_USE_STEP\")](\"stepId\") pattern\n if (callExpr.callee.type === 'MemberExpression') {\n const member = callExpr.callee as MemberExpression;\n // Check if object is globalThis\n if (\n member.object.type === 'Identifier' &&\n (member.object as Identifier).value === 'globalThis' &&\n member.property.type === 'Computed'\n ) {\n // For computed member access globalThis[Symbol.for(...)],\n // the property is a Computed type containing the expression\n const computedExpr = (member.property as any).expression;\n if (computedExpr?.type === 'CallExpression') {\n const symbolCall = computedExpr as CallExpression;\n // Check if it's Symbol.for(\"WORKFLOW_USE_STEP\")\n if (symbolCall.callee.type === 'MemberExpression') {\n const symbolMember = symbolCall.callee as MemberExpression;\n if (\n symbolMember.object.type === 'Identifier' &&\n (symbolMember.object as Identifier).value === 'Symbol' &&\n symbolMember.property.type === 'Identifier' &&\n (symbolMember.property as Identifier).value === 'for' &&\n symbolCall.arguments.length > 0 &&\n symbolCall.arguments[0].expression.type ===\n 'StringLiteral' &&\n (symbolCall.arguments[0].expression as any).value ===\n 'WORKFLOW_USE_STEP'\n ) {\n // Extract the stepId from the outer call arguments\n if (\n callExpr.arguments.length > 0 &&\n callExpr.arguments[0].expression.type === 'StringLiteral'\n ) {\n const stepId = (callExpr.arguments[0].expression as any)\n .value;\n const varName = (decl.id as Identifier).value;\n inlineSteps.set(varName, { stepId });\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n\n return inlineSteps;\n}\n\n/**\n * Build a map of all functions in the bundle for transitive step resolution\n */\nfunction buildFunctionMap(\n ast: Program,\n stepDeclarations: Map<string, { stepId: string }>\n): Map<string, FunctionInfo> {\n const functionMap = new Map<string, FunctionInfo>();\n\n for (const item of ast.body) {\n if (item.type === 'FunctionDeclaration') {\n const func = item as FunctionDeclaration;\n if (func.identifier) {\n const name = func.identifier.value;\n const isStep = stepDeclarations.has(name);\n functionMap.set(name, {\n name,\n body: func.body,\n isStep,\n stepId: isStep ? stepDeclarations.get(name)?.stepId : undefined,\n });\n }\n }\n\n if (item.type === 'VariableDeclaration') {\n const varDecl = item as VariableDeclaration;\n for (const decl of varDecl.declarations) {\n if (decl.id.type === 'Identifier' && decl.init) {\n const name = decl.id.value;\n const isStep = stepDeclarations.has(name);\n\n if (decl.init.type === 'FunctionExpression') {\n const funcExpr = decl.init as FunctionExpression;\n functionMap.set(name, {\n name,\n body: funcExpr.body,\n isStep,\n stepId: isStep ? stepDeclarations.get(name)?.stepId : undefined,\n });\n } else if (decl.init.type === 'ArrowFunctionExpression') {\n const arrowFunc = decl.init as ArrowFunctionExpression;\n functionMap.set(name, {\n name,\n body: arrowFunc.body,\n isStep,\n stepId: isStep ? stepDeclarations.get(name)?.stepId : undefined,\n });\n }\n }\n }\n }\n }\n\n return functionMap;\n}\n\n/**\n * Build a map of variable definitions (objects) for tool resolution\n * This allows us to resolve tools objects to the actual tools object\n */\nfunction buildVariableMap(ast: Program): Map<string, any> {\n const variableMap = new Map<string, any>();\n\n for (const item of ast.body) {\n if (item.type === 'VariableDeclaration') {\n const varDecl = item as VariableDeclaration;\n for (const decl of varDecl.declarations) {\n if (\n decl.type === 'VariableDeclarator' &&\n decl.id.type === 'Identifier' &&\n decl.init?.type === 'ObjectExpression'\n ) {\n variableMap.set(decl.id.value, decl.init);\n }\n }\n }\n }\n\n return variableMap;\n}\n\n/**\n * Extract workflows from AST\n */\nfunction extractWorkflows(\n ast: Program,\n stepDeclarations: Map<string, { stepId: string }>,\n functionMap: Map<string, FunctionInfo>,\n variableMap: Map<string, any>\n): {\n [filePath: string]: {\n [workflowName: string]: ManifestWorkflowEntry;\n };\n} {\n const result: {\n [filePath: string]: {\n [workflowName: string]: ManifestWorkflowEntry;\n };\n } = {};\n\n for (const item of ast.body) {\n if (item.type === 'FunctionDeclaration') {\n const func = item as FunctionDeclaration;\n if (!func.identifier) continue;\n\n const workflowName = func.identifier.value;\n const workflowId = findWorkflowId(ast, workflowName);\n if (!workflowId) continue;\n\n // Extract file path and actual workflow name from workflowId: \"workflow//path/to/file.ts//functionName\"\n // The bundler may rename functions to avoid collisions (e.g. addTenWorkflow -> addTenWorkflow2),\n // but the workflowId contains the original TypeScript function name.\n const parts = workflowId.split('//');\n const filePath = parts.length > 1 ? parts[1] : 'unknown';\n const actualWorkflowName = parts.length > 2 ? parts[2] : workflowName;\n\n const graph = analyzeWorkflowFunction(\n func,\n workflowName,\n stepDeclarations,\n functionMap,\n variableMap\n );\n\n if (!result[filePath]) {\n result[filePath] = {};\n }\n\n result[filePath][actualWorkflowName] = {\n workflowId,\n graph,\n };\n }\n }\n\n return result;\n}\n\n/**\n * Find workflowId assignment for a function\n */\nfunction findWorkflowId(ast: Program, functionName: string): string | null {\n for (const item of ast.body) {\n if (item.type === 'ExpressionStatement') {\n const expr = item.expression;\n if (expr.type === 'AssignmentExpression') {\n const left = expr.left;\n if (left.type === 'MemberExpression') {\n const obj = left.object;\n const prop = left.property;\n if (\n obj.type === 'Identifier' &&\n obj.value === functionName &&\n prop.type === 'Identifier' &&\n prop.value === 'workflowId'\n ) {\n const right = expr.right;\n if (right.type === 'StringLiteral') {\n return right.value;\n }\n }\n }\n }\n }\n }\n return null;\n}\n\n/**\n * Analyze a workflow function and build its graph\n */\nfunction analyzeWorkflowFunction(\n func: FunctionDeclaration,\n workflowName: string,\n stepDeclarations: Map<string, { stepId: string }>,\n functionMap: Map<string, FunctionInfo>,\n variableMap: Map<string, any>\n): WorkflowGraphData {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n\n // Add start node\n nodes.push({\n id: 'start',\n type: 'workflowStart',\n data: {\n label: `Start: ${workflowName}`,\n nodeKind: 'workflow_start',\n },\n });\n\n const context: AnalysisContext = {\n parallelCounter: 0,\n loopCounter: 0,\n conditionalCounter: 0,\n nodeCounter: 0,\n inLoop: null,\n inConditional: null,\n webhookVariables: new Set(),\n promiseArrays: new Map(),\n };\n\n let prevExitIds = ['start'];\n\n if (func.body?.stmts) {\n // Extract inline step declarations from the workflow body\n // These are steps defined as variables inside the workflow function\n const inlineSteps = extractInlineStepDeclarations(func.body.stmts);\n\n // Merge inline steps with global step declarations\n const mergedStepDeclarations = new Map(stepDeclarations);\n for (const [name, info] of inlineSteps) {\n mergedStepDeclarations.set(name, info);\n }\n\n for (const stmt of func.body.stmts) {\n const result = analyzeStatement(\n stmt,\n mergedStepDeclarations,\n context,\n functionMap,\n variableMap\n );\n\n nodes.push(...result.nodes);\n edges.push(...result.edges);\n\n for (const prevId of prevExitIds) {\n for (const entryId of result.entryNodeIds) {\n const edgeId = `e_${prevId}_${entryId}`;\n if (!edges.find((e) => e.id === edgeId)) {\n const targetNode = result.nodes.find((n) => n.id === entryId);\n // Only use 'parallel' type for parallel group connections\n // Sequential connections (including to/from loops) should be 'default'\n const edgeType = targetNode?.metadata?.parallelGroupId\n ? 'parallel'\n : 'default';\n edges.push({\n id: edgeId,\n source: prevId,\n target: entryId,\n type: edgeType,\n });\n }\n }\n }\n\n if (result.exitNodeIds.length > 0) {\n prevExitIds = result.exitNodeIds;\n }\n }\n }\n\n // Add end node\n nodes.push({\n id: 'end',\n type: 'workflowEnd',\n data: {\n label: 'Return',\n nodeKind: 'workflow_end',\n },\n });\n\n for (const prevId of prevExitIds) {\n edges.push({\n id: `e_${prevId}_end`,\n source: prevId,\n target: 'end',\n type: 'default',\n });\n }\n\n return { nodes, edges };\n}\n\n/**\n * Check if a statement or block contains await expressions (recursively)\n * Used to determine if a for/while loop is truly a looping execution pattern\n * vs just collecting promises for parallel execution\n */\nfunction containsAwaitExpression(node: any): boolean {\n if (!node) return false;\n\n // Direct await expression\n if (node.type === 'AwaitExpression') return true;\n\n // Check block statements\n if (node.type === 'BlockStatement' && node.stmts) {\n return node.stmts.some((stmt: any) => containsAwaitExpression(stmt));\n }\n\n // Check expression statements\n if (node.type === 'ExpressionStatement' && node.expression) {\n return containsAwaitExpression(node.expression);\n }\n\n // Check variable declarations\n if (node.type === 'VariableDeclaration' && node.declarations) {\n return node.declarations.some(\n (decl: any) => decl.init && containsAwaitExpression(decl.init)\n );\n }\n\n // Check if statements\n if (node.type === 'IfStatement') {\n return (\n containsAwaitExpression(node.consequent) ||\n containsAwaitExpression(node.alternate)\n );\n }\n\n // Check for statements\n if (\n node.type === 'ForStatement' ||\n node.type === 'WhileStatement' ||\n node.type === 'ForOfStatement' ||\n node.type === 'ForInStatement'\n ) {\n return containsAwaitExpression(node.body);\n }\n\n // Check assignment expressions (e.g., result = await doWork())\n if (node.type === 'AssignmentExpression') {\n return containsAwaitExpression(node.right);\n }\n\n // Check call expressions (for await in arguments)\n if (node.type === 'CallExpression') {\n if (node.arguments) {\n return node.arguments.some((arg: any) =>\n containsAwaitExpression(arg.expression || arg)\n );\n }\n }\n\n return false;\n}\n\n/**\n * Analyze a statement and extract step calls with proper CFG structure\n */\nfunction analyzeStatement(\n stmt: Statement,\n stepDeclarations: Map<string, { stepId: string }>,\n context: AnalysisContext,\n functionMap: Map<string, FunctionInfo>,\n variableMap: Map<string, any>\n): AnalysisResult {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n let entryNodeIds: string[] = [];\n let exitNodeIds: string[] = [];\n\n if (stmt.type === 'VariableDeclaration') {\n const varDecl = stmt as VariableDeclaration;\n for (const decl of varDecl.declarations) {\n if (decl.init) {\n // Track webhook/hook variable assignments: const webhook = createWebhook()\n if (\n decl.id.type === 'Identifier' &&\n decl.init.type === 'CallExpression' &&\n (decl.init as CallExpression).callee.type === 'Identifier'\n ) {\n const funcName = ((decl.init as CallExpression).callee as Identifier)\n .value;\n if (funcName === 'createWebhook' || funcName === 'createHook') {\n context.webhookVariables.add((decl.id as Identifier).value);\n }\n }\n\n // Track empty array assignments for Promise.all pattern: const promises = []\n if (\n decl.id.type === 'Identifier' &&\n decl.init.type === 'ArrayExpression'\n ) {\n const elements = (decl.init as any).elements;\n // Empty array: elements is undefined, null, or empty array\n if (!elements || elements.length === 0) {\n const varName = (decl.id as Identifier).value;\n context.promiseArrays.set(varName, []);\n }\n }\n\n const result = analyzeExpression(\n decl.init,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n nodes.push(...result.nodes);\n edges.push(...result.edges);\n if (entryNodeIds.length === 0) {\n entryNodeIds = result.entryNodeIds;\n } else {\n for (const prevId of exitNodeIds) {\n for (const entryId of result.entryNodeIds) {\n edges.push({\n id: `e_${prevId}_${entryId}`,\n source: prevId,\n target: entryId,\n type: 'default',\n });\n }\n }\n }\n exitNodeIds = result.exitNodeIds;\n }\n }\n }\n\n if (stmt.type === 'ExpressionStatement') {\n const result = analyzeExpression(\n stmt.expression,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n nodes.push(...result.nodes);\n edges.push(...result.edges);\n entryNodeIds = result.entryNodeIds;\n exitNodeIds = result.exitNodeIds;\n }\n\n if (stmt.type === 'IfStatement') {\n const savedConditional = context.inConditional;\n const conditionalId = `cond_${context.conditionalCounter++}`;\n context.inConditional = conditionalId;\n\n // Analyze the \"then\" branch first to check if it has any workflow-relevant nodes\n let thenResult: AnalysisResult;\n if (stmt.consequent.type === 'BlockStatement') {\n thenResult = analyzeBlock(\n stmt.consequent.stmts,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n } else {\n // Handle single-statement consequent (no braces)\n thenResult = analyzeStatement(\n stmt.consequent,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n }\n\n // Analyze the \"else\" branch if it exists\n let elseResult: AnalysisResult | null = null;\n if (stmt.alternate) {\n if (stmt.alternate.type === 'BlockStatement') {\n elseResult = analyzeBlock(\n stmt.alternate.stmts,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n } else {\n // Handle single-statement alternate (no braces) or else-if\n elseResult = analyzeStatement(\n stmt.alternate,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n }\n }\n\n // Only create conditional node if at least one branch has workflow-relevant nodes.\n // This avoids creating nodes for runtime assertions like `if (!ctx) { throw ... }`\n const thenHasNodes = thenResult.nodes.length > 0;\n const elseHasNodes = elseResult ? elseResult.nodes.length > 0 : false;\n\n if (thenHasNodes || elseHasNodes) {\n // Create the conditional decision node\n const conditionText = getConditionText(stmt.test);\n const condNodeId = `${conditionalId}_node`;\n const condMetadata: NodeMetadata = {};\n if (context.inLoop) {\n condMetadata.loopId = context.inLoop;\n }\n\n const condNode: ManifestNode = {\n id: condNodeId,\n type: 'conditional',\n data: {\n label: conditionText,\n nodeKind: 'conditional',\n },\n metadata:\n Object.keys(condMetadata).length > 0 ? condMetadata : undefined,\n };\n nodes.push(condNode);\n\n // The conditional node is the entry point\n entryNodeIds.push(condNodeId);\n\n for (const node of thenResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.conditionalId = conditionalId;\n node.metadata.conditionalBranch = 'Then';\n }\n\n nodes.push(...thenResult.nodes);\n edges.push(...thenResult.edges);\n\n // Create edge from conditional node to \"then\" branch with \"true\" label\n for (const thenEntryId of thenResult.entryNodeIds) {\n edges.push({\n id: `e_${condNodeId}_${thenEntryId}_true`,\n source: condNodeId,\n target: thenEntryId,\n type: 'conditional',\n label: 'true',\n });\n }\n exitNodeIds.push(...thenResult.exitNodeIds);\n\n if (elseResult) {\n for (const node of elseResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.conditionalId = conditionalId;\n node.metadata.conditionalBranch = 'Else';\n }\n\n nodes.push(...elseResult.nodes);\n edges.push(...elseResult.edges);\n\n // Create edge from conditional node to \"else\" branch with \"false\" label\n for (const elseEntryId of elseResult.entryNodeIds) {\n edges.push({\n id: `e_${condNodeId}_${elseEntryId}_false`,\n source: condNodeId,\n target: elseEntryId,\n type: 'conditional',\n label: 'false',\n });\n }\n exitNodeIds.push(...elseResult.exitNodeIds);\n }\n }\n // Note: When there's no else branch, we don't add the conditional node as an exit.\n // The then-branch exits are the only exits. This means the graph shows the \"true\" path;\n // the \"false\" case (when condition is false and there's no else) implicitly means\n // execution continues with no steps from this if statement.\n //\n // When both branches have no workflow-relevant nodes (e.g., runtime assertions like\n // `if (!ctx) { throw ... }`), we skip creating the conditional node entirely.\n\n context.inConditional = savedConditional;\n }\n\n if (stmt.type === 'WhileStatement' || stmt.type === 'ForStatement') {\n const body =\n stmt.type === 'WhileStatement' ? stmt.body : (stmt as any).body;\n\n // Only treat as a loop if the body contains await expressions\n // Otherwise it's likely a \"collect promises\" pattern (for parallel execution)\n const hasAwait = containsAwaitExpression(body);\n\n const loopId = hasAwait ? `loop_${context.loopCounter++}` : undefined;\n const savedLoop = context.inLoop;\n if (loopId) {\n context.inLoop = loopId;\n }\n\n if (body.type === 'BlockStatement') {\n const loopResult = analyzeBlock(\n body.stmts,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n\n // Only add loop metadata if this is truly a looping pattern\n if (loopId) {\n for (const node of loopResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.loopId = loopId;\n }\n }\n\n nodes.push(...loopResult.nodes);\n edges.push(...loopResult.edges);\n entryNodeIds = loopResult.entryNodeIds;\n exitNodeIds = loopResult.exitNodeIds;\n\n // Only create loop-back edges if this is truly a looping pattern\n if (loopId) {\n for (const exitId of loopResult.exitNodeIds) {\n for (const entryId of loopResult.entryNodeIds) {\n edges.push({\n id: `e_${exitId}_back_${entryId}`,\n source: exitId,\n target: entryId,\n type: 'loop',\n });\n }\n }\n }\n } else {\n // Handle single-statement body (no braces)\n const loopResult = analyzeStatement(\n body,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n\n // Only add loop metadata if this is truly a looping pattern\n if (loopId) {\n for (const node of loopResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.loopId = loopId;\n }\n }\n\n nodes.push(...loopResult.nodes);\n edges.push(...loopResult.edges);\n entryNodeIds = loopResult.entryNodeIds;\n exitNodeIds = loopResult.exitNodeIds;\n\n // Only create loop-back edges if this is truly a looping pattern\n if (loopId) {\n for (const exitId of loopResult.exitNodeIds) {\n for (const entryId of loopResult.entryNodeIds) {\n edges.push({\n id: `e_${exitId}_back_${entryId}`,\n source: exitId,\n target: entryId,\n type: 'loop',\n });\n }\n }\n }\n }\n\n context.inLoop = savedLoop;\n }\n\n if (stmt.type === 'ForOfStatement') {\n const loopId = `loop_${context.loopCounter++}`;\n const savedLoop = context.inLoop;\n context.inLoop = loopId;\n\n const isAwait = (stmt as any).isAwait || (stmt as any).await;\n const body = (stmt as any).body;\n\n if (body.type === 'BlockStatement') {\n const loopResult = analyzeBlock(\n body.stmts,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n\n for (const node of loopResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.loopId = loopId;\n node.metadata.loopIsAwait = isAwait;\n }\n\n nodes.push(...loopResult.nodes);\n edges.push(...loopResult.edges);\n entryNodeIds = loopResult.entryNodeIds;\n exitNodeIds = loopResult.exitNodeIds;\n\n for (const exitId of loopResult.exitNodeIds) {\n for (const entryId of loopResult.entryNodeIds) {\n edges.push({\n id: `e_${exitId}_back_${entryId}`,\n source: exitId,\n target: entryId,\n type: 'loop',\n });\n }\n }\n } else {\n // Handle single-statement body (no braces)\n const loopResult = analyzeStatement(\n body,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n\n for (const node of loopResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.loopId = loopId;\n node.metadata.loopIsAwait = isAwait;\n }\n\n nodes.push(...loopResult.nodes);\n edges.push(...loopResult.edges);\n entryNodeIds = loopResult.entryNodeIds;\n exitNodeIds = loopResult.exitNodeIds;\n\n for (const exitId of loopResult.exitNodeIds) {\n for (const entryId of loopResult.entryNodeIds) {\n edges.push({\n id: `e_${exitId}_back_${entryId}`,\n source: exitId,\n target: entryId,\n type: 'loop',\n });\n }\n }\n }\n\n context.inLoop = savedLoop;\n }\n\n // Handle plain BlockStatement (bare blocks like { ... })\n if (stmt.type === 'BlockStatement') {\n const blockResult = analyzeBlock(\n (stmt as BlockStatement).stmts,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n nodes.push(...blockResult.nodes);\n edges.push(...blockResult.edges);\n entryNodeIds = blockResult.entryNodeIds;\n exitNodeIds = blockResult.exitNodeIds;\n }\n\n if (stmt.type === 'ReturnStatement' && (stmt as any).argument) {\n const result = analyzeExpression(\n (stmt as any).argument,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n nodes.push(...result.nodes);\n edges.push(...result.edges);\n entryNodeIds = result.entryNodeIds;\n exitNodeIds = result.exitNodeIds;\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds };\n}\n\n/**\n * Analyze a block of statements with proper sequential chaining\n */\nfunction analyzeBlock(\n stmts: Statement[],\n stepDeclarations: Map<string, { stepId: string }>,\n context: AnalysisContext,\n functionMap: Map<string, FunctionInfo>,\n variableMap: Map<string, any>\n): AnalysisResult {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n let entryNodeIds: string[] = [];\n let currentExitIds: string[] = [];\n\n for (const stmt of stmts) {\n const result = analyzeStatement(\n stmt,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n\n if (result.nodes.length === 0) continue;\n\n nodes.push(...result.nodes);\n edges.push(...result.edges);\n\n if (entryNodeIds.length === 0 && result.entryNodeIds.length > 0) {\n entryNodeIds = result.entryNodeIds;\n }\n\n if (currentExitIds.length > 0 && result.entryNodeIds.length > 0) {\n for (const prevId of currentExitIds) {\n for (const entryId of result.entryNodeIds) {\n const targetNode = result.nodes.find((n) => n.id === entryId);\n const edgeType = targetNode?.metadata?.parallelGroupId\n ? 'parallel'\n : 'default';\n edges.push({\n id: `e_${prevId}_${entryId}`,\n source: prevId,\n target: entryId,\n type: edgeType,\n });\n }\n }\n }\n\n if (result.exitNodeIds.length > 0) {\n currentExitIds = result.exitNodeIds;\n }\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds: currentExitIds };\n}\n\n/**\n * Analyze an expression and extract step calls\n */\nfunction analyzeExpression(\n expr: Expression,\n stepDeclarations: Map<string, { stepId: string }>,\n context: AnalysisContext,\n functionMap: Map<string, FunctionInfo>,\n variableMap: Map<string, any>,\n visitedFunctions: Set<string> = new Set()\n): AnalysisResult {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n const entryNodeIds: string[] = [];\n const exitNodeIds: string[] = [];\n\n if (expr.type === 'AwaitExpression') {\n const awaitedExpr = expr.argument;\n if (awaitedExpr.type === 'CallExpression') {\n const callExpr = awaitedExpr as CallExpression;\n\n // Check for Promise.all/race/allSettled/any\n if (callExpr.callee.type === 'MemberExpression') {\n const member = callExpr.callee as MemberExpression;\n if (\n member.object.type === 'Identifier' &&\n (member.object as Identifier).value === 'Promise' &&\n member.property.type === 'Identifier'\n ) {\n const method = (member.property as Identifier).value;\n if (['all', 'race', 'allSettled', 'any'].includes(method)) {\n const parallelId = `parallel_${context.parallelCounter++}`;\n\n if (callExpr.arguments.length > 0) {\n const arg = callExpr.arguments[0].expression;\n if (arg.type === 'ArrayExpression') {\n for (const element of arg.elements) {\n if (element?.expression) {\n const elemResult = analyzeExpression(\n element.expression,\n stepDeclarations,\n context,\n functionMap,\n variableMap,\n visitedFunctions\n );\n\n for (const node of elemResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.parallelGroupId = parallelId;\n node.metadata.parallelMethod = method;\n if (context.inLoop) {\n node.metadata.loopId = context.inLoop;\n }\n }\n\n nodes.push(...elemResult.nodes);\n edges.push(...elemResult.edges);\n entryNodeIds.push(...elemResult.entryNodeIds);\n exitNodeIds.push(...elemResult.exitNodeIds);\n }\n }\n } else if (\n arg.type === 'Identifier' &&\n context.promiseArrays.has((arg as Identifier).value)\n ) {\n // Handle Promise.all(variableName) where variable was built via push()\n const arrayName = (arg as Identifier).value;\n const trackedNodes = context.promiseArrays.get(arrayName);\n // Apply parallelGroupId to all nodes that were pushed to this array\n if (trackedNodes && trackedNodes.length > 0) {\n for (const trackedNode of trackedNodes) {\n if (!trackedNode.metadata) trackedNode.metadata = {};\n trackedNode.metadata.parallelGroupId = parallelId;\n trackedNode.metadata.parallelMethod = method;\n if (context.inLoop) {\n trackedNode.metadata.loopId = context.inLoop;\n }\n // Return tracked node IDs for proper edge connections\n entryNodeIds.push(trackedNode.id);\n exitNodeIds.push(trackedNode.id);\n }\n }\n } else {\n // Handle non-array arguments like array.map(stepFn)\n const argResult = analyzeExpression(\n arg,\n stepDeclarations,\n context,\n functionMap,\n variableMap,\n visitedFunctions\n );\n\n for (const node of argResult.nodes) {\n if (!node.metadata) node.metadata = {};\n node.metadata.parallelGroupId = parallelId;\n node.metadata.parallelMethod = method;\n if (context.inLoop) {\n node.metadata.loopId = context.inLoop;\n }\n }\n\n nodes.push(...argResult.nodes);\n edges.push(...argResult.edges);\n entryNodeIds.push(...argResult.entryNodeIds);\n exitNodeIds.push(...argResult.exitNodeIds);\n }\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds };\n }\n }\n }\n\n // Regular call - check if it's a step, workflow primitive, or helper function\n if (callExpr.callee.type === 'Identifier') {\n const funcName = (callExpr.callee as Identifier).value;\n const stepInfo = stepDeclarations.get(funcName);\n\n if (stepInfo) {\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n\n if (context.inLoop) {\n metadata.loopId = context.inLoop;\n }\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n\n const node: ManifestNode = {\n id: nodeId,\n type: 'step',\n data: {\n label: getOriginalStepName(stepInfo.stepId, funcName),\n nodeKind: 'step',\n stepId: stepInfo.stepId,\n },\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n } else if (WORKFLOW_PRIMITIVES.has(funcName)) {\n // Handle workflow primitives like sleep\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n\n if (context.inLoop) {\n metadata.loopId = context.inLoop;\n }\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n\n const node: ManifestNode = {\n id: nodeId,\n type: 'primitive',\n data: {\n label: funcName,\n nodeKind: 'primitive',\n },\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n } else {\n const transitiveResult = analyzeTransitiveCall(\n funcName,\n stepDeclarations,\n context,\n functionMap,\n variableMap,\n visitedFunctions\n );\n nodes.push(...transitiveResult.nodes);\n edges.push(...transitiveResult.edges);\n entryNodeIds.push(...transitiveResult.entryNodeIds);\n exitNodeIds.push(...transitiveResult.exitNodeIds);\n }\n }\n\n // Also analyze the arguments of awaited calls for step references in objects\n for (const arg of callExpr.arguments) {\n if (arg.expression?.type === 'ObjectExpression') {\n const refResult = analyzeObjectForStepReferences(\n arg.expression,\n stepDeclarations,\n context,\n ''\n );\n nodes.push(...refResult.nodes);\n edges.push(...refResult.edges);\n entryNodeIds.push(...refResult.entryNodeIds);\n exitNodeIds.push(...refResult.exitNodeIds);\n }\n }\n }\n\n // Handle await on a webhook/hook variable: await webhook\n if (awaitedExpr.type === 'Identifier') {\n const varName = (awaitedExpr as Identifier).value;\n if (context.webhookVariables.has(varName)) {\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n\n if (context.inLoop) {\n metadata.loopId = context.inLoop;\n }\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n\n const node: ManifestNode = {\n id: nodeId,\n type: 'primitive',\n data: {\n label: 'awaitWebhook',\n nodeKind: 'primitive',\n },\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n }\n }\n }\n\n // Non-awaited call expression\n if (expr.type === 'CallExpression') {\n const callExpr = expr as CallExpression;\n if (callExpr.callee.type === 'Identifier') {\n const funcName = (callExpr.callee as Identifier).value;\n const stepInfo = stepDeclarations.get(funcName);\n\n if (stepInfo) {\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n\n if (context.inLoop) {\n metadata.loopId = context.inLoop;\n }\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n\n const node: ManifestNode = {\n id: nodeId,\n type: 'step',\n data: {\n label: getOriginalStepName(stepInfo.stepId, funcName),\n nodeKind: 'step',\n stepId: stepInfo.stepId,\n },\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n } else if (WORKFLOW_PRIMITIVES.has(funcName)) {\n // Handle non-awaited workflow primitives like createHook, createWebhook\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n\n if (context.inLoop) {\n metadata.loopId = context.inLoop;\n }\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n\n const node: ManifestNode = {\n id: nodeId,\n type: 'primitive',\n data: {\n label: funcName,\n nodeKind: 'primitive',\n },\n metadata: Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n } else {\n const transitiveResult = analyzeTransitiveCall(\n funcName,\n stepDeclarations,\n context,\n functionMap,\n variableMap,\n visitedFunctions\n );\n nodes.push(...transitiveResult.nodes);\n edges.push(...transitiveResult.edges);\n entryNodeIds.push(...transitiveResult.entryNodeIds);\n exitNodeIds.push(...transitiveResult.exitNodeIds);\n }\n }\n }\n\n // Check for step references in object literals\n if (expr.type === 'ObjectExpression') {\n const refResult = analyzeObjectForStepReferences(\n expr,\n stepDeclarations,\n context,\n ''\n );\n nodes.push(...refResult.nodes);\n edges.push(...refResult.edges);\n entryNodeIds.push(...refResult.entryNodeIds);\n exitNodeIds.push(...refResult.exitNodeIds);\n }\n\n // Check for step references and step calls in function call arguments\n // Skip for array methods (map, forEach, etc.) which have a specialized handler below\n if (expr.type === 'CallExpression') {\n const callExpr = expr as CallExpression;\n\n // Check if this is an array method call - if so, skip the generic handler\n // and let the specialized handler at the end of this function handle it\n const isArrayMethodCall =\n callExpr.callee.type === 'MemberExpression' &&\n (callExpr.callee as MemberExpression).property.type === 'Identifier' &&\n ['map', 'forEach', 'filter', 'find', 'some', 'every', 'flatMap'].includes(\n ((callExpr.callee as MemberExpression).property as Identifier).value\n );\n\n // Check if this is a .push() call on a tracked promise array\n // Pattern: promises.push(stepCall())\n let pushArrayName: string | null = null;\n if (\n callExpr.callee.type === 'MemberExpression' &&\n (callExpr.callee as MemberExpression).object.type === 'Identifier' &&\n (callExpr.callee as MemberExpression).property.type === 'Identifier' &&\n ((callExpr.callee as MemberExpression).property as Identifier).value ===\n 'push'\n ) {\n const objName = (\n (callExpr.callee as MemberExpression).object as Identifier\n ).value;\n if (context.promiseArrays.has(objName)) {\n pushArrayName = objName;\n }\n }\n\n for (const arg of callExpr.arguments) {\n if (arg.expression) {\n // For array method calls, skip step identifier detection here\n // since we have a specialized handler for those\n if (arg.expression.type === 'Identifier' && !isArrayMethodCall) {\n const argName = (arg.expression as Identifier).value;\n const stepInfo = stepDeclarations.get(argName);\n if (stepInfo) {\n const nodeId = `node_${context.nodeCounter++}`;\n const node: ManifestNode = {\n id: nodeId,\n type: 'step',\n data: {\n label: `${getOriginalStepName(stepInfo.stepId, argName)} (ref)`,\n nodeKind: 'step',\n stepId: stepInfo.stepId,\n },\n metadata: {\n isStepReference: true,\n referenceContext: 'function argument',\n },\n };\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n }\n }\n // Handle step calls passed as arguments (e.g., promises.push(stepCall()))\n // Note: Don't add loopId here - these are non-awaited calls being collected\n // for parallel execution (like Promise.all), not truly looping calls\n if (arg.expression.type === 'CallExpression') {\n const argCallExpr = arg.expression as CallExpression;\n if (argCallExpr.callee.type === 'Identifier') {\n const funcName = (argCallExpr.callee as Identifier).value;\n const stepInfo = stepDeclarations.get(funcName);\n if (stepInfo) {\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n // Don't add loopId - this is a non-awaited call, likely being\n // collected for parallel execution (Promise.all pattern)\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n const node: ManifestNode = {\n id: nodeId,\n type: 'step',\n data: {\n label: getOriginalStepName(stepInfo.stepId, funcName),\n nodeKind: 'step',\n stepId: stepInfo.stepId,\n },\n metadata:\n Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n // If this is being pushed to a tracked promise array, store the node\n // so we can apply parallelGroupId when Promise.all is reached\n if (pushArrayName) {\n const trackedNodes = context.promiseArrays.get(pushArrayName);\n if (trackedNodes) {\n trackedNodes.push(node);\n }\n }\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n }\n }\n }\n if (arg.expression.type === 'ObjectExpression') {\n const refResult = analyzeObjectForStepReferences(\n arg.expression,\n stepDeclarations,\n context,\n ''\n );\n nodes.push(...refResult.nodes);\n edges.push(...refResult.edges);\n entryNodeIds.push(...refResult.entryNodeIds);\n exitNodeIds.push(...refResult.exitNodeIds);\n }\n }\n }\n }\n\n // Check for step references in 'new' expressions\n if (expr.type === 'NewExpression') {\n const newExpr = expr as any;\n\n // Check if this is a DurableAgent instantiation\n const isDurableAgent =\n newExpr.callee?.type === 'Identifier' &&\n newExpr.callee?.value === 'DurableAgent';\n\n if (isDurableAgent && newExpr.arguments?.length > 0) {\n // Create a node for the DurableAgent itself\n const agentNodeId = `node_${context.nodeCounter++}`;\n const agentNode: ManifestNode = {\n id: agentNodeId,\n type: 'agent',\n data: {\n label: 'DurableAgent',\n nodeKind: 'agent',\n },\n metadata: {\n isStepReference: true,\n referenceContext: 'DurableAgent',\n },\n };\n nodes.push(agentNode);\n entryNodeIds.push(agentNodeId);\n\n // Look for tools in the constructor options\n const optionsArg = newExpr.arguments[0]?.expression;\n if (optionsArg?.type === 'ObjectExpression') {\n const toolsResult = analyzeDurableAgentTools(\n optionsArg,\n stepDeclarations,\n context,\n agentNodeId,\n variableMap\n );\n nodes.push(...toolsResult.nodes);\n edges.push(...toolsResult.edges);\n\n // If we found tools, they are the exit nodes\n if (toolsResult.exitNodeIds.length > 0) {\n exitNodeIds.push(...toolsResult.exitNodeIds);\n } else {\n exitNodeIds.push(agentNodeId);\n }\n } else {\n exitNodeIds.push(agentNodeId);\n }\n } else if (newExpr.arguments) {\n for (const arg of newExpr.arguments) {\n if (arg.expression?.type === 'ObjectExpression') {\n const refResult = analyzeObjectForStepReferences(\n arg.expression,\n stepDeclarations,\n context,\n ''\n );\n nodes.push(...refResult.nodes);\n edges.push(...refResult.edges);\n entryNodeIds.push(...refResult.entryNodeIds);\n exitNodeIds.push(...refResult.exitNodeIds);\n }\n }\n }\n }\n\n // Handle AssignmentExpression - analyze the right-hand side\n if (expr.type === 'AssignmentExpression') {\n const assignExpr = expr as any;\n if (assignExpr.right) {\n const rightResult = analyzeExpression(\n assignExpr.right,\n stepDeclarations,\n context,\n functionMap,\n variableMap,\n visitedFunctions\n );\n nodes.push(...rightResult.nodes);\n edges.push(...rightResult.edges);\n entryNodeIds.push(...rightResult.entryNodeIds);\n exitNodeIds.push(...rightResult.exitNodeIds);\n }\n }\n\n // Handle MemberExpression calls like array.map(stepFn) where step is passed as callback\n if (expr.type === 'CallExpression') {\n const callExpr = expr as CallExpression;\n if (callExpr.callee.type === 'MemberExpression') {\n const member = callExpr.callee as MemberExpression;\n // Check if this is a method call like .map(), .forEach(), .filter() etc.\n if (member.property.type === 'Identifier') {\n const methodName = (member.property as Identifier).value;\n if (\n [\n 'map',\n 'forEach',\n 'filter',\n 'find',\n 'some',\n 'every',\n 'flatMap',\n ].includes(methodName)\n ) {\n // Check if any argument is a step function reference\n for (const arg of callExpr.arguments) {\n if (arg.expression?.type === 'Identifier') {\n const argName = (arg.expression as Identifier).value;\n const stepInfo = stepDeclarations.get(argName);\n if (stepInfo) {\n const nodeId = `node_${context.nodeCounter++}`;\n const metadata: NodeMetadata = {};\n if (context.inLoop) {\n metadata.loopId = context.inLoop;\n }\n if (context.inConditional) {\n metadata.conditionalId = context.inConditional;\n }\n const node: ManifestNode = {\n id: nodeId,\n type: 'step',\n data: {\n label: getOriginalStepName(stepInfo.stepId, argName),\n nodeKind: 'step',\n stepId: stepInfo.stepId,\n },\n metadata:\n Object.keys(metadata).length > 0 ? metadata : undefined,\n };\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n }\n }\n }\n }\n }\n }\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds };\n}\n\n/**\n * Analyze DurableAgent tools property to extract tool nodes\n */\nfunction analyzeDurableAgentTools(\n optionsObj: any,\n stepDeclarations: Map<string, { stepId: string }>,\n context: AnalysisContext,\n agentNodeId: string,\n variableMap: Map<string, any>\n): AnalysisResult {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n const entryNodeIds: string[] = [];\n const exitNodeIds: string[] = [];\n\n if (!optionsObj.properties)\n return { nodes, edges, entryNodeIds, exitNodeIds };\n\n // Helper function to extract tools from an ObjectExpression\n function extractToolsFromObject(toolsObj: any): void {\n for (const toolProp of toolsObj.properties || []) {\n if (toolProp.type !== 'KeyValueProperty') continue;\n\n let toolName = '';\n if (toolProp.key.type === 'Identifier') {\n toolName = toolProp.key.value;\n }\n\n if (!toolName) continue;\n\n // Look for execute property in the tool definition\n if (toolProp.value.type === 'ObjectExpression') {\n for (const innerProp of toolProp.value.properties || []) {\n if (innerProp.type !== 'KeyValueProperty') continue;\n\n let innerKey = '';\n if (innerProp.key.type === 'Identifier') {\n innerKey = innerProp.key.value;\n }\n\n if (innerKey === 'execute' && innerProp.value.type === 'Identifier') {\n const stepName = innerProp.value.value;\n const stepInfo = stepDeclarations.get(stepName);\n\n const nodeId = `node_${context.nodeCounter++}`;\n const node: ManifestNode = {\n id: nodeId,\n type: 'tool',\n data: {\n label: stepName,\n nodeKind: 'tool',\n stepId: stepInfo?.stepId,\n },\n metadata: {\n isTool: true,\n toolName: toolName,\n referenceContext: `tools.${toolName}.execute`,\n },\n };\n nodes.push(node);\n exitNodeIds.push(nodeId);\n\n // Connect agent to this tool with tool edge type\n edges.push({\n id: `e_${agentNodeId}_${nodeId}`,\n source: agentNodeId,\n target: nodeId,\n type: 'tool',\n });\n }\n }\n }\n }\n }\n\n // Find the 'tools' property\n for (const prop of optionsObj.properties) {\n if (prop.type !== 'KeyValueProperty') continue;\n\n let keyName = '';\n if (prop.key.type === 'Identifier') {\n keyName = prop.key.value;\n }\n\n if (keyName !== 'tools') continue;\n\n // Handle inline tools object\n if (prop.value.type === 'ObjectExpression') {\n extractToolsFromObject(prop.value);\n }\n\n // Handle tools as a variable reference - resolve it from variableMap\n if (prop.value.type === 'Identifier') {\n const toolsVarName = prop.value.value;\n\n // Try to resolve the variable from the variableMap (bundled code)\n const resolvedToolsObj = variableMap.get(toolsVarName);\n\n if (resolvedToolsObj && resolvedToolsObj.type === 'ObjectExpression') {\n // Successfully resolved - extract individual tools\n extractToolsFromObject(resolvedToolsObj);\n } else {\n // Fallback: create a placeholder node if we can't resolve\n const nodeId = `node_${context.nodeCounter++}`;\n const node: ManifestNode = {\n id: nodeId,\n type: 'tool',\n data: {\n label: `${toolsVarName}`,\n nodeKind: 'tool',\n },\n metadata: {\n isToolsCollection: true,\n toolsVariable: toolsVarName,\n referenceContext: `tools:${toolsVarName}`,\n },\n };\n nodes.push(node);\n exitNodeIds.push(nodeId);\n\n // Connect agent to tools with tool edge type\n edges.push({\n id: `e_${agentNodeId}_${nodeId}`,\n source: agentNodeId,\n target: nodeId,\n type: 'tool',\n });\n }\n }\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds };\n}\n\n/**\n * Analyze an object expression for step references\n */\nfunction analyzeObjectForStepReferences(\n obj: any,\n stepDeclarations: Map<string, { stepId: string }>,\n context: AnalysisContext,\n path: string\n): AnalysisResult {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n const entryNodeIds: string[] = [];\n const exitNodeIds: string[] = [];\n\n if (!obj.properties) return { nodes, edges, entryNodeIds, exitNodeIds };\n\n for (const prop of obj.properties) {\n if (prop.type !== 'KeyValueProperty') continue;\n\n let keyName = '';\n if (prop.key.type === 'Identifier') {\n keyName = prop.key.value;\n } else if (prop.key.type === 'StringLiteral') {\n keyName = prop.key.value;\n }\n\n const currentPath = path ? `${path}.${keyName}` : keyName;\n\n if (prop.value.type === 'Identifier') {\n const valueName = prop.value.value;\n const stepInfo = stepDeclarations.get(valueName);\n if (stepInfo) {\n const nodeId = `node_${context.nodeCounter++}`;\n const node: ManifestNode = {\n id: nodeId,\n type: 'step',\n data: {\n label: `${getOriginalStepName(stepInfo.stepId, valueName)} (tool)`,\n nodeKind: 'step',\n stepId: stepInfo.stepId,\n },\n metadata: {\n isStepReference: true,\n referenceContext: currentPath,\n },\n };\n nodes.push(node);\n entryNodeIds.push(nodeId);\n exitNodeIds.push(nodeId);\n }\n }\n\n if (prop.value.type === 'ObjectExpression') {\n const nestedResult = analyzeObjectForStepReferences(\n prop.value,\n stepDeclarations,\n context,\n currentPath\n );\n nodes.push(...nestedResult.nodes);\n edges.push(...nestedResult.edges);\n entryNodeIds.push(...nestedResult.entryNodeIds);\n exitNodeIds.push(...nestedResult.exitNodeIds);\n }\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds };\n}\n\n/**\n * Analyze a transitive function call to find step calls within helper functions\n */\nfunction analyzeTransitiveCall(\n funcName: string,\n stepDeclarations: Map<string, { stepId: string }>,\n context: AnalysisContext,\n functionMap: Map<string, FunctionInfo>,\n variableMap: Map<string, any>,\n visitedFunctions: Set<string>\n): AnalysisResult {\n const nodes: ManifestNode[] = [];\n const edges: ManifestEdge[] = [];\n const entryNodeIds: string[] = [];\n const exitNodeIds: string[] = [];\n\n if (visitedFunctions.has(funcName)) {\n return { nodes, edges, entryNodeIds, exitNodeIds };\n }\n\n const funcInfo = functionMap.get(funcName);\n if (!funcInfo || funcInfo.isStep) {\n return { nodes, edges, entryNodeIds, exitNodeIds };\n }\n\n visitedFunctions.add(funcName);\n\n try {\n if (funcInfo.body) {\n if (funcInfo.body.type === 'BlockStatement') {\n const bodyResult = analyzeBlock(\n funcInfo.body.stmts,\n stepDeclarations,\n context,\n functionMap,\n variableMap\n );\n nodes.push(...bodyResult.nodes);\n edges.push(...bodyResult.edges);\n entryNodeIds.push(...bodyResult.entryNodeIds);\n exitNodeIds.push(...bodyResult.exitNodeIds);\n } else {\n const exprResult = analyzeExpression(\n funcInfo.body,\n stepDeclarations,\n context,\n functionMap,\n variableMap,\n visitedFunctions\n );\n nodes.push(...exprResult.nodes);\n edges.push(...exprResult.edges);\n entryNodeIds.push(...exprResult.entryNodeIds);\n exitNodeIds.push(...exprResult.exitNodeIds);\n }\n }\n } finally {\n visitedFunctions.delete(funcName);\n }\n\n return { nodes, edges, entryNodeIds, exitNodeIds };\n}\n"]}