opencode-copilot-account-switcher 0.14.7 → 0.14.8

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.
@@ -1,6 +1,7 @@
1
1
  import { bindOperator, readOperatorBinding, rebindOperator, resetOperatorBinding } from "./operator-store.js";
2
2
  import { loadOpenClawWeixinPublicHelpers } from "./compat/openclaw-public-helpers.js";
3
3
  import { buildOpenClawMenuAccount } from "./openclaw-account-adapter.js";
4
+ import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
4
5
  import qrcodeTerminal from "qrcode-terminal";
5
6
  const DEFAULT_QR_WAIT_TIMEOUT_MS = 480000;
6
7
  function pickFirstNonEmptyString(...values) {
@@ -87,10 +88,11 @@ export async function runWechatBindFlow(input) {
87
88
  if (waited && typeof waited === "object" && "connected" in waited && waited.connected === false) {
88
89
  throw new Error("qr login did not complete");
89
90
  }
90
- const accountId = pickFirstNonEmptyString(waited?.accountId);
91
- if (!accountId) {
91
+ const rawAccountId = pickFirstNonEmptyString(waited?.accountId);
92
+ if (!rawAccountId) {
92
93
  throw new Error("missing accountId after qr login");
93
94
  }
95
+ const accountId = normalizeAccountId(rawAccountId);
94
96
  const boundAt = now();
95
97
  const previousOperatorBinding = input.action === "wechat-rebind" ? await loadOperatorBinding() : undefined;
96
98
  const userIdFromWait = pickFirstNonEmptyString(waited?.userId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-copilot-account-switcher",
3
- "version": "0.14.7",
3
+ "version": "0.14.8",
4
4
  "description": "GitHub Copilot account switcher plugin for OpenCode",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",