opencode-copilot-account-switcher 0.1.3 → 0.1.4
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 +8 -8
- package/dist/loop-safety-plugin.d.ts +1 -1
- package/dist/loop-safety-plugin.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
|
|
13
13
|
## English
|
|
14
14
|
|
|
15
|
-
Manage and switch between multiple **GitHub Copilot** accounts in **OpenCode**. This plugin adds account switching, quota checks, and an optional **Guided Loop Safety** mode
|
|
15
|
+
Manage and switch between multiple **GitHub Copilot** accounts in **OpenCode**. This plugin adds account switching, quota checks, and an optional **Guided Loop Safety** mode that can help Copilot keep a single premium request working longer with fewer report interruptions before it truly needs user input. It **uses the official `github-copilot` provider** and does **not** require model reconfiguration.
|
|
16
16
|
|
|
17
17
|
## What You Get
|
|
18
18
|
|
|
19
19
|
- **Multi-account support** — add multiple Copilot accounts and switch anytime
|
|
20
20
|
- **Quota check** — view remaining quota per account
|
|
21
21
|
- **Auth import** — import Copilot tokens from OpenCode auth storage
|
|
22
|
-
- **Guided Loop Safety** —
|
|
22
|
+
- **Guided Loop Safety** — a stricter Copilot-only question-first policy designed to keep non-blocked work moving, require `question` for user-facing reports when available, and help cut avoidable quota burn caused by repeated status interruptions
|
|
23
23
|
- **Zero model config** — no model changes required (official provider only)
|
|
24
24
|
|
|
25
25
|
---
|
|
@@ -101,12 +101,12 @@ You will see an interactive menu (arrow keys + enter) with actions:
|
|
|
101
101
|
- **Add account**
|
|
102
102
|
- **Import from auth.json**
|
|
103
103
|
- **Check quotas**
|
|
104
|
-
- **Guided Loop Safety** — prompt-guided question-first reporting that requires `question` for user-facing reports when available,
|
|
104
|
+
- **Guided Loop Safety** — prompt-guided question-first reporting that requires `question` for user-facing reports when available, keeps non-blocked work moving, and avoids unnecessary subagent calls
|
|
105
105
|
- **Switch account**
|
|
106
106
|
- **Remove account**
|
|
107
107
|
- **Remove all**
|
|
108
108
|
|
|
109
|
-
If you want
|
|
109
|
+
If you want GitHub Copilot sessions to stay in a single premium request longer, enable Guided Loop Safety from the account menu. It is a prompt-guided, Copilot-only question-first mode: when `question` is available and permitted, user-facing reports must go through it; 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.
|
|
110
110
|
|
|
111
111
|
---
|
|
112
112
|
|
|
@@ -134,14 +134,14 @@ No. It uses the official provider and only adds account switching + quota checks
|
|
|
134
134
|
|
|
135
135
|
## 中文
|
|
136
136
|
|
|
137
|
-
在 **OpenCode** 中管理并切换多个 **GitHub Copilot** 账号。本插件提供**账号切换、配额查询**以及可选的 **Guided Loop Safety**
|
|
137
|
+
在 **OpenCode** 中管理并切换多个 **GitHub Copilot** 账号。本插件提供**账号切换、配额查询**以及可选的 **Guided Loop Safety** 模式,帮助 Copilot 在一次 premium request 里更持续地工作,并尽量减少真正需要你输入之前的汇报打断。**完全依赖官方 `github-copilot` provider**,无需修改模型配置。
|
|
138
138
|
|
|
139
139
|
## 功能一览
|
|
140
140
|
|
|
141
141
|
- **多账号管理** — 添加多个 Copilot 账号,随时切换
|
|
142
142
|
- **配额查询** — 查看每个账号的剩余额度
|
|
143
143
|
- **导入认证** — 可从 OpenCode 认证存储导入
|
|
144
|
-
- **Guided Loop Safety** —
|
|
144
|
+
- **Guided Loop Safety** — 仅对 Copilot 生效的更严格 question-first 提示词策略,推动非阻塞工作持续执行、在可用时要求用户可见汇报走 `question`,并帮助降低因反复中断带来的无谓配额消耗
|
|
145
145
|
- **无需模型配置** — 使用官方 provider,无需改模型
|
|
146
146
|
|
|
147
147
|
---
|
|
@@ -223,12 +223,12 @@ opencode auth login --provider github-copilot
|
|
|
223
223
|
- **添加账号**
|
|
224
224
|
- **从 auth.json 导入**
|
|
225
225
|
- **检查配额**
|
|
226
|
-
- **Guided Loop Safety 开关** — 通过提示词引导模型在可用时必须使用 `question`
|
|
226
|
+
- **Guided Loop Safety 开关** — 通过提示词引导模型在可用时必须使用 `question` 做用户可见汇报、继续完成非阻塞工作,并避免不必要的子代理调用
|
|
227
227
|
- **切换账号**
|
|
228
228
|
- **删除账号**
|
|
229
229
|
- **全部删除**
|
|
230
230
|
|
|
231
|
-
如果你希望 GitHub Copilot
|
|
231
|
+
如果你希望 GitHub Copilot 会话在一次 premium request 中尽量持续工作、更少被汇报打断,可以在账号菜单中开启 Guided Loop Safety。它是仅对 Copilot 生效的 prompt 引导式 question-first 模式:当 `question` 工具在当前会话中可用且被允许时,用户可见汇报必须通过它完成;只要还有安全的非阻塞工作可做,Copilot 就应继续执行而不是提前暂停;只有在当前确实没有可安全执行的动作时,才应通过 `question` 询问下一项任务或所需澄清,同时也会减少不必要的子代理调用。
|
|
232
232
|
|
|
233
233
|
---
|
|
234
234
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Hooks } from "@opencode-ai/plugin";
|
|
2
2
|
import { type StoreFile } from "./store.js";
|
|
3
|
-
export declare const LOOP_SAFETY_POLICY = "Guided Loop Safety Policy\n- When the question tool is available and permitted in the current session, all user-facing reports must be delivered through the question tool.\n- The question tool is considered available and permitted when it appears in the active tool list and the current session has not denied its use.\n- Direct assistant text is allowed only when the question tool is unavailable, denied, or absent from the current session.\n- When reporting multiple related items, prefer a single question tool call with multiple well-grouped questions instead of multiple separate interruptions.\n- Group related items into clear question batches such as current progress, key findings, and next-step choices.\n- For long or complex reports, split the report into paginated or sequential question batches instead of overloading one large message.\n- Present the highest-priority information first and defer secondary details to later question batches when needed.\n- Even when no explicit decision is required, prefer brief question-tool status updates over direct assistant text whenever the tool is available.\n- Avoid unnecessary question frequency; combine small related updates when a single question call can cover them clearly.\n- Dispatching task or subagent work is expensive and should be avoided unless it materially improves the result.\n- Materially improves the result means clearly beneficial cases such as parallel analysis of independent areas; it does not include routine local searches, small file reads, or straightforward edits.\n- If task or subagent delegation is used, keep the number minimal and explain the reason briefly through the question tool when available.";
|
|
3
|
+
export declare const LOOP_SAFETY_POLICY = "Guided Loop Safety Policy\n- Continue working on any remaining non-blocked task before stopping to report or wait for more instructions.\n- If you are not fully blocked, do not stop just because you feel ready to pause; finish the work that can still be done safely.\n- When the question tool is available and permitted in the current session, all user-facing reports must be delivered through the question tool.\n- The question tool is considered available and permitted when it appears in the active tool list and the current session has not denied its use.\n- Direct assistant text is allowed only when the question tool is unavailable, denied, or absent from the current session.\n- When reporting multiple related items, prefer a single question tool call with multiple well-grouped questions instead of multiple separate interruptions.\n- Group related items into clear question batches such as current progress, key findings, and next-step choices.\n- For long or complex reports, split the report into paginated or sequential question batches instead of overloading one large message.\n- Present the highest-priority information first and defer secondary details to later question batches when needed.\n- Even when no explicit decision is required, prefer brief question-tool status updates over direct assistant text whenever the tool is available.\n- Avoid unnecessary question frequency; combine small related updates when a single question call can cover them clearly.\n- When no further action can be taken safely and no non-blocked work remains, use the question tool to ask for the next task or clarification instead of ending with direct assistant text.\n- Dispatching task or subagent work is expensive and should be avoided unless it materially improves the result.\n- Materially improves the result means clearly beneficial cases such as parallel analysis of independent areas; it does not include routine local searches, small file reads, or straightforward edits.\n- If task or subagent delegation is used, keep the number minimal and explain the reason briefly through the question tool when available.";
|
|
4
4
|
export type ExperimentalChatSystemTransformHook = (input: {
|
|
5
5
|
sessionID: string;
|
|
6
6
|
model: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readStoreSafe } from "./store.js";
|
|
2
2
|
export const LOOP_SAFETY_POLICY = `Guided Loop Safety Policy
|
|
3
|
+
- Continue working on any remaining non-blocked task before stopping to report or wait for more instructions.
|
|
4
|
+
- If you are not fully blocked, do not stop just because you feel ready to pause; finish the work that can still be done safely.
|
|
3
5
|
- When the question tool is available and permitted in the current session, all user-facing reports must be delivered through the question tool.
|
|
4
6
|
- The question tool is considered available and permitted when it appears in the active tool list and the current session has not denied its use.
|
|
5
7
|
- Direct assistant text is allowed only when the question tool is unavailable, denied, or absent from the current session.
|
|
@@ -9,6 +11,7 @@ export const LOOP_SAFETY_POLICY = `Guided Loop Safety Policy
|
|
|
9
11
|
- Present the highest-priority information first and defer secondary details to later question batches when needed.
|
|
10
12
|
- Even when no explicit decision is required, prefer brief question-tool status updates over direct assistant text whenever the tool is available.
|
|
11
13
|
- Avoid unnecessary question frequency; combine small related updates when a single question call can cover them clearly.
|
|
14
|
+
- When no further action can be taken safely and no non-blocked work remains, use the question tool to ask for the next task or clarification instead of ending with direct assistant text.
|
|
12
15
|
- Dispatching task or subagent work is expensive and should be avoided unless it materially improves the result.
|
|
13
16
|
- Materially improves the result means clearly beneficial cases such as parallel analysis of independent areas; it does not include routine local searches, small file reads, or straightforward edits.
|
|
14
17
|
- If task or subagent delegation is used, keep the number minimal and explain the reason briefly through the question tool when available.`;
|