<commit_before>package circlet.components

import circlet.auth.*
import circlet.common.oauth.*
import circlet.permission.*
import circlet.platform.api.oauth.*
import circlet.platform.client.*
import circlet.platform.workspaces.*
import circlet.settings.*
import circlet.utils.*
import circlet.workspaces.*
import com.intellij.openapi.options.*
import libraries.coroutines.extra.*
import libraries.klogging.*
import runtime.*
import runtime.persistence.*
import runtime.reactive.*

val circletWorkspace get() = application.getComponent<CircletWorkspaceComponent>()

private val log = logger<CircletWorkspaceComponent>()

// monitors CircletConfigurable state, creates and exposed instance of Workspace, provides various state properties and callbacks.
class CircletWorkspaceComponent : WorkspaceManagerHost(), LifetimedComponent by SimpleLifetimedComponent() {

    private val ideaClientPersistenceConfiguration = PersistenceConfiguration(
        FeatureFlagsVmPersistenceKey,
        PersistenceKey.Arena
    )

    private val workspacesLifetimes = SequentialLifetimes(lifetime)
    private val manager = mutableProperty<WorkspaceManager?>(null)

    val workspace = flatMap<WorkspaceManager?, Workspace?>(manager, null) {
        (it?.workspace ?: mutableProperty<Workspace?>(null))
    }

    override fun initComponent() {
        val settingsOnStartup = CircletServerSettingsComponent.getInstance().settings.value
        val wsLifetime = workspacesLifetimes.next()

        // sign in automatically on application startup.
        launch(wsLifetime, Ui) {
            if (!autoSignIn(settingsOnStartup, wsLifetime))
                notifyDisconnected(wsLifetime)
        }

        // notify circlet is connected on the first connect (remove it later)
        workspace.whenNotNull(lifetime) { lt, ws ->
            ws.client.connectionStatus.filterIsInstance<ConnectionStatus.Connected>().first().forEach(lt) { status ->
                notifyConnected(lt)
            }<commit_msg>Property: clean up<commit_after>package circlet.components

import circlet.auth.*
import circlet.common.oauth.*
import circlet.permission.*
import circlet.platform.api.oauth.*
import circlet.platform.client.*
import circlet.platform.workspaces.*
import circlet.settings.*
import circlet.utils.*
import circlet.workspaces.*
import com.intellij.openapi.options.*
import libraries.coroutines.extra.*
import libraries.klogging.*
import runtime.*
import runtime.persistence.*
import runtime.reactive.*

val circletWorkspace get() = application.getComponent<CircletWorkspaceComponent>()

private val log = logger<CircletWorkspaceComponent>()

// monitors CircletConfigurable state, creates and exposed instance of Workspace, provides various state properties and callbacks.
class CircletWorkspaceComponent : WorkspaceManagerHost(), LifetimedComponent by SimpleLifetimedComponent() {

    private val ideaClientPersistenceConfiguration = PersistenceConfiguration(
        FeatureFlagsVmPersistenceKey,
        PersistenceKey.Arena
    )

    private val workspacesLifetimes = SequentialLifetimes(lifetime)
    private val manager = mutableProperty<WorkspaceManager?>(null)

    val workspace = flatMapInit<WorkspaceManager?, Workspace?>(manager, null) {
        (it?.workspace ?: mutableProperty<Workspace?>(null))
    }

    override fun initComponent() {
        val settingsOnStartup = CircletServerSettingsComponent.getInstance().settings.value
        val wsLifetime = workspacesLifetimes.next()

        // sign in automatically on application startup.
        launch(wsLifetime, Ui) {
            if (!autoSignIn(settingsOnStartup, wsLifetime))
                notifyDisconnected(wsLifetime)
        }

        // notify circlet is connected on the first connect (remove it later)
        workspace.whenNotNull(lifetime) { lt, ws ->
            ws.client.connectionStatus.filterIsInstance<ConnectionStatus.Connected>().first().forEach(lt) { status ->
                notifyConnected(lt)
            }
{'fraction_non_alphanumeric': 0.08895013781007266, 'fraction_numerical': 0.0, 'mean_word_length': 4.072426937738246, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5046694', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1011, 'n_words': 242}