@cifn/runner 0.0.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/steps/testfn-run.ts","../src/index.ts","../src/runner.ts","../src/executor/run-step.ts","../src/steps/checkout.ts","../src/steps/artifact-upload.ts","../src/steps/artifact-download.ts","../src/steps/cache-save.ts","../src/steps/cache-restore.ts","../src/steps/hostfn-deploy.ts","../src/reporting/redact.ts","../src/reporting/logfn-client.ts","../src/docker-executor.ts"],"sourcesContent":["import { TestRunner, JsonReporter, type TestFnConfig } from '@testfn/core';\nimport { join } from 'node:path';\nimport { existsSync } from 'node:fs';\n\nexport interface TestFnRunOptions {\n framework?: string;\n testPattern?: string;\n reporter?: string;\n outputPath?: string;\n workspace: string;\n env?: Record<string, string>;\n parallel?: number | 'auto';\n timeout?: number;\n retries?: number;\n}\n\nexport interface TestFnRunResult {\n success: boolean;\n exitCode: number;\n lines: string[];\n error?: string;\n}\n\nexport function executeTestFnRun(options: TestFnRunOptions): TestFnRunResult {\n const {\n framework = 'vitest',\n testPattern,\n reporter,\n outputPath = './testfn-results.json',\n workspace,\n env,\n parallel,\n timeout,\n retries\n } = options;\n const lines: string[] = [];\n\n lines.push(`Running tests with testfn SDK (framework: ${framework})`);\n\n try {\n if (!['vitest', 'playwright', 'jest'].includes(framework)) {\n throw new Error(`Unsupported framework: ${framework}. Supported: vitest, playwright, jest`);\n }\n\n const config: TestFnConfig = {\n framework: framework as 'vitest' | 'playwright' | 'jest',\n testPattern: testPattern || './tests/**/*.{test,spec}.{ts,js}',\n parallel,\n timeout,\n retries,\n env,\n reporters: reporter === 'json' ? [new JsonReporter(join(workspace, outputPath))] : undefined,\n };\n\n const originalCwd = process.cwd();\n try {\n process.chdir(workspace);\n \n const runner = new TestRunner(config);\n const results = runner.run();\n \n process.chdir(originalCwd);\n\n if (results && typeof results === 'object' && 'then' in results) {\n throw new Error('executeTestFnRun must be called from async context or use sync adapter');\n }\n\n lines.push(`Tests completed: ${(results as any).summary?.total || 0} total`);\n lines.push(`Passed: ${(results as any).summary?.passed || 0}, Failed: ${(results as any).summary?.failed || 0}`);\n \n if (reporter === 'json' && outputPath) {\n const fullPath = join(workspace, outputPath);\n if (existsSync(fullPath)) {\n lines.push(`JSON report written to ${outputPath}`);\n }\n }\n\n const hasFailed = (results as any).summary?.failed > 0;\n if (hasFailed) {\n return {\n success: false,\n exitCode: 1,\n lines,\n error: 'Tests failed'\n };\n }\n\n return { success: true, exitCode: 0, lines };\n } catch (innerErr) {\n process.chdir(originalCwd);\n throw innerErr;\n }\n } catch (err: unknown) {\n const errorMessage = err instanceof Error ? err.message : String(err);\n lines.push(`Test execution failed: ${errorMessage}`);\n return {\n success: false,\n exitCode: 1,\n lines,\n error: errorMessage\n };\n }\n}\n\nexport async function executeTestFnRunAsync(options: TestFnRunOptions): Promise<TestFnRunResult> {\n const {\n framework = 'vitest',\n testPattern,\n reporter,\n outputPath = './testfn-results.json',\n workspace,\n env,\n parallel,\n timeout,\n retries\n } = options;\n const lines: string[] = [];\n\n lines.push(`Running tests with testfn SDK (framework: ${framework})`);\n\n try {\n if (!['vitest', 'playwright', 'jest'].includes(framework)) {\n throw new Error(`Unsupported framework: ${framework}. Supported: vitest, playwright, jest`);\n }\n\n const config: TestFnConfig = {\n framework: framework as 'vitest' | 'playwright' | 'jest',\n testPattern: testPattern || './tests/**/*.{test,spec}.{ts,js}',\n parallel,\n timeout,\n retries,\n env,\n reporters: reporter === 'json' ? [new JsonReporter(join(workspace, outputPath))] : undefined,\n };\n\n const originalCwd = process.cwd();\n try {\n process.chdir(workspace);\n \n const runner = new TestRunner(config);\n const results = await runner.run();\n \n process.chdir(originalCwd);\n\n lines.push(`Tests completed: ${results.summary.total} total`);\n lines.push(`Passed: ${results.summary.passed}, Failed: ${results.summary.failed}`);\n \n if (reporter === 'json' && outputPath) {\n const fullPath = join(workspace, outputPath);\n if (existsSync(fullPath)) {\n lines.push(`JSON report written to ${outputPath}`);\n }\n }\n\n if (results.summary.failed > 0) {\n return {\n success: false,\n exitCode: 1,\n lines,\n error: 'Tests failed'\n };\n }\n\n return { success: true, exitCode: 0, lines };\n } catch (innerErr) {\n process.chdir(originalCwd);\n throw innerErr;\n }\n } catch (err: unknown) {\n const errorMessage = err instanceof Error ? err.message : String(err);\n lines.push(`Test execution failed: ${errorMessage}`);\n return {\n success: false,\n exitCode: 1,\n lines,\n error: errorMessage\n };\n }\n}\n","export { Runner } from './runner.js';\nexport type { RunnerOptions } from './runner.js';\nexport { executeRunStep } from './executor/run-step.js';\nexport type { RunStepResult } from './executor/run-step.js';\nexport { MemoryLogFnClient } from './reporting/logfn-client.js';\nexport type { LogEntry, LogFnClient } from './reporting/logfn-client.js';\nexport { executeCheckout } from './steps/checkout.js';\nexport type { CheckoutOptions, CheckoutResult } from './steps/checkout.js';\nexport { executeArtifactUpload } from './steps/artifact-upload.js';\nexport type { ArtifactUploadOptions, ArtifactUploadResult } from './steps/artifact-upload.js';\nexport { executeArtifactDownload } from './steps/artifact-download.js';\nexport type { ArtifactDownloadOptions, ArtifactDownloadResult } from './steps/artifact-download.js';\nexport { executeCacheSave } from './steps/cache-save.js';\nexport type { CacheSaveOptions, CacheSaveResult } from './steps/cache-save.js';\nexport { executeCacheRestore } from './steps/cache-restore.js';\nexport type { CacheRestoreOptions, CacheRestoreResult } from './steps/cache-restore.js';\nexport { redactSecrets } from './reporting/redact.js';\nexport { executeTestFnRun } from './steps/testfn-run.js';\nexport type { TestFnRunOptions, TestFnRunResult } from './steps/testfn-run.js';\nexport { executeHostFnDeploy } from './steps/hostfn-deploy.js';\nexport type { HostFnDeployOptions, HostFnDeployResult } from './steps/hostfn-deploy.js';\nexport { DockerExecutor } from './docker-executor.js';\nexport type { DockerExecutorOptions, DockerCommandRunner } from './docker-executor.js';\n","import { mkdtempSync, rmSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport type { QueueClient, JobPayload } from 'cifn';\nimport {\n DEFAULT_QUEUE_NAME,\n getReadyJobs,\n evaluateConditionSync,\n interpolate,\n hashFiles,\n type MemoryStore,\n type PipelineSpec,\n} from 'cifn';\nimport { executeRunStep } from './executor/run-step.js';\nimport { executeCheckout } from './steps/checkout.js';\nimport { executeArtifactUpload } from './steps/artifact-upload.js';\nimport { executeArtifactDownload } from './steps/artifact-download.js';\nimport { executeCacheSave } from './steps/cache-save.js';\nimport { executeCacheRestore } from './steps/cache-restore.js';\nimport { executeHostFnDeploy } from './steps/hostfn-deploy.js';\nimport type { LogFnClient } from './reporting/logfn-client.js';\nimport { redactSecrets } from './reporting/redact.js';\nimport { DockerExecutor } from './docker-executor.js';\n\nexport interface RunnerOptions {\n store: MemoryStore;\n queue: QueueClient;\n logClient: LogFnClient;\n pipelineSpecs?: Map<string, PipelineSpec>;\n queueName?: string;\n cleanWorkspace?: boolean;\n fileFnClient?: {\n upload(namespace: string, key: string, data: Buffer): Promise<string>;\n downloadByKey(namespace: string, key: string): Promise<Buffer | null>;\n };\n artifactStore?: {\n addArtifact(runId: string, artifact: { name: string; fileId: string; url?: string }): void;\n };\n secretValues?: Map<string, string[]>;\n /** Resolve secret by name for interpolation. When not set, ${{ secrets.* }} in run/with/cache key will fail. */\n getSecret?: (runId: string, name: string) => Promise<string | null>;\n labels?: string[];\n runnerType?: 'default' | 'hostfn-runner';\n dockerExecutor?: DockerExecutor;\n defaultDockerImage?: string;\n dockerRunOnLabels?: string[];\n dockerForDefault?: boolean;\n}\n\nexport class Runner {\n private store: MemoryStore;\n private queue: QueueClient;\n private logClient: LogFnClient;\n private pipelineSpecs: Map<string, PipelineSpec>;\n private queueName: string;\n private cleanWorkspace: boolean;\n private fileFnClient?: RunnerOptions['fileFnClient'];\n private artifactStore?: RunnerOptions['artifactStore'];\n private secretValues: Map<string, string[]>;\n private labels: string[];\n private runnerType: 'default' | 'hostfn-runner';\n private dockerExecutor?: DockerExecutor;\n private defaultDockerImage: string;\n private dockerRunOnLabels: Set<string>;\n private dockerForDefault: boolean;\n private getSecret?: (runId: string, name: string) => Promise<string | null>;\n\n constructor(options: RunnerOptions) {\n this.store = options.store;\n this.queue = options.queue;\n this.logClient = options.logClient;\n this.pipelineSpecs = options.pipelineSpecs ?? new Map();\n this.queueName = options.queueName ?? DEFAULT_QUEUE_NAME;\n this.cleanWorkspace = options.cleanWorkspace ?? true;\n this.fileFnClient = options.fileFnClient;\n this.artifactStore = options.artifactStore;\n this.secretValues = options.secretValues ?? new Map();\n this.getSecret = options.getSecret;\n this.runnerType = options.runnerType ?? 'default';\n this.labels = options.labels && options.labels.length > 0\n ? [...new Set(options.labels)]\n : [this.runnerType];\n this.dockerExecutor = options.dockerExecutor;\n this.defaultDockerImage = options.defaultDockerImage ?? 'node:20';\n this.dockerRunOnLabels = new Set(options.dockerRunOnLabels ?? ['docker-ubuntu-22']);\n this.dockerForDefault = options.dockerForDefault ?? false;\n }\n\n registerPipelineSpec(runId: string, spec: PipelineSpec): void {\n this.pipelineSpecs.set(runId, spec);\n }\n\n registerSecretValues(runId: string, values: string[]): void {\n this.secretValues.set(runId, values);\n }\n\n async processNextJob(): Promise<boolean> {\n const payload = await this.queue.dequeueMatching(this.queueName, (job) =>\n this.labels.includes(job.jobSpec['runs-on'])\n );\n if (!payload) return false;\n await this.executeJob(payload);\n return true;\n }\n\n async processAllJobs(): Promise<number> {\n let count = 0;\n while (await this.processNextJob()) {\n count++;\n }\n return count;\n }\n\n private async executeJob(payload: JobPayload): Promise<void> {\n const { runId, jobKey, jobSpec } = payload;\n let jobEnv: Record<string, string> = { ...payload.env };\n const secretVals = this.secretValues.get(runId) ?? [];\n if (payload.secretKeys && jobEnv) {\n for (const key of payload.secretKeys) {\n const val = jobEnv[key];\n if (val && !secretVals.includes(val)) {\n secretVals.push(val);\n }\n }\n }\n\n const logLines = (stepKey: string, lines: string[]) => {\n this.logClient.appendLines(runId, jobKey, stepKey, redactSecrets(lines, secretVals));\n };\n\n const run = this.store.getRun(runId);\n if (!run) return;\n\n const job = run.jobs.find(j => j.jobKey === jobKey);\n if (!job) return;\n\n const github = (run.trigger?.payload?.github as Record<string, string> | undefined) ?? {};\n if (!github.ref && payload.pipelineRef?.ref) github.ref = payload.pipelineRef.ref;\n if (!github.repository && payload.pipelineRef?.repo) github.repository = payload.pipelineRef.repo;\n if (!github.event_name && run.trigger?.type) github.event_name = run.trigger.type;\n\n if (jobSpec.if !== undefined && jobSpec.if !== null) {\n try {\n const runJob = evaluateConditionSync(String(jobSpec.if).trim(), { github, stepOutcomes: [] });\n if (!runJob) {\n job.status = 'skipped';\n job.completedAt = new Date().toISOString();\n logLines('__job__', [`Job \"${jobKey}\" skipped (if: false)`]);\n this.enqueueDependentJobs(runId, jobKey);\n this.checkRunCompletion(runId);\n return;\n }\n } catch {\n job.status = 'failure';\n job.completedAt = new Date().toISOString();\n logLines('__job__', [`Job \"${jobKey}\" failed (invalid if expression)`]);\n this.store.updateRunStatus(runId, 'failure');\n return;\n }\n }\n\n if (run.status === 'queued') {\n this.store.updateRunStatus(runId, 'running');\n }\n\n job.status = 'running';\n job.startedAt = new Date().toISOString();\n\n logLines('__job__', [`Job \"${jobKey}\" started`]);\n\n const workspace = mkdtempSync(join(tmpdir(), `cifn-${runId}-${jobKey}-`));\n\n let jobFailed = false;\n\n const interpolateContext = {\n github,\n getSecret: this.getSecret ? (name: string) => this.getSecret!(runId, name) : undefined,\n workspaceRoot: workspace,\n hashFiles: (glob: string) => Promise.resolve(hashFiles(workspace, glob)),\n };\n\n if (jobSpec.env) {\n for (const [k, v] of Object.entries(jobSpec.env)) {\n try {\n const { result, secretValues: sv } = await interpolate(String(v), interpolateContext);\n jobEnv[k] = result;\n secretVals.push(...sv);\n } catch {\n jobEnv[k] = String(v);\n }\n }\n }\n\n try {\n for (let i = 0; i < jobSpec.steps.length; i++) {\n const stepSpec = jobSpec.steps[i];\n const step = job.steps[i];\n if (!step) continue;\n\n const effectiveIf = ('if' in stepSpec && stepSpec.if != null) ? String(stepSpec.if).trim() : 'success()';\n const stepOutcomes = job.steps.slice(0, i).map(s => s.status);\n try {\n const runStep = evaluateConditionSync(effectiveIf, { github, stepOutcomes });\n if (!runStep) {\n step.status = 'skipped';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" skipped (if: false)`]);\n continue;\n }\n } catch {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" failed (invalid if expression)`]);\n jobFailed = true;\n continue;\n }\n\n if ('uses' in stepSpec) {\n if (stepSpec.uses === 'checkout') {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: checkout`,\n ]);\n\n const repo = (stepSpec.with?.repository as string) ?? payload.pipelineRef?.repo ?? '';\n const ref = (stepSpec.with?.ref as string) ?? payload.pipelineRef?.ref ?? 'main';\n const token = stepSpec.with?.token as string | undefined;\n\n const checkoutResult = executeCheckout({ repo, ref, workspace, token });\n logLines(step.stepKey, checkoutResult.lines);\n\n if (checkoutResult.success) {\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n } else {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed: ${checkoutResult.error}`,\n ]);\n jobFailed = true;\n }\n continue;\n }\n\n if (stepSpec.uses === 'artifact/upload' && this.fileFnClient) {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n let artName = (stepSpec.with?.name as string) ?? 'default';\n let artPath = (stepSpec.with?.path as string) ?? '.';\n try {\n const nameRes = await interpolate(artName, interpolateContext);\n artName = nameRes.result;\n secretVals.push(...nameRes.secretValues);\n const pathRes = await interpolate(artPath, interpolateContext);\n artPath = pathRes.result;\n secretVals.push(...pathRes.secretValues);\n } catch {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" failed: interpolation error`]);\n jobFailed = true;\n continue;\n }\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: artifact/upload \"${artName}\"`,\n ]);\n\n const uploadResult = await executeArtifactUpload({\n name: artName, path: artPath, workspace, runId, fileFnClient: this.fileFnClient,\n });\n logLines(step.stepKey, uploadResult.lines);\n\n if (uploadResult.success) {\n if (uploadResult.fileId && this.artifactStore) {\n this.artifactStore.addArtifact(runId, { name: artName, fileId: uploadResult.fileId });\n }\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n } else {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed: ${uploadResult.error}`,\n ]);\n jobFailed = true;\n }\n continue;\n }\n\n if (stepSpec.uses === 'artifact/download' && this.fileFnClient) {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n let artName = (stepSpec.with?.name as string) ?? 'default';\n try {\n const nameRes = await interpolate(artName, interpolateContext);\n artName = nameRes.result;\n secretVals.push(...nameRes.secretValues);\n } catch {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" failed: interpolation error`]);\n jobFailed = true;\n continue;\n }\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: artifact/download \"${artName}\"`,\n ]);\n\n const downloadResult = await executeArtifactDownload({\n name: artName, workspace, runId, fileFnClient: this.fileFnClient,\n });\n logLines(step.stepKey, downloadResult.lines);\n\n if (downloadResult.success) {\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n } else {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed: ${downloadResult.error}`,\n ]);\n jobFailed = true;\n }\n continue;\n }\n\n if (stepSpec.uses === 'cache/save' && this.fileFnClient) {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n let cacheKey = (stepSpec.with?.key as string) ?? '';\n try {\n const keyRes = await interpolate(cacheKey, interpolateContext);\n cacheKey = keyRes.result;\n secretVals.push(...keyRes.secretValues);\n } catch {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" failed: interpolation error`]);\n jobFailed = true;\n continue;\n }\n const cachePaths = (stepSpec.with?.paths as string[]) ?? [];\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: cache/save \"${cacheKey}\"`,\n ]);\n\n const saveResult = await executeCacheSave({\n key: cacheKey, paths: cachePaths, workspace, fileFnClient: this.fileFnClient,\n });\n logLines(step.stepKey, saveResult.lines);\n\n step.status = saveResult.success ? 'success' : 'failure';\n step.completedAt = new Date().toISOString();\n if (!saveResult.success) {\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed: ${saveResult.error}`,\n ]);\n jobFailed = true;\n } else {\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n }\n continue;\n }\n\n if (stepSpec.uses === 'cache/restore' && this.fileFnClient) {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n let cacheKey = (stepSpec.with?.key as string) ?? '';\n try {\n const keyRes = await interpolate(cacheKey, interpolateContext);\n cacheKey = keyRes.result;\n secretVals.push(...keyRes.secretValues);\n } catch {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" failed: interpolation error`]);\n jobFailed = true;\n continue;\n }\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: cache/restore \"${cacheKey}\"`,\n ]);\n\n const restoreResult = await executeCacheRestore({\n key: cacheKey, workspace, fileFnClient: this.fileFnClient,\n });\n logLines(step.stepKey, restoreResult.lines);\n\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully${restoreResult.hit ? ' (cache hit)' : ' (cache miss)'}`,\n ]);\n continue;\n }\n\n if (stepSpec.uses === 'testfn/run') {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n const framework = stepSpec.with?.framework as string | undefined;\n const testPattern = stepSpec.with?.testPattern as string | undefined;\n const reporter = stepSpec.with?.reporter as string | undefined;\n const outputPath = stepSpec.with?.outputPath as string | undefined;\n const parallel = stepSpec.with?.parallel as number | 'auto' | undefined;\n const timeout = stepSpec.with?.timeout as number | undefined;\n const retries = stepSpec.with?.retries as number | undefined;\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: testfn/run`,\n ]);\n\n const { executeTestFnRunAsync } = await import('./steps/testfn-run.js');\n const testResult = await executeTestFnRunAsync({\n framework,\n testPattern,\n reporter,\n outputPath,\n workspace,\n env: jobEnv,\n parallel,\n timeout,\n retries,\n });\n logLines(step.stepKey, testResult.lines);\n\n if (testResult.success) {\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n } else {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed: ${testResult.error}`,\n ]);\n jobFailed = true;\n }\n continue;\n }\n\n if (stepSpec.uses === 'hostfn/deploy') {\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n const environment = (stepSpec.with?.environment as string) ?? '';\n const ci = (stepSpec.with?.ci as boolean) ?? true;\n const local = typeof stepSpec.with?.local === 'boolean'\n ? (stepSpec.with.local as boolean)\n : jobSpec['runs-on'] === 'hostfn-runner';\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: hostfn/deploy ${environment}`,\n ]);\n\n const deployResult = executeHostFnDeploy({\n environment, ci, local, workspace, env: jobEnv,\n });\n logLines(step.stepKey, deployResult.lines);\n\n if (deployResult.success) {\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n } else {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed: ${deployResult.error}`,\n ]);\n jobFailed = true;\n }\n continue;\n }\n\n step.status = 'skipped';\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" skipped (unsupported uses: ${stepSpec.uses})`,\n ]);\n continue;\n }\n\n step.status = 'running';\n step.startedAt = new Date().toISOString();\n\n let runCommand = stepSpec.run;\n try {\n const runRes = await interpolate(stepSpec.run, interpolateContext);\n runCommand = runRes.result;\n secretVals.push(...runRes.secretValues);\n } catch {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [`Step \"${step.stepKey}\" failed: interpolation error`]);\n jobFailed = true;\n continue;\n }\n\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" started: ${runCommand}`,\n ]);\n\n const result = this.executeRunCommand(runCommand, workspace, jobSpec, jobEnv);\n\n logLines(step.stepKey, result.lines);\n\n if (result.exitCode === 0) {\n step.status = 'success';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" completed successfully`,\n ]);\n } else {\n step.status = 'failure';\n step.completedAt = new Date().toISOString();\n logLines(step.stepKey, [\n `Step \"${step.stepKey}\" failed with exit code ${result.exitCode}`,\n ]);\n jobFailed = true;\n }\n }\n } finally {\n if (this.cleanWorkspace) {\n try {\n rmSync(workspace, { recursive: true, force: true });\n } catch {\n // ignore cleanup errors\n }\n }\n }\n\n job.completedAt = new Date().toISOString();\n\n if (jobFailed) {\n job.status = 'failure';\n logLines('__job__', [`Job \"${jobKey}\" failed`]);\n this.store.updateRunStatus(runId, 'failure');\n } else {\n job.status = 'success';\n logLines('__job__', [`Job \"${jobKey}\" completed successfully`]);\n await this.enqueueDependentJobs(runId, jobKey);\n this.checkRunCompletion(runId);\n }\n }\n\n private executeRunCommand(\n command: string,\n workspace: string,\n jobSpec: JobPayload['jobSpec'],\n env?: Record<string, string>,\n ) {\n if (this.shouldUseDocker(jobSpec) && this.dockerExecutor) {\n return this.dockerExecutor.execute({\n image: jobSpec.image ?? this.defaultDockerImage,\n workspace,\n command,\n env,\n });\n }\n\n return executeRunStep(command, workspace, env);\n }\n\n private shouldUseDocker(jobSpec: JobPayload['jobSpec']): boolean {\n if (!this.dockerExecutor) return false;\n if (typeof jobSpec.image === 'string' && jobSpec.image.length > 0) return true;\n if (jobSpec['runs-on'] === 'default' && this.dockerForDefault) return true;\n return this.dockerRunOnLabels.has(jobSpec['runs-on']);\n }\n\n private async enqueueDependentJobs(runId: string, completedJobKey: string): Promise<void> {\n const spec = this.pipelineSpecs.get(runId);\n if (!spec) return;\n\n const run = this.store.getRun(runId);\n if (!run) return;\n\n const completedJobs = new Set(\n run.jobs.filter(j => j.status === 'success' || j.status === 'skipped').map(j => j.jobKey)\n );\n const enqueuedJobs = new Set(\n run.jobs.filter(j => j.status !== 'pending').map(j => j.jobKey)\n );\n\n const readyJobs = getReadyJobs(spec, completedJobs, enqueuedJobs);\n\n for (const readyJobKey of readyJobs) {\n const jobSpec = spec.jobs[readyJobKey];\n if (jobSpec) {\n await this.queue.enqueue(this.queueName, {\n runId,\n jobKey: readyJobKey,\n jobSpec,\n });\n }\n }\n }\n\n private checkRunCompletion(runId: string): void {\n const run = this.store.getRun(runId);\n if (!run) return;\n\n const allDone = run.jobs.every(j =>\n j.status === 'success' || j.status === 'failure' || j.status === 'skipped'\n );\n\n if (allDone) {\n const anyFailure = run.jobs.some(j => j.status === 'failure');\n this.store.updateRunStatus(runId, anyFailure ? 'failure' : 'success');\n }\n }\n}\n","import { execSync, type ExecSyncOptionsWithStringEncoding } from 'node:child_process';\n\nexport interface RunStepResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n lines: string[];\n}\n\nexport function executeRunStep(command: string, workspacePath: string, env?: Record<string, string>): RunStepResult {\n const execEnv = env ? { ...process.env, ...env } : process.env;\n try {\n const stdout = execSync(command, {\n cwd: workspacePath,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n timeout: 300_000,\n shell: '/bin/sh',\n env: execEnv,\n } satisfies ExecSyncOptionsWithStringEncoding);\n const lines = stdout.split('\\n').filter(l => l !== '');\n return { exitCode: 0, stdout, stderr: '', lines };\n } catch (err: unknown) {\n const error = err as { status?: number; stdout?: string; stderr?: string };\n const stdout = typeof error.stdout === 'string' ? error.stdout : '';\n const stderr = typeof error.stderr === 'string' ? error.stderr : '';\n const exitCode = typeof error.status === 'number' ? error.status : 1;\n const lines = [\n ...stdout.split('\\n').filter(l => l !== ''),\n ...stderr.split('\\n').filter(l => l !== ''),\n ];\n return { exitCode, stdout, stderr, lines };\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface CheckoutOptions {\n repo: string;\n ref: string;\n workspace: string;\n token?: string;\n}\n\nexport interface CheckoutResult {\n success: boolean;\n lines: string[];\n error?: string;\n}\n\nexport function executeCheckout(options: CheckoutOptions): CheckoutResult {\n const { repo, ref, workspace, token } = options;\n const lines: string[] = [];\n const secretsToRedact: string[] = [];\n\n let cloneUrl = repo;\n if (token && cloneUrl.startsWith('https://')) {\n const url = new URL(cloneUrl);\n url.username = 'x-access-token';\n url.password = token;\n cloneUrl = url.toString();\n secretsToRedact.push(token);\n secretsToRedact.push(cloneUrl);\n }\n\n const redactLine = (line: string): string => {\n let redacted = line;\n for (const secret of secretsToRedact) {\n if (secret.length > 0) {\n redacted = redacted.split(secret).join('***');\n }\n }\n return redacted;\n };\n\n try {\n lines.push(`Cloning ${repo} at ref ${ref}`);\n\n const cloneCmd = `git clone --depth 1 --branch ${ref} ${cloneUrl} .`;\n const output = execSync(cloneCmd, {\n cwd: workspace,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n timeout: 120_000,\n });\n if (output) {\n lines.push(...output.split('\\n').filter(l => l !== '').map(redactLine));\n }\n\n lines.push(`Checkout complete: ${ref}`);\n return { success: true, lines };\n } catch (err: unknown) {\n const error = err as { stderr?: string; message?: string };\n const errMsg = typeof error.stderr === 'string' ? redactLine(error.stderr) : (error.message ? redactLine(error.message) : 'Unknown error');\n lines.push(`Checkout failed: ${errMsg}`);\n return { success: false, lines, error: errMsg };\n }\n}\n","import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\nexport interface ArtifactUploadOptions {\n name: string;\n path: string;\n workspace: string;\n runId: string;\n fileFnClient: {\n upload(namespace: string, key: string, data: Buffer): Promise<string>;\n };\n}\n\nexport interface ArtifactUploadResult {\n success: boolean;\n fileId?: string;\n lines: string[];\n error?: string;\n}\n\nfunction collectFiles(dirPath: string): string[] {\n const files: string[] = [];\n if (!existsSync(dirPath)) return files;\n const stat = statSync(dirPath);\n if (stat.isFile()) return [dirPath];\n if (!stat.isDirectory()) return files;\n for (const entry of readdirSync(dirPath, { withFileTypes: true })) {\n const fullPath = join(dirPath, entry.name);\n if (entry.isFile()) {\n files.push(fullPath);\n } else if (entry.isDirectory()) {\n files.push(...collectFiles(fullPath));\n }\n }\n return files;\n}\n\nexport async function executeArtifactUpload(options: ArtifactUploadOptions): Promise<ArtifactUploadResult> {\n const { name, path: artifactPath, workspace, runId, fileFnClient } = options;\n const lines: string[] = [];\n\n // Validate artifact name length (max 256 chars)\n if (name.length > 256) {\n const msg = `Artifact name exceeds maximum length of 256 characters (actual: ${name.length})`;\n lines.push(msg);\n return { success: false, lines, error: msg };\n }\n\n const fullPath = join(workspace, artifactPath);\n\n if (!existsSync(fullPath)) {\n const msg = `Artifact path not found: ${artifactPath}`;\n lines.push(msg);\n return { success: false, lines, error: msg };\n }\n\n try {\n lines.push(`Uploading artifact \"${name}\" from ${artifactPath}`);\n\n const files = collectFiles(fullPath);\n const buffers: Buffer[] = [];\n const manifest: Array<{ relativePath: string; offset: number; size: number }> = [];\n\n let offset = 0;\n for (const file of files) {\n const data = readFileSync(file);\n const rel = relative(fullPath, file) || relative(workspace, file);\n manifest.push({ relativePath: rel, offset, size: data.length });\n buffers.push(data);\n offset += data.length;\n }\n\n const manifestBuf = Buffer.from(JSON.stringify(manifest));\n const headerBuf = Buffer.alloc(4);\n headerBuf.writeUInt32BE(manifestBuf.length, 0);\n\n const combined = Buffer.concat([headerBuf, manifestBuf, ...buffers]);\n\n const namespace = `artifact:${runId}`;\n const fileId = await fileFnClient.upload(namespace, name, combined);\n\n lines.push(`Uploaded ${files.length} file(s), artifact fileId: ${fileId}`);\n return { success: true, fileId, lines };\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n lines.push(`Upload failed: ${msg}`);\n return { success: false, lines, error: msg };\n }\n}\n","import { mkdirSync, writeFileSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\n\nexport interface ArtifactDownloadOptions {\n name: string;\n workspace: string;\n runId: string;\n fileFnClient: {\n downloadByKey(namespace: string, key: string): Promise<Buffer | null>;\n };\n}\n\nexport interface ArtifactDownloadResult {\n success: boolean;\n lines: string[];\n error?: string;\n}\n\nexport async function executeArtifactDownload(options: ArtifactDownloadOptions): Promise<ArtifactDownloadResult> {\n const { name, workspace, runId, fileFnClient } = options;\n const lines: string[] = [];\n\n try {\n lines.push(`Downloading artifact \"${name}\"`);\n\n const namespace = `artifact:${runId}`;\n const data = await fileFnClient.downloadByKey(namespace, name);\n\n if (!data) {\n const msg = `Artifact \"${name}\" not found`;\n lines.push(msg);\n return { success: false, lines, error: msg };\n }\n\n const manifestLen = data.readUInt32BE(0);\n const manifestJson = data.subarray(4, 4 + manifestLen).toString('utf-8');\n const manifest: Array<{ relativePath: string; offset: number; size: number }> = JSON.parse(manifestJson);\n\n const dataStart = 4 + manifestLen;\n\n for (const entry of manifest) {\n const fileBuf = data.subarray(dataStart + entry.offset, dataStart + entry.offset + entry.size);\n const outPath = join(workspace, entry.relativePath);\n mkdirSync(dirname(outPath), { recursive: true });\n writeFileSync(outPath, fileBuf);\n }\n\n lines.push(`Downloaded and extracted ${manifest.length} file(s)`);\n return { success: true, lines };\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n lines.push(`Download failed: ${msg}`);\n return { success: false, lines, error: msg };\n }\n}\n","import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\nexport interface CacheSaveOptions {\n key: string;\n paths: string[];\n workspace: string;\n fileFnClient: {\n upload(namespace: string, key: string, data: Buffer): Promise<string>;\n };\n}\n\nexport interface CacheSaveResult {\n success: boolean;\n lines: string[];\n error?: string;\n}\n\nfunction collectFiles(dirPath: string, basePath: string): Array<{ relativePath: string; data: Buffer }> {\n const results: Array<{ relativePath: string; data: Buffer }> = [];\n if (!existsSync(dirPath)) return results;\n const stat = statSync(dirPath);\n if (stat.isFile()) {\n results.push({ relativePath: relative(basePath, dirPath), data: readFileSync(dirPath) });\n return results;\n }\n if (!stat.isDirectory()) return results;\n for (const entry of readdirSync(dirPath, { withFileTypes: true })) {\n const fullPath = join(dirPath, entry.name);\n if (entry.isFile()) {\n results.push({ relativePath: relative(basePath, fullPath), data: readFileSync(fullPath) });\n } else if (entry.isDirectory()) {\n results.push(...collectFiles(fullPath, basePath));\n }\n }\n return results;\n}\n\nexport async function executeCacheSave(options: CacheSaveOptions): Promise<CacheSaveResult> {\n const { key, paths, workspace, fileFnClient } = options;\n const lines: string[] = [];\n\n // Validate cache key length (max 1KB)\n const keyByteLength = Buffer.byteLength(key, 'utf8');\n if (keyByteLength > 1024) {\n const msg = `Cache key exceeds maximum length of 1KB (actual: ${keyByteLength} bytes)`;\n lines.push(msg);\n return { success: false, lines, error: msg };\n }\n\n try {\n lines.push(`Saving cache with key \"${key}\"`);\n\n const allFiles: Array<{ relativePath: string; data: Buffer }> = [];\n for (const p of paths) {\n const fullPath = join(workspace, p);\n const files = collectFiles(fullPath, workspace);\n allFiles.push(...files);\n }\n\n if (allFiles.length === 0) {\n lines.push('No files found to cache');\n return { success: true, lines };\n }\n\n const manifest: Array<{ relativePath: string; offset: number; size: number }> = [];\n const buffers: Buffer[] = [];\n let offset = 0;\n for (const f of allFiles) {\n manifest.push({ relativePath: f.relativePath, offset, size: f.data.length });\n buffers.push(f.data);\n offset += f.data.length;\n }\n\n const manifestBuf = Buffer.from(JSON.stringify(manifest));\n const headerBuf = Buffer.alloc(4);\n headerBuf.writeUInt32BE(manifestBuf.length, 0);\n const combined = Buffer.concat([headerBuf, manifestBuf, ...buffers]);\n\n await fileFnClient.upload('cache', key, combined);\n lines.push(`Cached ${allFiles.length} file(s) under key \"${key}\"`);\n return { success: true, lines };\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n lines.push(`Cache save failed: ${msg}`);\n return { success: false, lines, error: msg };\n }\n}\n","import { mkdirSync, writeFileSync } from 'node:fs';\nimport { join, dirname } from 'node:path';\n\nexport interface CacheRestoreOptions {\n key: string;\n workspace: string;\n fileFnClient: {\n downloadByKey(namespace: string, key: string): Promise<Buffer | null>;\n };\n}\n\nexport interface CacheRestoreResult {\n success: boolean;\n hit: boolean;\n lines: string[];\n error?: string;\n}\n\nexport async function executeCacheRestore(options: CacheRestoreOptions): Promise<CacheRestoreResult> {\n const { key, workspace, fileFnClient } = options;\n const lines: string[] = [];\n\n // Validate cache key length (max 1KB)\n const keyByteLength = Buffer.byteLength(key, 'utf8');\n if (keyByteLength > 1024) {\n const msg = `Cache key exceeds maximum length of 1KB (actual: ${keyByteLength} bytes)`;\n lines.push(msg);\n return { success: false, hit: false, lines, error: msg };\n }\n\n try {\n lines.push(`Restoring cache with key \"${key}\"`);\n\n const data = await fileFnClient.downloadByKey('cache', key);\n\n if (!data) {\n lines.push(`Cache miss for key \"${key}\"`);\n return { success: true, hit: false, lines };\n }\n\n const manifestLen = data.readUInt32BE(0);\n const manifestJson = data.subarray(4, 4 + manifestLen).toString('utf-8');\n const manifest: Array<{ relativePath: string; offset: number; size: number }> = JSON.parse(manifestJson);\n\n const dataStart = 4 + manifestLen;\n\n for (const entry of manifest) {\n const fileBuf = data.subarray(dataStart + entry.offset, dataStart + entry.offset + entry.size);\n const outPath = join(workspace, entry.relativePath);\n mkdirSync(dirname(outPath), { recursive: true });\n writeFileSync(outPath, fileBuf);\n }\n\n lines.push(`Cache hit: restored ${manifest.length} file(s)`);\n return { success: true, hit: true, lines };\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err);\n lines.push(`Cache restore failed: ${msg}`);\n return { success: false, hit: false, lines, error: msg };\n }\n}\n","import { execSync } from 'node:child_process';\n\nexport interface HostFnDeployOptions {\n environment: string;\n ci?: boolean;\n local?: boolean;\n workspace: string;\n env?: Record<string, string>;\n}\n\nexport interface HostFnDeployResult {\n success: boolean;\n exitCode: number;\n lines: string[];\n error?: string;\n}\n\nexport function executeHostFnDeploy(options: HostFnDeployOptions): HostFnDeployResult {\n const { environment, ci = true, local = false, workspace, env } = options;\n const lines: string[] = [];\n\n let command = `hostfn deploy ${environment}`;\n if (local) command += ' --local';\n if (ci) command += ' --ci';\n\n lines.push(`Deploying: ${command}`);\n\n try {\n const output = execSync(command, {\n cwd: workspace,\n encoding: 'utf-8',\n stdio: ['pipe', 'pipe', 'pipe'],\n timeout: 600_000,\n shell: '/bin/sh',\n env: env ? { ...process.env, ...env } : process.env,\n });\n if (output) {\n lines.push(...output.split('\\n').filter(l => l !== ''));\n }\n lines.push('Deploy succeeded');\n return { success: true, exitCode: 0, lines };\n } catch (err: unknown) {\n const error = err as { status?: number; stdout?: string; stderr?: string };\n const stdout = typeof error.stdout === 'string' ? error.stdout : '';\n const stderr = typeof error.stderr === 'string' ? error.stderr : '';\n const exitCode = typeof error.status === 'number' ? error.status : 1;\n if (stdout) lines.push(...stdout.split('\\n').filter(l => l !== ''));\n if (stderr) lines.push(...stderr.split('\\n').filter(l => l !== ''));\n lines.push(`Deploy failed with exit code ${exitCode}`);\n return { success: false, exitCode, lines, error: `Deploy failed with exit code ${exitCode}` };\n }\n}\n","export function redactSecrets(lines: string[], secretValues: string[]): string[] {\n if (secretValues.length === 0) return lines;\n return lines.map(line => {\n let result = line;\n for (const secret of secretValues) {\n if (secret.length > 0) {\n result = result.split(secret).join('***');\n }\n }\n return result;\n });\n}\n","export interface LogEntry {\n runId: string;\n jobKey: string;\n stepKey: string;\n line: string;\n timestamp: string;\n}\n\nexport interface LogFnClient {\n append(entry: LogEntry): void;\n appendLines(runId: string, jobKey: string, stepKey: string, lines: string[]): void;\n getLines(runId: string, jobKey: string): LogEntry[];\n getAllLines(runId: string): LogEntry[];\n}\n\nexport class MemoryLogFnClient implements LogFnClient {\n private entries: LogEntry[] = [];\n\n append(entry: LogEntry): void {\n this.entries.push(entry);\n }\n\n appendLines(runId: string, jobKey: string, stepKey: string, lines: string[]): void {\n const now = new Date().toISOString();\n for (const line of lines) {\n this.entries.push({ runId, jobKey, stepKey, line, timestamp: now });\n }\n }\n\n getLines(runId: string, jobKey: string): LogEntry[] {\n return this.entries.filter(e => e.runId === runId && e.jobKey === jobKey);\n }\n\n getAllLines(runId: string): LogEntry[] {\n return this.entries.filter(e => e.runId === runId);\n }\n}\n","import { spawnSync } from 'node:child_process';\nimport type { RunStepResult } from './executor/run-step.js';\n\nexport interface DockerExecutorOptions {\n image: string;\n workspace: string;\n command: string;\n env?: Record<string, string>;\n}\n\nexport interface DockerCommandRunner {\n run(args: string[], options: { cwd: string; env?: Record<string, string> }): {\n status: number | null;\n stdout: string;\n stderr: string;\n error?: string;\n };\n}\n\nclass DefaultDockerCommandRunner implements DockerCommandRunner {\n run(args: string[], options: { cwd: string; env?: Record<string, string> }) {\n const res = spawnSync('docker', args, {\n cwd: options.cwd,\n encoding: 'utf-8',\n env: options.env ? { ...process.env, ...options.env } : process.env,\n timeout: 600_000,\n });\n return {\n status: res.status,\n stdout: res.stdout ?? '',\n stderr: res.stderr ?? '',\n error: res.error ? String(res.error.message ?? res.error) : undefined,\n };\n }\n}\n\nexport class DockerExecutor {\n private readonly runner: DockerCommandRunner;\n\n constructor(runner?: DockerCommandRunner) {\n this.runner = runner ?? new DefaultDockerCommandRunner();\n }\n\n execute(options: DockerExecutorOptions): RunStepResult {\n const args = [\n 'run',\n '--rm',\n '-v', `${options.workspace}:/workspace`,\n '-w', '/workspace',\n ];\n\n for (const [key, value] of Object.entries(options.env ?? {})) {\n args.push('-e', `${key}=${value}`);\n }\n\n args.push(options.image, 'sh', '-lc', options.command);\n\n const output = this.runner.run(args, { cwd: options.workspace, env: options.env });\n\n const stdout = output.stdout ?? '';\n const stderr = output.stderr ?? '';\n const lines = [...stdout.split('\\n'), ...stderr.split('\\n')].filter(line => line !== '');\n const exitCode = output.status ?? 1;\n\n if (output.error) {\n lines.push(`docker error: ${output.error}`);\n }\n\n return {\n exitCode,\n stdout,\n stderr,\n lines,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,SAAS,iBAAiB,SAA4C;AAC3E,QAAM;AAAA,IACJ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,QAAkB,CAAC;AAEzB,QAAM,KAAK,6CAA6C,SAAS,GAAG;AAEpE,MAAI;AACF,QAAI,CAAC,CAAC,UAAU,cAAc,MAAM,EAAE,SAAS,SAAS,GAAG;AACzD,YAAM,IAAI,MAAM,0BAA0B,SAAS,uCAAuC;AAAA,IAC5F;AAEA,UAAM,SAAuB;AAAA,MAC3B;AAAA,MACA,aAAa,eAAe;AAAA,MAC5B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,WAAW,aAAa,SAAS,CAAC,IAAI,6BAAa,wBAAK,WAAW,UAAU,CAAC,CAAC,IAAI;AAAA,IACrF;AAEA,UAAM,cAAc,QAAQ,IAAI;AAChC,QAAI;AACF,cAAQ,MAAM,SAAS;AAEvB,YAAM,SAAS,IAAI,uBAAW,MAAM;AACpC,YAAM,UAAU,OAAO,IAAI;AAE3B,cAAQ,MAAM,WAAW;AAEzB,UAAI,WAAW,OAAO,YAAY,YAAY,UAAU,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ACF;AACF;AAEO,IAAM,iBAAN,MAAqB;AAAA,EAG1B,YAAY,QAA8B;AACxC,SAAK,SAAS,UAAU,IAAI,2BAA2B;AAAA,EACzD;AAAA,EAEA,QAAQ,SAA+C;AACrD,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MAAM,GAAG,QAAQ,SAAS;AAAA,MAC1B;AAAA,MAAM;AAAA,IACR;AAEA,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,QAAQ,OAAO,CAAC,CAAC,GAAG;AAC5D,WAAK,KAAK,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE;AAAA,IACnC;AAEA,SAAK,KAAK,QAAQ,OAAO,MAAM,OAAO,QAAQ,OAAO;AAErD,UAAM,SAAS,KAAK,OAAO,IAAI,MAAM,EAAE,KAAK,QAAQ,WAAW,KAAK,QAAQ,IAAI,CAAC;AAEjF,UAAM,SAAS,OAAO,UAAU;AAChC,UAAM,SAAS,OAAO,UAAU;AAChC,UAAM,QAAQ,CAAC,GAAG,OAAO,MAAM,IAAI,GAAG,GAAG,OAAO,MAAM,IAAI,CAAC,EAAE,OAAO,UAAQ,SAAS,EAAE;AACvF,UAAM,WAAW,OAAO,UAAU;AAElC,QAAI,OAAO,OAAO;AAChB,YAAM,KAAK,iBAAiB,OAAO,KAAK,EAAE;AAAA,IAC5C;AAEA,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":["import_node_path","import_node_fs","import_node_fs","import_node_path","import_node_child_process","import_node_fs","import_node_path","import_node_fs","import_node_path","collectFiles","import_node_fs","import_node_path","import_node_child_process","executeTestFnRunAsync","import_node_child_process"]}