Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 21 additions & 17 deletions .agents/skills/develop-lithe/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ framework conventions.
| `Sources/Lithe/Core/` | Platform-neutral ports and typed Rust operations |
| `Sources/Lithe/Platform/MacOS/` | macOS adapters and composition |
| `rust/lithe-core/` | Deterministic shared commands, models, validation, and C ABI |
| `windows/` | Native C++23, Win32 adapter, and Qt implementation |
| `windows/` | React/Tauri Windows product and Rust platform adapters |
| `shared/` | Cross-platform contracts and fixtures, not compiled implementation |
| `third_party/` | Upstream code; leave unchanged unless the task explicitly targets it |

macOS is the current reference product. Windows is an independent native
macOS is the current reference product. Windows is an independent React/Tauri
implementation and must not import Swift source or depend on macOS types.

## Preserve application boundaries
Expand All @@ -48,15 +48,16 @@ implementation and must not import Swift source or depend on macOS types.
`Process`, `Pipe`, `FileManager`, `FileHandle`, watchers, persistence stores,
or concrete `Mac*` adapters.
- Core and application code must remain free of SwiftUI, AppKit, CoreServices,
Win32, Qt, and concrete platform implementations.
Tauri, WebView2, Win32, and concrete platform implementations.
- `MacServiceContainer` is the macOS composition root. Platform capabilities
belong in `Sources/Lithe/Platform/MacOS/`.
- Deterministic behavior shared by both products belongs in `rust/lithe-core/`.
Native filesystem, process, terminal, runtime, security, persistence, and UI
behavior belongs in platform adapters.
- Windows application algorithms and services must not depend on Win32 or Qt.
Qt code must not include `core_client.h` directly, and public ports must not
expose Win32 handle types.
- Windows feature code must import `@/platform/tauri-core` instead of the Tauri
core API directly. Shared operations route through `lithe-core`; Windows-only
terminal, watcher, credential, process, and WebView behavior stays in the
Tauri host or a platform plugin.

## Keep shared contracts deterministic

Expand Down Expand Up @@ -103,15 +104,18 @@ the existing stack can reasonably avoid.
- Add tests in the owning crate for changes to commands, parsing, validation,
ordering, cancellation, or serialization.

### Windows C++ and Qt
### Windows React and Tauri

- Use C++23 and the existing CMake target boundaries. Use the Qt version pinned
in `.github/workflows/ci-windows.yml`.
- Keep Qt widget state in `windows/qt/`, application behavior in `windows/app/`,
Rust communication in `windows/core/`, and native behavior in
`windows/adapters/`.
- Add CTest coverage under `windows/tests/` for application, DTO, algorithm,
persistence, or adapter behavior that can be tested without manual UI work.
- Use Bun for frontend scripts and Tauri 2 for the Windows host. Keep React
feature code in `windows/tauri/src/features`, reusable UI in
`windows/tauri/src/ui`, the invoke boundary in
`windows/tauri/src/platform`, and native Rust behavior in
`windows/tauri/src-tauri`.
- Do not restore a parallel C++/Qt application layer or one Tauri command per
shared Core operation. Translate compatibility command names through the
central platform dispatcher.
- Add frontend tests for product behavior and Rust tests in the owning crate.
Verify WebView2, ConPTY, installer, signing, and updater behavior on Windows.

## Avoid hardcoded environment details

Expand All @@ -130,8 +134,8 @@ the existing stack can reasonably avoid.

- Do not silently discard errors. Return, translate, or log them at the layer
that has enough context to act on them.
- Preserve stable contract error categories when crossing Rust, Swift, C++, or
process boundaries.
- Preserve stable contract error categories when crossing Rust, Swift,
TypeScript, Tauri, or process boundaries.
- User-facing failures should be actionable without exposing credentials,
environment contents, or unnecessary internal details.
- Comments should explain non-obvious constraints or decisions, not narrate the
Expand All @@ -151,7 +155,7 @@ before handoff.
| Core feature behavior | `./scripts/verify-core.sh` |
| Git graph behavior | `./scripts/verify-git-graph.sh` |
| Windows boundaries from macOS/Linux | `./scripts/verify-windows-boundaries.sh` |
| Windows implementation on Windows | `./scripts/build-windows.ps1 -Configuration Release -BuildQt`, then `ctest --test-dir windows/build-windows -C Release --output-on-failure` |
| Windows implementation on Windows | `./scripts/build-windows.ps1 -Configuration Release`, then `cargo test --manifest-path windows/tauri/src-tauri/Cargo.toml` |

Also run tests for directly affected crates or targets. If the current machine
cannot run a platform-specific check, state that clearly; do not claim an
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body:
id: environment
attributes:
label: Environment / 环境信息
description: Include relevant JDK, Maven, JDT LS, Rust, or Qt versions. / 请填写相关的 JDK、Maven、JDT LS、Rust 或 Qt 版本。
description: Include relevant JDK, Maven, JDT LS, Rust, WebView2, or Tauri versions. / 请填写相关的 JDK、Maven、JDT LS、Rust、WebView2Tauri 版本。
placeholder: |
JDK:
Maven:
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,21 @@ jobs:
with:
targets: x86_64-pc-windows-msvc

- name: Set up Qt
uses: jurplel/install-qt-action@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
version: "6.8.2"
arch: win64_msvc2022_64
archives: qtbase
cache: true
bun-version: "1.3.12"

- name: Build Rust core and C++ targets
- name: Build Windows Tauri application
shell: pwsh
run: ./scripts/build-windows.ps1 -Configuration Release -BuildQt
run: ./scripts/build-windows.ps1 -Configuration Release

- name: Verify Windows boundaries
shell: pwsh
run: ./scripts/verify-windows-boundaries.ps1

- name: Run C++ tests
shell: pwsh
run: ctest --test-dir windows/build-windows -C Release --output-on-failure

- name: Run Rust tests
shell: pwsh
run: cargo test --manifest-path rust/Cargo.toml
run: |
cargo test --manifest-path rust/Cargo.toml
cargo test --manifest-path windows/tauri/src-tauri/Cargo.toml
17 changes: 5 additions & 12 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,10 @@ jobs:
with:
targets: x86_64-pc-windows-msvc

- name: Set up Qt
uses: jurplel/install-qt-action@v4
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
version: "6.8.2"
arch: win64_msvc2022_64
modules: qtbase
cache: true

- name: Install NSIS
shell: pwsh
run: choco install nsis --no-progress --yes
bun-version: "1.3.12"

- name: Resolve release version
id: version
Expand All @@ -61,9 +54,9 @@ jobs:
"version=$version" >> $env:GITHUB_OUTPUT
"tag=v$version" >> $env:GITHUB_OUTPUT

- name: Build Rust core and Qt workbench
- name: Build Windows Tauri application
shell: pwsh
run: ./scripts/build-windows.ps1 -Configuration Release -BuildQt
run: ./scripts/build-windows.ps1 -Configuration Release

- name: Import Authenticode certificate
shell: pwsh
Expand Down
23 changes: 12 additions & 11 deletions docs/architecture/repository-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Lithe contains two independent platform applications connected by a small set
of shared contracts. macOS is the current reference product. Windows is a
Qt/C++ implementation in progress; it must not import Swift source or depend
on macOS types.
React/Tauri implementation; it must not import Swift source or depend on macOS
types.

## Top-level layout

Expand All @@ -23,7 +23,7 @@ Lithe-IDEA/
├── Plugins/Official/ # source manifests and Bundle metadata for official plugins
├── Tests/LitheTests/ # Swift Testing unit tests
├── rust/lithe-core/ # shared Rust commands, models, and C ABI
├── windows/ # C++ CoreClient, Win32 adapters, and Qt UI
├── windows/ # React/Tauri Windows application and Rust adapters
├── shared/ # contracts and cross-platform fixtures
├── Fixtures/ # reusable Java, Maven, Spring Boot, and Git data
├── scripts/ # build, packaging, fixture, and verification tools
Expand All @@ -43,17 +43,18 @@ SwiftUI/AppKit → AppModel → Application Feature Models → AppServices
└── macOS ports and adapters
```

The Windows implementation has the corresponding native layers:
The Windows implementation has the corresponding web/native layers:

```text
windows/qt/ Qt Widgets workbench and UI state
windows/core/ C++ client for the Rust JSON C ABI
windows/adapters/ Win32 file, watcher, process, terminal, runtime, and storage adapters
windows/tauri/src/ React workbench, feature stores, and presentation
windows/tauri/src/platform/ frontend boundary for shared and native commands
windows/tauri/src-tauri/ Tauri composition and Windows-owned Rust adapters
```

Both platforms consume `rust/lithe-core` through the same JSON envelope and
command names. Shared behavior belongs in `shared/contracts/` and should have
a fixture under `shared/fixtures/` before the second platform relies on it.
command names. The Windows Tauri host links the Rust crate directly while
macOS uses the C ABI. Shared behavior belongs in `shared/contracts/` and should
have a fixture under `shared/fixtures/` before the second platform relies on it.

## Swift source organization

Expand Down Expand Up @@ -133,8 +134,8 @@ Moving Rust files must not change JSON command strings, Serde field names, error
| Error codes, cancellation, deadlines, and JSON envelope | PTY/ConPTY, signals, handles, and native UI |

The UI must depend on feature models and shared models, not on a concrete
adapter. Core and Services must remain free of AppKit, SwiftUI, Win32, Qt,
`Process`, and direct platform file APIs.
adapter. Core and Services must remain free of AppKit, SwiftUI, Tauri, WebView2,
Win32, `Process`, and direct platform file APIs.

Language tooling has an additional protocol/application split: Rust owns the
complete LSP process/session runtime and normalized results, while platform
Expand Down
Loading
Loading