dsh-github-copilot 0.1.0-alpha.4.dsh.0.2.2.rc.3 → 0.1.0-alpha.5.dsh.0.2.2.rc.3

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 CHANGED
@@ -27,6 +27,15 @@ This repository follows a **plugin-only** policy: implement fixes in `dsh-github
27
27
 
28
28
  Use native DSH tools for goals, background jobs and scoped subagents. Use local Git and the GitHub REST API for delivery; no external orchestration daemon, roster or `vcs_*` tool is required. Do not assume a model provider's identity is the assisting agent.
29
29
 
30
+ ## Session isolation and temporary artifacts (#442)
31
+
32
+ - Prefer one app-managed worktree per independent repository session when supported and authorized. A branch-backed session, folder session or shared checkout is not necessarily isolated. Verify the actual workspace and branch; preserve the user's chosen workspace. Creating or checking out another worktree still requires separate approval.
33
+ - Store temporary evidence, downloads, scratch files and backups in the session-owned artifact area outside the repository checkout. Keep only intentional deliverables in the repository. Clean up only explicitly identified temporary files created by the current task; never hide, move, delete or stage pre-existing files merely to make a gate pass.
34
+ - Inspect the explicit staged and committed diff before delivery. Unrelated untracked files are not by themselves a Git conflict or proof of a GitHub permission failure. Respect each delivery tool's own instructions and allowed fallback paths; repository guidance cannot override those requirements or branch protection.
35
+ - Continue routine investigation and authorized delivery without repeated approval prompts. For a genuine decision, safety boundary or tool-policy blocker, ask or report it once with the exact consequence; do not loop while the user is unavailable. Preserve existing approval boundaries for profile installation, sign-out, disruptive restart and worktree checkout.
36
+
37
+ These are agent instructions and contract-drift checks, not a filesystem sandbox or a guarantee that every session uses a worktree.
38
+
30
39
  ## Product and architecture
31
40
 
32
41
  ### Confirmed product scope (#455, #456)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.5.dsh.0.2.2.rc.3 (prepared)
4
+
5
+ - Show the native Credits account identity only after verifying the canonical OAuth grant and quota belong together; keep quota available when identity is unavailable.
6
+ - Use scoped Node and system certificate trust for the existing GitHub identity lookup without weakening TLS verification.
7
+
3
8
  ## 0.1.0-alpha.4.dsh.0.2.2.rc.3 (prepared)
4
9
 
5
10
  - Remove the hosted-search aside from the managed account-model summary and hide retired Auto descriptions when no historical diagnostic data exists. Historical Auto data remains available and is identified before JSON sharing, including its possible model IDs (#467).
package/README.md CHANGED
@@ -67,15 +67,15 @@ After the exact compatible release is available and verified, download its
67
67
  original asset and checksum in an empty directory:
68
68
 
69
69
  ```sh
70
- curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.2.rc.3.tgz
71
- curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.2.rc.3/SHA256SUMS
70
+ curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.5.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.5.dsh.0.2.2.rc.3.tgz
71
+ curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.5.dsh.0.2.2.rc.3/SHA256SUMS
72
72
  sha256sum --check SHA256SUMS
73
73
  ```
74
74
 
75
75
  For the `web` profile, install the same Release asset:
76
76
 
77
77
  ```sh
78
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.2.rc.3.tgz
78
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.5.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.5.dsh.0.2.2.rc.3.tgz
79
79
  ```
80
80
 
81
81
  Choose the intended profile explicitly. Then:
@@ -111,7 +111,7 @@ unavailable. There is no model retry, backend replacement or plugin routing UI.
111
111
  The native Auto reviewer's qualified Copilot Responses requests omit
112
112
  `temperature`; ordinary Chat and native allow/deny/error/cancel behavior remain
113
113
  unchanged. See [reviewer compatibility](./docs/auto-review-sampling.md).
114
- The native route's quota display uses only the canonical OAuth account. If the
114
+ The native route's quota and optional identity display use only the canonical OAuth account. If the
115
115
  provider names a credential, endpoint or nonempty headers override, or its configuration
116
116
  cannot be verified, quota is shown as unavailable rather than attributed to a
117
117
  different account. This is not proof of request-level billing attribution.
package/README.zh.md CHANGED
@@ -55,15 +55,15 @@ node scripts/select-core-release.mjs 0.2.2-rc.3
55
55
  精确兼容版本发布且通过验证后,在空目录下载原始制品并校验:
56
56
 
57
57
  ```sh
58
- curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.2.rc.3.tgz
59
- curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.2.rc.3/SHA256SUMS
58
+ curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.5.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.5.dsh.0.2.2.rc.3.tgz
59
+ curl -fLO https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.5.dsh.0.2.2.rc.3/SHA256SUMS
60
60
  sha256sum --check SHA256SUMS
61
61
  ```
62
62
 
63
63
  例如安装到 `web` profile:
64
64
 
65
65
  ```sh
66
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.4.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.4.dsh.0.2.2.rc.3.tgz
66
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.1.0-alpha.5.dsh.0.2.2.rc.3/dsh-github-copilot-0.1.0-alpha.5.dsh.0.2.2.rc.3.tgz
67
67
  ```
68
68
 
69
69
  请明确选择目标 profile,然后:
@@ -91,7 +91,7 @@ Web 服务替换或旧插件路由 UI。
91
91
  原生 Auto reviewer 经确认的 Copilot Responses 审核请求会省略 `temperature`;
92
92
  普通聊天和原生 allow/deny/error/cancel 行为不变。参见
93
93
  [审核兼容说明](./docs/auto-review-sampling.md)。
94
- 原生路线的额度显示只使用 canonical OAuth 账号;如果 provider 指定了其他凭据、
94
+ 原生路线的额度和可选身份显示只使用 canonical OAuth 账号;如果 provider 指定了其他凭据、
95
95
  端点或非空请求头,或无法确认其配置,则显示额度不可用,不会将其他账号的额度归到原生路线。
96
96
  这不证明单次请求实际计费的账号。
97
97
  原生上下文异常诊断不依赖可选的托管续接服务,也不会替代 DSH 的上下文计量。
@@ -8,14 +8,14 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.1.0-alpha.4.dsh.0.2.2.rc.3"
11
+ "version": "0.1.0-alpha.5.dsh.0.2.2.rc.3"
12
12
  },
13
13
  "releaseLines": [
14
14
  { "core": "0.2.0-rc.2", "version": "0.4.2-alpha.15", "status": "published" },
15
15
  { "core": "0.2.1-alpha.4", "version": "0.4.2-alpha.16", "status": "published" },
16
16
  { "core": "0.2.1-alpha.5", "version": "0.1.0-alpha.2.dsh.0.2.1.alpha.5", "status": "published" },
17
17
  { "core": "0.2.1-rc.3", "version": "0.1.0-alpha.5.dsh.0.2.1.rc.3", "status": "published" },
18
- { "core": "0.2.2-rc.3", "version": "0.1.0-alpha.4.dsh.0.2.2.rc.3", "status": "pending" }
18
+ { "core": "0.2.2-rc.3", "version": "0.1.0-alpha.5.dsh.0.2.2.rc.3", "status": "pending" }
19
19
  ],
20
20
  "evidence": {
21
21
  "kind": "source-and-synthetic-test-inventory",
@@ -583,8 +583,12 @@
583
583
  {"file": "tests/copilot-usage-normalize.spec.ts", "name": "does not let invalid optional account metadata suppress a valid snapshot reset"},
584
584
  {"file": "tests/copilot-usage-card.spec.ts", "name": "uses native secondary type tokens and a bounded single-line trigger"},
585
585
  {"file": "tests/copilot-usage-card.spec.ts", "name": "shows supplied account amounts without an unsupported Session credits section"},
586
+ {"file": "tests/copilot-usage-card.spec.ts", "name": "keeps quota visible when the native identity Remote fails %s"},
586
587
  {"file": "tests/copilot-usage-ui.spec.ts", "name": "uses real Cordis Remote tracing and reversible public SlotRegistry registration"},
587
588
  {"file": "tests/copilot-usage-ui.spec.ts", "name": "renders the usage trigger through a required Session selector for %s"},
589
+ {"file": "tests/copilot-usage-ui.spec.ts", "name": "keeps native quota visible while identity is pending and rejects late identity after a route change"},
590
+ {"file": "tests/copilot-usage-host.spec.ts", "name": "binds native identity to the canonical quota and rejects a credential change during lookup"},
591
+ {"file": "tests/copilot-identity-refresh.spec.ts", "name": "uses scoped system trust for native identity without changing global TLS settings"},
588
592
  {"file": "tests/fixtures/copilot-usage-selector-core.fixture.ts", "name": "renders and reacts to the owning Session on %s"},
589
593
  {"file": "tests/scripts/copilot-usage-gateway.test.mjs", "name": "quota Remote reaches the actual Host gateway without startup or signed-out network requests"},
590
594
  {"file": "tests/client-bundle.spec.ts", "name": "mounts strict Host result codecs through the published rc.1 client carrier"},
@@ -90,7 +90,11 @@ For the native `github-copilot` route, quota reads use only the canonical
90
90
  selector. When the native profile is missing or names an `apiKeyEnv`, endpoint,
91
91
  or nonempty headers override, the quota is unavailable with
92
92
  `COPILOT_USAGE_NATIVE_AUTH_UNPROVEN` rather than attributing another
93
- credential's quota. Other public header contributors may still modify a request;
93
+ credential's quota. The optional native identity lookup uses the same canonical
94
+ grant, verifies that the grant and route still match the quota, and never delays
95
+ the initial quota display. If identity cannot be verified it remains unavailable
96
+ without hiding the quota. Both GitHub lookups use scoped default and system CA
97
+ trust with TLS verification enabled. Other public header contributors may still modify a request;
94
98
  configuration-based evidence does not prove which account a request billed.
95
99
  The managed route continues to use its
96
100
  session-bound selected account. GitHub's
package/lib/client.js CHANGED
@@ -6207,6 +6207,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6207
6207
  const timestamp = number().int().nonnegative().max(COPILOT_USAGE_MAX_TIMESTAMP);
6208
6208
  const CopilotUsageViewSchema = object({
6209
6209
  accountId: string().max(36).regex(COPILOT_ACCOUNT_ID_PATTERN).optional(),
6210
+ identity: object({
6211
+ login: string().min(1).max(39).regex(GITHUB_ACCOUNT_LOGIN_PATTERN),
6212
+ userId: number().int().positive().max(Number.MAX_SAFE_INTEGER),
6213
+ host: literal("github.com").optional()
6214
+ }).strict().optional(),
6210
6215
  state: _enum([
6211
6216
  "ready",
6212
6217
  "stale",
@@ -6241,6 +6246,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6241
6246
  view.limit,
6242
6247
  view.percentUsed
6243
6248
  ].some((value) => value !== void 0);
6249
+ if (view.identity !== void 0 && (view.accountId !== "canonical" || view.state !== "ready" && view.state !== "stale")) invalid();
6244
6250
  if (view.state === "unavailable" || view.state === "signed-out") {
6245
6251
  if (hasAmounts || view.observedAt !== void 0 || view.resetAt !== void 0 || view.diagnostic === void 0) invalid();
6246
6252
  if (view.state === "signed-out" && (view.billing !== "unknown" || view.budget !== "unknown")) invalid();
@@ -6262,7 +6268,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6262
6268
  "get",
6263
6269
  "refresh",
6264
6270
  "getNative",
6265
- "refreshNative"
6271
+ "refreshNative",
6272
+ "ensureNativeIdentity",
6273
+ "refreshNativeIdentity"
6266
6274
  ].map((method) => ({
6267
6275
  id: `dsh-github-copilot:githubCopilotUsage.${method}`,
6268
6276
  namespace: "githubCopilotUsage",
@@ -7639,7 +7647,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7639
7647
  };
7640
7648
  //#endregion
7641
7649
  //#region package.json
7642
- var version = "0.1.0-alpha.4.dsh.0.2.2.rc.3";
7650
+ var version = "0.1.0-alpha.5.dsh.0.2.2.rc.3";
7643
7651
  //#endregion
7644
7652
  //#region lib/types/diagnostics-client.js
7645
7653
  let owner;
@@ -11040,6 +11048,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11040
11048
  setBusy(true);
11041
11049
  setFailed(false);
11042
11050
  try {
11051
+ const nativeIdentityOperation = props.accountsRemote === void 0 ? (async () => {
11052
+ try {
11053
+ return await (force ? props.remote.refreshIdentity?.() : props.remote.ensureIdentity?.());
11054
+ } catch {
11055
+ return;
11056
+ }
11057
+ })() : void 0;
11043
11058
  const identityOperation = props.accountsRemote === void 0 ? void 0 : (async () => {
11044
11059
  const observed = diagnostics.current.begin("identity-read");
11045
11060
  try {
@@ -11082,6 +11097,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11082
11097
  } else setView(parsed.data);
11083
11098
  owner.busy = false;
11084
11099
  setBusy(false);
11100
+ const nativeIdentityResult = await nativeIdentityOperation;
11101
+ if (!current()) return;
11102
+ if (nativeIdentityResult?.ok === true) {
11103
+ const nativeView = CopilotUsageViewSchema.safeParse(nativeIdentityResult.value);
11104
+ if (nativeView.success) setView(nativeView.data);
11105
+ }
11085
11106
  const renewed = await identityOperation;
11086
11107
  if (!current()) return;
11087
11108
  const renewedView = renewed?.ok === true ? accountsViewFrom(renewed.value) : void 0;
@@ -11338,7 +11359,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11338
11359
  ].filter(Boolean).join(" · ")}${used === void 0 && remaining === void 0 ? ` · ${busy ? t.loading : t.unavailable}` : ""}`;
11339
11360
  const observed = available ? dateLabel(view.observedAt, language) : void 0;
11340
11361
  const reset = available && view.resetAt !== void 0 && view.observedAt !== void 0 && view.resetAt > view.observedAt ? dateLabel(view.resetAt, language) : void 0;
11341
- const currentIdentity = accountIdentityLabel(accounts) ?? t.identityUnavailable;
11362
+ const currentIdentity = (view?.identity === void 0 ? void 0 : copilotIdentityLabel(view.identity)) ?? accountIdentityLabel(accounts) ?? t.identityUnavailable;
11342
11363
  const runningIdentity = sessionAccount?.runningAccountId === void 0 ? void 0 : accountIdentityLabel({
11343
11364
  ...sessionAccount.accounts,
11344
11365
  activeAccountId: sessionAccount.runningAccountId
@@ -11990,6 +12011,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11990
12011
  function isNativeRemote(value) {
11991
12012
  return record$2(value) && typeof value.getNative === "function" && typeof value.refreshNative === "function";
11992
12013
  }
12014
+ function isNativeIdentityRemote(value) {
12015
+ return record$2(value) && typeof value.ensureNativeIdentity === "function" && typeof value.refreshNativeIdentity === "function";
12016
+ }
11993
12017
  function isSessionRemote(value) {
11994
12018
  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";
11995
12019
  }
@@ -12113,7 +12137,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
12113
12137
  const face = record$2(namespaces) ? namespaces.githubCopilotUsage : void 0;
12114
12138
  if (isNativeRemote(face)) nativeRemote = {
12115
12139
  get: () => face.getNative(),
12116
- refresh: () => face.refreshNative()
12140
+ refresh: () => face.refreshNative(),
12141
+ ...isNativeIdentityRemote(face) ? {
12142
+ ensureIdentity: () => face.ensureNativeIdentity(),
12143
+ refreshIdentity: () => face.refreshNativeIdentity()
12144
+ } : {}
12117
12145
  };
12118
12146
  else diagnostic("COPILOT_USAGE_NATIVE_REMOTE_UNAVAILABLE");
12119
12147
  } catch {