Skip to content

Update easydict extension - #27100

Merged
raycastbot merged 4 commits into
raycast:mainfrom
maxchang3:ext/easydict
Apr 13, 2026
Merged

raycastbot merged 4 commits into
raycast:mainfrom
maxchang3:ext/easydict

Conversation

@maxchang3

@maxchang3 maxchang3 commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #26761

💎 Improvement

  • Remove crypto-js and qs dependencies, and simplify Volcano translation
  • Replace lint-staged with nano-staged
  • Update dependencies and improve stability

🐞 Fixed

  • Support max_completion_tokens for OpenAI reasoning models

Screencast

Checklist

- fix(openai): support `max_completion_tokens` for reasoning models (raycast#80)
- refactor: remove crypto-js and qs, simplify volcano translation (raycast#81)
- chore: release v2.11.1 (raycast#79)
- docs: update changelog
- chore(deps): update to latest
@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: easydict Issues related to the easydict extension platform: macOS OP is contributor The OP of the PR is a contributor of the extension labels Apr 11, 2026
@raycastbot

raycastbot commented Apr 11, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @tisfeng @ViGeng @LitoMore you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="ext/easydict"
FORK_URL="https://github.com/maxchang3/raycast-extensions.git"
EXTENSION_NAME="easydict"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@maxchang3
maxchang3 marked this pull request as ready for review April 11, 2026 20:55
@greptile-apps

greptile-apps Bot commented Apr 11, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates easydict from crypto-js and qs to Node.js built-in node:crypto and URLSearchParams, removes the Volcano web-translate URL builder, and adds a forceMaxCompletionTokens preference to support OpenAI reasoning models. The defaultEncryptedCaiyunToken is correctly re-encrypted in the new AES-256-CBC format.

Confidence Score: 5/5

Safe to merge — all crypto and serialisation migrations are semantically correct, and no new P0/P1 issues were found.

The crypto-js → node:crypto replacements preserve algorithm, mode, padding, and key-derivation semantics across every call site. The qs → URLSearchParams replacement is correct for the flat string-valued objects used. The KNOWN_ENDPOINTS check uses startsWith, which correctly matches the full default endpoint URL. The only open points from prior threads (model-pattern breadth) are P2 style suggestions.

No files require special attention.

Important Files Changed

Filename Overview
extensions/easydict/src/preferences.ts Replaces CryptoJS AES with node:crypto (AES-256-CBC + SHA-256 key derivation); re-encrypts the hardcoded default Caiyun token in the new format; adds forceMaxCompletionTokens field.
extensions/easydict/src/translation/openAI/chat.ts Adds getTokenLimitParams() which uses startsWith-based endpoint detection and a regex model check to switch between max_tokens and max_completion_tokens.
extensions/easydict/src/translation/volcano/volcanoSign.js Replaces CryptoJS HMAC-SHA256 chain with node:crypto equivalents; also normalises toLocaleLowerCase() to toLowerCase(). Migration is semantically correct.
extensions/easydict/src/translation/microsoft/bing.ts Drops qs import; replaces qs.stringify(data) with new URLSearchParams(data).toString() for a flat string-valued object — functionally equivalent.
extensions/easydict/src/dictionary/youdao/youdaoTranslate.ts Migrates CryptoJS MD5 and AES-128-CBC decryption to node:crypto equivalents; key/IV derivation and padding behaviour are preserved.
extensions/easydict/package.json Removes crypto-js, qs (and their @types), lint-staged; adds nano-staged; adds forceMaxCompletionTokens checkbox preference definition.

Reviews (2): Last reviewed commit: "fix: improve endpoint check in getTokenL..." | Re-trigger Greptile

@0xdhrv 0xdhrv self-assigned this Apr 12, 2026

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 7133efe into raycast:main Apr 13, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@maxchang3
maxchang3 deleted the ext/easydict branch May 14, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: easydict Issues related to the easydict extension extension fix / improvement Label for PRs with extension's fix improvements OP is contributor The OP of the PR is a contributor of the extension platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Easydict] OpenAI API parameter "max_completion_tokens" replacement

3 participants