/** * Claude Code scoped-home provisioning. The harness authenticates by * endpoint key (see endpoint-auth.ts), so a scoped home needs nothing beyond * the directory itself: `claude -p` scaffolds `.claude.json` on its first * run, and the endpoint credential arrives per round through the spawn env * (resolved from the scope's endpoint-auth.json over the plugin config). * When `proxyUrl` is configured, the scoped `settings.json` gains an env * block pointing the CLI's own traffic at it — claude reads proxy settings * from this file, so the child works even when the host process environment * carries no proxy (a supervisor-spawned instance's env is not the user's * shell env). * @module @khorsheed/dsh-local-agent-claude-code/provision */ /** * Provision the scoped home directory. Claude creates it lazily on first * use, but creating it eagerly keeps the harness's homeDir contract uniform * with the other harnesses. Two maintenance duties run here: * * - Legacy OAuth sweep: the endpoint-key era never reads `.credentials.json` * or the `.claude.json` `oauthAccount` marker — both are deleted so a * pre-migration scoped home carries no dead grant (measured: claude * 2.1.296 prefers the env credential over a stored one anyway; the sweep * is hygiene, not priority repair). Other `.claude.json` keys survive. * - When `proxyUrl` is configured, the scoped `settings.json` gains an env * block pointing the CLI's own traffic at it — claude reads proxy settings * from this file, so the child works even when the host process environment * carries no proxy (a supervisor-spawned instance's env is not the user's * shell env). An existing settings file is merged, not overwritten; only * the two proxy keys are managed. * @param homeDir - the `claude-code` harness's scoped home. * @param proxyUrl - optional HTTP proxy URL for the child CLI's traffic. */ export declare function provisionClaudeHome(homeDir: string, proxyUrl?: string): Promise; /** * Remove the OAuth era's artifacts from the scoped home: the * `.credentials.json` grant file outright, and the `oauthAccount` marker key * from `.claude.json` (the file itself carries live CLI state and stays). * Idempotent and best-effort per file — a missing or malformed file is * simply not a sweep target. The macOS keychain entry is deliberately left * alone: the CLI never consults it once an env credential rides the spawn, * and keychain writes are outside the harness's file-based contract. * @param homeDir - the `claude-code` harness's scoped home. */ export declare function sweepLegacyOauth(homeDir: string): Promise; /** * Read the scoped settings' configured model: the `model` key of * `/settings.json` — the model a delegation round pins when the * scoped settings name one at all. Claude's own default model is decided by * the CLI and is deliberately NOT guessed here. Only the scoped file is * consulted (never the host's `~/.claude`); absent or malformed content * yields undefined. * @param homeDir - the `claude-code` harness's scoped home. * @returns the configured model identifier, or undefined when none is set. */ export declare function readClaudeConfiguredModel(homeDir: string): Promise; /** Read the scoped native effort setting without changing the settings file. */ export declare function readClaudeConfiguredEffort(homeDir: string): Promise; /** * Write (or, with undefined, remove) the scoped settings.json `model` key, * merging the rest of the file exactly as {@link provisionClaudeHome} merges * its env block. Only the live driver calls this: a resident runtime needs * its member's effective model IN THE FILE, because a `--resume` respawn * restores the session's own stored model over the `--model` flag. The exec * path never calls it — its `--model` flag always applies, and the file * stays exactly as the person edited it. * @param homeDir - the `claude-code` harness's scoped home. * @param model - the model to scratch in, or undefined to remove the key. */ export declare function writeClaudeScopedModel(homeDir: string, model: string | undefined): Promise; //# sourceMappingURL=provision.d.ts.map