Compare commits
362 Commits
v2025.7.0
...
mcp-client
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c415e7f471 | ||
|
|
8023603ebe | ||
|
|
66942eaf2c | ||
|
|
38796b1833 | ||
|
|
49ffa6fc45 | ||
|
|
1f56ba2eb6 | ||
|
|
f98a70ecb4 | ||
|
|
2984eb40c9 | ||
|
|
cc5d4742f0 | ||
|
|
5b8e4b98a0 | ||
|
|
8637c90a21 | ||
|
|
b88c5e71a0 | ||
|
|
1899d512ab | ||
|
|
7c31718f5e | ||
|
|
8f1463e5d0 | ||
|
|
0dc8807808 | ||
|
|
f24a159b8a | ||
|
|
0b91d3aaff | ||
|
|
431dc1c896 | ||
|
|
bc8277b56b | ||
|
|
0afed185d9 | ||
|
|
55cee00601 | ||
|
|
b41a8e04cb | ||
|
|
eff4519d91 | ||
|
|
c4ce458f79 | ||
|
|
f02ae35634 | ||
|
|
c2f068970b | ||
|
|
eec2d6bc38 | ||
|
|
efa22e470e | ||
|
|
c00d2e981f | ||
|
|
9c45254952 | ||
|
|
d031ff231a | ||
|
|
f056894ddb | ||
|
|
1b0315165f | ||
|
|
bd7e840a57 | ||
|
|
8969748c3c | ||
|
|
4e15ac10a6 | ||
|
|
47a3d44888 | ||
|
|
eb10910d20 | ||
|
|
6ba83d424d | ||
|
|
beb47a6b6a | ||
|
|
1893b8f8dd | ||
|
|
7a5bca7aae | ||
|
|
9a75bc2ae7 | ||
|
|
65514e3882 | ||
|
|
9ddaafb79f | ||
|
|
de47ee19ec | ||
|
|
ea730d0184 | ||
|
|
fe706998d4 | ||
|
|
99209e088f | ||
|
|
3eb29ff2fe | ||
|
|
b759003c83 | ||
|
|
6cba38ac89 | ||
|
|
ba8f85baaf | ||
|
|
9970d5fa6f | ||
|
|
d550b42ca3 | ||
|
|
2e1f0cb53f | ||
|
|
eead422ada | ||
|
|
b5753da3b7 | ||
|
|
ae2f2459e9 | ||
|
|
306e6f358a | ||
|
|
822d52a57e | ||
|
|
e665ce04df | ||
|
|
e4828e1b17 | ||
|
|
42143249a2 | ||
|
|
72a7e6963d | ||
|
|
494e9efb64 | ||
|
|
9fe077f598 | ||
|
|
a6eca1cf2e | ||
|
|
31edd1013f | ||
|
|
28e9657ea5 | ||
|
|
ff084a224a | ||
|
|
bbcae34575 | ||
|
|
2a5587c128 | ||
|
|
c41e173a63 | ||
|
|
2b43407ddf | ||
|
|
4d75b8ef06 | ||
|
|
aa79fb05f9 | ||
|
|
fe01796536 | ||
|
|
6654d6c346 | ||
|
|
4c8f768624 | ||
|
|
47c5ef1464 | ||
|
|
2bf7cf5eeb | ||
|
|
f2be52bfec | ||
|
|
ef80216ca1 | ||
|
|
3bcc0b8356 | ||
|
|
ebcdee9be0 | ||
|
|
873abe69a1 | ||
|
|
5fe64f8a22 | ||
|
|
33afafd890 | ||
|
|
ac7de993ba | ||
|
|
1f8fa0f8c3 | ||
|
|
dc51de2af1 | ||
|
|
e818c349cc | ||
|
|
412d7a7654 | ||
|
|
ab5c7f638b | ||
|
|
5bd8685175 | ||
|
|
a9118bf55a | ||
|
|
1828e2ec14 | ||
|
|
6c9791cf0b | ||
|
|
a09437018e | ||
|
|
4b54c22012 | ||
|
|
4f7e67b106 | ||
|
|
8b637d53c4 | ||
|
|
00bf5920e3 | ||
|
|
58bf55704a | ||
|
|
c75d6b815e | ||
|
|
35a57bf7f5 | ||
|
|
118b2faa76 | ||
|
|
158164089f | ||
|
|
4cd4cb5722 | ||
|
|
52f7447f85 | ||
|
|
11694921e3 | ||
|
|
0146ee586f | ||
|
|
e751167dfc | ||
|
|
2ccee0dc70 | ||
|
|
04eec0ee05 | ||
|
|
7e239c0dd1 | ||
|
|
f1783feafc | ||
|
|
ef187373c5 | ||
|
|
8da3659be3 | ||
|
|
4d2bf9304a | ||
|
|
d544899f39 | ||
|
|
92a8da03af | ||
|
|
07ea1ea7dc | ||
|
|
e435414c2e | ||
|
|
e4bd30eb01 | ||
|
|
af3e672386 | ||
|
|
45be354625 | ||
|
|
cd65ef8dbe | ||
|
|
6b9b207e1c | ||
|
|
58eff84f43 | ||
|
|
25d51a017e | ||
|
|
f1a3ef1c11 | ||
|
|
3d919591f3 | ||
|
|
75f92bdd29 | ||
|
|
2fc8678183 | ||
|
|
1c29f4d4ad | ||
|
|
8e1959b7c3 | ||
|
|
cdd5ba3c83 | ||
|
|
3c45464e34 | ||
|
|
7446d62e39 | ||
|
|
3855058d8f | ||
|
|
07d743db21 | ||
|
|
6d5ba685f1 | ||
|
|
218fdf3715 | ||
|
|
7742e7a54c | ||
|
|
b516ca877b | ||
|
|
f3dc71a85c | ||
|
|
394fbbd55d | ||
|
|
6869aa49ec | ||
|
|
ba00274045 | ||
|
|
e32930034d | ||
|
|
26a3e88715 | ||
|
|
6a0d5d2337 | ||
|
|
271d8f29ca | ||
|
|
9c5479b206 | ||
|
|
5f8902e57b | ||
|
|
089c7e8dce | ||
|
|
7e0aa919fb | ||
|
|
5776bab288 | ||
|
|
6b52a0cbed | ||
|
|
46933059f6 | ||
|
|
e17aae246b | ||
|
|
cfbfd66eef | ||
|
|
c20c0eff32 | ||
|
|
9d40949043 | ||
|
|
d435337f2a | ||
|
|
a32145c054 | ||
|
|
e0f547b93f | ||
|
|
5d4268d6a1 | ||
|
|
0a3506f81e | ||
|
|
375b2287b7 | ||
|
|
e72c1e68e5 | ||
|
|
3484db3371 | ||
|
|
c4b559f34b | ||
|
|
ef1ba9b834 | ||
|
|
846f4d9551 | ||
|
|
4780bfe41f | ||
|
|
d0d01b3897 | ||
|
|
fc1e8baa23 | ||
|
|
d35116c494 | ||
|
|
1d257b365b | ||
|
|
1076d57e8a | ||
|
|
01904cd1c9 | ||
|
|
1c93d5775f | ||
|
|
113d0dc3c7 | ||
|
|
7b78fac24e | ||
|
|
6534b3f622 | ||
|
|
daba21fbca | ||
|
|
3b99ea1cad | ||
|
|
937d7aa72a | ||
|
|
5bf7278479 | ||
|
|
095af8cf4b | ||
|
|
e1c1ecc34d | ||
|
|
6e4c167bfd | ||
|
|
25d8357471 | ||
|
|
8e00693af3 | ||
|
|
079da67889 | ||
|
|
9ed3dacd28 | ||
|
|
ba6e64ef37 | ||
|
|
d7a68c2d53 | ||
|
|
e8e1d9246e | ||
|
|
a7574f2e5a | ||
|
|
69f9661813 | ||
|
|
302b0a4747 | ||
|
|
07f4696a2c | ||
|
|
2ddb1096df | ||
|
|
0149355d66 | ||
|
|
2e7749a883 | ||
|
|
cd0e8c0bc2 | ||
|
|
64e4e352a0 | ||
|
|
b512365f5a | ||
|
|
13c84e3fb6 | ||
|
|
8d1b17cac1 | ||
|
|
0c7034eefc | ||
|
|
3ec236462f | ||
|
|
1b5ac6fc89 | ||
|
|
d356bac135 | ||
|
|
8a80e7b833 | ||
|
|
a1ae065d37 | ||
|
|
79dd50474d | ||
|
|
dfa6f1c5b4 | ||
|
|
2edd33b6e3 | ||
|
|
8b851d4685 | ||
|
|
20e1b5c00e | ||
|
|
c4ab2965f7 | ||
|
|
0cad8f69e2 | ||
|
|
a8402824ed | ||
|
|
acf9458616 | ||
|
|
0a58f7dfc8 | ||
|
|
6e05d85ae4 | ||
|
|
a04db485de | ||
|
|
d7043e75d6 | ||
|
|
ec3e2e16a9 | ||
|
|
2bac610efe | ||
|
|
43a7132014 | ||
|
|
bddc6e35a0 | ||
|
|
0e98a3e498 | ||
|
|
17b6c945e6 | ||
|
|
474e761eb7 | ||
|
|
1fbf9e50c4 | ||
|
|
6863decd8e | ||
|
|
569e506f32 | ||
|
|
6d7a08758f | ||
|
|
20dfd50a7d | ||
|
|
d747eb5e45 | ||
|
|
81fca7c54f | ||
|
|
5465efea84 | ||
|
|
96a3630725 | ||
|
|
f1b6c89186 | ||
|
|
9c52652a5e | ||
|
|
84219571e8 | ||
|
|
7ced183b11 | ||
|
|
593a7ab7e5 | ||
|
|
a4c4663011 | ||
|
|
5745a96106 | ||
|
|
5449e3c620 | ||
|
|
7b6278405c | ||
|
|
8164a61376 | ||
|
|
2e9f21f838 | ||
|
|
0d725b59bd | ||
|
|
632860c29b | ||
|
|
e1cf16f6e1 | ||
|
|
47c9cfb295 | ||
|
|
6389fd3b8f | ||
|
|
d318546d0c | ||
|
|
2f60b7b1f3 | ||
|
|
75dc82570b | ||
|
|
d7a7a64ec4 | ||
|
|
3aae1b52d1 | ||
|
|
9eddf716e1 | ||
|
|
554e632c19 | ||
|
|
054916b7af | ||
|
|
f2a63087b0 | ||
|
|
6f0d4ad5e4 | ||
|
|
cd3530f598 | ||
|
|
53aea914ac | ||
|
|
dc0c1decee | ||
|
|
32d56f2274 | ||
|
|
ef86c1d189 | ||
|
|
e264c50427 | ||
|
|
f05ad62301 | ||
|
|
0a6228bf16 | ||
|
|
fa3a0b57f9 | ||
|
|
4390c02117 | ||
|
|
77011176af | ||
|
|
759fc503d3 | ||
|
|
0cb633e479 | ||
|
|
81ceb981e8 | ||
|
|
4dae1a7955 | ||
|
|
d119f4cab2 | ||
|
|
7e1eb90d29 | ||
|
|
bf97ea1659 | ||
|
|
749ca968ec | ||
|
|
0c54b481fb | ||
|
|
4943bad8ec | ||
|
|
450dbd0053 | ||
|
|
236c8fa656 | ||
|
|
1dfc2ee602 | ||
|
|
1d158082f6 | ||
|
|
f3e44c53d7 | ||
|
|
c8d5e7c97b | ||
|
|
9bde6bbd0a | ||
|
|
df5be218a5 | ||
|
|
2deb870bb6 | ||
|
|
0f9975339c | ||
|
|
6ad4e7bbb5 | ||
|
|
2bcf67aaa6 | ||
|
|
c01b8ce4ca | ||
|
|
f7bb649b16 | ||
|
|
e3e67c8df7 | ||
|
|
c9698c0f23 | ||
|
|
2cdd1d8136 | ||
|
|
8d8e5c0317 | ||
|
|
4e66a73677 | ||
|
|
08f1bc4e65 | ||
|
|
c6d9cb9c9e | ||
|
|
efbb90dd60 | ||
|
|
7a7940d365 | ||
|
|
8a6f80a181 | ||
|
|
e8e0097e2d | ||
|
|
f475b05c51 | ||
|
|
7e5f9004e2 | ||
|
|
660771b48c | ||
|
|
030e8b837e | ||
|
|
a42cba567c | ||
|
|
484b5b2fd8 | ||
|
|
a71fb8ed6c | ||
|
|
5b8114f6f3 | ||
|
|
68637d24c7 | ||
|
|
c097afe657 | ||
|
|
78bc7d7909 | ||
|
|
b68ce44d52 | ||
|
|
632344d166 | ||
|
|
f3814b7d2b | ||
|
|
618a544dbd | ||
|
|
9a55426236 | ||
|
|
b7ad490c9b | ||
|
|
2095cb88c2 | ||
|
|
a9e05ae988 | ||
|
|
99a6c38632 | ||
|
|
b2766509e3 | ||
|
|
3f5b5a397c | ||
|
|
923b1ac830 | ||
|
|
17dbe7c9a7 | ||
|
|
df80cdfe33 | ||
|
|
eb1916b773 | ||
|
|
a3df0489b1 | ||
|
|
b19e036a61 | ||
|
|
b51e37f221 | ||
|
|
cf9882b5b9 | ||
|
|
bbf85c953d | ||
|
|
17ddc76223 | ||
|
|
754ec0ba86 | ||
|
|
1198aa7d87 | ||
|
|
43437abae7 | ||
|
|
9439cfa2ba | ||
|
|
a731ccc8bd | ||
|
|
451c8b9dde | ||
|
|
b7682db9a3 | ||
|
|
7e2d72c4e3 |
72
.claude-context.md
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
# Claude Context: Detaching Tauri from Yaak
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
Make Yaak runnable as a standalone CLI without Tauri as a dependency. The core Rust crates in `crates/` should be usable independently, while Tauri-specific code lives in `crates-tauri/`.
|
||||||
|
|
||||||
|
## Project Structure
|
||||||
|
```
|
||||||
|
crates/ # Core crates - should NOT depend on Tauri
|
||||||
|
crates-tauri/ # Tauri-specific crates (yaak-app, yaak-tauri-utils, etc.)
|
||||||
|
crates-cli/ # CLI crate (yaak-cli)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Completed Work
|
||||||
|
|
||||||
|
### 1. Folder Restructure
|
||||||
|
- Moved Tauri-dependent app code to `crates-tauri/yaak-app/`
|
||||||
|
- Created `crates-tauri/yaak-tauri-utils/` for shared Tauri utilities (window traits, api_client, error handling)
|
||||||
|
- Created `crates-cli/yaak-cli/` for the standalone CLI
|
||||||
|
|
||||||
|
### 2. Decoupled Crates (no longer depend on Tauri)
|
||||||
|
- **yaak-models**: Uses `init_standalone()` pattern for CLI database access
|
||||||
|
- **yaak-http**: Removed Tauri plugin, HttpConnectionManager initialized in yaak-app setup
|
||||||
|
- **yaak-common**: Only contains Tauri-free utilities (serde, platform)
|
||||||
|
- **yaak-crypto**: Removed Tauri plugin, EncryptionManager initialized in yaak-app setup, commands moved to yaak-app
|
||||||
|
- **yaak-grpc**: Replaced AppHandle with GrpcConfig struct, uses tokio::process::Command instead of Tauri sidecar
|
||||||
|
|
||||||
|
### 3. CLI Implementation
|
||||||
|
- Basic CLI at `crates-cli/yaak-cli/src/main.rs`
|
||||||
|
- Commands: workspaces, requests, send (by ID), get (ad-hoc URL), create
|
||||||
|
- Uses same database as Tauri app via `yaak_models::init_standalone()`
|
||||||
|
|
||||||
|
## Remaining Work
|
||||||
|
|
||||||
|
### Crates Still Depending on Tauri (in `crates/`)
|
||||||
|
1. **yaak-git** (3 files) - Moderate complexity
|
||||||
|
2. **yaak-plugins** (13 files) - **Hardest** - deeply integrated with Tauri for plugin-to-window communication
|
||||||
|
3. **yaak-sync** (4 files) - Moderate complexity
|
||||||
|
4. **yaak-ws** (5 files) - Moderate complexity
|
||||||
|
|
||||||
|
### Pattern for Decoupling
|
||||||
|
1. Remove Tauri plugin `init()` function from the crate
|
||||||
|
2. Move commands to `yaak-app/src/commands.rs` or keep inline in `lib.rs`
|
||||||
|
3. Move extension traits (e.g., `SomethingManagerExt`) to yaak-app or yaak-tauri-utils
|
||||||
|
4. Initialize managers in yaak-app's `.setup()` block
|
||||||
|
5. Remove `tauri` from Cargo.toml dependencies
|
||||||
|
6. Update `crates-tauri/yaak-app/capabilities/default.json` to remove the plugin permission
|
||||||
|
7. Replace `tauri::async_runtime::block_on` with `tokio::runtime::Handle::current().block_on()`
|
||||||
|
|
||||||
|
## Key Files
|
||||||
|
- `crates-tauri/yaak-app/src/lib.rs` - Main Tauri app, setup block initializes managers
|
||||||
|
- `crates-tauri/yaak-app/src/commands.rs` - Migrated Tauri commands
|
||||||
|
- `crates-tauri/yaak-app/src/models_ext.rs` - Database plugin and extension traits
|
||||||
|
- `crates-tauri/yaak-tauri-utils/src/window.rs` - WorkspaceWindowTrait for window state
|
||||||
|
- `crates/yaak-models/src/lib.rs` - Contains `init_standalone()` for CLI usage
|
||||||
|
|
||||||
|
## Git Branch
|
||||||
|
Working on `detach-tauri` branch.
|
||||||
|
|
||||||
|
## Recent Commits
|
||||||
|
```
|
||||||
|
c40cff40 Remove Tauri dependencies from yaak-crypto and yaak-grpc
|
||||||
|
df495f1d Move Tauri utilities from yaak-common to yaak-tauri-utils
|
||||||
|
481e0273 Remove Tauri dependencies from yaak-http and yaak-common
|
||||||
|
10568ac3 Add HTTP request sending to yaak-cli
|
||||||
|
bcb7d600 Add yaak-cli stub with basic database access
|
||||||
|
e718a5f1 Refactor models_ext to use init_standalone from yaak-models
|
||||||
|
```
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
- Run `cargo check -p <crate>` to verify a crate builds without Tauri
|
||||||
|
- Run `npm run app-dev` to test the Tauri app still works
|
||||||
|
- Run `cargo run -p yaak-cli -- --help` to test the CLI
|
||||||
51
.claude/commands/release/check-out-pr.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
description: Review a PR in a new worktree
|
||||||
|
allowed-tools: Bash(git worktree:*), Bash(gh pr:*)
|
||||||
|
---
|
||||||
|
|
||||||
|
Review a GitHub pull request in a new git worktree.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
/review-pr <PR_NUMBER>
|
||||||
|
```
|
||||||
|
|
||||||
|
## What to do
|
||||||
|
|
||||||
|
1. List all open pull requests and ask the user to select one
|
||||||
|
2. Get PR information using `gh pr view <PR_NUMBER> --json number,headRefName`
|
||||||
|
3. Extract the branch name from the PR
|
||||||
|
4. Create a new worktree at `../yaak-worktrees/pr-<PR_NUMBER>` using `git worktree add` with a timeout of at least 300000ms (5 minutes) since the post-checkout hook runs a bootstrap script
|
||||||
|
5. Checkout the PR branch in the new worktree using `gh pr checkout <PR_NUMBER>`
|
||||||
|
6. The post-checkout hook will automatically:
|
||||||
|
- Create `.env.local` with unique ports
|
||||||
|
- Copy editor config folders
|
||||||
|
- Run `npm install && npm run bootstrap`
|
||||||
|
7. Inform the user:
|
||||||
|
- Where the worktree was created
|
||||||
|
- What ports were assigned
|
||||||
|
- How to access it (cd command)
|
||||||
|
- How to run the dev server
|
||||||
|
- How to remove the worktree when done
|
||||||
|
|
||||||
|
## Example Output
|
||||||
|
|
||||||
|
```
|
||||||
|
Created worktree for PR #123 at ../yaak-worktrees/pr-123
|
||||||
|
Branch: feature-auth
|
||||||
|
Ports: Vite (1421), MCP (64344)
|
||||||
|
|
||||||
|
To start working:
|
||||||
|
cd ../yaak-worktrees/pr-123
|
||||||
|
npm run app-dev
|
||||||
|
|
||||||
|
To remove when done:
|
||||||
|
git worktree remove ../yaak-worktrees/pr-123
|
||||||
|
```
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
|
||||||
|
- If the PR doesn't exist, show a helpful error
|
||||||
|
- If the worktree already exists, inform the user and ask if they want to remove and recreate it
|
||||||
|
- If `gh` CLI is not available, inform the user to install it
|
||||||
47
.claude/commands/release/generate-release-notes.md
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
description: Generate formatted release notes for Yaak releases
|
||||||
|
allowed-tools: Bash(git tag:*)
|
||||||
|
---
|
||||||
|
|
||||||
|
Generate formatted release notes for Yaak releases by analyzing git history and pull request descriptions.
|
||||||
|
|
||||||
|
## What to do
|
||||||
|
|
||||||
|
1. Identifies the version tag and previous version
|
||||||
|
2. Retrieves all commits between versions
|
||||||
|
- If the version is a beta version, it retrieves commits between the beta version and previous beta version
|
||||||
|
- If the version is a stable version, it retrieves commits between the stable version and the previous stable version
|
||||||
|
3. Fetches PR descriptions for linked issues to find:
|
||||||
|
- Feedback URLs (feedback.yaak.app)
|
||||||
|
- Additional context and descriptions
|
||||||
|
- Installation links for plugins
|
||||||
|
4. Formats the release notes using the standard Yaak format:
|
||||||
|
- Changelog badge at the top
|
||||||
|
- Bulleted list of changes with PR links
|
||||||
|
- Feedback links where available
|
||||||
|
- Full changelog comparison link at the bottom
|
||||||
|
|
||||||
|
## Output Format
|
||||||
|
|
||||||
|
The skill generates markdown-formatted release notes following this structure:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
[](https://yaak.app/changelog/VERSION)
|
||||||
|
|
||||||
|
- Feature/fix description in by @username [#123](https://github.com/mountain-loop/yaak/pull/123)
|
||||||
|
- [Linked feedback item](https://feedback.yaak.app/p/item) by @username in [#456](https://github.com/mountain-loop/yaak/pull/456)
|
||||||
|
- A simple item that doesn't have a feedback or PR link
|
||||||
|
|
||||||
|
**Full Changelog**: https://github.com/mountain-loop/yaak/compare/vPREV...vCURRENT
|
||||||
|
```
|
||||||
|
|
||||||
|
**IMPORTANT**: Always add a blank lines around the markdown code fence and output the markdown code block last
|
||||||
|
**IMPORTANT**: PRs by `@gschier` should not mention the @username
|
||||||
|
|
||||||
|
## After Generating Release Notes
|
||||||
|
|
||||||
|
After outputting the release notes, ask the user if they would like to create a draft GitHub release with these notes. If they confirm, create the release using:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gh release create <tag> --draft --prerelease --title "<tag>" --notes '<release notes>'
|
||||||
|
```
|
||||||
27
.claude/rules.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# Project Rules
|
||||||
|
|
||||||
|
## General Development
|
||||||
|
|
||||||
|
- **NEVER** commit or push without explicit confirmation
|
||||||
|
|
||||||
|
## Build and Lint
|
||||||
|
|
||||||
|
- **ALWAYS** run `npm run lint` after modifying TypeScript or JavaScript files
|
||||||
|
- Run `npm run bootstrap` after changing plugin runtime or MCP server code
|
||||||
|
|
||||||
|
## Plugin System
|
||||||
|
|
||||||
|
### Backend Constraints
|
||||||
|
|
||||||
|
- Always use `UpdateSource::Plugin` when calling database methods from plugin events
|
||||||
|
- Never send timestamps (`createdAt`, `updatedAt`) from TypeScript - Rust backend controls these
|
||||||
|
- Backend uses `NaiveDateTime` (no timezone) so avoid sending ISO timestamp strings
|
||||||
|
|
||||||
|
### MCP Server
|
||||||
|
|
||||||
|
- MCP server has **no active window context** - cannot call `window.workspaceId()`
|
||||||
|
- Get workspace ID from `workspaceCtx.yaak.workspace.list()` instead
|
||||||
|
|
||||||
|
## Rust Type Generation
|
||||||
|
|
||||||
|
- Run `cargo test --package yaak-plugins` (and for other crates) to regenerate TypeScript bindings after modifying Rust event types
|
||||||
35
.claude/skills/worktree.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Worktree Management Skill
|
||||||
|
|
||||||
|
## Creating Worktrees
|
||||||
|
|
||||||
|
When creating git worktrees for this project, ALWAYS use the path format:
|
||||||
|
```
|
||||||
|
../yaak-worktrees/<NAME>
|
||||||
|
```
|
||||||
|
|
||||||
|
For example:
|
||||||
|
- `git worktree add ../yaak-worktrees/feature-auth`
|
||||||
|
- `git worktree add ../yaak-worktrees/bugfix-login`
|
||||||
|
- `git worktree add ../yaak-worktrees/refactor-api`
|
||||||
|
|
||||||
|
## What Happens Automatically
|
||||||
|
|
||||||
|
The post-checkout hook will automatically:
|
||||||
|
1. Create `.env.local` with unique ports (YAAK_DEV_PORT and YAAK_PLUGIN_MCP_SERVER_PORT)
|
||||||
|
2. Copy gitignored editor config folders (.zed, .idea, etc.)
|
||||||
|
3. Run `npm install && npm run bootstrap`
|
||||||
|
|
||||||
|
## Deleting Worktrees
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git worktree remove ../yaak-worktrees/<NAME>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Port Assignments
|
||||||
|
|
||||||
|
- Main worktree: 1420 (Vite), 64343 (MCP)
|
||||||
|
- First worktree: 1421, 64344
|
||||||
|
- Second worktree: 1422, 64345
|
||||||
|
- etc.
|
||||||
|
|
||||||
|
Each worktree can run `npm run app-dev` simultaneously without conflicts.
|
||||||
9
.gitattributes
vendored
@@ -1,2 +1,7 @@
|
|||||||
src-tauri/vendored/**/* linguist-generated=true
|
crates-tauri/yaak-app/vendored/**/* linguist-generated=true
|
||||||
src-tauri/gen/schemas/**/* linguist-generated=true
|
crates-tauri/yaak-app/gen/schemas/**/* linguist-generated=true
|
||||||
|
**/bindings/* linguist-generated=true
|
||||||
|
crates/yaak-templates/pkg/* linguist-generated=true
|
||||||
|
|
||||||
|
# Ensure consistent line endings for test files that check exact content
|
||||||
|
crates/yaak-http/tests/test.txt text eol=lf
|
||||||
|
|||||||
12
.github/FUNDING.yml
vendored
@@ -1,15 +1,3 @@
|
|||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: gschier
|
github: gschier
|
||||||
patreon: # Replace with a single Patreon username
|
|
||||||
open_collective: # Replace with a single Open Collective username
|
|
||||||
ko_fi: # Replace with a single Ko-fi username
|
|
||||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
||||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
||||||
liberapay: # Replace with a single Liberapay username
|
|
||||||
issuehunt: # Replace with a single IssueHunt username
|
|
||||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
||||||
polar: # Replace with a single Polar username
|
|
||||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
||||||
thanks_dev: # Replace with a single thanks.dev username
|
|
||||||
custom: https://yaak.app/pricing
|
|
||||||
|
|||||||
18
.github/workflows/ci-js.yml
vendored
@@ -1,18 +0,0 @@
|
|||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [develop]
|
|
||||||
|
|
||||||
name: CI (JS)
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Lint/Test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm run lint
|
|
||||||
- run: npm test
|
|
||||||
36
.github/workflows/ci-rust.yml
vendored
@@ -1,36 +0,0 @@
|
|||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [develop]
|
|
||||||
paths:
|
|
||||||
- src-tauri/**
|
|
||||||
- .github/workflows/**
|
|
||||||
|
|
||||||
name: CI (Rust)
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: src-tauri
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
name: Check/Test
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y libwebkit2gtk-4.1-dev
|
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
continue-on-error: false
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-cargo-
|
|
||||||
- run: cargo check --all
|
|
||||||
- run: cargo test --all
|
|
||||||
30
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
name: Lint and Test
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
name: Lint/Test
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
shared-key: ci
|
||||||
|
cache-on-failure: true
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run bootstrap
|
||||||
|
- run: npm run lint
|
||||||
|
- name: Run JS Tests
|
||||||
|
run: npm test
|
||||||
|
- name: Run Rust Tests
|
||||||
|
run: cargo test --all
|
||||||
50
.github/workflows/claude.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
name: Claude Code
|
||||||
|
|
||||||
|
on:
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
pull_request_review_comment:
|
||||||
|
types: [created]
|
||||||
|
issues:
|
||||||
|
types: [opened, assigned]
|
||||||
|
pull_request_review:
|
||||||
|
types: [submitted]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
claude:
|
||||||
|
if: |
|
||||||
|
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
|
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
|
||||||
|
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
|
||||||
|
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: read
|
||||||
|
issues: read
|
||||||
|
id-token: write
|
||||||
|
actions: read # Required for Claude to read CI results on PRs
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
|
- name: Run Claude Code
|
||||||
|
id: claude
|
||||||
|
uses: anthropics/claude-code-action@v1
|
||||||
|
with:
|
||||||
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
|
||||||
|
# This is an optional setting that allows Claude to read CI results on PRs
|
||||||
|
additional_permissions: |
|
||||||
|
actions: read
|
||||||
|
|
||||||
|
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
|
||||||
|
# prompt: 'Update the pull request description to include a summary of changes.'
|
||||||
|
|
||||||
|
# Optional: Add claude_args to customize behavior and configuration
|
||||||
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||||
|
# claude_args: '--allowed-tools Bash(gh pr:*)'
|
||||||
|
|
||||||
152
.github/workflows/release.yml
vendored
@@ -1,7 +1,7 @@
|
|||||||
name: Generate Artifacts
|
name: Generate Artifacts
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: [ v* ]
|
tags: [v*]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-artifacts:
|
build-artifacts:
|
||||||
@@ -13,18 +13,37 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- platform: 'macos-latest' # for Arm-based Macs (M1 and above).
|
- platform: "macos-latest" # for Arm-based Macs (M1 and above).
|
||||||
args: '--target aarch64-apple-darwin'
|
args: "--target aarch64-apple-darwin"
|
||||||
yaak_arch: 'arm64'
|
yaak_arch: "arm64"
|
||||||
- platform: 'macos-latest' # for Intel-based Macs.
|
os: "macos"
|
||||||
args: '--target x86_64-apple-darwin'
|
targets: "aarch64-apple-darwin"
|
||||||
yaak_arch: 'x64'
|
- platform: "macos-latest" # for Intel-based Macs.
|
||||||
- platform: 'ubuntu-22.04'
|
args: "--target x86_64-apple-darwin"
|
||||||
args: ''
|
yaak_arch: "x64"
|
||||||
yaak_arch: 'x64'
|
os: "macos"
|
||||||
- platform: 'windows-latest'
|
targets: "x86_64-apple-darwin"
|
||||||
args: ''
|
- platform: "ubuntu-22.04"
|
||||||
yaak_arch: 'x64'
|
args: ""
|
||||||
|
yaak_arch: "x64"
|
||||||
|
os: "ubuntu"
|
||||||
|
targets: ""
|
||||||
|
- platform: "ubuntu-22.04-arm"
|
||||||
|
args: ""
|
||||||
|
yaak_arch: "arm64"
|
||||||
|
os: "ubuntu"
|
||||||
|
targets: ""
|
||||||
|
- platform: "windows-latest"
|
||||||
|
args: ""
|
||||||
|
yaak_arch: "x64"
|
||||||
|
os: "windows"
|
||||||
|
targets: ""
|
||||||
|
# Windows ARM64
|
||||||
|
- platform: "windows-latest"
|
||||||
|
args: "--target aarch64-pc-windows-msvc"
|
||||||
|
yaak_arch: "arm64"
|
||||||
|
os: "windows"
|
||||||
|
targets: "aarch64-pc-windows-msvc"
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
steps:
|
steps:
|
||||||
@@ -33,60 +52,79 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: install Rust stable
|
- name: install Rust stable
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
|
targets: ${{ matrix.targets }}
|
||||||
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- uses: Swatinem/rust-cache@v2
|
||||||
continue-on-error: false
|
|
||||||
with:
|
with:
|
||||||
path: |
|
shared-key: ci
|
||||||
~/.cargo/bin/
|
cache-on-failure: true
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
src-tauri/target/
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-cargo-
|
|
||||||
|
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (Linux only)
|
||||||
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
|
if: matrix.os == 'ubuntu'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils
|
||||||
|
|
||||||
- name: install dependencies (windows only)
|
|
||||||
if: matrix.platform == 'windows-latest'
|
|
||||||
run: cargo install --force trusted-signing-cli
|
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Install Protoc for plugin-runtime
|
- name: Install Protoc for plugin-runtime
|
||||||
uses: arduino/setup-protoc@v3
|
uses: arduino/setup-protoc@v3
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# Some things (eg. WASM package) requires building before lint will work
|
- name: Install trusted-signing-cli (Windows only)
|
||||||
- name: Run bootstrap
|
if: matrix.os == 'windows'
|
||||||
run: npm run bootstrap
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
$dir = "$env:USERPROFILE\trusted-signing"
|
||||||
|
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
||||||
|
$url = "https://github.com/Levminer/trusted-signing-cli/releases/download/0.8.0/trusted-signing-cli.exe"
|
||||||
|
$exe = Join-Path $dir "trusted-signing-cli.exe"
|
||||||
|
Invoke-WebRequest -Uri $url -OutFile $exe
|
||||||
|
echo $dir >> $env:GITHUB_PATH
|
||||||
|
& $exe --version
|
||||||
|
|
||||||
- name: Run lint
|
- run: npm ci
|
||||||
run: npm run lint
|
- run: npm run bootstrap
|
||||||
|
env:
|
||||||
- name: Run tests
|
YAAK_TARGET_ARCH: ${{ matrix.yaak_arch }}
|
||||||
|
- run: npm run lint
|
||||||
|
- name: Run JS Tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
- name: Run Rust Tests
|
||||||
|
run: cargo test --all
|
||||||
|
|
||||||
- name: Set version
|
- name: Set version
|
||||||
run: npm run replace-version
|
run: npm run replace-version
|
||||||
env:
|
env:
|
||||||
YAAK_VERSION: ${{ github.ref_name }}
|
YAAK_VERSION: ${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Sign vendored binaries (macOS only)
|
||||||
|
if: matrix.os == 'macos'
|
||||||
|
env:
|
||||||
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||||
|
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||||
|
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
|
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||||
|
run: |
|
||||||
|
# Create keychain
|
||||||
|
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
||||||
|
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
|
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
||||||
|
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
||||||
|
|
||||||
|
# Import certificate
|
||||||
|
echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12
|
||||||
|
security import certificate.p12 -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
||||||
|
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||||
|
|
||||||
|
# Sign vendored binaries with hardened runtime and their specific entitlements
|
||||||
|
codesign --force --options runtime --entitlements crates-tauri/yaak-app/macos/entitlements.yaakprotoc.plist --sign "$APPLE_SIGNING_IDENTITY" crates-tauri/yaak-app/vendored/protoc/yaakprotoc || true
|
||||||
|
codesign --force --options runtime --entitlements crates-tauri/yaak-app/macos/entitlements.yaaknode.plist --sign "$APPLE_SIGNING_IDENTITY" crates-tauri/yaak-app/vendored/node/yaaknode || true
|
||||||
|
|
||||||
- uses: tauri-apps/tauri-action@v0
|
- uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
YAAK_TARGET_ARCH: ${{ matrix.yaak_arch }}
|
YAAK_TARGET_ARCH: ${{ matrix.yaak_arch }}
|
||||||
@@ -97,21 +135,21 @@ jobs:
|
|||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
|
||||||
|
|
||||||
# Apple signing stuff
|
# Apple signing stuff
|
||||||
APPLE_CERTIFICATE: ${{ matrix.platform == 'macos-latest' && secrets.APPLE_CERTIFICATE }}
|
APPLE_CERTIFICATE: ${{ matrix.os == 'macos' && secrets.APPLE_CERTIFICATE }}
|
||||||
APPLE_CERTIFICATE_PASSWORD: ${{ matrix.platform == 'macos-latest' && secrets.APPLE_CERTIFICATE_PASSWORD }}
|
APPLE_CERTIFICATE_PASSWORD: ${{ matrix.os == 'macos' && secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||||
APPLE_ID: ${{ matrix.platform == 'macos-latest' && secrets.APPLE_ID }}
|
APPLE_ID: ${{ matrix.os == 'macos' && secrets.APPLE_ID }}
|
||||||
APPLE_PASSWORD: ${{ matrix.platform == 'macos-latest' && secrets.APPLE_PASSWORD }}
|
APPLE_PASSWORD: ${{ matrix.os == 'macos' && secrets.APPLE_PASSWORD }}
|
||||||
APPLE_SIGNING_IDENTITY: ${{ matrix.platform == 'macos-latest' && secrets.APPLE_SIGNING_IDENTITY }}
|
APPLE_SIGNING_IDENTITY: ${{ matrix.os == 'macos' && secrets.APPLE_SIGNING_IDENTITY }}
|
||||||
APPLE_TEAM_ID: ${{ matrix.platform == 'macos-latest' && secrets.APPLE_TEAM_ID }}
|
APPLE_TEAM_ID: ${{ matrix.os == 'macos' && secrets.APPLE_TEAM_ID }}
|
||||||
|
|
||||||
# Windows signing stuff
|
# Windows signing stuff
|
||||||
AZURE_CLIENT_ID: ${{ matrix.platform == 'windows-latest' && secrets.AZURE_CLIENT_ID }}
|
AZURE_CLIENT_ID: ${{ matrix.os == 'windows' && secrets.AZURE_CLIENT_ID }}
|
||||||
AZURE_CLIENT_SECRET: ${{ matrix.platform == 'windows-latest' && secrets.AZURE_CLIENT_SECRET }}
|
AZURE_CLIENT_SECRET: ${{ matrix.os == 'windows' && secrets.AZURE_CLIENT_SECRET }}
|
||||||
AZURE_TENANT_ID: ${{ matrix.platform == 'windows-latest' && secrets.AZURE_TENANT_ID }}
|
AZURE_TENANT_ID: ${{ matrix.os == 'windows' && secrets.AZURE_TENANT_ID }}
|
||||||
with:
|
with:
|
||||||
tagName: 'v__VERSION__'
|
tagName: "v__VERSION__"
|
||||||
releaseName: 'Release __VERSION__'
|
releaseName: "Release __VERSION__"
|
||||||
releaseBody: '[Changelog __VERSION__](https://yaak.app/blog/__VERSION__)'
|
releaseBody: "[Changelog __VERSION__](https://yaak.app/blog/__VERSION__)"
|
||||||
releaseDraft: true
|
releaseDraft: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
args: '${{ matrix.args }} --config ./src-tauri/tauri.release.conf.json'
|
args: "${{ matrix.args }} --config ./crates-tauri/yaak-app/tauri.release.conf.json"
|
||||||
|
|||||||
13
.gitignore
vendored
@@ -15,6 +15,8 @@ dist-ssr
|
|||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/launch.json
|
||||||
.idea
|
.idea
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.suo
|
*.suo
|
||||||
@@ -23,6 +25,7 @@ dist-ssr
|
|||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
out
|
||||||
|
|
||||||
*.sqlite
|
*.sqlite
|
||||||
*.sqlite-*
|
*.sqlite-*
|
||||||
@@ -31,3 +34,13 @@ dist-ssr
|
|||||||
|
|
||||||
.tmp
|
.tmp
|
||||||
tmp
|
tmp
|
||||||
|
.zed
|
||||||
|
codebook.toml
|
||||||
|
target
|
||||||
|
|
||||||
|
# Per-worktree Tauri config (generated by post-checkout hook)
|
||||||
|
crates-tauri/yaak-app/tauri.worktree.conf.json
|
||||||
|
|
||||||
|
# Tauri auto-generated permission files
|
||||||
|
**/permissions/autogenerated
|
||||||
|
**/permissions/schemas
|
||||||
|
|||||||
1
.husky/post-checkout
Executable file
@@ -0,0 +1 @@
|
|||||||
|
node scripts/git-hooks/post-checkout.mjs "$@"
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
node_modules/
|
|
||||||
dist/
|
|
||||||
out/
|
|
||||||
.prettierrc.cjs
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export default {
|
|
||||||
"trailingComma": "all",
|
|
||||||
"tabWidth": 2,
|
|
||||||
"semi": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"printWidth": 100,
|
|
||||||
"bracketSpacing": true
|
|
||||||
}
|
|
||||||
3
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["biomejs.biome", "rust-lang.rust-analyzer", "bradlc.vscode-tailwindcss"]
|
||||||
|
}
|
||||||
26
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Dev App",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": ["run", "start"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Build App",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": ["run", "start"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Bootstrap",
|
||||||
|
"runtimeExecutable": "npm",
|
||||||
|
"runtimeArgs": ["run", "bootstrap"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"editor.defaultFormatter": "biomejs.biome",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"biome.enabled": true,
|
||||||
|
"biome.lint.format.enable": true
|
||||||
|
}
|
||||||
604
src-tauri/Cargo.lock → Cargo.lock
generated
69
Cargo.toml
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
[workspace]
|
||||||
|
resolver = "2"
|
||||||
|
members = [
|
||||||
|
# Shared crates (no Tauri dependency)
|
||||||
|
"crates/yaak-core",
|
||||||
|
"crates/yaak-common",
|
||||||
|
"crates/yaak-crypto",
|
||||||
|
"crates/yaak-git",
|
||||||
|
"crates/yaak-grpc",
|
||||||
|
"crates/yaak-http",
|
||||||
|
"crates/yaak-models",
|
||||||
|
"crates/yaak-plugins",
|
||||||
|
"crates/yaak-sse",
|
||||||
|
"crates/yaak-sync",
|
||||||
|
"crates/yaak-templates",
|
||||||
|
"crates/yaak-tls",
|
||||||
|
"crates/yaak-ws",
|
||||||
|
# CLI crates
|
||||||
|
"crates-cli/yaak-cli",
|
||||||
|
# Tauri-specific crates
|
||||||
|
"crates-tauri/yaak-app",
|
||||||
|
"crates-tauri/yaak-fonts",
|
||||||
|
"crates-tauri/yaak-license",
|
||||||
|
"crates-tauri/yaak-mac-window",
|
||||||
|
"crates-tauri/yaak-tauri-utils",
|
||||||
|
]
|
||||||
|
|
||||||
|
[workspace.dependencies]
|
||||||
|
chrono = "0.4.42"
|
||||||
|
hex = "0.4.3"
|
||||||
|
keyring = "3.6.3"
|
||||||
|
log = "0.4.29"
|
||||||
|
reqwest = "0.12.20"
|
||||||
|
rustls = { version = "0.23.34", default-features = false }
|
||||||
|
rustls-platform-verifier = "0.6.2"
|
||||||
|
serde = "1.0.228"
|
||||||
|
serde_json = "1.0.145"
|
||||||
|
sha2 = "0.10.9"
|
||||||
|
tauri = "2.9.5"
|
||||||
|
tauri-plugin = "2.5.2"
|
||||||
|
tauri-plugin-dialog = "2.4.2"
|
||||||
|
tauri-plugin-shell = "2.3.3"
|
||||||
|
thiserror = "2.0.17"
|
||||||
|
tokio = "1.48.0"
|
||||||
|
ts-rs = "11.1.0"
|
||||||
|
|
||||||
|
# Internal crates - shared
|
||||||
|
yaak-core = { path = "crates/yaak-core" }
|
||||||
|
yaak-common = { path = "crates/yaak-common" }
|
||||||
|
yaak-crypto = { path = "crates/yaak-crypto" }
|
||||||
|
yaak-git = { path = "crates/yaak-git" }
|
||||||
|
yaak-grpc = { path = "crates/yaak-grpc" }
|
||||||
|
yaak-http = { path = "crates/yaak-http" }
|
||||||
|
yaak-models = { path = "crates/yaak-models" }
|
||||||
|
yaak-plugins = { path = "crates/yaak-plugins" }
|
||||||
|
yaak-sse = { path = "crates/yaak-sse" }
|
||||||
|
yaak-sync = { path = "crates/yaak-sync" }
|
||||||
|
yaak-templates = { path = "crates/yaak-templates" }
|
||||||
|
yaak-tls = { path = "crates/yaak-tls" }
|
||||||
|
yaak-ws = { path = "crates/yaak-ws" }
|
||||||
|
|
||||||
|
# Internal crates - Tauri-specific
|
||||||
|
yaak-fonts = { path = "crates-tauri/yaak-fonts" }
|
||||||
|
yaak-license = { path = "crates-tauri/yaak-license" }
|
||||||
|
yaak-mac-window = { path = "crates-tauri/yaak-mac-window" }
|
||||||
|
yaak-tauri-utils = { path = "crates-tauri/yaak-tauri-utils" }
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
strip = false
|
||||||
@@ -54,9 +54,35 @@ Rerun the app to apply the migrations.
|
|||||||
|
|
||||||
_Note: For safety, development builds use a separate database location from production builds._
|
_Note: For safety, development builds use a separate database location from production builds._
|
||||||
|
|
||||||
## Lezer Grammer Generation
|
## Lezer Grammar Generation
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Example
|
# Example
|
||||||
lezer-generator components/core/Editor/<LANG>/<LANG>.grammar > components/core/Editor/<LANG>/<LANG>.ts
|
lezer-generator components/core/Editor/<LANG>/<LANG>.grammar > components/core/Editor/<LANG>/<LANG>.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Linting & Formatting
|
||||||
|
|
||||||
|
This repo uses Biome for linting and formatting (replacing ESLint + Prettier).
|
||||||
|
|
||||||
|
- Lint the entire repo:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
- Auto-fix lint issues where possible:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run lint:fix
|
||||||
|
```
|
||||||
|
|
||||||
|
- Format code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run format
|
||||||
|
```
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
- Many workspace packages also expose the same scripts (`lint`, `lint:fix`, and `format`).
|
||||||
|
- TypeScript type-checking still runs separately via `tsc --noEmit` in relevant packages.
|
||||||
|
|||||||
27
MCP_CLIENT_PLAN.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
# MCP Client Plan
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
Add an MCP client mode to Yaak so users can connect to and debug MCP servers.
|
||||||
|
|
||||||
|
## Core Design
|
||||||
|
- **Protocol layer:** Implement JSON‑RPC framing, message IDs, and notifications as the common core.
|
||||||
|
- **Transport interface:** Define an async trait with `connect`, `send`, `receive`, and `close` methods.
|
||||||
|
- **Transports:**
|
||||||
|
- Start with **Standard I/O** for local development.
|
||||||
|
- Reuse the existing HTTP stack for **HTTP streaming** next.
|
||||||
|
- Leave hooks for **WebSocket** support later.
|
||||||
|
|
||||||
|
## Integration
|
||||||
|
- Register MCP as a new request type alongside REST, GraphQL, gRPC, and WebSocket.
|
||||||
|
- Allow per‑request transport selection (stdio or HTTP).
|
||||||
|
- Map inbound messages into a new MCP response model that feeds existing timeline and debug views.
|
||||||
|
|
||||||
|
## Testing and Dog‑fooding
|
||||||
|
- Convert Yaak's own MCP server to Standard I/O for local testing.
|
||||||
|
- Use it internally to validate protocol behavior and message flow.
|
||||||
|
- Add unit and integration tests for JSON‑RPC messaging and transport abstractions.
|
||||||
|
|
||||||
|
## Future Refinements
|
||||||
|
- Add WebSocket transport support once core paths are stable.
|
||||||
|
- Extend timelines for protocol‑level visualization layered over raw transport events.
|
||||||
|
- Implement version and capability negotiation between client and server.
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/JamesIves/github-sponsors-readme-action">
|
<a href="https://github.com/JamesIves/github-sponsors-readme-action">
|
||||||
<img width="200px" src="https://github.com/mountain-loop/yaak/raw/main/src-tauri/icons/icon.png">
|
<img width="200px" src="https://github.com/mountain-loop/yaak/raw/main/crates-tauri/yaak-app/icons/icon.png">
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
@@ -19,10 +19,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<!-- sponsors-premium --><a href="https://github.com/MVST-Solutions"><img src="https://github.com/MVST-Solutions.png" width="80px" alt="User avatar: MVST-Solutions" /></a> <a href="https://github.com/dharsanb"><img src="https://github.com/dharsanb.png" width="80px" alt="User avatar: dharsanb" /></a> <a href="https://github.com/railwayapp"><img src="https://github.com/railwayapp.png" width="80px" alt="User avatar: railwayapp" /></a> <a href="https://github.com/caseyamcl"><img src="https://github.com/caseyamcl.png" width="80px" alt="User avatar: caseyamcl" /></a> <a href="https://github.com/andriyor"><img src="https://github.com/andriyor.png" width="80px" alt="User avatar: andriyor" /></a> <a href="https://github.com/"><img src="https://raw.githubusercontent.com/JamesIves/github-sponsors-readme-action/dev/.github/assets/placeholder.png" width="80px" alt="User avatar: " /></a> <!-- sponsors-premium -->
|
<!-- sponsors-premium --><a href="https://github.com/MVST-Solutions"><img src="https://github.com/MVST-Solutions.png" width="80px" alt="User avatar: MVST-Solutions" /></a> <a href="https://github.com/dharsanb"><img src="https://github.com/dharsanb.png" width="80px" alt="User avatar: dharsanb" /></a> <a href="https://github.com/railwayapp"><img src="https://github.com/railwayapp.png" width="80px" alt="User avatar: railwayapp" /></a> <a href="https://github.com/caseyamcl"><img src="https://github.com/caseyamcl.png" width="80px" alt="User avatar: caseyamcl" /></a> <a href="https://github.com/bytebase"><img src="https://github.com/bytebase.png" width="80px" alt="User avatar: bytebase" /></a> <a href="https://github.com/"><img src="https://raw.githubusercontent.com/JamesIves/github-sponsors-readme-action/dev/.github/assets/placeholder.png" width="80px" alt="User avatar: " /></a> <!-- sponsors-premium -->
|
||||||
</p>
|
</p>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<!-- sponsors-base --><a href="https://github.com/seanwash"><img src="https://github.com/seanwash.png" width="50px" alt="User avatar: seanwash" /></a> <a href="https://github.com/jerath"><img src="https://github.com/jerath.png" width="50px" alt="User avatar: jerath" /></a> <a href="https://github.com/itsa-sh"><img src="https://github.com/itsa-sh.png" width="50px" alt="User avatar: itsa-sh" /></a> <a href="https://github.com/dmmulroy"><img src="https://github.com/dmmulroy.png" width="50px" alt="User avatar: dmmulroy" /></a> <a href="https://github.com/timcole"><img src="https://github.com/timcole.png" width="50px" alt="User avatar: timcole" /></a> <a href="https://github.com/VLZH"><img src="https://github.com/VLZH.png" width="50px" alt="User avatar: VLZH" /></a> <a href="https://github.com/terasaka2k"><img src="https://github.com/terasaka2k.png" width="50px" alt="User avatar: terasaka2k" /></a> <a href="https://github.com/majudhu"><img src="https://github.com/majudhu.png" width="50px" alt="User avatar: majudhu" /></a> <!-- sponsors-base -->
|
<!-- sponsors-base --><a href="https://github.com/seanwash"><img src="https://github.com/seanwash.png" width="50px" alt="User avatar: seanwash" /></a> <a href="https://github.com/jerath"><img src="https://github.com/jerath.png" width="50px" alt="User avatar: jerath" /></a> <a href="https://github.com/itsa-sh"><img src="https://github.com/itsa-sh.png" width="50px" alt="User avatar: itsa-sh" /></a> <a href="https://github.com/dmmulroy"><img src="https://github.com/dmmulroy.png" width="50px" alt="User avatar: dmmulroy" /></a> <a href="https://github.com/timcole"><img src="https://github.com/timcole.png" width="50px" alt="User avatar: timcole" /></a> <a href="https://github.com/VLZH"><img src="https://github.com/VLZH.png" width="50px" alt="User avatar: VLZH" /></a> <a href="https://github.com/terasaka2k"><img src="https://github.com/terasaka2k.png" width="50px" alt="User avatar: terasaka2k" /></a> <a href="https://github.com/andriyor"><img src="https://github.com/andriyor.png" width="50px" alt="User avatar: andriyor" /></a> <a href="https://github.com/majudhu"><img src="https://github.com/majudhu.png" width="50px" alt="User avatar: majudhu" /></a> <a href="https://github.com/axelrindle"><img src="https://github.com/axelrindle.png" width="50px" alt="User avatar: axelrindle" /></a> <a href="https://github.com/jirizverina"><img src="https://github.com/jirizverina.png" width="50px" alt="User avatar: jirizverina" /></a> <a href="https://github.com/chip-well"><img src="https://github.com/chip-well.png" width="50px" alt="User avatar: chip-well" /></a> <a href="https://github.com/GRAYAH"><img src="https://github.com/GRAYAH.png" width="50px" alt="User avatar: GRAYAH" /></a> <a href="https://github.com/flashblaze"><img src="https://github.com/flashblaze.png" width="50px" alt="User avatar: flashblaze" /></a> <!-- sponsors-base -->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||

|

|
||||||
@@ -64,7 +64,7 @@ visit [`DEVELOPMENT.md`](DEVELOPMENT.md) for tips on setting up your environment
|
|||||||
## Useful Resources
|
## Useful Resources
|
||||||
|
|
||||||
- [Feedback and Bug Reports](https://feedback.yaak.app)
|
- [Feedback and Bug Reports](https://feedback.yaak.app)
|
||||||
- [Documentation](https://feedback.yaak.app/help)
|
- [Documentation](https://yaak.app/docs)
|
||||||
- [Yaak vs Postman](https://yaak.app/alternatives/postman)
|
- [Yaak vs Postman](https://yaak.app/alternatives/postman)
|
||||||
- [Yaak vs Bruno](https://yaak.app/alternatives/bruno)
|
- [Yaak vs Bruno](https://yaak.app/alternatives/bruno)
|
||||||
- [Yaak vs Insomnia](https://yaak.app/alternatives/insomnia)
|
- [Yaak vs Insomnia](https://yaak.app/alternatives/insomnia)
|
||||||
|
|||||||
53
biome.json
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://biomejs.dev/schemas/2.3.11/schema.json",
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true,
|
||||||
|
"a11y": {
|
||||||
|
"useKeyWithClickEvents": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"formatter": {
|
||||||
|
"enabled": true,
|
||||||
|
"indentStyle": "space",
|
||||||
|
"indentWidth": 2,
|
||||||
|
"lineWidth": 100,
|
||||||
|
"bracketSpacing": true
|
||||||
|
},
|
||||||
|
"css": {
|
||||||
|
"parser": {
|
||||||
|
"tailwindDirectives": true
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"javascript": {
|
||||||
|
"formatter": {
|
||||||
|
"quoteStyle": "single",
|
||||||
|
"jsxQuoteStyle": "double",
|
||||||
|
"trailingCommas": "all",
|
||||||
|
"semicolons": "always"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": {
|
||||||
|
"includes": [
|
||||||
|
"**",
|
||||||
|
"!**/node_modules",
|
||||||
|
"!**/dist",
|
||||||
|
"!**/build",
|
||||||
|
"!target",
|
||||||
|
"!scripts",
|
||||||
|
"!crates",
|
||||||
|
"!crates-tauri",
|
||||||
|
"!src-web/tailwind.config.cjs",
|
||||||
|
"!src-web/postcss.config.cjs",
|
||||||
|
"!src-web/vite.config.ts",
|
||||||
|
"!src-web/routeTree.gen.ts",
|
||||||
|
"!packages/plugin-runtime-types/lib",
|
||||||
|
"!**/bindings"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
22
crates-cli/yaak-cli/Cargo.toml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
[package]
|
||||||
|
name = "yaak-cli"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "yaakcli"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
clap = { version = "4", features = ["derive"] }
|
||||||
|
dirs = "6"
|
||||||
|
env_logger = "0.11"
|
||||||
|
log = { workspace = true }
|
||||||
|
serde_json = { workspace = true }
|
||||||
|
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
|
||||||
|
yaak-crypto = { workspace = true }
|
||||||
|
yaak-http = { workspace = true }
|
||||||
|
yaak-models = { workspace = true }
|
||||||
|
yaak-plugins = { workspace = true }
|
||||||
|
yaak-templates = { workspace = true }
|
||||||
198
crates-cli/yaak-cli/PLAN.md
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
# CLI Command Architecture Plan
|
||||||
|
|
||||||
|
## Goal
|
||||||
|
|
||||||
|
Redesign the yaak-cli command structure to use a resource-oriented `<resource> <action>`
|
||||||
|
pattern that scales well, is discoverable, and supports both human and LLM workflows.
|
||||||
|
|
||||||
|
## Command Architecture
|
||||||
|
|
||||||
|
### Design Principles
|
||||||
|
|
||||||
|
- **Resource-oriented**: top-level commands are nouns, subcommands are verbs
|
||||||
|
- **Polymorphic requests**: `request` covers HTTP, gRPC, and WebSocket — the CLI
|
||||||
|
resolves the type via `get_any_request` and adapts behavior accordingly
|
||||||
|
- **Simple creation, full-fidelity via JSON**: human-friendly flags for basic creation,
|
||||||
|
`--json` for full control (targeted at LLM and scripting workflows)
|
||||||
|
- **Runtime schema introspection**: `request schema` outputs JSON Schema for the request
|
||||||
|
models, with dynamic auth fields populated from loaded plugins at runtime
|
||||||
|
- **Destructive actions require confirmation**: `delete` commands prompt for user
|
||||||
|
confirmation before proceeding. Can be bypassed with `--yes` / `-y` for scripting
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
```
|
||||||
|
# Top-level shortcut
|
||||||
|
yaakcli send <id> [-e <env_id>] # id can be a request, folder, or workspace
|
||||||
|
|
||||||
|
# Resource commands
|
||||||
|
yaakcli workspace list
|
||||||
|
yaakcli workspace show <id>
|
||||||
|
yaakcli workspace create --name <name>
|
||||||
|
yaakcli workspace create --json '{"name": "My Workspace"}'
|
||||||
|
yaakcli workspace create '{"name": "My Workspace"}' # positional JSON shorthand
|
||||||
|
yaakcli workspace update --json '{"id": "wk_abc", "name": "New Name"}'
|
||||||
|
yaakcli workspace delete <id>
|
||||||
|
|
||||||
|
yaakcli request list <workspace_id>
|
||||||
|
yaakcli request show <id>
|
||||||
|
yaakcli request create <workspace_id> --name <name> --url <url> [--method GET]
|
||||||
|
yaakcli request create --json '{"workspaceId": "wk_abc", "url": "..."}'
|
||||||
|
yaakcli request update --json '{"id": "rq_abc", "url": "https://new.com"}'
|
||||||
|
yaakcli request send <id> [-e <env_id>]
|
||||||
|
yaakcli request delete <id>
|
||||||
|
yaakcli request schema <http|grpc|websocket>
|
||||||
|
|
||||||
|
yaakcli folder list <workspace_id>
|
||||||
|
yaakcli folder show <id>
|
||||||
|
yaakcli folder create <workspace_id> --name <name>
|
||||||
|
yaakcli folder create --json '{"workspaceId": "wk_abc", "name": "Auth"}'
|
||||||
|
yaakcli folder update --json '{"id": "fl_abc", "name": "New Name"}'
|
||||||
|
yaakcli folder delete <id>
|
||||||
|
|
||||||
|
yaakcli environment list <workspace_id>
|
||||||
|
yaakcli environment show <id>
|
||||||
|
yaakcli environment create <workspace_id> --name <name>
|
||||||
|
yaakcli environment create --json '{"workspaceId": "wk_abc", "name": "Production"}'
|
||||||
|
yaakcli environment update --json '{"id": "ev_abc", ...}'
|
||||||
|
yaakcli environment delete <id>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### `send` — Top-Level Shortcut
|
||||||
|
|
||||||
|
`yaakcli send <id>` is a convenience alias that accepts any sendable ID. It tries
|
||||||
|
each type in order via DB lookups (short-circuiting on first match):
|
||||||
|
|
||||||
|
1. Request (HTTP, gRPC, or WebSocket via `get_any_request`)
|
||||||
|
2. Folder (sends all requests in the folder)
|
||||||
|
3. Workspace (sends all requests in the workspace)
|
||||||
|
|
||||||
|
ID prefixes exist (e.g. `rq_`, `fl_`, `wk_`) but are not relied upon — resolution
|
||||||
|
is purely by DB lookup.
|
||||||
|
|
||||||
|
`request send <id>` is the same but restricted to request IDs only.
|
||||||
|
|
||||||
|
### Request Send — Polymorphic Behavior
|
||||||
|
|
||||||
|
`send` means "execute this request" regardless of protocol:
|
||||||
|
|
||||||
|
- **HTTP**: send request, print response, exit
|
||||||
|
- **gRPC**: invoke the method; for streaming, stream output to stdout until done/Ctrl+C
|
||||||
|
- **WebSocket**: connect, stream messages to stdout until closed/Ctrl+C
|
||||||
|
|
||||||
|
### `request schema` — Runtime JSON Schema
|
||||||
|
|
||||||
|
Outputs a JSON Schema describing the full request shape, including dynamic fields:
|
||||||
|
|
||||||
|
1. Generate base schema from `schemars::JsonSchema` derive on the Rust model structs
|
||||||
|
2. Load plugins, collect auth strategy definitions and their form inputs
|
||||||
|
3. Merge plugin-defined auth fields into the `authentication` property as a `oneOf`
|
||||||
|
4. Output the combined schema as JSON
|
||||||
|
|
||||||
|
This lets an LLM call `schema`, read the shape, and construct valid JSON for
|
||||||
|
`create --json` or `update --json`.
|
||||||
|
|
||||||
|
## Implementation Steps
|
||||||
|
|
||||||
|
### Phase 1: Restructure commands (no new functionality)
|
||||||
|
|
||||||
|
Refactor `main.rs` into the new resource/action pattern using clap subcommand nesting.
|
||||||
|
Existing behavior stays the same, just reorganized. Remove the `get` command.
|
||||||
|
|
||||||
|
1. Create module structure: `commands/workspace.rs`, `commands/request.rs`, etc.
|
||||||
|
2. Define nested clap enums:
|
||||||
|
```rust
|
||||||
|
enum Commands {
|
||||||
|
Send(SendArgs),
|
||||||
|
Workspace(WorkspaceArgs),
|
||||||
|
Request(RequestArgs),
|
||||||
|
Folder(FolderArgs),
|
||||||
|
Environment(EnvironmentArgs),
|
||||||
|
}
|
||||||
|
```
|
||||||
|
3. Move existing `Workspaces` logic into `workspace list`
|
||||||
|
4. Move existing `Requests` logic into `request list`
|
||||||
|
5. Move existing `Send` logic into `request send`
|
||||||
|
6. Move existing `Create` logic into `request create`
|
||||||
|
7. Delete the `Get` command entirely
|
||||||
|
8. Extract shared setup (DB init, plugin init, encryption) into a reusable context struct
|
||||||
|
|
||||||
|
### Phase 2: Add missing CRUD commands
|
||||||
|
|
||||||
|
1. `workspace show <id>`
|
||||||
|
2. `workspace create --name <name>` (and `--json`)
|
||||||
|
3. `workspace update --json`
|
||||||
|
4. `workspace delete <id>`
|
||||||
|
5. `request show <id>` (JSON output of the full request model)
|
||||||
|
6. `request delete <id>`
|
||||||
|
7. `folder list <workspace_id>`
|
||||||
|
8. `folder show <id>`
|
||||||
|
9. `folder create <workspace_id> --name <name>` (and `--json`)
|
||||||
|
10. `folder update --json`
|
||||||
|
11. `folder delete <id>`
|
||||||
|
12. `environment list <workspace_id>`
|
||||||
|
13. `environment show <id>`
|
||||||
|
14. `environment create <workspace_id> --name <name>` (and `--json`)
|
||||||
|
15. `environment update --json`
|
||||||
|
16. `environment delete <id>`
|
||||||
|
|
||||||
|
### Phase 3: JSON input for create/update
|
||||||
|
|
||||||
|
Both commands accept JSON via `--json <string>` or as a positional argument (detected
|
||||||
|
by leading `{`). They follow the same upsert pattern as the plugin API.
|
||||||
|
|
||||||
|
- **`create --json`**: JSON must include `workspaceId`. Must NOT include `id` (or
|
||||||
|
use empty string `""`). Deserializes into the model with defaults for missing fields,
|
||||||
|
then upserts (insert).
|
||||||
|
- **`update --json`**: JSON must include `id`. Performs a fetch-merge-upsert:
|
||||||
|
1. Fetch the existing model from DB
|
||||||
|
2. Serialize it to `serde_json::Value`
|
||||||
|
3. Deep-merge the user's partial JSON on top (JSON Merge Patch / RFC 7386 semantics)
|
||||||
|
4. Deserialize back into the typed model
|
||||||
|
5. Upsert (update)
|
||||||
|
|
||||||
|
This matches how the MCP server plugin already does it (fetch existing, spread, override),
|
||||||
|
but the CLI handles the merge server-side so callers don't have to.
|
||||||
|
|
||||||
|
Setting a field to `null` removes it (for `Option<T>` fields), per RFC 7386.
|
||||||
|
|
||||||
|
Implementation:
|
||||||
|
1. Add `--json` flag and positional JSON detection to `create` commands
|
||||||
|
2. Add `update` commands with required `--json` flag
|
||||||
|
3. Implement JSON merge utility (or use `json-patch` crate)
|
||||||
|
|
||||||
|
### Phase 4: Runtime schema generation
|
||||||
|
|
||||||
|
1. Add `schemars` dependency to `yaak-models`
|
||||||
|
2. Derive `JsonSchema` on `HttpRequest`, `GrpcRequest`, `WebsocketRequest`, and their
|
||||||
|
nested types (`HttpRequestHeader`, `HttpUrlParameter`, etc.)
|
||||||
|
3. Implement `request schema` command:
|
||||||
|
- Generate base schema from schemars
|
||||||
|
- Query plugins for auth strategy form inputs
|
||||||
|
- Convert plugin form inputs into JSON Schema properties
|
||||||
|
- Merge into the `authentication` field
|
||||||
|
- Print to stdout
|
||||||
|
|
||||||
|
### Phase 5: Polymorphic send
|
||||||
|
|
||||||
|
1. Update `request send` to use `get_any_request` to resolve the request type
|
||||||
|
2. Match on `AnyRequest` variant and dispatch to the appropriate sender:
|
||||||
|
- `AnyRequest::HttpRequest` — existing HTTP send logic
|
||||||
|
- `AnyRequest::GrpcRequest` — gRPC invoke (future implementation)
|
||||||
|
- `AnyRequest::WebsocketRequest` — WebSocket connect (future implementation)
|
||||||
|
3. gRPC and WebSocket send can initially return "not yet implemented" errors
|
||||||
|
|
||||||
|
### Phase 6: Top-level `send` and folder/workspace send
|
||||||
|
|
||||||
|
1. Add top-level `yaakcli send <id>` command
|
||||||
|
2. Resolve ID by trying DB lookups in order: any_request → folder → workspace
|
||||||
|
3. For folder: list all requests in folder, send each
|
||||||
|
4. For workspace: list all requests in workspace, send each
|
||||||
|
5. Add execution options: `--sequential` (default), `--parallel`, `--fail-fast`
|
||||||
|
|
||||||
|
## Crate Changes
|
||||||
|
|
||||||
|
- **yaak-cli**: restructure into modules, new clap hierarchy
|
||||||
|
- **yaak-models**: add `schemars` dependency, derive `JsonSchema` on model structs
|
||||||
|
(current derives: `Debug, Clone, PartialEq, Serialize, Deserialize, Default, TS`)
|
||||||
409
crates-cli/yaak-cli/src/main.rs
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
use clap::{Parser, Subcommand};
|
||||||
|
use log::info;
|
||||||
|
use serde_json::Value;
|
||||||
|
use std::collections::BTreeMap;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
use std::sync::Arc;
|
||||||
|
use tokio::sync::mpsc;
|
||||||
|
use yaak_crypto::manager::EncryptionManager;
|
||||||
|
use yaak_http::path_placeholders::apply_path_placeholders;
|
||||||
|
use yaak_http::sender::{HttpSender, ReqwestSender};
|
||||||
|
use yaak_http::types::{SendableHttpRequest, SendableHttpRequestOptions};
|
||||||
|
use yaak_models::models::{HttpRequest, HttpRequestHeader, HttpUrlParameter};
|
||||||
|
use yaak_models::render::make_vars_hashmap;
|
||||||
|
use yaak_models::util::UpdateSource;
|
||||||
|
use yaak_plugins::events::{PluginContext, RenderPurpose};
|
||||||
|
use yaak_plugins::manager::PluginManager;
|
||||||
|
use yaak_plugins::template_callback::PluginTemplateCallback;
|
||||||
|
use yaak_templates::{RenderOptions, parse_and_render, render_json_value_raw};
|
||||||
|
|
||||||
|
#[derive(Parser)]
|
||||||
|
#[command(name = "yaakcli")]
|
||||||
|
#[command(about = "Yaak CLI - API client from the command line")]
|
||||||
|
struct Cli {
|
||||||
|
/// Use a custom data directory
|
||||||
|
#[arg(long, global = true)]
|
||||||
|
data_dir: Option<PathBuf>,
|
||||||
|
|
||||||
|
/// Environment ID to use for variable substitution
|
||||||
|
#[arg(long, short, global = true)]
|
||||||
|
environment: Option<String>,
|
||||||
|
|
||||||
|
/// Enable verbose logging
|
||||||
|
#[arg(long, short, global = true)]
|
||||||
|
verbose: bool,
|
||||||
|
|
||||||
|
#[command(subcommand)]
|
||||||
|
command: Commands,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
enum Commands {
|
||||||
|
/// List all workspaces
|
||||||
|
Workspaces,
|
||||||
|
/// List requests in a workspace
|
||||||
|
Requests {
|
||||||
|
/// Workspace ID
|
||||||
|
workspace_id: String,
|
||||||
|
},
|
||||||
|
/// Send an HTTP request by ID
|
||||||
|
Send {
|
||||||
|
/// Request ID
|
||||||
|
request_id: String,
|
||||||
|
},
|
||||||
|
/// Send a GET request to a URL
|
||||||
|
Get {
|
||||||
|
/// URL to request
|
||||||
|
url: String,
|
||||||
|
},
|
||||||
|
/// Create a new HTTP request
|
||||||
|
Create {
|
||||||
|
/// Workspace ID
|
||||||
|
workspace_id: String,
|
||||||
|
/// Request name
|
||||||
|
#[arg(short, long)]
|
||||||
|
name: String,
|
||||||
|
/// HTTP method
|
||||||
|
#[arg(short, long, default_value = "GET")]
|
||||||
|
method: String,
|
||||||
|
/// URL
|
||||||
|
#[arg(short, long)]
|
||||||
|
url: String,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Render an HTTP request with template variables and plugin functions
|
||||||
|
async fn render_http_request(
|
||||||
|
r: &HttpRequest,
|
||||||
|
environment_chain: Vec<yaak_models::models::Environment>,
|
||||||
|
cb: &PluginTemplateCallback,
|
||||||
|
opt: &RenderOptions,
|
||||||
|
) -> yaak_templates::error::Result<HttpRequest> {
|
||||||
|
let vars = &make_vars_hashmap(environment_chain);
|
||||||
|
|
||||||
|
let mut url_parameters = Vec::new();
|
||||||
|
for p in r.url_parameters.clone() {
|
||||||
|
if !p.enabled {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
url_parameters.push(HttpUrlParameter {
|
||||||
|
enabled: p.enabled,
|
||||||
|
name: parse_and_render(p.name.as_str(), vars, cb, opt).await?,
|
||||||
|
value: parse_and_render(p.value.as_str(), vars, cb, opt).await?,
|
||||||
|
id: p.id,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut headers = Vec::new();
|
||||||
|
for p in r.headers.clone() {
|
||||||
|
if !p.enabled {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
headers.push(HttpRequestHeader {
|
||||||
|
enabled: p.enabled,
|
||||||
|
name: parse_and_render(p.name.as_str(), vars, cb, opt).await?,
|
||||||
|
value: parse_and_render(p.value.as_str(), vars, cb, opt).await?,
|
||||||
|
id: p.id,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut body = BTreeMap::new();
|
||||||
|
for (k, v) in r.body.clone() {
|
||||||
|
body.insert(k, render_json_value_raw(v, vars, cb, opt).await?);
|
||||||
|
}
|
||||||
|
|
||||||
|
let authentication = {
|
||||||
|
let mut disabled = false;
|
||||||
|
let mut auth = BTreeMap::new();
|
||||||
|
match r.authentication.get("disabled") {
|
||||||
|
Some(Value::Bool(true)) => {
|
||||||
|
disabled = true;
|
||||||
|
}
|
||||||
|
Some(Value::String(tmpl)) => {
|
||||||
|
disabled = parse_and_render(tmpl.as_str(), vars, cb, opt)
|
||||||
|
.await
|
||||||
|
.unwrap_or_default()
|
||||||
|
.is_empty();
|
||||||
|
info!(
|
||||||
|
"Rendering authentication.disabled as a template: {disabled} from \"{tmpl}\""
|
||||||
|
);
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
if disabled {
|
||||||
|
auth.insert("disabled".to_string(), Value::Bool(true));
|
||||||
|
} else {
|
||||||
|
for (k, v) in r.authentication.clone() {
|
||||||
|
if k == "disabled" {
|
||||||
|
auth.insert(k, Value::Bool(false));
|
||||||
|
} else {
|
||||||
|
auth.insert(k, render_json_value_raw(v, vars, cb, opt).await?);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
auth
|
||||||
|
};
|
||||||
|
|
||||||
|
let url = parse_and_render(r.url.clone().as_str(), vars, cb, opt).await?;
|
||||||
|
|
||||||
|
// Apply path placeholders (e.g., /users/:id -> /users/123)
|
||||||
|
let (url, url_parameters) = apply_path_placeholders(&url, &url_parameters);
|
||||||
|
|
||||||
|
Ok(HttpRequest { url, url_parameters, headers, body, authentication, ..r.to_owned() })
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let cli = Cli::parse();
|
||||||
|
|
||||||
|
// Initialize logging
|
||||||
|
if cli.verbose {
|
||||||
|
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Use the same app_id for both data directory and keyring
|
||||||
|
let app_id = if cfg!(debug_assertions) { "app.yaak.desktop.dev" } else { "app.yaak.desktop" };
|
||||||
|
|
||||||
|
let data_dir = cli.data_dir.unwrap_or_else(|| {
|
||||||
|
dirs::data_dir().expect("Could not determine data directory").join(app_id)
|
||||||
|
});
|
||||||
|
|
||||||
|
let db_path = data_dir.join("db.sqlite");
|
||||||
|
let blob_path = data_dir.join("blobs.sqlite");
|
||||||
|
|
||||||
|
let (query_manager, _blob_manager, _rx) =
|
||||||
|
yaak_models::init_standalone(&db_path, &blob_path).expect("Failed to initialize database");
|
||||||
|
|
||||||
|
let db = query_manager.connect();
|
||||||
|
|
||||||
|
// Initialize encryption manager for secure() template function
|
||||||
|
// Use the same app_id as the Tauri app for keyring access
|
||||||
|
let encryption_manager = Arc::new(EncryptionManager::new(query_manager.clone(), app_id));
|
||||||
|
|
||||||
|
// Initialize plugin manager for template functions
|
||||||
|
let vendored_plugin_dir = data_dir.join("vendored-plugins");
|
||||||
|
let installed_plugin_dir = data_dir.join("installed-plugins");
|
||||||
|
|
||||||
|
// Use system node for CLI (must be in PATH)
|
||||||
|
let node_bin_path = PathBuf::from("node");
|
||||||
|
|
||||||
|
// Find the plugin runtime - check YAAK_PLUGIN_RUNTIME env var, then fallback to development path
|
||||||
|
let plugin_runtime_main =
|
||||||
|
std::env::var("YAAK_PLUGIN_RUNTIME").map(PathBuf::from).unwrap_or_else(|_| {
|
||||||
|
// Development fallback: look relative to crate root
|
||||||
|
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||||
|
.join("../../crates-tauri/yaak-app/vendored/plugin-runtime/index.cjs")
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create plugin manager (plugins may not be available in CLI context)
|
||||||
|
let plugin_manager = Arc::new(
|
||||||
|
PluginManager::new(
|
||||||
|
vendored_plugin_dir,
|
||||||
|
installed_plugin_dir,
|
||||||
|
node_bin_path,
|
||||||
|
plugin_runtime_main,
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
.await,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Initialize plugins from database
|
||||||
|
let plugins = db.list_plugins().unwrap_or_default();
|
||||||
|
if !plugins.is_empty() {
|
||||||
|
let errors =
|
||||||
|
plugin_manager.initialize_all_plugins(plugins, &PluginContext::new_empty()).await;
|
||||||
|
for (plugin_dir, error_msg) in errors {
|
||||||
|
eprintln!("Warning: Failed to initialize plugin '{}': {}", plugin_dir, error_msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
match cli.command {
|
||||||
|
Commands::Workspaces => {
|
||||||
|
let workspaces = db.list_workspaces().expect("Failed to list workspaces");
|
||||||
|
if workspaces.is_empty() {
|
||||||
|
println!("No workspaces found");
|
||||||
|
} else {
|
||||||
|
for ws in workspaces {
|
||||||
|
println!("{} - {}", ws.id, ws.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Commands::Requests { workspace_id } => {
|
||||||
|
let requests = db.list_http_requests(&workspace_id).expect("Failed to list requests");
|
||||||
|
if requests.is_empty() {
|
||||||
|
println!("No requests found in workspace {}", workspace_id);
|
||||||
|
} else {
|
||||||
|
for req in requests {
|
||||||
|
println!("{} - {} {}", req.id, req.method, req.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Commands::Send { request_id } => {
|
||||||
|
let request = db.get_http_request(&request_id).expect("Failed to get request");
|
||||||
|
|
||||||
|
// Resolve environment chain for variable substitution
|
||||||
|
let environment_chain = db
|
||||||
|
.resolve_environments(
|
||||||
|
&request.workspace_id,
|
||||||
|
request.folder_id.as_deref(),
|
||||||
|
cli.environment.as_deref(),
|
||||||
|
)
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
|
// Create template callback with plugin support
|
||||||
|
let plugin_context = PluginContext::new(None, Some(request.workspace_id.clone()));
|
||||||
|
let template_callback = PluginTemplateCallback::new(
|
||||||
|
plugin_manager.clone(),
|
||||||
|
encryption_manager.clone(),
|
||||||
|
&plugin_context,
|
||||||
|
RenderPurpose::Send,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Render templates in the request
|
||||||
|
let rendered_request = render_http_request(
|
||||||
|
&request,
|
||||||
|
environment_chain,
|
||||||
|
&template_callback,
|
||||||
|
&RenderOptions::throw(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("Failed to render request templates");
|
||||||
|
|
||||||
|
if cli.verbose {
|
||||||
|
println!("> {} {}", rendered_request.method, rendered_request.url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert to sendable request
|
||||||
|
let sendable = SendableHttpRequest::from_http_request(
|
||||||
|
&rendered_request,
|
||||||
|
SendableHttpRequestOptions::default(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("Failed to build request");
|
||||||
|
|
||||||
|
// Create event channel for progress
|
||||||
|
let (event_tx, mut event_rx) = mpsc::channel(100);
|
||||||
|
|
||||||
|
// Spawn task to print events if verbose
|
||||||
|
let verbose = cli.verbose;
|
||||||
|
let verbose_handle = if verbose {
|
||||||
|
Some(tokio::spawn(async move {
|
||||||
|
while let Some(event) = event_rx.recv().await {
|
||||||
|
println!("{}", event);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
// Drain events silently
|
||||||
|
tokio::spawn(async move { while event_rx.recv().await.is_some() {} });
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
|
// Send the request
|
||||||
|
let sender = ReqwestSender::new().expect("Failed to create HTTP client");
|
||||||
|
let response = sender.send(sendable, event_tx).await.expect("Failed to send request");
|
||||||
|
|
||||||
|
// Wait for event handler to finish
|
||||||
|
if let Some(handle) = verbose_handle {
|
||||||
|
let _ = handle.await;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print response
|
||||||
|
if verbose {
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
println!(
|
||||||
|
"HTTP {} {}",
|
||||||
|
response.status,
|
||||||
|
response.status_reason.as_deref().unwrap_or("")
|
||||||
|
);
|
||||||
|
|
||||||
|
if verbose {
|
||||||
|
for (name, value) in &response.headers {
|
||||||
|
println!("{}: {}", name, value);
|
||||||
|
}
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print body
|
||||||
|
let (body, _stats) = response.text().await.expect("Failed to read response body");
|
||||||
|
println!("{}", body);
|
||||||
|
}
|
||||||
|
Commands::Get { url } => {
|
||||||
|
if cli.verbose {
|
||||||
|
println!("> GET {}", url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build a simple GET request
|
||||||
|
let sendable = SendableHttpRequest {
|
||||||
|
url: url.clone(),
|
||||||
|
method: "GET".to_string(),
|
||||||
|
headers: vec![],
|
||||||
|
body: None,
|
||||||
|
options: SendableHttpRequestOptions::default(),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create event channel for progress
|
||||||
|
let (event_tx, mut event_rx) = mpsc::channel(100);
|
||||||
|
|
||||||
|
// Spawn task to print events if verbose
|
||||||
|
let verbose = cli.verbose;
|
||||||
|
let verbose_handle = if verbose {
|
||||||
|
Some(tokio::spawn(async move {
|
||||||
|
while let Some(event) = event_rx.recv().await {
|
||||||
|
println!("{}", event);
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
tokio::spawn(async move { while event_rx.recv().await.is_some() {} });
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
|
// Send the request
|
||||||
|
let sender = ReqwestSender::new().expect("Failed to create HTTP client");
|
||||||
|
let response = sender.send(sendable, event_tx).await.expect("Failed to send request");
|
||||||
|
|
||||||
|
if let Some(handle) = verbose_handle {
|
||||||
|
let _ = handle.await;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print response
|
||||||
|
if verbose {
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
println!(
|
||||||
|
"HTTP {} {}",
|
||||||
|
response.status,
|
||||||
|
response.status_reason.as_deref().unwrap_or("")
|
||||||
|
);
|
||||||
|
|
||||||
|
if verbose {
|
||||||
|
for (name, value) in &response.headers {
|
||||||
|
println!("{}: {}", name, value);
|
||||||
|
}
|
||||||
|
println!();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print body
|
||||||
|
let (body, _stats) = response.text().await.expect("Failed to read response body");
|
||||||
|
println!("{}", body);
|
||||||
|
}
|
||||||
|
Commands::Create { workspace_id, name, method, url } => {
|
||||||
|
let request = HttpRequest {
|
||||||
|
workspace_id,
|
||||||
|
name,
|
||||||
|
method: method.to_uppercase(),
|
||||||
|
url,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let created = db
|
||||||
|
.upsert_http_request(&request, &UpdateSource::Sync)
|
||||||
|
.expect("Failed to create request");
|
||||||
|
|
||||||
|
println!("Created request: {}", created.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Terminate plugin manager gracefully
|
||||||
|
plugin_manager.terminate().await;
|
||||||
|
}
|
||||||
76
crates-tauri/yaak-app/Cargo.toml
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
[package]
|
||||||
|
name = "yaak-app"
|
||||||
|
version = "0.0.0"
|
||||||
|
edition = "2024"
|
||||||
|
authors = ["Gregory Schier"]
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
# Produce a library for mobile support
|
||||||
|
[lib]
|
||||||
|
name = "tauri_app_lib"
|
||||||
|
crate-type = ["staticlib", "cdylib", "lib"]
|
||||||
|
|
||||||
|
[features]
|
||||||
|
cargo-clippy = []
|
||||||
|
default = []
|
||||||
|
updater = []
|
||||||
|
license = ["yaak-license"]
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
tauri-build = { version = "2.5.3", features = [] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
|
openssl-sys = { version = "0.9.105", features = ["vendored"] } # For Ubuntu installation to work
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
charset = "0.1.5"
|
||||||
|
chrono = { workspace = true, features = ["serde"] }
|
||||||
|
cookie = "0.18.1"
|
||||||
|
eventsource-client = { git = "https://github.com/yaakapp/rust-eventsource-client", version = "0.14.0" }
|
||||||
|
http = { version = "1.2.0", default-features = false }
|
||||||
|
log = { workspace = true }
|
||||||
|
md5 = "0.8.0"
|
||||||
|
r2d2 = "0.8.10"
|
||||||
|
r2d2_sqlite = "0.25.0"
|
||||||
|
mime_guess = "2.0.5"
|
||||||
|
rand = "0.9.0"
|
||||||
|
reqwest = { workspace = true, features = ["multipart", "gzip", "brotli", "deflate", "json", "rustls-tls-manual-roots-no-provider", "socks", "http2"] }
|
||||||
|
serde = { workspace = true, features = ["derive"] }
|
||||||
|
serde_json = { workspace = true, features = ["raw_value"] }
|
||||||
|
tauri = { workspace = true, features = ["devtools", "protocol-asset"] }
|
||||||
|
tauri-plugin-clipboard-manager = "2.3.2"
|
||||||
|
tauri-plugin-deep-link = "2.4.5"
|
||||||
|
tauri-plugin-dialog = { workspace = true }
|
||||||
|
tauri-plugin-fs = "2.4.4"
|
||||||
|
tauri-plugin-log = { version = "2.7.1", features = ["colored"] }
|
||||||
|
tauri-plugin-opener = "2.5.2"
|
||||||
|
tauri-plugin-os = "2.3.2"
|
||||||
|
tauri-plugin-shell = { workspace = true }
|
||||||
|
tauri-plugin-single-instance = { version = "2.3.6", features = ["deep-link"] }
|
||||||
|
tauri-plugin-updater = "2.9.0"
|
||||||
|
tauri-plugin-window-state = "2.4.1"
|
||||||
|
thiserror = { workspace = true }
|
||||||
|
tokio = { workspace = true, features = ["sync"] }
|
||||||
|
tokio-stream = "0.1.17"
|
||||||
|
tokio-tungstenite = { version = "0.26.2", default-features = false }
|
||||||
|
url = "2"
|
||||||
|
tokio-util = { version = "0.7", features = ["codec"] }
|
||||||
|
ts-rs = { workspace = true }
|
||||||
|
uuid = "1.12.1"
|
||||||
|
yaak-common = { workspace = true }
|
||||||
|
yaak-tauri-utils = { workspace = true }
|
||||||
|
yaak-core = { workspace = true }
|
||||||
|
yaak-crypto = { workspace = true }
|
||||||
|
yaak-fonts = { workspace = true }
|
||||||
|
yaak-git = { workspace = true }
|
||||||
|
yaak-grpc = { workspace = true }
|
||||||
|
yaak-http = { workspace = true }
|
||||||
|
yaak-license = { workspace = true, optional = true }
|
||||||
|
yaak-mac-window = { workspace = true }
|
||||||
|
yaak-models = { workspace = true }
|
||||||
|
yaak-plugins = { workspace = true }
|
||||||
|
yaak-sse = { workspace = true }
|
||||||
|
yaak-sync = { workspace = true }
|
||||||
|
yaak-templates = { workspace = true }
|
||||||
|
yaak-tls = { workspace = true }
|
||||||
|
yaak-ws = { workspace = true }
|
||||||
3
crates-tauri/yaak-app/bindings/gen_watch.ts
generated
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
|
||||||
|
export type WatchResult = { unlistenEvent: string, };
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
|
||||||
|
export type PluginUpdateInfo = { name: string, currentVersion: string, latestVersion: string, };
|
||||||
|
|
||||||
|
export type PluginUpdateNotification = { updateCount: number, plugins: Array<PluginUpdateInfo>, };
|
||||||
|
|
||||||
export type UpdateInfo = { replyEventId: string, version: string, downloaded: boolean, };
|
export type UpdateInfo = { replyEventId: string, version: string, downloaded: boolean, };
|
||||||
|
|
||||||
export type UpdateResponse = { "type": "ack" } | { "type": "action", action: UpdateResponseAction, };
|
export type UpdateResponse = { "type": "ack" } | { "type": "action", action: UpdateResponseAction, };
|
||||||
|
|
||||||
export type UpdateResponseAction = "install" | "skip";
|
export type UpdateResponseAction = "install" | "skip";
|
||||||
|
|
||||||
|
export type WatchResult = { unlistenEvent: string, };
|
||||||
|
|
||||||
export type YaakNotification = { timestamp: string, timeout: number | null, id: string, title: string | null, message: string, color: string | null, action: YaakNotificationAction | null, };
|
export type YaakNotification = { timestamp: string, timeout: number | null, id: string, title: string | null, message: string, color: string | null, action: YaakNotificationAction | null, };
|
||||||
|
|
||||||
export type YaakNotificationAction = { label: string, url: string, };
|
export type YaakNotificationAction = { label: string, url: string, };
|
||||||
5
crates-tauri/yaak-app/bindings/plugins_ext.ts
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
|
||||||
|
export type PluginUpdateInfo = { name: string, currentVersion: string, latestVersion: string, };
|
||||||
|
|
||||||
|
export type PluginUpdateNotification = { updateCount: number, plugins: Array<PluginUpdateInfo>, };
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
"core:event:allow-listen",
|
"core:event:allow-listen",
|
||||||
"core:event:allow-unlisten",
|
"core:event:allow-unlisten",
|
||||||
"core:path:allow-resolve-directory",
|
"core:path:allow-resolve-directory",
|
||||||
|
"core:path:allow-basename",
|
||||||
"os:allow-os-type",
|
"os:allow-os-type",
|
||||||
"clipboard-manager:allow-clear",
|
"clipboard-manager:allow-clear",
|
||||||
"clipboard-manager:allow-write-text",
|
"clipboard-manager:allow-write-text",
|
||||||
@@ -50,13 +51,7 @@
|
|||||||
"opener:allow-open-url",
|
"opener:allow-open-url",
|
||||||
"opener:allow-reveal-item-in-dir",
|
"opener:allow-reveal-item-in-dir",
|
||||||
"shell:allow-open",
|
"shell:allow-open",
|
||||||
"yaak-crypto:default",
|
|
||||||
"yaak-fonts:default",
|
"yaak-fonts:default",
|
||||||
"yaak-git:default",
|
"yaak-mac-window:default"
|
||||||
"yaak-mac-window:default",
|
|
||||||
"yaak-models:default",
|
|
||||||
"yaak-plugins:default",
|
|
||||||
"yaak-sync:default",
|
|
||||||
"yaak-ws:default"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 848 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 356 KiB After Width: | Height: | Size: 356 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |