/** Claude Code `--permission-mode` values, as accepted by CLI v2.1.x. */ export declare const PERMISSION_MODES: readonly ["acceptEdits", "auto", "bypassPermissions", "manual", "dontAsk", "plan"]; export type PermissionMode = (typeof PERMISSION_MODES)[number]; export declare function isPermissionMode(value: unknown): value is PermissionMode; export declare const DANGEROUS_PERMISSION_MODES: readonly PermissionMode[]; export declare function isDangerousPermissionMode(mode: PermissionMode): boolean; /** * The mode sessions will actually spawn with, for callers that need to know * before any spawn happens (the boot warning). Mirrors the precedence * `StreamerServer.spawnFlagOverrides()` applies — `claudeFlags.permissionMode` * wins over the `--default-permission-mode` fallback — so the two must not * drift: a warning that reads the fallback would stay silent while a * `claude_flags:` bypass is what actually reaches argv. */ export declare function effectivePermissionMode(flags: ClaudeFlagValues | undefined, fallback: string | undefined): PermissionMode | undefined; /** Claude Code `--effort` levels, as accepted by CLI v2.1.x. */ export declare const EFFORT_LEVELS: readonly ["low", "medium", "high", "xhigh", "max"]; export type EffortLevel = (typeof EFFORT_LEVELS)[number]; export declare function isEffortLevel(value: unknown): value is EffortLevel; export type FlagValueType = "boolean" | "string" | "enum" | "list"; /** How risky enabling a flag is. Drives the client's confirmation UX. */ export type FlagRisk = "low" | "elevated" | "dangerous"; export interface FlagDefinition { /** Stable config/wire key. Never the CLI spelling. */ id: string; /** The literal CLI token, e.g. "--add-dir". */ flag: string; valueType: FlagValueType; /** Allowed values when valueType === "enum". */ enumValues?: readonly string[]; /** * Baseline risk. `permissionMode` is the exception: it is only dangerous for * the values in DANGEROUS_PERMISSION_MODES, so clients must call * `flagValueRisk()` rather than reading this field directly. */ risk: FlagRisk; } export type ClaudeFlagValue = string | string[] | boolean; export type ClaudeFlagValues = Record; export declare const CLAUDE_FLAGS: readonly FlagDefinition[]; export declare function findFlag(id: string): FlagDefinition | undefined; /** * Effective risk of a specific value. Only `permissionMode` is value-dependent * (`acceptEdits` is routine; `bypassPermissions` is not). */ export declare function flagValueRisk(id: string, value: ClaudeFlagValue): FlagRisk; /** * Drop everything that isn't a known id carrying a well-typed value. * * This is a TRUST BOUNDARY, not a convenience: values arrive from a * user-editable server.yaml and from HTTP, and they become process argv. Never * skip it. Unknown/invalid entries are dropped rather than throwing so one bad * key can't prevent the server from booting. */ export declare function validateFlagValues(raw: unknown): ClaudeFlagValues; /** * Split a free-text extra-args string into argv tokens, honouring single and * double quotes so a path with spaces survives. Deliberately not a full shell * parser — no variable expansion, no globbing, no escapes beyond the quotes. */ export declare function tokenizeExtraArgs(input: string | undefined): string[]; /** * Turn validated flag values + extra args into argv tokens. * * The SPAWN_POSITIONAL_FLAG_IDS are intentionally NOT emitted here: both PTY * spawn paths already pass them as explicit positionals, and emitting them * twice would put a duplicate flag on the command line. They flow through * `options.permissionMode` / `options.model` / `options.effort` instead, which * StreamerServer.spawnFlagOverrides() sources from these same flag values. * * Extra args land LAST so the escape hatch can override anything the allowlist * set. */ export declare function buildFlagArgs(values: ClaudeFlagValues | undefined, extraArgs?: string): string[]; export declare function buildSettingsJson(permissionMode: PermissionMode): string; //# sourceMappingURL=claude-flags.d.ts.map