dsh-github-copilot 0.4.0-alpha.66 → 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 +1 -1
- package/CHANGELOG.md +6 -0
- package/README.md +8 -8
- package/README.zh.md +8 -8
- package/deployment-baseline.json +4 -2
- package/docs/automatic-model-routing.md +15 -7
- 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 +28 -14
- package/lib/types/auto-model-host.d.ts +1 -0
- package/lib/types/client.d.ts +5 -0
- package/lib/types/config.d.ts +6 -2
- package/lib/types/parent-model-follow-card.d.ts +41 -0
- package/lib/types/parent-model-follow.d.ts +2 -1
- 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
package/lib/index.js
CHANGED
|
@@ -1646,7 +1646,7 @@ let GitHubCopilotUsageController = (() => {
|
|
|
1646
1646
|
//#endregion
|
|
1647
1647
|
//#region package.json
|
|
1648
1648
|
var name$1 = "dsh-github-copilot";
|
|
1649
|
-
var version = "0.4.0-alpha.
|
|
1649
|
+
var version = "0.4.0-alpha.68";
|
|
1650
1650
|
//#endregion
|
|
1651
1651
|
//#region lib/types/probe.js
|
|
1652
1652
|
/**
|
|
@@ -2076,6 +2076,7 @@ function readInlineConfig(config) {
|
|
|
2076
2076
|
childSessionId: binding.childSessionId,
|
|
2077
2077
|
parentSessionId: binding.parentSessionId
|
|
2078
2078
|
})),
|
|
2079
|
+
followParentModel: readConfigValue(config.followParentModel),
|
|
2079
2080
|
searchModel: readConfigValue(config.searchModel),
|
|
2080
2081
|
searchRouting: readConfigValue(config.searchRouting),
|
|
2081
2082
|
temporaryRouteBackup: readConfigValue(config.temporaryRouteBackup)
|
|
@@ -2095,10 +2096,11 @@ const Config = z.object({
|
|
|
2095
2096
|
accountModelTtlMs: z.number().step(1).min(0).max(MAX_TIMEOUT_MS).default(864e5),
|
|
2096
2097
|
accountModelFailureCooldownMs: z.number().step(1).min(0).max(MAX_TIMEOUT_MS).default(3e5),
|
|
2097
2098
|
excludedModelIds: z.array(z.string()).default([]).hidden().volatile(),
|
|
2099
|
+
followParentModel: z.boolean().default(false).volatile(),
|
|
2098
2100
|
parentModelFollow: z.array(z.object({
|
|
2099
2101
|
childSessionId: z.string().min(1),
|
|
2100
2102
|
parentSessionId: z.string().min(1)
|
|
2101
|
-
})).default([]).volatile(),
|
|
2103
|
+
})).default([]).hidden().volatile(),
|
|
2102
2104
|
requestBudgetSafetyTokens: z.number().step(1).min(0).max(Number.MAX_SAFE_INTEGER).default(DEFAULT_REQUEST_BUDGET_POLICY.safetyTokens),
|
|
2103
2105
|
requestBudgetPressureRatio: z.number().step(.01).min(.01).max(1).default(DEFAULT_REQUEST_BUDGET_POLICY.pressureRatio),
|
|
2104
2106
|
compactionReasoning: z.union(["prefer-low", "preserve"]).default(DEFAULT_REQUEST_BUDGET_POLICY.compactionReasoning),
|
|
@@ -6808,16 +6810,20 @@ var ParentModelFollowError = class extends Error {
|
|
|
6808
6810
|
this.name = "ParentModelFollowError";
|
|
6809
6811
|
}
|
|
6810
6812
|
};
|
|
6813
|
+
function supportsParentFollowing(subject) {
|
|
6814
|
+
return !subject.state.blocked && subject.state.descriptor && subject.origin === "subagent";
|
|
6815
|
+
}
|
|
6811
6816
|
/** Resolve a new turn's intent without changing any Session, setting or descriptor. */
|
|
6812
|
-
function resolveParentModel(child, bindings, lookup) {
|
|
6817
|
+
function resolveParentModel(child, bindings, lookup, followAll = false) {
|
|
6813
6818
|
const matches = bindings.filter((binding) => binding.childSessionId === child.id);
|
|
6814
|
-
|
|
6819
|
+
const automatic = matches.length === 0;
|
|
6820
|
+
if (automatic && (!followAll || !supportsParentFollowing(child))) return void 0;
|
|
6815
6821
|
const fail = (code) => {
|
|
6816
6822
|
throw new ParentModelFollowError(`COPILOT_PARENT_MODEL_${code}`);
|
|
6817
6823
|
};
|
|
6818
|
-
if (matches.length !== 1) fail("BINDING_INVALID");
|
|
6819
|
-
if (
|
|
6820
|
-
if (!child.parentId || child.parentId !== matches[0]?.parentSessionId) fail("LINEAGE_INVALID");
|
|
6824
|
+
if (!automatic && matches.length !== 1) fail("BINDING_INVALID");
|
|
6825
|
+
if (!supportsParentFollowing(child)) fail("CHILD_UNSUPPORTED");
|
|
6826
|
+
if (!child.parentId || !automatic && child.parentId !== matches[0]?.parentSessionId) fail("LINEAGE_INVALID");
|
|
6821
6827
|
if (child.state.explicit !== null) return void 0;
|
|
6822
6828
|
const seen = /* @__PURE__ */ new Set([child.id]);
|
|
6823
6829
|
let current = child;
|
|
@@ -6827,17 +6833,23 @@ function resolveParentModel(child, bindings, lookup) {
|
|
|
6827
6833
|
seen.add(parentId);
|
|
6828
6834
|
const parent = lookup(parentId);
|
|
6829
6835
|
if (!parent) return fail("PARENT_UNAVAILABLE");
|
|
6830
|
-
if (parent.state.blocked)
|
|
6836
|
+
if (parent.state.blocked) {
|
|
6837
|
+
if (automatic) return void 0;
|
|
6838
|
+
fail("PARENT_UNSUPPORTED");
|
|
6839
|
+
}
|
|
6831
6840
|
const parentBindings = bindings.filter((binding) => binding.childSessionId === parent.id);
|
|
6832
6841
|
if (parentBindings.length > 1) fail("BINDING_INVALID");
|
|
6833
|
-
if (parentBindings.length === 1 && parent.state.explicit === null) {
|
|
6834
|
-
if (!parent.state.descriptor || parent.origin !== "subagent" || parent.parentId !== parentBindings[0]?.parentSessionId) fail("LINEAGE_INVALID");
|
|
6842
|
+
if ((parentBindings.length === 1 || followAll && supportsParentFollowing(parent)) && parent.state.explicit === null) {
|
|
6843
|
+
if (!parent.state.descriptor || parent.origin !== "subagent" || parentBindings.length === 1 && parent.parentId !== parentBindings[0]?.parentSessionId) fail("LINEAGE_INVALID");
|
|
6835
6844
|
current = parent;
|
|
6836
6845
|
continue;
|
|
6837
6846
|
}
|
|
6838
6847
|
const selection = parent.pending ?? parent.recorded;
|
|
6839
6848
|
if (!selection) return fail("SELECTION_UNAVAILABLE");
|
|
6840
|
-
if (selection.provider !== "github-copilot-preview")
|
|
6849
|
+
if (selection.provider !== "github-copilot-preview") {
|
|
6850
|
+
if (automatic) return void 0;
|
|
6851
|
+
fail("PROVIDER_UNSUPPORTED");
|
|
6852
|
+
}
|
|
6841
6853
|
return { ...selection };
|
|
6842
6854
|
}
|
|
6843
6855
|
}
|
|
@@ -6948,7 +6960,8 @@ function installAutoModelRouting(ctx, dependencies) {
|
|
|
6948
6960
|
if (state.data.turn === previous.turn) return previous.selection;
|
|
6949
6961
|
}
|
|
6950
6962
|
const bindings = dependencies.parentModelBindings?.() ?? [];
|
|
6951
|
-
|
|
6963
|
+
const followAll = dependencies.followParentModel?.() === true;
|
|
6964
|
+
if (!bindings.some((binding) => binding.childSessionId === agent.session.id) && (!followAll || agent.session.header.origin !== "subagent")) return void 0;
|
|
6952
6965
|
const projections = ctx.get("sessionProjections");
|
|
6953
6966
|
if (!record(projections) || typeof projections.register !== "function" || typeof projections.stateOf !== "function") throw failure$1("COPILOT_PARENT_MODEL_PROJECTIONS_UNAVAILABLE");
|
|
6954
6967
|
const stateOf = projections.stateOf;
|
|
@@ -6998,7 +7011,7 @@ function installAutoModelRouting(ctx, dependencies) {
|
|
|
6998
7011
|
const selection = resolveParentModel(child, bindings, (id) => {
|
|
6999
7012
|
if (!record(agents) || typeof agents.get !== "function") return void 0;
|
|
7000
7013
|
return readSubject(agents.get(id));
|
|
7001
|
-
});
|
|
7014
|
+
}, followAll);
|
|
7002
7015
|
followed.set(agent, {
|
|
7003
7016
|
turn: child.state.turn,
|
|
7004
7017
|
selection
|
|
@@ -7880,7 +7893,8 @@ function apply$1(ctx, config = {}) {
|
|
|
7880
7893
|
return (await discoverSnapshot({ signal })).models.filter((model) => !excluded.has(model.id));
|
|
7881
7894
|
},
|
|
7882
7895
|
budgetPolicy: () => budgetSettings(),
|
|
7883
|
-
parentModelBindings: () => cacheSettings().parentModelFollow ?? []
|
|
7896
|
+
parentModelBindings: () => cacheSettings().parentModelFollow ?? [],
|
|
7897
|
+
followParentModel: () => cacheSettings().followParentModel === true
|
|
7884
7898
|
});
|
|
7885
7899
|
const registration = ctx.llm.registerAdapter([GITHUB_COPILOT_PREVIEW_PROVIDER_ID], new PreviewAdapter(lifetime, optionsFor, discoverSnapshot, refreshRejected, budgetSettings, cacheSettings));
|
|
7886
7900
|
let exclusionSignature = JSON.stringify([...excludedModels()]);
|
|
@@ -15,6 +15,7 @@ export interface AutoModelHostDependencies {
|
|
|
15
15
|
loadModels(signal: AbortSignal): Promise<readonly AccountModelDescriptor[]>;
|
|
16
16
|
budgetPolicy?: () => Partial<RequestBudgetPolicy>;
|
|
17
17
|
parentModelBindings?: () => readonly ParentModelBinding[];
|
|
18
|
+
followParentModel?: () => boolean;
|
|
18
19
|
}
|
|
19
20
|
/** Resolve virtual Auto once per Core turn before request/header persistence. */
|
|
20
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
|
@@ -36,6 +36,8 @@ export interface InlineConfig {
|
|
|
36
36
|
excludedModelIds?: string[];
|
|
37
37
|
/** Explicit native child/direct-parent enrollments; empty preserves native routing. */
|
|
38
38
|
parentModelFollow?: ParentModelBinding[];
|
|
39
|
+
/** Profile-wide next-turn policy for supported native children. */
|
|
40
|
+
followParentModel?: boolean;
|
|
39
41
|
/** Estimated managed-route input headroom, separate from truthful catalog capacities. */
|
|
40
42
|
requestBudgetSafetyTokens?: number;
|
|
41
43
|
/** Fraction of admissible input used by eligible automatic-compaction requests. */
|
|
@@ -53,14 +55,16 @@ export interface InlineConfig {
|
|
|
53
55
|
/** Internal JSON backup of route leaves temporarily owned by the GPT-6 overlay. */
|
|
54
56
|
temporaryRouteBackup?: string;
|
|
55
57
|
}
|
|
56
|
-
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow'> & {
|
|
58
|
+
export type LiveInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'> & {
|
|
59
|
+
followParentModel?: boolean | LiveSetting<boolean>;
|
|
57
60
|
parentModelFollow?: ParentModelBinding[] | LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
58
61
|
excludedModelIds?: string[] | LiveSetting<ArrayLike<string>>;
|
|
59
62
|
searchModel?: string | LiveSetting<string | undefined>;
|
|
60
63
|
searchRouting?: WebSearchRoutingConfig | LiveSetting<WebSearchRoutingConfig | undefined>;
|
|
61
64
|
temporaryRouteBackup?: string | LiveSetting<string | undefined>;
|
|
62
65
|
};
|
|
63
|
-
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow'> & {
|
|
66
|
+
export type ResolvedInlineConfig = Omit<InlineConfig, 'searchModel' | 'searchRouting' | 'temporaryRouteBackup' | 'excludedModelIds' | 'parentModelFollow' | 'followParentModel'> & {
|
|
67
|
+
followParentModel: LiveSetting<boolean>;
|
|
64
68
|
parentModelFollow: LiveSetting<ArrayLike<ParentModelBinding>>;
|
|
65
69
|
excludedModelIds: LiveSetting<ArrayLike<string>>;
|
|
66
70
|
searchModel: LiveSetting<string | undefined>;
|
|
@@ -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
|
|
@@ -37,7 +37,8 @@ export interface FollowSubject {
|
|
|
37
37
|
readonly pending: FollowSelection | null;
|
|
38
38
|
readonly recorded?: FollowSelection;
|
|
39
39
|
}
|
|
40
|
+
export declare function supportsParentFollowing(subject: FollowSubject): boolean;
|
|
40
41
|
/** 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 declare function resolveParentModel(child: FollowSubject, bindings: readonly ParentModelBinding[], lookup: (id: string) => FollowSubject | undefined, followAll?: boolean): FollowSelection | undefined;
|
|
42
43
|
export {};
|
|
43
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' | 'parentModelFollow'>;
|
|
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/",
|