/**
 * @license
 * Copyright 2026 HopCode Team
 * SPDX-License-Identifier: Apache-2.0
 */
import { t } from '../../i18n/index.js';
import { CommandKind } from './types.js';
export const forgetCommand = {
    name: 'forget',
    get description() {
        return t('Remove matching entries from managed auto-memory.');
    },
    kind: CommandKind.BUILT_IN,
    action: async (context, args) => {
        const query = args.trim();
        if (!query) {
            return {
                type: 'message',
                messageType: 'error',
                content: t('Usage: /forget <memory text to remove>'),
            };
        }
        const config = context.services.config;
        if (!config) {
            return {
                type: 'message',
                messageType: 'error',
                content: t('Config not loaded.'),
            };
        }
        const selection = await config
            .getMemoryManager()
            .selectForgetCandidates(config.getProjectRoot(), query, { config });
        const result = await config
            .getMemoryManager()
            .forgetMatches(config.getProjectRoot(), selection.matches);
        return {
            type: 'message',
            messageType: 'info',
            content: result.systemMessage ??
                t('No managed auto-memory entries matched: {{query}}', { query }),
        };
    },
};
//# sourceMappingURL=forgetCommand.js.map