dsh-github-copilot 0.4.0-alpha.100

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.
Files changed (156) hide show
  1. package/AGENTS.md +312 -0
  2. package/CHANGELOG.md +479 -0
  3. package/CONTRIBUTING.md +46 -0
  4. package/LICENSE +21 -0
  5. package/README.md +203 -0
  6. package/README.zh.md +202 -0
  7. package/SECURITY.md +29 -0
  8. package/cordis.patch.yml +16 -0
  9. package/deployment-baseline.json +1299 -0
  10. package/docs/agent-readiness.md +110 -0
  11. package/docs/auto-task-routing.md +234 -0
  12. package/docs/automatic-model-routing.md +205 -0
  13. package/docs/copilot-accounts.md +236 -0
  14. package/docs/copilot-compaction.md +120 -0
  15. package/docs/copilot-usage.md +125 -0
  16. package/docs/dual-model.md +66 -0
  17. package/docs/image-input-compatibility.md +64 -0
  18. package/docs/images/copilot-accounts-credits.png +0 -0
  19. package/docs/images/copilot-accounts.png +0 -0
  20. package/docs/images/copilot-model-preferences.png +0 -0
  21. package/docs/images/copilot-search-routing.png +0 -0
  22. package/docs/images/dual-model-desktop.png +0 -0
  23. package/docs/images/dual-model-mobile.png +0 -0
  24. package/docs/images/dual-model-provenance.json +35 -0
  25. package/docs/images/parent-model-follow.png +0 -0
  26. package/docs/manual-compaction-recovery.md +64 -0
  27. package/docs/model-compatibility-acceptance.md +164 -0
  28. package/docs/npm-distribution.md +149 -0
  29. package/docs/official-first-016-alpha2.md +66 -0
  30. package/docs/official-first-020-rc1.md +32 -0
  31. package/docs/official-first-020-rc2.md +16 -0
  32. package/docs/session-search-routing.md +133 -0
  33. package/docs/single-route-migration.md +130 -0
  34. package/docs/web-lifecycle-rc2.md +55 -0
  35. package/lib/client.js +10822 -0
  36. package/lib/client.js.map +1 -0
  37. package/lib/copilot-identity-DRZY_d2X.js +15 -0
  38. package/lib/index.js +11689 -0
  39. package/lib/manual-compaction-recovery.js +315 -0
  40. package/lib/remote.js +734 -0
  41. package/lib/request-budget-DLY_aRq0.js +87 -0
  42. package/lib/routed-web.js +120 -0
  43. package/lib/search-routing-CqysPLve.js +792 -0
  44. package/lib/types/account-model-auth.d.ts +15 -0
  45. package/lib/types/account-model-catalog.d.ts +70 -0
  46. package/lib/types/account-model-source.d.ts +85 -0
  47. package/lib/types/agent-compaction.d.ts +4 -0
  48. package/lib/types/authorization-controller.d.ts +119 -0
  49. package/lib/types/auto-assessment-evidence.d.ts +46 -0
  50. package/lib/types/auto-model-host.d.ts +27 -0
  51. package/lib/types/auto-model-intent.d.ts +36 -0
  52. package/lib/types/auto-model-presentation.d.ts +57 -0
  53. package/lib/types/auto-model-routing.d.ts +59 -0
  54. package/lib/types/auto-selection-explanation.d.ts +9 -0
  55. package/lib/types/auto-task-assessment.d.ts +47 -0
  56. package/lib/types/auto-task-classifier.d.ts +9 -0
  57. package/lib/types/background-compaction.d.ts +30 -0
  58. package/lib/types/client.d.ts +115 -0
  59. package/lib/types/compact-account.d.ts +42 -0
  60. package/lib/types/compaction-pressure.d.ts +23 -0
  61. package/lib/types/compatibility.d.ts +17 -0
  62. package/lib/types/config.d.ts +89 -0
  63. package/lib/types/content-file.d.ts +10 -0
  64. package/lib/types/context-evidence-ui.d.ts +11 -0
  65. package/lib/types/context-evidence.d.ts +108 -0
  66. package/lib/types/context-usage.d.ts +4 -0
  67. package/lib/types/copilot-account-presentation.d.ts +7 -0
  68. package/lib/types/copilot-accounts-card.d.ts +30 -0
  69. package/lib/types/copilot-accounts-host.d.ts +75 -0
  70. package/lib/types/copilot-accounts-remote.d.ts +77 -0
  71. package/lib/types/copilot-accounts-types.d.ts +42 -0
  72. package/lib/types/copilot-auth.d.ts +25 -0
  73. package/lib/types/copilot-grant.d.ts +11 -0
  74. package/lib/types/copilot-identity.d.ts +11 -0
  75. package/lib/types/copilot-request.d.ts +11 -0
  76. package/lib/types/copilot-stream-liveness.d.ts +23 -0
  77. package/lib/types/copilot-usage-card.d.ts +30 -0
  78. package/lib/types/copilot-usage-host.d.ts +58 -0
  79. package/lib/types/copilot-usage-normalize.d.ts +9 -0
  80. package/lib/types/copilot-usage-remote.d.ts +63 -0
  81. package/lib/types/copilot-usage-types.d.ts +20 -0
  82. package/lib/types/copilot-usage-ui.d.ts +4 -0
  83. package/lib/types/current-provider.d.ts +59 -0
  84. package/lib/types/deepseek-search-fallback.d.ts +11 -0
  85. package/lib/types/dual-model-host.d.ts +119 -0
  86. package/lib/types/dual-model-remote.d.ts +63 -0
  87. package/lib/types/dual-model-types.d.ts +34 -0
  88. package/lib/types/external-link.d.ts +3 -0
  89. package/lib/types/failure.d.ts +38 -0
  90. package/lib/types/http.d.ts +48 -0
  91. package/lib/types/image-input-admission.d.ts +5 -0
  92. package/lib/types/index.d.ts +39 -0
  93. package/lib/types/manual-compaction-recovery.d.ts +52 -0
  94. package/lib/types/migration-status.d.ts +50 -0
  95. package/lib/types/model-exclusions.d.ts +15 -0
  96. package/lib/types/model-preferences-card.d.ts +9 -0
  97. package/lib/types/model-protocol.d.ts +31 -0
  98. package/lib/types/native-select-style.d.ts +4 -0
  99. package/lib/types/parent-model-follow-card.d.ts +41 -0
  100. package/lib/types/parent-model-follow.d.ts +44 -0
  101. package/lib/types/pi-provider-bridge.d.ts +22 -0
  102. package/lib/types/plan.d.ts +148 -0
  103. package/lib/types/pre-step-pressure.d.ts +8 -0
  104. package/lib/types/preview-provider.d.ts +66 -0
  105. package/lib/types/preview-route.d.ts +74 -0
  106. package/lib/types/probe.d.ts +39 -0
  107. package/lib/types/reasoning-presentation.d.ts +55 -0
  108. package/lib/types/remote-codec.d.ts +10 -0
  109. package/lib/types/remote.d.ts +199 -0
  110. package/lib/types/replay-recovery-host.d.ts +28 -0
  111. package/lib/types/replay-recovery-remote.d.ts +14 -0
  112. package/lib/types/replay-recovery-types.d.ts +24 -0
  113. package/lib/types/replay-recovery-ui.d.ts +26 -0
  114. package/lib/types/replay-recovery.d.ts +17 -0
  115. package/lib/types/request-body-evidence.d.ts +34 -0
  116. package/lib/types/request-body-timeout-marker.d.ts +2 -0
  117. package/lib/types/request-body-timeout.d.ts +4 -0
  118. package/lib/types/request-budget.d.ts +58 -0
  119. package/lib/types/request-upload-evidence.d.ts +23 -0
  120. package/lib/types/response-error-body.d.ts +3 -0
  121. package/lib/types/responses-reasoning-text.d.ts +24 -0
  122. package/lib/types/responses-reasoning.d.ts +7 -0
  123. package/lib/types/responses-replay-compat.d.ts +30 -0
  124. package/lib/types/route-ownership.d.ts +70 -0
  125. package/lib/types/routed-web.d.ts +50 -0
  126. package/lib/types/search-backend.d.ts +16 -0
  127. package/lib/types/search-routing-host.d.ts +19 -0
  128. package/lib/types/search-routing-policy.d.ts +18 -0
  129. package/lib/types/search-routing-remote.d.ts +20 -0
  130. package/lib/types/search-routing.d.ts +43 -0
  131. package/lib/types/search-tool-routing.d.ts +22 -0
  132. package/lib/types/serialize.d.ts +106 -0
  133. package/lib/types/settings-reader.d.ts +16 -0
  134. package/lib/types/sse.d.ts +28 -0
  135. package/lib/types/temporary-models.d.ts +25 -0
  136. package/lib/types/tool-schema-compat.d.ts +17 -0
  137. package/lib/types/traditional-search.d.ts +17 -0
  138. package/lib/types/turn-model-provenance.d.ts +45 -0
  139. package/lib/types/turn-selection-card.d.ts +10 -0
  140. package/lib/types/turn-selection-host.d.ts +11 -0
  141. package/lib/types/turn-selection-remote.d.ts +13 -0
  142. package/lib/types/turn-selection.d.ts +119 -0
  143. package/lib/types/turn-usage-evidence.d.ts +66 -0
  144. package/lib/types/turn-usage-notice.d.ts +7 -0
  145. package/lib/types/types.d.ts +69 -0
  146. package/lib/types/usage.d.ts +26 -0
  147. package/lib/types/watchdog.d.ts +22 -0
  148. package/lib/types/web-delegate.d.ts +12 -0
  149. package/lib/types/web-search-routing-card.d.ts +16 -0
  150. package/lib/types/web-search-routing-config.d.ts +12 -0
  151. package/lib/types/wire-anthropic.d.ts +37 -0
  152. package/lib/types/wire.d.ts +56 -0
  153. package/lib/web-delegate.js +9 -0
  154. package/output/auto-model-mockup/index.html +207 -0
  155. package/package.json +236 -0
  156. package/scripts/check-search-composition.mjs +191 -0
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # dsh-github-copilot
2
+
3
+ [![CI](https://github.com/cloga/dsh-github-copilot/actions/workflows/ci.yml/badge.svg)](https://github.com/cloga/dsh-github-copilot/actions/workflows/ci.yml)
4
+ [![Release](https://img.shields.io/github/v/release/cloga/dsh-github-copilot?include_prereleases)](https://github.com/cloga/dsh-github-copilot/releases)
5
+ [![License](https://img.shields.io/github/license/cloga/dsh-github-copilot)](./LICENSE)
6
+
7
+ **English** | [简体中文](./README.zh.md)
8
+
9
+ GitHub Copilot account discovery, contextual Auto routing and hosted search for DSH. The plugin reuses DSH's published native adapter with one active Host-side OAuth account per profile; it does not patch Core or maintain a second model catalog.
10
+
11
+ The [account requirements and design](./docs/copilot-accounts.md) cover
12
+ independent official authorizations in the existing credentials service.
13
+ **Models → Manage → GitHub accounts** is the only management/switching entry;
14
+ Credits details show the current GitHub identity read-only.
15
+
16
+ **Source candidate: `0.4.0-alpha.100` (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.
17
+
18
+ ## What you can do
19
+
20
+ | Task | Where to start |
21
+ |---|---|
22
+ | Sign in and manage account models | **Settings → Models → GitHub Copilot → Sign in** |
23
+ | Add or switch GitHub accounts | **Manage → GitHub accounts**; managed-only profiles |
24
+ | Exclude or restore individual models | **Manage → Model preferences** |
25
+ | Choose models automatically | Pick **Auto · Balance**, **Auto · Efficiency** or **Auto · Intelligence** |
26
+ | Follow a parent model in supported subagents | **Plugins → dsh-github-copilot → Details → Follow parent model** |
27
+ | Choose primary/fallback search providers | **Plugin details → Web search** |
28
+ | Read account Credits and context evidence | Copilot Session composer; native Turn Usage stays separate |
29
+
30
+ ![Account controls and model preferences from the published Client](./docs/images/copilot-model-preferences.png)
31
+
32
+ Actual published Client components with synthetic models in an isolated browser. These screenshots demonstrate presentation, not live sign-in, model availability, search or loaded Desktop state.
33
+
34
+ ## Install and sign in
35
+
36
+ Use the exact verified release, the intended profile and an authorized package source. No `copilot2api`, external gateway, pasted GitHub token, placeholder key or separate `dsh-web-search-provider` is required.
37
+
38
+ Before installation, extract the checksum-verified archive and run its **read-only composition preflight** with absolute paths:
39
+
40
+ ```sh
41
+ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profile --home /absolute/DSH_HOME --install-anchor /absolute/dsh/package.json
42
+ ```
43
+
44
+ Supply any launcher patches with repeated `--patch /absolute/file`. Require `supported: true`: the install command does not automatically run this preflight. Unsupported/custom Web composition and `NONEMPTY_DISPOSABLE_PROFILE_ROOT` are stop conditions. Preserve a nonempty root and review whether public composition reconstructs it before any separately approved normalization; never assume it can be cleared. Check effective shared-peer resolution so stale profile-local packages do not shadow Desktop's official peers.
45
+
46
+ For a **standalone named profile**:
47
+
48
+ ```sh
49
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.100/dsh-github-copilot-0.4.0-alpha.100.tgz
50
+ ```
51
+
52
+ For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.100` 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.
53
+
54
+ After an approved reload/restart:
55
+
56
+ 1. Open **Settings → Models → GitHub Copilot** and select **Sign in with GitHub**. No native provider or manual model definition is needed.
57
+ 2. Copy the displayed one-time code and complete GitHub's device flow in your own browser. Desktop uses its system-browser handoff; a selectable verification URL remains available if it does not open.
58
+ 3. Wait for **Signed in** and account discovery, then choose a model. Opening Models and normal use ensure missing/stale metadata; **Manage → Refresh models** is an intentional forced refresh, not routine setup.
59
+
60
+ Sign-out requires an explicit action and removes only the active account's authorization, not other saved grants or route settings. Upgrades preserve existing native Copilot profiles; two groups can remain until [explicit single-route migration](./docs/single-route-migration.md). Installation never migrates conversations or defaults.
61
+
62
+ In **Manage → GitHub accounts**, adding an account never replaces the active one. A confirmed switch applies profile-wide to subsequent managed requests; relevant active work and native-route or incomplete evidence block it. 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. Missing/revoked accounts never fall back to another account.
63
+
64
+ **Desktop lifecycle:** disable/remove/upgrade can require a full cold restart for Web service recomposition. If the plugin is Off and the native manager reports only `pending (waiting for service: web)`, do not repeatedly toggle or reinstall. Obtain restart approval and follow [rc.2 lifecycle guidance](./docs/web-lifecycle-rc2.md).
65
+
66
+ ## Auto and model preferences
67
+
68
+ All three Auto preferences use the same account-verified, non-excluded eligible pool. Hard input/image capability checks run before soft task preferences.
69
+
70
+ | Task demand | Efficiency | Balance | Intelligence |
71
+ |---|---|---|---|
72
+ | Proven simple | Lightweight | Lightweight | Lightweight |
73
+ | Routine | Lightweight | Versatile | Powerful |
74
+ | Complex | Powerful | Powerful | Powerful |
75
+ | Unknown | Versatile | Versatile | Powerful |
76
+
77
+ Categories come from authenticated supplier metadata, not model names, context capacity or measured quality rankings. A suitable previous model is retained; otherwise the plugin uses stable equal-weight allocation within the eligible category. Category fallback is explained explicitly. One real model stays fixed throughout each admitted turn's steps, retries and compaction.
78
+
79
+ Semantic assessment is **enabled by default only for locally unknown tasks**. It makes at most one bounded auxiliary call with an **8-second end-to-end deadline** and **128-token output budget**. Set `github-copilot.autoSemanticAssessment: false` to opt out. Timeout/invalid output leaves demand unknown and uses the preference fallback; it never means simple or triggers another classifier. Caller cancellation and account invalidation remain terminal. Auxiliary calls add latency and supplier charges outside native answer Usage.
80
+
81
+ The deadline is checked against a monotonic clock at preparation, native request and result boundaries, even if the event loop delays the timer. Such delays can postpone settlement; they do not authorize late dispatch or late-result acceptance. Eligible Lightweight classifiers advertising reasoning `off` take precedence, with deterministic ID tie-breaking; the request uses `off` only if the public native model also supports it. This is not a measured speed ranking. Explanations distinguish the fitting category pool and previous-model continuity from semantic merit.
82
+
83
+ The reply's selection disclosure shows captured reasons and optional content-free auxiliary milestones. `uncertain` and `insufficient-evidence` do not mean the conversation is empty. **Selection unknown** means no retained record; **Selection unavailable → Retry** means the read failed. Retry rereads that turn, not inference. Evidence is bounded and Host-local, so restart/eviction can lose it.
84
+
85
+ **Model exclusions** remove exact IDs from the managed picker and new Auto pools. Selected models are excludable: an admitted turn keeps its model, but a new turn/direct request cannot use an excluded ID. A fixed selection is never silently replaced. Unknown preference settings leave controls read-only, not falsely enabled. Saves use narrow native CAS without credentials, discovery or Session scans.
86
+
87
+ See [task assessment](./docs/auto-task-routing.md) and [routing contracts, exclusions and history recovery](./docs/automatic-model-routing.md).
88
+
89
+ Explicit Auto intent survives native pending-selection consumption and cold restore through a plugin-owned projection of existing selection events. Later explicit fixed choices still win for future turns; admitted turns keep their route. This does not backfill historical selection reasons or turn unknown evidence into guessed Auto.
90
+
91
+ ## Subagents and search
92
+
93
+ ![Current parent-following and Web search controls](./docs/images/copilot-search-routing.png)
94
+
95
+ **Follow parent model** defaults Off and applies profile-wide to supported native children/Team mates of managed Copilot parents. Fixed parents apply on each child's next turn; Auto parents pass the exact preference while each child evaluates its own context. Child-owned explicit selections win. Running turns, roots, forks, other providers and dedicated legacy policies are not rewritten. Existing legacy bindings remain independent when the broad switch is Off. [Parent-following contract](./docs/parent-model-follow.md).
96
+
97
+ **Web search** has two ordinary controls: primary provider and final fallback. Auto follows the initiating Chat provider when a corresponding search registration exists; fixed choices stay fixed when Chat changes. At most one distinct final fallback is tried, with possible charges disclosed. Cancellation/account-proof loss never authorizes a fallback.
98
+
99
+ Copilot search requires current account/protocol evidence and capability proof. Fixed/fallback Copilot preserves a nonempty legacy `searchModel`; otherwise it considers at most three account-owned Responses candidates. The final user query is sent once, never replayed across those candidates. A saved choice or successful Chat request does not prove hosted search. [Search routing and composition](./docs/session-search-routing.md).
100
+ The legacy `github-copilot.searchFallback` setting applies only to its separate
101
+ canonical inline path; it is not a third routed fallback. Fetch is unchanged.
102
+
103
+ ## Usage, request limits and recovery
104
+
105
+ **Credits** shows validated account billing-cycle data, not context tokens or Session cost. Stale, pooled and unavailable readings keep their real meanings. The quota request alone uses Node plus system CA roots with TLS verification enabled; it does not change trust for sign-in, models, search or Desktop globally.
106
+
107
+ Native context occupancy and Turn Usage remain Core-owned. The plugin forwards usage unchanged, including zero samples on failure/cancellation. Its separate context disclosure reports historical evidence, never current occupancy or a replacement `0%` meter. **Turn Usage incomplete** explains missing samples/lifecycle and recorded local blocks; it invents neither zero usage nor partial totals. Cancellation can retain usage, but does not guarantee a final supplier receipt. [Usage boundaries](./docs/copilot-usage.md).
108
+
109
+ Owned timeout/replay errors preserve native usage before terminal failure restoration, including nonzero samples. A failed zero can still make the native ring show `0%`; this is not proof of an empty request. Retry-entry times describe backoff, not the failed request's duration. These accounting fixes do not cure supplier HTTP 408 or change retry policy.
110
+
111
+ Managed request admission preserves truthful input/output limits and native transactions. Automatic pressure uses the initiating Agent's actual bound compaction service; a preset without an engine cannot borrow global recovery. Already oversized manual summaries require separately selected [manual recovery](./docs/manual-compaction-recovery.md), not a promise that preventive admission can rescue them.
112
+
113
+ For continuing steps with a committed managed route and no pending model change, known input pressure is reduced before Core opens the next model attempt. Successful native reduction avoids an unsampled local-pressure attempt that would make whole-turn Usage unavailable. First steps, pending selections, new fixed-prefix growth and final hard-budget refusals retain existing admission; this does not repair historical totals or invent missing usage.
114
+
115
+ For exact verified `408 / user_request_timeout`, diagnostics describe bounded request composition and observable timing, not a proven payload limit or root cause. Image counts include native Responses tool outputs; older stored diagnostics may have counted those images as residual history. Bytes are not tokens; timing is not upload duration. Small, image-free requests can also time out. Follow [request-budget and timeout guidance](./docs/copilot-compaction.md); do not automatically trim history, disable proof, switch models or add retries.
116
+
117
+ The same failure can include request-scoped native local body-write/header milestones, negotiated TLS ALPN and a Node writable-buffer count. These are local submission observations, not kernel ACK or supplier receipt; missing events do not prove an incomplete upload. Unsupported or ambiguous transports report unavailable evidence. No request contents are logged and no connection, proxy, dispatcher or retry is changed.
118
+
119
+ HTTP/SSE liveness separates five-minute byte idle from bounded ten-minute assistant-output silence by default. Consumer work is excluded; WebSocket/explicit `auto` stays native-only. This does not cure supplier HTTP 408s. Images are admitted against actual native-projected MIME evidence; the plugin does not own conversion or infer format support from filenames. [Image compatibility](./docs/image-input-compatibility.md).
120
+
121
+ ## Settings and troubleshooting
122
+
123
+ Configuration is under `github-copilot`. Credentials, endpoint definitions and a static model catalog are not plugin settings.
124
+
125
+ | Key | Default | Purpose |
126
+ |---|---:|---|
127
+ | `autoSemanticAssessment` | `true` | One auxiliary assessment for locally unknown Auto tasks |
128
+ | `followParentModel` | `false` | Supported child following; explicit child selections win |
129
+ | `excludedModelIds` | `[]` | Exact exclusions through Model preferences |
130
+ | `accountModelTtlMs` | `86400000` | 24h maximum metadata reuse, not token/proof validity |
131
+ | `accountModelFailureCooldownMs` | `300000` | 5min non-forcing discovery failure cooldown |
132
+ | `chatStreamLiveness` | `true` | Managed HTTP/SSE byte observation |
133
+ | `chatStreamIdleTimeoutMs` | `300000` | Byte-idle deadline; separate from search |
134
+ | `chatMaxRequestImageBytes` | `20971520` | Native 20 MiB outgoing-image budget, not a total JSON limit |
135
+ | `requestBudgetSafetyTokens` | `4096` | Estimated input safety allowance |
136
+ | `requestBudgetPressureRatio` | `0.9` | Early pressure with supported enabled recovery |
137
+ | `compactionReasoning` | `prefer-low` | Supported low effort only when none is resolved |
138
+ | `enabled` / `probe` | `true` / `true` | Hosted search / capability proof |
139
+ | `providers` | `[]` | Optional explicit search route allowlist |
140
+ | `includeSources` / `stripServerTools` | `true` / `true` | Inline citations / hosted-tool schema handling |
141
+ | `idleTimeoutMs` / `probeTimeoutMs` | `300000` / `30000` | Search request / probe deadlines |
142
+
143
+ | Symptom | Next safe action |
144
+ |---|---|
145
+ | No sign-in controls | Check active profile and loaded Host/Client; do not add a native provider merely to reveal login |
146
+ | Signed in, missing models | Inspect discovery diagnostics; use visible Retry or intentional Refresh, not repeated sign-in |
147
+ | Two Copilot groups | Review [explicit migration](./docs/single-route-migration.md); no automatic removal |
148
+ | Selection unknown/unavailable | Distinguish lost evidence from read failure; Retry only rereads |
149
+ | Missing/cancelled Turn Usage | Read [usage limitations](./docs/copilot-usage.md); do not infer zero billing |
150
+ | History fails on `github-copilot/auto-model-decision` | Use [detached, check-first recovery](./docs/automatic-model-routing.md#recovering-affected-histories); never replace live history without stopped writers and approval |
151
+ | AUTH, Responses replay-scope or TLS failure | Review [request diagnostics](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics) and [usage TLS boundaries](./docs/copilot-usage.md#account-data-boundary). After an exact scope rejection, **Replay recovery** appears automatically when the session's turn ends or the session opens. Review the loss of matching old encrypted items and their summaries, then authorize **Next matching turn only** (default choice) or **Continue in this session**. Both expire within one hour of the evidence and require the same validation state. Recovery itself stays off until confirmed; use native Send/Retry separately. It never rewrites history or retries automatically, and is not a 408 fix. Never reset credentials or disable TLS as an automatic repair. |
152
+ | Hosted search unavailable | Check account/protocol/probe diagnostics; a legacy override stays authoritative until explicitly reset |
153
+
154
+ ## Ownership and further reading
155
+
156
+ DSH Core owns Sessions, tools, sandboxing, attachments, native accounting and other providers. `llm-pi-ai` owns OAuth, token exchange/refresh and normal model transport. This plugin composes the published adapter with authenticated account metadata; new supported account model IDs need no name-based routing patch. Credentials stay Host-only under `llm-pi-ai/github-copilot`.
157
+
158
+ Public APIs cannot replace Core Edit/Delete, restructure its flat picker or make native Add a single-route enforcement mechanism. Retired [Model roles](./docs/dual-model.md) remain compatibility-only. Fixes must stay [plugin-only](./AGENTS.md#plugin-only-implementation-boundary).
159
+
160
+ | Guide | Scope |
161
+ |---|---|
162
+ | [Compatibility acceptance](./docs/model-compatibility-acceptance.md) | Metadata, reasoning, replay and public-interface limits |
163
+ | [Current official-first review](./docs/official-first-020-rc2.md) | Exact rc.2 seams and retained gaps |
164
+ | [Migration](./docs/single-route-migration.md) | Fresh read-only readiness and explicit config-only maintenance |
165
+ | [Distribution](./docs/npm-distribution.md) | Same-byte GitHub/npm publication and qualified installation |
166
+ | [Agent guide](./AGENTS.md), [contributing](./CONTRIBUTING.md) | Owners, task plans, gates and delivery policy |
167
+
168
+ Version history belongs in [CHANGELOG.md](./CHANGELOG.md) and immutable [Releases](https://github.com/cloga/dsh-github-copilot/releases), not the setup instructions. `deployment-baseline.json` retains historical pins without admitting them as current support.
169
+
170
+ ## Build and verify
171
+
172
+ Use Node 24 LTS and the exact pnpm version in `package.json`; runtime Node must be >=22.19.0.
173
+
174
+ ```sh
175
+ pnpm install --frozen-lockfile
176
+ pnpm verify
177
+ pnpm pack --pack-destination artifacts
178
+ pnpm verify:tarball -- artifacts/dsh-github-copilot-<package-version>.tgz
179
+ ```
180
+
181
+ `pnpm verify` covers contracts, types, baseline, build, tests and built entry smoke. Required CI targets unchanged official rc.2 source and published artifacts on Windows/Linux. Passing synthetic tests does not prove live account/model/search behavior.
182
+
183
+ Agents start with `node scripts/agent.mjs describe --json`, `doctor --json` and `plan <task> --json`; plans are unexecuted arguments, not action approval. Follow [AGENTS.md](./AGENTS.md) for the full change/release policy. Important updates require protected merge and verified dual-channel publication; documentation-only work does not release by default. Profile installation, sign-out and session-interrupting restart need separate authorization.
184
+
185
+ Commit attribution uses `Assisted-by` with the actual tool, never the model provider or an unverified collaborator identity.
186
+
187
+ ## Release and checksum verification
188
+
189
+ 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.
190
+
191
+ ```sh
192
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.100/dsh-github-copilot-0.4.0-alpha.100.tgz
193
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.100/SHA256SUMS
194
+ sha256sum --check SHA256SUMS
195
+ ```
196
+
197
+ ```powershell
198
+ $expected = (Get-Content .\SHA256SUMS).Split()[0]
199
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.100.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
200
+ if ($actual -cne $expected) { throw 'Release checksum mismatch' }
201
+ ```
202
+
203
+ Checksums detect corruption/drift; protected workflows and repository controls establish publisher provenance. Report vulnerabilities privately through [SECURITY.md](./SECURITY.md).
package/README.zh.md ADDED
@@ -0,0 +1,202 @@
1
+ # dsh-github-copilot
2
+
3
+ [![CI](https://github.com/cloga/dsh-github-copilot/actions/workflows/ci.yml/badge.svg)](https://github.com/cloga/dsh-github-copilot/actions/workflows/ci.yml)
4
+ [![Release](https://img.shields.io/github/v/release/cloga/dsh-github-copilot?include_prereleases)](https://github.com/cloga/dsh-github-copilot/releases)
5
+ [![License](https://img.shields.io/github/license/cloga/dsh-github-copilot)](./LICENSE)
6
+
7
+ [English](./README.md) | **简体中文**
8
+
9
+ 为 DSH 提供 GitHub Copilot 账号模型发现、上下文 Auto 选模和 hosted search。插件复用 DSH 公开的原生适配器,每个 profile 同时使用一个 Host 端活动 OAuth 账号,不修改 Core,也不维护第二套模型目录。
10
+
11
+ [账号需求与技术方案](./docs/copilot-accounts.md)说明如何在现有凭据服务中
12
+ 分别保存独立官方授权。**模型 → Manage → GitHub accounts**是唯一管理/
13
+ 切换入口;Credits 详情只读展示当前 GitHub 身份。
14
+
15
+ **源码候选版本:`0.4.0-alpha.100`(尚未发布)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。下方带版本的命令适用于候选版本发布后,不代表对应资产已经存在。
16
+
17
+ ## 你可以做什么
18
+
19
+ | 任务 | 入口 |
20
+ |---|---|
21
+ | 登录并管理账号模型 | **设置 → 模型 → GitHub Copilot → Sign in** |
22
+ | 添加/切换 GitHub 账号 | **Manage → GitHub accounts**;仅限托管路由 profile |
23
+ | 排除/恢复单个模型 | **Manage → Model preferences** |
24
+ | 自动选择模型 | 选择 **Auto · Balance / Efficiency / Intelligence** |
25
+ | 让受支持子代理跟随父模型 | **插件 → dsh-github-copilot → 详情 → Follow parent model** |
26
+ | 设置搜索主 provider 与最终 fallback | **插件详情 → Web search** |
27
+ | 查看账号 Credits 与上下文证据 | Copilot 会话输入框;原生 Turn Usage 独立保留 |
28
+
29
+ ![已发布 Client 的账号控件与模型偏好](./docs/images/copilot-model-preferences.png)
30
+
31
+ 图片来自实际已发布 Client 组件和隔离浏览器中的模拟模型,仅说明界面,不证明真实登录、模型可用性、搜索或 Desktop 已加载。
32
+
33
+ ## 安装与登录
34
+
35
+ 使用已校验的固定版本、指定 profile 和获准的包源。不需要 `copilot2api`、外部网关、手工粘贴 GitHub token、占位 key 或另装 `dsh-web-search-provider`。
36
+
37
+ 安装前,解包已核验 checksum 的归档,以绝对路径运行包内**只读组合预检**:
38
+
39
+ ```sh
40
+ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profile --home /absolute/DSH_HOME --install-anchor /absolute/dsh/package.json
41
+ ```
42
+
43
+ 启动 patch 用重复的 `--patch /absolute/file` 提供。必须得到 `supported: true`;安装器不会自动执行此预检。不支持的/自定义 Web 组合及 `NONEMPTY_DISPOSABLE_PROFILE_ROOT` 均须停止。先保全非空 root,并核对公开组合能否完整重建,再另行批准规范化;不能默认清空。检查实际共享 peer 解析,避免旧 profile-local 包遮蔽官方 Desktop peer。
44
+
45
+ **独立具名 profile**:
46
+
47
+ ```sh
48
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.100/dsh-github-copilot-0.4.0-alpha.100.tgz
49
+ ```
50
+
51
+ **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.100`。官方 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 或删除配置。
52
+
53
+ 经批准 reload/restart 后:
54
+
55
+ 1. 打开**设置 → 模型 → GitHub Copilot**,选择 **Sign in with GitHub**。不需要添加原生 provider 或手工定义模型。
56
+ 2. 复制一次性验证码,在自己的浏览器完成 GitHub device flow。Desktop 交给系统浏览器;未打开时仍可复制界面中的验证网址。
57
+ 3. 等待 **Signed in** 和账号发现完成,再选择模型。打开 Models 和正常使用会确保缺失/过期元数据;**Manage → Refresh models**用于有意强制刷新,不是日常设置前提。
58
+
59
+ 退出须显式操作,只删除活动账号的授权,保留其它授权与路由设置。升级保留已有原生 Copilot profile;在[显式单路由迁移](./docs/single-route-migration.md)前,仍可能存在两个分组。安装不迁移会话或默认模型。
60
+
61
+ 在 **Manage → GitHub accounts**添加账号不会替换活动账号。确认切换后,当前 profile 的后续托管请求使用新账号;相关工作仍在运行、原生路由尚存或证据不完整时会阻止切换。新账号可能没有已选模型,旧加密 replay 也可能绑定原账号;不会自动替换模型或删除历史。**Reauthorize**仅更新同一已存身份的授权;**Remove**仅删除非活动授权。账号缺失/失效不会自动回退到其它账号。
62
+
63
+ **Desktop 生命周期:**停用、移除、升级后的 Web 服务重组可能需要完整冷重启。若插件已 Off,而原生 manager 仅提示 `pending (waiting for service: web)`,不要反复切换或重装。先取得重启许可,遵循[rc.2 生命周期说明](./docs/web-lifecycle-rc2.md)。
64
+
65
+ ## Auto 与模型偏好
66
+
67
+ 三档 Auto 共用账号验证、未排除的合格模型池。输入/图片能力等硬门槛先于任务偏好。
68
+
69
+ | 任务需求 | Efficiency | Balance | Intelligence |
70
+ |---|---|---|---|
71
+ | 已证实简单 | Lightweight | Lightweight | Lightweight |
72
+ | 常规 | Lightweight | Versatile | Powerful |
73
+ | 复杂 | Powerful | Powerful | Powerful |
74
+ | 未知 | Versatile | Versatile | Powerful |
75
+
76
+ 分类来自认证后的供应方元数据,不按模型名、上下文容量或臆测质量排名。上一模型仍合适时保持,否则在合格分类内稳定等权分配;分类回退明确说明。同一已准入 turn 的工具步骤、重试和压缩保持同一真实模型。
77
+
78
+ 语义判断**默认开启,仅用于本地需求未知的任务**。最多一次辅助请求,**8 秒端到端期限、128 tokens 输出预算**。可用 `github-copilot.autoSemanticAssessment: false` 关闭。超时/无效结果保留未知,再按偏好兜底,不解释为简单,也不换分类模型重试。用户取消和账号失效仍终止请求。辅助调用增加延迟与供应方费用,不计入原生回答 Usage。
79
+
80
+ 准备、原生请求和结果边界均用单调时钟检查期限,不依赖定时器及时执行。事件循环延迟可能推迟结束,但不授权超期发起请求或接受结果。合格 Lightweight 分类模型优先考虑声明 reasoning `off` 的候选,同级按 ID 确定顺序;只有公开原生模型也支持时才发送 `off`。这不是实测速率排名。解释分别说明该分类的可容纳候选数和上一模型连续性,不将保留上一模型说成语义优选。
81
+
82
+ 回复的选模说明展示捕获的理由和可选的不含内容的辅助里程碑。`uncertain`、`insufficient-evidence` 不等于会话没有上下文。**Selection unknown**表示记录未保留,**Selection unavailable → Retry**表示读取失败;Retry 只重读该 turn,不重新推理。证据有界且仅限 Host 生命周期,重启/淘汰可能丢失。
83
+
84
+ **模型排除**将精确 ID 移出托管 picker 与新 turn 的 Auto 候选。已选模型也能排除:已准入 turn 保持原模型,但新 turn/直接调用不得使用;固定选择不会静默替换。偏好状态未知时只读,不伪装为已启用。保存采用窄范围原生 CAS,不读凭据、不发现模型、不扫描会话。
85
+
86
+ 详见[任务判断](./docs/auto-task-routing.md)与[路由合同、排除和历史恢复](./docs/automatic-model-routing.md)。
87
+
88
+ 显式 Auto 意图通过插件对现有选择事件的独立投影保留,不因原生 pending 被消费或冷恢复而丢失。后续显式固定选择仍从未来轮次生效,已准入轮次保持原路由。不会补写历史选择理由,也不会把未知证据猜成 Auto。
89
+
90
+ ## 子代理与搜索
91
+
92
+ ![当前父模型跟随及 Web search 控件](./docs/images/copilot-search-routing.png)
93
+
94
+ **Follow parent model**默认关闭,在当前 profile 内作用于托管 Copilot 父会话的受支持原生子代理/Team mate。固定父模型从子会话下一 turn 生效;Auto 父会话传递准确偏好,子会话按自己的上下文选模。子会话的显式选择优先。运行中 turn、root、fork、其它 provider、旧专用策略不被改写;关闭宽泛开关也不移除旧绑定。[父模型跟随合同](./docs/parent-model-follow.md)。
95
+
96
+ **Web search**仅有两个常规选项:主 provider 与最终 fallback。Auto 在存在对应搜索注册时跟随发起 Chat provider;固定 provider 不随 Chat 模型改变。最多尝试一个不同的最终 fallback,明确提示可能费用;取消或账号 proof 失效不授权 fallback。
97
+
98
+ Copilot 搜索要求当前账号/协议证据及能力 proof。固定/fallback Copilot 保留非空旧 `searchModel`;否则最多考虑三个账号 Responses 候选。最终用户查询只发送一次,不跨候选重放。设置保存或 Chat 成功不证明 hosted search 可用。[搜索路由与组合](./docs/session-search-routing.md)。
99
+
100
+ 旧 `github-copilot.searchFallback` 只控制独立的 canonical inline 路径,不是路由搜索的第三层 fallback;网页抓取不变。
101
+
102
+ ## 用量、请求限制与恢复
103
+
104
+ **Credits**展示已验证账号计费周期数据,不是上下文 tokens 或会话成本。过期、组织共享及不可用数据保留真实语义。仅额度请求在保持 TLS 验签下合并 Node 与系统 CA;不改变登录、模型、搜索或整个 Desktop 的信任配置。
105
+
106
+ 原生上下文占用与 Turn Usage 由 Core 所有。插件原样转发 usage,包括失败/取消时的零样本。独立上下文说明展示历史证据,不推断当前占用、不替换原生 `0%`。**Turn Usage incomplete**解释缺失样本/生命周期及已记录本地阻断,不编造零用量或部分总和。取消可以保留 usage,但不保证收到供应方最终回执。[用量边界](./docs/copilot-usage.md)。
107
+
108
+ 插件恢复 timeout/replay 结构化错误前会保留原生 usage,包括非零采样。失败的零采样仍可能让原生圆环显示 `0%`,不代表请求上下文为空。重试条目的耗时表示退避等待,不是失败请求耗时;用量修复不等于解决供应方 HTTP 408,也不改变重试策略。
109
+
110
+ 托管请求准入保留真实输入/输出上限和原生事务。自动压力使用发起 Agent 真正绑定的压缩服务;preset 无引擎时不能借用全局恢复。已超限的手动摘要需另行选择[手动恢复](./docs/manual-compaction-recovery.md),不能承诺预防性准入已解决。
111
+
112
+ 同一轮后续步骤已有托管路由、且没有待切换模型时,已知输入压力会在 Core 开始下次模型尝试之前压缩。原生压缩成功可避免一次无 usage 样本的本地压力拒绝导致整轮 Usage 不可用。首次步骤、待切换模型、新增固定前缀膨胀与最终硬预算拒绝仍保留原有准入;不会修复历史总量或虚构缺失用量。
113
+
114
+ 严格核验的 `408 / user_request_timeout`诊断给出有界请求构成和可观察耗时,不证明供应方 payload 上限或根因。图片统计包括原生 Responses 工具输出中的图片;旧的已存诊断可能把这些图片算作剩余历史。字节不是 tokens,耗时不是上传时长;小型无图请求也可能超时。参见[预算与超时指导](./docs/copilot-compaction.md),不要自动裁剪历史、禁用 proof、切换模型或增加重试。
115
+
116
+ 同一失败还可包含请求级原生客户端的本地请求体写入/响应头里程碑、协商出的 TLS ALPN 与 Node 写缓冲字节数。这些只是本地提交观测,不是内核 ACK 或供应方接收证明;缺失事件不代表上传未完成。不支持或存在歧义的传输会明确报告证据不可用。不记录请求内容,也不改变连接、代理、dispatcher 或重试。
117
+
118
+ HTTP/SSE liveness 默认区分 5 分钟字节 idle 和有界的 10 分钟助手输出静默,排除消费者工作;WebSocket/显式 `auto`仍仅使用原生路径。这不修复供应方 HTTP 408。图片按原生实际投影 MIME 证据准入;插件不负责转换,也不按文件名猜格式支持。[图片兼容](./docs/image-input-compatibility.md)。
119
+
120
+ ## 设置与排障
121
+
122
+ 配置位于 `github-copilot`。凭据、endpoint 和静态模型目录不是插件设置。
123
+
124
+ | Key | 默认值 | 用途 |
125
+ |---|---:|---|
126
+ | `autoSemanticAssessment` | `true` | 本地未知任务的一次辅助判断 |
127
+ | `followParentModel` | `false` | 受支持子代理跟随,子会话显式选择优先 |
128
+ | `excludedModelIds` | `[]` | Model preferences 保存的精确排除 |
129
+ | `accountModelTtlMs` | `86400000` | 最多复用元数据 24h,不延长 token/proof |
130
+ | `accountModelFailureCooldownMs` | `300000` | 非强制发现失败冷却 5min |
131
+ | `chatStreamLiveness` | `true` | 托管 HTTP/SSE 字节观察 |
132
+ | `chatStreamIdleTimeoutMs` | `300000` | 字节 idle 期限,与搜索独立 |
133
+ | `chatMaxRequestImageBytes` | `20971520` | 原生 20 MiB 出站图片预算,非总 JSON 上限 |
134
+ | `requestBudgetSafetyTokens` | `4096` | 估算输入安全余量 |
135
+ | `requestBudgetPressureRatio` | `0.9` | 启用受支持恢复时的提前压力 |
136
+ | `compactionReasoning` | `prefer-low` | 未解析 effort 时采用受支持低档 |
137
+ | `enabled` / `probe` | `true` / `true` | Hosted search/能力 proof |
138
+ | `providers` | `[]` | 可选显式搜索路由 allowlist |
139
+ | `includeSources` / `stripServerTools` | `true` / `true` | Inline 引用/托管工具 schema 处理 |
140
+ | `idleTimeoutMs` / `probeTimeoutMs` | `300000` / `30000` | 搜索请求/probe 期限 |
141
+
142
+ | 现象 | 安全下一步 |
143
+ |---|---|
144
+ | 无登录控件 | 核对活动 profile 与已加载 Host/Client;不要只为显示登录而添加原生 provider |
145
+ | 已登录但缺模型 | 查看发现诊断,使用 Retry 或有意 Refresh,不反复登录 |
146
+ | 两个 Copilot 分组 | 审核[显式迁移](./docs/single-route-migration.md),不会自动移除 |
147
+ | 选模未知/不可读 | 区分记录丢失与读取失败;Retry 只重读 |
148
+ | 缺失/取消后的 Turn Usage | 查看[用量限制](./docs/copilot-usage.md),不推断零计费 |
149
+ | 历史加载报 `github-copilot/auto-model-decision` | 使用[独立副本、先检查的恢复](./docs/automatic-model-routing.md#recovering-affected-histories);未经批准且未停写不得替换实际历史 |
150
+ | AUTH、Responses replay scope 或 TLS 错误 | 查看[请求诊断](./docs/model-compatibility-acceptance.md#authentication-replay-and-request-diagnostics)及[额度 TLS 边界](./docs/copilot-usage.md#account-data-boundary)。精确 scope 拒绝后,**回放恢复**会在当前轮结束或打开会话时自动提示。查看旧加密项及项内摘要的损失后,可选择**仅下一轮使用恢复**(默认选项)或**在本会话内继续使用**;两者都要求验证状态不变,最长不超过证据产生后一小时。恢复默认关闭,确认授权也不发送消息,需另行使用原生发送或重试。不改磁盘历史,也不是 408 修复。不自动重置凭据或关闭 TLS。 |
151
+ | Hosted search 不可用 | 检查账号/协议/probe 诊断;旧 override 保留至显式 reset |
152
+
153
+ ## 所有权与深入阅读
154
+
155
+ DSH Core 所有会话、工具、sandbox、附件、原生计量和其它 provider;`llm-pi-ai`所有 OAuth、token 交换/刷新和普通模型传输。插件以认证后的账号元数据组合公开适配器,受支持的新模型 ID 无需名称路由补丁。凭据仅在 Host,key 为 `llm-pi-ai/github-copilot`。
156
+
157
+ 公开接口不能替换 Core Edit/Delete、重构平铺 picker 或把原生 Add 变成单路由强制机制。已退役的[Model roles](./docs/dual-model.md)仅保留兼容。修复须遵循[plugin-only](./AGENTS.md#plugin-only-implementation-boundary)。
158
+
159
+ | 指南 | 范围 |
160
+ |---|---|
161
+ | [兼容验收](./docs/model-compatibility-acceptance.md) | 元数据、reasoning、replay 及公开接口限制 |
162
+ | [当前 official-first](./docs/official-first-020-rc2.md) | 准确 rc.2 seam 与保留差距 |
163
+ | [迁移](./docs/single-route-migration.md) | 新鲜只读就绪证据及显式 config-only 维护 |
164
+ | [分发](./docs/npm-distribution.md) | 同字节 GitHub/npm 发布和合格安装入口 |
165
+ | [Agent 指南](./AGENTS.md)、[贡献](./CONTRIBUTING.md) | owner、任务计划、gate 与交付政策 |
166
+
167
+ 版本沿革见[CHANGELOG.md](./CHANGELOG.md)与不可变[Releases](https://github.com/cloga/dsh-github-copilot/releases),不再混入安装步骤。`deployment-baseline.json`保留历史 pin,但不准入为当前支持。
168
+
169
+ ## 构建与验证
170
+
171
+ 开发使用 Node 24 LTS 和 `package.json`指定的 pnpm;runtime Node 至少 22.19.0。
172
+
173
+ ```sh
174
+ pnpm install --frozen-lockfile
175
+ pnpm verify
176
+ pnpm pack --pack-destination artifacts
177
+ pnpm verify:tarball -- artifacts/dsh-github-copilot-<package-version>.tgz
178
+ ```
179
+
180
+ `pnpm verify`覆盖合同、类型、baseline、build、测试和构建入口 smoke。必需 CI 在 Windows/Linux 使用未修改的官方 rc.2 源码与发布制品。模拟测试通过不证明真实账号/模型/搜索可用。
181
+
182
+ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <task> --json`开始;计划仅返回未执行 argv,不授权副作用。完整变更/发布政策见[AGENTS.md](./AGENTS.md)。重要更新必须经受保护合并与双渠道发布;纯文档默认不发包。Profile 安装、退出和中断会话的重启另需许可。
183
+
184
+ 提交以 `Assisted-by` 标明实际使用的工具,不用模型供应商或未经核实的协作者身份。
185
+
186
+ ## Release 与 checksum
187
+
188
+ GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
189
+
190
+ ```sh
191
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.100/dsh-github-copilot-0.4.0-alpha.100.tgz
192
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.100/SHA256SUMS
193
+ sha256sum --check SHA256SUMS
194
+ ```
195
+
196
+ ```powershell
197
+ $expected = (Get-Content .\SHA256SUMS).Split()[0]
198
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.100.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
199
+ if ($actual -cne $expected) { throw 'Release checksum mismatch' }
200
+ ```
201
+
202
+ Checksum 检测损坏/漂移;受保护 workflow 和仓库控制建立发布来源。漏洞请通过[SECURITY.md](./SECURITY.md)私下报告。
package/SECURITY.md ADDED
@@ -0,0 +1,29 @@
1
+ # Security policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are applied to the latest GitHub Release and the `main` branch. Older release tarballs remain available for reproducible deployments but do not receive backports unless a release note explicitly says otherwise.
6
+
7
+ ## Report a vulnerability privately
8
+
9
+ Do not open a public issue for credential exposure, OAuth/session handling flaws, endpoint-validation bypasses, or another vulnerability that could put users at risk.
10
+
11
+ Use GitHub's private vulnerability reporting for this repository:
12
+
13
+ https://github.com/cloga/dsh-github-copilot/security/advisories/new
14
+
15
+ Include:
16
+
17
+ - the affected release or commit;
18
+ - the DSH baseline and operating system;
19
+ - a minimal reproduction or proof of concept;
20
+ - the expected and observed security boundary;
21
+ - whether credentials, tokens, logs, or release artifacts may have been exposed.
22
+
23
+ Never include a live GitHub, Copilot, npm, or DSH credential. Replace secrets with clearly synthetic values and redact raw provider responses.
24
+
25
+ ## Security boundaries
26
+
27
+ This package keeps Copilot credential payloads on the Host, accepts only validated GitHub-hosted or signed-in Enterprise Copilot endpoints, and does not route credentials through an external gateway. DSH Core owns sandboxing and approval policy; this package only narrows Copilot-visible Tool Schemas and does not grant wider permissions.
28
+
29
+ The official release process publishes tarballs through the protected tag-triggered Release workflow. Repository tag rules and immutable-release settings protect new releases after publication. Verify the downloaded artifact against `SHA256SUMS` from the same GitHub Release before deployment.
@@ -0,0 +1,16 @@
1
+ # Keep the official web service and its exact configuration in a named realm.
2
+ # `name` is an include-patch guard, not a replacement: custom web services do not
3
+ # match. Native tools/presets and all execution policies remain unchanged.
4
+ - id: web
5
+ name: '@deepseek-ai/dsh-web'
6
+ isolate:
7
+ web: github-copilot-original-web
8
+ - insert:
9
+ - id: github-copilot-web-delegate
10
+ name: dsh-github-copilot/web-delegate
11
+ isolate:
12
+ web: github-copilot-original-web
13
+ - id: github-copilot-routed-web
14
+ name: dsh-github-copilot/routed-web
15
+ - id: github-copilot
16
+ name: dsh-github-copilot