dsh-github-copilot 0.4.0-alpha.99 → 0.4.0

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 (109) hide show
  1. package/AGENTS.md +96 -16
  2. package/CHANGELOG.md +211 -0
  3. package/CONTRIBUTING.md +9 -0
  4. package/README.md +106 -18
  5. package/README.zh.md +97 -18
  6. package/deployment-baseline.json +227 -8
  7. package/docs/account-management-experience.md +143 -0
  8. package/docs/auto-high-cost.md +154 -0
  9. package/docs/auto-iteration-review.json +22 -0
  10. package/docs/auto-review-sampling.md +60 -0
  11. package/docs/auto-task-routing.md +8 -6
  12. package/docs/automatic-model-routing.md +33 -5
  13. package/docs/copilot-accounts.md +376 -0
  14. package/docs/copilot-compaction.md +23 -2
  15. package/docs/copilot-usage.md +24 -4
  16. package/docs/evidence-driven-iteration.md +86 -0
  17. package/docs/images/copilot-accounts-credits.png +0 -0
  18. package/docs/images/copilot-accounts.png +0 -0
  19. package/docs/images/copilot-current-provenance.json +39 -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/copilot-session-continuation.png +0 -0
  23. package/docs/manual-compaction-recovery.md +50 -7
  24. package/docs/mockups/copilot-account-dropdown.html +71 -0
  25. package/docs/mockups/copilot-account-management.html +393 -0
  26. package/docs/model-compatibility-acceptance.md +34 -16
  27. package/docs/official-first-020-rc2.md +1 -0
  28. package/docs/plugin-diagnostics.md +452 -0
  29. package/docs/session-continuation.md +141 -0
  30. package/docs/session-search-routing.md +1 -1
  31. package/docs/single-route-migration.md +5 -4
  32. package/lib/client.js +4415 -846
  33. package/lib/client.js.map +1 -1
  34. package/lib/diagnostics-analysis-io.js +78 -0
  35. package/lib/diagnostics-analysis.js +425 -0
  36. package/lib/diagnostics-types-FVf6zjob.js +182 -0
  37. package/lib/index.js +10356 -6020
  38. package/lib/manual-compaction-recovery.js +163 -38
  39. package/lib/remote.js +593 -34
  40. package/lib/routed-web.js +1 -1
  41. package/lib/{search-routing-jzNYveyK.js → search-routing-CV2hs8as.js} +139 -139
  42. package/lib/types/account-dropdown.d.ts +22 -0
  43. package/lib/types/account-model-auth.d.ts +1 -1
  44. package/lib/types/authorization-code-clipboard.d.ts +4 -0
  45. package/lib/types/authorization-controller.d.ts +2 -0
  46. package/lib/types/auto-allocation-card.d.ts +9 -0
  47. package/lib/types/auto-allocation-evidence.d.ts +38 -0
  48. package/lib/types/auto-allocation.d.ts +24 -0
  49. package/lib/types/auto-model-host.d.ts +2 -0
  50. package/lib/types/auto-model-routing.d.ts +6 -2
  51. package/lib/types/auto-review-sampling.d.ts +6 -0
  52. package/lib/types/auto-task-classifier.d.ts +1 -1
  53. package/lib/types/background-compaction.d.ts +2 -2
  54. package/lib/types/client.d.ts +19 -3
  55. package/lib/types/compaction-continuation-ui.d.ts +29 -0
  56. package/lib/types/compaction-continuation.d.ts +48 -0
  57. package/lib/types/compaction-input-estimate.d.ts +24 -0
  58. package/lib/types/compaction-replay.d.ts +18 -0
  59. package/lib/types/composer-notice-style.d.ts +7 -0
  60. package/lib/types/config.d.ts +42 -2
  61. package/lib/types/context-evidence-ui.d.ts +18 -1
  62. package/lib/types/context-evidence.d.ts +152 -4
  63. package/lib/types/copilot-account-presentation.d.ts +7 -0
  64. package/lib/types/copilot-accounts-card.d.ts +43 -0
  65. package/lib/types/copilot-accounts-host.d.ts +93 -0
  66. package/lib/types/copilot-accounts-remote.d.ts +85 -0
  67. package/lib/types/copilot-accounts-types.d.ts +43 -0
  68. package/lib/types/copilot-auth.d.ts +3 -1
  69. package/lib/types/copilot-usage-card.d.ts +23 -0
  70. package/lib/types/copilot-usage-host.d.ts +9 -1
  71. package/lib/types/copilot-usage-remote.d.ts +2 -1
  72. package/lib/types/copilot-usage-types.d.ts +1 -0
  73. package/lib/types/diagnostics-analysis-io.d.ts +23 -0
  74. package/lib/types/diagnostics-analysis.d.ts +295 -0
  75. package/lib/types/diagnostics-card.d.ts +11 -0
  76. package/lib/types/diagnostics-client.d.ts +13 -0
  77. package/lib/types/diagnostics-collector.d.ts +36 -0
  78. package/lib/types/diagnostics-host.d.ts +72 -0
  79. package/lib/types/diagnostics-remote.d.ts +109 -0
  80. package/lib/types/diagnostics-types.d.ts +431 -0
  81. package/lib/types/manual-compaction-recovery.d.ts +18 -3
  82. package/lib/types/model-preferences-card.d.ts +1 -1
  83. package/lib/types/native-settings-style.d.ts +10 -0
  84. package/lib/types/parent-model-follow-card.d.ts +2 -11
  85. package/lib/types/preview-provider.d.ts +4 -0
  86. package/lib/types/preview-route.d.ts +7 -5
  87. package/lib/types/remote.d.ts +9 -6
  88. package/lib/types/replay-recovery-host.d.ts +2 -2
  89. package/lib/types/replay-recovery-ui.d.ts +3 -1
  90. package/lib/types/request-body-evidence.d.ts +3 -1
  91. package/lib/types/responses-replay-compat.d.ts +2 -1
  92. package/lib/types/responses-request-compression.d.ts +33 -0
  93. package/lib/types/session-accounts-controller.d.ts +20 -0
  94. package/lib/types/session-accounts-host.d.ts +33 -0
  95. package/lib/types/session-accounts-remote.d.ts +114 -0
  96. package/lib/types/session-accounts.d.ts +38 -0
  97. package/lib/types/session-continuation-host.d.ts +45 -0
  98. package/lib/types/session-continuation-remote.d.ts +22 -0
  99. package/lib/types/session-continuation-types.d.ts +62 -0
  100. package/lib/types/session-continuation-ui.d.ts +49 -0
  101. package/lib/types/session-continuation.d.ts +14 -0
  102. package/lib/types/turn-request-models.d.ts +55 -0
  103. package/lib/types/turn-selection-card.d.ts +15 -1
  104. package/lib/types/turn-selection-host.d.ts +23 -0
  105. package/lib/types/turn-selection-remote.d.ts +4 -0
  106. package/lib/types/turn-selection.d.ts +19 -4
  107. package/package.json +19 -3
  108. package/scripts/analyze-diagnostics.mjs +91 -0
  109. package/scripts/iteration-review.mjs +53 -0
@@ -0,0 +1,48 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { Agent } from '@deepseek-ai/dsh-agent';
3
+ import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
4
+ import type { CompactionContinuationLifecycle } from './session-continuation-types.ts';
5
+ declare module '@deepseek-ai/dsh-session-projection/types' {
6
+ interface SessionProjectionMap {
7
+ githubCopilotCompactionLifecycle: CompactionContinuationLifecycle;
8
+ }
9
+ interface SessionProjectionStateMap {
10
+ githubCopilotCompactionLifecycle: CompactionContinuationLifecycle;
11
+ }
12
+ }
13
+ export declare const compactionContinuationDefinition: {
14
+ key: "githubCopilotCompactionLifecycle";
15
+ stateVersion: number;
16
+ stateSchema: import("zod").ZodObject<{
17
+ id: import("zod").ZodNullable<import("zod").ZodString>;
18
+ running: import("zod").ZodBoolean;
19
+ }, import("zod/v4/core").$strict>;
20
+ init: () => CompactionContinuationLifecycle;
21
+ apply(state: NoInfer<{
22
+ id: string | null;
23
+ running: boolean;
24
+ }>, event: import("@deepseek-ai/dsh-session").SessionEvent): {
25
+ id: string | null;
26
+ running: boolean;
27
+ };
28
+ wire: {
29
+ viewSchema: import("zod").ZodObject<{
30
+ id: import("zod").ZodNullable<import("zod").ZodString>;
31
+ running: import("zod").ZodBoolean;
32
+ }, import("zod/v4/core").$strict>;
33
+ view: (state: CompactionContinuationLifecycle) => {
34
+ id: string | null;
35
+ running: boolean;
36
+ };
37
+ };
38
+ };
39
+ /** Native brackets authorize scope, never loss; the existing Session policy authorizes loss. */
40
+ export declare function installCompactionContinuation(ctx: Context, enabled: (agent: Agent) => boolean): {
41
+ status(agent: Agent): {
42
+ id: string;
43
+ state: "running" | "cancelled" | "failed" | "completed" | "blocked";
44
+ } | undefined;
45
+ prepare(request: GenerateOptions): ((payload: unknown) => Promise<unknown>) | undefined;
46
+ dispose(): void;
47
+ };
48
+ //# sourceMappingURL=compaction-continuation.d.ts.map
@@ -0,0 +1,24 @@
1
+ import type { Message, ToolSchema } from '@deepseek-ai/dsh-llm';
2
+ interface CompactionPlanningMessage {
3
+ readonly role: string;
4
+ readonly content: readonly {
5
+ readonly type: string;
6
+ readonly id?: string;
7
+ }[];
8
+ readonly toolCallId?: string;
9
+ }
10
+ export declare function compactionSafeBoundaries(messages: readonly CompactionPlanningMessage[]): readonly number[];
11
+ /**
12
+ * Conservative content-byte planning, not provider-exact token accounting.
13
+ * Native admission still checks converted replay, images and the full request.
14
+ */
15
+ export declare function estimateCompactionInputBytes(input: {
16
+ readonly messages: readonly Message[];
17
+ readonly tools?: readonly ToolSchema[];
18
+ }): number;
19
+ export declare function reduceCompactionInputLimit(input: {
20
+ readonly messages: readonly Message[];
21
+ readonly tools?: readonly ToolSchema[];
22
+ }, inputLimit: number): number;
23
+ export {};
24
+ //# sourceMappingURL=compaction-input-estimate.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
3
+ import type { SessionId } from '@deepseek-ai/dsh-session';
4
+ declare module '@deepseek-ai/cordis' {
5
+ interface Context {
6
+ githubCopilotCompactionReplay: CompactionReplayRecovery;
7
+ }
8
+ }
9
+ /** Explicit manual consent lasts only for the native summarizer hook's exact signal. */
10
+ export declare class CompactionReplayRecovery {
11
+ private readonly operations;
12
+ private closed;
13
+ run<T>(sessionId: SessionId, model: string, signal: AbortSignal, operation: () => Promise<T>): Promise<T>;
14
+ prepare(request: GenerateOptions): ((payload: unknown) => Promise<unknown>) | undefined;
15
+ dispose(): void;
16
+ }
17
+ export declare function installCompactionReplay(ctx: Context): CompactionReplayRecovery;
18
+ //# sourceMappingURL=compaction-replay.d.ts.map
@@ -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
@@ -8,8 +8,12 @@ import type { RequestBudgetPolicy } from './request-budget.ts';
8
8
  import type { WebSearchRoutingConfig } from './web-search-routing-config.ts';
9
9
  import type { LiveSetting } from './settings-reader.ts';
10
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';
11
13
  /** Plugin configuration. Defaults make the current chat route decide. */
12
14
  export interface InlineConfig {
15
+ /** Opt-in local aggregate diagnostics; no uploads or scheduled analysis. */
16
+ diagnosticsEnabled?: boolean;
13
17
  /** Hosted-search switch; managed chat requests remain enabled. */
14
18
  enabled: boolean;
15
19
  /**
@@ -29,6 +33,10 @@ export interface InlineConfig {
29
33
  chatStreamLiveness?: boolean;
30
34
  /** Native request image projection budget; changing it can offload older images. */
31
35
  chatMaxRequestImageBytes?: number;
36
+ /** Default-off lossless gzip for eligible managed Responses HTTP requests. */
37
+ responsesRequestCompression?: boolean;
38
+ /** Default-off override omitting temperature from all managed Responses requests. */
39
+ responsesOmitTemperature?: boolean;
32
40
  /** Verify the endpoint executes native search before serving. */
33
41
  probe: boolean;
34
42
  /** Bound on one probe request, in milliseconds. */
@@ -39,12 +47,26 @@ export interface InlineConfig {
39
47
  accountModelFailureCooldownMs?: number;
40
48
  /** Exact account model IDs hidden from the managed directory and every Auto candidate pool. */
41
49
  excludedModelIds?: string[];
50
+ /** User-marked costly IDs; reduced positive Auto weight, independent of category. */
51
+ highCostModelIds?: string[];
52
+ /** Opaque profile-wide account selector; absence retains canonical compatibility. */
53
+ activeAccountId?: string;
54
+ /** Explicit Session overrides; absence means follow the profile default. */
55
+ sessionAccounts?: SessionAccountPreference[];
56
+ /** Explicit lossy continuation consent for exact Sessions, never inherited. */
57
+ sessionContinuation?: SessionContinuationPreference[];
58
+ continuationDefaultHistory?: {
59
+ enabled: boolean;
60
+ changedAt: number;
61
+ }[];
42
62
  /** Explicit native child/direct-parent enrollments; empty preserves native routing. */
43
63
  parentModelFollow?: ParentModelBinding[];
44
64
  /** Profile-wide next-turn policy for supported native children. */
45
65
  followParentModel?: boolean;
46
66
  /** Default-on bounded task assessment; explicit false opts out of auxiliary inference. */
47
67
  autoSemanticAssessment?: boolean;
68
+ /** Capture bounded local candidate opportunities for future policy review. */
69
+ autoAllocationEvidence?: boolean;
48
70
  /** Estimated managed-route input headroom, separate from truthful catalog capacities. */
49
71
  requestBudgetSafetyTokens?: number;
50
72
  /** Fraction of admissible input used by eligible automatic-compaction requests. */
@@ -62,17 +84,35 @@ export interface InlineConfig {
62
84
  /** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
63
85
  temporaryRouteBackup?: string;
64
86
  }
65
- export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'> & {
87
+ export type LiveInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
88
+ continuationDefaultHistory?: InlineConfig['continuationDefaultHistory'] | LiveSetting<ArrayLike<{
89
+ enabled: boolean;
90
+ changedAt: number;
91
+ }>>;
92
+ sessionContinuation?: SessionContinuationPreference[] | LiveSetting<ArrayLike<SessionContinuationPreference>>;
93
+ sessionAccounts?: SessionAccountPreference[] | LiveSetting<ArrayLike<SessionAccountPreference>>;
94
+ diagnosticsEnabled?: boolean | LiveSetting<boolean>;
95
+ activeAccountId?: string | LiveSetting<string | undefined>;
66
96
  followParentModel?: boolean | LiveSetting<boolean>;
67
97
  parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
98
+ highCostModelIds?: string[] | LiveSetting<ArrayLike<string>>;
68
99
  excludedModelIds?: string[] | LiveSetting<ArrayLike<string>>;
69
100
  searchModel?: string | LiveSetting<string | undefined>;
70
101
  searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
71
102
  temporaryRouteBackup?: string | LiveSetting<string | undefined>;
72
103
  };
73
- export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'> & {
104
+ export type ResolvedInlineConfig = Omit<InlineConfig, 'diagnosticsEnabled' | 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'highCostModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId' | 'sessionAccounts' | 'sessionContinuation' | 'continuationDefaultHistory'> & {
105
+ diagnosticsEnabled: LiveSetting<boolean>;
106
+ continuationDefaultHistory: LiveSetting<ArrayLike<{
107
+ enabled: boolean;
108
+ changedAt: number;
109
+ }>>;
110
+ sessionContinuation: LiveSetting<ArrayLike<SessionContinuationPreference>>;
111
+ sessionAccounts: LiveSetting<ArrayLike<SessionAccountPreference>>;
112
+ activeAccountId: LiveSetting<string | undefined>;
74
113
  followParentModel: LiveSetting<boolean>;
75
114
  parentModelFollow: LiveSetting<ArrayLike<ParentModelBinding>>;
115
+ highCostModelIds: LiveSetting<ArrayLike<string>>;
76
116
  excludedModelIds: LiveSetting<ArrayLike<string>>;
77
117
  searchModel: LiveSetting<string | undefined>;
78
118
  searchRouting: LiveSetting<WebSearchRoutingConfig>;
@@ -1,10 +1,27 @@
1
1
  import type { Context } from '@deepseek-ai/cordis';
2
2
  import type { ReactElement } from 'react';
3
3
  import type { ContextEvidence } from './context-evidence.ts';
4
- export declare function ContextEvidenceNotice({ evidence, locale, applicable }: {
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 }: {
5
17
  evidence: ContextEvidence | undefined;
6
18
  locale?: string;
7
19
  applicable?: boolean;
20
+ compactionStatus?: CompactionContinuationStatus;
21
+ showCompactionResult?: boolean;
22
+ controls?: ReactElement | null;
23
+ sessionId?: string;
24
+ presentation?: ContextIncidentPresentation;
8
25
  }): ReactElement | null;
9
26
  /** Additive disclosure only: native input, context ring and billing remain untouched. */
10
27
  export declare function registerContextEvidenceUi(ctx: Context): () => void;
@@ -19,9 +19,50 @@ export declare const ContextEvidenceSchema: z.ZodObject<{
19
19
  none: "none";
20
20
  compaction: "compaction";
21
21
  unknown: "unknown";
22
- selection: "selection";
23
22
  "failed-zero": "failed-zero";
23
+ "invalid-sample": "invalid-sample";
24
+ selection: "selection";
24
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
+ cancelled: "cancelled";
56
+ failed: "failed";
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>>>;
25
66
  }, z.core.$strict>;
26
67
  export type ContextEvidence = z.infer<typeof ContextEvidenceSchema>;
27
68
  declare module '@deepseek-ai/dsh-session-projection/types' {
@@ -57,9 +98,50 @@ export declare const contextEvidenceDefinition: {
57
98
  none: "none";
58
99
  compaction: "compaction";
59
100
  unknown: "unknown";
60
- selection: "selection";
61
101
  "failed-zero": "failed-zero";
102
+ "invalid-sample": "invalid-sample";
103
+ selection: "selection";
62
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
+ cancelled: "cancelled";
135
+ failed: "failed";
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>>>;
63
145
  }, z.core.$strict>;
64
146
  init: typeof initialContextEvidence;
65
147
  apply: typeof foldContextEvidence;
@@ -82,9 +164,50 @@ export declare const contextEvidenceDefinition: {
82
164
  none: "none";
83
165
  compaction: "compaction";
84
166
  unknown: "unknown";
85
- selection: "selection";
86
167
  "failed-zero": "failed-zero";
168
+ "invalid-sample": "invalid-sample";
169
+ selection: "selection";
87
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
+ cancelled: "cancelled";
201
+ failed: "failed";
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>>>;
88
211
  }, z.core.$strict>;
89
212
  view: (state: ContextEvidence) => {
90
213
  route: {
@@ -100,7 +223,32 @@ export declare const contextEvidenceDefinition: {
100
223
  };
101
224
  } | null;
102
225
  invalid: boolean;
103
- reason: "none" | "compaction" | "unknown" | "selection" | "failed-zero";
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" | "cancelled" | "failed" | "pending" | "idle" | "succeeded";
247
+ } | null | undefined;
248
+ activeStep?: {
249
+ turn: number;
250
+ step: number;
251
+ } | null | undefined;
104
252
  };
105
253
  };
106
254
  };
@@ -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
@@ -0,0 +1,85 @@
1
+ import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
2
+ import { z } from 'zod';
3
+ import type { CopilotAccountsView } from './copilot-accounts-types.ts';
4
+ export type { CopilotAccountsView, CopilotAccountIdentity, CopilotAccountView } from './copilot-accounts-types.ts';
5
+ declare module '@deepseek-ai/dsh-typert-protocol' {
6
+ interface TypertRemoteNamespaceMap {
7
+ githubCopilotAccounts: {
8
+ get(): Promise<RemoteResult<CopilotAccountsView>>;
9
+ refreshIdentity(): Promise<RemoteResult<CopilotAccountsView>>;
10
+ ensureIdentity(): Promise<RemoteResult<CopilotAccountsView>>;
11
+ add(): Promise<RemoteResult<CopilotAccountsView>>;
12
+ cancel(): Promise<RemoteResult<CopilotAccountsView>>;
13
+ reauthorize(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
14
+ switchAccount(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
15
+ removeAccount(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
16
+ };
17
+ }
18
+ }
19
+ export declare const CopilotAccountIdSchema: z.ZodString;
20
+ export declare const CopilotAccountsViewSchema: z.ZodObject<{
21
+ state: z.ZodEnum<{
22
+ error: "error";
23
+ ready: "ready";
24
+ }>;
25
+ activeAccountId: z.ZodString;
26
+ revision: z.ZodOptional<z.ZodNumber>;
27
+ writable: z.ZodBoolean;
28
+ switchable: z.ZodBoolean;
29
+ accounts: z.ZodArray<z.ZodObject<{
30
+ id: z.ZodString;
31
+ configured: z.ZodBoolean;
32
+ identityState: z.ZodEnum<{
33
+ ready: "ready";
34
+ unavailable: "unavailable";
35
+ unknown: "unknown";
36
+ }>;
37
+ identity: z.ZodOptional<z.ZodObject<{
38
+ login: z.ZodString;
39
+ userId: z.ZodNumber;
40
+ }, z.core.$strict>>;
41
+ }, z.core.$strict>>;
42
+ operation: z.ZodOptional<z.ZodEnum<{
43
+ authorizing: "authorizing";
44
+ verifying: "verifying";
45
+ switching: "switching";
46
+ }>>;
47
+ notices: z.ZodArray<z.ZodObject<{
48
+ message: z.ZodString;
49
+ url: z.ZodOptional<z.ZodLiteral<"https://github.com/login/device">>;
50
+ code: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strict>>;
52
+ diagnostic: z.ZodOptional<z.ZodEnum<{
53
+ COPILOT_ACCOUNTS_SELECTOR_INVALID: "COPILOT_ACCOUNTS_SELECTOR_INVALID";
54
+ COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE: "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE";
55
+ COPILOT_ACCOUNTS_SELECTED_MISSING: "COPILOT_ACCOUNTS_SELECTED_MISSING";
56
+ COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE: "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE";
57
+ COPILOT_ACCOUNTS_CHANGED: "COPILOT_ACCOUNTS_CHANGED";
58
+ COPILOT_ACCOUNTS_BUSY: "COPILOT_ACCOUNTS_BUSY";
59
+ COPILOT_ACCOUNTS_CONFLICT: "COPILOT_ACCOUNTS_CONFLICT";
60
+ COPILOT_ACCOUNTS_COMMIT_UNCERTAIN: "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN";
61
+ COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
62
+ COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
63
+ COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
64
+ COPILOT_ACCOUNTS_IDENTITY_TIMEOUT: "COPILOT_ACCOUNTS_IDENTITY_TIMEOUT";
65
+ COPILOT_ACCOUNTS_IDENTITY_TLS: "COPILOT_ACCOUNTS_IDENTITY_TLS";
66
+ COPILOT_ACCOUNTS_IDENTITY_NETWORK: "COPILOT_ACCOUNTS_IDENTITY_NETWORK";
67
+ COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED: "COPILOT_ACCOUNTS_IDENTITY_AUTH_REJECTED";
68
+ COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED: "COPILOT_ACCOUNTS_IDENTITY_RATE_LIMITED";
69
+ COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR: "COPILOT_ACCOUNTS_IDENTITY_HTTP_ERROR";
70
+ COPILOT_ACCOUNTS_IDENTITY_CHANGED: "COPILOT_ACCOUNTS_IDENTITY_CHANGED";
71
+ COPILOT_ACCOUNTS_DUPLICATE: "COPILOT_ACCOUNTS_DUPLICATE";
72
+ COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED: "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED";
73
+ COPILOT_ACCOUNTS_ROUTE_BLOCKED: "COPILOT_ACCOUNTS_ROUTE_BLOCKED";
74
+ COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE: "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE";
75
+ COPILOT_ACCOUNTS_LIMIT: "COPILOT_ACCOUNTS_LIMIT";
76
+ COPILOT_ACCOUNTS_AUTH_FAILED: "COPILOT_ACCOUNTS_AUTH_FAILED";
77
+ COPILOT_ACCOUNTS_AUTH_UNAVAILABLE: "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE";
78
+ COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED: "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED";
79
+ COPILOT_ACCOUNTS_REMOVE_FAILED: "COPILOT_ACCOUNTS_REMOVE_FAILED";
80
+ COPILOT_ACCOUNTS_DISPOSED: "COPILOT_ACCOUNTS_DISPOSED";
81
+ }>>;
82
+ }, z.core.$strict>;
83
+ declare const contribution: TypertRemoteContribution;
84
+ export default contribution;
85
+ //# sourceMappingURL=copilot-accounts-remote.d.ts.map