@magpie-community/opencode-workbuddy-auth 0.2.20 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.mjs +6 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -15,7 +15,6 @@ import { homedir } from "node:os"
15
15
  import { isAbsolute, join } from "node:path"
16
16
  import { gzipSync } from "node:zlib"
17
17
 
18
- const APP_VERSION = "2.0.0" // the version WorkBuddy's sign-in page is opened with
19
18
  const POLL_MS = 1000
20
19
  const SIGN_IN_MS = 5 * 60 * 1000
21
20
  const EARLY_MS = 60 * 1000 // a token this close to its end is refreshed before a request
@@ -1755,7 +1754,12 @@ async function browserSignIn(site) {
1755
1754
  if (!state?.state || !state?.authUrl) throw new Error(`${site.name} gave no sign-in page`)
1756
1755
  const url = new URL(state.authUrl)
1757
1756
  if (url.protocol !== "https:") throw new Error(`${site.name}'s sign-in page isn't https`)
1758
- url.searchParams.set("version", APP_VERSION)
1757
+ // the desktop app's own version, as WorkBuddy desktop opens it
1758
+ // (openAuthUrl: version = CLIENT_INFO_PLUGIN_VERSION, the app's version).
1759
+ // The China build's page hides 企业微信 (WeCom) for a version under 5.8.0
1760
+ // (its signin-callback chunk: platform workbuddy and version >= "5.8.0"),
1761
+ // so the 2.0.0 sent before offered no WeCom sign-in (shenyebuwu on Discord)
1762
+ url.searchParams.set("version", site.app)
1759
1763
  url.searchParams.set("loginSessionId", hex())
1760
1764
  return {
1761
1765
  url: url.toString(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-workbuddy-auth",
3
- "version": "0.2.20",
3
+ "version": "0.2.21",
4
4
  "description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
5
5
  "type": "module",
6
6
  "main": "./opencode.mjs",