dsh-github-copilot 0.4.0-alpha.110 → 0.4.0-alpha.111
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/AGENTS.md +2 -0
- package/CHANGELOG.md +6 -0
- package/README.md +8 -8
- package/README.zh.md +8 -8
- package/deployment-baseline.json +4 -1
- package/docs/copilot-accounts.md +16 -3
- package/lib/client.js +30 -29
- package/lib/client.js.map +1 -1
- package/lib/index.js +59 -8
- package/lib/types/copilot-accounts-host.d.ts +1 -0
- package/lib/types/session-accounts-host.d.ts +1 -0
- package/lib/types/session-accounts.d.ts +2 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -49,6 +49,8 @@ This repository owns eleven narrow surfaces:
|
|
|
49
49
|
|
|
50
50
|
Identity presentation uses additive `ensureIdentity` Remotes, including explicit-Agent Session lookup. Keep `get` metadata-only; visible surfaces may ensure on their sixty-second cadence. Fresh ten-minute cache avoids requests, same-account consumers join a bounded flight, and failures cool down thirty seconds unless explicitly refreshed. Credential notifications revoke pending work even when token bytes are unchanged; no late cache publication. Quota may settle independently only with account-coherent metadata. Presentation cache never replaces fresh identity validation for switch, reauthorization or duplicate checks. Preserve strict sanitized diagnostics and Session/turn ownership (#309).
|
|
51
51
|
|
|
52
|
+
Account display names survive freshness expiry in bounded Host memory, never credential invalidation or failed verification. Visible account lists may ensure missing configured names without activating accounts; no disk name cache, credential copying or identity-based authorization. Turn admission captures the first verified name for the frozen account. A missing name may be filled by one existing nonforcing account-bound lookup only during that exact active, uncancelled turn/signal; never after turn/end/disposal. Evidence still requires actual native delivery and never reconstructs completed history (#322).
|
|
53
|
+
|
|
52
54
|
The user approved independently authorized account records in the existing DSH credentials service. The canonical `llm-pi-ai/github-copilot` record remains unchanged as the compatibility account. Additional plugin-owned `github-copilot/account-<opaque-id>` records must be written directly by official pi-ai OAuth through public account-bound stores; never copy/move grants, refill the canonical record, introduce a separate credential storage service, patch Core, or implement another wire/catalog. Native `Models.getAuth()` and DSH `modifyRecord()` remain the refresh and serialization owners.
|
|
53
55
|
|
|
54
56
|
Settings store only the opaque global account selector and explicit `sessionAccounts` rows. Missing/invalid selectors or records fail explicitly, without another-account fallback. Models manages reauthorization/removal and the global default; Credits may select an already authorized account for this Session's subsequent turns, restore global inheritance or run add-only authorization without selecting it (#305/#318). An explicit choice equal to the default remains explicit. Freeze account ownership before Auto assessment and request admission, holding mutation fences until native `turn/end`/disposal; later Session/default changes never redirect running steps, retries or search. Account-local credentials, metadata, quota, proof cancellation and native adapter composition must remain isolated. Keep one public adapter/controller registration, with no second wire/catalog or Core changes. Reauthorization/removal of a pinned record stays blocked; global-default selection may continue independently.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.111 (prepared)
|
|
4
|
+
|
|
5
|
+
- Retain verified saved-account display names beyond the ten-minute revalidation interval in bounded Host memory. Models and Session Credits resolve missing inactive account names without switching accounts; credential changes, removal and failed verification still invalidate names (#322).
|
|
6
|
+
- Capture identity for the frozen admitted account and non-blockingly ensure missing identity once per active turn. Preserve the first verified name, require native delivery for execution evidence, and reject late/aborted/completed-turn enrichment. Refresh the account footer at native completion.
|
|
7
|
+
- Keep existing strict Remote descriptors, credential ownership, model-access validation, history and Usage unchanged. No persistent name store, Core changes, live installation or restart.
|
|
8
|
+
|
|
3
9
|
## 0.4.0-alpha.110 (prepared)
|
|
4
10
|
|
|
5
11
|
- Replace searchable account-switch forms with one compact anchored dropdown in Models and Chat: current-choice checkmark, bounded internal scrolling and Add account footer (#320).
|
package/README.md
CHANGED
|
@@ -15,11 +15,11 @@ Inside **Credits**, choose a saved account for this Session's subsequent turns o
|
|
|
15
15
|
restore **Follow global default**. Running turns retain their original account.
|
|
16
16
|
Identity display accepts GitHub Enterprise Managed User names, including their underscore-separated enterprise suffixes.
|
|
17
17
|
|
|
18
|
-
Visible Models and Credits
|
|
18
|
+
Visible Models and Credits resolve missing names for saved accounts without activating them. Verified names remain cached for the Host lifetime, including inactive accounts; the ten-minute freshness interval governs revalidation, not name display. Credential changes, removal and failed identity verification invalidate names. Shared per-account requests and a thirty-second failure cooldown remain; explicit refresh retries immediately. Names do not prove authorization or model access. See [account lifecycle](./docs/copilot-accounts.md).
|
|
19
19
|
|
|
20
20
|
Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
|
|
21
21
|
|
|
22
|
-
**Source candidate: `0.4.0-alpha.
|
|
22
|
+
**Source candidate: `0.4.0-alpha.111` (unreleased). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. The versioned commands below are for this candidate after publication, not evidence that its assets exist.
|
|
23
23
|
|
|
24
24
|
## What you can do
|
|
25
25
|
|
|
@@ -59,10 +59,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
|
|
|
59
59
|
For a **standalone named profile**:
|
|
60
60
|
|
|
61
61
|
```sh
|
|
62
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
62
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.111/dsh-github-copilot-0.4.0-alpha.111.tgz
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.
|
|
65
|
+
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.111` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
|
|
66
66
|
|
|
67
67
|
After an approved reload/restart:
|
|
68
68
|
|
|
@@ -74,7 +74,7 @@ Sign-out requires an explicit action and removes only the active account's autho
|
|
|
74
74
|
|
|
75
75
|
In **Manage → GitHub accounts**, adding an account never replaces the global default. During device authorization, the card keeps the verification link and selectable URL, one-time code, **Copy authorization code**, and **Cancel adding account** together. Once authorization succeeds, the card separately verifies identity and available models; a completed addition is still not a default switch. Diagnostic codes remain in a collapsed technical-details disclosure. **Refresh account information** renews identity only; it does not complete or cancel authorization. A confirmed switch changes future inherited turns, not running turns or explicit Session overrides. **Credits → Switch account** persists a choice only for this Session's subsequent turns; **Follow global default** clears it. Explicitly choosing today's default still remains a Session override. Native-route or incomplete evidence blocks account switching. The new account may not offer your selected model, and old encrypted replay may be account-bound: no automatic model substitution or history removal occurs. **Reauthorize** renews the same saved identity; **Remove** deletes only an inactive saved authorization and cannot mutate a running turn's pinned account. Missing/revoked accounts never fall back.
|
|
76
76
|
|
|
77
|
-
Completed managed turns show **Account** beside native Usage. It records the request account, not billing or subagent totals. A
|
|
77
|
+
Completed managed turns show **Account** beside native Usage. It records the request account, not billing or subagent totals. A verified name is frozen at admission; if missing, an existing bounded non-forcing lookup for that exact account runs without delaying model delivery and can fill identity only while the same turn remains active. No account evidence exists before native delivery. Missing identity remains unavailable; completed history is never backfilled from current settings. Evidence is bounded to the Host lifetime; restart, cold history or missing delivery displays unknown. Credits labels an unidentified original or saved authorization without displaying opaque account IDs.
|
|
78
78
|
|
|
79
79
|
Account eligibility reads official rc.2 SettingsForms values, without requiring the retired settings `get()` API. Missing or malformed configuration remains incomplete evidence; upgrading does not bypass native-route or activity restrictions.
|
|
80
80
|
|
|
@@ -216,14 +216,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
|
|
|
216
216
|
GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
|
|
217
217
|
|
|
218
218
|
```sh
|
|
219
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
220
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
219
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.111/dsh-github-copilot-0.4.0-alpha.111.tgz
|
|
220
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.111/SHA256SUMS
|
|
221
221
|
sha256sum --check SHA256SUMS
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
```powershell
|
|
225
225
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
226
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
226
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.111.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
227
227
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
228
228
|
```
|
|
229
229
|
|
package/README.zh.md
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
在 Credits 内选择本 Session 后续 turn 的账号,或恢复跟随全局默认;正在运行的 turn 保持原账号。
|
|
14
14
|
身份展示支持 GitHub 企业托管账号,包括带下划线企业后缀的用户名。
|
|
15
15
|
|
|
16
|
-
可见的 Models 和 Credits
|
|
16
|
+
可见的 Models 和 Credits 会补齐已保存账号缺失的名称,不需要先激活账号。已验证名称在 Host 生命周期内缓存,未激活账号也会保留;十分钟是重新验证的间隔,不是名字的显示期限。凭据变更、账号移除及身份验证失败会使名称失效。同账号共享请求、失败冷却三十秒,显式刷新可立即重试。名称不能证明授权有效或模型可用。参见[账号生命周期](./docs/copilot-accounts.md)。
|
|
17
17
|
|
|
18
18
|
添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
|
|
19
19
|
|
|
20
|
-
**源码候选版本:`0.4.0-alpha.
|
|
20
|
+
**源码候选版本:`0.4.0-alpha.111`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
|
|
21
21
|
|
|
22
22
|
## 你可以做什么
|
|
23
23
|
|
|
@@ -57,10 +57,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
57
57
|
**独立具名 profile**:
|
|
58
58
|
|
|
59
59
|
```sh
|
|
60
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
60
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.111/dsh-github-copilot-0.4.0-alpha.111.tgz
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.
|
|
63
|
+
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.111`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
|
|
64
64
|
|
|
65
65
|
经批准 reload/restart 后:
|
|
66
66
|
|
|
@@ -72,7 +72,7 @@ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/release
|
|
|
72
72
|
|
|
73
73
|
在 **Manage → GitHub accounts**添加账号不会替换全局默认。设备授权期间,卡片会同时保留验证链接、可选择的网址、一次性授权码、**复制授权码**和**取消添加账号**。GitHub 授权成功后,卡片会单独验证身份和可用模型;完成添加仍不会切换默认账号。诊断码位于折叠的技术详情中。**刷新账号信息**只更新身份,不会完成或取消授权。确认切换只影响后续跟随默认的 turn,不影响正在运行的 turn 或 Session 已指定账号。**Credits → 切换账号**只为本 Session 后续 turn 保存选择;**跟随全局默认**清除该选择。即使显式选中的账号恰好等于全局默认,也仍是 Session 覆盖。原生路由尚存或证据不完整时会阻止账号切换。新账号可能没有已选模型,旧加密 replay 也可能绑定原账号;不会自动替换模型或删除历史。**Reauthorize**仅更新同一已存身份的授权;**Remove**仅删除非全局活动授权,正在运行 turn 锁定的授权不能修改。账号缺失/失效不会自动回退到其它账号。
|
|
74
74
|
|
|
75
|
-
已完成的托管 turn 在原生 Usage 旁显示 **Account**,记录实际请求账号,不是计费归因或子 Agent
|
|
75
|
+
已完成的托管 turn 在原生 Usage 旁显示 **Account**,记录实际请求账号,不是计费归因或子 Agent 汇总。准入时冻结已验证名称;缺失时针对本轮固定账号执行现有的有界、非强制查询,不阻塞模型输出,只能在同一 turn 仍运行时补齐身份。没有原生流返回就没有账号执行证据。未查到的身份仍显示不可用;不会根据当前设置补写已完成历史。证据仅在 Host 生命周期内有界保留,重启及冷历史显示未知。Credits 对身份未知的原始/已保存授权显示可读标签,不显示不透明账号 ID。
|
|
76
76
|
|
|
77
77
|
切换资格通过官方 rc.2 SettingsForms 的配置值读取,不再依赖已退役的 Settings `get()` API。缺失或无效配置仍视为证据不完整;升级不会绕过原生路由或运行中工作的限制。
|
|
78
78
|
|
|
@@ -214,14 +214,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
|
|
|
214
214
|
GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
|
|
215
215
|
|
|
216
216
|
```sh
|
|
217
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
218
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
217
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.111/dsh-github-copilot-0.4.0-alpha.111.tgz
|
|
218
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.111/SHA256SUMS
|
|
219
219
|
sha256sum --check SHA256SUMS
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
```powershell
|
|
223
223
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
224
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
224
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.111.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
225
225
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
226
226
|
```
|
|
227
227
|
|
package/deployment-baseline.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"package": {
|
|
10
10
|
"name": "dsh-github-copilot",
|
|
11
|
-
"version": "0.4.0-alpha.
|
|
11
|
+
"version": "0.4.0-alpha.111"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -304,6 +304,7 @@
|
|
|
304
304
|
"tests": [
|
|
305
305
|
{"file": "tests/session-accounts.spec.ts", "name": "freezes each turn across preference changes, steps and retries"},
|
|
306
306
|
{"file": "tests/session-accounts-host.spec.ts", "name": "holds account mutation fencing through abort until the actual turn boundary"},
|
|
307
|
+
{"file": "tests/session-accounts-host.spec.ts", "name": "ignores identity completion after the turn ends"},
|
|
307
308
|
{"file": "tests/copilot-usage-card.spec.ts", "name": "switches only subsequent Session turns inside Credits and can restore inheritance"},
|
|
308
309
|
{"file": "tests/fixtures/remote-core.fixture.ts", "name": "binds Session account choices and historical reads through native Client and %s Host gateways"},
|
|
309
310
|
{"file": "tests/fixtures/copilot-accounts-persistence-core.fixture.ts", "name": "persists independent native credentials and SettingsForms CAS across profile restart without cross-account OAuth writes"}
|
|
@@ -324,6 +325,8 @@
|
|
|
324
325
|
],
|
|
325
326
|
"tests": [
|
|
326
327
|
{"file": "tests/copilot-identity-refresh.spec.ts", "name": "renews expired identity once for account %s without changing metadata-only reads"},
|
|
328
|
+
{"file": "tests/copilot-account-identity-cache.spec.ts", "name": "hydrates saved inactive names without activating them, then reuses them"},
|
|
329
|
+
{"file": "tests/copilot-account-identity-cache.spec.ts", "name": "retains inactive verified names after freshness expiry without reads or network in status"},
|
|
327
330
|
{"file": "tests/copilot-usage-card.spec.ts", "name": "settles quota before a slow identity renewal and uses nonforcing ensure on visible refresh cadence"},
|
|
328
331
|
{"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "never writes a captured A refresh into B after an external selection change"},
|
|
329
332
|
{"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "preserves uncertain commit ahead of missing-slot recovery"},
|
package/docs/copilot-accounts.md
CHANGED
|
@@ -235,8 +235,13 @@ See [the approved experience and mock](./account-management-experience.md).
|
|
|
235
235
|
Completed managed turns have a compact **Account** disclosure alongside native
|
|
236
236
|
Usage/selection actions through the public assistant-actions slot. This is
|
|
237
237
|
request-account evidence, not billing attribution or a subagent account rollup.
|
|
238
|
-
It
|
|
239
|
-
|
|
238
|
+
It freezes a verified cached identity at admission. Missing identity starts one
|
|
239
|
+
nonforcing, bounded lookup for the exact admitted account without delaying model
|
|
240
|
+
delivery. A successful lookup may fill missing identity only while that same
|
|
241
|
+
turn/signal remains active and uncancelled, retaining the first verified name.
|
|
242
|
+
Account execution evidence is still created only on the first real ordinary
|
|
243
|
+
native chunk, not discovery, preparation or auxiliary Auto assessment. Late
|
|
244
|
+
lookups never backfill completed turns. Host memory retains at
|
|
240
245
|
most 64 Sessions and 128 turns per Session. Restart, cold history, eviction or a
|
|
241
246
|
request with no native delivery is unknown. Failed reads are distinct from
|
|
242
247
|
unknown evidence; Retry rereads the same turn without inference. Official rc.2
|
|
@@ -264,7 +269,15 @@ same-account in-flight work and observes a thirty-second failure cooldown;
|
|
|
264
269
|
explicit **Refresh account information** bypasses cooldown but joins active
|
|
265
270
|
work. There is no render-driven request loop or background polling after
|
|
266
271
|
unmount. Credential changes revoke identity and pending work; cancelled or
|
|
267
|
-
|
|
272
|
+
unverified identity is never shown as current. Verified display names remain in
|
|
273
|
+
the bounded Host cache beyond the ten-minute revalidation interval; freshness
|
|
274
|
+
expiry alone never replaces an inactive account name with unknown. Names are
|
|
275
|
+
display metadata, not authorization/model-access proof, and are not persisted
|
|
276
|
+
across Host restarts. Models and Session Credits ensure missing configured
|
|
277
|
+
account names through the same per-account lookup without activating those
|
|
278
|
+
accounts. Membership limits bound the parallel lookups and each retains its
|
|
279
|
+
timeout/single flight/cooldown. Credential invalidation and failed verification
|
|
280
|
+
still clear names. Session ensure retains explicit
|
|
268
281
|
Agent lookup and rechecks account selection before returning.
|
|
269
282
|
|
|
270
283
|
Quota settles independently of identity renewal only after account-coherent
|
package/lib/client.js
CHANGED
|
@@ -7353,35 +7353,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7353
7353
|
const [account, setAccount] = react.useState();
|
|
7354
7354
|
const [accountFailed, setAccountFailed] = react.useState(false);
|
|
7355
7355
|
const [accountAttempt, setAccountAttempt] = react.useState(0);
|
|
7356
|
-
react.useEffect(() => {
|
|
7357
|
-
setAccount(void 0);
|
|
7358
|
-
setAccountFailed(false);
|
|
7359
|
-
if (turn === void 0 || sessionId === void 0 || props.accountRemote === void 0) return;
|
|
7360
|
-
let active = true;
|
|
7361
|
-
props.accountRemote.turn(sessionId, turn).then((result) => {
|
|
7362
|
-
if (!active) return;
|
|
7363
|
-
const parsed = result.ok ? TurnAccountViewSchema.safeParse(result.value) : void 0;
|
|
7364
|
-
if (parsed?.success) setAccount(parsed.data);
|
|
7365
|
-
else {
|
|
7366
|
-
setAccountFailed(true);
|
|
7367
|
-
props.diagnostic("COPILOT_TURN_ACCOUNT_READ_FAILED");
|
|
7368
|
-
}
|
|
7369
|
-
}, () => {
|
|
7370
|
-
if (active) {
|
|
7371
|
-
setAccountFailed(true);
|
|
7372
|
-
props.diagnostic("COPILOT_TURN_ACCOUNT_READ_FAILED");
|
|
7373
|
-
}
|
|
7374
|
-
});
|
|
7375
|
-
return () => {
|
|
7376
|
-
active = false;
|
|
7377
|
-
};
|
|
7378
|
-
}, [
|
|
7379
|
-
props.accountRemote,
|
|
7380
|
-
sessionId,
|
|
7381
|
-
turn,
|
|
7382
|
-
props.diagnostic,
|
|
7383
|
-
accountAttempt
|
|
7384
|
-
]);
|
|
7385
7356
|
react.useEffect(() => {
|
|
7386
7357
|
setLive({ mode: "unknown" });
|
|
7387
7358
|
if (turn === void 0 || sessionId === void 0 || props.remote === void 0) {
|
|
@@ -7434,6 +7405,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7434
7405
|
const native = record$4(props.tail) && record$4(props.tail.data) ? props.tail.data : void 0;
|
|
7435
7406
|
const nativeCompleted = native?.turn === turn && sequence(native?.seq);
|
|
7436
7407
|
const completed = evidence?.ended === true || nativeCompleted;
|
|
7408
|
+
react.useEffect(() => {
|
|
7409
|
+
setAccount(void 0);
|
|
7410
|
+
setAccountFailed(false);
|
|
7411
|
+
if (turn === void 0 || sessionId === void 0 || props.accountRemote === void 0) return;
|
|
7412
|
+
let active = true;
|
|
7413
|
+
props.accountRemote.turn(sessionId, turn).then((result) => {
|
|
7414
|
+
if (!active) return;
|
|
7415
|
+
const parsed = result.ok ? TurnAccountViewSchema.safeParse(result.value) : void 0;
|
|
7416
|
+
if (parsed?.success) setAccount(parsed.data);
|
|
7417
|
+
else {
|
|
7418
|
+
setAccountFailed(true);
|
|
7419
|
+
props.diagnostic("COPILOT_TURN_ACCOUNT_READ_FAILED");
|
|
7420
|
+
}
|
|
7421
|
+
}, () => {
|
|
7422
|
+
if (active) {
|
|
7423
|
+
setAccountFailed(true);
|
|
7424
|
+
props.diagnostic("COPILOT_TURN_ACCOUNT_READ_FAILED");
|
|
7425
|
+
}
|
|
7426
|
+
});
|
|
7427
|
+
return () => {
|
|
7428
|
+
active = false;
|
|
7429
|
+
};
|
|
7430
|
+
}, [
|
|
7431
|
+
props.accountRemote,
|
|
7432
|
+
sessionId,
|
|
7433
|
+
turn,
|
|
7434
|
+
props.diagnostic,
|
|
7435
|
+
accountAttempt,
|
|
7436
|
+
completed
|
|
7437
|
+
]);
|
|
7437
7438
|
const nativeRoutes = nativeCompleted && record$4(native?.tokenUsage) && Array.isArray(native.tokenUsage.routes) ? native.tokenUsage.routes : [];
|
|
7438
7439
|
const recorded = evidence?.routes.length ? evidence.routes : nativeRoutes.filter((route) => record$4(route) && typeof route.provider === "string" && route.provider.trim() !== "" && typeof route.model === "string" && route.model.trim() !== "");
|
|
7439
7440
|
const needsRequested = completed && recorded.length === 0;
|