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,22 @@
1
+ import type { CSSProperties, ReactElement, RefObject } from 'react';
2
+ export interface AccountDropdownOption {
3
+ id: string;
4
+ label: string;
5
+ selected: boolean;
6
+ disabled?: boolean;
7
+ }
8
+ export declare function AccountDropdown(props: {
9
+ label: string;
10
+ open: boolean;
11
+ disabled?: boolean;
12
+ busy?: boolean;
13
+ options: AccountDropdownOption[];
14
+ onOpenChange(open: boolean): void;
15
+ onSelect(id: string): void;
16
+ triggerStyle: CSSProperties;
17
+ triggerRef?: RefObject<HTMLButtonElement | null>;
18
+ footer?: ReactElement | null;
19
+ listAttribute: 'data-copilot-saved-accounts' | 'data-copilot-account-options';
20
+ maxHeight?: number;
21
+ }): ReactElement;
22
+ //# sourceMappingURL=account-dropdown.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { CredentialStore } from '@earendil-works/pi-ai';
2
+ import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
3
+ import type { AccountModelSourceDependencies } from './account-model-source.ts';
4
+ /** Native getAuth renews within five minutes; reserve another thirty seconds for metadata preparation. */
5
+ export declare const ACCOUNT_MODEL_AUTH_MIN_VALIDITY_MS: number;
6
+ /** An opaque, process-local account key. Never a substitute for request credentials. */
7
+ export declare function copilotAccountKey(grant: GitHubCopilotOAuthCredential): string;
8
+ /** Compare normalized permission snapshots without retaining model credentials. */
9
+ export declare function copilotEntitlementKey(grant: Pick<GitHubCopilotOAuthCredential, 'availableModelIds'>): string;
10
+ /**
11
+ * Bind model discovery to the existing native OAuth lifecycle. No model catalog,
12
+ * login, environment fallback or separate credential record is introduced here.
13
+ */
14
+ export declare function createAccountModelAuth(credentials: CredentialStore | (() => CredentialStore), renewRejectedCredential?: (grant: GitHubCopilotOAuthCredential) => boolean): Pick<AccountModelSourceDependencies, 'resolveAuth' | 'assertAuthCurrent'>;
15
+ //# sourceMappingURL=account-model-auth.d.ts.map
@@ -0,0 +1,70 @@
1
+ /** Pure normalization of account /models metadata; no transport, credentials, or model-name rules. */
2
+ export declare const ACCOUNT_MODEL_CATALOG_LIMITS: Readonly<{
3
+ maxBytes: number;
4
+ maxModels: 512;
5
+ maxIdLength: 200;
6
+ maxNameLength: 256;
7
+ maxEndpoints: 16;
8
+ maxEndpointLength: 128;
9
+ maxEfforts: 32;
10
+ maxEffortLength: 64;
11
+ maxMediaTypes: 32;
12
+ }>;
13
+ export type AccountModelApi = 'anthropic-messages' | 'openai-responses' | 'openai-completions';
14
+ export type AccountModelHttpEndpoint = '/v1/messages' | '/responses' | '/chat/completions';
15
+ export type AccountModelCategory = 'powerful' | 'versatile' | 'lightweight';
16
+ type RecognizedEndpoint = AccountModelHttpEndpoint | 'ws:/responses';
17
+ /** Advertised data only; consumers must not turn unfamiliar labels into supported Core controls. */
18
+ export interface AccountModelReasoning {
19
+ readonly advertisedEfforts: readonly string[];
20
+ readonly unmappedEfforts: readonly string[];
21
+ readonly adaptiveThinking?: boolean;
22
+ readonly minThinkingBudget?: number;
23
+ readonly maxThinkingBudget?: number;
24
+ }
25
+ export interface AccountModelDescriptor {
26
+ readonly id: string;
27
+ readonly name: string;
28
+ readonly api: AccountModelApi;
29
+ readonly contextWindow: number;
30
+ /** Independent server prompt limit; absence is not replaced with the context window. */
31
+ readonly maxInputTokens?: number;
32
+ readonly maxTokens: number;
33
+ readonly input: readonly ('text' | 'image')[];
34
+ readonly category?: AccountModelCategory;
35
+ readonly reasoning: AccountModelReasoning;
36
+ readonly evidence: {
37
+ /** Recognized endpoint literals only, never arbitrary URLs or query strings. */
38
+ readonly endpoints: readonly RecognizedEndpoint[];
39
+ readonly unsupportedEndpointCount: number;
40
+ readonly selectedEndpoint: AccountModelHttpEndpoint;
41
+ readonly apiSource: 'advertised-native' | 'advertised-priority';
42
+ readonly policySource: 'server-enabled' | 'account-available-id';
43
+ readonly contextWindowSource: 'max_context_window_tokens' | 'max_prompt_tokens';
44
+ readonly visionMediaTypes?: readonly string[];
45
+ readonly categoryDiagnostic?: 'missing' | 'unknown' | 'invalid';
46
+ };
47
+ }
48
+ export interface AccountModelRejection {
49
+ readonly id?: string;
50
+ readonly code: string;
51
+ }
52
+ export interface AccountModelCatalog {
53
+ readonly models: readonly AccountModelDescriptor[];
54
+ readonly rejected: readonly AccountModelRejection[];
55
+ }
56
+ export interface AccountModelCatalogOptions {
57
+ readonly nativeApis?: ReadonlyMap<string, string>;
58
+ /** Proof supplied by the account-bound caller; used only when policy is absent. */
59
+ readonly availableModelIds?: ReadonlySet<string>;
60
+ }
61
+ /**
62
+ * Normalize an account-bound /models response without model-name inference.
63
+ * JSON text is byte-bounded before parsing. Already-parsed objects have a
64
+ * bounded known-field work budget; unknown fields are deliberately not visited,
65
+ * so callers accepting objects must also bound the original transport body.
66
+ * Returned candidates do not replace request-time OAuth/account checks.
67
+ */
68
+ export declare function normalizeAccountModelCatalog(raw: unknown, options?: AccountModelCatalogOptions): AccountModelCatalog;
69
+ export {};
70
+ //# sourceMappingURL=account-model-catalog.d.ts.map
@@ -0,0 +1,85 @@
1
+ import type { AccountModelCatalog } from './account-model-catalog.ts';
2
+ /** Transient native OAuth result. Only accountKey is permitted in a published snapshot. */
3
+ export interface AccountModelAuth {
4
+ readonly apiKey: string;
5
+ /** Already trust-validated by the native credential owner; this source additionally requires an HTTPS root. */
6
+ readonly baseURL: string;
7
+ readonly accountKey: string;
8
+ readonly availableModelIds?: readonly string[] | ReadonlySet<string>;
9
+ }
10
+ export interface AccountModelSourceDependencies {
11
+ resolveAuth(signal: AbortSignal): Promise<AccountModelAuth>;
12
+ /** Must reject if the account/token is no longer current. This callback must not perform OAuth refresh. */
13
+ assertAuthCurrent(auth: AccountModelAuth, signal: AbortSignal): void | Promise<void>;
14
+ fetch?: typeof globalThis.fetch;
15
+ /** Public static request headers only; credential/routing/framing headers are refused. */
16
+ headers?: Readonly<Record<string, string>>;
17
+ nativeApis?: ReadonlyMap<string, string>;
18
+ now?: () => number;
19
+ ttlMs?: number | (() => number);
20
+ /** Failure backoff for non-force discovery only; never a background retry timer. */
21
+ failureCooldownMs?: number | (() => number);
22
+ timeoutMs?: number;
23
+ }
24
+ export interface AccountModelSnapshot extends AccountModelCatalog {
25
+ readonly accountKey: string;
26
+ readonly fetchedAt: number;
27
+ readonly generation: number;
28
+ }
29
+ export interface AccountModelSourceView {
30
+ readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'error' | 'disposed';
31
+ readonly generation: number;
32
+ readonly modelCount: number;
33
+ readonly rejectedCount: number;
34
+ readonly fetchedAt?: number;
35
+ readonly error?: AccountModelSourceErrorCode;
36
+ }
37
+ export interface AccountModelLoadOptions {
38
+ readonly force?: boolean;
39
+ readonly signal?: AbortSignal;
40
+ }
41
+ declare const codes: readonly ["COPILOT_MODEL_SOURCE_INVALID_CONFIG", "COPILOT_MODEL_SOURCE_INVALID_AUTH", "COPILOT_MODEL_SOURCE_AUTH_FAILED", "COPILOT_MODEL_SOURCE_AUTH_CHANGED", "COPILOT_MODEL_SOURCE_FETCH_FAILED", "COPILOT_MODEL_SOURCE_HTTP_ERROR", "COPILOT_MODEL_SOURCE_REDIRECTED_RESPONSE", "COPILOT_MODEL_SOURCE_BODY_FAILED", "COPILOT_MODEL_SOURCE_RESPONSE_TOO_LARGE", "COPILOT_MODEL_SOURCE_INVALID_RESPONSE", "COPILOT_MODEL_SOURCE_INVALID_CATALOG", "COPILOT_MODEL_SOURCE_INVALIDATED", "COPILOT_MODEL_SOURCE_ABORTED", "COPILOT_MODEL_SOURCE_TIMEOUT", "COPILOT_MODEL_SOURCE_DISPOSED"];
42
+ export type AccountModelSourceErrorCode = typeof codes[number];
43
+ export declare class AccountModelSourceError extends Error {
44
+ readonly code: AccountModelSourceErrorCode;
45
+ constructor(code: AccountModelSourceErrorCode);
46
+ }
47
+ /**
48
+ * Lazy account metadata, not model-call authorization. The owner must invalidate
49
+ * on credential/account changes and validate the account again before model wire.
50
+ * Cache reads do not refresh OAuth or claim authority over a separate Core catalog.
51
+ */
52
+ export declare class AccountModelSource {
53
+ private readonly dependencies;
54
+ private readonly timeoutMs;
55
+ private readonly now;
56
+ private readonly fetch;
57
+ private readonly headers;
58
+ private readonly nativeApis;
59
+ private generation;
60
+ private disposed;
61
+ private cache;
62
+ private flight;
63
+ private failure;
64
+ private failedAt;
65
+ private readonly operations;
66
+ constructor(dependencies: AccountModelSourceDependencies);
67
+ private cacheDuration;
68
+ /** Display only: TTL expiry is allowed, but invalidation and clock guards still apply.
69
+ * The owner must additionally validate its account/token/entitlement proof before display. */
70
+ readDisplaySnapshot(): AccountModelSnapshot | undefined;
71
+ readSnapshot(): AccountModelSnapshot | undefined;
72
+ getView(): AccountModelSourceView;
73
+ load(options?: AccountModelLoadOptions): Promise<AccountModelSnapshot>;
74
+ /** Revoke definitively rejected metadata and back off passive reuse/recovery. */
75
+ rejectSnapshot(snapshot: AccountModelSnapshot): boolean;
76
+ invalidate(): void;
77
+ dispose(): void;
78
+ private start;
79
+ private current;
80
+ private validateCurrent;
81
+ private perform;
82
+ }
83
+ export declare function createAccountModelSource(dependencies: AccountModelSourceDependencies): AccountModelSource;
84
+ export {};
85
+ //# sourceMappingURL=account-model-source.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { Agent } from '@deepseek-ai/dsh-agent';
2
+ /** Resolve the owning preset's service without reaching into Core's service registry. */
3
+ export declare function agentCompaction(agent: Agent): unknown;
4
+ //# sourceMappingURL=agent-compaction.d.ts.map
@@ -0,0 +1,4 @@
1
+ type ClipboardWriter = Pick<Clipboard, 'writeText'>;
2
+ export declare function copyAuthorizationCode(code: string, clipboard?: ClipboardWriter): Promise<void>;
3
+ export {};
4
+ //# sourceMappingURL=authorization-code-clipboard.d.ts.map
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Host-side bridge between the Models-page companion UI and DSH's neutral
3
+ * authorization, credential-record, and settings seams.
4
+ */
5
+ import { Context } from '@deepseek-ai/cordis';
6
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
7
+ import { type GitHubCopilotMigrationStatus } from './migration-status.ts';
8
+ export { GITHUB_COPILOT_CREDENTIAL_KEY, GITHUB_COPILOT_PROVIDER_ID } from './copilot-identity.ts';
9
+ export declare const LLM_PI_AI_SETTINGS_NAMESPACE = "llm-pi-ai";
10
+ export type GitHubCopilotModelCatalogState = 'current' | 'partially-outdated' | 'outdated';
11
+ export interface GitHubCopilotModelCatalogView {
12
+ readonly state: GitHubCopilotModelCatalogState;
13
+ readonly accountModelCount: number;
14
+ readonly supportedModelCount: number;
15
+ readonly unknownModelIds: readonly string[];
16
+ readonly temporarilyUnavailableModelIds?: readonly string[];
17
+ /** Exact models served by the plugin-owned route, not canonical Core metadata. */
18
+ readonly previewModelIds?: readonly string[];
19
+ }
20
+ export interface GitHubCopilotProviderProfileResult {
21
+ readonly changed: boolean;
22
+ /** Legacy result field retained for consumers; canonical repair does not project a catalog. */
23
+ readonly catalog?: GitHubCopilotModelCatalogView;
24
+ }
25
+ export interface AuthorizationNoticeView {
26
+ readonly message: string;
27
+ readonly url?: string;
28
+ readonly code?: string;
29
+ }
30
+ export type GitHubCopilotAuthorizationPhase = 'signed-out' | 'authorizing' | 'signed-in' | 'error';
31
+ export interface GitHubCopilotRouteView {
32
+ /** Legacy canonical configuration only; intentional absence is not an OAuth or managed-route failure. */
33
+ readonly state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict' | 'error';
34
+ readonly diagnosticCode?: 'ROUTE_READ_FAILED' | 'RECONCILIATION_FAILED' | 'ROUTE_CONFLICT';
35
+ }
36
+ export interface GitHubCopilotAccountModelsView {
37
+ readonly state: 'idle' | 'loading' | 'ready' | 'stale' | 'error' | 'disposed' | 'unconfigured' | 'unavailable';
38
+ readonly models: readonly {
39
+ readonly id: string;
40
+ readonly name: string;
41
+ readonly api: string;
42
+ }[];
43
+ readonly rejected: readonly {
44
+ readonly id?: string;
45
+ readonly code: string;
46
+ }[];
47
+ readonly warnings?: readonly {
48
+ readonly id: string;
49
+ readonly code: string;
50
+ }[];
51
+ readonly discoveredAt?: number;
52
+ readonly error?: string;
53
+ }
54
+ export interface GitHubCopilotModelPreferencesView {
55
+ readonly state: 'ready' | 'error';
56
+ readonly writable: boolean;
57
+ readonly revision?: number;
58
+ readonly excludedModelIds: readonly string[];
59
+ readonly lockedModelIds: readonly string[];
60
+ readonly unavailableExcludedModelIds: readonly string[];
61
+ readonly highCostModelIds?: readonly string[];
62
+ readonly error?: 'COPILOT_MODEL_PREFERENCES_UNAVAILABLE' | 'COPILOT_MODEL_EXCLUSION_SELECTED' | 'COPILOT_MODEL_EXCLUSION_CONFLICT' | 'COPILOT_MODEL_EXCLUSION_SAVE_FAILED' | 'COPILOT_MODEL_SETTINGS_UNAVAILABLE' | 'COPILOT_MODEL_SETTINGS_INVALID' | 'COPILOT_MODEL_SELECTION_UNAVAILABLE';
63
+ }
64
+ export interface GitHubCopilotAuthorizationView {
65
+ readonly phase: GitHubCopilotAuthorizationPhase;
66
+ readonly configured: boolean;
67
+ readonly writable: boolean;
68
+ readonly inFlight: boolean;
69
+ readonly notices: readonly AuthorizationNoticeView[];
70
+ readonly catalog?: GitHubCopilotModelCatalogView;
71
+ readonly route?: GitHubCopilotRouteView;
72
+ readonly accountModels?: GitHubCopilotAccountModelsView;
73
+ readonly modelPreferences?: GitHubCopilotModelPreferencesView;
74
+ readonly error?: string;
75
+ /** Latest fixed interaction milestone observed during a failed or active attempt; never a failure cause. */
76
+ readonly authorizationMilestone?: GitHubCopilotAuthorizationMilestone;
77
+ }
78
+ export type GitHubCopilotAuthorizationMilestone = 'AUTHORIZATION_REQUESTED' | 'INTERACTION_PROMPT_OBSERVED' | 'INTERACTION_NOTICE_OBSERVED';
79
+ /** Read-only legacy configuration planning; not-configured permits managed-only use and never requests creation. */
80
+ export declare function describeGitHubCopilotProviderProfile(ctx: Context): Promise<{
81
+ state: 'ready' | 'needs-repair' | 'not-configured' | 'conflict';
82
+ catalog?: GitHubCopilotModelCatalogView;
83
+ }>;
84
+ export declare function inspectGitHubCopilotProviderProfile(ctx: Context): Promise<GitHubCopilotProviderProfileResult>;
85
+ export declare function ensureGitHubCopilotProviderProfile(ctx: Context): Promise<boolean>;
86
+ /**
87
+ * Remote owner for the browser companion. No credential payload crosses this
88
+ * service: status uses record descriptions, sign-in delegates to the
89
+ * registered llm-pi-ai flow, and sign-out asks the credential seam to delete
90
+ * only llm-pi-ai's Copilot record.
91
+ */
92
+ export declare class GitHubCopilotAuthorizationController extends TypertRemoteService {
93
+ private notices;
94
+ private failure;
95
+ private reconciliationFailed;
96
+ private attempt;
97
+ private authorizationMilestone;
98
+ private modelPreferenceFailure;
99
+ constructor(ctx: Context);
100
+ /** No-argument Ops evidence; deliberately independent of ordinary account status. */
101
+ migrationStatus(): GitHubCopilotMigrationStatus;
102
+ status(): Promise<GitHubCopilotAuthorizationView>;
103
+ excludeModel(modelId: string): Promise<GitHubCopilotAuthorizationView>;
104
+ restoreModel(modelId: string): Promise<GitHubCopilotAuthorizationView>;
105
+ setModelExcluded(modelId: string, excluded: boolean): Promise<GitHubCopilotModelPreferencesView>;
106
+ setModelHighCost(modelId: string, highCost: boolean): Promise<GitHubCopilotModelPreferencesView>;
107
+ /** Explicit model discovery: may refresh OAuth and GET the account catalog, never changes selection. */
108
+ discoverModels(): Promise<GitHubCopilotAuthorizationView>;
109
+ /** Ensure metadata for a visible account view, honoring shared cache and failure cooldown. */
110
+ ensureModels(): Promise<GitHubCopilotAuthorizationView>;
111
+ private loadAccountModels;
112
+ /** Explicit route repair over the stored account snapshot; never forces OAuth or a network probe. */
113
+ reconcile(): Promise<GitHubCopilotAuthorizationView>;
114
+ start(): Promise<GitHubCopilotAuthorizationView>;
115
+ cancel(): Promise<GitHubCopilotAuthorizationView>;
116
+ signOut(): Promise<GitHubCopilotAuthorizationView>;
117
+ private updateModelExclusion;
118
+ private ensureProviderProfile;
119
+ }
120
+ export default GitHubCopilotAuthorizationController;
121
+ //# sourceMappingURL=authorization-controller.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { ReactElement } from 'react';
2
+ export declare function AutoAllocationCard({ read, locale }: {
3
+ readonly read: () => Promise<{
4
+ ok: boolean;
5
+ value?: unknown;
6
+ }>;
7
+ readonly locale: string;
8
+ }): ReactElement;
9
+ //# sourceMappingURL=auto-allocation-card.d.ts.map
@@ -0,0 +1,126 @@
1
+ import { z } from 'zod';
2
+ import type { AutoSelectionExplanation } from './auto-model-routing.ts';
3
+ export declare const AUTO_ALLOCATION_DIAGNOSTIC_MAX_ROWS = 1024;
4
+ export declare const AUTO_ALLOCATION_DIAGNOSTIC_RETENTION_MS: number;
5
+ export declare const AutoAllocationDiagnosticsSchema: z.ZodObject<{
6
+ status: z.ZodEnum<{
7
+ observed: "observed";
8
+ "not-collected": "not-collected";
9
+ }>;
10
+ rows: z.ZodArray<z.ZodObject<{
11
+ day: z.ZodNumber;
12
+ version: z.ZodString;
13
+ policyVersion: z.ZodString;
14
+ modelId: z.ZodString;
15
+ targetCategory: z.ZodEnum<{
16
+ powerful: "powerful";
17
+ versatile: "versatile";
18
+ lightweight: "lightweight";
19
+ }>;
20
+ category: z.ZodEnum<{
21
+ unknown: "unknown";
22
+ powerful: "powerful";
23
+ versatile: "versatile";
24
+ lightweight: "lightweight";
25
+ }>;
26
+ demand: z.ZodEnum<{
27
+ unknown: "unknown";
28
+ simple: "simple";
29
+ routine: "routine";
30
+ complex: "complex";
31
+ }>;
32
+ assessmentSource: z.ZodEnum<{
33
+ local: "local";
34
+ semantic: "semantic";
35
+ }>;
36
+ assessmentOutcome: z.ZodOptional<z.ZodEnum<{
37
+ disabled: "disabled";
38
+ unavailable: "unavailable";
39
+ "context-omitted": "context-omitted";
40
+ "invalid-result": "invalid-result";
41
+ timeout: "timeout";
42
+ failed: "failed";
43
+ "local-known": "local-known";
44
+ "local-unknown": "local-unknown";
45
+ "semantic-known": "semantic-known";
46
+ "semantic-unknown": "semantic-unknown";
47
+ }>>;
48
+ method: z.ZodEnum<{
49
+ "weighted-distribution": "weighted-distribution";
50
+ "only-candidate": "only-candidate";
51
+ }>;
52
+ fallback: z.ZodBoolean;
53
+ highCost: z.ZodBoolean;
54
+ previous: z.ZodBoolean;
55
+ weight: z.ZodNumber;
56
+ opportunities: z.ZodNumber;
57
+ expectedSelections: z.ZodNumber;
58
+ selections: z.ZodNumber;
59
+ }, z.core.$strict>>;
60
+ noFitRows: z.ZodArray<z.ZodObject<{
61
+ day: z.ZodNumber;
62
+ version: z.ZodString;
63
+ policyVersion: z.ZodString;
64
+ targetCategory: z.ZodEnum<{
65
+ powerful: "powerful";
66
+ versatile: "versatile";
67
+ lightweight: "lightweight";
68
+ }>;
69
+ category: z.ZodEnum<{
70
+ unknown: "unknown";
71
+ powerful: "powerful";
72
+ versatile: "versatile";
73
+ lightweight: "lightweight";
74
+ }>;
75
+ demand: z.ZodEnum<{
76
+ unknown: "unknown";
77
+ simple: "simple";
78
+ routine: "routine";
79
+ complex: "complex";
80
+ }>;
81
+ assessmentSource: z.ZodEnum<{
82
+ local: "local";
83
+ semantic: "semantic";
84
+ }>;
85
+ assessmentOutcome: z.ZodOptional<z.ZodEnum<{
86
+ disabled: "disabled";
87
+ unavailable: "unavailable";
88
+ "context-omitted": "context-omitted";
89
+ "invalid-result": "invalid-result";
90
+ timeout: "timeout";
91
+ failed: "failed";
92
+ "local-known": "local-known";
93
+ "local-unknown": "local-unknown";
94
+ "semantic-known": "semantic-known";
95
+ "semantic-unknown": "semantic-unknown";
96
+ }>>;
97
+ decisions: z.ZodNumber;
98
+ }, z.core.$strict>>;
99
+ observationStart: z.ZodNullable<z.ZodNumber>;
100
+ observationEnd: z.ZodNullable<z.ZodNumber>;
101
+ completeHistory: z.ZodLiteral<false>;
102
+ rowsTruncated: z.ZodBoolean;
103
+ dropped: z.ZodNumber;
104
+ expired: z.ZodNumber;
105
+ saturated: z.ZodNumber;
106
+ restarts: z.ZodNumber;
107
+ }, z.core.$strict>;
108
+ export type AutoAllocationDiagnostics = z.infer<typeof AutoAllocationDiagnosticsSchema>;
109
+ export declare function emptyAutoAllocationDiagnostics(): AutoAllocationDiagnostics;
110
+ /** Profile-local rolling aggregates; no per-turn, Session, prompt, or execution-outcome records. */
111
+ export declare class AutoAllocationDiagnosticsCollector {
112
+ private readonly version;
113
+ private readonly changed;
114
+ private readonly wall;
115
+ private data;
116
+ private enabled;
117
+ constructor(version: string, changed?: () => void, wall?: () => number);
118
+ restore(value: unknown, countRestart?: boolean): void;
119
+ setEnabled(enabled: boolean): void;
120
+ clear(): void;
121
+ record(explanation: AutoSelectionExplanation): void;
122
+ snapshot(): AutoAllocationDiagnostics;
123
+ private expire;
124
+ private add;
125
+ }
126
+ //# sourceMappingURL=auto-allocation-diagnostics.d.ts.map
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ import type { AutoSelectionExplanation } from './auto-model-routing.ts';
3
+ export declare const AutoAllocationSummarySchema: z.ZodObject<{
4
+ policyVersion: z.ZodEnum<{
5
+ "high-cost-v1": "high-cost-v1";
6
+ "high-cost-v2": "high-cost-v2";
7
+ "high-cost-v3": "high-cost-v3";
8
+ "high-cost-v4": "high-cost-v4";
9
+ }>;
10
+ scope: z.ZodLiteral<"viewed-session-host-lifetime">;
11
+ status: z.ZodEnum<{
12
+ observed: "observed";
13
+ "not-collected": "not-collected";
14
+ }>;
15
+ retainedDecisions: z.ZodNumber;
16
+ noFitDecisions: z.ZodNumber;
17
+ omittedPolicyDecisions: z.ZodOptional<z.ZodNumber>;
18
+ rowsTruncated: z.ZodBoolean;
19
+ completeHistory: z.ZodLiteral<false>;
20
+ observationStart: z.ZodNullable<z.ZodNumber>;
21
+ observationEnd: z.ZodNullable<z.ZodNumber>;
22
+ rows: z.ZodArray<z.ZodObject<{
23
+ modelId: z.ZodString;
24
+ category: z.ZodEnum<{
25
+ unknown: "unknown";
26
+ powerful: "powerful";
27
+ versatile: "versatile";
28
+ lightweight: "lightweight";
29
+ }>;
30
+ highCost: z.ZodBoolean;
31
+ previous: z.ZodBoolean;
32
+ weight: z.ZodNumber;
33
+ opportunities: z.ZodNumber;
34
+ expectedSelections: z.ZodNumber;
35
+ selections: z.ZodNumber;
36
+ }, z.core.$strict>>;
37
+ }, z.core.$strict>;
38
+ export type AutoAllocationSummary = z.infer<typeof AutoAllocationSummarySchema>;
39
+ /** Recompute only from captured bounded decisions, never today's settings or history content. */
40
+ export declare function summarizeAutoAllocations(explanations: readonly AutoSelectionExplanation[], window?: {
41
+ readonly start: number;
42
+ readonly end: number;
43
+ }): AutoAllocationSummary;
44
+ //# sourceMappingURL=auto-allocation-evidence.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ export declare const AUTO_ALLOCATION_POLICIES: readonly ["high-cost-v1", "high-cost-v2", "high-cost-v3", "high-cost-v4"];
3
+ export declare const AUTO_ALLOCATION_POLICY = "high-cost-v4";
4
+ declare const categories: readonly ["powerful", "versatile", "lightweight", "unknown"];
5
+ type Category = typeof categories[number];
6
+ export declare function autoCategoryWeight(category: Category, target: Exclude<Category, 'unknown'>): number;
7
+ export declare const AutoAllocationSchema: z.ZodObject<{
8
+ policyVersion: z.ZodEnum<{
9
+ "high-cost-v1": "high-cost-v1";
10
+ "high-cost-v2": "high-cost-v2";
11
+ "high-cost-v3": "high-cost-v3";
12
+ "high-cost-v4": "high-cost-v4";
13
+ }>;
14
+ targetCategory: z.ZodOptional<z.ZodEnum<{
15
+ powerful: "powerful";
16
+ versatile: "versatile";
17
+ lightweight: "lightweight";
18
+ }>>;
19
+ deferredHighCostCount: z.ZodOptional<z.ZodNumber>;
20
+ selectedModelId: z.ZodString;
21
+ candidates: z.ZodArray<z.ZodObject<{
22
+ modelId: z.ZodString;
23
+ category: z.ZodOptional<z.ZodEnum<{
24
+ unknown: "unknown";
25
+ powerful: "powerful";
26
+ versatile: "versatile";
27
+ lightweight: "lightweight";
28
+ }>>;
29
+ categoryWeight: z.ZodOptional<z.ZodNumber>;
30
+ highCost: z.ZodBoolean;
31
+ previous: z.ZodBoolean;
32
+ weight: z.ZodNumber;
33
+ expectedShare: z.ZodNumber;
34
+ }, z.core.$strict>>;
35
+ }, z.core.$strict>;
36
+ type AllocationValue = z.infer<typeof AutoAllocationSchema>;
37
+ export type AutoAllocation = Readonly<Omit<AllocationValue, 'candidates'>> & {
38
+ readonly candidates: readonly Readonly<AllocationValue['candidates'][number]>[];
39
+ };
40
+ export declare function normalizeHighCostModelIds(value: unknown): readonly string[];
41
+ /** Integer policy units avoid cumulative decimal drift; avalanche sequential turn seeds. */
42
+ export declare function allocateAutoModel(pool: readonly {
43
+ readonly id: string;
44
+ readonly category?: Exclude<Category, 'unknown'>;
45
+ }[], highCostModelIds: unknown, previousModelId: string | undefined, seed: number, targetCategory?: Exclude<Category, 'unknown'>): AutoAllocation;
46
+ export {};
47
+ //# sourceMappingURL=auto-allocation.d.ts.map
@@ -0,0 +1,111 @@
1
+ import { z } from 'zod';
2
+ export declare const AssessmentProjectionSchema: z.ZodObject<{
3
+ retainedMessages: z.ZodNumber;
4
+ historyOmitted: z.ZodBoolean;
5
+ taskTextLimited: z.ZodBoolean;
6
+ continuationAnchor: z.ZodEnum<{
7
+ missing: "missing";
8
+ "not-needed": "not-needed";
9
+ retained: "retained";
10
+ }>;
11
+ }, z.core.$strict>;
12
+ export type AssessmentProjection = Readonly<z.infer<typeof AssessmentProjectionSchema>>;
13
+ export declare const ClassifierRejectionSchema: z.ZodEnum<{
14
+ input: "input";
15
+ category: "category";
16
+ excluded: "excluded";
17
+ "configured-id": "configured-id";
18
+ "reasoning-disable-unproven": "reasoning-disable-unproven";
19
+ budget: "budget";
20
+ }>;
21
+ export type ClassifierRejection = z.infer<typeof ClassifierRejectionSchema>;
22
+ export declare const SemanticAssessmentEvidenceSchema: z.ZodObject<{
23
+ modelId: z.ZodOptional<z.ZodString>;
24
+ budgetMs: z.ZodNumber;
25
+ elapsedMs: z.ZodNumber;
26
+ stage: z.ZodEnum<{
27
+ preparing: "preparing";
28
+ "model-selected": "model-selected";
29
+ "adapter-started": "adapter-started";
30
+ "text-received": "text-received";
31
+ finished: "finished";
32
+ }>;
33
+ adapterStartedMs: z.ZodOptional<z.ZodNumber>;
34
+ firstTextMs: z.ZodOptional<z.ZodNumber>;
35
+ nativeFinish: z.ZodOptional<z.ZodEnum<{
36
+ stop: "stop";
37
+ "non-stop": "non-stop";
38
+ }>>;
39
+ outputCharacters: z.ZodNumber;
40
+ validation: z.ZodEnum<{
41
+ invalid: "invalid";
42
+ "not-validated": "not-validated";
43
+ valid: "valid";
44
+ "context-omitted": "context-omitted";
45
+ }>;
46
+ candidateScan: z.ZodOptional<z.ZodObject<{
47
+ candidates: z.ZodNumber;
48
+ eligible: z.ZodNumber;
49
+ rejected: z.ZodRecord<z.ZodEnum<{
50
+ input: "input";
51
+ category: "category";
52
+ excluded: "excluded";
53
+ "configured-id": "configured-id";
54
+ "reasoning-disable-unproven": "reasoning-disable-unproven";
55
+ budget: "budget";
56
+ }> & z.core.$partial, z.ZodNumber>;
57
+ }, z.core.$strict>>;
58
+ preparationFailure: z.ZodOptional<z.ZodEnum<{
59
+ "native-off-unavailable": "native-off-unavailable";
60
+ }>>;
61
+ projection: z.ZodOptional<z.ZodObject<{
62
+ retainedMessages: z.ZodNumber;
63
+ historyOmitted: z.ZodBoolean;
64
+ taskTextLimited: z.ZodBoolean;
65
+ continuationAnchor: z.ZodEnum<{
66
+ missing: "missing";
67
+ "not-needed": "not-needed";
68
+ retained: "retained";
69
+ }>;
70
+ }, z.core.$strict>>;
71
+ classifierDemand: z.ZodOptional<z.ZodEnum<{
72
+ unknown: "unknown";
73
+ simple: "simple";
74
+ routine: "routine";
75
+ complex: "complex";
76
+ }>>;
77
+ }, z.core.$strict>;
78
+ export type SemanticAssessmentEvidence = Readonly<z.infer<typeof SemanticAssessmentEvidenceSchema>>;
79
+ export type TaskClassifierObservation = {
80
+ readonly stage: 'context-projection';
81
+ readonly projection: AssessmentProjection;
82
+ } | {
83
+ readonly stage: 'classified';
84
+ readonly demand: NonNullable<SemanticAssessmentEvidence['classifierDemand']>;
85
+ } | {
86
+ readonly stage: 'candidate-scan';
87
+ readonly candidates: number;
88
+ readonly eligible: number;
89
+ readonly rejected: Partial<Record<ClassifierRejection, number>>;
90
+ } | {
91
+ readonly stage: 'preparation-failed';
92
+ readonly reason: 'native-off-unavailable';
93
+ } | {
94
+ readonly stage: 'model-selected';
95
+ readonly modelId: string;
96
+ } | {
97
+ readonly stage: 'adapter-started';
98
+ } | {
99
+ readonly stage: 'text';
100
+ readonly characters: number;
101
+ } | {
102
+ readonly stage: 'finished';
103
+ readonly stopped: boolean;
104
+ };
105
+ export type TaskClassifierObserver = (observation: TaskClassifierObservation) => void;
106
+ /** Request-local milestones, not wire/upload timings, model health or token accounting. */
107
+ export declare function assessmentEvidence(budgetMs: number): {
108
+ observe: TaskClassifierObserver;
109
+ finish(validation: SemanticAssessmentEvidence['validation']): SemanticAssessmentEvidence;
110
+ };
111
+ //# sourceMappingURL=auto-assessment-evidence.d.ts.map