feat(slash-commands): add /weather and /exchange commands#250
Draft
AnayDhawan wants to merge 1 commit into
Draft
feat(slash-commands): add /weather and /exchange commands#250AnayDhawan wants to merge 1 commit into
AnayDhawan wants to merge 1 commit into
Conversation
|
Lowkey a good idea to have this in the terminal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two new slash commands —
/weather <city>and/exchange <FROM> <TO> [amount]— that run directly in the composer without invoking the AI model. Results are injected into the chat as local messages.Why
Closes #249. Quick factual lookups shouldn't cost tokens or require waiting for a model response.
How
Added a
local-runoutcome type toSlashOutcome. When returned,composer.tsxawaits the execute function and injects user + result messages directly viaChat.messagessetter, bypassing the transport layer entirely. API calls go through the existingai_http_requestTauri command./weatherreads the OWM key from the OS keychain viasecrets_get;/exchangeuses frankfurter.app (no key needed).Testing
pnpm exec tsc --noEmitclean/weather Mumbai— returns conditions table/weather New York imperial— returns °F/exchange USD INR— returns rate/exchange USD INR 500— returns converted amount/weatherwith no OWM key — returns helpful setup messageNotes for reviewer
/weatherrequires a free OpenWeatherMap key saved in Settings → API Keys (account: openweathermap)./exchangeworks out of the box.