feat(cli): add deep work mode with integrated execution flow

This commit is contained in:
Dmitry Lyalin
2026-02-12 23:21:11 -05:00
parent d82f66973f
commit c57b55fa03
46 changed files with 2348 additions and 109 deletions
@@ -0,0 +1,47 @@
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { CommandKind, type SlashCommand } from './types.js';
import { ApprovalMode, coreEvents, debugLogger } from '@google/gemini-cli-core';
export const deepworkCommand: SlashCommand = {
name: 'deepwork',
description: 'Switch to Deep Work mode for iterative execution',
kind: CommandKind.BUILT_IN,
autoExecute: true,
action: async (context) => {
const config = context.services.config;
if (!config) {
debugLogger.debug(
'Deep Work command: config is not available in context',
);
return;
}
if (!config.isDeepWorkEnabled()) {
coreEvents.emitFeedback(
'error',
'Deep Work mode is disabled. Enable experimental.deepWork in settings first.',
);
return;
}
const previousApprovalMode = config.getApprovalMode();
config.setApprovalMode(ApprovalMode.DEEP_WORK);
if (previousApprovalMode !== ApprovalMode.DEEP_WORK) {
coreEvents.emitFeedback('info', 'Switched to Deep Work mode.');
}
const approvedPlanPath = config.getApprovedPlanPath();
if (approvedPlanPath) {
coreEvents.emitFeedback(
'info',
`Deep Work will follow approved plan: ${approvedPlanPath}`,
);
}
},
};