opencode-copilot-account-switcher 0.14.17 → 0.14.18
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 +1 -3
- package/dist/wechat/bridge.d.ts +4 -4
- package/dist/wechat/bridge.js +8 -2
- package/package.json +1 -1
package/dist/plugin-hooks.js
CHANGED
|
@@ -322,9 +322,7 @@ function hasWechatBridgeClientShape(value) {
|
|
|
322
322
|
return typeof client.session?.list === "function"
|
|
323
323
|
&& typeof client.session?.status === "function"
|
|
324
324
|
&& typeof client.session?.todo === "function"
|
|
325
|
-
&& typeof client.session?.messages === "function"
|
|
326
|
-
&& typeof client.question?.list === "function"
|
|
327
|
-
&& typeof client.permission?.list === "function";
|
|
325
|
+
&& typeof client.session?.messages === "function";
|
|
328
326
|
}
|
|
329
327
|
function sanitizeLoggedRequestHeadersRecord(headers) {
|
|
330
328
|
const sanitized = { ...headers };
|
package/dist/wechat/bridge.d.ts
CHANGED
|
@@ -14,11 +14,11 @@ type WechatBridgeClient = {
|
|
|
14
14
|
todo: (sessionID: string) => Promise<Todo[]>;
|
|
15
15
|
messages: (sessionID: string) => Promise<SessionMessages>;
|
|
16
16
|
};
|
|
17
|
-
question
|
|
18
|
-
list
|
|
17
|
+
question?: {
|
|
18
|
+
list?: () => Promise<QuestionRequest[]>;
|
|
19
19
|
};
|
|
20
|
-
permission
|
|
21
|
-
list
|
|
20
|
+
permission?: {
|
|
21
|
+
list?: () => Promise<PermissionRequest[]>;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export type InstanceUnavailableKind = "sessionStatus" | "questionList" | "permissionList";
|
package/dist/wechat/bridge.js
CHANGED
|
@@ -72,11 +72,17 @@ export function createWechatBridge(input) {
|
|
|
72
72
|
? Math.max(1, Math.floor(input.liveReadTimeoutMs))
|
|
73
73
|
: DEFAULT_LIVE_READ_TIMEOUT_MS;
|
|
74
74
|
const unavailable = new Set();
|
|
75
|
+
const questionList = input.client.question?.list;
|
|
76
|
+
const permissionList = input.client.permission?.list;
|
|
75
77
|
const [sessionListResult, statusResult, questionResult, permissionResult] = await Promise.allSettled([
|
|
76
78
|
withTimeout(() => input.client.session.list(), liveReadTimeoutMs, "session.list"),
|
|
77
79
|
withTimeout(() => input.client.session.status(), liveReadTimeoutMs, "session.status"),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
typeof questionList === "function"
|
|
81
|
+
? withTimeout(() => questionList(), liveReadTimeoutMs, "question.list")
|
|
82
|
+
: Promise.reject(new Error("question.list unavailable")),
|
|
83
|
+
typeof permissionList === "function"
|
|
84
|
+
? withTimeout(() => permissionList(), liveReadTimeoutMs, "permission.list")
|
|
85
|
+
: Promise.reject(new Error("permission.list unavailable")),
|
|
80
86
|
]);
|
|
81
87
|
const sessions = sessionListResult.status === "fulfilled" ? sessionListResult.value : [];
|
|
82
88
|
const recentSessions = pickRecentSessions(sessions, 3);
|