dsh-github-copilot 0.1.0-alpha.1.dsh.0.2.1.alpha.5

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 (209) hide show
  1. package/AGENTS.md +439 -0
  2. package/CHANGELOG.md +875 -0
  3. package/CONTRIBUTING.md +55 -0
  4. package/LICENSE +21 -0
  5. package/README.md +366 -0
  6. package/README.zh.md +341 -0
  7. package/SECURITY.md +29 -0
  8. package/cordis.patch.yml +16 -0
  9. package/deployment-baseline.json +1580 -0
  10. package/docs/account-management-experience.md +143 -0
  11. package/docs/agent-readiness.md +110 -0
  12. package/docs/auto-high-cost.md +255 -0
  13. package/docs/auto-iteration-review.json +22 -0
  14. package/docs/auto-review-sampling.md +60 -0
  15. package/docs/auto-task-routing.md +341 -0
  16. package/docs/automatic-model-routing.md +236 -0
  17. package/docs/copilot-accounts.md +424 -0
  18. package/docs/copilot-compaction.md +148 -0
  19. package/docs/copilot-usage.md +133 -0
  20. package/docs/dual-model.md +66 -0
  21. package/docs/evidence-driven-iteration.md +86 -0
  22. package/docs/image-input-compatibility.md +64 -0
  23. package/docs/images/copilot-accounts-credits.png +0 -0
  24. package/docs/images/copilot-accounts.png +0 -0
  25. package/docs/images/copilot-current-provenance.json +39 -0
  26. package/docs/images/copilot-model-preferences.png +0 -0
  27. package/docs/images/copilot-search-routing.png +0 -0
  28. package/docs/images/copilot-session-continuation.png +0 -0
  29. package/docs/images/dual-model-desktop.png +0 -0
  30. package/docs/images/dual-model-mobile.png +0 -0
  31. package/docs/images/dual-model-provenance.json +35 -0
  32. package/docs/images/parent-model-follow.png +0 -0
  33. package/docs/manual-compaction-recovery.md +109 -0
  34. package/docs/mockups/copilot-account-dropdown.html +71 -0
  35. package/docs/mockups/copilot-account-management.html +393 -0
  36. package/docs/model-compatibility-acceptance.md +182 -0
  37. package/docs/npm-distribution.md +202 -0
  38. package/docs/official-first-016-alpha2.md +66 -0
  39. package/docs/official-first-020-rc1.md +32 -0
  40. package/docs/official-first-020-rc2.md +17 -0
  41. package/docs/official-first-021-alpha4.md +157 -0
  42. package/docs/official-first-021-alpha5.md +83 -0
  43. package/docs/plugin-diagnostics.md +605 -0
  44. package/docs/session-continuation.md +141 -0
  45. package/docs/session-search-routing.md +133 -0
  46. package/docs/single-route-migration.md +131 -0
  47. package/docs/web-lifecycle-rc2.md +55 -0
  48. package/lib/client.js +13236 -0
  49. package/lib/client.js.map +1 -0
  50. package/lib/copilot-identity-DRZY_d2X.js +15 -0
  51. package/lib/diagnostics-analysis-io.js +78 -0
  52. package/lib/diagnostics-analysis.js +427 -0
  53. package/lib/diagnostics-types-CF-qg8Do.js +708 -0
  54. package/lib/index.js +15661 -0
  55. package/lib/manual-compaction-recovery.js +485 -0
  56. package/lib/remote.js +1507 -0
  57. package/lib/request-budget-DLY_aRq0.js +87 -0
  58. package/lib/routed-web.js +120 -0
  59. package/lib/search-routing-CV2hs8as.js +792 -0
  60. package/lib/types/account-dropdown.d.ts +22 -0
  61. package/lib/types/account-model-auth.d.ts +15 -0
  62. package/lib/types/account-model-catalog.d.ts +70 -0
  63. package/lib/types/account-model-source.d.ts +85 -0
  64. package/lib/types/agent-compaction.d.ts +4 -0
  65. package/lib/types/authorization-code-clipboard.d.ts +4 -0
  66. package/lib/types/authorization-controller.d.ts +121 -0
  67. package/lib/types/auto-allocation-card.d.ts +9 -0
  68. package/lib/types/auto-allocation-diagnostics.d.ts +126 -0
  69. package/lib/types/auto-allocation-evidence.d.ts +44 -0
  70. package/lib/types/auto-allocation.d.ts +47 -0
  71. package/lib/types/auto-assessment-evidence.d.ts +111 -0
  72. package/lib/types/auto-model-host.d.ts +30 -0
  73. package/lib/types/auto-model-intent.d.ts +36 -0
  74. package/lib/types/auto-model-presentation.d.ts +57 -0
  75. package/lib/types/auto-model-routing.d.ts +64 -0
  76. package/lib/types/auto-review-sampling.d.ts +6 -0
  77. package/lib/types/auto-selection-explanation.d.ts +9 -0
  78. package/lib/types/auto-task-assessment.d.ts +49 -0
  79. package/lib/types/auto-task-classifier.d.ts +10 -0
  80. package/lib/types/background-compaction.d.ts +30 -0
  81. package/lib/types/client.d.ts +129 -0
  82. package/lib/types/compact-account.d.ts +42 -0
  83. package/lib/types/compaction-continuation-ui.d.ts +29 -0
  84. package/lib/types/compaction-continuation.d.ts +48 -0
  85. package/lib/types/compaction-input-estimate.d.ts +28 -0
  86. package/lib/types/compaction-pressure.d.ts +23 -0
  87. package/lib/types/compaction-replay.d.ts +18 -0
  88. package/lib/types/compatibility.d.ts +17 -0
  89. package/lib/types/composer-notice-style.d.ts +7 -0
  90. package/lib/types/config.d.ts +141 -0
  91. package/lib/types/content-file.d.ts +10 -0
  92. package/lib/types/context-evidence-ui.d.ts +28 -0
  93. package/lib/types/context-evidence.d.ts +256 -0
  94. package/lib/types/context-usage.d.ts +4 -0
  95. package/lib/types/copilot-account-presentation.d.ts +7 -0
  96. package/lib/types/copilot-accounts-card.d.ts +43 -0
  97. package/lib/types/copilot-accounts-host.d.ts +93 -0
  98. package/lib/types/copilot-accounts-remote.d.ts +85 -0
  99. package/lib/types/copilot-accounts-types.d.ts +43 -0
  100. package/lib/types/copilot-auth.d.ts +31 -0
  101. package/lib/types/copilot-grant.d.ts +11 -0
  102. package/lib/types/copilot-identity.d.ts +11 -0
  103. package/lib/types/copilot-request.d.ts +11 -0
  104. package/lib/types/copilot-stream-liveness.d.ts +23 -0
  105. package/lib/types/copilot-usage-card.d.ts +51 -0
  106. package/lib/types/copilot-usage-host.d.ts +61 -0
  107. package/lib/types/copilot-usage-normalize.d.ts +9 -0
  108. package/lib/types/copilot-usage-remote.d.ts +63 -0
  109. package/lib/types/copilot-usage-types.d.ts +20 -0
  110. package/lib/types/copilot-usage-ui.d.ts +4 -0
  111. package/lib/types/current-provider.d.ts +59 -0
  112. package/lib/types/deepseek-search-fallback.d.ts +11 -0
  113. package/lib/types/diagnostics-analysis-io.d.ts +23 -0
  114. package/lib/types/diagnostics-analysis.d.ts +298 -0
  115. package/lib/types/diagnostics-card.d.ts +12 -0
  116. package/lib/types/diagnostics-client.d.ts +13 -0
  117. package/lib/types/diagnostics-collector.d.ts +50 -0
  118. package/lib/types/diagnostics-host.d.ts +183 -0
  119. package/lib/types/diagnostics-remote.d.ts +113 -0
  120. package/lib/types/diagnostics-types.d.ts +893 -0
  121. package/lib/types/dual-model-host.d.ts +119 -0
  122. package/lib/types/dual-model-remote.d.ts +63 -0
  123. package/lib/types/dual-model-types.d.ts +34 -0
  124. package/lib/types/external-link.d.ts +3 -0
  125. package/lib/types/failure.d.ts +38 -0
  126. package/lib/types/http.d.ts +48 -0
  127. package/lib/types/image-input-admission.d.ts +5 -0
  128. package/lib/types/index.d.ts +39 -0
  129. package/lib/types/manual-compaction-recovery.d.ts +67 -0
  130. package/lib/types/migration-status.d.ts +50 -0
  131. package/lib/types/model-exclusions.d.ts +15 -0
  132. package/lib/types/model-preferences-card.d.ts +9 -0
  133. package/lib/types/model-protocol.d.ts +31 -0
  134. package/lib/types/native-select-style.d.ts +4 -0
  135. package/lib/types/native-settings-style.d.ts +10 -0
  136. package/lib/types/parent-model-follow-card.d.ts +32 -0
  137. package/lib/types/parent-model-follow.d.ts +44 -0
  138. package/lib/types/pi-provider-bridge.d.ts +22 -0
  139. package/lib/types/plan.d.ts +148 -0
  140. package/lib/types/pre-step-pressure.d.ts +8 -0
  141. package/lib/types/preview-provider.d.ts +77 -0
  142. package/lib/types/preview-route.d.ts +76 -0
  143. package/lib/types/probe.d.ts +39 -0
  144. package/lib/types/remote-codec.d.ts +10 -0
  145. package/lib/types/remote.d.ts +202 -0
  146. package/lib/types/replay-recovery-host.d.ts +28 -0
  147. package/lib/types/replay-recovery-remote.d.ts +14 -0
  148. package/lib/types/replay-recovery-types.d.ts +24 -0
  149. package/lib/types/replay-recovery-ui.d.ts +28 -0
  150. package/lib/types/replay-recovery.d.ts +17 -0
  151. package/lib/types/request-body-composition.d.ts +17 -0
  152. package/lib/types/request-body-evidence.d.ts +37 -0
  153. package/lib/types/request-body-timeout-marker.d.ts +2 -0
  154. package/lib/types/request-body-timeout.d.ts +4 -0
  155. package/lib/types/request-budget.d.ts +58 -0
  156. package/lib/types/request-diagnostics.d.ts +278 -0
  157. package/lib/types/request-upload-evidence.d.ts +23 -0
  158. package/lib/types/response-error-body.d.ts +3 -0
  159. package/lib/types/responses-reasoning-text.d.ts +24 -0
  160. package/lib/types/responses-reasoning.d.ts +7 -0
  161. package/lib/types/responses-replay-compat.d.ts +31 -0
  162. package/lib/types/responses-request-compression.d.ts +33 -0
  163. package/lib/types/route-ownership.d.ts +70 -0
  164. package/lib/types/routed-web.d.ts +50 -0
  165. package/lib/types/search-backend.d.ts +16 -0
  166. package/lib/types/search-routing-host.d.ts +19 -0
  167. package/lib/types/search-routing-policy.d.ts +18 -0
  168. package/lib/types/search-routing-remote.d.ts +20 -0
  169. package/lib/types/search-routing.d.ts +43 -0
  170. package/lib/types/search-tool-routing.d.ts +22 -0
  171. package/lib/types/serialize.d.ts +106 -0
  172. package/lib/types/session-accounts-controller.d.ts +20 -0
  173. package/lib/types/session-accounts-host.d.ts +33 -0
  174. package/lib/types/session-accounts-remote.d.ts +114 -0
  175. package/lib/types/session-accounts.d.ts +38 -0
  176. package/lib/types/session-continuation-host.d.ts +45 -0
  177. package/lib/types/session-continuation-remote.d.ts +22 -0
  178. package/lib/types/session-continuation-types.d.ts +62 -0
  179. package/lib/types/session-continuation-ui.d.ts +49 -0
  180. package/lib/types/session-continuation.d.ts +14 -0
  181. package/lib/types/settings-reader.d.ts +16 -0
  182. package/lib/types/sse.d.ts +28 -0
  183. package/lib/types/temporary-models.d.ts +25 -0
  184. package/lib/types/tool-schema-compat.d.ts +17 -0
  185. package/lib/types/traditional-search.d.ts +17 -0
  186. package/lib/types/turn-model-provenance.d.ts +45 -0
  187. package/lib/types/turn-request-models.d.ts +55 -0
  188. package/lib/types/turn-selection-card.d.ts +24 -0
  189. package/lib/types/turn-selection-host.d.ts +35 -0
  190. package/lib/types/turn-selection-remote.d.ts +17 -0
  191. package/lib/types/turn-selection.d.ts +186 -0
  192. package/lib/types/turn-usage-evidence.d.ts +66 -0
  193. package/lib/types/turn-usage-notice.d.ts +7 -0
  194. package/lib/types/types.d.ts +69 -0
  195. package/lib/types/usage.d.ts +26 -0
  196. package/lib/types/watchdog.d.ts +22 -0
  197. package/lib/types/web-delegate.d.ts +12 -0
  198. package/lib/types/web-search-routing-card.d.ts +16 -0
  199. package/lib/types/web-search-routing-config.d.ts +12 -0
  200. package/lib/types/wire-anthropic.d.ts +37 -0
  201. package/lib/types/wire.d.ts +56 -0
  202. package/lib/web-delegate.js +9 -0
  203. package/output/auto-model-mockup/index.html +207 -0
  204. package/package.json +261 -0
  205. package/scripts/analyze-diagnostics.mjs +91 -0
  206. package/scripts/check-search-composition.mjs +191 -0
  207. package/scripts/iteration-review.mjs +53 -0
  208. package/scripts/release-policy.mjs +353 -0
  209. package/scripts/select-core-release.mjs +11 -0
@@ -0,0 +1,119 @@
1
+ import { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import { z as json } from 'zod';
4
+ import type { DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
5
+ export declare const DUAL_MODEL_NAMESPACE = "github-copilot-dual-model";
6
+ export declare const DUAL_MODEL_POLICY_EVENT = "github-copilot/dual-model-policy";
7
+ export declare const DUAL_MODEL_PROJECTION = "githubCopilotDualModelPolicy";
8
+ export declare const DUAL_MODEL_EXECUTE_TOOL = "copilot_execute";
9
+ declare const PolicyJson: json.ZodObject<{
10
+ version: json.ZodLiteral<1>;
11
+ rootSessionId: json.ZodString;
12
+ requestId: json.ZodString;
13
+ workspaceId: json.ZodString;
14
+ settingsRevision: json.ZodNumber;
15
+ cwd: json.ZodString;
16
+ agentPreset: json.ZodString;
17
+ provider: json.ZodLiteral<"github-copilot-preview">;
18
+ plannerModel: json.ZodString;
19
+ executorModel: json.ZodString;
20
+ executorTools: json.ZodArray<json.ZodString>;
21
+ plannerTools: json.ZodArray<json.ZodString>;
22
+ }, json.core.$strict>;
23
+ type Policy = json.infer<typeof PolicyJson>;
24
+ interface LogEvent {
25
+ readonly type: string;
26
+ readonly seq: number;
27
+ readonly data: unknown;
28
+ readonly ignorable?: true;
29
+ }
30
+ interface Header {
31
+ readonly id: string;
32
+ readonly cwd?: string;
33
+ readonly parentSession?: string;
34
+ readonly origin?: string;
35
+ readonly agentPreset?: string;
36
+ }
37
+ interface ChildDescriptor {
38
+ readonly version: 3;
39
+ readonly mode: 'continuable';
40
+ readonly provider: 'spawn';
41
+ readonly agentProvider: string;
42
+ readonly agentModel: string;
43
+ }
44
+ interface Projection {
45
+ readonly id: string;
46
+ readonly parentId: string | null;
47
+ readonly origin: string | null;
48
+ readonly inherited: number;
49
+ readonly policy: Policy | null;
50
+ readonly child: ChildDescriptor | null;
51
+ readonly invalid: boolean;
52
+ }
53
+ /** A root policy is authoritative only in its own suffix, never in a fork seed. */
54
+ export declare const dualModelProjection: {
55
+ key: string;
56
+ stateVersion: number;
57
+ stateSchema: json.ZodObject<{
58
+ id: json.ZodString;
59
+ parentId: json.ZodNullable<json.ZodString>;
60
+ origin: json.ZodNullable<json.ZodString>;
61
+ inherited: json.ZodNumber;
62
+ policy: json.ZodNullable<json.ZodObject<{
63
+ version: json.ZodLiteral<1>;
64
+ rootSessionId: json.ZodString;
65
+ requestId: json.ZodString;
66
+ workspaceId: json.ZodString;
67
+ settingsRevision: json.ZodNumber;
68
+ cwd: json.ZodString;
69
+ agentPreset: json.ZodString;
70
+ provider: json.ZodLiteral<"github-copilot-preview">;
71
+ plannerModel: json.ZodString;
72
+ executorModel: json.ZodString;
73
+ executorTools: json.ZodArray<json.ZodString>;
74
+ plannerTools: json.ZodArray<json.ZodString>;
75
+ }, json.core.$strict>>;
76
+ child: json.ZodNullable<json.ZodObject<{
77
+ version: json.ZodLiteral<3>;
78
+ mode: json.ZodLiteral<"continuable">;
79
+ provider: json.ZodLiteral<"spawn">;
80
+ agentProvider: json.ZodString;
81
+ agentModel: json.ZodString;
82
+ }, json.core.$strict>>;
83
+ invalid: json.ZodBoolean;
84
+ }, json.core.$strip>;
85
+ init: (header: Header, inherited?: number) => Projection;
86
+ apply: (state: Projection, event: LogEvent) => Projection;
87
+ };
88
+ export declare function dualModelSessionId(requestId: string): string;
89
+ declare module '@deepseek-ai/cordis' {
90
+ interface Context {
91
+ githubCopilotDualModel: GitHubCopilotDualModel;
92
+ }
93
+ }
94
+ /** Always mountable; retired entry points coexist with retained policy enforcement. */
95
+ export default class GitHubCopilotDualModel extends TypertRemoteService {
96
+ private readonly owner;
97
+ private readonly lifetime;
98
+ private readonly creates;
99
+ private readonly overlays;
100
+ private settingsReady;
101
+ private projectionReady;
102
+ private registrationFailed;
103
+ constructor(ctx: Context);
104
+ private capabilities;
105
+ private requireCapabilities;
106
+ private configuration;
107
+ view(): Promise<DualModelView>;
108
+ save(input: DualModelSaveRequest): Promise<DualModelView>;
109
+ private saveOnce;
110
+ create(input: DualModelCreateRequest): Promise<DualModelCreateResult>;
111
+ private createOnce;
112
+ private workspace;
113
+ private assertModels;
114
+ private projection;
115
+ private restore;
116
+ private install;
117
+ }
118
+ export {};
119
+ //# sourceMappingURL=dual-model-host.d.ts.map
@@ -0,0 +1,63 @@
1
+ /** Client-safe, strict wire contract for the optional Copilot model-role feature. */
2
+ import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
3
+ import { z } from 'zod';
4
+ import type { DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
5
+ export type { DualModelConfig, DualModelView, DualModelSaveRequest, DualModelCreateRequest, DualModelCreateResult } from './dual-model-types.ts';
6
+ declare module '@deepseek-ai/dsh-typert-protocol' {
7
+ interface RemoteErrorDetailsMap {
8
+ 'copilot/dual-model': {
9
+ readonly reason: string;
10
+ readonly creation?: 'not-created' | 'uncertain';
11
+ };
12
+ }
13
+ interface TypertRemoteNamespaceMap {
14
+ githubCopilotDualModel: {
15
+ view(): Promise<RemoteResult<DualModelView>>;
16
+ save(input: DualModelSaveRequest): Promise<RemoteResult<DualModelView>>;
17
+ create(input: DualModelCreateRequest): Promise<RemoteResult<DualModelCreateResult>>;
18
+ };
19
+ }
20
+ }
21
+ export declare const DualModelConfigSchema: z.ZodObject<{
22
+ enabled: z.ZodBoolean;
23
+ plannerModel: z.ZodString;
24
+ executorModel: z.ZodString;
25
+ }, z.core.$strict>;
26
+ export declare const DualModelViewSchema: z.ZodObject<{
27
+ supported: z.ZodBoolean;
28
+ diagnostic: z.ZodOptional<z.ZodString>;
29
+ writable: z.ZodBoolean;
30
+ revision: z.ZodNullable<z.ZodNumber>;
31
+ configuration: z.ZodObject<{
32
+ enabled: z.ZodBoolean;
33
+ plannerModel: z.ZodString;
34
+ executorModel: z.ZodString;
35
+ }, z.core.$strict>;
36
+ models: z.ZodArray<z.ZodObject<{
37
+ id: z.ZodString;
38
+ name: z.ZodString;
39
+ }, z.core.$strict>>;
40
+ workspaces: z.ZodArray<z.ZodObject<{
41
+ id: z.ZodString;
42
+ name: z.ZodString;
43
+ }, z.core.$strict>>;
44
+ }, z.core.$strict>;
45
+ export declare const DualModelSaveSchema: z.ZodObject<{
46
+ configuration: z.ZodObject<{
47
+ enabled: z.ZodBoolean;
48
+ plannerModel: z.ZodString;
49
+ executorModel: z.ZodString;
50
+ }, z.core.$strict>;
51
+ expectedRevision: z.ZodNumber;
52
+ }, z.core.$strict>;
53
+ export declare const DualModelCreateSchema: z.ZodObject<{
54
+ requestId: z.ZodString;
55
+ workspaceId: z.ZodString;
56
+ expectedRevision: z.ZodNumber;
57
+ }, z.core.$strict>;
58
+ export declare const DualModelCreateResultSchema: z.ZodObject<{
59
+ sessionId: z.ZodString;
60
+ }, z.core.$strict>;
61
+ declare const contribution: TypertRemoteContribution;
62
+ export default contribution;
63
+ //# sourceMappingURL=dual-model-remote.d.ts.map
@@ -0,0 +1,34 @@
1
+ /** Credential-free contracts shared by the optional dual-model Host and UI. */
2
+ export interface DualModelConfig {
3
+ readonly enabled: boolean;
4
+ readonly plannerModel: string;
5
+ readonly executorModel: string;
6
+ }
7
+ export interface DualModelView {
8
+ readonly supported: boolean;
9
+ readonly diagnostic?: string;
10
+ readonly writable: boolean;
11
+ readonly revision: number | null;
12
+ readonly configuration: DualModelConfig;
13
+ readonly models: readonly {
14
+ readonly id: string;
15
+ readonly name: string;
16
+ }[];
17
+ readonly workspaces: readonly {
18
+ readonly id: string;
19
+ readonly name: string;
20
+ }[];
21
+ }
22
+ export interface DualModelSaveRequest {
23
+ readonly configuration: DualModelConfig;
24
+ readonly expectedRevision: number;
25
+ }
26
+ export interface DualModelCreateRequest {
27
+ readonly requestId: string;
28
+ readonly workspaceId: string;
29
+ readonly expectedRevision: number;
30
+ }
31
+ export interface DualModelCreateResult {
32
+ readonly sessionId: string;
33
+ }
34
+ //# sourceMappingURL=dual-model-types.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Use Desktop's public v1 navigation handoff instead of WebView popup creation. */
2
+ export declare function externalLinkTarget(): '_self' | '_blank';
3
+ //# sourceMappingURL=external-link.d.ts.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Failure classification for the inline wire path. The codes must land in
3
+ * the harness vocabulary dsh-llm-retry understands (AUTH, RATE_LIMIT,
4
+ * INVALID_REQUEST, SERVER, TIMEOUT, TRANSPORT, QUOTA,
5
+ * CONTEXT_WINDOW_EXCEEDED, UNKNOWN) so the standard retry policy applies.
6
+ * Also owns the finish-chunk constructors the two wires share.
7
+ * @module dsh-github-copilot/failure
8
+ */
9
+ import type { LlmFailure, StreamChunk } from '@deepseek-ai/dsh-llm';
10
+ /**
11
+ * Classify a non-OK HTTP response into the harness failure vocabulary.
12
+ * @param status - the HTTP status code.
13
+ * @param retryAfterMs - optional provider-requested delay in milliseconds.
14
+ * @param requestId - optional provider request id for diagnostics.
15
+ * @param apiLabel - the API family named in the diagnostic, e.g. `Messages API`.
16
+ * @returns the failure object for a finish chunk.
17
+ */
18
+ export declare function classifyHttpStatus(status: number, retryAfterMs?: number, requestId?: string, apiLabel?: string): LlmFailure;
19
+ /**
20
+ * Parse an HTTP `Retry-After` header value into milliseconds. Only a
21
+ * non-negative seconds integer is accepted; an HTTP-date or any other value
22
+ * yields `undefined` rather than a `NaN` delay.
23
+ * @param retryAfter - the raw header value, or `null` when absent.
24
+ * @returns the delay in milliseconds, or `undefined`.
25
+ */
26
+ export declare function parseRetryAfterMs(retryAfter: string | null): number | undefined;
27
+ /**
28
+ * Classify a transport-level error (fetch throw, timeout, malformed body)
29
+ * into the harness failure vocabulary.
30
+ * @param error - the thrown value.
31
+ * @returns the failure object for a finish chunk.
32
+ */
33
+ export declare function classifyWireError(error: unknown): LlmFailure;
34
+ /** The finish chunk for any failure; the generator never throws it. */
35
+ export declare function errorFinish(failure: LlmFailure): StreamChunk;
36
+ /** The finish chunk for a caller-aborted request. */
37
+ export declare function abortedFinish(): StreamChunk;
38
+ //# sourceMappingURL=failure.d.ts.map
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Shared HTTP plumbing for the capability probe and the inline wires:
3
+ * bounded response reading, caller-cancellation races for preflight steps,
4
+ * and the stable {@link WebError} translations. The patterns mirror the
5
+ * harness `dsh-web` package family (web-search-deepseek, model discovery) so
6
+ * every credentialed request rejects redirects before a `Location` target can
7
+ * be contacted.
8
+ * @module dsh-github-copilot/http
9
+ */
10
+ /**
11
+ * Endpoint replies larger than this are refused. The endpoint is whatever
12
+ * base URL the configuration named, so the ceiling holds on the bytes
13
+ * actually read rather than on the length the server claims.
14
+ */
15
+ export declare const MAX_RESPONSE_BYTES: number;
16
+ /**
17
+ * Read a response body with a hard byte cap, refusing one that outgrows it.
18
+ * A declared length is checked first so an honest server is turned away
19
+ * without transferring anything; the accumulated total is what actually
20
+ * enforces the bound, because a server that under-declares (or streams) tells
21
+ * us nothing up front.
22
+ * @param response - the HTTP response whose body is read to completion.
23
+ * @param url - the requested URL, named in the refusal message.
24
+ * @returns the decoded body text.
25
+ * @throws WebError `WEB_PROVIDER_ERROR` when the body exceeds the cap.
26
+ */
27
+ export declare function readBounded(response: Response, url: string): Promise<string>;
28
+ /** Whether an error is the fetch/`AbortSignal` abort signal. */
29
+ export declare function isAbortError(error: unknown): boolean;
30
+ /**
31
+ * Race a same-process asynchronous preflight (credential resolution) against
32
+ * a cancellation signal. The attached settlement handlers keep observing an
33
+ * uncooperative operation after the race is lost, so a later rejection cannot
34
+ * become unhandled.
35
+ * @param operation - the preflight promise.
36
+ * @param signal - the cancellation signal (request abort or idle watchdog).
37
+ * @returns the operation's value, or a rejection once the signal fires.
38
+ */
39
+ export declare function abortable<T>(operation: Promise<T>, signal: AbortSignal | undefined): Promise<T>;
40
+ /**
41
+ * Extract a provider error message from an error envelope whose shape varies
42
+ * by protocol and vendor: `{ error: { message } }`, `{ error: "text" }`, or
43
+ * `{ message }`. Returns `undefined` when nothing usable is present.
44
+ * @param body - the parsed non-2xx response body.
45
+ * @returns the provider message, or `undefined`.
46
+ */
47
+ export declare function providerErrorMessage(body: unknown): string | undefined;
48
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { AccountModelDescriptor } from './account-model-catalog.ts';
2
+ export type ImageInputFailure = 'COPILOT_IMAGE_INPUT_UNSUPPORTED' | 'COPILOT_IMAGE_MEDIA_TYPE_UNAVAILABLE' | 'COPILOT_IMAGE_MEDIA_TYPE_UNSUPPORTED';
3
+ /** Inspect native projected images, never infer wire formats from durable filenames. */
4
+ export declare function imageInputFailure(model: AccountModelDescriptor, messages: readonly unknown[]): ImageInputFailure | undefined;
5
+ //# sourceMappingURL=image-input-admission.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The inline web-search plugin: short-circuits agent-loop model calls on
3
+ * the `llm/stream` waterfall, injecting the server-side `web_search` tool
4
+ * into the wire request so search executes inside the model's own turn.
5
+ * The narrow gate keeps every other request on the normal adapter path.
6
+ * @module dsh-github-copilot
7
+ */
8
+ import type { Context } from '@deepseek-ai/cordis';
9
+ import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
10
+ import type { LiveInlineConfig } from './config.ts';
11
+ export { COPILOT_HOSTED_SEARCH_PROVIDER_ID, GITHUB_COPILOT_HOSTED_SEARCH_PROVIDER_ID, } from './traditional-search.ts';
12
+ /** Cordis plugin name used by loader diagnostics. */
13
+ export declare const name = "github-copilot";
14
+ /**
15
+ * Bootstrap dependency. The integration itself is mounted below only after
16
+ * every service in {@link integrationInject}, including authorization, is
17
+ * active.
18
+ */
19
+ export declare const inject: string[];
20
+ /** Settings namespace carrying this plugin's section. */
21
+ export declare const GITHUB_COPILOT_SETTINGS_NAMESPACE: SettingsNamespace;
22
+ /** Schema of the plugin's settings section, exported for composition consumers. */
23
+ export { Config } from './config.ts';
24
+ export type { InlineConfig } from './config.ts';
25
+ export { NO_DEFAULT_SEARCH_PROVIDER, WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE, WebSearchRoutingConfigSchema, } from './web-search-routing-config.ts';
26
+ export type { WebSearchRoutingConfig } from './web-search-routing-config.ts';
27
+ export { assertDshCompatibility, DSH_COMPATIBILITY } from './compatibility.ts';
28
+ export { GITHUB_COPILOT_CREDENTIAL_KEY, GitHubCopilotAuthorizationController, describeGitHubCopilotProviderProfile, ensureGitHubCopilotProviderProfile, LLM_PI_AI_SETTINGS_NAMESPACE, } from './authorization-controller.ts';
29
+ export type { AuthorizationNoticeView, GitHubCopilotAuthorizationPhase, GitHubCopilotAuthorizationView, GitHubCopilotRouteView, } from './authorization-controller.ts';
30
+ /**
31
+ * Register the inline short-circuit. The plan (candidates plus probe
32
+ * verdict) follows the settings section; the listener reads the CURRENT
33
+ * plan and config per request.
34
+ * @param ctx - context whose `llm` events and `systemPrompt` receive the
35
+ * registrations; both are effect-scoped and unregister on dispose.
36
+ * @param config - the composition entry config, used as the settings base layer.
37
+ */
38
+ export declare function apply(ctx: Context, config: LiveInlineConfig): void;
39
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,67 @@
1
+ import type { Agent } from '@deepseek-ai/dsh-agent';
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import BasicCompactionEngine from '@deepseek-ai/dsh-compaction-basic';
4
+ import type { BasicCompactionConfig } from '@deepseek-ai/dsh-compaction-basic';
5
+ import z from '@deepseek-ai/schemastery';
6
+ import type { ContentBlock, Message, TokenUsage, ToolSchema } from '@deepseek-ai/dsh-llm';
7
+ import type { CommandId } from '@deepseek-ai/dsh-commands/brand';
8
+ import type { CompactionResult } from '@deepseek-ai/dsh-compaction';
9
+ interface RecoveryMessage {
10
+ readonly role: string;
11
+ readonly content: readonly {
12
+ readonly type: string;
13
+ readonly id?: string;
14
+ }[];
15
+ readonly toolCallId?: string;
16
+ }
17
+ interface RecoveryInput<M> {
18
+ readonly messages: readonly M[];
19
+ readonly tools?: readonly ToolSchema[];
20
+ }
21
+ interface RecoveryResult {
22
+ readonly summary: ContentBlock[];
23
+ readonly provider: string;
24
+ readonly model: string;
25
+ readonly maxTokens?: number;
26
+ readonly usage?: TokenUsage;
27
+ }
28
+ interface RecoveryOptions<M extends RecoveryMessage, R extends RecoveryResult> {
29
+ readonly input: RecoveryInput<M>;
30
+ readonly inputLimit: number;
31
+ readonly maxCalls?: number;
32
+ readonly signal: AbortSignal;
33
+ readonly estimate: (input: RecoveryInput<M>) => number;
34
+ readonly summarize: (input: RecoveryInput<M>) => Promise<R>;
35
+ readonly makeCheckpoint: (summary: readonly ContentBlock[]) => M;
36
+ readonly assertCurrent?: () => void;
37
+ }
38
+ /**
39
+ * Bounded map/fold. The native engine still owns the only
40
+ * durable transaction, source-stability check, shrink check and cancellation.
41
+ */
42
+ export declare function summarizeOversizedManualInput<M extends RecoveryMessage, R extends RecoveryResult>(options: RecoveryOptions<M, R>): Promise<RecoveryResult>;
43
+ /**
44
+ * Deployment-selected alternative to stock BasicCompactionEngine. Do not
45
+ * mount both: Cordis compaction is a singleton, not an overridable service.
46
+ */
47
+ export declare class CopilotManualRecoveryCompactionEngine extends BasicCompactionEngine {
48
+ static Config: z<BasicCompactionConfig & {
49
+ automaticRecovery?: boolean;
50
+ }>;
51
+ private readonly manual;
52
+ private readonly visibleHistory;
53
+ private readonly automaticRecovery;
54
+ constructor(ctx: Context, config?: BasicCompactionConfig & {
55
+ automaticRecovery?: boolean;
56
+ });
57
+ compactNow(agent: Agent, signal: AbortSignal, sourceCommandId?: CommandId): Promise<CompactionResult | null>;
58
+ protected summarize(input: RecoveryInput<Message>, agent: Agent, signal?: AbortSignal): Promise<RecoveryResult | {
59
+ summary: ContentBlock[];
60
+ provider: string;
61
+ model: string;
62
+ maxTokens?: number;
63
+ }>;
64
+ private summarizeManaged;
65
+ }
66
+ export default CopilotManualRecoveryCompactionEngine;
67
+ //# sourceMappingURL=manual-compaction-recovery.d.ts.map
@@ -0,0 +1,50 @@
1
+ /** Read-only, synchronous evidence for an independently authorized Ops migration. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ export interface MigrationSelection {
4
+ readonly provider: string;
5
+ readonly model: string;
6
+ readonly reasoningEffort?: string;
7
+ }
8
+ export interface MigrationSession {
9
+ readonly id: string;
10
+ readonly status: 'idle' | 'running';
11
+ readonly effectiveSelection: MigrationSelection | null;
12
+ readonly selectionSource: 'pending' | 'request-header' | 'default' | 'unknown';
13
+ /** Latest recorded request config for running Agents, not proof of an in-flight model call. */
14
+ readonly activeRequestSelection: MigrationSelection | null;
15
+ }
16
+ /** Loaded plugin identity is not Desktop/Core byte attestation. Cold histories are not inspected. */
17
+ export interface GitHubCopilotMigrationStatus {
18
+ readonly plugin: {
19
+ readonly name: string;
20
+ readonly version: string;
21
+ };
22
+ readonly protocolVersion: 1;
23
+ readonly historyScope: 'live-agents-only';
24
+ readonly observedAt: number;
25
+ readonly capabilities: {
26
+ readonly agentsList: boolean;
27
+ readonly sessionProjections: boolean;
28
+ readonly settingsCas: boolean;
29
+ readonly providerRegistry: boolean;
30
+ readonly defaultSelection: boolean;
31
+ };
32
+ readonly complete: {
33
+ readonly sessions: boolean;
34
+ readonly defaultSelection: boolean;
35
+ readonly routes: boolean;
36
+ };
37
+ readonly defaultSelection: MigrationSelection | null;
38
+ readonly sessions: readonly MigrationSession[];
39
+ readonly routes: {
40
+ readonly nativeConfigured: boolean | null;
41
+ readonly nativeRegistered: boolean | null;
42
+ readonly managedRegistered: boolean | null;
43
+ };
44
+ }
45
+ /**
46
+ * Observe only public live leaves in one synchronous stack, without writes or network.
47
+ * This is not a cross-namespace transaction; callers must recheck immediately before CAS.
48
+ */
49
+ export declare function migrationStatus(ctx: Context): GitHubCopilotMigrationStatus;
50
+ //# sourceMappingURL=migration-status.d.ts.map
@@ -0,0 +1,15 @@
1
+ export declare const MAX_EXCLUDED_MODEL_IDS = 512;
2
+ /** Admission is bound to the native turn and its request signal, not the global picker. */
3
+ export declare class ModelExclusionTurns {
4
+ private readonly turns;
5
+ private readonly signals;
6
+ admit(owner: object, turn: number, model: string, signal: AbortSignal, excluded: ReadonlySet<string>): boolean;
7
+ permits(signal: AbortSignal | undefined, model: string): boolean;
8
+ end(owner: object): void;
9
+ }
10
+ export declare function normalizeExcludedModelIds(value: unknown): readonly string[];
11
+ export declare function excludedModelSet(value: unknown): ReadonlySet<string>;
12
+ export declare function filterExcludedModels<T extends {
13
+ readonly id: string;
14
+ }>(models: readonly T[], value: unknown): readonly T[];
15
+ //# sourceMappingURL=model-exclusions.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
2
+ import type { ReactElement } from 'react';
3
+ import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
4
+ export declare function GitHubCopilotModelPreferencesPanel(props: {
5
+ readonly remote: Pick<ClientContext['remote']['githubCopilot'], 'status' | 'setModelExcluded' | 'setModelHighCost'>;
6
+ readonly models: GitHubCopilotAuthorizationView['accountModels'];
7
+ readonly preferences: GitHubCopilotAuthorizationView['modelPreferences'];
8
+ }): ReactElement;
9
+ //# sourceMappingURL=model-preferences-card.d.ts.map
@@ -0,0 +1,31 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { Api, Model } from '@earendil-works/pi-ai';
3
+ /** Public facts from this plugin's pi-ai dependency, not a claim about another Core copy. */
4
+ export interface CopilotModelFacts {
5
+ readonly id: string;
6
+ readonly provider: string;
7
+ readonly api: string;
8
+ readonly name: string;
9
+ readonly baseUrl: string;
10
+ readonly contextWindow: number;
11
+ readonly maxTokens: number;
12
+ readonly input: readonly ('text' | 'image')[];
13
+ readonly reasoning: boolean;
14
+ readonly supportsReasoningOff: boolean;
15
+ readonly reasoningEfforts: Readonly<Record<string, string>>;
16
+ readonly headers?: Readonly<Record<string, string | null>>;
17
+ }
18
+ export interface CopilotCatalogSnapshot {
19
+ readonly models: readonly CopilotModelFacts[];
20
+ /** True only for models whose actual native provider is built by this plugin. */
21
+ readonly authoritative: boolean;
22
+ }
23
+ /** Project only public leaves and the same pi library's supported wire efforts. */
24
+ export declare function projectModelFacts(model: Model<Api>): CopilotModelFacts;
25
+ /** Stock Core owns its own catalog; local metadata must not retire corrections on its behalf. */
26
+ export declare function readCopilotCatalog(_ctx: Context): CopilotCatalogSnapshot;
27
+ /** The preview uses this exact pi provider instance family, so local model facts are authoritative there. */
28
+ export declare function readPreviewCatalog(): CopilotCatalogSnapshot;
29
+ /** Scope optional preview contributions to this plugin's successfully mounted route service. */
30
+ export declare function isPluginPreviewProvider(ctx: Context, provider: string): boolean;
31
+ //# sourceMappingURL=model-protocol.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare function nativeSelectStyle(disabled?: boolean): CSSProperties;
3
+ export declare function nativeOptionStyle(disabled?: boolean): CSSProperties;
4
+ //# sourceMappingURL=native-select-style.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const nativeSettingsStyle: CSSProperties;
3
+ export declare const nativeHeadingStyle: CSSProperties;
4
+ export declare const nativeCaptionStyle: CSSProperties;
5
+ export declare const nativeButtonStyle: CSSProperties;
6
+ export declare const nativeCompactButtonStyle: CSSProperties;
7
+ export declare const nativeInputStyle: CSSProperties;
8
+ export declare const nativeCardStyle: CSSProperties;
9
+ export declare const nativeSettingsCss = "\n[data-copilot-native-ui] :is(h3, strong, th) { font-weight: 500; }\n[data-copilot-native-ui] button:not(:disabled):hover {\n background: var(--dsw-alias-interactive-bg-hover, var(--dsw-specific-settings-secondary-hover-solid, ButtonFace));\n}\n[data-copilot-native-ui] :is(button, input, select, textarea, summary, a):focus-visible {\n outline: 2px solid var(--dsw-focus-ring-color, Highlight); outline-offset: 2px;\n}\n[data-copilot-native-ui] :is(button, input, select, textarea):disabled { opacity: 0.4; cursor: not-allowed; }\n[data-copilot-native-ui] summary {\n width: fit-content; max-width: 100%; padding: 2px 4px; margin-left: -4px;\n border-radius: var(--dsw-radius-sm, 8px); cursor: pointer;\n font: inherit; font-weight: 500;\n color: var(--dsw-alias-label-secondary, GrayText); list-style: none;\n}\n[data-copilot-native-ui] summary::-webkit-details-marker { display: none; }\n[data-copilot-native-ui] summary::before {\n content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 8px;\n border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;\n transform: rotate(-45deg); transition: transform 120ms ease;\n}\n[data-copilot-native-ui] details[open] > summary::before,\n[data-copilot-native-ui][open] > summary::before { transform: rotate(45deg); }\n[data-copilot-native-ui] summary:hover { background: var(--dsw-alias-interactive-bg-hover, ButtonFace); }\n@media (prefers-reduced-motion: reduce) {\n [data-copilot-native-ui] summary::before { transition: none; }\n}\n";
10
+ //# sourceMappingURL=native-settings-style.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ReactElement } from 'react';
3
+ type Settings = Context['remote']['settings'];
4
+ interface Snapshot {
5
+ enabled: boolean;
6
+ revision: number;
7
+ writable: boolean;
8
+ legacy: boolean;
9
+ }
10
+ interface Props {
11
+ settings: Settings;
12
+ onSaved?: (revision: {
13
+ previous: number;
14
+ next: number;
15
+ }) => void;
16
+ }
17
+ export declare function readParentFollowSettings(settings: Settings): Promise<Snapshot>;
18
+ export declare function saveParentFollowSettings(settings: Settings, saved: Snapshot, enabled: boolean): Promise<{
19
+ snapshot: {
20
+ enabled: boolean;
21
+ revision: number;
22
+ writable: boolean;
23
+ legacy: boolean;
24
+ };
25
+ revision: {
26
+ previous: number;
27
+ next: number;
28
+ };
29
+ }>;
30
+ export declare function ParentModelFollowCard({ settings, onSaved }: Props): ReactElement;
31
+ export {};
32
+ //# sourceMappingURL=parent-model-follow-card.d.ts.map
@@ -0,0 +1,44 @@
1
+ /** Explicit enrollment, never inferred from equality of parent and child models. */
2
+ export interface ParentModelBinding {
3
+ readonly childSessionId: string;
4
+ readonly parentSessionId: string;
5
+ }
6
+ export interface FollowSelection {
7
+ readonly provider: string;
8
+ readonly model: string;
9
+ }
10
+ export interface FollowState {
11
+ readonly inherited: number;
12
+ readonly turn: number | null;
13
+ readonly started: boolean;
14
+ readonly explicit: FollowSelection | null;
15
+ readonly descriptor: boolean;
16
+ readonly blocked: boolean;
17
+ }
18
+ interface Event {
19
+ readonly seq: number;
20
+ readonly type: string;
21
+ readonly data: unknown;
22
+ }
23
+ export declare const PARENT_MODEL_FOLLOW_PROJECTION = "githubCopilotParentModelFollow";
24
+ export declare function followSelection(value: unknown): FollowSelection | undefined;
25
+ export declare function initialFollowState(inherited?: number): FollowState;
26
+ /** Fold only the child's own suffix; copied fork selections are not child overrides. */
27
+ export declare function foldFollowState(state: FollowState, event: Event): FollowState;
28
+ export declare class ParentModelFollowError extends Error {
29
+ readonly code: string;
30
+ constructor(code: string);
31
+ }
32
+ export interface FollowSubject {
33
+ readonly id: string;
34
+ readonly parentId?: string;
35
+ readonly origin?: string;
36
+ readonly state: FollowState;
37
+ readonly pending: FollowSelection | null;
38
+ readonly recorded?: FollowSelection;
39
+ }
40
+ export declare function supportsParentFollowing(subject: FollowSubject): boolean;
41
+ /** Resolve a new turn's intent without changing any Session, setting or descriptor. */
42
+ export declare function resolveParentModel(child: FollowSubject, bindings: readonly ParentModelBinding[], lookup: (id: string) => FollowSubject | undefined, followAll?: boolean): FollowSelection | undefined;
43
+ export {};
44
+ //# sourceMappingURL=parent-model-follow.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { Provider, AssistantMessageEventStream } from '@earendil-works/pi-ai';
2
+ import type { ResolvedPiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai';
3
+ export type CoreCompatibleProvider = NonNullable<ResolvedPiAiProviderProfile['piProvider']>;
4
+ export type SimpleNativeProvider = Pick<Provider, 'id' | 'name' | 'baseUrl' | 'headers' | 'auth' | 'getModels' | 'filterModels' | 'streamSimple'>;
5
+ type CoreStream = ReturnType<CoreCompatibleProvider['streamSimple']>;
6
+ type PublicCoreStream = Pick<CoreStream, keyof CoreStream>;
7
+ type PublicNativeStream = Pick<AssistantMessageEventStream, keyof AssistantMessageEventStream>;
8
+ type Assert<Condition extends true> = Condition;
9
+ /** Compile-time, bidirectional proof; a future real public event change must fail this gate. */
10
+ export type PiStreamPublicCompatibility = [
11
+ Assert<PublicNativeStream extends PublicCoreStream ? true : false>,
12
+ Assert<PublicCoreStream extends PublicNativeStream ? true : false>
13
+ ];
14
+ /** Retain the same stream object after proving its public surface; only SDK-private nominal identity differs. */
15
+ export declare function coreEventStream(stream: AssistantMessageEventStream): CoreStream;
16
+ /**
17
+ * The published Core adapter consumes streamSimple. Do not pretend its older
18
+ * protocol-specific clients are interchangeable with a newer SDK's clients.
19
+ */
20
+ export declare function coreProviderView(provider: SimpleNativeProvider): CoreCompatibleProvider;
21
+ export {};
22
+ //# sourceMappingURL=pi-provider-bridge.d.ts.map