dsh-github-copilot 0.4.0-alpha.77 → 0.4.0-alpha.79
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 +8 -1
- package/CHANGELOG.md +11 -0
- package/README.md +11 -9
- package/README.zh.md +11 -9
- package/deployment-baseline.json +7 -2
- package/docs/automatic-model-routing.md +24 -0
- package/lib/client.js +40 -7
- package/lib/client.js.map +1 -1
- package/lib/index.js +197 -107
- package/lib/remote.js +21 -1
- package/lib/types/authorization-controller.d.ts +1 -0
- package/lib/types/auto-model-host.d.ts +1 -0
- package/lib/types/model-exclusions.d.ts +8 -0
- package/lib/types/remote.d.ts +22 -1
- package/lib/types/turn-selection-host.d.ts +11 -0
- package/package.json +1 -1
package/lib/remote.js
CHANGED
|
@@ -340,6 +340,7 @@ const GitHubCopilotAuthorizationViewSchema = z.object({
|
|
|
340
340
|
]).optional()
|
|
341
341
|
}).strict();
|
|
342
342
|
const result = strictRemoteCodec(GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL, GitHubCopilotAuthorizationViewSchema);
|
|
343
|
+
const GitHubCopilotModelPreferencesViewSchema = GitHubCopilotAuthorizationViewSchema.shape.modelPreferences.unwrap();
|
|
343
344
|
const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
|
|
344
345
|
const selectionSchema = z.object({
|
|
345
346
|
provider: z.string().min(1).max(512),
|
|
@@ -420,6 +421,25 @@ const contribution = {
|
|
|
420
421
|
}],
|
|
421
422
|
result
|
|
422
423
|
})),
|
|
424
|
+
{
|
|
425
|
+
id: "dsh-github-copilot:githubCopilot.setModelExcluded",
|
|
426
|
+
service: "githubCopilotAuthorization",
|
|
427
|
+
namespace: "githubCopilot",
|
|
428
|
+
method: "setModelExcluded",
|
|
429
|
+
invocation: direct,
|
|
430
|
+
parameters: [{
|
|
431
|
+
name: "modelId",
|
|
432
|
+
wire: "modelId",
|
|
433
|
+
source: "json",
|
|
434
|
+
codec: strictRemoteCodec("dsh-github-copilot#GitHubCopilotModelId", z.string().min(1).max(512))
|
|
435
|
+
}, {
|
|
436
|
+
name: "excluded",
|
|
437
|
+
wire: "excluded",
|
|
438
|
+
source: "json",
|
|
439
|
+
codec: strictRemoteCodec("dsh-github-copilot#GitHubCopilotModelExcluded", z.boolean())
|
|
440
|
+
}],
|
|
441
|
+
result: strictRemoteCodec("dsh-github-copilot#GitHubCopilotModelPreferencesView", GitHubCopilotModelPreferencesViewSchema)
|
|
442
|
+
},
|
|
423
443
|
{
|
|
424
444
|
id: "dsh-github-copilot:githubCopilot.migrationStatus",
|
|
425
445
|
service: "githubCopilotAuthorization",
|
|
@@ -436,4 +456,4 @@ const contribution = {
|
|
|
436
456
|
]
|
|
437
457
|
};
|
|
438
458
|
//#endregion
|
|
439
|
-
export { GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL, GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotAuthorizationViewSchema, GitHubCopilotMigrationStatusSchema, contribution as default };
|
|
459
|
+
export { GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL, GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotAuthorizationViewSchema, GitHubCopilotMigrationStatusSchema, GitHubCopilotModelPreferencesViewSchema, contribution as default };
|
|
@@ -101,6 +101,7 @@ export declare class GitHubCopilotAuthorizationController extends TypertRemoteSe
|
|
|
101
101
|
status(): Promise<GitHubCopilotAuthorizationView>;
|
|
102
102
|
excludeModel(modelId: string): Promise<GitHubCopilotAuthorizationView>;
|
|
103
103
|
restoreModel(modelId: string): Promise<GitHubCopilotAuthorizationView>;
|
|
104
|
+
setModelExcluded(modelId: string, excluded: boolean): Promise<GitHubCopilotModelPreferencesView>;
|
|
104
105
|
/** Explicit model discovery: may refresh OAuth and GET the account catalog, never changes selection. */
|
|
105
106
|
discoverModels(): Promise<GitHubCopilotAuthorizationView>;
|
|
106
107
|
/** Ensure metadata for a visible account view, honoring shared cache and failure cooldown. */
|
|
@@ -16,6 +16,7 @@ export interface AutoModelHostDependencies {
|
|
|
16
16
|
budgetPolicy?: () => Partial<RequestBudgetPolicy>;
|
|
17
17
|
parentModelBindings?: () => readonly ParentModelBinding[];
|
|
18
18
|
followParentModel?: () => boolean;
|
|
19
|
+
admitModel?: (agent: Agent, turn: number, model: string, signal: AbortSignal) => void;
|
|
19
20
|
}
|
|
20
21
|
/** Resolve virtual Auto once per Core turn before request/header persistence. */
|
|
21
22
|
export declare function installAutoModelRouting(ctx: Context, dependencies: AutoModelHostDependencies): () => void;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export declare const MAX_EXCLUDED_MODEL_IDS = 512;
|
|
2
|
+
/** Admission is bound to the native turn and its request signal, not the global picker. */
|
|
3
|
+
export declare class ModelExclusionTurns {
|
|
4
|
+
private readonly turns;
|
|
5
|
+
private readonly signals;
|
|
6
|
+
admit(owner: object, turn: number, model: string, signal: AbortSignal, excluded: ReadonlySet<string>): boolean;
|
|
7
|
+
permits(signal: AbortSignal | undefined, model: string): boolean;
|
|
8
|
+
end(owner: object): void;
|
|
9
|
+
}
|
|
2
10
|
export declare function normalizeExcludedModelIds(value: unknown): readonly string[];
|
|
3
11
|
export declare function excludedModelSet(value: unknown): ReadonlySet<string>;
|
|
4
12
|
export declare function filterExcludedModels<T extends {
|
package/lib/types/remote.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { RemoteResult, TypertRemoteContribution } from '@deepseek-ai/dsh-typert-protocol';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
|
|
6
|
+
import type { GitHubCopilotAuthorizationView, GitHubCopilotModelPreferencesView } from './authorization-controller.ts';
|
|
7
7
|
import type { GitHubCopilotMigrationStatus } from './migration-status.ts';
|
|
8
8
|
declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
9
9
|
interface TypertRemoteNamespaceMap {
|
|
@@ -15,6 +15,7 @@ declare module '@deepseek-ai/dsh-typert-protocol' {
|
|
|
15
15
|
ensureModels(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
16
16
|
excludeModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
17
17
|
restoreModel(modelId: string): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
18
|
+
setModelExcluded(modelId: string, excluded: boolean): Promise<RemoteResult<GitHubCopilotModelPreferencesView>>;
|
|
18
19
|
start(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
19
20
|
cancel(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
20
21
|
signOut(): Promise<RemoteResult<GitHubCopilotAuthorizationView>>;
|
|
@@ -117,6 +118,26 @@ export declare const GitHubCopilotAuthorizationViewSchema: z.ZodObject<{
|
|
|
117
118
|
INTERACTION_NOTICE_OBSERVED: "INTERACTION_NOTICE_OBSERVED";
|
|
118
119
|
}>>;
|
|
119
120
|
}, z.core.$strict>;
|
|
121
|
+
export declare const GitHubCopilotModelPreferencesViewSchema: z.ZodObject<{
|
|
122
|
+
state: z.ZodEnum<{
|
|
123
|
+
error: "error";
|
|
124
|
+
ready: "ready";
|
|
125
|
+
}>;
|
|
126
|
+
writable: z.ZodBoolean;
|
|
127
|
+
revision: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
excludedModelIds: z.ZodArray<z.ZodString>;
|
|
129
|
+
lockedModelIds: z.ZodArray<z.ZodString>;
|
|
130
|
+
unavailableExcludedModelIds: z.ZodArray<z.ZodString>;
|
|
131
|
+
error: z.ZodOptional<z.ZodEnum<{
|
|
132
|
+
COPILOT_MODEL_PREFERENCES_UNAVAILABLE: "COPILOT_MODEL_PREFERENCES_UNAVAILABLE";
|
|
133
|
+
COPILOT_MODEL_EXCLUSION_SELECTED: "COPILOT_MODEL_EXCLUSION_SELECTED";
|
|
134
|
+
COPILOT_MODEL_EXCLUSION_CONFLICT: "COPILOT_MODEL_EXCLUSION_CONFLICT";
|
|
135
|
+
COPILOT_MODEL_EXCLUSION_SAVE_FAILED: "COPILOT_MODEL_EXCLUSION_SAVE_FAILED";
|
|
136
|
+
COPILOT_MODEL_SETTINGS_UNAVAILABLE: "COPILOT_MODEL_SETTINGS_UNAVAILABLE";
|
|
137
|
+
COPILOT_MODEL_SETTINGS_INVALID: "COPILOT_MODEL_SETTINGS_INVALID";
|
|
138
|
+
COPILOT_MODEL_SELECTION_UNAVAILABLE: "COPILOT_MODEL_SELECTION_UNAVAILABLE";
|
|
139
|
+
}>>;
|
|
140
|
+
}, z.core.$strict>;
|
|
120
141
|
export declare const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
|
|
121
142
|
/** Independent Ops result: strict at every object level; no account or private Session data. */
|
|
122
143
|
export declare const GitHubCopilotMigrationStatusSchema: z.ZodObject<{
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
3
|
+
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
4
|
+
import type { TurnSelection, TurnSelectionStore } from './turn-selection.ts';
|
|
5
|
+
/** Public Host binding for the existing bounded, runtime-only decision store. */
|
|
6
|
+
export declare class TurnSelectionController extends TypertRemoteService {
|
|
7
|
+
private readonly selections;
|
|
8
|
+
constructor(ctx: Context, selections: TurnSelectionStore);
|
|
9
|
+
get(agent: Agent, turn: number): TurnSelection;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=turn-selection-host.d.ts.map
|
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.79",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|