export interface Config { /** * Base URL of the Rustpad instance, e.g. `https://rustpad.example.net`. * May be undefined: the server still starts and lists its tools, every call * then fails with {@link missingConfigMessage}. The same URL is used for the * HTTP API, the WebSocket endpoint (http→ws mapped) and the share links * returned by the tools. */ url: string | undefined; insecureTls: boolean; readOnly: boolean; /** * Whether a client that *can* show a dialog is asked before a guarded tool * acts. `ELICITATION=false` turns the dialog off — the guard stays and falls * back to the two-call token, so there is no setting in which a guarded call * goes unannounced. */ elicitation: boolean; /** * Raw value of `RUSTPAD_ALLOW_TOOLS` — comma-separated tool names, `list_*` * prefixes, or `essential`. Kept unparsed on purpose: this file is a mirror of * the environment, and the names can only be checked against the tool * catalogue, which `buildToolFilter` does. */ allowTools: string | undefined; /** Raw value of `RUSTPAD_DENY_TOOLS`, same shape, subtracted from the above. */ denyTools: string | undefined; } /** Shown when the configuration is incomplete — at startup and on every call. */ export declare function missingConfigMessage(missing: string[]): string; /** Names of the required environment variables that are unset in `config`. */ export declare function missingConfigKeys(config: Config): string[]; /** * Reads `ELICITATION` — deliberately unprefixed, and deliberately fatal on * anything it does not recognise. * * Unprefixed: environment variables are process-wide, so this is one switch for * every server in the same environment. That is also its risk, which is why a * server started with it off says so on its startup line. * * Fatal: this is the first variable of the family that defaults to *on*. The * others fail open on a typo, which is the safe direction for them. Here a typo * would leave the dialog running while the operator believes it is off — and an * operator who believes that has no way to find out. */ export declare function parseElicitation(raw: string | undefined): boolean; /** * Reads the configuration from environment variables. * * A missing URL is only a warning, not a fatal error: the server must be able * to complete the MCP handshake and answer `tools/list` without it, so * registries and sandbox inspectors can introspect it. A malformed URL still * exits — every request built from it would go to the wrong place. */ export declare function loadConfig(env?: NodeJS.ProcessEnv): Config; /** * A counted loop rather than `/\/+$/`: a suffix pattern that starts with a * repetition is tried from every position of the run, so a path of many * slashes costs its length squared. The URL is the operator's, and the cost is * paid once at startup — but the same helper serves the socket URL on every * call, and the rule is cheaper to keep than to argue about. */ export declare function stripTrailingSlashes(path: string): string;