[PR #415] [MERGED] CLI plugin host: handle send/render HTTP requests #965

Closed
opened 2026-04-20 19:54:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mountain-loop/yaak/pull/415
Author: @gschier
Created: 3/3/2026
Status: Merged
Merged: 3/4/2026
Merged by: @gschier

Base: mainHead: gschier/cli-plugin-send-render-http


📝 Commits (7)

  • fb5ad8c cli: handle send/render http plugin host requests
  • ef63b88 cli: add grpc/template render handlers and unsupported event errors
  • b01b3a4 cli: implement plugin host render/send context and cookie jar support
  • ad31755 feat(cli): add plugin install and complete prompt/render host events
  • 2439ffd chore: remove prompt form CLI test plugin scaffold
  • 77e3c85 refactor(cli): move DB and encryption init into CliContext::new
  • f61cf2e fix(cli): resolve folder_id for template render environment chain

📊 Changes

18 files changed (+1811 additions, -361 deletions)

View changed files

📝 Cargo.lock (+118 -7)
📝 crates-cli/yaak-cli/Cargo.toml (+2 -0)
📝 crates-cli/yaak-cli/src/cli.rs (+38 -6)
crates-cli/yaak-cli/src/commands/cookie_jar.rs (+42 -0)
📝 crates-cli/yaak-cli/src/commands/environment.rs (+14 -7)
📝 crates-cli/yaak-cli/src/commands/folder.rs (+13 -7)
📝 crates-cli/yaak-cli/src/commands/mod.rs (+1 -0)
📝 crates-cli/yaak-cli/src/commands/plugin.rs (+121 -7)
📝 crates-cli/yaak-cli/src/commands/request.rs (+44 -10)
📝 crates-cli/yaak-cli/src/commands/send.rs (+67 -9)
📝 crates-cli/yaak-cli/src/context.rs (+64 -47)
📝 crates-cli/yaak-cli/src/main.rs (+191 -53)
📝 crates-cli/yaak-cli/src/plugin_events.rs (+964 -121)
📝 crates-cli/yaak-cli/src/utils/mod.rs (+1 -0)
crates-cli/yaak-cli/src/utils/workspace.rs (+19 -0)
📝 crates/yaak-plugins/bindings/gen_events.ts (+80 -80)
📝 crates/yaak-plugins/bindings/gen_models.ts (+30 -6)
📝 plugins/template-function-response/src/index.ts (+2 -1)

📄 Description

Summary

  • expand yaak-cli plugin host handling beyond HTTP send/render so CLI can run more real-world plugins
  • implement these host requests in crates-cli/yaak-cli/src/plugin_events.rs:
    • send_http_request
    • render_http_request
    • render_grpc_request
    • template_render
    • prompt_text
    • prompt_form (with CLI fallbacks for non-terminal-specific form controls)
    • copy_text
    • open_external_url
    • list_cookie_names
    • get_cookie_value
    • window_info
  • keep unsupported branches explicit with host errors for:
    • open_window
    • close_window
    • unknown other_request
  • avoid nested plugin render/send deadlocks by handling each inbound plugin event in its own task
  • wire CLI execution context (workspace/request/environment/cookie jar) into plugin event handling

CLI Command Updates

  • add yaak plugin install <source>
    • local directory install (default)
    • registry spec install when source matches @org/plugin or @org/plugin@version
  • plugin subcommand dispatch in main.rs is explicit so install always runs through context-aware setup

Validation

  • cargo fmt -p yaak-cli
  • cargo check -p yaak-cli
  • manual OAuth external-browser flow sanity check via open_external_url

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mountain-loop/yaak/pull/415 **Author:** [@gschier](https://github.com/gschier) **Created:** 3/3/2026 **Status:** ✅ Merged **Merged:** 3/4/2026 **Merged by:** [@gschier](https://github.com/gschier) **Base:** `main` ← **Head:** `gschier/cli-plugin-send-render-http` --- ### 📝 Commits (7) - [`fb5ad8c`](https://github.com/mountain-loop/yaak/commit/fb5ad8c7f7b64ecbf453f4e1400dac1127557ce0) cli: handle send/render http plugin host requests - [`ef63b88`](https://github.com/mountain-loop/yaak/commit/ef63b88710b5a6b5974eeea0b8934e1f965afc8f) cli: add grpc/template render handlers and unsupported event errors - [`b01b3a4`](https://github.com/mountain-loop/yaak/commit/b01b3a4c579289bc3b91b9b33468713491731301) cli: implement plugin host render/send context and cookie jar support - [`ad31755`](https://github.com/mountain-loop/yaak/commit/ad31755dbbe4b20e7e3e4065d12f164f0e3cdb0e) feat(cli): add plugin install and complete prompt/render host events - [`2439ffd`](https://github.com/mountain-loop/yaak/commit/2439ffd28c21dcd0ffb78d5020ee2b79ed943f70) chore: remove prompt form CLI test plugin scaffold - [`77e3c85`](https://github.com/mountain-loop/yaak/commit/77e3c85455b1c4dd443359f164ef5021659f6dce) refactor(cli): move DB and encryption init into CliContext::new - [`f61cf2e`](https://github.com/mountain-loop/yaak/commit/f61cf2ed5136ce413a7ecfe7b1e660d92c4d6031) fix(cli): resolve folder_id for template render environment chain ### 📊 Changes **18 files changed** (+1811 additions, -361 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+118 -7) 📝 `crates-cli/yaak-cli/Cargo.toml` (+2 -0) 📝 `crates-cli/yaak-cli/src/cli.rs` (+38 -6) ➕ `crates-cli/yaak-cli/src/commands/cookie_jar.rs` (+42 -0) 📝 `crates-cli/yaak-cli/src/commands/environment.rs` (+14 -7) 📝 `crates-cli/yaak-cli/src/commands/folder.rs` (+13 -7) 📝 `crates-cli/yaak-cli/src/commands/mod.rs` (+1 -0) 📝 `crates-cli/yaak-cli/src/commands/plugin.rs` (+121 -7) 📝 `crates-cli/yaak-cli/src/commands/request.rs` (+44 -10) 📝 `crates-cli/yaak-cli/src/commands/send.rs` (+67 -9) 📝 `crates-cli/yaak-cli/src/context.rs` (+64 -47) 📝 `crates-cli/yaak-cli/src/main.rs` (+191 -53) 📝 `crates-cli/yaak-cli/src/plugin_events.rs` (+964 -121) 📝 `crates-cli/yaak-cli/src/utils/mod.rs` (+1 -0) ➕ `crates-cli/yaak-cli/src/utils/workspace.rs` (+19 -0) 📝 `crates/yaak-plugins/bindings/gen_events.ts` (+80 -80) 📝 `crates/yaak-plugins/bindings/gen_models.ts` (+30 -6) 📝 `plugins/template-function-response/src/index.ts` (+2 -1) </details> ### 📄 Description ## Summary - expand `yaak-cli` plugin host handling beyond HTTP send/render so CLI can run more real-world plugins - implement these host requests in `crates-cli/yaak-cli/src/plugin_events.rs`: - `send_http_request` - `render_http_request` - `render_grpc_request` - `template_render` - `prompt_text` - `prompt_form` (with CLI fallbacks for non-terminal-specific form controls) - `copy_text` - `open_external_url` - `list_cookie_names` - `get_cookie_value` - `window_info` - keep unsupported branches explicit with host errors for: - `open_window` - `close_window` - unknown `other_request` - avoid nested plugin render/send deadlocks by handling each inbound plugin event in its own task - wire CLI execution context (workspace/request/environment/cookie jar) into plugin event handling ## CLI Command Updates - add `yaak plugin install <source>` - local directory install (default) - registry spec install when source matches `@org/plugin` or `@org/plugin@version` - plugin subcommand dispatch in `main.rs` is explicit so `install` always runs through context-aware setup ## Validation - `cargo fmt -p yaak-cli` - `cargo check -p yaak-cli` - manual OAuth external-browser flow sanity check via `open_external_url` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 19:54:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/yaak#965