opencode-copilot-account-switcher 0.3.0 → 0.3.1
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/copilot-network-retry.d.ts +9 -0
- package/dist/copilot-network-retry.js +26 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/internal.d.ts +3 -0
- package/dist/internal.js +3 -0
- package/package.json +11 -1
|
@@ -44,6 +44,15 @@ export type CopilotRetryContext = {
|
|
|
44
44
|
};
|
|
45
45
|
}>;
|
|
46
46
|
};
|
|
47
|
+
part?: {
|
|
48
|
+
update?: (input: {
|
|
49
|
+
sessionID: string;
|
|
50
|
+
messageID: string;
|
|
51
|
+
partID: string;
|
|
52
|
+
directory?: string;
|
|
53
|
+
part?: JsonRecord;
|
|
54
|
+
}) => Promise<unknown>;
|
|
55
|
+
};
|
|
47
56
|
tui?: {
|
|
48
57
|
showToast?: (options: {
|
|
49
58
|
body: {
|
|
@@ -318,6 +318,32 @@ async function repairSessionPart(sessionID, failingId, ctx) {
|
|
|
318
318
|
},
|
|
319
319
|
body: JSON.stringify(body),
|
|
320
320
|
};
|
|
321
|
+
if (ctx?.client?.part?.update) {
|
|
322
|
+
try {
|
|
323
|
+
await ctx.client.part.update({
|
|
324
|
+
sessionID,
|
|
325
|
+
messageID: match.messageID,
|
|
326
|
+
partID: match.partID,
|
|
327
|
+
directory: ctx.directory,
|
|
328
|
+
part: body,
|
|
329
|
+
});
|
|
330
|
+
debugLog("input-id retry session repair", {
|
|
331
|
+
partID: match.partID,
|
|
332
|
+
messageID: match.messageID,
|
|
333
|
+
sessionID,
|
|
334
|
+
});
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
catch (error) {
|
|
338
|
+
debugLog("input-id retry session repair failed", {
|
|
339
|
+
partID: match.partID,
|
|
340
|
+
messageID: match.messageID,
|
|
341
|
+
sessionID,
|
|
342
|
+
error: String(error instanceof Error ? error.message : error),
|
|
343
|
+
});
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
321
347
|
if (ctx?.patchPart) {
|
|
322
348
|
try {
|
|
323
349
|
await ctx.patchPart({ url: url.href, init });
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
1
|
export { CopilotAccountSwitcher } from "./plugin.js";
|
|
2
|
-
export { applyMenuAction } from "./plugin-actions.js";
|
|
3
|
-
export { buildPluginHooks } from "./plugin-hooks.js";
|
|
4
|
-
export { createOfficialFetchAdapter, loadOfficialCopilotConfig } from "./upstream/copilot-loader-adapter.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
1
|
export { CopilotAccountSwitcher } from "./plugin.js";
|
|
2
|
-
export { applyMenuAction } from "./plugin-actions.js";
|
|
3
|
-
export { buildPluginHooks } from "./plugin-hooks.js";
|
|
4
|
-
export { createOfficialFetchAdapter, loadOfficialCopilotConfig } from "./upstream/copilot-loader-adapter.js";
|
package/dist/internal.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-copilot-account-switcher",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "GitHub Copilot account switcher plugin for OpenCode",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./internal": {
|
|
13
|
+
"types": "./dist/internal.d.ts",
|
|
14
|
+
"default": "./dist/internal.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
7
17
|
"type": "module",
|
|
8
18
|
"license": "MPL-2.0",
|
|
9
19
|
"author": "jiwangyihao",
|