opencode-copilot-account-switcher 0.2.6 → 0.2.8
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/README.md +107 -116
- package/dist/copilot-network-retry.d.ts +39 -4
- package/dist/copilot-network-retry.js +376 -32
- package/dist/loop-safety-plugin.d.ts +1 -1
- package/dist/loop-safety-plugin.js +7 -1
- package/dist/plugin-hooks.d.ts +27 -3
- package/dist/plugin-hooks.js +13 -3
- package/dist/plugin.js +8 -1
- package/dist/store.js +2 -2
- package/dist/ui/menu.d.ts +29 -1
- package/dist/ui/menu.js +86 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,43 +4,43 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/opencode-copilot-account-switcher)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
[
|
|
7
|
+
[中文](#中文) | [English](#english)
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
<a name="
|
|
11
|
+
<a name="中文"></a>
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## 中文
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
在 **OpenCode** 中管理并切换多个 **GitHub Copilot** 账号。本插件提供**账号切换、配额查询**、默认开启的 **Guided Loop Safety** 模式,以及默认关闭的 **Copilot Network Retry** 开关;前者帮助一次 premium request 更容易连续工作好几个小时、减少真正需要你输入之前的汇报打断,后者用于处理可重试的网络与证书类失败。**完全依赖官方 `github-copilot` provider**,无需修改模型配置。
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## 功能一览
|
|
18
18
|
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- **Guided Loop Safety** —
|
|
23
|
-
- **Copilot Network Retry** —
|
|
24
|
-
-
|
|
19
|
+
- **多账号管理** — 添加多个 Copilot 账号,随时切换
|
|
20
|
+
- **配额查询** — 查看每个账号的剩余额度
|
|
21
|
+
- **导入认证** — 可从 OpenCode 认证存储导入
|
|
22
|
+
- **Guided Loop Safety** — 默认开启;仅对 Copilot 生效的更严格 question-first 提示词策略,推动非阻塞工作持续执行、让一次 premium request 更容易连续工作好几个小时,并通过减少反复中断来降低无谓配额消耗
|
|
23
|
+
- **Copilot Network Retry** — 默认关闭;把可重试的 Copilot 网络或 TLS 失败归一化成 OpenCode 原生重试链路可识别的形态
|
|
24
|
+
- **无需模型配置** — 使用官方 provider,无需改模型
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## 安装
|
|
29
29
|
|
|
30
30
|
<details open>
|
|
31
|
-
<summary><b
|
|
31
|
+
<summary><b>面向人类用户</b></summary>
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
**选项 A:让 LLM 帮你安装**
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
把下面这段话丢给任意 LLM(OpenCode / Claude Code / Cursor 等):
|
|
36
36
|
|
|
37
37
|
```
|
|
38
|
-
|
|
38
|
+
请按以下说明安装 opencode-copilot-account-switcher 插件:https://raw.githubusercontent.com/jiwangyihao/opencode-copilot-account-switcher/master/README.md
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
**选项 B:手动安装**
|
|
42
42
|
|
|
43
|
-
1.
|
|
43
|
+
1. **在配置文件中添加插件** `~/.config/opencode/opencode.json`:
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
46
|
{
|
|
@@ -49,9 +49,9 @@ Install the opencode-copilot-account-switcher plugin by following: https://raw.g
|
|
|
49
49
|
}
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
2.
|
|
52
|
+
2. **重启 OpenCode**(会自动从 npm 下载插件)。
|
|
53
53
|
|
|
54
|
-
3.
|
|
54
|
+
3. **登录 GitHub Copilot**:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
opencode auth login --provider github-copilot
|
|
@@ -60,15 +60,15 @@ Install the opencode-copilot-account-switcher plugin by following: https://raw.g
|
|
|
60
60
|
</details>
|
|
61
61
|
|
|
62
62
|
<details>
|
|
63
|
-
<summary><b
|
|
63
|
+
<summary><b>面向 LLM 智能体</b></summary>
|
|
64
64
|
|
|
65
|
-
###
|
|
65
|
+
### 步骤指引
|
|
66
66
|
|
|
67
|
-
1.
|
|
67
|
+
1. 打开 OpenCode 配置文件 `~/.config/opencode/opencode.json`
|
|
68
68
|
|
|
69
|
-
>
|
|
69
|
+
> **说明**:该路径在所有平台通用;Windows 上 `~` 会解析为用户目录(例如 `C:\Users\YourName`)。
|
|
70
70
|
|
|
71
|
-
2.
|
|
71
|
+
2. 在 `plugin` 数组中添加插件:
|
|
72
72
|
|
|
73
73
|
```json
|
|
74
74
|
{
|
|
@@ -77,9 +77,9 @@ Install the opencode-copilot-account-switcher plugin by following: https://raw.g
|
|
|
77
77
|
}
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
3.
|
|
80
|
+
3. 重启 OpenCode,使其自动拉取 npm 包。
|
|
81
81
|
|
|
82
|
-
###
|
|
82
|
+
### 验证
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
85
|
opencode auth login --provider github-copilot
|
|
@@ -89,55 +89,55 @@ opencode auth login --provider github-copilot
|
|
|
89
89
|
|
|
90
90
|
---
|
|
91
91
|
|
|
92
|
-
##
|
|
92
|
+
## 使用方式
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
在 Copilot 认证流程中运行:
|
|
95
95
|
|
|
96
96
|
```bash
|
|
97
97
|
opencode auth login --provider github-copilot
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
会出现交互式菜单(方向键 + 回车):
|
|
101
101
|
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
- **Guided Loop Safety
|
|
106
|
-
- **Copilot Network Retry
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
102
|
+
- **添加账号**
|
|
103
|
+
- **从 auth.json 导入**
|
|
104
|
+
- **检查配额**
|
|
105
|
+
- **Guided Loop Safety 开关** — 通过提示词引导模型在可用时必须使用 `question` 做用户可见汇报、继续完成非阻塞工作、减少反复中断,并避免不必要的子代理调用
|
|
106
|
+
- **Copilot Network Retry 开关** — 默认关闭;仅影响 Copilot 请求的 `fetch` 路径,只处理可重试的网络/证书类失败
|
|
107
|
+
- **切换账号**
|
|
108
|
+
- **删除账号**
|
|
109
|
+
- **全部删除**
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Guided Loop Safety 现在默认开启。实际使用中,它可以让一次 request 更容易连续工作好几个小时:当 `question` 工具在当前会话中可用且被允许时,用户可见汇报必须通过它完成,因此等待你的回复本身不会像反复插入直接状态消息那样继续额外消耗配额;少一次中断,本身就少一次无谓的配额消耗。只要还有安全的非阻塞工作可做,Copilot 就应继续执行而不是提前暂停;只有在当前确实没有可安全执行的动作时,才应通过 `question` 询问下一项任务或所需澄清,同时也会减少不必要的子代理调用。
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
如果你在切换 Copilot 账号后遇到瞬时 TLS/网络失败,或者遇到由旧 session item ID 残留引起的 `input[*].id too long` 错误,也可以在同一菜单中开启 Copilot Network Retry。它默认关闭。开启后,插件会先保留 upstream 官方 loader 生成的 `baseURL`、认证头和 `fetch` 行为,只在最后一跳 Copilot `fetch` 路径上做最小包装,把可重试的网络类失败归一化成 OpenCode 已有重试链路能识别的形态;对于明确命中的 `input[*].id too long` 400,还会回写命中的 session part,避免旧 item ID 持续污染后续重试。
|
|
114
114
|
|
|
115
115
|
## Copilot Network Retry
|
|
116
116
|
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
117
|
+
- 默认:**关闭**
|
|
118
|
+
- 作用范围:仅影响 `auth.loader` 返回的官方 Copilot 请求 `fetch` 路径
|
|
119
|
+
- 用途:有限处理 `failed to fetch`、`ECONNRESET`、`unknown certificate`、`self signed certificate` 等可重试网络/证书类失败
|
|
120
|
+
- 实现策略:尽量保留官方 loader 行为,再把可重试失败归一化给 OpenCode 原生重试链路判断是否重试
|
|
121
|
+
- 风险提示:因为插件仍然包裹了官方 fetch 路径,若 upstream 后续内部实现变化,仍可能产生行为漂移
|
|
122
122
|
|
|
123
|
-
## Upstream
|
|
123
|
+
## Upstream 同步机制
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
仓库中提交了一份 upstream 快照 `src/upstream/copilot-plugin.snapshot.ts`,并提供同步/校验脚本 `scripts/sync-copilot-upstream.mjs`。
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
常用命令:
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
npm run sync:copilot-snapshot -- --source <file-or-url> --upstream-commit <sha> --sync-date <YYYY-MM-DD>
|
|
131
131
|
npm run check:copilot-sync -- --source <file-or-url> --upstream-commit <sha> --sync-date <YYYY-MM-DD>
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
|
|
134
|
+
该脚本会生成或校验仓库中提交的 snapshot,并要求在更新正式 snapshot 时显式提供 upstream commit 与同步日期,用来尽早发现与官方 `opencode` `copilot.ts` 的行为漂移。
|
|
135
135
|
|
|
136
136
|
---
|
|
137
137
|
|
|
138
|
-
##
|
|
138
|
+
## 存储位置
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
账号信息保存于:
|
|
141
141
|
|
|
142
142
|
```
|
|
143
143
|
~/.config/opencode/copilot-accounts.json
|
|
@@ -145,52 +145,52 @@ Accounts are stored in:
|
|
|
145
145
|
|
|
146
146
|
---
|
|
147
147
|
|
|
148
|
-
##
|
|
148
|
+
## 常见问题
|
|
149
149
|
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
**需要改模型配置吗?**
|
|
151
|
+
不需要。本插件只做账号管理,继续使用官方 `github-copilot` provider。
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
**会替换官方 provider 吗?**
|
|
154
|
+
不会。它只是在官方 provider 基础上增加账号切换和配额查询。
|
|
155
155
|
|
|
156
|
-
**
|
|
157
|
-
|
|
156
|
+
**Copilot Network Retry 会替代 OpenCode 自己的重试逻辑吗?**
|
|
157
|
+
不会。插件的目标是把可重试的 Copilot 网络/TLS 失败归一化成 OpenCode 已识别的可重试错误形态,真正的是否重试与如何退避仍由 OpenCode 原生链路决定。
|
|
158
158
|
|
|
159
159
|
---
|
|
160
160
|
|
|
161
|
-
<a name="
|
|
161
|
+
<a name="english"></a>
|
|
162
162
|
|
|
163
|
-
##
|
|
163
|
+
## English
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
Manage and switch between multiple **GitHub Copilot** accounts in **OpenCode**. This plugin adds account switching, quota checks, a default-on **Guided Loop Safety** mode that can keep a single premium request productive for hours with fewer report interruptions before it truly needs user input, and an optional **Copilot Network Retry** switch for retryable network and certificate failures. It **uses the official `github-copilot` provider** and does **not** require model reconfiguration.
|
|
166
166
|
|
|
167
|
-
##
|
|
167
|
+
## What You Get
|
|
168
168
|
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
- **Guided Loop Safety** —
|
|
173
|
-
- **Copilot Network Retry** —
|
|
174
|
-
-
|
|
169
|
+
- **Multi-account support** — add multiple Copilot accounts and switch anytime
|
|
170
|
+
- **Quota check** — view remaining quota per account
|
|
171
|
+
- **Auth import** — import Copilot tokens from OpenCode auth storage
|
|
172
|
+
- **Guided Loop Safety** — enabled by default; a stricter Copilot-only question-first policy designed to keep non-blocked work moving, keep one premium request productive for hours, and cut avoidable quota burn by replacing repeated interruption turns with `question`-based waiting
|
|
173
|
+
- **Copilot Network Retry** — optional and off by default; normalizes retryable Copilot network or TLS failures so OpenCode's native retry path can handle them
|
|
174
|
+
- **Zero model config** — no model changes required (official provider only)
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
178
|
-
##
|
|
178
|
+
## Installation
|
|
179
179
|
|
|
180
180
|
<details open>
|
|
181
|
-
<summary><b
|
|
181
|
+
<summary><b>For Humans</b></summary>
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
**Option A: Let an LLM do it**
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Paste this into any LLM agent (OpenCode, Claude Code, Cursor, etc.):
|
|
186
186
|
|
|
187
187
|
```
|
|
188
|
-
|
|
188
|
+
Install the opencode-copilot-account-switcher plugin by following: https://raw.githubusercontent.com/jiwangyihao/opencode-copilot-account-switcher/master/README.md
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
**Option B: Manual setup**
|
|
192
192
|
|
|
193
|
-
1.
|
|
193
|
+
1. **Add the plugin** to `~/.config/opencode/opencode.json`:
|
|
194
194
|
|
|
195
195
|
```json
|
|
196
196
|
{
|
|
@@ -199,9 +199,9 @@ No. The plugin keeps retry policy inside OpenCode by normalizing retryable Copil
|
|
|
199
199
|
}
|
|
200
200
|
```
|
|
201
201
|
|
|
202
|
-
2.
|
|
202
|
+
2. **Restart OpenCode** (it will auto-download the plugin from npm).
|
|
203
203
|
|
|
204
|
-
3.
|
|
204
|
+
3. **Login** to GitHub Copilot:
|
|
205
205
|
|
|
206
206
|
```bash
|
|
207
207
|
opencode auth login --provider github-copilot
|
|
@@ -210,15 +210,15 @@ No. The plugin keeps retry policy inside OpenCode by normalizing retryable Copil
|
|
|
210
210
|
</details>
|
|
211
211
|
|
|
212
212
|
<details>
|
|
213
|
-
<summary><b
|
|
213
|
+
<summary><b>For LLM Agents</b></summary>
|
|
214
214
|
|
|
215
|
-
###
|
|
215
|
+
### Step-by-Step Instructions
|
|
216
216
|
|
|
217
|
-
1.
|
|
217
|
+
1. Edit the OpenCode configuration file at `~/.config/opencode/opencode.json`
|
|
218
218
|
|
|
219
|
-
>
|
|
219
|
+
> **Note**: This path works on all platforms. On Windows, `~` resolves to your user home directory (e.g., `C:\Users\YourName`).
|
|
220
220
|
|
|
221
|
-
2.
|
|
221
|
+
2. Add the plugin to the `plugin` array:
|
|
222
222
|
|
|
223
223
|
```json
|
|
224
224
|
{
|
|
@@ -227,9 +227,9 @@ No. The plugin keeps retry policy inside OpenCode by normalizing retryable Copil
|
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
3.
|
|
230
|
+
3. Restart OpenCode so it fetches the plugin automatically from npm.
|
|
231
231
|
|
|
232
|
-
###
|
|
232
|
+
### Verification
|
|
233
233
|
|
|
234
234
|
```bash
|
|
235
235
|
opencode auth login --provider github-copilot
|
|
@@ -239,55 +239,46 @@ opencode auth login --provider github-copilot
|
|
|
239
239
|
|
|
240
240
|
---
|
|
241
241
|
|
|
242
|
-
##
|
|
242
|
+
## Usage
|
|
243
243
|
|
|
244
|
-
|
|
244
|
+
Run inside the GitHub Copilot auth flow:
|
|
245
245
|
|
|
246
246
|
```bash
|
|
247
247
|
opencode auth login --provider github-copilot
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
- **添加账号**
|
|
253
|
-
- **从 auth.json 导入**
|
|
254
|
-
- **检查配额**
|
|
255
|
-
- **Guided Loop Safety 开关** — 通过提示词引导模型在可用时必须使用 `question` 做用户可见汇报、继续完成非阻塞工作、减少反复中断,并避免不必要的子代理调用
|
|
256
|
-
- **Copilot Network Retry 开关** — 默认关闭;仅影响 Copilot 请求的 `fetch` 路径,只处理可重试的网络/证书类失败
|
|
257
|
-
- **切换账号**
|
|
258
|
-
- **删除账号**
|
|
259
|
-
- **全部删除**
|
|
250
|
+
You will see an interactive menu. Use the built-in language switch action if you want to swap between Chinese and English labels.
|
|
260
251
|
|
|
261
|
-
|
|
252
|
+
Guided Loop Safety is enabled by default. In practice, this can keep one request productive for hours: when `question` is available and permitted, user-facing reports must go through it, so waiting for your reply does not keep burning extra quota the way repeated direct-status interruptions do. Fewer interruptions also means less avoidable quota burn. If safe non-blocked work remains, Copilot should keep going instead of pausing early; only when no safe action remains should it use `question` to ask for the next task or clarification, while also reducing unnecessary subagent calls.
|
|
262
253
|
|
|
263
|
-
|
|
254
|
+
If you switch Copilot accounts and then hit transient TLS/network failures or `input[*].id too long` errors caused by stale session item IDs, enable Copilot Network Retry from the same menu. It is off by default. When enabled, the plugin keeps the official Copilot header/baseURL behavior from the upstream loader, only wraps the final Copilot `fetch` path, and converts retryable network-like failures into a shape that OpenCode already treats as retryable. It also repairs the matched session part after an `input[*].id too long` 400 so later retries can recover instead of repeatedly failing on stale item IDs.
|
|
264
255
|
|
|
265
256
|
## Copilot Network Retry
|
|
266
257
|
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
258
|
+
- Default: **disabled**
|
|
259
|
+
- Scope: only the official Copilot request `fetch` path returned by `auth.loader`
|
|
260
|
+
- Purpose: limited handling for retryable network and certificate-style failures such as `failed to fetch`, `ECONNRESET`, `unknown certificate`, or `self signed certificate`
|
|
261
|
+
- Strategy: preserve official loader behavior, then normalize retryable failures so OpenCode's native retry pipeline can decide whether and when to retry
|
|
262
|
+
- Risk: because the plugin still wraps the official fetch path, upstream internal behavior may change over time and drift is possible
|
|
272
263
|
|
|
273
|
-
## Upstream
|
|
264
|
+
## Upstream Sync
|
|
274
265
|
|
|
275
|
-
|
|
266
|
+
The repository includes a committed upstream snapshot at `src/upstream/copilot-plugin.snapshot.ts` plus a sync/check script at `scripts/sync-copilot-upstream.mjs`.
|
|
276
267
|
|
|
277
|
-
|
|
268
|
+
Useful commands:
|
|
278
269
|
|
|
279
270
|
```bash
|
|
280
271
|
npm run sync:copilot-snapshot -- --source <file-or-url> --upstream-commit <sha> --sync-date <YYYY-MM-DD>
|
|
281
272
|
npm run check:copilot-sync -- --source <file-or-url> --upstream-commit <sha> --sync-date <YYYY-MM-DD>
|
|
282
273
|
```
|
|
283
274
|
|
|
284
|
-
|
|
275
|
+
The script generates or checks the committed snapshot, requires upstream metadata for repository snapshot updates, and helps catch drift from the official `opencode` `copilot.ts` implementation.
|
|
285
276
|
|
|
286
277
|
---
|
|
287
278
|
|
|
288
|
-
##
|
|
279
|
+
## Storage
|
|
289
280
|
|
|
290
|
-
|
|
281
|
+
Accounts are stored in:
|
|
291
282
|
|
|
292
283
|
```
|
|
293
284
|
~/.config/opencode/copilot-accounts.json
|
|
@@ -295,16 +286,16 @@ npm run check:copilot-sync -- --source <file-or-url> --upstream-commit <sha> --s
|
|
|
295
286
|
|
|
296
287
|
---
|
|
297
288
|
|
|
298
|
-
##
|
|
289
|
+
## FAQ
|
|
299
290
|
|
|
300
|
-
|
|
301
|
-
|
|
291
|
+
**Do I need to change model configurations?**
|
|
292
|
+
No. This plugin only manages accounts and works with the official `github-copilot` provider.
|
|
302
293
|
|
|
303
|
-
|
|
304
|
-
|
|
294
|
+
**Does it replace the official provider?**
|
|
295
|
+
No. It uses the official provider and only adds account switching + quota checks.
|
|
305
296
|
|
|
306
|
-
**Copilot Network Retry
|
|
307
|
-
|
|
297
|
+
**Does Copilot Network Retry replace OpenCode's retry logic?**
|
|
298
|
+
No. The plugin keeps retry policy inside OpenCode by normalizing retryable Copilot network/TLS failures into a shape that OpenCode already recognizes as retryable.
|
|
308
299
|
|
|
309
300
|
---
|
|
310
301
|
|
|
@@ -1,6 +1,41 @@
|
|
|
1
|
-
type FetchLike = (request: Request | URL | string, init?: RequestInit) => Promise<Response>;
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
export type FetchLike = (request: Request | URL | string, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
type JsonRecord = Record<string, unknown>;
|
|
3
|
+
export type CopilotRetryContext = {
|
|
4
|
+
client?: {
|
|
5
|
+
session?: {
|
|
6
|
+
messages?: (input: {
|
|
7
|
+
path: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
data?: Array<{
|
|
12
|
+
info?: {
|
|
13
|
+
id?: string;
|
|
14
|
+
role?: string;
|
|
15
|
+
};
|
|
16
|
+
parts?: Array<JsonRecord>;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
message?: (input: {
|
|
20
|
+
path: {
|
|
21
|
+
id: string;
|
|
22
|
+
messageID: string;
|
|
23
|
+
};
|
|
24
|
+
}) => Promise<{
|
|
25
|
+
data?: {
|
|
26
|
+
parts?: Array<JsonRecord>;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
directory?: string;
|
|
32
|
+
serverUrl?: URL;
|
|
4
33
|
wait?: (ms: number) => Promise<void>;
|
|
5
|
-
|
|
34
|
+
patchPart?: (request: {
|
|
35
|
+
url: string;
|
|
36
|
+
init: RequestInit;
|
|
37
|
+
}) => Promise<unknown>;
|
|
38
|
+
};
|
|
39
|
+
export declare function isRetryableCopilotFetchError(error: unknown): boolean;
|
|
40
|
+
export declare function createCopilotRetryingFetch(baseFetch: FetchLike, options?: CopilotRetryContext): (request: Request | URL | string, init?: RequestInit) => Promise<Response>;
|
|
6
41
|
export {};
|