From 82e3610ca5d88b922c7597f1b6a8b632cf4e8bf5 Mon Sep 17 00:00:00 2001 From: Enrico Piovesan Date: Sun, 23 Aug 2026 12:23:49 -0600 Subject: [PATCH] feat(loop): scaffold WF1 reference app across seven OS clients Add apps/loop shells (web, iOS, macOS, Android, Windows, Linux GTK, CLI) composed via registry_ref digests for ingest/extract/normalize/authorize, in-app WF1 workflow overlay, event-UI conformance, and human-review chrome. Co-authored-by: Cursor --- .github/workflows/ci.yml | 4 + .github/workflows/nightly.yml | 22 + AGENTS.md | 4 +- README.md | 2 + apps/loop/Cargo.lock | 3471 +++++++++++++++++ apps/loop/Cargo.toml | 3 + apps/loop/LoopCore/.gitignore | 3 + apps/loop/LoopCore/Package.swift | 28 + apps/loop/LoopCore/README.md | 11 + .../Sources/LoopCore/AppStateViewModel.swift | 128 + .../Sources/LoopCore/EmbeddedHost.swift | 342 ++ .../Sources/LoopCore/LoopCommand.swift | 17 + .../Sources/LoopCore/LoopOutput.swift | 219 ++ .../Sources/LoopCore/PresentationMapper.swift | 224 ++ .../Tests/LoopCoreTests/LoopCoreTests.swift | 95 + .../PresentationMapperTests.swift | 52 + apps/loop/android-compose/.gitignore | 9 + apps/loop/android-compose/README.md | 48 + .../loop/android-compose/app/build.gradle.kts | 75 + .../android-compose/app/proguard-rules.pro | 1 + .../app/src/main/AndroidManifest.xml | 23 + .../bundles/loop/manifests/app.manifest.json | 163 + .../authorize/component.manifest.json | 28 + .../extract/component.manifest.json | 28 + .../normalize/component.manifest.json | 28 + .../process/component.manifest.json | 28 + .../manifests/workflows/wf1/workflow.json | 149 + .../bundles/loop/runtime/runtime-release.json | 1 + .../assets/bundles/loop/runtime/runtime.wasm | Bin 0 -> 993 bytes .../traverseframework/loop/BundleAssets.kt | 38 + .../traverseframework/loop/EmbeddedHost.kt | 168 + .../loop/ExecutionUiState.kt | 31 + .../loop/ExecutionViewModel.kt | 75 + .../loop/ExecutionViewModelFactory.kt | 17 + .../traverseframework/loop/MainActivity.kt | 63 + .../java/com/traverseframework/loop/Models.kt | 49 + .../loop/PresentationMapper.kt | 209 + .../loop/SettingsRepository.kt | 29 + .../traverseframework/loop/ui/MainScreen.kt | 243 ++ .../loop/ui/SettingsScreen.kt | 56 + .../com/traverseframework/loop/ui/Theme.kt | 13 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../app/src/main/res/values/colors.xml | 5 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/themes.xml | 3 + .../main/res/xml/network_security_config.xml | 8 + .../loop/ExecutionUiStateTest.kt | 19 + .../loop/ExecutionViewModelTest.kt | 87 + .../loop/PresentationMapperTest.kt | 59 + apps/loop/android-compose/build.gradle.kts | 6 + apps/loop/android-compose/gradle.properties | 4 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 43583 bytes .../gradle/wrapper/gradle-wrapper.properties | 7 + apps/loop/android-compose/gradlew | 252 ++ apps/loop/android-compose/settings.gradle.kts | 29 + apps/loop/cli-rust/Cargo.toml | 19 + apps/loop/cli-rust/README.md | 13 + apps/loop/cli-rust/src/client.rs | 5 + apps/loop/cli-rust/src/commands/health.rs | 48 + apps/loop/cli-rust/src/commands/mod.rs | 2 + apps/loop/cli-rust/src/commands/submit.rs | 48 + apps/loop/cli-rust/src/lib.rs | 7 + apps/loop/cli-rust/src/main.rs | 56 + apps/loop/cli-rust/src/output.rs | 58 + apps/loop/cli-rust/tests/integration_tests.rs | 34 + .../ios-swift/Loop.xcodeproj/project.pbxproj | 396 ++ .../xcshareddata/xcschemes/Loop.xcscheme | 64 + apps/loop/ios-swift/Loop/AppSettings.swift | 33 + .../AppIcon.appiconset/Contents.json | 13 + .../Loop/Assets.xcassets/Contents.json | 6 + apps/loop/ios-swift/Loop/ContentView.swift | 210 + apps/loop/ios-swift/Loop/Info.plist | 36 + apps/loop/ios-swift/Loop/LoopApp.swift | 34 + .../Resources/bundles/loop/app.manifest.json | 163 + .../authorize/component.manifest.json | 28 + .../extract/component.manifest.json | 28 + .../normalize/component.manifest.json | 28 + .../process/component.manifest.json | 28 + .../bundles/loop/runtime/runtime-release.json | 1 + .../bundles/loop/runtime/runtime.wasm | Bin 0 -> 993 bytes apps/loop/ios-swift/Loop/SettingsView.swift | 37 + .../LoopTests/AppSettingsSmokeTests.swift | 13 + apps/loop/ios-swift/README.md | 22 + apps/loop/linux-gtk/.gitignore | 2 + apps/loop/linux-gtk/Cargo.toml | 23 + apps/loop/linux-gtk/README.md | 12 + apps/loop/linux-gtk/src/client.rs | 5 + apps/loop/linux-gtk/src/execution_state.rs | 56 + apps/loop/linux-gtk/src/lib.rs | 8 + apps/loop/linux-gtk/src/main.rs | 17 + apps/loop/linux-gtk/src/settings.rs | 50 + apps/loop/linux-gtk/src/ui/main_window.rs | 362 ++ apps/loop/linux-gtk/src/ui/mod.rs | 5 + apps/loop/linux-gtk/src/ui/preferences.rs | 95 + apps/loop/linux-gtk/tests/client_tests.rs | 23 + apps/loop/loop-core-rs/Cargo.toml | 14 + apps/loop/loop-core-rs/src/client.rs | 43 + apps/loop/loop-core-rs/src/host.rs | 276 ++ apps/loop/loop-core-rs/src/lib.rs | 23 + apps/loop/loop-core-rs/src/presentation.rs | 341 ++ apps/loop/loop-core-rs/src/state.rs | 106 + apps/loop/loop-core-rs/tests/host_tests.rs | 42 + .../LoopMac.xcodeproj/project.pbxproj | 395 ++ .../xcshareddata/xcschemes/LoopMac.xcscheme | 64 + .../macos-swift/LoopMac/AppDelegate.swift | 11 + .../macos-swift/LoopMac/AppSettings.swift | 33 + .../AppIcon.appiconset/Contents.json | 13 + .../LoopMac/Assets.xcassets/Contents.json | 6 + .../macos-swift/LoopMac/ContentView.swift | 186 + apps/loop/macos-swift/LoopMac/Info.plist | 33 + .../loop/macos-swift/LoopMac/LoopMacApp.swift | 68 + .../macos-swift/LoopMac/PreferencesView.swift | 29 + .../Resources/bundles/loop/app.manifest.json | 163 + .../authorize/component.manifest.json | 28 + .../extract/component.manifest.json | 28 + .../normalize/component.manifest.json | 28 + .../process/component.manifest.json | 28 + .../bundles/loop/runtime/runtime-release.json | 1 + .../bundles/loop/runtime/runtime.wasm | Bin 0 -> 993 bytes .../LoopMacTests/AppSettingsSmokeTests.swift | 13 + apps/loop/macos-swift/README.md | 22 + apps/loop/web-react/.env | 2 + apps/loop/web-react/.gitignore | 25 + apps/loop/web-react/README.md | 49 + apps/loop/web-react/eslint.config.js | 22 + apps/loop/web-react/index.html | 13 + apps/loop/web-react/package.json | 40 + apps/loop/web-react/public/favicon.svg | 24 + apps/loop/web-react/src/App.test.tsx | 55 + apps/loop/web-react/src/App.tsx | 143 + .../src/client/traverseOutput.test.ts | 69 + .../web-react/src/client/traverseOutput.ts | 53 + .../src/components/HealthIndicator.tsx | 116 + .../web-react/src/components/LoopResult.tsx | 163 + .../web-react/src/components/ReviewPanel.tsx | 59 + .../src/components/TranscriptInput.tsx | 79 + .../web-react/src/host/embeddedHost.test.ts | 73 + apps/loop/web-react/src/host/embeddedHost.ts | 189 + apps/loop/web-react/src/index.css | 135 + apps/loop/web-react/src/main.tsx | 10 + apps/loop/web-react/src/test/setup.ts | 1 + apps/loop/web-react/tsconfig.app.json | 23 + apps/loop/web-react/tsconfig.json | 7 + apps/loop/web-react/tsconfig.node.json | 21 + apps/loop/web-react/vite.config.ts | 22 + apps/loop/windows-winui/.gitignore | 7 + .../Loop.Tests/ExecutionViewModelTests.cs | 97 + .../Loop.Tests/Loop.Tests.csproj | 35 + .../Loop.Tests/PresentationMapperTests.cs | 56 + apps/loop/windows-winui/Loop.sln | 55 + apps/loop/windows-winui/Loop/App.xaml | 13 + apps/loop/windows-winui/Loop/App.xaml.cs | 25 + apps/loop/windows-winui/Loop/AppConstants.cs | 9 + .../Assets/bundles/loop/app.manifest.json | 163 + .../authorize/component.manifest.json | 28 + .../extract/component.manifest.json | 28 + .../normalize/component.manifest.json | 28 + .../process/component.manifest.json | 28 + .../bundles/loop/runtime/runtime-release.json | 1 + .../Assets/bundles/loop/runtime/runtime.wasm | Bin 0 -> 993 bytes apps/loop/windows-winui/Loop/EmbeddedHost.cs | 416 ++ .../windows-winui/Loop/ExecutionViewModel.cs | 143 + apps/loop/windows-winui/Loop/HomePage.xaml | 62 + apps/loop/windows-winui/Loop/HomePage.xaml.cs | 156 + .../windows-winui/Loop/ISettingsRepository.cs | 7 + apps/loop/windows-winui/Loop/Loop.csproj | 38 + apps/loop/windows-winui/Loop/MainWindow.xaml | 41 + .../windows-winui/Loop/MainWindow.xaml.cs | 62 + apps/loop/windows-winui/Loop/Models.cs | 68 + .../windows-winui/Loop/Package.appxmanifest | 43 + .../windows-winui/Loop/PresentationMapper.cs | 322 ++ apps/loop/windows-winui/Loop/Program.cs | 13 + .../loop/windows-winui/Loop/SettingsPage.xaml | 30 + .../windows-winui/Loop/SettingsPage.xaml.cs | 39 + .../windows-winui/Loop/SettingsRepository.cs | 40 + apps/loop/windows-winui/Loop/app.manifest | 15 + apps/loop/windows-winui/README.md | 58 + docs/design-language.md | 12 + docs/runtime-bundle-sync.md | 8 + manifests/loop/app.manifest.json | 163 + .../authorize/component.manifest.json | 27 + .../extract/component.manifest.json | 27 + .../normalize/component.manifest.json | 27 + .../process/component.manifest.json | 27 + manifests/loop/workflows/wf1/workflow.json | 149 + package-lock.json | 1567 ++------ package.json | 1 + scripts/ci/repository_checks.sh | 29 + scripts/ci/sync_android_loop_bundle.sh | 15 + scripts/ci/sync_bundle_core.sh | 70 +- scripts/ci/sync_swift_loop_bundle.sh | 20 + scripts/ci/sync_web_loop_bundle.sh | 15 + scripts/ci/sync_winui_loop_bundle.sh | 15 + 193 files changed, 15242 insertions(+), 1215 deletions(-) create mode 100644 apps/loop/Cargo.lock create mode 100644 apps/loop/Cargo.toml create mode 100644 apps/loop/LoopCore/.gitignore create mode 100644 apps/loop/LoopCore/Package.swift create mode 100644 apps/loop/LoopCore/README.md create mode 100644 apps/loop/LoopCore/Sources/LoopCore/AppStateViewModel.swift create mode 100644 apps/loop/LoopCore/Sources/LoopCore/EmbeddedHost.swift create mode 100644 apps/loop/LoopCore/Sources/LoopCore/LoopCommand.swift create mode 100644 apps/loop/LoopCore/Sources/LoopCore/LoopOutput.swift create mode 100644 apps/loop/LoopCore/Sources/LoopCore/PresentationMapper.swift create mode 100644 apps/loop/LoopCore/Tests/LoopCoreTests/LoopCoreTests.swift create mode 100644 apps/loop/LoopCore/Tests/LoopCoreTests/PresentationMapperTests.swift create mode 100644 apps/loop/android-compose/.gitignore create mode 100644 apps/loop/android-compose/README.md create mode 100644 apps/loop/android-compose/app/build.gradle.kts create mode 100644 apps/loop/android-compose/app/proguard-rules.pro create mode 100644 apps/loop/android-compose/app/src/main/AndroidManifest.xml create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/app.manifest.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/authorize/component.manifest.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/extract/component.manifest.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/normalize/component.manifest.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/process/component.manifest.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/workflows/wf1/workflow.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime-release.json create mode 100644 apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime.wasm create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/BundleAssets.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/EmbeddedHost.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionUiState.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModel.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModelFactory.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/MainActivity.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/Models.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/PresentationMapper.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/SettingsRepository.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/MainScreen.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/SettingsScreen.kt create mode 100644 apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/Theme.kt create mode 100644 apps/loop/android-compose/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 apps/loop/android-compose/app/src/main/res/values/colors.xml create mode 100644 apps/loop/android-compose/app/src/main/res/values/strings.xml create mode 100644 apps/loop/android-compose/app/src/main/res/values/themes.xml create mode 100644 apps/loop/android-compose/app/src/main/res/xml/network_security_config.xml create mode 100644 apps/loop/android-compose/app/src/test/java/com/traverseframework/loop/ExecutionUiStateTest.kt create mode 100644 apps/loop/android-compose/app/src/test/java/com/traverseframework/loop/ExecutionViewModelTest.kt create mode 100644 apps/loop/android-compose/app/src/test/java/com/traverseframework/loop/PresentationMapperTest.kt create mode 100644 apps/loop/android-compose/build.gradle.kts create mode 100644 apps/loop/android-compose/gradle.properties create mode 100644 apps/loop/android-compose/gradle/wrapper/gradle-wrapper.jar create mode 100644 apps/loop/android-compose/gradle/wrapper/gradle-wrapper.properties create mode 100755 apps/loop/android-compose/gradlew create mode 100644 apps/loop/android-compose/settings.gradle.kts create mode 100644 apps/loop/cli-rust/Cargo.toml create mode 100644 apps/loop/cli-rust/README.md create mode 100644 apps/loop/cli-rust/src/client.rs create mode 100644 apps/loop/cli-rust/src/commands/health.rs create mode 100644 apps/loop/cli-rust/src/commands/mod.rs create mode 100644 apps/loop/cli-rust/src/commands/submit.rs create mode 100644 apps/loop/cli-rust/src/lib.rs create mode 100644 apps/loop/cli-rust/src/main.rs create mode 100644 apps/loop/cli-rust/src/output.rs create mode 100644 apps/loop/cli-rust/tests/integration_tests.rs create mode 100644 apps/loop/ios-swift/Loop.xcodeproj/project.pbxproj create mode 100644 apps/loop/ios-swift/Loop.xcodeproj/xcshareddata/xcschemes/Loop.xcscheme create mode 100644 apps/loop/ios-swift/Loop/AppSettings.swift create mode 100644 apps/loop/ios-swift/Loop/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 apps/loop/ios-swift/Loop/Assets.xcassets/Contents.json create mode 100644 apps/loop/ios-swift/Loop/ContentView.swift create mode 100644 apps/loop/ios-swift/Loop/Info.plist create mode 100644 apps/loop/ios-swift/Loop/LoopApp.swift create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/app.manifest.json create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/components/authorize/component.manifest.json create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/components/extract/component.manifest.json create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/components/normalize/component.manifest.json create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/components/process/component.manifest.json create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/runtime/runtime-release.json create mode 100644 apps/loop/ios-swift/Loop/Resources/bundles/loop/runtime/runtime.wasm create mode 100644 apps/loop/ios-swift/Loop/SettingsView.swift create mode 100644 apps/loop/ios-swift/LoopTests/AppSettingsSmokeTests.swift create mode 100644 apps/loop/ios-swift/README.md create mode 100644 apps/loop/linux-gtk/.gitignore create mode 100644 apps/loop/linux-gtk/Cargo.toml create mode 100644 apps/loop/linux-gtk/README.md create mode 100644 apps/loop/linux-gtk/src/client.rs create mode 100644 apps/loop/linux-gtk/src/execution_state.rs create mode 100644 apps/loop/linux-gtk/src/lib.rs create mode 100644 apps/loop/linux-gtk/src/main.rs create mode 100644 apps/loop/linux-gtk/src/settings.rs create mode 100644 apps/loop/linux-gtk/src/ui/main_window.rs create mode 100644 apps/loop/linux-gtk/src/ui/mod.rs create mode 100644 apps/loop/linux-gtk/src/ui/preferences.rs create mode 100644 apps/loop/linux-gtk/tests/client_tests.rs create mode 100644 apps/loop/loop-core-rs/Cargo.toml create mode 100644 apps/loop/loop-core-rs/src/client.rs create mode 100644 apps/loop/loop-core-rs/src/host.rs create mode 100644 apps/loop/loop-core-rs/src/lib.rs create mode 100644 apps/loop/loop-core-rs/src/presentation.rs create mode 100644 apps/loop/loop-core-rs/src/state.rs create mode 100644 apps/loop/loop-core-rs/tests/host_tests.rs create mode 100644 apps/loop/macos-swift/LoopMac.xcodeproj/project.pbxproj create mode 100644 apps/loop/macos-swift/LoopMac.xcodeproj/xcshareddata/xcschemes/LoopMac.xcscheme create mode 100644 apps/loop/macos-swift/LoopMac/AppDelegate.swift create mode 100644 apps/loop/macos-swift/LoopMac/AppSettings.swift create mode 100644 apps/loop/macos-swift/LoopMac/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 apps/loop/macos-swift/LoopMac/Assets.xcassets/Contents.json create mode 100644 apps/loop/macos-swift/LoopMac/ContentView.swift create mode 100644 apps/loop/macos-swift/LoopMac/Info.plist create mode 100644 apps/loop/macos-swift/LoopMac/LoopMacApp.swift create mode 100644 apps/loop/macos-swift/LoopMac/PreferencesView.swift create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/app.manifest.json create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/components/authorize/component.manifest.json create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/components/extract/component.manifest.json create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/components/normalize/component.manifest.json create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/components/process/component.manifest.json create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/runtime/runtime-release.json create mode 100644 apps/loop/macos-swift/LoopMac/Resources/bundles/loop/runtime/runtime.wasm create mode 100644 apps/loop/macos-swift/LoopMacTests/AppSettingsSmokeTests.swift create mode 100644 apps/loop/macos-swift/README.md create mode 100644 apps/loop/web-react/.env create mode 100644 apps/loop/web-react/.gitignore create mode 100644 apps/loop/web-react/README.md create mode 100644 apps/loop/web-react/eslint.config.js create mode 100644 apps/loop/web-react/index.html create mode 100644 apps/loop/web-react/package.json create mode 100644 apps/loop/web-react/public/favicon.svg create mode 100644 apps/loop/web-react/src/App.test.tsx create mode 100644 apps/loop/web-react/src/App.tsx create mode 100644 apps/loop/web-react/src/client/traverseOutput.test.ts create mode 100644 apps/loop/web-react/src/client/traverseOutput.ts create mode 100644 apps/loop/web-react/src/components/HealthIndicator.tsx create mode 100644 apps/loop/web-react/src/components/LoopResult.tsx create mode 100644 apps/loop/web-react/src/components/ReviewPanel.tsx create mode 100644 apps/loop/web-react/src/components/TranscriptInput.tsx create mode 100644 apps/loop/web-react/src/host/embeddedHost.test.ts create mode 100644 apps/loop/web-react/src/host/embeddedHost.ts create mode 100644 apps/loop/web-react/src/index.css create mode 100644 apps/loop/web-react/src/main.tsx create mode 100644 apps/loop/web-react/src/test/setup.ts create mode 100644 apps/loop/web-react/tsconfig.app.json create mode 100644 apps/loop/web-react/tsconfig.json create mode 100644 apps/loop/web-react/tsconfig.node.json create mode 100644 apps/loop/web-react/vite.config.ts create mode 100644 apps/loop/windows-winui/.gitignore create mode 100644 apps/loop/windows-winui/Loop.Tests/ExecutionViewModelTests.cs create mode 100644 apps/loop/windows-winui/Loop.Tests/Loop.Tests.csproj create mode 100644 apps/loop/windows-winui/Loop.Tests/PresentationMapperTests.cs create mode 100644 apps/loop/windows-winui/Loop.sln create mode 100644 apps/loop/windows-winui/Loop/App.xaml create mode 100644 apps/loop/windows-winui/Loop/App.xaml.cs create mode 100644 apps/loop/windows-winui/Loop/AppConstants.cs create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/app.manifest.json create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/components/authorize/component.manifest.json create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/components/extract/component.manifest.json create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/components/normalize/component.manifest.json create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/components/process/component.manifest.json create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/runtime/runtime-release.json create mode 100644 apps/loop/windows-winui/Loop/Assets/bundles/loop/runtime/runtime.wasm create mode 100644 apps/loop/windows-winui/Loop/EmbeddedHost.cs create mode 100644 apps/loop/windows-winui/Loop/ExecutionViewModel.cs create mode 100644 apps/loop/windows-winui/Loop/HomePage.xaml create mode 100644 apps/loop/windows-winui/Loop/HomePage.xaml.cs create mode 100644 apps/loop/windows-winui/Loop/ISettingsRepository.cs create mode 100644 apps/loop/windows-winui/Loop/Loop.csproj create mode 100644 apps/loop/windows-winui/Loop/MainWindow.xaml create mode 100644 apps/loop/windows-winui/Loop/MainWindow.xaml.cs create mode 100644 apps/loop/windows-winui/Loop/Models.cs create mode 100644 apps/loop/windows-winui/Loop/Package.appxmanifest create mode 100644 apps/loop/windows-winui/Loop/PresentationMapper.cs create mode 100644 apps/loop/windows-winui/Loop/Program.cs create mode 100644 apps/loop/windows-winui/Loop/SettingsPage.xaml create mode 100644 apps/loop/windows-winui/Loop/SettingsPage.xaml.cs create mode 100644 apps/loop/windows-winui/Loop/SettingsRepository.cs create mode 100644 apps/loop/windows-winui/Loop/app.manifest create mode 100644 apps/loop/windows-winui/README.md create mode 100644 manifests/loop/app.manifest.json create mode 100644 manifests/loop/components/authorize/component.manifest.json create mode 100644 manifests/loop/components/extract/component.manifest.json create mode 100644 manifests/loop/components/normalize/component.manifest.json create mode 100644 manifests/loop/components/process/component.manifest.json create mode 100644 manifests/loop/workflows/wf1/workflow.json create mode 100755 scripts/ci/sync_android_loop_bundle.sh create mode 100755 scripts/ci/sync_swift_loop_bundle.sh create mode 100755 scripts/ci/sync_web_loop_bundle.sh create mode 100755 scripts/ci/sync_winui_loop_bundle.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6be17b2..a4c9715 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,6 +129,10 @@ jobs: working-directory: apps/doc-approval run: cargo test -p doc-approval-core-rs -p doc-approval-cli + - name: cargo test loop (core + cli) + working-directory: apps/loop + run: cargo test -p loop-core-rs -p loop-cli + pr-hygiene: if: github.event_name == 'pull_request' && github.event.pull_request.user.login != 'dependabot[bot]' runs-on: ubuntu-latest diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index aff9151..0bf84fa 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -83,6 +83,15 @@ jobs: build test \ CODE_SIGNING_ALLOWED=NO + - name: Build + test loop macOS + working-directory: apps/loop/macos-swift + run: | + xcodebuild \ + -scheme LoopMac \ + -destination 'platform=macOS' \ + build test \ + CODE_SIGNING_ALLOWED=NO + native-windows: runs-on: windows-latest steps: @@ -115,6 +124,12 @@ jobs: dotnet restore MeetingNotes.Tests/MeetingNotes.Tests.csproj dotnet test MeetingNotes.Tests/MeetingNotes.Tests.csproj -c Release --nologo + - name: Restore + test loop WinUI logic + working-directory: apps/loop/windows-winui + run: | + dotnet restore Loop.Tests/Loop.Tests.csproj + dotnet test Loop.Tests/Loop.Tests.csproj -c Release --nologo + # Required: GTK shells (AdwApplicationWindowExt / GString fixes landed). native-linux-gtk: runs-on: ubuntu-latest @@ -148,6 +163,7 @@ jobs: run: | (cd apps/traverse-starter && cargo test -p traverse-starter-gtk) (cd apps/doc-approval && cargo test -p doc-approval-gtk) + (cd apps/loop && cargo test -p loop-gtk) # Required: Android unit tests via public RuntimeTraverseEmbedder(TraverseBundle). native-android: @@ -189,3 +205,9 @@ jobs: env: TRAVERSE_REPO: ${{ github.workspace }}/.traverse-checkout run: ./gradlew --no-daemon testDebugUnitTest + + - name: Gradle test loop + working-directory: apps/loop/android-compose + env: + TRAVERSE_REPO: ${{ github.workspace }}/.traverse-checkout + run: ./gradlew --no-daemon testDebugUnitTest diff --git a/AGENTS.md b/AGENTS.md index 199bf72..08f3d09 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,8 +29,8 @@ gh project item-list 2 --owner traverse-framework --format json --limit 300 \ | `llm-mcp-cursor-live-smoke` | **Done** (#240) | Cursor MCP Mode A stdio evidence | | `llm-mcp-claude-live-smoke` | **Done** (#241) | Claude Desktop/Code MCP Mode A evidence | | `llm-mcp-traverse-starter-catalog` | **Blocked** | Kit IDs on MCP stdio — Traverse #865 / registry #99 | -| `loop-wf1-registry-deps` | **In Progress** | PR [#263](https://github.com/traverse-framework/reference-apps/pull/263) digest inventory | -| `loop-wf1-multi-os` | **Ready** | `apps/loop/` WF1 × 7 OS; compose via `registry_ref` | +| `loop-wf1-registry-deps` | **Done** (#263) | Digest inventory in `docs/loop-registry-deps.md` | +| `loop-wf1-multi-os` | **In Progress** | Scaffolding `apps/loop/` WF1 × 7 OS | Full gap table + wave notes: [`docs/production-reference-plan.md`](docs/production-reference-plan.md). diff --git a/README.md b/README.md index 2c5acf7..e5ff7e8 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ UI examples for [Traverse](https://github.com/traverse-framework/Traverse). | **traverse-starter** | Submit a short note → title, tags, note type, next action, status | [web](apps/traverse-starter/web-react/) · [all OS](#by-os--target) | | **doc-approval** | Paste a document → type, parties, amounts, confidence, recommendation | [web](apps/doc-approval/web-react/) | | **meeting-notes** | Paste a transcript → action items, decisions, follow-ups, summary | [web](apps/meeting-notes/web-react/) · [all OS](#by-os--target) | +| **loop** | WF1 follow-through: ingest → extract → normalize → authorize (human review) | [web](apps/loop/web-react/) · [all OS](#by-os--target) | | **trace-explorer** | Browse execution traces (debugger — not a product shell to copy) | [web](apps/trace-explorer/web-react/) | | **LLM MCP façades** | Claude / Cursor / ChatGPT / Grok call the same workflows via MCP (not prompt skills) | [`apps/llm-mcp-reference/`](apps/llm-mcp-reference/) · [section](#llm-mcp-reference-façades) | @@ -61,6 +62,7 @@ Same apps on other platforms (`—` = not shipped yet): | traverse-starter | [link](apps/traverse-starter/web-react/) | [link](apps/traverse-starter/macos-swift/) | [link](apps/traverse-starter/ios-swift/) | [link](apps/traverse-starter/android-compose/) | [link](apps/traverse-starter/windows-winui/) | [link](apps/traverse-starter/linux-gtk/) | [link](apps/traverse-starter/cli-rust/) | | doc-approval | [link](apps/doc-approval/web-react/) | [link](apps/doc-approval/macos-swift/) | [link](apps/doc-approval/ios-swift/) | [link](apps/doc-approval/android-compose/) | [link](apps/doc-approval/windows-winui/) | [link](apps/doc-approval/linux-gtk/) | [link](apps/doc-approval/cli-rust/) | | meeting-notes | [link](apps/meeting-notes/web-react/) | [link](apps/meeting-notes/macos-swift/) | [link](apps/meeting-notes/ios-swift/) | [link](apps/meeting-notes/android-compose/) | [link](apps/meeting-notes/windows-winui/) | [link](apps/meeting-notes/linux-gtk/) | [link](apps/meeting-notes/cli-rust/) | +| loop | [link](apps/loop/web-react/) | [link](apps/loop/macos-swift/) | [link](apps/loop/ios-swift/) | [link](apps/loop/android-compose/) | [link](apps/loop/windows-winui/) | [link](apps/loop/linux-gtk/) | [link](apps/loop/cli-rust/) | --- diff --git a/apps/loop/Cargo.lock b/apps/loop/Cargo.lock new file mode 100644 index 0000000..fc10613 --- /dev/null +++ b/apps/loop/Cargo.lock @@ -0,0 +1,3471 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59317f77929f0e679d39364702289274de2f0f0b22cbf50b2b8cff2169a0b27a" +dependencies = [ + "gimli", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "ambient-authority" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + +[[package]] +name = "async-trait" +version = "0.1.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.2", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +dependencies = [ + "allocator-api2", +] + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cairo-rs" +version = "0.20.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e3bd0f4e25afa9cabc157908d14eeef9067d6448c49414d17b3fb55f0eadd0" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "059cc746549898cbfd9a47754288e5a958756650ef4652bbb6c5f71a6bda4f8b" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "cap-fs-ext" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5528f85b1e134ae811704e41ef80930f56e795923f866813255bc342cc20654" +dependencies = [ + "cap-primitives", + "cap-std", + "io-lifetimes", + "windows-sys 0.59.0", +] + +[[package]] +name = "cap-net-ext" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20a158160765c6a7d0d8c072a53d772e4cb243f38b04bfcf6b4939cfbe7482e7" +dependencies = [ + "cap-primitives", + "cap-std", + "rustix 1.1.4", + "smallvec", +] + +[[package]] +name = "cap-primitives" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6cf3aea8a5081171859ef57bc1606b1df6999df4f1110f8eef68b30098d1d3a" +dependencies = [ + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes", + "ipnet", + "maybe-owned", + "rustix 1.1.4", + "rustix-linux-procfs", + "windows-sys 0.59.0", + "winx", +] + +[[package]] +name = "cap-rand" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8144c22e24bbcf26ade86cb6501a0916c46b7e4787abdb0045a467eb1645a1d" +dependencies = [ + "ambient-authority", + "rand", +] + +[[package]] +name = "cap-std" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6dc3090992a735d23219de5c204927163d922f42f575a0189b005c62d37549a" +dependencies = [ + "cap-primitives", + "io-extras", + "io-lifetimes", + "rustix 1.1.4", +] + +[[package]] +name = "cap-time-ext" +version = "3.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "def102506ce40c11710a9b16e614af0cde8e76ae51b1f48c04b8d79f4b671a80" +dependencies = [ + "ambient-authority", + "cap-primitives", + "iana-time-zone", + "once_cell", + "rustix 1.1.4", + "winx", +] + +[[package]] +name = "cc" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex", +] + +[[package]] +name = "cfg-expr" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb693542bcafa528e198be0ebd9d3632ca5b7c93dbe7237460e199910835997c" +dependencies = [ + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fb99565819980999fb7b4a1796046a5c949e6d4ff132cf5fadf5a641e20d776" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09628afdcc538b57f3c6341e9c8e9970f18e4a481690a64974d7023bd33548b" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f2392eae7f16557a3d727ef3a12e57b2b2ca6f98566a5f4fb41ffe305df077" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.19", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.59.0", +] + +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpp_demangle" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2bb79cb74d735044c972aae58ed0aaa9a837e85b01106a54c39e42e97f62253" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "cranelift-assembler-x64" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3867f7a56768640a79fc660d2f60298251dc6d65b5d1c907706cd1afff024957" +dependencies = [ + "cranelift-assembler-x64-meta", +] + +[[package]] +name = "cranelift-assembler-x64-meta" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0661d63dcf8fc4a6538c1ee4d523917c5b27e9fce7a4114cdf9e2b30b4043cf" +dependencies = [ + "cranelift-srcgen", +] + +[[package]] +name = "cranelift-bforest" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d535b489159ea63e3c40dfbe8d0e12bfb71f2a14845ef2407353e06c5a697c" +dependencies = [ + "cranelift-entity", + "wasmtime-internal-core", +] + +[[package]] +name = "cranelift-bitset" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3af4f7d421b2354deb01d714266022f38fcdbebc9f5f1ec6d310d3c27286d9e" +dependencies = [ + "serde", + "serde_derive", + "wasmtime-internal-core", +] + +[[package]] +name = "cranelift-codegen" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fe4c289e67e0221d1705734a57f95e25c289ed0ead7728743ea21285fc4cf1" +dependencies = [ + "bumpalo", + "cranelift-assembler-x64", + "cranelift-bforest", + "cranelift-bitset", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.16.1", + "libm", + "log", + "pulley-interpreter", + "regalloc2", + "rustc-hash", + "serde", + "smallvec", + "target-lexicon", + "wasmtime-internal-core", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3063e5363dc5ee6ee8edd930314582c08eb91c209b9564da1cd667f6424b9b3" +dependencies = [ + "cranelift-assembler-x64-meta", + "cranelift-codegen-shared", + "cranelift-srcgen", + "heck", + "pulley-interpreter", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34b9c8dbc9edf37744918e56898d4979ef1e764e8e4bbe8b4d50250838ddfe8" + +[[package]] +name = "cranelift-control" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eed9dc54204dc99aad19669bca50142659ed583396d9a99a2aef34d7c136ef4" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2846b239a046217ecf95cfed0e31be4e86843785d07438ad33f456871e888" +dependencies = [ + "cranelift-bitset", + "serde", + "serde_derive", + "wasmtime-internal-core", +] + +[[package]] +name = "cranelift-frontend" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "144f70fa9cd07efb83497c12dc8fb73f360a690cd990c44e8ceebc293d8c13b5" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0733ca5b2aaa5f6d5d6a1439e3c44280d34730d4d5c262ca08c6775c8d83f191" + +[[package]] +name = "cranelift-native" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b1290d6193b171172d5fe9a6e42326edf487a79f211fbf1e76f912a4aed035" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-srcgen" +version = "0.131.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce0d5c2b4d719566816a0f1c9a9712d35d61e27df0ffd6c72a9afec9048db6c0" + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "curve25519-dalek" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5eed333089e2e1c1ac8c6c0398e5e2497b4c9926ca6d0365ed1e099afa5bc23" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "curve25519-dalek-derive", + "digest 0.11.3", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", +] + +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "const-oid", + "crypto-common 0.2.2", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "ed25519" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29fcf32e6c73d1079f83ab4d782de2d81620346a5f38c6237a86a22f8368980a" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ebaa1a2bf1290ab3bfe5a7b771d050ebffab2711c19a81691c683a5144a25de" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2 0.11.0", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "fd-lock" +version = "4.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce92ff622d6dadf7349484f42c93271a0d49b7cc4d466a936405bacbe10aa78" +dependencies = [ + "cfg-if", + "rustix 1.1.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "fiat-crypto" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" + +[[package]] +name = "field-offset" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" +dependencies = [ + "memoffset", + "rustc_version", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-set-times" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a" +dependencies = [ + "io-lifetimes", + "rustix 1.1.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "futures" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88cf1f829d945f548cf8fec32c61b1f202b6d93b45848602fc02af4b12ad218" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" + +[[package]] +name = "futures-executor" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6754879cc9f2c66f88c6e5c35344bb0bdb0708b0352b1201815667c7eabc7458" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a" + +[[package]] +name = "futures-macro" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "futures-sink" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307" + +[[package]] +name = "futures-task" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" + +[[package]] +name = "futures-util" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25234f20a3ec0a962a61770cfe39ecf03cb529a6e474ad8cff025ed497eda557" +dependencies = [ + "bitflags", + "debugid", + "rustc-hash", + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "gdk-pixbuf" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd242894c084f4beed508a56952750bce3e96e85eb68fdc153637daa163e10c" +dependencies = [ + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b34f3b580c988bd217e9543a2de59823fafae369d1a055555e5f95a8b130b96" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "gdk4" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4850c9d9c1aecd1a3eb14fadc1cdb0ac0a2298037e116264c7473e1740a32d60" +dependencies = [ + "cairo-rs", + "gdk-pixbuf", + "gdk4-sys", + "gio", + "glib", + "libc", + "pango", +] + +[[package]] +name = "gdk4-sys" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f6eb95798e2b46f279cf59005daf297d5b69555428f185650d71974a910473a" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi", +] + +[[package]] +name = "gimli" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7f043f89559805f8c7cacc432749b2fa0d0a0a9ee46ce47164ed5ba7f126c" +dependencies = [ + "fnv", + "hashbrown 0.16.1", + "indexmap", + "stable_deref_trait", +] + +[[package]] +name = "gio" +version = "0.20.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e27e276e7b6b8d50f6376ee7769a71133e80d093bdc363bd0af71664228b831" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "pin-project-lite", + "smallvec", +] + +[[package]] +name = "gio-sys" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521e93a7e56fc89e84aea9a52cfc9436816a4b363b030260b699950ff1336c83" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "windows-sys 0.59.0", +] + +[[package]] +name = "glib" +version = "0.20.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc4b6e352d4716d84d7dde562dd9aee2a7d48beb872dd9ece7f2d1515b2d683" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "memchr", + "smallvec", +] + +[[package]] +name = "glib-macros" +version = "0.20.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8084af62f09475a3f529b1629c10c429d7600ee1398ae12dd3bf175d74e7145" +dependencies = [ + "heck", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "glib-sys" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ab79e1ed126803a8fb827e3de0e2ff95191912b8db65cee467edb56fc4cc215" +dependencies = [ + "libc", + "system-deps", +] + +[[package]] +name = "gobject-sys" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec9aca94bb73989e3cfdbf8f2e0f1f6da04db4d291c431f444838925c4c63eda" +dependencies = [ + "glib-sys", + "libc", + "system-deps", +] + +[[package]] +name = "graphene-rs" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b86dfad7d14251c9acaf1de63bc8754b7e3b4e5b16777b6f5a748208fe9519b" +dependencies = [ + "glib", + "graphene-sys", + "libc", +] + +[[package]] +name = "graphene-sys" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df583a85ba2d5e15e1797e40d666057b28bc2f60a67c9c24145e6db2cc3861ea" +dependencies = [ + "glib-sys", + "libc", + "pkg-config", + "system-deps", +] + +[[package]] +name = "gsk4" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61f5e72f931c8c9f65fbfc89fe0ddc7746f147f822f127a53a9854666ac1f855" +dependencies = [ + "cairo-rs", + "gdk4", + "glib", + "graphene-rs", + "gsk4-sys", + "libc", + "pango", +] + +[[package]] +name = "gsk4-sys" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "755059de55fa6f85a46bde8caf03e2184c96bfda1f6206163c72fb0ea12436dc" +dependencies = [ + "cairo-sys-rs", + "gdk4-sys", + "glib-sys", + "gobject-sys", + "graphene-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "gtk4" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f274dd0102c21c47bbfa8ebcb92d0464fab794a22fad6c3f3d5f165139a326d6" +dependencies = [ + "cairo-rs", + "field-offset", + "futures-channel", + "gdk-pixbuf", + "gdk4", + "gio", + "glib", + "graphene-rs", + "gsk4", + "gtk4-macros", + "gtk4-sys", + "libc", + "pango", +] + +[[package]] +name = "gtk4-macros" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed1786c4703dd196baf7e103525ce0cf579b3a63a0570fe653b7ee6bac33999" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "gtk4-sys" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41e03b01e54d77c310e1d98647d73f996d04b2f29b9121fe493ea525a7ec03d6" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk4-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "graphene-sys", + "gsk4-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "foldhash", + "serde", + "serde_core", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hybrid-array" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" +dependencies = [ + "typenum", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", + "serde", + "serde_core", +] + +[[package]] +name = "io-extras" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2285ddfe3054097ef4b2fe909ef8c3bcd1ea52a8f0d274416caebeef39f04a65" +dependencies = [ + "io-lifetimes", + "windows-sys 0.59.0", +] + +[[package]] +name = "io-lifetimes" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "ittapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" +dependencies = [ + "cc", +] + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83bff1d572d6b9aeef67ddfc8448e4a3737909cb28e81f97c791b9018703e52" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libadwaita" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "500135d29c16aabf67baafd3e7741d48e8b8978ca98bac39e589165c8dc78191" +dependencies = [ + "gdk4", + "gio", + "glib", + "gtk4", + "libadwaita-sys", + "libc", + "pango", +] + +[[package]] +name = "libadwaita-sys" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6680988058c2558baf3f548a370e4e78da3bf7f08469daa822ac414842c912db" +dependencies = [ + "gdk4-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk4-sys", + "libc", + "pango-sys", + "system-deps", +] + +[[package]] +name = "libc" +version = "0.2.187" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7743783ea728ef5c31194c6590797eed286449b4a4e87d626d8a51f0a94e732" + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] +name = "libredox" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c943259e342f1e06ff2da7a83eabdfe7f92ce10262688dbf1895ff0b3e6e4652" +dependencies = [ + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "loop-cli" +version = "0.1.0" +dependencies = [ + "clap", + "colored", + "loop-core-rs", + "serde", + "serde_json", +] + +[[package]] +name = "loop-core-rs" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "traverse-embedder", +] + +[[package]] +name = "loop-gtk" +version = "0.1.0" +dependencies = [ + "directories", + "gtk4", + "libadwaita", + "loop-core-rs", + "serde", + "serde_json", +] + +[[package]] +name = "mach2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44" +dependencies = [ + "libc", +] + +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "memfd" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad38eb12aea514a0466ea40a80fd8cc83637065948eb4a426e4aa46261175227" +dependencies = [ + "rustix 1.1.4", +] + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mio" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "object" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" +dependencies = [ + "crc32fast", + "hashbrown 0.17.1", + "indexmap", + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pango" +version = "0.20.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6576b311f6df659397043a5fa8a021da8f72e34af180b44f7d57348de691ab5c" +dependencies = [ + "gio", + "glib", + "libc", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186909673fc09be354555c302c0b3dcf753cd9fa08dcb8077fa663c80fb243fa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkg-config" +version = "0.3.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" + +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "serde", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pulley-interpreter" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34dff5fd3d9ac4845939fcb4597cd413cb244bc530448ed4766d11b1725e53d0" +dependencies = [ + "cranelift-bitset", + "log", + "pulley-macros", + "wasmtime-internal-core", +] + +[[package]] +name = "pulley-macros" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c60fb1c885bdb1efd7c50e8e973714de558b75a65f20c3e9a41398c652aa44b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.17", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regalloc2" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "757712e8e61590d6d4f5d563483755538b5aa13467837a3b41cd9832509a7f85" +dependencies = [ + "allocator-api2", + "bumpalo", + "hashbrown 0.17.1", + "log", + "rustc-hash", + "smallvec", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb" + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys 0.12.1", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustix-linux-procfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc84bf7e9aa16c4f2c758f27412dc9841341e16aa682d9c7ac308fe3ee12056" +dependencies = [ + "once_cell", + "rustix 1.1.4", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.2", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_spanned" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" +dependencies = [ + "serde_core", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signature" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "system-deps" +version = "7.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml 1.1.3+spec-1.1.0", + "version-compare", +] + +[[package]] +name = "system-interface" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4592f674ce18521c2a81483873a49596655b179f71c5e05d10c1fe66c78745" +dependencies = [ + "bitflags", + "cap-fs-ext", + "cap-std", + "fd-lock", + "io-lifetimes", + "rustix 0.38.44", + "windows-sys 0.59.0", + "winx", +] + +[[package]] +name = "target-lexicon" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.3", + "once_cell", + "rustix 1.1.4", + "windows-sys 0.61.2", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9" +dependencies = [ + "thiserror-impl 2.0.19", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.2", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "toml" +version = "0.9.12+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 0.7.15", +] + +[[package]] +name = "toml" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53c96ecdfa941c8fc4fcaed14f99ada8ebed502eef533015095a07e3301d4c3c" +dependencies = [ + "indexmap", + "serde_core", + "serde_spanned", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "toml_writer", + "winnow 1.0.4", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.13+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +dependencies = [ + "indexmap", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.4", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.4", +] + +[[package]] +name = "toml_writer" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "traverse-contracts" +version = "0.8.1" +source = "git+https://github.com/traverse-framework/Traverse.git#7997043da02771ba3b8e0cf933f63ebfb24f1d45" +dependencies = [ + "semver", + "serde", + "serde_json", +] + +[[package]] +name = "traverse-embedder" +version = "0.8.1" +source = "git+https://github.com/traverse-framework/Traverse.git#7997043da02771ba3b8e0cf933f63ebfb24f1d45" +dependencies = [ + "serde_json", + "traverse-registry", + "traverse-runtime", +] + +[[package]] +name = "traverse-registry" +version = "0.8.1" +source = "git+https://github.com/traverse-framework/Traverse.git#7997043da02771ba3b8e0cf933f63ebfb24f1d45" +dependencies = [ + "semver", + "serde", + "serde_json", + "sha2 0.11.0", + "traverse-contracts", +] + +[[package]] +name = "traverse-runtime" +version = "0.8.1" +source = "git+https://github.com/traverse-framework/Traverse.git#7997043da02771ba3b8e0cf933f63ebfb24f1d45" +dependencies = [ + "chrono", + "ed25519-dalek", + "rayon", + "semver", + "serde", + "serde_json", + "sha2 0.11.0", + "traverse-contracts", + "traverse-registry", + "uuid", + "wasmtime", + "wasmtime-wasi", + "zeroize", +] + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-compose" +version = "0.246.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05a2b3bad87cc1ce45b63425ec09a854cc4cb369231c9fed1fee31538103efb" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "log", + "petgraph", + "smallvec", + "wasm-encoder 0.246.2", + "wasmparser 0.246.2", + "wat", +] + +[[package]] +name = "wasm-encoder" +version = "0.246.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61fb705ce81adde29d2a8e99d87995e39a6e927358c91398f374474746070ef7" +dependencies = [ + "leb128fmt", + "wasmparser 0.246.2", +] + +[[package]] +name = "wasm-encoder" +version = "0.254.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09480d646178e5fdd12bb06e812d0af9a3a191dbc9cd697fdc86687beade7393" +dependencies = [ + "leb128fmt", + "wasmparser 0.254.0", +] + +[[package]] +name = "wasmparser" +version = "0.246.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71cde4757396defafd25417cfb36aa3161027d06d865b0c24baaae229aac005d" +dependencies = [ + "bitflags", + "hashbrown 0.16.1", + "indexmap", + "semver", + "serde", +] + +[[package]] +name = "wasmparser" +version = "0.254.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5769a29f799fbab136aaf65b4fe5384cd7d93fe6fc9ba0dcb6c8382a1f16e27" +dependencies = [ + "bitflags", + "indexmap", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.246.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e41f7493ba994b8a779430a4c25ff550fd5a40d291693af43a6ef48688f00e3" +dependencies = [ + "anyhow", + "termcolor", + "wasmparser 0.246.2", +] + +[[package]] +name = "wasmtime" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d807f646bfecc1dbb4990d8c864beebccbdb3f2cd1b39b2b82957b4e294c6058" +dependencies = [ + "addr2line", + "async-trait", + "bitflags", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "futures", + "fxprof-processed-profile", + "gimli", + "ittapi", + "libc", + "log", + "mach2", + "memfd", + "object", + "once_cell", + "postcard", + "pulley-interpreter", + "rayon", + "rustix 1.1.4", + "semver", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "target-lexicon", + "tempfile", + "wasm-compose", + "wasm-encoder 0.246.2", + "wasmparser 0.246.2", + "wasmtime-environ", + "wasmtime-internal-cache", + "wasmtime-internal-component-macro", + "wasmtime-internal-component-util", + "wasmtime-internal-core", + "wasmtime-internal-cranelift", + "wasmtime-internal-fiber", + "wasmtime-internal-jit-debug", + "wasmtime-internal-jit-icache-coherence", + "wasmtime-internal-unwinder", + "wasmtime-internal-versioned-export-macros", + "wasmtime-internal-winch", + "wat", + "windows-sys 0.61.2", +] + +[[package]] +name = "wasmtime-environ" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48b945309908f22473ebcd585ac2993948044228491cd96941d367aa81a49c3f" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-bforest", + "cranelift-bitset", + "cranelift-entity", + "gimli", + "hashbrown 0.16.1", + "indexmap", + "log", + "object", + "postcard", + "rustc-demangle", + "semver", + "serde", + "serde_derive", + "sha2 0.10.9", + "smallvec", + "target-lexicon", + "wasm-encoder 0.246.2", + "wasmparser 0.246.2", + "wasmprinter", + "wasmtime-internal-component-util", + "wasmtime-internal-core", +] + +[[package]] +name = "wasmtime-internal-cache" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f14b8b93c2137c88ed84114d9a09cb11cb8bf9394aba4856e48f5304a4f99eec" +dependencies = [ + "base64", + "directories-next", + "log", + "postcard", + "rustix 1.1.4", + "serde", + "serde_derive", + "sha2 0.10.9", + "toml 0.9.12+spec-1.1.0", + "wasmtime-environ", + "windows-sys 0.61.2", + "zstd", +] + +[[package]] +name = "wasmtime-internal-component-macro" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7307dec6251a18ffa9df03120d2945ac2476ce150b5b099f39b199e8f81464dc" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasmtime-internal-component-util", + "wasmtime-internal-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-internal-component-util" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3d899b0270bcf04852f141bd9538cb162a436e7f56b2c6e0f4e57ecc70743a" + +[[package]] +name = "wasmtime-internal-core" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedd3947487d0afdd37accb981466fcd60571e898004c8955111f88686581dfc" +dependencies = [ + "anyhow", + "hashbrown 0.16.1", + "libm", + "serde", +] + +[[package]] +name = "wasmtime-internal-cranelift" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512fd846630c064bfc42909eeba90a7d26703b6ded09ad4778ff6afcbdc868dd" +dependencies = [ + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "gimli", + "itertools", + "log", + "object", + "pulley-interpreter", + "smallvec", + "target-lexicon", + "thiserror 2.0.19", + "wasmparser 0.246.2", + "wasmtime-environ", + "wasmtime-internal-core", + "wasmtime-internal-unwinder", + "wasmtime-internal-versioned-export-macros", +] + +[[package]] +name = "wasmtime-internal-fiber" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15629ea71394be5812a52cb8fbc6cd039484ab1dd48fce5e1ef58ae89606289a" +dependencies = [ + "cc", + "cfg-if", + "libc", + "rustix 1.1.4", + "wasmtime-environ", + "wasmtime-internal-versioned-export-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "wasmtime-internal-jit-debug" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5fce5fedc1c952a64cdf3c87e4632af072d2aca0bc2c460d53296fb2654757d" +dependencies = [ + "cc", + "object", + "rustix 1.1.4", + "wasmtime-internal-versioned-export-macros", +] + +[[package]] +name = "wasmtime-internal-jit-icache-coherence" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10005b038e662775ac002f233e429447a58892e89918580fa67ce8cdd9192d0a" +dependencies = [ + "cfg-if", + "libc", + "wasmtime-internal-core", + "windows-sys 0.61.2", +] + +[[package]] +name = "wasmtime-internal-unwinder" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03f3e0f474281b405a3e9d97239f83f643b572324d292e1ef9dc5e3e0ab04c68" +dependencies = [ + "cfg-if", + "cranelift-codegen", + "log", + "object", + "wasmtime-environ", +] + +[[package]] +name = "wasmtime-internal-versioned-export-macros" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "910e5393af4aca456113581a5913b8d499cd2189013e983f8764d06ebc42b2ed" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "wasmtime-internal-winch" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55481651bea5b8336fb200fa49914ccf802f5e7617ba9ab0b4691f16d4f97ff8" +dependencies = [ + "cranelift-codegen", + "gimli", + "log", + "object", + "target-lexicon", + "wasmparser 0.246.2", + "wasmtime-environ", + "wasmtime-internal-cranelift", + "winch-codegen", +] + +[[package]] +name = "wasmtime-internal-wit-bindgen" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d890c3804d0e46000fa901c86ac1a9fdedf684e72dfd64e582b56bb4a78a6746" +dependencies = [ + "anyhow", + "bitflags", + "heck", + "indexmap", + "wit-parser", +] + +[[package]] +name = "wasmtime-wasi" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa7f927779d92863a1447c1d88192b2242080608cb91ece69c177321488948b" +dependencies = [ + "async-trait", + "bitflags", + "bytes", + "cap-fs-ext", + "cap-net-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "futures", + "io-extras", + "io-lifetimes", + "rustix 1.1.4", + "system-interface", + "thiserror 2.0.19", + "tokio", + "tracing", + "url", + "wasmtime", + "wasmtime-wasi-io", + "wiggle", + "windows-sys 0.61.2", +] + +[[package]] +name = "wasmtime-wasi-io" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6fd8b702c2aa82bb4907da5ad44120b4385048f6a20731908a6e2485ea7567e" +dependencies = [ + "async-trait", + "bytes", + "futures", + "tracing", + "wasmtime", +] + +[[package]] +name = "wast" +version = "35.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" +dependencies = [ + "leb128", +] + +[[package]] +name = "wast" +version = "254.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ed4dfc8f6b9fc38b231065e2cdfbf7359af5ab945990abf09658dcc63c3e32" +dependencies = [ + "bumpalo", + "leb128fmt", + "memchr", + "unicode-width", + "wasm-encoder 0.254.0", +] + +[[package]] +name = "wat" +version = "1.254.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7127f7f9b8f127c879991cecd35f494e4628bae1b0874c681414d8d8831e952c" +dependencies = [ + "wast 254.0.0", +] + +[[package]] +name = "wiggle" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165512f7870210d0fd45911990b832782b5fb82d40f4ce28cf86b40aaecd453c" +dependencies = [ + "bitflags", + "thiserror 2.0.19", + "tracing", + "wasmtime", + "wasmtime-environ", + "wiggle-macro", +] + +[[package]] +name = "wiggle-generate" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7f63d06fdf2e9a133407b318574574f66ea6590ea7a42c4a7554c029824454a" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.119", + "wasmtime-environ", + "witx", +] + +[[package]] +name = "wiggle-macro" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b976b7285ca32a637e21721021442691a2d7938ab4650cb99472a672e9def6c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "wiggle-generate", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "winch-codegen" +version = "44.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436a7fa4109b13b0e555d01ec615ab8b928b7834639aca7b2fdc1f55d70a1f0c" +dependencies = [ + "cranelift-assembler-x64", + "cranelift-codegen", + "gimli", + "regalloc2", + "smallvec", + "target-lexicon", + "thiserror 2.0.19", + "wasmparser 0.246.2", + "wasmtime-environ", + "wasmtime-internal-core", + "wasmtime-internal-cranelift", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "winx" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d" +dependencies = [ + "bitflags", + "windows-sys 0.59.0", +] + +[[package]] +name = "wit-parser" +version = "0.246.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd979042b5ff288607ccf3b314145435453f20fc67173195f91062d2289b204d" +dependencies = [ + "anyhow", + "hashbrown 0.16.1", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.246.2", +] + +[[package]] +name = "witx" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" +dependencies = [ + "anyhow", + "log", + "thiserror 1.0.69", + "wast 35.0.2", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.16+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/apps/loop/Cargo.toml b/apps/loop/Cargo.toml new file mode 100644 index 0000000..9a2da31 --- /dev/null +++ b/apps/loop/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +resolver = "2" +members = ["loop-core-rs", "linux-gtk", "cli-rust"] diff --git a/apps/loop/LoopCore/.gitignore b/apps/loop/LoopCore/.gitignore new file mode 100644 index 0000000..0ca9c38 --- /dev/null +++ b/apps/loop/LoopCore/.gitignore @@ -0,0 +1,3 @@ +.build/ +.swiftpm/ +Package.resolved diff --git a/apps/loop/LoopCore/Package.swift b/apps/loop/LoopCore/Package.swift new file mode 100644 index 0000000..9b9c38a --- /dev/null +++ b/apps/loop/LoopCore/Package.swift @@ -0,0 +1,28 @@ +// swift-tools-version: 6.0 +import PackageDescription + +let package = Package( + name: "LoopCore", + platforms: [ + .iOS(.v17), + .macOS(.v14), + ], + products: [ + .library(name: "LoopCore", targets: ["LoopCore"]), + ], + dependencies: [ + .package(path: "../../../vendor/traverse-embedder-swift"), + ], + targets: [ + .target( + name: "LoopCore", + dependencies: [ + .product(name: "TraverseEmbedder", package: "traverse-embedder-swift"), + ] + ), + .testTarget( + name: "LoopCoreTests", + dependencies: ["LoopCore"] + ), + ] +) diff --git a/apps/loop/LoopCore/README.md b/apps/loop/LoopCore/README.md new file mode 100644 index 0000000..85155c0 --- /dev/null +++ b/apps/loop/LoopCore/README.md @@ -0,0 +1,11 @@ +# LoopCore + +Shared Swift package for loop iOS and macOS shells. + +- `EmbeddedHost` — `RuntimeTraverseEmbedder` / `InMemoryTraverseEmbedder` boundary +- `AppStateViewModel` — Zone 1 Ready/Unavailable + submit/reset +- `LoopOutput` — runtime-owned field decoding only + +```bash +cd apps/loop/LoopCore && swift test +``` diff --git a/apps/loop/LoopCore/Sources/LoopCore/AppStateViewModel.swift b/apps/loop/LoopCore/Sources/LoopCore/AppStateViewModel.swift new file mode 100644 index 0000000..5d48ab5 --- /dev/null +++ b/apps/loop/LoopCore/Sources/LoopCore/AppStateViewModel.swift @@ -0,0 +1,128 @@ +import Combine +import Foundation + +public enum RuntimeStatus: Equatable, Sendable { + case starting + case ready + case unavailable +} + +/// Drives UI state from an embedded Traverse host. +/// Contains no local business-field computation. +@MainActor +public final class AppStateViewModel: ObservableObject { + @Published public private(set) var currentState: String = "idle" + @Published public private(set) var output: LoopOutput? + @Published public private(set) var errorMessage: String? + @Published public private(set) var sessionId: String? + @Published public private(set) var trace: [TraceEvent] = [] + @Published public private(set) var runtimeStatus: RuntimeStatus = .starting + @Published public private(set) var submitting: Bool = false + @Published public private(set) var presentationState: PresentationState = .idle + @Published public private(set) var activeCapabilityId: String? + @Published public private(set) var capabilityProgress: [CapabilityProgressStep] = [] + @Published public var transcript: String = "" + @Published public var showTrace: Bool = false + + public let appId: String + public let transcriptMaxLength: Int + public let runtimeMode: String + public let workflowId: String + public private(set) var workspaceId: String + + private let host: EmbeddedHostProtocol? + + public init( + host: EmbeddedHostProtocol?, + workspaceId: String, + appId: String = EmbeddedHost.defaultAppId, + transcriptMaxLength: Int = 5_000 + ) { + self.host = host + self.workspaceId = workspaceId + self.appId = appId + self.transcriptMaxLength = transcriptMaxLength + self.runtimeMode = EmbeddedHost.runtimeModeEmbedded + self.workflowId = host?.workflowId ?? EmbeddedHost.defaultWorkflowId + self.runtimeStatus = host?.isReady == true ? .ready : .unavailable + } + + public var canSubmit: Bool { + runtimeStatus == .ready && + !transcript.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty && + !isRunning + } + + public var isRunning: Bool { + submitting || currentState == "processing" + } + + public func updateWorkspace(_ workspaceId: String) { + self.workspaceId = workspaceId + } + + public func refreshRuntimeStatus() { + runtimeStatus = host?.isReady == true ? .ready : .unavailable + } + + public func submit() { + guard canSubmit, let host else { return } + let trimmed = String(transcript.trimmingCharacters(in: .whitespacesAndNewlines).prefix(transcriptMaxLength)) + submitting = true + currentState = "processing" + errorMessage = nil + output = nil + trace = [] + showTrace = false + sessionId = nil + + Task { [weak self] in + guard let self else { return } + do { + let result = try await Task.detached { + try host.submitTranscript(trimmed) + }.value + await MainActor.run { + self.sessionId = result.sessionId + self.trace = result.events + self.showTrace = !result.events.isEmpty + self.submitting = false + self.presentationState = result.presentationState + self.activeCapabilityId = result.activeCapabilityId + self.capabilityProgress = result.capabilityProgress + if let error = result.error { + self.currentState = "error" + self.errorMessage = error + } else { + self.output = result.output ?? .empty + self.currentState = "completed" + } + } + } catch { + await MainActor.run { + self.submitting = false + self.currentState = "error" + self.errorMessage = error.localizedDescription + } + } + } + } + + public func reset() { + submitting = false + currentState = "idle" + sessionId = nil + output = nil + trace = [] + errorMessage = nil + showTrace = false + presentationState = .idle + activeCapabilityId = nil + capabilityProgress = [] + } + + /// Compatibility alias for shell call sites. + public func resetLocal() { + reset() + } +} diff --git a/apps/loop/LoopCore/Sources/LoopCore/EmbeddedHost.swift b/apps/loop/LoopCore/Sources/LoopCore/EmbeddedHost.swift new file mode 100644 index 0000000..d0319ae --- /dev/null +++ b/apps/loop/LoopCore/Sources/LoopCore/EmbeddedHost.swift @@ -0,0 +1,342 @@ +import Foundation +import TraverseEmbedder + +/// Successful or failed embedded workflow run. +public struct HostRunResult: Equatable, Sendable { + public let sessionId: String + public let output: LoopOutput? + public let events: [TraceEvent] + public let error: String? + public let presentationState: PresentationState + public let presentationError: String? + public let capabilityProgress: [CapabilityProgressStep] + public let activeCapabilityId: String? + + public init( + sessionId: String, + output: LoopOutput?, + events: [TraceEvent], + error: String?, + presentationState: PresentationState = .idle, + presentationError: String? = nil, + capabilityProgress: [CapabilityProgressStep] = [], + activeCapabilityId: String? = nil + ) { + self.sessionId = sessionId + self.output = output + self.events = events + self.error = error + self.presentationState = presentationState + self.presentationError = presentationError + self.capabilityProgress = capabilityProgress + self.activeCapabilityId = activeCapabilityId + } + + /// Attaches Spec 001/002 presentation fields derived from public embedder events. + public func withPresentation(from likes: [EmbedderEventLike]) -> HostRunResult { + let snap = PresentationMapper.mapPresentationState(likes) + let presentationState: PresentationState = + (error != nil && snap.state == .idle) ? .error : snap.state + return HostRunResult( + sessionId: sessionId, + output: output, + events: events, + error: error, + presentationState: presentationState, + presentationError: snap.errorMessage ?? (error != nil && snap.state == .idle ? error : nil), + capabilityProgress: PresentationMapper.mapCapabilityProgress(likes), + activeCapabilityId: PresentationMapper.activeCapabilityId(likes) + ) + } +} + +/// Embedded Traverse host boundary for SwiftUI shells. +public protocol EmbeddedHostProtocol: AnyObject, Sendable { + var workspaceId: String { get } + var workflowId: String { get } + var isReady: Bool { get } + func submitTranscript(_ transcript: String) throws -> HostRunResult +} + +/// Factory helpers for production and test hosts. +public enum EmbeddedHost { + public static let runtimeModeEmbedded = "Embedded" + public static let defaultWorkflowId = "loop.wf1" + public static let defaultWorkspace = "local-default" + public static let defaultAppId = "loop" + public static let pinnedRuntimeWasmDigest = + "sha256:aa801023ba4eb20b8c1b4004bdd964a78fed9540478b252b77eac04c80811852" + public static let defaultRelativeBundlePath = "bundles/loop" + + /// Production host backed by the digest-pinned runtime WASM bridge. + public static func tryCreateProduction( + bundleRoot: URL? = nil, + workspaceId: String? = nil, + digest: String? = nil + ) -> EmbeddedHostProtocol? { + do { + guard let root = resolveBundleRoot(override: bundleRoot) else { return nil } + let pinned = digest ?? readPinnedDigest(bundleRoot: root) ?? pinnedRuntimeWasmDigest + let workspace = (workspaceId?.trimmingCharacters(in: .whitespacesAndNewlines)).flatMap { + $0.isEmpty ? nil : $0 + } ?? defaultWorkspace + return try ProductionEmbeddedHost(bundleRoot: root, digest: pinned, workspaceId: workspace) + } catch { + return nil + } + } + + /// Deterministic test double (spec 068 / #751). + public static func createTestHost( + output: LoopOutput, + workspaceId: String = defaultWorkspace + ) throws -> EmbeddedHostProtocol { + let encoder = JSONEncoder() + let data = try encoder.encode(output) + let harness = InMemoryTraverseEmbedder().withTargetOutput(data) + let bundle = try TraverseBundle(rootURL: URL(fileURLWithPath: "test-root"), runtimeWasmDigest: "sha256:test") + try harness.initialize(bundle: bundle) + return TestEmbeddedHost(harness: harness, workspaceId: workspaceId, workflowId: defaultWorkflowId) + } + + public static func resolveBundleRoot(override: URL? = nil) -> URL? { + if let override { + let runtime = override.appendingPathComponent("runtime").appendingPathComponent("runtime.wasm") + if FileManager.default.fileExists(atPath: runtime.path) { + return override + } + } + + let candidates: [URL] = [ + Bundle.main.resourceURL? + .appendingPathComponent(defaultRelativeBundlePath), + Bundle.main.bundleURL + .appendingPathComponent("Contents/Resources") + .appendingPathComponent(defaultRelativeBundlePath), + URL(fileURLWithPath: FileManager.default.currentDirectoryPath) + .appendingPathComponent(defaultRelativeBundlePath), + ].compactMap { $0 } + + for candidate in candidates { + let runtime = candidate.appendingPathComponent("runtime").appendingPathComponent("runtime.wasm") + if FileManager.default.fileExists(atPath: runtime.path) { + return candidate + } + } + return nil + } + + private static func readPinnedDigest(bundleRoot: URL) -> String? { + let release = bundleRoot.appendingPathComponent("runtime").appendingPathComponent("runtime-release.json") + guard let data = try? Data(contentsOf: release), + let json = try? JSONSerialization.jsonObject(with: data) as? [String: Any], + let hex = json["sha256"] as? String, + !hex.isEmpty else { + return nil + } + return hex.hasPrefix("sha256:") ? hex : "sha256:\(hex)" + } +} + +private final class ProductionEmbeddedHost: EmbeddedHostProtocol, @unchecked Sendable { + let workspaceId: String + let workflowId: String + let isReady: Bool + private let client: WasmiHostBridgeClient + private let runtime: RuntimeTraverseEmbedder + + init(bundleRoot: URL, digest: String, workspaceId: String) throws { + self.workspaceId = workspaceId + self.workflowId = EmbeddedHost.defaultWorkflowId + let bundle = try TraverseBundle(rootURL: bundleRoot, runtimeWasmDigest: digest) + self.client = try WasmiHostBridgeClient(bundle: bundle) + self.runtime = RuntimeTraverseEmbedder(client: client) + let config = try JSONSerialization.data(withJSONObject: ["workspace_id": workspaceId]) + _ = try runtime.initialize(configJSON: config) + self.isReady = true + } + + func submitTranscript(_ transcript: String) throws -> HostRunResult { + let input = try JSONSerialization.data(withJSONObject: ["transcript": transcript]) + let submission = try TraverseSubmission(targetID: workflowId, inputJSON: input) + let accepted = try runtime.submit(submission) + guard accepted.status.lowercased() == "accepted" else { + return HostRunResult( + sessionId: accepted.sessionID, + output: nil, + events: [], + error: "submit \(accepted.status)" + ) + } + return try drainEvents(sessionId: accepted.sessionID) + } + + private func drainEvents(sessionId: String) throws -> HostRunResult { + var events: [TraceEvent] = [] + var output: LoopOutput? + var error: String? + + while let bytes = try client.nextEvent() { + guard let root = try JSONSerialization.jsonObject(with: bytes) as? [String: Any] else { + continue + } + let eventType = (root["type"] as? String) + ?? (root["event_type"] as? String) + ?? "event" + if let eventSession = root["session_id"] as? String, + eventSession != sessionId { + continue + } + let data = root["data"].map { JSONValue.fromAny($0) } ?? nil + events.append(TraceEvent(event_type: eventType, timestamp: "\(events.count)", data: data)) + + if eventType == "error" { + error = extractError(root["data"]) ?? "execution failed" + break + } + if eventType == "capability_result" { + output = parseOutput(root["data"]) + break + } + } + + let likes = embedderEventLikes(from: events) + if let error { + return HostRunResult(sessionId: sessionId, output: nil, events: events, error: error) + .withPresentation(from: likes) + } + if output == nil, events.isEmpty { + return HostRunResult( + sessionId: sessionId, + output: nil, + events: events, + error: "embedder emitted no capability_result" + ).withPresentation(from: likes) + } + return HostRunResult( + sessionId: sessionId, + output: output ?? .empty, + events: events, + error: nil + ).withPresentation(from: likes) + } + + deinit { + _ = try? runtime.shutdown() + } +} + +private final class TestEmbeddedHost: EmbeddedHostProtocol, @unchecked Sendable { + let workspaceId: String + let workflowId: String + let isReady: Bool = true + private let harness: InMemoryTraverseEmbedder + + init(harness: InMemoryTraverseEmbedder, workspaceId: String, workflowId: String) { + self.harness = harness + self.workspaceId = workspaceId + self.workflowId = workflowId + } + + func submitTranscript(_ transcript: String) throws -> HostRunResult { + let input = try JSONSerialization.data(withJSONObject: ["transcript": transcript]) + let submission = try TraverseSubmission(targetID: workflowId, inputJSON: input) + let accepted = try harness.submit(submission) + let runtimeEvents = try harness.subscribe() + var events: [TraceEvent] = [] + var output: LoopOutput? + var error: String? + + for evt in runtimeEvents { + if let sid = evt.sessionID, sid != accepted.sessionID { continue } + let eventType = evt.eventType ?? evt.status + var data: JSONValue? + if let out = evt.output, + let obj = try? JSONSerialization.jsonObject(with: out) { + data = JSONValue.fromAny(obj) + } + events.append(TraceEvent(event_type: eventType, timestamp: "\(evt.sequence)", data: data)) + if eventType == "error" { + error = evt.errorData.flatMap { String(data: $0, encoding: .utf8) } ?? "execution failed" + break + } + if eventType == "capability_result", let out = evt.output { + output = (try? JSONDecoder().decode(LoopOutput.self, from: out)) ?? .empty + break + } + } + + let likes = embedderEventLikes(from: events) + if let error { + return HostRunResult(sessionId: accepted.sessionID, output: nil, events: events, error: error) + .withPresentation(from: likes) + } + return HostRunResult( + sessionId: accepted.sessionID, + output: output ?? .empty, + events: events, + error: output == nil ? "embedder emitted no capability_result" : nil + ).withPresentation(from: likes) + } + + deinit { + harness.shutdown() + } +} + +private func parseOutput(_ raw: Any?) -> LoopOutput { + guard let raw else { return .empty } + var value = raw + if let dict = raw as? [String: Any], let nested = dict["output"] { + value = nested + } + if let dict = value as? [String: Any], + let parsed = LoopOutputParser.parse(dict) { + return parsed + } + if let data = try? JSONSerialization.data(withJSONObject: value), + let decoded = try? JSONDecoder().decode(LoopOutput.self, from: data) { + return decoded + } + return .empty +} + +private func extractError(_ raw: Any?) -> String? { + guard let dict = raw as? [String: Any] else { return nil } + if let err = dict["error"] as? String { return err } + if let err = dict["error"] as? [String: Any], let message = err["message"] as? String { + return message + } + return nil +} + +private func embedderEventLikes(from events: [TraceEvent]) -> [EmbedderEventLike] { + events.enumerated().map { index, event in + EmbedderEventLike( + eventType: event.event_type, + sequence: UInt64(index + 1), + data: event.data?.asDictionary ?? [:] + ) + } +} + +private extension JSONValue { + static func fromAny(_ value: Any) -> JSONValue { + switch value { + case let s as String: return .string(s) + case let n as NSNumber: + if CFGetTypeID(n) == CFBooleanGetTypeID() { + return .bool(n.boolValue) + } + return .number(n.doubleValue) + case let dict as [String: Any]: + return .object(dict.mapValues { fromAny($0) }) + case let arr as [Any]: + return .array(arr.map { fromAny($0) }) + case is NSNull: + return .null + default: + return .null + } + } +} diff --git a/apps/loop/LoopCore/Sources/LoopCore/LoopCommand.swift b/apps/loop/LoopCore/Sources/LoopCore/LoopCommand.swift new file mode 100644 index 0000000..1cc953e --- /dev/null +++ b/apps/loop/LoopCore/Sources/LoopCore/LoopCommand.swift @@ -0,0 +1,17 @@ +import Foundation + +public struct LoopCommand: Equatable, Sendable { + public let name: String + public let payload: [String: String] + public let sessionId: String? + + public init(name: String, payload: [String: String] = [:], sessionId: String? = nil) { + self.name = name + self.payload = payload + self.sessionId = sessionId + } + + public static func submit(transcript: String, sessionId: String? = nil) -> LoopCommand { + LoopCommand(name: "submit", payload: ["transcript": transcript], sessionId: sessionId) + } +} diff --git a/apps/loop/LoopCore/Sources/LoopCore/LoopOutput.swift b/apps/loop/LoopCore/Sources/LoopCore/LoopOutput.swift new file mode 100644 index 0000000..b1435d2 --- /dev/null +++ b/apps/loop/LoopCore/Sources/LoopCore/LoopOutput.swift @@ -0,0 +1,219 @@ +import Foundation + +public struct ActionItem: Equatable, Sendable, Codable { + public let task: String + public let owner: String? + public let due: String? + + public init(task: String, owner: String? = nil, due: String? = nil) { + self.task = task + self.owner = owner + self.due = due + } +} + +public struct Decision: Equatable, Sendable, Codable { + public let text: String + public let madeBy: String? + + public init(text: String, madeBy: String? = nil) { + self.text = text + self.madeBy = madeBy + } + + enum CodingKeys: String, CodingKey { + case text + case madeBy = "made_by" + } +} + +/// Runtime-owned loop.wf1 output. +public struct LoopOutput: Equatable, Sendable, Codable { + public let actionItems: [ActionItem] + public let decisions: [Decision] + public let followUps: [String] + public let summary: String + + public init( + actionItems: [ActionItem], + decisions: [Decision], + followUps: [String], + summary: String + ) { + self.actionItems = actionItems + self.decisions = decisions + self.followUps = followUps + self.summary = summary + } + + public static let empty = LoopOutput( + actionItems: [], + decisions: [], + followUps: [], + summary: "" + ) + + enum CodingKeys: String, CodingKey { + case actionItems = "action_items" + case decisions + case followUps = "follow_ups" + case summary + } +} + +public struct TraceEvent: Equatable, Sendable, Codable { + public let event_type: String + public let timestamp: String + public let data: JSONValue? + + public init(event_type: String, timestamp: String, data: JSONValue? = nil) { + self.event_type = event_type + self.timestamp = timestamp + self.data = data + } +} + +public struct AppStateEventPayload: Equatable, Sendable { + public let state: String? + public let sessionId: String? + public let executionId: String? + public let output: LoopOutput? + public let errorMessage: String? + + public init( + state: String? = nil, + sessionId: String? = nil, + executionId: String? = nil, + output: LoopOutput? = nil, + errorMessage: String? = nil + ) { + self.state = state + self.sessionId = sessionId + self.executionId = executionId + self.output = output + self.errorMessage = errorMessage + } +} + +public enum LoopClientError: Error, Equatable, Sendable { + case http(status: Int) + case decode + case invalidURL +} + +public enum JSONValue: Equatable, Sendable, Codable { + case string(String) + case number(Double) + case bool(Bool) + case object([String: JSONValue]) + case array([JSONValue]) + case null + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if container.decodeNil() { + self = .null + } else if let value = try? container.decode(Bool.self) { + self = .bool(value) + } else if let value = try? container.decode(Double.self) { + self = .number(value) + } else if let value = try? container.decode(String.self) { + self = .string(value) + } else if let value = try? container.decode([String: JSONValue].self) { + self = .object(value) + } else if let value = try? container.decode([JSONValue].self) { + self = .array(value) + } else { + throw DecodingError.dataCorruptedError(in: container, debugDescription: "Unsupported JSON") + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .string(let value): try container.encode(value) + case .number(let value): try container.encode(value) + case .bool(let value): try container.encode(value) + case .object(let value): try container.encode(value) + case .array(let value): try container.encode(value) + case .null: try container.encodeNil() + } + } + + /// Dictionary mapping (object payloads only). + public var asDictionary: [String: Any] { + guard case .object(let object) = self else { return [:] } + return object.mapValues { $0.asAny } + } + + public var asAny: Any { + switch self { + case .string(let value): return value + case .number(let value): return value + case .bool(let value): return value + case .object(let value): return value.mapValues { $0.asAny } + case .array(let value): return value.map { $0.asAny } + case .null: return NSNull() + } + } +} + +public enum LoopOutputParser { + public static func parse(_ raw: Any?) -> LoopOutput? { + guard let dict = raw as? [String: Any], + let summary = dict["summary"] as? String else { + return nil + } + let actionItems = parseActionItems(dict["action_items"]) + let decisions = parseDecisions(dict["decisions"]) + let followUps = dict["follow_ups"] as? [String] ?? [] + return LoopOutput( + actionItems: actionItems, + decisions: decisions, + followUps: followUps, + summary: summary + ) + } + + public static func parseEventPayload(_ raw: Any?) -> AppStateEventPayload? { + guard let dict = raw as? [String: Any] else { return nil } + let state = dict["state"] as? String + let sessionId = dict["session_id"] as? String + let executionId = dict["execution_id"] as? String + let output = parse(dict["output"]) + var errorMessage: String? + if let error = dict["error"] as? String { + errorMessage = error + } else if let errorObj = dict["error"] as? [String: Any], + let message = errorObj["message"] as? String { + errorMessage = message + } + return AppStateEventPayload( + state: state, + sessionId: sessionId, + executionId: executionId, + output: output, + errorMessage: errorMessage + ) + } + + private static func parseActionItems(_ raw: Any?) -> [ActionItem] { + guard let items = raw as? [[String: Any]] else { return [] } + return items.compactMap { item in + guard let task = item["task"] as? String else { return nil } + return ActionItem( + task: task, + owner: item["owner"] as? String, + due: item["due"] as? String + ) + } + } + + private static func parseDecisions(_ raw: Any?) -> [Decision] { + guard let items = raw as? [[String: Any]] else { return [] } + return items.compactMap { item in + guard let text = item["text"] as? String else { return nil } + return Decision(text: text, madeBy: item["made_by"] as? String) + } + } +} diff --git a/apps/loop/LoopCore/Sources/LoopCore/PresentationMapper.swift b/apps/loop/LoopCore/Sources/LoopCore/PresentationMapper.swift new file mode 100644 index 0000000..64d33c5 --- /dev/null +++ b/apps/loop/LoopCore/Sources/LoopCore/PresentationMapper.swift @@ -0,0 +1,224 @@ +import Foundation + +/// Canonical UI presentation states (Spec 001). +public enum PresentationState: String, Equatable, Sendable { + case idle + case loading + case loaded + case blocked + case ended + case error +} + +public struct PresentationSnapshot: Equatable, Sendable { + public let state: PresentationState + public let errorMessage: String? + public let output: Any? + + public init(state: PresentationState, errorMessage: String?, output: Any?) { + self.state = state + self.errorMessage = errorMessage + self.output = output + } + + public static func == (lhs: PresentationSnapshot, rhs: PresentationSnapshot) -> Bool { + lhs.state == rhs.state && lhs.errorMessage == rhs.errorMessage + } +} + +public enum CapabilityPhase: String, Equatable, Sendable { + case invoked + case result +} + +public struct CapabilityProgressStep: Equatable, Sendable { + public let capabilityId: String + public let phase: CapabilityPhase + public let sequence: UInt64 + public let status: String? + public let output: Any? + + public init( + capabilityId: String, + phase: CapabilityPhase, + sequence: UInt64, + status: String?, + output: Any? + ) { + self.capabilityId = capabilityId + self.phase = phase + self.sequence = sequence + self.status = status + self.output = output + } + + public static func == (lhs: CapabilityProgressStep, rhs: CapabilityProgressStep) -> Bool { + lhs.capabilityId == rhs.capabilityId + && lhs.phase == rhs.phase + && lhs.sequence == rhs.sequence + && lhs.status == rhs.status + } +} + +/// Minimal embedder event fields required by the mapper. +public struct EmbedderEventLike: Equatable, Sendable { + public let eventType: String + public let sequence: UInt64 + public let data: [String: Any] + + public init(eventType: String, sequence: UInt64, data: [String: Any]) { + self.eventType = eventType + self.sequence = sequence + self.data = data + } + + public static func == (lhs: EmbedderEventLike, rhs: EmbedderEventLike) -> Bool { + lhs.eventType == rhs.eventType && lhs.sequence == rhs.sequence + } +} + +/// Spec 001/002 presentation + capability progress (language-equivalent of +/// `packages/event-ui-conformance`). +public enum PresentationMapper { + private static let blockedStates: Set = [ + "blocked", "waiting", "waiting_for_human", "awaiting_human", "awaiting_input", + ] + private static let endedStates: Set = [ + "cancelled", "canceled", "closed", "ended", + ] + + public static func mapPresentationState(_ events: [EmbedderEventLike]) -> PresentationSnapshot { + if events.isEmpty { + return PresentationSnapshot(state: .idle, errorMessage: nil, output: nil) + } + + var state: PresentationState = .idle + var errorMessage: String? + var output: Any? + + for event in events { + switch event.eventType { + case "error": + state = .error + errorMessage = errorMessageFromData(event.data) ?? "execution failed" + case "capability_invoked": + if state != .error { + state = .loading + } + case "state_changed": + if state == .error { break } + if isBlockedPayload(event.data) { + state = .blocked + } else if isEndedStatePayload(event.data) { + state = .ended + } else if state != .loaded && state != .ended { + state = .loading + } + case "capability_result": + if state == .error { break } + if hasRenderableOutput(event.data) { + state = .loaded + output = event.data["output"] + } else { + state = .ended + output = nil + } + default: + break + } + } + + return PresentationSnapshot(state: state, errorMessage: errorMessage, output: output) + } + + public static func mapCapabilityProgress(_ events: [EmbedderEventLike]) -> [CapabilityProgressStep] { + var steps: [CapabilityProgressStep] = [] + for event in events { + guard let capabilityId = event.data["capability_id"] as? String else { continue } + switch event.eventType { + case "capability_invoked": + steps.append( + CapabilityProgressStep( + capabilityId: capabilityId, + phase: .invoked, + sequence: event.sequence, + status: nil, + output: nil + ) + ) + case "capability_result": + steps.append( + CapabilityProgressStep( + capabilityId: capabilityId, + phase: .result, + sequence: event.sequence, + status: event.data["status"] as? String, + output: event.data["output"] + ) + ) + default: + break + } + } + return steps + } + + public static func activeCapabilityId(_ events: [EmbedderEventLike]) -> String? { + let progress = mapCapabilityProgress(events) + var open: [String: Int] = [:] + for step in progress { + switch step.phase { + case .invoked: + open[step.capabilityId, default: 0] += 1 + case .result: + let count = open[step.capabilityId] ?? 0 + if count <= 1 { + open.removeValue(forKey: step.capabilityId) + } else { + open[step.capabilityId] = count - 1 + } + } + } + for step in progress.reversed() { + if step.phase == .invoked, open[step.capabilityId] != nil { + return step.capabilityId + } + } + return nil + } + + private static func errorMessageFromData(_ data: [String: Any]) -> String? { + if let err = data["error"] as? String { return err } + if let err = data["error"] as? [String: Any], let message = err["message"] as? String { + return message + } + return nil + } + + private static func runtimeStateToken(_ data: [String: Any]) -> String? { + (data["state"] as? String) + ?? (data["status"] as? String) + ?? (data["runtime_state"] as? String) + } + + private static func isBlockedPayload(_ data: [String: Any]) -> Bool { + if data["blocked"] as? Bool == true || data["waiting_for_human"] as? Bool == true { + return true + } + guard let token = runtimeStateToken(data)?.lowercased() else { return false } + return blockedStates.contains(token) + } + + private static func isEndedStatePayload(_ data: [String: Any]) -> Bool { + guard let token = runtimeStateToken(data)?.lowercased() else { return false } + return endedStates.contains(token) + } + + private static func hasRenderableOutput(_ data: [String: Any]) -> Bool { + guard data.keys.contains("output") else { return false } + let output = data["output"] + if output == nil || output is NSNull { return false } + if let dict = output as? [String: Any], dict.isEmpty { return false } + return true + } +} diff --git a/apps/loop/LoopCore/Tests/LoopCoreTests/LoopCoreTests.swift b/apps/loop/LoopCore/Tests/LoopCoreTests/LoopCoreTests.swift new file mode 100644 index 0000000..d03b909 --- /dev/null +++ b/apps/loop/LoopCore/Tests/LoopCoreTests/LoopCoreTests.swift @@ -0,0 +1,95 @@ +import Foundation +import XCTest +@testable import LoopCore + +final class EmbeddedHostTests: XCTestCase { + private var sampleOutput: LoopOutput { + LoopOutput( + actionItems: [ActionItem(task: "Ship clients", owner: "Alex", due: "Friday")], + decisions: [Decision(text: "Use embedded runtime", madeBy: "Team")], + followUps: ["Schedule review"], + summary: "Discussed Wave 2 ports" + ) + } + + func testTestHostReturnsScriptedCapabilityResult() throws { + let host = try EmbeddedHost.createTestHost(output: sampleOutput) + let result = try host.submitTranscript("any transcript") + XCTAssertNil(result.error) + XCTAssertEqual(result.output?.summary, "Discussed Wave 2 ports") + XCTAssertTrue(result.events.contains { $0.event_type == "capability_result" }) + } + + func testPinnedDigestConstant() { + XCTAssertTrue(EmbeddedHost.pinnedRuntimeWasmDigest.hasPrefix("sha256:")) + XCTAssertEqual(EmbeddedHost.pinnedRuntimeWasmDigest.count, 71) + } +} + +@MainActor +final class AppStateViewModelTests: XCTestCase { + private var sampleOutput: LoopOutput { + LoopOutput( + actionItems: [ActionItem(task: "Ship clients")], + decisions: [], + followUps: [], + summary: "Discussed Wave 2 ports" + ) + } + + func testCanSubmitWhenReadyWithTranscript() throws { + let host = try EmbeddedHost.createTestHost(output: sampleOutput) + let vm = AppStateViewModel(host: host, workspaceId: "local-default") + vm.transcript = "hello" + XCTAssertEqual(vm.runtimeStatus, .ready) + XCTAssertEqual(vm.runtimeMode, EmbeddedHost.runtimeModeEmbedded) + XCTAssertTrue(vm.canSubmit) + } + + func testUnavailableHostDisablesSubmit() { + let vm = AppStateViewModel(host: nil, workspaceId: "local-default") + vm.transcript = "hello" + XCTAssertEqual(vm.runtimeStatus, .unavailable) + XCTAssertFalse(vm.canSubmit) + } + + func testSubmitTransitionsToCompleted() async throws { + let host = try EmbeddedHost.createTestHost(output: sampleOutput) + let vm = AppStateViewModel(host: host, workspaceId: "local-default") + vm.transcript = "meeting transcript" + vm.submit() + try await Task.sleep(nanoseconds: 200_000_000) + XCTAssertEqual(vm.currentState, "completed") + XCTAssertEqual(vm.output?.summary, "Discussed Wave 2 ports") + XCTAssertNotNil(vm.sessionId) + } + + func testResetReturnsToIdle() throws { + let host = try EmbeddedHost.createTestHost(output: sampleOutput) + let vm = AppStateViewModel(host: host, workspaceId: "local-default") + vm.errorMessage = "boom" + vm.reset() + XCTAssertEqual(vm.currentState, "idle") + XCTAssertNil(vm.errorMessage) + } +} + +final class LoopOutputParserTests: XCTestCase { + func testParseProcessOutput() { + let raw: [String: Any] = [ + "action_items": [ + ["task": "Ship clients", "owner": "Alex", "due": "Friday"], + ], + "decisions": [ + ["text": "Use embedded runtime", "made_by": "Team"], + ], + "follow_ups": ["Schedule review"], + "summary": "Discussed Wave 2 ports", + ] + let output = LoopOutputParser.parse(raw) + XCTAssertEqual(output?.summary, "Discussed Wave 2 ports") + XCTAssertEqual(output?.actionItems.first?.task, "Ship clients") + XCTAssertEqual(output?.decisions.first?.madeBy, "Team") + XCTAssertEqual(output?.followUps, ["Schedule review"]) + } +} diff --git a/apps/loop/LoopCore/Tests/LoopCoreTests/PresentationMapperTests.swift b/apps/loop/LoopCore/Tests/LoopCoreTests/PresentationMapperTests.swift new file mode 100644 index 0000000..0607e18 --- /dev/null +++ b/apps/loop/LoopCore/Tests/LoopCoreTests/PresentationMapperTests.swift @@ -0,0 +1,52 @@ +import XCTest +@testable import LoopCore + +final class PresentationMapperTests: XCTestCase { + func testEmptyStreamIsIdle() { + let snap = PresentationMapper.mapPresentationState([]) + XCTAssertEqual(snap.state, .idle) + XCTAssertNil(snap.errorMessage) + } + + func testHappyPathLoads() { + let events: [EmbedderEventLike] = [ + .init(eventType: "capability_invoked", sequence: 1, data: [ + "capability_id": "fixture.process", + ]), + .init(eventType: "capability_result", sequence: 2, data: [ + "capability_id": "fixture.process", + "output": ["ok": true], + ]), + ] + let snap = PresentationMapper.mapPresentationState(events) + XCTAssertEqual(snap.state, .loaded) + let progress = PresentationMapper.mapCapabilityProgress(events) + XCTAssertEqual(progress.map(\.capabilityId), ["fixture.process", "fixture.process"]) + XCTAssertEqual(progress.map(\.phase), [.invoked, .result]) + XCTAssertNil(PresentationMapper.activeCapabilityId(events)) + } + + func testBlockedWaitingForHuman() { + let events: [EmbedderEventLike] = [ + .init(eventType: "capability_invoked", sequence: 1, data: [ + "capability_id": "fixture.approve", + ]), + .init(eventType: "state_changed", sequence: 2, data: [ + "state": "waiting_for_human", + ]), + ] + XCTAssertEqual(PresentationMapper.mapPresentationState(events).state, .blocked) + XCTAssertEqual(PresentationMapper.activeCapabilityId(events), "fixture.approve") + } + + func testErrorPath() { + let events: [EmbedderEventLike] = [ + .init(eventType: "error", sequence: 1, data: [ + "error": ["message": "boom"], + ]), + ] + let snap = PresentationMapper.mapPresentationState(events) + XCTAssertEqual(snap.state, .error) + XCTAssertEqual(snap.errorMessage, "boom") + } +} diff --git a/apps/loop/android-compose/.gitignore b/apps/loop/android-compose/.gitignore new file mode 100644 index 0000000..e4f1161 --- /dev/null +++ b/apps/loop/android-compose/.gitignore @@ -0,0 +1,9 @@ +.gradle/ +build/ +local.properties +.idea/ +*.iml +.DS_Store +captures/ +.externalNativeBuild/ +.cxx/ diff --git a/apps/loop/android-compose/README.md b/apps/loop/android-compose/README.md new file mode 100644 index 0000000..addd183 --- /dev/null +++ b/apps/loop/android-compose/README.md @@ -0,0 +1,48 @@ +# loop (Android Compose) + +**Runtime mode: Embedded** - public Kotlin `TraverseEmbedder` (`dev.traverse.embedder`) with digest-pinned `runtime/runtime.wasm`. No `traverse-cli serve` sidecar is required. + +Native Android client for the `loop` reference app. + +## Prerequisites + +- Android Studio Ladybug+ (or compatible AGP 8.7 / Kotlin 2.0) +- Android emulator API 28+ (or physical device) +- Traverse checkout with the Kotlin embedder package and certified runtime artifact: + +```bash +export TRAVERSE_REPO=/path/to/Traverse +bash scripts/ci/sync_android_loop_bundle.sh +``` + +`settings.gradle.kts` composites `$TRAVERSE_REPO/packages/kotlin/TraverseEmbedder` as `:traverse-embedder`. + +## Bundle configuration + +Assets live under `app/src/main/assets/bundles/loop/` (including `runtime/runtime.wasm` + `runtime-release.json` after sync). The app copies them into `filesDir` on launch. + +Settings -> Workspace only (no sidecar URL). Default workspace is `local-default`. + +## Build and test + +```bash +export TRAVERSE_REPO=/path/to/Traverse +cd apps/loop/android-compose +./gradlew test +./gradlew :app:assembleDebug +``` + +Unit tests inject `InMemoryTraverseEmbedder` via `InMemoryLoopHost`; fixtures use only the runtime-owned `LoopOutput` fields. + +## Architecture + +| File | Role | +|---|---| +| `EmbeddedHost.kt` | Production + in-memory embedded hosts | +| `ExecutionViewModel.kt` | Submit transcript -> render runtime-owned output | +| `BundleAssets.kt` | Materialize asset bundle into filesDir | +| `ui/MainScreen.kt` | Embedded runtime status, transcript input, output, trace | + +## Design language + +Follow [docs/design-language.md](../../../docs/design-language.md). Zone 1 shows **Embedded** runtime mode. diff --git a/apps/loop/android-compose/app/build.gradle.kts b/apps/loop/android-compose/app/build.gradle.kts new file mode 100644 index 0000000..b62a096 --- /dev/null +++ b/apps/loop/android-compose/app/build.gradle.kts @@ -0,0 +1,75 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.plugin.serialization") + id("org.jetbrains.kotlin.plugin.compose") +} + +android { + namespace = "com.traverseframework.loop" + compileSdk = 35 + + defaultConfig { + applicationId = "com.traverseframework.loop" + minSdk = 28 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + + buildFeatures { + compose = true + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + val composeBom = platform("androidx.compose:compose-bom:2024.10.01") + implementation(composeBom) + androidTestImplementation(composeBom) + + implementation("androidx.core:core-ktx:1.15.0") + implementation("androidx.activity:activity-compose:1.9.3") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") + implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7") + implementation("androidx.lifecycle:lifecycle-runtime-compose:2.8.7") + implementation("androidx.navigation:navigation-compose:2.8.4") + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.material3:material3") + implementation("androidx.datastore:datastore-preferences:1.1.1") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3") + + // Public Traverse Kotlin embedder (composite via settings.gradle.kts + TRAVERSE_REPO) + implementation(project(":traverse-embedder")) + + debugImplementation("androidx.compose.ui:ui-tooling") + + testImplementation("junit:junit:4.13.2") + testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0") +} diff --git a/apps/loop/android-compose/app/proguard-rules.pro b/apps/loop/android-compose/app/proguard-rules.pro new file mode 100644 index 0000000..60ba34d --- /dev/null +++ b/apps/loop/android-compose/app/proguard-rules.pro @@ -0,0 +1 @@ +# traverse-starter Android — default keep rules diff --git a/apps/loop/android-compose/app/src/main/AndroidManifest.xml b/apps/loop/android-compose/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..941c93e --- /dev/null +++ b/apps/loop/android-compose/app/src/main/AndroidManifest.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/app.manifest.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/app.manifest.json new file mode 100644 index 0000000..858009d --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/app.manifest.json @@ -0,0 +1,163 @@ +{ + "app_id": "loop", + "version": "1.0.0", + "schema_version": "1.0.0", + "workspace_defaults": { + "workspace_id": "local-default", + "registry_scope": "private" + }, + "components": [ + { + "component_id": "loop.process-component", + "version": "1.0.0", + "digest": "sha256:ec192a0c2104b08bee76418c5c6d44358036568d655d8465e506858d1aaadbf2", + "manifest_path": "components/process/component.manifest.json" + }, + { + "component_id": "loop.extract-component", + "version": "1.0.0", + "digest": "sha256:1f815c8debd26d9f17cc895e49154e204b05b637df6d66760c59002f1ef0a503", + "manifest_path": "components/extract/component.manifest.json" + }, + { + "component_id": "loop.normalize-component", + "version": "1.0.0", + "digest": "sha256:6bb5c6300710de6090c4b5f25d611a6a6af7d2dd9e1bacb3bdb01b166110b5ad", + "manifest_path": "components/normalize/component.manifest.json" + }, + { + "component_id": "loop.authorize-component", + "version": "1.0.0", + "digest": "sha256:0c318fff56a74eddfbc1ab850c25c1ba191744309984a07bd503b8cd9cb92e40", + "manifest_path": "components/authorize/component.manifest.json" + } + ], + "workflows": [ + { + "workflow_id": "loop.wf1", + "workflow_version": "1.0.0", + "path": "_traverse/workflows/examples/loop/wf1/workflow.json" + } + ], + "model_dependencies": [], + "config_schema": { + "type": "object", + "required": [ + "workspace_id" + ], + "properties": { + "workspace_id": { + "type": "string" + }, + "processing_mode": { + "type": "string", + "enum": [ + "deterministic" + ] + } + }, + "additionalProperties": false + }, + "default_config": { + "workspace_id": "local-default", + "processing_mode": "deterministic" + }, + "placement_policy": { + "preferred_targets": [ + "local" + ], + "allow_fallback": false + }, + "public_surfaces": [ + "cli", + "http_json" + ], + "state_machine": { + "initial_state": "idle", + "list_context_fields": [ + "output.ingest.action_items", + "output.ingest.decisions", + "output.ingest.follow_ups", + "output.ingest.summary", + "output.extract.action_items", + "output.extract.needs_human_review", + "output.extract.reason_code", + "output.normalize", + "output.authorize.decision", + "output.authorize.reason", + "output.authorize.reason_code" + ], + "states": [ + { + "id": "idle", + "transitions": [ + { + "on": "submit", + "to": "processing" + } + ] + }, + { + "id": "processing", + "invoke": { + "capability_id": "loop.wf1", + "input_from": "command.payload" + }, + "transitions": [ + { + "on": "capability_succeeded", + "to": "review" + }, + { + "on": "waiting_for_human", + "to": "review" + }, + { + "on": "capability_failed", + "to": "error" + } + ] + }, + { + "id": "review", + "transitions": [ + { + "on": "accept", + "to": "results" + }, + { + "on": "reject", + "to": "idle" + }, + { + "on": "reset", + "to": "idle" + } + ] + }, + { + "id": "results", + "transitions": [ + { + "on": "reset", + "to": "idle" + } + ] + }, + { + "id": "error", + "transitions": [ + { + "on": "retry", + "to": "processing", + "with_last_payload": true + }, + { + "on": "reset", + "to": "idle" + } + ] + } + ] + } +} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/authorize/component.manifest.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/authorize/component.manifest.json new file mode 100644 index 0000000..3d5d68c --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/authorize/component.manifest.json @@ -0,0 +1,28 @@ +{ + "component_id": "loop.authorize-component", + "version": "1.0.0", + "schema_version": "1.0.0", + "capability_id": "core.authorize", + "capability_version": "1.2.0", + "runtime_constraints": { + "host_api_access": "none", + "network_access": "forbidden", + "filesystem_access": "none" + }, + "permitted_targets": [ + "local", + "device" + ], + "dependencies": [], + "connector_requirements": [], + "validation_evidence": [ + { + "evidence_type": "checked_in_fixture", + "status": "passed", + "produced_by": "loop_wf1_registry_deps" + } + ], + "contract_path": "../../_traverse/examples/core-authorize/contract.json", + "wasm_binary_path": "../../_traverse/examples/core-authorize/artifacts/core-authorize.wasm", + "wasm_digest": "sha256:0c318fff56a74eddfbc1ab850c25c1ba191744309984a07bd503b8cd9cb92e40" +} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/extract/component.manifest.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/extract/component.manifest.json new file mode 100644 index 0000000..56b0096 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/extract/component.manifest.json @@ -0,0 +1,28 @@ +{ + "component_id": "loop.extract-component", + "version": "1.0.0", + "schema_version": "1.0.0", + "capability_id": "core.extract-action-items", + "capability_version": "1.2.0", + "runtime_constraints": { + "host_api_access": "none", + "network_access": "forbidden", + "filesystem_access": "none" + }, + "permitted_targets": [ + "local", + "device" + ], + "dependencies": [], + "connector_requirements": [], + "validation_evidence": [ + { + "evidence_type": "checked_in_fixture", + "status": "passed", + "produced_by": "loop_wf1_registry_deps" + } + ], + "contract_path": "../../_traverse/examples/core-extract-action-items/contract.json", + "wasm_binary_path": "../../_traverse/examples/core-extract-action-items/artifacts/core-extract-action-items.wasm", + "wasm_digest": "sha256:1f815c8debd26d9f17cc895e49154e204b05b637df6d66760c59002f1ef0a503" +} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/normalize/component.manifest.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/normalize/component.manifest.json new file mode 100644 index 0000000..8654084 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/normalize/component.manifest.json @@ -0,0 +1,28 @@ +{ + "component_id": "loop.normalize-component", + "version": "1.0.0", + "schema_version": "1.0.0", + "capability_id": "core.normalize-participants", + "capability_version": "1.1.0", + "runtime_constraints": { + "host_api_access": "none", + "network_access": "forbidden", + "filesystem_access": "none" + }, + "permitted_targets": [ + "local", + "device" + ], + "dependencies": [], + "connector_requirements": [], + "validation_evidence": [ + { + "evidence_type": "checked_in_fixture", + "status": "passed", + "produced_by": "loop_wf1_registry_deps" + } + ], + "contract_path": "../../_traverse/examples/core-normalize-participants/contract.json", + "wasm_binary_path": "../../_traverse/examples/core-normalize-participants/artifacts/core-normalize-participants.wasm", + "wasm_digest": "sha256:6bb5c6300710de6090c4b5f25d611a6a6af7d2dd9e1bacb3bdb01b166110b5ad" +} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/process/component.manifest.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/process/component.manifest.json new file mode 100644 index 0000000..e47525d --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/components/process/component.manifest.json @@ -0,0 +1,28 @@ +{ + "component_id": "loop.process-component", + "version": "1.0.0", + "schema_version": "1.0.0", + "capability_id": "meeting-notes.process", + "capability_version": "1.3.2", + "runtime_constraints": { + "host_api_access": "none", + "network_access": "forbidden", + "filesystem_access": "none" + }, + "permitted_targets": [ + "local", + "device" + ], + "dependencies": [], + "connector_requirements": [], + "validation_evidence": [ + { + "evidence_type": "checked_in_fixture", + "status": "passed", + "produced_by": "loop_wf1_registry_deps" + } + ], + "contract_path": "../../_traverse/contracts/examples/meeting-notes/capabilities/process/contract.json", + "wasm_binary_path": "../../_traverse/examples/meeting-notes/process-agent/artifacts/process-agent.wasm", + "wasm_digest": "sha256:bddc4423a5ae611b5606886d5b0b9c87bbfb39fff2826724f6c34850d88020f6" +} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/workflows/wf1/workflow.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/workflows/wf1/workflow.json new file mode 100644 index 0000000..fdf0d48 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/manifests/workflows/wf1/workflow.json @@ -0,0 +1,149 @@ +{ + "kind": "workflow_definition", + "schema_version": "1.0.0", + "id": "loop.wf1", + "name": "wf1", + "version": "1.0.0", + "lifecycle": "active", + "owner": { + "team": "traverse-core", + "contact": "enrico.piovesan10@gmail.com" + }, + "summary": "Loop WF1 \u2014 ingest transcript, extract action items, normalize participants, authorize follow-through.", + "inputs": { + "schema": { + "type": "object", + "required": [ + "transcript" + ], + "properties": { + "transcript": { + "type": "string" + } + }, + "additionalProperties": true + } + }, + "outputs": { + "schema": { + "type": "object", + "additionalProperties": true + } + }, + "nodes": [ + { + "node_id": "ingest", + "capability_id": "meeting-notes.process", + "capability_version": "1.3.2", + "input": { + "from_workflow_input": [ + "transcript" + ] + }, + "output": { + "to_workflow_state": [ + "action_items", + "decisions", + "follow_ups", + "summary" + ], + "publish_to_state_as": "ingest" + } + }, + { + "node_id": "extract", + "capability_id": "core.extract-action-items", + "capability_version": "1.2.0", + "input": { + "from_workflow_input": [ + "transcript" + ], + "from_workflow_state": [ + "ingest" + ] + }, + "output": { + "to_workflow_state": [ + "action_items", + "needs_human_review", + "rejected_candidates", + "reason_code", + "evaluation_trace" + ], + "publish_to_state_as": "extract" + } + }, + { + "node_id": "normalize", + "capability_id": "core.normalize-participants", + "capability_version": "1.1.0", + "input": { + "from_workflow_state": [ + "extract", + "ingest" + ] + }, + "output": { + "to_workflow_state": [], + "publish_to_state_as": "normalize" + } + }, + { + "node_id": "authorize", + "capability_id": "core.authorize", + "capability_version": "1.2.0", + "input": { + "from_workflow_state": [ + "extract", + "normalize" + ] + }, + "output": { + "to_workflow_state": [ + "decision", + "reason", + "reason_code", + "matched_rules", + "obligations", + "break_glass_used" + ], + "publish_to_state_as": "authorize" + } + } + ], + "edges": [ + { + "edge_id": "ingest_to_extract", + "from": "ingest", + "to": "extract", + "trigger": "direct" + }, + { + "edge_id": "extract_to_normalize", + "from": "extract", + "to": "normalize", + "trigger": "direct" + }, + { + "edge_id": "normalize_to_authorize", + "from": "normalize", + "to": "authorize", + "trigger": "direct" + } + ], + "start_node": "ingest", + "terminal_nodes": [ + "authorize" + ], + "output_projection": [ + "ingest", + "extract", + "normalize", + "authorize" + ], + "tags": [ + "loop", + "wf1" + ], + "governing_spec": "003-loop-wf1-reference-app" +} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime-release.json b/apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime-release.json new file mode 100644 index 0000000..b3354d7 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime-release.json @@ -0,0 +1 @@ +{"runtime_version":"0.8.1","bridge_version":"1.1.0","bridge_abi_version":10100,"sha256":"aa801023ba4eb20b8c1b4004bdd964a78fed9540478b252b77eac04c80811852"} diff --git a/apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime.wasm b/apps/loop/android-compose/app/src/main/assets/bundles/loop/runtime/runtime.wasm new file mode 100644 index 0000000000000000000000000000000000000000..9587c31e71e17ac8e0b51f19008a7f484f9d0d1b GIT binary patch literal 993 zcmb7D!EVz)5S>{&N$I9(tMotxQiGEtJ#axNCoCkyx#I3@>{YU@y|(OiN>oMeAMi_Q zQ*q$Hg7@Rp70k*ls2=N%J{_XC@ajnHMq`=PH`WK#Wyj0hMaNPR)uq zPD5ZvH4w=STg*xyNAsW=9{{}tO^=s^!(GrIZiWslK{H^Kk$4fru) z)rS|@C+>1UDo$Jndd$CFf`4`dG{G*F0TQ$%Xa#HR0{S%E_wHM=T;75I-NHCP9}hV( zxMl9a|6&=pWS#g7E>19(95NW z=H5$B=6RZXLtV!4f=o#Dj#RR+FE>z;RhHVQM4oTK^H+4Lwh>_{Gb5vao$i2tyz$ID zljLFbG6<(aPuAK;8$`kgZ@9^84Jd?Gdg3i?$a~-)YU@yB^gYJP%mbxo>D7PvukBXA zFLv4GvM6I?pZ2kF{7##eCMyl)UaXBDfS>#|^1`H9M)4N##?>N`*hFyX2s?Ga0gMnc XhMF-zO-mv%YIPX6Qz + destDir.outputStream().use { output -> input.copyTo(output) } + } + return + } + destDir.mkdirs() + for (child in children) { + val childAsset = "$assetPath/$child" + val childDest = File(destDir, child) + val grand = context.assets.list(childAsset) + if (grand.isNullOrEmpty()) { + context.assets.open(childAsset).use { input -> + childDest.outputStream().use { output -> input.copyTo(output) } + } + } else { + copyAssetTree(context, childAsset, childDest) + } + } + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/EmbeddedHost.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/EmbeddedHost.kt new file mode 100644 index 0000000..c4cceac --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/EmbeddedHost.kt @@ -0,0 +1,168 @@ +package com.traverseframework.loop + +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.buildJsonObject +import kotlinx.serialization.json.put +import java.io.File + +/** + * Embedded Traverse host for loop. + * + * Production uses the public Kotlin `dev.traverse.embedder` package. + * Unit tests inject [InMemoryLoopHost] with scripted runtime-owned output. + */ +interface LoopHost { + val runtimeMode: String + val isReady: Boolean + fun submitTranscript(transcript: String): HostRunResult +} + +data class HostRunResult( + val sessionId: String, + val output: LoopOutput?, + val events: List, + val error: String?, + val presentationState: PresentationState = PresentationState.Idle, + val presentationError: String? = null, + val capabilityProgress: List = emptyList(), + val activeCapabilityId: String? = null, +) { + fun withPresentation(likes: List): HostRunResult { + val snap = PresentationMapper.mapPresentationState(likes) + val state = + if (error != null && snap.state == PresentationState.Idle) { + PresentationState.Error + } else { + snap.state + } + return copy( + presentationState = state, + presentationError = snap.errorMessage + ?: if (error != null && snap.state == PresentationState.Idle) error else null, + capabilityProgress = PresentationMapper.mapCapabilityProgress(likes), + activeCapabilityId = PresentationMapper.activeCapabilityId(likes), + ) + } +} + +/** Deterministic test double wrapping [dev.traverse.embedder.InMemoryTraverseEmbedder]. */ +class InMemoryLoopHost( + private val scriptedOutputJson: String, +) : LoopHost { + override val runtimeMode: String = AppConstants.RUNTIME_MODE_EMBEDDED + override val isReady: Boolean = true + + private val embedder = dev.traverse.embedder.InMemoryTraverseEmbedder() + .withTargetOutput(scriptedOutputJson) + .also { + it.initialize( + dev.traverse.embedder.TraverseBundle( + rootPath = "test-bundle", + runtimeWasmDigest = "sha256:test", + ), + ) + } + + override fun submitTranscript(transcript: String): HostRunResult { + val inputJson = buildJsonObject { put("transcript", transcript) }.toString() + val result = embedder.submit( + dev.traverse.embedder.TraverseSubmission(AppConstants.CAPABILITY_ID, inputJson), + ) + val events = embedder.subscribe() + val outputJson = events.firstOrNull { it.eventType == "capability_result" }?.output + val output = outputJson?.let { parseOutput(it) } + return HostRunResult( + sessionId = result.sessionId, + output = output, + events = events.map { + TraceEvent( + event_type = it.eventType ?: it.status, + timestamp = it.sequence.toString(), + data = null, + ) + }, + error = if (output == null) "embedder emitted no capability_result output" else null, + ).withPresentation(emptyList()) + } + + companion object { + private val json = Json { ignoreUnknownKeys = true } + + fun parseOutput(raw: String): LoopOutput? = try { + json.decodeFromString(LoopOutput.serializer(), raw) + } catch (_: Exception) { + null + } + + fun withScriptedOutput(output: LoopOutput): InMemoryLoopHost = + InMemoryLoopHost(json.encodeToString(LoopOutput.serializer(), output)) + } +} + +/** + * Production host: digest-pinned `runtime/runtime.wasm` via public [RuntimeTraverseEmbedder] + * constructed from [TraverseBundle] (public constructor). + */ +class ProductionLoopHost private constructor( + private val embedder: dev.traverse.embedder.RuntimeTraverseEmbedder, +) : LoopHost { + override val runtimeMode: String = AppConstants.RUNTIME_MODE_EMBEDDED + override val isReady: Boolean = true + + override fun submitTranscript(transcript: String): HostRunResult = try { + val inputJson = buildJsonObject { put("transcript", transcript) }.toString() + val result = embedder.submit( + dev.traverse.embedder.TraverseSubmission(AppConstants.CAPABILITY_ID, inputJson), + ) + val runtimeEvents = embedder.subscribe() + val events = runtimeEvents.map { + TraceEvent( + event_type = it.eventType ?: it.status, + timestamp = it.sequence.toString(), + data = null, + ) + } + val output = runtimeEvents + .firstOrNull { it.eventType == "capability_result" || it.output != null } + ?.output + ?.let { InMemoryLoopHost.parseOutput(it) } + HostRunResult( + sessionId = result.sessionId, + output = output, + events = events, + error = if (output == null) { + "runtime returned no loop output" + } else { + null + }, + ).withPresentation(emptyList()) + } catch (e: Exception) { + HostRunResult("", null, emptyList(), e.message ?: "submit failed") + .withPresentation(emptyList()) + } + + companion object { + fun createOrNull(bundleRoot: File): ProductionLoopHost? { + val wasm = File(bundleRoot, "runtime/runtime.wasm") + val release = File(bundleRoot, "runtime/runtime-release.json") + if (!wasm.isFile || !release.isFile) return null + val digestHex = Regex("\"sha256\"\\s*:\\s*\"([^\"]+)\"") + .find(release.readText()) + ?.groupValues + ?.get(1) + ?: return null + return try { + val bundle = dev.traverse.embedder.TraverseBundle( + rootPath = bundleRoot.absolutePath, + runtimeWasmDigest = "sha256:$digestHex", + ) + val embedder = dev.traverse.embedder.RuntimeTraverseEmbedder(bundle) + embedder.initialize("{}") + ProductionLoopHost(embedder) + } catch (_: Exception) { + null + } + } + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionUiState.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionUiState.kt new file mode 100644 index 0000000..45d360e --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionUiState.kt @@ -0,0 +1,31 @@ +package com.traverseframework.loop + +sealed interface ExecutionPhase { + data object Idle : ExecutionPhase + data object Loading : ExecutionPhase + data class Succeeded(val output: LoopOutput, val trace: List) : ExecutionPhase + data class Failed(val error: String) : ExecutionPhase +} + +enum class RuntimeStatus { + Starting, + Ready, + Unavailable, +} + +data class ExecutionUiState( + val phase: ExecutionPhase = ExecutionPhase.Idle, + val transcript: String = "", + val runtimeStatus: RuntimeStatus = RuntimeStatus.Starting, + val runtimeMode: String = AppConstants.RUNTIME_MODE_EMBEDDED, + val workspace: String = AppConstants.DEFAULT_WORKSPACE, + val showTrace: Boolean = false, +) { + val isRunning: Boolean + get() = phase is ExecutionPhase.Loading + + val canSubmit: Boolean + get() = runtimeStatus == RuntimeStatus.Ready && + transcript.trim().isNotEmpty() && + !isRunning +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModel.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModel.kt new file mode 100644 index 0000000..3f1388b --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModel.kt @@ -0,0 +1,75 @@ +package com.traverseframework.loop + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.Job +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext + +class ExecutionViewModel( + private val host: LoopHost, + private val settings: RuntimeSettings, + private val computeDispatcher: CoroutineDispatcher = Dispatchers.Default, +) : ViewModel() { + private val _uiState = MutableStateFlow( + ExecutionUiState( + runtimeStatus = if (host.isReady) RuntimeStatus.Ready else RuntimeStatus.Unavailable, + runtimeMode = host.runtimeMode, + workspace = AppConstants.DEFAULT_WORKSPACE, + ), + ) + val uiState: StateFlow = _uiState.asStateFlow() + + private var submitJob: Job? = null + + init { + viewModelScope.launch { + settings.workspace.collect { workspace -> + _uiState.update { it.copy(workspace = workspace) } + } + } + } + + fun updateTranscript(transcript: String) { + _uiState.update { it.copy(transcript = transcript.take(AppConstants.TRANSCRIPT_MAX_LENGTH)) } + } + + fun toggleTrace(show: Boolean) { + _uiState.update { it.copy(showTrace = show) } + } + + fun submit() { + val state = _uiState.value + if (!state.canSubmit) return + submitJob?.cancel() + _uiState.update { it.copy(phase = ExecutionPhase.Loading) } + val transcript = state.transcript.trim() + submitJob = viewModelScope.launch { + val result = withContext(computeDispatcher) { host.submitTranscript(transcript) } + if (result.error != null && result.output == null) { + _uiState.update { it.copy(phase = ExecutionPhase.Failed(result.error)) } + } else { + _uiState.update { + it.copy( + phase = ExecutionPhase.Succeeded( + result.output ?: LoopOutput.EMPTY, + result.events, + ), + ) + } + } + } + } + + fun reset() { + submitJob?.cancel() + submitJob = null + _uiState.update { it.copy(phase = ExecutionPhase.Idle, showTrace = false) } + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModelFactory.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModelFactory.kt new file mode 100644 index 0000000..6e32bbd --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ExecutionViewModelFactory.kt @@ -0,0 +1,17 @@ +package com.traverseframework.loop + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.ViewModelProvider + +class ExecutionViewModelFactory( + private val host: LoopHost, + private val settings: RuntimeSettings, +) : ViewModelProvider.Factory { + @Suppress("UNCHECKED_CAST") + override fun create(modelClass: Class): T { + if (modelClass.isAssignableFrom(ExecutionViewModel::class.java)) { + return ExecutionViewModel(host, settings) as T + } + throw IllegalArgumentException("Unknown ViewModel class") + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/MainActivity.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/MainActivity.kt new file mode 100644 index 0000000..1d3cfe9 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/MainActivity.kt @@ -0,0 +1,63 @@ +package com.traverseframework.loop + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.getValue +import androidx.lifecycle.compose.collectAsStateWithLifecycle +import androidx.lifecycle.viewmodel.compose.viewModel +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController +import com.traverseframework.loop.ui.MainScreen +import com.traverseframework.loop.ui.LoopTheme +import com.traverseframework.loop.ui.SettingsScreen + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + val settings = SettingsRepository(applicationContext) + val bundleRoot = BundleAssets.materialize(applicationContext) + val host: LoopHost = ProductionLoopHost.createOrNull(bundleRoot) + ?: UnavailableLoopHost + setContent { + LoopTheme { + val navController = rememberNavController() + val viewModel: ExecutionViewModel = viewModel( + factory = ExecutionViewModelFactory(host, settings), + ) + val uiState by viewModel.uiState.collectAsStateWithLifecycle() + + NavHost(navController = navController, startDestination = "main") { + composable("main") { + MainScreen( + uiState = uiState, + onTranscriptChange = viewModel::updateTranscript, + onSubmit = viewModel::submit, + onReset = viewModel::reset, + onOpenSettings = { navController.navigate("settings") }, + onTraceToggle = viewModel::toggleTrace, + ) + } + composable("settings") { + SettingsScreen( + settings = settings, + currentWorkspace = uiState.workspace, + onBack = { navController.popBackStack() }, + ) + } + } + } + } + } +} + +/** Fallback when the digest-pinned runtime bundle is missing from assets. */ +object UnavailableLoopHost : LoopHost { + override val runtimeMode: String = AppConstants.RUNTIME_MODE_EMBEDDED + override val isReady: Boolean = false + override fun submitTranscript(transcript: String): HostRunResult = + HostRunResult("", null, emptyList(), "embedded runtime unavailable - sync the app bundle") +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/Models.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/Models.kt new file mode 100644 index 0000000..2f53d34 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/Models.kt @@ -0,0 +1,49 @@ +package com.traverseframework.loop + +import kotlinx.serialization.json.JsonElement + +@kotlinx.serialization.Serializable +data class ActionItem( + val task: String, + val owner: String? = null, + val due: String? = null, +) + +@kotlinx.serialization.Serializable +data class Decision( + val text: String, + val made_by: String? = null, +) + +@kotlinx.serialization.Serializable +data class LoopOutput( + val action_items: List, + val decisions: List, + val follow_ups: List, + val summary: String, +) { + companion object { + val EMPTY = LoopOutput( + action_items = emptyList(), + decisions = emptyList(), + follow_ups = emptyList(), + summary = "", + ) + } +} + +@kotlinx.serialization.Serializable +data class TraceEvent( + val event_type: String, + val timestamp: String, + val data: JsonElement? = null, +) + +object AppConstants { + const val CAPABILITY_ID = "loop.wf1" + const val RUNTIME_MODE_EMBEDDED = "Embedded" + const val DEFAULT_WORKSPACE = "local-default" + const val TRANSCRIPT_MAX_LENGTH = 5000 + /** Asset-relative bundle root (must include runtime/runtime.wasm after sync). */ + const val BUNDLE_ASSET_DIR = "bundles/loop" +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/PresentationMapper.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/PresentationMapper.kt new file mode 100644 index 0000000..722184d --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/PresentationMapper.kt @@ -0,0 +1,209 @@ +package com.traverseframework.loop + +import kotlinx.serialization.json.JsonElement +import kotlinx.serialization.json.JsonNull +import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.booleanOrNull +import kotlinx.serialization.json.contentOrNull +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive + +/** Canonical UI presentation states (Spec 001). */ +enum class PresentationState { + Idle, + Loading, + Loaded, + Blocked, + Ended, + Error, + ; + + fun asWire(): String = when (this) { + Idle -> "idle" + Loading -> "loading" + Loaded -> "loaded" + Blocked -> "blocked" + Ended -> "ended" + Error -> "error" + } +} + +data class PresentationSnapshot( + val state: PresentationState, + val errorMessage: String?, + val output: JsonElement?, +) + +enum class CapabilityPhase { + Invoked, + Result, + ; + + fun asWire(): String = when (this) { + Invoked -> "invoked" + Result -> "result" + } +} + +data class CapabilityProgressStep( + val capabilityId: String, + val phase: CapabilityPhase, + val sequence: Long, + val status: String?, + val output: JsonElement?, +) + +/** Minimal embedder event fields required by the mapper. */ +data class EmbedderEventLike( + val eventType: String, + val sequence: Long, + val data: JsonObject, +) + +/** + * Spec 001/002 presentation + capability progress (language-equivalent of + * `packages/event-ui-conformance`). + */ +object PresentationMapper { + private val blockedStates = setOf( + "blocked", + "waiting", + "waiting_for_human", + "awaiting_human", + "awaiting_input", + ) + private val endedStates = setOf("cancelled", "canceled", "closed", "ended") + + fun mapPresentationState(events: List): PresentationSnapshot { + if (events.isEmpty()) { + return PresentationSnapshot(PresentationState.Idle, null, null) + } + + var state = PresentationState.Idle + var errorMessage: String? = null + var output: JsonElement? = null + + for (event in events) { + when (event.eventType) { + "error" -> { + state = PresentationState.Error + errorMessage = errorMessageFromData(event.data) ?: "execution failed" + } + "capability_invoked" -> { + if (state != PresentationState.Error) { + state = PresentationState.Loading + } + } + "state_changed" -> { + if (state == PresentationState.Error) continue + state = when { + isBlockedPayload(event.data) -> PresentationState.Blocked + isEndedStatePayload(event.data) -> PresentationState.Ended + state != PresentationState.Loaded && state != PresentationState.Ended -> + PresentationState.Loading + else -> state + } + } + "capability_result" -> { + if (state == PresentationState.Error) continue + if (hasRenderableOutput(event.data)) { + state = PresentationState.Loaded + output = event.data["output"] + } else { + state = PresentationState.Ended + output = null + } + } + } + } + + return PresentationSnapshot(state, errorMessage, output) + } + + fun mapCapabilityProgress(events: List): List { + val steps = mutableListOf() + for (event in events) { + val capabilityId = stringField(event.data, "capability_id") ?: continue + when (event.eventType) { + "capability_invoked" -> steps.add( + CapabilityProgressStep( + capabilityId = capabilityId, + phase = CapabilityPhase.Invoked, + sequence = event.sequence, + status = null, + output = null, + ), + ) + "capability_result" -> steps.add( + CapabilityProgressStep( + capabilityId = capabilityId, + phase = CapabilityPhase.Result, + sequence = event.sequence, + status = stringField(event.data, "status"), + output = event.data["output"], + ), + ) + } + } + return steps + } + + fun activeCapabilityId(events: List): String? { + val progress = mapCapabilityProgress(events) + val open = mutableMapOf() + for (step in progress) { + when (step.phase) { + CapabilityPhase.Invoked -> open[step.capabilityId] = (open[step.capabilityId] ?: 0) + 1 + CapabilityPhase.Result -> { + val count = open[step.capabilityId] ?: 0 + if (count <= 1) open.remove(step.capabilityId) + else open[step.capabilityId] = count - 1 + } + } + } + for (step in progress.asReversed()) { + if (step.phase == CapabilityPhase.Invoked && open.containsKey(step.capabilityId)) { + return step.capabilityId + } + } + return null + } + + private fun stringField(data: JsonObject, key: String): String? = + data[key]?.jsonPrimitive?.contentOrNull + + private fun errorMessageFromData(data: JsonObject): String? { + val err = data["error"] ?: return null + err.jsonPrimitive.contentOrNull?.let { return it } + return try { + err.jsonObject["message"]?.jsonPrimitive?.contentOrNull + } catch (_: Exception) { + null + } + } + + private fun runtimeStateToken(data: JsonObject): String? = + stringField(data, "state") + ?: stringField(data, "status") + ?: stringField(data, "runtime_state") + + private fun isBlockedPayload(data: JsonObject): Boolean { + if (data["blocked"]?.jsonPrimitive?.booleanOrNull == true) return true + if (data["waiting_for_human"]?.jsonPrimitive?.booleanOrNull == true) return true + val token = runtimeStateToken(data)?.lowercase() ?: return false + return token in blockedStates + } + + private fun isEndedStatePayload(data: JsonObject): Boolean { + val token = runtimeStateToken(data)?.lowercase() ?: return false + return token in endedStates + } + + private fun hasRenderableOutput(data: JsonObject): Boolean { + if (!data.containsKey("output")) return false + val output = data["output"] + if (output == null || output is JsonNull) return false + if (output is JsonObject && output.isEmpty()) return false + return true + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/SettingsRepository.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/SettingsRepository.kt new file mode 100644 index 0000000..86a888a --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/SettingsRepository.kt @@ -0,0 +1,29 @@ +package com.traverseframework.loop + +import android.content.Context +import androidx.datastore.core.DataStore +import androidx.datastore.preferences.core.Preferences +import androidx.datastore.preferences.core.edit +import androidx.datastore.preferences.core.stringPreferencesKey +import androidx.datastore.preferences.preferencesDataStore +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.map + +interface RuntimeSettings { + val workspace: Flow + suspend fun setWorkspace(workspace: String) +} + +private val Context.settingsDataStore: DataStore by preferencesDataStore(name = "loop_settings") + +class SettingsRepository(private val context: Context) : RuntimeSettings { + private val workspaceKey = stringPreferencesKey("workspace") + + override val workspace: Flow = context.settingsDataStore.data.map { prefs -> + prefs[workspaceKey] ?: AppConstants.DEFAULT_WORKSPACE + } + + override suspend fun setWorkspace(workspace: String) { + context.settingsDataStore.edit { it[workspaceKey] = workspace } + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/MainScreen.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/MainScreen.kt new file mode 100644 index 0000000..a49a071 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/MainScreen.kt @@ -0,0 +1,243 @@ +package com.traverseframework.loop.ui + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Button +import androidx.compose.material3.Card +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import com.traverseframework.loop.ActionItem +import com.traverseframework.loop.AppConstants +import com.traverseframework.loop.Decision +import com.traverseframework.loop.ExecutionPhase +import com.traverseframework.loop.ExecutionUiState +import com.traverseframework.loop.LoopOutput +import com.traverseframework.loop.RuntimeStatus + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun MainScreen( + uiState: ExecutionUiState, + onTranscriptChange: (String) -> Unit, + onSubmit: () -> Unit, + onReset: () -> Unit, + onOpenSettings: () -> Unit, + onTraceToggle: (Boolean) -> Unit, +) { + Scaffold( + topBar = { + TopAppBar( + title = { Text("loop") }, + actions = { + Row( + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.padding(end = 12.dp), + ) { + StatusDot(uiState.runtimeStatus) + Text( + text = statusLabel(uiState.runtimeStatus), + style = MaterialTheme.typography.labelMedium, + modifier = Modifier.padding(start = 8.dp), + ) + Button(onClick = onOpenSettings, modifier = Modifier.padding(start = 8.dp)) { + Text("Settings") + } + } + }, + ) + }, + ) { padding -> + Column( + modifier = Modifier + .fillMaxSize() + .padding(padding) + .padding(16.dp) + .verticalScroll(rememberScrollState()), + verticalArrangement = Arrangement.spacedBy(16.dp), + ) { + RuntimeCard(uiState) + InputCard(uiState, onTranscriptChange, onSubmit) + OutputCard(uiState, onReset, onTraceToggle) + } + } +} + +@Composable +private fun RuntimeCard(uiState: ExecutionUiState) { + Card(modifier = Modifier.fillMaxWidth()) { + Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { + Text("Runtime Environment", style = MaterialTheme.typography.titleMedium) + Text("mode: ${uiState.runtimeMode}", style = MaterialTheme.typography.bodySmall) + Text("workspace: ${uiState.workspace}", style = MaterialTheme.typography.bodySmall) + Text("capability: ${AppConstants.CAPABILITY_ID}", style = MaterialTheme.typography.bodySmall) + } + } +} + +@Composable +private fun InputCard( + uiState: ExecutionUiState, + onTranscriptChange: (String) -> Unit, + onSubmit: () -> Unit, +) { + Card(modifier = Modifier.fillMaxWidth()) { + Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { + Text("Process Transcript", style = MaterialTheme.typography.titleMedium) + OutlinedTextField( + value = uiState.transcript, + onValueChange = onTranscriptChange, + modifier = Modifier + .fillMaxWidth() + .height(140.dp), + placeholder = { Text("Paste meeting transcript...") }, + ) + Text("${uiState.transcript.length}/${AppConstants.TRANSCRIPT_MAX_LENGTH}") + Button(onClick = onSubmit, enabled = uiState.canSubmit, modifier = Modifier.fillMaxWidth()) { + Text(if (uiState.isRunning) "Processing..." else "Submit Transcript") + } + if (uiState.runtimeStatus == RuntimeStatus.Unavailable) { + Text( + "Embedded runtime unavailable - sync the bundle with scripts/ci/sync_android_loop_bundle.sh (requires TRAVERSE_REPO).", + style = MaterialTheme.typography.bodySmall, + ) + } + } + } +} + +@Composable +private fun OutputCard( + uiState: ExecutionUiState, + onReset: () -> Unit, + onTraceToggle: (Boolean) -> Unit, +) { + Card(modifier = Modifier.fillMaxWidth()) { + Column(modifier = Modifier.padding(16.dp), verticalArrangement = Arrangement.spacedBy(8.dp)) { + Text("Output", style = MaterialTheme.typography.titleMedium) + when (val phase = uiState.phase) { + ExecutionPhase.Idle -> { + Text( + if (uiState.runtimeStatus == RuntimeStatus.Unavailable) { + "Initialize the embedded runtime to see loop output here." + } else { + "Submit a transcript above to run loop.wf1." + }, + style = MaterialTheme.typography.bodyMedium, + ) + } + ExecutionPhase.Loading -> Text("Running embedded workflow...") + is ExecutionPhase.Failed -> Text("Error: ${phase.error}", color = MaterialTheme.colorScheme.error) + is ExecutionPhase.Succeeded -> { + OutputFields(phase.output) + if (phase.trace.isNotEmpty()) { + Button(onClick = { onTraceToggle(!uiState.showTrace) }) { + Text("Trace (${phase.trace.size} events)") + } + if (uiState.showTrace) { + phase.trace.forEach { event -> + Text("${event.timestamp} - ${event.event_type}", style = MaterialTheme.typography.bodySmall) + } + } + } + Button(onClick = onReset) { Text("Reset") } + } + } + } + } +} + +@Composable +private fun OutputFields(output: LoopOutput) { + ActionItemsSection(output.action_items) + Spacer(modifier = Modifier.height(8.dp)) + DecisionsSection(output.decisions) + Spacer(modifier = Modifier.height(8.dp)) + StringListSection("Follow-ups", output.follow_ups) + Spacer(modifier = Modifier.height(8.dp)) + Text("Summary", style = MaterialTheme.typography.titleSmall) + Text(output.summary) +} + +@Composable +private fun ActionItemsSection(items: List) { + Text("Action Items", style = MaterialTheme.typography.titleSmall) + if (items.isEmpty()) { + Text("None recorded", color = MaterialTheme.colorScheme.onSurfaceVariant) + return + } + items.forEach { item -> + Text("- ${item.task}") + val details = listOfNotNull(item.owner, item.due?.let { "due $it" }) + if (details.isNotEmpty()) { + Text(details.joinToString(" | "), style = MaterialTheme.typography.bodySmall) + } + } +} + +@Composable +private fun DecisionsSection(items: List) { + Text("Decisions", style = MaterialTheme.typography.titleSmall) + if (items.isEmpty()) { + Text("None recorded", color = MaterialTheme.colorScheme.onSurfaceVariant) + return + } + items.forEach { item -> + Text("- ${item.text}") + item.made_by?.let { madeBy -> + Text("decided by $madeBy", style = MaterialTheme.typography.bodySmall) + } + } +} + +@Composable +private fun StringListSection(label: String, items: List) { + Text(label, style = MaterialTheme.typography.titleSmall) + if (items.isEmpty()) { + Text("None recorded", color = MaterialTheme.colorScheme.onSurfaceVariant) + return + } + items.forEach { item -> Text("- $item") } +} + +@Composable +private fun StatusDot(status: RuntimeStatus) { + val color = when (status) { + RuntimeStatus.Ready -> Color(0xFF06B6D4) + RuntimeStatus.Unavailable -> Color(0xFFEF4444) + RuntimeStatus.Starting -> Color.Gray + } + Box( + modifier = Modifier + .size(10.dp) + .clip(CircleShape) + .background(color), + ) +} + +private fun statusLabel(status: RuntimeStatus): String = when (status) { + RuntimeStatus.Ready -> "Ready" + RuntimeStatus.Unavailable -> "Unavailable" + RuntimeStatus.Starting -> "Starting..." +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/SettingsScreen.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/SettingsScreen.kt new file mode 100644 index 0000000..89d1617 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/SettingsScreen.kt @@ -0,0 +1,56 @@ +package com.traverseframework.loop.ui + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Button +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.traverseframework.loop.RuntimeSettings +import kotlinx.coroutines.launch + +@Composable +fun SettingsScreen( + settings: RuntimeSettings, + currentWorkspace: String, + onBack: () -> Unit, +) { + var workspace by remember(currentWorkspace) { mutableStateOf(currentWorkspace) } + val scope = rememberCoroutineScope() + + Column( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp), + verticalArrangement = Arrangement.spacedBy(12.dp), + ) { + Text("Embedded runtime settings") + Text("Runtime mode is Embedded - no HTTP sidecar URL.") + OutlinedTextField( + value = workspace, + onValueChange = { workspace = it }, + label = { Text("Workspace") }, + modifier = Modifier.fillMaxWidth(), + ) + Button( + onClick = { + scope.launch { + settings.setWorkspace(workspace.trim()) + onBack() + } + }, + modifier = Modifier.fillMaxWidth(), + ) { + Text("Save") + } + } +} diff --git a/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/Theme.kt b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/Theme.kt new file mode 100644 index 0000000..d724fae --- /dev/null +++ b/apps/loop/android-compose/app/src/main/java/com/traverseframework/loop/ui/Theme.kt @@ -0,0 +1,13 @@ +package com.traverseframework.loop.ui + +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable + +@Composable +fun LoopTheme(content: @Composable () -> Unit) { + MaterialTheme( + colorScheme = lightColorScheme(), + content = content, + ) +} diff --git a/apps/loop/android-compose/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/apps/loop/android-compose/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..99310e9 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/loop/android-compose/app/src/main/res/values/colors.xml b/apps/loop/android-compose/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..27c0ce3 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/res/values/colors.xml @@ -0,0 +1,5 @@ + + + #1E1B4B + #8B5CF6 + diff --git a/apps/loop/android-compose/app/src/main/res/values/strings.xml b/apps/loop/android-compose/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..c73c7f6 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + loop + diff --git a/apps/loop/android-compose/app/src/main/res/values/themes.xml b/apps/loop/android-compose/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..ca36c03 --- /dev/null +++ b/apps/loop/android-compose/app/src/main/res/values/themes.xml @@ -0,0 +1,3 @@ + +