dsh-github-copilot 0.4.0-alpha.28 → 0.4.0-alpha.29
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 +3 -2
- package/CHANGELOG.md +8 -0
- package/README.md +13 -12
- package/README.zh.md +13 -12
- package/deployment-baseline.json +29 -1
- package/docs/session-search-routing.md +11 -5
- package/lib/client.js +120 -134
- 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
|
@@ -5927,7 +5927,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5927
5927
|
//#region lib/types/web-search-routing-card.js
|
|
5928
5928
|
const GITHUB_COPILOT_SETTINGS_NAMESPACE = "github-copilot";
|
|
5929
5929
|
const WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE = "github-copilot-search-routing";
|
|
5930
|
-
const NO_DEFAULT_SEARCH_PROVIDER = "none";
|
|
5931
5930
|
const GITHUB_COPILOT_SEARCH_PROVIDER = "github-copilot-hosted";
|
|
5932
5931
|
const DEEPSEEK_SEARCH_PROVIDER = "deepseek-official";
|
|
5933
5932
|
const cardStyle$1 = {
|
|
@@ -5945,17 +5944,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5945
5944
|
gap: "6px",
|
|
5946
5945
|
minWidth: 0
|
|
5947
5946
|
};
|
|
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
5947
|
const buttonStyle$1 = {
|
|
5960
5948
|
justifySelf: "start",
|
|
5961
5949
|
padding: "9px 16px",
|
|
@@ -5970,7 +5958,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5970
5958
|
opacity: .8,
|
|
5971
5959
|
fontSize: "12px",
|
|
5972
5960
|
lineHeight: 1.5,
|
|
5973
|
-
overflowWrap: "anywhere"
|
|
5961
|
+
overflowWrap: "anywhere",
|
|
5962
|
+
margin: 0
|
|
5974
5963
|
};
|
|
5975
5964
|
function record(value) {
|
|
5976
5965
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
|
|
@@ -5978,22 +5967,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5978
5967
|
function revisionOf(value) {
|
|
5979
5968
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : void 0;
|
|
5980
5969
|
}
|
|
5981
|
-
|
|
5970
|
+
function providerLabel(id) {
|
|
5971
|
+
return id === GITHUB_COPILOT_SEARCH_PROVIDER ? "GitHub Copilot" : id === DEEPSEEK_SEARCH_PROVIDER ? "DeepSeek" : id;
|
|
5972
|
+
}
|
|
5973
|
+
function saveFailure(error) {
|
|
5974
|
+
const code = record(error).code;
|
|
5975
|
+
if (code === "settings-conflict") return "Search settings changed since you opened this page. Reload settings, then review and save your choices again.";
|
|
5976
|
+
if (code === "settings-rejected") return "The settings service rejected this change. Reload settings to check whether editing is available, then try again.";
|
|
5977
|
+
return "Could not confirm the save. Reload settings to check saved values before retrying. Your current choices have been kept.";
|
|
5978
|
+
}
|
|
5979
|
+
/** Save provider routing independently of account discovery and provider-specific model settings. */
|
|
5982
5980
|
function WebSearchRoutingCard(props) {
|
|
5983
5981
|
const [draft, setDraft] = (0, react.useState)({
|
|
5984
5982
|
primary: "auto",
|
|
5985
5983
|
provider: DEEPSEEK_SEARCH_PROVIDER,
|
|
5986
|
-
model: "",
|
|
5987
5984
|
legacy: true
|
|
5988
5985
|
});
|
|
5989
|
-
const [
|
|
5986
|
+
const [override, setOverride] = (0, react.useState)({ model: "" });
|
|
5990
5987
|
const [providers, setProviders] = (0, react.useState)([]);
|
|
5991
5988
|
const [catalogReady, setCatalogReady] = (0, react.useState)(false);
|
|
5992
5989
|
const [loading, setLoading] = (0, react.useState)(true);
|
|
5993
|
-
const [saving, setSaving] = (0, react.useState)(
|
|
5990
|
+
const [saving, setSaving] = (0, react.useState)();
|
|
5994
5991
|
const [writable, setWritable] = (0, react.useState)(false);
|
|
5995
5992
|
const [message, setMessage] = (0, react.useState)("");
|
|
5996
|
-
const [modelNotice, setModelNotice] = (0, react.useState)("");
|
|
5997
5993
|
const lifecycle = (0, react.useRef)({
|
|
5998
5994
|
active: false,
|
|
5999
5995
|
generation: 0,
|
|
@@ -6006,29 +6002,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6006
6002
|
const current = () => owner.active && owner.generation === generation;
|
|
6007
6003
|
owner.busy = true;
|
|
6008
6004
|
setLoading(true);
|
|
6009
|
-
setSaving(
|
|
6005
|
+
setSaving(void 0);
|
|
6010
6006
|
setWritable(false);
|
|
6011
6007
|
setCatalogReady(false);
|
|
6012
6008
|
setMessage("");
|
|
6013
|
-
setModels([]);
|
|
6014
6009
|
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
6010
|
try {
|
|
6033
6011
|
const [result, catalog] = await Promise.all([props.settings.describe(), Promise.resolve().then(() => props.routing.providers()).catch(() => void 0)]);
|
|
6034
6012
|
if (!current()) return;
|
|
@@ -6048,9 +6026,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6048
6026
|
primary: normalized.primaryProvider,
|
|
6049
6027
|
provider: normalized.defaultProvider,
|
|
6050
6028
|
legacy: normalized.legacy,
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6029
|
+
routingRevision: revisionOf(routing?.revision)
|
|
6030
|
+
});
|
|
6031
|
+
setOverride({
|
|
6032
|
+
model: typeof copilotValue.searchModel === "string" ? copilotValue.searchModel.trim() : "",
|
|
6033
|
+
revision: revisionOf(copilot?.revision)
|
|
6054
6034
|
});
|
|
6055
6035
|
const parsed = catalog?.ok ? SearchProviderCatalogSchema.safeParse(catalog.value) : void 0;
|
|
6056
6036
|
const ids = parsed?.success ? parsed.data.providers.map((entry) => entry.id) : [];
|
|
@@ -6064,21 +6044,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6064
6044
|
if (!routing || revisionOf(routing.revision) === void 0) setMessage("Web search routing settings are unavailable. Reload after the routing namespace is registered.");
|
|
6065
6045
|
else if (!result.value.writable) setMessage("Search settings are read-only in this deployment.");
|
|
6066
6046
|
} catch {
|
|
6067
|
-
|
|
6047
|
+
if (current()) setMessage("Could not load search settings. Reload settings to retry.");
|
|
6068
6048
|
} finally {
|
|
6069
6049
|
if (current()) {
|
|
6070
6050
|
owner.busy = false;
|
|
6071
6051
|
setLoading(false);
|
|
6072
6052
|
}
|
|
6073
6053
|
}
|
|
6074
|
-
|
|
6075
|
-
if (current()) setMessage(value);
|
|
6076
|
-
}
|
|
6077
|
-
}, [
|
|
6078
|
-
props.copilot,
|
|
6079
|
-
props.settings,
|
|
6080
|
-
props.routing
|
|
6081
|
-
]);
|
|
6054
|
+
}, [props.settings, props.routing]);
|
|
6082
6055
|
(0, react.useEffect)(() => {
|
|
6083
6056
|
const owner = lifecycle.current;
|
|
6084
6057
|
owner.active = true;
|
|
@@ -6090,55 +6063,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6090
6063
|
};
|
|
6091
6064
|
}, [load]);
|
|
6092
6065
|
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;
|
|
6066
|
+
const disabled = loading || saving !== void 0 || !writable || draft.routingRevision === void 0 || !catalogReady;
|
|
6095
6067
|
const primaryKnown = draft.primary === "auto" || draft.primary === "none" || providers.includes(draft.primary);
|
|
6096
6068
|
const fallbackKnown = draft.provider === "none" || providers.includes(draft.provider);
|
|
6097
6069
|
const missingProvider = !primaryKnown || !fallbackKnown;
|
|
6098
6070
|
const save = (0, react.useCallback)(async () => {
|
|
6099
6071
|
const owner = lifecycle.current;
|
|
6100
|
-
if (!owner.active || owner.busy || disabled
|
|
6072
|
+
if (!owner.active || owner.busy || disabled) return;
|
|
6101
6073
|
if (missingProvider) {
|
|
6102
6074
|
setMessage("Choose a registered search provider, or disable the fallback with None.");
|
|
6103
6075
|
return;
|
|
6104
6076
|
}
|
|
6105
6077
|
const generation = owner.generation;
|
|
6106
6078
|
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
|
-
}
|
|
6079
|
+
const provider = draft.provider, primary = draft.primary;
|
|
6112
6080
|
owner.busy = true;
|
|
6113
|
-
setSaving(
|
|
6081
|
+
setSaving("routing");
|
|
6114
6082
|
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
6083
|
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, [{
|
|
6084
|
+
const result = await props.settings.mutate(WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE, [{
|
|
6142
6085
|
op: "set",
|
|
6143
6086
|
path: ["searchProvider"],
|
|
6144
6087
|
value: primary
|
|
@@ -6148,11 +6091,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6148
6091
|
value: provider
|
|
6149
6092
|
}], draft.routingRevision);
|
|
6150
6093
|
if (!current()) return;
|
|
6151
|
-
if (!
|
|
6152
|
-
setMessage(saveFailure());
|
|
6094
|
+
if (!result.ok) {
|
|
6095
|
+
setMessage(saveFailure(result.error));
|
|
6153
6096
|
return;
|
|
6154
6097
|
}
|
|
6155
|
-
const revision = revisionOf(
|
|
6098
|
+
const revision = revisionOf(result.value.revision);
|
|
6156
6099
|
setDraft((value) => current() ? {
|
|
6157
6100
|
...value,
|
|
6158
6101
|
primary,
|
|
@@ -6160,28 +6103,72 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6160
6103
|
routingRevision: revision,
|
|
6161
6104
|
legacy: false
|
|
6162
6105
|
} : 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());
|
|
6106
|
+
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.");
|
|
6107
|
+
} catch (error) {
|
|
6108
|
+
if (current()) setMessage(saveFailure(error));
|
|
6166
6109
|
} finally {
|
|
6167
6110
|
if (current()) {
|
|
6168
6111
|
owner.busy = false;
|
|
6169
|
-
setSaving(
|
|
6112
|
+
setSaving(void 0);
|
|
6170
6113
|
}
|
|
6171
6114
|
}
|
|
6172
6115
|
}, [
|
|
6173
6116
|
disabled,
|
|
6174
6117
|
draft,
|
|
6175
|
-
missingCopilot,
|
|
6176
6118
|
missingProvider,
|
|
6177
|
-
props.settings
|
|
6178
|
-
|
|
6119
|
+
props.settings
|
|
6120
|
+
]);
|
|
6121
|
+
const clearOverride = (0, react.useCallback)(async () => {
|
|
6122
|
+
const owner = lifecycle.current;
|
|
6123
|
+
if (!owner.active || owner.busy || disabled || override.revision === void 0) return;
|
|
6124
|
+
const generation = owner.generation;
|
|
6125
|
+
const current = () => owner.active && owner.generation === generation;
|
|
6126
|
+
owner.busy = true;
|
|
6127
|
+
setSaving("override");
|
|
6128
|
+
setMessage("");
|
|
6129
|
+
try {
|
|
6130
|
+
const result = await props.settings.mutate(GITHUB_COPILOT_SETTINGS_NAMESPACE, [{
|
|
6131
|
+
op: "set",
|
|
6132
|
+
path: ["searchModel"],
|
|
6133
|
+
value: ""
|
|
6134
|
+
}], override.revision);
|
|
6135
|
+
if (!current()) return;
|
|
6136
|
+
if (!result.ok) {
|
|
6137
|
+
setMessage(saveFailure(result.error));
|
|
6138
|
+
return;
|
|
6139
|
+
}
|
|
6140
|
+
const revision = revisionOf(result.value.revision);
|
|
6141
|
+
if (revision === void 0) {
|
|
6142
|
+
setOverride((value) => ({
|
|
6143
|
+
...value,
|
|
6144
|
+
revision: void 0
|
|
6145
|
+
}));
|
|
6146
|
+
setMessage("Save returned no revision. Reload settings before editing again.");
|
|
6147
|
+
return;
|
|
6148
|
+
}
|
|
6149
|
+
setOverride({
|
|
6150
|
+
model: "",
|
|
6151
|
+
revision
|
|
6152
|
+
});
|
|
6153
|
+
setMessage("Copilot model selection is now automatic. Unsaved provider choices have not been applied.");
|
|
6154
|
+
} catch (error) {
|
|
6155
|
+
if (current()) setMessage(saveFailure(error));
|
|
6156
|
+
} finally {
|
|
6157
|
+
if (current()) {
|
|
6158
|
+
owner.busy = false;
|
|
6159
|
+
setSaving(void 0);
|
|
6160
|
+
}
|
|
6161
|
+
}
|
|
6162
|
+
}, [
|
|
6163
|
+
disabled,
|
|
6164
|
+
override,
|
|
6165
|
+
props.settings
|
|
6179
6166
|
]);
|
|
6180
6167
|
const providerOptions = () => providers.map((id) => (0, react.createElement)("option", {
|
|
6181
6168
|
key: id,
|
|
6182
6169
|
value: id,
|
|
6183
6170
|
style: nativeOptionStyle()
|
|
6184
|
-
}, id));
|
|
6171
|
+
}, providerLabel(id)));
|
|
6185
6172
|
const unavailableOption = (id, known) => known ? null : (0, react.createElement)("option", {
|
|
6186
6173
|
value: id,
|
|
6187
6174
|
disabled: true,
|
|
@@ -6189,7 +6176,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6189
6176
|
}, `${id || "(empty)"} — unavailable`);
|
|
6190
6177
|
return (0, react.createElement)("section", {
|
|
6191
6178
|
style: cardStyle$1,
|
|
6192
|
-
"data-dsh-web-search-routing": true
|
|
6179
|
+
"data-dsh-web-search-routing": true,
|
|
6180
|
+
"aria-busy": loading || saving !== void 0
|
|
6193
6181
|
}, (0, react.createElement)("div", null, (0, react.createElement)("h3", { style: {
|
|
6194
6182
|
margin: 0,
|
|
6195
6183
|
fontSize: "16px"
|
|
@@ -6198,7 +6186,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6198
6186
|
opacity: .8,
|
|
6199
6187
|
fontSize: "13px",
|
|
6200
6188
|
lineHeight: 1.5
|
|
6201
|
-
} }, "
|
|
6189
|
+
} }, "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
6190
|
fontSize: "13px",
|
|
6203
6191
|
fontWeight: 600
|
|
6204
6192
|
} }, "Search provider"), (0, react.createElement)("select", {
|
|
@@ -6208,6 +6196,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6208
6196
|
"data-dsh-web-search-mode": true,
|
|
6209
6197
|
onChange: (event) => {
|
|
6210
6198
|
const primary = event.currentTarget.value;
|
|
6199
|
+
setMessage("");
|
|
6211
6200
|
setDraft((current) => ({
|
|
6212
6201
|
...current,
|
|
6213
6202
|
primary
|
|
@@ -6219,54 +6208,46 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6219
6208
|
}, "Auto — follow Chat"), draft.primary === "none" ? (0, react.createElement)("option", {
|
|
6220
6209
|
value: "none",
|
|
6221
6210
|
style: nativeOptionStyle()
|
|
6222
|
-
}, "Disabled — saved configuration") : null, ...providerOptions(), unavailableOption(draft.primary, primaryKnown))), (0, react.createElement)("label", { style: fieldStyle$1 }, (0, react.createElement)("span", { style: {
|
|
6211
|
+
}, "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
6212
|
fontSize: "13px",
|
|
6224
6213
|
fontWeight: 600
|
|
6225
|
-
} }, "
|
|
6214
|
+
} }, "Fallback provider"), (0, react.createElement)("select", {
|
|
6226
6215
|
style: nativeSelectStyle(disabled),
|
|
6227
6216
|
disabled,
|
|
6228
6217
|
value: draft.provider,
|
|
6229
6218
|
"data-dsh-web-search-provider": true,
|
|
6230
6219
|
onChange: (event) => {
|
|
6231
6220
|
const provider = event.currentTarget.value;
|
|
6221
|
+
setMessage("");
|
|
6232
6222
|
setDraft((current) => ({
|
|
6233
6223
|
...current,
|
|
6234
6224
|
provider
|
|
6235
6225
|
}));
|
|
6236
6226
|
}
|
|
6237
6227
|
}, (0, react.createElement)("option", {
|
|
6238
|
-
value:
|
|
6228
|
+
value: "none",
|
|
6239
6229
|
style: nativeOptionStyle()
|
|
6240
|
-
}, "None — no fallback"), ...providerOptions(), unavailableOption(draft.provider, fallbackKnown)), (0, react.createElement)("span", { style: hintStyle }, "
|
|
6230
|
+
}, "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
6231
|
role: "status",
|
|
6242
6232
|
style: hintStyle
|
|
6243
6233
|
}, "No search providers are registered. Enable a search provider, then reload settings.") : null, catalogReady && missingProvider ? (0, react.createElement)("p", {
|
|
6244
6234
|
role: "status",
|
|
6245
6235
|
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
|
-
}));
|
|
6236
|
+
}, "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: {
|
|
6237
|
+
cursor: "pointer",
|
|
6238
|
+
fontSize: "13px"
|
|
6239
|
+
} }, "Existing Copilot model override"), (0, react.createElement)("div", { style: {
|
|
6240
|
+
...fieldStyle$1,
|
|
6241
|
+
marginTop: "8px"
|
|
6242
|
+
} }, (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", {
|
|
6243
|
+
type: "button",
|
|
6244
|
+
style: buttonStyle$1,
|
|
6245
|
+
disabled: disabled || override.revision === void 0,
|
|
6246
|
+
"data-dsh-copilot-search-reset": true,
|
|
6247
|
+
onClick: () => {
|
|
6248
|
+
clearOverride();
|
|
6262
6249
|
}
|
|
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: {
|
|
6250
|
+
}, saving === "override" ? "Updating…" : "Use automatic model selection"))) : null, (0, react.createElement)("div", { style: {
|
|
6270
6251
|
display: "flex",
|
|
6271
6252
|
alignItems: "center",
|
|
6272
6253
|
gap: "12px",
|
|
@@ -6274,24 +6255,29 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6274
6255
|
} }, (0, react.createElement)("button", {
|
|
6275
6256
|
type: "button",
|
|
6276
6257
|
style: buttonStyle$1,
|
|
6277
|
-
disabled: disabled ||
|
|
6258
|
+
disabled: disabled || missingProvider,
|
|
6278
6259
|
"data-dsh-web-search-save": true,
|
|
6279
6260
|
onClick: () => {
|
|
6280
6261
|
save();
|
|
6281
6262
|
}
|
|
6282
|
-
}, loading ? "Loading…" : saving ? "Saving…" : "Save search routing"), (0, react.createElement)("button", {
|
|
6263
|
+
}, loading ? "Loading…" : saving === "routing" ? "Saving…" : "Save search routing"), (0, react.createElement)("button", {
|
|
6283
6264
|
type: "button",
|
|
6284
6265
|
style: buttonStyle$1,
|
|
6285
|
-
disabled: loading || saving,
|
|
6266
|
+
disabled: loading || saving !== void 0,
|
|
6286
6267
|
title: "Reload saved values and discard unsaved edits",
|
|
6287
6268
|
"data-dsh-web-search-reload": true,
|
|
6288
6269
|
onClick: () => {
|
|
6289
6270
|
load();
|
|
6290
6271
|
}
|
|
6291
|
-
}, "Reload settings"),
|
|
6272
|
+
}, "Reload settings")), (0, react.createElement)("p", {
|
|
6292
6273
|
role: "status",
|
|
6293
|
-
|
|
6294
|
-
|
|
6274
|
+
"aria-live": "polite",
|
|
6275
|
+
"aria-atomic": true,
|
|
6276
|
+
style: {
|
|
6277
|
+
...hintStyle,
|
|
6278
|
+
...message ? {} : { display: "none" }
|
|
6279
|
+
}
|
|
6280
|
+
}, message));
|
|
6295
6281
|
}
|
|
6296
6282
|
//#endregion
|
|
6297
6283
|
//#region lib/types/dual-model-card.js
|
|
@@ -7898,10 +7884,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7898
7884
|
let footerActive = false;
|
|
7899
7885
|
let sectionActive = false;
|
|
7900
7886
|
let fallback;
|
|
7887
|
+
const settings = ctx.remote.settings;
|
|
7888
|
+
const routing = ctx.remote.githubCopilotSearchRouting;
|
|
7901
7889
|
const render = () => (0, react.createElement)(WebSearchRoutingCard, {
|
|
7902
|
-
settings
|
|
7903
|
-
|
|
7904
|
-
routing: ctx.remote.githubCopilotSearchRouting
|
|
7890
|
+
settings,
|
|
7891
|
+
routing
|
|
7905
7892
|
});
|
|
7906
7893
|
const syncFallback = () => {
|
|
7907
7894
|
if (active && sectionActive && !footerActive) fallback ??= ctx.slots.register({
|
|
@@ -7972,7 +7959,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7972
7959
|
throw error;
|
|
7973
7960
|
}
|
|
7974
7961
|
const searchUi = ctx.inject([
|
|
7975
|
-
"remote.githubCopilot",
|
|
7976
7962
|
"remote.settings",
|
|
7977
7963
|
"remote.githubCopilotSearchRouting",
|
|
7978
7964
|
"slots"
|