UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

48 lines • 2.79 kB
export type CursorCliOauthExecutionMode = "agent" | "plan"; export type CursorCliOauthResumeMode = "auto" | "off"; export interface CursorCliOauthProviderSettings { /** * Explicit senpi-side opt-in for the AMBIENT lane (host-CLI-derived native * credential bootstrap). Defaults to false: a logged-in `cursor-agent` on the * host is not consent to spend that subscription from senpi. */ readonly enabled: boolean; /** * True only when a settings layer or the environment set `enabled` to false * verbatim. That is a kill switch and outranks stored accounts, while a merely * absent flag leaves an explicit senpi-side login usable. */ readonly explicitlyDisabled: boolean; readonly executablePath: string | undefined; readonly forceExecution: boolean; readonly noApprovalAcknowledgedAt: string | undefined; readonly executionMode: CursorCliOauthExecutionMode; readonly resumeMode: CursorCliOauthResumeMode; readonly pinnedAccount: string | undefined; readonly contextRecapOnModelSwitch: boolean; readonly modelCatalogTtlHours: number; readonly sandboxMode: string | undefined; /** Exact full commands the spawned CLI must refuse; globs are not supported. */ readonly denyCommands?: string[]; } type Environment = Readonly<Record<string, string | undefined>>; /** Parse one provider settings block with environment values taking precedence. */ export declare function parseCursorCliOauthProviderSettings(value: unknown, environment: Environment): CursorCliOauthProviderSettings; /** * Build the probe-owned sandbox allowlist validator without hardcoding modes in settings parsing. * Each distinct rejected mode is reported once through the supplied warning hook. */ export declare function createCursorCliOauthSandboxModeValidator(acceptedModes: ReadonlySet<string>, onWarning: (message: string) => void): (value: string | undefined) => string | undefined; /** Load global and project settings afresh, with env values taking final precedence. */ export declare function loadCursorCliOauthProviderSettingsFromDisk(cwd: string): CursorCliOauthProviderSettings; /** Persist explicit provider activation while preserving every sibling setting. */ export declare function persistCursorCliOauthEnabled(cwd: string, enabled: boolean): void; /** * Read-modify-write `noApprovalAcknowledgedAt` into the provider block of the * global settings file, preserving every other key. An unparseable file is * reported instead of silently clobbered, so an acknowledgement can never * claim success while leaving the settings unwritten. */ export declare function persistCursorCliNoApprovalAcknowledgement(cwd: string, acknowledgedAt: string): void; export {}; //# sourceMappingURL=settings.d.ts.map