opencode-copilot-account-switcher 0.14.12 → 0.14.13
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.js +6 -0
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -4,6 +4,7 @@ import { runProviderMenu } from "./menu-runtime.js";
|
|
|
4
4
|
import { persistAccountSwitch } from "./plugin-actions.js";
|
|
5
5
|
import { buildPluginHooks } from "./plugin-hooks.js";
|
|
6
6
|
import { readCommonSettingsStore, readCommonSettingsStoreSync, writeCommonSettingsStore, } from "./common-settings-store.js";
|
|
7
|
+
import { connectOrSpawnBroker } from "./wechat/broker-launcher.js";
|
|
7
8
|
import { createCodexMenuAdapter } from "./providers/codex-menu-adapter.js";
|
|
8
9
|
import { createCopilotMenuAdapter } from "./providers/copilot-menu-adapter.js";
|
|
9
10
|
import { createProviderRegistry } from "./providers/registry.js";
|
|
@@ -194,6 +195,10 @@ async function createAccountSwitcherPlugin(input, provider) {
|
|
|
194
195
|
const client = input.client;
|
|
195
196
|
const directory = input.directory;
|
|
196
197
|
const serverUrl = input.serverUrl;
|
|
198
|
+
const ensureWechatBrokerStarted = input.ensureWechatBrokerStarted ?? (async () => connectOrSpawnBroker());
|
|
199
|
+
void Promise.resolve()
|
|
200
|
+
.then(() => ensureWechatBrokerStarted())
|
|
201
|
+
.catch(() => { });
|
|
197
202
|
const persistStore = (store, meta) => writeStore(store, { debug: meta });
|
|
198
203
|
const codexClient = {
|
|
199
204
|
auth: {
|
|
@@ -379,6 +384,7 @@ async function createAccountSwitcherPlugin(input, provider) {
|
|
|
379
384
|
client,
|
|
380
385
|
directory,
|
|
381
386
|
serverUrl,
|
|
387
|
+
ensureWechatBrokerStarted: async () => { },
|
|
382
388
|
loadCommonSettings: readCommonSettingsStore,
|
|
383
389
|
loadCommonSettingsSync: readCommonSettingsStoreSync,
|
|
384
390
|
});
|