[
  {
    "path": ".fleet/receipt.json",
    "content": "// Project generated by Kotlin Multiplatform Wizard\n{\n    \"spec\": {\n        \"template_id\": \"kmt\",\n        \"targets\": {\n            \"android\": {\n                \"ui\": [\n                    \"compose\"\n                ]\n            },\n            \"ios\": {\n                \"ui\": [\n                    \"compose\"\n                ]\n            }\n        }\n    },\n    \"timestamp\": \"2025-04-06T08:25:58.346564588Z\"\n}"
  },
  {
    "path": ".gitignore",
    "content": "*.iml\n.kotlin\n.gradle\n**/build/\nxcuserdata\n!src/**/build/\nlocal.properties\n.idea\n.DS_Store\ncaptures\n.externalNativeBuild\n.cxx\n*.xcodeproj/*\n!*.xcodeproj/project.pbxproj\n!*.xcodeproj/xcshareddata/\n!*.xcodeproj/project.xcworkspace/\n!*.xcworkspace/contents.xcworkspacedata\n**/xcshareddata/WorkspaceSettings.xcsettings\n"
  },
  {
    "path": "README.md",
    "content": "\n**一、介绍**\n\n* **Aether**：业内首次创新性基于 AST + Runtime 构建 KMP + CMP 的动态化方案，实现逻辑页面动态下发。\n* 全流程覆盖开发至运维。提升发版效率与热修复能力，有效缓解 KMP 缺失的动态化，可大范围推动 Android KMP 的生态发展。\n* 但因为个人精力有限，还有很多工程化的能力需要建设，期待社区一起未来后续将强化复杂语法支持与生态建设，降低开发成本、优化体验并扩大业务覆盖；推进大前端融合，实现跨终端一致性体验。\n* 目前实现最小的实验原型，后续依赖于社区一起建设。\n\n---\n\n**二、项目结构**\n\n* `/composeApp` 是用于在 Compose Multiplatform 应用程序之间共享代码的部分。\n  它包含以下几个子文件夹：\n  - `commonMain` 用于所有目标平台通用的代码。\n  - 其他文件夹是针对特定平台编译的 Kotlin 代码。例如，如果你想在 iOS 部分使用 Apple 的 CoreCrypto，\n    则应该在 `iosMain` 文件夹中编写相关调用。\n\n* `/iosApp` 包含 iOS 应用程序。即使你通过 Compose Multiplatform 共享 UI，\n  你仍然需要这个入口点来启动你的 iOS 应用。这也是你添加 SwiftUI 代码的地方。\n\n* `/core` 模块是 Aether 的核心模块。\ngit \n---\n\n**三、挑战**\n\n* 工作量巨大，需要保持耐心，笔者在业余时间进行探索，几乎已经投入全部时间。\n* 项目较为复杂，核心链路虽然跑通了，但是一些复杂的语法还未支持，需要保持一定耐心去兼容。之所以开源出来也是希望依赖于社区同学一起投入进来。\n* 因为牵扯到 AST 和 DSL 的转换和解析执行虚拟机的加载，对于排查问题有一定的门槛，边界异常逻辑处理需要后继者更为注意。\n\n---"
  },
  {
    "path": "annotations/build.gradle.kts",
    "content": "plugins {\n    kotlin(\"jvm\")\n}\n\njava {\n    sourceCompatibility = JavaVersion.VERSION_17\n    targetCompatibility = JavaVersion.VERSION_17\n}\n\nkotlin {\n    jvmToolchain(17)\n}\n\ndependencies {\n    implementation(kotlin(\"stdlib\"))\n}\n\ntasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {\n    kotlinOptions {\n        jvmTarget = \"17\"\n    }\n}"
  },
  {
    "path": "annotations/src/main/java/com/aether/annotations/ComposeMirror.kt",
    "content": "package com.aether.annotations\n\n@Target(AnnotationTarget.CLASS)\n@Retention(AnnotationRetention.SOURCE)\nannotation class ComposeMirror "
  },
  {
    "path": "annotations/src/main/java/com/aether/annotations/Reflectable.kt",
    "content": "package com.aether.annotations\n\n/**\n * 用于标记可反射的Compose组件类\n */\n@Target(AnnotationTarget.CLASS)\n@Retention(AnnotationRetention.SOURCE)\nannotation class Reflectable(\n    val name: String = \"\",\n    val description: String = \"\"\n)\n\n/**\n * 用于标记可反射的Compose函数\n */\n@Target(AnnotationTarget.FUNCTION)\n@Retention(AnnotationRetention.SOURCE)\nannotation class ReflectableFunction(\n    val name: String = \"\",\n    val description: String = \"\"\n)\n\n// 标记要生成反射元数据的注解\n@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)\nannotation class GenerateMirror"
  },
  {
    "path": "build.gradle.kts",
    "content": "plugins {\n    // this is necessary to avoid the plugins to be loaded multiple times\n    // in each subproject's classloader\n    alias(libs.plugins.androidApplication) apply false\n    alias(libs.plugins.androidLibrary) apply false\n    alias(libs.plugins.composeMultiplatform) apply false\n    alias(libs.plugins.kotlinMultiplatform) apply false\n    alias(libs.plugins.kotlinAndroid) apply false\n}"
  },
  {
    "path": "composeApp/build.gradle.kts",
    "content": "import org.jetbrains.compose.desktop.application.dsl.TargetFormat\nimport org.jetbrains.compose.ExperimentalComposeLibrary\n\nplugins {\n    alias(libs.plugins.kotlinMultiplatform)\n    alias(libs.plugins.androidApplication)\n    alias(libs.plugins.composeMultiplatform)\n}\n\nconfigurations.implementation {\n    exclude(group = \"org.jetbrains\", module = \"annotations\")\n}\n\nkotlin {\n    android {\n        compilations.all {\n            kotlinOptions {\n                jvmTarget = \"17\"\n            }\n        }\n    }\n\n    sourceSets {\n        val androidMain by getting {\n            dependencies {\n                implementation(compose.preview)\n                implementation(libs.androidx.activity.compose)\n            }\n        }\n\n        @OptIn(ExperimentalComposeLibrary::class)\n        val commonMain by getting {\n            dependencies {\n                implementation(project(\":core\"))\n                implementation(project(\":annotations\"))\n                implementation(compose.runtime)\n                implementation(compose.foundation)\n                implementation(compose.material)\n                implementation(compose.ui)\n                implementation(compose.components.resources)\n                implementation(compose.preview)\n                implementation(libs.androidx.lifecycle.viewmodel)\n                implementation(libs.androidx.lifecycle.runtime.compose)\n            }\n        }\n    }\n}\n\nandroid {\n    namespace = \"org.example.project\"\n    compileSdk = 34\n\n    defaultConfig {\n        applicationId = \"org.example.project\"\n        minSdk = libs.versions.android.minSdk.get().toInt()\n        targetSdk = 34\n        versionCode = 1\n        versionName = \"1.0\"\n    }\n    packaging {\n        resources {\n            excludes += \"/META-INF/{AL2.0,LGPL2.1}\"\n        }\n    }\n    packagingOptions {\n        resources.excludes.add(\"kotlin/reflect/reflect.kotlin_builtins\")\n        resources.excludes.add(\"kotlin/internal/internal.kotlin_builtins\")\n        resources.excludes.add(\"kotlin/kotlin.kotlin_builtins\")\n        resources.excludes.add(\"kotlin/coroutines/coroutines.kotlin_builtins\")\n        resources.excludes.add(\"kotlin/ranges/ranges.kotlin_builtins\")\n        resources.excludes.add(\"kotlin/collections/collections.kotlin_builtins\")\n        resources.excludes.add(\"kotlin/annotation/annotation.kotlin_builtins\")\n        excludes.addAll(listOf(\n            \"META-INF/DEPENDENCIES\",\n            \"META-INF/LICENSE\",\n            \"META-INF/LICENSE.txt\",\n            \"META-INF/NOTICE\",\n            \"META-INF/NOTICE.txt\",\n            \"META-INF/ASL2.0\"\n        ))\n    }\n\n    buildTypes {\n        getByName(\"release\") {\n            isMinifyEnabled = false\n        }\n    }\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_17\n        targetCompatibility = JavaVersion.VERSION_17\n    }\n    buildToolsVersion = \"34.0.0\"\n}\n\ndependencies {\n    implementation(\"org.jetbrains.kotlin:kotlin-stdlib:1.8.22\")\n    debugImplementation(compose.uiTooling)\n    implementation(compose.ui)\n    implementation(compose.preview)\n    implementation(project(\":annotations\"))\n    implementation(project(\":core\"))\n}"
  },
  {
    "path": "composeApp/src/androidMain/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <application\n        android:name=\"MyApplication\"\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher_test\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_test\"\n        android:supportsRtl=\"true\"\n        tools:replace=\"android:theme\"\n        android:theme=\"@android:style/Theme.Material.Light.NoActionBar\">\n        <activity\n            android:exported=\"true\"\n            android:configChanges=\"orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode\"\n            android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "composeApp/src/androidMain/kotlin/Myapplicaton.kt",
    "content": "package org.example.project\nimport android.app.Application\nimport com.aether.core.runtime.reflectable.ComposeComponentFactory.initializeComposeMirrors\n\nclass MyApplication : Application() {\n    override fun onCreate() {\n        super.onCreate()\n\n        // 初始化 Compose 镜像反射系统\n        initializeComposeMirrors()\n\n        // 其他初始化代码...\n    }\n}"
  },
  {
    "path": "composeApp/src/androidMain/kotlin/org/example/project/MainActivity.kt",
    "content": "package org.example.project\n\nimport android.os.Bundle\nimport androidx.activity.ComponentActivity\nimport androidx.activity.compose.setContent\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.tooling.preview.Preview\nimport com.aether.core.runtime.deliver.ExampleUsage\n\nclass MainActivity : ComponentActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n\n        setContent {\n//            App()\n            ExampleUsage()\n        }\n    }\n}\n\n@Preview\n@Composable\nfun AppAndroidPreview() {\n    App()\n}"
  },
  {
    "path": "composeApp/src/androidMain/kotlin/org/example/project/Platform.android.kt",
    "content": "package org.example.project\n\nimport android.os.Build\n\nclass AndroidPlatform : Platform {\n    override val name: String = \"Android ${Build.VERSION.SDK_INT}\"\n}\n\nactual fun getPlatform(): Platform = AndroidPlatform()"
  },
  {
    "path": "composeApp/src/androidMain/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#3DDC84\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n</vector>"
  },
  {
    "path": "composeApp/src/androidMain/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path android:pathData=\"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"85.84757\"\n                android:endY=\"92.4963\"\n                android:startX=\"42.9492\"\n                android:startY=\"49.59793\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\" />\n</vector>"
  },
  {
    "path": "composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "composeApp/src/androidMain/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "composeApp/src/androidMain/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">KotlinProject</string>\n</resources>"
  },
  {
    "path": "composeApp/src/commonMain/composeResources/drawable/compose-multiplatform.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"600dp\"\n    android:height=\"600dp\"\n    android:viewportWidth=\"600\"\n    android:viewportHeight=\"600\">\n  <path\n      android:pathData=\"M301.21,418.53C300.97,418.54 300.73,418.56 300.49,418.56C297.09,418.59 293.74,417.72 290.79,416.05L222.6,377.54C220.63,376.43 219,374.82 217.85,372.88C216.7,370.94 216.09,368.73 216.07,366.47L216.07,288.16C216.06,287.32 216.09,286.49 216.17,285.67C216.38,283.54 216.91,281.5 217.71,279.6L199.29,268.27L177.74,256.19C175.72,260.43 174.73,265.23 174.78,270.22L174.79,387.05C174.85,393.89 178.57,400.2 184.53,403.56L286.26,461.02C290.67,463.51 295.66,464.8 300.73,464.76C300.91,464.76 301.09,464.74 301.27,464.74C301.24,449.84 301.22,439.23 301.22,439.23L301.21,418.53Z\"\n      android:fillColor=\"#041619\"\n      android:fillType=\"nonZero\"/>\n  <path\n      android:pathData=\"M409.45,242.91L312.64,188.23C303.64,183.15 292.58,183.26 283.68,188.51L187.92,245C183.31,247.73 179.93,251.62 177.75,256.17L177.74,256.19L199.29,268.27L217.71,279.6C217.83,279.32 217.92,279.02 218.05,278.74C218.24,278.36 218.43,277.98 218.64,277.62C219.06,276.88 219.52,276.18 220.04,275.51C221.37,273.8 223.01,272.35 224.87,271.25L289.06,233.39C290.42,232.59 291.87,231.96 293.39,231.51C295.53,230.87 297.77,230.6 300,230.72C302.98,230.88 305.88,231.73 308.47,233.2L373.37,269.85C375.54,271.08 377.49,272.68 379.13,274.57C379.68,275.19 380.18,275.85 380.65,276.53C380.86,276.84 381.05,277.15 381.24,277.47L397.79,266.39L420.34,252.93L420.31,252.88C417.55,248.8 413.77,245.35 409.45,242.91Z\"\n      android:fillColor=\"#37BF6E\"\n      android:fillType=\"nonZero\"/>\n  <path\n      android:pathData=\"M381.24,277.47C381.51,277.92 381.77,278.38 382.01,278.84C382.21,279.24 382.39,279.65 382.57,280.06C382.91,280.88 383.19,281.73 383.41,282.59C383.74,283.88 383.92,285.21 383.93,286.57L383.93,361.1C383.96,363.95 383.35,366.77 382.16,369.36C381.93,369.86 381.69,370.35 381.42,370.83C379.75,373.79 377.32,376.27 374.39,378L310.2,415.87C307.47,417.48 304.38,418.39 301.21,418.53L301.22,439.23C301.22,439.23 301.24,449.84 301.27,464.74C306.1,464.61 310.91,463.3 315.21,460.75L410.98,404.25C419.88,399 425.31,389.37 425.22,379.03L425.22,267.85C425.17,262.48 423.34,257.34 420.34,252.93L397.79,266.39L381.24,277.47Z\"\n      android:fillColor=\"#3870B2\"\n      android:fillType=\"nonZero\"/>\n  <path\n      android:pathData=\"M177.75,256.17C179.93,251.62 183.31,247.73 187.92,245L283.68,188.51C292.58,183.26 303.64,183.15 312.64,188.23L409.45,242.91C413.77,245.35 417.55,248.8 420.31,252.88L420.34,252.93L498.59,206.19C494.03,199.46 487.79,193.78 480.67,189.75L320.86,99.49C306.01,91.1 287.75,91.27 273.07,99.95L114.99,193.2C107.39,197.69 101.81,204.11 98.21,211.63L177.74,256.19L177.75,256.17ZM301.27,464.74C301.09,464.74 300.91,464.76 300.73,464.76C295.66,464.8 290.67,463.51 286.26,461.02L184.53,403.56C178.57,400.2 174.85,393.89 174.79,387.05L174.78,270.22C174.73,265.23 175.72,260.43 177.74,256.19L98.21,211.63C94.86,218.63 93.23,226.58 93.31,234.82L93.31,427.67C93.42,438.97 99.54,449.37 109.4,454.92L277.31,549.77C284.6,553.88 292.84,556.01 301.2,555.94L301.2,555.8C301.39,543.78 301.33,495.26 301.27,464.74Z\"\n      android:strokeWidth=\"10\"\n      android:fillColor=\"#00000000\"\n      android:strokeColor=\"#083042\"\n      android:fillType=\"nonZero\"/>\n  <path\n      android:pathData=\"M498.59,206.19L420.34,252.93C423.34,257.34 425.17,262.48 425.22,267.85L425.22,379.03C425.31,389.37 419.88,399 410.98,404.25L315.21,460.75C310.91,463.3 306.1,464.61 301.27,464.74C301.33,495.26 301.39,543.78 301.2,555.8L301.2,555.94C309.48,555.87 317.74,553.68 325.11,549.32L483.18,456.06C497.87,447.39 506.85,431.49 506.69,414.43L506.69,230.91C506.6,222.02 503.57,213.5 498.59,206.19Z\"\n      android:strokeWidth=\"10\"\n      android:fillColor=\"#00000000\"\n      android:strokeColor=\"#083042\"\n      android:fillType=\"nonZero\"/>\n  <path\n      android:pathData=\"M301.2,555.94C292.84,556.01 284.6,553.88 277.31,549.76L109.4,454.92C99.54,449.37 93.42,438.97 93.31,427.67L93.31,234.82C93.23,226.58 94.86,218.63 98.21,211.63C101.81,204.11 107.39,197.69 114.99,193.2L273.07,99.95C287.75,91.27 306.01,91.1 320.86,99.49L480.67,189.75C487.79,193.78 494.03,199.46 498.59,206.19C503.57,213.5 506.6,222.02 506.69,230.91L506.69,414.43C506.85,431.49 497.87,447.39 483.18,456.06L325.11,549.32C317.74,553.68 309.48,555.87 301.2,555.94Z\"\n      android:strokeWidth=\"10\"\n      android:fillColor=\"#00000000\"\n      android:strokeColor=\"#083042\"\n      android:fillType=\"nonZero\"/>\n</vector>"
  },
  {
    "path": "composeApp/src/commonMain/kotlin/org/example/project/App.kt",
    "content": "package org.example.project\n\nimport androidx.compose.animation.AnimatedVisibility\nimport androidx.compose.foundation.Image\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.foundation.layout.fillMaxWidth\nimport androidx.compose.material.Button\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.*\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport org.jetbrains.compose.resources.painterResource\n\nimport kotlinproject.composeapp.generated.resources.Res\nimport kotlinproject.composeapp.generated.resources.compose_multiplatform\n\n@Composable\nfun App() {\n    MaterialTheme {\n        var showContent by remember { mutableStateOf(false) }\n        Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {\n            Button(onClick = { showContent = !showContent }) {\n                Text(\"Click me!\")\n            }\n            AnimatedVisibility(showContent) {\n                val greeting = remember { Greeting().greet() }\n                Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {\n                    Text(\"Compose: $greeting\")\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "composeApp/src/commonMain/kotlin/org/example/project/Greeting.kt",
    "content": "package org.example.project\n\nclass Greeting {\n    private val platform = getPlatform()\n\n    fun greet(): String {\n        return \"Hello, ${platform.name}!\"\n    }\n}"
  },
  {
    "path": "composeApp/src/commonMain/kotlin/org/example/project/Platform.kt",
    "content": "package org.example.project\n\ninterface Platform {\n    val name: String\n}\n\nexpect fun getPlatform(): Platform"
  },
  {
    "path": "composeApp/src/iosMain/kotlin/org/example/project/MainViewController.kt",
    "content": "package org.example.project\n\nimport androidx.compose.ui.window.ComposeUIViewController\n\nfun MainViewController() = ComposeUIViewController { App() }"
  },
  {
    "path": "composeApp/src/iosMain/kotlin/org/example/project/Platform.ios.kt",
    "content": "package org.example.project\n\nimport platform.UIKit.UIDevice\n\nclass IOSPlatform: Platform {\n    override val name: String = UIDevice.currentDevice.systemName() + \" \" + UIDevice.currentDevice.systemVersion\n}\n\nactual fun getPlatform(): Platform = IOSPlatform()"
  },
  {
    "path": "composeApp/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher_test\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_test\"\n        android:supportsRtl=\"true\"\n        tools:replace=\"android:theme\"\n        android:theme=\"@android:style/Theme.Material.Light.NoActionBar\">\n        <activity\n            android:exported=\"true\"\n            android:configChanges=\"orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode\"\n            android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "composeApp/src/main/java/com/aether/composeapp/example/ReflectableExample.kt",
    "content": "package com.aether.composeapp.example\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.foundation.layout.padding\nimport androidx.compose.material.Button\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.unit.dp\nimport com.aether.annotations.ReflectableFunction\nimport com.aether.core.runtime.reflectable.ComposeComponentFactory\n\n/**\n * 一个可反射的文本组件\n */\n@ReflectableFunction(\n    name = \"CustomText\",\n    description = \"A custom text component with padding\"\n)\n@Composable\nfun CustomText(text: String, modifier: Modifier = Modifier) {\n    Text(\n        text = text,\n        modifier = modifier.padding(16.dp)\n    )\n}\n\n/**\n * 一个可反射的按钮组件\n */\n@ReflectableFunction(\n    name = \"CustomButton\",\n    description = \"A custom button component with text\"\n)\n@Composable\nfun CustomButton(\n    text: String,\n    onClick: () -> Unit,\n    modifier: Modifier = Modifier\n) {\n    Button(\n        onClick = onClick,\n        modifier = modifier\n    ) {\n        Text(text)\n    }\n}\n\n/**\n * 一个可反射的容器组件\n */\n@ReflectableFunction(\n    name = \"CustomContainer\",\n    description = \"A custom container component\"\n)\n@Composable\nfun CustomContainer(\n    content: @Composable () -> Unit,\n    modifier: Modifier = Modifier\n) {\n    Column(modifier = modifier) {\n        content()\n    }\n}\n\n/**\n * 一个可反射的复合组件\n */\n//@ReflectableFunction(\n//    name = \"ComplexComponent\",\n//    description = \"A complex component combining multiple elements\"\n//)\n//@Composable\n//fun ComplexComponent(\n//    title: String,\n//    buttonText: String,\n//    onButtonClick: () -> Unit\n//) {\n//    CustomContainer {\n//        CustomText(text = title)\n//        CustomButton(\n//            text = buttonText,\n//            onClick = onButtonClick\n//        )\n//    }\n//}\n\n/**\n * 示例用法\n */\n@Composable\nfun ExampleUsage() {\n    // 注册组件\n}"
  },
  {
    "path": "core/.gitignore",
    "content": "/build"
  },
  {
    "path": "core/build.gradle.kts",
    "content": "plugins {\n    alias(libs.plugins.androidLibrary)\n    alias(libs.plugins.kotlinAndroid)\n}\n\nandroid {\n    namespace = \"com.aether.core.runtime\"\n    compileSdk = 34\n\n    buildFeatures {\n        compose = true\n    }\n\n    composeOptions {\n        kotlinCompilerExtensionVersion = \"1.4.8\" // This version works with Kotlin 1.8.22\n    }\n//    android {\n//        composeOptions {\n//            kotlinCompilerExtensionVersion = \"1.5.15\"\n//        }\n//    }\n//    defaultConfig {\n//        minSdk = 34\n//        targetSdk = 34\n//        versionCode = 1\n//        versionName = \"1.0\"\n//\n//        testInstrumentationRunner = \"androidx.test.runner.AndroidJUnitRunner\"\n//    }\n\n\n    buildTypes {\n        release {\n            isMinifyEnabled = false\n            proguardFiles(\n                getDefaultProguardFile(\"proguard-android-optimize.txt\"),\n                \"proguard-rules.pro\"\n            )\n        }\n    }\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_17\n        targetCompatibility = JavaVersion.VERSION_17\n    }\n    kotlinOptions {\n        jvmTarget = \"17\"\n    }\n}\n\nconfigurations.implementation {\n    exclude(group = \"com.intellij\", module = \"annotations\")\n}\n\ndependencies {\n\n    implementation(libs.androidx.core.ktx)\n    implementation(libs.androidx.appcompat)\n    implementation(libs.androidx.material)\n    testImplementation(libs.junit)\n    androidTestImplementation(libs.androidx.test.junit)\n    androidTestImplementation(libs.androidx.espresso.core)\n\n    // Kotlin 标准库\n//    implementation(\"org.jetbrains.kotlin:kotlin-stdlib:1.8.20\")\n    // AndroidX Core KTX\n    implementation(\"androidx.core:core-ktx:1.3.1\")\n    // AndroidX AppCompat\n    implementation(\"androidx.appcompat:appcompat:1.2.0\")\n    // Material Design 组件\n//    implementation(\"com.google.android.material:material:1.2.1\")\n    // ConstraintLayout\n    implementation(\"androidx.constraintlayout:constraintlayout:2.0.1\")\n    // JUnit 测试框架\n//    testImplementation(\"junit:junit:4.13.2\")\n    // AndroidX 测试扩展 JUnit\n//    androidTestImplementation(\"androidx.test.ext:junit:1.1.2\")\n    // Espresso 测试框架\n    androidTestImplementation(\"androidx.test.espresso:espresso-core:3.3.0\")\n    // Kotlin 编译器\n    implementation(\"org.jetbrains.kotlin:kotlin-compiler:1.8.20\") {\n        exclude(group = \"com.google.guava\", module = \"guava\")\n    }\n\n    implementation(\"org.jetbrains.kotlin:kotlin-stdlib:1.8.22\")\n    implementation(\"androidx.compose.ui:ui:1.6.0\")\n    implementation(\"androidx.compose.material:material:1.6.0\")\n//    implementation(\"androidx.compose.runtime:runtime:1.6.0\")\n    implementation(\"androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0\")\n//    implementation(\"com.google.firebase:firebase-inappmessaging-display:17.2.0\")\n//    implementation(\"com.google.guava:guava:27.0.1-android\")\n//    implementation(\"com.google.guava:guava:27.0.1-jre\")\n    implementation(\"com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava\")\n//    implementation(\"com.google.code.gson:gson:2.8.8\")\n    implementation(\"com.fasterxml.jackson.core:jackson-databind:2.14.2\")\n}"
  },
  {
    "path": "core/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n-keep class androidx.compose.** { *; }\n-dontwarn androidx.compose.**"
  },
  {
    "path": "core/src/androidTest/java/com/aether/core/runtime/ExampleInstrumentedTest.kt",
    "content": "package com.aether.core.runtime\n\nimport androidx.test.platform.app.InstrumentationRegistry\nimport androidx.test.ext.junit.runners.AndroidJUnit4\n\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\nimport org.junit.Assert.*\n\n/**\n * Instrumented test, which will execute on an Android device.\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\n@RunWith(AndroidJUnit4::class)\nclass ExampleInstrumentedTest {\n    @Test\n    fun useAppContext() {\n        // Context of the app under test.\n        val appContext = InstrumentationRegistry.getInstrumentation().targetContext\n        assertEquals(\"com.aether.core.runtime\", appContext.packageName)\n    }\n}"
  },
  {
    "path": "core/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher_test\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_test\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/Theme.KotlinProject\" />\n\n</manifest>"
  },
  {
    "path": "core/src/main/assets/test0_compose.json",
    "content": "{\n  \"directives\": [\n    {\n      \"type\": \"ImportDirective\",\n      \"importPath\": \"androidx.compose.material.Text\",\n      \"alias\": null,\n      \"name\": \"Text\"\n    },\n    {\n      \"type\": \"ImportDirective\",\n      \"importPath\": \"androidx.compose.runtime.Composable\",\n      \"alias\": null,\n      \"name\": \"Composable\"\n    }\n  ],\n  \"declarations\": [\n    {\n      \"type\": \"ClassDeclaration\",\n      \"name\": \"DemoCompose\",\n      \"members\": [\n        {\n          \"type\": \"MethodDeclaration\",\n          \"name\": \"Main\",\n          \"parameters\": [],\n          \"typeParameters\": [],\n          \"body\": {\n            \"type\": \"BlockStatement\",\n            \"body\": [\n              {\n                \"type\": \"InstanceCreationExpression\",\n                \"constructorName\": \"Text\",\n                \"argumentList\": {\n                  \"type\": \"ArgumentList\",\n                  \"arguments\": [\n                    {\n                      \"type\": \"Argument\",\n                      \"body\": {\n                        \"type\": \"StringTemplateExpression\",\n                        \"name\": null,\n                        \"body\": {\n                          \"type\": \"StringTemplateEntry\",\n                          \"body\": null,\n                          \"value\": \"这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\"\n                        }\n                      }\n                    }\n                  ]\n                },\n                \"valueArgument\": []\n              }\n            ]\n          },\n          \"isStatic\": false,\n          \"isGetter\": true,\n          \"isSetter\": false\n        }\n      ],\n      \"body\": {}\n    }\n  ],\n  \"type\": \"CompilationUnit\"\n}"
  },
  {
    "path": "core/src/main/assets/test1_compose.json",
    "content": "{\n  \"directives\" : [ {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.background\",\n    \"alias\" : null,\n    \"name\" : \"background\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.layout.Box\",\n    \"alias\" : null,\n    \"name\" : \"Box\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.layout.Column\",\n    \"alias\" : null,\n    \"name\" : \"Column\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.layout.fillMaxWidth\",\n    \"alias\" : null,\n    \"name\" : \"fillMaxWidth\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.layout.height\",\n    \"alias\" : null,\n    \"name\" : \"height\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.layout.padding\",\n    \"alias\" : null,\n    \"name\" : \"padding\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.foundation.shape.RoundedCornerShape\",\n    \"alias\" : null,\n    \"name\" : \"RoundedCornerShape\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.material.Button\",\n    \"alias\" : null,\n    \"name\" : \"Button\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.material.Text\",\n    \"alias\" : null,\n    \"name\" : \"Text\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.runtime.Composable\",\n    \"alias\" : null,\n    \"name\" : \"Composable\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.ui.Alignment\",\n    \"alias\" : null,\n    \"name\" : \"Alignment\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.ui.Modifier\",\n    \"alias\" : null,\n    \"name\" : \"Modifier\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.ui.draw.clip\",\n    \"alias\" : null,\n    \"name\" : \"clip\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.ui.graphics.Color\",\n    \"alias\" : null,\n    \"name\" : \"Color\"\n  }, {\n    \"type\" : \"ImportDirective\",\n    \"importPath\" : \"androidx.compose.ui.unit.dp\",\n    \"alias\" : null,\n    \"name\" : \"dp\"\n  } ],\n  \"declarations\" : [ {\n    \"type\" : \"ClassDeclaration\",\n    \"name\" : \"DemoCompose\",\n    \"members\" : [ {\n      \"type\" : \"MethodDeclaration\",\n      \"name\" : \"Main\",\n      \"parameters\" : [ ],\n      \"typeParameters\" : [ ],\n      \"body\" : {\n        \"type\" : \"BlockStatement\",\n        \"body\" : [ {\n          \"type\" : \"InstanceCreationExpression\",\n          \"constructorName\" : \"Column\",\n          \"argumentList\" : {\n            \"type\" : \"ArgumentList\",\n            \"arguments\" : [ {\n              \"type\" : \"Argument\",\n              \"body\" : {\n                \"type\" : \"MethodInvocation\",\n                \"name\" : null,\n                \"methodName\" : {\n                  \"type\" : \"CallExpression\",\n                  \"methodName\" : {\n                    \"type\" : \"Identifier\",\n                    \"name\" : \"fillMaxWidth\"\n                  },\n                  \"target\" : {\n                    \"type\" : \"Identifier\",\n                    \"name\" : \"fillMaxWidth\"\n                  },\n                  \"argumentList\" : {\n                    \"type\" : \"ArgumentList\",\n                    \"arguments\" : [ ]\n                  },\n                  \"valueArgument\" : [ ]\n                },\n                \"target\" : {\n                  \"type\" : \"Identifier\",\n                  \"name\" : \"Modifier\"\n                }\n              }\n            }, {\n              \"type\" : \"Argument\",\n              \"body\" : {\n                \"type\" : \"MethodInvocation\",\n                \"name\" : null,\n                \"methodName\" : {\n                  \"type\" : \"Identifier\",\n                  \"name\" : \"CenterHorizontally\"\n                },\n                \"target\" : {\n                  \"type\" : \"Identifier\",\n                  \"name\" : \"Alignment\"\n                }\n              }\n            } ]\n          },\n          \"valueArgument\" : [ ]\n        } ]\n      },\n      \"isStatic\" : false,\n      \"isGetter\" : true,\n      \"isSetter\" : false\n    } ],\n    \"body\" : { }\n  } ],\n  \"type\" : \"CompilationUnit\"\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/AppContextManager.kt",
    "content": "package com.aether.core.runtime\n\nimport com.aether.core.runtime.AppContext\n\nobject AppContextManager {\n   private val contextHolder = ThreadLocal.withInitial { AppContext(null, \"ROOT\", emptyMap(), emptyMap()) }\n\n    // 获取当前线程的 AppContext\n    val context: AppContext\n        get() = contextHolder.get()\n\n    // 设置当前线程的 AppContext\n    fun set(context: AppContext) {\n        contextHolder.set(context)\n    }\n\n    fun get() :AppContext{\n       return context\n    }\n    // 移除当前线程的 AppContext\n    fun removeContext() {\n        contextHolder.remove()\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/AstRuntime.kt",
    "content": "package com.aether.core.runtime\n\nimport android.text.TextUtils\nimport com.aether.core.runtime.AppContextManager.context\nimport com.aether.core.runtime.deliver.ComposableHolder\nimport com.aether.core.runtime.deliver.invokeRunMain\nimport com.aether.core.runtime.proxy.ProxyBinding\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.ComposeComponentFactory\nimport com.fasterxml.jackson.databind.ObjectMapper\nimport com.fasterxml.jackson.databind.SerializationFeature\nimport com.intellij.openapi.project.Project\nimport com.intellij.openapi.util.Disposer\nimport com.intellij.psi.PsiFileFactory\nimport org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles\nimport org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment\nimport org.jetbrains.kotlin.psi.KtExpression\nimport org.jetbrains.kotlin.psi.KtFile\nimport java.io.File\nimport java.lang.reflect.Modifier\nimport java.util.Collections\nimport java.util.UUID\nimport kotlin.reflect.KClass\nimport kotlin.reflect.jvm.javaMethod\n\n\n/// The `import` directive.\nclass Import(\n    /// The absolute URI of the imported library.\n    val uri: String,\n    /// The import prefix, or `null` if not specified.\n    val prefix: String?,\n    /// The list of namespace combinators to apply, not `null`.\n    val combinators: List<Combinator>?\n) {\n    override fun toString(): String {\n        return \"Import(uri: $uri, prefix: $prefix, combinators: $combinators)\"\n    }\n}\n\nfun _exeAndRecMethodInvocation(methodInvocation: MethodInvocation): Any? {\n    val programStack = context.get<ProgramStack>(ProgramStack::class.java)\n    val scope = StackScope(\"Call method: \") // 创建 StackScope 实例\n    scope[\"node\"] = methodInvocation // 将 methodInvocation 存入 scope\n    programStack?.push(scope = scope) // 将 scope 压入程序栈\n    val result = _executeMethodInvocation2(methodInvocation) // 执行方法调用逻辑\n    programStack?.pop() // 弹出栈顶\n    return result // 返回结果\n}\n\nfun _executeMethodInvocation2(methodInvocation: MethodInvocation): Any? {\n    val runtime = context.get<AstRuntime>(AstRuntime::class.java)!! // 获取 AstRuntime，使用 !! 表示非空断言\n    val programStack = context.get<ProgramStack>(ProgramStack::class.java)!! // 获取 ProgramStack\n    val methodName = methodInvocation.methodName\n\n    val positionalArguments = mutableListOf<Any?>() // 位置参数列表\n    val namedArguments = mutableMapOf<String, Any?>() // 命名参数 Map\n\n    // 处理方法的参数\n    if (!(methodInvocation.argumentList?.arguments == null || methodInvocation.argumentList.arguments.isEmpty())) {\n        for (argument in methodInvocation.argumentList!!.arguments!!) {\n            if (argument.isNamedExpression) {\n                namedArguments.putAll(executeExpression(argument) as Map<String, Any?>)\n            } else {\n                val arg = executeExpression(argument)\n                if (arg != null) {\n                    positionalArguments.add(\n                        arg\n                    )\n                }\n            }\n        }\n    }\n    // 检查是否有 ComposableHolder 上下文\n    val holder = context.get(ComposableHolder::class.java)\n    if (holder != null) {\n        if (methodName?.name == \"build\" && methodInvocation.argumentList?.arguments?.isNotEmpty() == true) {\n            // 确保有参数\n//            val arg = methodInvocation.argumentList?.arguments?.get(0)\n//            if (arg != null && arg.isFunctionExpression) {\n//                return doRunBuild(arg.asFunctionExpression())\n//            }\n        } else if (methodName?.name == \"runApp\" && methodInvocation.argumentList?.arguments?.isNotEmpty() == true) {\n//            val arg = methodInvocation.argumentList?.arguments?.get(0)\n//            if (arg != null) {\n//                return invokeRunApp(arg)\n//            }\n        }\n    }\n\n    var target: Any? = null\n    if (methodInvocation.isCascaded) {\n//        target = findCascadeAncestorTargetValue(methodInvocation)\n    } else if (methodInvocation.target != null) {\n        target = executeExpression(methodInvocation.target)\n    }\n//\n//    if (target == null) {\n//        if (methodInvocation.isNullAware) {\n//            return null\n//        }\n//        if (methodInvocation.target != null) {\n//            throw RuntimeException(\"Null check operator used on a null value -> $methodName\")\n//        }\n//    }\n\n    // 如果没有目标对象\n    if (target == null) {\n        // 查找实例 AST 方法或静态 AST 方法\n        val method = programStack.get<AstMethod>(methodName!!.name)\n        if (method != null) {\n            return AstMethod.apply2(method, positionalArguments, namedArguments)\n        }\n\n        // 默认 AST 构造函数\n        val clazz = AstClass.forName(methodName!!.name)\n        if (clazz != null) {\n            return clazz.newInstance(\"\", positionalArguments, namedArguments)\n        }\n    } else {\n        methodInvocation.methodName\n        // 如果目标是 AstClass\n        if (target is AstClass) {\n            if (target.hasConstructor(methodName!!.name)) {\n                return target.newInstance(methodName.name, positionalArguments, namedArguments)\n            } else {\n                return target.invoke(methodName.name, positionalArguments, namedArguments)\n            }\n        }\n\n        // 如果目标是 AstInstance\n        val instance = AstInstance.forObject(target)\n        if (instance != null) {\n\n            val positionalArguments = mutableListOf<Any?>() // 位置参数列表\n            val namedArguments = mutableMapOf<String, Any?>() // 命名参数 Map\n\n            return instance.invoke(methodName!!.name, positionalArguments, namedArguments)\n        }\n\n        throw RuntimeException(\"InstanceMirror for ${target::class} not found\")\n    }\n\n    // 检查是否有顶层函数\n//    if (runtime.hasTopLevelFunction(methodName)) {\n//        return runtime.invoke(methodName, positionalArguments, namedArguments)\n//    }\n//\n//    // 尝试通过反射调用顶层方法\n//    val libraryMirror = ReflectionBinding.instance.reflectTopLevelInvoke(methodName)\n//    if (libraryMirror != null) {\n//        val function = AstMethod.fromMirror(libraryMirror.declarations[methodName] as MethodMirror)\n//        processArguments(function.parameters, positionalArguments, namedArguments)\n//        return libraryMirror.invoke(methodName, positionalArguments, namedArguments)\n//    }\n\n    throw RuntimeException(\"Error: MethodInvocation -> $methodName, target: $target, runtimeType: ${target?.toString()}\")\n}\n\n//fun executeMethodTarget(\n//    methodInvocation: MethodInvocation,\n//    methodName: String,\n//    positionalArguments: List<Any?>,\n//    namedArguments: Map<String, Any?>? = null\n//): Any? {\n//    if (methodInvocation?.target != null) {\n//        var target = executeExpression(methodInvocation.target!!)\n//        if (target is AstClass) {\n//            if (target.hasConstructor(methodName)) {\n//                return target.newInstance(methodName, positionalArguments, namedArguments)\n//            } else {\n//                return target.invoke(methodName, positionalArguments, namedArguments)\n//            }\n//        }\n//        val instance = AstInstance.forObject(target)\n//        if (instance != null) {\n//            return instance.invokeGetter(methodInvocation.methodName!!.name)\n//        }\n//    }\n//    return null\n//}\n\nfun executeInstanceCreationExpression(instanceCreationExpression: InstanceCreationExpression): Any? {\n    val positionalArguments = mutableListOf<Any?>()\n    val namedArguments = mutableMapOf<String, Any?>()\n\n    if (instanceCreationExpression.argumentList?.arguments?.isNotEmpty() == true) {\n        for (arg in instanceCreationExpression!!.argumentList!!.arguments!!) {\n            if (arg.isNamedExpression) {\n                namedArguments.putAll(executeExpression(arg) as Map<out String, Any?>)\n            } else {\n                positionalArguments.add(executeExpression(arg))\n            }\n        }\n    }\n\n    val constructorName = instanceCreationExpression.constructorName?.name\n    val typeName = instanceCreationExpression.constructorName?.typeName\n    if (typeName == null || constructorName == null) {\n        println(\"Type $typeName is ${typeName == null} not found, constructorName is ${constructorName == null} not found\")\n        null\n    }\n    //TODO 这里依然有问题，需要\n    // 对于Compose组件，返回一个包含路径和参数的描述对象\n    // 而不是直接返回@Composable函数\n    val runtime = context.get<AstRuntime>(AstRuntime::class.java)\n    val importDirective = runtime?.getReflectClass(typeName ?: \"\")\n    val children = mutableListOf<ComposeComponentDescriptor>()\n    instanceCreationExpression.children?.forEach {\n        if (it.isInstanceCreationExpression) {\n            val element = executeExpression(it)\n            children.add(element as ComposeComponentDescriptor)\n        }\n    }\n    if (ComposeComponentFactory.isComponentAvailable(importDirective?.uri ?: \"\")) {\n        return ComposeComponentDescriptor(\n            importDirective?.uri ?: \"\",\n            positionalArguments,\n            namedArguments,\n            children\n        )\n    }\n\n    val astClass: AstClass? = AstClass.forName(typeName ?: \"\")\n    return if (astClass != null) {\n        astClass.newInstance(constructorName!!, positionalArguments, namedArguments)\n    } else {\n        println(\"Type $typeName not found\")\n        null\n    }\n}\n\nfun executeExpression(\n    expression: Expression, flag: String? = null, keepVariable: Boolean = false\n): Any? {\n    return try {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)\n        if (expression.isIdentifier) {\n            val name = expression.asIdentifier.name\n            val variable = programStack?.getVariable(name)\n            if (variable != null) {\n                if (keepVariable) {\n                    return variable\n                } else {\n                    if (variable.value is Expression) {\n                        return executeExpression(variable.value as Expression)\n                    }\n                    return variable.value\n                }\n            }\n\n            val runtime = context.get<AstRuntime>(AstRuntime::class.java)!!\n            val method = programStack?.get<AstMethod>(name)\n            if (method != null) {\n                if (method.isGetter) {\n                    return AstMethod.apply2(\n                        method,\n                        positionalArguments = mutableListOf(),\n                        namedArguments = mutableMapOf()\n                    )\n                }\n                val length = method.parameters.size\n                val thisReference = context.get(ThisReference::class.java)\n                val superReference = context.get(SuperReference::class.java)\n                val innerStack = ProgramStack(\"closure\", programStack)\n                val overrides = mapOf(\n                    ProgramStack::class.java to { innerStack },\n                    AstRuntime::class.java to { runtime },\n                    ThisReference::class.java to { thisReference },\n                    SuperReference::class.java to { superReference })\n                return when (length) {\n                    0 -> {\n                        {\n                            context.run(\n                                name = \"closure override\", body = {\n                                    AstMethod.apply2(\n                                        method,\n                                        positionalArguments = mutableListOf(),\n                                        namedArguments = mutableMapOf()\n                                    )\n                                }, overrides = overrides\n                            )\n                        }\n                    }\n//                        1 -> {\n//                            { a ->\n//                                context.run(\n//                                    name = \"closure override\",\n//                                    body = { AstMethod.apply2(method, listOf(a)) },\n//                                    overrides = overrides\n//                                )\n//                            }\n//                        }\n//                        2 -> {\n//                            { a, b ->\n//                                context.run(\n//                                    name = \"closure override\",\n//                                    body = { AstMethod.apply2(method, listOf(a, b)) },\n//                                    overrides = overrides\n//                                )\n//                            }\n//                        }\n//                        3 -> {\n//                            { a, b, c ->\n//                                context.run(\n//                                    name = \"closure override\",\n//                                    body = { AstMethod.apply2(method, listOf(a, b, c)) },\n//                                    overrides = overrides\n//                                )\n//                            }\n//                        }\n//                        4 -> {\n//                            { a, b, c, d ->\n//                                context.run(\n//                                    name = \"closure override\",\n//                                    body = { AstMethod.apply2(method, listOf(a, b, c, d)) },\n//                                    overrides = overrides\n//                                )\n//                            }\n//                        }\n//                        5 -> {\n//                            { a, b, c, d, e ->\n//                                context.run(\n//                                    name = \"closure override\",\n//                                    body = { AstMethod.apply2(method, listOf(a, b, c, d, e)) },\n//                                    overrides = overrides\n//                                )\n//                            }\n//                        }\n//                        6 -> {\n//                            { a, b, c, d, e, f ->\n//                                context.run(\n//                                    name = \"closure override\",\n//                                    body = { AstMethod.apply2(method, listOf(a, b, c, d, e, f)) },\n//                                    overrides = overrides\n//                                )\n//                            }\n//                        }\n                    else -> {\n                        {\n                            context.run(\n                                name = \"closure override\", body = {\n                                    AstMethod.apply2(\n                                        method,\n                                        positionalArguments = mutableListOf(),\n                                        namedArguments = mutableMapOf()\n                                    )\n                                }, overrides = overrides\n                            )\n                        }\n                    }\n                }\n            } else {\n\n            }\n\n//                val topLevelVariable = runtime.getTopLevelVariable(name)\n//                if (topLevelVariable != null) {\n//                    if (keepVariable) {\n//                        return topLevelVariable\n//                    } else {\n//                        return topLevelVariable.value\n//                    }\n//                }\n//\n            val clazz = AstClass.forName(name)\n            if (clazz != null) {\n                return clazz\n            }\n\n\n            // 1. 通过反射获取 Log 类\n//            val reflectClass = runtime.getReflectClass(name)\n//            if (reflectClass != null) {\n//                val classInstance = Class.forName(reflectClass?.uri)\n//                val methodArgs = ArrayList<String>()\n//                methodArgs.add(\"你好\")\n//                parseKtClass(reflectClass?.uri, \"info\", methodArgs)\n//                if (classInstance != null) {\n//                    return classInstance\n//                }\n//            }\n            return null\n//                val libraryMirror = ReflectionBinding.instance.reflectTopLevelInvoke(name)\n//                if (libraryMirror != null) {\n//                    return libraryMirror.invokeGetter(name)\n//                }\n//\n//                throw \"Should not happen execute Identifier: ${expression.asIdentifier.name}\"\n        } else if (expression.isBlockStatement) {\n            return _executeBlockStatement(expression.asBlockStatement, flag = flag);\n        } else if (expression.isEmptyFunctionBody) {\n            return null\n        } else if (expression.isInstanceCreationExpression) {\n            return executeInstanceCreationExpression(\n                expression.asInstanceCreationExpression\n            );\n        } else if (expression.isPropertyAccess) {\n            // 取值表达式，如demo.test()\n            val propertyAccess = expression.asPropertyAccess\n            var target: Any? = null\n//            if (propertyAccess.isCascaded) {\n//                target = findCascadeAncestorTargetValue(propertyAccess)\n//            } else {\n//                target = executeExpression(propertyAccess.targetExpression!!)\n            target = executeExpression(propertyAccess.targetExpression!!)\n//            }\n            val instance = AstInstance.forObject(target)\n            if (instance != null && !propertyAccess.name.isNullOrEmpty()) {\n                propertyAccess.name?.let {\n                    return instance.invokeGetter(it)\n                }\n            }\n            if (target == null) {\n//                if (propertyAccess.isNullAware) {\n//                    return null\n//                } else {\n//                    throw IllegalArgumentException(\"Null check operator used on a null value\")\n//                }\n            } else {\n\n            }\n        } else if (expression.isVariableDeclarationList) {\n            return _executeVariableDeclaration(expression.asVariableDeclarationList)\n        } else if (expression.isBinaryExpression) {\n            return _executeBinaryExpression(expression.asBinaryExpression);\n        } else if (expression.isReturnStatement) {\n            var result: Any? = null\n            if (expression.asReturnStatement.argument != null) {\n                result = executeExpression(expression.asReturnStatement.argument!!)\n            }\n            returnFlags[flag ?: \"\"] = true\n            return result\n\n        } else if (expression.isIntegerLiteral) {\n            return expression.asIntegerLiteral.value\n        } else if (expression.isMethodInvocation) {\n            //method调用\n            return _exeAndRecMethodInvocation(expression.asMethodInvocation);\n        } else if (expression.isStringTemplateExpression) {\n            //string\n            var result: Any? = null\n            if (expression.asStringTemplateExpression != null && expression.asStringTemplateExpression.target != null) {\n                result = executeExpression(expression.asStringTemplateExpression.target!!)\n                return result\n            }\n            return result\n        } else if (expression.isStringLiteral) {\n            return expression.asIntegerLiteral.value\n        } else if (expression.isStringTemplateEntry) {\n            return expression.asStringTemplateEntry.value\n        } else if (expression.isBooleanLiteral) {\n            return expression.asBooleanLiteral.value\n        } else if (expression.isNamedExpression) {\n            //获取named 参数值\n            val namedExpression = expression.asNamedExpression\n            val mutableMapOf = mutableMapOf<String?, Any?>()\n            mutableMapOf.put(\n                namedExpression.name,\n                executeExpression(namedExpression.argument!!)\n            )\n            return mutableMapOf\n        } else if (expression.isCallExpression) {\n            //callFunction调用\n            val clazz = AstClass.forName(expression.asCallExpression.methodName)\n            if (clazz != null) {\n                return clazz\n            } else {\n                val runtime = context.get<AstRuntime>(AstRuntime::class.java)!!\n                val function = runtime._program.getFunction(expression.asCallExpression.methodName)\n                if (function != null) {\n                    val result = AstMethod.apply2(\n                        function,\n                        expression.asCallExpression.argumentList.arguments ?: emptyList(),\n                        emptyMap(),\n                    )\n                    return result\n                }\n\n                return null\n            }\n        } else {\n            println(\"executeExpression ${expression.type} not implement\")\n        }\n    } catch (e: Exception) {\n//            if (e is DynamicCardException) {\n//                throw e\n//            } else {\n        throw DynamicException.fromExpression(expression, e.toString())\n//            }\n    }\n    return null\n}\n\n\nfun parseKtClass(className: String, methodName: String, methodArgs: List<*>) {\n    // 假设这是从 PSI 解析生成的 Map<String, Any>\n    val parsedMap: Map<String, Any> = mapOf(\n        \"className\" to \"org.example.MyClass\",\n        \"methodName\" to \"myMethod\",\n        \"methodArgs\" to listOf(\"arg1\", \"arg2\")\n    )\n\n//        // 动态加载类并调用方法\n//        val className = parsedMap[\"className\"] as String\n//        val methodName = parsedMap[\"methodName\"] as String\n//        val methodArgs = parsedMap[\"methodArgs\"] as List<*>\n\n    try {\n        // 1. 动态加载类\n        val clazz: Class<*> = Class.forName(className)\n        val kClass: KClass<*> = clazz.kotlin\n\n        // 2. 获取目标方法\n        val memberFunction = kClass.members.find { it.name == methodName }\n            ?: throw NoSuchMethodException(\"No such method: $methodName\")\n\n        // 3. 调用方法\n        if (memberFunction is kotlin.reflect.KFunction<*>) {\n            // 创建实例（如果需要）\n            val instance = if (!clazz.isInterface && !Modifier.isStatic(\n                    memberFunction.javaMethod?.modifiers ?: 0\n                )\n            ) {\n                clazz.getDeclaredConstructor().newInstance()\n            } else {\n                null\n            }\n\n            // 调用方法\n            val messages = arrayOf(\"你好\")\n            val result = memberFunction.call(instance, messages)\n            println(\"Result of $methodName: $result\")\n        } else {\n            throw IllegalArgumentException(\"$methodName is not a callable function\")\n        }\n    } catch (e: Exception) {\n        e.printStackTrace()\n    }\n}\n\n\nclass DynamicException(message: String?) : RuntimeException(message) {\n    var stackTrace = \"\"\n\n    companion object {\n        fun fromExpression(expression: Expression, e: String): Throwable {\n            System.out.println(\"error:\" + e)\n            return DynamicException(message = e)\n        }\n    }\n\n}\n\nfun _executeVariableDeclaration(variableDeclarationList: PropertyStatement): Any? {\n    val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n\n    val variableDeclarator = variableDeclarationList.target\n    // ignore: unnecessary_null_comparison\n//    if (variableDeclarator.init == null) {\n//        // 光定义，没有赋值的场景\n//        programStack.putVariable(variableDeclarator.name, null)\n//        return null // TODO\n//    }\n//    if (variableDeclarator.init!!.isAwaitExpression) {\n//        //await expression;\n//        val value = _exeAndRecMethodInvocation(variableDeclarator.init!!.asAwaitExpression.expression)\n//        programStack.putVariable(variableDeclarator.name, value)\n//    } else if (variableDeclarator.init!!.isMethodInvocation) {\n//        val value = _exeAndRecMethodInvocation(variableDeclarator.init!!.asMethodInvocation)\n//        //存入声明的初始化变量值\n//        programStack.putVariable(variableDeclarator.name, value)\n//    } else {\n//        //存入声明的初始化变量值\n    val value = executeExpression(variableDeclarator!!)\n    programStack.putVariable(variableDeclarationList.name, value)\n//    }\n    return null\n}\n//fun findCascadeAncestorTargetValue(child: Node): Any? {\n//    fun helper(node: Node?): Any? {\n//        return when {\n//            node == null -> null\n//            node is CascadeExpression -> node.targetValue\n//            else -> helper(node.parent)\n//        }\n//    }\n//    return helper(child)\n//}\n\n\nfun _executeBinaryExpression(binaryExpression: BinaryExpression): Any? {\n    val evalLeft = executeExpression(binaryExpression.left)\n    val evalRight = executeExpression(binaryExpression.right)\n    val operator = binaryExpression.operator\n    if (evalLeft is String || evalRight is String) {\n        return when (operator) {\n            \"+\" -> \"$evalLeft$evalRight\"\n            else -> throw UnimplementedError(\"operator Int ${binaryExpression.operator}\")\n        }\n    }\n    if (evalLeft is Int && evalRight is Int) {\n        return when (operator) {\n            \"+\" -> evalLeft + evalRight\n            \"-\" -> evalLeft - evalRight\n            \"*\" -> evalLeft * evalRight\n            \"/\" -> evalLeft / evalRight\n            \"<\" -> evalLeft < evalRight\n            \">\" -> evalLeft > evalRight\n            \"<=\" -> evalLeft <= evalRight\n            \">=\" -> evalLeft >= evalRight\n            \"==\" -> evalLeft == evalRight\n            \"%\" -> evalLeft % evalRight\n            \"<<\" -> evalLeft shl evalRight\n            \"|\" -> evalLeft or evalRight\n            \"&\" -> evalLeft and evalRight\n            \">>\" -> evalLeft shr evalRight\n            \"!=\" -> evalLeft != evalRight\n            \"/\" -> evalLeft / evalRight\n            else -> throw UnimplementedError(\"operator Int ${binaryExpression.operator}\")\n        }\n    }\n\n    if (evalLeft is Boolean && evalRight is Boolean) {\n        return when (operator) {\n            \"&&\" -> evalLeft && evalRight\n            \"||\" -> evalLeft || evalRight\n            else -> throw UnimplementedError(\"operator Boolean ${binaryExpression.operator}\")\n        }\n    }\n    return null\n}\n\n\nval returnFlags: MutableMap<String, Boolean> = mutableMapOf()\nfun _executeBlockStatement(block: BlockStatement, flag: String? = null): Any? {\n    var flagTemp = flag\n    if (flag == null) {\n        flagTemp = UUID.randomUUID().toString()\n    }\n    val programStack = context.get<ProgramStack>(ProgramStack::class.java)\n\n    programStack?.push(name = \"Block statement\")\n    var result: Any? = null\n    if (block.body?.isNotEmpty() == true) {\n        for (expression in block.body!!) {\n            if (returnFlags[flag] == true) {\n                returnFlags.remove(flagTemp)\n                break\n            }\n            result = executeExpression(expression, flag = flagTemp)\n        }\n    }\n    programStack?.pop()\n    return result\n}\n\n\nclass AstRuntime(val _program: ProgramNode) {\n\n    public var programStack: ProgramStack? = null\n\n    init {\n        // 创建并初始化 ProxyBinding 实例\n        val proxyBinding = ProxyBinding()\n        proxyBinding.initInstances()\n        this.programStack = ProgramStack(\"root stack:${_program.compilation.toUnit()[\"source\"]}\")\n    }\n\n    fun invoke2(memberName: String): AstMethod? {\n        val function = _program.getFunction(memberName)\n        return function\n    }\n\n    val classes: List<AstClass>\n        get() {\n            return context.run(\n                name = \"AstRuntime\",\n                body = {\n                    _program.classes\n                },\n                overrides = mapOf(\n                    ProgramStack::class.java to { programStack },\n                    AstRuntime::class.java to { this }\n                )\n            ) as List<AstClass>\n        }\n\n\n    fun getClass(className: String): AstClass? {\n        return context.run(\n            name = \"AstRuntime\",\n            body = {\n                _program?.getClass(className)\n            },\n            overrides = mapOf(\n                ProgramStack::class.java to { programStack },\n                AstRuntime::class.java to { this }\n            )\n        ) as AstClass?\n    }\n\n    fun getReflectClass(className: String): ImportDirective? {\n        return _program?.getReflectClass(className)\n    }\n\n    fun invoke2(\n        memberName: String,\n        positionalArguments: List<Any?>? = null,\n        namedArguments: Map<String, Any?>? = null\n    ): Any? {\n        return context.run(\n            name = \"Invoke top-level function or variables\",\n            body = {\n                val function = _program?.getFunction(memberName)\n                if (function != null) {\n                    context.run(name = \"\", body = {\n                        val result = AstMethod.apply2(\n                            function, positionalArguments ?: emptyList(), namedArguments\n                        )\n                        if (result is Variable) {\n                            return@run result.value\n                        }\n                        invokeRunMain(result)\n                        return@run result\n                    }, overrides = mapOf(ProgramNode::class.java to { function.programNode }))\n                } else {\n                    null\n                }\n            },\n            overrides = mapOf(\n                ProgramStack::class.java to { programStack },\n                AstRuntime::class.java to { this })\n        )\n    }\n\n\n    fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>? = null,\n        namedArguments: Map<String, Any?>? = null\n    ): Any? {\n        return context.run(\n            name = \"Invoke top-level function or variables\",\n            body = {\n                val function = _program?.getFunction(memberName)\n                if (function != null) {\n                    context.run(name = \"\", body = {\n                        val result = AstMethod.apply2(\n                            function, positionalArguments ?: emptyList(), namedArguments\n                        )\n                        if (result is Variable) {\n                            return@run result.value\n                        }\n                        return@run result\n                    }, overrides = mapOf(ProgramNode::class.java to { function.programNode }))\n                } else {\n                    null\n                }\n            },\n            overrides = mapOf(\n                ProgramStack::class.java to { programStack },\n                AstRuntime::class.java to { this })\n        )\n    }\n\n    class LocalJson(val json: String) : ProgramEntity() {\n\n        override val exists: Boolean\n            get() = !TextUtils.isEmpty(json)\n        val walker = ProgramDependencyWalker();\n        override fun createNode(): ProgramNode {\n            val transformMap = transformMap(json)\n            val node = walker.getNode(this, CompilationUnit.fromUnit(transformMap))\n            return node\n        }\n\n        fun transformMap(json: String): Map<String, Any> {\n            try {\n                // 序列化 Map 对象为 JSON 字符串\n                val objectMapper = ObjectMapper()\n                // 禁用 FAIL_ON_EMPTY_BEANS 特性\n                objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);\n\n                // 反序列化 JSON 字符串为 Map 对象\n                @Suppress(\"UNCHECKED_CAST\")\n                val deserializedMap =\n                    objectMapper.readValue(json, HashMap::class.java) as Map<String, Any>\n                println(\"Deserialized Map: $deserializedMap\")\n                return deserializedMap\n            } catch (e: java.lang.Exception) {\n                e.printStackTrace()\n            }\n            return emptyMap()\n        }\n\n        fun getClassFilePath(clazz: Class<*>): String? {\n            // 尝试从保护域获取类文件的位置\n            clazz.protectionDomain?.codeSource?.location?.let {\n                return try {\n                    // 如果是文件形式存在，则返回其路径\n                    it.toURI().path\n                } catch (e: Exception) {\n                    e.printStackTrace()\n                    null\n                }\n            }\n\n            // 尝试通过类加载器获取资源路径\n            val resource = clazz.name.replace('.', '/') + \".class\"\n            val resourcePath = clazz.classLoader.getResource(resource)?.toURI()?.path\n            if (resourcePath != null && resourcePath.endsWith(\".jar\")) {\n                // 如果是在JAR内，则返回JAR文件路径\n                return resourcePath\n            }\n\n            return resourcePath?.removeSuffix(\".class\")\n        }\n\n        fun convertClassToPath(fullClassName: String): String {\n            return \"src/test/java/\" + fullClassName.replace('.', '/') + \".kt\"\n        }\n\n        override fun getRelativeEntity(uri: String): ProgramEntity {\n            // 获取文件的目录路径\n//            val basePath = File(convertClassToPath(uri)).parentFile?.absolutePath\n//                ?: throw IllegalArgumentException(\"Invalid base file path\")\n            return LocalFile(File(convertClassToPath(uri)))\n        }\n\n        private fun createCoreEnvironment(): KotlinCoreEnvironment {\n            val disposable = Disposer.newDisposable()\n            return KotlinCoreEnvironment.createForProduction(\n                disposable,\n                ProjectHelper.getConfiguration(),\n                EnvironmentConfigFiles.JVM_CONFIG_FILES\n            )\n        }\n\n        fun parseKotlinCode(content: String, fileName: String = \"DummyFile.kt\"): KtFile {\n            val project: Project = createCoreEnvironment().project\n            val psiFileFactory = PsiFileFactory.getInstance(project)\n            return psiFileFactory.createFileFromText(fileName, content) as KtFile\n        }\n\n    }\n\n    class GeneraJson(val file: File) {\n\n        fun createNodeToJson(): String? {\n            val ktFile = parseKotlinCode(file.readText())\n            val visitor = MyKtVisitorV2()\n            ktFile.accept(visitor)\n            val unit = visitor.getResult()\n            val json = transformJson(unit)\n            return json\n        }\n\n        private fun transformJson(unit: Map<String, Any>): String? {\n            try {\n                // 序列化 Map 对象为 JSON 字符串\n                val objectMapper = ObjectMapper()\n                // 禁用 FAIL_ON_EMPTY_BEANS 特性\n                objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);\n                val json: String? = objectMapper.writeValueAsString(unit)\n\n                // 输出 JSON 字符串\n                println(json)\n                return json\n            } catch (e: java.lang.Exception) {\n                e.printStackTrace()\n            }\n            return null\n        }\n\n        private fun transformMap(json: String): Map<String, Any> {\n            try {\n                // 序列化 Map 对象为 JSON 字符串\n                val objectMapper = ObjectMapper()\n                // 禁用 FAIL_ON_EMPTY_BEANS 特性\n                objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);\n\n                // 反序列化 JSON 字符串为 Map 对象\n                @Suppress(\"UNCHECKED_CAST\")\n                val deserializedMap =\n                    objectMapper.readValue(json, HashMap::class.java) as Map<String, Any>\n                println(\"Deserialized Map: $deserializedMap\")\n                return deserializedMap\n            } catch (e: java.lang.Exception) {\n                e.printStackTrace()\n            }\n            return emptyMap()\n        }\n\n        private fun createCoreEnvironment(): KotlinCoreEnvironment {\n            val disposable = Disposer.newDisposable()\n            return KotlinCoreEnvironment.createForProduction(\n                disposable,\n                ProjectHelper.getConfiguration(),\n                EnvironmentConfigFiles.JVM_CONFIG_FILES\n            )\n        }\n\n        fun parseKotlinCode(content: String, fileName: String = \"DummyFile.kt\"): KtFile {\n            val project: Project = createCoreEnvironment().project\n            val psiFileFactory = PsiFileFactory.getInstance(project)\n            return psiFileFactory.createFileFromText(fileName, content) as KtFile\n        }\n\n    }\n\n    class LocalFile(val file: File) : ProgramEntity() {\n\n        override val exists: Boolean\n            get() = file.exists()\n        val walker = ProgramDependencyWalker();\n        override fun createNode(): ProgramNode {\n            val ktFile = parseKotlinCode(file.readText())\n            val visitor = MyKtVisitorV2()\n            ktFile.accept(visitor)\n//            val unit = visitor.getResult()\n            val transformMap = transformMap(getDefaultJson())\n            val node = walker.getNode(this, CompilationUnit.fromUnit(transformMap))\n            return node\n        }\n\n        private fun transformJson(unit: Map<String, Any>) {\n            try {\n                // 序列化 Map 对象为 JSON 字符串\n                val objectMapper = ObjectMapper()\n                // 禁用 FAIL_ON_EMPTY_BEANS 特性\n                objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);\n                val json: String? = objectMapper.writeValueAsString(unit)\n\n                // 输出 JSON 字符串\n                println(json)\n\n                // 反序列化 JSON 字符串为 Map 对象\n                @Suppress(\"UNCHECKED_CAST\")\n                val deserializedMap =\n                    objectMapper.readValue(json, HashMap::class.java) as Map<String, Any>\n                println(\"Deserialized Map: $deserializedMap\")\n            } catch (e: java.lang.Exception) {\n                e.printStackTrace()\n            }\n        }\n\n        fun transformMap(json: String): Map<String, Any> {\n            try {\n                // 序列化 Map 对象为 JSON 字符串\n                val objectMapper = ObjectMapper()\n                // 禁用 FAIL_ON_EMPTY_BEANS 特性\n                objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);\n\n                // 反序列化 JSON 字符串为 Map 对象\n                @Suppress(\"UNCHECKED_CAST\")\n                val deserializedMap =\n                    objectMapper.readValue(json, HashMap::class.java) as Map<String, Any>\n                println(\"Deserialized Map: $deserializedMap\")\n                return deserializedMap\n            } catch (e: java.lang.Exception) {\n                e.printStackTrace()\n            }\n            return emptyMap()\n        }\n\n        fun getDefaultJson(): String {\n            return \"{\\n\" +\n                    \"  \\\"directives\\\" : [ ],\\n\" +\n                    \"  \\\"declarations\\\" : [ {\\n\" +\n                    \"    \\\"type\\\" : \\\"ClassDeclaration\\\",\\n\" +\n                    \"    \\\"name\\\" : \\\"DemoEmptyFunctionExpress\\\",\\n\" +\n                    \"    \\\"members\\\" : [ {\\n\" +\n                    \"      \\\"type\\\" : \\\"MethodDeclaration\\\",\\n\" +\n                    \"      \\\"name\\\" : \\\"test2\\\",\\n\" +\n                    \"      \\\"parameters\\\" : [ {\\n\" +\n                    \"        \\\"type\\\" : \\\"SimpleFormalParameter\\\",\\n\" +\n                    \"        \\\"name\\\" : \\\"index\\\",\\n\" +\n                    \"        \\\"typeName\\\" : \\\"Int\\\"\\n\" +\n                    \"      }, {\\n\" +\n                    \"        \\\"type\\\" : \\\"SimpleFormalParameter\\\",\\n\" +\n                    \"        \\\"name\\\" : \\\"item\\\",\\n\" +\n                    \"        \\\"typeName\\\" : \\\"String\\\"\\n\" +\n                    \"      } ],\\n\" +\n                    \"      \\\"typeParameters\\\" : [ ],\\n\" +\n                    \"      \\\"body\\\" : {\\n\" +\n                    \"        \\\"type\\\" : \\\"BlockStatement\\\",\\n\" +\n                    \"        \\\"body\\\" : [ {\\n\" +\n                    \"          \\\"type\\\" : \\\"PropertyStatement\\\",\\n\" +\n                    \"          \\\"name\\\" : \\\"a\\\",\\n\" +\n                    \"          \\\"initializer\\\" : {\\n\" +\n                    \"            \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n                    \"            \\\"value\\\" : \\\"2\\\",\\n\" +\n                    \"            \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n                    \"          }\\n\" +\n                    \"        }, {\\n\" +\n                    \"          \\\"type\\\" : \\\"PropertyStatement\\\",\\n\" +\n                    \"          \\\"name\\\" : \\\"b\\\",\\n\" +\n                    \"          \\\"initializer\\\" : {\\n\" +\n                    \"            \\\"type\\\" : \\\"BinaryExpression\\\",\\n\" +\n                    \"            \\\"name\\\" : null,\\n\" +\n                    \"            \\\"operator\\\" : \\\"+\\\",\\n\" +\n                    \"            \\\"left\\\" : {\\n\" +\n                    \"              \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n                    \"              \\\"value\\\" : \\\"2\\\",\\n\" +\n                    \"              \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n                    \"            },\\n\" +\n                    \"            \\\"right\\\" : {\\n\" +\n                    \"              \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n                    \"              \\\"name\\\" : \\\"index\\\"\\n\" +\n                    \"            }\\n\" +\n                    \"          }\\n\" +\n                    \"        }, {\\n\" +\n                    \"          \\\"type\\\" : \\\"ReturnStatement\\\",\\n\" +\n                    \"          \\\"argument\\\" : {\\n\" +\n                    \"            \\\"type\\\" : \\\"BinaryExpression\\\",\\n\" +\n                    \"            \\\"name\\\" : null,\\n\" +\n                    \"            \\\"operator\\\" : \\\"*\\\",\\n\" +\n                    \"            \\\"left\\\" : {\\n\" +\n                    \"              \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n                    \"              \\\"name\\\" : \\\"a\\\"\\n\" +\n                    \"            },\\n\" +\n                    \"            \\\"right\\\" : {\\n\" +\n                    \"              \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n                    \"              \\\"name\\\" : \\\"b\\\"\\n\" +\n                    \"            }\\n\" +\n                    \"          }\\n\" +\n                    \"        } ]\\n\" +\n                    \"      },\\n\" +\n                    \"      \\\"isStatic\\\" : true,\\n\" +\n                    \"      \\\"isGetter\\\" : false,\\n\" +\n                    \"      \\\"isSetter\\\" : false\\n\" +\n                    \"    } ],\\n\" +\n                    \"    \\\"body\\\" : { }\\n\" +\n                    \"  } ],\\n\" +\n                    \"  \\\"type\\\" : \\\"CompilationUnit\\\"\\n\" +\n                    \"}\"\n        }\n\n        fun getClassFilePath(clazz: Class<*>): String? {\n            // 尝试从保护域获取类文件的位置\n            clazz.protectionDomain?.codeSource?.location?.let {\n                return try {\n                    // 如果是文件形式存在，则返回其路径\n                    it.toURI().path\n                } catch (e: Exception) {\n                    e.printStackTrace()\n                    null\n                }\n            }\n\n            // 尝试通过类加载器获取资源路径\n            val resource = clazz.name.replace('.', '/') + \".class\"\n            val resourcePath = clazz.classLoader.getResource(resource)?.toURI()?.path\n            if (resourcePath != null && resourcePath.endsWith(\".jar\")) {\n                // 如果是在JAR内，则返回JAR文件路径\n                return resourcePath\n            }\n\n            return resourcePath?.removeSuffix(\".class\")\n        }\n\n        fun convertClassToPath(fullClassName: String): String {\n            return \"src/test/java/\" + fullClassName.replace('.', '/') + \".kt\"\n        }\n\n        override fun getRelativeEntity(uri: String): ProgramEntity {\n            // 获取文件的目录路径\n//            val basePath = File(convertClassToPath(uri)).parentFile?.absolutePath\n//                ?: throw IllegalArgumentException(\"Invalid base file path\")\n            return LocalFile(File(convertClassToPath(uri)))\n        }\n\n        private fun createCoreEnvironment(): KotlinCoreEnvironment {\n            val disposable = Disposer.newDisposable()\n            return KotlinCoreEnvironment.createForProduction(\n                disposable,\n                ProjectHelper.getConfiguration(),\n                EnvironmentConfigFiles.JVM_CONFIG_FILES\n            )\n        }\n\n        fun parseKotlinCode(content: String, fileName: String = \"DummyFile.kt\"): KtFile {\n            val project: Project = createCoreEnvironment().project\n            val psiFileFactory = PsiFileFactory.getInstance(project)\n            return psiFileFactory.createFileFromText(fileName, content) as KtFile\n        }\n\n    }\n\n    class ProgramDependencyWalker {\n        val nodeMap = mutableMapOf<ProgramEntity, ProgramNode>()\n\n        fun evaluate(node: ProgramNode) {\n            node.evaluate()\n        }\n\n        fun evaluateScc(scc: List<ProgramNode>) {\n            for (node in scc) {\n                node.markCircular()\n            }\n        }\n\n        fun getNode(entity: ProgramEntity, compilation: CompilationUnit): ProgramNode {\n            val programNode = nodeMap.getOrPut(entity) { ProgramNode(entity, this, compilation) }\n            programNode.dependencies = programNode.computeDependencies()\n            return programNode\n        }\n    }\n\n    // Assuming the ProgramNode class has these methods:\n    class ProgramNode(\n        val entity: ProgramEntity,\n        val walker: ProgramDependencyWalker,\n        val compilation: CompilationUnit\n    ) {\n        var _classDeclarations: Map<String, ClassDeclaration>? = null\n        var _methodDeclarations: Map<String, MethodDeclaration>? = null\n        var _variableDeclarators: Map<String, VariableDeclarator>? = null\n\n        private val _classes: MutableMap<String, AstClass> = mutableMapOf()\n        private val _functions: MutableMap<String, AstMethod> = mutableMapOf()\n        private val _topLevelVariables: MutableMap<String, AstVariable> = mutableMapOf()\n        var dependencies: List<ProgramNode> = emptyList()\n        var data: MutableMap<String, ImportDirective> = mutableMapOf()\n        fun evaluate() {\n            // Implement the evaluation logic here\n            TODO(\"Implement evaluate for ProgramNode\")\n        }\n\n        fun markCircular() {\n            // Implement the circular marking logic here\n            TODO(\"Implement markCircular for ProgramNode\")\n        }\n\n        private val methodDeclarations: Map<String, MethodDeclaration>?\n            get() {\n                if (_methodDeclarations == null) {\n//                    val result = mutableMapOf<String, FunctionDeclaration>()\n//                    compilation.declarations\n//                        ?.filterIsInstance<FunctionDeclaration>()\n//                        ?.forEach { declaration ->\n//                            result[declaration.name] = declaration\n//                        }\n//                    _functionDeclarations = result\n                    val result = mutableMapOf<String, MethodDeclaration>()\n                    compilation.declarations?.forEach {\n                        (it.get() as ClassDeclaration).members?.forEach { declaration ->\n                            if (declaration.get() is MethodDeclaration) {\n                                result[((declaration?.get() as MethodDeclaration).name ?: \"\")] =\n                                    declaration.get() as MethodDeclaration\n                                _methodDeclarations = result\n                            }\n                        }\n                    }\n                }\n\n                return _methodDeclarations\n            }\n\n\n        val classes: List<AstClass>\n            get() = compilation.declarations?.filter { it.isClassDeclaration }\n                ?.map { it.asClassDeclaration }\n                ?.mapNotNull { getClass(it.name) }\n                ?.toList() ?: emptyList()\n\n        fun ensureClassDeclarations() {\n            var classDeclarations = _classDeclarations\n            if (classDeclarations == null) {\n                val result = mutableMapOf<String, ClassDeclaration>()\n                compilation.declarations\n                    ?.filter { it.isClassDeclaration }\n                    ?.map { it.asClassDeclaration }\n                    ?.forEach { declaration ->\n                        result[declaration.name] = declaration\n                    }\n                _classDeclarations = result.unmodifiable()\n            }\n        }\n\n        fun getReflectClass(className: String, recursive: Boolean = true): ImportDirective? {\n            val importDirective = data[className]\n            return importDirective\n        }\n\n\n        fun getClass(className: String, recursive: Boolean = true): AstClass? {\n            ensureClassDeclarations()\n            _classes[className]?.let { return it }\n            _classDeclarations?.get(className)?.let {\n                val clazz = AstClass.fromClass(it, this)\n                _classes[className] = clazz\n                return clazz\n            }\n            if (!recursive) return null\n            dependencies.forEach {\n                it.getClass(className, recursive = false)?.let { clazz -> return clazz }\n            }\n            return null\n        }\n\n        fun <K, V> Map<K, V>.unmodifiable(): Map<K, V> {\n            return Collections.unmodifiableMap(this)\n        }\n\n\n        // 获取函数声明\n        fun getFunction(functionName: String, recursive: Boolean = true): AstMethod? {\n            val functions = methodDeclarations\n            if (functions != null && functions.containsKey(functionName)) {\n                val functionDeclaration = functions[functionName]\n                if (functionDeclaration != null) {\n                    return AstMethod.fromFunction(functionDeclaration, this)\n                }\n            }\n            if (!recursive) {\n                return null\n            }\n\n            for (dependency in dependencies) {\n                val function = dependency.getFunction(functionName, recursive = false)\n                if (function != null) {\n                    return function\n                }\n            }\n\n            return null\n        }\n\n        private fun _visitNode(\n            entity: ProgramEntity,\n            dependencies: MutableSet<ProgramNode>,\n            node: ProgramNode\n        ) {\n            for (directive in node.compilation.directives!!) {\n                when (directive) {\n                    is ImportDirective -> {\n                        val import = Import(directive.uri, \"\", null)\n                        val newEntity = entity.getRelativeEntity(import.uri)\n                        val newNode = walker.nodeMap[newEntity] ?: run {\n                            if (newEntity.exists) {\n                                val newNode = newEntity.createNode()\n                                walker.nodeMap.putIfAbsent(newEntity, newNode)\n                                newNode\n                            } else null\n                        }\n\n                        if (newNode != null) {\n                            if (!dependencies.contains(newNode)) {\n                                dependencies.add(newNode)\n                                _visitNode(newEntity, dependencies, newNode)\n                            }\n                        } else {\n                            //反射\n                            data[directive.name] = directive\n                        }\n                    }\n//                    is PartDirective -> {\n//                        val newEntity = entity.getRelativeEntity(directive.uri)\n//                        val newNode = walker.nodeMap[newEntity] ?: run {\n//                            if (newEntity.exists) {\n//                                val newNode = newEntity.createNode()\n//                                walker.nodeMap.putIfAbsent(newEntity, newNode)\n//                                newNode\n//                            } else null\n//                        }\n//                        newNode?.let {\n//                            if (!dependencies.contains(it)) {\n//                                dependencies.add(it)\n//                                _visitNode(newEntity, dependencies, it)\n//                            }\n//                        }\n//                    }\n                }\n            }\n        }\n\n        fun computeDependencies(): List<ProgramNode> {\n            val dependencies = mutableSetOf<ProgramNode>()\n            _visitNode(entity, dependencies, this)\n            return dependencies.toList()\n        }\n\n    }\n\n    abstract class ProgramEntity {\n        abstract val exists: Boolean\n\n        abstract fun createNode(): ProgramNode\n\n        abstract fun getRelativeEntity(uri: String): ProgramEntity\n    }\n\n    //    class ProgramNode(\n//        private val walker: ProgramDependencyWalker,\n//        private val compilation: CompilationUnit,\n//        private val entity: ProgramEntity\n//    ){\n//\n////        private var imports: List<Import>? = null\n//\n////        val importsList: List<Import>\n////            get() {\n////                if (imports == null) {\n////                    imports = compilation.directives\n////                        .filterIsInstance<ImportDirective>()\n////                        .map { directive ->\n////                            Import(directive.uri, directive.prefix, _getCombinators(directive))\n////                        }\n////                        .toList()\n////                }\n////                return imports!!\n////            }\n//\n//        var isEvaluated: Boolean = false\n//\n////        val dependencies: List<ProgramNode>\n////            get() = if (isRecursive) super.getDependencies(this) else emptyList()\n//\n//        var isRecursive: Boolean = true\n//\n\n    //\n//        private fun _evaluate() {\n//            isEvaluated = true\n//        }\n//\n//        private fun _markCircular() {\n//            isEvaluated = true\n//        }\n//\n//        private var classDeclarations: MutableMap<String, ClassDeclaration>? = null\n//        private var functionDeclarations: MutableMap<String, FunctionDeclaration>? = null\n//        private var variableDeclarators: MutableMap<String, VariableDeclarator>? = null\n//\n//        fun ensureClassDeclarations() {\n//            var classDeclarations = this.classDeclarations\n//            if (classDeclarations == null) {\n//                val result = mutableMapOf<String, ClassDeclaration>()\n//                compilation.declarations\n//                    .filterIsInstance<ClassDeclaration>()\n//                    .forEach { declaration ->\n//                        result[declaration.name] = declaration\n//                    }\n//                classDeclarations = this.classDeclarations =\n//                    Collections.unmodifiableMap(result)\n//            }\n//        }\n//\n//        private val classes = mutableMapOf<String, AstClass>()\n//        private val functions = mutableMapOf<String, AstMethod>()\n//        private val topLevelVariables = mutableMapOf<String, AstVariable>()\n//\n////        val classesList: List<AstClass>\n////            get() = compilation.declarations\n////                .filterIsInstance<ClassDeclaration>()\n////                .map { declaration ->\n////                    getClass(declaration.name, recursive = false)!!\n////                }\n//\n////        fun getClass(className: String, recursive: Boolean = true): AstClass? {\n////            ensureClassDeclarations()\n////            if (classes.containsKey(className)) {\n////                return classes[className]\n////            }\n////            val classDecl = classDeclarations?.get(className)\n////            if (classDecl != null) {\n////                val clazz = AstClass.fromClass(classDecl, this)\n////                classes[className] = clazz\n////                return clazz\n////            }\n////            if (!recursive) return null\n////\n////            for (dependency in dependencies) {\n////                val clazz = dependency.getClass(className, recursive = false)\n////                if (clazz != null) return clazz\n////            }\n////            return null\n////        }\n//\n//        fun getFunction(functionName: String, recursive: Boolean = true): AstMethod? {\n//            var functions = this.functionDeclarations\n//            if (functions == null) {\n//                val result = mutableMapOf<String, FunctionDeclaration>()\n//                compilation.declarations\n//                    .filterIsInstance<FunctionDeclaration>()\n//                    .forEach { declaration ->\n//                        result[declaration.name] = declaration\n//                    }\n//                functions = this.functionDeclarations =\n//                    Collections.unmodifiableMap(result)\n//            }\n//            functions?.get(functionName)?.let {\n//                return AstMethod.fromFunction(it, this)\n//            }\n//            if (!recursive) return null\n//\n//            for (dependency in dependencies) {\n//                val function = dependency.getFunction(functionName, recursive = false)\n//                if (function != null) return function\n//            }\n//            return null\n//        }\n//\n//        private val topLevel = mutableMapOf<String, Variable>()\n//\n//        fun getTopLevelVariable(variableName: String, recursive: Boolean = true): Variable? {\n//            var topLevelVariables = this.variableDeclarators\n//            if (topLevelVariables == null) {\n//                val result = mutableMapOf<String, VariableDeclarator>()\n//                compilation.declarations\n//                    .filterIsInstance<TopLevelVariableDeclaration>()\n//                    .forEach { declaration ->\n//                        declaration.variables.declarationList.forEach { declarator ->\n//                            result[declarator.name] = declarator\n//                        }\n//                    }\n//                topLevelVariables = this.variableDeclarators =\n//                    Collections.unmodifiableMap(result)\n//            }\n//            topLevelVariables?.get(variableName)?.let {\n//                val variable = AstVariable.fromDeclarator(it)\n//                return topLevel.computeIfAbsent(variableName) {\n//                    Variable.lazily(variableName) {\n//                        if (variable.initializer != null) {\n//                            val programStack = context.get<ProgramStack>()!!\n//                            programStack.push(name = \"Top-Level variable initializer\")\n//                            try {\n//                                executeExpression(variable.initializer)\n//                            } finally {\n//                                programStack.pop()\n//                            }\n//                        }\n//                    }\n//                }\n//            }\n//            if (!recursive) return null\n//\n//            for (dependency in dependencies) {\n//                val topLevelVariable = dependency.getTopLevelVariable(variableName, recursive = false)\n//                if (topLevelVariable != null) return topLevelVariable\n//            }\n//            return null\n//        }\n//\n//        // Helper methods and properties that need to be implemented or mapped to Kotlin equivalents\n//        private fun _getCombinators(directive: ImportDirective): List<String> {\n//            // Implementation of _getCombinators\n//            TODO(\"Implement _getCombinators\")\n//        }\n//\n////        private fun isPlatformUri(uri: Uri): Boolean {\n////            // Implementation of isPlatformUri\n////            TODO(\"Implement isPlatformUri\")\n////        }\n//\n//        private fun executeExpression(expression: Expression): Any? {\n//            // Implementation of executeExpression\n//            TODO(\"Implement executeExpression\")\n//        }\n//\n//        companion object {\n//            // Context or other static members can be placed here if needed\n//        }\n//    }\n//\n    open fun executeExpression(\n        expression: KtExpression, flag: String? = null, keepVariable: Boolean = false\n    ): Any? {\n        return try {\n//            val programStack = context.get<ProgramStack>() ?: throw IllegalStateException(\"ProgramStack not found in context\")\n//            if (expression.isIdentifier) {\n//\n//            } else if (expression.isStringLiteral) {\n//                //string\n//                return expression?.asStringLiteral()?.value;\n//            } else {\n//                println(\"executeExpression ${expression::class.simpleName} not implemented\")\n//            }\n\n\n        } catch (e: Exception) {\n            return null\n        }\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/ClassMirror.kt",
    "content": "package com.aether.core.runtime\n\nimport androidx.compose.runtime.Composable\nimport com.aether.core.runtime.reflectable.ClassMirror\nimport com.aether.core.runtime.reflectable.ClassMirrorBase\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor2\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport org.jetbrains.kotlin.builtins.StandardNames.FqNames.kProperty\nimport java.lang.reflect.Modifier\nimport kotlin.reflect.KCallable\nimport kotlin.reflect.KClass\nimport kotlin.reflect.KFunction\nimport kotlin.reflect.KMutableProperty\nimport kotlin.reflect.KParameter\nimport kotlin.reflect.KProperty\nimport kotlin.reflect.KType\nimport kotlin.reflect.jvm.isAccessible\nimport kotlin.reflect.jvm.javaMethod\n\n\nclass _ClassMirror(\n    private val classMirror: ClassMirrorBase,\n    private val _name: String,\n    override val superclass: AstClass?,\n    private val _staticFields: Map<String, _VariableImpl>,\n    private val _staticGetters: Map<String, AstMethod>,\n    private val _staticSetters: Map<String, AstMethod>,\n    val _instanceFields: Map<String, _VariableImpl>,\n    val _instanceGetters: Map<String, _MethodImpl>,\n    val _instanceSetters: Map<String, _MethodImpl>,\n    private val _constructors: Map<String, _ConstructorImpl>,\n//    private val _node: ClassDeclaration,\n    override val programNode: AstRuntime.ProgramNode\n) : AstObject, AstClass() {\n    companion object {\n\n        fun fromMirror(mirror: ClassMirrorBase, programNode: AstRuntime.ProgramNode): _ClassMirror {\n            var staticFields: Map<String, _VariableImpl> = HashMap<String, _VariableImpl>()\n            val staticGetters: HashMap<String, AstMethod> = HashMap<String, AstMethod>()\n            val staticSetters: HashMap<String, AstMethod> = HashMap<String, AstMethod>()\n            val instanceFields: Map<String, _VariableImpl> = mapOf<String, _VariableImpl>()\n            val instanceGetters: Map<String, _MethodImpl> = mapOf<String, _MethodImpl>()\n            val instanceSetters: Map<String, _MethodImpl> = mapOf<String, _MethodImpl>()\n            val constructors: Map<String, _ConstructorImpl> = mapOf<String, _ConstructorImpl>()\n\n            return _ClassMirror(\n                mirror,\n                _name = mirror.simpleName ?: \"\",\n                superclass = null,\n                _staticFields = staticFields,\n                _staticGetters = staticGetters,\n                _staticSetters = staticSetters,\n                _instanceFields = instanceFields,\n                _instanceGetters = instanceGetters,\n                _instanceSetters = instanceSetters,\n                _constructors = constructors,\n                programNode = programNode,\n            );\n        }\n    }\n\n    private var _declarations: Map<String, AstDeclaration>? = null\n    private var _staticMembers: Map<String, AstMethod>? = null\n    private var _instanceMembers: Map<String, AstMethod>? = null\n    override val isAbstract: Boolean\n        get() = TODO(\"Not yet implemented\")\n\n    override val declarations: Map<String, AstDeclaration>\n        get() = _declarations ?: run {\n            val result = mutableMapOf<String, AstDeclaration>()\n//            kClass.members.forEach { member ->\n//                when (member) {\n//                    is kotlin.reflect.KFunction -> result[member.name] =\n//                        AstMethod.fromMirror(member)\n//                    is kotlin.reflect.KProperty<*> -> result[member.name] =\n//                        AstVariable.fromKCallable(member)\n//                }\n//            }\n            result.toMap().also { _declarations = it }\n        }\n    override val instanceFields: Map<String, AstVariable>\n        get() = TODO(\"Not yet implemented\")\n    override val instanceGetters: Map<String, AstMethod>\n        get() = TODO(\"Not yet implemented\")\n    override val instanceSetters: Map<String, AstMethod>\n        get() = TODO(\"Not yet implemented\")\n    override val staticFields: Map<String, AstVariable>\n        get() = TODO(\"Not yet implemented\")\n    override val staticGetters: Map<String, AstMethod>\n        get() = _staticMembers ?: run {\n            val result = mutableMapOf<String, AstMethod>()\n            classMirror.staticMembers.forEach { simpleName, member ->\n                result[simpleName] = AstMethod.fromMirror(member)\n            }\n            result.toMap().also { _staticMembers = it }\n        }\n    override val staticSetters: Map<String, AstMethod>\n        get() = TODO(\"Not yet implemented\")\n\n    override fun newInstance(\n        constructorName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        return classMirror.invoke(constructorName, positionalArguments, namedArguments)\n    }\n\n    override fun isSubclassOf(other: AstClass): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasConstructor(constructorName: String): Boolean {\n        return false\n    }\n\n    override val simpleName: String\n        get() = _name\n    override val qualifiedName: String\n        get() = _name\n    override val owner: AstDeclaration?\n        get() = TODO(\"Not yet implemented\")\n    override val isPrivate: Boolean\n        get() = throw NotImplementedError()\n\n    override fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        val method = staticGetters[memberName] ?: throw NoSuchMethodError(\"Member $memberName not found\")\n        return invokeStaticMethod(method, positionalArguments, namedArguments)\n    }\n\n    override fun invokeGetter(getterName: String): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasGetter(getterName: String): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun invokeSetter(setterName: String, value: Any?): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasSetter(setterName: String): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasRegularMethod(methodName: String): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    private fun invokeStaticMethod(\n        name: AstMethod,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        val methodMirror = (name as _MethodMirror2)._methodMirror\n        return ComposeComponentDescriptor2(\n            methodMirror = methodMirror,\n             \"\",\n            positionalArguments = positionalArguments,\n            namedArguments = namedArguments,\n            children = null\n        )\n//        return methodMirror?.invoke(null,namedArguments)\n    }\n\n    private fun buildParameters(\n        kFunction: KFunction<*>,\n        positionalArgs: List<Any?>,\n        namedArgs: Map<String, Any?>?\n    ): Map<KParameter, Any?> {\n\n        val parameters = kFunction.parameters\n        val result = mutableMapOf<KParameter, Any?>()\n\n        // 处理位置参数\n        var positionalIndex = 0\n        for (param in parameters) {\n            if (positionalIndex < positionalArgs.size && !param.isVararg) {\n                result[param] = positionalArgs[positionalIndex]\n                positionalIndex++\n            } else if (namedArgs?.containsKey(param.name) == true) {\n                // 处理命名参数\n                result[param] = namedArgs[param.name]\n            } else if (param.isVararg) {\n                // 如果是可变参数，则需要特殊处理\n                val remainingPosArgs = positionalArgs.drop(positionalIndex)\n                result[param] = if (remainingPosArgs.isNotEmpty())\n                    remainingPosArgs.toTypedArray()\n                else\n                    null\n            }\n        }\n        return result\n    }\n\n    private fun convertType(type: KType, value: Any?): Any? {\n        return when (type.classifier) {\n            Double::class -> value?.toString()?.toDoubleOrNull()\n            else -> value\n        }\n    }\n}\n\n//class _ClassMirror(private val _classMirror: ClassMirror) : AstObject, AstClass() {\n//    private var _declarations: Map<String, AstDeclaration>? = null\n//    private var _staticMembers: Map<String, AstMethod>? = null\n//    private var _instanceMembers: Map<String, AstMethod>? = null\n//\n//    override val declarations: Map<String, AstDeclaration>\n//        get() = _declarations ?: run {\n//            val result = mutableMapOf<String, AstDeclaration>()\n//            _classMirror.declarations.forEach { (name, mirror) ->\n//                when (mirror) {\n//                    is MethodMirror -> result[name] = AstMethod.fromMirror(mirror)\n//                    is VariableMirrorBase -> result[name] = AstVariable.fromMirror(mirror)\n//                }\n//            }\n//            result.toMap().also { _declarations = it }\n//        }\n//\n//    override val staticMembers: Map<String, AstMethod>\n//        get() = _staticMembers ?: run {\n//            val result = mutableMapOf<String, AstMethod>()\n//            _classMirror.staticMembers.forEach { (name, mirror) ->\n//                result[name] = AstMethod.fromMirror(mirror)\n//            }\n//            result.toMap().also { _staticMembers = it }\n//        }\n//\n//    override fun hasConstructor(constructorName: String): Boolean {\n//        val methodName = if (constructorName.isEmpty()) simpleName else \"$simpleName.$constructorName\"\n//        return (_classMirror.declarations[methodName] as? MethodMirror)?.isConstructor ?: false\n//    }\n//\n//    override fun invoke(memberName: String, positionalArguments: List<Any?>, namedArguments: MutableMap<String, Any?>?): Any? {\n//        val method = staticMembers[memberName] ?: throw NoSuchMethodError(\"Member $memberName not found\")\n////        processArguments(method.parameters, positionalArguments, namedArguments)\n//        processArguments(mutableListOf<AstParameter>(), positionalArguments, namedArguments)\n//        return _classMirror.invoke(memberName, positionalArguments, namedArguments)\n//    }\n//\n//    // 其他方法类似转换...\n//}\n\n\nclass _MethodMirror2(methodMirror: MethodMirror) : AstMethod {\n\n    var _methodMirror: MethodMirror? = null\n\n    init {\n        this._methodMirror = methodMirror\n    }\n\n    companion object {\n        fun fromMirror(mirror: KFunction<*>): _MethodMirror {\n            return _MethodMirror(mirror);\n        }\n\n        fun fromMirror(mirror: MethodMirror): _MethodMirror2 {\n            return _MethodMirror2(mirror);\n        }\n    }\n\n    fun fromKCallable(member: KFunction<*>): AstDeclaration {\n        return _MethodMirror.fromMirror(member)\n    }\n\n    val isMutable: Boolean\n        //        get() = kProperty is KMutableProperty<*>\n        get() = true\n\n    val setter: KCallable<*>?\n        get() = if (isMutable) (kProperty as? KMutableProperty<*>)?.setter else null\n\n\n    val isConstConstructor: Boolean\n        get() = false // Kotlin does not have a direct equivalent of Dart's const constructors\n\n\n    val isRedirectingConstructor: Boolean\n        get() = false // Kotlin does not have redirecting constructors\n\n    override val owner: AstDeclaration?\n        get() = null // Unimplemented for simplicity\n    override val isPrivate: Boolean\n        get() = TODO(\"Not yet implemented\")\n\n    private var _parameters: List<AstParameter>? = null\n\n    override val parameters: List<_ParameterImpl>\n        get() {\n            return mutableListOf()\n        }\n    override val isStatic: Boolean\n        get() = TODO(\"Not yet implemented\")\n    override val isAbstract: Boolean\n        get() = TODO(\"Not yet implemented\")\n\n    override val returnType: AstType\n        get() = throw UnimplementedError(\"returnType error\")\n\n    override val simpleName: String\n        get() = _methodMirror?.simpleName ?: \"\"\n\n    override val qualifiedName: String\n        get() = _methodMirror?.qualifiedName ?: \"\"\n\n    override fun toString(): String = \"_MethodMirror($qualifiedName)\"\n\n\n    override val isSynthetic: Boolean\n        //        get() = kFunction.isSynthetic\n        get() = true\n    override val isRegularMethod: Boolean\n        get() = TODO(\"Not yet implemented\")\n    override val isGetter: Boolean\n        get() = TODO(\"Not yet implemented\")\n    override val isSetter: Boolean\n        get() = TODO(\"Not yet implemented\")\n    override val isOperator: Boolean\n        get() = TODO(\"Not yet implemented\")\n    override val isConstructor: Boolean\n        get() = TODO(\"Not yet implemented\")\n    override val constructorName: String\n        get() = TODO(\"Not yet implemented\")\n\n    override val programNode: AstRuntime.ProgramNode\n        get() = throw UnsupportedOperationException()\n}\n\n\nclass _MethodMirror(val kFunction: KFunction<*>) : AstMethod {\n\n    var function: KFunction<*>? = null\n\n    init {\n        this.function = kFunction\n    }\n\n    companion object {\n        fun fromMirror(mirror: KFunction<*>): _MethodMirror {\n            return _MethodMirror(mirror);\n        }\n\n        fun fromMirror(mirror: MethodMirror): _MethodMirror2 {\n            return _MethodMirror2(mirror);\n        }\n    }\n\n    fun fromKCallable(member: KFunction<*>): AstDeclaration {\n        return fromMirror(member)\n    }\n\n    val isBound: Boolean\n        get() = kFunction.isInstanceBound()\n\n    private fun KFunction<*>.isInstanceBound(): Boolean {\n        return when {\n            this is Function<*> -> {\n                // 如果是 lambda 或局部函数，可能无法直接判断\n                false\n            }\n\n            else -> {\n                // 检查是否有接收者参数\n//                parameters.firstOrNull()?.isInstanceParameter == true\n                true\n            }\n        }\n    }\n\n    val isMutable: Boolean\n        //        get() = kProperty is KMutableProperty<*>\n        get() = true\n\n    val setter: KCallable<*>?\n        get() = if (isMutable) (kProperty as? KMutableProperty<*>)?.setter else null\n\n    val declaringClass: KClass<*>?\n        get() = kFunction.declaringClass()\n\n    private fun KFunction<*>.declaringClass(): KClass<*>? {\n        return when {\n            javaMethod != null -> javaMethod!!.declaringClass.kotlin // 如果是 Java 方法\n            else -> this.parameters.firstOrNull()?.type?.classifier as? KClass<*>\n        }\n    }\n\n    override val constructorName: String\n        get() = if (kFunction.name == \"<init>\") declaringClass?.simpleName ?: \"\" else \"\"\n\n    override val isAbstract: Boolean\n        get() = kFunction.isAbstract\n\n    val isConstConstructor: Boolean\n        get() = false // Kotlin does not have a direct equivalent of Dart's const constructors\n\n    override val isConstructor: Boolean\n        get() = kFunction.name == \"<init>\"\n\n    val isFactoryConstructor: Boolean\n        get() = false // Kotlin does not have factory constructors\n\n    override val isGetter: Boolean\n        get() = kFunction is KProperty<*> && !setter!!.isAccessible\n\n    override val isOperator: Boolean\n        get() = kFunction.name.startsWith(\"operator\")\n\n    override val isPrivate: Boolean\n        get() = Modifier.isPrivate(kFunction.javaMethod?.modifiers ?: 0)\n\n    val isRedirectingConstructor: Boolean\n        get() = false // Kotlin does not have redirecting constructors\n\n    override val isSetter: Boolean\n        get() = kFunction is KMutableProperty<*>\n\n    override val isStatic: Boolean\n        get() = isBound\n\n\n    override val owner: AstDeclaration?\n        get() = null // Unimplemented for simplicity\n\n    private var _parameters: List<AstParameter>? = null\n\n    override val parameters: List<_ParameterImpl>\n        get() {\n//            if (_parameters == null) {\n//                _parameters = kFunction.parameters.map { AstParameter.fromKParameter(it) }\n//            }\n//            return _parameters!!\n            return mutableListOf()\n        }\n\n    override val returnType: AstType\n        get() = throw UnimplementedError(\"returnType error\")\n\n    override val simpleName: String\n        get() = kFunction.name\n\n    override val qualifiedName: String\n        get() = \"${kFunction.name}\"\n\n    override fun toString(): String = \"_MethodMirror($qualifiedName)\"\n\n    override val isRegularMethod: Boolean\n        get() = kFunction.name != \"<init>\" && kFunction.name != \"<clinit>\"\n\n    override val isSynthetic: Boolean\n        //        get() = kFunction.isSynthetic\n        get() = true\n\n    override val programNode: AstRuntime.ProgramNode\n        get() = throw UnsupportedOperationException()\n}\n\nprivate fun <T> processArguments(\n    parameters: List<AstParameter>?,\n    positionalArgs: List<Any?>,\n    namedArgs: Map<String, Any?>?\n) {\n//    parameters.forEachIndexed { i, param ->\n//        when {\n//            param.isNamed && namedArgs?.containsKey(param.simpleName) == true -> {\n//                namedArgs[param.simpleName] =\n//                    convertType(param, namedArgs.getValue(param.simpleName))\n//            }\n//            i < positionalArgs.size -> {\n//                positionalArgs[i] = convertType(param, positionalArgs[i])\n//            }\n//        }\n//    }\n}\n\n\n// _InstanceMirror.kt\n//class _InstanceMirror(private val _instanceMirror: InstanceMirror) : AstObject(), AstInstance {\n//    override val type: AstClass get() = AstClass.fromMirror(_instanceMirror.type)\n//\n//    override fun invoke(memberName: String, positionalArguments: List<Any?>, namedArguments: Map<Symbol, Any?>?): Any? {\n//        return context.run{\n//            val method = (type as _ClassMirror).instanceMembers[memberName]\n//                ?: throw NoSuchMethodError(\"Method $memberName not found\")\n//            processArguments(method.parameters, positionalArguments, namedArguments)\n//            _instanceMirror.invoke(memberName, positionalArguments, namedArguments)\n//        }\n//    }\n// 其他方法转换...\n//}\n\n//private fun convertType(param: AstParameter, value: Any?): Any? {\n//    return when (param.reflectedType) {\n//        Double::class -> value?.toString()?.toDoubleOrNull()\n//        else -> value\n//    }\n//}\n\n"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/KtAstVisitor.kt",
    "content": "package com.aether.core.runtime\n\nimport com.intellij.psi.PsiElement\nimport org.jetbrains.kotlin.lexer.KtSingleValueToken\nimport org.jetbrains.kotlin.psi.*\nimport org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject\n\n// 自定义访问者类，继承 KtTreeVisitorVoid\nclass MyKtVisitorV2 : KtVisitor<Map<String, Any?>, Void?>() {\n\n    // 用于存储遍历结果的 Map\n    private val result = mutableMapOf<String, Any>()\n\n    // 获取遍历结果\n    fun getResult(): Map<String, Any> {\n        return result.toMap()\n    }\n\n    // 遍历单个节点\n    private fun visitNode(node: KtElement?, data: Void?): Map<String, Any?>? {\n        // 调用 accept 方法，启动访问者模式的遍历\n        if (node != null) {\n            return node.accept(this, data)\n        }\n        return null\n    }\n\n    // 遍历节点列表\n    private fun visitNodeList(nodes: List<KtElement>, data: Void?): List<Map<String, Any?>> {\n        val maps = mutableListOf<Map<String, Any?>>()\n        for (node in nodes) {\n            val res = visitNode(node, data)\n            if (res != null) {\n                maps.add(res)\n            }\n        }\n        return maps\n    }\n\n    override fun visitKtElement(element: KtElement, data: Void?): Map<String, Any>? {\n//        println(\"Visiting element: ${element.text}\")\n        super.visitElement(element)\n        return mutableMapOf()\n    }\n\n    override fun visitElement(element: PsiElement) {\n        super.visitElement(element)\n    }\n\n//    override fun visitSimpleNameExpression(\n//        node: KtSimpleNameExpression,\n//        data: Void?\n//    ): Map<String, Any?> {\n//        super.visitSimpleNameExpression(node, data)\n//        println(\"Visiting Identifier: ${node.name}\")\n//        return mapOf(\n//            \"type\" to \"Identifier\",\n//            \"name\" to node.name,\n//        )\n//    }\n\n    override fun visitKtFile(file: KtFile, data: Void?): Map<String, Any>? {\n        println(\"Visiting file: ${file.name}\")\n//        result[\"file\"] = file.name\n\n        // 处理包声明\n//        val packageDirective = file.packageDirective\n//        if (packageDirective != null) {\n//            println(\"Package: ${packageDirective.fqName.asString()}\")\n//            result[\"package\"] = packageDirective.fqName.asString()\n//        }\n\n        // 处理导入语句\n//        for (import in file.importDirectives) {\n//            println(\"Import: ${import.importPath?.toString()}\")\n//            result[\"directives\"] =\n//                result.getOrDefault(\"imports\", mutableListOf<String>()) as MutableList<String>\n//            (result[\"directives\"] as MutableList<String>).add(\n//                import.importPath?.toString() ?: \"Unknown\"\n//            )\n//        }\n\n        val declarations = file.declarations\n        if (declarations != null) {\n            val directives = file.importDirectives\n            println(\"Import: ${directives?.toString()}\")\n            result[\"directives\"] = visitNodeList(directives, data)\n\n\n            println(\"declarations: ${declarations.asSequence()}\")\n            result[\"declarations\"] = visitNodeList(declarations, data)\n            result[\"type\"] = \"CompilationUnit\"\n        }\n        file.acceptChildren(this)\n        return result\n    }\n\n    override fun visitBlockExpression(\n        node: KtBlockExpression, data: Void?\n    ): Map<String, Any?> {\n        super.visitBlockExpression(node, data)\n        println(\"Visiting class: ${node.name}\")\n        return mapOf(\n            \"type\" to \"BlockStatement\",\n            \"body\" to visitNodeList(node.statements, data),\n        )\n    }\n\n    override fun visitObjectDeclaration(\n        node: KtObjectDeclaration, data: Void?\n    ): Map<String, Any?> {\n//       1 val annotations = node.annotationEntries\n//        return annotations.any { it.shortName()?.asString() == \"JvmStatic\" }\n//       2 val containingClass = function.containingClassOrObject\n//        return containingClass is KtObjectDeclaration && containingClass.isCompanion()\n//       3 function.parent is KtFile\n        println(\"Visiting visitObjectDeclaration: ${node.name}\")\n        return mapOf(\n            \"type\" to \"ClassDeclaration\",\n            \"name\" to node.name,\n            \"members\" to visitNodeList(node.declarations, data),\n            \"body\" to visitNode(node.body, data),\n        )\n    }\n    // 重写 visitClass 方法，处理类节点\n    override fun visitClass(klass: KtClass, data: Void?): Map<String, Any?>? {\n        println(\"Visiting class: ${klass.name}\")\n        super.visitClass(klass, data)\n        return mapOf(\n            \"type\" to \"ClassDeclaration\",\n            \"name\" to klass.name,\n            \"members\" to visitNodeList(klass.declarations, data),\n            \"body\" to visitNode(klass.body, data),\n        )\n    }\n\n    override fun visitCallableReferenceExpression(\n        expression: KtCallableReferenceExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        super.visitCallableReferenceExpression(expression, data)\n        return mapOf(\n            \"type\" to \"visitCallableReferenceExpression\",\n            \"name\" to expression.name,\n            \"targetExpression\" to visitNode(expression.receiverExpression, data),//右边部分\n        )\n    }\n\n\n    override fun visitLambdaExpression(\n        expression: KtLambdaExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        super.visitLambdaExpression(expression, data)\n        println(\"Visiting visitLambdaExpression: ${expression.name}\")\n        return mapOf(\n            \"type\" to \"LambdaExpression\",\n            \"name\" to expression.name,\n            \"parameters\" to visitNodeList(expression.valueParameters, data),\n            \"body\" to visitNode(expression.bodyExpression, data),\n            \"returnType\" to visitNode(expression.functionLiteral, data),\n        )\n    }\n\n    //    override fun visitFunctionDeclaration(node: KtNamedFunction, data: Void?): Map<String, Any?>? {\n//        println(\"Visiting function: ${node.name}\")\n//        super.visitNamedFunction(node, data)\n//        val parameters = visitNodeList(node.valueParameters, data)\n//        return mapOf(\n//            \"type\" to \"FunctionDeclaration\",\n//            \"name\" to node.name,\n//            \"parameters\" to parameters,\n//            \"typeParameters\" to visitNodeList(node.typeParameters, data),\n//            \"body\" to visitNode(node.bodyExpression, data),\n//            \"isStatic\" to isStaticMethod(node),\n//            \"isGetter\" to parameters.isEmpty(),\n//            \"isSetter\" to (parameters.size == 1 && node.name!!.startsWith(\"set\")),\n//            \"node\" to node\n//        )\n//\n//    }\n    override fun visitNamedFunction(node: KtNamedFunction, data: Void?): Map<String, Any?>? {\n        println(\"Visiting function: ${node.name}\")\n        super.visitNamedFunction(node, data)\n        val parameters = visitNodeList(node.valueParameters, data)\n        return mapOf(\n            \"type\" to \"MethodDeclaration\",\n            \"name\" to node.name,\n            \"parameters\" to parameters,\n            \"typeParameters\" to visitNodeList(node.typeParameters, data),\n            \"body\" to visitNode(node.bodyExpression, data),\n            \"isStatic\" to isStaticMethod(node),\n            \"isGetter\" to parameters.isEmpty(),\n            \"isSetter\" to (parameters.size == 1 && node.name!!.startsWith(\"set\")),\n//            \"node\" to node\n        )\n\n    }\n\n    override fun visitValueArgumentList(node: KtValueArgumentList, data: Void?): Map<String, Any?> {\n        println(\"visitValueArgumentList: ${node.name}\")\n        super.visitValueArgumentList(node, data)\n        return mapOf(\n            \"type\" to \"ArgumentList\",\n            \"arguments\" to visitNodeList(node.arguments, data),\n        )\n\n    }\n\n    override fun visitParameterList(node: KtParameterList, data: Void?): Map<String, Any?> {\n        println(\"Visiting function: ${node.name}\")\n        super.visitParameterList(node, data)\n        return mapOf(\n            \"type\" to \"ParameterList\",\n            \"name\" to node.name,\n            \"parameters\" to visitNodeList(node.parameters, data),\n        )\n    }\n\n    // 重写 visitProperty 方法，处理属性节点\n    override fun visitProperty(property: KtProperty, data: Void?): Map<String, Any?>? {\n        println(\"Visiting property: ${property.name}\")\n        super.visitProperty(property, data)\n        return if (property.containingClassOrObject != null) {\n            mapOf(\n                \"type\" to \"FieldDeclaration\",\n                \"name\" to property.name,\n                \"initializer\" to visitNode(property.initializer, data),\n            )\n        } else {\n            mapOf(\n                \"type\" to \"PropertyStatement\",\n                \"name\" to property.name,\n                \"initializer\" to visitNode(property.initializer, data),\n            )\n        }\n    }\n\n    // 重写 visitBinaryExpression 方法，处理二元表达式\n    override fun visitBinaryExpression(\n        expression: KtBinaryExpression, data: Void?\n    ): Map<String, Any?>? {\n        println(\"Visiting binary expression: ${expression.text}\")\n        super.visitBinaryExpression(expression, data)\n        return mapOf(\n            \"type\" to \"BinaryExpression\",\n            \"name\" to expression.name,\n            \"operator\" to (expression.operationToken as KtSingleValueToken).value,\n            \"left\" to visitNode(expression.left, data),\n            \"right\" to visitNode(expression.right, data),\n//            \"node\" to expression,\n        )\n    }\n\n    override fun visitReferenceExpression(\n        expression: KtReferenceExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        println(\"Visiting visitReferenceExpression: ${expression.text}\")\n        super.visitReferenceExpression(expression, data)//visitSimpleIdentifier\n        return mapOf(\n            \"type\" to \"Identifier\",\n            \"name\" to expression.text,\n        )\n    }\n\n    override fun visitSecondaryConstructor(\n        constructor: KtSecondaryConstructor,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitSecondaryConstructor(constructor, null)\n        println(\"Visiting visitSecondaryConstructor: ${constructor.name}\")\n        return mapOf(\n            \"type\" to \"SecondaryConstructor\",\n            \"name\" to constructor.name,\n            \"body\" to visitNode(constructor.bodyExpression, data),\n            \"parameters\" to visitNode(constructor.valueParameterList, data),\n        )\n    }\n\n    override fun visitStringTemplateExpression(\n        expression: KtStringTemplateExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        // 手动遍历子节点\n        for (entry in expression.entries) {\n            when (entry) {\n                is KtLiteralStringTemplateEntry -> {\n                    return mapOf(\n                        \"type\" to \"StringTemplateExpression\",\n                        \"name\" to entry.name,\n                        \"body\" to visitNode(entry, data),\n                    )\n                }\n\n                is KtSimpleNameStringTemplateEntry -> visitNode(entry, data)\n//                is KtExpressionStringTemplateEntry -> visitExpressionStringTemplateEntry(entry)\n                else -> entry.accept(this) // 对于未知类型，可以使用 accept 方法\n            }\n        }\n        return super.visitStringTemplateExpression(expression, data)\n    }\n\n    override fun visitLiteralStringTemplateEntry(\n        entry: KtLiteralStringTemplateEntry,\n        data: Void?\n    ): Map<String, Any?> {\n        super.visitLiteralStringTemplateEntry(entry, data)\n        return mapOf(\n            \"type\" to \"StringTemplateEntry\",\n            \"body\" to visitNode(entry.expression, data),\n            \"value\" to entry.text\n        )\n    }\n\n    override fun visitConstantExpression(\n        expression: KtConstantExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        super.visitConstantExpression(expression, data)\n        return mapOf(\n            \"type\" to expression.elementType.debugName,\n            \"value\" to expression.text,\n            \"name\" to \"ConstantExpression\",\n        )\n\n    }\n\n    override fun visitPrimaryConstructor(\n        constructor: KtPrimaryConstructor,\n        data: Void?\n    ): Map<String, Any?>? {\n        println(\"Visiting visitPrimaryConstructor: ${constructor.name}\")\n        super.visitPrimaryConstructor(constructor, null)\n        return mapOf(\n            \"type\" to \"PrimaryConstructor\",\n            \"name\" to constructor.name,\n            \"body\" to visitNode(constructor.bodyExpression, data),\n            \"parameters\" to visitNode(constructor.valueParameterList, data),\n        )\n    }\n\n    //\n//    override fun visitTypeAlias(typeAlias: KtTypeAlias) {\n//        println(\"Visiting visitTypeAlias: ${typeAlias.name}\")\n//        super.visitTypeAlias(typeAlias, null)\n//    }\n//\n//    override fun visitDestructuringDeclaration(destructuringDeclaration: KtDestructuringDeclaration) {\n//        println(\"Visiting visitDestructuringDeclaration: ${destructuringDeclaration.name}\")\n//        super.visitDestructuringDeclaration(destructuringDeclaration, null)\n//    }\n//\n//    override fun visitDestructuringDeclarationEntry(multiDeclarationEntry: KtDestructuringDeclarationEntry) {\n//        println(\"Visiting visitDestructuringDeclarationEntry: ${multiDeclarationEntry.name}\")\n//        super.visitDestructuringDeclarationEntry(multiDeclarationEntry, null)\n//    }\n//\n//    override fun visitScript(script: KtScript) {\n//        println(\"Visiting visitScript: ${script?.name}\")\n//        super.visitScript(script, null)\n//    }\n//\n//    override fun visitImportAlias(importAlias: KtImportAlias) {\n//        println(\"Visiting visitImportAlias: ${importAlias?.name}\")\n//        super.visitImportAlias(importAlias, null)\n//    }\n//\n    override fun visitImportDirective(\n        node: KtImportDirective,\n        data: Void?\n    ): Map<String, Any?>? {\n        println(\"Visiting visitImportDirective: ${node?.name}\")\n        super.visitImportDirective(node, null)\n//        node.importPath?.fqName?.asString()\n        return mapOf(\n            \"type\" to \"ImportDirective\",\n            \"importPath\" to node.importPath?.pathStr,\n            \"alias\" to node.alias?.text,\n            \"name\" to node.importedFqName?.shortName()?.identifier,\n        )\n    }\n\n    //    override fun visitImportList(importList: KtImportList, data: Void?): Map<String, Any?> {\n//        super.visitImportList(importList, data)\n//        return mapOf(\n//            \"type\" to \"ImportList\",\n//            \"imports\" to visitNodeList(importList.imports, data),\n////            \"prefix\" to visitNode(node.pre,data),\n////            \"combinators\" to visitNode(node.comb,data),\n//        )\n//\n//    }\n//\n//    override fun visitModifierList(list: KtModifierList) {\n//        println(\"Visiting visitModifierList: ${list?.name}\")\n//        super.visitModifierList(list, null)\n//    }\n//\n//    override fun visitAnnotation(annotation: KtAnnotation) {\n//        println(\"Visiting visitAnnotation: ${annotation?.name}\")\n//        super.visitAnnotation(annotation, null)\n//    }\n//\n//    override fun visitAnnotationEntry(annotationEntry: KtAnnotationEntry) {\n//        println(\"Visiting visitAnnotationEntry: ${annotationEntry?.name}\")\n//        super.visitAnnotationEntry(annotationEntry, null)\n//    }\n//\n//    override fun visitConstructorCalleeExpression(constructorCalleeExpression: KtConstructorCalleeExpression) {\n//        println(\"Visiting visitConstructorCalleeExpression: ${constructorCalleeExpression?.name}\")\n//        super.visitConstructorCalleeExpression(constructorCalleeExpression, null)\n//    }\n//\n    override fun visitTypeParameterList(\n        node: KtTypeParameterList, data: Void?\n    ): Map<String, Any?>? {\n        println(\"Visiting visitTypeParameterList: ${node?.name}\")\n        super.visitTypeParameterList(node, null)\n        return mapOf(\n            \"type\" to \"TypeParameterList\",\n            \"typeParameters\" to visitNodeList(node.parameters, data),\n        )\n    }\n\n    override fun visitTypeParameter(node: KtTypeParameter, data: Void?): Map<String, Any?>? {\n        println(\"Visiting visitTypeParameter: ${node?.name}\")\n        super.visitTypeParameter(node, null)\n        return mapOf(\n            \"type\" to \"TypeParameter\",\n            \"name\" to node.name,\n            \"bound\" to visitNode(node.extendsBound, data),\n        )\n    }\n\n    //\n//    override fun visitEnumEntry(enumEntry: KtEnumEntry) {\n//        println(\"Visiting visitEnumEntry: ${enumEntry?.name}\")\n//        super.visitEnumEntry(enumEntry, null)\n//    }\n//\n    override fun visitParameter(parameter: KtParameter, data: Void?): Map<String, Any?>? {\n        println(\"Visiting visitParameter: ${parameter?.name}\")\n        super.visitParameter(parameter, null)\n        parameter\n        return mapOf(\n            \"type\" to \"SimpleFormalParameter\",\n            \"name\" to parameter.name,\n            \"typeName\" to parameter.typeReference?.text,\n        )\n    }\n\n    //\n//    override fun visitSuperTypeList(list: KtSuperTypeList) {\n//        println(\"Visiting visitSuperTypeList: ${list?.name}\")\n//        super.visitSuperTypeList(list, null)\n//    }\n//\n//    override fun visitSuperTypeListEntry(specifier: KtSuperTypeListEntry) {\n//        println(\"Visiting visitSuperTypeList: ${specifier?.name}\")\n//        super.visitSuperTypeListEntry(specifier, null)\n//    }\n//\n//    override fun visitDelegatedSuperTypeEntry(specifier: KtDelegatedSuperTypeEntry) {\n//        println(\"Visiting visitDelegatedSuperTypeEntry: ${specifier?.name}\")\n//        super.visitDelegatedSuperTypeEntry(specifier, null)\n//    }\n//\n//    override fun visitSuperTypeCallEntry(call: KtSuperTypeCallEntry) {\n//        println(\"Visiting visitSuperTypeCallEntry: ${call?.name}\")\n//        super.visitSuperTypeCallEntry(call, null)\n//    }\n//\n//    override fun visitSuperTypeEntry(specifier: KtSuperTypeEntry) {\n//        super.visitSuperTypeEntry(specifier, null)\n//    }\n//\n//    override fun visitContextReceiverList(contextReceiverList: KtContextReceiverList) {\n//        super.visitContextReceiverList(contextReceiverList, null)\n//    }\n//\n//    override fun visitConstructorDelegationCall(call: KtConstructorDelegationCall) {\n//        super.visitConstructorDelegationCall(call, null)\n//    }\n//\n//    override fun visitPropertyDelegate(delegate: KtPropertyDelegate) {\n//        super.visitPropertyDelegate(delegate, null)\n//    }\n//\n\n    override fun visitArgument(argument: KtValueArgument, data: Void?): Map<String, Any?>? {\n        super.visitArgument(argument, null)\n        return mapOf(\n            \"type\" to \"Argument\",\n            \"isNamed\" to argument.isNamed(),\n            \"name\" to argument.getArgumentName()?.text,\n            \"body\" to visitNode(argument.getArgumentExpression(), data),\n        )\n    }\n\n\n    //\n//    override fun visitLoopExpression(loopExpression: KtLoopExpression) {\n//        super.visitLoopExpression(loopExpression, null)\n//    }\n//\n    override fun visitLabeledExpression(\n        node: KtLabeledExpression, data: Void?\n    ): Map<String, Any?>? {\n        super.visitLabeledExpression(node, null)\n        return visitNode(node.labelQualifier, data)\n    }\n\n    //\n//    override fun visitPrefixExpression(expression: KtPrefixExpression) {\n//        super.visitPrefixExpression(expression, null)\n//    }\n//\n//    override fun visitPostfixExpression(expression: KtPostfixExpression) {\n//        super.visitPostfixExpression(expression, null)\n//    }\n//\n//    override fun visitUnaryExpression(expression: KtUnaryExpression) {\n//        super.visitUnaryExpression(expression, null)\n//    }\n//\n    override fun visitReturnExpression(\n        expression: KtReturnExpression, data: Void?\n    ): Map<String, Any?>? {\n        println(\"Visiting visitReturnExpression: ${expression?.name}\")\n        return mapOf(\n            \"type\" to \"ReturnStatement\",\n            \"argument\" to visitNode(expression.returnedExpression, null),\n        )\n\n    }\n\n    //\n//    override fun visitExpressionWithLabel(expression: KtExpressionWithLabel) {\n//        super.visitExpressionWithLabel(expression, null)\n//    }\n//\n    override fun visitThrowExpression(\n        node: KtThrowExpression,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitThrowExpression(node, null)\n        println(\"Visiting visitThrowExpression: ${node?.name}\")\n        return mapOf(\n            \"type\" to \"ThrowExpression\",\n            \"expression\" to visitNode(node.thrownExpression, data),\n//            \"node\" to node,\n        )\n    }\n\n    override fun visitBreakExpression(\n        node: KtBreakExpression,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitBreakExpression(node, null)\n        println(\"Visiting visitBreakExpression: ${node?.name}\")\n        return mapOf(\n            \"type\" to \"BreakStatement\",\n            \"label\" to visitNode(node.labelQualifier, data),\n            \"target\" to visitNode(node.getTargetLabel(), data),\n        )\n    }\n\n    //\n//    override fun visitContinueExpression(expression: KtContinueExpression) {\n//        super.visitContinueExpression(expression, null)\n//    }\n//\n    override fun visitIfExpression(node: KtIfExpression, data: Void?): Map<String, Any?>? {\n        super.visitIfExpression(node, null)\n        println(\"Visiting visitIfExpression: ${node?.name}\")\n        return mapOf(\n            \"type\" to \"IfExpression\",\n            \"condition\" to visitNode(node.condition, data),\n            \"consequent\" to visitNode(node.then, data),\n            \"alternate\" to visitNode(node.`else`, data),\n        )\n    }\n\n    //\n//    override fun visitWhenExpression(expression: KtWhenExpression) {\n//        super.visitWhenExpression(expression, null)\n//    }\n//\n//    override fun visitCollectionLiteralExpression(expression: KtCollectionLiteralExpression) {\n//        super.visitCollectionLiteralExpression(expression, null)\n//    }\n//\n//    override fun visitTryExpression(expression: KtTryExpression) {\n//        super.visitTryExpression(expression, null)\n//    }\n//\n//    override fun visitForExpression(expression: KtForExpression) {\n//        super.visitForExpression(expression, null)\n//    }\n//\n//    override fun visitWhileExpression(expression: KtWhileExpression) {\n//        super.visitWhileExpression(expression, null)\n//    }\n//\n//    override fun visitDoWhileExpression(expression: KtDoWhileExpression) {\n//        super.visitDoWhileExpression(expression, null)\n//    }\n//\n//    override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) {\n//        super.visitLambdaExpression(lambdaExpression, null)\n//    }\n//\n//    override fun visitAnnotatedExpression(expression: KtAnnotatedExpression) {\n//        super.visitAnnotatedExpression(expression, null)\n//    }\n//\n\n    override fun visitConstructorCalleeExpression(\n        expression: KtConstructorCalleeExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        println(\"Visiting visitConstructorCalleeExpression: ${expression?.name}\")\n        return super.visitConstructorCalleeExpression(expression, data)\n    }\n\n    /**\n     * visitCallExpression 方法在 Kotlin 的 AST（抽象语法树）访问器模式中用于处理函数或构造函数的调用。\n     * 这意味着它不仅处理普通函数的调用，也包括对象实例化时构造函数的调用\n     * KtConstructorCalleeExpression专门用于表示对构造函数的引用\n     */\n//    override fun visitCallExpression(\n//        expression: KtCallExpression,\n//        data: Void?\n//    ): Map<String, Any?>? {\n//        super.visitCallExpression(expression, null)\n//        println(\"Visiting visitCallExpression: ${expression?.name}\")\n//        val callee = expression.calleeExpression\n//        if (callee is KtConstructorCalleeExpression) {\n//            // 这是一个构造函数调用\n//            println(\"Detected constructor call: ${callee.text}\")\n//        }\n//        //这里因为没有办法区分是构造方法还是普通方法，所以通过方法名称的大写暂时先这样判断，后续优化吧\n//        if (expression.calleeExpression!!.text[0].isUpperCase()) {\n//            return mapOf(\n//                \"type\" to \"InstanceCreationExpression\",\n//                \"constructorName\" to expression.calleeExpression?.text,\n//                \"argumentList\" to visitNode(expression.valueArgumentList, data),\n//                \"valueArgument\" to visitNodeList(expression.typeArguments, data),\n//            )\n//        } else {\n//            return mapOf(\n//                \"type\" to \"CallExpression\",\n//                \"methodName\" to visitNode(expression.calleeExpression, data),\n//                \"target\" to visitNode(expression.calleeExpression, data),\n//                \"argumentList\" to visitNode(expression.valueArgumentList, data),\n//                \"valueArgument\" to visitNodeList(expression.typeArguments, data),\n//            )\n//        }\n//    }\n\n    override fun visitCallExpression(\n        expression: KtCallExpression,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitCallExpression(expression, null)\n        println(\"Visiting visitCallExpression: ${expression.calleeExpression?.text}\")\n\n        val callee = expression.calleeExpression\n        if (callee is KtConstructorCalleeExpression) {\n            // 这是一个构造函数调用\n            println(\"Detected constructor call: ${callee.text}\")\n        }\n\n        // 检查是否有尾随 lambda\n        val lambdaArgument = expression.lambdaArguments.firstOrNull()\n        val childElements = mutableListOf<Map<String, Any?>?>()\n\n        // 访问 lambda 体中的表达式\n        if (lambdaArgument != null) {\n            val lambdaExpression = lambdaArgument.getLambdaExpression()\n            val lambdaBody = lambdaExpression?.bodyExpression\n\n            // 访问 lambda 体中的所有语句\n            if (lambdaBody != null) {\n                val bodyStatements = when (lambdaBody) {\n                    is KtBlockExpression -> lambdaBody.statements\n                    else -> listOf(lambdaBody) // 如果不是块表达式，则将整个表达式视为单个语句\n                }\n\n                // 遍历 lambda 体中的所有语句\n                for (statement in bodyStatements) {\n                    if (statement is KtCallExpression) {\n                        // 递归访问子调用表达式\n                        childElements.add(visitCallExpression(statement, data))\n                    }\n                }\n            }\n        }\n\n        // 判断是构造方法还是普通方法\n        if (expression.calleeExpression?.text?.firstOrNull()?.isUpperCase() == true) {\n            return mapOf(\n                \"type\" to \"InstanceCreationExpression\",\n                \"constructorName\" to expression.calleeExpression?.text,\n                \"argumentList\" to visitNode(expression.valueArgumentList, data),\n                \"typeArguments\" to visitNodeList(expression.typeArguments, data),\n                \"children\" to childElements // 添加子元素列表\n            )\n        } else {\n            return mapOf(\n                \"type\" to \"CallExpression\",\n                \"methodName\" to visitNode(expression.calleeExpression, data),\n                \"target\" to visitNode(expression.calleeExpression, data),\n                \"argumentList\" to visitNode(expression.valueArgumentList, data),\n                \"typeArguments\" to visitNodeList(expression.typeArguments, data),\n                \"children\" to childElements // 添加子元素列表\n            )\n        }\n    }\n\n    override fun visitDotQualifiedExpression(\n        expression: KtDotQualifiedExpression,\n        data: Void?\n    ): Map<String, Any?> {\n        //对应visitPropertyAccess\n        println(\"Visiting DotQualifiedExpression: ${expression.name}\")\n        super.visitDotQualifiedExpression(expression, data)\n        return mapOf(\n            \"type\" to \"MethodInvocation\",\n            \"name\" to expression.name,\n            \"methodName\" to visitNode(\n                expression.selectorExpression,\n                data\n            ),//右边部分 ,要执行的方法test1，指令的部分比如比如DemoTest.test1.\n            \"target\" to visitNode(expression.receiverExpression, data),//左边部分,指令的部分比如比如DemoTest\n        )\n//        return {\n//            'type': 'PropertyAccess',\n//            'id': _visitNode(node.propertyName),\n//            'target': _visitNode(node.target),\n//            'isCascaded': node.isCascaded,\n//            'isNullAware': node.isNullAware,\n//            'node': node,\n//        };\n    }\n\n    //\n//    override fun visitArrayAccessExpression(expression: KtArrayAccessExpression) {\n//        super.visitArrayAccessExpression(expression, null)\n//    }\n//\n//    override fun visitQualifiedExpression(expression: KtQualifiedExpression) {\n//        super.visitQualifiedExpression(expression, null)\n//    }\n//\n//    override fun visitDoubleColonExpression(expression: KtDoubleColonExpression) {\n//        super.visitDoubleColonExpression(expression, null)\n//    }\n//\n//    override fun visitCallableReferenceExpression(expression: KtCallableReferenceExpression) {\n//        super.visitCallableReferenceExpression(expression, null)\n//    }\n//\n//    override fun visitClassLiteralExpression(expression: KtClassLiteralExpression) {\n//        super.visitClassLiteralExpression(expression, null)\n//    }\n//\n//    override fun visitDotQualifiedExpression(expression: KtDotQualifiedExpression) {\n//        super.visitDotQualifiedExpression(expression, null)\n//    }\n//\n//    override fun visitSafeQualifiedExpression(expression: KtSafeQualifiedExpression) {\n//        super.visitSafeQualifiedExpression(expression, null)\n//    }\n//\n//    override fun visitObjectLiteralExpression(expression: KtObjectLiteralExpression) {\n//        super.visitObjectLiteralExpression(expression, null)\n//    }\n    override fun visitCatchSection(catchClause: KtCatchClause, data: Void?): Map<String, Any?>? {\n        super.visitCatchSection(catchClause, null)\n        println(\"Visiting visitCatchSection: ${catchClause?.name}\")\n        return mapOf(\n            \"type\" to \"CatchSection\",\n            \"name\" to catchClause.name,\n        )\n    }\n\n    //\n//    override fun visitFinallySection(finallySection: KtFinallySection) {\n//        super.visitFinallySection(finallySection, null)\n//    }\n//\n    override fun visitTypeArgumentList(\n        node: KtTypeArgumentList,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitTypeArgumentList(node, null)\n        println(\"Visiting visitTypeArgumentList: ${node?.name}\")\n        return mapOf(\n            \"type\" to \"TypeArgumentList\",\n            \"arguments\" to visitNodeList(node.arguments, data),\n        )\n    }\n\n    override fun visitThisExpression(\n        node: KtThisExpression,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitThisExpression(node, null)\n        println(\"Visiting visitThisExpression: ${node?.name}\")\n        return mapOf(\n            \"type\" to \"ThisExpression\",\n        )\n    }\n\n    override fun visitSuperExpression(\n        node: KtSuperExpression,\n        data: Void?\n    ): Map<String, Any?>? {\n        super.visitSuperExpression(node, null)\n        println(\"Visiting visitSuperExpression: ${node?.name}\")\n        return mapOf(\n            \"type\" to \"SuperExpression\",\n        )\n    }\n\n    //\n//    override fun visitParenthesizedExpression(expression: KtParenthesizedExpression) {\n//        super.visitParenthesizedExpression(expression, null)\n//    }\n//\n//    override fun visitInitializerList(list: KtInitializerList) {\n//        super.visitInitializerList(list, null)\n//    }\n//\n//    override fun visitAnonymousInitializer(initializer: KtAnonymousInitializer) {\n//        super.visitAnonymousInitializer(initializer, null)\n//    }\n//\n//    override fun visitScriptInitializer(initializer: KtScriptInitializer) {\n//        super.visitScriptInitializer(initializer, null)\n//    }\n//\n//    override fun visitClassInitializer(initializer: KtClassInitializer) {\n//        super.visitClassInitializer(initializer, null)\n//    }\n//\n//    override fun visitPropertyAccessor(\n//        node: KtPropertyAccessor,\n//        data: Void?\n//    ): Map<String, Any?>? {\n//        super.visitPropertyAccessor(node, null)\n//        println(\"Visiting visitProperty: ${node?.name}\")\n//        return mapOf(\n//            \"type\" to \"Property\",\n//            \"id\" to visitNode(node.property, data),\n//        )\n//    }\n//\n//    override fun visitTypeConstraintList(list: KtTypeConstraintList) {\n//        super.visitTypeConstraintList(list, null)\n//    }\n//\n//    override fun visitTypeConstraint(constraint: KtTypeConstraint) {\n//        super.visitTypeConstraint(constraint, null)\n//    }\n//\n//\n//\n//    override fun visitFunctionType(type: KtFunctionType) {\n//        super.visitFunctionType(type, null)\n//    }\n//\n//    override fun visitSelfType(type: KtSelfType) {\n//        super.visitSelfType(type, null)\n//    }\n//\n//    override fun visitBinaryWithTypeRHSExpression(expression: KtBinaryExpressionWithTypeRHS) {\n//        super.visitBinaryWithTypeRHSExpression(expression, null)\n//    }\n//\n//    override fun visitStringTemplateExpression(expression: KtStringTemplateExpression) {\n//        super.visitStringTemplateExpression(expression, null)\n//    }\n//\n//    override fun visitNullableType(nullableType: KtNullableType) {\n//        super.visitNullableType(nullableType, null)\n//    }\n//\n//    override fun visitIntersectionType(intersectionType: KtIntersectionType) {\n//        super.visitIntersectionType(intersectionType, null)\n//    }\n//\n//    override fun visitTypeProjection(typeProjection: KtTypeProjection) {\n//        super.visitTypeProjection(typeProjection, null)\n//    }\n//\n//    override fun visitWhenEntry(jetWhenEntry: KtWhenEntry) {\n//        super.visitWhenEntry(jetWhenEntry, null)\n//    }\n//\n//    override fun visitIsExpression(expression: KtIsExpression) {\n//        super.visitIsExpression(expression, null)\n//    }\n//\n//    override fun visitWhenConditionIsPattern(condition: KtWhenConditionIsPattern) {\n//        super.visitWhenConditionIsPattern(condition, null)\n//    }\n//\n//    override fun visitWhenConditionInRange(condition: KtWhenConditionInRange) {\n//        super.visitWhenConditionInRange(condition, null)\n//    }\n//\n//    override fun visitWhenConditionWithExpression(condition: KtWhenConditionWithExpression) {\n//        super.visitWhenConditionWithExpression(condition, null)\n//    }\n//\n//    override fun visitObjectDeclaration(declaration: KtObjectDeclaration) {\n//        super.visitObjectDeclaration(declaration, null)\n//    }\n\n    private fun isStaticMethod(function: KtNamedFunction): Boolean {\n        // 1. 检查是否为顶层函数\n        if (isTopLevelFunction(function)) {\n            return true\n        }\n\n        if (isObjectMember(function)) {\n            return true\n        }\n\n        // 2. 检查是否为伴生对象内的成员函数\n        if (isCompanionObjectMember(function)) {\n            return true\n        }\n\n        // 3. 检查是否使用了 @JvmStatic 注解\n        if (hasJvmStaticAnnotation(function)) {\n            return true\n        }\n\n        return false\n    }\n\n    private fun isTopLevelFunction(function: KtNamedFunction): Boolean {\n        val parent = function.parent\n        return parent is KtFile\n    }\n\n    private fun isObjectMember(function: KtNamedFunction): Boolean {\n        val containingClass = function.containingClassOrObject\n        return containingClass is KtObjectDeclaration\n    }\n\n\n    private fun isCompanionObjectMember(function: KtNamedFunction): Boolean {\n        val containingClass = function.containingClassOrObject\n        return containingClass is KtObjectDeclaration && containingClass.isCompanion()\n    }\n\n    private fun hasJvmStaticAnnotation(function: KtNamedFunction): Boolean {\n        return function.annotationEntries.any { it.shortName?.asString() == \"JvmStatic\" }\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/Node.kt",
    "content": "package com.aether.core.runtime\n\n\nfun parseError(unit: Any): Nothing {\n    throw Exception(\"Parse error: ${unit.toString()}\")\n}\n\nabstract class Node(\n    private val unit: Map<String, Any>\n) {\n    val type: String =\n        unit[\"type\"] as? String ?: throw IllegalArgumentException(\"Type not found in unit\")\n    var parent: Node? = null\n\n    init {\n        if (unit[\"type\"] == null) {\n            throw IllegalArgumentException(\"Type not found in unit\")\n        }\n    }\n\n    protected fun <T : Node> becomeParentOf(child: T?): T? {\n        child?.parent = this\n        return child\n    }\n\n    fun toUnit(): Map<String, Any> = unit\n\n    // Assuming Expression is a subclass of Node and has a specific property or behavior\n    // If Expression has a special way of setting its parent, you might need to adjust this method.\n    // For now, we'll assume that all Nodes have the same parent-setting logic.\n}\n\nclass Expression(\n    expression: Node,\n    isIdentifier: Boolean = false,\n    isConstructorDeclaration: Boolean = false,\n    isMethodInvocation: Boolean = false,\n    isCallExpression: Boolean = false,\n    isNamedExpression: Boolean = false,\n    isMethodDeclaration: Boolean = false,\n    isBlockStatement: Boolean = false,\n    isEmptyFunctionBody: Boolean = false,\n    isInstanceCreationExpression: Boolean = false,\n    isClassDeclaration: Boolean = false,\n    isPropertyAccess: Boolean = false,\n    isIntegerLiteral: Boolean = false,\n    isStringLiteral: Boolean = false,\n    isStringTemplateEntry: Boolean = false,\n    isStringTemplateExpression: Boolean = false,\n    isBooleanLiteral: Boolean = false,\n    isBinaryExpression: Boolean = false,\n    isReturnStatement: Boolean = false,\n    isVariableDeclarationList: Boolean = false,\n    isFieldDeclaration: Boolean = false,\n    isReferenceExpression: Boolean = false,\n    unit: Map<String, Any>\n) : Node(unit) {\n    var expression: Node? = null;\n    var isIdentifier: Boolean = false\n    var isConstructorDeclaration: Boolean = false\n    var isMethodInvocation: Boolean = false\n    var isMethodDeclaration: Boolean = false\n    var isCallExpression: Boolean = false\n    var isNamedExpression: Boolean = false\n    var isBlockStatement: Boolean = false\n    var isEmptyFunctionBody: Boolean = false\n    var isInstanceCreationExpression: Boolean = false\n    var isClassDeclaration: Boolean = false\n    var isPropertyAccess: Boolean = false\n    var isIntegerLiteral: Boolean = false\n    var isStringLiteral: Boolean = false\n    var isStringTemplateEntry: Boolean = false\n    var isStringTemplateExpression: Boolean = false\n    var isBooleanLiteral: Boolean = false\n    var isBinaryExpression: Boolean = false\n    var isReturnStatement: Boolean = false\n    var isVariableDeclarationList: Boolean = false\n    var isFieldDeclaration: Boolean = false\n    var isReferenceExpression: Boolean = false\n\n    init {\n        this.expression = expression\n        this.isIdentifier = isIdentifier\n        this.isConstructorDeclaration = isConstructorDeclaration\n        this.isMethodInvocation = isMethodInvocation\n        this.isMethodDeclaration = isMethodDeclaration\n        this.isCallExpression = isCallExpression\n        this.isNamedExpression = isNamedExpression\n        this.isBlockStatement = isBlockStatement\n        this.isEmptyFunctionBody = isEmptyFunctionBody\n        this.isInstanceCreationExpression = isInstanceCreationExpression\n        this.isClassDeclaration = isClassDeclaration\n        this.isPropertyAccess = isPropertyAccess\n        this.isIntegerLiteral = isIntegerLiteral\n        this.isStringLiteral = isStringLiteral\n        this.isStringTemplateEntry = isStringTemplateEntry\n        this.isStringTemplateExpression = isStringTemplateExpression\n        this.isBooleanLiteral = isBooleanLiteral\n        this.isBinaryExpression = isBinaryExpression\n        this.isReturnStatement = isReturnStatement\n        this.isVariableDeclarationList = isVariableDeclarationList\n        this.isFieldDeclaration = isFieldDeclaration\n        this.isReferenceExpression = isReferenceExpression\n    }\n\n    fun get(): Node? {\n        return expression\n    }\n\n    val asConstructorDeclaration: ConstructorDeclaration\n        get() = expression as ConstructorDeclaration\n\n    val asBlockStatement: BlockStatement\n        get() = expression as BlockStatement\n\n    val asInstanceCreationExpression: InstanceCreationExpression\n        get() = expression as InstanceCreationExpression\n\n    val asClassDeclaration: ClassDeclaration\n        get() = expression as ClassDeclaration\n\n    val asVariableDeclarationList: PropertyStatement\n        get() = expression as PropertyStatement\n\n    val asFieldDeclaration: FieldDeclaration\n        get() = expression as FieldDeclaration\n\n    val asPropertyAccess: PropertyAccess\n        get() = expression as PropertyAccess\n\n    val asReturnStatement: ReturnStatement\n        get() = expression as ReturnStatement\n    val asBinaryExpression: BinaryExpression\n        get() = expression as BinaryExpression\n\n    val asIntegerLiteral: IntegerLiteral\n        get() = expression as IntegerLiteral\n\n    val asStringLiteral: StringTemplateExpression\n        get() = expression as StringTemplateExpression\n\n    val asStringTemplateEntry: StringTemplateEntry\n        get() = expression as StringTemplateEntry\n\n    val asNamedExpression: Argument\n        get() = expression as Argument\n\n    val asBooleanLiteral: BooleanLiteral\n        get() = expression as BooleanLiteral\n\n    val asStringTemplateExpression: StringTemplateExpression\n        get() = expression as StringTemplateExpression\n\n    val asIdentifier: Identifier\n        get() = expression as Identifier\n\n    val asMethodInvocation: MethodInvocation\n        get() = expression as MethodInvocation\n\n    val asCallExpression: CallExpression\n        get() = expression as CallExpression\n\n    val asMethodExpression: MethodDeclaration\n        get() = expression as MethodDeclaration\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): Expression {\n            val type = unit[\"type\"]\n            if (type == \"ClassDeclaration\") {\n                return Expression(\n                    ClassDeclaration.fromUnit(unit),\n                    isClassDeclaration = true,\n                    unit = unit\n                )\n            } else if (type == \"MethodDeclaration\") {\n                return Expression(\n                    MethodDeclaration.fromUnit(unit), isMethodDeclaration = true, unit = unit\n                );\n            } else if (type == \"BlockStatement\") {\n                return Expression(\n                    BlockStatement.fromUnit(unit), isBlockStatement = true, unit = unit\n                );\n            } else if (type == \"EmptyFunctionBody\") {\n                return Expression(\n                    EmptyFunctionBody.fromUnit(unit), isEmptyFunctionBody = true, unit = unit\n                );\n            } else if (type == \"InstanceCreationExpression\") {\n                return Expression(\n                    InstanceCreationExpression.fromUnit(unit),\n                    isInstanceCreationExpression = true,\n                    unit = unit\n                );\n            } else if (type == \"ReturnStatement\") {\n                return Expression(\n                    ReturnStatement.fromUnit(unit), isReturnStatement = true, unit = unit\n                );\n            } else if (type == \"PropertyAccess\") {\n                return Expression(\n                    PropertyAccess.fromUnit(unit),\n                    isPropertyAccess = true,\n                    unit = unit\n                )\n            } else if (type == \"FieldDeclaration\") {\n                return Expression(\n                    FieldDeclaration.fromUnit(unit),\n                    isFieldDeclaration = true,\n                    unit = unit\n                )\n            } else if (type == \"PropertyStatement\") {\n                return Expression(\n                    PropertyStatement.fromUnit(unit),\n                    isVariableDeclarationList = true,\n                    unit = unit\n                )\n            } else if (type == \"ConstantExpression\") {\n                return Expression(\n                    ConstantExpression.fromUnit(unit), unit = unit\n                )\n            } else if (type == \"INTEGER_CONSTANT\") {\n                return Expression(\n                    IntegerLiteral.fromUnit(unit), isIntegerLiteral = true, unit = unit\n                );\n            } else if (type == \"StringTemplateExpression\") {\n                return Expression(\n                    StringTemplateExpression.fromUnit(unit),\n                    isStringTemplateExpression = true,\n                    unit = unit\n                )\n            } else if (type == \"StringLiteral\") {\n                return Expression(\n                    StringTemplateExpression.fromUnit(unit), isStringLiteral = true, unit = unit\n                )\n            } else if (type == \"BOOLEAN_CONSTANT\") {\n                return Expression(\n                    BooleanLiteral.fromUnit(unit), isBooleanLiteral = true, unit = unit\n                )\n            } else if (type == \"BinaryExpression\") {\n                return Expression(\n                    BinaryExpression.fromUnit(unit), isBinaryExpression = true, unit = unit\n                )\n            } else if (type == \"Identifier\") {\n                return Expression(\n                    Identifier.fromUnit(unit),\n                    isReferenceExpression = true,\n                    isIdentifier = true,\n                    unit = unit\n                )\n            } else if (type == \"ImportDirective\") {\n                return Expression(\n                    ImportDirective.fromUnit(unit), isIdentifier = false, unit = unit\n                )\n            } else if (type == \"CallExpression\") {\n                return Expression(\n                    CallExpression.fromUnit(unit),\n                    isCallExpression = true,\n                    isIdentifier = false,\n                    unit = unit\n                )\n            } else if (type == \"MethodInvocation\") {\n                return Expression(\n                    MethodInvocation.fromUnit(unit),\n                    isMethodInvocation = true,\n                    isIdentifier = false,\n                    unit = unit\n                )\n            } else if (type == \"StringTemplateEntry\") {\n                return Expression(\n                    StringTemplateEntry.fromUnit(unit),\n                    isStringTemplateEntry = true,\n                    isMethodInvocation = false,\n                    isIdentifier = false,\n                    unit = unit\n                )\n            } else if (type == \"SecondaryConstructor\") {\n                return Expression(\n                    ConstructorDeclaration.fromUnit(unit),\n                    isConstructorDeclaration = true,\n                    unit = unit\n                )\n            } else if (type == \"Argument\") {\n                val isNamed = (unit[\"isNamed\"] ?: false) as Boolean\n                return Expression(\n                    Argument.fromUnit(unit), isNamedExpression = isNamed, unit = unit\n                );\n            } else if (type == \"Column\") {\n                val isNamed = (unit[\"isNamed\"] ?: false) as Boolean\n                return Expression(\n                    Argument.fromUnit(unit), isNamedExpression = isNamed, unit = unit\n                );\n            }\n            return Expression(\n                ClassDeclaration.fromUnit(unit), unit = mapOf(\n                    \"type\" to \"e\"\n                )\n            )\n        }\n    }\n\n}\n\nclass BlockStatement(body: List<Expression>, unit: Map<String, Any>) : Node(unit) {\n    var body: List<Expression>? = null\n\n    init {\n        this.body = body\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): BlockStatement {\n            if (unit[\"type\"] != \"BlockStatement\") {\n                parseError(unit)\n            }\n            val body = mutableListOf<Expression>()\n            if (unit[\"type\"] == \"BlockStatement\") {\n                if (unit[\"body\"].isNotEmptyCollection()) {\n                    val items = unit[\"body\"] as List<Map<String, Any>>\n                    for (item in items) {\n                        body.add(Expression.fromUnit(item))\n                    }\n                }\n            }\n            return BlockStatement(body = body, unit)\n        }\n    }\n\n}\n\nclass EmptyFunctionBody(unit: Map<String, Any>) : Node(unit) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): EmptyFunctionBody {\n            if (unit[\"type\"] != \"EmptyFunctionBody\") {\n                parseError(unit)\n            }\n            return EmptyFunctionBody(unit)\n        }\n    }\n\n}\n\nclass PropertyAccess : Node {\n    var name: String?\n    var targetExpression: Expression?\n    var selectorExpression: Expression?\n    var isCascaded: Boolean\n    var isNullAware: Boolean\n\n    constructor(\n        name: String?,\n        targetExpression: Expression?,\n        selectorExpression: Expression?,\n        isCascaded: Boolean,\n        isNullAware: Boolean,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.name = name\n        this.targetExpression = targetExpression\n        this.selectorExpression = selectorExpression\n        this.isCascaded = isCascaded\n        this.isNullAware = isNullAware\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): PropertyAccess {\n            if (unit[\"type\"] == \"PropertyAccess\") {\n                val targetExpression =\n                    unit[\"targetExpression\"]?.let { Expression.fromUnit(it as Map<String, Any>) }\n                val selectorExpression =\n                    unit[\"selectorExpression\"]?.let { Expression.fromUnit(it as Map<String, Any>) }\n                return PropertyAccess(\n                    ((unit[\"selectorExpression\"] as Map<String, Any>)[\"target\"] as Map<String, Any>)[\"name\"] as String,\n//                    unit[\"name\"] as String?,\n                    targetExpression,\n                    selectorExpression,\n                    unit[\"isCascaded\"] as? Boolean ?: false,\n                    unit[\"isNullAware\"] as? Boolean ?: false,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\nclass FieldDeclaration(\n    name: String,\n    isStatic: Boolean,\n    target: Expression?,\n    unit: Map<String, Any>\n) : Node(unit) {\n    var target: Expression? = null\n    var name: String\n    var isStatic: Boolean = false\n\n    init {\n        this.target = target\n        this.name = name\n        this.isStatic = isStatic\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): FieldDeclaration {\n            if (unit[\"type\"] != \"FieldDeclaration\") {\n                return parseError(unit)\n            }\n            var target: Expression? = null\n            if (unit[\"initializer\"] != null) {\n                target = Expression.fromUnit(unit[\"initializer\"] as Map<String, Any>);\n            }\n            return FieldDeclaration(\n                unit[\"name\"] as String,\n                false,\n//                unit[\"isStatic\"] as Boolean,\n                target = target,\n                unit = unit\n            )\n        }\n    }\n}\n\nclass PropertyStatement(\n    name: String,\n    isStatic: Boolean,\n    target: Expression?,\n    unit: Map<String, Any>\n) : Node(unit) {\n    var target: Expression? = null\n    var name: String\n    var isStatic: Boolean = false\n\n    init {\n        this.target = target\n        this.name = name\n        this.isStatic = isStatic\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): PropertyStatement {\n            if (unit[\"type\"] != \"PropertyStatement\") {\n                parseError(unit)\n            }\n            var target: Expression? = null\n            if (unit[\"type\"] == \"PropertyStatement\") {\n                if (unit[\"initializer\"] != null) {\n                    target = Expression.fromUnit(unit[\"initializer\"] as Map<String, Any>);\n                }\n//                if (unit[\"parameters\"].isNotEmptyMap()) {\n//                    var argument: Expression? = null\n//                    if (unit[\"argument\"] != null) {\n//                        argument = Expression.fromUnit(unit[\"parameters\"] as Map<String, Any>);\n//                    }\n//                    return PropertyStatement(argument = argument, unit = unit)\n//                }\n            }\n            return PropertyStatement(\n                unit[\"name\"] as String,\n                false,\n//                unit[\"isStatic\"] as Boolean,\n                target = target,\n                unit = unit\n            )\n        }\n    }\n}\n\nclass StringLiteral(value: String?, unit: Map<String, Any>) : Node(unit) {\n    var value: String? = null\n\n    init {\n        this.value = value\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): StringLiteral {\n            if (unit[\"type\"] != \"StringLiteral\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"StringLiteral\") {\n                return StringLiteral(value = (unit[\"value\"].toString()), unit = unit)\n            }\n            return StringLiteral(value = null, unit = unit)\n        }\n    }\n}\n\nclass StringTemplateEntry(value: String?, unit: Map<String, Any>) : Node(unit) {\n    var value: String? = null\n\n    init {\n        this.value = value\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): StringTemplateEntry {\n            if (unit[\"type\"] != \"StringTemplateEntry\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"StringTemplateEntry\") {\n                return StringTemplateEntry(value = (unit[\"value\"].toString()), unit = unit)\n            }\n            return StringTemplateEntry(value = null, unit = unit)\n        }\n    }\n}\n\nclass ConstructorName(name: String, typeName: String?, unit: Map<String, Any>) : Node(unit) {\n    val name: String = name\n    val typeName: String? = typeName\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ConstructorName {\n            return ConstructorName(\n                name = unit[\"name\"] as String,\n                typeName = unit[\"typeName\"] as String,\n                unit = unit\n            )\n        }\n\n        private fun parseError(unit: Map<String, Any?>): Nothing {\n            throw IllegalArgumentException(\"Parse error on unit: $unit\")\n        }\n    }\n}\n\nclass InstanceCreationExpression(\n    constructorName: ConstructorName?,\n    argumentList: ArgumentList?,\n    children: List<Expression>?,\n    unit: Map<String, Any>\n) : Node(unit) {\n    var constructorName: ConstructorName? = null\n    var children: List<Expression>? = null\n    var argumentList: ArgumentList? = null\n\n    init {\n        this.constructorName = constructorName\n        this.children = children\n        this.argumentList = argumentList\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): InstanceCreationExpression {\n            if (unit[\"type\"] != \"InstanceCreationExpression\") {\n                return parseError(unit)\n            }\n\n            val name = unit[\"constructorName\"] as String\n            val children = mutableListOf<Expression>()\n\n            // 处理子元素\n            val childrenList = unit[\"children\"]\n            if (childrenList is List<*> && childrenList.isNotEmpty()) {\n                // 遍历子元素列表\n                for (child in childrenList) {\n                    if (child is Map<*, *>) {\n                        @Suppress(\"UNCHECKED_CAST\")\n                        // 将每个子元素转换为Expression\n                        val childExpr = Expression.fromUnit(child as Map<String, Any>)\n                        children.add(childExpr)\n                    }\n                }\n            }\n\n            return InstanceCreationExpression(\n                ConstructorName(name, name, unit),\n                if (unit[\"argumentList\"] == null) null else ArgumentList.fromUnit(unit[\"argumentList\"] as Map<String, Any>),\n                children,\n                unit = unit\n            )\n        }\n    }\n}\n\nclass StringTemplateExpression(target: Expression?, unit: Map<String, Any>) : Node(unit) {\n    var target: Expression? = null\n\n    init {\n        this.target = target\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): StringTemplateExpression {\n            if (unit[\"type\"] != \"StringTemplateExpression\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"StringTemplateExpression\") {\n                var target: Expression? = null\n                if (unit[\"body\"] != null) {\n                    target = Expression.fromUnit(unit[\"body\"] as Map<String, Any>)\n                    return StringTemplateExpression(\n                        target = target,\n                        unit = unit[\"body\"] as Map<String, Any>\n                    )\n                }\n            }\n            return StringTemplateExpression(target = null, unit = unit)\n        }\n    }\n}\n\nclass BinaryExpression(\n    operator: String, left: Expression, right: Expression, unit: Map<String, Any>\n) : Node(unit) {\n    ///运算符\n    /// * +\n    /// * -\n    /// * *\n    /// * /\n    /// * <\n    /// * >\n    /// * <=\n    /// * >=\n    /// * ==\n    /// * &&\n    /// * ||\n    /// * %\n    /// * <<\n    /// * |\n    /// * &\n    /// * >>\n    ///\n    val operator: String = operator\n\n    ///左操作表达式\n    val left: Expression = left\n\n    ///右操作表达式\n    val right: Expression = right\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): BinaryExpression {\n            if (unit[\"type\"] != \"BinaryExpression\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"BinaryExpression\") {\n//                return BinaryExpression(unit = unit)\n            }\n            return BinaryExpression(\n                unit[\"operator\"] as String,\n                Expression.fromUnit(unit[\"left\"] as Map<String, Any>),\n                Expression.fromUnit(unit[\"right\"] as Map<String, Any>),\n                unit = unit\n            )\n        }\n    }\n}\n\nclass Identifier : Node {\n    constructor(name: String, unit: Map<String, Any>) : super(unit) {\n        this.name = name\n    }\n\n    var name: String\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): Identifier {\n            if (unit[\"type\"] == \"Identifier\") {\n                return Identifier(\n                    name = (unit[\"name\"].toString()), unit = unit\n                )\n            }\n            parseError(unit)\n        }\n\n        fun isPrivateName(name: String): Boolean {\n            return false\n        }\n    }\n}\n\nclass BooleanLiteral(value: Boolean, unit: Map<String, Any>) : Node(unit) {\n    var value: Boolean = false\n\n    init {\n        this.value = value\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): BooleanLiteral {\n            if (unit[\"type\"] != \"BOOLEAN_CONSTANT\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"BOOLEAN_CONSTANT\") {\n                return BooleanLiteral(value = (unit[\"value\"].toString().toBoolean()), unit = unit)\n            }\n            return BooleanLiteral(value = false, unit = unit)\n        }\n    }\n}\n\nclass IntegerLiteral(value: Int, unit: Map<String, Any>) : Node(unit) {\n    var value: Int? = 0\n\n    init {\n        this.value = value\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): IntegerLiteral {\n            if (unit[\"type\"] != \"INTEGER_CONSTANT\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"INTEGER_CONSTANT\") {\n                return IntegerLiteral(value = (unit[\"value\"].toString().toInt()), unit = unit)\n            }\n            return IntegerLiteral(value = 0, unit = unit)\n        }\n    }\n}\n\nclass ConstantExpression(unit: Map<String, Any>) : Node(unit) {\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ConstantExpression {\n            if (unit[\"type\"] != \"ConstantExpression\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"ConstantExpression\") {\n//                if (unit[\"parameters\"].isNotEmptyMap()) {\n//                    var argument: Expression? = null\n//                    if (unit[\"argument\"] != null) {\n//                        argument = Expression.fromUnit(unit[\"parameters\"] as Map<String, Any>);\n//                    }\n//                    return PropertyStatement(argument = argument, unit = unit)\n//                }\n            }\n            return ConstantExpression(unit = unit)\n        }\n    }\n}\n\nclass ReturnStatement(val argument: Expression?, unit: Map<String, Any>) : Node(unit) {\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ReturnStatement {\n            if (unit[\"type\"] != \"ReturnStatement\") {\n                parseError(unit)\n            }\n            if (unit[\"type\"] == \"ReturnStatement\") {\n                var argument: Expression? = null\n                if (unit[\"argument\"] != null) {\n                    argument = Expression.fromUnit(unit[\"argument\"] as Map<String, Any>);\n                }\n                return ReturnStatement(argument = argument, unit = unit)\n            }\n            return ReturnStatement(null, unit = unit)\n        }\n    }\n\n}\n\nclass ClassDeclaration(members: List<Expression>, name: String, unit: Map<String, Any>) :\n    Node(unit) {\n    var name: String = \"\"\n    var members: List<Expression>? = null\n\n    init {\n        this.members = members\n        this.name = name\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ClassDeclaration {\n            if (unit[\"type\"] != \"ClassDeclaration\") {\n                parseError(unit)\n            }\n            val members = mutableListOf<Expression>()\n            if (unit[\"type\"] == \"ClassDeclaration\") {\n                if (unit[\"members\"] is List<*>) {\n                    val list = unit[\"members\"] as List<Map<String, Any>>\n                    for (member in list) {\n                        members.add(Expression.fromUnit(member))\n                    }\n                }\n            }\n            return ClassDeclaration(members = members, name = (unit[\"name\"] ?: \"\") as String, unit)\n        }\n    }\n\n}\n\nclass MethodDeclaration : Node {\n\n    var parameters: FormalParameterList?\n    var name: String\n    var isStatic: Boolean\n    var isSetter: Boolean\n    var bodyExpression: Expression\n    var isAsync: Boolean\n\n    constructor(\n        parameters: FormalParameterList?,\n        name: String,\n        isStatic: Boolean,\n        isSetter: Boolean,\n        bodyExpression: Expression,\n        isAsync: Boolean,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.name = name\n        this.isStatic = isStatic\n        this.isSetter = isSetter\n        this.parameters = parameters\n        this.bodyExpression = bodyExpression\n        this.isAsync = isAsync\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): Node {\n            if (unit[\"type\"] != \"MethodDeclaration\") {\n                parseError(unit)\n            }\n            var parameters: FormalParameterList? = null;\n            if (unit[\"parameters\"].isNotEmptyCollection()) {\n                val any = unit[\"parameters\"]\n                val map = mutableMapOf<String, Any>()\n                map[\"type\"] = \"ParameterList\"\n                map[\"parameters\"] = unit[\"parameters\"] as Any\n                parameters = FormalParameterList.fromUnit(map);\n            }\n            return MethodDeclaration(\n                parameters = parameters,\n                unit[\"name\"] as String,\n                unit[\"isStatic\"] as Boolean,\n                unit[\"isSetter\"] as Boolean,\n                bodyExpression = Expression.fromUnit(unit[\"body\"] as Map<String, Any>),\n                isAsync = false,\n                unit = unit\n            )\n        }\n    }\n}\n\nclass VariableDeclarator : Node {\n\n    var name: String\n    var typeName: String?\n    var init: Expression?\n    var isStatic: Boolean\n    var isFinal: Boolean\n    var isConst: Boolean\n    var isLate: Boolean\n    var isTopLevel: Boolean\n\n    constructor(\n        name: String,\n        typeName: String?,\n        init: Expression?,\n        isStatic: Boolean,\n        isFinal: Boolean,\n        isConst: Boolean,\n        isLate: Boolean,\n        isTopLevel: Boolean,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.name = name\n        this.typeName = typeName\n        this.init = init\n        this.isStatic = isStatic\n        this.isFinal = isFinal\n        this.isConst = isConst\n        this.isLate = isLate\n        this.isTopLevel = isTopLevel\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): VariableDeclarator {\n            if (unit[\"type\"] == \"VariableDeclarator\") {\n                val init = unit[\"init\"]?.let { Expression.fromUnit(it as Map<String, Any>) }\n                val isStatic = unit[\"isStatic\"] as? Boolean ?: false\n                val isTopLevel = unit[\"isTopLevel\"] as? Boolean ?: false\n                return VariableDeclarator(\n                    Identifier.fromUnit(unit[\"id\"] as Map<String, Any>).name,\n                    unit[\"typeName\"] as? String,\n                    init,\n                    isStatic,\n                    unit[\"isFinal\"] as? Boolean ?: false,\n                    unit[\"isConst\"] as? Boolean ?: false,\n                    unit[\"isLate\"] as? Boolean ?: false,\n                    isTopLevel,\n                    unit\n                )\n            }\n            return parseError(unit)\n        }\n    }\n}\n\n//class FunctionDeclaration(\n//    name: String,\n//    unit: Map<String, Any>\n//) : Node(unit) {\n//    var name: String = \"\"\n//\n//    init {\n//        this.name = name\n//    }\n//\n//    companion object {\n//        fun fromUnit(unit: Map<String, Any>): Node {\n//            if (unit[\"type\"] != \"FunctionDeclaration\") {\n//                parseError(unit)\n//            }\n//            return FunctionDeclaration(\n//                unit[\"name\"] as String,\n//                unit = unit\n//            )\n//        }\n//    }\n//}\n\nclass FormalParameterList(\n    val parameters: List<FormalParameter>,\n    unit: Map<String, Any>\n) : Node(unit) {\n\n    init {\n        parameters.forEach { becomeParentOf(it) }\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): FormalParameterList {\n            if (unit[\"type\"] == \"ParameterList\") {\n                return FormalParameterList(\n                    (unit[\"parameters\"] as List<Map<String, Any>>)\n                        .map { FormalParameter.fromUnit(it) },\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\nabstract class FormalParameter(unit: Map<String, Any>) : Node(unit) {\n\n    abstract val name: String\n    abstract val typeName: String?\n    abstract val isFinal: Boolean\n    abstract val isNamed: Boolean\n    abstract val isPositional: Boolean\n    abstract val isOptional: Boolean\n    abstract val isOptionalNamed: Boolean\n    abstract val isOptionalPositional: Boolean\n    abstract val isRequired: Boolean\n    abstract val isRequiredNamed: Boolean\n    abstract val isRequiredPositional: Boolean\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): FormalParameter {\n            return when (unit[\"type\"]) {\n                \"SimpleFormalParameter\" -> SimpleFormalParameter.fromUnit(unit)\n                \"DefaultFormalParameter\" -> DefaultFormalParameter.fromUnit(unit)\n//                \"FieldFormalParameter\" -> FieldFormalParameter.fromUnit(unit)\n                else -> parseError(unit)\n            }\n        }\n    }\n}\n\nclass FieldFormalParameter(\n    name: String,\n    typeName: String?,\n    isFinal: Boolean,\n    isNamed: Boolean,\n    isPositional: Boolean,\n    isOptional: Boolean,\n    isOptionalNamed: Boolean,\n    isOptionalPositional: Boolean,\n    isRequired: Boolean,\n    isRequiredNamed: Boolean,\n    isRequiredPositional: Boolean,\n    val parameters: FormalParameterList?,\n    unit: Map<String, Any>\n) : SimpleFormalParameter(\n    name,\n    typeName,\n    isFinal,\n    isNamed,\n    isPositional,\n    isOptional,\n    isOptionalNamed,\n    isOptionalPositional,\n    isRequired,\n    isRequiredNamed,\n    isRequiredPositional,\n    unit\n) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): FieldFormalParameter {\n            if (unit[\"type\"] == \"FieldFormalParameter\") {\n                val parameters =\n                    unit[\"parameters\"]?.let { FormalParameterList.fromUnit(it as Map<String, Any>) }\n                val typeName =\n                    unit[\"typeName\"]?.let { TypeName.fromUnit(it as Map<String, Any>).name }\n                return FieldFormalParameter(\n                    unit[\"name\"] as String,\n                    typeName,\n                    unit[\"isFinal\"] as Boolean,\n                    unit[\"isNamed\"] as Boolean,\n                    unit[\"isPositional\"] as Boolean,\n                    unit[\"isOptional\"] as Boolean,\n                    unit[\"isOptionalNamed\"] as Boolean,\n                    unit[\"isOptionalPositional\"] as Boolean,\n                    unit[\"isRequired\"] as Boolean,\n                    unit[\"isRequiredNamed\"] as Boolean,\n                    unit[\"isRequiredPositional\"] as Boolean,\n                    parameters,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\nabstract class NormalFormalParameter(unit: Map<String, Any>) : FormalParameter(unit)\n\n\nopen class SimpleFormalParameter(\n    val _name: String,\n    val _typeName: String?,\n    val _isFinal: Boolean,\n    val _isNamed: Boolean,\n    val _isPositional: Boolean,\n    val _isOptional: Boolean,\n    val _isOptionalNamed: Boolean,\n    val _isOptionalPositional: Boolean,\n    val _isRequired: Boolean,\n    val _isRequiredNamed: Boolean,\n    val _isRequiredPositional: Boolean,\n    unit: Map<String, Any>\n) : NormalFormalParameter(unit) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): SimpleFormalParameter {\n            if (unit[\"type\"] == \"SimpleFormalParameter\") {\n                val typeName = unit[\"typeName\"]\n//                val typeName = unit[\"typeName\"]?.let { TypeName.fromUnit(it as Map<String, Any>).name }\n                return SimpleFormalParameter(\n                    unit[\"name\"] as String,\n                    (typeName ?: \"\").toString(),\n                    unit[\"isFinal\"] as? Boolean ?: false,\n                    unit[\"isNamed\"] as? Boolean ?: false,\n                    unit[\"isPositional\"] as? Boolean ?: false,\n                    unit[\"isOptional\"] as? Boolean ?: false,\n                    unit[\"isOptionalNamed\"] as? Boolean ?: false,\n                    unit[\"isOptionalPositional\"] as? Boolean ?: false,\n                    unit[\"isRequired\"] as? Boolean ?: false,\n                    unit[\"isRequiredNamed\"] as? Boolean ?: false,\n                    unit[\"isRequiredPositional\"] as? Boolean ?: false,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n\n    override val isFinal: Boolean\n        get() = _isFinal\n\n    override val isNamed: Boolean\n        get() = _isNamed\n\n    override val isOptional: Boolean\n        get() = _isOptional\n\n    override val isOptionalNamed: Boolean\n        get() = _isOptionalNamed\n\n    override val isOptionalPositional: Boolean\n        get() = _isOptionalPositional\n\n    override val isPositional: Boolean\n        get() = _isPositional\n\n    override val isRequired: Boolean\n        get() = _isRequired\n\n    override val isRequiredNamed: Boolean\n        get() = _isRequiredNamed\n\n    override val isRequiredPositional: Boolean\n        get() = _isRequiredPositional\n\n    override val name: String\n        get() = _name\n\n    override val typeName: String?\n        get() = _typeName\n}\n\nclass TypeName(\n    name: String,\n    typeArguments: TypeArgumentList?,\n    unit: Map<String, Any>\n) : NamedType(name, typeArguments, unit) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): TypeName {\n            if (unit[\"type\"] == \"TypeName\") {\n                val typeArguments =\n                    unit[\"typeArguments\"]?.let { TypeArgumentList.fromUnit(it as Map<String, Any>) }\n                return TypeName(\n                    unit[\"name\"] as String,\n                    typeArguments,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\nclass TypeArgumentList : Node {\n\n    val arguments: List<TypeAnnotation>\n\n    constructor(arguments: List<TypeAnnotation>, unit: Map<String, Any>) : super(unit) {\n        this.arguments = arguments\n    }\n\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): TypeArgumentList {\n            if (unit[\"type\"] == \"TypeArgumentList\") {\n                val arguments = unit[\"arguments\"]?.let {\n                    if (it is List<*>) {\n                        it.mapNotNull { argument ->\n                            if (argument is Map<*, *>) {\n                                TypeAnnotation.fromUnit(argument as Map<String, Any>)\n                            } else {\n                                null\n                            }\n                        }\n                    } else {\n                        emptyList()\n                    }\n                } ?: emptyList()\n                return TypeArgumentList(arguments, unit)\n            }\n\n            parseError(unit)\n        }\n    }\n}\n\nabstract class NamedType(\n    val name: String,\n    val typeArguments: TypeArgumentList?,\n    unit: Map<String, Any>\n) : TypeAnnotation(unit) {\n\n    init {\n        becomeParentOf(typeArguments)\n    }\n}\n\nabstract class TypeAnnotation(unit: Map<String, Any>) : Node(unit) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): TypeAnnotation {\n            val type = unit[\"type\"]\n            return when (type) {\n                \"TypeName\" -> TypeName.fromUnit(unit)\n//                \"GenericFunctionType\" -> GenericFunctionType.fromUnit(unit)\n                else -> parseError(unit)\n            }\n        }\n    }\n}\n\n\nclass DefaultFormalParameter(\n    val parameter: FormalParameter,\n    val defaultValue: Expression?,\n    unit: Map<String, Any>\n) : FormalParameter(unit) {\n\n    init {\n        becomeParentOf(parameter)\n        becomeParentOf(defaultValue)\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): DefaultFormalParameter {\n            if (unit[\"type\"] == \"DefaultFormalParameter\") {\n                val defaultValue =\n                    unit[\"defaultValue\"]?.let { Expression.fromUnit(it as Map<String, Any>) }\n                return DefaultFormalParameter(\n                    FormalParameter.fromUnit(unit[\"parameter\"] as Map<String, Any>),\n                    defaultValue,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n\n    override val isFinal: Boolean\n        get() = parameter.isFinal\n\n    override val isNamed: Boolean\n        get() = parameter.isNamed\n\n    override val isOptional: Boolean\n        get() = parameter.isOptional\n\n    override val isOptionalNamed: Boolean\n        get() = parameter.isOptionalNamed\n\n    override val isOptionalPositional: Boolean\n        get() = parameter.isOptionalPositional\n\n    override val isPositional: Boolean\n        get() = parameter.isPositional\n\n    override val isRequired: Boolean\n        get() = parameter.isRequired\n\n    override val isRequiredNamed: Boolean\n        get() = parameter.isRequiredNamed\n\n    override val isRequiredPositional: Boolean\n        get() = parameter.isRequiredPositional\n\n    override val name: String\n        get() = parameter.name\n\n    override val typeName: String?\n        get() = parameter.typeName\n}\n\nclass CompilationUnit(unit: Map<String, Any>) : Node(unit) {\n    var declarations: List<Expression>? = null\n    var directives: List<Directive>? = null\n\n    //\n    constructor(\n        declarations: List<Expression>, directives: List<Directive>, unit: Map<String, Any>\n    ) : this(unit) {\n        this.declarations = declarations\n        this.directives = directives\n    }\n\n    // 从单元数据创建CompilationUnit实例的工厂方法\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): CompilationUnit {\n            if (unit[\"type\"] != \"CompilationUnit\") {\n                parseError(unit)\n            }\n            val declarations = unit[\"declarations\"]?.let { it as? List<Map<String, Any>> }\n                ?.map { Expression.fromUnit(it) } ?: emptyList()\n\n            val directives = unit[\"directives\"]?.let { it as? List<Map<String, Any>> }\n                ?.map { Directive.fromUnit(it) } ?: emptyList()\n\n            return CompilationUnit(declarations, directives, unit)\n        }\n    }\n}\n\nclass ImportDirective : NamespaceDirective {\n    var refix: String?\n\n    var name: String\n\n    private constructor(uri: String, prefix: String?, name: String, unit: Map<String, Any>) : super(\n        uri,\n        unit\n    ) {\n        this.refix = prefix;\n        this.name = name\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ImportDirective {\n            if (unit[\"type\"] == \"ImportDirective\") {\n//                val combinators = (unit[\"combinators\"] as List<Map<String, Any>>).map { Combinator.fromUnit(it as Map<String, Any>) }\n                val prefix = unit[\"alias\"]\n                return ImportDirective(\n                    unit[\"importPath\"] as String,\n                    prefix as String?,\n                    unit[\"name\"] as String,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\nclass CallExpression : Node {\n    val methodName: String\n    val target: Expression?\n    val argumentList: ArgumentList\n    val isCascaded: Boolean\n    val isNullAware: Boolean\n\n    private constructor(\n        methodName: String,\n        target: Expression?,\n        argumentList: ArgumentList,\n        isCascaded: Boolean,\n        isNullAware: Boolean,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.methodName = methodName\n        this.target = target\n        this.argumentList = argumentList\n        this.isCascaded = isCascaded\n        this.isNullAware = isNullAware\n        becomeParentOf(target)\n        becomeParentOf(argumentList)\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): CallExpression {\n            if (unit[\"type\"] == \"CallExpression\") {\n                val target = unit[\"target\"]?.let { Expression.fromUnit(it as Map<String, Any>) }\n                return CallExpression(\n                    Identifier.fromUnit(unit[\"methodName\"] as Map<String, Any>).name,\n                    target,\n                    ArgumentList.fromUnit(unit[\"argumentList\"] as Map<String, Any>),\n                    unit[\"isCascaded\"] as? Boolean ?: false,\n                    unit[\"isNullAware\"] as? Boolean ?: false,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\n\nclass MethodInvocation : Node {\n    val methodName: Identifier?\n    var isStatic: Boolean = true\n    var isSetter: Boolean = false\n    val target: Expression?\n    val argumentList: ArgumentList?\n    val isCascaded: Boolean\n    val isNullAware: Boolean\n\n    private constructor(\n        methodName: Identifier,\n        target: Expression?,\n        argumentList: ArgumentList?,\n        isCascaded: Boolean,\n        isNullAware: Boolean,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.methodName = methodName\n        this.target = target\n        this.argumentList = argumentList\n        this.isCascaded = isCascaded\n        this.isNullAware = isNullAware\n        becomeParentOf(target)\n        becomeParentOf(argumentList)\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): MethodInvocation {\n            if (unit[\"type\"] == \"MethodInvocation\") {\n                val target = unit[\"target\"]?.let { Expression.fromUnit(it as Map<String, Any>) }\n                return MethodInvocation(\n//                    if ((unit[\"methodName\"] as Map<String, Any>)[\"target\"] == null) \"\" else ((unit[\"methodName\"] as Map<String, Any>)[\"target\"] as Map<String, Any>)[\"name\"] as String,\n                    Identifier.fromUnit(unit[\"methodName\"] as Map<String, Any>),\n                    target,\n                    if ((unit[\"methodName\"] as Map<String, Any>)[\"argumentList\"] == null) null else ArgumentList.fromUnit(\n                        (unit[\"methodName\"] as Map<String, Any>)[\"argumentList\"] as Map<String, Any>\n                    ),\n                    unit[\"isCascaded\"] as? Boolean ?: false,\n                    unit[\"isNullAware\"] as? Boolean ?: false,\n                    unit\n                )\n            }\n            parseError(unit)\n        }\n    }\n}\n\nclass Argument : Node {\n    var name: String? = null\n    var isNamed: Boolean? = false\n    var argument: Expression? = null\n\n    private constructor(\n        name: String?,\n        isNamed: Boolean,\n        argument: Expression,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.name = name\n        this.isNamed = isNamed\n        this.argument = argument\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): Argument {\n            if (unit[\"type\"] == \"Argument\") {\n                val isNamed = (unit[\"isNamed\"] ?: false) as Boolean\n                val name = (unit[\"name\"] ?: false) as String\n                val argument = Expression.fromUnit(unit[\"body\"] as Map<String, Any>)\n                return Argument(name, isNamed, argument, unit)\n            }\n            parseError(unit)\n        }\n    }\n}\n\n\nclass ArgumentList : Node {\n    var arguments: List<Expression>\n\n    private constructor(\n        arguments: List<Expression>,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.arguments = arguments\n        arguments?.forEach { becomeParentOf(it) }\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ArgumentList {\n            if (unit[\"type\"] == \"ArgumentList\") {\n                val arguments =\n                    (unit[\"arguments\"] as List<Map<String, Any>>).map { Expression.fromUnit(it as Map<String, Any>) }\n                return ArgumentList(arguments, unit)\n            }\n            parseError(unit)\n        }\n    }\n}\n\n\nabstract class Combinator(unit: Map<String, Any>) : Node(unit) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): Combinator {\n            val type = unit[\"type\"]\n            return when (type) {\n                \"HideCombinator\" -> HideCombinator.fromUnit(unit)\n                \"ShowCombinator\" -> ShowCombinator.fromUnit(unit)\n                else -> parseError(unit)\n            }\n        }\n    }\n}\n\nclass ShowCombinator : Combinator {\n    var shownNames: List<Identifier>\n\n    private constructor(shownNames: List<Identifier>, unit: Map<String, Any>) : super(unit) {\n        this.shownNames = shownNames\n        shownNames.forEach { becomeParentOf(it) }\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ShowCombinator {\n            if (unit[\"type\"] == \"ShowCombinator\") {\n                val shownNames =\n                    (unit[\"shownNames\"] as List<Map<String, Any>>).map { Identifier.fromUnit(it as Map<String, Any>) }\n                return ShowCombinator(shownNames, unit)\n            }\n            parseError(unit)\n        }\n    }\n}\n\nclass HideCombinator : Combinator {\n    var hiddenNames: List<Identifier>\n\n    constructor(hiddenNames: List<Identifier>, unit: Map<String, Any>) : super(unit) {\n        this.hiddenNames = hiddenNames\n        hiddenNames.forEach { becomeParentOf(it) }\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): HideCombinator {\n            if (unit[\"type\"] == \"HideCombinator\") {\n                val hiddenNames =\n                    (unit[\"hiddenNames\"] as List<Map<String, Any>>).map { Identifier.fromUnit(it as Map<String, Any>) }\n                return HideCombinator(hiddenNames, unit)\n            }\n            parseError(unit)\n        }\n    }\n}\n\n\nabstract class NamespaceDirective : UriBasedDirective {\n    constructor(\n        uri: String,\n        unit: Map<String, Any>\n    ) : super(uri, unit) {\n        this.uri = uri\n    }\n}\n\nabstract class UriBasedDirective : Directive {\n    var uri: String\n\n    constructor(\n        uri: String,\n        unit: Map<String, Any>\n    ) : super(unit) {\n        this.uri = uri\n    }\n}\n\nabstract class Directive(unit: Map<String, Any>) : Node(unit) {\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): Directive {\n            val type = unit[\"type\"]\n            return when (type) {\n                \"ImportDirective\" -> ImportDirective.fromUnit(unit)\n//                \"PartDirective\" -> PartDirective.fromUnit(unit)\n//                \"PartOfDirective\" -> PartOfDirective.fromUnit(unit)\n//                \"ExportDirective\" -> ExportDirective.fromUnit(unit)\n                else -> parseError(unit)\n            }\n        }\n    }\n}\n\n\nfun Any?.isNotEmptyCollection(): Boolean =\n    this != null && this is Collection<*> && this.isNotEmpty()\n\nfun Any?.isNotEmptyMap(): Boolean = this != null && this is Map<*, *> && this.isNotEmpty()"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/ProgramStack.kt",
    "content": "package com.aether.core.runtime\n\ntypealias LazilyInitializer = () -> Any?\n\nclass Variable(\n    private var _value: Any?,\n    val name: String,\n    val isFinal: Boolean = false,\n    val isStatic: Boolean = false,\n    val isConst: Boolean = false,\n    val isLate: Boolean = false\n) {\n    private var isInitialized = if (isLate && _value == null) false else true\n\n    var value: kotlin.Any?\n        get() {\n            if (isLate && !isInitialized) {\n                _value = (_value as LazilyInitializer).invoke() as Any?\n                isInitialized = true\n            }\n            return _value!!\n        }\n    set(data) {\n        value = data\n    }\n\n//    constructor(name: String, initializer: LazilyInitializer, isLate: Boolean = true) : this(null, name, isLate = isLate) {\n//        this._value = initializer\n//    }\n\n    operator fun plus(other: Any?): Any? {\n        return when (other) {\n            is Variable ->{\n                val thisValue = value as? Comparable<*>\n                val otherValue = other.value\n                if (thisValue != null && otherValue != null) {\n                    thisValue.compareTo(otherValue as Nothing)\n                } else {\n                    0\n                }\n            }\n            is Number -> {\n                val thisValue = value as? Number\n                if (thisValue != null) {\n                    thisValue.toDouble() + other.toDouble()\n                } else {\n                    null // or throw an exception if you prefer\n                }\n            }\n            else -> null\n        }\n    }\n\n    // Implement other operators similarly...\n\n    override fun toString(): String {\n        return \"[Variable $value]\"\n    }\n\n    override fun equals(other: kotlin.Any?): Boolean {\n        if (this === other) return true\n        if (other !is Variable) return false\n        return value == other.value\n    }\n\n    override fun hashCode(): Int {\n        return value?.hashCode() ?: 0\n    }\n}\n\nclass StackScope(val name: String? = null) {\n    private val frame = mutableMapOf<String, Any?>()\n\n    operator fun contains(key: String): Boolean = frame.containsKey(key)\n\n    operator fun get(key: String): Any? = frame[key]\n\n    operator fun set(key: String, value: Any?) {\n        frame[key] = value\n    }\n\n    override fun toString(): String {\n        return \"[$name]: $frame\"\n    }\n}\n\nclass ProgramStack(val name: String, oldStack: ProgramStack? = null) {\n    val frames: MutableList<StackScope> = oldStack?.frames?.toMutableList() ?: mutableListOf()\n\n    init {\n        if (oldStack == null) {\n            push(name = \"root scope:$name\")\n        }\n    }\n\n    fun isRoot(): Boolean {\n        return frames.size == 1 && frames.single().name == \"root scope:$name\"\n    }\n\n    fun length(): Int = frames.size\n\n    fun push(scope: StackScope? = null, name: String? = null) {\n        frames.add(scope ?: StackScope(name))\n    }\n\n    fun pop(): StackScope? = frames.removeLastOrNull()\n\n    fun putVariable(name: String, value: Any?) {\n        frames.last()[name] = Variable(value, name)\n    }\n    fun  getVariable(name: String): Variable? {\n        return get<Variable>(name)\n    }\n\n    fun putLazilyVariable(name: String, initializer: LazilyInitializer) {\n        frames.last()[name] = Variable(_value = initializer,name = name)//todo initializer\n    }\n\n    fun put(name: String, value: Any?) {\n        frames.last()[name] = value\n    }\n\n    inline fun <reified T> get(name: String): T? {\n        for (i in frames.indices.reversed()) {\n            val curFrame = frames[i]\n            if (curFrame.contains(name) && curFrame[name] is T) {\n                @Suppress(\"UNCHECKED_CAST\")\n                return curFrame[name] as T\n            }\n        }\n        return null\n    }\n\n    override fun toString(): String {\n        return \"Program Stack ($name)\\n${frames.joinToString(\"\\n\")}\"\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/ProjectHelper.kt",
    "content": "/*\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.aether.core.runtime\n\nimport com.intellij.openapi.project.Project\nimport com.intellij.openapi.util.Disposer\nimport org.jetbrains.kotlin.cli.common.CLIConfigurationKeys\nimport org.jetbrains.kotlin.cli.common.messages.MessageRenderer\nimport org.jetbrains.kotlin.cli.common.messages.PrintingMessageCollector\nimport org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles\nimport org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment\nimport org.jetbrains.kotlin.config.CompilerConfiguration\n\n/**\n * Helper that creates or uses a provided Project for psi operations. For example, finding the\n * PsiManager.\n */\nobject ProjectHelper {\n\n  private var overriddenProject: Project? = null\n  private val kotlinCoreEnvironment: KotlinCoreEnvironment by lazy { createCoreEnvironment() }\n\n  fun getProject(): Project {\n    return overriddenProject ?: kotlinCoreEnvironment.project\n  }\n\n  fun setProjectOverride(project: Project) {\n    this.overriddenProject = project\n  }\n\n  private fun createCoreEnvironment(): KotlinCoreEnvironment {\n    val disposable = Disposer.newDisposable()\n    return KotlinCoreEnvironment.createForProduction(\n        disposable, getConfiguration(), EnvironmentConfigFiles.JVM_CONFIG_FILES)\n  }\n\n  fun getConfiguration(): CompilerConfiguration {\n    val configuration = CompilerConfiguration()\n    configuration.put(\n        CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY,\n        PrintingMessageCollector(System.err, MessageRenderer.PLAIN_RELATIVE_PATHS, false))\n    return configuration\n  }\n}\n"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/Structs.kt",
    "content": "package com.aether.core.runtime\n\nimport android.text.TextUtils\nimport com.aether.core.runtime.AppContextManager.context\nimport com.aether.core.runtime.proxy.ProxyBinding\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor2\nimport com.aether.core.runtime.reflectable.ComposeMirror\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport org.w3c.dom.Text\nimport kotlin.reflect.KFunction\n\n\ninterface Present\n\ninterface AstDeclaration : Present {\n    abstract val simpleName: String\n    abstract val qualifiedName: String\n    abstract val owner: AstDeclaration?\n    abstract val isPrivate: Boolean\n    abstract val programNode: AstRuntime.ProgramNode?\n}\n\ninterface AstObject : Present {\n\n    abstract fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>? = null\n    ): Any?\n\n    abstract fun invokeGetter(getterName: String): Any?\n\n    abstract fun hasGetter(getterName: String): Boolean\n\n    abstract fun invokeSetter(setterName: String, value: Any?): Any?\n\n    abstract fun hasSetter(setterName: String): Boolean\n\n    abstract fun hasRegularMethod(methodName: String): Boolean\n\n}\n\nabstract class AstType : AstDeclaration\n\nabstract class AstClass : AstType(), AstObject {\n    abstract val superclass: AstClass?\n    abstract val isAbstract: Boolean\n    abstract val declarations: Map<String, AstDeclaration>\n    abstract val instanceFields: Map<String, AstVariable>\n    abstract val instanceGetters: Map<String, AstMethod>\n    abstract val instanceSetters: Map<String, AstMethod>\n    abstract val staticFields: Map<String, AstVariable>\n    abstract val staticGetters: Map<String, AstMethod>\n    abstract val staticSetters: Map<String, AstMethod>\n\n    abstract fun newInstance(\n        constructorName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>? = null\n    ): Any?\n\n    abstract fun isSubclassOf(other: AstClass): Boolean\n\n    abstract fun hasConstructor(constructorName: String): Boolean\n\n    companion object {\n        fun fromClass(\n            declaration: ClassDeclaration,\n            programNode: AstRuntime.ProgramNode\n        ): AstClass {\n            // 实现逻辑\n            return _ClassImpl.fromClass(declaration, programNode)\n        }\n\n        fun fromMirror(mirror: ComposeReflector, programNode: AstRuntime.ProgramNode): AstClass {\n            // 实现逻辑\n            return _ClassMirror.fromMirror(mirror, programNode);\n        }\n\n        fun forName(className: String): AstClass? {\n            val runtime = context.get<AstRuntime>(AstRuntime::class.java) ?: return null\n            val clazz = runtime.getClass(className)\n            if (clazz != null) return clazz\n            //TODO 这里可以直接去加载反射的类。\n            val importDirective = runtime.getReflectClass(className)\n            var mirror: ComposeReflector? =\n                ProxyBinding.instance?.getProxyClassForName2(importDirective?.uri ?: \"\")\n            if (mirror == null) {\n                mirror = ProxyBinding.instance?.getProxyClassForName2(importDirective?.uri ?: \"\")\n            }\n            if (mirror != null) {\n                return fromMirror(mirror, runtime._program)\n            }\n            return null\n        }\n    }\n}\n\nclass _VariableImpl(\n    name: String,\n    typeName: String?,\n    private val _initializer: Expression?,\n    isPrivate: Boolean,\n    isTopLevel: Boolean,\n    isStatic: Boolean,\n    isConst: Boolean,\n    isFinal: Boolean\n) : _VariableBase(\n    name,\n    typeName,\n    isPrivate,\n    isTopLevel,\n    isStatic,\n    isFinal,\n    isConst\n) {\n    val initializer: Expression?\n        get() = _initializer\n\n    companion object {\n\n        fun fromDeclarator(\n            name: String,\n            typeName: String?,\n            _initializer: Expression?,\n            isPrivate: Boolean = false,\n            isTopLevel: Boolean = false,\n            isStatic: Boolean = false,\n            isConst: Boolean = false,\n            isFinal: Boolean = false\n        ): _VariableImpl {\n            return _VariableImpl(\n                name,\n                typeName,\n                _initializer,\n                isPrivate,\n                isTopLevel,\n                isStatic,\n                isConst,\n                isFinal\n            )\n        }\n\n//        fun fromDeclarator(declarator: VariableDeclarator): _VariableImpl {\n//            return _VariableImpl(\n//                declarator.name,\n//                declarator.typeName,\n//                declarator.init,\n//                Identifier.isPrivateName(declarator.name),\n//                declarator.isTopLevel,\n//                declarator.isStatic,\n//                declarator.isConst,\n//                declarator.isFinal\n//            )\n//        }\n    }\n}\n\nclass _ClassImpl(\n    private val _name: String,\n    override val superclass: AstClass?,\n    private val _staticFields: Map<String, _VariableImpl>,\n    private val _staticGetters: Map<String, _MethodImpl>,\n    private val _staticSetters: Map<String, _MethodImpl>,\n    val _instanceFields: Map<String, _VariableImpl>,\n    val _instanceGetters: Map<String, _MethodImpl>,\n    val _instanceSetters: Map<String, _MethodImpl>,\n    private val _constructors: Map<String, _ConstructorImpl>,\n    private val _node: ClassDeclaration,\n    override val programNode: AstRuntime.ProgramNode\n) : AstClass() {\n\n    public lateinit var _classScope: StackScope\n    public lateinit var runtime: AstRuntime\n\n    init {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n        val classScope = StackScope(\"$simpleName\").apply {\n            set(\"node\", _node)\n        }\n\n        programStack.push(scope = classScope)\n\n        _staticFields.values.forEach { staticField ->\n            programStack.putLazilyVariable(staticField.simpleName) {\n                staticField.initializer?.let {\n                    programStack.push(name = \"Static field initializer\")\n                    val result = executeExpression(it)\n                    programStack.pop()\n                    result\n                }\n            }\n        }\n\n        _staticGetters.values.forEach { method ->\n            programStack.put(method.simpleName, method)\n        }\n\n        _classScope = programStack.pop()!!\n        runtime = context.get<AstRuntime>(AstRuntime::class.java)!!\n    }\n\n    override val simpleName: String get() = _name\n    override val qualifiedName: String get() = _name\n    override val owner: AstDeclaration?\n        get() = TODO(\"Not yet implemented\")\n    override val declarations: Map<String, AstDeclaration>\n        get() = throw NotImplementedError()\n\n    override val instanceFields: Map<String, AstVariable>\n        get() = _instanceFields\n\n    private var _inheritedGetters: Map<String, AstMethod>? = null\n    override val instanceGetters: Map<String, AstMethod>\n        get() {\n            _inheritedGetters?.let {\n                return mapOf(*_instanceGetters.toList().toTypedArray(), *it.toList().toTypedArray())\n            }\n\n            val result = mutableMapOf<String, AstMethod>().apply {\n                superclass?.instanceGetters?.let { putAll(it) }\n            }\n            _inheritedGetters = result.toMap()\n            return _instanceGetters\n        }\n\n    private var _inheritedSetters: Map<String, AstMethod>? = null\n    override val instanceSetters: Map<String, AstMethod>\n        get() {\n            _inheritedSetters?.let {\n                return mapOf(*_instanceSetters.toList().toTypedArray(), *it.toList().toTypedArray())\n            }\n\n            val result = mutableMapOf<String, AstMethod>().apply {\n                superclass?.instanceSetters?.let { putAll(it) }\n            }\n            _inheritedSetters = result.toMap()\n            return _instanceSetters\n        }\n\n    override val staticFields: Map<String, AstVariable> get() = _staticFields\n    override val staticGetters: Map<String, AstMethod> get() = _staticGetters\n    override val staticSetters: Map<String, AstMethod> get() = _staticSetters\n\n    override fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        val method = _staticGetters[memberName] ?: throw NoSuchMethodError()\n        return context.run(\n            name = \"Static invoke\",\n            overrides = mapOf(\n                AstRuntime.ProgramNode::class.java to { programNode }\n            ),\n            body = {\n                val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n                programStack.push(scope = _classScope)\n                val result = AstMethod.apply2(method, positionalArguments, namedArguments)\n                programStack.pop()\n                (result as? Variable)?.value ?: result\n            }\n        )\n    }\n\n    override fun invokeGetter(getterName: String): Any? {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n        return try {\n            programStack.push(scope = _classScope)\n            context.run(\n                name = \"Static invokeGetter\",\n                overrides = mapOf(AstRuntime.ProgramNode::class.java to { programNode }),\n                body = {\n                    _invokeGetter(getterName)\n                }\n            )\n        } finally {\n            programStack.pop()\n        }\n    }\n\n    private fun _invokeGetter(getterName: String): Any? {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n        return _staticGetters[getterName]?.let {\n            AstMethod.apply2(it, emptyList(), mutableMapOf())\n        } ?: _staticFields[getterName]?.let {\n            programStack.getVariable(it.simpleName)?.value\n        } ?: throw NoSuchMethodError(\"getterName=$getterName\")\n    }\n\n    override fun invokeSetter(setterName: String, value: Any?): Any? {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n        return try {\n            programStack.push(scope = _classScope)\n            context.run(\n                name = \"Static invokeSetter\",\n                overrides = mapOf(AstRuntime.ProgramNode::class.java to { programNode }),\n                body = {\n                    _invokeSetter(setterName, value)\n                }\n            )\n        } finally {\n            programStack.pop()\n        }\n    }\n\n    override fun hasSetter(setterName: String): Boolean {\n        return _staticSetters.containsKey(setterName) || _staticFields.containsKey(setterName)\n    }\n\n    private fun _invokeSetter(setterName: String, value: Any?): Any? {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n        return _staticSetters[setterName]?.let {\n            AstMethod.apply2(it, listOf(value), mapOf())\n        } ?: _staticFields[setterName]?.let {\n            val variable = programStack.getVariable(it.simpleName)\n            if (variable != null) {\n                variable?.value = value\n                return null;\n            }\n        } ?: throw NoSuchMethodError(\"setterName=$setterName\")\n    }\n\n    override val isAbstract: Boolean get() = throw NotImplementedError()\n    override val isPrivate: Boolean get() = throw NotImplementedError()\n\n    override fun isSubclassOf(other: AstClass): Boolean {\n        throw NotImplementedError()\n    }\n\n    override fun newInstance(\n        constructorName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n\n        return context.run(\n            name = \"Constructor scope\",\n            body = {\n                val constructor = _constructors[constructorName] ?: throw NoSuchMethodError()\n                val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n\n                programStack.push(scope = _classScope)\n                programStack.push(name = \"Instance scope\")\n\n                instanceFields.values.forEach { variable ->\n                    val value =\n                        (variable as? _VariableImpl)?.initializer?.let { executeExpression(it) }\n                    programStack.putVariable(variable.simpleName, value)\n                }\n\n                instanceGetters.values.forEach { method ->\n                    programStack.put(method.simpleName, method)\n                }\n\n                val instanceScope = programStack.pop()!!\n                lateinit var instance: _InstanceImpl\n\n                _MethodImpl.readyForScopedInvoke(\n                    constructor.parameters, positionalArguments, namedArguments\n                ) { args, namedArgs ->\n                    programStack.push(scope = instanceScope)\n                    constructor.parameters.forEachIndexed { i, param ->\n                        if (param.isField) {\n                            val field = _instanceFields[param.simpleName]!!\n                            val value =\n                                if (param.isNamed) namedArgs?.get(param.simpleName) else args[i]//param.simpleName 临时加的\n                            programStack.putVariable(\n                                param.simpleName,\n                                value?.takeIf { field.typeName == \"double\" })\n                        }\n                    }\n                    programStack.pop()\n\n                    instance = _InstanceImpl.build(this@_ClassImpl, instanceScope)\n\n                    superclass?.let {\n                        // Superclass initialization logic\n                    }\n\n                    programStack.push(scope = instanceScope)\n                    programStack.push(name = \"Constructor body scope\")\n\n                    val result = context.run(\n                        name = \"Constructor body scope\",\n                        overrides = mapOf(ThisReference::class.java to { ThisReference(instance) }\n                        ),\n                        body = {\n                            executeExpression(constructor.body)\n                        }\n                    )\n\n                    programStack.pop()\n                    programStack.pop()\n                    result\n                }\n\n                instance\n            },\n            overrides = mapOf(\n                ProgramStack::class.java to { runtime.programStack },\n                AstRuntime::class.java to { runtime })\n        )\n    }\n\n    override fun hasConstructor(constructorName: String): Boolean {\n        return _constructors.containsKey(constructorName)\n    }\n\n    override fun hasGetter(getterName: String): Boolean {\n        throw NotImplementedError()\n    }\n\n    override fun hasRegularMethod(methodName: String): Boolean {\n        throw NotImplementedError()\n    }\n\n    companion object {\n        fun fromClass(\n            declaration: ClassDeclaration,\n            programNode: AstRuntime.ProgramNode\n        ): _ClassImpl {\n            val staticFields = mutableMapOf<String, _VariableImpl>()\n            val staticGetters = mutableMapOf<String, _MethodImpl>()\n            val staticSetters = mutableMapOf<String, _MethodImpl>()\n            val instanceFields = mutableMapOf<String, _VariableImpl>()\n            val instanceGetters = mutableMapOf<String, _MethodImpl>()\n            val instanceSetters = mutableMapOf<String, _MethodImpl>()\n            val constructors = mutableMapOf<String, _ConstructorImpl>()\n//                val superclass = declaration.extendsClause?.let {\n//                    val superclassName = it.superclass\n//                    AstClass.forName(superclassName) ?: throw IllegalStateException(\"Unable to determine superclass: $superclassName\")\n//                }\n//\n//                val mixins = mutableListOf<AstClass>().apply {\n//                    declaration.withClause?.mixinTypes?.forEach { mixinType ->\n//                        add(AstClass.forName(mixinType) ?: throw IllegalStateException(\"Unable to determine mixin: $mixinType\"))\n//                    }\n//                }\n            declaration.members?.forEach { member ->\n                when {\n                    member.isClassDeclaration -> {\n                        member.asClassDeclaration.members?.forEach {\n                            when {\n                                it.isMethodDeclaration -> {\n                                    val method = it.asMethodExpression\n                                    if (method.isStatic) {\n                                        if (method.isSetter) {\n                                            staticSetters[method.name] =\n                                                _MethodImpl.fromMethod(method);\n                                        } else {\n                                            staticGetters[method.name] =\n                                                _MethodImpl.fromMethod(method);\n                                        }\n                                    }\n                                    when {\n//                                        method.isSetter -> setters[method.name] = _MethodImpl.fromMethod(method)\n//                                        else -> getters[method.name] = _MethodImpl.fromMethod(method)\n                                    }\n                                }\n                            }\n                        }\n                    }\n\n                    member.isMethodDeclaration -> {\n                        val method = member.asMethodExpression\n                        if (method.isStatic) {\n                            if (method.isSetter) {\n                                staticSetters[method.name] =\n                                    _MethodImpl.fromMethod(method);\n                            } else {\n                                staticGetters[method.name] =\n                                    _MethodImpl.fromMethod(method);\n                            }\n                        } else {\n                            if (method.isSetter) {\n                                instanceSetters[method.name] =\n                                    _MethodImpl.fromMethod(method);\n                            } else {\n                                instanceGetters[method.name] =\n                                    _MethodImpl.fromMethod(method);\n                            }\n                        }\n                    }\n\n                    member.isConstructorDeclaration -> {\n                        val constructor = member.asConstructorDeclaration\n                        constructors[constructor.name] =\n                            _ConstructorImpl.fromConstructor(constructor)\n                    }\n\n                    member.isFieldDeclaration -> {\n                        val field = member.asFieldDeclaration\n                        instanceFields[field.name] = _VariableImpl.fromDeclarator(\n                            name = field.name,\n                            typeName = field.name,\n                            _initializer = field.target\n                        )\n//                        if (field)\n//\n//                        fields.fields.declarationList.forEach { declarator ->\n//                            val targetMap =\n//                                if (fields.isStatic) staticFields else instanceFields\n//                            targetMap[declarator.name] =\n//                                _VariableImpl.fromDeclarator(declarator)\n//                        }\n                    }\n                }\n//                it.asClassDeclaration.members[0]\n            }\n\n//            declaration.members[0].asClassDeclaration.members[0]\n            declaration.members?.forEach { member ->\n                when {\n//                        member.isConstructorDeclaration -> {\n//                            val constructor = member.asConstructorDeclaration\n//                            constructors[constructor.name] = _ConstructorImpl.fromConstructor(constructor)\n//                        }\n//                        member.isFieldDeclaration -> {\n//                            val fields = member.asFieldDeclaration\n//                            fields.fields.declarationList.forEach { declarator ->\n//                                val targetMap = if (fields.isStatic) staticFields else instanceFields\n//                                targetMap[declarator.name] = _VariableImpl.fromDeclarator(declarator)\n//                            }\n//                        }\n//                        member.isMethodDeclaration -> {\n//                            val method = member.asMethodDeclaration\n//                            val (getters, setters) = when (method.isStatic) {\n//                                true -> staticGetters to staticSetters\n//                                false -> instanceGetters to instanceSetters\n//                            }\n//\n//                            when {\n//                                method.isSetter -> setters[method.name] = _MethodImpl.fromMethod(method)\n//                                else -> getters[method.name] = _MethodImpl.fromMethod(method)\n//                            }\n//                        }\n                }\n            }\n\n            if (constructors.isEmpty()) {\n                constructors[\"\"] = _ConstructorImpl.defaultConstructor()\n            }\n\n            return _ClassImpl(\n                _name = declaration.name,\n                superclass = null,\n                _staticFields = staticFields,\n                _staticGetters = staticGetters,\n                _staticSetters = staticSetters,\n                _instanceFields = instanceFields,\n                _instanceGetters = instanceGetters,\n                _instanceSetters = instanceSetters,\n                _constructors = constructors,\n                _node = declaration,\n                programNode = programNode,\n            )\n        }\n    }\n}\n\nclass _InstanceImpl(\n    private val _type: _ClassImpl,\n    private val _instanceScope: StackScope\n) : AstObject, AstInstance() {\n\n    var ancestor: AstInstance? = null\n        private set\n\n    private val _behaviors = mutableListOf<AstInstance>()\n\n    init {\n        // 初始化逻辑（如有需要）\n    }\n\n    override val type: _ClassImpl\n        get() = _type\n\n    override fun invoke(\n        methodName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        return context.run(\n            name = \"Instance scope\",\n            overrides = mapOf(\n                ThisReference::class.java to { ThisReference(this) },\n                SuperReference::class.java to { SuperReference(ancestor) },\n                ProgramStack::class.java to { _type.runtime.programStack },\n                AstRuntime::class.java to { _type.runtime },\n                AstRuntime.ProgramNode::class.java to { _type.programNode }\n            ),\n            body = {\n                val programStack = context.get<ProgramStack>(ProgramStack::class.java)\n                val method = _type._instanceGetters[methodName]\n\n                method?.let {\n                    programStack?.push(scope = _type._classScope)\n                    programStack?.push(scope = _instanceScope)\n\n                    val result = _MethodImpl.readyForScopedInvoke(\n                        it.parameters,\n                        positionalArguments,\n                        namedArguments\n                    ) { args, namedArgs ->\n                        val scope = StackScope(\"$methodName\").apply {\n                            it.body.expression?.parent?.let { parent -> set(\"node\", parent) }\n                        }\n                        programStack?.push(scope = scope)\n                        val executeResult = executeExpression(it.body)\n                        programStack?.pop()\n                        (executeResult as? Variable)?.value ?: executeResult\n                    }\n\n                    programStack?.pop()\n                    programStack?.pop()\n                    return@run result\n                }\n\n                ancestor?.takeIf { it.hasGetter(methodName) }?.let {\n                    return@run it.invoke(methodName, positionalArguments, namedArguments)\n                }\n\n                throw NoSuchMethodError(\"NoSuchMethodError: $methodName\")\n            }\n        )\n    }\n\n    override fun invokeGetter(getterName: String): Any? {\n        return context.run(\n            name = \"Instance scope\",\n            overrides = mapOf(\n                ThisReference::class.java to { ThisReference(this) },\n                SuperReference::class.java to { SuperReference(ancestor) },\n                ProgramStack::class.java to { _type.runtime.programStack },\n                AstRuntime::class.java to { _type.runtime },\n                AstRuntime.ProgramNode::class.java to { _type.programNode }\n            ),\n            body = {\n                val programStack = context.get<ProgramStack>(ProgramStack::class.java)\n                return@run try {\n                    programStack?.push(scope = _type._classScope)\n                    programStack?.push(scope = _instanceScope)\n                    _invokeGetter(getterName).let {\n                        (it as? Variable)?.value ?: it\n                    }\n                } finally {\n                    programStack?.pop()\n                    programStack?.pop()\n                }\n            }\n        )\n    }\n\n    private fun _invokeGetter(getterName: String): Any? {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n\n        _type._instanceGetters[getterName]?.takeIf { it.isGetter }?.let { method ->\n            return _MethodImpl.readyForScopedInvoke(\n                method.parameters,\n                emptyList(),\n                null\n            ) { _, _ ->\n                programStack.push(name = \"Invoke getter $getterName\")\n                val result = executeExpression(method.body)\n                programStack.pop()\n                result\n            }\n        }\n\n        _type._instanceFields[getterName]?.let { field ->\n            return programStack.getVariable(field.simpleName)\n        }\n\n        ancestor?.takeIf { it.hasGetter(getterName) }?.let {\n            return it.invokeGetter(getterName)\n        }\n\n        throw NoSuchMethodError(\"getterName=$getterName\")\n    }\n\n    override fun invokeSetter(setterName: String, value: Any?): Any? {\n        return context.run(\n            name = \"Instance scope\",\n            overrides = mapOf(\n                ThisReference::class.java to { ThisReference(this) },\n                SuperReference::class.java to { SuperReference(ancestor) },\n                ProgramStack::class.java to { _type.runtime.programStack },\n                AstRuntime::class.java to { _type.runtime },\n                AstRuntime.ProgramNode::class.java to { _type.programNode }\n            ),\n            body = {\n                val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n                return@run try {\n                    programStack.push(scope = _type._classScope)\n                    programStack.push(scope = _instanceScope)\n                    _invokeSetter(setterName, value)\n                } finally {\n                    programStack.pop()\n                    programStack.pop()\n                }\n            }\n        )\n    }\n\n    override fun hasSetter(setterName: String): Boolean {\n        return _type.instanceSetters.containsKey(setterName) ||\n                _type.instanceFields.containsKey(setterName)\n    }\n\n    private fun _invokeSetter(setterName: String, value: Any?): Any? {\n        val programStack = context.get<ProgramStack>(ProgramStack::class.java)!!\n\n        _type._instanceSetters[setterName]?.takeIf { it.isSetter }?.let { method ->\n            return _MethodImpl.readyForScopedInvoke(\n                method.parameters,\n                listOf(value),\n                null\n            ) { _, _ ->\n                programStack.push(name = \"Invoke setter $setterName\")\n                val result = executeExpression(method.body)\n                programStack.pop()\n                result\n            }\n        }\n\n        _type._instanceFields[setterName]?.let { field ->\n            programStack.getVariable(field.simpleName)?.apply {\n                this.value = value\n            }\n            return null\n        }\n\n        ancestor?.takeIf { it.hasSetter(setterName) }?.let {\n            return it.invokeSetter(setterName, value)\n        }\n\n        throw NoSuchMethodError(\"setterName=$setterName\")\n    }\n\n    override fun hasGetter(getterName: String): Boolean {\n        return _type.instanceGetters.containsKey(getterName) ||\n                _type.instanceFields.containsKey(getterName)\n    }\n\n    override fun hasRegularMethod(methodName: String): Boolean {\n        return _type.instanceGetters[methodName]?.isRegularMethod ?: false\n    }\n\n    companion object {\n        fun build(type: _ClassImpl, scope: StackScope): _InstanceImpl {\n            return _InstanceImpl(type, scope)\n        }\n    }\n}\n\nclass _ConstructorImpl(\n    name: String,\n    body: Expression,\n    parameters: List<_ParameterImpl>,\n    isAbstract: Boolean,\n    isSynthetic: Boolean,\n    isGetter: Boolean,\n    isSetter: Boolean,\n    isStatic: Boolean,\n    isPrivate: Boolean,\n    isOperator: Boolean,\n    isConstructor: Boolean,\n    val isConstConstructor: Boolean,\n    val isFactoryConstructor: Boolean,\n    val isRedirectingConstructor: Boolean,\n    val initializers: List<Expression>\n) : _MethodBase(\n    _name = name,\n    _body = body,\n    _isAbstract = isAbstract,\n    _isSynthetic = isSynthetic,\n//    _isExternal = false,\n    _parameters = parameters,\n//    _isGetter = isGetter,\n//    _isSetter = isSetter,\n    _isStatic = isStatic,\n//    _isPrivate = isPrivate,\n    _isOperator = isOperator,\n    _isConstructor = isConstructor\n) {\n\n    companion object {\n        fun defaultConstructor(): _ConstructorImpl {\n            return _ConstructorImpl(\n                name = \"\",\n                body = Expression.fromUnit(mapOf(\"type\" to \"EmptyFunctionBody\")),\n                parameters = emptyList(),\n                isAbstract = false,\n                isSynthetic = true,\n                isGetter = false,\n                isSetter = false,\n                isStatic = false,\n                isPrivate = false,\n                isOperator = false,\n                isConstructor = true,\n                isConstConstructor = false,\n                isFactoryConstructor = false,\n                isRedirectingConstructor = false,\n                initializers = emptyList()\n            )\n        }\n\n        fun fromConstructor(declaration: ConstructorDeclaration): _ConstructorImpl {\n            val parameters = declaration.parameters.parameters.map {\n                _ParameterImpl.fromParameter(it as FormalParameter)\n            }.toList()\n\n            return _ConstructorImpl(\n                name = declaration.name,\n                body = declaration.body,\n                parameters = parameters,\n                isAbstract = false,\n                isSynthetic = false,\n                isGetter = false,\n                isSetter = false,\n                isStatic = false,\n                isPrivate = Identifier.isPrivateName(declaration.name),\n                isOperator = false,\n                isConstructor = true,\n                isConstConstructor = declaration.isConstConstructor,\n                isFactoryConstructor = declaration.isFactoryConstructor,\n                isRedirectingConstructor = declaration.isRedirectingConstructor,\n                initializers = declaration.initializers\n            )\n        }\n    }\n}\n\nclass InstanceMirror(val composeReflector: ComposeReflector) : AstInstance() {\n\n    override fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        val mergedArgs = namedArguments?.toMutableMap()\n        mergedArgs?.put(\"attribute\",memberName)\n        return ComposeComponentDescriptor(this.composeReflector.qualifiedName,positionalArguments,mergedArgs,null)\n    }\n\n    override fun invokeGetter(getterName: String): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasGetter(getterName: String): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun invokeSetter(setterName: String, value: Any?): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasSetter(setterName: String): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun hasRegularMethod(methodName: String): Boolean {\n        TODO(\"Not yet implemented\")\n    }\n\n    override val type: AstClass\n        get() = TODO(\"Not yet implemented\")\n\n}\n\nabstract class AstInstance : AstObject {\n\n    abstract val type: AstClass\n\n    companion object {\n        private fun fromMirror(composeReflector: ComposeReflector): AstInstance? {\n            return InstanceMirror(composeReflector)\n        }\n        fun forObject(obj: Any?, proxy: Boolean = true): AstInstance? {\n            if (obj == null) return null\n            if (obj is AstInstance) return obj\n            if (obj is ComposeComponentDescriptor2) {\n                return ComposeMirror.getReflector(obj.methodMirror?.qualifiedName ?: \"\")\n                    ?.let {\n                        AstInstance.fromMirror(it)\n                    }\n            }\n            return null\n        }\n    }\n}\n\nclass ConstructorDeclaration(\n    val name: String,\n    val parameters: FormalParameterList,\n    val initializers: List<Expression>,\n    val body: Expression,\n    val isConstConstructor: Boolean,\n    val isFactoryConstructor: Boolean,\n    val isRedirectingConstructor: Boolean,\n    unit: Map<String, Any>\n) : Node(unit) {\n\n    init {\n        parameters.parent = this\n        body.parent = this\n    }\n\n    companion object {\n        fun fromUnit(unit: Map<String, Any>): ConstructorDeclaration {\n            if (unit[\"type\"] != \"SecondaryConstructor\") {\n                parseError(unit)\n            }\n            val name = unit[\"name\"] ?: \"\"\n//            val name = unit[\"name\"]?.let {\n//                Identifier.fromUnit(it as Map<String, Any>).name\n//            } ?: \"\"\n\n            val initializers = (unit[\"initializers\"] as? List<Map<String, Any>>)?.map {\n                Expression.fromUnit(it)\n            }?.toList() ?: emptyList()\n            val emptyUnit = mutableMapOf<String, Any>()\n            emptyUnit[\"type\"] = \"EmptyFunctionBody\"\n            return ConstructorDeclaration(\n                name = name as String,\n                parameters = FormalParameterList.fromUnit(\n                    unit[\"parameters\"] as Map<String, Any>\n                ),\n                initializers = initializers,\n                body = if (unit[\"body\"] != null) Expression.fromUnit(unit[\"body\"] as Map<String, Any>) else Expression(\n                    EmptyFunctionBody.fromUnit(emptyUnit), isEmptyFunctionBody = true, unit = unit\n                ),\n                isConstConstructor = unit[\"isConstConstructor\"] as? Boolean ?: false,\n                isFactoryConstructor = unit[\"isFactoryConstructor\"] as? Boolean ?: false,\n                isRedirectingConstructor = unit[\"isRedirectingConstructor\"] as? Boolean ?: false,\n                unit = unit\n            )\n        }\n    }\n}\n\nabstract class AstVariable : AstDeclaration {\n    abstract val type: AstType\n    abstract override val isPrivate: Boolean\n    abstract val isTopLevel: Boolean\n    abstract val isStatic: Boolean\n    abstract val isFinal: Boolean\n    abstract val isConst: Boolean\n\n    companion object {\n\n        inline fun <reified T : AstVariable> fromDeclarator(declarator: VariableDeclarator): T {\n            // 实现逻辑\n            TODO(\"Not yet implemented\")\n        }\n\n//        inline fun <reified T : AstVariable> fromMirror(mirror: VariableMirrorBase): T {\n//            // 实现逻辑\n//            TODO(\"Not yet implemented\")\n//        }\n//\n//        fun applyTopLevelVariable(variable: AstVariable) {\n//            val programStack = context.get<ProgramStack>() ?: return\n//            programStack.putLazilyVariable(variable.simpleName) {\n//                if (variable is _VariableImpl && variable.initializer != null) {\n//                    val result = executeExpression(variable.initializer!!)\n//                    result\n//                } else {\n//                    null\n//                }\n//            }\n//        }\n    }\n}\n\nabstract class AstParameter : AstVariable() {\n    abstract val isOptional: Boolean\n    abstract val isNamed: Boolean\n    abstract val hasDefaultValue: Boolean\n    abstract val defaultValue: Any?\n\n    companion object {\n//        inline fun <reified T : AstParameter> fromParameter(parameter: FormalParameter): T {\n//            // 实现逻辑\n//            TODO(\"Not yet implemented\")\n//        }\n//\n//        inline fun <reified T : AstParameter> fromMirror(mirror: ParameterMirror): T {\n//            // 实现逻辑\n//            TODO(\"Not yet implemented\")\n//        }\n    }\n}\n\ninterface AstMethod : AstDeclaration {\n    val returnType: AstType\n    val parameters: List<_ParameterImpl>\n    val isStatic: Boolean\n    val isAbstract: Boolean\n    val isSynthetic: Boolean\n    val isRegularMethod: Boolean\n    val isGetter: Boolean\n    val isSetter: Boolean\n    val isOperator: Boolean\n    val isConstructor: Boolean\n    val constructorName: String\n\n    companion object {\n//        fun defaultConstructor(): AstMethod = _ConstructorImpl.defaultConstructor()\n\n//        fun fromConstructor(declaration: ConstructorDeclaration): AstMethod =\n//            _ConstructorImpl.fromConstructor(declaration)\n\n//        fun fromMethod(declaration: MethodDeclaration): AstMethod =\n//            _MethodImpl.fromMethod(declaration)\n\n        fun fromFunction(\n            declaration: MethodDeclaration,\n            programNode: AstRuntime.ProgramNode\n        ): AstMethod =\n            _MethodImpl.fromFunction(declaration, programNode)\n\n        //\n        fun fromExpression(expression: MethodDeclaration): AstMethod =\n            _MethodImpl.fromExpression(expression)\n\n        fun fromMirror(mirror: KFunction<*>): AstMethod = _MethodMirror.fromMirror(mirror)\n        fun fromMirror(mirror: MethodMirror): AstMethod = _MethodMirror.fromMirror(mirror)\n\n//        fun forTopLevelFunction(name: String): AstMethod? {\n//            val programNode = context.get<AstRuntime.ProgramNode>() ?: return null\n//            var function = programNode.getFunction(name)\n//            if (function != null) {\n//                return function\n//            }\n//\n//            val libraryMirror = ReflectionBinding.instance.reflectTopLevelInvoke(name)\n//            if (libraryMirror != null) {\n//                return fromMirror(libraryMirror.declarations[name] as MethodMirror)\n//            }\n//            return null\n//        }\n\n//        fun readyForScopedInvoke(\n//            parameters: List<_ParameterImpl>?,\n//            positionalArguments: List<Any?>,\n//            namedArguments: Map<String, Any?>?,\n//            invoke: (List<Any?>, Map<String, Any?>?) -> Any?\n//        ): Any? =\n//            _MethodImpl.readyForScopedInvoke(parameters, positionalArguments, namedArguments, invoke)\n\n        fun apply2(\n            method: AstMethod,\n            positionalArguments: List<Any?>,\n            namedArguments: Map<String, Any?>?\n        ): Any? {\n            if (method.isStatic) {\n                if (method is _MethodImpl) {\n                    return _MethodImpl.readyForScopedInvoke(\n                        method.parameters,\n                        positionalArguments,\n                        namedArguments\n                    ) { args, namedArgs ->\n                        val programStack = context.get<ProgramStack>(ProgramStack::class.java)\n                            ?: return@readyForScopedInvoke null\n                        programStack.push(name = \"Static function body\")\n                        val result = executeExpression(method.body)\n                        programStack.pop()\n                        result\n                    }\n                } else {\n//                    processArguments(method.parameters, positionalArguments, namedArguments)\n                }\n            } else {\n                val ref = context.get(ThisReference::class.java)\n                    ?: throw IllegalStateException(\"Invalid ThisReference\")\n                if (ref.value is AstInstance) {\n                    val instance = ref.value\n                    return when {\n                        method.isGetter -> instance.invokeGetter(method.simpleName)\n                        method.isSetter -> instance.invokeSetter(\n                            method.simpleName,\n                            positionalArguments[0]\n                        )\n\n                        else -> instance.invoke(\n                            method.simpleName,\n                            positionalArguments,\n                            namedArguments\n                        )\n                    }\n                }\n                throw IllegalStateException(\"Invalid ThisReference\")\n            }\n            return null\n        }\n    }\n}\n\n\n//abstract class AstMethod : AstDeclaration() {\n//\n//    abstract val returnType: AstType\n//    abstract val parameters: List<AstParameter>\n//    abstract val isStatic: Boolean\n//    abstract val isAbstract: Boolean\n//    abstract val isSynthetic: Boolean\n//    abstract val isRegularMethod: Boolean\n//    abstract val isGetter: Boolean\n//    abstract val isSetter: Boolean\n//    abstract val isOperator: Boolean\n//    abstract val isConstructor: Boolean\n//    abstract val constructorName: String\n//\n//    companion object {\n//        inline fun <reified T : AstMethod> defaultConstructor(): T {\n//            // 实现逻辑\n//            TODO(\"Not yet implemented\")\n//        }\n//\n////        inline fun <reified T : AstMethod> fromConstructor(declaration: ConstructorDeclaration): T {\n////            // 实现逻辑\n////            TODO(\"Not yet implemented\")\n////        }\n////\n////        inline fun <reified T : AstMethod> fromMethod(declaration: MethodDeclaration): T {\n////            // 实现逻辑\n////            TODO(\"Not yet implemented\")\n////        }\n//\n//        fun fromFunction(\n//            declaration: FunctionDeclaration,\n//            programNode: AstRuntime.ProgramNode\n//        ): AstMethod {\n//            return _MethodImpl()\n//        }\n//\n//        inline fun <reified T : AstMethod> fromExpression(expression: FunctionDeclaration): T {\n//            // 实现逻辑\n//            TODO(\"Not yet implemented\")\n//        }\n//\n////        inline fun <reified T : AstMethod> fromMirror(mirror: MethodMirror): T {\n////            // 实现逻辑\n////            TODO(\"Not yet implemented\")\n////        }\n//\n////        fun forTopLevelFunction(name: String): AstMethod? {\n////            val programNode = context.get<ProgramNode>() ?: return null\n////            val function = programNode.getFunction(name)\n////            if (function != null) {\n////                return function\n////            }\n////\n////            val libraryMirror = ReflectionBinding.instance.reflectTopLevelInvoke(name)\n////            if (libraryMirror != null) {\n////                return fromMirror(libraryMirror.declarations[name] as MethodMirror)\n////            }\n////            return null\n////        }\n//\n//        fun readyForScopedInvoke(\n////            parameters: List<_ParameterImpl>?,\n//            positionalArguments: List<Any?>,\n//            namedArguments: Map<String, Any?>?,\n//            invoke: (List<Any?>, Map<String, Any?>?) -> Any?\n//        ): Any? {\n//            // 实现逻辑\n//            TODO(\"Not yet implemented\")\n//        }\n//\n//        fun apply2(\n//            method: AstMethod,\n//            positionalArguments: List<Any?>,\n//            namedArguments: Map<String, Any?>?\n//        ): Any? {\n//            if (method.isStatic) {\n////            if (method is _MethodImpl) {\n////                return readyForScopedInvoke(\n////                    method.parameters,\n////                    positionalArguments,\n////                    namedArguments\n////                ) { args, namedArgs ->\n////                    val programStack = context.get<ProgramStack>()!!\n////                    programStack.push(name = \"Static function body\")\n////                    val result = executeExpression(method.body)\n////                    programStack.pop()\n////                    result\n////                }\n////            } else {\n////                processArguments(method.parameters, positionalArguments, namedArguments)\n////            }\n//            } else {\n//                val ref = context.get(ThisReference::class.java) ?: throw IllegalStateException(\"Invalid ThisReference\")\n//                if (ref.value is AstInstance) {\n//                    val instance = ref.value\n//                    return when {\n//                        method.isGetter -> instance.invokeGetter(method.simpleName)\n//                        method.isSetter -> instance.invokeSetter(method.simpleName, positionalArguments[0])\n//                        else -> instance.invoke(method.simpleName, positionalArguments, namedArguments)\n//                    }\n//                }\n//                throw IllegalStateException(\"Invalid ThisReference\")\n//            }\n//\n//            return null\n//        }\n//    }\n//}\n\nabstract class _MethodBase(\n    private val _name: String,\n    private val _body: Expression,\n    private val _parameters: List<_ParameterImpl>,\n    private val _isAbstract: Boolean,\n    private val _isSynthetic: Boolean,\n//    private val _isRegularMethod: Boolean,\n//    private val _isGetter: Boolean,\n//    private val _isSetter: Boolean,\n    private val _isStatic: Boolean,\n//    private val _isPrivate: Boolean,\n    private val _isOperator: Boolean,\n    private val _isConstructor: Boolean,\n    override val programNode: AstRuntime.ProgramNode? = null\n) : AstMethod {\n\n    val body: Expression\n        get() = _body\n\n    override val qualifiedName: String\n        get() = \"${owner?.qualifiedName}.$simpleName\"\n\n    override val simpleName: String\n        get() = if (_isConstructor) {\n            if (_name.isEmpty()) owner.simpleName else \"${owner.simpleName}.$simpleName\"\n        } else {\n            _name\n        }\n\n    override val constructorName: String\n        get() = if (_isConstructor) _name else \"\"\n\n    override val isAbstract: Boolean\n        get() = _isAbstract\n\n    override val isSynthetic: Boolean\n        get() = _isSynthetic\n\n    override val isRegularMethod: Boolean\n        get() = false\n\n    override val isConstructor: Boolean\n        get() = _isConstructor\n\n    override val isGetter: Boolean\n        get() = false\n\n    override val isPrivate: Boolean\n        get() = false\n\n    override val isSetter: Boolean\n        get() = false\n\n    override val isStatic: Boolean\n        get() = _isStatic\n\n    override val owner: AstDeclaration\n        get() = throw UnimplementedError(\"operator ${_name} error\")\n\n    //\n    override val parameters: List<_ParameterImpl>\n        get() = _parameters\n\n    override val isOperator: Boolean\n        get() = _isOperator\n\n    override val returnType: AstType\n        get() = throw UnimplementedError(\"operator ${_name} error\")\n}\n\npublic class UnimplementedError(s: String) : Throwable() {\n\n}\n\nclass _MethodImpl(\n    name: String,\n    body: Expression,\n    parameters: List<_ParameterImpl>,\n    isAbstract: Boolean,\n    isSynthetic: Boolean,\n//    isRegularMethod: Boolean,\n//    isGetter: Boolean,\n//    isSetter: Boolean,\n    isStatic: Boolean,\n//    isPrivate: Boolean,\n    isOperator: Boolean,\n    isConstructor: Boolean,\n    programNode: AstRuntime.ProgramNode? = null\n) : _MethodBase(\n    name,\n    body,\n    parameters,\n    isAbstract,\n    isSynthetic,\n//    isRegularMethod,\n//    isGetter,\n//    isSetter,\n    isStatic,\n//    isPrivate,\n    isOperator,\n    isConstructor,\n    programNode\n) {\n\n    companion object {\n        fun fromExpression(expression: MethodDeclaration): AstMethod {\n            val parameters = mutableListOf<_ParameterImpl>()\n            if (expression.parameters?.parameters?.isNotEmpty() == true) {\n                for (parameter in expression.parameters!!.parameters) {\n                    parameters.add(_ParameterImpl.fromParameter(parameter))\n                }\n            }\n\n            return _MethodImpl(\n                name = \"\",\n                body = expression.bodyExpression,\n                parameters = parameters,\n                isStatic = false,\n                isAbstract = false,\n                isOperator = false,\n                isConstructor = false,\n                isSynthetic = false\n            )\n        }\n\n        fun fromMethod(declaration: MethodDeclaration): _MethodImpl {\n            val parameters = mutableListOf<_ParameterImpl>()\n//            declaration.valueParameters.forEach { parameter ->\n//                parameters.add(_ParameterImpl.fromParameter(parameter))\n//            }\n            return _MethodImpl(\n                declaration.name ?: \"\",\n                declaration.bodyExpression,\n                parameters,\n                false,\n                false,\n//                !declaration.isGetter && !declaration.isSetter,\n//                declaration.isGetter,\n//                declaration.isSetter,\n                true,\n//                declaration.isPrivate,\n                false,\n                false,\n            )\n        }\n\n        fun fromFunction(\n            declaration: MethodDeclaration,\n            programNode: AstRuntime.ProgramNode\n        ): _MethodImpl {\n            val parameters = mutableListOf<_ParameterImpl>()\n            declaration.parameters?.parameters?.forEach { parameter ->\n                parameters.add(_ParameterImpl.fromParameter(parameter))\n            }\n\n            return _MethodImpl(\n                declaration.name ?: \"\",\n                declaration.bodyExpression,\n                parameters,\n                false,\n                false,\n//                !declaration.isGetter && !declaration.isSetter,\n//                declaration.isGetter,\n//                declaration.isSetter,\n                true,\n//                declaration.isPrivate,\n                false,\n                false,\n                programNode\n            )\n        }\n//\n//        fun fromExpression(expression: KtFunctionExpression): _MethodImpl {\n//            val parameters = mutableListOf<_ParameterImpl>()\n//            expression.valueParameters.forEach { parameter ->\n//                parameters.add(_ParameterImpl.fromParameter(parameter))\n//            }\n//\n//            return _MethodImpl(\n//                \"\",\n//                expression.bodyExpression,\n//                parameters,\n//                false,\n//                false,\n//                true,\n//                false,\n//                false,\n//                true,\n//                false,\n//                false,\n//                false\n//            )\n//        }\n\n        fun readyForScopedInvoke(\n            parameters: List<_ParameterImpl>?,\n            positionalArguments: List<Any?>,\n            namedArguments: Map<String, Any?>?,\n            invoke: (List<Any?>, Map<String, Any?>?) -> Any?\n        ): Any? {\n            val programStack = context.get<ProgramStack>(ProgramStack::class.java) ?: return null\n            programStack.push(name = \"Formal parameters scope\")\n\n            parameters?.forEachIndexed { index, parameter ->\n                if (parameter.isNamed) {\n                    programStack.putVariable(\n                        parameter.simpleName,\n                        namedArguments?.get(parameter.simpleName)\n                    )\n                } else {\n                    programStack.putVariable(\n                        parameter.simpleName,\n                        positionalArguments.getOrNull(index)\n                    )\n                }\n            }\n\n            val result = invoke(positionalArguments, namedArguments)\n\n            programStack.pop()\n\n            return result\n        }\n    }\n}\n\ninterface Reference<T> {\n    val value: T\n}\n\nclass ThisReference<T>(override val value: T) : Reference<T>\n\nclass SuperReference<T>(override val value: T) : Reference<T>\n\nclass ProxyReference<T>(override val value: T) : Reference<T>\n\nclass MirrorReference<T>(override val value: T) : Reference<T>"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/StructsImpl.kt",
    "content": "package com.aether.core.runtime\n\nclass StructsImpl {\n}\n\nabstract class _VariableBase(\n    val _name: String,\n    val _typeName: String?,\n    val _isPrivate: Boolean,\n    val _isTopLevel: Boolean,\n    val _isStatic: Boolean,\n    val _isFinal: Boolean,\n    val _isConst: Boolean,\n    override val programNode: AstRuntime.ProgramNode? = null\n) : AstVariable() {\n\n    override val simpleName: String\n        get() = _name\n\n    override val qualifiedName: String\n        get() = \"${owner.qualifiedName}.$simpleName\"\n\n    override val isPrivate: Boolean\n        get() = _isPrivate\n\n    override val isTopLevel: Boolean\n        get() = _isTopLevel\n\n    override val isStatic: Boolean\n        get() = _isStatic\n\n    override val isFinal: Boolean\n        get() = _isFinal\n\n    override val isConst: Boolean\n        get() = _isConst\n\n    override val owner: AstDeclaration\n        get() = throw UnimplementedError(\"owner error\")\n\n    override val type: AstType\n        get() = throw UnimplementedError(\"type error:${type}\")\n\n    val typeName: String?\n        get() = _typeName\n}\n\nclass VariableImpl private constructor(\n    name: String,\n    typeName: String?,\n    private val _initializer: Expression?,\n    isPrivate: Boolean,\n    isTopLevel: Boolean,\n    isStatic: Boolean,\n    isConst: Boolean,\n    isFinal: Boolean,\n    programNode: AstRuntime.ProgramNode? = null\n) : _VariableBase(name, typeName, isPrivate, isTopLevel, isStatic, isFinal, isConst, programNode) {\n\n    companion object {\n        fun fromDeclarator(declarator: VariableDeclarator): VariableImpl {\n            return VariableImpl(\n                declarator.name,\n                declarator.typeName,\n                declarator.init,\n                Identifier.isPrivateName(declarator.name),\n                declarator.isTopLevel,\n                declarator.isStatic,\n                declarator.isConst,\n                declarator.isFinal\n            )\n        }\n    }\n\n    override val owner: AstDeclaration\n        get() = throw UnimplementedError(\"owner error\")\n\n    override val type: AstType\n        get() = throw UnimplementedError(\"type error:${type}\")\n\n    val initializer: Expression?\n        get() = _initializer\n}\n\nclass _ParameterImpl private constructor(\n    name: String,\n    typeName: String?,\n    isPrivate: Boolean,\n    isTopLevel: Boolean,\n    isStatic: Boolean,\n    isConst: Boolean,\n    isFinal: Boolean,\n    private val _isNamed: Boolean,\n    private val _isOptional: Boolean,\n    private val _isField: Boolean,\n    private val _defaultValue: Expression?\n) : _VariableBase(name, typeName, isPrivate, isTopLevel, isStatic, isFinal, isConst){\n\n    companion object {\n        fun fromParameter(parameter: FormalParameter): _ParameterImpl {\n            val defaultValue: Expression? = if (parameter is DefaultFormalParameter) {\n                parameter.defaultValue\n            } else {\n                null\n            }\n            val isField = parameter is FieldFormalParameter\n            return _ParameterImpl(\n                parameter.name,\n                parameter.typeName,\n                Identifier.isPrivateName(parameter.name),\n                false,\n                false,\n                false,\n                parameter.isFinal,\n                parameter.isNamed,\n                parameter.isOptional,\n                isField,\n                defaultValue\n            )\n        }\n    }\n\n    val defaultValue: Expression?\n        get() = _defaultValue\n\n    val hasDefaultValue: Boolean\n        get() = _defaultValue != null\n\n    val isNamed: Boolean\n        get() = _isNamed\n\n    val isField: Boolean\n        get() = _isField\n\n    val isOptional: Boolean\n        get() = _isOptional\n\n    override val owner: AstDeclaration\n        get() = throw UnimplementedError(\"owner error\")\n\n    override val type: AstType\n        get() = throw UnimplementedError(\"type error:${type}\")\n}\n"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/context.kt",
    "content": "package com.aether.core.runtime\n\nimport java.util.Collections\n\ntypealias Generator = () -> Any?\n\nclass ContextDependencyCycleException(cycle: List<Class<*>>) :\n    Exception(\"Dependency cycle detected: ${cycle.joinToString(\" -> \")}\")\n\nconst val contextKey = \"context\"\n\nval context2: AppContext\n    get() = AppContextManager.context\n\nclass AppContext(\n    private var parent: AppContext?,\n    val name: String?,\n    private val overrides: Map<Class<*>, Generator>,\n    private val fallbacks: Map<Class<*>, Generator>\n) {\n    private val values = mutableMapOf<Class<*>, Any?>()\n    private val reentrantChecks = mutableListOf<Class<*>>()\n\n    companion object {\n        val root = AppContext(null, \"ROOT\", emptyMap(), emptyMap())\n    }\n\n    private fun boxNull(value: Any?): Any? = value ?: BoxedNull\n\n    private fun unboxNull(value: Any?): Any? = if (value == BoxedNull) null else value\n\n    private fun generateIfNecessary(type: Class<*>, generators: Map<Class<*>, Generator>): Any? {\n        if (!generators.containsKey(type)) {\n            return null\n        }\n\n        return values.getOrPut(type) {\n            val index = reentrantChecks.indexOf(type)\n            if (index >= 0) {\n                throw ContextDependencyCycleException(reentrantChecks.subList(index, 0))\n            }\n\n            reentrantChecks.add(type)\n            try {\n                return  boxNull(generators[type]?.invoke())\n            } finally {\n                reentrantChecks.removeAt(reentrantChecks.lastIndex)\n            }\n        }\n    }\n\n    fun <T : Any> get(type: Class<T>): T? {\n        var value = generateIfNecessary(type, overrides)\n        if (value == null && parent != null) {\n            value = parent!!.get(type)\n        }\n        return unboxNull(value ?: generateIfNecessary(type, fallbacks)) as T?\n    }\n\n    fun run(\n        name: String? = null,\n        body: () -> Any?,\n        overrides: Map<Class<*>, Generator>? = null,\n        fallbacks: Map<Class<*>, Generator>? = null\n    ): Any? {\n        val child = AppContext(\n            this,\n            name,\n            Collections.unmodifiableMap(overrides ?: emptyMap()),\n            Collections.unmodifiableMap(fallbacks ?: emptyMap())\n        )\n        val previousContext = AppContextManager.get()\n        child.parent = previousContext\n        AppContextManager.set(child)\n        try {\n            return body()\n        } finally {\n            AppContextManager.set(child)\n        }\n    }\n\n//    suspend fun run(\n//        body: suspend () -> Any?,\n//        name: String? = null,\n//        overrides: Map<Class<*>, Generator>? = null,\n//        fallbacks: Map<Class<*>, Generator>? = null\n//    ): Any? {\n//        val child = AppContext(\n//            this,\n//            name,\n//            overrides?.toMap() ?: emptyMap(),\n//            fallbacks?.toMap() ?: emptyMap()\n//        )\n//        return withContext(currentCoroutineContext() + mapOf(contextKey to child)) {\n//            try {\n//                body()\n//            } catch (e: Exception) {\n//                val astRuntime = child.get(AstRuntime::class)\n//                if (astRuntime != null && astRuntime.errorCallback != null) {\n//                    astRuntime.errorCallback(e, e.stackTrace)\n//                }\n//                throw e\n//            }\n//        }\n//    }\n\n    override fun toString(): String {\n        val buf = StringBuilder()\n        var indent = \"\"\n        var ctx: AppContext? = this\n        while (ctx != null) {\n            buf.append(\"AppContext\")\n            if (ctx.name != null) {\n                buf.append(\"[${ctx.name}]\")\n            }\n            if (ctx.overrides.isNotEmpty()) {\n                buf.append(\"\\n$indent  overrides: [${ctx.overrides.keys.joinToString(\", \")}]\")\n            }\n            if (ctx.fallbacks.isNotEmpty()) {\n                buf.append(\"\\n$indent  fallbacks: [${ctx.fallbacks.keys.joinToString(\", \")}]\")\n            }\n            if (ctx.parent != null) {\n                buf.append(\"\\n$indent  parent: \")\n            }\n            ctx = ctx.parent\n            indent += \"  \"\n        }\n        return buf.toString()\n    }\n}\n\nobject BoxedNull\n"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/deliver/TemplateProvider.kt",
    "content": "package com.aether.core.runtime.deliver\n\nimport com.aether.core.runtime.AstRuntime\nimport android.util.Log\nimport androidx.compose.animation.AnimatedVisibility\nimport androidx.compose.foundation.background\nimport androidx.compose.foundation.layout.padding\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.runtime.DisposableEffect\nimport androidx.compose.runtime.LaunchedEffect\nimport androidx.compose.runtime.getValue\nimport androidx.compose.runtime.mutableStateOf\nimport androidx.compose.runtime.setValue\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.unit.dp\nimport androidx.lifecycle.ViewModel\nimport androidx.lifecycle.viewModelScope\nimport kotlinx.coroutines.Dispatchers\nimport kotlinx.coroutines.flow.Flow\nimport kotlinx.coroutines.flow.MutableStateFlow\nimport kotlinx.coroutines.flow.catch\nimport kotlinx.coroutines.flow.flowOn\nimport kotlinx.coroutines.launch\nimport java.io.File\nimport java.util.zip.ZipFile\n\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.compose.foundation.layout.Box\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.foundation.layout.Spacer\nimport androidx.compose.foundation.layout.fillMaxSize\nimport androidx.compose.foundation.layout.fillMaxWidth\nimport androidx.compose.foundation.layout.height\nimport androidx.compose.foundation.rememberScrollState\nimport androidx.compose.foundation.shape.RoundedCornerShape\nimport androidx.compose.foundation.verticalScroll\nimport androidx.compose.material.Button\nimport androidx.compose.material.Card\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Surface\nimport androidx.compose.runtime.getValue\nimport androidx.compose.runtime.remember\nimport androidx.compose.runtime.setValue\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.draw.clip\nimport androidx.compose.ui.graphics.Color\nimport androidx.compose.ui.text.font.FontWeight\nimport com.aether.core.runtime.AppContextManager.context\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.RenderComponent\n\n/**\n * Arguments for a dynamic Composable\n */\nclass Arguments(\n    val positionalArguments: List<Any?> = emptyList(),\n    val namedArguments: Map<String, Any?> = emptyMap()\n)\n\n/**\n * Events that can be triggered during CloudComposable lifecycle\n */\nenum class EasyComposeEvent {\n    LOAD_COMPLETE,\n    LOAD_ERROR\n}\n\n/**\n * Interface for template providers\n */\ninterface TemplateProvider {\n    val key: String\n    fun resolve(): Flow<TemplateResult>\n}\n\n/**\n * Result of template loading\n */\ndata class TemplateResult(\n    val programNode: AstRuntime.ProgramNode,\n    val sourceKey: String\n)\n\n/**\n * Network template provider\n */\nclass NetworkTemplate(\n    private val url: String,\n    private val fileMd5: String? = null\n) : TemplateProvider {\n    override val key: String\n        get() = \"network_$url${fileMd5?.let { \"_$it\" } ?: \"\"}\"\n\n    override fun resolve(): Flow<TemplateResult> {\n        return TemplateLoader.loadFromNetwork(url, fileMd5)\n            .flowOn(Dispatchers.IO)\n    }\n}\n\n/**\n * Asset template provider\n */\nclass AssetTemplate(\n    private val assetName: String\n) : TemplateProvider {\n    override val key: String\n        get() = \"asset_$assetName\"\n\n    override fun resolve(): Flow<TemplateResult> {\n        return TemplateLoader.loadFromAsset(assetName)\n            .flowOn(Dispatchers.IO)\n    }\n}\n\n/**\n * File template provider\n */\nclass FileTemplate(\n    private val file: File\n) : TemplateProvider {\n    override val key: String\n        get() = \"file_${file.absolutePath}\"\n\n    override fun resolve(): Flow<TemplateResult> {\n        return TemplateLoader.loadFromFile(file)\n            .flowOn(Dispatchers.IO)\n    }\n}\n\n/**\n * Zip file template provider\n */\nclass ZipFileTemplate(\n    private val zipFile: File\n) : TemplateProvider {\n    override val key: String\n        get() = \"zip_${zipFile.absolutePath}\"\n\n    override fun resolve(): Flow<TemplateResult> {\n        return TemplateLoader.loadFromZipFile(zipFile)\n            .flowOn(Dispatchers.IO)\n    }\n}\n\n/**\n * Helper class for loading templates\n */\nobject TemplateLoader {\n    fun loadFromNetwork(url: String, fileMd5: String? = null): Flow<TemplateResult> {\n        val resultFlow = MutableStateFlow<TemplateResult?>(null)\n\n        try {\n            // Download code from network and create local file\n            val tempFile = File.createTempFile(\"network_template\", \".kt\")\n            // For demo purposes, using placeholder content\n            tempFile.writeText(\n                \"\"\"\n                @Composable\n                fun Main() {\n                    Text(\"Network content from $url\")\n                }\n            \"\"\".trimIndent()\n            )\n\n            // Create AstRuntime from file\n            val localFile = AstRuntime.LocalFile(tempFile)\n            val node = localFile.createNode()\n\n            resultFlow.value = TemplateResult(\n                programNode = node,\n                sourceKey = \"network_$url${fileMd5?.let { \"_$it\" } ?: \"\"}\"\n            )\n        } catch (e: Exception) {\n            throw e\n        }\n\n        return resultFlow as Flow<TemplateResult>\n    }\n\n    fun loadFromAsset(assetName: String): Flow<TemplateResult> {\n        val resultFlow = MutableStateFlow<TemplateResult?>(null)\n\n        try {\n//            val tempFile = File.createTempFile(\"asset_template\", \".kt\")\n//            tempFile.writeText(\n//                \"\"\"\n//                @Composable\n//                fun Main() {\n//                    Text(\"Asset content from $assetName\")\n//                }\n//            \"\"\".trimIndent()\n//            )\n//            val json = \"{\\n\" +\n//                    \"  \\\"directives\\\" : [ {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.background\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"background\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.Box\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Box\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.Column\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Column\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.fillMaxWidth\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"fillMaxWidth\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.height\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"height\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.padding\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"padding\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.shape.RoundedCornerShape\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"RoundedCornerShape\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.material.Button\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Button\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.material.Text\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Text\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.runtime.Composable\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Composable\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.Alignment\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Alignment\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.Modifier\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Modifier\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.draw.clip\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"clip\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.graphics.Color\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"Color\\\"\\n\" +\n//                    \"  }, {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.unit.dp\\\",\\n\" +\n//                    \"    \\\"alias\\\" : null,\\n\" +\n//                    \"    \\\"name\\\" : \\\"dp\\\"\\n\" +\n//                    \"  } ],\\n\" +\n//                    \"  \\\"declarations\\\" : [ {\\n\" +\n//                    \"    \\\"type\\\" : \\\"ClassDeclaration\\\",\\n\" +\n//                    \"    \\\"name\\\" : \\\"DemoCompose\\\",\\n\" +\n//                    \"    \\\"members\\\" : [ {\\n\" +\n//                    \"      \\\"type\\\" : \\\"MethodDeclaration\\\",\\n\" +\n//                    \"      \\\"name\\\" : \\\"Main\\\",\\n\" +\n//                    \"      \\\"parameters\\\" : [ ],\\n\" +\n//                    \"      \\\"typeParameters\\\" : [ ],\\n\" +\n//                    \"      \\\"body\\\" : {\\n\" +\n//                    \"        \\\"type\\\" : \\\"BlockStatement\\\",\\n\" +\n//                    \"        \\\"body\\\" : [ {\\n\" +\n//                    \"          \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n//                    \"          \\\"constructorName\\\" : \\\"Column\\\",\\n\" +\n//                    \"          \\\"argumentList\\\" : {\\n\" +\n//                    \"            \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n//                    \"            \\\"arguments\\\" : [ {\\n\" +\n//                    \"              \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//                    \"              \\\"body\\\" : {\\n\" +\n//                    \"                \\\"type\\\" : \\\"MethodInvocation\\\",\\n\" +\n//                    \"                \\\"name\\\" : null,\\n\" +\n//                    \"                \\\"methodName\\\" : {\\n\" +\n//                    \"                  \\\"type\\\" : \\\"CallExpression\\\",\\n\" +\n//                    \"                  \\\"methodName\\\" : {\\n\" +\n//                    \"                    \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n//                    \"                    \\\"name\\\" : \\\"fillMaxWidth\\\"\\n\" +\n//                    \"                  },\\n\" +\n//                    \"                  \\\"target\\\" : {\\n\" +\n//                    \"                    \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n//                    \"                    \\\"name\\\" : \\\"fillMaxWidth\\\"\\n\" +\n//                    \"                  },\\n\" +\n//                    \"                  \\\"argumentList\\\" : {\\n\" +\n//                    \"                    \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n//                    \"                    \\\"arguments\\\" : [ ]\\n\" +\n//                    \"                  },\\n\" +\n//                    \"                  \\\"valueArgument\\\" : [ ]\\n\" +\n//                    \"                },\\n\" +\n//                    \"                \\\"target\\\" : {\\n\" +\n//                    \"                  \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n//                    \"                  \\\"name\\\" : \\\"Modifier\\\"\\n\" +\n//                    \"                }\\n\" +\n//                    \"              }\\n\" +\n//                    \"            }, {\\n\" +\n//                    \"              \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//                    \"              \\\"body\\\" : {\\n\" +\n//                    \"                \\\"type\\\" : \\\"MethodInvocation\\\",\\n\" +\n//                    \"                \\\"name\\\" : null,\\n\" +\n//                    \"                \\\"methodName\\\" : {\\n\" +\n//                    \"                  \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n//                    \"                  \\\"name\\\" : \\\"CenterHorizontally\\\"\\n\" +\n//                    \"                },\\n\" +\n//                    \"                \\\"target\\\" : {\\n\" +\n//                    \"                  \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n//                    \"                  \\\"name\\\" : \\\"Alignment\\\"\\n\" +\n//                    \"                }\\n\" +\n//                    \"              }\\n\" +\n//                    \"            } ]\\n\" +\n//                    \"          },\\n\" +\n//                    \"          \\\"valueArgument\\\" : [ ]\\n\" +\n//                    \"        } ]\\n\" +\n//                    \"      },\\n\" +\n//                    \"      \\\"isStatic\\\" : false,\\n\" +\n//                    \"      \\\"isGetter\\\" : true,\\n\" +\n//                    \"      \\\"isSetter\\\" : false\\n\" +\n//                    \"    } ],\\n\" +\n//                    \"    \\\"body\\\" : { }\\n\" +\n//                    \"  } ],\\n\" +\n//                    \"  \\\"type\\\" : \\\"CompilationUnit\\\"\\n\" +\n//                    \"}\"\n\n//            val json = \"{\\\"directives\\\":[{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.Column\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Column\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.material.Text\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Text\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.runtime.Composable\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Composable\\\"}],\\\"declarations\\\":[{\\\"type\\\":\\\"ClassDeclaration\\\",\\\"name\\\":\\\"ColumComposeNameExpressText\\\",\\\"members\\\":[{\\\"type\\\":\\\"MethodDeclaration\\\",\\\"name\\\":\\\"Main\\\",\\\"parameters\\\":[],\\\"typeParameters\\\":[],\\\"body\\\":{\\\"type\\\":\\\"BlockStatement\\\",\\\"body\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":null,\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"1这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"minLines\\\",\\\"body\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"1\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"2这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"minLines\\\",\\\"body\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"1\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"3这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"minLines\\\",\\\"body\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"1\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"4这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"minLines\\\",\\\"body\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"1\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}]}]},\\\"isStatic\\\":false,\\\"isGetter\\\":true,\\\"isSetter\\\":false}],\\\"body\\\":{}}],\\\"type\\\":\\\"CompilationUnit\\\"}\"\n//            val json = \"{\\\"directives\\\":[{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.Arrangement\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Arrangement\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.Column\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Column\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.Spacer\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Spacer\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.fillMaxSize\\\",\\\"alias\\\":null,\\\"name\\\":\\\"fillMaxSize\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.fillMaxWidth\\\",\\\"alias\\\":null,\\\"name\\\":\\\"fillMaxWidth\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.height\\\",\\\"alias\\\":null,\\\"name\\\":\\\"height\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.padding\\\",\\\"alias\\\":null,\\\"name\\\":\\\"padding\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.rememberScrollState\\\",\\\"alias\\\":null,\\\"name\\\":\\\"rememberScrollState\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.shape.RoundedCornerShape\\\",\\\"alias\\\":null,\\\"name\\\":\\\"RoundedCornerShape\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.verticalScroll\\\",\\\"alias\\\":null,\\\"name\\\":\\\"verticalScroll\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.material.Card\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Card\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.material.MaterialTheme\\\",\\\"alias\\\":null,\\\"name\\\":\\\"MaterialTheme\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.material.Text\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Text\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.runtime.Composable\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Composable\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.ui.Modifier\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Modifier\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.ui.graphics.Color\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Color\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.ui.text.font.FontWeight\\\",\\\"alias\\\":null,\\\"name\\\":\\\"FontWeight\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.ui.unit.dp\\\",\\\"alias\\\":null,\\\"name\\\":\\\"dp\\\"}],\\\"declarations\\\":[{\\\"type\\\":\\\"ClassDeclaration\\\",\\\"name\\\":\\\"ColumArgsComposeExpressText\\\",\\\"members\\\":[{\\\"type\\\":\\\"MethodDeclaration\\\",\\\"name\\\":\\\"Main\\\",\\\"parameters\\\":[],\\\"typeParameters\\\":[],\\\"body\\\":{\\\"type\\\":\\\"BlockStatement\\\",\\\"body\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"verticalScroll\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"verticalScroll\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"rememberScrollState\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"rememberScrollState\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[]}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"padding\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"padding\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"16\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxSize\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxSize\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"verticalArrangement\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"spacedBy\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"spacedBy\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"10\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Arrangement\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Card\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"100\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxWidth\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxWidth\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"shape\\\",\\\"body\\\":{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"RoundedCornerShape\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"16\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"elevation\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"4\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"backgroundColor\\\",\\\"body\\\":{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Color\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"0xFFE0F7FA\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}}]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"padding\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"padding\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"16\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxSize\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxSize\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"verticalArrangement\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Center\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Arrangement\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"主标题 1\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h6\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"fontWeight\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Bold\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"FontWeight\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Spacer\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"4\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"副标题 1\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"body1\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"color\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Gray\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Color\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}]}]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Card\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"100\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxWidth\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxWidth\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"shape\\\",\\\"body\\\":{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"RoundedCornerShape\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"16\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"elevation\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"4\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"backgroundColor\\\",\\\"body\\\":{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Color\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"0xFFE0F7FA\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}}]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"padding\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"padding\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"16\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxSize\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"fillMaxSize\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"verticalArrangement\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Center\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Arrangement\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"主标题 2\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h6\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"fontWeight\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Bold\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"FontWeight\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Spacer\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"modifier\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"CallExpression\\\",\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"height\\\"},\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":false,\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"dp\\\"},\\\"target\\\":{\\\"type\\\":\\\"INTEGER_CONSTANT\\\",\\\"value\\\":\\\"4\\\",\\\"name\\\":\\\"ConstantExpression\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Modifier\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"副标题 2\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"body1\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"color\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Gray\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"Color\\\"}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}]}]}]}]},\\\"isStatic\\\":false,\\\"isGetter\\\":true,\\\"isSetter\\\":false}],\\\"body\\\":{}}],\\\"type\\\":\\\"CompilationUnit\\\"}\"\n            val json = obtainJson()\n\n            val localFile = AstRuntime.LocalJson(json)\n            val node = localFile.createNode()\n\n            resultFlow.value = TemplateResult(\n                programNode = node,\n                sourceKey = \"asset_$assetName\"\n            )\n        } catch (e: Exception) {\n            throw e\n        }\n\n        return resultFlow as Flow<TemplateResult>\n    }\n\n    fun loadFromFile(file: File): Flow<TemplateResult> {\n        val resultFlow = MutableStateFlow<TemplateResult?>(null)\n\n        try {\n            val localFile = AstRuntime.LocalFile(file)\n            val node = localFile.createNode()\n\n            resultFlow.value = TemplateResult(\n                programNode = node,\n                sourceKey = \"file_${file.absolutePath}\"\n            )\n        } catch (e: Exception) {\n            throw e\n        }\n\n        return resultFlow as Flow<TemplateResult>\n    }\n\n    fun loadFromZipFile(zipFile: File): Flow<TemplateResult> {\n        val resultFlow = MutableStateFlow<TemplateResult?>(null)\n\n        try {\n            val extractedFile = extractMainFileFromZip(zipFile)\n            val localFile = AstRuntime.LocalFile(extractedFile)\n            val node = localFile.createNode()\n\n            resultFlow.value = TemplateResult(\n                programNode = node,\n                sourceKey = \"zip_${zipFile.absolutePath}\"\n            )\n        } catch (e: Exception) {\n            throw e\n        }\n\n        return resultFlow as Flow<TemplateResult>\n    }\n\n    private fun extractMainFileFromZip(zipFile: File): File {\n        ZipFile(zipFile).use { zip ->\n            val entry = zip.entries().asSequence().firstOrNull {\n                it.name.endsWith(\".kt\") && !it.isDirectory\n            } ?: throw IllegalArgumentException(\"No Kotlin files found in zip\")\n\n            val extractedFile = File.createTempFile(\"extracted\", \".kt\")\n            zip.getInputStream(entry).use { input ->\n                extractedFile.outputStream().use { output ->\n                    input.copyTo(output)\n                }\n            }\n\n            return extractedFile\n        }\n    }\n}\n\n/**\n * Holder for Composable content\n */\nclass ComposableHolder {\n    var componentDescriptor: ComposeComponentDescriptor? = null\n}\n\n/**\n * Context provider for CloudComposable\n */\nobject ComposeContext {\n    private val contextMap = mutableMapOf<String, Any>()\n\n    fun <T> run(name: String, body: () -> T, overrides: Map<Any, () -> Any?> = emptyMap()): T {\n        val savedContext = HashMap(contextMap)\n\n        try {\n            overrides.forEach { (key, provider) ->\n                contextMap[key.toString()] = provider() ?: Any()\n            }\n\n            return body()\n        } finally {\n            contextMap.clear()\n            contextMap.putAll(savedContext)\n        }\n    }\n\n    fun <T> get(key: Class<T>): T? {\n        @Suppress(\"UNCHECKED_CAST\")\n        return contextMap[key.toString()] as? T\n    }\n}\n\n/**\n * View model for CloudComposable to manage state\n */\nclass CloudComposeViewModel : ViewModel() {\n    var templateResult by mutableStateOf<TemplateResult?>(null)\n    var arguments by mutableStateOf<Arguments?>(null)\n    var error by mutableStateOf<Throwable?>(null)\n    var astRuntime by mutableStateOf<AstRuntime?>(null)\n    var composableCache by mutableStateOf<(@Composable () -> Unit)?>(null)\n\n    fun loadTemplate(\n        template: TemplateProvider,\n        arguments: Arguments?,\n        errorCallback: ((Throwable, Array<StackTraceElement>) -> Unit)?,\n        eventCallback: ((EasyComposeEvent) -> Unit)?\n    ) {\n        viewModelScope.launch {\n            try {\n                template.resolve()\n                    .catch { e ->\n                        error = e\n                        eventCallback?.invoke(EasyComposeEvent.LOAD_ERROR)\n                        errorCallback?.invoke(e, e.stackTrace)\n                    }\n                    .collect { result ->\n                        templateResult = result\n                        this@CloudComposeViewModel.arguments = arguments\n                        error = null\n                        composableCache = null\n\n                        astRuntime = AstRuntime(result.programNode)\n                        eventCallback?.invoke(EasyComposeEvent.LOAD_COMPLETE)\n                    }\n            } catch (e: Exception) {\n                error = e\n                eventCallback?.invoke(EasyComposeEvent.LOAD_ERROR)\n                errorCallback?.invoke(e, e.stackTrace)\n            }\n        }\n    }\n\n    fun updateArguments(arguments: Arguments?) {\n        if (templateResult != null) {\n            this.arguments = arguments\n            composableCache = null\n        }\n    }\n}\n\n/**\n * Type for loading builder\n */\ntypealias TemplateLoadingBuilder = @Composable () -> Unit\n\n/**\n * Type for error builder\n */\ntypealias TemplateErrorWidgetBuilder = @Composable (Throwable, Array<StackTraceElement>?) -> Unit\n\n/**\n * Main Composable function for dynamic UI\n */\n@Composable\nfun CloudComposableFunction(\n    template: TemplateProvider,\n    arguments: Arguments? = null,\n    loadingBuilder: TemplateLoadingBuilder? = null,\n    errorBuilder: TemplateErrorWidgetBuilder? = null,\n    errorCallback: ((Throwable, Array<StackTraceElement>) -> Unit)? = null,\n    eventCallback: ((EasyComposeEvent) -> Unit)? = null,\n    viewModel: CloudComposeViewModel = remember { CloudComposeViewModel() }\n) {\n    // Load template when provider changes\n    LaunchedEffect(template) {\n        viewModel.loadTemplate(template, arguments, errorCallback, eventCallback)\n    }\n\n    // Update arguments when they change\n    LaunchedEffect(arguments) {\n        viewModel.updateArguments(arguments)\n    }\n\n    // Cleanup\n    DisposableEffect(Unit) {\n        onDispose {\n            // Cleanup resources\n        }\n    }\n\n    // Render appropriate content\n    when {\n        viewModel.error != null -> {\n            if (errorBuilder != null) {\n                errorBuilder(viewModel.error!!, viewModel.error!!.stackTrace)\n            } else {\n                DefaultErrorContent(viewModel.error!!)\n            }\n        }\n\n        viewModel.templateResult == null -> {\n            if (loadingBuilder != null) {\n                loadingBuilder()\n            } else {\n                DefaultLoadingContent()\n            }\n        }\n\n        else -> {\n            if (viewModel.composableCache == null) {\n                viewModel.composableCache = createDynamicComposable(\n                    viewModel.astRuntime!!,\n                    viewModel.arguments\n                )\n            }\n\n            // Use Column instead of Box to avoid BoxScope issues\n            Text(\n                text = \"viewModel.composableCache?.invoke()...\",\n                modifier = Modifier.padding(top = 16.dp)\n            )\n            Surface(\n                modifier = Modifier.fillMaxSize(),\n                color = MaterialTheme.colors.background\n            ) {\n\n                Column(\n                    Modifier.fillMaxWidth(),\n                    horizontalAlignment = Alignment.CenterHorizontally\n                ) {\n                    Button(onClick = {}) {\n                        Text(\"这是由云端下发资源渲染的一个动态化的页面\")\n                    }\n                    Column(\n                        Modifier.fillMaxWidth(),\n                        horizontalAlignment = Alignment.CenterHorizontally\n                    ) {\n                        Box(\n                            modifier = Modifier\n                                .fillMaxWidth()\n                                .padding(16.dp) // 设置外部边缘（padding）\n                                .clip(RoundedCornerShape(10.dp)) // 设置圆角半径为10dp\n                                .background(Color(0xFFD1EAFB)), // 设置背景颜色\n                            contentAlignment = Alignment.Center // 将 Text 垂直和水平居中\n                        ) {\n                            viewModel.composableCache?.invoke()\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n\n/**\n * Create a composable from AstRuntime\n */\nprivate fun createDynamicComposable(\n    runtime: AstRuntime,\n    arguments: Arguments?\n): @Composable () -> Unit {\n    return {\n        val holder = ComposableHolder()\n        var descriptorState by remember { mutableStateOf<ComposeComponentDescriptor?>(null) }\n\n        // Create or retrieve the dynamic composable\n        LaunchedEffect(runtime, arguments) {\n            context.run(\n                name = \"CloudComposable\",\n                body = {\n                    if (runtime.hasTopLevelFunction(\"Main\")) {\n                        // Execute main function if it exists\n                        Log.d(\"CloudComposable\", \"Executing main function\")\n                        val invoke = runtime.invoke2(\n                            \"Main\",\n                            arguments?.positionalArguments ?: emptyList(),\n                            arguments?.namedArguments\n                        )\n                        // Get the holder from context\n                        // 获取holder\n                        val composableHolder = context.get(ComposableHolder::class.java)\n                        if (composableHolder != null && composableHolder.componentDescriptor != null) {\n                            holder.componentDescriptor = composableHolder.componentDescriptor\n                        } else {\n                            // 创建描述符而不是直接创建Composable函数\n                            holder.componentDescriptor = obtainDefaultCompose()\n                        }\n                    } else {\n                        // Look for composable classes\n                        // 查找Composable类\n                        Log.d(\"CloudComposable\", \"Looking for composable classes\")\n                        var foundComposable = false\n\n                        for (astClass in runtime.classes) {\n                            if (astClass.superclass?.simpleName == \"\\$ProxyComposable\" ||\n                                astClass.superclass?.simpleName == \"\\$ComposableWidget\"\n                            ) {\n                                Log.d(\n                                    \"CloudComposable\",\n                                    \"Found composable class: ${astClass.simpleName}\"\n                                )\n\n                                // 创建描述符\n                                holder.componentDescriptor = obtainDefaultCompose()\n\n                                foundComposable = true\n                                break\n                            }\n                        }\n\n                        if (!foundComposable) {\n                            // 创建描述符\n                            holder.componentDescriptor = obtainDefaultCompose()\n                        }\n                    }\n\n                    // 然后在更新时\n                    if (holder.componentDescriptor != null) {\n                        descriptorState = holder.componentDescriptor!!\n                    }\n                },\n                overrides = mapOf(\n                    ComposableHolder::class.java to { holder }\n                )\n            )\n        }\n\n        // Render the composable\n        if (descriptorState != null) {\n            // 使用工厂方法渲染组件\n            RenderComponent(descriptorState!!)\n        } else {\n            // 默认加载显示\n            Text(\"Loading composable content...\")\n        }\n    }\n}\n\nprivate fun obtainDefaultCompose(): ComposeComponentDescriptor = ComposeComponentDescriptor(\n    \"androidx.compose.material.Text\",\n    null, null, null\n)\n\n/**\n * Check if runtime has top-level function\n */\nfun AstRuntime.hasTopLevelFunction(name: String): Boolean {\n    return invoke2(name) != null\n}\n\n/**\n * Default loading content\n */\n@Composable\nprivate fun DefaultLoadingContent() {\n    Text(\n        text = \"Loading template...\",\n        modifier = Modifier.padding(top = 16.dp)\n    )\n}\n\n//\n///**\n// * Default error content\n// */\n@Composable\nprivate fun DefaultErrorContent(error: Throwable) {\n    // Use a simple Text as a fallback\n    Text(\n        text = \"Error loading template: ${error.message}\",\n        color = Color.Red,\n        modifier = Modifier\n            .fillMaxWidth()\n            .padding(16.dp)\n    )\n}\n\n/**\n * Object to host CloudComposable extension functions\n */\nobject CloudComposable {\n    /**\n     * Convenience function for network templates\n     */\n    @Composable\n    fun Network(\n        url: String,\n        fileMd5: String? = null,\n        arguments: Arguments? = null,\n        loadingBuilder: TemplateLoadingBuilder? = null,\n        errorBuilder: TemplateErrorWidgetBuilder? = null,\n        errorCallback: ((Throwable, Array<StackTraceElement>) -> Unit)? = null,\n        eventCallback: ((EasyComposeEvent) -> Unit)? = null\n    ) {\n        CloudComposableFunction(\n            template = NetworkTemplate(url, fileMd5),\n            arguments = arguments,\n            loadingBuilder = loadingBuilder,\n            errorBuilder = errorBuilder,\n            errorCallback = errorCallback,\n            eventCallback = eventCallback\n        )\n    }\n\n    /**\n     * Convenience function for asset templates\n     */\n    @Composable\n    fun Asset(\n        assetName: String,\n        arguments: Arguments? = null,\n        loadingBuilder: TemplateLoadingBuilder? = null,\n        errorBuilder: TemplateErrorWidgetBuilder? = null,\n        errorCallback: ((Throwable, Array<StackTraceElement>) -> Unit)? = null,\n        eventCallback: ((EasyComposeEvent) -> Unit)? = null\n    ) {\n        CloudComposableFunction(\n            template = AssetTemplate(assetName),\n            arguments = arguments,\n            loadingBuilder = loadingBuilder,\n            errorBuilder = errorBuilder,\n            errorCallback = errorCallback,\n            eventCallback = eventCallback\n        )\n    }\n\n    /**\n     * Convenience function for file templates\n     */\n    @Composable\n    fun File(\n        file: File,\n        arguments: Arguments? = null,\n        loadingBuilder: TemplateLoadingBuilder? = null,\n        errorBuilder: TemplateErrorWidgetBuilder? = null,\n        errorCallback: ((Throwable, Array<StackTraceElement>) -> Unit)? = null,\n        eventCallback: ((EasyComposeEvent) -> Unit)? = null\n    ) {\n        CloudComposableFunction(\n            template = FileTemplate(file),\n            arguments = arguments,\n            loadingBuilder = loadingBuilder,\n            errorBuilder = errorBuilder,\n            errorCallback = errorCallback,\n            eventCallback = eventCallback\n        )\n    }\n\n    /**\n     * Convenience function for zip file templates\n     */\n    @Composable\n    fun ZipFile(\n        zipFile: File,\n        arguments: Arguments? = null,\n        loadingBuilder: TemplateLoadingBuilder? = null,\n        errorBuilder: TemplateErrorWidgetBuilder? = null,\n        errorCallback: ((Throwable, Array<StackTraceElement>) -> Unit)? = null,\n        eventCallback: ((EasyComposeEvent) -> Unit)? = null\n    ) {\n        CloudComposableFunction(\n            template = ZipFileTemplate(zipFile),\n            arguments = arguments,\n            loadingBuilder = loadingBuilder,\n            errorBuilder = errorBuilder,\n            errorCallback = errorCallback,\n            eventCallback = eventCallback\n        )\n    }\n}\n\nprivate fun obtainJson(): String {\n//    return \"{\\n\" +\n//            \"  \\\"directives\\\" : [ {\\n\" +\n//            \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//            \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.Column\\\",\\n\" +\n//            \"    \\\"alias\\\" : null,\\n\" +\n//            \"    \\\"name\\\" : \\\"Column\\\"\\n\" +\n//            \"  }, {\\n\" +\n//            \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//            \"    \\\"importPath\\\" : \\\"androidx.compose.material.Text\\\",\\n\" +\n//            \"    \\\"alias\\\" : null,\\n\" +\n//            \"    \\\"name\\\" : \\\"Text\\\"\\n\" +\n//            \"  }, {\\n\" +\n//            \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n//            \"    \\\"importPath\\\" : \\\"androidx.compose.runtime.Composable\\\",\\n\" +\n//            \"    \\\"alias\\\" : null,\\n\" +\n//            \"    \\\"name\\\" : \\\"Composable\\\"\\n\" +\n//            \"  } ],\\n\" +\n//            \"  \\\"declarations\\\" : [ {\\n\" +\n//            \"    \\\"type\\\" : \\\"ClassDeclaration\\\",\\n\" +\n//            \"    \\\"name\\\" : \\\"ColumComposeNameExpressText\\\",\\n\" +\n//            \"    \\\"members\\\" : [ {\\n\" +\n//            \"      \\\"type\\\" : \\\"MethodDeclaration\\\",\\n\" +\n//            \"      \\\"name\\\" : \\\"Main\\\",\\n\" +\n//            \"      \\\"parameters\\\" : [ ],\\n\" +\n//            \"      \\\"typeParameters\\\" : [ ],\\n\" +\n//            \"      \\\"body\\\" : {\\n\" +\n//            \"        \\\"type\\\" : \\\"BlockStatement\\\",\\n\" +\n//            \"        \\\"body\\\" : [ {\\n\" +\n//            \"          \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n//            \"          \\\"constructorName\\\" : \\\"Column\\\",\\n\" +\n//            \"          \\\"argumentList\\\" : null,\\n\" +\n//            \"          \\\"typeArguments\\\" : [ ],\\n\" +\n//            \"          \\\"children\\\" : [ {\\n\" +\n//            \"            \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n//            \"            \\\"constructorName\\\" : \\\"Text\\\",\\n\" +\n//            \"            \\\"argumentList\\\" : {\\n\" +\n//            \"              \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n//            \"              \\\"arguments\\\" : [ {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"text\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"StringTemplateExpression\\\",\\n\" +\n//            \"                  \\\"name\\\" : null,\\n\" +\n//            \"                  \\\"body\\\" : {\\n\" +\n//            \"                    \\\"type\\\" : \\\"StringTemplateEntry\\\",\\n\" +\n//            \"                    \\\"body\\\" : null,\\n\" +\n//            \"                    \\\"value\\\" : \\\"1这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"\\n\" +\n//            \"                  }\\n\" +\n//            \"                }\\n\" +\n//            \"              }, {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"minLines\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n//            \"                  \\\"value\\\" : \\\"1\\\",\\n\" +\n//            \"                  \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n//            \"                }\\n\" +\n//            \"              } ]\\n\" +\n//            \"            },\\n\" +\n//            \"            \\\"typeArguments\\\" : [ ],\\n\" +\n//            \"            \\\"children\\\" : [ ]\\n\" +\n//            \"          }, {\\n\" +\n//            \"            \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n//            \"            \\\"constructorName\\\" : \\\"Text\\\",\\n\" +\n//            \"            \\\"argumentList\\\" : {\\n\" +\n//            \"              \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n//            \"              \\\"arguments\\\" : [ {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"text\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"StringTemplateExpression\\\",\\n\" +\n//            \"                  \\\"name\\\" : null,\\n\" +\n//            \"                  \\\"body\\\" : {\\n\" +\n//            \"                    \\\"type\\\" : \\\"StringTemplateEntry\\\",\\n\" +\n//            \"                    \\\"body\\\" : null,\\n\" +\n//            \"                    \\\"value\\\" : \\\"2这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"\\n\" +\n//            \"                  }\\n\" +\n//            \"                }\\n\" +\n//            \"              }, {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"minLines\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n//            \"                  \\\"value\\\" : \\\"1\\\",\\n\" +\n//            \"                  \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n//            \"                }\\n\" +\n//            \"              } ]\\n\" +\n//            \"            },\\n\" +\n//            \"            \\\"typeArguments\\\" : [ ],\\n\" +\n//            \"            \\\"children\\\" : [ ]\\n\" +\n//            \"          }, {\\n\" +\n//            \"            \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n//            \"            \\\"constructorName\\\" : \\\"Text\\\",\\n\" +\n//            \"            \\\"argumentList\\\" : {\\n\" +\n//            \"              \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n//            \"              \\\"arguments\\\" : [ {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"text\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"StringTemplateExpression\\\",\\n\" +\n//            \"                  \\\"name\\\" : null,\\n\" +\n//            \"                  \\\"body\\\" : {\\n\" +\n//            \"                    \\\"type\\\" : \\\"StringTemplateEntry\\\",\\n\" +\n//            \"                    \\\"body\\\" : null,\\n\" +\n//            \"                    \\\"value\\\" : \\\"3这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"\\n\" +\n//            \"                  }\\n\" +\n//            \"                }\\n\" +\n//            \"              }, {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"minLines\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n//            \"                  \\\"value\\\" : \\\"1\\\",\\n\" +\n//            \"                  \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n//            \"                }\\n\" +\n//            \"              } ]\\n\" +\n//            \"            },\\n\" +\n//            \"            \\\"typeArguments\\\" : [ ],\\n\" +\n//            \"            \\\"children\\\" : [ ]\\n\" +\n//            \"          }, {\\n\" +\n//            \"            \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n//            \"            \\\"constructorName\\\" : \\\"Text\\\",\\n\" +\n//            \"            \\\"argumentList\\\" : {\\n\" +\n//            \"              \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n//            \"              \\\"arguments\\\" : [ {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"text\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"StringTemplateExpression\\\",\\n\" +\n//            \"                  \\\"name\\\" : null,\\n\" +\n//            \"                  \\\"body\\\" : {\\n\" +\n//            \"                    \\\"type\\\" : \\\"StringTemplateEntry\\\",\\n\" +\n//            \"                    \\\"body\\\" : null,\\n\" +\n//            \"                    \\\"value\\\" : \\\"4这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\\\"\\n\" +\n//            \"                  }\\n\" +\n//            \"                }\\n\" +\n//            \"              }, {\\n\" +\n//            \"                \\\"type\\\" : \\\"Argument\\\",\\n\" +\n//            \"                \\\"isNamed\\\" : true,\\n\" +\n//            \"                \\\"name\\\" : \\\"minLines\\\",\\n\" +\n//            \"                \\\"body\\\" : {\\n\" +\n//            \"                  \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n//            \"                  \\\"value\\\" : \\\"1\\\",\\n\" +\n//            \"                  \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n//            \"                }\\n\" +\n//            \"              } ]\\n\" +\n//            \"            },\\n\" +\n//            \"            \\\"typeArguments\\\" : [ ],\\n\" +\n//            \"            \\\"children\\\" : [ ]\\n\" +\n//            \"          } ]\\n\" +\n//            \"        } ]\\n\" +\n//            \"      },\\n\" +\n//            \"      \\\"isStatic\\\" : false,\\n\" +\n//            \"      \\\"isGetter\\\" : true,\\n\" +\n//            \"      \\\"isSetter\\\" : false\\n\" +\n//            \"    } ],\\n\" +\n//            \"    \\\"body\\\" : { }\\n\" +\n//            \"  } ],\\n\" +\n//            \"  \\\"type\\\" : \\\"CompilationUnit\\\"\\n\" +\n//            \"}\"\n\n    return \"{\\\"directives\\\":[{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.foundation.layout.Column\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Column\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.material.MaterialTheme\\\",\\\"alias\\\":null,\\\"name\\\":\\\"MaterialTheme\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.material.Text\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Text\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.runtime.Composable\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Composable\\\"},{\\\"type\\\":\\\"ImportDirective\\\",\\\"importPath\\\":\\\"androidx.compose.ui.graphics.Color\\\",\\\"alias\\\":null,\\\"name\\\":\\\"Color\\\"}],\\\"declarations\\\":[{\\\"type\\\":\\\"ClassDeclaration\\\",\\\"name\\\":\\\"ColumArgsComposeExpressText\\\",\\\"members\\\":[{\\\"type\\\":\\\"MethodDeclaration\\\",\\\"name\\\":\\\"Main\\\",\\\"parameters\\\":[],\\\"typeParameters\\\":[],\\\"body\\\":{\\\"type\\\":\\\"BlockStatement\\\",\\\"body\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":null,\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"主标题 1\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h4\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"副标题 1\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h5\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"主标题 2\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h4\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"副标题 3\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h5\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Column\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[]},\\\"typeArguments\\\":[],\\\"children\\\":[{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"主标题 2\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h4\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]},{\\\"type\\\":\\\"InstanceCreationExpression\\\",\\\"constructorName\\\":\\\"Text\\\",\\\"argumentList\\\":{\\\"type\\\":\\\"ArgumentList\\\",\\\"arguments\\\":[{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"text\\\",\\\"body\\\":{\\\"type\\\":\\\"StringTemplateExpression\\\",\\\"name\\\":null,\\\"body\\\":{\\\"type\\\":\\\"StringTemplateEntry\\\",\\\"body\\\":null,\\\"value\\\":\\\"副标题 3\\\"}}},{\\\"type\\\":\\\"Argument\\\",\\\"isNamed\\\":true,\\\"name\\\":\\\"style\\\",\\\"body\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"h5\\\"},\\\"target\\\":{\\\"type\\\":\\\"MethodInvocation\\\",\\\"name\\\":null,\\\"methodName\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"typography\\\"},\\\"target\\\":{\\\"type\\\":\\\"Identifier\\\",\\\"name\\\":\\\"MaterialTheme\\\"}}}}]},\\\"typeArguments\\\":[],\\\"children\\\":[]}]}]}]},\\\"isStatic\\\":false,\\\"isGetter\\\":true,\\\"isSetter\\\":false}],\\\"body\\\":{}}],\\\"type\\\":\\\"CompilationUnit\\\"}\"\n}\n/**\n * Example usage\n */\n@Composable\nfun ExampleUsage() {\n//    Column(\n//    ) {\n//        Text(\n//            text = \"主标题 1\",\n//            style = MaterialTheme.typography.h6,\n//        )\n//        Text(text = \"副标题 1\", style = MaterialTheme.typography.body1, color = Color.Gray)\n//    }\n    val testFile = File(\"src/test/java/com/aether/core/compose/DemoCompose.kt\")\n    CloudComposable.Asset(\n        assetName = \"mytest\",\n        arguments = Arguments(\n            positionalArguments = listOf(5, \"a\"),\n            namedArguments = mapOf(\"name\" to \"value\")\n        ),\n        eventCallback = { event ->\n            when (event) {\n                EasyComposeEvent.LOAD_COMPLETE -> Log.d(\"Example\", \"Template loaded\")\n                EasyComposeEvent.LOAD_ERROR -> Log.d(\"Example\", \"Template failed to load\")\n            }\n        }\n    )\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/deliver/binding.kt",
    "content": "package com.aether.core.runtime.deliver\n\nimport com.aether.core.runtime.AppContextManager.context\nimport com.aether.core.runtime.AstMethod\nimport com.aether.core.runtime.Expression\nimport com.aether.core.runtime.MethodDeclaration\nimport com.aether.core.runtime.executeExpression\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\n\n// 实现 doRunBuild 方法\nfun doRunBuild(func: MethodDeclaration) {\n    val arguments = context.get<Arguments>(Arguments::class.java)\n    val positionalArguments = mutableListOf<Any?>()\n    val namedArguments = mutableMapOf<String, Any?>()\n\n    if (arguments != null) {\n        arguments.positionalArguments?.let { positionalArguments.addAll(it) }\n        arguments.namedArguments?.let { namedArguments.putAll(it) }\n    }\n\n    val method = AstMethod.fromExpression(func)\n    val holder = context.get<ComposableHolder>(ComposableHolder::class.java)!!\n\n    // 处理返回的结果\n    val result = AstMethod.apply2(method, positionalArguments, namedArguments)\n\n    // 如果结果是 ComposeComponentDescriptor，直接设置\n    if (result is ComposeComponentDescriptor) {\n        holder.componentDescriptor = result\n    } else {\n        // 对于其他类型的结果，创建一个默认的 Text 组件描述符\n        holder.componentDescriptor = obtainDefaultCompose()\n    }\n}\n\nprivate fun obtainDefaultCompose(): ComposeComponentDescriptor = ComposeComponentDescriptor(\n    \"androidx.compose.material.Text\",\n    null, null, null\n)\n\n// 实现 invokeRunMain 方法\nfun invokeRunMain(expression: Any?) {\n    val holder = context.get<ComposableHolder>(ComposableHolder::class.java)!!\n//    val result = executeExpression(expression)\n\n    // 处理返回的结果\n    if (expression is ComposeComponentDescriptor) {\n        holder.componentDescriptor = expression\n    } else {\n        // 默认情况\n        holder.componentDescriptor = obtainDefaultCompose()\n    }\n}\n\n\n// 实现 invokeRunApp 方法\nfun invokeRunApp(expression: Expression) {\n    val holder = context.get<ComposableHolder>(ComposableHolder::class.java)!!\n    val result = executeExpression(expression)\n\n    // 处理返回的结果\n    if (result is ComposeComponentDescriptor) {\n        holder.componentDescriptor = result\n    } else {\n        // 默认情况\n        holder.componentDescriptor = obtainDefaultCompose()\n    }\n}\n"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/entity/SimpleMember.kt",
    "content": "package com.aether.core.runtime.entity\n\n// 简单的成员表示，用于替代可能导致问题的KCallable\nclass SimpleMember(val name: String, val modifiers: Int) {\n    val isStatic: Boolean\n        get() = modifiers and java.lang.reflect.Modifier.STATIC != 0\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/mirror/MirrorHelper.kt",
    "content": "package com.aether.core.runtime.mirror\n\nimport android.util.Log\nimport androidx.compose.ui.Modifier\nimport java.lang.reflect.Field\nimport java.lang.reflect.Method\nimport kotlin.reflect.KCallable\nimport kotlin.reflect.KClass\nimport kotlin.reflect.KFunction\nimport kotlin.reflect.full.findAnnotation\nimport kotlin.reflect.jvm.javaMethod\n\nobject MirrorHelper {\n\n    /**\n     * 安全获取类的成员，特别处理Compose UI组件\n     * @param kClass 要反射的Kotlin类\n     * @return 成员集合，包含方法和属性\n     */\n    fun safeGetMembers(kClass: KClass<*>): Collection<KCallableLike> {\n        return try {\n            if (kClass.qualifiedName?.startsWith(\"androidx.compose\") == true) {\n                // 对于Compose类，使用Java反射获取更安全的成员列表\n                val javaClass = kClass.java\n                val result = mutableListOf<KCallableLike>()\n\n                // 添加方法\n                javaClass.declaredMethods.forEach { method ->\n                    result.add(JavaMethodAdapter(method))\n                }\n\n                // 添加字段\n                javaClass.declaredFields.forEach { field ->\n                    result.add(JavaFieldAdapter(field))\n                }\n\n                result\n            } else {\n                // 非Compose类使用正常的Kotlin反射\n                kClass.members.map { KCallableAdapter(it) }\n            }\n        } catch (e: Exception) {\n            Log.e(\"Reflection\", \"Error accessing members of ${kClass.qualifiedName}\", e)\n            // 返回空列表作为后备\n            emptyList()\n        }\n    }\n\n    /**\n     * KCallable接口的统一表示\n     */\n    interface KCallableLike {\n        val name: String\n        val isStatic: Boolean\n        fun call(vararg args: Any?): Any?\n        fun hasAnnotation(annotationClass: KClass<out Annotation>): Boolean\n    }\n\n    /**\n     * 包装KCallable的适配器\n     */\n    class KCallableAdapter(private val callable: KCallable<*>) : KCallableLike {\n        override val name: String = callable.name\n\n        override val isStatic: Boolean\n            get() = callable.findAnnotation<JvmStatic>() != null ||\n                    (callable is KFunction<*> &&\n                            callable.javaMethod?.let {\n                                java.lang.reflect.Modifier.isStatic(it.modifiers) // 明确使用完整类名\n                            } == true)\n\n\n        override fun call(vararg args: Any?): Any? {\n            return callable.call(*args)\n        }\n\n        override fun hasAnnotation(annotationClass: KClass<out Annotation>): Boolean {\n            return callable.annotations.any { it.annotationClass == annotationClass }\n        }\n    }\n\n    /**\n     * Java Method的适配器\n     */\n    class JavaMethodAdapter(private val method: Method) : KCallableLike {\n        override val name: String = method.name\n\n        override val isStatic: Boolean\n            get() = java.lang.reflect.Modifier.isStatic(method.modifiers) // 明确使用完整类名\n\n        override fun call(vararg args: Any?): Any? {\n            val accessible = method.isAccessible\n            try {\n                method.isAccessible = true\n                return method.invoke(null, *args)\n            } finally {\n                method.isAccessible = accessible\n            }\n        }\n\n        override fun hasAnnotation(annotationClass: KClass<out Annotation>): Boolean {\n            return method.isAnnotationPresent(annotationClass.java)\n        }\n    }\n\n    /**\n     * Java Field的适配器\n     */\n    class JavaFieldAdapter(private val field1: Field) : KCallableLike {\n        override val name: String = field1.name\n\n\n        override val isStatic: Boolean\n            get() = java.lang.reflect.Modifier.isStatic(field1.modifiers) // 明确使用完整类名\n\n\n        override fun call(vararg args: Any?): Any? {\n            val accessible = field1.isAccessible\n            try {\n                field1.isAccessible = true\n                return if (args.isEmpty()) {\n                    field1.get(null)\n                } else {\n                    field1.set(null, args[0])\n                    null\n                }\n            } finally {\n                field1.isAccessible = accessible\n            }\n        }\n\n        override fun hasAnnotation(annotationClass: KClass<out Annotation>): Boolean {\n            return field1.isAnnotationPresent(annotationClass.java)\n        }\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/proxy/ProxyBinding.kt",
    "content": "package com.aether.core.runtime.proxy\n\nimport com.aether.core.runtime.ImportDirective\nimport com.aether.core.runtime.reflectable.ComposeMirror\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport java.lang.reflect.Modifier\nimport kotlin.reflect.KClass\nimport kotlin.reflect.full.createInstance\nimport kotlin.reflect.jvm.javaMethod\n\n// 假设 BindingBase 是一个基础类\nopen class BindingBase {\n    open fun initInstances() {\n        println(\"BindingBase initInstances called\")\n    }\n}\n\n// ProxyBinding 类，使用继承代替 mixin\nclass ProxyBinding : BindingBase() {\n\n    companion object {\n        private var _instance: ProxyBinding? = null\n\n        // 单例访问方法\n        val instance: ProxyBinding?\n            get() = _instance\n    }\n\n    override fun initInstances() {\n        super.initInstances()\n        _instance = this\n        initializeReflectable()\n        initializeProxy()\n    }\n\n    // 初始化反射相关的逻辑\n    private fun initializeReflectable() {\n        println(\"Initializing reflectable...\")\n    }\n\n    // 初始化代理相关的逻辑\n    private fun initializeProxy() {\n        println(\"Initializing proxy...\")\n    }\n\n    // 根据类型名称获取类镜像\n    fun getProxyClassForName2(typeName: String): ComposeReflector? {\n        return ComposeMirror.getReflector(typeName)\n    }\n\n\n    // 根据类型名称获取类镜像\n    fun getProxyClassForName(directive: ImportDirective?): KClass<*>? {\n        // 假设 p.data 是一个存储类型映射的全局变量\n        // 尝试通过反射加载类\n        if (directive == null) {\n            return null\n        }\n        return try {\n            //parseKtClass(directive.uri, \"\", ArrayList<String>())\n            Class.forName(directive.uri).kotlin\n        } catch (e: ClassNotFoundException) {\n            println(\"Class not found for type: ${directive.name}\")\n            null\n        }\n    }\n\n    fun parseKtClass(className: String, methodName: String, methodArgs: List<*>) {\n        // 假设这是从 PSI 解析生成的 Map<String, Any>\n        val parsedMap: Map<String, Any> = mapOf(\n            \"className\" to \"org.example.MyClass\",\n            \"methodName\" to \"myMethod\",\n            \"methodArgs\" to listOf(\"arg1\", \"arg2\")\n        )\n\n//        // 动态加载类并调用方法\n//        val className = parsedMap[\"className\"] as String\n//        val methodName = parsedMap[\"methodName\"] as String\n//        val methodArgs = parsedMap[\"methodArgs\"] as List<*>\n\n        try {\n            // 1. 动态加载类\n            val clazz: Class<*> = Class.forName(className)\n            val kClass: KClass<*> = clazz.kotlin\n\n            // 2. 获取目标方法\n            val memberFunction = kClass.members.find { it.name == methodName }\n                ?: throw NoSuchMethodException(\"No such method: $methodName\")\n\n            // 3. 调用方法\n            if (memberFunction is kotlin.reflect.KFunction<*>) {\n                // 创建实例（如果需要）\n                val instance = if (!clazz.isInterface && !Modifier.isStatic(\n                        memberFunction.javaMethod?.modifiers ?: 0\n                    )\n                ) {\n                    clazz.getDeclaredConstructor().newInstance()\n                } else {\n                    null\n                }\n\n                // 调用方法\n                val result = memberFunction.call(instance, *methodArgs.toTypedArray())\n                println(\"Result of $methodName: $result\")\n            } else {\n                throw IllegalArgumentException(\"$methodName is not a callable function\")\n            }\n        } catch (e: Exception) {\n            e.printStackTrace()\n        }\n    }\n}\n\n\n// 假设的全局数据源 p.data\nobject p {\n    val data: Map<String, Class<*>> = mapOf(\n        \"ExampleType\" to ExampleType::class.java\n    )\n}\n\n// 示例类\nclass ExampleType\n\nfun mainTest() {\n//    // 创建并初始化 ProxyBinding 实例\n//    val proxyBinding = ProxyBinding()\n//    proxyBinding.initInstances()\n//\n//    // 获取当前实例\n//    val currentInstance = ProxyBinding.instance\n//    println(\"Current ProxyBinding instance: $currentInstance\")\n//\n//    // 测试 getProxyClassForName 方法\n//    val proxyClass = currentInstance?.getProxyClassForName(\"ExampleType\")\n//    println(\"Proxy class for 'ExampleType': $proxyClass\")\n//\n//    val invalidClass = currentInstance?.getProxyClassForName(\"InvalidType\")\n//    println(\"Proxy class for 'InvalidType': $invalidClass\")\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ClassMirror.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\nimport kotlin.reflect.KClass\n\nabstract class ClassMirror : TypeMirror() {\n\n//    /**\n//     * 当前类所实现的所有接口的镜像列表。\n//     */\n//    abstract val superinterfaces: List<ClassMirror>\n\n\n    /**\n     * 返回当前类中显式声明的所有成员的不可变映射。\n     *\n     * 包括方法、getter、setter、字段、构造函数等。\n     * 不包括继承来的成员。\n     *\n     * 映射以简单名称为键，[DeclarationMirror] 为值。\n     *\n     * 所需能力: [DeclarationsCapability]\n     */\n    abstract val declarations: Map<String, DeclarationMirror>\n\n    /**\n     * 返回实例可以访问的所有成员（包括继承的）。\n     *\n     * 包括方法、getter、setter。\n     * 字段本身不包含，但其 getter/setter 会被包含。\n     *\n     * 映射以简单名称为键，[MethodMirror] 为值。\n     *\n     * 所需能力: [DeclarationsCapability]\n     */\n    abstract val instanceMembers: Map<String, MethodMirror>\n\n    /**\n     * 返回类的静态方法、getter 和 setter。\n     *\n     * 映射以简单名称为键，[MethodMirror] 为值。\n     *\n     * 所需能力: [DeclarationsCapability]\n     */\n    abstract val staticMembers: Map<String, MethodMirror>\n\n\n    /**\n     * 调用指定名称的构造函数并返回结果。\n     *\n     * @param constructorName 构造函数名（空字符串表示默认构造函数）\n     * @param positionalArguments 位置参数列表\n     * @param namedArguments 命名参数映射\n     */\n    abstract fun newInstance(\n        constructorName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>? = null\n    ): Any?\n}\n\n/**\n * 表示类型相关的镜像信息。\n */\nabstract class TypeMirror : DeclarationMirror() {\n\n}\n\n\n/**\n * 代表方法或访问器的镜像。\n */\nabstract class MethodMirror : DeclarationMirror() {\n    abstract val isStatic: Boolean\n\n    @Composable\n    abstract fun invoke(args: List<Any?>?, namedArgs: Map<String, Any?>?): Any?\n}\n\ndata class Symbol(val name: String)\n\ntypealias Type = KClass<*>"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ClassMirrorBase.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nopen class ClassMirrorBase(\n    override val simpleName: String,\n    override val qualifiedName: String,\n) : ClassMirror(), ObjectMirror {\n    override fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun invokeGetter(getterName: String): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override fun invokeSetter(setterName: String, value: Any?): Any? {\n        TODO(\"Not yet implemented\")\n    }\n\n    override val declarations: Map<String, DeclarationMirror>\n        get() = TODO(\"Not yet implemented\")\n    override val instanceMembers: Map<String, MethodMirror>\n        get() = TODO(\"Not yet implemented\")\n    override val staticMembers: Map<String, MethodMirror>\n        get() = TODO(\"Not yet implemented\")\n\n    override fun newInstance(\n        constructorName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        return null\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ComposeComponentDescriptor.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\nimport com.aether.core.runtime.Expression\nimport com.aether.core.runtime.executeExpression\n\n// 定义一个描述Compose组件的类，不包含@Composable注解\nclass ComposeComponentDescriptor(\n    val componentPath: String,\n    val positionalArguments: List<Any?>?,\n    val namedArguments: Map<String, Any?>?,\n    val children: List<ComposeComponentDescriptor>?\n)\n\nclass ComposeComponentDescriptor2(\n    val methodMirror: MethodMirror?,\n    val componentPath: String,\n    val positionalArguments: List<Any?>?,\n    val namedArguments: Map<String, Any?>?,\n    val children: List<ComposeComponentDescriptor>? = null\n)\n\n// 然后在@Composable函数中使用这个描述符\n@Composable\nfun RenderComponent(descriptor: ComposeComponentDescriptor) {\n    ComposeComponentFactory.createComponent(\n        descriptor.componentPath,\n        descriptor.positionalArguments,\n        descriptor.namedArguments,\n        descriptor.children\n    )\n}\n\n\n// 然后在@Composable函数中使用这个描述符\n@Composable\nfun RenderComponent(\n    componentPath: String,\n    arguments: List<Expression>?\n) {\n    var mutableList = mutableListOf<String>()\n    val expression = arguments?.get(0)\n    var text = \"Default Text\"\n    expression?.let {\n        text = executeExpression(expression) as String\n        mutableList.add(text)\n    }\n\n//    ComposeComponentFactory.createComponent2(\n//        componentPath,\n//        mutableList\n//    )\n}\n"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ComposeComponentRegistry.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.foundation.background\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.foundation.layout.fillMaxSize\nimport androidx.compose.foundation.layout.fillMaxWidth\nimport androidx.compose.foundation.layout.height\nimport androidx.compose.foundation.layout.padding\nimport androidx.compose.foundation.shape.RoundedCornerShape\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.draw.clip\nimport androidx.compose.ui.graphics.Color\nimport androidx.compose.ui.text.font.FontFamily\nimport androidx.compose.ui.text.font.FontStyle\nimport androidx.compose.ui.text.font.FontWeight\nimport androidx.compose.ui.text.style.TextAlign\nimport androidx.compose.ui.text.style.TextDecoration\nimport androidx.compose.ui.text.style.TextOverflow\nimport androidx.compose.ui.unit.TextUnit\nimport androidx.compose.ui.unit.dp\nimport androidx.compose.ui.unit.sp\nimport com.aether.core.runtime.Argument\nimport com.aether.core.runtime.Expression\nimport com.aether.core.runtime.executeExpression\nimport com.aether.core.runtime.reflectable.widgets.ColumnMirror\nimport com.aether.core.runtime.reflectable.widgets.MaterialThemeMirror\nimport com.aether.core.runtime.reflectable.widgets.TextMirror\nimport com.aether.core.runtime.reflectable.widgets.TextStyleMirror\nimport com.aether.core.runtime.reflectable.widgets.TypographyMirror\n\n// 在你的代码中添加一个辅助类来映射Compose组件\n/**\n * Compose组件工厂\n * 提供创建Compose组件的方法\n */\npublic object ComposeComponentFactory {\n    private val componentFactories = mutableMapOf<String, @Composable (Map<String, Any>) -> Unit>()\n\n    fun registerComponent(\n        name: String, factory: @Composable (Map<String, Any>) -> Unit\n    ) {\n        componentFactories[name] = factory\n    }\n\n    @Composable\n    fun createComponent2(\n        name: String, arguments: Map<String, Any> = emptyMap()\n    ) {\n        val factory = componentFactories[name]\n        if (factory != null) {\n            factory(arguments)\n        } else {\n            // 处理未找到组件的情况\n        }\n    }\n\n    // 创建动态Composable组件\n    @Composable\n    fun createComponent(\n        componentPath: String?,\n        positionalArguments: List<Any?>?,\n        namedArguments: Map<String, Any?>?,\n        children: List<ComposeComponentDescriptor>?\n    ) {\n        // 创建属性映射以存储解析后的参数\n        val props = mutableMapOf<String, Any?>()\n        when (componentPath) {\n            \"androidx.compose.material.Text\" -> {\n                // 设置默认值\n                props[\"modifier\"] = Modifier.padding(16.dp)\n                ComposeMirror.getReflector(componentPath)?.invoke(namedArguments)\n            }\n\n            \"androidx.compose.material.MaterialTheme\" -> {\n                val mergedArgs = namedArguments?.toMutableMap() ?: mutableMapOf()\n                // 使用反射器渲染Column\n                ComposeMirror.getReflector(componentPath)?.invoke(mergedArgs) ?: fallbackColumn(\n                    mergedArgs,\n                    children\n                )\n            }\n\n            \"androidx.compose.material.Typography\" -> {\n                val mergedArgs = namedArguments?.toMutableMap() ?: mutableMapOf()\n                // 使用反射器渲染Column\n                ComposeMirror.getReflector(componentPath)?.invoke(mergedArgs) ?: fallbackColumn(\n                    mergedArgs,\n                    children\n                )\n            }\n\n\n            \"androidx.compose.foundation.layout.Column\" -> {\n                // 为Column组件添加子组件信息\n                val mergedArgs = namedArguments?.toMutableMap() ?: mutableMapOf()\n                // 将子组件信息添加到参数中\n                mergedArgs[\"children\"] = children\n                // 使用反射器渲染Column\n                ComposeMirror.getReflector(componentPath)?.invoke(mergedArgs) ?: fallbackColumn(\n                    mergedArgs,\n                    children\n                )\n            }\n            // 可以继续添加更多组件...\n            else -> {\n                Text(\"未实现的组件: $componentPath\")\n            }\n        }\n    }\n\n    // 备用Column实现，当反射器不可用时使用\n    @Composable\n    private fun fallbackColumn(\n        args: Map<String, Any?>, children: List<ComposeComponentDescriptor>?\n    ) {\n//        Column(\n//            modifier = (args[\"modifier\"] as? Modifier) ?: Modifier\n//                .fillMaxSize()\n//                .padding(16.dp),\n//            verticalArrangement = (args[\"verticalArrangement\"] as? Arrangement.Vertical)\n//                ?: Arrangement.spacedBy(8.dp),\n//            horizontalAlignment = (args[\"horizontalAlignment\"] as? Alignment.Horizontal)\n//                ?: Alignment.CenterHorizontally\n//        ) {\n//            // 渲染子组件\n//            children?.forEach { childDescriptor ->\n//                createComponent(\n//                    childDescriptor.componentPath,\n//                    childDescriptor.positionalArguments,\n//                    childDescriptor.namedArguments,\n//                    childDescriptor.children\n//                )\n//            }\n//        }\n    }\n\n    // 注册生成的反射器的初始化函数\n    fun initializeComposeMirrors() {\n        // 这里会被生成的代码调用，注册所有反射器\n        // 例如自动生成的TextMirror\n        ComposeMirror.register(\n            \"androidx.compose.material.Text\", TextMirror(\n                simpleName = \"Text\",\n                \"androidx.compose.material.Text\"\n            )\n        )\n        ComposeMirror.register(\n            \"androidx.compose.foundation.layout.Column\", ColumnMirror(\n                simpleName = \"Column\",\n                qualifiedName = \"androidx.compose.foundation.layout.Column\"\n            )\n        )\n\n        ComposeMirror.register(\n            \"androidx.compose.material.MaterialTheme\", MaterialThemeMirror(\n                simpleName = \"MaterialTheme\",\n                qualifiedName = \"androidx.compose.material.MaterialTheme\"\n            )\n        )\n\n        ComposeMirror.register(\n            \"androidx.compose.material.Typography\", TypographyMirror(\n                simpleName = \"Typography\",\n                qualifiedName = \"androidx.compose.material.Typography\"\n            )\n        )\n\n        ComposeMirror.register(\n            \"androidx.compose.ui.text.TextStyle\", TextStyleMirror(\n                simpleName = \"TextStyle\",\n                qualifiedName = \"androidx.compose.ui.text.TextStyle\"\n            )\n        )\n    }\n\n    private fun initReflect() {\n\n    }\n\n    // 注册表，用于检查组件是否可用\n    private val availableComponents = setOf(\n        \"androidx.compose.material.Text\",\n        \"androidx.compose.material.Button\",\n        \"androidx.compose.foundation.layout.Column\",\n        \"androidx.compose.foundation.layout.Row\",\n        // 添加更多组件...\n    )\n\n    // 检查组件是否可用\n    fun isComponentAvailable(path: String): Boolean {\n        return availableComponents.contains(path)\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ComposeMirror.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\n\nobject ComposeMirror {\n    private val reflectors = mutableMapOf<String, ComposeReflector>()\n\n    fun register(name: String, reflector: ComposeReflector) {\n        reflectors[name] = reflector\n    }\n\n    fun getReflector(name: String): ComposeReflector? {\n        return reflectors[name]\n    }\n\n    @Composable\n    fun render(name: String, args: Map<String, Any?>?) {\n        reflectors[name]?.invoke(args) ?: error(\"No reflector found for $name\")\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ComposeMirrorRuntime.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\nimport kotlin.reflect.KClass\nimport kotlin.reflect.full.createInstance\nimport kotlin.reflect.full.memberFunctions\nimport kotlin.reflect.full.memberProperties\n\nclass ComposeMirrorRuntime {\n    private val mirrorCache = mutableMapOf<String, Any>()\n\n    fun <T : Any> createMirror(clazz: KClass<T>, params: List<Any?> = emptyList()): T {\n        val mirrorClassName = \"${clazz.simpleName}Mirror\"\n        val mirrorClass = try {\n            Class.forName(\"${clazz.qualifiedName}$mirrorClassName\")\n        } catch (e: ClassNotFoundException) {\n            throw IllegalStateException(\"Mirror class not found for ${clazz.qualifiedName}. Make sure the class is annotated with @ComposeMirror\")\n        }\n\n        val mirrorInstance = mirrorClass.getDeclaredMethod(\"invoke\", List::class.java)\n            .invoke(null, params) as T\n\n        mirrorCache[clazz.qualifiedName!!] = mirrorInstance\n        return mirrorInstance\n    }\n\n    fun invokeComposable(mirror: Any, functionName: String, vararg args: Any?): Any? {\n        val clazz = mirror::class\n        val composableFunction = clazz.memberFunctions.find { it.name == functionName }\n            ?: throw IllegalArgumentException(\"No composable function named $functionName found\")\n\n        if (!composableFunction.annotations.any { it is Composable }) {\n            throw IllegalArgumentException(\"Function $functionName is not a @Composable function\")\n        }\n\n        return composableFunction.call(mirror, *args)\n    }\n\n    fun getProperty(mirror: Any, propertyName: String): Any? {\n        val clazz = mirror::class\n        val property = clazz.memberProperties.find { it.name == propertyName }\n            ?: throw IllegalArgumentException(\"No property named $propertyName found\")\n\n        return property.getter.call(mirror)\n    }\n\n    fun setProperty(mirror: Any, propertyName: String, value: Any?) {\n        val clazz = mirror::class\n        val property = clazz.memberProperties.find { it.name == propertyName }\n            ?: throw IllegalArgumentException(\"No property named $propertyName found\")\n\n        if (property is kotlin.reflect.KMutableProperty<*>) {\n            property.setter.call(mirror, value)\n        } else {\n            throw IllegalArgumentException(\"Property $propertyName is not mutable\")\n        }\n    }\n} "
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ComposeReflectRuntime.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\nimport kotlin.reflect.KClass\nimport kotlin.reflect.full.createInstance\nimport kotlin.reflect.full.memberFunctions\nimport kotlin.reflect.full.memberProperties\n\nclass ComposeReflectRuntime {\n    private val reflectCache = mutableMapOf<String, Any>()\n\n    fun <T : Any> createReflect(clazz: KClass<T>): T {\n        val reflectClassName = \"${clazz.simpleName}Reflect\"\n        val reflectClass = try {\n            Class.forName(\"${clazz.qualifiedName}$reflectClassName\")\n        } catch (e: ClassNotFoundException) {\n            throw IllegalStateException(\"Reflect class not found for ${clazz.qualifiedName}. Make sure the class is annotated with @ComposeReflect\")\n        }\n\n        val instance = clazz.createInstance()\n        val reflectInstance = reflectClass.getDeclaredConstructor(clazz.java)\n            .newInstance(instance) as T\n\n        reflectCache[clazz.qualifiedName!!] = reflectInstance\n        return reflectInstance\n    }\n\n    fun invokeComposable(reflect: Any, functionName: String, vararg args: Any?): Any? {\n        val clazz = reflect::class\n        val reflectFunction = clazz.memberFunctions.find { it.name == \"invoke$functionName\" }\n            ?: throw IllegalArgumentException(\"No reflectable function named $functionName found\")\n\n        return reflectFunction.call(reflect, *args)\n    }\n\n    fun getProperty(reflect: Any, propertyName: String): Any? {\n        val clazz = reflect::class\n        val property = clazz.memberProperties.find { it.name == propertyName }\n            ?: throw IllegalArgumentException(\"No property named $propertyName found\")\n\n        return property.getter.call(reflect)\n    }\n\n    fun setProperty(reflect: Any, propertyName: String, value: Any?) {\n        val clazz = reflect::class\n        val property = clazz.memberProperties.find { it.name == propertyName }\n            ?: throw IllegalArgumentException(\"No property named $propertyName found\")\n\n        if (property is kotlin.reflect.KMutableProperty<*>) {\n            property.setter.call(reflect, value)\n        } else {\n            throw IllegalArgumentException(\"Property $propertyName is not mutable\")\n        }\n    }\n} "
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/DeclarationMirror.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nabstract class DeclarationMirror : Mirror {\n\n    /**\n     * 返回此声明的简单名称。\n     *\n     * 简单名称通常是该实体的标识符名，例如：\n     * - 方法名 \"myMethod\"\n     * - 类名 \"MyClass\"\n     * - 库名 \"mylibrary\"\n     */\n    abstract val simpleName: String\n\n    /**\n     * 返回此声明的完全限定名称。\n     *\n     * 例如：库 \"lib\" 中的类 \"MyClass\" 中的方法 \"myMethod\" 的完全限定名为：\n     * \"lib.MyClass.myMethod\"\n     */\n    abstract val qualifiedName: String\n\n\n    /**\n     * 判断此声明是否为库私有（以 `_` 开头）。\n     *\n     * 对于库本身，始终返回 false。\n     */\n//    abstract val isPrivate: Boolean\n\n    /**\n     * 判断此声明是否是顶级声明（拥有者是库）。\n     */\n//    abstract val isTopLevel: Boolean\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/MethodMirrorImpl.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\n\nclass MethodMirrorImpl(override val isStatic: Boolean,\n                       val invoke: @Composable (args: List<Any?>?, namedArgs: Map<String, Any?>?) -> Any?,\n                       override val simpleName: String,\n                       override val qualifiedName: String\n) :MethodMirror() {\n\n    @Composable\n    override fun invoke(\n        args: List<Any?>?,\n        namedArgs: Map<String, Any?>?\n    ): Any? {\n        return invoke.invoke(args, namedArgs)\n    }\n\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/Mirror.kt",
    "content": "package com.aether.core.runtime.reflectable\n\n//Mirror 接口作为父接口存在。\ninterface Mirror {\n}\n\n interface ObjectMirror : Mirror {\n\n    /**\n     * 调用函数或方法 [memberName]，返回结果。\n     *\n     * @param memberName 方法名\n     * @param positionalArguments 位置参数列表\n     * @param namedArguments 命名参数映射（Symbol -> value）\n     *\n     * 实现逻辑应模拟 o.memberName(positionalArguments..., k1 = v1, ...)\n     * 并支持访问私有成员。\n     */\n    fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>? = null\n    ): Any?\n\n    /**\n     * 调用 getter 方法并返回结果。\n     *\n     * 如果是实例镜像且 [getterName] 是方法，则返回闭包。\n     * 如果是库镜像且 [getterName] 是顶层方法，则返回闭包。\n     * 如果是类镜像且 [getterName] 是静态方法，则返回闭包。\n     */\n    fun invokeGetter(getterName: String): Any?\n\n    /**\n     * 调用 setter 方法并返回结果。\n     *\n     * setter 名称可以带 `=`，也可以不带，内部会自动处理。\n     */\n    fun invokeSetter(setterName: String, value: Any?): Any?\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/ParamInfo.kt",
    "content": "package com.aether.core.runtime.reflectable\n\nimport androidx.compose.runtime.Composable\n\n// 参数信息\ndata class ParamInfo(\n    val name: String,\n    val type: String,\n    val isOptional: Boolean\n)\n\n// 组件反射接口\nabstract class ComposeReflector(\n    simpleName: String,\n    qualifiedName: String\n) : ClassMirrorBase(\n    simpleName, qualifiedName\n) {\n    @Composable\n    abstract fun invoke(args: Map<String, Any?>?): Any?\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/widgets/ColumnMirror.kt",
    "content": "package com.aether.core.runtime.reflectable.widgets\n\nimport androidx.compose.foundation.layout.Arrangement\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.foundation.layout.ColumnScope\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.ComposeComponentFactory.createComponent\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.DeclarationMirror\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport com.aether.core.runtime.reflectable.ParamInfo\n\nclass ColumnMirror(\n    simpleName: String,\n    qualifiedName: String\n) : ComposeReflector(simpleName, qualifiedName) {\n    override val simpleName: String = \"Column\"\n\n    @Composable\n    override fun  invoke(args: Map<String, Any?>?): Int  {\n        if (args == null) {\n            Column {\n                Text(\"No Column UI, please check args\")\n            }\n            return 0 as Int\n        }\n\n        // 从参数映射中提取可选参数\n        val modifier = args[\"modifier\"] as? Modifier ?: Modifier\n        val verticalArrangement = args[\"verticalArrangement\"] as? Arrangement.Vertical ?: Arrangement.Top\n        val horizontalAlignment = args[\"horizontalAlignment\"] as? Alignment.Horizontal ?: Alignment.Start\n\n        // 获取内容函数\n        val children = args[\"children\"] as? List<ComposeComponentDescriptor>\n\n        // 调用实际的Column组件\n        Column(\n            modifier = modifier,\n            verticalArrangement = verticalArrangement,\n            horizontalAlignment = horizontalAlignment\n        ) {\n            // 如果提供了子组件列表，则渲染它们\n            children?.forEach { childDescriptor ->\n                createComponent(\n                    childDescriptor.componentPath,\n                    childDescriptor.positionalArguments,\n                    childDescriptor.namedArguments,\n                    childDescriptor.children\n                )\n            }\n        }\n        return 1 as Int\n    }\n\n//    override val params: List<ParamInfo> = listOf(\n//        ParamInfo(\n//            name = \"modifier\", type = \"androidx.compose.ui.Modifier\", isOptional = true\n//        ), ParamInfo(\n//            name = \"verticalArrangement\",\n//            type = \"androidx.compose.foundation.layout.Arrangement.Vertical\",\n//            isOptional = true\n//        ), ParamInfo(\n//            name = \"horizontalAlignment\",\n//            type = \"androidx.compose.ui.Alignment.Horizontal\",\n//            isOptional = true\n//        ), ParamInfo(\n//            name = \"content\", type = \"androidx.compose.runtime.Composable\", isOptional = false\n//        )\n//    )\n\n//    @Composable\n//    override fun invoke(args: Map<String, Any?>?) {\n//        if (args == null) {\n//            Column {\n//                Text(\"No Column UI, please check args\")\n//            }\n//            return\n//        }\n//\n//        // 从参数映射中提取可选参数\n//        val modifier = args[\"modifier\"] as? Modifier ?: Modifier\n//        val verticalArrangement = args[\"verticalArrangement\"] as? Arrangement.Vertical ?: Arrangement.Top\n//        val horizontalAlignment = args[\"horizontalAlignment\"] as? Alignment.Horizontal ?: Alignment.Start\n//\n//        // 获取内容函数\n//        val children = args[\"children\"] as? List<ComposeComponentDescriptor>\n//\n//        // 调用实际的Column组件\n//        Column(\n//            modifier = modifier,\n//            verticalArrangement = verticalArrangement,\n//            horizontalAlignment = horizontalAlignment\n//        ) {\n//            // 如果提供了子组件列表，则渲染它们\n//            children?.forEach { childDescriptor ->\n//                createComponent(\n//                    childDescriptor.componentPath,\n//                    childDescriptor.positionalArguments,\n//                    childDescriptor.namedArguments,\n//                    childDescriptor.children\n//                )\n//            }\n//        }\n//    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/widgets/MaterialThemeMirror.kt",
    "content": "package com.aether.core.runtime.reflectable.widgets\n\nimport android.util.Log\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Typography\nimport androidx.compose.runtime.Composable\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport com.aether.core.runtime.reflectable.MethodMirrorImpl\n\nclass MaterialThemeMirror(\n    simpleName: String,\n    qualifiedName: String\n) : ComposeReflector(\n   simpleName, qualifiedName\n) {\n    private var _staticMembers: Map<String, MethodMirror>? = null\n\n    override val staticMembers: Map<String, MethodMirror>\n        get() = _staticMembers ?: run {\n            // Create a map to store MaterialTheme's static members\n            val result = mutableMapOf<String, MethodMirror>()\n            // Add Typography property\n            result[\"typography\"] = MethodMirrorImpl(\n                simpleName = \"typography\",\n                qualifiedName = \"androidx.compose.material.Typography\",\n                isStatic = true,\n                invoke = { _, _ -> MaterialTheme.typography }\n            )\n            // Cache and return the immutable map\n            result.toMap().also { _staticMembers = it }\n        }\n\n    @Composable\n    override fun  invoke(args: Map<String, Any?>?): Int? {\n        if (args == null) {\n            Log.e(\"MaterialThemeMirror\", \"error: args :$args\")\n            return 0 as Int\n        }\n        val typography = args[\"typography\"] as? Typography\n        val content = args[\"content\"] as? @Composable () -> Unit\n        // 调用实际的Text组件\n        MaterialTheme(\n            content = content ?: {}, typography = typography ?: MaterialTheme.typography\n        )\n        return 1 as Int\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/widgets/TextMirror.kt",
    "content": "package com.aether.core.runtime.reflectable.widgets\n\nimport android.graphics.fonts.FontFamily\nimport android.os.Build\nimport android.text.TextUtils\nimport androidx.compose.material.LocalTextStyle\nimport androidx.compose.material.MaterialTheme.typography\nimport androidx.compose.material.Text\nimport androidx.compose.material.Typography\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.graphics.Color\nimport androidx.compose.ui.text.style.TextAlign\nimport androidx.compose.ui.text.style.TextOverflow\nimport androidx.compose.ui.unit.TextUnit\nimport com.aether.core.runtime.reflectable.ClassMirror\nimport com.aether.core.runtime.reflectable.ClassMirrorBase\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.DeclarationMirror\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport com.aether.core.runtime.reflectable.MethodMirrorImpl\nimport com.aether.core.runtime.reflectable.ParamInfo\nimport com.aether.core.runtime.reflectable.RenderComponent\nimport java.time.format.TextStyle\nimport kotlin.collections.set\n\n/**\n * 自动生成的Text组件反射包装类\n */\nclass TextMirror(\n    simpleName: String, qualifiedName: String\n) : ComposeReflector(\n    simpleName, qualifiedName\n) {\n\n    override fun invoke(\n        memberName: String, positionalArguments: List<Any?>, namedArguments: Map<String, Any?>?\n    ): Any? {\n        return super.invoke(memberName, positionalArguments, namedArguments)\n    }\n\n    @Composable\n    override fun invoke(args: Map<String, Any?>?): Int {\n        if (args == null) {\n            Text(\"NO Text UI please chack args\")\n            return 0 as Int\n        }\n        // 从参数映射中提取必要参数\n        val text = args[\"text\"] as? String ?: \"\"\n\n        // 从参数映射中提取可选参数\n        val modifier = args[\"modifier\"] as? Modifier\n        val color = args[\"color\"] as? Color\n        val fontSize = args[\"fontSize\"] as? TextUnit\n        val fontFamily = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n            args[\"fontFamily\"] as? FontFamily\n        } else {\n            TODO(\"VERSION.SDK_INT < Q\")\n        }\n        val textAlign = args[\"textAlign\"] as? TextAlign\n        val styleTemp = args[\"style\"]\n        val maxLines = args[\"maxLines\"] as? Int\n        val overflow = args[\"overflow\"] as? androidx.compose.ui.text.style.TextOverflow\n        val style = if (styleTemp is ComposeComponentDescriptor) {\n            val attribute = styleTemp.namedArguments?.get(\"attribute\") as String\n            if (TextUtils.equals(attribute, \"h6\")) {\n                typography.h6\n            } else if (TextUtils.equals(attribute, \"h5\")) {\n                typography.h5\n            } else if (TextUtils.equals(attribute, \"h4\")) {\n                typography.h4\n            } else if (TextUtils.equals(attribute, \"h3\")) {\n                typography.h3\n            } else if (TextUtils.equals(attribute, \"h2\")) {\n                typography.h2\n            } else if (TextUtils.equals(attribute, \"h1\")) {\n                typography.h1\n            } else {\n                Typography().h1\n            }\n        } else {\n            Typography().h1\n        }\n        // 调用实际的Text组件\n        Text(\n            text = text,\n//            modifier = modifier ?: Modifier,\n            color = color ?: androidx.compose.ui.graphics.Color.Unspecified,\n            fontSize = fontSize ?: TextUnit.Unspecified,\n//            fontFamily = fontFamily,\n            textAlign = textAlign,\n            style = style,\n//            maxLines = maxLines ?: Int.MAX_VALUE,\n            overflow = overflow ?: TextOverflow.Clip\n        )\n        return 1 as Int\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/widgets/TextStyleMirror.kt",
    "content": "package com.aether.core.runtime.reflectable.widgets\n\nimport android.util.Log\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Typography\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.text.TextStyle\nimport androidx.compose.ui.text.font.FontWeight\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport com.aether.core.runtime.reflectable.MethodMirrorImpl\n\nclass TextStyleMirror(\n    simpleName: String,\n    qualifiedName: String\n) : ComposeReflector(\n    simpleName, qualifiedName\n) {\n    private var _staticMembers: Map<String, MethodMirror>? = null\n\n    override val staticMembers: Map<String, MethodMirror>\n        get() = _staticMembers ?: run {\n            // Create a map to store MaterialTheme's static members\n            val result = mutableMapOf<String, MethodMirror>()\n            // Add Typography property\n            result[\"h6\"] = MethodMirrorImpl(\n                simpleName = \"h6\",\n                qualifiedName = \"androidx.compose.ui.text.TextStyle\",\n                isStatic = true,\n                invoke = { _, _ -> }\n            )\n            // Cache and return the immutable map\n            result.toMap().also { _staticMembers = it }\n        }\n\n    override fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n\n        return TextStyle(\n\n        )\n\n    }\n\n    @Composable\n    override fun invoke(args: Map<String, Any?>?): Int? {\n        if (args == null) {\n            Log.e(\"TextStyleMirror\", \"error: args :$args\")\n            return 0 as Int\n        }\n        // 调用实际的Text组件\n        TextStyle(\n\n        )\n        return 1 as Int\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/reflectable/widgets/TypographyMirror.kt",
    "content": "package com.aether.core.runtime.reflectable.widgets\n\nimport android.text.TextUtils\nimport android.util.Log\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Typography\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.text.font.FontWeight\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor\nimport com.aether.core.runtime.reflectable.ComposeComponentDescriptor2\nimport com.aether.core.runtime.reflectable.ComposeMirror\nimport com.aether.core.runtime.reflectable.ComposeReflector\nimport com.aether.core.runtime.reflectable.MethodMirror\nimport com.aether.core.runtime.reflectable.MethodMirrorImpl\n\nclass TypographyMirror(\n    simpleName: String,\n    qualifiedName: String\n) : ComposeReflector(\n    simpleName, qualifiedName\n) {\n    private var _staticMembers: Map<String, MethodMirror>? = null\n\n    override val staticMembers: Map<String, MethodMirror>\n        get() = _staticMembers ?: run {\n            // Create a map to store MaterialTheme's static members\n            val result = mutableMapOf<String, MethodMirror>()\n            // Add Typography property\n            result[\"h6\"] = MethodMirrorImpl(\n                simpleName = \"h6\",\n                qualifiedName = \"androidx.compose.ui.text.TextStyle\",\n                isStatic = true,\n                invoke = { _, _ -> }\n            )\n            // Cache and return the immutable map\n            result.toMap().also { _staticMembers = it }\n        }\n\n    @Composable\n    override fun invoke(args: Map<String, Any?>?): Typography? {\n        if (args == null) {\n            Log.e(\"MaterialThemeMirror\", \"error: args :$args\")\n            return null\n        }\n        val typography = MaterialTheme.typography\n        val attribute = args[simpleName] as String\n        if (TextUtils.equals(attribute, \"h6\")) {\n            typography.h6\n        }else if (TextUtils.equals(attribute, \"h5\")) {\n            typography.h5\n        }\n        return typography\n    }\n\n    override fun invoke(\n        memberName: String,\n        positionalArguments: List<Any?>,\n        namedArguments: Map<String, Any?>?\n    ): Any? {\n        if (namedArguments == null) {\n            Log.e(\"MaterialThemeMirror\", \"error: args :$namedArguments\")\n            return null\n        }\n        val reflector = ComposeMirror.getReflector(memberName)\n\n        val typography = namedArguments[\"typography\"] as? Typography\n        val content = namedArguments[\"content\"] as? @Composable () -> Unit\n        // 调用实际的Text组件\n//        return MaterialTheme.typography.h6\n        return null\n    }\n}"
  },
  {
    "path": "core/src/main/java/com/aether/core/runtime/utils/JsonReader.kt",
    "content": "package com.aether.core.runtime.utils\n\nimport android.content.Context\nimport android.content.res.AssetManager\nimport org.json.JSONException\nimport org.json.JSONObject\nimport java.io.IOException\n\nobject JsonReader {\n    fun readJsonFromAssets(context: Context, fileName: String): JSONObject? {\n        var json: String? = null\n        try {\n            val assetManager: AssetManager = context.assets\n            val inputStream = assetManager.open(fileName)\n            val size = inputStream.available()\n            val buffer = ByteArray(size)\n            inputStream.read(buffer)\n            inputStream.close()\n            json = String(buffer, Charsets.UTF_8)\n        } catch (ex: IOException) {\n            ex.printStackTrace()\n            return null\n        }\n        try {\n            return JSONObject(json)\n        } catch (e: JSONException) {\n            e.printStackTrace()\n            return null\n        }\n    }\n}"
  },
  {
    "path": "core/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#3DDC84\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeWidth=\"0.8\"\n        android:strokeColor=\"#33FFFFFF\" />\n</vector>\n"
  },
  {
    "path": "core/src/main/res/drawable/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path android:pathData=\"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"85.84757\"\n                android:endY=\"92.4963\"\n                android:startX=\"42.9492\"\n                android:startY=\"49.59793\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z\"\n        android:strokeWidth=\"1\"\n        android:strokeColor=\"#00000000\" />\n</vector>"
  },
  {
    "path": "core/src/main/res/mipmap-anydpi/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n    <monochrome android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "core/src/main/res/mipmap-anydpi/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n    <monochrome android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "core/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"purple_200\">#FFBB86FC</color>\n    <color name=\"purple_500\">#FF6200EE</color>\n    <color name=\"purple_700\">#FF3700B3</color>\n    <color name=\"teal_200\">#FF03DAC5</color>\n    <color name=\"teal_700\">#FF018786</color>\n    <color name=\"black\">#FF000000</color>\n    <color name=\"white\">#FFFFFFFF</color>\n</resources>"
  },
  {
    "path": "core/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">core</string>\n</resources>"
  },
  {
    "path": "core/src/main/res/values/themes.xml",
    "content": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n    <!-- Base application theme. -->\n    <style name=\"Theme.KotlinProject\" parent=\"Theme.MaterialComponents.DayNight.DarkActionBar\">\n        <!-- Primary brand color. -->\n        <item name=\"colorPrimary\">@color/purple_500</item>\n        <item name=\"colorPrimaryVariant\">@color/purple_700</item>\n        <item name=\"colorOnPrimary\">@color/white</item>\n        <!-- Secondary brand color. -->\n        <item name=\"colorSecondary\">@color/teal_200</item>\n        <item name=\"colorSecondaryVariant\">@color/teal_700</item>\n        <item name=\"colorOnSecondary\">@color/black</item>\n        <!-- Status bar color. -->\n        <item name=\"android:statusBarColor\">?attr/colorPrimaryVariant</item>\n        <!-- Customize your theme here. -->\n    </style>\n</resources>"
  },
  {
    "path": "core/src/main/res/values-night/themes.xml",
    "content": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n    <!-- Base application theme. -->\n    <style name=\"Theme.KotlinProject\" parent=\"Theme.MaterialComponents.DayNight.DarkActionBar\">\n        <!-- Primary brand color. -->\n        <item name=\"colorPrimary\">@color/purple_200</item>\n        <item name=\"colorPrimaryVariant\">@color/purple_700</item>\n        <item name=\"colorOnPrimary\">@color/black</item>\n        <!-- Secondary brand color. -->\n        <item name=\"colorSecondary\">@color/teal_200</item>\n        <item name=\"colorSecondaryVariant\">@color/teal_200</item>\n        <item name=\"colorOnSecondary\">@color/black</item>\n        <!-- Status bar color. -->\n        <item name=\"android:statusBarColor\">?attr/colorPrimaryVariant</item>\n        <!-- Customize your theme here. -->\n    </style>\n</resources>"
  },
  {
    "path": "core/src/test/java/com/aether/core/ExampleUnitTest.kt",
    "content": "package com.aether.core\n\nimport org.junit.Test\n\nimport org.junit.Assert.*\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\nclass ExampleUnitTest {\n    @Test\n    fun addition_isCorrect() {\n        assertEquals(4, 2 + 2)\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/compose/ColumArgsComposeExpressText.kt",
    "content": "package com.aether.core.compose\n\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.graphics.Color\n\nclass ColumArgsComposeExpressText {\n    @Composable\n    fun Main() {\n        Column {\n            Column(\n            ) {\n                Text(\n                    text = \"主标题 1\",\n                    style = MaterialTheme.typography.h4,\n                )\n                Text(\n                    text = \"副标题 1\",\n                    style = MaterialTheme.typography.h5,\n                )\n            }\n            Column(\n            ) {\n                Text(\n                    text = \"主标题 2\",\n                    style = MaterialTheme.typography.h4,\n                )\n                Text(\n                    text = \"副标题 3\",\n                    style = MaterialTheme.typography.h5,\n                )\n            }\n            Column(\n            ) {\n                Text(\n                    text = \"主标题 2\",\n                    style = MaterialTheme.typography.h4,\n                )\n                Text(\n                    text = \"副标题 3\",\n                    style = MaterialTheme.typography.h5,\n                )\n            }\n        }\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/compose/ColumComposeNameExpressText.kt",
    "content": "package com.aether.core.compose\nimport androidx.compose.foundation.layout.Column\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\n\n\nclass ColumComposeNameExpressText {\n    @Composable\n    fun Main() {\n        Column {\n            Text(\n                text = \"1这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n                minLines = 1,\n            )\n            Text(\n                text = \"2这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n                minLines = 1,\n            )\n            Text(\n                text = \"3这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n                minLines = 1,\n            )\n            Text(\n                text = \"4这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n                minLines = 1,\n            )\n        }\n\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/compose/DemoCompose.kt",
    "content": "package com.aether.core.compose\n\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.graphics.Color\n\n\nclass DemoCompose {\n//    @Composable\n//    fun Main() {\n//        Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {\n//            Button(onClick = { }) {\n//                Text(\"Click me!\")\n//            }\n//            Column(\n//                Modifier.fillMaxWidth(),\n//                horizontalAlignment = Alignment.CenterHorizontally\n//            ) {\n//                Text(\"这是一个KMP加载的动态化的View\")\n//            }\n//        }\n//    }\n//}\n//        Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {\n//            Button(onClick = {}) {\n//                Text(\"Click me!\")\n//            }\n//            Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {\n//                Box(\n//                    modifier = Modifier\n//                        .height(100.dp)\n//                        .fillMaxWidth()\n//                        .padding(16.dp) // 设置外部边缘（padding）\n//                        .clip(RoundedCornerShape(10.dp)) // 设置圆角半径为10dp\n//                        .background(Color(0xFFD1EAFB)), // 设置背景颜色\n//                    contentAlignment = Alignment.Center // 将 Text 垂直和水平居中\n//                ) {\n//                    Text(\"一个标题\")\n//                }\n//            }\n//        }\n//        Text(\"这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\")\n//    }\n\n    @Composable\n    fun Main() {\n        Text(\n            \"这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n            color = Color.Red\n        )\n\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/compose/DemoComposeColor.kt",
    "content": "package com.aether.core.compose\n\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.graphics.Color\n\n\nclass DemoComposeColor {\n    @Composable\n    fun Main() {\n        Text(\n            \"这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n        )\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/compose/NameExpressComposeNameExpressText.kt",
    "content": "package com.aether.core.compose\n\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.graphics.Color\n\n\nclass NameExpressComposeNameExpressText {\n    @Composable\n    fun Main() {\n        Text(\n            text = \"text=这个一个最小试验单位的动态化卡片，它的产物来自云端打包编译，可以根据产品诉求随意替换\",\n            minLines = 1,\n        )\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/ArgsComposeTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.junit.Test\nimport java.io.File\n\nclass ArgsComposeTest {\n\n    @Test\n    fun mainTest() {\n        val localFile = AstRuntime.LocalJson(getDefaultJson())\n        val node = localFile.createNode()\n        val runtime = AstRuntime(node);\n        val test2 = runtime.invoke(\"test2\", mutableListOf(5, \"a\"))\n        System.out.println(\"动态化引擎输出结果：\" + test2)\n    }\n\n\n    @Test\n    fun generateJson() {\n        val targetDirectory =\n            File(\"src/test/java/com/aether/core/compose/DemoComposeColor.kt\")\n        val json = AstRuntime.GeneraJson(targetDirectory).createNodeToJson()\n        System.out.println(\"生成的dsl：\" + json)\n    }\n\n    companion object {\n        fun getDefaultJson(): String {\n            return \"\"\n        }\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/ColumArgsExpressComposeTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.junit.Test\nimport java.io.File\n\nclass ColumArgsExpressComposeTest {\n\n    @Test\n    fun generateJson() {\n        val targetDirectory =\n            File(\"src/test/java/com/aether/core/compose/ColumArgsComposeExpressText.kt\")\n        val json = AstRuntime.GeneraJson(targetDirectory).createNodeToJson()\n        System.out.println(\"生成的dsl：\" + json)\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/ColumExpressComposeTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.junit.Test\nimport java.io.File\n\nclass ColumExpressComposeTest {\n\n    @Test\n    fun mainTest() {\n        val localFile = AstRuntime.LocalJson(getDefaultJson())\n        val node = localFile.createNode()\n        val runtime = AstRuntime(node);\n        val test2 = runtime.invoke(\"test2\", mutableListOf(5, \"a\"))\n        System.out.println(\"动态化引擎输出结果：\" + test2)\n    }\n\n\n    @Test\n    fun generateJson() {\n        val targetDirectory =\n            File(\"src/test/java/com/aether/core/compose/ColumComposeNameExpressText.kt\")\n        val json = AstRuntime.GeneraJson(targetDirectory).createNodeToJson()\n        System.out.println(\"生成的dsl：\" + json)\n    }\n\n    companion object {\n        fun getDefaultJson(): String {\n            return \"\"\n        }\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/DemoEmptyFunctionExpress.kt",
    "content": "package com.aether.core.express\n\n\nobject DemoEmptyFunctionExpress {\n    /**\n     * result =10\n     * result2 =10\n     * index = 5\n     */\n    fun test2(index: Int, item: String): Int {\n        val a = 2\n        val b = 2 + index\n        return a * b\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/DemoFunctionExpress.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.express.DemoTest\nimport com.aether.core.express.InstanceTest\nimport org.jline.utils.Display\nimport org.jline.utils.Log\n\nobject DemoFunctionExpress {\n    /**\n     * result =10\n     * result2 =10\n     * index = 5\n     */\n    fun test2(index: Int, item: String): Int {\n        val result = DemoTest.demo1Test1()\n        val result2 = DemoTest.demo1Test2()\n        Log.info(1,23,456)\n        val instanceTest = InstanceTest(18)\n        instanceTest.triggerTest()\n        val a = 2\n        val b = 2 + index\n        return a * b + result + result2\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/DemoTest.kt",
    "content": "package com.aether.core.express\n\n\nclass DemoTest {\n\n    companion object{\n        fun demo1Test1(): Int {\n            return 10\n        }\n        fun demo1Test2(): Int {\n            return 10\n        }\n    }\n    fun test2(index: Int): Int {\n        val a = 1\n        val b = 2\n        return a + b\n    }\n}\n"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/InstanceComposeTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.jline.utils.Log\nimport org.junit.Test\nimport java.io.File\n\nclass InstanceComposeTest {\n\n    @Test\n    fun mainTest() {\n        val localFile = AstRuntime.LocalJson(getDefaultJson())\n        val node = localFile.createNode()\n        val runtime = AstRuntime(node);\n        val test2 = runtime.invoke(\"test2\", mutableListOf(5, \"a\"))\n        System.out.println(\"动态化引擎输出结果：\" + test2)\n    }\n\n\n    @Test\n    fun generateJson() {\n        val targetDirectory =\n            File(\"src/test/java/com/aether/core/compose/DemoCompose.kt\")\n        val json = AstRuntime.GeneraJson(targetDirectory).createNodeToJson()\n        System.out.println(\"生成的dsl：\" + json)\n    }\n\n    companion object {\n        fun getDefaultJson(): String {\n            return \"{\\n\" +\n                    \"  \\\"directives\\\" : [ {\\n\" +\n                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.Column\\\",\\n\" +\n                    \"    \\\"alias\\\" : null,\\n\" +\n                    \"    \\\"name\\\" : \\\"Column\\\"\\n\" +\n                    \"  }, {\\n\" +\n                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n                    \"    \\\"importPath\\\" : \\\"androidx.compose.foundation.layout.padding\\\",\\n\" +\n                    \"    \\\"alias\\\" : null,\\n\" +\n                    \"    \\\"name\\\" : \\\"padding\\\"\\n\" +\n                    \"  }, {\\n\" +\n                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n                    \"    \\\"importPath\\\" : \\\"androidx.compose.material.Text\\\",\\n\" +\n                    \"    \\\"alias\\\" : null,\\n\" +\n                    \"    \\\"name\\\" : \\\"Text\\\"\\n\" +\n                    \"  }, {\\n\" +\n                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n                    \"    \\\"importPath\\\" : \\\"androidx.compose.runtime.Composable\\\",\\n\" +\n                    \"    \\\"alias\\\" : null,\\n\" +\n                    \"    \\\"name\\\" : \\\"Composable\\\"\\n\" +\n                    \"  }, {\\n\" +\n                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.Modifier\\\",\\n\" +\n                    \"    \\\"alias\\\" : null,\\n\" +\n                    \"    \\\"name\\\" : \\\"Modifier\\\"\\n\" +\n                    \"  }, {\\n\" +\n                    \"    \\\"type\\\" : \\\"ImportDirective\\\",\\n\" +\n                    \"    \\\"importPath\\\" : \\\"androidx.compose.ui.unit.dp\\\",\\n\" +\n                    \"    \\\"alias\\\" : null,\\n\" +\n                    \"    \\\"name\\\" : \\\"dp\\\"\\n\" +\n                    \"  } ],\\n\" +\n                    \"  \\\"declarations\\\" : [ {\\n\" +\n                    \"    \\\"type\\\" : \\\"ClassDeclaration\\\",\\n\" +\n                    \"    \\\"name\\\" : \\\"DemoCompose\\\",\\n\" +\n                    \"    \\\"members\\\" : [ {\\n\" +\n                    \"      \\\"type\\\" : \\\"MethodDeclaration\\\",\\n\" +\n                    \"      \\\"name\\\" : \\\"Main\\\",\\n\" +\n                    \"      \\\"parameters\\\" : [ ],\\n\" +\n                    \"      \\\"typeParameters\\\" : [ ],\\n\" +\n                    \"      \\\"body\\\" : {\\n\" +\n                    \"        \\\"type\\\" : \\\"BlockStatement\\\",\\n\" +\n                    \"        \\\"body\\\" : [ {\\n\" +\n                    \"          \\\"type\\\" : \\\"InstanceCreationExpression\\\",\\n\" +\n                    \"          \\\"constructorName\\\" : \\\"Text\\\",\\n\" +\n                    \"          \\\"argumentList\\\" : {\\n\" +\n                    \"            \\\"type\\\" : \\\"ArgumentList\\\",\\n\" +\n                    \"            \\\"arguments\\\" : [ {\\n\" +\n                    \"              \\\"type\\\" : \\\"Argument\\\",\\n\" +\n                    \"              \\\"body\\\" : {\\n\" +\n                    \"                \\\"type\\\" : \\\"StringTemplateExpression\\\",\\n\" +\n                    \"                \\\"name\\\" : null,\\n\" +\n                    \"                \\\"body\\\" : {\\n\" +\n                    \"                  \\\"type\\\" : \\\"StringTemplateEntry\\\",\\n\" +\n                    \"                  \\\"body\\\" : null,\\n\" +\n                    \"                  \\\"value\\\" : \\\"Asset content from demo\\\"\\n\" +\n                    \"                }\\n\" +\n                    \"              }\\n\" +\n                    \"            } ]\\n\" +\n                    \"          },\\n\" +\n                    \"          \\\"valueArgument\\\" : [ ]\\n\" +\n                    \"        } ]\\n\" +\n                    \"      },\\n\" +\n                    \"      \\\"isStatic\\\" : false,\\n\" +\n                    \"      \\\"isGetter\\\" : true,\\n\" +\n                    \"      \\\"isSetter\\\" : false\\n\" +\n                    \"    } ],\\n\" +\n                    \"    \\\"body\\\" : { }\\n\" +\n                    \"  } ],\\n\" +\n                    \"  \\\"type\\\" : \\\"CompilationUnit\\\"\\n\" +\n                    \"}\"\n        }\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/InstanceCreationExpressionTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.jline.utils.Log\nimport org.junit.Test\nimport java.io.File\n\nclass InstanceCreationExpressionTest {\n\n    @Test\n    fun mainTest() {\n        val targetDirectory =\n            File(\"src/test/java/com/aether/core/express/DemoFunctionExpress.kt\")\n        val localFile = AstRuntime.LocalFile(targetDirectory)\n        val node = localFile.createNode()\n        val runtime = AstRuntime(node);\n        val test2 = runtime.invoke(\"test2\", mutableListOf(5,\"a\"))\n        System.out.println(\"动态化引擎输出结果：\" + test2)\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/InstanceJsonEmptyCreationExpressionTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.junit.Test\n\nclass InstanceJsonEmptyCreationExpressionTest {\n\n    @Test\n    fun mainTest() {\n        val localFile = AstRuntime.LocalJson(getDefaultJson())\n        val node = localFile.createNode()\n        val runtime = AstRuntime(node);\n        val test2 = runtime.invoke(\"test2\", mutableListOf(5,\"a\"))\n        System.out.println(\"动态化引擎输出结果：\" + test2)\n    }\n\n    fun getDefaultJson(): String {\n        return \"{\\n\" +\n                \"  \\\"directives\\\" : [ ],\\n\" +\n                \"  \\\"declarations\\\" : [ {\\n\" +\n                \"    \\\"type\\\" : \\\"ClassDeclaration\\\",\\n\" +\n                \"    \\\"name\\\" : \\\"DemoEmptyFunctionExpress\\\",\\n\" +\n                \"    \\\"members\\\" : [ {\\n\" +\n                \"      \\\"type\\\" : \\\"MethodDeclaration\\\",\\n\" +\n                \"      \\\"name\\\" : \\\"test2\\\",\\n\" +\n                \"      \\\"parameters\\\" : [ {\\n\" +\n                \"        \\\"type\\\" : \\\"SimpleFormalParameter\\\",\\n\" +\n                \"        \\\"name\\\" : \\\"index\\\",\\n\" +\n                \"        \\\"typeName\\\" : \\\"Int\\\"\\n\" +\n                \"      }, {\\n\" +\n                \"        \\\"type\\\" : \\\"SimpleFormalParameter\\\",\\n\" +\n                \"        \\\"name\\\" : \\\"item\\\",\\n\" +\n                \"        \\\"typeName\\\" : \\\"String\\\"\\n\" +\n                \"      } ],\\n\" +\n                \"      \\\"typeParameters\\\" : [ ],\\n\" +\n                \"      \\\"body\\\" : {\\n\" +\n                \"        \\\"type\\\" : \\\"BlockStatement\\\",\\n\" +\n                \"        \\\"body\\\" : [ {\\n\" +\n                \"          \\\"type\\\" : \\\"PropertyStatement\\\",\\n\" +\n                \"          \\\"name\\\" : \\\"a\\\",\\n\" +\n                \"          \\\"initializer\\\" : {\\n\" +\n                \"            \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n                \"            \\\"value\\\" : \\\"2\\\",\\n\" +\n                \"            \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n                \"          }\\n\" +\n                \"        }, {\\n\" +\n                \"          \\\"type\\\" : \\\"PropertyStatement\\\",\\n\" +\n                \"          \\\"name\\\" : \\\"b\\\",\\n\" +\n                \"          \\\"initializer\\\" : {\\n\" +\n                \"            \\\"type\\\" : \\\"BinaryExpression\\\",\\n\" +\n                \"            \\\"name\\\" : null,\\n\" +\n                \"            \\\"operator\\\" : \\\"+\\\",\\n\" +\n                \"            \\\"left\\\" : {\\n\" +\n                \"              \\\"type\\\" : \\\"INTEGER_CONSTANT\\\",\\n\" +\n                \"              \\\"value\\\" : \\\"2\\\",\\n\" +\n                \"              \\\"name\\\" : \\\"ConstantExpression\\\"\\n\" +\n                \"            },\\n\" +\n                \"            \\\"right\\\" : {\\n\" +\n                \"              \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n                \"              \\\"name\\\" : \\\"index\\\"\\n\" +\n                \"            }\\n\" +\n                \"          }\\n\" +\n                \"        }, {\\n\" +\n                \"          \\\"type\\\" : \\\"ReturnStatement\\\",\\n\" +\n                \"          \\\"argument\\\" : {\\n\" +\n                \"            \\\"type\\\" : \\\"BinaryExpression\\\",\\n\" +\n                \"            \\\"name\\\" : null,\\n\" +\n                \"            \\\"operator\\\" : \\\"*\\\",\\n\" +\n                \"            \\\"left\\\" : {\\n\" +\n                \"              \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n                \"              \\\"name\\\" : \\\"a\\\"\\n\" +\n                \"            },\\n\" +\n                \"            \\\"right\\\" : {\\n\" +\n                \"              \\\"type\\\" : \\\"Identifier\\\",\\n\" +\n                \"              \\\"name\\\" : \\\"b\\\"\\n\" +\n                \"            }\\n\" +\n                \"          }\\n\" +\n                \"        } ]\\n\" +\n                \"      },\\n\" +\n                \"      \\\"isStatic\\\" : true,\\n\" +\n                \"      \\\"isGetter\\\" : false,\\n\" +\n                \"      \\\"isSetter\\\" : false\\n\" +\n                \"    } ],\\n\" +\n                \"    \\\"body\\\" : { }\\n\" +\n                \"  } ],\\n\" +\n                \"  \\\"type\\\" : \\\"CompilationUnit\\\"\\n\" +\n                \"}\"\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/InstanceTest.kt",
    "content": "package com.aether.core.express\n\nimport org.jline.utils.Log\n\nclass InstanceTest {\n    private var age = 18;\n    private val name = \"zhangsan\";\n    private val TAG = \"InstanceTest\";\n\n    companion object {\n        private val name2 = \"wangwu\";\n    }\n\n    constructor(age: Int) {\n\n    }\n\n    fun triggerTest(): Int {\n        Log.info(TAG, \": wode :\" + triggerTest2(2))\n        return age\n    }\n\n    fun triggerTest2(index: Int): Int {\n        return index + 1\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/express/NameExpressComposeTest.kt",
    "content": "package com.aether.core.express\n\nimport com.aether.core.runtime.AstRuntime\nimport org.junit.Test\nimport java.io.File\n\nclass NameExpressComposeTest {\n\n    @Test\n    fun mainTest() {\n        val localFile = AstRuntime.LocalJson(getDefaultJson())\n        val node = localFile.createNode()\n        val runtime = AstRuntime(node);\n        val test2 = runtime.invoke(\"test2\", mutableListOf(5, \"a\"))\n        System.out.println(\"动态化引擎输出结果：\" + test2)\n    }\n\n\n    @Test\n    fun generateJson() {\n        val targetDirectory =\n            File(\"src/test/java/com/aether/core/compose/NameExpressComposeNameExpressText.kt\")\n        val json = AstRuntime.GeneraJson(targetDirectory).createNodeToJson()\n        System.out.println(\"生成的dsl：\" + json)\n    }\n\n    companion object {\n        fun getDefaultJson(): String {\n            return \"\"\n        }\n    }\n}"
  },
  {
    "path": "core/src/test/java/com/aether/core/runtime/ExampleUnitTest.kt",
    "content": "package com.aether.core.runtime\n\nimport org.junit.Test\n\nimport org.junit.Assert.*\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\nclass ExampleUnitTest {\n    @Test\n    fun addition_isCorrect() {\n        assertEquals(4, 2 + 2)\n    }\n}"
  },
  {
    "path": "gradle/libs.versions.toml",
    "content": "[versions]\nagp = \"8.2.0\"\nandroid-compileSdk = \"34\"\nandroid-minSdk = \"26\"\nandroid-targetSdk = \"34\"\nandroidx-activityCompose = \"1.8.2\"\nandroidx-appcompat = \"1.7.0\"\nandroidx-constraintlayout = \"2.2.1\"\nandroidx-core-ktx = \"1.12.0\"\nandroidx-espresso-core = \"3.6.1\"\nandroidx-lifecycle = \"2.8.4\"\nandroidx-material = \"1.12.0\"\nandroidx-test-junit = \"1.2.1\"\ncompose-multiplatform = \"1.6.0\"\njunit = \"4.13.2\"\nkotlin = \"1.8.22\"\n\n[libraries]\nkotlin-test = { module = \"org.jetbrains.kotlin:kotlin-test\", version.ref = \"kotlin\" }\nkotlin-test-junit = { module = \"org.jetbrains.kotlin:kotlin-test-junit\", version.ref = \"kotlin\" }\njunit = { group = \"junit\", name = \"junit\", version.ref = \"junit\" }\nandroidx-core-ktx = { group = \"androidx.core\", name = \"core-ktx\", version.ref = \"androidx-core-ktx\" }\nandroidx-test-junit = { group = \"androidx.test.ext\", name = \"junit\", version.ref = \"androidx-test-junit\" }\nandroidx-espresso-core = { group = \"androidx.test.espresso\", name = \"espresso-core\", version.ref = \"androidx-espresso-core\" }\nandroidx-appcompat = { group = \"androidx.appcompat\", name = \"appcompat\", version.ref = \"androidx-appcompat\" }\nandroidx-material = { group = \"com.google.android.material\", name = \"material\", version.ref = \"androidx-material\" }\nandroidx-constraintlayout = { group = \"androidx.constraintlayout\", name = \"constraintlayout\", version.ref = \"androidx-constraintlayout\" }\nandroidx-activity-compose = { module = \"androidx.activity:activity-compose\", version.ref = \"androidx-activityCompose\" }\nandroidx-lifecycle-viewmodel = { group = \"org.jetbrains.androidx.lifecycle\", name = \"lifecycle-viewmodel\", version.ref = \"androidx-lifecycle\" }\nandroidx-lifecycle-runtime-compose = { group = \"org.jetbrains.androidx.lifecycle\", name = \"lifecycle-runtime-compose\", version.ref = \"androidx-lifecycle\" }\n\n[plugins]\nandroidApplication = { id = \"com.android.application\", version.ref = \"agp\" }\nandroidLibrary = { id = \"com.android.library\", version.ref = \"agp\" }\ncomposeMultiplatform = { id = \"org.jetbrains.compose\", version.ref = \"compose-multiplatform\" }\ncomposeCompiler = { id = \"org.jetbrains.kotlin.plugin.compose\", version.ref = \"kotlin\" }\nkotlinMultiplatform = { id = \"org.jetbrains.kotlin.multiplatform\", version.ref = \"kotlin\" }\nkotlinAndroid = { id = \"org.jetbrains.kotlin.android\", version.ref = \"kotlin\" }"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Apr 07 01:51:47 CST 2025\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://mirrors.cloud.tencent.com/gradle/gradle-8.5-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "gradle.properties",
    "content": "#Kotlin\nkotlin.code.style=official\nkotlin.daemon.jvmargs=-Xmx2048M\n\n#Gradle\norg.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8\n\n#Android\nandroid.nonTransitiveRClass=true\nandroid.useAndroidX=true\nandroid.enableAapt2Daemon=false\n\nandroid.enableJetifier=true\nkotlin.mpp.androidSourceSetLayoutVersion=2\nkotlin.mpp.androidGradlePluginCompatibility.nowarn=true"
  },
  {
    "path": "gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# SPDX-License-Identifier: Apache-2.0\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\n# This is normally unused\n# shellcheck disable=SC2034\nAPP_BASE_NAME=${0##*/}\n# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)\nAPP_HOME=$( cd -P \"${APP_HOME:-./}\" > /dev/null && printf '%s\n' \"$PWD\" ) || exit\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    if ! command -v java >/dev/null 2>&1\n    then\n        die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC2039,SC3045\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.\n        # shellcheck disable=SC2039,SC3045\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Collect all arguments for the java command:\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,\n#     and any embedded shellness will be escaped.\n#   * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be\n#     treated as '${Hostname}' itself on the command line.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Stop when \"xargs\" is not available.\nif ! command -v xargs >/dev/null 2>&1\nthen\n    die \"xargs is not available\"\nfi\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n@rem SPDX-License-Identifier: Apache-2.0\r\n@rem\r\n\r\n@if \"%DEBUG%\"==\"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\"==\"\" set DIRNAME=.\r\n@rem This is normally unused\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif %ERRORLEVEL% equ 0 goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho. 1>&2\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2\r\necho. 1>&2\r\necho Please set the JAVA_HOME variable in your environment to match the 1>&2\r\necho location of your Java installation. 1>&2\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif %ERRORLEVEL% equ 0 goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nset EXIT_CODE=%ERRORLEVEL%\r\nif %EXIT_CODE% equ 0 set EXIT_CODE=1\r\nif not \"\"==\"%GRADLE_EXIT_CONSOLE%\" exit %EXIT_CODE%\r\nexit /b %EXIT_CODE%\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "iosApp/Configuration/Config.xcconfig",
    "content": "TEAM_ID=\nBUNDLE_ID=org.example.project.KotlinProject\nAPP_NAME=KotlinProject"
  },
  {
    "path": "iosApp/iosApp/Assets.xcassets/AccentColor.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}"
  },
  {
    "path": "iosApp/iosApp/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"app-icon-1024.png\",\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "iosApp/iosApp/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}"
  },
  {
    "path": "iosApp/iosApp/ContentView.swift",
    "content": "import UIKit\nimport SwiftUI\nimport ComposeApp\n\nstruct ComposeView: UIViewControllerRepresentable {\n    func makeUIViewController(context: Context) -> UIViewController {\n        MainViewControllerKt.MainViewController()\n    }\n\n    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}\n}\n\nstruct ContentView: View {\n    var body: some View {\n        ComposeView()\n                .ignoresSafeArea(.keyboard) // Compose has own keyboard handler\n    }\n}\n\n\n\n"
  },
  {
    "path": "iosApp/iosApp/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>CADisableMinimumFrameDurationOnPhone</key>\n\t<true/>\n\t<key>UIApplicationSceneManifest</key>\n\t<dict>\n\t\t<key>UIApplicationSupportsMultipleScenes</key>\n\t\t<false/>\n\t</dict>\n\t<key>UILaunchScreen</key>\n\t<dict/>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}"
  },
  {
    "path": "iosApp/iosApp/iOSApp.swift",
    "content": "import SwiftUI\n\n@main\nstruct iOSApp: App {\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n        }\n    }\n}"
  },
  {
    "path": "iosApp/iosApp.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };\n\t\t058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };\n\t\t2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; };\n\t\t7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\t2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = \"<group>\"; };\n\t\t7555FF7B242A565900829871 /* KotlinProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KotlinProject.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\t7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\tAB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\tB92378962B6B1156000C7307 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t058557D7273AAEEB004C7B11 /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t42799AB246E5F90AF97AA0EF /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t7555FF72242A565900829871 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB1DB47929225F7C00F7AF9C /* Configuration */,\n\t\t\t\t7555FF7D242A565900829871 /* iosApp */,\n\t\t\t\t7555FF7C242A565900829871 /* Products */,\n\t\t\t\t42799AB246E5F90AF97AA0EF /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t7555FF7C242A565900829871 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t7555FF7B242A565900829871 /* KotlinProject.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t7555FF7D242A565900829871 /* iosApp */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t058557BA273AAA24004C7B11 /* Assets.xcassets */,\n\t\t\t\t7555FF82242A565900829871 /* ContentView.swift */,\n\t\t\t\t7555FF8C242A565B00829871 /* Info.plist */,\n\t\t\t\t2152FB032600AC8F00CF470E /* iOSApp.swift */,\n\t\t\t\t058557D7273AAEEB004C7B11 /* Preview Content */,\n\t\t\t);\n\t\t\tpath = iosApp;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\tAB1DB47929225F7C00F7AF9C /* Configuration */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\tAB3632DC29227652001CCB65 /* Config.xcconfig */,\n\t\t\t);\n\t\t\tpath = Configuration;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t7555FF7A242A565900829871 /* iosApp */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget \"iosApp\" */;\n\t\t\tbuildPhases = (\n\t\t\t\tF36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */,\n\t\t\t\t7555FF77242A565900829871 /* Sources */,\n\t\t\t\tB92378962B6B1156000C7307 /* Frameworks */,\n\t\t\t\t7555FF79242A565900829871 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = iosApp;\n\t\t\tpackageProductDependencies = (\n\t\t\t);\n\t\t\tproductName = iosApp;\n\t\t\tproductReference = 7555FF7B242A565900829871 /* KotlinProject.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t7555FF73242A565900829871 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tBuildIndependentTargetsInParallel = YES;\n\t\t\t\tLastSwiftUpdateCheck = 1130;\n\t\t\t\tLastUpgradeCheck = 1540;\n\t\t\t\tORGANIZATIONNAME = orgName;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t7555FF7A242A565900829871 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 11.3.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject \"iosApp\" */;\n\t\t\tcompatibilityVersion = \"Xcode 14.0\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 7555FF72242A565900829871;\n\t\t\tpackageReferences = (\n\t\t\t);\n\t\t\tproductRefGroup = 7555FF7C242A565900829871 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t7555FF7A242A565900829871 /* iosApp */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t7555FF79242A565900829871 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */,\n\t\t\t\t058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXShellScriptBuildPhase section */\n\t\tF36B1CEB2AD83DDC00CB74D5 /* Compile Kotlin Framework */ = {\n\t\t\tisa = PBXShellScriptBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\tinputFileListPaths = (\n\t\t\t);\n\t\t\tinputPaths = (\n\t\t\t);\n\t\t\tname = \"Compile Kotlin Framework\";\n\t\t\toutputFileListPaths = (\n\t\t\t);\n\t\t\toutputPaths = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t\tshellPath = /bin/sh;\n\t\t\tshellScript = \"if [ \\\"YES\\\" = \\\"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\\\" ]; then\\n  echo \\\"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\\\\\"YES\\\\\\\"\\\"\\n  exit 0\\nfi\\ncd \\\"$SRCROOT/..\\\"\\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\\n\";\n\t\t};\n/* End PBXShellScriptBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t7555FF77242A565900829871 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */,\n\t\t\t\t7555FF83242A565900829871 /* ContentView.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin XCBuildConfiguration section */\n\t\t7555FFA3242A565B00829871 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tENABLE_USER_SCRIPT_SANDBOXING = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.3;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t7555FFA4242A565B00829871 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbaseConfigurationReference = AB3632DC29227652001CCB65 /* Config.xcconfig */;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_USER_SCRIPT_SANDBOXING = NO;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.3;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t7555FFA6242A565B00829871 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_IDENTITY = \"Apple Development\";\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"iosApp/Preview Content\\\"\";\n\t\t\t\tDEVELOPMENT_TEAM = \"${TEAM_ID}\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\\n$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = iosApp/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.3;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"${BUNDLE_ID}${TEAM_ID}\";\n\t\t\t\tPRODUCT_NAME = \"${APP_NAME}\";\n\t\t\t\tPROVISIONING_PROFILE_SPECIFIER = \"\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t7555FFA7242A565B00829871 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_IDENTITY = \"Apple Development\";\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"iosApp/Preview Content\\\"\";\n\t\t\t\tDEVELOPMENT_TEAM = \"${TEAM_ID}\";\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tFRAMEWORK_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\\n$(SRCROOT)/../composeApp/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\",\n\t\t\t\t);\n\t\t\t\tINFOPLIST_FILE = iosApp/Info.plist;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 15.3;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = \"${BUNDLE_ID}${TEAM_ID}\";\n\t\t\t\tPRODUCT_NAME = \"${APP_NAME}\";\n\t\t\t\tPROVISIONING_PROFILE_SPECIFIER = \"\";\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t7555FF76242A565900829871 /* Build configuration list for PBXProject \"iosApp\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t7555FFA3242A565B00829871 /* Debug */,\n\t\t\t\t7555FFA4242A565B00829871 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget \"iosApp\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t7555FFA6242A565B00829871 /* Debug */,\n\t\t\t\t7555FFA7242A565B00829871 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 7555FF73242A565900829871 /* Project object */;\n}"
  },
  {
    "path": "processor/build.gradle.kts",
    "content": "plugins {\n    kotlin(\"jvm\")\n    id(\"com.google.devtools.ksp\") version \"1.8.22-1.0.11\"\n}\n\n// 确保处理器可以作为工件发布\nsourceSets.main {\n    resources {\n        srcDir(\"src/main/resources\")\n    }\n}\n\ndependencies {\n    implementation(project(\":annotations\"))\n    implementation(\"com.google.devtools.ksp:symbol-processing-api:1.8.22-1.0.11\")\n    implementation(\"com.squareup:kotlinpoet:1.14.2\")\n    implementation(\"com.squareup:kotlinpoet-ksp:1.14.2\")\n}"
  },
  {
    "path": "processor/src/main/java/com/aether/processor/ComposeMirrorProcessor.kt",
    "content": "package com.aether.processor\n\nimport com.google.devtools.ksp.processing.*\nimport com.google.devtools.ksp.symbol.*\nimport com.google.devtools.ksp.validate\nimport com.squareup.kotlinpoet.*\nimport com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy\nimport com.squareup.kotlinpoet.ksp.writeTo\n\nclass ComposeMirrorProcessor(\n    private val codeGenerator: CodeGenerator,\n    private val logger: KSPLogger,\n    private val options: Map<String, String>\n) : SymbolProcessor {\n\n    override fun process(resolver: Resolver): List<KSAnnotated> {\n        val symbols = resolver.getSymbolsWithAnnotation(\"com.aether.annotations.ComposeMirror\")\n        val ret = symbols.filter { !it.validate() }.toList()\n        \n        symbols\n            .filter { it is KSClassDeclaration && it.validate() }\n            .forEach { it.accept(ComposeMirrorVisitor(), Unit) }\n            \n        return ret\n    }\n\n    inner class ComposeMirrorVisitor : KSVisitorVoid() {\n        override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) {\n            val packageName = classDeclaration.packageName.asString()\n            val className = classDeclaration.simpleName.asString()\n            \n            // Generate mirror class\n            val mirrorClassName = \"${className}Mirror\"\n            val fileSpec = FileSpec.builder(packageName, mirrorClassName)\n                .addType(\n                    TypeSpec.classBuilder(mirrorClassName)\n                        .addModifiers(KModifier.PUBLIC)\n                        .addFunction(\n                            FunSpec.builder(\"invoke\")\n                                .addModifiers(KModifier.PUBLIC)\n                                .addParameter(\"params\", List::class.asTypeName().parameterizedBy(Any::class.asTypeName()))\n                                .returns(Any::class)\n                                .addCode(\"\"\"\n                                    |return $className().apply {\n                                    |    params.forEachIndexed { index, param ->\n                                    |        when(index) {\n                                    |            // Add parameter assignments based on constructor parameters\n                                    |        }\n                                    |    }\n                                    |}\n                                \"\"\".trimMargin())\n                                .build()\n                        )\n                        .build()\n                )\n                .build()\n                \n            fileSpec.writeTo(codeGenerator, false)\n        }\n    }\n}\n\nclass ComposeMirrorProcessorProvider : SymbolProcessorProvider {\n    override fun create(\n        environment: SymbolProcessorEnvironment\n    ): SymbolProcessor {\n        return ComposeMirrorProcessor(\n            environment.codeGenerator,\n            environment.logger,\n            environment.options\n        )\n    }\n} "
  },
  {
    "path": "processor/src/main/java/com/aether/processor/ComposeMirrorProcessor2.kt",
    "content": "package com.aether.processor\n\nimport com.aether.annotations.GenerateMirror\nimport com.google.devtools.ksp.processing.CodeGenerator\nimport com.google.devtools.ksp.processing.Dependencies\nimport com.google.devtools.ksp.processing.KSPLogger\nimport com.google.devtools.ksp.processing.Resolver\nimport com.google.devtools.ksp.processing.SymbolProcessor\nimport com.google.devtools.ksp.processing.SymbolProcessorEnvironment\nimport com.google.devtools.ksp.processing.SymbolProcessorProvider\nimport com.google.devtools.ksp.symbol.KSAnnotated\nimport com.google.devtools.ksp.symbol.KSClassDeclaration\nimport com.google.devtools.ksp.symbol.KSFunctionDeclaration\nimport com.squareup.kotlinpoet.ANY\nimport com.squareup.kotlinpoet.ClassName\nimport com.squareup.kotlinpoet.CodeBlock\nimport com.squareup.kotlinpoet.FileSpec\nimport com.squareup.kotlinpoet.FunSpec\nimport com.squareup.kotlinpoet.LIST\nimport com.squareup.kotlinpoet.MAP\nimport com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy\nimport com.squareup.kotlinpoet.PropertySpec\nimport com.squareup.kotlinpoet.STRING\nimport com.squareup.kotlinpoet.TypeSpec\n\nclass ComposeMirrorProcessor(\n    private val codeGenerator: CodeGenerator,\n    private val logger: KSPLogger\n) : SymbolProcessor {\n\n    override fun process(resolver: Resolver): List<KSAnnotated> {\n        // 查找所有标记了@GenerateMirror的符号\n        val symbols = resolver.getSymbolsWithAnnotation(GenerateMirror::class.qualifiedName!!)\n\n        // 处理标记的函数和类\n        symbols.filter { it is KSFunctionDeclaration || it is KSClassDeclaration }\n            .forEach {\n//                processSymbol(it)\n            }\n\n        // 自动处理常用的Compose组件\n        processComposeComponents(resolver)\n\n        return emptyList()\n    }\n\n    private fun processComposeComponents(resolver: Resolver) {\n        // 查找Text组件的所有重载\n        val textFunctions = resolver.getAllFiles().flatMap { file ->\n            file.declarations.filterIsInstance<KSFunctionDeclaration>()\n                .filter { it.simpleName.asString() == \"Text\" }\n        }\n\n        // 为Text组件生成反射元数据\n        textFunctions.forEach { generateTextMirror(it) }\n    }\n\n    private fun generateTextMirror(function: KSFunctionDeclaration) {\n        // 分析函数参数\n        val params = function.parameters.map { param ->\n            val name = param.name?.asString() ?: \"\"\n            val type = param.type.resolve().declaration.qualifiedName?.asString() ?: \"Any\"\n            val isOptional = param.hasDefault\n\n            ParamInfo(name, type, isOptional)\n        }\n\n        // 生成Text组件的反射元数据\n        generateMirrorClass(\"Text\", params)\n    }\n\n    private fun generateMirrorClass(name: String, params: List<ParamInfo>) {\n        val fileName = \"${name}Mirror\"\n        val packageName = \"com.your.package.mirror.generated\"\n\n        val fileSpec = FileSpec.builder(packageName, fileName)\n            .addType(\n                TypeSpec.classBuilder(fileName)\n                    .addProperty(\n                        PropertySpec.builder(\"name\", String::class)\n                            .initializer(\"\\\"$name\\\"\")\n                            .build()\n                    )\n                    .addProperty(\n                        PropertySpec.builder(\"params\", LIST.parameterizedBy(\n                            ClassName(\"com.your.package.mirror\", \"ParamInfo\")\n                        ))\n                            .initializer(buildParamsList(params))\n                            .build()\n                    )\n                    .addFunction(\n                        FunSpec.builder(\"invoke\")\n                            .addParameter(\"args\", MAP.parameterizedBy(\n                                STRING, ANY.copy(nullable = true)\n                            ))\n                            .addCode(buildInvokeCode(name, params))\n                            .build()\n                    )\n                    .build()\n            )\n            .build()\n\n        codeGenerator.createNewFile(\n            Dependencies(false),\n            packageName,\n            fileName\n        ).use { outputStream ->\n            outputStream.writer().use {\n                fileSpec.writeTo(it)\n            }\n        }\n    }\n\n    private fun buildParamsList(params: List<ParamInfo>): CodeBlock {\n        return CodeBlock.builder()\n            .add(\"listOf(\\n\")\n            .indent()\n            .apply {\n                params.forEachIndexed { index, param ->\n                    add(\"ParamInfo(\\n\")\n                    indent()\n                    add(\"name = %S,\\n\", param.name)\n                    add(\"type = %S,\\n\", param.type)\n                    add(\"isOptional = %L\\n\", param.isOptional)\n                    unindent()\n                    add(\")\")\n                    if (index < params.size - 1) add(\",\\n\") else add(\"\\n\")\n                }\n            }\n            .unindent()\n            .add(\")\")\n            .build()\n    }\n\n    private fun buildInvokeCode(name: String, params: List<ParamInfo>): CodeBlock {\n        return CodeBlock.builder()\n            .beginControlFlow(\"return androidx.compose.runtime.Composable { \")\n            .add(\"androidx.compose.material.Text(\\n\")\n            .indent()\n            .apply {\n                params.forEach { param ->\n                    add(\"%L = args[%S] as? %L,\\n\",\n                        param.name,\n                        param.name,\n                        param.type.split(\".\").last()\n                    )\n                }\n            }\n            .unindent()\n            .add(\")\\n\")\n            .endControlFlow()\n            .build()\n    }\n\n    private data class ParamInfo(\n        val name: String,\n        val type: String,\n        val isOptional: Boolean\n    )\n\n    // 处理器提供者\n    class ComposeMirrorProcessorProvider2 : SymbolProcessorProvider {\n        override fun create(\n            environment: SymbolProcessorEnvironment\n        ): SymbolProcessor {\n            return ComposeMirrorProcessor(\n                environment.codeGenerator,\n                environment.logger\n            )\n        }\n    }\n}"
  },
  {
    "path": "processor/src/main/java/com/aether/processor/ComposeReflectProcessor.kt",
    "content": "package com.aether.processor\n\nimport com.google.devtools.ksp.processing.*\nimport com.google.devtools.ksp.symbol.*\nimport com.google.devtools.ksp.validate\nimport com.squareup.kotlinpoet.*\nimport com.squareup.kotlinpoet.ksp.writeTo\n\nclass ComposeReflectProcessor(\n    private val codeGenerator: CodeGenerator,\n    private val logger: KSPLogger,\n    private val options: Map<String, String>\n) : SymbolProcessor {\n\n    override fun process(resolver: Resolver): List<KSAnnotated> {\n        val symbols = resolver.getSymbolsWithAnnotation(\"com.aether.annotations.ComposeReflect\")\n        val ret = symbols.filter { !it.validate() }.toList()\n        \n        symbols\n            .filter { it is KSClassDeclaration && it.validate() }\n            .forEach { it.accept(ComposeReflectVisitor(), Unit) }\n            \n        return ret\n    }\n\n    inner class ComposeReflectVisitor : KSVisitorVoid() {\n        override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) {\n            val packageName = classDeclaration.packageName.asString()\n            val className = classDeclaration.simpleName.asString()\n            \n            // Generate reflection class\n            val reflectClassName = \"${className}Reflect\"\n            val fileSpec = FileSpec.builder(packageName, reflectClassName)\n                .addType(\n                    TypeSpec.classBuilder(reflectClassName)\n                        .addModifiers(KModifier.PUBLIC)\n                        .primaryConstructor(\n                            FunSpec.constructorBuilder()\n                                .addParameter(\"instance\", ClassName(packageName, className))\n                                .build()\n                        )\n                        .addProperty(\n                            PropertySpec.builder(\"instance\", ClassName(packageName, className))\n                                .initializer(\"instance\")\n                                .build()\n                        )\n                        .addFunctions(generateReflectFunctions(classDeclaration))\n                        .build()\n                )\n                .build()\n                \n            fileSpec.writeTo(codeGenerator, false)\n        }\n\n        private fun generateReflectFunctions(classDeclaration: KSClassDeclaration): List<FunSpec> {\n            val functions = mutableListOf<FunSpec>()\n            \n            classDeclaration.declarations\n                .filterIsInstance<KSFunctionDeclaration>()\n                .filter { it.annotations.any { ann -> ann.annotationType.resolve().declaration.qualifiedName?.asString() == \"com.aether.annotations.Reflectable\" } }\n                .forEach { function ->\n                    val functionName = function.simpleName.asString()\n                    val parameters = function.parameters.map { param ->\n                        ParameterSpec.builder(\n                            param.name?.asString() ?: \"param\",\n                            param.type.resolve().toTypeName()\n                        ).build()\n                    }\n                    \n                    functions.add(\n                        FunSpec.builder(\"invoke$functionName\")\n                            .addModifiers(KModifier.PUBLIC)\n                            .addParameters(parameters)\n                            .returns(Unit::class)\n                            .addCode(\"\"\"\n                                |instance.$functionName(${parameters.joinToString { it.name }})\n                            \"\"\".trimMargin())\n                            .build()\n                    )\n                }\n                \n            return functions\n        }\n    }\n}\n\nclass ComposeReflectProcessorProvider : SymbolProcessorProvider {\n    override fun create(\n        environment: SymbolProcessorEnvironment\n    ): SymbolProcessor {\n        return ComposeReflectProcessor(\n            environment.codeGenerator,\n            environment.logger,\n            environment.options\n        )\n    }\n} "
  },
  {
    "path": "processor/src/main/java/com/aether/processor/ReflectableProcessor.kt",
    "content": "package com.aether.processor\n\nimport com.google.devtools.ksp.processing.*\nimport com.google.devtools.ksp.symbol.*\nimport com.google.devtools.ksp.validate\nimport com.aether.annotations.Reflectable\n\nclass ReflectableProcessor(\n    private val codeGenerator: CodeGenerator,\n    private val logger: KSPLogger,\n    private val options: Map<String, String>\n) : SymbolProcessor {\n\n    override fun process(resolver: Resolver): List<KSAnnotated> {\n        val symbols = resolver.getSymbolsWithAnnotation(Reflectable::class.qualifiedName!!)\n        val ret = symbols.filter { !it.validate() }.toList()\n        \n        symbols\n            .filter { it is KSClassDeclaration && it.validate() }\n            .forEach { it.accept(ReflectableVisitor(), Unit) }\n            \n        return ret\n    }\n\n    inner class ReflectableVisitor : KSVisitorVoid() {\n        override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) {\n            val packageName = classDeclaration.packageName.asString()\n            val className = classDeclaration.simpleName.asString()\n            \n            // 生成反射支持代码\n            val file = codeGenerator.createNewFile(\n                dependencies = Dependencies(false),\n                packageName = packageName,\n                fileName = \"${className}Reflector\"\n            )\n            \n            file.appendText(\"\"\"\n                package $packageName\n                \n                import androidx.compose.runtime.Composable\n                import com.aether.core.runtime.reflectable.ComposeComponentRegistry\n                \n                object ${className}Reflector {\n                    @Composable\n                    fun createInstance(\n                        name: String,\n                        arguments: Map<String, Any> = emptyMap()\n                    ) {\n                        when (name) {\n                            \"${classDeclaration.qualifiedName?.asString()}\" -> {\n                                $className()\n                            }\n                            else -> {\n                                // 处理其他情况\n                            }\n                        }\n                    }\n                }\n            \"\"\".trimIndent())\n            \n            file.close()\n        }\n    }\n}\n\nclass ReflectableProcessorProvider : SymbolProcessorProvider {\n    override fun create(\n        environment: SymbolProcessorEnvironment\n    ): SymbolProcessor {\n        return ReflectableProcessor(\n            environment.codeGenerator,\n            environment.logger,\n            environment.options\n        )\n    }\n} "
  },
  {
    "path": "processor/src/main/resources/META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider",
    "content": "com.aether.processor.ComposeMirrorProcessorProvider"
  },
  {
    "path": "settings.gradle.kts",
    "content": "rootProject.name = \"KotlinProject\"\nenableFeaturePreview(\"TYPESAFE_PROJECT_ACCESSORS\")\n\npluginManagement {\n    repositories {\n        google()\n        mavenCentral()\n        gradlePluginPortal()\n    }\n}\n\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\n\ninclude(\":composeApp\")\ninclude(\":core\")\ninclude(\":annotations\")\ninclude(\":processor\")\n"
  }
]