opencode-copilot-account-switcher 0.14.11 → 0.14.12

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.
@@ -586,8 +586,21 @@ export function buildPluginHooks(input) {
586
586
  const triggerBillingCompensation = input.triggerBillingCompensation ?? (async () => { });
587
587
  const ensureWechatBrokerStarted = input.ensureWechatBrokerStarted ?? (async () => connectOrSpawnBroker());
588
588
  const createWechatBridgeLifecycleImpl = input.createWechatBridgeLifecycleImpl ?? createWechatBridgeLifecycle;
589
- if (input.serverUrl && hasWechatBridgeClientShape(input.client)) {
590
- const wechatBridgeClient = input.client;
589
+ const wechatBridgeClient = hasWechatBridgeClientShape(input.client) ? input.client : undefined;
590
+ if (wechatBridgeClient) {
591
+ void showStatusToast({
592
+ client: input.client,
593
+ message: "正在尝试连接或拉起 WeChat broker...",
594
+ variant: "info",
595
+ warn: (scope, error) => {
596
+ console.warn(`[${scope}] failed to show toast`, error);
597
+ },
598
+ });
599
+ void Promise.resolve()
600
+ .then(() => ensureWechatBrokerStarted())
601
+ .catch(() => { });
602
+ }
603
+ if (input.serverUrl && wechatBridgeClient) {
591
604
  const lifecycleKey = buildWechatBridgeLifecycleKey({
592
605
  directory: input.directory,
593
606
  serverUrl: input.serverUrl,
@@ -597,9 +610,6 @@ export function buildPluginHooks(input) {
597
610
  void ensureWechatBridgeLifecycle({
598
611
  key: lifecycleKey,
599
612
  create: async () => {
600
- void Promise.resolve()
601
- .then(() => ensureWechatBrokerStarted())
602
- .catch(() => { });
603
613
  return createWechatBridgeLifecycleImpl({
604
614
  client: wechatBridgeClient,
605
615
  project: input.project,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-copilot-account-switcher",
3
- "version": "0.14.11",
3
+ "version": "0.14.12",
4
4
  "description": "GitHub Copilot account switcher plugin for OpenCode",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",