import type { HerokuApiClientOptions } from '@heroku/heroku-fetch'; import type { Dyno } from '@heroku/types/3.sdk'; import type { ResourceCtx } from '../../../core/extend-resource.js'; export type RunDynoOptions = { /** * When `true`, the platform returns a dyno with a non-null * `attach_url` the caller can use to open its own interactive * session (STDIN/STDOUT rendezvous). The SDK itself does not open * the connection. */ attach?: boolean; /** * Options forwarded to the raw `HerokuApiClient` created for the * exec-inside path (`dyno` is set). The route registry has no entry * for `POST /apps/{app}/dynos/{dyno}`, so that call is issued via a * bare client. Ignored when `dyno` is omitted — the standard * create-one-off path uses the SDK's own routes client. */ clientOptions?: HerokuApiClientOptions; /** * If set, exec `command` inside the named dyno via * `POST /apps/{app}/dynos/{dyno}` with the `version=3.run-inside` * Accept variant. Omit to create a new one-off dyno via * `POST /apps/{app}/dynos`. */ dyno?: string; /** Additional environment variables layered onto the dyno. */ env?: Record; /** * When `true`, `command` is appended with `; echo "￿ * heroku-command-exit-status: $?"` to surface the process exit * code over the attach stream. Consumers may parse this line to * recover the exit code. * * Because the wrap uses a bare `;`, `command` must be a single * shell statement that terminates cleanly with `;`. Trailing `&` * (backgrounding), line continuations (`\`), unclosed quotes, or * unterminated heredocs will break the wrap and produce a shell * syntax error or garbled output. Callers who need those * constructs should wrap them in a subshell or `{ ...; }` group * themselves before passing `command`. */ exitCode?: boolean; /** * Serialized to the platform as `force_no_tty`. Forces an attached * one-off dyno to not run in a TTY even when the caller's * environment looks like one. */ forceNoTTY?: boolean; signal?: AbortSignal; size?: string; type?: string; }; /** * Create a one-off dyno or exec a command inside an existing one. * * Route selection: * - `POST /apps/{app}/dynos` (default) creates a new one-off dyno. * Uses the SDK's routes client, which sends the platform * service's default `Accept: version=3` header. * - `POST /apps/{app}/dynos/{dyno}` (when `options.dyno` is set) * execs the command inside the named dyno. Uses a raw * `HerokuApiClient` with `Accept: version=3.sdk` because the * routes registry has no entry for this endpoint. * * Retries: the runtime API occasionally returns 409 while a newly * pushed app's release is still propagating. This is transient and * short-lived, so 409 is retried up to two times back-to-back with no * delay. Any other error propagates. Matches the retry semantics of * the historical CLI implementation. * * The returned `Dyno` includes `attach_url` for callers who want to * open their own interactive session; the SDK does not establish the * session, spawn ssh, or manage TTY state. */ export declare function runDyno(ctx: Pick, appIdentity: string, command: string, options?: RunDynoOptions): Promise;