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,7 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const composerNoticeStyle: CSSProperties;
3
+ export declare const composerNoticeSurfaceStyle: CSSProperties;
4
+ export declare const composerNoticeQuietButtonStyle: CSSProperties;
5
+ export declare const composerNoticeParagraphStyle: CSSProperties;
6
+ export declare const composerNoticeButtonStyle: CSSProperties;
7
+ //# sourceMappingURL=composer-notice-style.d.ts.map
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Settings for managed account requests and inline hosted search, including
3
+ * separate stream bounds. Credentials and model transport remain native-owned.
4
+ * @module dsh-github-copilot/config
5
+ */
6
+ import z from '@deepseek-ai/schemastery';
7
+ import type { RequestBudgetPolicy } from './request-budget.ts';
8
+ import type { WebSearchRoutingConfig } from './web-search-routing-config.ts';
9
+ import type { LiveSetting } from './settings-reader.ts';
10
+ import type { ParentModelBinding } from './parent-model-follow.ts';
11
+ import type { SessionAccountPreference } from './session-accounts.ts';
12
+ import type { SessionContinuationPreference } from './session-continuation-types.ts';
13
+ /** Plugin configuration. Defaults make the current chat route decide. */
14
+ export interface InlineConfig {
15
+ /** Opt-in local aggregate diagnostics; no uploads or scheduled analysis. */
16
+ diagnosticsEnabled?: boolean;
17
+ /** Independent opt-in persistence of Auto allocation aggregates. */
18
+ autoAllocationDiagnosticsEnabled?: boolean;
19
+ /** Separate opt-in content-free physical request observations. */
20
+ requestDiagnosticsEnabled?: boolean;
21
+ /** Hosted-search switch; managed chat requests remain enabled. */
22
+ enabled: boolean;
23
+ /**
24
+ * Provider whitelist (llm-pi-ai route keys). Empty = follow the current
25
+ * chat route, whose candidates decide whether the plugin can serve.
26
+ */
27
+ providers: string[];
28
+ /** Append `include: ['web_search_call.action.sources']` to wire requests. */
29
+ includeSources: boolean;
30
+ /** Strip function-tool variants of the server-side web tools from the wire. */
31
+ stripServerTools: boolean;
32
+ /** Idle bound for one inline request, in milliseconds. */
33
+ idleTimeoutMs: number;
34
+ /** Managed chat byte-idle interval; separate from hosted search. */
35
+ chatStreamIdleTimeoutMs?: number;
36
+ /** Enable bounded HTTP byte-aware liveness without fabricated assistant progress. */
37
+ chatStreamLiveness?: boolean;
38
+ /** Native request image projection budget; changing it can offload older images. */
39
+ chatMaxRequestImageBytes?: number;
40
+ /** Default-off lossless gzip for eligible managed Responses HTTP requests. */
41
+ responsesRequestCompression?: boolean;
42
+ /** Default-off override omitting temperature from all managed Responses requests. */
43
+ responsesOmitTemperature?: boolean;
44
+ /** Verify the endpoint executes native search before serving. */
45
+ probe: boolean;
46
+ /** Bound on one probe request, in milliseconds. */
47
+ probeTimeoutMs: number;
48
+ /** Maximum reuse of account model metadata; credential proof guards still take precedence. */
49
+ accountModelTtlMs?: number;
50
+ /** Minimum delay after failed passive discovery; explicit Refresh bypasses it. */
51
+ accountModelFailureCooldownMs?: number;
52
+ /** Exact account model IDs hidden from the managed directory and every Auto candidate pool. */
53
+ excludedModelIds?: string[];
54
+ /** User-marked costly IDs; reduced positive Auto weight, independent of category. */
55
+ highCostModelIds?: string[];
56
+ /** Opaque profile-wide account selector; absence retains canonical compatibility. */
57
+ activeAccountId?: string;
58
+ /** Explicit Session overrides; absence means follow the profile default. */
59
+ sessionAccounts?: SessionAccountPreference[];
60
+ /** Explicit lossy continuation consent for exact Sessions, never inherited. */
61
+ sessionContinuation?: SessionContinuationPreference[];
62
+ continuationDefaultHistory?: {
63
+ enabled: boolean;
64
+ changedAt: number;
65
+ }[];
66
+ /** Explicit native child/direct-parent enrollments; empty preserves native routing. */
67
+ parentModelFollow?: ParentModelBinding[];
68
+ /** Profile-wide next-turn policy for supported native children. */
69
+ followParentModel?: boolean;
70
+ /** Default-on bounded task assessment; explicit false opts out of auxiliary inference. */
71
+ autoSemanticAssessment?: boolean;
72
+ /** Total preparation/response budget; finite wait, independent of native Chat deadlines. */
73
+ autoSemanticAssessmentTimeoutMs?: number;
74
+ /** Exact account classifier ID; empty keeps metadata-driven automatic selection. */
75
+ autoSemanticAssessmentModel?: string;
76
+ /** Capture bounded local candidate opportunities for future policy review. */
77
+ autoAllocationEvidence?: boolean;
78
+ /** Estimated managed-route input headroom, separate from truthful catalog capacities. */
79
+ requestBudgetSafetyTokens?: number;
80
+ /** Fraction of admissible input used by eligible automatic-compaction requests. */
81
+ requestBudgetPressureRatio?: number;
82
+ /** Supported low effort only for summary calls with no already resolved effort. */
83
+ compactionReasoning?: RequestBudgetPolicy['compactionReasoning'];
84
+ /** Route the official web-search consumer by initiating Session when the bundle isolate is mounted. */
85
+ routeWebSearch?: boolean;
86
+ /** Automatic fallback, disclosed in results; no per-search approval dialog. */
87
+ searchFallback?: 'none' | 'deepseek';
88
+ /** Optional authoritative legacy override; otherwise hosted search resolves bounded account-owned candidates independently of Chat. */
89
+ searchModel?: string;
90
+ /** Provider routing folded into this plugin entry on current Core releases. */
91
+ searchRouting?: WebSearchRoutingConfig;
92
+ /** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
93
+ temporaryRouteBackup?: string;
94
+ }
95
+ export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'autoAllocationDiagnosticsEnabled' | 'requestDiagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory' | 'autoSemanticAssessmentTimeoutMs' | 'autoSemanticAssessmentModel'> & {
96
+ autoSemanticAssessmentTimeoutMs?: number | LiveSetting<number>;
97
+ autoSemanticAssessmentModel?: string | LiveSetting<string>;
98
+ continuationDefaultHistory?: InlineConfig['continuationDefaultHistory'] | LiveSetting<ArrayLike<{
99
+ enabled: boolean;
100
+ changedAt: number;
101
+ }>>;
102
+ sessionContinuation?: SessionContinuationPreference[] | LiveSetting<ArrayLike<SessionContinuationPreference>>;
103
+ sessionAccounts?: SessionAccountPreference[] | LiveSetting<ArrayLike<SessionAccountPreference>>;
104
+ diagnosticsEnabled?: boolean | LiveSetting<boolean>;
105
+ autoAllocationDiagnosticsEnabled?: boolean | LiveSetting<boolean>;
106
+ requestDiagnosticsEnabled?: boolean | LiveSetting<boolean>;
107
+ activeAccountId?: string | LiveSetting<string | undefined>;
108
+ followParentModel?: boolean | LiveSetting<boolean>;
109
+ parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
110
+ highCostModelIds?: string[] | LiveSetting<ArrayLike<string>>;
111
+ excludedModelIds?: string[] | LiveSetting<ArrayLike<string>>;
112
+ searchModel?: string | LiveSetting<string | undefined>;
113
+ searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
114
+ temporaryRouteBackup?: string | LiveSetting<string | undefined>;
115
+ };
116
+ export type ResolvedInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'autoAllocationDiagnosticsEnabled' | 'requestDiagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory' | 'autoSemanticAssessmentTimeoutMs' | 'autoSemanticAssessmentModel'> & {
117
+ autoSemanticAssessmentTimeoutMs: LiveSetting<number>;
118
+ autoSemanticAssessmentModel: LiveSetting<string>;
119
+ diagnosticsEnabled: LiveSetting<boolean>;
120
+ autoAllocationDiagnosticsEnabled: LiveSetting<boolean>;
121
+ requestDiagnosticsEnabled: LiveSetting<boolean>;
122
+ continuationDefaultHistory: LiveSetting<ArrayLike<{
123
+ enabled: boolean;
124
+ changedAt: number;
125
+ }>>;
126
+ sessionContinuation: LiveSetting<ArrayLike<SessionContinuationPreference>>;
127
+ sessionAccounts: LiveSetting<ArrayLike<SessionAccountPreference>>;
128
+ activeAccountId: LiveSetting<string | undefined>;
129
+ followParentModel: LiveSetting<boolean>;
130
+ parentModelFollow: LiveSetting<ArrayLike<ParentModelBinding>>;
131
+ highCostModelIds: LiveSetting<ArrayLike<string>>;
132
+ excludedModelIds: LiveSetting<ArrayLike<string>>;
133
+ searchModel: LiveSetting<string | undefined>;
134
+ searchRouting: LiveSetting<WebSearchRoutingConfig>;
135
+ temporaryRouteBackup: LiveSetting<string | undefined>;
136
+ };
137
+ /** Keep native live references at the boundary; request code consumes plain snapshots. */
138
+ export declare function readInlineConfig(config: LiveInlineConfig): InlineConfig;
139
+ /** Schema of the plugin's settings section. */
140
+ export declare const Config: z<Partial<InlineConfig>, ResolvedInlineConfig>;
141
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** File-content detection shared by the hosted-search preflight. */
2
+ /** Structural signature of Core's recursive file-content helper. */
3
+ export type ContentHasFile = (content: readonly unknown[]) => boolean;
4
+ /**
5
+ * Prefer Core's official recursive predicate when the installed release exports
6
+ * it. The structural fallback retains rc.2/rc.1 compatibility and follows the
7
+ * same `tool-result.content` recursion so file context always fails closed.
8
+ */
9
+ export declare function contentHasFileCompat(content: readonly unknown[], official?: ContentHasFile | undefined): boolean;
10
+ //# sourceMappingURL=content-file.d.ts.map
@@ -0,0 +1,28 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ReactElement } from 'react';
3
+ import type { ContextEvidence } from './context-evidence.ts';
4
+ import type { CompactionContinuationStatus } from './session-continuation-types.ts';
5
+ export declare class ContextIncidentPresentation {
6
+ private dismissed;
7
+ private listeners;
8
+ private version;
9
+ subscribe: (listener: () => void) => () => void;
10
+ snapshot: () => number;
11
+ private key;
12
+ visible(sessionId: string, incident: NonNullable<ContextEvidence['incident']>): boolean;
13
+ dismiss(sessionId: string, incident: NonNullable<ContextEvidence['incident']>): void;
14
+ dispose(): void;
15
+ }
16
+ export declare function ContextEvidenceNotice({ evidence, locale, applicable, compactionStatus, showCompactionResult, controls, sessionId, presentation }: {
17
+ evidence: ContextEvidence | undefined;
18
+ locale?: string;
19
+ applicable?: boolean;
20
+ compactionStatus?: CompactionContinuationStatus;
21
+ showCompactionResult?: boolean;
22
+ controls?: ReactElement | null;
23
+ sessionId?: string;
24
+ presentation?: ContextIncidentPresentation;
25
+ }): ReactElement | null;
26
+ /** Additive disclosure only: native input, context ring and billing remain untouched. */
27
+ export declare function registerContextEvidenceUi(ctx: Context): () => void;
28
+ //# sourceMappingURL=context-evidence-ui.d.ts.map
@@ -0,0 +1,256 @@
1
+ import { z } from 'zod';
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ export declare const COPILOT_CONTEXT_EVIDENCE = "githubCopilotContextEvidence";
4
+ export declare const ContextEvidenceSchema: z.ZodObject<{
5
+ route: z.ZodNullable<z.ZodObject<{
6
+ provider: z.ZodString;
7
+ model: z.ZodString;
8
+ }, z.core.$strict>>;
9
+ sample: z.ZodNullable<z.ZodObject<{
10
+ tokens: z.ZodNumber;
11
+ seq: z.ZodNumber;
12
+ route: z.ZodObject<{
13
+ provider: z.ZodString;
14
+ model: z.ZodString;
15
+ }, z.core.$strict>;
16
+ }, z.core.$strict>>;
17
+ invalid: z.ZodBoolean;
18
+ reason: z.ZodEnum<{
19
+ none: "none";
20
+ compaction: "compaction";
21
+ unknown: "unknown";
22
+ "failed-zero": "failed-zero";
23
+ "invalid-sample": "invalid-sample";
24
+ selection: "selection";
25
+ }>;
26
+ incident: z.ZodNullable<z.ZodObject<{
27
+ kind: z.ZodEnum<{
28
+ "failed-zero": "failed-zero";
29
+ "invalid-sample": "invalid-sample";
30
+ }>;
31
+ seq: z.ZodNumber;
32
+ }, z.core.$strict>>;
33
+ compaction: z.ZodOptional<z.ZodNullable<z.ZodObject<{
34
+ id: z.ZodString;
35
+ startSeq: z.ZodNumber;
36
+ endSeq: z.ZodNullable<z.ZodNumber>;
37
+ state: z.ZodEnum<{
38
+ running: "running";
39
+ unknown: "unknown";
40
+ failed: "failed";
41
+ completed: "completed";
42
+ }>;
43
+ checkpoint: z.ZodBoolean;
44
+ headerSeq: z.ZodNullable<z.ZodNumber>;
45
+ requestRoute: z.ZodNullable<z.ZodObject<{
46
+ provider: z.ZodString;
47
+ model: z.ZodString;
48
+ }, z.core.$strict>>;
49
+ step: z.ZodNullable<z.ZodObject<{
50
+ turn: z.ZodNumber;
51
+ step: z.ZodNumber;
52
+ }, z.core.$strict>>;
53
+ request: z.ZodEnum<{
54
+ unknown: "unknown";
55
+ failed: "failed";
56
+ cancelled: "cancelled";
57
+ pending: "pending";
58
+ idle: "idle";
59
+ succeeded: "succeeded";
60
+ }>;
61
+ }, z.core.$strict>>>;
62
+ activeStep: z.ZodOptional<z.ZodNullable<z.ZodObject<{
63
+ turn: z.ZodNumber;
64
+ step: z.ZodNumber;
65
+ }, z.core.$strict>>>;
66
+ }, z.core.$strict>;
67
+ export type ContextEvidence = z.infer<typeof ContextEvidenceSchema>;
68
+ declare module '@deepseek-ai/dsh-session-projection/types' {
69
+ interface SessionProjectionMap {
70
+ githubCopilotContextEvidence: ContextEvidence;
71
+ }
72
+ interface SessionProjectionStateMap {
73
+ githubCopilotContextEvidence: ContextEvidence;
74
+ }
75
+ }
76
+ export declare function initialContextEvidence(): ContextEvidence;
77
+ /** Read only counts and routing leaves; never message content or opaque replay. */
78
+ export declare function foldContextEvidence(state: ContextEvidence, event: unknown): ContextEvidence;
79
+ /** Separate bounded replay unit; never register under or modify a Core key. */
80
+ export declare const contextEvidenceDefinition: {
81
+ key: "githubCopilotContextEvidence";
82
+ stateVersion: number;
83
+ stateSchema: z.ZodObject<{
84
+ route: z.ZodNullable<z.ZodObject<{
85
+ provider: z.ZodString;
86
+ model: z.ZodString;
87
+ }, z.core.$strict>>;
88
+ sample: z.ZodNullable<z.ZodObject<{
89
+ tokens: z.ZodNumber;
90
+ seq: z.ZodNumber;
91
+ route: z.ZodObject<{
92
+ provider: z.ZodString;
93
+ model: z.ZodString;
94
+ }, z.core.$strict>;
95
+ }, z.core.$strict>>;
96
+ invalid: z.ZodBoolean;
97
+ reason: z.ZodEnum<{
98
+ none: "none";
99
+ compaction: "compaction";
100
+ unknown: "unknown";
101
+ "failed-zero": "failed-zero";
102
+ "invalid-sample": "invalid-sample";
103
+ selection: "selection";
104
+ }>;
105
+ incident: z.ZodNullable<z.ZodObject<{
106
+ kind: z.ZodEnum<{
107
+ "failed-zero": "failed-zero";
108
+ "invalid-sample": "invalid-sample";
109
+ }>;
110
+ seq: z.ZodNumber;
111
+ }, z.core.$strict>>;
112
+ compaction: z.ZodOptional<z.ZodNullable<z.ZodObject<{
113
+ id: z.ZodString;
114
+ startSeq: z.ZodNumber;
115
+ endSeq: z.ZodNullable<z.ZodNumber>;
116
+ state: z.ZodEnum<{
117
+ running: "running";
118
+ unknown: "unknown";
119
+ failed: "failed";
120
+ completed: "completed";
121
+ }>;
122
+ checkpoint: z.ZodBoolean;
123
+ headerSeq: z.ZodNullable<z.ZodNumber>;
124
+ requestRoute: z.ZodNullable<z.ZodObject<{
125
+ provider: z.ZodString;
126
+ model: z.ZodString;
127
+ }, z.core.$strict>>;
128
+ step: z.ZodNullable<z.ZodObject<{
129
+ turn: z.ZodNumber;
130
+ step: z.ZodNumber;
131
+ }, z.core.$strict>>;
132
+ request: z.ZodEnum<{
133
+ unknown: "unknown";
134
+ failed: "failed";
135
+ cancelled: "cancelled";
136
+ pending: "pending";
137
+ idle: "idle";
138
+ succeeded: "succeeded";
139
+ }>;
140
+ }, z.core.$strict>>>;
141
+ activeStep: z.ZodOptional<z.ZodNullable<z.ZodObject<{
142
+ turn: z.ZodNumber;
143
+ step: z.ZodNumber;
144
+ }, z.core.$strict>>>;
145
+ }, z.core.$strict>;
146
+ init: typeof initialContextEvidence;
147
+ apply: typeof foldContextEvidence;
148
+ wire: {
149
+ viewSchema: z.ZodObject<{
150
+ route: z.ZodNullable<z.ZodObject<{
151
+ provider: z.ZodString;
152
+ model: z.ZodString;
153
+ }, z.core.$strict>>;
154
+ sample: z.ZodNullable<z.ZodObject<{
155
+ tokens: z.ZodNumber;
156
+ seq: z.ZodNumber;
157
+ route: z.ZodObject<{
158
+ provider: z.ZodString;
159
+ model: z.ZodString;
160
+ }, z.core.$strict>;
161
+ }, z.core.$strict>>;
162
+ invalid: z.ZodBoolean;
163
+ reason: z.ZodEnum<{
164
+ none: "none";
165
+ compaction: "compaction";
166
+ unknown: "unknown";
167
+ "failed-zero": "failed-zero";
168
+ "invalid-sample": "invalid-sample";
169
+ selection: "selection";
170
+ }>;
171
+ incident: z.ZodNullable<z.ZodObject<{
172
+ kind: z.ZodEnum<{
173
+ "failed-zero": "failed-zero";
174
+ "invalid-sample": "invalid-sample";
175
+ }>;
176
+ seq: z.ZodNumber;
177
+ }, z.core.$strict>>;
178
+ compaction: z.ZodOptional<z.ZodNullable<z.ZodObject<{
179
+ id: z.ZodString;
180
+ startSeq: z.ZodNumber;
181
+ endSeq: z.ZodNullable<z.ZodNumber>;
182
+ state: z.ZodEnum<{
183
+ running: "running";
184
+ unknown: "unknown";
185
+ failed: "failed";
186
+ completed: "completed";
187
+ }>;
188
+ checkpoint: z.ZodBoolean;
189
+ headerSeq: z.ZodNullable<z.ZodNumber>;
190
+ requestRoute: z.ZodNullable<z.ZodObject<{
191
+ provider: z.ZodString;
192
+ model: z.ZodString;
193
+ }, z.core.$strict>>;
194
+ step: z.ZodNullable<z.ZodObject<{
195
+ turn: z.ZodNumber;
196
+ step: z.ZodNumber;
197
+ }, z.core.$strict>>;
198
+ request: z.ZodEnum<{
199
+ unknown: "unknown";
200
+ failed: "failed";
201
+ cancelled: "cancelled";
202
+ pending: "pending";
203
+ idle: "idle";
204
+ succeeded: "succeeded";
205
+ }>;
206
+ }, z.core.$strict>>>;
207
+ activeStep: z.ZodOptional<z.ZodNullable<z.ZodObject<{
208
+ turn: z.ZodNumber;
209
+ step: z.ZodNumber;
210
+ }, z.core.$strict>>>;
211
+ }, z.core.$strict>;
212
+ view: (state: ContextEvidence) => {
213
+ route: {
214
+ provider: string;
215
+ model: string;
216
+ } | null;
217
+ sample: {
218
+ tokens: number;
219
+ seq: number;
220
+ route: {
221
+ provider: string;
222
+ model: string;
223
+ };
224
+ } | null;
225
+ invalid: boolean;
226
+ reason: "none" | "compaction" | "unknown" | "failed-zero" | "invalid-sample" | "selection";
227
+ incident: {
228
+ kind: "failed-zero" | "invalid-sample";
229
+ seq: number;
230
+ } | null;
231
+ compaction?: {
232
+ id: string;
233
+ startSeq: number;
234
+ endSeq: number | null;
235
+ state: "running" | "unknown" | "failed" | "completed";
236
+ checkpoint: boolean;
237
+ headerSeq: number | null;
238
+ requestRoute: {
239
+ provider: string;
240
+ model: string;
241
+ } | null;
242
+ step: {
243
+ turn: number;
244
+ step: number;
245
+ } | null;
246
+ request: "unknown" | "failed" | "cancelled" | "pending" | "idle" | "succeeded";
247
+ } | null | undefined;
248
+ activeStep?: {
249
+ turn: number;
250
+ step: number;
251
+ } | null | undefined;
252
+ };
253
+ };
254
+ };
255
+ export declare function installContextEvidence(ctx: Context): void;
256
+ //# sourceMappingURL=context-evidence.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { TokenUsage } from '@deepseek-ai/dsh-llm';
2
+ /** All observed counters are zero, not proof that an attempted prompt was empty. */
3
+ export declare function isZeroContextUsage(usage: TokenUsage): boolean;
4
+ //# sourceMappingURL=context-usage.d.ts.map
@@ -0,0 +1,7 @@
1
+ /** Invalidation only: account data and credentials never travel between surfaces. */
2
+ export declare const accountPresentationChanges: {
3
+ pending: () => boolean;
4
+ subscribe(listener: () => void): () => void;
5
+ begin(): () => void;
6
+ };
7
+ //# sourceMappingURL=copilot-account-presentation.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { CopilotAccountsView } from './copilot-accounts-types.ts';
3
+ type AccountResult = {
4
+ ok: true;
5
+ value: CopilotAccountsView;
6
+ } | {
7
+ ok: false;
8
+ error: unknown;
9
+ };
10
+ export interface CopilotAccountsRemote {
11
+ get(): Promise<AccountResult>;
12
+ refreshIdentity(): Promise<AccountResult>;
13
+ ensureIdentity(): Promise<AccountResult>;
14
+ add(): Promise<AccountResult>;
15
+ cancel(): Promise<AccountResult>;
16
+ switchAccount(accountId: string, expectedRevision: number): Promise<AccountResult>;
17
+ reauthorize(accountId: string, expectedRevision: number): Promise<AccountResult>;
18
+ removeAccount(accountId: string, expectedRevision: number): Promise<AccountResult>;
19
+ }
20
+ export type CopilotAccountAddRemote = Pick<CopilotAccountsRemote, 'get' | 'add' | 'cancel'>;
21
+ export declare function CopilotAccountAdd(props: {
22
+ remote?: CopilotAccountAddRemote;
23
+ onChanged?: () => void;
24
+ locale?: string;
25
+ }): ReactElement;
26
+ /** Copy owned presentation fields before decoding traced Client values. */
27
+ export declare function accountsViewFrom(value: unknown): CopilotAccountsView | undefined;
28
+ export declare function accountIdentityLabel(view: CopilotAccountsView | undefined): string | undefined;
29
+ interface AccountControlsProps {
30
+ expanded: boolean;
31
+ refreshKey?: number;
32
+ onChanged?: () => void;
33
+ authorizationBusy?: boolean;
34
+ configured?: boolean;
35
+ accountSettings?: ReactElement;
36
+ continuationSettings?: ReactElement;
37
+ locale?: string;
38
+ }
39
+ export declare function CopilotAccountsPanel(props: AccountControlsProps & {
40
+ remote?: CopilotAccountsRemote;
41
+ }): ReactElement;
42
+ export {};
43
+ //# sourceMappingURL=copilot-accounts-card.d.ts.map
@@ -0,0 +1,93 @@
1
+ import { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import type { CopilotAccountBinding, CopilotAccountIdentity, CopilotAccountLease, CopilotAccountsDiagnostic, CopilotAccountsView } from './copilot-accounts-types.ts';
4
+ interface Dependencies {
5
+ fetch?: typeof globalThis.fetch;
6
+ validateModels?: (binding: CopilotAccountBinding, signal: AbortSignal) => Promise<void>;
7
+ routeDiagnostic?: () => CopilotAccountsDiagnostic | undefined;
8
+ }
9
+ export declare function isCopilotAccountRecord(key: string): boolean;
10
+ /** Account membership is credential metadata; only the selector lives in Settings. */
11
+ export declare class CopilotAccountsHost {
12
+ private readonly ctx;
13
+ private readonly dependencies;
14
+ private generation;
15
+ private selectionSignature;
16
+ private disposed;
17
+ private readonly leases;
18
+ private readonly accountLeases;
19
+ private readonly identities;
20
+ private readonly unavailableIdentities;
21
+ private readonly identityFlights;
22
+ private readonly identityFailures;
23
+ private readonly listeners;
24
+ private readonly abort;
25
+ private operation;
26
+ private attemptKey;
27
+ private authorizationAbort;
28
+ private notices;
29
+ private lastFailure;
30
+ constructor(ctx: Context, dependencies?: Dependencies);
31
+ private settings;
32
+ private selection;
33
+ private revoke;
34
+ selectionChanged(): void;
35
+ isActiveRecord(key: string): boolean;
36
+ credentialChanged(key: string): void;
37
+ private invalidateIdentity;
38
+ onChanged(listener: () => void): () => void;
39
+ cachedIdentity(accountId: string): CopilotAccountIdentity | undefined;
40
+ capture(accountId?: string): CopilotAccountBinding;
41
+ /** A frozen turn owns a record, not the mutable profile default. */
42
+ captureAccount(accountId: string): CopilotAccountBinding;
43
+ validateAccount(binding: CopilotAccountBinding): Promise<void>;
44
+ acquire(signal?: AbortSignal, requireManaged?: boolean, accountId?: string): CopilotAccountLease;
45
+ acquireCanonicalAuthorization(): CopilotAccountLease;
46
+ private routeDiagnostic;
47
+ private busy;
48
+ private membership;
49
+ get(): Promise<CopilotAccountsView>;
50
+ private accountView;
51
+ private identity;
52
+ private fetchIdentity;
53
+ private fetchIdentityResponse;
54
+ refreshIdentity(): Promise<CopilotAccountsView>;
55
+ ensureIdentity(): Promise<CopilotAccountsView>;
56
+ viewForAccount(accountId: string): Promise<CopilotAccountsView>;
57
+ refreshIdentityFor(accountId: string): Promise<CopilotAccountsView>;
58
+ ensureIdentityFor(accountId: string): Promise<CopilotAccountsView>;
59
+ ensureAccountNamesFor(accountId: string): Promise<CopilotAccountsView>;
60
+ private readIdentity;
61
+ private readIdentityObserved;
62
+ private validateModels;
63
+ private assertIdentityCurrent;
64
+ switchAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
65
+ add(): Promise<CopilotAccountsView>;
66
+ reauthorize(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
67
+ authorize(accountId: string, expectedRevision?: number): Promise<CopilotAccountsView>;
68
+ cancel(): Promise<CopilotAccountsView>;
69
+ remove(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
70
+ signOutActive(): Promise<void>;
71
+ dispose(): void;
72
+ }
73
+ declare module '@deepseek-ai/cordis' {
74
+ interface Context {
75
+ githubCopilotAccounts: GitHubCopilotAccountsController;
76
+ }
77
+ }
78
+ export declare function activeCopilotBinding(ctx: Context): CopilotAccountBinding | undefined;
79
+ export declare function isActiveCopilotRecord(ctx: Context, key: string): boolean;
80
+ export default class GitHubCopilotAccountsController extends TypertRemoteService {
81
+ readonly host: CopilotAccountsHost;
82
+ constructor(ctx: Context);
83
+ get(): Promise<CopilotAccountsView>;
84
+ refreshIdentity(): Promise<CopilotAccountsView>;
85
+ ensureIdentity(): Promise<CopilotAccountsView>;
86
+ add(): Promise<CopilotAccountsView>;
87
+ cancel(): Promise<CopilotAccountsView>;
88
+ reauthorize(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
89
+ switchAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
90
+ removeAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
91
+ }
92
+ export {};
93
+ //# sourceMappingURL=copilot-accounts-host.d.ts.map