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.
- package/dist/plugin-hooks.js +15 -5
- package/package.json +1 -1
package/dist/plugin-hooks.js
CHANGED
|
@@ -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
|
-
|
|
590
|
-
|
|
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,
|