import { SettingsManager } from "./settings-manager-core.js";
import { settingsInternals } from "./settings-manager-internals.js";
const resourceAccessors = {
    getHideThinkingBlock() {
        return settingsInternals(this).settings.hideThinkingBlock ?? false;
    },
    getExternalEditorCommand() {
        const configuredEditor = settingsInternals(this).settings.externalEditor;
        if (typeof configuredEditor === "string" && configuredEditor.trim() !== "") {
            return configuredEditor;
        }
        const environmentEditor = process.env.VISUAL || process.env.EDITOR;
        if (environmentEditor) {
            return environmentEditor;
        }
        return process.platform === "win32" ? "notepad" : "nano";
    },
    setHideThinkingBlock(hide) {
        const state = settingsInternals(this);
        state.globalSettings.hideThinkingBlock = hide;
        state.markModified("hideThinkingBlock");
        state.save();
    },
    getShellPath() {
        return settingsInternals(this).settings.shellPath;
    },
    setShellPath(path) {
        const state = settingsInternals(this);
        state.globalSettings.shellPath = path;
        state.markModified("shellPath");
        state.save();
    },
    getDefaultProjectTrust() {
        const value = settingsInternals(this).globalSettings.defaultProjectTrust;
        return value === "always" || value === "never" ? value : "ask";
    },
    setDefaultProjectTrust(defaultProjectTrust) {
        const state = settingsInternals(this);
        state.globalSettings.defaultProjectTrust = defaultProjectTrust;
        state.markModified("defaultProjectTrust");
        state.save();
    },
    getQuietStartup() {
        return settingsInternals(this).settings.quietStartup ?? false;
    },
    setQuietStartup(quiet) {
        const state = settingsInternals(this);
        state.globalSettings.quietStartup = quiet;
        state.markModified("quietStartup");
        state.save();
    },
    getShellCommandPrefix() {
        return settingsInternals(this).settings.shellCommandPrefix;
    },
    setShellCommandPrefix(prefix) {
        const state = settingsInternals(this);
        state.globalSettings.shellCommandPrefix = prefix;
        state.markModified("shellCommandPrefix");
        state.save();
    },
    getBashInterceptorEnabled() {
        return settingsInternals(this).settings.bashInterceptor?.enabled ?? false;
    },
    setBashInterceptorEnabled(enabled) {
        const state = settingsInternals(this);
        state.globalSettings.bashInterceptor = { ...(state.globalSettings.bashInterceptor ?? {}), enabled };
        state.markModified("bashInterceptor");
        state.save();
    },
    getSearchContextBefore() {
        return settingsInternals(this).settings.search?.contextBefore ?? 1;
    },
    getSearchContextAfter() {
        return settingsInternals(this).settings.search?.contextAfter ?? 3;
    },
    getNpmCommand() {
        const command = settingsInternals(this).settings.npmCommand;
        return command ? [...command] : undefined;
    },
    setNpmCommand(command) {
        const state = settingsInternals(this);
        state.globalSettings.npmCommand = command ? [...command] : undefined;
        state.markModified("npmCommand");
        state.save();
    },
    getCollapseChangelog() {
        return settingsInternals(this).settings.collapseChangelog ?? false;
    },
    setCollapseChangelog(collapse) {
        const state = settingsInternals(this);
        state.globalSettings.collapseChangelog = collapse;
        state.markModified("collapseChangelog");
        state.save();
    },
    getEnableInstallTelemetry() {
        return settingsInternals(this).settings.enableInstallTelemetry ?? true;
    },
    setEnableInstallTelemetry(enabled) {
        const state = settingsInternals(this);
        state.globalSettings.enableInstallTelemetry = enabled;
        state.markModified("enableInstallTelemetry");
        state.save();
    },
    getPackages() {
        return [...(settingsInternals(this).settings.packages ?? [])];
    },
    setPackages(packages) {
        const state = settingsInternals(this);
        state.globalSettings.packages = packages;
        state.markModified("packages");
        state.save();
    },
    setProjectPackages(packages) {
        const state = settingsInternals(this);
        const projectSettings = structuredClone(state.projectSettings);
        projectSettings.packages = packages;
        state.markProjectModified("packages");
        state.saveProjectSettings(projectSettings);
    },
    getExtensionPaths() {
        return [...(settingsInternals(this).settings.extensions ?? [])];
    },
    setExtensionPaths(paths) {
        const state = settingsInternals(this);
        state.globalSettings.extensions = paths;
        state.markModified("extensions");
        state.save();
    },
    setProjectExtensionPaths(paths) {
        const state = settingsInternals(this);
        const projectSettings = structuredClone(state.projectSettings);
        projectSettings.extensions = paths;
        state.markProjectModified("extensions");
        state.saveProjectSettings(projectSettings);
    },
    getSkillPaths() {
        return [...(settingsInternals(this).settings.skills ?? [])];
    },
    setSkillPaths(paths) {
        const state = settingsInternals(this);
        state.globalSettings.skills = paths;
        state.markModified("skills");
        state.save();
    },
    setProjectSkillPaths(paths) {
        const state = settingsInternals(this);
        const projectSettings = structuredClone(state.projectSettings);
        projectSettings.skills = paths;
        state.markProjectModified("skills");
        state.saveProjectSettings(projectSettings);
    },
    getPromptTemplatePaths() {
        return [...(settingsInternals(this).settings.prompts ?? [])];
    },
    setPromptTemplatePaths(paths) {
        const state = settingsInternals(this);
        state.globalSettings.prompts = paths;
        state.markModified("prompts");
        state.save();
    },
    setProjectPromptTemplatePaths(paths) {
        const state = settingsInternals(this);
        const projectSettings = structuredClone(state.projectSettings);
        projectSettings.prompts = paths;
        state.markProjectModified("prompts");
        state.saveProjectSettings(projectSettings);
    },
    getThemePaths() {
        return [...(settingsInternals(this).settings.themes ?? [])];
    },
    setThemePaths(paths) {
        const state = settingsInternals(this);
        state.globalSettings.themes = paths;
        state.markModified("themes");
        state.save();
    },
    setProjectThemePaths(paths) {
        const state = settingsInternals(this);
        const projectSettings = structuredClone(state.projectSettings);
        projectSettings.themes = paths;
        state.markProjectModified("themes");
        state.saveProjectSettings(projectSettings);
    },
    getEnableSkillCommands() {
        return settingsInternals(this).settings.enableSkillCommands ?? true;
    },
    setEnableSkillCommands(enabled) {
        const state = settingsInternals(this);
        state.globalSettings.enableSkillCommands = enabled;
        state.markModified("enableSkillCommands");
        state.save();
    },
    getThinkingBudgets() {
        return settingsInternals(this).settings.thinkingBudgets;
    },
};
Object.assign(SettingsManager.prototype, resourceAccessors);
//# sourceMappingURL=settings-manager-resource-accessors.js.map