dsh-github-copilot 0.4.0-alpha.64 → 0.4.0-alpha.66
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 +12 -8
- package/README.zh.md +12 -8
- package/deployment-baseline.json +9 -1
- package/docs/automatic-model-routing.md +122 -7
- package/docs/copilot-compaction.md +4 -0
- package/lib/index.js +321 -90
- package/lib/types/auto-model-host.d.ts +2 -0
- package/lib/types/auto-model-routing.d.ts +5 -3
- package/lib/types/config.d.ts +7 -2
- package/lib/types/parent-model-follow.d.ts +43 -0
- package/lib/types/preview-route.d.ts +1 -1
- 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,7 @@ 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[];
|
|
16
18
|
}
|
|
17
19
|
/** Resolve virtual Auto once per Core turn before request/header persistence. */
|
|
18
20
|
export declare function installAutoModelRouting(ctx: Context, dependencies: AutoModelHostDependencies): () => void;
|
|
@@ -21,6 +21,8 @@ export interface AutoModelDecision {
|
|
|
21
21
|
readonly inputFitDiagnostic: AutoModelInputFitDiagnostic;
|
|
22
22
|
}
|
|
23
23
|
export interface AutoModelRoutingContext {
|
|
24
|
+
readonly estimateMessage?: (message: unknown) => number;
|
|
25
|
+
readonly inputTokenFloor?: number;
|
|
24
26
|
readonly sessionId?: string;
|
|
25
27
|
readonly turn?: number;
|
|
26
28
|
readonly requestedMaxTokens?: number;
|
|
@@ -30,11 +32,11 @@ export interface AutoModelRoutingContext {
|
|
|
30
32
|
readonly hasCompactionSummary?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export declare class AutoModelRoutingError extends Error {
|
|
33
|
-
readonly code: 'COPILOT_AUTO_NO_ELIGIBLE_MODEL';
|
|
34
|
-
constructor(code: 'COPILOT_AUTO_NO_ELIGIBLE_MODEL');
|
|
35
|
+
readonly code: 'COPILOT_AUTO_NO_ELIGIBLE_MODEL' | 'COPILOT_AUTO_TOKEN_METER_UNAVAILABLE' | 'COPILOT_AUTO_TOKEN_ESTIMATE_INVALID';
|
|
36
|
+
constructor(code: 'COPILOT_AUTO_NO_ELIGIBLE_MODEL' | 'COPILOT_AUTO_TOKEN_METER_UNAVAILABLE' | 'COPILOT_AUTO_TOKEN_ESTIMATE_INVALID');
|
|
35
37
|
}
|
|
36
38
|
export declare function classifyAutoModelTurn(messages: readonly unknown[]): AutoModelFeatures;
|
|
37
|
-
export declare function estimateTurnInputTokens(messages: readonly unknown[]): number;
|
|
39
|
+
export declare function estimateTurnInputTokens(messages: readonly unknown[], estimateMessage?: (message: unknown) => number): number;
|
|
38
40
|
/**
|
|
39
41
|
* Filter by hard capabilities and input headroom before soft preference.
|
|
40
42
|
* Soft preferences distribute across capacity bands using in-memory deterministic seeds.
|
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,8 @@ 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[];
|
|
36
39
|
/** Estimated managed-route input headroom, separate from truthful catalog capacities. */
|
|
37
40
|
requestBudgetSafetyTokens?: number;
|
|
38
41
|
/** Fraction of admissible input used by eligible automatic-compaction requests. */
|
|
@@ -50,13 +53,15 @@ export interface InlineConfig {
|
|
|
50
53
|
/** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
|
|
51
54
|
temporaryRouteBackup?: string;
|
|
52
55
|
}
|
|
53
|
-
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds'> & {
|
|
56
|
+
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow'> & {
|
|
57
|
+
parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
54
58
|
excludedModelIds?: string[] | LiveSetting<ArrayLike<string>>;
|
|
55
59
|
searchModel?: string | LiveSetting<string | undefined>;
|
|
56
60
|
searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
|
|
57
61
|
temporaryRouteBackup?: string | LiveSetting<string | undefined>;
|
|
58
62
|
};
|
|
59
|
-
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds'> & {
|
|
63
|
+
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow'> & {
|
|
64
|
+
parentModelFollow: LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
60
65
|
excludedModelIds: LiveSetting<ArrayLike<string>>;
|
|
61
66
|
searchModel: LiveSetting<string | undefined>;
|
|
62
67
|
searchRouting: LiveSetting<WebSearchRoutingConfig>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/** Resolve a new turn's intent without changing any Session, setting or descriptor. */
|
|
41
|
+
export declare function resolveParentModel(child: FollowSubject, bindings: readonly ParentModelBinding[], lookup: (id: string) => FollowSubject | undefined): FollowSelection | undefined;
|
|
42
|
+
export {};
|
|
43
|
+
//# 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'>;
|
|
11
11
|
readonly requestBudget?: Partial<RequestBudgetPolicy>;
|
|
12
12
|
readonly requestBudgetSettings?: () => Partial<RequestBudgetPolicy>;
|
|
13
13
|
};
|
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.66",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"registry": "https://registry.npmjs.org/",
|