dsh-github-copilot 0.4.0-alpha.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/AGENTS.md +312 -0
  2. package/CHANGELOG.md +479 -0
  3. package/CONTRIBUTING.md +46 -0
  4. package/LICENSE +21 -0
  5. package/README.md +203 -0
  6. package/README.zh.md +202 -0
  7. package/SECURITY.md +29 -0
  8. package/cordis.patch.yml +16 -0
  9. package/deployment-baseline.json +1299 -0
  10. package/docs/agent-readiness.md +110 -0
  11. package/docs/auto-task-routing.md +234 -0
  12. package/docs/automatic-model-routing.md +205 -0
  13. package/docs/copilot-accounts.md +236 -0
  14. package/docs/copilot-compaction.md +120 -0
  15. package/docs/copilot-usage.md +125 -0
  16. package/docs/dual-model.md +66 -0
  17. package/docs/image-input-compatibility.md +64 -0
  18. package/docs/images/copilot-accounts-credits.png +0 -0
  19. package/docs/images/copilot-accounts.png +0 -0
  20. package/docs/images/copilot-model-preferences.png +0 -0
  21. package/docs/images/copilot-search-routing.png +0 -0
  22. package/docs/images/dual-model-desktop.png +0 -0
  23. package/docs/images/dual-model-mobile.png +0 -0
  24. package/docs/images/dual-model-provenance.json +35 -0
  25. package/docs/images/parent-model-follow.png +0 -0
  26. package/docs/manual-compaction-recovery.md +64 -0
  27. package/docs/model-compatibility-acceptance.md +164 -0
  28. package/docs/npm-distribution.md +149 -0
  29. package/docs/official-first-016-alpha2.md +66 -0
  30. package/docs/official-first-020-rc1.md +32 -0
  31. package/docs/official-first-020-rc2.md +16 -0
  32. package/docs/session-search-routing.md +133 -0
  33. package/docs/single-route-migration.md +130 -0
  34. package/docs/web-lifecycle-rc2.md +55 -0
  35. package/lib/client.js +10822 -0
  36. package/lib/client.js.map +1 -0
  37. package/lib/copilot-identity-DRZY_d2X.js +15 -0
  38. package/lib/index.js +11689 -0
  39. package/lib/manual-compaction-recovery.js +315 -0
  40. package/lib/remote.js +734 -0
  41. package/lib/request-budget-DLY_aRq0.js +87 -0
  42. package/lib/routed-web.js +120 -0
  43. package/lib/search-routing-CqysPLve.js +792 -0
  44. package/lib/types/account-model-auth.d.ts +15 -0
  45. package/lib/types/account-model-catalog.d.ts +70 -0
  46. package/lib/types/account-model-source.d.ts +85 -0
  47. package/lib/types/agent-compaction.d.ts +4 -0
  48. package/lib/types/authorization-controller.d.ts +119 -0
  49. package/lib/types/auto-assessment-evidence.d.ts +46 -0
  50. package/lib/types/auto-model-host.d.ts +27 -0
  51. package/lib/types/auto-model-intent.d.ts +36 -0
  52. package/lib/types/auto-model-presentation.d.ts +57 -0
  53. package/lib/types/auto-model-routing.d.ts +59 -0
  54. package/lib/types/auto-selection-explanation.d.ts +9 -0
  55. package/lib/types/auto-task-assessment.d.ts +47 -0
  56. package/lib/types/auto-task-classifier.d.ts +9 -0
  57. package/lib/types/background-compaction.d.ts +30 -0
  58. package/lib/types/client.d.ts +115 -0
  59. package/lib/types/compact-account.d.ts +42 -0
  60. package/lib/types/compaction-pressure.d.ts +23 -0
  61. package/lib/types/compatibility.d.ts +17 -0
  62. package/lib/types/config.d.ts +89 -0
  63. package/lib/types/content-file.d.ts +10 -0
  64. package/lib/types/context-evidence-ui.d.ts +11 -0
  65. package/lib/types/context-evidence.d.ts +108 -0
  66. package/lib/types/context-usage.d.ts +4 -0
  67. package/lib/types/copilot-account-presentation.d.ts +7 -0
  68. package/lib/types/copilot-accounts-card.d.ts +30 -0
  69. package/lib/types/copilot-accounts-host.d.ts +75 -0
  70. package/lib/types/copilot-accounts-remote.d.ts +77 -0
  71. package/lib/types/copilot-accounts-types.d.ts +42 -0
  72. package/lib/types/copilot-auth.d.ts +25 -0
  73. package/lib/types/copilot-grant.d.ts +11 -0
  74. package/lib/types/copilot-identity.d.ts +11 -0
  75. package/lib/types/copilot-request.d.ts +11 -0
  76. package/lib/types/copilot-stream-liveness.d.ts +23 -0
  77. package/lib/types/copilot-usage-card.d.ts +30 -0
  78. package/lib/types/copilot-usage-host.d.ts +58 -0
  79. package/lib/types/copilot-usage-normalize.d.ts +9 -0
  80. package/lib/types/copilot-usage-remote.d.ts +63 -0
  81. package/lib/types/copilot-usage-types.d.ts +20 -0
  82. package/lib/types/copilot-usage-ui.d.ts +4 -0
  83. package/lib/types/current-provider.d.ts +59 -0
  84. package/lib/types/deepseek-search-fallback.d.ts +11 -0
  85. package/lib/types/dual-model-host.d.ts +119 -0
  86. package/lib/types/dual-model-remote.d.ts +63 -0
  87. package/lib/types/dual-model-types.d.ts +34 -0
  88. package/lib/types/external-link.d.ts +3 -0
  89. package/lib/types/failure.d.ts +38 -0
  90. package/lib/types/http.d.ts +48 -0
  91. package/lib/types/image-input-admission.d.ts +5 -0
  92. package/lib/types/index.d.ts +39 -0
  93. package/lib/types/manual-compaction-recovery.d.ts +52 -0
  94. package/lib/types/migration-status.d.ts +50 -0
  95. package/lib/types/model-exclusions.d.ts +15 -0
  96. package/lib/types/model-preferences-card.d.ts +9 -0
  97. package/lib/types/model-protocol.d.ts +31 -0
  98. package/lib/types/native-select-style.d.ts +4 -0
  99. package/lib/types/parent-model-follow-card.d.ts +41 -0
  100. package/lib/types/parent-model-follow.d.ts +44 -0
  101. package/lib/types/pi-provider-bridge.d.ts +22 -0
  102. package/lib/types/plan.d.ts +148 -0
  103. package/lib/types/pre-step-pressure.d.ts +8 -0
  104. package/lib/types/preview-provider.d.ts +66 -0
  105. package/lib/types/preview-route.d.ts +74 -0
  106. package/lib/types/probe.d.ts +39 -0
  107. package/lib/types/reasoning-presentation.d.ts +55 -0
  108. package/lib/types/remote-codec.d.ts +10 -0
  109. package/lib/types/remote.d.ts +199 -0
  110. package/lib/types/replay-recovery-host.d.ts +28 -0
  111. package/lib/types/replay-recovery-remote.d.ts +14 -0
  112. package/lib/types/replay-recovery-types.d.ts +24 -0
  113. package/lib/types/replay-recovery-ui.d.ts +26 -0
  114. package/lib/types/replay-recovery.d.ts +17 -0
  115. package/lib/types/request-body-evidence.d.ts +34 -0
  116. package/lib/types/request-body-timeout-marker.d.ts +2 -0
  117. package/lib/types/request-body-timeout.d.ts +4 -0
  118. package/lib/types/request-budget.d.ts +58 -0
  119. package/lib/types/request-upload-evidence.d.ts +23 -0
  120. package/lib/types/response-error-body.d.ts +3 -0
  121. package/lib/types/responses-reasoning-text.d.ts +24 -0
  122. package/lib/types/responses-reasoning.d.ts +7 -0
  123. package/lib/types/responses-replay-compat.d.ts +30 -0
  124. package/lib/types/route-ownership.d.ts +70 -0
  125. package/lib/types/routed-web.d.ts +50 -0
  126. package/lib/types/search-backend.d.ts +16 -0
  127. package/lib/types/search-routing-host.d.ts +19 -0
  128. package/lib/types/search-routing-policy.d.ts +18 -0
  129. package/lib/types/search-routing-remote.d.ts +20 -0
  130. package/lib/types/search-routing.d.ts +43 -0
  131. package/lib/types/search-tool-routing.d.ts +22 -0
  132. package/lib/types/serialize.d.ts +106 -0
  133. package/lib/types/settings-reader.d.ts +16 -0
  134. package/lib/types/sse.d.ts +28 -0
  135. package/lib/types/temporary-models.d.ts +25 -0
  136. package/lib/types/tool-schema-compat.d.ts +17 -0
  137. package/lib/types/traditional-search.d.ts +17 -0
  138. package/lib/types/turn-model-provenance.d.ts +45 -0
  139. package/lib/types/turn-selection-card.d.ts +10 -0
  140. package/lib/types/turn-selection-host.d.ts +11 -0
  141. package/lib/types/turn-selection-remote.d.ts +13 -0
  142. package/lib/types/turn-selection.d.ts +119 -0
  143. package/lib/types/turn-usage-evidence.d.ts +66 -0
  144. package/lib/types/turn-usage-notice.d.ts +7 -0
  145. package/lib/types/types.d.ts +69 -0
  146. package/lib/types/usage.d.ts +26 -0
  147. package/lib/types/watchdog.d.ts +22 -0
  148. package/lib/types/web-delegate.d.ts +12 -0
  149. package/lib/types/web-search-routing-card.d.ts +16 -0
  150. package/lib/types/web-search-routing-config.d.ts +12 -0
  151. package/lib/types/wire-anthropic.d.ts +37 -0
  152. package/lib/types/wire.d.ts +56 -0
  153. package/lib/web-delegate.js +9 -0
  154. package/output/auto-model-mockup/index.html +207 -0
  155. package/package.json +236 -0
  156. package/scripts/check-search-composition.mjs +191 -0
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Browser companion for the Models provider-card slot.
3
+ */
4
+ import type { Context as ClientContext } from '@deepseek-ai/cordis';
5
+ import { createElement } from 'react';
6
+ import { createCompactAccount } from './compact-account.ts';
7
+ import type { CSSProperties, ReactElement } from 'react';
8
+ import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
9
+ import type { ProviderCardExtrasOwnerProps, SettingsSectionOwnerProps } from './dsh-supported-types.ts';
10
+ export { HostedSearchSettingsCard, WebSearchRoutingCard } from './web-search-routing-card.ts';
11
+ export { ParentModelFollowCard } from './parent-model-follow-card.ts';
12
+ export { CopilotUsageCard } from './copilot-usage-card.ts';
13
+ import type { CopilotAccountsRemote } from './copilot-accounts-card.ts';
14
+ export { GitHubCopilotModelPreferencesPanel } from './model-preferences-card.ts';
15
+ export declare const inject: string[];
16
+ interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
17
+ readonly remote: ClientContext['remote']['githubCopilot'];
18
+ }
19
+ interface GitHubCopilotSettingsSectionProps extends SettingsSectionOwnerProps {
20
+ readonly remote: ClientContext['remote']['githubCopilot'];
21
+ }
22
+ /** Older Remote clients may not decode results: project known fields before validating our own copy. */
23
+ export declare function authorizationViewFrom(value: unknown): GitHubCopilotAuthorizationView | undefined;
24
+ export declare function catalogWarningOf(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
25
+ /** Account allocation is not a claim that a route is loaded or a model request succeeded. */
26
+ export declare function previewAssignmentMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
27
+ export declare function routeStatusMessage(status: GitHubCopilotAuthorizationView | undefined): string | undefined;
28
+ export declare function activeAuthorizationNotice(status: GitHubCopilotAuthorizationView | undefined): GitHubCopilotAuthorizationView['notices'][number] | undefined;
29
+ type ClipboardWriter = Pick<Clipboard, 'writeText'>;
30
+ type CopyState = 'idle' | 'copying' | 'copied' | 'failed';
31
+ /** Copy a one-time authorization code through the browser clipboard boundary. */
32
+ export declare function copyAuthorizationCode(code: string, clipboard?: ClipboardWriter): Promise<void>;
33
+ interface AuthorizationNoticeProps {
34
+ readonly message: string;
35
+ readonly url?: string;
36
+ readonly code?: string;
37
+ readonly copyState: CopyState;
38
+ readonly onCopy: () => void;
39
+ readonly buttonStyle?: CSSProperties;
40
+ }
41
+ /** Pure presentation for the in-flight GitHub device-code handoff. */
42
+ export declare function GitHubCopilotAuthorizationNotice(props: AuthorizationNoticeProps): ReactElement;
43
+ /** Shared account authorization controls, mounted by the account footer or its fallback only. */
44
+ export declare function GitHubCopilotProviderCard(props: GitHubCopilotProviderCardProps): ReturnType<typeof createElement> | null;
45
+ type AccountModelsSnapshot = NonNullable<GitHubCopilotAuthorizationView['accountModels']>;
46
+ export interface AccountModelsUpdatedAt {
47
+ readonly text: string;
48
+ readonly dateTime: string;
49
+ readonly title: string;
50
+ readonly ariaLabel: string;
51
+ }
52
+ /** Pure presentation of the Host's last successful cache update; never invent freshness evidence. */
53
+ export declare function formatAccountModelsUpdatedAt(discoveredAt: number | undefined, now: number, locales?: Intl.LocalesArgument): AccountModelsUpdatedAt | undefined;
54
+ /** Display-only clock: no Remote, status, discovery, or controller lifecycle ownership. */
55
+ export declare function GitHubCopilotAccountModelsUpdatedAt(props: {
56
+ readonly discoveredAt: number | undefined;
57
+ }): ReactElement | null;
58
+ /** A discovery snapshot is metadata evidence, not proof of a successful model call. */
59
+ export declare function GitHubCopilotAccountModelsSummary(props: {
60
+ readonly snapshot: AccountModelsSnapshot;
61
+ }): ReactElement;
62
+ /** Explicit account discovery only: no mount-time request, polling, or automatic retry. */
63
+ export declare function GitHubCopilotAccountModelsPanel(props: {
64
+ readonly remote: ClientContext['remote']['githubCopilot'];
65
+ }): ReactElement;
66
+ interface GitHubCopilotPreviewFooterProps {
67
+ readonly remote: ClientContext['remote']['githubCopilot'];
68
+ readonly accountsRemote?: CopilotAccountsRemote;
69
+ /** A slot coordinator owns this controller's attachment across surface handoffs. */
70
+ readonly account?: ReturnType<typeof createCompactAccount>;
71
+ readonly embedded?: boolean;
72
+ }
73
+ /** One lifecycle owner; disclosure toggles never mount another status or discovery controller. */
74
+ export declare function GitHubCopilotCompactAccount(props: GitHubCopilotPreviewFooterProps): ReactElement;
75
+ /** Standalone footer presentation; registered Models seats use the shared surface coordinator. */
76
+ export declare function GitHubCopilotPreviewFooter(props: GitHubCopilotPreviewFooterProps): ReactElement;
77
+ type AccountSurfaceKind = 'provider' | 'footer' | 'settings';
78
+ interface AccountSurfaceSeat {
79
+ readonly kind: AccountSurfaceKind;
80
+ active: boolean;
81
+ }
82
+ type AccountController = ReturnType<typeof createCompactAccount>;
83
+ type AccountSurfaceOwner = {
84
+ readonly token: symbol;
85
+ readonly account: AccountController;
86
+ };
87
+ /** Only the mounted canonical row owns embedded controls. Credential presence is not row presence. */
88
+ export declare function isGitHubCopilotAccountRow(props: ProviderCardExtrasOwnerProps): boolean;
89
+ /** Plugin-owned mounted-seat leases, not a view into Core's settings or provider store.
90
+ * One controller follows the winning surface, retaining in-flight work during a
91
+ * handoff. Slot disposal revokes its leases even before React unmounts the rows.
92
+ */
93
+ export declare function createAccountSurfaces(): {
94
+ getSnapshot: () => AccountSurfaceOwner | undefined;
95
+ invalidate(): void;
96
+ subscribe(listener: () => void): () => void;
97
+ mount(seat: AccountSurfaceSeat, token: symbol, remote: GitHubCopilotPreviewFooterProps["remote"]): () => void;
98
+ revoke(seat: AccountSurfaceSeat): void;
99
+ dispose(): void;
100
+ };
101
+ /** Arbitration happens in committed layout effects, never during speculative render. */
102
+ export declare function GitHubCopilotAccountSurface(props: GitHubCopilotPreviewFooterProps & {
103
+ readonly surfaces: ReturnType<typeof createAccountSurfaces>;
104
+ readonly seat: AccountSurfaceSeat;
105
+ readonly eligible?: boolean;
106
+ }): ReactElement | null;
107
+ /** Unified fallback when the Models footer extension is absent or incompatible. */
108
+ export declare function GitHubCopilotSettingsSection(props: GitHubCopilotSettingsSectionProps): ReturnType<typeof createElement>;
109
+ export declare function CopilotPluginSettingsPage(props: {
110
+ settings: ClientContext['remote']['settings'];
111
+ routing: ClientContext['remote']['githubCopilotSearchRouting'];
112
+ }): import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement>;
113
+ /** Mount the plugin-owned Remote namespace and register the Models card seat. */
114
+ export declare function apply(ctx: ClientContext): Promise<() => Promise<void>>;
115
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1,42 @@
1
+ import type { GitHubCopilotAuthorizationView as View } from './authorization-controller.ts';
2
+ export interface CompactAccountRemote {
3
+ status(): Promise<unknown>;
4
+ start(): Promise<unknown>;
5
+ cancel(): Promise<unknown>;
6
+ signOut(): Promise<unknown>;
7
+ discoverModels(): Promise<unknown>;
8
+ ensureModels(): Promise<unknown>;
9
+ reconcile(): Promise<unknown>;
10
+ }
11
+ type Operation = 'start' | 'cancel' | 'signOut' | 'discoverModels' | 'reconcile';
12
+ export declare const AUTHORIZATION_POLL_INITIAL_MS = 500;
13
+ export declare const AUTHORIZATION_POLL_MAX_MS = 2000;
14
+ export interface CompactAccountSnapshot {
15
+ readonly view: View | undefined;
16
+ readonly checking: boolean;
17
+ readonly operation: Operation | undefined;
18
+ readonly error: string | undefined;
19
+ readonly copyState: 'idle' | 'copying' | 'copied' | 'failed';
20
+ }
21
+ /** One mounted account's snapshot, bounded freshness check and explicit actions.
22
+ * Initial signed-in status ensures missing/idle/stale/error metadata once or
23
+ * joins loading metadata; the Host owns single flight and failure cooldown.
24
+ * A confirmed user Start earns one forced discovery after sign-in completes.
25
+ * No Remote call occurs during construction. Every await is fenced by lifetime
26
+ * and request generation; UI disclosure changes never reconstruct this owner.
27
+ */
28
+ export declare function createCompactAccount(remote: CompactAccountRemote, decode: (value: unknown) => View | undefined, copy: (code: string) => Promise<void>): {
29
+ getSnapshot: () => CompactAccountSnapshot;
30
+ subscribe(listener: () => void): () => void;
31
+ attach(): () => void;
32
+ invalidate(): void;
33
+ retryStatus: () => Promise<void>;
34
+ start: () => Promise<void>;
35
+ cancel: () => Promise<void>;
36
+ signOut: () => Promise<void>;
37
+ refreshModels: () => Promise<void>;
38
+ reconcile: () => Promise<void>;
39
+ copyCode(): Promise<void>;
40
+ };
41
+ export {};
42
+ //# sourceMappingURL=compact-account.d.ts.map
@@ -0,0 +1,23 @@
1
+ /** Local Copilot pressure signalling over the stock compaction recovery path. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import type { GenerateOptions } from '@deepseek-ai/dsh-llm';
4
+ /** Conservative input threshold already resolved from authenticated model facts and current policy. */
5
+ export interface CopilotCompactionPressureBudget {
6
+ readonly inputBudgetTokens: number;
7
+ }
8
+ /** Snapshot access belongs to the account route; pressure signalling never starts discovery. */
9
+ export interface CopilotCompactionPressureCallbacks {
10
+ /** Return the exact owned request's current budget, or undefined when disabled or unavailable. */
11
+ resolve(request: GenerateOptions): CopilotCompactionPressureBudget | undefined;
12
+ }
13
+ /**
14
+ * Request a stock overflow reduction before sending an estimated over-budget
15
+ * conversation. The loop has already logged and frozen this exact request;
16
+ * only its owner can rebuild it after a durable compaction. Never rewrite the
17
+ * request, invoke compaction concurrently, or intercept auxiliary summaries.
18
+ * @param ctx - Host context owning the reversible stream listener.
19
+ * @param callbacks - synchronous authenticated budget lookup, without discovery.
20
+ * @returns disposer for the listener, also owned by its Cordis context.
21
+ */
22
+ export declare function installCopilotCompactionPressure(ctx: Context, callbacks: CopilotCompactionPressureCallbacks): () => void;
23
+ //# sourceMappingURL=compaction-pressure.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Fail-closed runtime validation for the DSH service APIs this integration
3
+ * consumes. Version ranges are validated by the deployment baseline; this
4
+ * check protects source and unpacked installs from API-shape drift.
5
+ * @module dsh-github-copilot/compatibility
6
+ */
7
+ import type { Context } from '@deepseek-ai/cordis';
8
+ export declare const DSH_COMPATIBILITY: {
9
+ readonly release: "0.2.0-rc.2";
10
+ readonly developmentRelease: "0.2.0-rc.2";
11
+ readonly peerRange: "0.2.0-rc.2";
12
+ readonly supportedReleases: readonly ["0.2.0-rc.2"];
13
+ readonly requiredApis: readonly ["agentDefaultModel.currentSelection", "authorization.describe", "authorization.begin", "authorization.cancel", "credentials.describeRecord", "credentials.readRecord", "credentials.listRecords", "credentials.modifyRecord", "credentials.deleteRecord", "settings.describe", "settings.mutate", "web.registerSearchProvider", "systemPrompt.section", "context.on", "context.effect", "context.plugin"];
14
+ };
15
+ /** Assert every required Core service shape before registering any effects. */
16
+ export declare function assertDshCompatibility(ctx: Context): void;
17
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1,89 @@
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
+ /** Plugin configuration. Defaults make the current chat route decide. */
12
+ export interface InlineConfig {
13
+ /** Hosted-search switch; managed chat requests remain enabled. */
14
+ enabled: boolean;
15
+ /**
16
+ * Provider whitelist (llm-pi-ai route keys). Empty = follow the current
17
+ * chat route, whose candidates decide whether the plugin can serve.
18
+ */
19
+ providers: string[];
20
+ /** Append `include: ['web_search_call.action.sources']` to wire requests. */
21
+ includeSources: boolean;
22
+ /** Strip function-tool variants of the server-side web tools from the wire. */
23
+ stripServerTools: boolean;
24
+ /** Idle bound for one inline request, in milliseconds. */
25
+ idleTimeoutMs: number;
26
+ /** Managed chat byte-idle interval; separate from hosted search. */
27
+ chatStreamIdleTimeoutMs?: number;
28
+ /** Enable bounded HTTP byte-aware liveness without fabricated assistant progress. */
29
+ chatStreamLiveness?: boolean;
30
+ /** Native request image projection budget; changing it can offload older images. */
31
+ chatMaxRequestImageBytes?: number;
32
+ /** Verify the endpoint executes native search before serving. */
33
+ probe: boolean;
34
+ /** Bound on one probe request, in milliseconds. */
35
+ probeTimeoutMs: number;
36
+ /** Maximum reuse of account model metadata; credential proof guards still take precedence. */
37
+ accountModelTtlMs?: number;
38
+ /** Minimum delay after failed passive discovery; explicit Refresh bypasses it. */
39
+ accountModelFailureCooldownMs?: number;
40
+ /** Exact account model IDs hidden from the managed directory and every Auto candidate pool. */
41
+ excludedModelIds?: string[];
42
+ /** Opaque profile-wide account selector; absence retains canonical compatibility. */
43
+ activeAccountId?: string;
44
+ /** Explicit native child/direct-parent enrollments; empty preserves native routing. */
45
+ parentModelFollow?: ParentModelBinding[];
46
+ /** Profile-wide next-turn policy for supported native children. */
47
+ followParentModel?: boolean;
48
+ /** Default-on bounded task assessment; explicit false opts out of auxiliary inference. */
49
+ autoSemanticAssessment?: boolean;
50
+ /** Estimated managed-route input headroom, separate from truthful catalog capacities. */
51
+ requestBudgetSafetyTokens?: number;
52
+ /** Fraction of admissible input used by eligible automatic-compaction requests. */
53
+ requestBudgetPressureRatio?: number;
54
+ /** Supported low effort only for summary calls with no already resolved effort. */
55
+ compactionReasoning?: RequestBudgetPolicy['compactionReasoning'];
56
+ /** Route the official web-search consumer by initiating Session when the bundle isolate is mounted. */
57
+ routeWebSearch?: boolean;
58
+ /** Automatic fallback, disclosed in results; no per-search approval dialog. */
59
+ searchFallback?: 'none' | 'deepseek';
60
+ /** Optional authoritative legacy override; otherwise hosted search resolves bounded account-owned candidates independently of Chat. */
61
+ searchModel?: string;
62
+ /** Provider routing folded into this plugin entry on current Core releases. */
63
+ searchRouting?: WebSearchRoutingConfig;
64
+ /** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
65
+ temporaryRouteBackup?: string;
66
+ }
67
+ export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId'> & {
68
+ activeAccountId?: string | LiveSetting<string | undefined>;
69
+ followParentModel?: boolean | LiveSetting<boolean>;
70
+ parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
71
+ excludedModelIds?: string[] | LiveSetting<ArrayLike<string>>;
72
+ searchModel?: string | LiveSetting<string | undefined>;
73
+ searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
74
+ temporaryRouteBackup?: string | LiveSetting<string | undefined>;
75
+ };
76
+ export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel' | 'activeAccountId'> & {
77
+ activeAccountId: LiveSetting<string | undefined>;
78
+ followParentModel: LiveSetting<boolean>;
79
+ parentModelFollow: LiveSetting<ArrayLike<ParentModelBinding>>;
80
+ excludedModelIds: LiveSetting<ArrayLike<string>>;
81
+ searchModel: LiveSetting<string | undefined>;
82
+ searchRouting: LiveSetting<WebSearchRoutingConfig>;
83
+ temporaryRouteBackup: LiveSetting<string | undefined>;
84
+ };
85
+ /** Keep native live references at the boundary; request code consumes plain snapshots. */
86
+ export declare function readInlineConfig(config: LiveInlineConfig): InlineConfig;
87
+ /** Schema of the plugin's settings section. */
88
+ export declare const Config: z<Partial<InlineConfig>, ResolvedInlineConfig>;
89
+ //# 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,11 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { ReactElement } from 'react';
3
+ import type { ContextEvidence } from './context-evidence.ts';
4
+ export declare function ContextEvidenceNotice({ evidence, locale, applicable }: {
5
+ evidence: ContextEvidence | undefined;
6
+ locale?: string;
7
+ applicable?: boolean;
8
+ }): ReactElement | null;
9
+ /** Additive disclosure only: native input, context ring and billing remain untouched. */
10
+ export declare function registerContextEvidenceUi(ctx: Context): () => void;
11
+ //# sourceMappingURL=context-evidence-ui.d.ts.map
@@ -0,0 +1,108 @@
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
+ selection: "selection";
23
+ "failed-zero": "failed-zero";
24
+ }>;
25
+ }, z.core.$strict>;
26
+ export type ContextEvidence = z.infer<typeof ContextEvidenceSchema>;
27
+ declare module '@deepseek-ai/dsh-session-projection/types' {
28
+ interface SessionProjectionMap {
29
+ githubCopilotContextEvidence: ContextEvidence;
30
+ }
31
+ interface SessionProjectionStateMap {
32
+ githubCopilotContextEvidence: ContextEvidence;
33
+ }
34
+ }
35
+ export declare function initialContextEvidence(): ContextEvidence;
36
+ /** Read only counts and routing leaves; never message content or opaque replay. */
37
+ export declare function foldContextEvidence(state: ContextEvidence, event: unknown): ContextEvidence;
38
+ /** Separate bounded replay unit; never register under or modify a Core key. */
39
+ export declare const contextEvidenceDefinition: {
40
+ key: "githubCopilotContextEvidence";
41
+ stateVersion: number;
42
+ stateSchema: z.ZodObject<{
43
+ route: z.ZodNullable<z.ZodObject<{
44
+ provider: z.ZodString;
45
+ model: z.ZodString;
46
+ }, z.core.$strict>>;
47
+ sample: z.ZodNullable<z.ZodObject<{
48
+ tokens: z.ZodNumber;
49
+ seq: z.ZodNumber;
50
+ route: z.ZodObject<{
51
+ provider: z.ZodString;
52
+ model: z.ZodString;
53
+ }, z.core.$strict>;
54
+ }, z.core.$strict>>;
55
+ invalid: z.ZodBoolean;
56
+ reason: z.ZodEnum<{
57
+ none: "none";
58
+ compaction: "compaction";
59
+ unknown: "unknown";
60
+ selection: "selection";
61
+ "failed-zero": "failed-zero";
62
+ }>;
63
+ }, z.core.$strict>;
64
+ init: typeof initialContextEvidence;
65
+ apply: typeof foldContextEvidence;
66
+ wire: {
67
+ viewSchema: z.ZodObject<{
68
+ route: z.ZodNullable<z.ZodObject<{
69
+ provider: z.ZodString;
70
+ model: z.ZodString;
71
+ }, z.core.$strict>>;
72
+ sample: z.ZodNullable<z.ZodObject<{
73
+ tokens: z.ZodNumber;
74
+ seq: z.ZodNumber;
75
+ route: z.ZodObject<{
76
+ provider: z.ZodString;
77
+ model: z.ZodString;
78
+ }, z.core.$strict>;
79
+ }, z.core.$strict>>;
80
+ invalid: z.ZodBoolean;
81
+ reason: z.ZodEnum<{
82
+ none: "none";
83
+ compaction: "compaction";
84
+ unknown: "unknown";
85
+ selection: "selection";
86
+ "failed-zero": "failed-zero";
87
+ }>;
88
+ }, z.core.$strict>;
89
+ view: (state: ContextEvidence) => {
90
+ route: {
91
+ provider: string;
92
+ model: string;
93
+ } | null;
94
+ sample: {
95
+ tokens: number;
96
+ seq: number;
97
+ route: {
98
+ provider: string;
99
+ model: string;
100
+ };
101
+ } | null;
102
+ invalid: boolean;
103
+ reason: "none" | "compaction" | "unknown" | "selection" | "failed-zero";
104
+ };
105
+ };
106
+ };
107
+ export declare function installContextEvidence(ctx: Context): void;
108
+ //# 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,30 @@
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
+ add(): Promise<AccountResult>;
14
+ cancel(): Promise<AccountResult>;
15
+ switchAccount(accountId: string, expectedRevision: number): Promise<AccountResult>;
16
+ reauthorize(accountId: string, expectedRevision: number): Promise<AccountResult>;
17
+ removeAccount(accountId: string, expectedRevision: number): Promise<AccountResult>;
18
+ }
19
+ /** Copy owned presentation fields before decoding traced Client values. */
20
+ export declare function accountsViewFrom(value: unknown): CopilotAccountsView | undefined;
21
+ export declare function accountIdentityLabel(view: CopilotAccountsView | undefined): string | undefined;
22
+ export declare function CopilotAccountsPanel(props: {
23
+ remote?: CopilotAccountsRemote;
24
+ expanded: boolean;
25
+ onChanged?: () => void;
26
+ authorizationBusy?: boolean;
27
+ configured?: boolean;
28
+ }): ReactElement;
29
+ export {};
30
+ //# sourceMappingURL=copilot-accounts-card.d.ts.map
@@ -0,0 +1,75 @@
1
+ import { Context } from '@deepseek-ai/cordis';
2
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
3
+ import type { CopilotAccountBinding, 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 identities;
19
+ private readonly unavailableIdentities;
20
+ private readonly listeners;
21
+ private readonly abort;
22
+ private operation;
23
+ private attemptKey;
24
+ private authorizationAbort;
25
+ private notices;
26
+ private lastFailure;
27
+ constructor(ctx: Context, dependencies?: Dependencies);
28
+ private settings;
29
+ private selection;
30
+ private revoke;
31
+ selectionChanged(): void;
32
+ isActiveRecord(key: string): boolean;
33
+ credentialChanged(key: string): void;
34
+ onChanged(listener: () => void): () => void;
35
+ capture(accountId?: string): CopilotAccountBinding;
36
+ acquire(signal?: AbortSignal, requireManaged?: boolean): CopilotAccountLease;
37
+ acquireCanonicalAuthorization(): CopilotAccountLease;
38
+ private routeDiagnostic;
39
+ private busy;
40
+ private membership;
41
+ get(): Promise<CopilotAccountsView>;
42
+ private identity;
43
+ private fetchIdentity;
44
+ refreshIdentity(): Promise<CopilotAccountsView>;
45
+ private validateModels;
46
+ private assertIdentityCurrent;
47
+ switchAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
48
+ add(): Promise<CopilotAccountsView>;
49
+ reauthorize(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
50
+ authorize(accountId: string, expectedRevision?: number): Promise<CopilotAccountsView>;
51
+ cancel(): Promise<CopilotAccountsView>;
52
+ remove(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
53
+ signOutActive(): Promise<void>;
54
+ dispose(): void;
55
+ }
56
+ declare module '@deepseek-ai/cordis' {
57
+ interface Context {
58
+ githubCopilotAccounts: GitHubCopilotAccountsController;
59
+ }
60
+ }
61
+ export declare function activeCopilotBinding(ctx: Context): CopilotAccountBinding | undefined;
62
+ export declare function isActiveCopilotRecord(ctx: Context, key: string): boolean;
63
+ export default class GitHubCopilotAccountsController extends TypertRemoteService {
64
+ readonly host: CopilotAccountsHost;
65
+ constructor(ctx: Context);
66
+ get(): Promise<CopilotAccountsView>;
67
+ refreshIdentity(): Promise<CopilotAccountsView>;
68
+ add(): Promise<CopilotAccountsView>;
69
+ cancel(): Promise<CopilotAccountsView>;
70
+ reauthorize(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
71
+ switchAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
72
+ removeAccount(accountId: string, expectedRevision: number): Promise<CopilotAccountsView>;
73
+ }
74
+ export {};
75
+ //# sourceMappingURL=copilot-accounts-host.d.ts.map
@@ -0,0 +1,77 @@
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
+ add(): Promise<RemoteResult<CopilotAccountsView>>;
11
+ cancel(): Promise<RemoteResult<CopilotAccountsView>>;
12
+ reauthorize(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
13
+ switchAccount(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
14
+ removeAccount(accountId: string, expectedRevision: number): Promise<RemoteResult<CopilotAccountsView>>;
15
+ };
16
+ }
17
+ }
18
+ export declare const CopilotAccountIdSchema: z.ZodString;
19
+ export declare const CopilotAccountsViewSchema: z.ZodObject<{
20
+ state: z.ZodEnum<{
21
+ ready: "ready";
22
+ error: "error";
23
+ }>;
24
+ activeAccountId: z.ZodString;
25
+ revision: z.ZodOptional<z.ZodNumber>;
26
+ writable: z.ZodBoolean;
27
+ switchable: z.ZodBoolean;
28
+ accounts: z.ZodArray<z.ZodObject<{
29
+ id: z.ZodString;
30
+ configured: z.ZodBoolean;
31
+ identityState: z.ZodEnum<{
32
+ ready: "ready";
33
+ unavailable: "unavailable";
34
+ unknown: "unknown";
35
+ }>;
36
+ identity: z.ZodOptional<z.ZodObject<{
37
+ login: z.ZodString;
38
+ userId: z.ZodNumber;
39
+ }, z.core.$strict>>;
40
+ }, z.core.$strict>>;
41
+ operation: z.ZodOptional<z.ZodEnum<{
42
+ authorizing: "authorizing";
43
+ switching: "switching";
44
+ }>>;
45
+ notices: z.ZodArray<z.ZodObject<{
46
+ message: z.ZodString;
47
+ url: z.ZodOptional<z.ZodLiteral<"https://github.com/login/device">>;
48
+ code: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strict>>;
50
+ diagnostic: z.ZodOptional<z.ZodEnum<{
51
+ COPILOT_ACCOUNTS_SELECTOR_INVALID: "COPILOT_ACCOUNTS_SELECTOR_INVALID";
52
+ COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE: "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE";
53
+ COPILOT_ACCOUNTS_SELECTED_MISSING: "COPILOT_ACCOUNTS_SELECTED_MISSING";
54
+ COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE: "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE";
55
+ COPILOT_ACCOUNTS_CHANGED: "COPILOT_ACCOUNTS_CHANGED";
56
+ COPILOT_ACCOUNTS_BUSY: "COPILOT_ACCOUNTS_BUSY";
57
+ COPILOT_ACCOUNTS_CONFLICT: "COPILOT_ACCOUNTS_CONFLICT";
58
+ COPILOT_ACCOUNTS_COMMIT_UNCERTAIN: "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN";
59
+ COPILOT_ACCOUNTS_MODELS_FAILED: "COPILOT_ACCOUNTS_MODELS_FAILED";
60
+ COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE: "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE";
61
+ COPILOT_ACCOUNTS_IDENTITY_INVALID: "COPILOT_ACCOUNTS_IDENTITY_INVALID";
62
+ COPILOT_ACCOUNTS_IDENTITY_CHANGED: "COPILOT_ACCOUNTS_IDENTITY_CHANGED";
63
+ COPILOT_ACCOUNTS_DUPLICATE: "COPILOT_ACCOUNTS_DUPLICATE";
64
+ COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED: "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED";
65
+ COPILOT_ACCOUNTS_ROUTE_BLOCKED: "COPILOT_ACCOUNTS_ROUTE_BLOCKED";
66
+ COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE: "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE";
67
+ COPILOT_ACCOUNTS_LIMIT: "COPILOT_ACCOUNTS_LIMIT";
68
+ COPILOT_ACCOUNTS_AUTH_FAILED: "COPILOT_ACCOUNTS_AUTH_FAILED";
69
+ COPILOT_ACCOUNTS_AUTH_UNAVAILABLE: "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE";
70
+ COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED: "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED";
71
+ COPILOT_ACCOUNTS_REMOVE_FAILED: "COPILOT_ACCOUNTS_REMOVE_FAILED";
72
+ COPILOT_ACCOUNTS_DISPOSED: "COPILOT_ACCOUNTS_DISPOSED";
73
+ }>>;
74
+ }, z.core.$strict>;
75
+ declare const contribution: TypertRemoteContribution;
76
+ export default contribution;
77
+ //# sourceMappingURL=copilot-accounts-remote.d.ts.map