Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Automatic redirects can expose questions or API credentials to hosts outside Asyntai.
2 open findings
What changed in this PR
Adds the Asyntai AI Assistant package, enabling Espanso users to query their website chatbot from text fields.
Changes:
- Adds
:ask,:clipask, and:asyntaikeytriggers. - Implements Python and PowerShell API clients.
- Adds package metadata, documentation, licensing, and setup instructions.
| File | Description |
|---|---|
README.md |
Documents setup, triggers, and requirements. |
package.yml |
Defines triggers and cross-platform launch commands. |
LICENSE |
Adds the MIT license. |
asyntai.py |
Implements the macOS/Linux client. |
asyntai.ps1 |
Implements the Windows client. |
_manifest.yml |
Defines package metadata. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
This is a more complex package than most, Copilot is already raising some security concerns, and I am about to go away so am short on time! I'll see if others would like to contribute. I may be back on a mobile device but can't do any testing of my own. The automated checks pass, but this needs closer inspection before we merge. If you've solved the issue of running OS-agnostic scripts I will be most impressed! I have been wrestling with this for a while. 😄 . |
|
Thanks for the quick look, and have a good trip! Copilot was right about the redirects. Fixed in a052a1b: both scripts now never follow a redirect ( On the OS-agnostic part: each match runs one command that both default shells can read. On sh/bash/zsh, line 1 runs the Python script and exits. In PowerShell, |
|
Thank you for drawing this to my attention! Just documenting it to share, and for future reference. |

New package:
asyntai-ai-assistantAdds Asyntai AI Assistant (0.1.0). Asyntai is an AI chatbot that answers website visitors from the site's own pages, docs and FAQ. This package brings those answers into any text field, which is handy for support replies.
:ask:clipask:asyntaikeyDocs: https://asyntai.com/documentation/integrations/espanso/
For review: what the scripts run
Each match has one
shellvar. The command is written so both Espanso default shells read it:python3 asyntai.py <mode>andexit 0, so line 2 and 3 are never reached.`#on line 1 is an escaped#, then<#opens a block comment that#>on line 2 closes. PowerShell runsasyntai.ps1on line 3 (loaded with[scriptblock]::Create, so the execution policy does not block it).The comment at the top of
package.ymlexplains this too.The two scripts do the same thing:
ESPANSO_FORM1_QUESTION/ESPANSO_CLIP, never from the command text, so quotes,$and backticks in a question cannot change the command.https://asyntai.com/api/v1/chat/(or/api/v1/websites/to check the key), API key in theAuthorizationheader.text (url), no Markdown bold or headings).%APPDATA%\asyntai\or~/.config/asyntai/(mode 0600). Nothing is deleted, nothing is downloaded or executed.Asyntai: ...line, and the scripts always exit 0.No dependencies: Windows PowerShell 5.1 on Windows; Python 3 standard library on macOS and Linux.
Testing
.github/scripts/validatepasses locally (0 errors).:clipaskand the:ask/:asyntaikeycommands expand correctly, Unicode intact. Windows Espanso 2.4.1 (portable) loads all three matches.Source and tests: https://github.com/asyntai/espanso-ai-assistant
Disclosure
We build Asyntai, the service this package calls.