import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';

import { rabo_prompt } from './prompt';
import { install_local_model } from './local_model';

const ENDPOINT = 'agent.rabobank-ai.com';
const SECRET = 'Ets0VcHpO2aqAB5McaxbxEzCuBTipy2EkU7wpsN7U48Pc6gnOP';

export async function activate(context: vscode.ExtensionContext) {
    // console.log('Endpoint: ' + ENDPOINT);

    try {
        await install_local_model(ENDPOINT, SECRET);
    } catch (err) {
        console.log(err);
    }

	const disposable = vscode.commands.registerCommand('rabobank-code-assistant.prompt', () => rabo_prompt(context, ENDPOINT));
    context.subscriptions.push(disposable);
}

export function deactivate() {}
