dsh-github-copilot 0.4.0-alpha.59 → 0.4.0-alpha.61
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.
- package/AGENTS.md +5 -5
- package/CHANGELOG.md +12 -1
- package/README.md +11 -11
- package/README.zh.md +11 -11
- package/deployment-baseline.json +5 -1
- package/docs/automatic-model-routing.md +5 -5
- package/lib/client.js +127 -1
- package/lib/client.js.map +1 -1
- package/lib/index.js +372 -12
- package/lib/remote.js +28 -0
- package/lib/types/authorization-controller.d.ts +14 -0
- package/lib/types/client.d.ts +1 -0
- package/lib/types/config.d.ts +2 -0
- package/lib/types/model-exclusions.d.ts +7 -0
- package/lib/types/model-preferences-card.d.ts +9 -0
- package/lib/types/preview-provider.d.ts +3 -0
- package/lib/types/preview-route.d.ts +1 -1
- package/lib/types/remote.d.ts +19 -0
- package/lib/types/responses-replay-compat.d.ts +14 -0
- package/package.json +1 -1
|
@@ -51,6 +51,15 @@ export interface GitHubCopilotAccountModelsView {
|
|
|
51
51
|
readonly discoveredAt?: number;
|
|
52
52
|
readonly error?: string;
|
|
53
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 error?: 'COPILOT_MODEL_PREFERENCES_UNAVAILABLE' | 'COPILOT_MODEL_EXCLUSION_SELECTED' | 'COPILOT_MODEL_EXCLUSION_CONFLICT' | 'COPILOT_MODEL_EXCLUSION_SAVE_FAILED';
|
|
62
|
+
}
|
|
54
63
|
export interface GitHubCopilotAuthorizationView {
|
|
55
64
|
readonly phase: GitHubCopilotAuthorizationPhase;
|
|
56
65
|
readonly configured: boolean;
|
|
@@ -60,6 +69,7 @@ export interface GitHubCopilotAuthorizationView {
|
|
|
60
69
|
readonly catalog?: GitHubCopilotModelCatalogView;
|
|
61
70
|
readonly route?: GitHubCopilotRouteView;
|
|
62
71
|
readonly accountModels?: GitHubCopilotAccountModelsView;
|
|
72
|
+
readonly modelPreferences?: GitHubCopilotModelPreferencesView;
|
|
63
73
|
readonly error?: string;
|
|
64
74
|
/** Latest fixed interaction milestone observed during a failed or active attempt; never a failure cause. */
|
|
65
75
|
readonly authorizationMilestone?: GitHubCopilotAuthorizationMilestone;
|
|
@@ -84,10 +94,13 @@ export declare class GitHubCopilotAuthorizationController extends TypertRemoteSe
|
|
|
84
94
|
private reconciliationFailed;
|
|
85
95
|
private attempt;
|
|
86
96
|
private authorizationMilestone;
|
|
97
|
+
private modelPreferenceFailure;
|
|
87
98
|
constructor(ctx: Context);
|
|
88
99
|
/** No-argument Ops evidence; deliberately independent of ordinary account status. */
|
|
89
100
|
migrationStatus(): GitHubCopilotMigrationStatus;
|
|
90
101
|
status(): Promise<GitHubCopilotAuthorizationView>;
|
|
102
|
+
excludeModel(modelId: string): Promise<GitHubCopilotAuthorizationView>;
|
|
103
|
+
restoreModel(modelId: string): Promise<GitHubCopilotAuthorizationView>;
|
|
91
104
|
/** Explicit model discovery: may refresh OAuth and GET the account catalog, never changes selection. */
|
|
92
105
|
discoverModels(): Promise<GitHubCopilotAuthorizationView>;
|
|
93
106
|
/** Ensure metadata for a visible account view, honoring shared cache and failure cooldown. */
|
|
@@ -98,6 +111,7 @@ export declare class GitHubCopilotAuthorizationController extends TypertRemoteSe
|
|
|
98
111
|
start(): Promise<GitHubCopilotAuthorizationView>;
|
|
99
112
|
cancel(): Promise<GitHubCopilotAuthorizationView>;
|
|
100
113
|
signOut(): Promise<GitHubCopilotAuthorizationView>;
|
|
114
|
+
private updateModelExclusion;
|
|
101
115
|
private ensureProviderProfile;
|
|
102
116
|
}
|
|
103
117
|
export default GitHubCopilotAuthorizationController;
|
package/lib/types/client.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { GitHubCopilotAuthorizationView } from './authorization-controller.
|
|
|
9
9
|
import type { ProviderCardExtrasOwnerProps, SettingsSectionOwnerProps } from './dsh-supported-types.ts';
|
|
10
10
|
export { HostedSearchSettingsCard, WebSearchRoutingCard } from './web-search-routing-card.ts';
|
|
11
11
|
export { CopilotUsageCard } from './copilot-usage-card.ts';
|
|
12
|
+
export { GitHubCopilotModelPreferencesPanel } from './model-preferences-card.ts';
|
|
12
13
|
export declare const inject: string[];
|
|
13
14
|
interface GitHubCopilotProviderCardProps extends ProviderCardExtrasOwnerProps {
|
|
14
15
|
readonly remote: ClientContext['remote']['githubCopilot'];
|
package/lib/types/config.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface InlineConfig {
|
|
|
31
31
|
accountModelTtlMs?: number;
|
|
32
32
|
/** Minimum delay after failed passive discovery; explicit Refresh bypasses it. */
|
|
33
33
|
accountModelFailureCooldownMs?: number;
|
|
34
|
+
/** Exact account model IDs hidden from the managed directory and every Auto candidate pool. */
|
|
35
|
+
excludedModelIds?: string[];
|
|
34
36
|
/** Estimated managed-route input headroom, separate from truthful catalog capacities. */
|
|
35
37
|
requestBudgetSafetyTokens?: number;
|
|
36
38
|
/** Fraction of admissible input used by eligible automatic-compaction requests. */
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const MAX_EXCLUDED_MODEL_IDS = 512;
|
|
2
|
+
export declare function normalizeExcludedModelIds(value: unknown): readonly string[];
|
|
3
|
+
export declare function excludedModelSet(value: unknown): ReadonlySet<string>;
|
|
4
|
+
export declare function filterExcludedModels<T extends {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
}>(models: readonly T[], value: unknown): readonly T[];
|
|
7
|
+
//# sourceMappingURL=model-exclusions.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Context as ClientContext } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
|
|
4
|
+
export declare function GitHubCopilotModelPreferencesPanel(props: {
|
|
5
|
+
readonly remote: ClientContext['remote']['githubCopilot'];
|
|
6
|
+
readonly models: GitHubCopilotAuthorizationView['accountModels'];
|
|
7
|
+
readonly preferences: GitHubCopilotAuthorizationView['modelPreferences'];
|
|
8
|
+
}): ReactElement;
|
|
9
|
+
//# sourceMappingURL=model-preferences-card.d.ts.map
|
|
@@ -3,6 +3,7 @@ import type { AccountModelApi, AccountModelDescriptor } from './account-model-ca
|
|
|
3
3
|
import type { CoreCompatibleProvider } from './pi-provider-bridge.ts';
|
|
4
4
|
import type { GitHubCopilotOAuthCredential } from './copilot-grant.ts';
|
|
5
5
|
import { CopilotResponsesReplayError } from './responses-replay-compat.ts';
|
|
6
|
+
import type { ResponsesRetryReplay } from './responses-replay-compat.ts';
|
|
6
7
|
export type ManagedWireAbortCode = 'COPILOT_PREVIEW_CREDENTIAL_CHANGED' | 'COPILOT_PREVIEW_DISPOSED';
|
|
7
8
|
/** Identity, not upstream error text, proves that the plugin revoked this wire. */
|
|
8
9
|
export declare class ManagedWireAbortError extends Error {
|
|
@@ -28,6 +29,8 @@ export interface PreviewProviderGuard {
|
|
|
28
29
|
/** Guard for one selected model in an account-bound descriptor snapshot. */
|
|
29
30
|
export interface AccountProviderGuard extends PreviewProviderGuard {
|
|
30
31
|
readonly selectedModelId?: string;
|
|
32
|
+
readonly retryReplay?: ResponsesRetryReplay;
|
|
33
|
+
readonly retrySignal?: AbortSignal;
|
|
31
34
|
/** Per-dispatch admission after native context conversion, before starting a model wire. */
|
|
32
35
|
inspectRequest?(model: Model<Api>, context: TranscriptContext, options?: StreamOptions): void;
|
|
33
36
|
assertEntitled(credential: GitHubCopilotOAuthCredential, modelId: string): void;
|
|
@@ -7,7 +7,7 @@ import type { InlineConfig } from './config.ts';
|
|
|
7
7
|
import type { RequestBudgetPolicy } from './request-budget.ts';
|
|
8
8
|
/** Safe request knobs; identities, model tables, endpoints and credentials are not configurable. */
|
|
9
9
|
export type PreviewRouteConfig = Pick<PiAiProviderProfile, 'reasoning' | 'cacheRetention' | 'transport' | 'timeoutMs' | 'websocketConnectTimeoutMs' | 'streamIdleTimeoutMs' | 'maxRequestImageBytes' | 'requestImagePixelBudget' | 'requestImageMaxBytes' | 'retryPolicy'> & Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs'> & {
|
|
10
|
-
readonly accountModelSettings?: () => Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs'>;
|
|
10
|
+
readonly accountModelSettings?: () => Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs' | 'excludedModelIds'>;
|
|
11
11
|
readonly requestBudget?: Partial<RequestBudgetPolicy>;
|
|
12
12
|
readonly requestBudgetSettings?: () => Partial<RequestBudgetPolicy>;
|
|
13
13
|
};
|
package/lib/types/remote.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
13
13
|
reconcile(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
14
14
|
discoverModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
15
15
|
ensureModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
16
|
+
excludeModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
17
|
+
restoreModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
16
18
|
start(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
17
19
|
cancel(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
18
20
|
signOut(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
@@ -74,6 +76,23 @@ export declare const GitHubCopilotAuthorizationViewSchema: z.ZodObject<{
|
|
|
74
76
|
discoveredAt: z.ZodOptional<z.ZodNumber>;
|
|
75
77
|
error: z.ZodOptional<z.ZodString>;
|
|
76
78
|
}, z.core.$strict>>;
|
|
79
|
+
modelPreferences: z.ZodOptional<z.ZodObject<{
|
|
80
|
+
state: z.ZodEnum<{
|
|
81
|
+
error: "error";
|
|
82
|
+
ready: "ready";
|
|
83
|
+
}>;
|
|
84
|
+
writable: z.ZodBoolean;
|
|
85
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
excludedModelIds: z.ZodArray<z.ZodString>;
|
|
87
|
+
lockedModelIds: z.ZodArray<z.ZodString>;
|
|
88
|
+
unavailableExcludedModelIds: z.ZodArray<z.ZodString>;
|
|
89
|
+
error: z.ZodOptional<z.ZodEnum<{
|
|
90
|
+
COPILOT_MODEL_PREFERENCES_UNAVAILABLE: "COPILOT_MODEL_PREFERENCES_UNAVAILABLE";
|
|
91
|
+
COPILOT_MODEL_EXCLUSION_SELECTED: "COPILOT_MODEL_EXCLUSION_SELECTED";
|
|
92
|
+
COPILOT_MODEL_EXCLUSION_CONFLICT: "COPILOT_MODEL_EXCLUSION_CONFLICT";
|
|
93
|
+
COPILOT_MODEL_EXCLUSION_SAVE_FAILED: "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
|
|
94
|
+
}>>;
|
|
95
|
+
}, z.core.$strict>>;
|
|
77
96
|
route: z.ZodOptional<z.ZodObject<{
|
|
78
97
|
state: z.ZodEnum<{
|
|
79
98
|
error: "error";
|
|
@@ -5,6 +5,20 @@ export declare class CopilotResponsesReplayError extends Error {
|
|
|
5
5
|
}
|
|
6
6
|
/** Normalize only the outgoing managed Responses payload, never stored history/context. */
|
|
7
7
|
export declare function normalizeCopilotResponsesPayload(payload: unknown): unknown;
|
|
8
|
+
/** A single lease can admit one HTTP-verified retry at a time; it never reads durable history. */
|
|
9
|
+
export declare class ResponsesRetryReplay {
|
|
10
|
+
private snapshot;
|
|
11
|
+
private active;
|
|
12
|
+
private disposed;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
belongsTo(sessionId: string): boolean;
|
|
15
|
+
begin(context: unknown, signal?: AbortSignal, sessionId?: string, modelId?: string): ResponsesRetryAttempt;
|
|
16
|
+
}
|
|
17
|
+
export interface ResponsesRetryAttempt {
|
|
18
|
+
normalize(payload: unknown): unknown;
|
|
19
|
+
observe(body: string | undefined, status: number): void;
|
|
20
|
+
finish(): void;
|
|
21
|
+
}
|
|
8
22
|
/** Observe a cloned, bounded 401 body; every unknown result retains native auth behavior. */
|
|
9
23
|
export declare function isCopilotInputItemScopeError(response: Response, signal?: AbortSignal): Promise<boolean>;
|
|
10
24
|
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-github-copilot",
|
|
3
3
|
"description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
|
|
4
|
-
"version": "0.4.0-alpha.
|
|
4
|
+
"version": "0.4.0-alpha.61",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|