/** * Set to `1` to always run the invoked CLI, even when the project has its own * `checkly` install. */ export declare const NO_DELEGATION_ENV = "CHECKLY_NO_DELEGATION"; /** The root of the checkly package this module belongs to. */ export declare const ownRoot: string; export interface Install { root: string; version: string; } export interface ProjectCli { /** The install's directory as found, i.e. `/node_modules/checkly`. */ dir: string; version: string; binPath: string; } /** * The short boolean flags of the commands that take `-c`. In a group of * short flags (`-pc path`), oclif lets each boolean letter pass and reads * the next letter, so a `c` after them is still `--config`. Installs from * before a new boolean short flag was added do not know it, and search from * the working directory when it is grouped with `c`. */ export declare const booleanShortFlags: Set; /** * The value of `--config` (or its short form `-c`) in raw command arguments, * in any form oclif accepts: `--config v`, `--config=v`, `-c v`, `-c=v`, * `-cv`, and `c` after boolean short flags in one group (`-pc v`, `-pcv`). * Arguments after `--` are not flags. * * Every command that takes a config file calls the flag `config` with the * short form `-c`, and other checkly installs read it here before handing a * command over, so the flag has to keep that meaning in every release. */ export declare function findConfigFlag(args: string[]): string | undefined; /** * The `checkly` install that a bare `checkly` import in `directory` resolves * to: the nearest `node_modules/checkly`, searched upwards like Node does. * NODE_PATH and global folders are deliberately not searched, because ES * module resolution of the project's files never uses them. Throws when a * candidate's package.json cannot be read, rather than skipping past the * install the project's imports would resolve to. */ export declare function findProjectCli(directory: string): Promise; /** Whether `version` is a development or canary build rather than a release. */ export declare function isDevelopmentBuild(version: string): boolean; /** Whether two paths are the same directory. Throws when either cannot be resolved. */ export declare function isSameDirectory(a: string, b: string): boolean; /** * The project's own CLI to run the command with instead of `self`, if any. * * Constructs in a project's config and check files register with the * `Session` of the `checkly` install the project resolves, so only that * install can load the project: when the running CLI is another install * (global, `pnpx`, an `npx` of another version), its `Session` would never * see them. Every command is handed off, which makes any install behave like * `npx checkly` run in the project's directory. */ export declare function findProjectCliHandOff(self: Install, directory?: string): Promise; /** * Node options for the project's CLI: this process's, minus inspector flags, * which would make the child compete with this process for the debugger * port. Use CHECKLY_NO_DELEGATION=1 to debug a hand-off case. */ export declare function childNodeOptions(execArgv: string[], nodeOptions: string | undefined): { execArgv: string[]; nodeOptions: string | undefined; }; /** * Runs `args` with the project's own CLI when {@link findProjectCliHandOff} * finds one, and exits with its exit status. Resolves to `false` when this * CLI should run the command itself. */ export declare function runWithProjectCli(args: string[], self?: Install): Promise;