dsh-github-copilot 0.4.0-alpha.28 → 0.4.0-alpha.30
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 +4 -2
- package/CHANGELOG.md +15 -0
- package/README.md +15 -14
- package/README.zh.md +15 -14
- package/deployment-baseline.json +35 -1
- package/docs/session-search-routing.md +11 -5
- package/lib/client.js +137 -150
- package/lib/client.js.map +1 -1
- package/lib/index.js +69 -30
- package/lib/types/config.d.ts +1 -1
- package/lib/types/web-search-routing-card.d.ts +1 -2
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -5627,9 +5627,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5627
5627
|
...contribution$1.descriptors
|
|
5628
5628
|
]
|
|
5629
5629
|
};
|
|
5630
|
-
//#endregion
|
|
5631
|
-
//#region lib/types/copilot-identity.js
|
|
5632
|
-
const GITHUB_COPILOT_PROVIDER_ID = "github-copilot";
|
|
5633
5630
|
const GITHUB_COPILOT_PREVIEW_PROVIDER_ID = "github-copilot-preview";
|
|
5634
5631
|
//#endregion
|
|
5635
5632
|
//#region lib/types/reasoning-presentation.js
|
|
@@ -5927,7 +5924,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5927
5924
|
//#region lib/types/web-search-routing-card.js
|
|
5928
5925
|
const GITHUB_COPILOT_SETTINGS_NAMESPACE = "github-copilot";
|
|
5929
5926
|
const WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE = "github-copilot-search-routing";
|
|
5930
|
-
const NO_DEFAULT_SEARCH_PROVIDER = "none";
|
|
5931
5927
|
const GITHUB_COPILOT_SEARCH_PROVIDER = "github-copilot-hosted";
|
|
5932
5928
|
const DEEPSEEK_SEARCH_PROVIDER = "deepseek-official";
|
|
5933
5929
|
const cardStyle$1 = {
|
|
@@ -5945,17 +5941,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5945
5941
|
gap: "6px",
|
|
5946
5942
|
minWidth: 0
|
|
5947
5943
|
};
|
|
5948
|
-
const controlStyle = {
|
|
5949
|
-
width: "100%",
|
|
5950
|
-
minWidth: 0,
|
|
5951
|
-
boxSizing: "border-box",
|
|
5952
|
-
padding: "9px 11px",
|
|
5953
|
-
borderRadius: "9px",
|
|
5954
|
-
color: "inherit",
|
|
5955
|
-
border: "1px solid color-mix(in srgb, currentColor 24%, transparent)",
|
|
5956
|
-
background: "color-mix(in srgb, currentColor 3%, transparent)",
|
|
5957
|
-
font: "inherit"
|
|
5958
|
-
};
|
|
5959
5944
|
const buttonStyle$1 = {
|
|
5960
5945
|
justifySelf: "start",
|
|
5961
5946
|
padding: "9px 16px",
|
|
@@ -5970,7 +5955,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5970
5955
|
opacity: .8,
|
|
5971
5956
|
fontSize: "12px",
|
|
5972
5957
|
lineHeight: 1.5,
|
|
5973
|
-
overflowWrap: "anywhere"
|
|
5958
|
+
overflowWrap: "anywhere",
|
|
5959
|
+
margin: 0
|
|
5974
5960
|
};
|
|
5975
5961
|
function record(value) {
|
|
5976
5962
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
@@ -5978,22 +5964,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5978
5964
|
function revisionOf(value) {
|
|
5979
5965
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
|
|
5980
5966
|
}
|
|
5981
|
-
|
|
5967
|
+
function providerLabel(id) {
|
|
5968
|
+
return id === GITHUB_COPILOT_SEARCH_PROVIDER ? "GitHub Copilot" : id === DEEPSEEK_SEARCH_PROVIDER ? "DeepSeek" : id;
|
|
5969
|
+
}
|
|
5970
|
+
function saveFailure(error) {
|
|
5971
|
+
const code = record(error).code;
|
|
5972
|
+
if (code === "settings-conflict") return "Search settings changed since you opened this page. Reload settings, then review and save your choices again.";
|
|
5973
|
+
if (code === "settings-rejected") return "The settings service rejected this change. Reload settings to check whether editing is available, then try again.";
|
|
5974
|
+
return "Could not confirm the save. Reload settings to check saved values before retrying. Your current choices have been kept.";
|
|
5975
|
+
}
|
|
5976
|
+
/** Save provider routing independently of account discovery and provider-specific model settings. */
|
|
5982
5977
|
function WebSearchRoutingCard(props) {
|
|
5983
5978
|
const [draft, setDraft] = (0, react.useState)({
|
|
5984
5979
|
primary: "auto",
|
|
5985
5980
|
provider: DEEPSEEK_SEARCH_PROVIDER,
|
|
5986
|
-
model: "",
|
|
5987
5981
|
legacy: true
|
|
5988
5982
|
});
|
|
5989
|
-
const [
|
|
5983
|
+
const [override, setOverride] = (0, react.useState)({ model: "" });
|
|
5990
5984
|
const [providers, setProviders] = (0, react.useState)([]);
|
|
5991
5985
|
const [catalogReady, setCatalogReady] = (0, react.useState)(false);
|
|
5992
5986
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
5993
|
-
const [saving, setSaving] = (0, react.useState)(
|
|
5987
|
+
const [saving, setSaving] = (0, react.useState)();
|
|
5994
5988
|
const [writable, setWritable] = (0, react.useState)(false);
|
|
5995
5989
|
const [message, setMessage] = (0, react.useState)("");
|
|
5996
|
-
const [modelNotice, setModelNotice] = (0, react.useState)("");
|
|
5997
5990
|
const lifecycle = (0, react.useRef)({
|
|
5998
5991
|
active: false,
|
|
5999
5992
|
generation: 0,
|
|
@@ -6006,29 +5999,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6006
5999
|
const current = () => owner.active && owner.generation === generation;
|
|
6007
6000
|
owner.busy = true;
|
|
6008
6001
|
setLoading(true);
|
|
6009
|
-
setSaving(
|
|
6002
|
+
setSaving(void 0);
|
|
6010
6003
|
setWritable(false);
|
|
6011
6004
|
setCatalogReady(false);
|
|
6012
6005
|
setMessage("");
|
|
6013
|
-
setModels([]);
|
|
6014
6006
|
setProviders([]);
|
|
6015
|
-
setModelNotice("");
|
|
6016
|
-
const loadModels = async () => {
|
|
6017
|
-
try {
|
|
6018
|
-
const result = await props.copilot.status();
|
|
6019
|
-
if (!current()) return;
|
|
6020
|
-
const parsed = result.ok ? GitHubCopilotAuthorizationViewSchema.safeParse(result.value) : void 0;
|
|
6021
|
-
if (!parsed?.success) {
|
|
6022
|
-
setModelNotice("Model suggestions are unavailable. Enter a model id or reload settings to retry.");
|
|
6023
|
-
return;
|
|
6024
|
-
}
|
|
6025
|
-
const ids = parsed.data.accountModels?.models.filter((item) => item.api === "openai-responses").map((item) => item.id) ?? [];
|
|
6026
|
-
setModels([...new Set(ids)].sort());
|
|
6027
|
-
} catch {
|
|
6028
|
-
if (current()) setModelNotice("Model suggestions are unavailable. Enter a model id or reload settings to retry.");
|
|
6029
|
-
}
|
|
6030
|
-
};
|
|
6031
|
-
loadModels();
|
|
6032
6007
|
try {
|
|
6033
6008
|
const [result, catalog] = await Promise.all([props.settings.describe(), Promise.resolve().then(() => props.routing.providers()).catch(() => void 0)]);
|
|
6034
6009
|
if (!current()) return;
|
|
@@ -6048,9 +6023,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6048
6023
|
primary: normalized.primaryProvider,
|
|
6049
6024
|
provider: normalized.defaultProvider,
|
|
6050
6025
|
legacy: normalized.legacy,
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6026
|
+
routingRevision: revisionOf(routing?.revision)
|
|
6027
|
+
});
|
|
6028
|
+
setOverride({
|
|
6029
|
+
model: typeof copilotValue.searchModel === "string" ? copilotValue.searchModel.trim() : "",
|
|
6030
|
+
revision: revisionOf(copilot?.revision)
|
|
6054
6031
|
});
|
|
6055
6032
|
const parsed = catalog?.ok ? SearchProviderCatalogSchema.safeParse(catalog.value) : void 0;
|
|
6056
6033
|
const ids = parsed?.success ? parsed.data.providers.map((entry) => entry.id) : [];
|
|
@@ -6064,21 +6041,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6064
6041
|
if (!routing || revisionOf(routing.revision) === void 0) setMessage("Web search routing settings are unavailable. Reload after the routing namespace is registered.");
|
|
6065
6042
|
else if (!result.value.writable) setMessage("Search settings are read-only in this deployment.");
|
|
6066
6043
|
} catch {
|
|
6067
|
-
|
|
6044
|
+
if (current()) setMessage("Could not load search settings. Reload settings to retry.");
|
|
6068
6045
|
} finally {
|
|
6069
6046
|
if (current()) {
|
|
6070
6047
|
owner.busy = false;
|
|
6071
6048
|
setLoading(false);
|
|
6072
6049
|
}
|
|
6073
6050
|
}
|
|
6074
|
-
|
|
6075
|
-
if (current()) setMessage(value);
|
|
6076
|
-
}
|
|
6077
|
-
}, [
|
|
6078
|
-
props.copilot,
|
|
6079
|
-
props.settings,
|
|
6080
|
-
props.routing
|
|
6081
|
-
]);
|
|
6051
|
+
}, [props.settings, props.routing]);
|
|
6082
6052
|
(0, react.useEffect)(() => {
|
|
6083
6053
|
const owner = lifecycle.current;
|
|
6084
6054
|
owner.active = true;
|
|
@@ -6090,55 +6060,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6090
6060
|
};
|
|
6091
6061
|
}, [load]);
|
|
6092
6062
|
const usesCopilot = draft.primary === GITHUB_COPILOT_SEARCH_PROVIDER || draft.provider === GITHUB_COPILOT_SEARCH_PROVIDER;
|
|
6093
|
-
const disabled = loading || saving || !writable || draft.routingRevision === void 0 || !catalogReady;
|
|
6094
|
-
const missingCopilot = usesCopilot && draft.copilotRevision === void 0;
|
|
6063
|
+
const disabled = loading || saving !== void 0 || !writable || draft.routingRevision === void 0 || !catalogReady;
|
|
6095
6064
|
const primaryKnown = draft.primary === "auto" || draft.primary === "none" || providers.includes(draft.primary);
|
|
6096
6065
|
const fallbackKnown = draft.provider === "none" || providers.includes(draft.provider);
|
|
6097
6066
|
const missingProvider = !primaryKnown || !fallbackKnown;
|
|
6098
6067
|
const save = (0, react.useCallback)(async () => {
|
|
6099
6068
|
const owner = lifecycle.current;
|
|
6100
|
-
if (!owner.active || owner.busy || disabled
|
|
6069
|
+
if (!owner.active || owner.busy || disabled) return;
|
|
6101
6070
|
if (missingProvider) {
|
|
6102
6071
|
setMessage("Choose a registered search provider, or disable the fallback with None.");
|
|
6103
6072
|
return;
|
|
6104
6073
|
}
|
|
6105
6074
|
const generation = owner.generation;
|
|
6106
6075
|
const current = () => owner.active && owner.generation === generation;
|
|
6107
|
-
const provider = draft.provider, primary = draft.primary
|
|
6108
|
-
if (usesCopilot && model.length === 0) {
|
|
6109
|
-
setMessage("Enter a Copilot Responses model before using GitHub Copilot search.");
|
|
6110
|
-
return;
|
|
6111
|
-
}
|
|
6076
|
+
const provider = draft.provider, primary = draft.primary;
|
|
6112
6077
|
owner.busy = true;
|
|
6113
|
-
setSaving(
|
|
6078
|
+
setSaving("routing");
|
|
6114
6079
|
setMessage("");
|
|
6115
|
-
let modelSaved = false;
|
|
6116
|
-
const saveFailure = () => modelSaved ? "Copilot search model was saved, but routing was not confirmed. Retry Save, or reload settings to review current values. The two namespaces are not saved atomically." : "Search settings could not be saved or confirmed. Retry Save, or reload settings to review current values before retrying.";
|
|
6117
6080
|
try {
|
|
6118
|
-
|
|
6119
|
-
const modelWrite = await props.settings.mutate(GITHUB_COPILOT_SETTINGS_NAMESPACE, [{
|
|
6120
|
-
op: "set",
|
|
6121
|
-
path: ["searchModel"],
|
|
6122
|
-
value: model
|
|
6123
|
-
}], draft.copilotRevision);
|
|
6124
|
-
if (!current()) return;
|
|
6125
|
-
if (!modelWrite.ok) {
|
|
6126
|
-
setMessage(saveFailure());
|
|
6127
|
-
return;
|
|
6128
|
-
}
|
|
6129
|
-
modelSaved = true;
|
|
6130
|
-
const revision = revisionOf(modelWrite.value.revision);
|
|
6131
|
-
setDraft((value) => current() ? {
|
|
6132
|
-
...value,
|
|
6133
|
-
model,
|
|
6134
|
-
copilotRevision: revision
|
|
6135
|
-
} : value);
|
|
6136
|
-
if (revision === void 0) {
|
|
6137
|
-
setMessage(saveFailure());
|
|
6138
|
-
return;
|
|
6139
|
-
}
|
|
6140
|
-
}
|
|
6141
|
-
const routingWrite = await props.settings.mutate(WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE, [{
|
|
6081
|
+
const result = await props.settings.mutate(WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE, [{
|
|
6142
6082
|
op: "set",
|
|
6143
6083
|
path: ["searchProvider"],
|
|
6144
6084
|
value: primary
|
|
@@ -6148,11 +6088,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6148
6088
|
value: provider
|
|
6149
6089
|
}], draft.routingRevision);
|
|
6150
6090
|
if (!current()) return;
|
|
6151
|
-
if (!
|
|
6152
|
-
setMessage(saveFailure());
|
|
6091
|
+
if (!result.ok) {
|
|
6092
|
+
setMessage(saveFailure(result.error));
|
|
6153
6093
|
return;
|
|
6154
6094
|
}
|
|
6155
|
-
const revision = revisionOf(
|
|
6095
|
+
const revision = revisionOf(result.value.revision);
|
|
6156
6096
|
setDraft((value) => current() ? {
|
|
6157
6097
|
...value,
|
|
6158
6098
|
primary,
|
|
@@ -6160,28 +6100,72 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6160
6100
|
routingRevision: revision,
|
|
6161
6101
|
legacy: false
|
|
6162
6102
|
} : value);
|
|
6163
|
-
setMessage(revision === void 0 ? "Save returned no revision. Reload settings before editing again." : "Saved. New searches use this routing
|
|
6164
|
-
} catch {
|
|
6165
|
-
if (current()) setMessage(saveFailure());
|
|
6103
|
+
setMessage(revision === void 0 ? "Save returned no revision. Reload settings before editing again." : "Saved. New searches use this routing. Search availability is checked when you search.");
|
|
6104
|
+
} catch (error) {
|
|
6105
|
+
if (current()) setMessage(saveFailure(error));
|
|
6166
6106
|
} finally {
|
|
6167
6107
|
if (current()) {
|
|
6168
6108
|
owner.busy = false;
|
|
6169
|
-
setSaving(
|
|
6109
|
+
setSaving(void 0);
|
|
6170
6110
|
}
|
|
6171
6111
|
}
|
|
6172
6112
|
}, [
|
|
6173
6113
|
disabled,
|
|
6174
6114
|
draft,
|
|
6175
|
-
missingCopilot,
|
|
6176
6115
|
missingProvider,
|
|
6177
|
-
props.settings
|
|
6178
|
-
|
|
6116
|
+
props.settings
|
|
6117
|
+
]);
|
|
6118
|
+
const clearOverride = (0, react.useCallback)(async () => {
|
|
6119
|
+
const owner = lifecycle.current;
|
|
6120
|
+
if (!owner.active || owner.busy || disabled || override.revision === void 0) return;
|
|
6121
|
+
const generation = owner.generation;
|
|
6122
|
+
const current = () => owner.active && owner.generation === generation;
|
|
6123
|
+
owner.busy = true;
|
|
6124
|
+
setSaving("override");
|
|
6125
|
+
setMessage("");
|
|
6126
|
+
try {
|
|
6127
|
+
const result = await props.settings.mutate(GITHUB_COPILOT_SETTINGS_NAMESPACE, [{
|
|
6128
|
+
op: "set",
|
|
6129
|
+
path: ["searchModel"],
|
|
6130
|
+
value: ""
|
|
6131
|
+
}], override.revision);
|
|
6132
|
+
if (!current()) return;
|
|
6133
|
+
if (!result.ok) {
|
|
6134
|
+
setMessage(saveFailure(result.error));
|
|
6135
|
+
return;
|
|
6136
|
+
}
|
|
6137
|
+
const revision = revisionOf(result.value.revision);
|
|
6138
|
+
if (revision === void 0) {
|
|
6139
|
+
setOverride((value) => ({
|
|
6140
|
+
...value,
|
|
6141
|
+
revision: void 0
|
|
6142
|
+
}));
|
|
6143
|
+
setMessage("Save returned no revision. Reload settings before editing again.");
|
|
6144
|
+
return;
|
|
6145
|
+
}
|
|
6146
|
+
setOverride({
|
|
6147
|
+
model: "",
|
|
6148
|
+
revision
|
|
6149
|
+
});
|
|
6150
|
+
setMessage("Copilot model selection is now automatic. Unsaved provider choices have not been applied.");
|
|
6151
|
+
} catch (error) {
|
|
6152
|
+
if (current()) setMessage(saveFailure(error));
|
|
6153
|
+
} finally {
|
|
6154
|
+
if (current()) {
|
|
6155
|
+
owner.busy = false;
|
|
6156
|
+
setSaving(void 0);
|
|
6157
|
+
}
|
|
6158
|
+
}
|
|
6159
|
+
}, [
|
|
6160
|
+
disabled,
|
|
6161
|
+
override,
|
|
6162
|
+
props.settings
|
|
6179
6163
|
]);
|
|
6180
6164
|
const providerOptions = () => providers.map((id) => (0, react.createElement)("option", {
|
|
6181
6165
|
key: id,
|
|
6182
6166
|
value: id,
|
|
6183
6167
|
style: nativeOptionStyle()
|
|
6184
|
-
}, id));
|
|
6168
|
+
}, providerLabel(id)));
|
|
6185
6169
|
const unavailableOption = (id, known) => known ? null : (0, react.createElement)("option", {
|
|
6186
6170
|
value: id,
|
|
6187
6171
|
disabled: true,
|
|
@@ -6189,7 +6173,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6189
6173
|
}, `${id || "(empty)"} — unavailable`);
|
|
6190
6174
|
return (0, react.createElement)("section", {
|
|
6191
6175
|
style: cardStyle$1,
|
|
6192
|
-
"data-dsh-web-search-routing": true
|
|
6176
|
+
"data-dsh-web-search-routing": true,
|
|
6177
|
+
"aria-busy": loading || saving !== void 0
|
|
6193
6178
|
}, (0, react.createElement)("div", null, (0, react.createElement)("h3", { style: {
|
|
6194
6179
|
margin: 0,
|
|
6195
6180
|
fontSize: "16px"
|
|
@@ -6198,7 +6183,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6198
6183
|
opacity: .8,
|
|
6199
6184
|
fontSize: "13px",
|
|
6200
6185
|
lineHeight: 1.5
|
|
6201
|
-
} }, "
|
|
6186
|
+
} }, "Choose who runs web searches. This does not change your Chat model.")), (0, react.createElement)("label", { style: fieldStyle$1 }, (0, react.createElement)("span", { style: {
|
|
6202
6187
|
fontSize: "13px",
|
|
6203
6188
|
fontWeight: 600
|
|
6204
6189
|
} }, "Search provider"), (0, react.createElement)("select", {
|
|
@@ -6208,6 +6193,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6208
6193
|
"data-dsh-web-search-mode": true,
|
|
6209
6194
|
onChange: (event) => {
|
|
6210
6195
|
const primary = event.currentTarget.value;
|
|
6196
|
+
setMessage("");
|
|
6211
6197
|
setDraft((current) => ({
|
|
6212
6198
|
...current,
|
|
6213
6199
|
primary
|
|
@@ -6219,54 +6205,46 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6219
6205
|
}, "Auto — follow Chat"), draft.primary === "none" ? (0, react.createElement)("option", {
|
|
6220
6206
|
value: "none",
|
|
6221
6207
|
style: nativeOptionStyle()
|
|
6222
|
-
}, "Disabled — saved configuration") : null, ...providerOptions(), unavailableOption(draft.primary, primaryKnown))), (0, react.createElement)("label", { style: fieldStyle$1 }, (0, react.createElement)("span", { style: {
|
|
6208
|
+
}, "Disabled — saved configuration") : null, ...providerOptions(), unavailableOption(draft.primary, primaryKnown)), (0, react.createElement)("span", { style: hintStyle }, "Auto follows the Chat provider when it supports search. A selected provider stays fixed when you switch Chat models.")), (0, react.createElement)("label", { style: fieldStyle$1 }, (0, react.createElement)("span", { style: {
|
|
6223
6209
|
fontSize: "13px",
|
|
6224
6210
|
fontWeight: 600
|
|
6225
|
-
} }, "
|
|
6211
|
+
} }, "Fallback provider"), (0, react.createElement)("select", {
|
|
6226
6212
|
style: nativeSelectStyle(disabled),
|
|
6227
6213
|
disabled,
|
|
6228
6214
|
value: draft.provider,
|
|
6229
6215
|
"data-dsh-web-search-provider": true,
|
|
6230
6216
|
onChange: (event) => {
|
|
6231
6217
|
const provider = event.currentTarget.value;
|
|
6218
|
+
setMessage("");
|
|
6232
6219
|
setDraft((current) => ({
|
|
6233
6220
|
...current,
|
|
6234
6221
|
provider
|
|
6235
6222
|
}));
|
|
6236
6223
|
}
|
|
6237
6224
|
}, (0, react.createElement)("option", {
|
|
6238
|
-
value:
|
|
6225
|
+
value: "none",
|
|
6239
6226
|
style: nativeOptionStyle()
|
|
6240
|
-
}, "None — no fallback"), ...providerOptions(), unavailableOption(draft.provider, fallbackKnown)), (0, react.createElement)("span", { style: hintStyle }, "
|
|
6227
|
+
}, "None — no fallback"), ...providerOptions(), unavailableOption(draft.provider, fallbackKnown)), (0, react.createElement)("span", { style: hintStyle }, "Used if Auto has no matching provider or the primary search fails. May incur the fallback provider’s charges. The same provider is not tried twice.")), catalogReady && providers.length === 0 ? (0, react.createElement)("p", {
|
|
6241
6228
|
role: "status",
|
|
6242
6229
|
style: hintStyle
|
|
6243
6230
|
}, "No search providers are registered. Enable a search provider, then reload settings.") : null, catalogReady && missingProvider ? (0, react.createElement)("p", {
|
|
6244
6231
|
role: "status",
|
|
6245
6232
|
style: hintStyle
|
|
6246
|
-
}, "A saved provider is no longer registered. Choose an available entry; it has not been replaced automatically.") : null, draft.legacy && catalogReady ? (0, react.createElement)("p", { style: hintStyle }, "
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
} }, "Copilot
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
...current,
|
|
6260
|
-
model
|
|
6261
|
-
}));
|
|
6233
|
+
}, "A saved provider is no longer registered. Choose an available entry; it has not been replaced automatically.") : null, draft.legacy && catalogReady ? (0, react.createElement)("p", { style: hintStyle }, "Saving adopts the selected fallback for new searches. Cancellation and account-proof invalidation never trigger fallback.") : null, usesCopilot ? (0, react.createElement)("p", { style: hintStyle }, "Copilot handles search model selection. No model setup is needed here. A signed-in account and a model with verified search support are required when searching.") : null, usesCopilot && override.model ? (0, react.createElement)("details", { "data-dsh-copilot-search-override": true }, (0, react.createElement)("summary", { style: {
|
|
6234
|
+
cursor: "pointer",
|
|
6235
|
+
fontSize: "13px"
|
|
6236
|
+
} }, "Existing Copilot model override"), (0, react.createElement)("div", { style: {
|
|
6237
|
+
...fieldStyle$1,
|
|
6238
|
+
marginTop: "8px"
|
|
6239
|
+
} }, (0, react.createElement)("p", { style: hintStyle }, "Your saved override ", (0, react.createElement)("code", null, override.model), " is preserved. Saving providers does not change it."), (0, react.createElement)("button", {
|
|
6240
|
+
type: "button",
|
|
6241
|
+
style: buttonStyle$1,
|
|
6242
|
+
disabled: disabled || override.revision === void 0,
|
|
6243
|
+
"data-dsh-copilot-search-reset": true,
|
|
6244
|
+
onClick: () => {
|
|
6245
|
+
clearOverride();
|
|
6262
6246
|
}
|
|
6263
|
-
}
|
|
6264
|
-
key: id,
|
|
6265
|
-
value: id
|
|
6266
|
-
}))), (0, react.createElement)("span", { style: hintStyle }, "Used when Copilot is selected explicitly or as the fallback. Account Responses models are suggestions, not hosted-search capability proof. This does not change the Chat model."), missingCopilot ? (0, react.createElement)("span", { role: "status" }, "Copilot search settings are unavailable. Reload after the github-copilot namespace is registered, or choose another provider.") : null, modelNotice ? (0, react.createElement)("span", {
|
|
6267
|
-
role: "status",
|
|
6268
|
-
style: hintStyle
|
|
6269
|
-
}, modelNotice) : null), (0, react.createElement)("div", { style: {
|
|
6247
|
+
}, saving === "override" ? "Updating…" : "Use automatic model selection"))) : null, (0, react.createElement)("div", { style: {
|
|
6270
6248
|
display: "flex",
|
|
6271
6249
|
alignItems: "center",
|
|
6272
6250
|
gap: "12px",
|
|
@@ -6274,24 +6252,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6274
6252
|
} }, (0, react.createElement)("button", {
|
|
6275
6253
|
type: "button",
|
|
6276
6254
|
style: buttonStyle$1,
|
|
6277
|
-
disabled: disabled ||
|
|
6255
|
+
disabled: disabled || missingProvider,
|
|
6278
6256
|
"data-dsh-web-search-save": true,
|
|
6279
6257
|
onClick: () => {
|
|
6280
6258
|
save();
|
|
6281
6259
|
}
|
|
6282
|
-
}, loading ? "Loading…" : saving ? "Saving…" : "Save search routing"), (0, react.createElement)("button", {
|
|
6260
|
+
}, loading ? "Loading…" : saving === "routing" ? "Saving…" : "Save search routing"), (0, react.createElement)("button", {
|
|
6283
6261
|
type: "button",
|
|
6284
6262
|
style: buttonStyle$1,
|
|
6285
|
-
disabled: loading || saving,
|
|
6263
|
+
disabled: loading || saving !== void 0,
|
|
6286
6264
|
title: "Reload saved values and discard unsaved edits",
|
|
6287
6265
|
"data-dsh-web-search-reload": true,
|
|
6288
6266
|
onClick: () => {
|
|
6289
6267
|
load();
|
|
6290
6268
|
}
|
|
6291
|
-
}, "Reload settings"),
|
|
6269
|
+
}, "Reload settings")), (0, react.createElement)("p", {
|
|
6292
6270
|
role: "status",
|
|
6293
|
-
|
|
6294
|
-
|
|
6271
|
+
"aria-live": "polite",
|
|
6272
|
+
"aria-atomic": true,
|
|
6273
|
+
style: {
|
|
6274
|
+
...hintStyle,
|
|
6275
|
+
...message ? {} : { display: "none" }
|
|
6276
|
+
}
|
|
6277
|
+
}, message));
|
|
6295
6278
|
}
|
|
6296
6279
|
//#endregion
|
|
6297
6280
|
//#region lib/types/dual-model-card.js
|
|
@@ -7122,6 +7105,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7122
7105
|
if (writer === void 0) throw new Error("Clipboard access is unavailable");
|
|
7123
7106
|
await writer.writeText(code);
|
|
7124
7107
|
}
|
|
7108
|
+
function verificationLinkTarget() {
|
|
7109
|
+
if (typeof window !== "undefined" && "dshDesktop" in window) {
|
|
7110
|
+
const desktop = window.dshDesktop;
|
|
7111
|
+
if (typeof desktop === "object" && desktop !== null && "protocolVersion" in desktop && desktop.protocolVersion === 1) return "_self";
|
|
7112
|
+
}
|
|
7113
|
+
return "_blank";
|
|
7114
|
+
}
|
|
7125
7115
|
/** Pure presentation for the in-flight GitHub device-code handoff. */
|
|
7126
7116
|
function GitHubCopilotAuthorizationNotice(props) {
|
|
7127
7117
|
const feedback = props.copyState === "copying" ? "Copying code…" : props.copyState === "copied" ? "Code copied to clipboard." : props.copyState === "failed" ? "Copy failed. Select the code and copy it manually." : "";
|
|
@@ -7130,9 +7120,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7130
7120
|
style: noticePanelStyle
|
|
7131
7121
|
}, (0, react.createElement)("div", null, props.message), props.url === void 0 ? null : (0, react.createElement)("a", {
|
|
7132
7122
|
href: props.url,
|
|
7133
|
-
target:
|
|
7123
|
+
target: verificationLinkTarget(),
|
|
7134
7124
|
rel: "noreferrer"
|
|
7135
|
-
}, "Open GitHub verification page"), props.
|
|
7125
|
+
}, "Open GitHub verification page"), props.url === void 0 ? null : (0, react.createElement)("div", null, "If the browser does not open, copy this address into your browser:", (0, react.createElement)("code", {
|
|
7126
|
+
"data-dsh-github-copilot-verification-url": true,
|
|
7127
|
+
style: {
|
|
7128
|
+
display: "block",
|
|
7129
|
+
userSelect: "all",
|
|
7130
|
+
overflowWrap: "anywhere"
|
|
7131
|
+
}
|
|
7132
|
+
}, props.url)), props.code === void 0 ? null : (0, react.createElement)("div", null, (0, react.createElement)("div", { style: {
|
|
7136
7133
|
marginBottom: "0.4rem",
|
|
7137
7134
|
fontWeight: 600
|
|
7138
7135
|
} }, "Your one-time code"), (0, react.createElement)("div", { style: codeRowStyle }, (0, react.createElement)("code", {
|
|
@@ -7646,22 +7643,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7646
7643
|
}, (0, react.createElement)("p", { style: {
|
|
7647
7644
|
margin: "0 0 10px",
|
|
7648
7645
|
fontSize: "13px"
|
|
7649
|
-
} }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models }), routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null
|
|
7646
|
+
} }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models }), routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null) : null);
|
|
7650
7647
|
}
|
|
7651
7648
|
/** Standalone footer presentation; registered Models seats use the shared surface coordinator. */
|
|
7652
7649
|
function GitHubCopilotPreviewFooter(props) {
|
|
7653
7650
|
return (0, react.createElement)("div", { "data-dsh-github-copilot-preview-footer": true }, (0, react.createElement)(GitHubCopilotCompactAccount, { remote: props.remote }));
|
|
7654
7651
|
}
|
|
7655
|
-
function compatibilityDetails() {
|
|
7656
|
-
return (0, react.createElement)("details", { "data-dsh-github-copilot-compatibility": true }, (0, react.createElement)("summary", null, "Compatibility and existing configurations"), (0, react.createElement)("p", null, `GitHub Copilot uses account-discovered models. The internal route ID ${GITHUB_COPILOT_PREVIEW_PROVIDER_ID} is retained for existing sessions and explicit /model selections.`), (0, react.createElement)("p", null, `An existing ${GITHUB_COPILOT_PROVIDER_ID} profile is a legacy configuration, not a second account. It is kept until explicit migration. Sign out disconnects the shared GitHub authorization; it does not remove saved profiles.`), migrationLink());
|
|
7657
|
-
}
|
|
7658
|
-
function migrationLink() {
|
|
7659
|
-
return (0, react.createElement)("a", {
|
|
7660
|
-
href: "https://github.com/cloga/dsh-github-copilot/blob/main/docs/single-route-migration.md",
|
|
7661
|
-
target: "_blank",
|
|
7662
|
-
rel: "noreferrer"
|
|
7663
|
-
}, "Review the single-route migration guide");
|
|
7664
|
-
}
|
|
7665
7652
|
/** Only the mounted canonical row owns embedded controls. Credential presence is not row presence. */
|
|
7666
7653
|
function isGitHubCopilotAccountRow(props) {
|
|
7667
7654
|
return props.configured && props.provider.provider === "github-copilot" && props.provider.settingsNs === "llm-pi-ai";
|
|
@@ -7898,10 +7885,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7898
7885
|
let footerActive = false;
|
|
7899
7886
|
let sectionActive = false;
|
|
7900
7887
|
let fallback;
|
|
7888
|
+
const settings = ctx.remote.settings;
|
|
7889
|
+
const routing = ctx.remote.githubCopilotSearchRouting;
|
|
7901
7890
|
const render = () => (0, react.createElement)(WebSearchRoutingCard, {
|
|
7902
|
-
settings
|
|
7903
|
-
|
|
7904
|
-
routing: ctx.remote.githubCopilotSearchRouting
|
|
7891
|
+
settings,
|
|
7892
|
+
routing
|
|
7905
7893
|
});
|
|
7906
7894
|
const syncFallback = () => {
|
|
7907
7895
|
if (active && sectionActive && !footerActive) fallback ??= ctx.slots.register({
|
|
@@ -7972,7 +7960,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7972
7960
|
throw error;
|
|
7973
7961
|
}
|
|
7974
7962
|
const searchUi = ctx.inject([
|
|
7975
|
-
"remote.githubCopilot",
|
|
7976
7963
|
"remote.settings",
|
|
7977
7964
|
"remote.githubCopilotSearchRouting",
|
|
7978
7965
|
"slots"
|