import { type MachineMode } from "./protocol.js"; /** The machine token, in `.env`; never forwarded to a run, never printed after pairing. */ export declare const CLOUD_TOKEN_ENV = "SKILLHOOK_CLOUD_TOKEN"; /** The machine's X25519 private key (base64url), in `.env`; for values the cloud seals to this machine. */ export declare const CLOUD_PRIVATE_KEY_ENV = "SKILLHOOK_CLOUD_PRIVATE_KEY"; /** A person's organisation API key (`shc_…`) for the fleet (`skillhook cloud login`), in `.env` or the environment; never the machine token. */ export declare const CLOUD_API_KEY_ENV = "SKILLHOOK_CLOUD_API_KEY"; /** The cloud that key was checked against at login: its requests go there and nowhere else, whatever `cloud.url` says later. */ export declare const CLOUD_API_URL_ENV = "SKILLHOOK_CLOUD_API_URL"; /** Skillhook Cloud's production deployment (MeterApp/skillhook-cloud); `--url`, `SKILLHOOK_CLOUD_URL` and `cloud.url` name another one. */ export declare const DEFAULT_CLOUD_URL = "https://skillhook.dev"; /** Every variable of this family stays on the machine: never in a run's environment, even when a skill lists it. */ export declare const CLOUD_ENV_PREFIX = "SKILLHOOK_CLOUD_"; export interface CloudPolicy { mode: MachineMode; /** Command types (or `job.*`, `*`) allowed regardless of mode; the only way to allow `allow_list` commands. */ allow_commands: string[]; /** Command types (or patterns) refused regardless of anything else. */ deny_commands: string[]; } /** Flag > `SKILLHOOK_CLOUD_URL` > `cloud.url` > the default, without a trailing slash. */ export declare function resolveCloudUrl(env: NodeJS.ProcessEnv, config: { url?: string; }, override?: string): string; /** Drops trailing slashes in one pass (a regex like `/\/+$/` backtracks quadratically on long runs of slashes). */ export declare function trimTrailingSlashes(value: string): string; /** `true` for https, and for plain http to a loopback address (a local cloud in tests) or when `SKILLHOOK_CLOUD_ALLOW_INSECURE=1`. */ export declare function isSecureCloudUrl(url: string, env?: NodeJS.ProcessEnv): boolean; export declare class InsecureCloudUrlError extends Error { constructor(url: string); } export declare function assertSecureCloudUrl(url: string, env?: NodeJS.ProcessEnv): void; /** `SKILLHOOK_NO_CLOUD=1`: the kill switch that beats every config file. */ export declare function cloudDisabledByEnv(env?: NodeJS.ProcessEnv): boolean; /** Set, and not "", "0" or "false": how the switches in the environment read (`SKILLHOOK_NO_CLOUD`, `CI`). */ export declare function truthy(value: string | undefined): boolean; /** `job.answer` matches `job.answer`, `job.*` and `*`. */ export declare function commandMatches(type: string, pattern: string): boolean; /** Deny list first, then the allow list, then the mode: read commands always, control ones only in `control` mode, allow-list ones only when listed. */ export declare function commandAllowed(type: string, policy: CloudPolicy): { allowed: boolean; reason?: string; };