dsh-github-copilot 0.4.0-alpha.104 → 0.4.0-alpha.105
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 +7 -0
- package/README.md +8 -6
- package/README.zh.md +8 -6
- package/deployment-baseline.json +4 -1
- package/docs/copilot-accounts.md +21 -3
- package/lib/client.js +54 -11
- package/lib/client.js.map +1 -1
- package/lib/index.js +141 -27
- package/lib/remote.js +8 -0
- package/lib/types/copilot-accounts-card.d.ts +1 -0
- package/lib/types/copilot-accounts-host.d.ts +8 -0
- package/lib/types/copilot-accounts-remote.d.ts +7 -0
- package/lib/types/copilot-accounts-types.d.ts +1 -1
- package/lib/types/copilot-usage-card.d.ts +1 -1
- package/lib/types/session-accounts-controller.d.ts +2 -0
- package/lib/types/session-accounts-remote.d.ts +7 -0
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -47,6 +47,8 @@ This repository owns eleven narrow surfaces:
|
|
|
47
47
|
|
|
48
48
|
## Approved multi-account ownership extension (#297)
|
|
49
49
|
|
|
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
|
+
|
|
50
52
|
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.
|
|
51
53
|
|
|
52
54
|
Settings store only the opaque global account selector and explicit `sessionAccounts` rows. Missing/invalid selectors or records fail explicitly, without another-account fallback. Models alone manages authorizations and the global default; Credits may select an already authorized account for this Session's subsequent turns or restore global inheritance (#305). 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,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0-alpha.105 (prepared)
|
|
4
|
+
|
|
5
|
+
- Renew expired account identity from visible Models and Credits through nonforcing, account-scoped ensure reads. Fresh ten-minute cache avoids requests; concurrent consumers share one bounded request and failed renewals retain a thirty-second cooldown (#309).
|
|
6
|
+
- Revoke pending identity on credential changes, selection changes and disposal, rejecting late results even when credentials retain the same bytes. Explicit account switching/reauthorization still validates fresh identity.
|
|
7
|
+
- Settle account-coherent Credits independently of slow identity renewal. Preserve Session account choices, running-turn pins, quota freshness semantics and metadata-only status reads.
|
|
8
|
+
- Add strict additive global/Session ensure Remotes and sanitized timeout, TLS, network, authentication, rate-limit and HTTP diagnostics. No authenticated provider calls, installation or restart are implied by synthetic evidence.
|
|
9
|
+
|
|
3
10
|
## 0.4.0-alpha.104 (prepared)
|
|
4
11
|
|
|
5
12
|
- Select an already authorized account inside Credits for this Session's subsequent turns, or follow the Models global default. Explicit same-as-default choices remain overrides; running turns keep their frozen account (#305).
|
package/README.md
CHANGED
|
@@ -15,7 +15,9 @@ 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
|
-
|
|
18
|
+
Visible Models and Credits renew expired identity without forcing fresh reads on every mount: ten-minute identity cache, shared per-account requests and a thirty-second failure cooldown. Explicit refresh retries immediately; quota can settle while identity renews. Unknown or revoked identity is never shown as current, and Session account isolation is unchanged. See [account lifecycle](./docs/copilot-accounts.md).
|
|
19
|
+
|
|
20
|
+
**Source candidate: `0.4.0-alpha.105` (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.
|
|
19
21
|
|
|
20
22
|
## What you can do
|
|
21
23
|
|
|
@@ -55,10 +57,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
|
|
|
55
57
|
For a **standalone named profile**:
|
|
56
58
|
|
|
57
59
|
```sh
|
|
58
|
-
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.105/dsh-github-copilot-0.4.0-alpha.105.tgz
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.
|
|
63
|
+
For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.105` 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.
|
|
62
64
|
|
|
63
65
|
After an approved reload/restart:
|
|
64
66
|
|
|
@@ -204,14 +206,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
|
|
|
204
206
|
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.
|
|
205
207
|
|
|
206
208
|
```sh
|
|
207
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
208
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
209
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
|
|
210
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/SHA256SUMS
|
|
209
211
|
sha256sum --check SHA256SUMS
|
|
210
212
|
```
|
|
211
213
|
|
|
212
214
|
```powershell
|
|
213
215
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
214
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
216
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.105.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
215
217
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
216
218
|
```
|
|
217
219
|
|
package/README.zh.md
CHANGED
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
在 Credits 内选择本 Session 后续 turn 的账号,或恢复跟随全局默认;正在运行的 turn 保持原账号。
|
|
14
14
|
身份展示支持 GitHub 企业托管账号,包括带下划线企业后缀的用户名。
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
可见的 Models 和 Credits 会续期已过期身份,不会在每次挂载时强制请求:身份缓存十分钟,同账号共享请求,失败冷却三十秒。显式刷新可立即重试;额度可先于身份续期完成展示。未知或已撤销身份不会作为当前用户名展示,Session 账号隔离保持不变。参见[账号生命周期](./docs/copilot-accounts.md)。
|
|
17
|
+
|
|
18
|
+
**源码候选版本:`0.4.0-alpha.105`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
|
|
17
19
|
|
|
18
20
|
## 你可以做什么
|
|
19
21
|
|
|
@@ -53,10 +55,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
|
|
|
53
55
|
**独立具名 profile**:
|
|
54
56
|
|
|
55
57
|
```sh
|
|
56
|
-
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
58
|
+
dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
|
|
57
59
|
```
|
|
58
60
|
|
|
59
|
-
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.
|
|
61
|
+
**Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.105`。官方 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 或删除配置。
|
|
60
62
|
|
|
61
63
|
经批准 reload/restart 后:
|
|
62
64
|
|
|
@@ -202,14 +204,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
|
|
|
202
204
|
GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
|
|
203
205
|
|
|
204
206
|
```sh
|
|
205
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
206
|
-
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.
|
|
207
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/dsh-github-copilot-0.4.0-alpha.105.tgz
|
|
208
|
+
curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.105/SHA256SUMS
|
|
207
209
|
sha256sum --check SHA256SUMS
|
|
208
210
|
```
|
|
209
211
|
|
|
210
212
|
```powershell
|
|
211
213
|
$expected = (Get-Content .\SHA256SUMS).Split()[0]
|
|
212
|
-
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.
|
|
214
|
+
$actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.105.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
|
|
213
215
|
if ($actual -cne $expected) { throw 'Release checksum mismatch' }
|
|
214
216
|
```
|
|
215
217
|
|
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.105"
|
|
12
12
|
},
|
|
13
13
|
"evidence": {
|
|
14
14
|
"kind": "source-and-synthetic-test-inventory",
|
|
@@ -315,6 +315,7 @@
|
|
|
315
315
|
"evidenceScope": "synthetic-public-services-native-adapter-and-ui-not-live-oauth-or-provider-access",
|
|
316
316
|
"activation": "managed-only-explicit-account-selector",
|
|
317
317
|
"sourceMarkers": [
|
|
318
|
+
{"file": "src/copilot-accounts-host.ts", "marker": "async ensureIdentityFor(accountId: string)"},
|
|
318
319
|
{"file": "AGENTS.md", "marker": "Approved multi-account ownership extension (#297)"},
|
|
319
320
|
{"file": "src/remote.ts", "marker": "...copilotAccountsRemote.descriptors"},
|
|
320
321
|
{"file": "src/copilot-accounts-card.ts", "marker": "removeAccount(accountId: string, expectedRevision: number)"},
|
|
@@ -322,6 +323,8 @@
|
|
|
322
323
|
{"file": "docs/copilot-accounts.md", "marker": "A mutable active-account lookup inside each store method is forbidden"}
|
|
323
324
|
],
|
|
324
325
|
"tests": [
|
|
326
|
+
{"file": "tests/copilot-identity-refresh.spec.ts", "name": "renews expired identity once for account %s without changing metadata-only reads"},
|
|
327
|
+
{"file": "tests/copilot-usage-card.spec.ts", "name": "settles quota before a slow identity renewal and uses nonforcing ensure on visible refresh cadence"},
|
|
325
328
|
{"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "never writes a captured A refresh into B after an external selection change"},
|
|
326
329
|
{"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "preserves uncertain commit ahead of missing-slot recovery"},
|
|
327
330
|
{"file": "tests/fixtures/copilot-accounts-host-core.fixture.ts", "name": "rechecks externally started canonical authorization before selector CAS"},
|
package/docs/copilot-accounts.md
CHANGED
|
@@ -200,7 +200,7 @@ These images render the actual candidate components with synthetic accounts
|
|
|
200
200
|
and quota in an isolated browser. They are not real authorization, supplier
|
|
201
201
|
availability or loaded Desktop evidence.
|
|
202
202
|
|
|
203
|
-
The separate `githubCopilotAccounts` namespace exposes `get`,
|
|
203
|
+
The separate `githubCopilotAccounts` namespace exposes `get`, `ensureIdentity`,
|
|
204
204
|
`refreshIdentity`, `add`, `cancel`, `switchAccount`, `reauthorize` and
|
|
205
205
|
`removeAccount`. Existing Remote descriptors are retained. The removal method
|
|
206
206
|
cannot be named `remove`: official rc.2 reserves that inherited service name
|
|
@@ -231,8 +231,26 @@ identity, grants or quota between surfaces. Failed reads never restore the
|
|
|
231
231
|
previous username as current.
|
|
232
232
|
Missing quota is not zero; pooled, stale, request-based and credit-based
|
|
233
233
|
snapshots retain their distinct meanings. Do not claim cross-app aggregation
|
|
234
|
-
or relabel request counts as AI credits.
|
|
235
|
-
|
|
234
|
+
or relabel request counts as AI credits.
|
|
235
|
+
|
|
236
|
+
Visible Models and Credits surfaces ensure identity on mount, visibility return
|
|
237
|
+
and their sixty-second display cadence. `get` and `viewForAccount` remain
|
|
238
|
+
metadata-only. Nonforcing ensure reuses a fresh ten-minute identity, joins
|
|
239
|
+
same-account in-flight work and observes a thirty-second failure cooldown;
|
|
240
|
+
explicit **Refresh account information** bypasses cooldown but joins active
|
|
241
|
+
work. There is no render-driven request loop or background polling after
|
|
242
|
+
unmount. Credential changes revoke identity and pending work; cancelled or
|
|
243
|
+
expired identity is never shown as current. Session ensure retains explicit
|
|
244
|
+
Agent lookup and rechecks account selection before returning.
|
|
245
|
+
|
|
246
|
+
Quota settles independently of identity renewal only after account-coherent
|
|
247
|
+
metadata checks. Identity failures cannot turn account quota into zero or
|
|
248
|
+
discard an otherwise valid same-account reading. Sanitized diagnostics separate
|
|
249
|
+
timeout, certificate, network, auth rejection, rate limiting and other HTTP
|
|
250
|
+
failures; no raw response/error text or credentials enter the Remote. These
|
|
251
|
+
diagnostics do not establish the cause of earlier screenshots or prove live
|
|
252
|
+
supplier health. Account switching, duplicate checks and reauthorization still
|
|
253
|
+
require fresh authenticated identity validation, not the presentation cache.
|
|
236
254
|
|
|
237
255
|
## Acceptance gates
|
|
238
256
|
|
package/lib/client.js
CHANGED
|
@@ -5594,6 +5594,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5594
5594
|
"COPILOT_ACCOUNTS_MODELS_FAILED",
|
|
5595
5595
|
"COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE",
|
|
5596
5596
|
"COPILOT_ACCOUNTS_IDENTITY_INVALID",
|
|
5597
|
+
"COPILOT_ACCOUNTS_IDENTITY_TIMEOUT",
|
|
5598
|
+
"COPILOT_ACCOUNTS_IDENTITY_TLS",
|
|
5599
|
+
"COPILOT_ACCOUNTS_IDENTITY_NETWORK",
|
|
5600
|
+
"COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED",
|
|
5601
|
+
"COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED",
|
|
5602
|
+
"COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR",
|
|
5597
5603
|
"COPILOT_ACCOUNTS_IDENTITY_CHANGED",
|
|
5598
5604
|
"COPILOT_ACCOUNTS_DUPLICATE",
|
|
5599
5605
|
"COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED",
|
|
@@ -5937,6 +5943,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5937
5943
|
descriptors: [
|
|
5938
5944
|
"get",
|
|
5939
5945
|
"refreshIdentity",
|
|
5946
|
+
"ensureIdentity",
|
|
5940
5947
|
"add",
|
|
5941
5948
|
"cancel",
|
|
5942
5949
|
"switchAccount",
|
|
@@ -5990,6 +5997,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5990
5997
|
"get",
|
|
5991
5998
|
"set",
|
|
5992
5999
|
"refreshIdentity",
|
|
6000
|
+
"ensureIdentity",
|
|
5993
6001
|
"usage",
|
|
5994
6002
|
"refreshUsage",
|
|
5995
6003
|
"turn"
|
|
@@ -8480,7 +8488,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8480
8488
|
setConfirmation(void 0);
|
|
8481
8489
|
setBusy(false);
|
|
8482
8490
|
setFailed(false);
|
|
8483
|
-
if (props.remote !== void 0 && !props.authorizationBusy) run(() => props.remote.
|
|
8491
|
+
if (props.remote !== void 0 && !props.authorizationBusy) run(() => props.remote.ensureIdentity());
|
|
8484
8492
|
return () => {
|
|
8485
8493
|
owner.active = false;
|
|
8486
8494
|
owner.generation++;
|
|
@@ -8492,6 +8500,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8492
8500
|
props.authorizationBusy,
|
|
8493
8501
|
props.configured
|
|
8494
8502
|
]);
|
|
8503
|
+
(0, react.useEffect)(() => {
|
|
8504
|
+
if (props.remote === void 0 || props.authorizationBusy || view?.operation !== void 0) return;
|
|
8505
|
+
const ensure = () => {
|
|
8506
|
+
if (document.visibilityState !== "hidden") run(() => props.remote.ensureIdentity());
|
|
8507
|
+
};
|
|
8508
|
+
const timer = window.setInterval(ensure, 6e4);
|
|
8509
|
+
document.addEventListener("visibilitychange", ensure);
|
|
8510
|
+
return () => {
|
|
8511
|
+
window.clearInterval(timer);
|
|
8512
|
+
document.removeEventListener("visibilitychange", ensure);
|
|
8513
|
+
};
|
|
8514
|
+
}, [
|
|
8515
|
+
props.remote,
|
|
8516
|
+
props.authorizationBusy,
|
|
8517
|
+
view?.operation,
|
|
8518
|
+
run
|
|
8519
|
+
]);
|
|
8495
8520
|
(0, react.useEffect)(() => {
|
|
8496
8521
|
if (view?.operation !== "authorizing" || props.remote === void 0) return;
|
|
8497
8522
|
const timer = window.setTimeout(() => {
|
|
@@ -8768,7 +8793,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8768
8793
|
generation: 0,
|
|
8769
8794
|
busy: false
|
|
8770
8795
|
});
|
|
8771
|
-
const identityRead = (0, react.useRef)(false);
|
|
8772
8796
|
const close = (0, react.useCallback)((restore = false) => {
|
|
8773
8797
|
setOpen(false);
|
|
8774
8798
|
if (restore) trigger.current?.focus();
|
|
@@ -8782,10 +8806,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8782
8806
|
setBusy(true);
|
|
8783
8807
|
setFailed(false);
|
|
8784
8808
|
try {
|
|
8785
|
-
const identityOperation = props.accountsRemote === void 0 ? void 0 : force
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8809
|
+
const identityOperation = props.accountsRemote === void 0 ? void 0 : (force ? props.accountsRemote.refreshIdentity() : props.accountsRemote.ensureIdentity()).catch(() => void 0);
|
|
8810
|
+
const [result, identityResult, sessionResult] = await Promise.all([
|
|
8811
|
+
force ? props.remote.refresh() : props.remote.get(),
|
|
8812
|
+
props.accountsRemote?.get().catch(() => void 0),
|
|
8813
|
+
props.sessionAccount?.get()
|
|
8814
|
+
]);
|
|
8789
8815
|
if (!current()) return;
|
|
8790
8816
|
const sessionView = sessionResult?.ok ? SessionAccountViewSchema.safeParse(sessionResult.value) : void 0;
|
|
8791
8817
|
setSessionAccount(sessionView?.success ? sessionView.data : void 0);
|
|
@@ -8797,6 +8823,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8797
8823
|
setView(void 0);
|
|
8798
8824
|
setFailed(true);
|
|
8799
8825
|
} else setView(parsed.data);
|
|
8826
|
+
owner.busy = false;
|
|
8827
|
+
setBusy(false);
|
|
8828
|
+
const renewed = await identityOperation;
|
|
8829
|
+
if (!current()) return;
|
|
8830
|
+
const renewedView = renewed?.ok === true ? accountsViewFrom(renewed.value) : void 0;
|
|
8831
|
+
if (renewedView !== void 0 && renewedView.activeAccountId === identityView?.activeAccountId) setAccounts(renewedView);
|
|
8832
|
+
else if (props.accountsRemote !== void 0) {
|
|
8833
|
+
setAccounts(void 0);
|
|
8834
|
+
if (renewedView !== void 0) {
|
|
8835
|
+
setView(void 0);
|
|
8836
|
+
setFailed(true);
|
|
8837
|
+
}
|
|
8838
|
+
}
|
|
8800
8839
|
} catch {
|
|
8801
8840
|
if (current()) {
|
|
8802
8841
|
setView(void 0);
|
|
@@ -8827,7 +8866,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8827
8866
|
setSavingAccount(false);
|
|
8828
8867
|
setAccountFailed(false);
|
|
8829
8868
|
setAccountSaveFailed(false);
|
|
8830
|
-
identityRead.current = false;
|
|
8831
8869
|
setFailed(false);
|
|
8832
8870
|
setBusy(false);
|
|
8833
8871
|
setOpen(false);
|
|
@@ -8849,7 +8887,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8849
8887
|
setView(void 0);
|
|
8850
8888
|
setBusy(false);
|
|
8851
8889
|
setFailed(false);
|
|
8852
|
-
identityRead.current = false;
|
|
8853
8890
|
if (!accountPresentationChanges.pending()) load(false);
|
|
8854
8891
|
});
|
|
8855
8892
|
return () => {
|
|
@@ -8886,7 +8923,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8886
8923
|
setSessionAccount(parsed.data);
|
|
8887
8924
|
setAccounts(parsed.data.accounts);
|
|
8888
8925
|
setView(void 0);
|
|
8889
|
-
identityRead.current = false;
|
|
8890
8926
|
setChoosingAccount(false);
|
|
8891
8927
|
owner.save = void 0;
|
|
8892
8928
|
setSavingAccount(false);
|
|
@@ -9185,7 +9221,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9185
9221
|
return record$2(value) && typeof value.get === "function" && typeof value.refresh === "function";
|
|
9186
9222
|
}
|
|
9187
9223
|
function isSessionRemote(value) {
|
|
9188
|
-
return record$2(value) && typeof value.get === "function" && typeof value.set === "function" && typeof value.refreshIdentity === "function" && typeof value.usage === "function" && typeof value.refreshUsage === "function";
|
|
9224
|
+
return record$2(value) && typeof value.get === "function" && typeof value.set === "function" && typeof value.refreshIdentity === "function" && typeof value.ensureIdentity === "function" && typeof value.usage === "function" && typeof value.refreshUsage === "function";
|
|
9189
9225
|
}
|
|
9190
9226
|
function isLocale$2(value) {
|
|
9191
9227
|
return record$2(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
|
|
@@ -9234,6 +9270,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9234
9270
|
ok: true,
|
|
9235
9271
|
value: result.value.accounts
|
|
9236
9272
|
} : result;
|
|
9273
|
+
},
|
|
9274
|
+
ensureIdentity: async () => {
|
|
9275
|
+
const result = await sessionRemote.ensureIdentity(id);
|
|
9276
|
+
return result.ok ? {
|
|
9277
|
+
ok: true,
|
|
9278
|
+
value: result.value.accounts
|
|
9279
|
+
} : result;
|
|
9237
9280
|
}
|
|
9238
9281
|
},
|
|
9239
9282
|
account: {
|
|
@@ -9284,7 +9327,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9284
9327
|
if (isRemote(face)) remote = face;
|
|
9285
9328
|
else diagnostic("COPILOT_USAGE_REMOTE_UNAVAILABLE");
|
|
9286
9329
|
const accounts = record$2(namespaces) ? namespaces.githubCopilotAccounts : void 0;
|
|
9287
|
-
if (record$2(accounts) && typeof accounts.get === "function" && typeof accounts.refreshIdentity === "function") accountsRemote = accounts;
|
|
9330
|
+
if (record$2(accounts) && typeof accounts.get === "function" && typeof accounts.refreshIdentity === "function" && typeof accounts.ensureIdentity === "function") accountsRemote = accounts;
|
|
9288
9331
|
else diagnostic("COPILOT_ACCOUNTS_REMOTE_UNAVAILABLE");
|
|
9289
9332
|
const session = record$2(namespaces) ? namespaces.githubCopilotSessionAccount : void 0;
|
|
9290
9333
|
if (isSessionRemote(session)) sessionRemote = session;
|