giga-code
Version:
A personal AI CLI assistant powered by Grok for local development.
72 lines • 2.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.modeManager = exports.ModeManager = void 0;
const types_1 = require("../types");
class ModeManager {
constructor() {
this.currentMode = types_1.AgentMode.CHILL;
this.modeConfigs = {
[types_1.AgentMode.PLAN]: {
mode: types_1.AgentMode.PLAN,
allowExpertModels: false,
requireConfirmation: false,
displayName: '📋 PLAN MODE',
description: 'Planning and thinking only - no expert models'
},
[types_1.AgentMode.CHILL]: {
mode: types_1.AgentMode.CHILL,
allowExpertModels: true,
requireConfirmation: true,
displayName: '😌 CHILL MODE',
description: 'All models available - asks permission for tool calls'
},
[types_1.AgentMode.GIGA]: {
mode: types_1.AgentMode.GIGA,
allowExpertModels: true,
requireConfirmation: false,
displayName: '⚡ GIGA MODE',
description: 'Full power - no permission requests'
}
};
}
static getInstance() {
if (!ModeManager.instance) {
ModeManager.instance = new ModeManager();
}
return ModeManager.instance;
}
getCurrentMode() {
return this.currentMode;
}
getCurrentModeConfig() {
return this.modeConfigs[this.currentMode];
}
getAllModes() {
return [types_1.AgentMode.PLAN, types_1.AgentMode.CHILL, types_1.AgentMode.GIGA];
}
cycleMode() {
const modes = this.getAllModes();
const currentIndex = modes.indexOf(this.currentMode);
const nextIndex = (currentIndex + 1) % modes.length;
this.currentMode = modes[nextIndex];
return this.currentMode;
}
setMode(mode) {
this.currentMode = mode;
}
shouldAllowExpertModels() {
return this.modeConfigs[this.currentMode].allowExpertModels;
}
shouldRequireConfirmation() {
return this.modeConfigs[this.currentMode].requireConfirmation;
}
getModeDisplayName() {
return this.modeConfigs[this.currentMode].displayName;
}
getModeDescription() {
return this.modeConfigs[this.currentMode].description;
}
}
exports.ModeManager = ModeManager;
exports.modeManager = ModeManager.getInstance();
//# sourceMappingURL=mode-manager.js.map