/** * The `astrale-domain` CLI — dev | build | deploy | publish | lint. * * Thin by design: it reads `astrale.config.ts`, resolves `envs[] → params` * via the adapter, loads the env's secrets file, then drives `adapter.watch` * (dev) or `adapter.deploy` (build+ship). It prints the resulting URL and the * exact `astrale domain install --direct` line. It boots no kernel and knows * nothing provider-specific — that all lives in the adapter. * * The diagnostic spec (`.astrale/spec.json`) is written AFTER watch/deploy * returns, at the live URL: the install graph (and therefore `schemaHash`) * embeds `binding.remoteUrl`s derived from the serving URL, so a spec built at * a guessed URL would carry a hash that never matches the worker's `/meta`. * Only `astrale-domain build` (no URL exists yet) uses an explicit placeholder * and says so. * * astrale-domain dev # = deploy dev --watch * astrale-domain prod # = deploy prod * astrale-domain deploy # any env key * astrale-domain build # rebuild spec only (placeholder URL) * astrale-domain lint # generic + Astrale static diagnostics * astrale-domain publish [env] # RELEASE: publish ./schema to npm (if any) + register the deployed URL * * A release has two halves that must stay in sync: the CONTRACT (`./schema` on * npm) and the DEPLOYMENT (worker URL in the catalog). `publish` does both, * npm-FIRST — `npm publish` is irreversible, so the catalog is registered only on * schema-publish success, never pointing at an unpublished contract. The schema * publish is idempotent (skips an unbumped version). Scope it with `--schema` * (contract only — config-free) or `--skip-schema` (catalog only). All publish * logic lives in `./publish.ts`; this file only parses args and dispatches. * * `publish` registers a domain's ALREADY-deployed URL in the admin catalog by * SHELLING OUT to the operator CLI (`astrale domain publish --origin --name * --public-url`); it does NOT deploy — run `prod` / `deploy ` first, or use * `deploy --publish` to deploy AND register in one step. Standalone publish * defaults the registered address to `https://` (what every fleet domain * serves at); pass `--public-url` for workers.dev / split-host deploys. Auth * lives entirely in the operator CLI — this build tool never touches * credentials. Requires `astrale` on PATH (the same CLI the deploy footer * already points you at for `domain install`). */ import type { DeployConfig } from '../config/deploy.js'; import { type LintReportFormat } from '../linter/report.js'; type ParsedArgs = { command: 'dev' | 'build' | 'deploy' | 'publish' | 'lint'; env: string; watch: boolean; /** `--fix` (lint) — apply safe Oxlint fixes before reporting remaining diagnostics. */ fix?: boolean; /** `--format ` (lint) — unified human or machine output. */ format?: LintReportFormat; /** `--dry-run` (publish) — pack + `npm publish --dry-run` and skip the catalog register. */ dryRun?: boolean; /** `--schema` (publish) — publish ONLY the `./schema` package; no catalog, no config. */ schemaOnly?: boolean; /** `--otp ` (publish / deploy --publish) — 2FA OTP forwarded to `npm publish`. */ otp?: string; /** `--skip-schema` (publish / deploy --publish) — register the catalog only; don't publish `./schema`. */ skipSchema?: boolean; /** `--port ` (dev only) — overrides the env's local dev port. */ port?: number; /** `--host ` (dev only) — public URL of a tunnel/proxy front: binds 0.0.0.0 + pins WORKER_URL. */ host?: string; /** `--publish` tail-flag on deploy/prod: ALSO register the freshly-deployed URL (deploy + register). */ publish?: boolean; /** `--name ` — registry name to publish under (default: the origin's first label, e.g. `ai-gateway`). */ name?: string; /** `--install-by-default` — mark the published domain for install on every new instance. */ installByDefault?: boolean; /** `--public-url ` — (publish only) the address the catalog points at (default: `https://`). */ publicUrl?: string; }; export declare function run(argv: readonly string[]): Promise; /** * Watch `astrale.config.ts` while `dev` runs: on change, re-import the config * (cache-busted), re-resolve env params + secrets, and re-run the adapter's * codegen via `adapter.regenerate` — the running dev server (e.g. `wrangler * dev`, which watches its generated config + entry) reloads them itself, so a * config edit lands without restarting the CLI. * * Watches the config's DIRECTORY, not the file: editors save via atomic * rename, which silently kills an inode-bound watch. * * Deliberate limits, surfaced to the user instead of half-applied: * • origin / adapter changes re-key the worker's identity → restart; * • a mid-edit broken config (syntax error, bad env) warns and keeps the * previous generation running; * • modules the config IMPORTS (e.g. the schema) stay module-cached — only * the config file itself is re-evaluated, which covers everything * `defineDomain` owns (vars, requires, postInstall, wrangler overlay…). */ export declare function watchConfigForRegen(args: { configPath: string; initial: DeployConfig; env: string; /** CLI flag overrides (dev --port / --host) — re-applied on every regen. */ paramOverrides: Record; projectDir: string; specPath: string; url: string; onReload: () => void; }): () => void; export declare function parseArgs(argv: readonly string[]): ParsedArgs; export {}; //# sourceMappingURL=run.d.ts.map