dsh-github-copilot 0.4.0-alpha.65 → 0.4.0-alpha.68
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 +2 -0
- package/CHANGELOG.md +12 -0
- package/README.md +10 -8
- package/README.zh.md +10 -8
- package/deployment-baseline.json +7 -1
- package/docs/automatic-model-routing.md +127 -4
- package/docs/images/parent-model-follow.png +0 -0
- package/lib/client.js +229 -1
- package/lib/client.js.map +1 -1
- package/lib/index.js +305 -57
- package/lib/types/auto-model-host.d.ts +3 -0
- package/lib/types/client.d.ts +5 -0
- package/lib/types/config.d.ts +11 -2
- package/lib/types/parent-model-follow-card.d.ts +41 -0
- package/lib/types/parent-model-follow.d.ts +44 -0
- package/lib/types/preview-route.d.ts +1 -1
- package/lib/types/web-search-routing-card.d.ts +4 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
|
3
3
|
import type { AccountModelDescriptor } from './account-model-catalog.ts';
|
|
4
4
|
import type { RequestBudgetPolicy } from './request-budget.ts';
|
|
5
5
|
import { TurnSelectionStore } from './turn-selection.ts';
|
|
6
|
+
import type { ParentModelBinding } from './parent-model-follow.ts';
|
|
6
7
|
declare module '@deepseek-ai/cordis' {
|
|
7
8
|
interface Context {
|
|
8
9
|
githubCopilotTurnSelection: {
|
|
@@ -13,6 +14,8 @@ declare module '@deepseek-ai/cordis' {
|
|
|
13
14
|
export interface AutoModelHostDependencies {
|
|
14
15
|
loadModels(signal: AbortSignal): Promise<readonly AccountModelDescriptor[]>;
|
|
15
16
|
budgetPolicy?: () => Partial<RequestBudgetPolicy>;
|
|
17
|
+
parentModelBindings?: () => readonly ParentModelBinding[];
|
|
18
|
+
followParentModel?: () => boolean;
|
|
16
19
|
}
|
|
17
20
|
/** Resolve virtual Auto once per Core turn before request/header persistence. */
|
|
18
21
|
export declare function installAutoModelRouting(ctx: Context, dependencies: AutoModelHostDependencies): () => void;
|
package/lib/types/client.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { CSSProperties, ReactElement } from 'react';
|
|
|
8
8
|
import type { GitHubCopilotAuthorizationView } from './authorization-controller.ts';
|
|
9
9
|
import type { ProviderCardExtrasOwnerProps, SettingsSectionOwnerProps } from './dsh-supported-types.ts';
|
|
10
10
|
export { HostedSearchSettingsCard, WebSearchRoutingCard } from './web-search-routing-card.ts';
|
|
11
|
+
export { ParentModelFollowCard } from './parent-model-follow-card.ts';
|
|
11
12
|
export { CopilotUsageCard } from './copilot-usage-card.ts';
|
|
12
13
|
export { GitHubCopilotModelPreferencesPanel } from './model-preferences-card.ts';
|
|
13
14
|
export declare const inject: string[];
|
|
@@ -103,6 +104,10 @@ export declare function GitHubCopilotAccountSurface(props: GitHubCopilotPreviewF
|
|
|
103
104
|
}): ReactElement | null;
|
|
104
105
|
/** Unified fallback when the Models footer extension is absent or incompatible. */
|
|
105
106
|
export declare function GitHubCopilotSettingsSection(props: GitHubCopilotSettingsSectionProps): ReturnType<typeof createElement>;
|
|
107
|
+
export declare function CopilotPluginSettingsPage(props: {
|
|
108
|
+
settings: ClientContext['remote']['settings'];
|
|
109
|
+
routing: ClientContext['remote']['githubCopilotSearchRouting'];
|
|
110
|
+
}): import("react").DetailedReactHTMLElement<import("react").HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
106
111
|
/** Mount the plugin-owned Remote namespace and register the Models card seat. */
|
|
107
112
|
export declare function apply(ctx: ClientContext): Promise<() => Promise<void>>;
|
|
108
113
|
//# sourceMappingURL=client.d.ts.map
|
package/lib/types/config.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import z from '@deepseek-ai/schemastery';
|
|
|
8
8
|
import type { RequestBudgetPolicy } from './request-budget.ts';
|
|
9
9
|
import type { WebSearchRoutingConfig } from './web-search-routing-config.ts';
|
|
10
10
|
import type { LiveSetting } from './settings-reader.ts';
|
|
11
|
+
import type { ParentModelBinding } from './parent-model-follow.ts';
|
|
11
12
|
/** Plugin configuration. Defaults make the current chat route decide. */
|
|
12
13
|
export interface InlineConfig {
|
|
13
14
|
/** Master switch; false sends every request down the normal adapter path. */
|
|
@@ -33,6 +34,10 @@ export interface InlineConfig {
|
|
|
33
34
|
accountModelFailureCooldownMs?: number;
|
|
34
35
|
/** Exact account model IDs hidden from the managed directory and every Auto candidate pool. */
|
|
35
36
|
excludedModelIds?: string[];
|
|
37
|
+
/** Explicit native child/direct-parent enrollments; empty preserves native routing. */
|
|
38
|
+
parentModelFollow?: ParentModelBinding[];
|
|
39
|
+
/** Profile-wide next-turn policy for supported native children. */
|
|
40
|
+
followParentModel?: boolean;
|
|
36
41
|
/** Estimated managed-route input headroom, separate from truthful catalog capacities. */
|
|
37
42
|
requestBudgetSafetyTokens?: number;
|
|
38
43
|
/** Fraction of admissible input used by eligible automatic-compaction requests. */
|
|
@@ -50,13 +55,17 @@ export interface InlineConfig {
|
|
|
50
55
|
/** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
|
|
51
56
|
temporaryRouteBackup?: string;
|
|
52
57
|
}
|
|
53
|
-
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds'> & {
|
|
58
|
+
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'> & {
|
|
59
|
+
followParentModel?: boolean | LiveSetting<boolean>;
|
|
60
|
+
parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
54
61
|
excludedModelIds?: string[] | LiveSetting<ArrayLike<string>>;
|
|
55
62
|
searchModel?: string | LiveSetting<string | undefined>;
|
|
56
63
|
searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
|
|
57
64
|
temporaryRouteBackup?: string | LiveSetting<string | undefined>;
|
|
58
65
|
};
|
|
59
|
-
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds'> & {
|
|
66
|
+
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'> & {
|
|
67
|
+
followParentModel: LiveSetting<boolean>;
|
|
68
|
+
parentModelFollow: LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
60
69
|
excludedModelIds: LiveSetting<ArrayLike<string>>;
|
|
61
70
|
searchModel: LiveSetting<string | undefined>;
|
|
62
71
|
searchRouting: LiveSetting<WebSearchRoutingConfig>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
type Settings = Context['remote']['settings'];
|
|
3
|
+
interface Snapshot {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
revision: number;
|
|
6
|
+
writable: boolean;
|
|
7
|
+
legacy: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
settings: Settings;
|
|
11
|
+
onSaved?: (revision: {
|
|
12
|
+
previous: number;
|
|
13
|
+
next: number;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function readParentFollowSettings(settings: Settings): Promise<Snapshot>;
|
|
17
|
+
export declare function saveParentFollowSettings(settings: Settings, saved: Snapshot, enabled: boolean): Promise<{
|
|
18
|
+
snapshot: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
revision: number;
|
|
21
|
+
writable: boolean;
|
|
22
|
+
legacy: boolean;
|
|
23
|
+
};
|
|
24
|
+
revision: {
|
|
25
|
+
previous: number;
|
|
26
|
+
next: number;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export declare function ParentModelFollowCard({ settings, onSaved }: Props): import("react").DetailedReactHTMLElement<{
|
|
30
|
+
'data-dsh-parent-model-follow': boolean;
|
|
31
|
+
'aria-busy': boolean;
|
|
32
|
+
style: {
|
|
33
|
+
padding: string;
|
|
34
|
+
marginTop: string;
|
|
35
|
+
display: "grid";
|
|
36
|
+
gap: string;
|
|
37
|
+
minWidth: number;
|
|
38
|
+
};
|
|
39
|
+
}, HTMLElement>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=parent-model-follow-card.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** Explicit enrollment, never inferred from equality of parent and child models. */
|
|
2
|
+
export interface ParentModelBinding {
|
|
3
|
+
readonly childSessionId: string;
|
|
4
|
+
readonly parentSessionId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface FollowSelection {
|
|
7
|
+
readonly provider: string;
|
|
8
|
+
readonly model: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FollowState {
|
|
11
|
+
readonly inherited: number;
|
|
12
|
+
readonly turn: number | null;
|
|
13
|
+
readonly started: boolean;
|
|
14
|
+
readonly explicit: FollowSelection | null;
|
|
15
|
+
readonly descriptor: boolean;
|
|
16
|
+
readonly blocked: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Event {
|
|
19
|
+
readonly seq: number;
|
|
20
|
+
readonly type: string;
|
|
21
|
+
readonly data: unknown;
|
|
22
|
+
}
|
|
23
|
+
export declare const PARENT_MODEL_FOLLOW_PROJECTION = "githubCopilotParentModelFollow";
|
|
24
|
+
export declare function followSelection(value: unknown): FollowSelection | undefined;
|
|
25
|
+
export declare function initialFollowState(inherited?: number): FollowState;
|
|
26
|
+
/** Fold only the child's own suffix; copied fork selections are not child overrides. */
|
|
27
|
+
export declare function foldFollowState(state: FollowState, event: Event): FollowState;
|
|
28
|
+
export declare class ParentModelFollowError extends Error {
|
|
29
|
+
readonly code: string;
|
|
30
|
+
constructor(code: string);
|
|
31
|
+
}
|
|
32
|
+
export interface FollowSubject {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly parentId?: string;
|
|
35
|
+
readonly origin?: string;
|
|
36
|
+
readonly state: FollowState;
|
|
37
|
+
readonly pending: FollowSelection | null;
|
|
38
|
+
readonly recorded?: FollowSelection;
|
|
39
|
+
}
|
|
40
|
+
export declare function supportsParentFollowing(subject: FollowSubject): boolean;
|
|
41
|
+
/** Resolve a new turn's intent without changing any Session, setting or descriptor. */
|
|
42
|
+
export declare function resolveParentModel(child: FollowSubject, bindings: readonly ParentModelBinding[], lookup: (id: string) => FollowSubject | undefined, followAll?: boolean): FollowSelection | undefined;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=parent-model-follow.d.ts.map
|
|
@@ -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' | 'excludedModelIds'>;
|
|
10
|
+
readonly accountModelSettings?: () => Pick<InlineConfig, 'accountModelTtlMs' | 'accountModelFailureCooldownMs' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'>;
|
|
11
11
|
readonly requestBudget?: Partial<RequestBudgetPolicy>;
|
|
12
12
|
readonly requestBudgetSettings?: () => Partial<RequestBudgetPolicy>;
|
|
13
13
|
};
|
|
@@ -3,6 +3,10 @@ import type { ReactElement } from 'react';
|
|
|
3
3
|
interface SearchRoutingCardProps {
|
|
4
4
|
readonly settings: ClientContext['remote']['settings'];
|
|
5
5
|
readonly routing: ClientContext['remote']['githubCopilotSearchRouting'];
|
|
6
|
+
readonly settingsRevision?: {
|
|
7
|
+
previous: number;
|
|
8
|
+
next: number;
|
|
9
|
+
};
|
|
6
10
|
}
|
|
7
11
|
/** Edit only explicit Copilot hosted-search leaves; provider routing remains a separate CAS. */
|
|
8
12
|
export declare function HostedSearchSettingsCard({ settings }: Pick<SearchRoutingCardProps, 'settings'>): ReactElement;
|
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.68",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|