diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fde7873e..53a2a18e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -26,7 +26,7 @@ updates: - '/agents/agent-voltagent/' - '/agents/agent-sdk/' - '/agents/agent-strands/' - - './agents/agents-langchain/' + - '/agents/agents-langchain/' - '/basic/cdk/' - '/basic/app/' - '/mcp/clients/mastra-mcp-client/' @@ -55,3 +55,19 @@ updates: npm: patterns: - '*' + + - package-ecosystem: gradle + directories: + - '/agents/agent-koog/' + schedule: + interval: daily + timezone: Asia/Tokyo + allow: + - dependency-type: all + rebase-strategy: auto + assignees: + - poad + groups: + gradle: + patterns: + - '*' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80d263fd..e877abcc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,3 +45,29 @@ jobs: - name: lint run: pnpm lint + build-android: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + - name: Set up JDK 17 + uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0 + with: + java-version: 17 + distribution: zulu + + - uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - name: Build with Gradle + working-directory: agents/agent-koog + run: | + chmod +x gradlew + ./gradlew assembleDebug -x lint diff --git a/.gitignore b/.gitignore index 884b27e3..7cad3d85 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,5 @@ dist .env !.env.local.template **/tsconfig.tsbuildinfo + +.DS_Store diff --git a/agents/agent-koog/.gitignore b/agents/agent-koog/.gitignore new file mode 100644 index 00000000..adfa9bff --- /dev/null +++ b/agents/agent-koog/.gitignore @@ -0,0 +1,19 @@ +*.iml +.kotlin +.gradle +**/build/ +xcuserdata +!src/**/build/ +local.properties +.idea +.DS_Store +captures +.externalNativeBuild +.cxx +*.xcodeproj/* +!*.xcodeproj/project.pbxproj +!*.xcodeproj/xcshareddata/ +!*.xcodeproj/project.xcworkspace/ +!*.xcworkspace/contents.xcworkspacedata +**/xcshareddata/WorkspaceSettings.xcsettings +node_modules/ diff --git a/agents/agent-koog/README.md b/agents/agent-koog/README.md new file mode 100644 index 00000000..e59acc37 --- /dev/null +++ b/agents/agent-koog/README.md @@ -0,0 +1,50 @@ +# agent-koog + +This is a Kotlin Multiplatform project targeting Android. + +- [/composeApp](./composeApp/src) is for code that will be shared across your Compose Multiplatform applications. + It contains several subfolders: + + - [commonMain](./composeApp/src/commonMain/kotlin) is for code that’s common for all targets. + - Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. + For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, + the [iosMain](./composeApp/src/iosMain/kotlin) folder would be the right place for such calls. + Similarly, if you want to edit the Desktop (JVM) specific part, the [jvmMain](./composeApp/src/jvmMain/kotlin) + folder is the appropriate location. + +## Build and Run Android Application + +To build and run the development version of the Android app, use the run configuration from the run widget +in your IDE’s toolbar or build it directly from the terminal: + +- on macOS/Linux + + ```shell + ./gradlew :composeApp:assembleDebug + ``` + +- on Windows + + ```shell + .\gradlew.bat :composeApp:assembleDebug + ``` + +--- + +Learn more about [Kotlin Multiplatform](https://www.jetbrains.com/help/kotlin-multiplatform-dev/get-started.html)… + +## Observability + +`$download_url` は からダウンロードURLを調べて取得したURLに置き換えてください。 + +```shell +# Jaegerを起動 +curl -sSL "$download_url" -o jaeger-2.13.0.tar.gz +tar -xzf jaeger-2.13.0.tar.gz +cd jaeger-2.13.0 +COLLECTOR_OTLP_ENABLED=true ./jaeger \ + --set=receivers.otlp.protocols.grpc.endpoint=0.0.0.0:4317 \ + --set=receivers.otlp.protocols.http.endpoint=0.0.0.0:4318 +``` + +Access to diff --git a/agents/agent-koog/build.gradle.kts b/agents/agent-koog/build.gradle.kts new file mode 100644 index 00000000..cf780d5a --- /dev/null +++ b/agents/agent-koog/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + // this is necessary to avoid the plugins to be loaded multiple times + // in each subproject's classloader + alias(libs.plugins.androidApplication) apply false + alias(libs.plugins.androidLibrary) apply false + alias(libs.plugins.composeMultiplatform) apply false + alias(libs.plugins.composeCompiler) apply false + alias(libs.plugins.kotlinMultiplatform) apply false +} \ No newline at end of file diff --git a/agents/agent-koog/composeApp/build.gradle.kts b/agents/agent-koog/composeApp/build.gradle.kts new file mode 100644 index 00000000..56ffbcde --- /dev/null +++ b/agents/agent-koog/composeApp/build.gradle.kts @@ -0,0 +1,117 @@ +import org.jetbrains.compose.desktop.application.dsl.TargetFormat +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + +plugins { + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.androidApplication) + alias(libs.plugins.composeMultiplatform) + alias(libs.plugins.composeCompiler) + + // Add Kotlin serialization plugin for Koog API support + kotlin("plugin.serialization") version "2.2.0" +} + +kotlin { + androidTarget { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } + } + + sourceSets { + androidMain.dependencies { + implementation(compose.preview) + implementation(libs.androidx.activity.compose) + } + commonMain.dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material3) + implementation(compose.ui) + implementation(libs.androidx.material.icons.core) + implementation(compose.components.resources) + implementation(compose.components.uiToolingPreview) + implementation(libs.androidx.lifecycle.viewmodelCompose) + implementation(libs.androidx.lifecycle.runtimeCompose) + implementation(libs.opentelemetry.logback.appender.x.x) + implementation(libs.slf4j.api) + implementation(libs.logback.android) + } + commonTest.dependencies { + implementation(libs.kotlin.test) + } + } +} + +android { + namespace = "com.example.koog_example" + compileSdk = libs.versions.android.compileSdk.get().toInt() + + defaultConfig { + applicationId = "com.example.koog_example" + minSdk = libs.versions.android.minSdk.get().toInt() + targetSdk = libs.versions.android.targetSdk.get().toInt() + versionCode = 1 + versionName = "1.0" + + // 環境変数から読み込んでBuildConfigに埋め込む + buildConfigField("String", "AWS_ACCESS_KEY_ID", "\"${System.getenv("AWS_ACCESS_KEY_ID") ?: ""}\"") + buildConfigField("String", "AWS_SECRET_ACCESS_KEY", "\"${System.getenv("AWS_SECRET_ACCESS_KEY") ?: ""}\"") + buildConfigField("String", "AWS_SESSION_TOKEN", "\"${System.getenv("AWS_SESSION_TOKEN") ?: ""}\"") + buildConfigField("String", "AWS_REGION", "\"${System.getenv("AWS_REGION") ?: "us-west-2"}\"") + + buildConfigField("String", "OTLP_BACKEND", "\"${System.getenv("OTLP_BACKEND") ?: ""}\"") + buildConfigField("String", "OTLP_ENDPOINT", "\"${System.getenv("OTLP_ENDPOINT") ?: "http://10.0.2.2:4318/v1/traces"}\"") + buildConfigField("String", "OTLP_HEADERS", "\"${System.getenv("LANGFUSE_API_KEY") ?: ""}\"") + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + dex { + useLegacyPackaging = false + } + } + buildTypes { + getByName("release") { + isMinifyEnabled = true + // 検証コードなのでproguard設定はしない + } + getByName("debug") { + applicationIdSuffix = ".debug" + isDebuggable = true + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + buildFeatures { + buildConfig = true + } +} + +dependencies { + debugImplementation(compose.uiTooling) + implementation(libs.koog.agents) + implementation(libs.opentelemetry.exporter.otlp) + implementation(libs.opentelemetry.exporter.logging) +} + +repositories { + google() + // Use Maven Central for resolving dependencies. + mavenCentral() + // Add JetBrains repository for Koog framework + maven { + url = uri("https://packages.jetbrains.team/maven/p/grazi/grazie-platform-public") + } +} + +configurations.all { + // FIXME exclude netty from Koog dependencies? + exclude(group = "io.netty", module = "*") + exclude(group = "org.apache.httpcomponents.httpclient5", module = "*") + exclude(group = "org.apache.httpcomponents.core5", module = "*") +} diff --git a/agents/agent-koog/composeApp/src/androidMain/AndroidManifest.xml b/agents/agent-koog/composeApp/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..0f96156b --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/agents/agent-koog/composeApp/src/androidMain/composeResources/drawable/compose-multiplatform.xml b/agents/agent-koog/composeApp/src/androidMain/composeResources/drawable/compose-multiplatform.xml new file mode 100644 index 00000000..1ffc948c --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/composeResources/drawable/compose-multiplatform.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/Agent.kt b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/Agent.kt new file mode 100644 index 00000000..e2cc7cea --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/Agent.kt @@ -0,0 +1,88 @@ +package com.example.koog_example + +import ai.koog.agents.core.agent.AIAgent +import ai.koog.agents.core.agent.AIAgentService +import ai.koog.agents.features.opentelemetry.feature.OpenTelemetry +import ai.koog.prompt.executor.clients.bedrock.BedrockModels +import ai.koog.prompt.executor.llms.all.simpleBedrockExecutor +import ai.koog.utils.io.use +import io.opentelemetry.api.common.AttributeKey +import io.opentelemetry.exporter.logging.LoggingSpanExporter +import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import java.util.concurrent.TimeUnit + +class Agent { + + private val accessKey = BuildConfig.AWS_ACCESS_KEY_ID + private val secretKey = BuildConfig.AWS_SECRET_ACCESS_KEY + private val sessionToken = BuildConfig.AWS_SESSION_TOKEN + + private val observabilityBackend = BuildConfig.OTLP_BACKEND // "jaeger", "langfuse", "langsmith" + + private val observabilityEndpoint = BuildConfig.OTLP_ENDPOINT + private val observabilityHeaders = + BuildConfig.OTLP_HEADERS // カンマ区切りの "key1:value1,key2:value2" 形式 + + private val agent = AIAgentService( + promptExecutor = simpleBedrockExecutor(accessKey, secretKey, sessionToken), + llmModel = BedrockModels.AmazonNovaMicro, + installFeatures = { + install(OpenTelemetry) { + setServiceInfo("koog-chat-app", "1.0.0") + // Add a console logger for local debugging + addSpanExporter(LoggingSpanExporter.create()) + + // バックエンドに応じてエクスポーターを設定 + when (observabilityBackend) { + "langfuse" -> { + val builder = OtlpHttpSpanExporter.builder() + .setTimeout(30, TimeUnit.SECONDS) + .setEndpoint(observabilityEndpoint) // http://10.0.2.2:4318/v1/traces + // ヘッダー文字列を安全に分割 + val headerParts = observabilityHeaders.split(":", limit = 2) + if (headerParts.size == 2) { + builder.addHeader(headerParts[0], headerParts[1]) + } + addSpanExporter( + builder + .build() + ) + } + + else -> { + // Jaeger (HTTP) + addSpanExporter( + OtlpHttpSpanExporter.builder() + .setTimeout(30, TimeUnit.SECONDS) + .setEndpoint(observabilityEndpoint) // http://10.0.2.2:4318/v1/traces + .build() + ) + } + } + + // 詳細ログを環境に応じて制御 + setVerbose(BuildConfig.DEBUG) + + // リソース属性を追加 + addResourceAttributes( + mapOf( + AttributeKey.stringKey("deployment.environment") to "android", + AttributeKey.stringKey("device.platform") to "Android", + ) + ) + } + } + ) + + suspend fun execute(query: String): String { + return withContext(Dispatchers.IO) { + try { + agent.createAgentAndRun(query) + } catch (e: Exception) { + "エラーが発生しました: ${e.message}" + } + } + } +} diff --git a/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/App.kt b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/App.kt new file mode 100644 index 00000000..0e8ff916 --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/App.kt @@ -0,0 +1,47 @@ +package com.example.koog_example + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.safeContentPadding +import androidx.compose.material3.Button +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import org.jetbrains.compose.resources.painterResource +import org.jetbrains.compose.ui.tooling.preview.Preview + +import koogexample.composeapp.generated.resources.Res +import koogexample.composeapp.generated.resources.compose_multiplatform + +@Composable +@Preview +fun App() { + MaterialTheme { + var showContent by remember { mutableStateOf(false) } + Column( + modifier = Modifier + .background(MaterialTheme.colorScheme.primaryContainer) + .safeContentPadding() + .fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Button(onClick = { showContent = !showContent }) { + Text("Click me!") + } + AnimatedVisibility(showContent) { + Column( + modifier = Modifier.fillMaxWidth(), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Image(painterResource(Res.drawable.compose_multiplatform), null) + } + } + } + } +} diff --git a/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/ChatActivity.kt b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/ChatActivity.kt new file mode 100644 index 00000000..46361398 --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/ChatActivity.kt @@ -0,0 +1,288 @@ +package com.example.koog_example + +import android.os.Bundle +import android.util.Log +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.widthIn +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.Send +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.OutlinedTextFieldDefaults +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import androidx.lifecycle.viewmodel.compose.viewModel +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.launch + +// データクラス +data class ChatMessage( + val text: String, + val isUser: Boolean, + val timestamp: Long = System.currentTimeMillis() +) + +// ViewModel +class ChatViewModel : ViewModel() { + private val agent = Agent() + + private val _messages = MutableStateFlow>(emptyList()) + val messages: StateFlow> = _messages.asStateFlow() + + private val _isLoading = MutableStateFlow(false) + val isLoading: StateFlow = _isLoading.asStateFlow() + + fun sendMessage(userInput: String) { + if (userInput.isBlank()) return + + _messages.value += ChatMessage(userInput, isUser = true) + + viewModelScope.launch { + _isLoading.value = true + try { + val response = agent.execute(userInput) + _messages.value += ChatMessage(response, isUser = false) + } catch (e: Exception) { + _messages.value += ChatMessage("エラー: ${e.message}", isUser = false) + e.message?.let { Log.println(Log.ERROR, "", it) } + } finally { + _isLoading.value = false + } + } + } +} + +// Compose UI +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun ChatScreen( + viewModel: ChatViewModel = viewModel() +) { + val messages by viewModel.messages.collectAsState() + val isLoading by viewModel.isLoading.collectAsState() + val listState = rememberLazyListState() + val coroutineScope = rememberCoroutineScope() + + // 新しいメッセージが追加されたら自動スクロール + LaunchedEffect(messages.size) { + if (messages.isNotEmpty()) { + coroutineScope.launch { + listState.animateScrollToItem(messages.size - 1) + } + } + } + + Scaffold( + topBar = { + TopAppBar( + title = { Text("チャットエージェント") }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = MaterialTheme.colorScheme.primary, + titleContentColor = Color.White + ) + ) + }, + bottomBar = { + // 入力欄をbottomBarに配置 + ChatInputField( + onSendMessage = { viewModel.sendMessage(it) }, + enabled = !isLoading + ) + }, + containerColor = Color(0xFFF5F5F5) + ) { innerPadding -> + // メッセージリスト + LazyColumn( + state = listState, + modifier = Modifier + .fillMaxSize() + .padding(innerPadding), + contentPadding = PaddingValues(16.dp), + verticalArrangement = Arrangement.spacedBy(8.dp) + ) { + items(messages) { message -> + ChatMessageItem(message) + } + + // ローディング表示 + if (isLoading) { + item { + LoadingIndicator() + } + } + } + } +} + +@Composable +fun ChatMessageItem(message: ChatMessage) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = if (message.isUser) Arrangement.End else Arrangement.Start + ) { + Card( + modifier = Modifier.widthIn(max = 280.dp), + colors = CardDefaults.cardColors( + containerColor = if (message.isUser) { + MaterialTheme.colorScheme.primary + } else { + Color.White + } + ), + elevation = CardDefaults.cardElevation(defaultElevation = 2.dp) + ) { + Text( + text = message.text, + modifier = Modifier.padding(12.dp), + color = if (message.isUser) Color.White else Color.Black + ) + } + } +} + +@Composable +fun LoadingIndicator() { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.Start + ) { + Card( + colors = CardDefaults.cardColors(containerColor = Color.White), + elevation = CardDefaults.cardElevation(defaultElevation = 2.dp) + ) { + Row( + modifier = Modifier.padding(12.dp), + verticalAlignment = Alignment.CenterVertically + ) { + CircularProgressIndicator( + modifier = Modifier.size(16.dp), + strokeWidth = 2.dp + ) + Spacer(modifier = Modifier.width(8.dp)) + Text("処理中...", fontSize = 14.sp) + } + } + } +} + +@Composable +fun ChatInputField( + onSendMessage: (String) -> Unit, + enabled: Boolean +) { + var text by remember { mutableStateOf("") } + + Surface( + shadowElevation = 8.dp, + color = Color.White, + modifier = Modifier.padding(bottom = 48.dp) // 下にマージンを追加して上に移動 + ) { + Row( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 12.dp, vertical = 8.dp), + verticalAlignment = Alignment.Bottom + ) { + OutlinedTextField( + value = text, + onValueChange = { text = it }, + modifier = Modifier.weight(1f), + placeholder = { Text("メッセージを入力...", fontSize = 14.sp) }, + enabled = enabled, + maxLines = 3, + textStyle = androidx.compose.ui.text.TextStyle(fontSize = 14.sp), + shape = RoundedCornerShape(24.dp), + colors = OutlinedTextFieldDefaults.colors( + focusedBorderColor = MaterialTheme.colorScheme.primary, + unfocusedBorderColor = Color.LightGray + ) + ) + + Spacer(modifier = Modifier.width(8.dp)) + + IconButton( + onClick = { + if (text.isNotBlank()) { + onSendMessage(text) + text = "" + } + }, + enabled = enabled && text.isNotBlank(), + modifier = Modifier + .size(40.dp) + .padding(bottom = 16.dp) // 下にマージンを追加して上に移動 + ) { + Icon( + imageVector = Icons.AutoMirrored.Filled.Send, + contentDescription = "送信", + tint = if (enabled && text.isNotBlank()) { + MaterialTheme.colorScheme.primary + } else { + Color.Gray + } + ) + } + } + } +} + +// Activity での使用例 +class ChatActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + enableEdgeToEdge() + super.onCreate(savedInstanceState) + setContent { + MaterialTheme { + ChatScreen() + } + } + } +} + +@Preview +@Composable +fun AppAndroidPreview() { + App() +} diff --git a/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/Platform.kt b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/Platform.kt new file mode 100644 index 00000000..3739626c --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/kotlin/com/example/koog_example/Platform.kt @@ -0,0 +1,9 @@ +package com.example.koog_example + +import android.os.Build + +class AndroidPlatform { + val name: String = "Android ${Build.VERSION.SDK_INT}" +} + +fun getPlatform() = AndroidPlatform() \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml b/agents/agent-koog/composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 00000000..2b068d11 --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidMain/res/drawable/ic_launcher_background.xml b/agents/agent-koog/composeApp/src/androidMain/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..e93e11ad --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 00000000..eca70cfe --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..a571e600 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 00000000..61da551c Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..c41dd285 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 00000000..db5080a7 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..6dba46da Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 00000000..da31a871 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..15ac6817 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..b216f2d3 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..f25a4197 Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 00000000..e96783cc Binary files /dev/null and b/agents/agent-koog/composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/agents/agent-koog/composeApp/src/androidMain/res/values/strings.xml b/agents/agent-koog/composeApp/src/androidMain/res/values/strings.xml new file mode 100644 index 00000000..187e7cab --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidMain/res/values/strings.xml @@ -0,0 +1,3 @@ + + Koogexample + \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/androidUnitTest/kotlin/com/example/koog_example/ComposeAppAndroidUnitTest.kt b/agents/agent-koog/composeApp/src/androidUnitTest/kotlin/com/example/koog_example/ComposeAppAndroidUnitTest.kt new file mode 100644 index 00000000..ad590c2e --- /dev/null +++ b/agents/agent-koog/composeApp/src/androidUnitTest/kotlin/com/example/koog_example/ComposeAppAndroidUnitTest.kt @@ -0,0 +1,12 @@ +package com.example.koog_example + +import kotlin.test.Test +import kotlin.test.assertEquals + +class ComposeAppAndroidUnitTest { + + @Test + fun example() { + assertEquals(3, 1 + 2) + } +} \ No newline at end of file diff --git a/agents/agent-koog/composeApp/src/debug/res/xml/network_security_config.xml b/agents/agent-koog/composeApp/src/debug/res/xml/network_security_config.xml new file mode 100644 index 00000000..80d2e1e1 --- /dev/null +++ b/agents/agent-koog/composeApp/src/debug/res/xml/network_security_config.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + 10.0.2.2 + localhost + 127.0.0.1 + + + + + diff --git a/agents/agent-koog/composeApp/src/release/res/xml/network_security_config.xml b/agents/agent-koog/composeApp/src/release/res/xml/network_security_config.xml new file mode 100644 index 00000000..6a42bb17 --- /dev/null +++ b/agents/agent-koog/composeApp/src/release/res/xml/network_security_config.xml @@ -0,0 +1,3 @@ + + + diff --git a/agents/agent-koog/gradle.properties b/agents/agent-koog/gradle.properties new file mode 100644 index 00000000..2dc57ada --- /dev/null +++ b/agents/agent-koog/gradle.properties @@ -0,0 +1,12 @@ +#Kotlin +kotlin.code.style=official +kotlin.daemon.jvmargs=-Xmx3072M + +#Gradle +org.gradle.jvmargs=-Xmx3072M -Dfile.encoding=UTF-8 +org.gradle.configuration-cache=true +org.gradle.caching=true + +#Android +android.nonTransitiveRClass=true +android.useAndroidX=true \ No newline at end of file diff --git a/agents/agent-koog/gradle/libs.versions.toml b/agents/agent-koog/gradle/libs.versions.toml new file mode 100644 index 00000000..03aa58f6 --- /dev/null +++ b/agents/agent-koog/gradle/libs.versions.toml @@ -0,0 +1,58 @@ +[versions] +agp = "8.13.2" +android-compileSdk = "36" +android-minSdk = "24" +android-targetSdk = "36" +androidx-activity = "1.12.2" +androidx-appcompat = "1.7.1" +androidx-core = "1.17.0" +androidx-espresso = "3.7.0" +androidx-lifecycle = "2.9.6" +androidx-testExt = "1.3.0" +composeMultiplatform = "1.9.3" +junit = "4.13.2" +koogAgents = "0.5.4" +kotlin = "2.2.21" +logbackAndroid = "3.0.0" +materialIconsCore = "1.7.8" +opentelemetryExporterOtlp = "1.57.0" +lifecycleViewmodelKtx = "2.10.0" +opentelemetryExporterOtlpHttpTrace = "1.14.0" +opentelemetryLogbackAppenderXX = "2.23.0-alpha" +slf4jApi = "2.0.17" +ui = "1.10.0" +runtime = "1.10.0" +foundationLayout = "1.10.0" +material3 = "1.4.0" + +[libraries] +androidx-material-icons-core = { module = "androidx.compose.material:material-icons-core", version.ref = "materialIconsCore" } +koog-agents = { module = "ai.koog:koog-agents", version.ref = "koogAgents" } +kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } +kotlin-testJunit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" } +junit = { module = "junit:junit", version.ref = "junit" } +androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core" } +androidx-testExt-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-testExt" } +androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" } +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" } +androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" } +androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } +androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } +logback-android = { module = "com.github.tony19:logback-android", version.ref = "logbackAndroid" } +opentelemetry-exporter-logging = { module = "io.opentelemetry:opentelemetry-exporter-logging", version.ref = "opentelemetryExporterOtlp" } +opentelemetry-exporter-otlp = { module = "io.opentelemetry:opentelemetry-exporter-otlp", version.ref = "opentelemetryExporterOtlp" } +androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" } +androidx-ui = { module = "androidx.compose.ui:ui", version.ref = "ui" } +androidx-runtime = { module = "androidx.compose.runtime:runtime", version.ref = "runtime" } +androidx-foundation-layout = { module = "androidx.compose.foundation:foundation-layout", version.ref = "foundationLayout" } +androidx-material3 = { module = "androidx.compose.material3:material3", version.ref = "material3" } +opentelemetry-exporter-otlp-http-trace = { module = "io.opentelemetry:opentelemetry-exporter-otlp-http-trace", version.ref = "opentelemetryExporterOtlpHttpTrace" } +opentelemetry-logback-appender-x-x = { module = "io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0", version.ref = "opentelemetryLogbackAppenderXX" } +slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4jApi" } + +[plugins] +androidApplication = { id = "com.android.application", version.ref = "agp" } +androidLibrary = { id = "com.android.library", version.ref = "agp" } +composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } +composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } diff --git a/agents/agent-koog/gradle/wrapper/gradle-wrapper.jar b/agents/agent-koog/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..1b33c55b Binary files /dev/null and b/agents/agent-koog/gradle/wrapper/gradle-wrapper.jar differ diff --git a/agents/agent-koog/gradle/wrapper/gradle-wrapper.properties b/agents/agent-koog/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..23449a2b --- /dev/null +++ b/agents/agent-koog/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/agents/agent-koog/gradlew b/agents/agent-koog/gradlew new file mode 100755 index 00000000..23d15a93 --- /dev/null +++ b/agents/agent-koog/gradlew @@ -0,0 +1,251 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH="\\\"\\\"" + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/agents/agent-koog/gradlew.bat b/agents/agent-koog/gradlew.bat new file mode 100644 index 00000000..5eed7ee8 --- /dev/null +++ b/agents/agent-koog/gradlew.bat @@ -0,0 +1,94 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH= + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/agents/agent-koog/settings.gradle.kts b/agents/agent-koog/settings.gradle.kts new file mode 100644 index 00000000..fdd7dcba --- /dev/null +++ b/agents/agent-koog/settings.gradle.kts @@ -0,0 +1,31 @@ +rootProject.name = "Koogexample" +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +pluginManagement { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + google { + mavenContent { + includeGroupAndSubgroups("androidx") + includeGroupAndSubgroups("com.android") + includeGroupAndSubgroups("com.google") + } + } + mavenCentral() + } +} + +include(":composeApp") \ No newline at end of file