import { jsx as _jsx } from "react/jsx-runtime";
import { render } from 'ink';
import { EventSource } from 'eventsource';
import { ClientSharedProxyApiService } from '../client-shared/api/proxy.js';
import { App } from './App.js';
import { ControlPlaneSessionStore } from './state/control-plane-session-store.js';
export function startChatCliV2(options) {
    const client = ClientSharedProxyApiService.createClient({
        url: options.trpcUrl,
        eventSource: EventSource,
    });
    const store = new ControlPlaneSessionStore({
        client,
        defaultModel: options.model,
        maxSteps: options.maxSteps,
        searchIgnoreDirs: options.searchIgnoreDirs,
        systemContext: options.systemContext,
        apiKey: options.apiKey,
        preferApiKey: options.preferApiKey,
    });
    return render(_jsx(App, { store: store, initialSelection: {
            workspaceId: options.workspaceId,
            sessionId: options.sessionId,
        } }));
}
//# sourceMappingURL=index.js.map