omnideploy-cli 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -2
- package/dist/main.js +2943 -0
- package/dist/main.js.map +1 -0
- package/package.json +67 -4
- package/schema.json +65 -0
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/main.ts","../src/cli/commands/auth.ts","../src/cli/commands/deploy.ts","../src/cli/presenters/format.ts","../src/domain/value-objects/Language.ts","../src/domain/entities/ProjectProfile.ts","../src/domain/entities/ProjectConfig.ts","../src/domain/errors/index.ts","../src/domain/services/CompatibilityPolicy.ts","../src/domain/services/naming.ts","../src/domain/services/spa.ts","../src/cli/commands/doctor.ts","../src/cli/commands/generate.ts","../src/cli/commands/init.ts","../src/cli/commands/providers.ts","../src/cli/commands/status.ts","../src/cli/container.ts","../src/application/services/ProviderRegistry.ts","../src/application/services/CredentialResolver.ts","../src/application/services/serviceName.ts","../src/application/use-cases/DetectProject.ts","../src/application/use-cases/GenerateArtifacts.ts","../src/application/use-cases/InitProject.ts","../src/application/use-cases/BuildProject.ts","../src/application/use-cases/DeployProject.ts","../src/application/use-cases/ManageCredentials.ts","../src/application/use-cases/ListProviders.ts","../src/application/use-cases/DoctorCheck.ts","../src/application/use-cases/GetDeploymentStatus.ts","../src/infrastructure/config/JsonConfigRepository.ts","../src/infrastructure/credentials/FileCredentialStore.ts","../src/infrastructure/detectors/DockerDetector.ts","../src/infrastructure/detectors/support.ts","../src/infrastructure/detectors/DotnetDetector.ts","../src/infrastructure/detectors/GoDetector.ts","../src/infrastructure/detectors/JavaDetector.ts","../src/infrastructure/detectors/NodeDetector.ts","../src/infrastructure/detectors/PhpDetector.ts","../src/infrastructure/detectors/PythonDetector.ts","../src/infrastructure/detectors/RubyDetector.ts","../src/infrastructure/detectors/RustDetector.ts","../src/infrastructure/detectors/StaticDetector.ts","../src/infrastructure/detectors/index.ts","../src/infrastructure/fs/NodeFileSystem.ts","../src/infrastructure/generators/dockerfile/templates.ts","../src/infrastructure/generators/dockerfile/DockerfileGenerator.ts","../src/infrastructure/generators/provider-config/netlify.ts","../src/infrastructure/generators/provider-config/railway.ts","../src/infrastructure/generators/provider-config/render.ts","../src/infrastructure/generators/provider-config/vercel.ts","../src/infrastructure/generators/index.ts","../src/infrastructure/git/CliGit.ts","../src/infrastructure/http/FetchHttpClient.ts","../src/infrastructure/process/ExecaProcessRunner.ts","../src/infrastructure/providers/support.ts","../src/infrastructure/providers/GitHubPagesProvider.ts","../src/infrastructure/providers/NetlifyProvider.ts","../src/infrastructure/providers/RailwayProvider.ts","../src/infrastructure/providers/RenderProvider.ts","../src/infrastructure/providers/VercelProvider.ts","../src/infrastructure/providers/index.ts","../src/cli/presenters/ClackPrompt.ts","../src/cli/presenters/ConsoleLogger.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { Command } from 'commander';\nimport { registerAuth } from './commands/auth.js';\nimport { registerDeploy } from './commands/deploy.js';\nimport { registerDoctor } from './commands/doctor.js';\nimport { registerGenerate } from './commands/generate.js';\nimport { registerInit } from './commands/init.js';\nimport { registerProviders } from './commands/providers.js';\nimport { registerStatus } from './commands/status.js';\nimport type { CommandEnv } from './commands/types.js';\nimport { createContainer, type Container } from './container.js';\nimport { presentError } from './presenters/format.js';\n\ndeclare const __VERSION__: string | undefined;\nconst VERSION = typeof __VERSION__ === 'string' ? __VERSION__ : '0.0.0-dev';\n\nconst program = new Command()\n .name('omnideploy')\n .description('Detect, containerize and deploy any project to Vercel, Netlify, GitHub Pages, Railway, Render — with one CLI.')\n .version(VERSION)\n .option('-C, --cwd <dir>', 'project directory', process.cwd())\n .option('--debug', 'show stack traces and debug output')\n .option('--no-interactive', 'never prompt (also implied by CI=true or a non-TTY stdin)')\n .showHelpAfterError();\n\nlet container: Container | undefined;\nconst globals = () => program.opts<{ cwd: string; debug?: boolean; interactive: boolean }>();\nconst env: CommandEnv = {\n cwd: () => resolve(globals().cwd),\n debug: () => Boolean(globals().debug),\n container: () =>\n (container ??= createContainer({\n debug: Boolean(globals().debug),\n interactive: globals().interactive && Boolean(process.stdin.isTTY) && !process.env.CI,\n version: VERSION,\n })),\n};\n\nfor (const register of [registerInit, registerDeploy, registerGenerate, registerAuth, registerProviders, registerDoctor, registerStatus]) {\n register(program, env);\n}\n\ntry {\n await program.parseAsync(process.argv);\n} catch (error) {\n process.exitCode = presentError(error, env.debug());\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport type { CommandEnv } from './types.js';\n\nexport function registerAuth(program: Command, env: CommandEnv): void {\n program\n .command('login')\n .description('Save an API token for a provider')\n .argument('<provider>')\n .option('-t, --token <token>', 'token value (otherwise prompted; prefer the env var in CI)')\n .action(async (provider: string, opts: { token?: string }) => {\n const c = env.container();\n await c.login.execute(provider, opts.token);\n p.log.success(`Logged in to ${c.providers.get(provider).displayName}.`);\n });\n\n program\n .command('logout')\n .description('Remove a saved provider token')\n .argument('<provider>')\n .action(async (provider: string) => {\n const c = env.container();\n const removed = await c.logout.execute(provider);\n const name = c.providers.get(provider).displayName;\n if (removed) p.log.success(`Logged out of ${name}.`);\n else p.log.info(`No saved token for ${name}.`);\n p.log.message(pc.dim(`(Tokens set via ${c.providers.get(provider).capabilities.auth.envVar} are not affected.)`));\n });\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport { describeError, table } from '../presenters/format.js';\nimport type { CommandEnv } from './types.js';\n\ninterface DeployOpts {\n preview?: boolean;\n build: boolean;\n dir?: string;\n dryRun?: boolean;\n yes?: boolean;\n force?: boolean;\n}\n\nexport function registerDeploy(program: Command, env: CommandEnv): void {\n program\n .command('deploy')\n .description('Deploy to one or more providers (default: those in omnideploy.json)')\n .argument('[providers...]', 'e.g. vercel netlify github-pages railway render')\n .option('--preview', 'create a preview/draft deployment instead of production')\n .option('--no-build', 'skip the local build step')\n .option('-d, --dir <path>', 'deploy this directory as a static site')\n .option('--dry-run', 'show what would happen without deploying')\n .option('-y, --yes', 'answer yes to every prompt (CI mode)')\n .option('-f, --force', 'regenerate deployment files even if they exist')\n .action(async (providers: string[], opts: DeployOpts) => {\n const c = env.container();\n p.intro(pc.inverse(' omnideploy deploy '));\n const report = await c.deploy.execute({\n rootDir: env.cwd(),\n providerIds: providers,\n production: !opts.preview,\n skipBuild: !opts.build,\n dir: opts.dir,\n dryRun: opts.dryRun,\n yes: opts.yes,\n force: opts.force,\n });\n if (report.dryRun) {\n p.outro('Dry run complete — nothing was deployed.');\n return;\n }\n\n const rows = report.outcomes.map((o) => [\n o.displayName,\n o.ok ? (o.deployment?.state === 'ready' ? pc.green('✔ live') : pc.yellow('… building')) : pc.red('✖ failed'),\n o.ok ? pc.cyan(o.deployment?.url ?? '(no public URL)') : '',\n ]);\n p.note(table(['Provider', 'Status', 'URL'], rows), 'Deployments');\n for (const o of report.outcomes.filter((o) => !o.ok)) p.log.error(`${o.displayName}: ${describeError(o.error)}`);\n\n const failed = report.outcomes.filter((o) => !o.ok).length;\n if (failed > 0) {\n process.exitCode = 1;\n p.outro(pc.red(`${failed} of ${report.outcomes.length} deployment(s) failed.`));\n } else {\n p.outro(pc.green('All deployments finished.'));\n }\n });\n}\n","import * as p from '@clack/prompts';\nimport pc from 'picocolors';\nimport { DomainError, UserCancelledError } from '../../domain/index.js';\n\n/** Renders rows as an aligned plain-text table. */\nexport function table(headers: string[], rows: string[][]): string {\n // eslint-disable-next-line no-control-regex\n const visible = (s: string) => s.replace(/\\x1b\\[[0-9;]*m/g, '').length;\n const widths = headers.map((h, i) => Math.max(visible(h), ...rows.map((r) => visible(r[i] ?? ''))));\n const line = (cells: string[]) => cells.map((c, i) => c + ' '.repeat(widths[i]! - visible(c))).join(' ').trimEnd();\n return [pc.bold(line(headers)), ...rows.map(line)].join('\\n');\n}\n\n/** One-line cause plus a \"Try:\" hint. Stack traces only with --debug. */\nexport function presentError(error: unknown, debug: boolean): number {\n if (error instanceof UserCancelledError) {\n p.cancel('Cancelled.');\n return 130;\n }\n if (error instanceof DomainError) {\n p.log.error(error.message);\n if (error.hint) p.log.message(`${pc.cyan('Try:')} ${error.hint}`);\n if (debug && error.stack) p.log.message(pc.dim(error.stack));\n return 1;\n }\n p.log.error(`Unexpected error: ${error instanceof Error ? error.message : String(error)}`);\n if (debug && error instanceof Error && error.stack) p.log.message(pc.dim(error.stack));\n else p.log.message(pc.dim('Re-run with --debug for details.'));\n return 1;\n}\n\nexport function describeError(error: unknown): string {\n if (error instanceof DomainError) return error.hint ? `${error.message}\\n ${pc.cyan('Try:')} ${error.hint}` : error.message;\n return error instanceof Error ? error.message : String(error);\n}\n","export const LANGUAGES = [\n 'node',\n 'python',\n 'java',\n 'go',\n 'rust',\n 'ruby',\n 'php',\n 'dotnet',\n 'static',\n 'docker',\n] as const;\n\n/** The primary runtime of a project. `docker` means \"a Dockerfile defines the runtime\". */\nexport type Language = (typeof LANGUAGES)[number];\n\nexport const LANGUAGE_LABELS: Record<Language, string> = {\n node: 'Node.js',\n python: 'Python',\n java: 'Java',\n go: 'Go',\n rust: 'Rust',\n ruby: 'Ruby',\n php: 'PHP',\n dotnet: '.NET',\n static: 'Static site',\n docker: 'Docker',\n};\n","import type { AppKind } from '../value-objects/AppKind.js';\nimport type { Framework } from '../value-objects/Framework.js';\nimport { LANGUAGE_LABELS, type Language } from '../value-objects/Language.js';\n\n/** Everything omnideploy knows about the project being deployed. */\nexport interface ProjectProfile {\n rootDir: string;\n language: Language;\n framework?: Framework;\n kind: AppKind;\n /** e.g. \"21\" for Java, \"3.12\" for Python, \"20\" for Node. */\n runtimeVersion?: string;\n packageManager?: 'npm' | 'pnpm' | 'yarn' | 'bun' | 'pip' | 'poetry' | 'uv' | 'maven' | 'gradle' | 'cargo' | 'bundler' | 'composer' | 'dotnet' | 'go';\n /** Shell command that builds the project, if any. */\n buildCommand?: string;\n /** Shell command that starts a server app. */\n startCommand?: string;\n /** Directory (relative to rootDir) containing static build output. */\n outputDir?: string;\n /** Port a server app listens on by default (the platform's $PORT always wins at runtime). */\n port: number;\n hasDockerfile: boolean;\n /** Language-specific extras for generators (e.g. { buildTool: 'gradle', artifactName: 'app.jar' }). */\n meta?: Record<string, string>;\n}\n\nexport function describeProfile(p: ProjectProfile): string {\n const parts = [\n LANGUAGE_LABELS[p.language] + (p.runtimeVersion ? ` ${p.runtimeVersion}` : ''),\n p.framework,\n p.kind,\n p.kind === 'static' ? (p.outputDir ? `output: ${p.outputDir}` : undefined) : `port ${p.port}`,\n ];\n return parts.filter(Boolean).join(' · ');\n}\n","import type { ProjectProfile } from './ProjectProfile.js';\n\n/** Contents of omnideploy.json — user overrides plus provider state persisted between deploys. */\nexport interface ProjectConfig {\n /** Service/site name used when creating apps on providers. */\n name?: string;\n build?: { command?: string; output?: string };\n app?: { start?: string; port?: number; healthCheckPath?: string };\n providers: Record<string, ProviderOptions>;\n}\n\nexport type ProviderOptions = Record<string, unknown>;\n\nexport const emptyConfig = (): ProjectConfig => ({ providers: {} });\n\n/** User config always overrides detected values. */\nexport function applyConfigOverrides(profile: ProjectProfile, config: ProjectConfig | null): ProjectProfile {\n if (!config) return profile;\n return {\n ...profile,\n buildCommand: config.build?.command ?? profile.buildCommand,\n outputDir: config.build?.output ?? profile.outputDir,\n startCommand: config.app?.start ?? profile.startCommand,\n port: config.app?.port ?? profile.port,\n };\n}\n","/**\n * Base class for expected, user-facing failures. The CLI renders `message` plus `hint`\n * and only shows stack traces with --debug.\n */\nexport class DomainError extends Error {\n constructor(\n message: string,\n readonly hint?: string,\n readonly code: string = 'DOMAIN_ERROR',\n ) {\n super(message);\n this.name = new.target.name;\n }\n}\n\nexport class UnsupportedProjectError extends DomainError {\n constructor(rootDir: string) {\n super(\n `Could not detect a supported project in ${rootDir}.`,\n 'Add a Dockerfile, or set build/app settings in omnideploy.json.',\n 'UNSUPPORTED_PROJECT',\n );\n }\n}\n\nexport class IncompatibleProviderError extends DomainError {\n constructor(provider: string, reason: string, suggestion?: string) {\n super(`${provider}: ${reason}`, suggestion, 'INCOMPATIBLE_PROVIDER');\n }\n}\n\nexport class UnknownProviderError extends DomainError {\n constructor(id: string, known: readonly string[]) {\n super(`Unknown provider \"${id}\".`, `Available providers: ${known.join(', ')}`, 'UNKNOWN_PROVIDER');\n }\n}\n\nexport class MissingCredentialError extends DomainError {\n constructor(provider: string, envVar: string) {\n super(\n `No credentials found for ${provider}.`,\n `Run \\`omnideploy login ${provider}\\` or set ${envVar}.`,\n 'MISSING_CREDENTIAL',\n );\n }\n}\n\nexport class MissingToolError extends DomainError {\n constructor(bin: string, install: string) {\n super(`Required tool \"${bin}\" is not installed.`, `Install it with: ${install}`, 'MISSING_TOOL');\n }\n}\n\nexport class ConfigError extends DomainError {\n constructor(message: string, hint?: string) {\n super(message, hint, 'CONFIG_ERROR');\n }\n}\n\nexport class BuildError extends DomainError {\n constructor(command: string, output?: string) {\n super(\n `Build failed: \\`${command}\\``,\n output ? `Last output:\\n${output}` : 'Fix the build locally, or override it with build.command in omnideploy.json.',\n 'BUILD_FAILED',\n );\n }\n}\n\nexport class ProviderApiError extends DomainError {\n constructor(\n provider: string,\n message: string,\n readonly status?: number,\n hint?: string,\n ) {\n super(`${provider} API error${status ? ` (${status})` : ''}: ${message}`, hint, 'PROVIDER_API_ERROR');\n }\n}\n\nexport class DeploymentFailedError extends DomainError {\n constructor(provider: string, detail: string, hint?: string) {\n super(`${provider} deployment failed: ${detail}`, hint, 'DEPLOYMENT_FAILED');\n }\n}\n\nexport class GitError extends DomainError {\n constructor(message: string, hint?: string) {\n super(message, hint, 'GIT_ERROR');\n }\n}\n\nexport class UserCancelledError extends DomainError {\n constructor() {\n super('Operation cancelled.', undefined, 'CANCELLED');\n }\n}\n","import type { ProjectProfile } from '../entities/ProjectProfile.js';\nimport type { ProviderCapabilities } from '../entities/ProviderCapabilities.js';\nimport { LANGUAGE_LABELS } from '../value-objects/Language.js';\n\nexport type Compatibility = { ok: true } | { ok: false; reason: string };\n\ninterface ProviderLike {\n id: string;\n displayName: string;\n capabilities: ProviderCapabilities;\n}\n\n/** Can a provider with these capabilities host this project? Pure function. */\nexport function checkCompatibility(profile: ProjectProfile, caps: ProviderCapabilities): Compatibility {\n if (profile.kind === 'static') {\n return caps.kinds.includes('static')\n ? { ok: true }\n : { ok: false, reason: 'does not host static sites' };\n }\n\n if (profile.framework && caps.serverlessFrameworks?.includes(profile.framework)) {\n return { ok: true };\n }\n\n // Serverless frameworks (e.g. Next.js) can also run as a regular server elsewhere.\n if (!caps.kinds.includes('server')) {\n const what = profile.framework ?? LANGUAGE_LABELS[profile.language];\n return {\n ok: false,\n reason: !caps.kinds.includes('static')\n ? `cannot run ${what} apps`\n : caps.serverlessFrameworks?.length\n ? `only hosts static sites and ${listOf(caps.serverlessFrameworks)} apps, not ${what} servers`\n : `only hosts static sites, not ${what} servers`,\n };\n }\n\n if (caps.serverLanguages === 'any') return { ok: true };\n if (caps.serverLanguages.includes(profile.language)) return { ok: true };\n return { ok: false, reason: `cannot run ${LANGUAGE_LABELS[profile.language]} server apps` };\n}\n\n/** Providers (other than `exclude`) that can host this project. */\nexport function compatibleProviders<P extends ProviderLike>(\n profile: ProjectProfile,\n providers: readonly P[],\n exclude?: string,\n): P[] {\n return providers.filter((p) => p.id !== exclude && checkCompatibility(profile, p.capabilities).ok);\n}\n\nexport function suggestAlternatives(profile: ProjectProfile, providers: readonly ProviderLike[], exclude: string): string {\n const alts = compatibleProviders(profile, providers, exclude).map((p) => p.displayName);\n return alts.length > 0 ? `Deploy to ${listOf(alts)} instead.` : 'No available provider can host this project yet.';\n}\n\nfunction listOf(items: readonly string[]): string {\n return items.length <= 1 ? (items[0] ?? '') : `${items.slice(0, -1).join(', ')} or ${items.at(-1)}`;\n}\n","/** Turns a directory or package name into a slug that is valid on every provider. */\nexport function toServiceName(raw: string): string {\n const slug = raw\n .toLowerCase()\n .replace(/^@[^/]+\\//, '')\n .replace(/[^a-z0-9-]+/g, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n .slice(0, 50);\n return slug || 'app';\n}\n","import type { ProjectProfile } from '../entities/ProjectProfile.js';\n\nconst SPA_FRAMEWORKS = /^(vite(-.+)?|create-react-app|angular)$/;\n\n/** Client-side routed apps need all unknown paths rewritten to /index.html. */\nexport function isSinglePageApp(profile: ProjectProfile): boolean {\n return profile.kind === 'static' && SPA_FRAMEWORKS.test(profile.framework ?? '');\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport type { CommandEnv } from './types.js';\n\nconst ICON = { ok: pc.green('✔'), warn: pc.yellow('▲'), fail: pc.red('✖') };\n\nexport function registerDoctor(program: Command, env: CommandEnv): void {\n program\n .command('doctor')\n .description('Check that everything needed to deploy this project is in place')\n .action(async () => {\n const c = env.container();\n p.intro(pc.inverse(' omnideploy doctor '));\n const checks = await c.doctor.execute(env.cwd(), { nodeVersion: process.version });\n for (const ch of checks) {\n p.log.message(`${ICON[ch.status]} ${pc.bold(ch.name)}: ${ch.detail}${ch.fix ? ch.fix.split('\\n').map((f) => `\\n ${pc.cyan('Fix:')} ${f}`).join('') : ''}`);\n }\n const failed = checks.filter((ch) => ch.status === 'fail').length;\n const warned = checks.filter((ch) => ch.status === 'warn').length;\n if (failed) process.exitCode = 1;\n p.outro(\n failed ? pc.red(`${failed} problem(s) to fix before deploying.`)\n : warned ? pc.yellow(`Ready, with ${warned} warning(s).`)\n : pc.green('Everything looks good!'),\n );\n });\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport { checkCompatibility, describeProfile, IncompatibleProviderError, suggestAlternatives } from '../../domain/index.js';\nimport type { CommandEnv } from './types.js';\n\nexport function registerGenerate(program: Command, env: CommandEnv): void {\n program\n .command('generate')\n .alias('eject')\n .description('Only write the deployment files (Dockerfile, render.yaml, ...) — deploy them however you like')\n .argument('<providers...>', 'providers to generate files for')\n .option('-f, --force', 'overwrite existing files')\n .option('-y, --yes', 'write without asking')\n .option('--dry-run', 'list the files without writing them')\n .action(async (providerIds: string[], opts: { force?: boolean; yes?: boolean; dryRun?: boolean }) => {\n const c = env.container();\n p.intro(pc.inverse(' omnideploy generate '));\n const { profile, config } = await c.detect.execute(env.cwd());\n p.log.success(`Detected ${describeProfile(profile)}`);\n for (const id of providerIds) {\n const provider = c.providers.get(id);\n const compat = checkCompatibility(profile, provider.capabilities);\n if (!compat.ok) throw new IncompatibleProviderError(provider.displayName, compat.reason, suggestAlternatives(profile, c.providers.all(), id));\n }\n const { planned, written } = await c.generate.execute({ profile, config, providerIds, ...opts });\n const kept = planned.filter((a) => a.action === 'keep').map((a) => a.path);\n if (kept.length) p.log.info(`Kept existing: ${kept.join(', ')} (use --force to regenerate)`);\n p.outro(written.length ? `Wrote ${written.length} file(s).` : opts.dryRun ? 'Dry run — nothing written.' : 'Nothing to generate.');\n });\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport type { CommandEnv } from './types.js';\n\nexport function registerInit(program: Command, env: CommandEnv): void {\n program\n .command('init')\n .description('Detect the project, pick providers, and generate deployment files + omnideploy.json')\n .option('-p, --providers <ids>', 'comma-separated providers (skips the prompt)')\n .option('-y, --yes', 'accept defaults and write files without asking')\n .option('-f, --force', 'overwrite existing deployment files')\n .action(async (opts: { providers?: string; yes?: boolean; force?: boolean }) => {\n const c = env.container();\n p.intro(pc.inverse(' omnideploy init '));\n const result = await c.init.execute({\n rootDir: env.cwd(),\n providerIds: opts.providers?.split(',').map((s) => s.trim()).filter(Boolean),\n yes: opts.yes,\n force: opts.force,\n });\n p.outro(`Ready! Deploy with ${pc.cyan(`omnideploy deploy${result.providerIds.length === 1 ? ` ${result.providerIds[0]}` : ''}`)}`);\n });\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport type { ProjectProfile } from '../../domain/index.js';\nimport { table } from '../presenters/format.js';\nimport type { CommandEnv } from './types.js';\n\nexport function registerProviders(program: Command, env: CommandEnv): void {\n program\n .command('providers')\n .alias('ls')\n .description('List providers, login state, required tools and compatibility with this project')\n .action(async () => {\n const c = env.container();\n let profile: ProjectProfile | undefined;\n try {\n profile = (await c.detect.execute(env.cwd())).profile;\n } catch {\n /* not inside a project — show the list without compatibility */\n }\n const rows = await c.listProviders.execute(profile);\n p.log.message(\n table(\n ['Provider', 'Id', 'Hosts', 'Auth', 'CLI', ...(profile ? ['Fits project'] : [])],\n rows.map((r) => [\n r.displayName,\n pc.dim(r.id),\n r.hosts,\n r.auth ? pc.green(`✔ ${r.auth}`) : pc.yellow('login needed'),\n r.cli ? (r.cli.installed ? pc.green(`✔ ${r.cli.bin}`) : pc.red(`✖ ${r.cli.bin}`)) : pc.dim('—'),\n ...(r.compatibility ? [r.compatibility.ok ? pc.green('✔') : pc.dim(`✖ ${r.compatibility.reason}`)] : []),\n ]),\n ),\n );\n if (rows.some((r) => !r.auth)) p.log.message(pc.dim('Log in with `omnideploy login <id>` or set the provider env var.'));\n });\n}\n","import * as p from '@clack/prompts';\nimport type { Command } from 'commander';\nimport pc from 'picocolors';\nimport type { CommandEnv } from './types.js';\n\nexport function registerStatus(program: Command, env: CommandEnv): void {\n program\n .command('status')\n .description('Show the latest (or a specific) deployment for a provider')\n .argument('<provider>')\n .argument('[deploymentId]')\n .action(async (provider: string, id?: string) => {\n const c = env.container();\n const s = await c.status.execute(env.cwd(), provider, id);\n const color = s.state === 'ready' ? pc.green : s.state === 'error' ? pc.red : pc.yellow;\n p.note(\n [`State: ${color(s.state)}`, `ID: ${s.id}`, s.url && `URL: ${pc.cyan(s.url)}`, s.createdAt && `Created: ${s.createdAt}`, s.message && `Info: ${s.message}`]\n .filter(Boolean)\n .join('\\n'),\n c.providers.get(provider).displayName,\n );\n });\n}\n","import { homedir } from 'node:os';\nimport { join } from 'node:path';\nimport {\n BuildProject,\n CredentialResolver,\n DeployProject,\n DetectProject,\n DoctorCheck,\n GenerateArtifacts,\n GetDeploymentStatus,\n InitProject,\n ListProviders,\n LoginProvider,\n LogoutProvider,\n ProviderRegistry,\n} from '../application/index.js';\nimport { JsonConfigRepository } from '../infrastructure/config/JsonConfigRepository.js';\nimport { FileCredentialStore } from '../infrastructure/credentials/FileCredentialStore.js';\nimport { builtInDetectors } from '../infrastructure/detectors/index.js';\nimport { NodeFileSystem } from '../infrastructure/fs/NodeFileSystem.js';\nimport { builtInGenerators } from '../infrastructure/generators/index.js';\nimport { CliGit } from '../infrastructure/git/CliGit.js';\nimport { FetchHttpClient } from '../infrastructure/http/FetchHttpClient.js';\nimport { ExecaProcessRunner } from '../infrastructure/process/ExecaProcessRunner.js';\nimport { builtInProviders } from '../infrastructure/providers/index.js';\nimport { ClackPrompt } from './presenters/ClackPrompt.js';\nimport { ConsoleLogger } from './presenters/ConsoleLogger.js';\n\nexport interface ContainerOptions {\n debug: boolean;\n interactive: boolean;\n version: string;\n}\n\nexport function credentialsPath(): string {\n const base =\n process.env.OMNIDEPLOY_CONFIG_DIR ??\n (process.platform === 'win32'\n ? join(process.env.APPDATA ?? join(homedir(), 'AppData', 'Roaming'), 'omnideploy')\n : join(process.env.XDG_CONFIG_HOME ?? join(homedir(), '.config'), 'omnideploy'));\n return join(base, 'credentials.json');\n}\n\n/** Composition root: the only place that knows about concrete adapters. */\nexport function createContainer(opts: ContainerOptions) {\n const fs = new NodeFileSystem();\n const proc = new ExecaProcessRunner();\n const http = new FetchHttpClient({ userAgent: `omnideploy/${opts.version}` });\n const git = new CliGit(proc);\n const store = new FileCredentialStore(credentialsPath());\n const configRepo = new JsonConfigRepository(fs);\n const prompt = new ClackPrompt(opts.interactive);\n const logger = new ConsoleLogger(opts.debug);\n\n const providers = new ProviderRegistry(builtInProviders({ http, fs, git, proc }));\n const credentials = new CredentialResolver(store, prompt);\n const detect = new DetectProject(builtInDetectors(fs), configRepo);\n const generate = new GenerateArtifacts(builtInGenerators(), providers, fs, prompt, logger);\n const build = new BuildProject(proc, fs, logger);\n const listProviders = new ListProviders(providers, store, proc);\n\n return {\n prompt,\n logger,\n providers,\n detect,\n generate,\n listProviders,\n init: new InitProject(detect, providers, generate, configRepo, prompt, logger),\n deploy: new DeployProject(detect, providers, generate, build, credentials, configRepo, git, prompt, logger),\n login: new LoginProvider(providers, store, prompt),\n logout: new LogoutProvider(providers, store),\n doctor: new DoctorCheck(detect, listProviders, git),\n status: new GetDeploymentStatus(providers, credentials, configRepo),\n };\n}\n\nexport type Container = ReturnType<typeof createContainer>;\n","import { UnknownProviderError, type DeploymentProvider } from '../../domain/index.js';\n\nexport class ProviderRegistry {\n private readonly byId: Map<string, DeploymentProvider>;\n\n constructor(providers: readonly DeploymentProvider[]) {\n this.byId = new Map(providers.map((p) => [p.id, p]));\n }\n\n all(): DeploymentProvider[] {\n return [...this.byId.values()];\n }\n\n ids(): string[] {\n return [...this.byId.keys()];\n }\n\n get(id: string): DeploymentProvider {\n const p = this.byId.get(id);\n if (!p) throw new UnknownProviderError(id, this.ids());\n return p;\n }\n}\n","import {\n MissingCredentialError,\n type CredentialStorePort,\n type DeploymentProvider,\n type PromptPort,\n} from '../../domain/index.js';\n\n/** Token lookup order: env var → credential store → interactive prompt. */\nexport class CredentialResolver {\n constructor(\n private readonly store: CredentialStorePort,\n private readonly prompt: PromptPort,\n ) {}\n\n async resolve(provider: DeploymentProvider, opts: { allowPrompt: boolean }): Promise<string> {\n const { envVar, tokenUrl } = provider.capabilities.auth;\n const found = await this.store.get(provider.id, envVar);\n if (found) return found.token;\n\n if (!opts.allowPrompt || !this.prompt.interactive) {\n throw new MissingCredentialError(provider.id, envVar);\n }\n\n this.prompt.note(`Create a token at:\\n${tokenUrl}\\n\\nIt will be saved for future deploys (or set ${envVar}).`, `${provider.displayName} login`);\n const token = (await this.prompt.password(`Paste your ${provider.displayName} token`)).trim();\n if (!token) throw new MissingCredentialError(provider.id, envVar);\n await this.store.set(provider.id, token);\n return token;\n }\n}\n","import { toServiceName, type ProjectConfig, type ProjectProfile } from '../../domain/index.js';\n\nexport function resolveServiceName(profile: ProjectProfile, config: ProjectConfig | null): string {\n const raw = config?.name ?? profile.meta?.name ?? profile.rootDir.split(/[\\\\/]/).filter(Boolean).pop() ?? 'app';\n return toServiceName(raw);\n}\n","import {\n applyConfigOverrides,\n UnsupportedProjectError,\n type ConfigRepositoryPort,\n type DetectionResult,\n type ProjectConfig,\n type ProjectDetector,\n type ProjectProfile,\n} from '../../domain/index.js';\n\nexport interface DetectProjectResult {\n profile: ProjectProfile;\n config: ProjectConfig | null;\n /** Other matches, best first — useful for `doctor` and debugging. */\n candidates: DetectionResult[];\n}\n\n/** Runs every detector, keeps the highest-confidence match, then applies omnideploy.json overrides. */\nexport class DetectProject {\n constructor(\n private readonly detectors: readonly ProjectDetector[],\n private readonly configRepo: ConfigRepositoryPort,\n ) {}\n\n async execute(rootDir: string): Promise<DetectProjectResult> {\n const [config, results] = await Promise.all([\n this.configRepo.load(rootDir),\n Promise.all(this.detectors.map((d) => d.detect(rootDir))),\n ]);\n const candidates = results\n .filter((r): r is DetectionResult => r !== null)\n .sort((a, b) => b.confidence - a.confidence);\n\n const best = candidates[0];\n if (!best) {\n // Config alone can describe a project the detectors don't know about.\n if (config?.app?.start || config?.build?.output) {\n const profile = applyConfigOverrides(\n { rootDir, language: 'docker', kind: config.app?.start ? 'server' : 'static', port: 8080, hasDockerfile: false },\n config,\n );\n return { profile, config, candidates };\n }\n throw new UnsupportedProjectError(rootDir);\n }\n\n return { profile: applyConfigOverrides(best.profile, config), config, candidates };\n }\n}\n","import {\n DomainError,\n UserCancelledError,\n type ArtifactGenerator,\n type ArtifactId,\n type DeploymentArtifact,\n type FileSystemPort,\n type LoggerPort,\n type ProjectConfig,\n type ProjectProfile,\n type PromptPort,\n} from '../../domain/index.js';\nimport type { ProviderRegistry } from '../services/ProviderRegistry.js';\nimport { resolveServiceName } from '../services/serviceName.js';\n\nexport type ArtifactAction = 'create' | 'overwrite' | 'keep';\n\nexport interface PlannedArtifact extends DeploymentArtifact {\n action: ArtifactAction;\n providers: string[];\n}\n\nexport interface GenerateArtifactsRequest {\n profile: ProjectProfile;\n config: ProjectConfig | null;\n providerIds: string[];\n force?: boolean;\n yes?: boolean;\n dryRun?: boolean;\n}\n\nexport interface GenerateArtifactsResult {\n planned: PlannedArtifact[];\n written: string[];\n}\n\n/**\n * Works out which deployment files the chosen providers need, renders the missing ones,\n * previews them and writes them after confirmation. Existing files are never overwritten\n * without `force`.\n */\nexport class GenerateArtifacts {\n constructor(\n private readonly generators: readonly ArtifactGenerator[],\n private readonly providers: ProviderRegistry,\n private readonly fs: FileSystemPort,\n private readonly prompt: PromptPort,\n private readonly logger: LoggerPort,\n ) {}\n\n async plan(req: GenerateArtifactsRequest): Promise<PlannedArtifact[]> {\n const serviceName = resolveServiceName(req.profile, req.config);\n const byId = new Map<ArtifactId, PlannedArtifact>();\n\n for (const providerId of req.providerIds) {\n const provider = this.providers.get(providerId);\n for (const id of provider.requiredArtifacts(req.profile)) {\n const existing = byId.get(id);\n if (existing) {\n existing.providers.push(providerId);\n continue;\n }\n const generator = this.generators.find((g) => g.id === id && g.supports(req.profile));\n const exists = await this.fs.exists(this.fs.join(req.profile.rootDir, generator?.path ?? String(id)));\n if (!generator) {\n if (exists) continue; // user-provided file, nothing to generate\n throw new DomainError(\n `${provider.displayName} needs a ${id} for this ${req.profile.language} project, but omnideploy has no template for it.`,\n id === 'dockerfile' ? 'Add a Dockerfile to the project root and run the command again.' : undefined,\n 'NO_GENERATOR',\n );\n }\n const artifact = generator.generate(req.profile, {\n providerId,\n providerOptions: req.config?.providers[providerId] ?? {},\n serviceName,\n healthCheckPath: req.config?.app?.healthCheckPath,\n });\n byId.set(id, {\n ...artifact,\n action: exists ? (req.force ? 'overwrite' : 'keep') : 'create',\n providers: [providerId],\n });\n }\n }\n return [...byId.values()];\n }\n\n async execute(req: GenerateArtifactsRequest): Promise<GenerateArtifactsResult> {\n const planned = await this.plan(req);\n const toWrite = planned.filter((a) => a.action !== 'keep');\n if (toWrite.length === 0) return { planned, written: [] };\n\n this.prompt.note(\n toWrite\n .map((a) => `${a.action === 'create' ? '+' : '~'} ${a.path} — ${a.description} (for ${a.providers.join(', ')})`)\n .join('\\n'),\n req.dryRun ? 'Would generate' : 'Deployment files to generate',\n );\n if (req.dryRun) return { planned, written: [] };\n\n if (!req.yes) {\n if (!this.prompt.interactive) {\n throw new DomainError(\n 'Deployment files need to be generated, but the terminal is not interactive.',\n 'Re-run with --yes to accept, or run `omnideploy generate <provider>` first.',\n 'CONFIRMATION_REQUIRED',\n );\n }\n const showPreview = await this.prompt.confirm('Preview file contents first?', false);\n if (showPreview) for (const a of toWrite) this.prompt.note(a.contents, a.path);\n if (!(await this.prompt.confirm('Write these files?', true))) throw new UserCancelledError();\n }\n\n for (const a of toWrite) {\n await this.fs.writeText(this.fs.join(req.profile.rootDir, a.path), a.contents);\n this.logger.success(`${a.action === 'create' ? 'Created' : 'Updated'} ${a.path}`);\n }\n return { planned, written: toWrite.map((a) => a.path) };\n }\n}\n","import {\n checkCompatibility,\n describeProfile,\n DomainError,\n emptyConfig,\n type ConfigRepositoryPort,\n type LoggerPort,\n type ProjectConfig,\n type ProjectProfile,\n type PromptPort,\n} from '../../domain/index.js';\nimport type { ProviderRegistry } from '../services/ProviderRegistry.js';\nimport { resolveServiceName } from '../services/serviceName.js';\nimport type { DetectProject } from './DetectProject.js';\nimport type { GenerateArtifacts } from './GenerateArtifacts.js';\n\nexport interface InitRequest {\n rootDir: string;\n providerIds?: string[];\n yes?: boolean;\n force?: boolean;\n}\n\nexport interface InitResult {\n profile: ProjectProfile;\n config: ProjectConfig;\n providerIds: string[];\n written: string[];\n}\n\nexport class InitProject {\n constructor(\n private readonly detect: DetectProject,\n private readonly providers: ProviderRegistry,\n private readonly generate: GenerateArtifacts,\n private readonly configRepo: ConfigRepositoryPort,\n private readonly prompt: PromptPort,\n private readonly logger: LoggerPort,\n ) {}\n\n async execute(req: InitRequest): Promise<InitResult> {\n const { profile, config: existing } = await this.detect.execute(req.rootDir);\n this.logger.success(`Detected ${describeProfile(profile)}`);\n\n const compatible = this.providers.all().filter((p) => checkCompatibility(profile, p.capabilities).ok);\n const incompatible = this.providers.all().filter((p) => !compatible.includes(p));\n if (compatible.length === 0) {\n throw new DomainError('None of the available providers can host this project.', undefined, 'NO_PROVIDER');\n }\n\n let providerIds = req.providerIds;\n if (providerIds) {\n for (const id of providerIds) {\n const p = this.providers.get(id);\n const c = checkCompatibility(profile, p.capabilities);\n if (!c.ok) this.logger.warn(`${p.displayName} ${c.reason} — skipping.`);\n }\n providerIds = providerIds.filter((id) => compatible.some((p) => p.id === id));\n } else if (req.yes || !this.prompt.interactive) {\n providerIds = compatible.map((p) => p.id);\n } else {\n if (incompatible.length > 0) {\n this.logger.info(\n `Not offered: ${incompatible.map((p) => `${p.displayName} (${(checkCompatibility(profile, p.capabilities) as { reason: string }).reason})`).join('; ')}`,\n );\n }\n providerIds = await this.prompt.multiselect(\n 'Where do you want to deploy?',\n compatible.map((p) => ({ value: p.id, label: p.displayName, hint: p.capabilities.kinds.join('/') })),\n Object.keys(existing?.providers ?? {}).filter((id) => compatible.some((p) => p.id === id)),\n );\n }\n if (providerIds.length === 0) throw new DomainError('No providers selected.', undefined, 'NO_PROVIDER');\n\n const config: ProjectConfig = existing ?? emptyConfig();\n config.name ??= resolveServiceName(profile, existing);\n if (profile.kind === 'static') {\n config.build = { command: profile.buildCommand, output: profile.outputDir, ...config.build };\n } else {\n config.app = { port: profile.port, start: profile.startCommand, ...config.app };\n }\n for (const id of providerIds) config.providers[id] ??= {};\n\n const { written } = await this.generate.execute({\n profile,\n config,\n providerIds,\n yes: req.yes,\n force: req.force,\n });\n await this.configRepo.save(req.rootDir, config);\n this.logger.success(`Saved ${this.configRepo.fileName}`);\n\n return { profile, config, providerIds, written };\n }\n}\n","import {\n BuildError,\n DomainError,\n type FileSystemPort,\n type LoggerPort,\n type ProcessRunnerPort,\n type ProjectProfile,\n type Spinner,\n} from '../../domain/index.js';\n\n/**\n * Builds static sites locally and returns the directory to upload.\n * Server and serverless apps are built remotely by the provider, so their source root is returned.\n */\nexport class BuildProject {\n constructor(\n private readonly process: ProcessRunnerPort,\n private readonly fs: FileSystemPort,\n private readonly logger: LoggerPort,\n ) {}\n\n async execute(profile: ProjectProfile, opts: { skipBuild?: boolean; spinner?: Spinner }): Promise<string> {\n if (profile.kind !== 'static') return profile.rootDir;\n\n if (profile.buildCommand && !opts.skipBuild) {\n opts.spinner?.start(`Building: ${profile.buildCommand}`);\n const res = await this.process.shell(profile.buildCommand, { cwd: profile.rootDir, env: { CI: '1' } });\n if (res.exitCode !== 0) {\n opts.spinner?.stop('Build failed', false);\n const tail = (res.stderr || res.stdout).trim().split('\\n').slice(-15).join('\\n');\n throw new BuildError(profile.buildCommand, tail);\n }\n opts.spinner?.stop('Build complete');\n }\n\n const out = this.fs.resolve(profile.rootDir, profile.outputDir ?? '.');\n if (!(await this.fs.exists(out))) {\n throw new DomainError(\n `Build output directory \"${profile.outputDir}\" does not exist.`,\n profile.buildCommand && opts.skipBuild\n ? 'Run the build first, or drop --no-build.'\n : 'Set build.output in omnideploy.json to the folder your build produces.',\n 'MISSING_OUTPUT',\n );\n }\n this.logger.debug(`Deploying files from ${out}`);\n return out;\n }\n}\n","import {\n checkCompatibility,\n describeProfile,\n DomainError,\n IncompatibleProviderError,\n suggestAlternatives,\n UserCancelledError,\n type ConfigRepositoryPort,\n type Deployment,\n type DeploymentProvider,\n type GitPort,\n type LoggerPort,\n type ProjectConfig,\n type ProjectProfile,\n type PromptPort,\n} from '../../domain/index.js';\nimport type { CredentialResolver } from '../services/CredentialResolver.js';\nimport type { ProviderRegistry } from '../services/ProviderRegistry.js';\nimport { resolveServiceName } from '../services/serviceName.js';\nimport type { BuildProject } from './BuildProject.js';\nimport type { DetectProject } from './DetectProject.js';\nimport type { GenerateArtifacts } from './GenerateArtifacts.js';\n\nexport interface DeployRequest {\n rootDir: string;\n /** Providers to deploy to; defaults to those in omnideploy.json, or asks. */\n providerIds?: string[];\n production: boolean;\n skipBuild?: boolean;\n /** Override the static output directory. */\n dir?: string;\n dryRun?: boolean;\n yes?: boolean;\n force?: boolean;\n}\n\nexport interface ProviderOutcome {\n provider: string;\n displayName: string;\n ok: boolean;\n deployment?: Deployment;\n error?: unknown;\n}\n\nexport interface DeployReport {\n profile: ProjectProfile;\n dryRun: boolean;\n outcomes: ProviderOutcome[];\n}\n\n/**\n * The main flow: detect → check compatibility → generate missing files → credentials →\n * preflight → sync git (for git-based providers) → build → deploy each provider → persist state.\n */\nexport class DeployProject {\n constructor(\n private readonly detect: DetectProject,\n private readonly providers: ProviderRegistry,\n private readonly generate: GenerateArtifacts,\n private readonly build: BuildProject,\n private readonly credentials: CredentialResolver,\n private readonly configRepo: ConfigRepositoryPort,\n private readonly git: GitPort,\n private readonly prompt: PromptPort,\n private readonly logger: LoggerPort,\n ) {}\n\n async execute(req: DeployRequest): Promise<DeployReport> {\n const detected = await this.detect.execute(req.rootDir);\n let profile = detected.profile;\n if (req.dir) profile = { ...profile, kind: 'static', outputDir: req.dir, buildCommand: req.skipBuild ? undefined : profile.buildCommand };\n const config: ProjectConfig = detected.config ?? { providers: {} };\n this.logger.success(`Detected ${describeProfile(profile)}`);\n\n const targets = await this.chooseProviders(req, profile, config);\n\n // 1. Compatibility — fail before touching anything.\n for (const p of targets) {\n const c = checkCompatibility(profile, p.capabilities);\n if (!c.ok) throw new IncompatibleProviderError(p.displayName, c.reason, suggestAlternatives(profile, this.providers.all(), p.id));\n }\n\n // 2. Deployment files (Dockerfile, render.yaml, ...).\n const { planned, written } = await this.generate.execute({\n profile,\n config,\n providerIds: targets.map((p) => p.id),\n yes: req.yes,\n force: req.force,\n dryRun: req.dryRun,\n });\n if (planned.some((a) => a.id === 'dockerfile')) profile = { ...profile, hasDockerfile: true };\n\n // 3. Credentials + provider preflight.\n const tokens = new Map<string, string>();\n for (const p of targets) {\n if (req.dryRun) {\n await this.credentials.resolve(p, { allowPrompt: false }).then(\n (t) => tokens.set(p.id, t),\n () => this.logger.warn(`${p.displayName}: no credentials (run \\`omnideploy login ${p.id}\\`)`),\n );\n continue;\n }\n tokens.set(p.id, await this.credentials.resolve(p, { allowPrompt: !req.yes }));\n await p.validate({ profile, rootDir: req.rootDir, options: config.providers[p.id] ?? {}, token: tokens.get(p.id)! });\n }\n\n // 4. Git-based providers build from the remote — make sure generated files are pushed.\n const gitTargets = targets.filter((p) => p.capabilities.buildsFromGit);\n if (gitTargets.length > 0 && !req.dryRun) await this.syncGitRemote(req, gitTargets, written);\n\n if (req.dryRun) {\n this.logger.info(`Dry run: would deploy to ${targets.map((p) => p.displayName).join(', ')}.`);\n return { profile, dryRun: true, outcomes: [] };\n }\n\n // 5. Build once (static sites only), then deploy to each target.\n const sourceDir = await this.build.execute(profile, { skipBuild: req.skipBuild, spinner: this.prompt.spinner() });\n const serviceName = resolveServiceName(profile, config);\n const outcomes: ProviderOutcome[] = [];\n\n for (const p of targets) {\n const spinner = this.prompt.spinner();\n spinner.start(`Deploying to ${p.displayName}`);\n try {\n const deployment = await p.deploy({\n profile,\n options: config.providers[p.id] ?? {},\n token: tokens.get(p.id)!,\n sourceDir,\n production: req.production,\n serviceName,\n logger: this.logger,\n progress: (m) => spinner.message(`${p.displayName}: ${m}`),\n });\n spinner.stop(`${p.displayName}: ${deployment.url ?? 'deployed'}`, true);\n outcomes.push({ provider: p.id, displayName: p.displayName, ok: true, deployment });\n config.providers[p.id] = { ...config.providers[p.id], ...deployment.configUpdates };\n await this.configRepo.save(req.rootDir, config);\n } catch (error) {\n spinner.stop(`${p.displayName}: failed`, false);\n outcomes.push({ provider: p.id, displayName: p.displayName, ok: false, error });\n }\n }\n return { profile, dryRun: false, outcomes };\n }\n\n private async chooseProviders(req: DeployRequest, profile: ProjectProfile, config: ProjectConfig): Promise<DeploymentProvider[]> {\n let ids = req.providerIds?.length ? req.providerIds : Object.keys(config.providers);\n if (ids.length === 0) {\n const compatible = this.providers.all().filter((p) => checkCompatibility(profile, p.capabilities).ok);\n if (!this.prompt.interactive || req.yes) {\n throw new DomainError(\n 'No provider given.',\n `Run \\`omnideploy deploy <provider>\\` (compatible: ${compatible.map((p) => p.id).join(', ')}) or \\`omnideploy init\\`.`,\n 'NO_PROVIDER',\n );\n }\n ids = [\n await this.prompt.select(\n 'Deploy to which provider?',\n compatible.map((p) => ({ value: p.id, label: p.displayName })),\n ),\n ];\n }\n return ids.map((id) => this.providers.get(id));\n }\n\n private async syncGitRemote(req: DeployRequest, targets: DeploymentProvider[], generated: string[]): Promise<void> {\n const names = targets.map((p) => p.displayName).join(', ');\n if (!(await this.git.isRepo(req.rootDir)) || !(await this.git.remote(req.rootDir))) {\n throw new DomainError(\n `${names} builds from a git repository, but this project has no git remote.`,\n 'Push the project to GitHub/GitLab (git init && git remote add origin <url> && git push -u origin HEAD).',\n 'NO_GIT_REMOTE',\n );\n }\n const dirty = await this.git.dirtyPaths(req.rootDir);\n if (dirty.length === 0) return;\n\n const generatedDirty = dirty.filter((d) => generated.includes(d) || ['Dockerfile', '.dockerignore', 'render.yaml', 'omnideploy.json'].includes(d));\n const otherDirty = dirty.filter((d) => !generatedDirty.includes(d));\n if (otherDirty.length > 0) {\n this.logger.warn(`${otherDirty.length} other uncommitted change(s) will NOT be deployed by ${names} (it builds from the remote).`);\n }\n if (generatedDirty.length === 0) return;\n\n const ok =\n req.yes ||\n (this.prompt.interactive &&\n (await this.prompt.confirm(`${names} builds from your git remote. Commit and push ${generatedDirty.join(', ')}?`, true)));\n if (!ok) {\n if (!this.prompt.interactive && !req.yes) {\n throw new DomainError('Deployment files must be committed and pushed first.', 'Commit them yourself, or re-run with --yes.', 'GIT_SYNC_REQUIRED');\n }\n throw new UserCancelledError();\n }\n await this.git.commit(req.rootDir, generatedDirty, 'chore: add deployment configuration (omnideploy)');\n await this.git.push(req.rootDir);\n this.logger.success('Pushed deployment files');\n }\n}\n","import { DomainError, type CredentialStorePort, type PromptPort } from '../../domain/index.js';\nimport type { ProviderRegistry } from '../services/ProviderRegistry.js';\n\nexport class LoginProvider {\n constructor(\n private readonly providers: ProviderRegistry,\n private readonly store: CredentialStorePort,\n private readonly prompt: PromptPort,\n ) {}\n\n async execute(providerId: string, token?: string): Promise<void> {\n const p = this.providers.get(providerId);\n if (!token) {\n if (!this.prompt.interactive) {\n throw new DomainError('No token given.', `Pass --token, or set ${p.capabilities.auth.envVar}.`, 'MISSING_TOKEN');\n }\n this.prompt.note(`Create a token at:\\n${p.capabilities.auth.tokenUrl}`, `${p.displayName} login`);\n token = await this.prompt.password(`Paste your ${p.displayName} token`);\n }\n token = token.trim();\n if (!token) throw new DomainError('Empty token.', undefined, 'MISSING_TOKEN');\n await this.store.set(p.id, token);\n }\n}\n\nexport class LogoutProvider {\n constructor(\n private readonly providers: ProviderRegistry,\n private readonly store: CredentialStorePort,\n ) {}\n\n async execute(providerId: string): Promise<boolean> {\n return this.store.delete(this.providers.get(providerId).id);\n }\n}\n","import {\n checkCompatibility,\n type CredentialStorePort,\n type ProcessRunnerPort,\n type ProjectProfile,\n} from '../../domain/index.js';\nimport type { ProviderRegistry } from '../services/ProviderRegistry.js';\n\nexport interface ProviderRow {\n id: string;\n displayName: string;\n hosts: string;\n auth: 'env' | 'store' | null;\n cli: { bin: string; installed: boolean; install: string } | null;\n compatibility?: { ok: boolean; reason?: string };\n}\n\nexport class ListProviders {\n constructor(\n private readonly providers: ProviderRegistry,\n private readonly store: CredentialStorePort,\n private readonly process: ProcessRunnerPort,\n ) {}\n\n async execute(profile?: ProjectProfile): Promise<ProviderRow[]> {\n return Promise.all(\n this.providers.all().map(async (p): Promise<ProviderRow> => {\n const cred = await this.store.get(p.id, p.capabilities.auth.envVar);\n const req = p.capabilities.requiredCli;\n const c = profile ? checkCompatibility(profile, p.capabilities) : undefined;\n return {\n id: p.id,\n displayName: p.displayName,\n hosts: p.capabilities.kinds.join(', '),\n auth: cred?.source ?? null,\n cli: req ? { bin: req.bin, installed: await this.process.has(req.bin), install: req.install } : null,\n compatibility: c && (c.ok ? { ok: true } : { ok: false, reason: c.reason }),\n };\n }),\n );\n }\n}\n","import {\n describeProfile,\n DomainError,\n type GitPort,\n type ProjectProfile,\n} from '../../domain/index.js';\nimport type { DetectProject } from './DetectProject.js';\nimport type { ListProviders } from './ListProviders.js';\n\nexport interface Check {\n name: string;\n status: 'ok' | 'warn' | 'fail';\n detail: string;\n fix?: string;\n}\n\nexport class DoctorCheck {\n constructor(\n private readonly detect: DetectProject,\n private readonly listProviders: ListProviders,\n private readonly git: GitPort,\n ) {}\n\n async execute(rootDir: string, runtime: { nodeVersion: string }): Promise<Check[]> {\n const checks: Check[] = [];\n const major = Number(runtime.nodeVersion.replace(/^v/, '').split('.')[0]);\n checks.push(\n major >= 20\n ? { name: 'Node.js', status: 'ok', detail: runtime.nodeVersion }\n : { name: 'Node.js', status: 'fail', detail: runtime.nodeVersion, fix: 'Install Node.js 20 or newer.' },\n );\n\n let profile: ProjectProfile | undefined;\n let configured: string[] = [];\n try {\n const r = await this.detect.execute(rootDir);\n profile = r.profile;\n configured = Object.keys(r.config?.providers ?? {});\n checks.push({ name: 'Project', status: 'ok', detail: describeProfile(r.profile) });\n checks.push(\n r.config\n ? { name: 'Config', status: 'ok', detail: `omnideploy.json (${configured.join(', ') || 'no providers'})` }\n : { name: 'Config', status: 'warn', detail: 'no omnideploy.json', fix: 'Run `omnideploy init`.' },\n );\n } catch (e) {\n checks.push({\n name: 'Project',\n status: 'fail',\n detail: e instanceof Error ? e.message : String(e),\n fix: e instanceof DomainError ? e.hint : undefined,\n });\n }\n\n if (await this.git.isRepo(rootDir)) {\n const remote = await this.git.remote(rootDir);\n checks.push(\n remote\n ? { name: 'Git remote', status: 'ok', detail: remote.url }\n : { name: 'Git remote', status: 'warn', detail: 'none', fix: 'Render and GitHub Pages need a pushed git remote (git remote add origin <url>).' },\n );\n } else {\n checks.push({ name: 'Git', status: 'warn', detail: 'not a git repository', fix: 'Render and GitHub Pages need one: git init.' });\n }\n\n for (const row of await this.listProviders.execute(profile)) {\n const relevant = configured.length === 0 || configured.includes(row.id);\n if (!relevant) continue;\n const problems: string[] = [];\n const fixes: string[] = [];\n if (!row.auth) {\n problems.push('not logged in');\n fixes.push(`omnideploy login ${row.id}`);\n }\n if (row.cli && !row.cli.installed) {\n problems.push(`${row.cli.bin} CLI missing`);\n fixes.push(row.cli.install);\n }\n if (row.compatibility && !row.compatibility.ok) problems.push(row.compatibility.reason ?? 'incompatible');\n checks.push({\n name: row.displayName,\n status: problems.length === 0 ? 'ok' : configured.includes(row.id) ? 'fail' : 'warn',\n detail: problems.length === 0 ? `ready (token from ${row.auth})` : problems.join(', '),\n fix: fixes.join('\\n') || undefined,\n });\n }\n return checks;\n }\n}\n","import { DomainError, type ConfigRepositoryPort, type DeploymentStatus } from '../../domain/index.js';\nimport type { CredentialResolver } from '../services/CredentialResolver.js';\nimport type { ProviderRegistry } from '../services/ProviderRegistry.js';\n\nexport class GetDeploymentStatus {\n constructor(\n private readonly providers: ProviderRegistry,\n private readonly credentials: CredentialResolver,\n private readonly configRepo: ConfigRepositoryPort,\n ) {}\n\n async execute(rootDir: string, providerId: string, deploymentId?: string): Promise<DeploymentStatus> {\n const p = this.providers.get(providerId);\n if (!p.status) throw new DomainError(`${p.displayName} does not support status checks yet.`, undefined, 'UNSUPPORTED');\n const config = await this.configRepo.load(rootDir);\n const token = await this.credentials.resolve(p, { allowPrompt: true });\n return p.status({ options: config?.providers[p.id] ?? {}, token }, deploymentId);\n }\n}\n","import { z } from 'zod';\nimport { ConfigError, type ConfigRepositoryPort, type FileSystemPort, type ProjectConfig } from '../../domain/index.js';\n\nconst schema = z.object({\n $schema: z.string().optional(),\n name: z.string().min(1).optional(),\n build: z.object({ command: z.string().optional(), output: z.string().optional() }).optional(),\n app: z\n .object({\n start: z.string().optional(),\n port: z.number().int().min(1).max(65535).optional(),\n healthCheckPath: z.string().startsWith('/').optional(),\n })\n .optional(),\n providers: z.record(z.string(), z.record(z.string(), z.unknown())).default({}),\n});\n\nconst SCHEMA_URL = 'https://unpkg.com/omnideploy/schema.json';\n\nexport class JsonConfigRepository implements ConfigRepositoryPort {\n readonly fileName = 'omnideploy.json';\n\n constructor(private readonly fs: FileSystemPort) {}\n\n async load(rootDir: string): Promise<ProjectConfig | null> {\n const raw = await this.fs.readTextIfExists(this.fs.join(rootDir, this.fileName));\n if (raw === null) return null;\n let json: unknown;\n try {\n json = JSON.parse(raw);\n } catch (e) {\n throw new ConfigError(`${this.fileName} is not valid JSON: ${(e as Error).message}`);\n }\n const parsed = schema.safeParse(json);\n if (!parsed.success) {\n const issues = parsed.error.issues.map((i) => ` • ${i.path.join('.') || '(root)'}: ${i.message}`).join('\\n');\n throw new ConfigError(`${this.fileName} is invalid:\\n${issues}`, 'Fix the fields above or delete the file and run `omnideploy init`.');\n }\n const { $schema: _ignored, ...config } = parsed.data;\n return config;\n }\n\n async save(rootDir: string, config: ProjectConfig): Promise<void> {\n // Stable, human-friendly key order: identity, build, runtime, then provider state.\n const { name, build, app, providers, ...rest } = config;\n const ordered = { $schema: SCHEMA_URL, name, build, app, ...rest, providers };\n await this.fs.writeText(this.fs.join(rootDir, this.fileName), JSON.stringify(stripUndefined(ordered), null, 2) + '\\n');\n }\n}\n\nfunction stripUndefined<T>(value: T): T {\n return JSON.parse(JSON.stringify(value)) as T;\n}\n","import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport type { CredentialStorePort, StoredCredential } from '../../domain/index.js';\n\ninterface CredentialFile {\n providers: Record<string, { token: string; savedAt: string }>;\n}\n\n/** Env var first, then a JSON file readable only by the current user (mode 0600). */\nexport class FileCredentialStore implements CredentialStorePort {\n constructor(\n private readonly filePath: string,\n private readonly env: Record<string, string | undefined> = process.env,\n ) {}\n\n async get(providerId: string, envVar: string): Promise<StoredCredential | null> {\n const fromEnv = this.env[envVar]?.trim();\n if (fromEnv) return { token: fromEnv, source: 'env' };\n const stored = (await this.read()).providers[providerId];\n return stored ? { token: stored.token, source: 'store' } : null;\n }\n\n async set(providerId: string, token: string): Promise<void> {\n const data = await this.read();\n data.providers[providerId] = { token, savedAt: new Date().toISOString() };\n await this.write(data);\n }\n\n async delete(providerId: string): Promise<boolean> {\n const data = await this.read();\n if (!data.providers[providerId]) return false;\n delete data.providers[providerId];\n await this.write(data);\n return true;\n }\n\n private async read(): Promise<CredentialFile> {\n try {\n const parsed = JSON.parse(await readFile(this.filePath, 'utf8')) as Partial<CredentialFile>;\n return { providers: parsed.providers ?? {} };\n } catch {\n return { providers: {} };\n }\n }\n\n private async write(data: CredentialFile): Promise<void> {\n await mkdir(dirname(this.filePath), { recursive: true, mode: 0o700 });\n await writeFile(this.filePath, JSON.stringify(data, null, 2) + '\\n', { mode: 0o600 });\n await chmod(this.filePath, 0o600);\n }\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\n\n/** Any project with a Dockerfile can be deployed as a container, even if no language detector matches. */\nexport class DockerDetector implements ProjectDetector {\n readonly id = 'docker';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const dockerfile = await this.fs.readTextIfExists(this.fs.join(root, 'Dockerfile'));\n if (dockerfile === null) return null;\n const port = Number(dockerfile.match(/^\\s*EXPOSE\\s+(\\d+)/im)?.[1] ?? 8080);\n return {\n profile: { rootDir: root, language: 'docker', kind: 'server', port, hasDockerfile: true },\n confidence: 20,\n };\n }\n}\n","import type { FileSystemPort } from '../../domain/index.js';\n\nexport async function readJson<T = Record<string, any>>(fs: FileSystemPort, path: string): Promise<T | null> {\n const raw = await fs.readTextIfExists(path);\n if (raw === null) return null;\n try {\n return JSON.parse(raw) as T;\n } catch {\n return null;\n }\n}\n\nexport async function firstExisting(fs: FileSystemPort, root: string, candidates: string[]): Promise<string | undefined> {\n for (const c of candidates) if (await fs.exists(fs.join(root, c))) return c;\n return undefined;\n}\n\nexport function hasDockerfile(fs: FileSystemPort, root: string): Promise<boolean> {\n return fs.exists(fs.join(root, 'Dockerfile'));\n}\n\n/** \"^8.2\", \">=3.11,<4\", \"v20.11.0\", \"21\" → \"8.2\", \"3.11\", \"20\", \"21\" */\nexport function extractVersion(spec: string | undefined | null, parts = 2): string | undefined {\n if (!spec) return undefined;\n const m = spec.match(/(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?/);\n if (!m) return undefined;\n return [m[1], m[2], m[3]].slice(0, parts).filter((x) => x !== undefined).join('.');\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { hasDockerfile } from './support.js';\n\nexport class DotnetDetector implements ProjectDetector {\n readonly id = 'dotnet';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const csproj = (await this.fs.list(root)).find((f) => f.endsWith('.csproj') || f.endsWith('.fsproj'));\n if (!csproj) return null;\n const xml = await this.fs.readText(this.fs.join(root, csproj));\n const assembly = xml.match(/<AssemblyName>([^<]+)</)?.[1] ?? csproj.replace(/\\.[cf]sproj$/, '');\n const version = xml.match(/<TargetFramework>net(\\d+\\.\\d+)</)?.[1] ?? '8.0';\n const web = /Sdk=\"Microsoft\\.NET\\.Sdk\\.Web\"/.test(xml);\n\n return {\n profile: {\n rootDir: root,\n language: 'dotnet',\n framework: web ? 'aspnetcore' : undefined,\n kind: 'server',\n packageManager: 'dotnet',\n runtimeVersion: version,\n buildCommand: 'dotnet publish -c Release -o out',\n startCommand: `dotnet ${assembly}.dll`,\n port: 8080,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: { name: assembly, assembly, projectFile: csproj },\n },\n confidence: web ? 85 : 70,\n };\n }\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { extractVersion, hasDockerfile } from './support.js';\n\nexport class GoDetector implements ProjectDetector {\n readonly id = 'go';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const gomod = await this.fs.readTextIfExists(this.fs.join(root, 'go.mod'));\n if (gomod === null) return null;\n const module = gomod.match(/^module\\s+(\\S+)/m)?.[1] ?? '';\n const framework = [\n ['github.com/gin-gonic/gin', 'gin'],\n ['github.com/labstack/echo', 'echo'],\n ['github.com/gofiber/fiber', 'fiber'],\n ['github.com/go-chi/chi', 'chi'],\n ].find(([mod]) => gomod.includes(mod!))?.[1];\n\n let mainPath = '.';\n if (!(await this.fs.exists(this.fs.join(root, 'main.go')))) {\n const cmds = await this.fs.list(this.fs.join(root, 'cmd'));\n for (const c of cmds) {\n if (await this.fs.exists(this.fs.join(root, 'cmd', c, 'main.go'))) {\n mainPath = `./cmd/${c}`;\n break;\n }\n }\n }\n\n return {\n profile: {\n rootDir: root,\n language: 'go',\n framework,\n kind: 'server',\n packageManager: 'go',\n runtimeVersion: extractVersion(gomod.match(/^go\\s+([\\d.]+)/m)?.[1]) ?? '1.23',\n buildCommand: `go build -o app ${mainPath}`,\n startCommand: './app',\n port: 8080,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: { name: module.split('/').pop() ?? '', mainPath },\n },\n confidence: 85,\n };\n }\n}\n","import { XMLParser } from 'fast-xml-parser';\nimport type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { extractVersion, hasDockerfile } from './support.js';\n\nconst JVM_FRAMEWORKS: Array<[marker: RegExp, framework: string]> = [\n [/spring-boot|org\\.springframework\\.boot/, 'spring-boot'],\n [/io\\.quarkus/, 'quarkus'],\n [/io\\.micronaut/, 'micronaut'],\n];\n\n/** System property each framework reads to choose its HTTP port. */\nconst PORT_PROPERTY: Record<string, string> = {\n 'spring-boot': 'server.port',\n quarkus: 'quarkus.http.port',\n micronaut: 'micronaut.server.port',\n};\n\nexport class JavaDetector implements ProjectDetector {\n readonly id = 'java';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const read = (f: string) => this.fs.readTextIfExists(this.fs.join(root, f));\n const pom = await read('pom.xml');\n const gradle = (await read('build.gradle.kts')) ?? (await read('build.gradle'));\n if (pom === null && gradle === null) return null;\n\n const buildTool = pom !== null ? 'maven' : 'gradle';\n const source = pom ?? gradle!;\n const framework = JVM_FRAMEWORKS.find(([re]) => re.test(source))?.[1];\n const hasWrapper = await this.fs.exists(this.fs.join(root, buildTool === 'maven' ? 'mvnw' : 'gradlew'));\n\n let name = '';\n let javaVersion: string | undefined;\n if (pom !== null) {\n const project = new XMLParser({ ignoreAttributes: true }).parse(pom)?.project ?? {};\n name = String(project.artifactId ?? '');\n const props = project.properties ?? {};\n javaVersion = extractVersion(String(props['java.version'] ?? props['maven.compiler.release'] ?? props['maven.compiler.source'] ?? ''), 1);\n } else {\n javaVersion =\n extractVersion(gradle!.match(/JavaLanguageVersion\\.of\\((\\d+)\\)/)?.[1], 1) ??\n extractVersion(gradle!.match(/VERSION_(\\d+)/)?.[1], 1) ??\n extractVersion(gradle!.match(/sourceCompatibility\\s*=\\s*['\"]?([\\d.]+)/)?.[1], 1);\n const settings = (await read('settings.gradle.kts')) ?? (await read('settings.gradle'));\n name = settings?.match(/rootProject\\.name\\s*=\\s*['\"]([^'\"]+)/)?.[1] ?? '';\n }\n // Java 1.8 → 8\n if (javaVersion === '1') javaVersion = '8';\n const runtimeVersion = javaVersion ?? '21';\n\n const tool = buildTool === 'maven' ? (hasWrapper ? './mvnw' : 'mvn') : hasWrapper ? './gradlew' : 'gradle';\n const buildCommand =\n buildTool === 'maven'\n ? `${tool} -B -DskipTests package`\n : `${tool} ${framework === 'spring-boot' ? 'bootJar' : 'build'} -x test --no-daemon`;\n const portProp = framework ? PORT_PROPERTY[framework] : undefined;\n\n return {\n profile: {\n rootDir: root,\n language: 'java',\n framework,\n kind: 'server',\n runtimeVersion,\n packageManager: buildTool,\n buildCommand,\n startCommand: `java ${portProp ? `-D${portProp}=$PORT ` : ''}-jar app.jar`,\n port: 8080,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: {\n name,\n buildTool,\n wrapper: String(hasWrapper),\n jarDir: buildTool === 'maven' ? 'target' : 'build/libs',\n portProperty: portProp ?? '',\n quarkus: String(framework === 'quarkus'),\n },\n },\n confidence: 85,\n };\n }\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector, ProjectProfile } from '../../domain/index.js';\nimport { extractVersion, firstExisting, hasDockerfile, readJson } from './support.js';\n\ninterface PackageJson {\n name?: string;\n main?: string;\n scripts?: Record<string, string>;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n engines?: { node?: string };\n}\n\nexport class NodeDetector implements ProjectDetector {\n readonly id = 'node';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const pkg = await readJson<PackageJson>(this.fs, this.fs.join(root, 'package.json'));\n if (!pkg) return null;\n\n const deps = { ...pkg.dependencies, ...pkg.devDependencies };\n const has = (name: string) => name in deps;\n const scripts = pkg.scripts ?? {};\n const pm = await this.packageManager(root);\n const run = (script: string) => (pm === 'npm' ? `npm run ${script}` : `${pm} run ${script}`);\n const install = { npm: 'npm ci', pnpm: 'pnpm install --frozen-lockfile', yarn: 'yarn install --frozen-lockfile', bun: 'bun install' }[pm];\n const nvmrc = await this.fs.readTextIfExists(this.fs.join(root, '.nvmrc'));\n\n const base: ProjectProfile = {\n rootDir: root,\n language: 'node',\n kind: 'server',\n packageManager: pm,\n runtimeVersion: extractVersion(pkg.engines?.node, 1) ?? extractVersion(nvmrc, 1) ?? '22',\n port: 3000,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: { name: pkg.name ?? '', install, lockfile: (await this.lockfile(root)) ?? '' },\n };\n const build = scripts.build ? run('build') : undefined;\n const start = scripts.start ? (pm === 'npm' ? 'npm start' : `${pm} start`) : undefined;\n const staticSite = (framework: string, outputDir: string): DetectionResult => ({\n profile: { ...base, framework, kind: 'static', buildCommand: build, outputDir },\n confidence: 90,\n });\n const server = (framework: string | undefined, startCommand: string | undefined, port = 3000): DetectionResult => ({\n profile: { ...base, framework, kind: 'server', buildCommand: build, startCommand, port },\n confidence: 90,\n });\n\n if (has('next')) {\n const nextConfig = await this.readFirst(root, ['next.config.js', 'next.config.mjs', 'next.config.ts']);\n if (nextConfig && /output\\s*:\\s*['\"]export['\"]/.test(nextConfig)) return staticSite('nextjs', 'out');\n return { profile: { ...base, framework: 'nextjs', kind: 'serverless', buildCommand: build, startCommand: start ?? 'npx next start' }, confidence: 90 };\n }\n if (has('nuxt')) return server('nuxt', 'node .output/server/index.mjs');\n if (has('@sveltejs/kit')) {\n return has('@sveltejs/adapter-static') ? staticSite('sveltekit', 'build') : server('sveltekit', 'node build');\n }\n if (has('@remix-run/node') || has('@remix-run/serve')) return server('remix', start);\n if (has('astro')) return has('@astrojs/node') ? server('astro', 'node ./dist/server/entry.mjs', 4321) : staticSite('astro', 'dist');\n if (has('gatsby')) return staticSite('gatsby', 'public');\n if (has('@angular/core')) return staticSite('angular', `dist/${pkg.name ?? 'app'}/browser`);\n if (has('react-scripts')) return staticSite('create-react-app', 'build');\n if (has('@nestjs/core')) return server('nestjs', scripts['start:prod'] ? run('start:prod') : 'node dist/main');\n\n for (const fw of ['express', 'fastify', 'koa', 'hono', '@hapi/hapi']) {\n if (has(fw)) return server(fw.replace('@hapi/', ''), start ?? `node ${pkg.main ?? 'index.js'}`);\n }\n if (has('vite')) {\n const viteFw = ['react', 'vue', 'svelte', 'solid-js', 'preact'].find(has);\n return staticSite(viteFw ? `vite-${viteFw.replace('-js', '')}` : 'vite', 'dist');\n }\n if (start) return server(undefined, start);\n if (build) return { ...staticSite('node-static', 'dist'), confidence: 60 };\n return null;\n }\n\n private async packageManager(root: string): Promise<'npm' | 'pnpm' | 'yarn' | 'bun'> {\n const lock = await this.lockfile(root);\n if (lock === 'pnpm-lock.yaml') return 'pnpm';\n if (lock === 'yarn.lock') return 'yarn';\n if (lock?.startsWith('bun.lock')) return 'bun';\n return 'npm';\n }\n\n private lockfile(root: string) {\n return firstExisting(this.fs, root, ['pnpm-lock.yaml', 'yarn.lock', 'bun.lockb', 'bun.lock', 'package-lock.json']);\n }\n\n private async readFirst(root: string, files: string[]): Promise<string | null> {\n const f = await firstExisting(this.fs, root, files);\n return f ? this.fs.readText(this.fs.join(root, f)) : null;\n }\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { extractVersion, hasDockerfile, readJson } from './support.js';\n\nexport class PhpDetector implements ProjectDetector {\n readonly id = 'php';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const composer = await readJson<{ name?: string; require?: Record<string, string> }>(this.fs, this.fs.join(root, 'composer.json'));\n const hasIndex = await this.fs.exists(this.fs.join(root, 'index.php'));\n const hasPublicIndex = await this.fs.exists(this.fs.join(root, 'public', 'index.php'));\n if (!composer && !hasIndex && !hasPublicIndex) return null;\n\n const req = composer?.require ?? {};\n const framework = 'laravel/framework' in req ? 'laravel' : 'symfony/framework-bundle' in req ? 'symfony' : undefined;\n const docroot = hasPublicIndex || framework ? 'public' : '.';\n\n return {\n profile: {\n rootDir: root,\n language: 'php',\n framework,\n kind: 'server',\n packageManager: composer ? 'composer' : undefined,\n runtimeVersion: extractVersion(req.php) ?? '8.3',\n startCommand: framework === 'laravel' ? 'php artisan serve --host=0.0.0.0 --port=$PORT' : `php -S 0.0.0.0:$PORT -t ${docroot}`,\n port: 8080,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: { name: composer?.name?.split('/').pop() ?? '', docroot, composer: String(Boolean(composer)) },\n },\n confidence: composer ? 80 : 50,\n };\n }\n}\n","import { parse as parseToml } from 'smol-toml';\nimport type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { extractVersion, firstExisting, hasDockerfile } from './support.js';\n\nexport class PythonDetector implements ProjectDetector {\n readonly id = 'python';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const read = (f: string) => this.fs.readTextIfExists(this.fs.join(root, f));\n const [requirements, pyprojectRaw, pipfile, hasManage] = await Promise.all([\n read('requirements.txt'),\n read('pyproject.toml'),\n read('Pipfile'),\n this.fs.exists(this.fs.join(root, 'manage.py')),\n ]);\n if (requirements === null && pyprojectRaw === null && pipfile === null && !hasManage) return null;\n\n let pyproject: Record<string, any> = {};\n try {\n pyproject = pyprojectRaw ? (parseToml(pyprojectRaw) as Record<string, any>) : {};\n } catch {\n /* tolerate invalid pyproject */\n }\n const depsText = [requirements, pyprojectRaw, pipfile].filter(Boolean).join('\\n').toLowerCase();\n const has = (name: string) => new RegExp(`(^|[\\\\s\"'\\\\[,])${name}([\\\\s\"'<>=~!\\\\[,;]|$)`, 'm').test(depsText);\n\n const packageManager = (await this.fs.exists(this.fs.join(root, 'uv.lock')))\n ? 'uv'\n : (await this.fs.exists(this.fs.join(root, 'poetry.lock'))) || pyproject.tool?.poetry\n ? 'poetry'\n : 'pip';\n const runtimeVersion =\n extractVersion(await read('.python-version')) ??\n extractVersion((await read('runtime.txt'))?.replace('python-', '')) ??\n extractVersion(pyproject.project?.['requires-python']) ??\n '3.12';\n\n const name: string = pyproject.project?.name ?? pyproject.tool?.poetry?.name ?? '';\n const base = {\n rootDir: root,\n language: 'python' as const,\n kind: 'server' as const,\n packageManager: packageManager as 'uv' | 'poetry' | 'pip',\n runtimeVersion,\n hasDockerfile: await hasDockerfile(this.fs, root),\n };\n const requirementsMeta = { requirements: String(requirements !== null) };\n\n if (hasManage || has('django')) {\n const project = await this.findDjangoProject(root);\n return {\n profile: {\n ...base,\n framework: 'django',\n port: 8000,\n startCommand: `gunicorn ${project}.wsgi:application --bind 0.0.0.0:$PORT`,\n buildCommand: 'python manage.py collectstatic --noinput',\n meta: { ...requirementsMeta, name, extraPackages: has('gunicorn') ? '' : 'gunicorn' },\n },\n confidence: 85,\n };\n }\n if (has('fastapi')) {\n const mod = (await this.findAppModule(root, 'FastAPI(')) ?? 'main:app';\n return {\n profile: { ...base, framework: 'fastapi', port: 8000, startCommand: `uvicorn ${mod} --host 0.0.0.0 --port $PORT`, meta: { ...requirementsMeta, name, extraPackages: has('uvicorn') ? '' : 'uvicorn' } },\n confidence: 85,\n };\n }\n if (has('flask')) {\n const mod = (await this.findAppModule(root, 'Flask(')) ?? 'app:app';\n return {\n profile: { ...base, framework: 'flask', port: 5000, startCommand: `gunicorn ${mod} --bind 0.0.0.0:$PORT`, meta: { ...requirementsMeta, name, extraPackages: has('gunicorn') ? '' : 'gunicorn' } },\n confidence: 85,\n };\n }\n if (has('streamlit')) {\n const entry = (await firstExisting(this.fs, root, ['streamlit_app.py', 'app.py', 'main.py'])) ?? 'app.py';\n return {\n profile: { ...base, framework: 'streamlit', port: 8501, startCommand: `streamlit run ${entry} --server.port $PORT --server.address 0.0.0.0`, meta: { ...requirementsMeta, name } },\n confidence: 85,\n };\n }\n const entry = await firstExisting(this.fs, root, ['main.py', 'app.py', 'server.py']);\n return {\n profile: { ...base, port: 8000, startCommand: entry ? `python ${entry}` : undefined, meta: { ...requirementsMeta, name } },\n confidence: 60,\n };\n }\n\n private async findDjangoProject(root: string): Promise<string> {\n for (const entry of await this.fs.list(root)) {\n if (await this.fs.exists(this.fs.join(root, entry, 'wsgi.py'))) return entry;\n }\n return 'config';\n }\n\n /** Finds \"module:app\" for the file that instantiates the framework app. */\n private async findAppModule(root: string, marker: string): Promise<string | undefined> {\n for (const file of ['main.py', 'app.py', 'server.py', 'app/main.py', 'src/main.py', 'api/main.py', 'app/__init__.py']) {\n const src = await this.fs.readTextIfExists(this.fs.join(root, file));\n if (!src?.includes(marker)) continue;\n const varName = src.match(new RegExp(`^(\\\\w+)\\\\s*=\\\\s*${marker.replace('(', '\\\\(')}`, 'm'))?.[1] ?? 'app';\n const mod = file.replace(/\\/__init__\\.py$/, '').replace(/\\.py$/, '').replace(/\\//g, '.');\n return `${mod}:${varName}`;\n }\n return undefined;\n }\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { extractVersion, hasDockerfile } from './support.js';\n\nexport class RubyDetector implements ProjectDetector {\n readonly id = 'ruby';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const gemfile = await this.fs.readTextIfExists(this.fs.join(root, 'Gemfile'));\n if (gemfile === null) return null;\n const has = (gem: string) => new RegExp(`^\\\\s*gem\\\\s+['\"]${gem}['\"]`, 'm').test(gemfile);\n const version =\n extractVersion(await this.fs.readTextIfExists(this.fs.join(root, '.ruby-version'))) ??\n extractVersion(gemfile.match(/^\\s*ruby\\s+['\"]([^'\"]+)/m)?.[1]) ??\n '3.3';\n const rails = has('rails');\n\n return {\n profile: {\n rootDir: root,\n language: 'ruby',\n framework: rails ? 'rails' : has('sinatra') ? 'sinatra' : undefined,\n kind: 'server',\n packageManager: 'bundler',\n runtimeVersion: version,\n buildCommand: rails ? 'bundle exec rails assets:precompile' : undefined,\n startCommand: rails ? 'bundle exec rails server -b 0.0.0.0 -p $PORT' : 'bundle exec rackup -o 0.0.0.0 -p $PORT',\n port: 3000,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: { name: '' },\n },\n confidence: 80,\n };\n }\n}\n","import { parse as parseToml } from 'smol-toml';\nimport type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { extractVersion, hasDockerfile } from './support.js';\n\nexport class RustDetector implements ProjectDetector {\n readonly id = 'rust';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n const raw = await this.fs.readTextIfExists(this.fs.join(root, 'Cargo.toml'));\n if (raw === null) return null;\n let cargo: Record<string, any> = {};\n try {\n cargo = parseToml(raw) as Record<string, any>;\n } catch {\n /* fall through with defaults */\n }\n const deps = Object.keys(cargo.dependencies ?? {});\n const framework = ['actix-web', 'axum', 'rocket', 'warp', 'poem'].find((f) => deps.includes(f));\n const binName: string = cargo.bin?.[0]?.name ?? cargo.package?.name ?? 'app';\n const toolchain =\n (await this.fs.readTextIfExists(this.fs.join(root, 'rust-toolchain'))) ??\n (await this.fs.readTextIfExists(this.fs.join(root, 'rust-toolchain.toml')));\n\n return {\n profile: {\n rootDir: root,\n language: 'rust',\n framework,\n kind: 'server',\n packageManager: 'cargo',\n runtimeVersion: extractVersion(toolchain) ?? '1',\n buildCommand: 'cargo build --release',\n startCommand: `./${binName}`,\n port: 8080,\n hasDockerfile: await hasDockerfile(this.fs, root),\n meta: { name: cargo.package?.name ?? '', binName },\n },\n confidence: framework ? 85 : 70,\n };\n }\n}\n","import type { DetectionResult, FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { hasDockerfile } from './support.js';\n\n/** Plain HTML sites with no build step. Language detectors outrank this. */\nexport class StaticDetector implements ProjectDetector {\n readonly id = 'static';\n constructor(private readonly fs: FileSystemPort) {}\n\n async detect(root: string): Promise<DetectionResult | null> {\n for (const dir of ['.', 'public', 'docs', 'site']) {\n if (await this.fs.exists(this.fs.join(root, dir, 'index.html'))) {\n return {\n profile: {\n rootDir: root,\n language: 'static',\n framework: 'html',\n kind: 'static',\n outputDir: dir,\n port: 8080,\n hasDockerfile: await hasDockerfile(this.fs, root),\n },\n confidence: 40,\n };\n }\n }\n return null;\n }\n}\n","import type { FileSystemPort, ProjectDetector } from '../../domain/index.js';\nimport { DockerDetector } from './DockerDetector.js';\nimport { DotnetDetector } from './DotnetDetector.js';\nimport { GoDetector } from './GoDetector.js';\nimport { JavaDetector } from './JavaDetector.js';\nimport { NodeDetector } from './NodeDetector.js';\nimport { PhpDetector } from './PhpDetector.js';\nimport { PythonDetector } from './PythonDetector.js';\nimport { RubyDetector } from './RubyDetector.js';\nimport { RustDetector } from './RustDetector.js';\nimport { StaticDetector } from './StaticDetector.js';\n\nexport function builtInDetectors(fs: FileSystemPort): ProjectDetector[] {\n return [\n new NodeDetector(fs),\n new PythonDetector(fs),\n new JavaDetector(fs),\n new GoDetector(fs),\n new RustDetector(fs),\n new RubyDetector(fs),\n new PhpDetector(fs),\n new DotnetDetector(fs),\n new StaticDetector(fs),\n new DockerDetector(fs),\n ];\n}\n","import { constants } from 'node:fs';\nimport { access, cp, mkdir, mkdtemp, readdir, readFile, rm, writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\nimport { dirname, join, resolve } from 'node:path';\nimport fg from 'fast-glob';\nimport ignore from 'ignore';\nimport type { FileSystemPort } from '../../domain/index.js';\n\nconst ALWAYS_IGNORED = ['**/node_modules/**', '**/.git/**', '**/.DS_Store'];\n\nexport class NodeFileSystem implements FileSystemPort {\n async exists(path: string): Promise<boolean> {\n try {\n await access(path, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n }\n\n readText(path: string): Promise<string> {\n return readFile(path, 'utf8');\n }\n\n async readTextIfExists(path: string): Promise<string | null> {\n try {\n return await readFile(path, 'utf8');\n } catch (e) {\n if ((e as NodeJS.ErrnoException).code === 'ENOENT' || (e as NodeJS.ErrnoException).code === 'EISDIR') return null;\n throw e;\n }\n }\n\n async readBytes(path: string): Promise<Uint8Array> {\n return new Uint8Array(await readFile(path));\n }\n\n async writeText(path: string, contents: string): Promise<void> {\n await mkdir(dirname(path), { recursive: true });\n await writeFile(path, contents, 'utf8');\n }\n\n async list(dir: string): Promise<string[]> {\n try {\n return await readdir(dir);\n } catch {\n return [];\n }\n }\n\n async collectFiles(dir: string, opts: { ignore?: string[]; respectGitignore?: boolean } = {}): Promise<string[]> {\n const files = await fg('**/*', {\n cwd: dir,\n dot: true,\n onlyFiles: true,\n followSymbolicLinks: false,\n ignore: [...ALWAYS_IGNORED, ...(opts.ignore ?? [])],\n });\n if (!opts.respectGitignore) return files.sort();\n const gitignore = await this.readTextIfExists(join(dir, '.gitignore'));\n if (!gitignore) return files.sort();\n const ig = ignore().add(gitignore);\n return files.filter((f) => !ig.ignores(f)).sort();\n }\n\n async copyDir(from: string, to: string): Promise<void> {\n await cp(from, to, {\n recursive: true,\n filter: (src) => !/[\\\\/](node_modules|\\.git)([\\\\/]|$)/.test(src.slice(from.length)),\n });\n }\n\n makeTempDir(prefix: string): Promise<string> {\n return mkdtemp(join(tmpdir(), `${prefix}-`));\n }\n\n async remove(path: string): Promise<void> {\n await rm(path, { recursive: true, force: true });\n }\n\n join(...parts: string[]): string {\n return join(...parts);\n }\n\n resolve(...parts: string[]): string {\n return resolve(...parts);\n }\n}\n","import type { ProjectProfile } from '../../../domain/index.js';\n\n/**\n * Dockerfile templates. Every template:\n * - is multi-stage (build tools never ship in the runtime image)\n * - pins the detected runtime version\n * - runs as a non-root user\n * - listens on $PORT (set by Render/Railway), defaulting to the detected port\n */\nexport type DockerTemplate = (p: ProjectProfile) => string;\n\nconst HEADER = '# syntax=docker/dockerfile:1\\n# Generated by omnideploy — safe to edit; omnideploy will not overwrite it without --force.\\n';\nconst shCmd = (cmd: string) => `CMD [\"sh\", \"-c\", ${JSON.stringify(`exec ${cmd}`)}]`;\nconst lines = (...l: Array<string | false | undefined>) => l.filter((x): x is string => typeof x === 'string').join('\\n') + '\\n';\n\n/** Serves a static directory with unprivileged nginx on $PORT, with SPA fallback. */\nconst nginxStage = (from: string, port: number) =>\n lines(\n 'FROM nginxinc/nginx-unprivileged:1.27-alpine',\n `ENV PORT=${port}`,\n 'USER root',\n `RUN mkdir -p /etc/nginx/templates && printf 'server {\\\\n listen \\${PORT};\\\\n root /usr/share/nginx/html;\\\\n location / { try_files $uri $uri/ /index.html; }\\\\n}\\\\n' > /etc/nginx/templates/default.conf.template`,\n 'RUN rm -f /etc/nginx/conf.d/default.conf && chown -R 101:101 /etc/nginx/conf.d /etc/nginx/templates',\n `COPY --from=${from} --chown=101:101 /out /usr/share/nginx/html`,\n 'USER 101',\n `EXPOSE ${port}`,\n );\n\nfunction nodeImage(p: ProjectProfile): { image: string; user: string; setup?: string } {\n if (p.packageManager === 'bun') return { image: 'oven/bun:1-alpine', user: 'bun' };\n const setup = p.packageManager === 'pnpm' || p.packageManager === 'yarn' ? 'RUN corepack enable' : undefined;\n return { image: `node:${p.runtimeVersion ?? '22'}-alpine`, user: 'node', setup };\n}\n\nfunction nodeInstall(p: ProjectProfile): { copy: string; run: string } {\n const lock = p.meta?.lockfile;\n const copy = `COPY package.json ${lock ? `${lock} ` : ''}./`;\n if (!lock) return { copy, run: p.packageManager === 'npm' || !p.packageManager ? 'npm install' : `${p.packageManager} install` };\n return { copy, run: p.meta?.install || 'npm ci' };\n}\n\nconst node: DockerTemplate = (p) => {\n const { image, user, setup } = nodeImage(p);\n const install = nodeInstall(p);\n const build = lines(\n `FROM ${image} AS build`,\n 'WORKDIR /app',\n setup,\n install.copy,\n `RUN ${install.run}`,\n 'COPY . .',\n p.buildCommand && `RUN ${p.buildCommand}`,\n );\n if (p.kind === 'static') {\n return HEADER + build + `RUN cp -r ${p.outputDir ?? 'dist'} /out\\n\\n` + nginxStage('build', p.port === 3000 ? 8080 : p.port);\n }\n return (\n HEADER +\n build +\n '\\n' +\n lines(\n `FROM ${image}`,\n 'WORKDIR /app',\n setup,\n `ENV NODE_ENV=production PORT=${p.port}`,\n `COPY --from=build --chown=${user}:${user} /app ./`,\n `USER ${user}`,\n `EXPOSE ${p.port}`,\n shCmd(p.startCommand ?? 'npm start'),\n )\n );\n};\n\nconst staticSite: DockerTemplate = (p) =>\n HEADER + lines('FROM busybox:1.36 AS files', 'WORKDIR /src', 'COPY . .', `RUN cp -r ${p.outputDir ?? '.'} /out`) + '\\n' + nginxStage('files', 8080);\n\nconst python: DockerTemplate = (p) => {\n const v = p.runtimeVersion ?? '3.12';\n const extra = p.meta?.extraPackages ? ` ${p.meta.extraPackages}` : '';\n let deps: string;\n if (p.packageManager === 'uv') {\n deps = lines('COPY pyproject.toml uv.lock ./', `RUN pip install uv && uv export --frozen --no-dev --no-hashes --no-emit-project -o requirements.txt && /venv/bin/pip install -r requirements.txt${extra}`);\n } else if (p.packageManager === 'poetry') {\n deps = lines(\n 'COPY pyproject.toml poetry.lock* ./',\n `RUN pip install poetry poetry-plugin-export && poetry export --without-hashes --only main -f requirements.txt -o requirements.txt && /venv/bin/pip install -r requirements.txt${extra}`,\n );\n } else {\n // requirements.txt → install deps only (better layer caching); otherwise install the pyproject package from source.\n deps =\n p.meta?.requirements === 'true'\n ? lines('COPY requirements.txt ./', `RUN /venv/bin/pip install -r requirements.txt${extra}`)\n : lines('COPY . .', `RUN /venv/bin/pip install .${extra ? ` && /venv/bin/pip install${extra}` : ''}`);\n }\n return (\n HEADER +\n lines(\n `FROM python:${v}-slim AS deps`,\n 'ENV PIP_NO_CACHE_DIR=1 PIP_DISABLE_PIP_VERSION_CHECK=1',\n 'WORKDIR /app',\n 'RUN python -m venv /venv',\n ) +\n deps +\n '\\n' +\n lines(\n `FROM python:${v}-slim`,\n `ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PATH=/venv/bin:$PATH PORT=${p.port}`,\n 'RUN useradd --create-home --uid 10001 app',\n 'WORKDIR /app',\n 'COPY --from=deps /venv /venv',\n 'COPY --chown=app:app . .',\n 'USER app',\n p.buildCommand && `RUN ${p.buildCommand} || echo \"omnideploy: build step '${p.buildCommand}' skipped (needs runtime config)\"`,\n `EXPOSE ${p.port}`,\n shCmd(p.startCommand ?? 'python main.py'),\n )\n );\n};\n\nconst java: DockerTemplate = (p) => {\n const v = p.runtimeVersion ?? '21';\n const maven = p.meta?.buildTool !== 'gradle';\n const quarkus = p.meta?.quarkus === 'true';\n const buildImage = maven ? `maven:3.9-eclipse-temurin-${v}` : `gradle:jdk${v}`;\n const build = maven ? 'mvn -B -q -DskipTests package' : `gradle ${p.framework === 'spring-boot' ? 'bootJar' : 'build'} -x test --no-daemon -q`;\n const jarDir = p.meta?.jarDir ?? (maven ? 'target' : 'build/libs');\n const portProp = p.meta?.portProperty;\n const collect = quarkus\n ? `RUN cp -r ${jarDir}/quarkus-app /out`\n : `RUN mkdir /out && cp \"$(ls ${jarDir}/*.jar | grep -v -e '-plain.jar$' -e '-sources.jar$' -e '-javadoc.jar$' -e '/original-' | head -n 1)\" /out/app.jar`;\n const jar = quarkus ? 'quarkus-run.jar' : 'app.jar';\n return (\n HEADER +\n lines(\n `FROM ${buildImage} AS build`,\n 'WORKDIR /src',\n maven ? 'COPY pom.xml ./' : 'COPY build.gradle* settings.gradle* gradle.properties* ./',\n maven ? 'RUN mvn -B -q dependency:go-offline || true' : 'RUN gradle dependencies --no-daemon -q || true',\n 'COPY . .',\n `RUN ${build}`,\n collect,\n ) +\n '\\n' +\n lines(\n `FROM eclipse-temurin:${v}-jre`,\n 'RUN useradd --system --create-home --uid 10001 app',\n 'WORKDIR /app',\n 'COPY --from=build --chown=app:app /out ./',\n 'USER app',\n `ENV PORT=${p.port} JAVA_OPTS=\"-XX:MaxRAMPercentage=75\"`,\n `EXPOSE ${p.port}`,\n shCmd(`java $JAVA_OPTS ${portProp ? `-D${portProp}=$PORT ` : ''}-jar ${jar}`),\n )\n );\n};\n\nconst go: DockerTemplate = (p) =>\n HEADER +\n lines(\n `FROM golang:${p.runtimeVersion ?? '1.23'}-alpine AS build`,\n 'WORKDIR /src',\n 'COPY go.mod go.su[m] ./',\n 'RUN go mod download',\n 'COPY . .',\n `RUN CGO_ENABLED=0 go build -trimpath -ldflags=\"-s -w\" -o /out/app ${p.meta?.mainPath ?? '.'}`,\n ) +\n '\\n' +\n lines(\n 'FROM gcr.io/distroless/static-debian12:nonroot',\n 'COPY --from=build /out/app /app',\n `ENV PORT=${p.port}`,\n `EXPOSE ${p.port}`,\n 'USER nonroot:nonroot',\n 'ENTRYPOINT [\"/app\"]',\n );\n\nconst rust: DockerTemplate = (p) => {\n const bin = p.meta?.binName ?? 'app';\n return (\n HEADER +\n lines(`FROM rust:${p.runtimeVersion ?? '1'}-slim AS build`, 'WORKDIR /src', 'COPY . .', `RUN cargo build --release --bin ${bin} && cp target/release/${bin} /out-app`) +\n '\\n' +\n lines(\n 'FROM debian:bookworm-slim',\n 'RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* \\\\',\n ' && useradd --system --uid 10001 app',\n 'COPY --from=build /out-app /usr/local/bin/app',\n `ENV PORT=${p.port}`,\n 'USER app',\n `EXPOSE ${p.port}`,\n 'CMD [\"app\"]',\n )\n );\n};\n\nconst ruby: DockerTemplate = (p) => {\n const v = p.runtimeVersion ?? '3.3';\n const rails = p.framework === 'rails';\n return (\n HEADER +\n lines(\n `FROM ruby:${v}-slim AS build`,\n 'RUN apt-get update && apt-get install -y --no-install-recommends build-essential git libpq-dev libyaml-dev pkg-config && rm -rf /var/lib/apt/lists/*',\n 'WORKDIR /app',\n 'ENV BUNDLE_WITHOUT=\"development:test\" RAILS_ENV=production RACK_ENV=production',\n 'COPY Gemfile Gemfile.loc[k] ./',\n 'RUN bundle install --jobs 4',\n 'COPY . .',\n rails && 'RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile',\n ) +\n '\\n' +\n lines(\n `FROM ruby:${v}-slim`,\n 'RUN apt-get update && apt-get install -y --no-install-recommends libpq5 libyaml-0-2 && rm -rf /var/lib/apt/lists/* \\\\',\n ' && useradd --create-home --uid 10001 app',\n 'WORKDIR /app',\n `ENV BUNDLE_WITHOUT=\"development:test\" RAILS_ENV=production RACK_ENV=production RAILS_LOG_TO_STDOUT=1 RAILS_SERVE_STATIC_FILES=1 PORT=${p.port}`,\n 'COPY --from=build /usr/local/bundle /usr/local/bundle',\n 'COPY --from=build --chown=app:app /app /app',\n 'USER app',\n `EXPOSE ${p.port}`,\n shCmd(p.startCommand ?? 'bundle exec rackup -o 0.0.0.0 -p $PORT'),\n )\n );\n};\n\nconst php: DockerTemplate = (p) => {\n const v = p.runtimeVersion ?? '8.3';\n const composer = p.meta?.composer === 'true';\n return (\n HEADER +\n (composer\n ? lines(\n 'FROM composer:2 AS vendor',\n 'WORKDIR /app',\n 'COPY composer.json composer.loc[k] ./',\n 'RUN composer install --no-dev --no-scripts --no-interaction --prefer-dist --ignore-platform-reqs --optimize-autoloader',\n ) + '\\n'\n : '') +\n lines(\n `FROM php:${v}-cli`,\n 'RUN docker-php-ext-install pdo pdo_mysql opcache && useradd --create-home --uid 10001 app',\n 'WORKDIR /app',\n composer && 'COPY --from=vendor --chown=app:app /app/vendor ./vendor',\n 'COPY --chown=app:app . .',\n 'USER app',\n `ENV PORT=${p.port}`,\n `EXPOSE ${p.port}`,\n shCmd(p.startCommand ?? `php -S 0.0.0.0:$PORT -t ${p.meta?.docroot ?? '.'}`),\n )\n );\n};\n\nconst dotnet: DockerTemplate = (p) => {\n const v = p.runtimeVersion ?? '8.0';\n const hasAppUser = Number(v.split('.')[0]) >= 8;\n return (\n HEADER +\n lines(\n `FROM mcr.microsoft.com/dotnet/sdk:${v} AS build`,\n 'WORKDIR /src',\n `COPY ${p.meta?.projectFile ?? '*.csproj'} ./`,\n 'RUN dotnet restore',\n 'COPY . .',\n 'RUN dotnet publish -c Release -o /out --no-restore',\n ) +\n '\\n' +\n lines(\n `FROM mcr.microsoft.com/dotnet/aspnet:${v}`,\n 'WORKDIR /app',\n 'COPY --from=build /out .',\n hasAppUser ? 'USER app' : 'RUN useradd --system --uid 10001 app\\nUSER app',\n `ENV PORT=${p.port}`,\n `EXPOSE ${p.port}`,\n shCmd(`env ASPNETCORE_URLS=http://+:$PORT ${p.startCommand ?? 'dotnet app.dll'}`),\n )\n );\n};\n\nexport const DOCKER_TEMPLATES: Partial<Record<ProjectProfile['language'], DockerTemplate>> = {\n node,\n static: staticSite,\n python,\n java,\n go,\n rust,\n ruby,\n php,\n dotnet,\n};\n\nconst IGNORES: Partial<Record<ProjectProfile['language'], string[]>> = {\n node: ['node_modules', 'npm-debug.log*', '.next', '.nuxt', '.output', 'coverage'],\n python: ['__pycache__', '*.pyc', '.venv', 'venv', '.pytest_cache', '.mypy_cache'],\n java: ['target', 'build', '.gradle', '*.iml', '.idea'],\n go: ['bin', 'vendor'],\n rust: ['target'],\n ruby: ['log/*', 'tmp/*', 'vendor/bundle', '.bundle'],\n php: ['vendor', 'storage/logs/*'],\n dotnet: ['bin', 'obj', 'out'],\n};\n\nexport function dockerignoreFor(p: ProjectProfile): string {\n return (\n ['# Generated by omnideploy', '.git', '.gitignore', 'Dockerfile', '.dockerignore', '.env', '.env.*', '*.log', '.DS_Store', ...(IGNORES[p.language] ?? [])].join('\\n') +\n '\\n'\n );\n}\n","import type { ArtifactGenerator, DeploymentArtifact, ProjectProfile } from '../../../domain/index.js';\nimport { LANGUAGE_LABELS } from '../../../domain/index.js';\nimport { DOCKER_TEMPLATES, dockerignoreFor } from './templates.js';\n\nexport class DockerfileGenerator implements ArtifactGenerator {\n readonly id = 'dockerfile';\n readonly path = 'Dockerfile';\n\n supports(profile: ProjectProfile): boolean {\n return profile.language in DOCKER_TEMPLATES;\n }\n\n generate(profile: ProjectProfile): DeploymentArtifact {\n const template = DOCKER_TEMPLATES[profile.language]!;\n return {\n id: this.id,\n path: this.path,\n contents: template(profile),\n description: `multi-stage ${LANGUAGE_LABELS[profile.language]}${profile.framework ? ` (${profile.framework})` : ''} image`,\n };\n }\n}\n\nexport class DockerignoreGenerator implements ArtifactGenerator {\n readonly id = 'dockerignore';\n readonly path = '.dockerignore';\n\n supports(): boolean {\n return true;\n }\n\n generate(profile: ProjectProfile): DeploymentArtifact {\n return { id: this.id, path: this.path, contents: dockerignoreFor(profile), description: 'keeps the Docker build context small' };\n }\n}\n","import { stringify } from 'smol-toml';\nimport { isSinglePageApp, type ArtifactGenerator, type DeploymentArtifact, type ProjectProfile } from '../../../domain/index.js';\n\nexport class NetlifyTomlGenerator implements ArtifactGenerator {\n readonly id = 'netlify-toml';\n readonly path = 'netlify.toml';\n\n supports(profile: ProjectProfile): boolean {\n return profile.kind === 'static';\n }\n\n generate(p: ProjectProfile): DeploymentArtifact {\n const config: Record<string, unknown> = {\n build: { publish: p.outputDir ?? '.', ...(p.buildCommand ? { command: p.buildCommand } : {}) },\n };\n if (p.language === 'node' && p.runtimeVersion) config.build = { ...(config.build as object), environment: { NODE_VERSION: p.runtimeVersion } };\n if (isSinglePageApp(p)) config.redirects = [{ from: '/*', to: '/index.html', status: 200 }];\n return {\n id: this.id,\n path: this.path,\n contents: '# Generated by omnideploy. https://docs.netlify.com/configure-builds/file-based-configuration/\\n' + stringify(config) + '\\n',\n description: 'Netlify build settings' + (isSinglePageApp(p) ? ' + SPA redirect' : ''),\n };\n }\n}\n","import type { ArtifactGenerator, DeploymentArtifact, GenerateOptions, ProjectProfile } from '../../../domain/index.js';\n\nexport class RailwayJsonGenerator implements ArtifactGenerator {\n readonly id = 'railway-json';\n readonly path = 'railway.json';\n\n supports(): boolean {\n return true;\n }\n\n generate(p: ProjectProfile, opts: GenerateOptions): DeploymentArtifact {\n const config = {\n $schema: 'https://railway.com/railway.schema.json',\n build: { builder: 'DOCKERFILE', dockerfilePath: 'Dockerfile' },\n deploy: {\n healthcheckPath: opts.healthCheckPath ?? '/',\n healthcheckTimeout: 300,\n restartPolicyType: 'ON_FAILURE',\n restartPolicyMaxRetries: 5,\n },\n };\n return {\n id: this.id,\n path: this.path,\n contents: JSON.stringify(config, null, 2) + '\\n',\n description: 'Railway config (build from Dockerfile, health check, restart policy)',\n };\n }\n}\n","import { stringify } from 'yaml';\nimport type { ArtifactGenerator, DeploymentArtifact, GenerateOptions, ProjectProfile } from '../../../domain/index.js';\n\n/** Languages Render can build natively without a Dockerfile. */\nconst RENDER_NATIVE: Record<string, string> = { node: 'node', python: 'python', ruby: 'ruby', go: 'go' };\n\n/** Render runs server apps natively when it can, otherwise from a Dockerfile. */\nexport function renderUsesDocker(profile: ProjectProfile): boolean {\n return profile.kind !== 'static' && (profile.hasDockerfile || !(profile.language in RENDER_NATIVE));\n}\n\n/** Install+build command for Render's native runtimes. */\nexport function renderNativeBuild(p: ProjectProfile): string {\n switch (p.language) {\n case 'node':\n return [p.meta?.install || 'npm install', p.buildCommand].filter(Boolean).join(' && ');\n case 'python': {\n const install =\n p.packageManager === 'poetry' ? 'pip install poetry && poetry install --no-root --only main'\n : p.packageManager === 'uv' ? 'pip install uv && uv sync --frozen --no-dev'\n : 'pip install -r requirements.txt';\n return [install, p.meta?.extraPackages && `pip install ${p.meta.extraPackages}`, p.buildCommand].filter(Boolean).join(' && ');\n }\n case 'ruby':\n return ['bundle install', p.buildCommand].filter(Boolean).join(' && ');\n case 'go':\n return p.buildCommand ?? 'go build -o app .';\n default:\n return p.buildCommand ?? '';\n }\n}\n\nexport function renderRuntime(p: ProjectProfile): string {\n if (p.kind === 'static') return 'static';\n return renderUsesDocker(p) ? 'docker' : RENDER_NATIVE[p.language]!;\n}\n\nexport class RenderYamlGenerator implements ArtifactGenerator {\n readonly id = 'render-yaml';\n readonly path = 'render.yaml';\n\n supports(): boolean {\n return true;\n }\n\n generate(p: ProjectProfile, opts: GenerateOptions): DeploymentArtifact {\n const runtime = renderRuntime(p);\n const service: Record<string, unknown> = {\n type: 'web',\n name: (opts.providerOptions.serviceName as string | undefined) ?? opts.serviceName,\n runtime,\n plan: (opts.providerOptions.plan as string | undefined) ?? 'free',\n region: (opts.providerOptions.region as string | undefined) ?? 'oregon',\n };\n if (runtime === 'static') {\n if (p.buildCommand) service.buildCommand = p.buildCommand;\n service.staticPublishPath = `./${p.outputDir ?? '.'}`;\n delete service.plan;\n delete service.region;\n } else if (runtime === 'docker') {\n service.dockerfilePath = './Dockerfile';\n service.dockerContext = '.';\n } else {\n service.buildCommand = renderNativeBuild(p);\n service.startCommand = p.startCommand;\n }\n if (runtime !== 'static') {\n service.healthCheckPath = opts.healthCheckPath ?? '/';\n service.autoDeploy = true;\n }\n if (p.kind === 'static' && /^(vite|create-react-app|angular)/.test(p.framework ?? '')) {\n service.routes = [{ type: 'rewrite', source: '/*', destination: '/index.html' }];\n }\n return {\n id: this.id,\n path: this.path,\n contents: '# Render Blueprint — generated by omnideploy. https://render.com/docs/blueprint-spec\\n' + stringify({ services: [service] }),\n description: `Render Blueprint (${runtime} runtime)`,\n };\n }\n}\n","import { isSinglePageApp, type ArtifactGenerator, type DeploymentArtifact, type ProjectProfile } from '../../../domain/index.js';\n\n/** Only needed for client-side routed SPAs; frameworks like Next.js need no vercel.json. */\nexport class VercelJsonGenerator implements ArtifactGenerator {\n readonly id = 'vercel-json';\n readonly path = 'vercel.json';\n\n supports(profile: ProjectProfile): boolean {\n return isSinglePageApp(profile);\n }\n\n generate(): DeploymentArtifact {\n const config = {\n $schema: 'https://openapi.vercel.sh/vercel.json',\n rewrites: [{ source: '/(.*)', destination: '/index.html' }],\n };\n return { id: this.id, path: this.path, contents: JSON.stringify(config, null, 2) + '\\n', description: 'SPA rewrite so client-side routes work on refresh' };\n }\n}\n","import type { ArtifactGenerator } from '../../domain/index.js';\nimport { DockerfileGenerator, DockerignoreGenerator } from './dockerfile/DockerfileGenerator.js';\nimport { NetlifyTomlGenerator } from './provider-config/netlify.js';\nimport { RailwayJsonGenerator } from './provider-config/railway.js';\nimport { RenderYamlGenerator } from './provider-config/render.js';\nimport { VercelJsonGenerator } from './provider-config/vercel.js';\n\nexport function builtInGenerators(): ArtifactGenerator[] {\n return [\n new DockerfileGenerator(),\n new DockerignoreGenerator(),\n new RenderYamlGenerator(),\n new RailwayJsonGenerator(),\n new VercelJsonGenerator(),\n new NetlifyTomlGenerator(),\n ];\n}\n","import { GitError, type GitPort, type GitRemote, type ProcessRunnerPort } from '../../domain/index.js';\n\nexport function parseGitHubRemote(url: string): { owner: string; repo: string } | undefined {\n const m = url.match(/github\\.com[:/]([^/]+)\\/([^/]+?)(?:\\.git)?\\/?$/);\n return m ? { owner: m[1]!, repo: m[2]! } : undefined;\n}\n\nexport class CliGit implements GitPort {\n constructor(private readonly proc: ProcessRunnerPort) {}\n\n private async git(dir: string, args: string[], what: string): Promise<string> {\n const r = await this.proc.run('git', args, { cwd: dir });\n if (r.exitCode !== 0) throw new GitError(`git ${what} failed: ${(r.stderr || r.stdout).trim()}`);\n return r.stdout.trim();\n }\n\n async isRepo(dir: string): Promise<boolean> {\n const r = await this.proc.run('git', ['rev-parse', '--is-inside-work-tree'], { cwd: dir });\n return r.exitCode === 0 && r.stdout.trim() === 'true';\n }\n\n async remote(dir: string, name = 'origin'): Promise<GitRemote | null> {\n const r = await this.proc.run('git', ['remote', 'get-url', name], { cwd: dir });\n if (r.exitCode !== 0) return null;\n const url = r.stdout.trim();\n return { url, github: parseGitHubRemote(url) };\n }\n\n async currentBranch(dir: string): Promise<string | null> {\n const r = await this.proc.run('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd: dir });\n return r.exitCode === 0 ? r.stdout.trim() : null;\n }\n\n async dirtyPaths(dir: string, paths: string[] = []): Promise<string[]> {\n const out = await this.git(dir, ['status', '--porcelain', '--untracked-files=all', '--', ...paths], 'status');\n return out\n .split('\\n')\n .filter(Boolean)\n .map((line) => line.slice(3).split(' -> ').pop()!.replace(/^\"|\"$/g, ''));\n }\n\n async commit(dir: string, paths: string[], message: string): Promise<void> {\n await this.git(dir, ['add', '--', ...paths], 'add');\n await this.git(dir, [...(await this.identityArgs(dir)), 'commit', '-m', message, '--', ...paths], 'commit');\n }\n\n async push(dir: string, remote = 'origin', branch?: string): Promise<void> {\n const target = branch ?? (await this.currentBranch(dir)) ?? 'HEAD';\n await this.git(dir, ['push', '-u', remote, target], 'push');\n }\n\n async publishDirectory(sourceDir: string, remoteUrl: string, branch: string, message: string): Promise<void> {\n await this.git(sourceDir, ['init', '-q'], 'init');\n await this.git(sourceDir, ['checkout', '-q', '-b', branch], 'checkout');\n await this.git(sourceDir, ['add', '-A'], 'add');\n await this.git(sourceDir, [...(await this.identityArgs(sourceDir)), 'commit', '-q', '-m', message], 'commit');\n await this.git(sourceDir, ['push', '--force', remoteUrl, `HEAD:${branch}`], 'push');\n }\n\n /** Lets commits succeed on machines without a configured git identity. */\n private async identityArgs(dir: string): Promise<string[]> {\n const r = await this.proc.run('git', ['config', 'user.email'], { cwd: dir });\n return r.exitCode === 0 && r.stdout.trim() ? [] : ['-c', 'user.name=omnideploy', '-c', 'user.email=omnideploy@users.noreply.github.com'];\n }\n}\n","import { ProviderApiError, type HttpClientPort, type HttpRequest, type HttpResponse } from '../../domain/index.js';\n\nexport interface FetchHttpClientOptions {\n retries?: number;\n /** Base delay for exponential backoff (ms). */\n backoffMs?: number;\n userAgent?: string;\n fetchImpl?: typeof fetch;\n}\n\nconst RETRYABLE = new Set([408, 425, 429, 500, 502, 503, 504]);\n\nexport class FetchHttpClient implements HttpClientPort {\n private readonly retries: number;\n private readonly backoffMs: number;\n private readonly userAgent: string;\n private readonly fetchImpl?: typeof fetch;\n\n constructor(opts: FetchHttpClientOptions = {}) {\n this.retries = opts.retries ?? 3;\n this.backoffMs = opts.backoffMs ?? 500;\n this.userAgent = opts.userAgent ?? 'omnideploy-cli';\n this.fetchImpl = opts.fetchImpl;\n }\n\n async request<T>(req: HttpRequest, opts: { provider?: string; allowStatus?: number[] } = {}): Promise<HttpResponse<T>> {\n const url = new URL(req.url);\n for (const [k, v] of Object.entries(req.query ?? {})) if (v !== undefined) url.searchParams.set(k, String(v));\n\n const headers: Record<string, string> = { 'user-agent': this.userAgent, accept: 'application/json', ...req.headers };\n let body: BodyInit | undefined;\n if (req.json !== undefined) {\n headers['content-type'] ??= 'application/json';\n body = JSON.stringify(req.json);\n } else if (req.body !== undefined) {\n body = req.body as BodyInit;\n }\n\n const provider = opts.provider ?? url.hostname;\n let lastError: unknown;\n for (let attempt = 0; attempt <= this.retries; attempt++) {\n if (attempt > 0) await sleep(this.backoffMs * 2 ** (attempt - 1));\n let res: Response;\n try {\n // Resolve fetch per call so test interceptors and polyfills installed later are honoured.\n res = await (this.fetchImpl ?? globalThis.fetch)(url, { method: req.method ?? 'GET', headers, body });\n } catch (e) {\n lastError = e;\n continue; // network error: retry\n }\n\n const data = await parseBody(res);\n if (res.ok || opts.allowStatus?.includes(res.status)) {\n return { status: res.status, headers: Object.fromEntries(res.headers.entries()), data: data as T };\n }\n lastError = new ProviderApiError(provider, extractMessage(data, res.statusText), res.status, hintFor(res.status));\n if (!RETRYABLE.has(res.status)) break;\n }\n if (lastError instanceof ProviderApiError) throw lastError;\n throw new ProviderApiError(provider, `request to ${url.host} failed: ${lastError instanceof Error ? lastError.message : String(lastError)}`, undefined, 'Check your network connection.');\n }\n}\n\nasync function parseBody(res: Response): Promise<unknown> {\n const text = await res.text();\n if (!text) return null;\n try {\n return JSON.parse(text);\n } catch {\n return text;\n }\n}\n\nfunction extractMessage(data: unknown, fallback: string): string {\n if (typeof data === 'string') return data.slice(0, 300) || fallback;\n if (data && typeof data === 'object') {\n const d = data as Record<string, unknown>;\n const err = d.error;\n if (err && typeof err === 'object' && typeof (err as Record<string, unknown>).message === 'string') {\n return (err as Record<string, string>).message!;\n }\n if (typeof err === 'string') return err;\n if (typeof d.message === 'string') return d.message;\n if (Array.isArray(d.errors) && d.errors.length) return JSON.stringify(d.errors).slice(0, 300);\n }\n return fallback || 'unknown error';\n}\n\nfunction hintFor(status: number): string | undefined {\n if (status === 401 || status === 403) return 'Your token may be invalid or expired. Run `omnideploy login <provider>` again.';\n if (status === 404) return 'The resource was not found — check the IDs in omnideploy.json.';\n if (status === 429) return 'Rate limited by the provider. Wait a moment and retry.';\n return undefined;\n}\n\nconst sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));\n","import { execa } from 'execa';\nimport type { ProcessRunnerPort, RunOptions, RunResult } from '../../domain/index.js';\n\nexport class ExecaProcessRunner implements ProcessRunnerPort {\n async run(bin: string, args: string[], opts: RunOptions = {}): Promise<RunResult> {\n try {\n const r = await execa(bin, args, {\n cwd: opts.cwd,\n env: opts.env,\n input: opts.input,\n reject: false,\n stdio: opts.inherit ? 'inherit' : 'pipe',\n });\n return { exitCode: r.exitCode ?? 1, stdout: String(r.stdout ?? ''), stderr: String(r.stderr ?? '') };\n } catch (e) {\n return { exitCode: 127, stdout: '', stderr: e instanceof Error ? e.message : String(e) };\n }\n }\n\n async shell(command: string, opts: RunOptions = {}): Promise<RunResult> {\n try {\n const r = await execa(command, {\n shell: true,\n cwd: opts.cwd,\n env: opts.env,\n input: opts.input,\n reject: false,\n stdio: opts.inherit ? 'inherit' : 'pipe',\n });\n return { exitCode: r.exitCode ?? 1, stdout: String(r.stdout ?? ''), stderr: String(r.stderr ?? '') };\n } catch (e) {\n return { exitCode: 127, stdout: '', stderr: e instanceof Error ? e.message : String(e) };\n }\n }\n\n async has(bin: string): Promise<boolean> {\n const probe = process.platform === 'win32' ? await this.run('where', [bin]) : await this.run('which', [bin]);\n return probe.exitCode === 0;\n }\n}\n","import { createHash } from 'node:crypto';\nimport { PassThrough } from 'node:stream';\nimport { ZipArchive } from 'archiver';\n\nexport interface PollOptions {\n intervalMs: number;\n timeoutMs: number;\n}\n\nexport const DEFAULT_POLL: PollOptions = { intervalMs: 3000, timeoutMs: 20 * 60_000 };\n\n/** Calls `fn` until `done` is true or the timeout elapses. */\nexport async function poll<T>(fn: () => Promise<T>, done: (v: T) => boolean, opts: PollOptions): Promise<{ value: T; timedOut: boolean }> {\n const deadline = Date.now() + opts.timeoutMs;\n for (;;) {\n const value = await fn();\n if (done(value)) return { value, timedOut: false };\n if (Date.now() >= deadline) return { value, timedOut: true };\n await new Promise((r) => setTimeout(r, opts.intervalMs));\n }\n}\n\nexport const sha1 = (data: Uint8Array): string => createHash('sha1').update(data).digest('hex');\n\nexport interface InMemoryFile {\n path: string;\n data: Uint8Array;\n}\n\nexport async function zip(files: InMemoryFile[]): Promise<Uint8Array> {\n const archive = new ZipArchive({ zlib: { level: 9 } });\n const sink = new PassThrough();\n const chunks: Buffer[] = [];\n sink.on('data', (c: Buffer) => chunks.push(c));\n const finished = new Promise<void>((resolve, reject) => {\n sink.on('end', resolve);\n archive.on('error', reject);\n });\n archive.pipe(sink);\n for (const f of files) archive.append(Buffer.from(f.data), { name: f.path });\n await archive.finalize();\n await finished;\n return new Uint8Array(Buffer.concat(chunks));\n}\n\nexport const textFile = (path: string, text: string): InMemoryFile => ({ path, data: new TextEncoder().encode(text) });\n\n/** Removes a secret from any string before it can reach logs or error messages. */\nexport const redact = (text: string, secret: string) => (secret ? text.split(secret).join('***') : text);\n","import {\n DomainError,\n GitError,\n isSinglePageApp,\n type DeployContext,\n type Deployment,\n type DeploymentProvider,\n type DeploymentStatus,\n type FileSystemPort,\n type GitPort,\n type HttpClientPort,\n type ProjectProfile,\n type ProviderCapabilities,\n type ProviderContext,\n type ProviderOptions,\n} from '../../domain/index.js';\nimport { DEFAULT_POLL, poll, redact, type PollOptions } from './support.js';\n\nconst API = 'https://api.github.com';\n\ninterface PagesInfo {\n html_url?: string;\n source?: { branch: string; path: string };\n}\ninterface PagesBuild {\n status: 'queued' | 'building' | 'built' | 'errored';\n error?: { message?: string | null };\n created_at?: string;\n commit?: string;\n}\n\nexport class GitHubPagesProvider implements DeploymentProvider {\n readonly id = 'github-pages';\n readonly displayName = 'GitHub Pages';\n readonly capabilities: ProviderCapabilities = {\n kinds: ['static'],\n serverLanguages: [],\n buildsFromGit: false,\n auth: { envVar: 'GITHUB_TOKEN', tokenUrl: 'https://github.com/settings/tokens/new?scopes=repo&description=omnideploy' },\n };\n\n constructor(\n private readonly http: HttpClientPort,\n private readonly fs: FileSystemPort,\n private readonly git: GitPort,\n private readonly pollOpts: PollOptions = { ...DEFAULT_POLL, timeoutMs: 3 * 60_000 },\n ) {}\n\n requiredArtifacts() {\n return [];\n }\n\n async validate(ctx: { profile: ProjectProfile; rootDir: string; options: ProviderOptions }): Promise<void> {\n await this.repo(ctx.rootDir, ctx.options);\n }\n\n async deploy(ctx: DeployContext): Promise<Deployment> {\n const { owner, repo } = await this.repo(ctx.profile.rootDir, ctx.options);\n const branch = (ctx.options.branch as string | undefined) ?? 'gh-pages';\n const cname = ctx.options.cname as string | undefined;\n const userSite = repo.toLowerCase() === `${owner.toLowerCase()}.github.io`;\n\n if (!cname && !userSite && /^(vite|create-react-app|angular)/.test(ctx.profile.framework ?? '')) {\n ctx.logger.warn(`GitHub Pages serves this site under /${repo}/. If assets 404, set the base path (Vite: base: '/${repo}/', CRA: \"homepage\").`);\n }\n\n ctx.progress('preparing files');\n const tmp = await this.fs.makeTempDir('omnideploy-pages');\n try {\n await this.fs.copyDir(ctx.sourceDir, tmp);\n await this.fs.writeText(this.fs.join(tmp, '.nojekyll'), '');\n if (cname) await this.fs.writeText(this.fs.join(tmp, 'CNAME'), cname + '\\n');\n if (isSinglePageApp(ctx.profile)) {\n const index = await this.fs.readTextIfExists(this.fs.join(tmp, 'index.html'));\n if (index && !(await this.fs.exists(this.fs.join(tmp, '404.html')))) await this.fs.writeText(this.fs.join(tmp, '404.html'), index);\n }\n\n ctx.progress(`pushing to ${branch}`);\n const remoteUrl = `https://x-access-token:${ctx.token}@github.com/${owner}/${repo}.git`;\n try {\n await this.git.publishDirectory(tmp, remoteUrl, branch, `Deploy to GitHub Pages (omnideploy) ${new Date().toISOString()}`);\n } catch (e) {\n throw new GitError(redact(e instanceof Error ? e.message : String(e), ctx.token), 'Check that the token has the \"repo\" scope and push access.');\n }\n } finally {\n await this.fs.remove(tmp);\n }\n\n ctx.progress('enabling GitHub Pages');\n const pages = await this.ensurePages(ctx.token, owner, repo, branch);\n\n ctx.progress('waiting for Pages build');\n const { value: build, timedOut } = await poll(\n () => this.latestBuild(ctx.token, owner, repo),\n (b) => b?.status === 'built' || b?.status === 'errored',\n this.pollOpts,\n );\n if (build?.status === 'errored') {\n throw new DomainError(`GitHub Pages build failed: ${build.error?.message ?? 'unknown error'}`, `See https://github.com/${owner}/${repo}/actions`, 'DEPLOYMENT_FAILED');\n }\n\n const url = cname ? `https://${cname}/` : (pages.html_url ?? (userSite ? `https://${repo}/` : `https://${owner}.github.io/${repo}/`));\n return {\n provider: this.id,\n id: build?.commit ?? 'latest',\n url,\n state: timedOut || !build ? 'building' : 'ready',\n dashboardUrl: `https://github.com/${owner}/${repo}/settings/pages`,\n configUpdates: { repo: `${owner}/${repo}`, branch },\n };\n }\n\n async status(ctx: ProviderContext): Promise<DeploymentStatus> {\n const [owner, repo] = String(ctx.options.repo ?? '').split('/');\n if (!owner || !repo) return { id: '-', state: 'unknown', message: 'Deploy once first (repo is stored in omnideploy.json).' };\n const b = await this.latestBuild(ctx.token, owner, repo);\n if (!b) return { id: '-', state: 'unknown', message: 'No Pages builds yet.' };\n return {\n id: b.commit ?? 'latest',\n state: b.status === 'built' ? 'ready' : b.status === 'errored' ? 'error' : 'building',\n createdAt: b.created_at,\n message: b.error?.message ?? undefined,\n };\n }\n\n private async repo(rootDir: string, options: ProviderOptions): Promise<{ owner: string; repo: string }> {\n if (typeof options.repo === 'string' && options.repo.includes('/')) {\n const [owner, repo] = options.repo.split('/') as [string, string];\n return { owner, repo };\n }\n const remote = await this.git.remote(rootDir);\n if (!remote?.github) {\n throw new DomainError(\n 'GitHub Pages needs a GitHub repository.',\n 'Add a GitHub remote (git remote add origin https://github.com/<you>/<repo>.git) or set providers[\"github-pages\"].repo = \"owner/repo\".',\n 'NO_GITHUB_REMOTE',\n );\n }\n return remote.github;\n }\n\n private async ensurePages(token: string, owner: string, repo: string, branch: string): Promise<PagesInfo> {\n const headers = this.headers(token);\n const url = `${API}/repos/${owner}/${repo}/pages`;\n const existing = await this.http.request<PagesInfo>({ url, headers }, { provider: 'GitHub', allowStatus: [404] });\n const source = { branch, path: '/' };\n if (existing.status === 404) {\n return (await this.http.request<PagesInfo>({ method: 'POST', url, headers, json: { source } }, { provider: 'GitHub', allowStatus: [409] })).data;\n }\n if (existing.data.source?.branch !== branch) {\n await this.http.request({ method: 'PUT', url, headers, json: { source } }, { provider: 'GitHub' });\n }\n return existing.data;\n }\n\n private async latestBuild(token: string, owner: string, repo: string): Promise<PagesBuild | null> {\n const r = await this.http.request<PagesBuild>(\n { url: `${API}/repos/${owner}/${repo}/pages/builds/latest`, headers: this.headers(token) },\n { provider: 'GitHub', allowStatus: [404] },\n );\n return r.status === 404 ? null : r.data;\n }\n\n private headers(token: string) {\n return { authorization: `Bearer ${token}`, accept: 'application/vnd.github+json', 'x-github-api-version': '2022-11-28' };\n }\n}\n","import {\n DeploymentFailedError,\n isSinglePageApp,\n type DeployContext,\n type Deployment,\n type DeploymentProvider,\n type DeploymentState,\n type DeploymentStatus,\n type FileSystemPort,\n type HttpClientPort,\n type ProviderCapabilities,\n type ProviderContext,\n} from '../../domain/index.js';\nimport { DEFAULT_POLL, poll, textFile, zip, type PollOptions } from './support.js';\n\nconst API = 'https://api.netlify.com/api/v1';\n\ninterface NetlifySite {\n id: string;\n name: string;\n ssl_url?: string;\n url: string;\n admin_url?: string;\n}\ninterface NetlifyDeploy {\n id: string;\n state: string;\n ssl_url?: string;\n deploy_ssl_url?: string;\n admin_url?: string;\n error_message?: string;\n created_at?: string;\n}\n\nconst STATE: Record<string, DeploymentState> = {\n new: 'queued',\n uploading: 'building',\n uploaded: 'building',\n preparing: 'building',\n prepared: 'building',\n processing: 'building',\n processed: 'building',\n ready: 'ready',\n error: 'error',\n};\n\nexport class NetlifyProvider implements DeploymentProvider {\n readonly id = 'netlify';\n readonly displayName = 'Netlify';\n readonly capabilities: ProviderCapabilities = {\n kinds: ['static'],\n serverLanguages: [],\n buildsFromGit: false,\n auth: { envVar: 'NETLIFY_AUTH_TOKEN', tokenUrl: 'https://app.netlify.com/user/applications#personal-access-tokens' },\n };\n\n constructor(\n private readonly http: HttpClientPort,\n private readonly fs: FileSystemPort,\n private readonly pollOpts: PollOptions = DEFAULT_POLL,\n ) {}\n\n requiredArtifacts() {\n return ['netlify-toml'];\n }\n\n async validate(): Promise<void> {}\n\n async deploy(ctx: DeployContext): Promise<Deployment> {\n const site = await this.ensureSite(ctx);\n\n ctx.progress('packaging files');\n const paths = await this.fs.collectFiles(ctx.sourceDir);\n const files = await Promise.all(paths.map(async (p) => ({ path: p, data: await this.fs.readBytes(this.fs.join(ctx.sourceDir, p)) })));\n // Zip deploys ignore netlify.toml, so SPA redirects must ship as _redirects.\n if (isSinglePageApp(ctx.profile) && !paths.includes('_redirects')) files.push(textFile('_redirects', '/* /index.html 200\\n'));\n const archive = await zip(files);\n\n ctx.progress(`uploading ${files.length} files`);\n const created = await this.http.request<NetlifyDeploy>(\n {\n method: 'POST',\n url: `${API}/sites/${site.id}/deploys`,\n headers: { ...this.auth(ctx.token), 'content-type': 'application/zip' },\n query: { draft: ctx.production ? undefined : true },\n body: archive,\n },\n { provider: 'Netlify' },\n );\n\n ctx.progress('processing');\n const { value: d, timedOut } = await poll(\n () => this.getDeploy(ctx.token, created.data.id),\n (d) => d.state === 'ready' || d.state === 'error',\n this.pollOpts,\n );\n if (d.state === 'error') throw new DeploymentFailedError('Netlify', d.error_message ?? 'unknown error', d.admin_url);\n\n return {\n provider: this.id,\n id: d.id,\n url: ctx.production ? (site.ssl_url ?? d.ssl_url ?? site.url) : (d.deploy_ssl_url ?? d.ssl_url),\n state: timedOut ? 'building' : 'ready',\n dashboardUrl: site.admin_url,\n configUpdates: { siteId: site.id, siteName: site.name },\n };\n }\n\n async status(ctx: ProviderContext, deploymentId?: string): Promise<DeploymentStatus> {\n let d: NetlifyDeploy | undefined;\n if (deploymentId) d = await this.getDeploy(ctx.token, deploymentId);\n else {\n const siteId = ctx.options.siteId as string | undefined;\n if (!siteId) return { id: '-', state: 'unknown', message: 'No Netlify site yet — deploy first.' };\n const r = await this.http.request<NetlifyDeploy[]>({ url: `${API}/sites/${siteId}/deploys`, headers: this.auth(ctx.token), query: { per_page: 1 } }, { provider: 'Netlify' });\n d = r.data[0];\n }\n if (!d) return { id: '-', state: 'unknown', message: 'No deployments yet.' };\n return { id: d.id, state: STATE[d.state] ?? 'unknown', url: d.deploy_ssl_url ?? d.ssl_url, createdAt: d.created_at, message: d.error_message };\n }\n\n private async ensureSite(ctx: DeployContext): Promise<NetlifySite> {\n const siteId = ctx.options.siteId as string | undefined;\n if (siteId) {\n return (await this.http.request<NetlifySite>({ url: `${API}/sites/${siteId}`, headers: this.auth(ctx.token) }, { provider: 'Netlify' })).data;\n }\n ctx.progress('creating site');\n const base = (ctx.options.siteName as string | undefined) ?? ctx.serviceName;\n // Site names are global; retry with a suffix if the name is taken.\n for (const name of [base, `${base}-${randomSuffix()}`, `${base}-${randomSuffix()}`]) {\n const r = await this.http.request<NetlifySite>(\n { method: 'POST', url: `${API}/sites`, headers: this.auth(ctx.token), json: { name } },\n { provider: 'Netlify', allowStatus: [422] },\n );\n if (r.status !== 422) return r.data;\n }\n throw new DeploymentFailedError('Netlify', `could not create a site named \"${base}\"`, 'Set providers.netlify.siteName in omnideploy.json.');\n }\n\n private async getDeploy(token: string, id: string): Promise<NetlifyDeploy> {\n return (await this.http.request<NetlifyDeploy>({ url: `${API}/deploys/${id}`, headers: this.auth(token) }, { provider: 'Netlify' })).data;\n }\n\n private auth(token: string) {\n return { authorization: `Bearer ${token}` };\n }\n}\n\nconst randomSuffix = () => Math.random().toString(36).slice(2, 7);\n","import {\n DeploymentFailedError,\n MissingToolError,\n type DeployContext,\n type Deployment,\n type DeploymentProvider,\n type ProcessRunnerPort,\n type ProviderCapabilities,\n} from '../../domain/index.js';\nimport { redact } from './support.js';\n\nconst INSTALL = 'npm i -g @railway/cli (or: brew install railway)';\n\n/**\n * Railway's public API has no simple \"upload this directory\" endpoint, so this provider\n * drives the official CLI: `railway up` uploads the project (including the generated\n * Dockerfile and railway.json) and builds it on Railway.\n */\nexport class RailwayProvider implements DeploymentProvider {\n readonly id = 'railway';\n readonly displayName = 'Railway';\n readonly capabilities: ProviderCapabilities = {\n kinds: ['static', 'server', 'serverless'],\n serverLanguages: 'any',\n buildsFromGit: false,\n requiredCli: { bin: 'railway', install: INSTALL },\n auth: { envVar: 'RAILWAY_TOKEN', tokenUrl: 'https://railway.com/account/tokens (create a *project* token: Project → Settings → Tokens)' },\n };\n\n constructor(private readonly proc: ProcessRunnerPort) {}\n\n requiredArtifacts() {\n return ['dockerfile', 'dockerignore', 'railway-json'];\n }\n\n async validate(): Promise<void> {\n if (!(await this.proc.has('railway'))) throw new MissingToolError('railway', INSTALL);\n }\n\n async deploy(ctx: DeployContext): Promise<Deployment> {\n const env = { RAILWAY_TOKEN: ctx.token };\n const scope = [\n ...(ctx.options.service ? ['--service', String(ctx.options.service)] : []),\n ...(ctx.options.environment ? ['--environment', String(ctx.options.environment)] : []),\n ];\n\n ctx.progress('uploading and building (this can take a few minutes)');\n const up = await this.proc.run('railway', ['up', '--ci', ...scope], { cwd: ctx.profile.rootDir, env });\n const output = redact(`${up.stdout}\\n${up.stderr}`, ctx.token);\n const logsUrl = output.match(/https:\\/\\/railway\\.(?:com|app)\\/project\\/\\S+/)?.[0];\n if (up.exitCode !== 0) {\n const tail = output.trim().split('\\n').slice(-12).join('\\n');\n throw new DeploymentFailedError('Railway', tail || `railway up exited with ${up.exitCode}`, logsUrl ? `Build logs: ${logsUrl}` : undefined);\n }\n\n ctx.progress('fetching public URL');\n const domain = await this.proc.run('railway', ['domain', ...scope], { cwd: ctx.profile.rootDir, env });\n const url = `${domain.stdout}\\n${domain.stderr}`.match(/https:\\/\\/[a-z0-9.-]+\\.(?:up\\.railway\\.app|railway\\.app|[a-z]{2,})/i)?.[0];\n\n return {\n provider: this.id,\n id: logsUrl?.match(/[?&]id=([\\w-]+)/)?.[1] ?? 'latest',\n url,\n state: 'ready',\n dashboardUrl: logsUrl,\n };\n }\n}\n","import {\n DeploymentFailedError,\n DomainError,\n ProviderApiError,\n type DeployContext,\n type Deployment,\n type DeploymentProvider,\n type DeploymentState,\n type DeploymentStatus,\n type GitPort,\n type HttpClientPort,\n type ProjectProfile,\n type ProviderCapabilities,\n type ProviderContext,\n type ProviderOptions,\n} from '../../domain/index.js';\nimport { renderNativeBuild, renderRuntime, renderUsesDocker } from '../generators/provider-config/render.js';\nimport { DEFAULT_POLL, poll, type PollOptions } from './support.js';\n\nconst API = 'https://api.render.com/v1';\n\ninterface RenderService {\n id: string;\n name: string;\n dashboardUrl?: string;\n serviceDetails?: { url?: string };\n}\ninterface RenderDeploy {\n id: string;\n status: string;\n createdAt?: string;\n finishedAt?: string;\n}\n\nconst STATE: Record<string, DeploymentState> = {\n created: 'queued',\n queued: 'queued',\n build_in_progress: 'building',\n update_in_progress: 'building',\n pre_deploy_in_progress: 'building',\n live: 'ready',\n deactivated: 'ready',\n build_failed: 'error',\n update_failed: 'error',\n pre_deploy_failed: 'error',\n canceled: 'canceled',\n};\nconst FINAL = new Set(['live', 'deactivated', 'build_failed', 'update_failed', 'pre_deploy_failed', 'canceled']);\n\n/** Render builds from the git remote (natively or from the generated Dockerfile). */\nexport class RenderProvider implements DeploymentProvider {\n readonly id = 'render';\n readonly displayName = 'Render';\n readonly capabilities: ProviderCapabilities = {\n kinds: ['static', 'server', 'serverless'],\n serverLanguages: 'any',\n buildsFromGit: true,\n auth: { envVar: 'RENDER_API_KEY', tokenUrl: 'https://dashboard.render.com/u/settings#api-keys' },\n };\n\n constructor(\n private readonly http: HttpClientPort,\n private readonly git: GitPort,\n private readonly pollOpts: PollOptions = DEFAULT_POLL,\n ) {}\n\n requiredArtifacts(profile: ProjectProfile) {\n return renderUsesDocker(profile) ? ['dockerfile', 'dockerignore', 'render-yaml'] : ['render-yaml'];\n }\n\n async validate(ctx: { rootDir: string; options: ProviderOptions }): Promise<void> {\n if (ctx.options.serviceId) return;\n const remote = await this.git.remote(ctx.rootDir);\n if (remote && !toHttpsRepo(remote.url)) {\n throw new DomainError(`Render cannot use the git remote \"${remote.url}\".`, 'Use a GitHub, GitLab or Bitbucket remote.', 'UNSUPPORTED_REMOTE');\n }\n }\n\n async deploy(ctx: DeployContext): Promise<Deployment> {\n let serviceId = ctx.options.serviceId as string | undefined;\n let ownerId = ctx.options.ownerId as string | undefined;\n let deployId: string;\n\n if (!serviceId) {\n ownerId ??= await this.ownerId(ctx);\n ctx.progress('creating service');\n const created = await this.createService(ctx, ownerId);\n serviceId = created.service.id;\n deployId = created.deployId;\n } else {\n ctx.progress('triggering deploy');\n const r = await this.http.request<RenderDeploy>(\n { method: 'POST', url: `${API}/services/${serviceId}/deploys`, headers: this.auth(ctx.token), json: { clearCache: 'do_not_clear' } },\n { provider: 'Render' },\n );\n deployId = r.data.id;\n }\n\n const { value: d, timedOut } = await poll(\n () => this.getDeploy(ctx.token, serviceId!, deployId),\n (d) => {\n ctx.progress(`${d.status.replace(/_/g, ' ')} (Render builds can take several minutes)`);\n return FINAL.has(d.status);\n },\n this.pollOpts,\n );\n const service = await this.getService(ctx.token, serviceId);\n const state = STATE[d.status] ?? 'unknown';\n if (state === 'error' || state === 'canceled') {\n throw new DeploymentFailedError('Render', d.status.replace(/_/g, ' '), service.dashboardUrl ? `Logs: ${service.dashboardUrl}/deploys/${d.id}` : undefined);\n }\n return {\n provider: this.id,\n id: d.id,\n url: service.serviceDetails?.url,\n state: timedOut ? 'building' : state,\n dashboardUrl: service.dashboardUrl,\n configUpdates: { serviceId, ownerId },\n };\n }\n\n async status(ctx: ProviderContext, deploymentId?: string): Promise<DeploymentStatus> {\n const serviceId = ctx.options.serviceId as string | undefined;\n if (!serviceId) return { id: '-', state: 'unknown', message: 'No Render service yet — deploy first.' };\n let d: RenderDeploy | undefined;\n if (deploymentId) d = await this.getDeploy(ctx.token, serviceId, deploymentId);\n else {\n const r = await this.http.request<Array<{ deploy: RenderDeploy }>>({ url: `${API}/services/${serviceId}/deploys`, headers: this.auth(ctx.token), query: { limit: 1 } }, { provider: 'Render' });\n d = r.data[0]?.deploy;\n }\n if (!d) return { id: '-', state: 'unknown', message: 'No deploys yet.' };\n const service = await this.getService(ctx.token, serviceId);\n return { id: d.id, state: STATE[d.status] ?? 'unknown', url: service.serviceDetails?.url, createdAt: d.createdAt, message: d.status };\n }\n\n private async ownerId(ctx: DeployContext): Promise<string> {\n const r = await this.http.request<Array<{ owner: { id: string; name: string } }>>(\n { url: `${API}/owners`, headers: this.auth(ctx.token), query: { limit: 20 } },\n { provider: 'Render' },\n );\n const owners = r.data.map((o) => o.owner);\n if (owners.length === 0) throw new DomainError('Your Render account has no workspace.', 'Create one at https://dashboard.render.com.', 'RENDER_NO_OWNER');\n if (owners.length > 1) ctx.logger.warn(`Using Render workspace \"${owners[0]!.name}\". Set providers.render.ownerId to choose another.`);\n return owners[0]!.id;\n }\n\n private async createService(ctx: DeployContext, ownerId: string): Promise<{ service: RenderService; deployId: string }> {\n const p = ctx.profile;\n const remote = await this.git.remote(p.rootDir);\n const repo = remote && toHttpsRepo(remote.url);\n if (!repo) throw new DomainError('Render needs a git remote to build from.', 'git remote add origin <url> && git push -u origin HEAD', 'NO_GIT_REMOTE');\n const branch = (ctx.options.branch as string | undefined) ?? (await this.git.currentBranch(p.rootDir)) ?? 'main';\n const runtime = renderRuntime(p);\n\n const serviceDetails =\n runtime === 'static'\n ? { buildCommand: p.buildCommand ?? '', publishPath: p.outputDir ?? '.' }\n : {\n runtime,\n plan: (ctx.options.plan as string | undefined) ?? 'free',\n region: (ctx.options.region as string | undefined) ?? 'oregon',\n healthCheckPath: (ctx.options.healthCheckPath as string | undefined) ?? '/',\n envSpecificDetails:\n runtime === 'docker'\n ? { dockerfilePath: './Dockerfile', dockerContext: '.' }\n : { buildCommand: renderNativeBuild(p), startCommand: p.startCommand ?? '' },\n };\n\n try {\n const r = await this.http.request<{ service: RenderService; deployId: string }>(\n {\n method: 'POST',\n url: `${API}/services`,\n headers: this.auth(ctx.token),\n json: {\n type: runtime === 'static' ? 'static_site' : 'web_service',\n name: (ctx.options.serviceName as string | undefined) ?? ctx.serviceName,\n ownerId,\n repo,\n branch,\n autoDeploy: 'yes',\n serviceDetails,\n },\n },\n { provider: 'Render' },\n );\n return r.data;\n } catch (e) {\n if (e instanceof ProviderApiError && e.status && e.status < 500 && /repo/i.test(e.message)) {\n throw new ProviderApiError('Render', e.message, e.status, 'Connect your Git provider to Render (Account settings → Git) and grant access to this repository.');\n }\n throw e;\n }\n }\n\n private async getDeploy(token: string, serviceId: string, deployId: string): Promise<RenderDeploy> {\n return (await this.http.request<RenderDeploy>({ url: `${API}/services/${serviceId}/deploys/${deployId}`, headers: this.auth(token) }, { provider: 'Render' })).data;\n }\n\n private async getService(token: string, serviceId: string): Promise<RenderService> {\n return (await this.http.request<RenderService>({ url: `${API}/services/${serviceId}`, headers: this.auth(token) }, { provider: 'Render' })).data;\n }\n\n private auth(token: string) {\n return { authorization: `Bearer ${token}` };\n }\n}\n\n/** git@github.com:o/r.git → https://github.com/o/r */\nexport function toHttpsRepo(url: string): string | null {\n const m = url.match(/^(?:git@|ssh:\\/\\/git@|https?:\\/\\/(?:[^@/]+@)?)(github\\.com|gitlab\\.com|bitbucket\\.org)[:/](.+?)(?:\\.git)?\\/?$/);\n return m ? `https://${m[1]}/${m[2]}` : null;\n}\n","import {\n DeploymentFailedError,\n ProviderApiError,\n isSinglePageApp,\n type DeployContext,\n type Deployment,\n type DeploymentProvider,\n type DeploymentState,\n type DeploymentStatus,\n type FileSystemPort,\n type HttpClientPort,\n type ProjectProfile,\n type ProviderCapabilities,\n type ProviderContext,\n} from '../../domain/index.js';\nimport { DEFAULT_POLL, poll, sha1, type InMemoryFile, type PollOptions } from './support.js';\n\nconst API = 'https://api.vercel.com';\n\ninterface VercelDeployment {\n id: string;\n url: string;\n readyState?: string;\n status?: string;\n alias?: string[];\n projectId?: string;\n inspectorUrl?: string;\n errorMessage?: string;\n createdAt?: number;\n}\n\nconst STATE: Record<string, DeploymentState> = {\n QUEUED: 'queued',\n INITIALIZING: 'building',\n BUILDING: 'building',\n READY: 'ready',\n ERROR: 'error',\n CANCELED: 'canceled',\n};\n\n/** Source-upload ignores for frameworks Vercel builds remotely. */\nconst SOURCE_IGNORES = ['.vercel/**', '.next/**', '.nuxt/**', '.output/**', '.svelte-kit/**', 'dist/**', '.env', '.env.*'];\n\nexport class VercelProvider implements DeploymentProvider {\n readonly id = 'vercel';\n readonly displayName = 'Vercel';\n readonly capabilities: ProviderCapabilities = {\n kinds: ['static', 'serverless'],\n serverLanguages: [],\n serverlessFrameworks: ['nextjs', 'nuxt', 'sveltekit', 'remix', 'astro'],\n buildsFromGit: false,\n auth: { envVar: 'VERCEL_TOKEN', tokenUrl: 'https://vercel.com/account/tokens' },\n };\n\n constructor(\n private readonly http: HttpClientPort,\n private readonly fs: FileSystemPort,\n private readonly pollOpts: PollOptions = DEFAULT_POLL,\n ) {}\n\n requiredArtifacts(profile: ProjectProfile) {\n return isSinglePageApp(profile) ? ['vercel-json'] : [];\n }\n\n async validate(): Promise<void> {}\n\n async deploy(ctx: DeployContext): Promise<Deployment> {\n const isStatic = ctx.profile.kind === 'static';\n const files = await this.collect(ctx, isStatic);\n const name = (ctx.options.project as string | undefined) ?? ctx.serviceName;\n const query = { teamId: ctx.options.teamId as string | undefined, skipAutoDetectionConfirmation: 1 };\n const manifest = files.map((f) => ({ file: f.path, sha: sha1(f.data), size: f.data.byteLength }));\n const body = {\n name,\n files: manifest,\n target: ctx.production ? 'production' : undefined,\n projectSettings: isStatic ? { framework: null } : { framework: ctx.profile.framework === 'nextjs' ? 'nextjs' : ctx.profile.framework },\n };\n\n ctx.progress(`creating deployment (${files.length} files)`);\n let created = await this.http.request<VercelDeployment & { error?: { code: string; missing?: string[] } }>(\n { method: 'POST', url: `${API}/v13/deployments`, headers: this.auth(ctx.token), query, json: body },\n { provider: 'Vercel', allowStatus: [400] },\n );\n if (created.status === 400) {\n const missing = new Set(created.data.error?.missing ?? []);\n if (created.data.error?.code !== 'missing_files' || missing.size === 0) {\n throw new ProviderApiError('Vercel', JSON.stringify(created.data.error), 400);\n }\n await this.upload(ctx, files.filter((f) => missing.has(sha1(f.data))), query.teamId);\n ctx.progress('creating deployment');\n created = await this.http.request({ method: 'POST', url: `${API}/v13/deployments`, headers: this.auth(ctx.token), query, json: body }, { provider: 'Vercel' });\n }\n\n ctx.progress('building');\n const { value: d, timedOut } = await poll(\n () => this.get(ctx.token, created.data.id, query.teamId),\n (d) => ['READY', 'ERROR', 'CANCELED'].includes(d.readyState ?? d.status ?? ''),\n this.pollOpts,\n );\n const state = STATE[d.readyState ?? d.status ?? ''] ?? 'unknown';\n if (state === 'error' || state === 'canceled') {\n throw new DeploymentFailedError('Vercel', d.errorMessage ?? state, d.inspectorUrl ? `Build logs: ${d.inspectorUrl}` : undefined);\n }\n const host = ctx.production ? (d.alias?.[0] ?? d.url) : d.url;\n return {\n provider: this.id,\n id: d.id,\n url: `https://${host}`,\n state: timedOut ? 'building' : state,\n dashboardUrl: d.inspectorUrl,\n configUpdates: { project: name, projectId: d.projectId },\n };\n }\n\n async status(ctx: ProviderContext, deploymentId?: string): Promise<DeploymentStatus> {\n const teamId = ctx.options.teamId as string | undefined;\n let id = deploymentId;\n if (!id) {\n const list = await this.http.request<{ deployments: Array<{ uid: string }> }>(\n { url: `${API}/v6/deployments`, headers: this.auth(ctx.token), query: { projectId: ctx.options.projectId as string, limit: 1, teamId } },\n { provider: 'Vercel' },\n );\n id = list.data.deployments[0]?.uid;\n if (!id) return { id: '-', state: 'unknown', message: 'No deployments yet.' };\n }\n const d = await this.get(ctx.token, id, teamId);\n return {\n id: d.id,\n state: STATE[d.readyState ?? d.status ?? ''] ?? 'unknown',\n url: `https://${d.url}`,\n createdAt: d.createdAt ? new Date(d.createdAt).toISOString() : undefined,\n message: d.errorMessage,\n };\n }\n\n private async collect(ctx: DeployContext, isStatic: boolean): Promise<InMemoryFile[]> {\n const root = ctx.profile.rootDir;\n const paths = isStatic\n ? await this.fs.collectFiles(ctx.sourceDir)\n : await this.fs.collectFiles(root, { respectGitignore: true, ignore: SOURCE_IGNORES });\n const base = isStatic ? ctx.sourceDir : root;\n const files = await Promise.all(paths.map(async (p) => ({ path: p, data: await this.fs.readBytes(this.fs.join(base, p)) })));\n // A root vercel.json (e.g. SPA rewrites) applies to prebuilt static output too.\n if (isStatic && !paths.includes('vercel.json')) {\n const cfg = await this.fs.readTextIfExists(this.fs.join(root, 'vercel.json'));\n if (cfg) files.push({ path: 'vercel.json', data: new TextEncoder().encode(cfg) });\n }\n return files;\n }\n\n private async upload(ctx: DeployContext, files: InMemoryFile[], teamId?: string): Promise<void> {\n let done = 0;\n const queue = [...files];\n const worker = async () => {\n for (let f = queue.shift(); f; f = queue.shift()) {\n await this.http.request(\n {\n method: 'POST',\n url: `${API}/v2/files`,\n query: { teamId },\n headers: { ...this.auth(ctx.token), 'content-type': 'application/octet-stream', 'x-vercel-digest': sha1(f.data) },\n body: f.data,\n },\n { provider: 'Vercel' },\n );\n ctx.progress(`uploading files ${++done}/${files.length}`);\n }\n };\n await Promise.all(Array.from({ length: Math.min(8, files.length) }, worker));\n }\n\n private async get(token: string, id: string, teamId?: string): Promise<VercelDeployment> {\n const r = await this.http.request<VercelDeployment>({ url: `${API}/v13/deployments/${id}`, headers: this.auth(token), query: { teamId } }, { provider: 'Vercel' });\n return r.data;\n }\n\n private auth(token: string) {\n return { authorization: `Bearer ${token}` };\n }\n}\n","import type { DeploymentProvider, FileSystemPort, GitPort, HttpClientPort, ProcessRunnerPort } from '../../domain/index.js';\nimport { GitHubPagesProvider } from './GitHubPagesProvider.js';\nimport { NetlifyProvider } from './NetlifyProvider.js';\nimport { RailwayProvider } from './RailwayProvider.js';\nimport { RenderProvider } from './RenderProvider.js';\nimport { VercelProvider } from './VercelProvider.js';\n\nexport interface ProviderDeps {\n http: HttpClientPort;\n fs: FileSystemPort;\n git: GitPort;\n proc: ProcessRunnerPort;\n}\n\nexport function builtInProviders({ http, fs, git, proc }: ProviderDeps): DeploymentProvider[] {\n return [\n new VercelProvider(http, fs),\n new NetlifyProvider(http, fs),\n new GitHubPagesProvider(http, fs, git),\n new RailwayProvider(proc),\n new RenderProvider(http, git),\n ];\n}\n","import * as p from '@clack/prompts';\nimport { UserCancelledError, type Choice, type PromptPort, type Spinner } from '../../domain/index.js';\n\nfunction unwrap<T>(value: T): Exclude<T, symbol> {\n if (p.isCancel(value)) throw new UserCancelledError();\n return value as Exclude<T, symbol>;\n}\n\nexport class ClackPrompt implements PromptPort {\n constructor(readonly interactive: boolean) {}\n\n async confirm(message: string, initial = true): Promise<boolean> {\n return unwrap(await p.confirm({ message, initialValue: initial }));\n }\n\n async select<T extends string>(message: string, choices: Choice<T>[]): Promise<T> {\n return unwrap(await p.select<T>({ message, options: choices as never }));\n }\n\n async multiselect<T extends string>(message: string, choices: Choice<T>[], initial: T[] = []): Promise<T[]> {\n return unwrap(await p.multiselect<T>({ message, options: choices as never, initialValues: initial, required: true }));\n }\n\n async text(message: string, opts: { placeholder?: string; initial?: string } = {}): Promise<string> {\n return unwrap(await p.text({ message, placeholder: opts.placeholder, initialValue: opts.initial }));\n }\n\n async password(message: string): Promise<string> {\n return unwrap(await p.password({ message }));\n }\n\n note(body: string, title?: string): void {\n p.note(body, title);\n }\n\n spinner(): Spinner {\n if (!this.interactive) {\n // Plain line output for CI logs.\n return {\n start: (m) => p.log.step(m),\n message: () => {},\n stop: (m, ok = true) => (ok ? p.log.success(m) : p.log.error(m)),\n };\n }\n const s = p.spinner();\n return {\n start: (m) => s.start(m),\n message: (m) => s.message(m),\n stop: (m, ok = true) => (ok ? s.stop(m) : s.error(m)),\n };\n }\n}\n","import * as p from '@clack/prompts';\nimport pc from 'picocolors';\nimport type { LoggerPort } from '../../domain/index.js';\n\nexport class ConsoleLogger implements LoggerPort {\n constructor(private readonly debugEnabled = false) {}\n\n info(message: string): void {\n p.log.info(message);\n }\n step(message: string): void {\n p.log.step(message);\n }\n success(message: string): void {\n p.log.success(message);\n }\n warn(message: string): void {\n p.log.warn(message);\n }\n error(message: string): void {\n p.log.error(message);\n }\n debug(message: string): void {\n if (this.debugEnabled) p.log.message(pc.dim(message));\n }\n}\n"],"mappings":";;;AAAA,SAAS,WAAAA,gBAAe;AACxB,SAAS,eAAe;;;ACDxB,YAAY,OAAO;AAEnB,OAAO,QAAQ;AAGR,SAAS,aAAaC,UAAkBC,MAAuB;AACpE,EAAAD,SACG,QAAQ,OAAO,EACf,YAAY,kCAAkC,EAC9C,SAAS,YAAY,EACrB,OAAO,uBAAuB,4DAA4D,EAC1F,OAAO,OAAO,UAAkB,SAA6B;AAC5D,UAAM,IAAIC,KAAI,UAAU;AACxB,UAAM,EAAE,MAAM,QAAQ,UAAU,KAAK,KAAK;AAC1C,IAAE,MAAI,QAAQ,gBAAgB,EAAE,UAAU,IAAI,QAAQ,EAAE,WAAW,GAAG;AAAA,EACxE,CAAC;AAEH,EAAAD,SACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,SAAS,YAAY,EACrB,OAAO,OAAO,aAAqB;AAClC,UAAM,IAAIC,KAAI,UAAU;AACxB,UAAM,UAAU,MAAM,EAAE,OAAO,QAA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AAmB,gBAAgB,cAAc,GAAG;AACxI,WAAS,SAAS,GAAG;AACvB;AAEA,IAAI;AACF,QAAM,QAAQ,WAAW,QAAQ,IAAI;AACvC,SAAS,OAAO;AACd,UAAQ,WAAW,aAAa,OAAO,IAAI,MAAM,CAAC;AACpD;","names":["resolve","program","env","p","pc","p","pc","p","p","pc","program","env","pc","o","p","pc","program","env","p","pc","program","env","pc","p","pc","program","env","p","pc","program","env","pc","p","pc","program","env","join","p","p","process","p","spinner","p","process","p","p","env","staticSite","name","entry","parseToml","parseToml","mkdir","readFile","writeFile","dirname","p","p","p","stringify","p","text","resolve","text","API","p","d","env","API","STATE","d","p","API","STATE","d","p","p","p","pc","join","resolve"]}
|