zidane-gui 8.2.1 → 8.2.2
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/out/main/index.js +121 -3
- package/out/main/lsp-host.js +12 -2
- package/out/preload/index.mjs +1 -0
- package/out/renderer/assets/{ghostty-web-BCAZYtuA.js → ghostty-web-6lAA0ofW.js} +1 -1
- package/out/renderer/assets/{index-CPTV1As9.js → index-BGEXnnpi.js} +824 -186
- package/out/renderer/assets/{index-CBxNp5Xb.css → index-Cp6Qu5JQ.css} +77 -11
- package/out/renderer/index.html +2 -2
- package/package.json +2 -2
|
@@ -14380,7 +14380,7 @@ const SECONDARY$1 = "zg-raised border text-[var(--zg-text-muted)] hover:text-[va
|
|
|
14380
14380
|
const PRIMARY$1 = "font-medium border-0 bg-transparent before:bg-[var(--zg-accent-soft)] text-[var(--zg-accent-hover)] hover:before:bg-[var(--zg-accent-soft-strong)]";
|
|
14381
14381
|
const SOLID = "zg-fill font-medium border-0";
|
|
14382
14382
|
const DANGER = "border-0 bg-transparent text-zg-danger hover:before:bg-zg-danger/10";
|
|
14383
|
-
const
|
|
14383
|
+
const DANGER_SOLID = "zg-fill zg-fill-danger font-medium border-0";
|
|
14384
14384
|
const GHOST = "border-0 bg-transparent text-[var(--zg-text-muted)] hover:before:bg-[var(--zg-row-hover)] hover:text-[var(--zg-text)]";
|
|
14385
14385
|
const VARIANTS = {
|
|
14386
14386
|
secondary: SECONDARY$1,
|
|
@@ -14388,7 +14388,7 @@ const VARIANTS = {
|
|
|
14388
14388
|
solid: SOLID,
|
|
14389
14389
|
ghost: GHOST,
|
|
14390
14390
|
danger: DANGER,
|
|
14391
|
-
"danger-
|
|
14391
|
+
"danger-solid": DANGER_SOLID
|
|
14392
14392
|
};
|
|
14393
14393
|
function buttonClass({
|
|
14394
14394
|
variant = "secondary",
|
|
@@ -14400,11 +14400,11 @@ function buttonClass({
|
|
|
14400
14400
|
const BTN_SECONDARY = `${BTN_BASE} ${SIZE_ROW} ${SECONDARY$1}`;
|
|
14401
14401
|
const BTN_PRIMARY$1 = `${BTN_BASE} ${SIZE_ROW} ${PRIMARY$1}`;
|
|
14402
14402
|
const BTN_DANGER$1 = `${BTN_BASE} ${SIZE_ROW} ${DANGER}`;
|
|
14403
|
-
const BTN_DANGER_CONFIRM = `${BTN_BASE} ${SIZE_ROW} ${
|
|
14403
|
+
const BTN_DANGER_CONFIRM = `${BTN_BASE} ${SIZE_ROW} ${DANGER_SOLID}`;
|
|
14404
14404
|
const BTN_LG_SECONDARY = `${BTN_BASE} ${SIZE_LG} ${SECONDARY$1}`;
|
|
14405
14405
|
const BTN_LG_PRIMARY = `${BTN_BASE} ${SIZE_LG} ${PRIMARY$1}`;
|
|
14406
14406
|
const BTN_LG_SOLID = `${BTN_BASE} ${SIZE_LG} ${SOLID}`;
|
|
14407
|
-
const BTN_LG_DANGER = `${BTN_BASE} ${SIZE_LG} ${
|
|
14407
|
+
const BTN_LG_DANGER = `${BTN_BASE} ${SIZE_LG} ${DANGER_SOLID}`;
|
|
14408
14408
|
const CONFIRM_TITLE_ID = "zg-confirm-title";
|
|
14409
14409
|
function ConfirmDialog({
|
|
14410
14410
|
title,
|
|
@@ -14450,7 +14450,7 @@ function ConfirmDialog({
|
|
|
14450
14450
|
ref: confirmRef,
|
|
14451
14451
|
type: "button",
|
|
14452
14452
|
onClick: onConfirm,
|
|
14453
|
-
className: buttonClass({ variant: destructive ? "danger-
|
|
14453
|
+
className: buttonClass({ variant: destructive ? "danger-solid" : "solid" }),
|
|
14454
14454
|
children: confirmLabel ?? labels.confirm
|
|
14455
14455
|
}
|
|
14456
14456
|
)
|
|
@@ -25025,10 +25025,14 @@ function ErrorFallback({
|
|
|
25025
25025
|
function ErrorDetails({ error, componentStack }) {
|
|
25026
25026
|
error instanceof Error ? error.stack : void 0;
|
|
25027
25027
|
const stack = "";
|
|
25028
|
-
return
|
|
25029
|
-
|
|
25030
|
-
stack
|
|
25031
|
-
|
|
25028
|
+
return (
|
|
25029
|
+
// `overflow-wrap: anywhere`, not `break-words`: it also lowers the min-content width, which is what
|
|
25030
|
+
// sizes this block inside EmptyState's centred column; long stack URLs would otherwise overflow a narrow region.
|
|
25031
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-2 w-full min-w-0 [overflow-wrap:anywhere]", children: [
|
|
25032
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "m-0 select-text", children: errorMessage$1(error) }),
|
|
25033
|
+
stack
|
|
25034
|
+
] })
|
|
25035
|
+
);
|
|
25032
25036
|
}
|
|
25033
25037
|
const MODAL_TITLE_ID = "zg-modal-title";
|
|
25034
25038
|
const ModalContext = reactExports.createContext(null);
|
|
@@ -26440,6 +26444,8 @@ const DEFAULT_SETTINGS = {
|
|
|
26440
26444
|
importRulerConfigs: true,
|
|
26441
26445
|
hideSubagentOutput: true,
|
|
26442
26446
|
subagentModels: true,
|
|
26447
|
+
imageGeneration: true,
|
|
26448
|
+
imageModel: "",
|
|
26443
26449
|
maxParallelSubagents: 3,
|
|
26444
26450
|
queueMessages: true,
|
|
26445
26451
|
theme: "default",
|
|
@@ -27920,6 +27926,12 @@ const SETTINGS_TOGGLES$1 = [
|
|
|
27920
27926
|
label: "Allow subagents to use different models",
|
|
27921
27927
|
description: "Let the agent hand work to cheaper models."
|
|
27922
27928
|
},
|
|
27929
|
+
{
|
|
27930
|
+
category: "agent",
|
|
27931
|
+
key: "imageGeneration",
|
|
27932
|
+
label: "Image generation",
|
|
27933
|
+
description: "Let the agent generate images with your providers' image models. Each image is billed by the provider."
|
|
27934
|
+
},
|
|
27923
27935
|
{
|
|
27924
27936
|
category: "agent",
|
|
27925
27937
|
key: "decisions",
|
|
@@ -32277,6 +32289,23 @@ const TOOL_DISPLAY = {
|
|
|
32277
32289
|
};
|
|
32278
32290
|
}
|
|
32279
32291
|
},
|
|
32292
|
+
generate_image: {
|
|
32293
|
+
displayName: (input) => input?.list === true ? "Image models" : "Generate image",
|
|
32294
|
+
format: (input) => {
|
|
32295
|
+
if (input.list === true) return { target: "list" };
|
|
32296
|
+
const prompt = stringField$1(input, "prompt");
|
|
32297
|
+
if (!prompt) return null;
|
|
32298
|
+
const meta = [
|
|
32299
|
+
stringField$1(input, "model"),
|
|
32300
|
+
stringField$1(input, "aspect_ratio"),
|
|
32301
|
+
typeof input.n === "number" && input.n > 1 ? `${Math.floor(input.n)} images` : void 0
|
|
32302
|
+
].filter((v2) => typeof v2 === "string" && v2 !== "");
|
|
32303
|
+
return {
|
|
32304
|
+
target: previewLine(prompt, 200),
|
|
32305
|
+
...meta.length ? { meta } : {}
|
|
32306
|
+
};
|
|
32307
|
+
}
|
|
32308
|
+
},
|
|
32280
32309
|
codemode: {
|
|
32281
32310
|
displayName: (input) => {
|
|
32282
32311
|
return descriptionLabel(input) ?? "Codemode";
|
|
@@ -35659,6 +35688,11 @@ const SETTINGS_TOGGLES = withCanonicalGates([
|
|
|
35659
35688
|
label: "Allow subagents to use different models",
|
|
35660
35689
|
description: "Let the agent hand work to cheaper models."
|
|
35661
35690
|
},
|
|
35691
|
+
{
|
|
35692
|
+
key: "imageGeneration",
|
|
35693
|
+
label: "Image generation",
|
|
35694
|
+
description: "Let the agent generate images with your providers' image models. Pick the model in the model picker's Image tab. Each image is billed by the provider."
|
|
35695
|
+
},
|
|
35662
35696
|
{
|
|
35663
35697
|
key: "sandbox",
|
|
35664
35698
|
label: "Sandbox shell commands",
|
|
@@ -37521,7 +37555,7 @@ const PAGES_KEY = "zg:browser:pages:v1";
|
|
|
37521
37555
|
const EMULATION_KEY = "zg:browser:emulation:v1";
|
|
37522
37556
|
const RECENT_KEY = "zg:browser:recent:v1";
|
|
37523
37557
|
const MAX_REMEMBERED = 50;
|
|
37524
|
-
const MAX_RECENT =
|
|
37558
|
+
const MAX_RECENT = 4;
|
|
37525
37559
|
class BrowserStore {
|
|
37526
37560
|
pages = /* @__PURE__ */ new Map();
|
|
37527
37561
|
slots = /* @__PURE__ */ new Map();
|
|
@@ -37541,10 +37575,15 @@ class BrowserStore {
|
|
|
37541
37575
|
livePages = () => this.pageList;
|
|
37542
37576
|
page = (sessionId) => sessionId ? this.pages.get(sessionId) ?? null : null;
|
|
37543
37577
|
slot = (sessionId) => this.slots.get(sessionId) ?? null;
|
|
37544
|
-
/**
|
|
37578
|
+
/**
|
|
37579
|
+
* Mount the session's page (if not already), at `url` or where it was last.
|
|
37580
|
+
* `cwd` is the session's project: a page opened before the session list
|
|
37581
|
+
* loaded, or a session that moved, takes the project it is in now.
|
|
37582
|
+
*/
|
|
37545
37583
|
open(sessionId, cwd2, url) {
|
|
37546
37584
|
const existing = this.pages.get(sessionId);
|
|
37547
37585
|
if (existing) {
|
|
37586
|
+
if (cwd2 && cwd2 !== existing.cwd) this.update(sessionId, { cwd: cwd2 });
|
|
37548
37587
|
if (url) this.navigate(sessionId, url);
|
|
37549
37588
|
return;
|
|
37550
37589
|
}
|
|
@@ -37594,7 +37633,9 @@ class BrowserStore {
|
|
|
37594
37633
|
this.pages.set(sessionId, next);
|
|
37595
37634
|
if (patch2.url && patch2.url !== page.url && patch2.url !== "about:blank") {
|
|
37596
37635
|
remember(sessionId, patch2.url);
|
|
37597
|
-
rememberRecent(next.cwd, patch2.url);
|
|
37636
|
+
if (next.cwd) rememberRecent(next.cwd, patch2.url, patch2.title ?? "");
|
|
37637
|
+
} else if (next.cwd && patch2.title && patch2.title !== page.title && next.url) {
|
|
37638
|
+
retitleRecent(next.cwd, next.url, patch2.title);
|
|
37598
37639
|
}
|
|
37599
37640
|
if (patch2.colorScheme !== void 0 || patch2.device !== void 0) {
|
|
37600
37641
|
rememberEmulation(sessionId, { colorScheme: next.colorScheme, device: next.device });
|
|
@@ -37612,6 +37653,24 @@ class BrowserStore {
|
|
|
37612
37653
|
}
|
|
37613
37654
|
this.update(sessionId, { initialUrl: url, generation: page.generation + 1 });
|
|
37614
37655
|
}
|
|
37656
|
+
/** Back to the start page: the page unmounts, and the session opens there next time too. */
|
|
37657
|
+
home(sessionId) {
|
|
37658
|
+
const page = this.pages.get(sessionId);
|
|
37659
|
+
if (!page) return;
|
|
37660
|
+
this.elements.delete(sessionId);
|
|
37661
|
+
forget$2(sessionId);
|
|
37662
|
+
this.update(sessionId, {
|
|
37663
|
+
initialUrl: "",
|
|
37664
|
+
url: "",
|
|
37665
|
+
title: "",
|
|
37666
|
+
loading: false,
|
|
37667
|
+
canGoBack: false,
|
|
37668
|
+
canGoForward: false,
|
|
37669
|
+
error: null,
|
|
37670
|
+
crashed: null,
|
|
37671
|
+
generation: page.generation + 1
|
|
37672
|
+
});
|
|
37673
|
+
}
|
|
37615
37674
|
/** Remount the page at its current URL (after a crash, or an explicit reload of a dead page). */
|
|
37616
37675
|
remount(sessionId, crashed = null) {
|
|
37617
37676
|
const page = this.pages.get(sessionId);
|
|
@@ -37653,8 +37712,29 @@ function useLiveBrowserPages() {
|
|
|
37653
37712
|
function useBrowserSlot(sessionId) {
|
|
37654
37713
|
return reactExports.useSyncExternalStore(browserStore.subscribe, () => browserStore.slot(sessionId));
|
|
37655
37714
|
}
|
|
37656
|
-
function
|
|
37657
|
-
return
|
|
37715
|
+
function recentBrowserPages(cwd2) {
|
|
37716
|
+
return readRecent()[cwd2] ?? [];
|
|
37717
|
+
}
|
|
37718
|
+
function removeRecentBrowserPage(cwd2, url) {
|
|
37719
|
+
const all2 = readRecent();
|
|
37720
|
+
const list2 = all2[cwd2];
|
|
37721
|
+
if (!list2?.some((e2) => e2.url === url)) return;
|
|
37722
|
+
all2[cwd2] = list2.filter((e2) => e2.url !== url);
|
|
37723
|
+
writeJson(RECENT_KEY, all2);
|
|
37724
|
+
}
|
|
37725
|
+
function readRecent() {
|
|
37726
|
+
const all2 = readJson(RECENT_KEY);
|
|
37727
|
+
const out = {};
|
|
37728
|
+
for (const [cwd2, list2] of Object.entries(all2)) {
|
|
37729
|
+
if (!Array.isArray(list2)) continue;
|
|
37730
|
+
out[cwd2] = list2.map((e2) => {
|
|
37731
|
+
if (typeof e2 === "string") return { url: e2, title: "", visitedAt: 0 };
|
|
37732
|
+
const entry = e2;
|
|
37733
|
+
if (typeof entry?.url !== "string") return null;
|
|
37734
|
+
return { url: entry.url, title: String(entry.title ?? ""), visitedAt: Number(entry.visitedAt) || 0 };
|
|
37735
|
+
}).filter((e2) => e2 !== null).slice(0, MAX_RECENT);
|
|
37736
|
+
}
|
|
37737
|
+
return out;
|
|
37658
37738
|
}
|
|
37659
37739
|
function rememberedUrl(sessionId) {
|
|
37660
37740
|
return readJson(PAGES_KEY)[sessionId] ?? null;
|
|
@@ -37682,9 +37762,26 @@ function remember(sessionId, url) {
|
|
|
37682
37762
|
for (const k2 of keys2.slice(0, Math.max(0, keys2.length - MAX_REMEMBERED))) delete all2[k2];
|
|
37683
37763
|
writeJson(PAGES_KEY, all2);
|
|
37684
37764
|
}
|
|
37685
|
-
function
|
|
37686
|
-
const all2 = readJson(
|
|
37687
|
-
|
|
37765
|
+
function forget$2(sessionId) {
|
|
37766
|
+
const all2 = readJson(PAGES_KEY);
|
|
37767
|
+
if (!(sessionId in all2)) return;
|
|
37768
|
+
delete all2[sessionId];
|
|
37769
|
+
writeJson(PAGES_KEY, all2);
|
|
37770
|
+
}
|
|
37771
|
+
function rememberRecent(cwd2, url, title) {
|
|
37772
|
+
const all2 = readRecent();
|
|
37773
|
+
const prev = (all2[cwd2] ?? []).find((e2) => e2.url === url);
|
|
37774
|
+
all2[cwd2] = [
|
|
37775
|
+
{ url, title: title || prev?.title || "", visitedAt: Date.now() },
|
|
37776
|
+
...(all2[cwd2] ?? []).filter((e2) => e2.url !== url)
|
|
37777
|
+
].slice(0, MAX_RECENT);
|
|
37778
|
+
writeJson(RECENT_KEY, all2);
|
|
37779
|
+
}
|
|
37780
|
+
function retitleRecent(cwd2, url, title) {
|
|
37781
|
+
const all2 = readRecent();
|
|
37782
|
+
const entry = all2[cwd2]?.find((e2) => e2.url === url);
|
|
37783
|
+
if (!entry || entry.title === title) return;
|
|
37784
|
+
entry.title = title;
|
|
37688
37785
|
writeJson(RECENT_KEY, all2);
|
|
37689
37786
|
}
|
|
37690
37787
|
function readJson(key2) {
|
|
@@ -37947,6 +38044,11 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
37947
38044
|
earlierMessages: (count2) => `${count2} earlier message${count2 === 1 ? "" : "s"}`,
|
|
37948
38045
|
// Prompt echo
|
|
37949
38046
|
viewAttachment: (name2) => `View ${name2}`,
|
|
38047
|
+
// Image generation (`generate_image` rows)
|
|
38048
|
+
generatingImage: (model) => model ? `Generating with ${model}…` : "Generating image…",
|
|
38049
|
+
generatingImages: (count2, model) => model ? `Generating ${count2} images with ${model}…` : `Generating ${count2} images…`,
|
|
38050
|
+
generatedImage: "Generated image",
|
|
38051
|
+
openImageFile: (path2) => `Open ${path2}`,
|
|
37950
38052
|
// Host transcript
|
|
37951
38053
|
transcriptLoading: "Loading conversation…",
|
|
37952
38054
|
earlierHistory: "Earlier messages",
|
|
@@ -37989,21 +38091,37 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
37989
38091
|
agentDraftNote: "Applies to your next chat.",
|
|
37990
38092
|
switchModel: "Switch model",
|
|
37991
38093
|
chooseModel: "Choose model",
|
|
38094
|
+
// The model pill's tooltip: the chain, then how to change it
|
|
38095
|
+
modelChain: "Model chain",
|
|
38096
|
+
modelForNextChat: "For your next chat",
|
|
38097
|
+
modelServing: (picked, serving) => `${picked} failed this run, so ${serving} took over. The next run tries ${picked} again.`,
|
|
38098
|
+
modelServingFallback: "The picked model",
|
|
38099
|
+
modelChainNoModel: "No model picked yet",
|
|
37992
38100
|
searchModels: "Search models",
|
|
37993
38101
|
searchModelsPlaceholder: "Search models…",
|
|
37994
|
-
|
|
37995
|
-
|
|
37996
|
-
|
|
38102
|
+
modelsShowLegacy: "Show legacy models",
|
|
38103
|
+
modelsShowLegacyHint: "Show legacy models (⌥L)",
|
|
38104
|
+
modelsLegacy: "Legacy",
|
|
37997
38105
|
modelsJumpToProvider: "Jump to provider",
|
|
37998
38106
|
modelsJumpHint: (provider, digit) => digit ? `${provider} (⌘${digit})` : provider,
|
|
37999
38107
|
modelsLoading: "Loading…",
|
|
38000
38108
|
modelsLoadFailed: (error) => `Failed to load models: ${error}`,
|
|
38001
38109
|
modelsNoProviders: "No provider is signed in. Sign in under Settings → Authentication.",
|
|
38110
|
+
modelsNoMatch: (query) => `No model matches "${query}".`,
|
|
38002
38111
|
modelsTypeAnId: 'Type any model id to use it. Put a provider first to pick one, for example "xai grok-9".',
|
|
38003
38112
|
modelsInUse: "In use",
|
|
38113
|
+
modelsChatTab: "Chat",
|
|
38114
|
+
modelsImageTab: "Image",
|
|
38115
|
+
modelKinds: "Model kind",
|
|
38116
|
+
imageModelsPill: "Image model",
|
|
38117
|
+
imageModelsNone: "No connected provider generates images. Connect OpenRouter, Google Gemini, xAI, or OpenAI with a platform API key.",
|
|
38118
|
+
imageModelReferences: "reference images",
|
|
38119
|
+
imageModelReferencesHint: "Edits or matches reference images",
|
|
38120
|
+
imageModelTransparency: "transparency",
|
|
38121
|
+
imageModelTransparencyHint: "Can make a transparent background",
|
|
38004
38122
|
modelsCustomId: "Custom id",
|
|
38005
38123
|
modelsShownOf: (shown2, total) => `${shown2} of ${total}`,
|
|
38006
|
-
|
|
38124
|
+
modelsLegacyHidden: (count2) => `${count2} legacy hidden`,
|
|
38007
38125
|
modelsSelected: (count2) => `${count2} selected`,
|
|
38008
38126
|
pickModel: "pick",
|
|
38009
38127
|
modelPrimary: "primary",
|
|
@@ -38016,15 +38134,16 @@ const DEFAULT_CHAT_LABELS = {
|
|
|
38016
38134
|
modelRemoveFallback: (n2) => `Remove fallback #${n2}`,
|
|
38017
38135
|
modelRemoveFromChain: "Remove from chain",
|
|
38018
38136
|
modelAccountBlocked: (provider) => `Another ${provider} account is in use. Picking this one switches the chain to it.`,
|
|
38019
|
-
|
|
38020
|
-
|
|
38137
|
+
modelLegacy: "legacy",
|
|
38138
|
+
modelLegacyHint: "Newer models exist in this family",
|
|
38139
|
+
modelUnavailable: "unavailable",
|
|
38021
38140
|
modelNotInCatalog: "not in catalog",
|
|
38022
38141
|
modelNotInCatalogHint: "Used as typed. No details are known for this id.",
|
|
38023
38142
|
modelVia: "via",
|
|
38024
38143
|
modelViaHint: (modelId, provider) => `${modelId} via ${provider}`,
|
|
38025
38144
|
modelInUse: "in use",
|
|
38026
38145
|
modelReasoning: "reasoning",
|
|
38027
|
-
modelReasoningHint: "
|
|
38146
|
+
modelReasoningHint: "Can think before answering",
|
|
38028
38147
|
contextWindow: "Context window",
|
|
38029
38148
|
modelOptions: "Model options",
|
|
38030
38149
|
setModelOptions: "Set model options",
|
|
@@ -42439,6 +42558,17 @@ function modelCatalogResource(cwd2, hostId) {
|
|
|
42439
42558
|
}
|
|
42440
42559
|
};
|
|
42441
42560
|
}
|
|
42561
|
+
function imageModelsResource(cwd2, hostId) {
|
|
42562
|
+
return {
|
|
42563
|
+
key: ["image-models", cwd2 ?? null, hostId ?? null],
|
|
42564
|
+
fetcher: () => window.api.sessions.listImageModels(cwd2 ?? void 0, null),
|
|
42565
|
+
options: {
|
|
42566
|
+
topics: ["models", "extensions", "extensions:built"],
|
|
42567
|
+
scope: { ...cwd2 ? { cwd: cwd2 } : {}, ...hostScope(hostId) },
|
|
42568
|
+
revalidateOnFocus: true
|
|
42569
|
+
}
|
|
42570
|
+
};
|
|
42571
|
+
}
|
|
42442
42572
|
function decisionModelsResource(cwd2, hostId) {
|
|
42443
42573
|
return {
|
|
42444
42574
|
key: ["decision-models", cwd2 ?? null, hostId ?? null],
|
|
@@ -44215,7 +44345,8 @@ function Tooltip({
|
|
|
44215
44345
|
children,
|
|
44216
44346
|
className = "",
|
|
44217
44347
|
portal = false,
|
|
44218
|
-
maxWidth
|
|
44348
|
+
maxWidth,
|
|
44349
|
+
disabled = false
|
|
44219
44350
|
}) {
|
|
44220
44351
|
const y2 = side === "bottom" ? "top-full mt-1.5" : "bottom-full mb-1.5";
|
|
44221
44352
|
const x2 = align === "end" ? "right-0" : "left-1/2 -translate-x-1/2";
|
|
@@ -44230,7 +44361,7 @@ function Tooltip({
|
|
|
44230
44361
|
const timer2 = reactExports.useRef(void 0);
|
|
44231
44362
|
const pointerInside = reactExports.useRef(false);
|
|
44232
44363
|
const [pos, setPos] = reactExports.useState(null);
|
|
44233
|
-
const open = (hovered || focused) && !suppressed && !dismissed;
|
|
44364
|
+
const open = !disabled && (hovered || focused) && !suppressed && !dismissed;
|
|
44234
44365
|
const presence = usePresence$1(open, { enter: portal, exitMs: readMenuExitMs });
|
|
44235
44366
|
const moves = useMotionLevel$1() === "full";
|
|
44236
44367
|
reactExports.useEffect(() => () => clearTimeout(timer2.current), []);
|
|
@@ -45416,7 +45547,7 @@ function loadSymbolsFont(url) {
|
|
|
45416
45547
|
return symbolsFont;
|
|
45417
45548
|
}
|
|
45418
45549
|
function loadGhostty$1(symbolsFontUrl2) {
|
|
45419
|
-
ghosttyModule ??= Promise.all([__vitePreload(() => import("./ghostty-web-
|
|
45550
|
+
ghosttyModule ??= Promise.all([__vitePreload(() => import("./ghostty-web-6lAA0ofW.js"), true ? [] : void 0, import.meta.url), loadSymbolsFont(symbolsFontUrl2)]).then(async ([m2]) => {
|
|
45420
45551
|
await m2.init();
|
|
45421
45552
|
drawBoxGlyphs(m2);
|
|
45422
45553
|
return m2;
|
|
@@ -45457,6 +45588,9 @@ function paletteToCssVars(p2) {
|
|
|
45457
45588
|
"--zg-warn-soft": p2.warnSoft,
|
|
45458
45589
|
"--zg-danger": p2.danger,
|
|
45459
45590
|
"--zg-danger-soft": p2.dangerSoft,
|
|
45591
|
+
"--zg-danger-fill": p2.dangerFill,
|
|
45592
|
+
"--zg-danger-fill-hover": p2.dangerFillHover,
|
|
45593
|
+
"--zg-danger-fill-fg": p2.dangerFillFg,
|
|
45460
45594
|
"--zg-info": p2.info,
|
|
45461
45595
|
"--zg-info-soft": p2.infoSoft,
|
|
45462
45596
|
"--zg-accent-dot": p2.dots.accent,
|
|
@@ -45918,6 +46052,9 @@ function derivePalette(seed) {
|
|
|
45918
46052
|
const success = status(seed.success, statusDefaults.success);
|
|
45919
46053
|
const warn2 = status(seed.warn, statusDefaults.warn);
|
|
45920
46054
|
const danger2 = status(seed.danger, statusDefaults.danger);
|
|
46055
|
+
const dangerFill = fillForWhite(danger2);
|
|
46056
|
+
const dangerFillHover = withLightness(dangerFill, (toOklch(dangerFill)?.l ?? 0.5) - 0.05);
|
|
46057
|
+
const dangerFillFg = onFillText(dangerFill, bg);
|
|
45921
46058
|
const info = status(seed.info, statusDefaults.info);
|
|
45922
46059
|
const codeBg = seed.codeBg ?? step(dark ? 0.02 : -0.018);
|
|
45923
46060
|
const codeFg = ensureContrast(text2, codeBg, CONTRAST.text);
|
|
@@ -45969,6 +46106,9 @@ function derivePalette(seed) {
|
|
|
45969
46106
|
warnSoft: withAlpha(warn2, 0.14),
|
|
45970
46107
|
danger: danger2,
|
|
45971
46108
|
dangerSoft: withAlpha(danger2, 0.14),
|
|
46109
|
+
dangerFill,
|
|
46110
|
+
dangerFillHover,
|
|
46111
|
+
dangerFillFg,
|
|
45972
46112
|
info,
|
|
45973
46113
|
infoSoft: withAlpha(info, 0.14),
|
|
45974
46114
|
dots,
|
|
@@ -63032,6 +63172,7 @@ const TOOL_GLYPH = {
|
|
|
63032
63172
|
write_file: "i-ph-file-plus",
|
|
63033
63173
|
fetch_url: "i-ph-globe",
|
|
63034
63174
|
web_search: "i-ph-magnifying-glass",
|
|
63175
|
+
generate_image: "i-ph-image",
|
|
63035
63176
|
spawn: "i-ph-robot",
|
|
63036
63177
|
tool_search: "i-ph-wrench",
|
|
63037
63178
|
skills_use: "i-ph-graduation-cap",
|
|
@@ -63985,6 +64126,124 @@ function readPath$1(tool) {
|
|
|
63985
64126
|
const path2 = tool.rawInput?.path;
|
|
63986
64127
|
return typeof path2 === "string" ? path2.slice(path2.lastIndexOf("/") + 1) : void 0;
|
|
63987
64128
|
}
|
|
64129
|
+
function cssRatio(raw2) {
|
|
64130
|
+
if (typeof raw2 !== "string") return "1 / 1";
|
|
64131
|
+
const m2 = /^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?)$/.exec(raw2);
|
|
64132
|
+
return m2 ? `${m2[1]} / ${m2[2]}` : "1 / 1";
|
|
64133
|
+
}
|
|
64134
|
+
function requestedCount(raw2) {
|
|
64135
|
+
return typeof raw2 === "number" && Number.isFinite(raw2) ? Math.min(4, Math.max(1, Math.floor(raw2))) : 1;
|
|
64136
|
+
}
|
|
64137
|
+
function savedPaths(text2) {
|
|
64138
|
+
return text2.split("\n").flatMap((line) => {
|
|
64139
|
+
const m2 = /^Saved: (.+?) \([^)]*\)$/.exec(line.trim());
|
|
64140
|
+
return m2 ? [m2[1]] : [];
|
|
64141
|
+
});
|
|
64142
|
+
}
|
|
64143
|
+
function drawsImageGeneration(tool) {
|
|
64144
|
+
return tool.name === "generate_image" && tool.rawInput?.list !== true;
|
|
64145
|
+
}
|
|
64146
|
+
function ImageFrame({
|
|
64147
|
+
src,
|
|
64148
|
+
ratio,
|
|
64149
|
+
pending: pending2,
|
|
64150
|
+
label,
|
|
64151
|
+
onOpen,
|
|
64152
|
+
onFail
|
|
64153
|
+
}) {
|
|
64154
|
+
const [readySrc, setReadySrc] = reactExports.useState(null);
|
|
64155
|
+
const ready2 = src !== null && readySrc === src;
|
|
64156
|
+
const img = reactExports.useRef(null);
|
|
64157
|
+
reactExports.useEffect(() => {
|
|
64158
|
+
const el = img.current;
|
|
64159
|
+
if (!src || !el) return void 0;
|
|
64160
|
+
let live = true;
|
|
64161
|
+
const show = () => {
|
|
64162
|
+
el.decode().catch(() => void 0).then(() => live && setReadySrc(src));
|
|
64163
|
+
};
|
|
64164
|
+
if (el.complete && el.naturalWidth > 0) show();
|
|
64165
|
+
else el.addEventListener("load", show, { once: true });
|
|
64166
|
+
return () => {
|
|
64167
|
+
live = false;
|
|
64168
|
+
el.removeEventListener("load", show);
|
|
64169
|
+
};
|
|
64170
|
+
}, [src]);
|
|
64171
|
+
const frame2 = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
64172
|
+
"span",
|
|
64173
|
+
{
|
|
64174
|
+
className: "zg-image-frame block",
|
|
64175
|
+
style: { aspectRatio: ratio },
|
|
64176
|
+
"data-testid": "image-frame",
|
|
64177
|
+
...pending2 || src && !ready2 ? { "data-pending": "" } : {},
|
|
64178
|
+
children: src && /* @__PURE__ */ jsxRuntimeExports.jsx("img", { ref: img, src, alt: "", decoding: "async", onError: onFail, ...ready2 ? { "data-ready": "" } : {} })
|
|
64179
|
+
}
|
|
64180
|
+
);
|
|
64181
|
+
if (!src || !onOpen) return frame2;
|
|
64182
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
64183
|
+
"button",
|
|
64184
|
+
{
|
|
64185
|
+
type: "button",
|
|
64186
|
+
"aria-label": label,
|
|
64187
|
+
onClick: (event) => onOpen(event.currentTarget),
|
|
64188
|
+
className: "zg-press-subtle block self-start max-w-full p-0 border-0 bg-transparent cursor-zoom-in rounded-zg-md focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--zg-ring)]",
|
|
64189
|
+
children: frame2
|
|
64190
|
+
}
|
|
64191
|
+
);
|
|
64192
|
+
}
|
|
64193
|
+
function ImageGenerationBlock({
|
|
64194
|
+
tool
|
|
64195
|
+
}) {
|
|
64196
|
+
const labels = useChatLabels();
|
|
64197
|
+
const { openFile } = useTranscriptActions();
|
|
64198
|
+
const lightbox = useLightbox();
|
|
64199
|
+
const media = useToolMedia(tool, tool.result);
|
|
64200
|
+
const [failed, setFailed] = reactExports.useState(() => /* @__PURE__ */ new Set());
|
|
64201
|
+
const input = tool.rawInput ?? {};
|
|
64202
|
+
const ratio = cssRatio(input.aspect_ratio);
|
|
64203
|
+
const model = typeof input.model === "string" && input.model ? input.model : null;
|
|
64204
|
+
const running2 = tool.ok === null;
|
|
64205
|
+
if (running2) {
|
|
64206
|
+
const count2 = requestedCount(input.n);
|
|
64207
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1.5 flex flex-col gap-1.5", "data-testid": "image-generation", "aria-busy": "true", children: [
|
|
64208
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-1.5", children: Array.from({ length: count2 }, (_2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsx(ImageFrame, { src: null, ratio, pending: true, label: "", onFail: () => void 0 }, i2)) }),
|
|
64209
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta zg-shimmer self-start", role: "status", children: count2 > 1 ? labels.generatingImages(count2, model) : labels.generatingImage(model) })
|
|
64210
|
+
] });
|
|
64211
|
+
}
|
|
64212
|
+
const images = media?.media.filter((m2) => m2.kind === "image" && !failed.has(m2.index)) ?? [];
|
|
64213
|
+
if (tool.ok === false || !media || images.length === 0) return null;
|
|
64214
|
+
const paths = savedPaths(media.rest);
|
|
64215
|
+
const gallery = images.map((m2, i2) => ({
|
|
64216
|
+
key: String(m2.index),
|
|
64217
|
+
name: paths[i2] ?? labels.generatedImage,
|
|
64218
|
+
src: media.url(m2.index)
|
|
64219
|
+
}));
|
|
64220
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1.5 flex flex-col gap-1.5", "data-testid": "image-generation", children: [
|
|
64221
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-1.5", children: images.map((m2, i2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex flex-col gap-1 min-w-0", children: [
|
|
64222
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
64223
|
+
ImageFrame,
|
|
64224
|
+
{
|
|
64225
|
+
src: media.url(m2.index),
|
|
64226
|
+
ratio,
|
|
64227
|
+
pending: false,
|
|
64228
|
+
label: labels.viewAttachment(paths[i2] ?? labels.generatedImage),
|
|
64229
|
+
onOpen: (el) => lightbox.open(gallery, i2, el),
|
|
64230
|
+
onFail: () => setFailed((prev) => new Set(prev).add(m2.index))
|
|
64231
|
+
}
|
|
64232
|
+
),
|
|
64233
|
+
paths[i2] && (openFile ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
64234
|
+
"button",
|
|
64235
|
+
{
|
|
64236
|
+
type: "button",
|
|
64237
|
+
title: labels.openImageFile(paths[i2]),
|
|
64238
|
+
onClick: (event) => openFile(paths[i2], event),
|
|
64239
|
+
className: "zg-press-subtle self-start max-w-full truncate p-0 border-0 bg-transparent cursor-pointer font-mono zg-meta text-[var(--zg-accent-hover)]",
|
|
64240
|
+
children: paths[i2]
|
|
64241
|
+
}
|
|
64242
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "self-start max-w-full truncate font-mono zg-meta", children: paths[i2] }))
|
|
64243
|
+
] }, m2.index)) }),
|
|
64244
|
+
lightbox.element
|
|
64245
|
+
] });
|
|
64246
|
+
}
|
|
63988
64247
|
function toolRowPropsEqual(prev, next) {
|
|
63989
64248
|
if (prev.mode !== next.mode || prev.showResult !== next.showResult || prev.showDiff !== next.showDiff || prev.lineState !== next.lineState) {
|
|
63990
64249
|
return false;
|
|
@@ -64137,6 +64396,7 @@ const ToolRow = reactExports.memo(({ tool, mode, showResult, showDiff, lineState
|
|
|
64137
64396
|
]
|
|
64138
64397
|
}
|
|
64139
64398
|
),
|
|
64399
|
+
mode !== "hidden" && drawsImageGeneration(tool) && /* @__PURE__ */ jsxRuntimeExports.jsx(ImageGenerationBlock, { tool }),
|
|
64140
64400
|
hasDiff && tool.edit && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsx(EditDiffBlock, { edit: tool.edit }) }) }),
|
|
64141
64401
|
interaction && ToolBody && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-2 pb-1", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolBody, { tool }) }) }) }),
|
|
64142
64402
|
showInputPanel && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible", "data-open": open, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "zg-collapsible-inner", children: bodyMounted && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
@@ -64166,7 +64426,7 @@ const ToolRow = reactExports.memo(({ tool, mode, showResult, showDiff, lineState
|
|
|
64166
64426
|
!bodyMounted ? null : media ? (
|
|
64167
64427
|
// An image the call read, or a screenshot it took: the media itself, then any text around it.
|
|
64168
64428
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1.5 flex flex-col gap-1.5", children: [
|
|
64169
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ToolMedia, { media: media.media, url: media.url }),
|
|
64429
|
+
!drawsImageGeneration(tool) && /* @__PURE__ */ jsxRuntimeExports.jsx(ToolMedia, { media: media.media, url: media.url }),
|
|
64170
64430
|
tool.name !== "read_file" && media.rest !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: CODE_PANEL, children: media.rest })
|
|
64171
64431
|
] })
|
|
64172
64432
|
) : tool.name === "read_file" ? (
|
|
@@ -78652,7 +78912,7 @@ const BTN = `${buttonClass({ variant: "secondary" })} !text-[var(--zg-text)] fon
|
|
|
78652
78912
|
const BTN_PRIMARY = buttonClass({ variant: "solid" });
|
|
78653
78913
|
buttonClass({ variant: "ghost" });
|
|
78654
78914
|
const BTN_GHOST_LEADING = buttonClass({ variant: "ghost", flush: "start" });
|
|
78655
|
-
const BTN_DANGER = buttonClass({ variant: "danger-
|
|
78915
|
+
const BTN_DANGER = buttonClass({ variant: "danger-solid" });
|
|
78656
78916
|
const INPUT = "zg-well w-full text-zg-ui px-2.5 placeholder:text-[var(--zg-text-subtle)]";
|
|
78657
78917
|
function CardError({
|
|
78658
78918
|
error
|
|
@@ -80094,6 +80354,7 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
|
|
|
80094
80354
|
const retry = useSessionRetry(sessionId);
|
|
80095
80355
|
const runStatus = reactExports.useMemo(() => ({ retry }), [retry]);
|
|
80096
80356
|
const modelName = useModelName();
|
|
80357
|
+
const openTarget = useOpenTarget();
|
|
80097
80358
|
const actions = reactExports.useMemo(
|
|
80098
80359
|
() => ({
|
|
80099
80360
|
sessionId,
|
|
@@ -80106,9 +80367,13 @@ const Timeline = reactExports.memo(({ events, isStreaming, sessionId }) => {
|
|
|
80106
80367
|
resume: (text2) => pushComposerPrompt(text2, sessionId ? { scopeKey: sessionId } : void 0),
|
|
80107
80368
|
modelName,
|
|
80108
80369
|
// Served from this computer's store (`zg-media:`); a server session keeps the stand-ins.
|
|
80109
|
-
...sessionId && serverIdOf(sessionId) === null ? { toolMediaUrl: (callId, index2) => toolMediaUrl(sessionId, callId, index2) } : {}
|
|
80370
|
+
...sessionId && serverIdOf(sessionId) === null ? { toolMediaUrl: (callId, index2) => toolMediaUrl(sessionId, callId, index2) } : {},
|
|
80371
|
+
// Files the session wrote, on this computer only: a server session's files are on the server.
|
|
80372
|
+
...sessionId && serverIdOf(sessionId) === null && scopeCwd ? {
|
|
80373
|
+
openFile: (path2, event) => void openTarget.file(`${scopeCwd.replace(/\/+$/, "")}/${path2}`, event)
|
|
80374
|
+
} : {}
|
|
80110
80375
|
}),
|
|
80111
|
-
[sessionId, openSession, modelName]
|
|
80376
|
+
[sessionId, openSession, modelName, openTarget, scopeCwd]
|
|
80112
80377
|
);
|
|
80113
80378
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(MarkdownContext.Provider, { value: markdownCtx, children: /* @__PURE__ */ jsxRuntimeExports.jsx(CommandScopeContext.Provider, { value: commandScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptRenderersProvider, { value: GUI_TRANSCRIPT_RENDERERS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(TranscriptActionsProvider, { value: actions, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
80114
80379
|
Transcript,
|
|
@@ -87070,7 +87335,7 @@ function formatTimeout(ms2) {
|
|
|
87070
87335
|
}
|
|
87071
87336
|
const PRIMARY = buttonClass({ variant: "solid" });
|
|
87072
87337
|
const SECONDARY = `${buttonClass({ variant: "secondary" })} !text-[var(--zg-text)] font-medium`;
|
|
87073
|
-
const DESTRUCTIVE = buttonClass({ variant: "danger-
|
|
87338
|
+
const DESTRUCTIVE = buttonClass({ variant: "danger-solid" });
|
|
87074
87339
|
const FILE_EDIT_TOOLS = /* @__PURE__ */ new Set(["edit", "multi_edit", "write_file"]);
|
|
87075
87340
|
function ApprovalBar({ sessionId }) {
|
|
87076
87341
|
const head2 = useSessionApprovalHead(sessionId);
|
|
@@ -129155,13 +129420,13 @@ function SessionModelOptionsPicker({
|
|
|
129155
129420
|
);
|
|
129156
129421
|
}
|
|
129157
129422
|
const MODEL_PICKER_STORAGE_KEY = "zg:model-picker:v1";
|
|
129158
|
-
const DEFAULT_MODEL_PICKER_PREFS = { version: 1,
|
|
129423
|
+
const DEFAULT_MODEL_PICKER_PREFS = { version: 1, showLegacy: false };
|
|
129159
129424
|
function parseModelPickerPrefs(raw2) {
|
|
129160
129425
|
try {
|
|
129161
129426
|
const o2 = JSON.parse(raw2);
|
|
129162
129427
|
if (!o2 || typeof o2 !== "object") return void 0;
|
|
129163
|
-
const
|
|
129164
|
-
return { version: 1,
|
|
129428
|
+
const showLegacy = o2.showLegacy;
|
|
129429
|
+
return { version: 1, showLegacy: typeof showLegacy === "boolean" ? showLegacy : false };
|
|
129165
129430
|
} catch {
|
|
129166
129431
|
return void 0;
|
|
129167
129432
|
}
|
|
@@ -129175,7 +129440,7 @@ function getModelPickerPrefs() {
|
|
|
129175
129440
|
function setModelPickerPrefs(update2) {
|
|
129176
129441
|
const prev = getModelPickerPrefs();
|
|
129177
129442
|
const next = { ...prev, ...update2, version: 1 };
|
|
129178
|
-
if (next.
|
|
129443
|
+
if (next.showLegacy === prev.showLegacy) return;
|
|
129179
129444
|
state$2 = next;
|
|
129180
129445
|
writePersisted(MODEL_PICKER_STORAGE_KEY, JSON.stringify(next));
|
|
129181
129446
|
for (const l2 of listeners$b) l2();
|
|
@@ -129316,7 +129581,7 @@ function modelSearchScore(entry, terms) {
|
|
|
129316
129581
|
}
|
|
129317
129582
|
return score;
|
|
129318
129583
|
}
|
|
129319
|
-
function pickerGroups(catalog2, query, chain,
|
|
129584
|
+
function pickerGroups(catalog2, query, chain, showLegacy, current2) {
|
|
129320
129585
|
const totals = /* @__PURE__ */ new Map();
|
|
129321
129586
|
for (const entry of catalog2) totals.set(groupKeyOf(entry), (totals.get(groupKeyOf(entry)) ?? 0) + 1);
|
|
129322
129587
|
const terms = query.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
@@ -129363,7 +129628,7 @@ function pickerGroups(catalog2, query, chain, showOlder, current2) {
|
|
|
129363
129628
|
}
|
|
129364
129629
|
for (const entry of catalog2) {
|
|
129365
129630
|
if (pinned2.has(rowKey(entry))) continue;
|
|
129366
|
-
if (!
|
|
129631
|
+
if (!showLegacy && !current2.has(lineupKeyOf(entry))) {
|
|
129367
129632
|
groupFor(entry);
|
|
129368
129633
|
continue;
|
|
129369
129634
|
}
|
|
@@ -129512,8 +129777,8 @@ function ModelChainFooter({
|
|
|
129512
129777
|
single,
|
|
129513
129778
|
multi,
|
|
129514
129779
|
selected,
|
|
129515
|
-
|
|
129516
|
-
|
|
129780
|
+
hiddenLegacy,
|
|
129781
|
+
onShowLegacy
|
|
129517
129782
|
}) {
|
|
129518
129783
|
const labels = useChatLabels();
|
|
129519
129784
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `zg-meta ${pad} py-2 shrink-0 border-t border-[var(--zg-hairline)] flex items-center gap-3`, children: [
|
|
@@ -129525,14 +129790,14 @@ function ModelChainFooter({
|
|
|
129525
129790
|
/* @__PURE__ */ jsxRuntimeExports.jsx(FooterKey, { spec: "tab" }),
|
|
129526
129791
|
labels.modelFallback
|
|
129527
129792
|
] }),
|
|
129528
|
-
|
|
129793
|
+
hiddenLegacy > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
129529
129794
|
"button",
|
|
129530
129795
|
{
|
|
129531
129796
|
type: "button",
|
|
129532
|
-
onClick:
|
|
129797
|
+
onClick: onShowLegacy,
|
|
129533
129798
|
className: "zg-meta bg-transparent border-0 p-0 cursor-pointer hover:text-[var(--zg-text)] whitespace-nowrap",
|
|
129534
|
-
"data-testid": "model-
|
|
129535
|
-
children: labels.
|
|
129799
|
+
"data-testid": "model-legacy-hint",
|
|
129800
|
+
children: labels.modelsLegacyHidden(hiddenLegacy)
|
|
129536
129801
|
}
|
|
129537
129802
|
),
|
|
129538
129803
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -129547,17 +129812,19 @@ function ModelChainFooter({
|
|
|
129547
129812
|
)
|
|
129548
129813
|
] });
|
|
129549
129814
|
}
|
|
129550
|
-
function
|
|
129815
|
+
function ModelChainHeader({
|
|
129551
129816
|
pad,
|
|
129552
129817
|
query,
|
|
129553
129818
|
onQuery,
|
|
129554
|
-
|
|
129555
|
-
|
|
129819
|
+
showLegacy,
|
|
129820
|
+
onShowLegacyChange,
|
|
129821
|
+
toolbar,
|
|
129822
|
+
pills,
|
|
129556
129823
|
inputRef
|
|
129557
129824
|
}) {
|
|
129558
129825
|
const labels = useChatLabels();
|
|
129559
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${pad}
|
|
129560
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "zg-well
|
|
129826
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `${pad} py-3 shrink-0 flex flex-col gap-2`, children: [
|
|
129827
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "zg-well w-full min-w-0 flex items-center gap-2 h-8 px-2.5", children: [
|
|
129561
129828
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-magnifying-glass text-zg-ui text-[var(--zg-text-muted)] shrink-0" }),
|
|
129562
129829
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
129563
129830
|
"input",
|
|
@@ -129573,26 +129840,83 @@ function ModelChainSearch({
|
|
|
129573
129840
|
}
|
|
129574
129841
|
)
|
|
129575
129842
|
] }),
|
|
129576
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
129577
|
-
|
|
129843
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "h-7 flex items-center gap-2 min-w-0", children: [
|
|
129844
|
+
toolbar,
|
|
129845
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
129846
|
+
"button",
|
|
129847
|
+
{
|
|
129848
|
+
type: "button",
|
|
129849
|
+
role: "switch",
|
|
129850
|
+
"aria-checked": showLegacy,
|
|
129851
|
+
"aria-label": labels.modelsShowLegacy,
|
|
129852
|
+
title: labels.modelsShowLegacyHint,
|
|
129853
|
+
onClick: () => {
|
|
129854
|
+
onShowLegacyChange(!showLegacy);
|
|
129855
|
+
inputRef.current?.focus({ preventScroll: true });
|
|
129856
|
+
},
|
|
129857
|
+
className: "zg-segment-item zg-press-subtle ml-auto shrink-0 inline-flex items-center gap-1.5 h-7 rounded-zg-md px-2 border-0 bg-transparent cursor-pointer text-zg-meta text-[var(--zg-text-muted)]",
|
|
129858
|
+
children: [
|
|
129859
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-clock-counter-clockwise text-zg-ui" }),
|
|
129860
|
+
labels.modelsLegacy,
|
|
129861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MenuSwitch, { on: showLegacy })
|
|
129862
|
+
]
|
|
129863
|
+
}
|
|
129864
|
+
)
|
|
129865
|
+
] }),
|
|
129866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-7 flex min-w-0", children: pills })
|
|
129867
|
+
] });
|
|
129868
|
+
}
|
|
129869
|
+
function ModelProviderChip({
|
|
129870
|
+
entry
|
|
129871
|
+
}) {
|
|
129872
|
+
const color2 = providerColor(entry.providerKey);
|
|
129873
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
129874
|
+
"span",
|
|
129875
|
+
{
|
|
129876
|
+
className: "inline-flex items-center h-[18px] gap-1 rounded-zg-sm px-1.5 text-zg-badge whitespace-nowrap",
|
|
129877
|
+
style: { color: color2, background: providerTint(entry.providerKey) },
|
|
129878
|
+
children: [
|
|
129879
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "w-1.5 h-1.5 rounded-full", style: { background: color2 } }),
|
|
129880
|
+
providerAccountLabel(entry)
|
|
129881
|
+
]
|
|
129882
|
+
}
|
|
129883
|
+
);
|
|
129884
|
+
}
|
|
129885
|
+
function ModelWindow({ entry }) {
|
|
129886
|
+
const labels = useChatLabels();
|
|
129887
|
+
if (entry.offCatalog) {
|
|
129888
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", style: { color: "var(--zg-warn)" }, title: labels.modelNotInCatalogHint, children: labels.modelNotInCatalog });
|
|
129889
|
+
}
|
|
129890
|
+
return entry.contextWindow === null ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", title: labels.contextWindow, children: compactWindow(entry.contextWindow) });
|
|
129891
|
+
}
|
|
129892
|
+
function ModelFlag({ icon, label, hint }) {
|
|
129893
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: hint, side: "top", portal: true, className: "shrink-0 inline-flex", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { role: "img", "aria-label": label, className: `${icon} text-zg-label text-[var(--zg-text-subtle)]` }) });
|
|
129894
|
+
}
|
|
129895
|
+
function ModelReasoning({ entry }) {
|
|
129896
|
+
const labels = useChatLabels();
|
|
129897
|
+
return entry.supportsReasoning ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelFlag, { icon: "i-ph-brain", label: labels.modelReasoning, hint: labels.modelReasoningHint }) : null;
|
|
129898
|
+
}
|
|
129899
|
+
function ModelMeta({
|
|
129900
|
+
entry,
|
|
129901
|
+
legacy: legacy2 = false,
|
|
129902
|
+
route = false
|
|
129903
|
+
}) {
|
|
129904
|
+
const labels = useChatLabels();
|
|
129905
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
129906
|
+
legacy2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", title: labels.modelLegacyHint, children: labels.modelLegacy }),
|
|
129907
|
+
entry.details?.map((detail) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", children: detail }, detail)),
|
|
129908
|
+
!(entry.offCatalog && route) && /* @__PURE__ */ jsxRuntimeExports.jsx(ModelWindow, { entry }),
|
|
129909
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ModelReasoning, { entry }),
|
|
129910
|
+
entry.references && /* @__PURE__ */ jsxRuntimeExports.jsx(ModelFlag, { icon: "i-ph-images", label: labels.imageModelReferences, hint: labels.imageModelReferencesHint }),
|
|
129911
|
+
entry.transparency && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
129912
|
+
ModelFlag,
|
|
129578
129913
|
{
|
|
129579
|
-
|
|
129580
|
-
|
|
129581
|
-
|
|
129582
|
-
"aria-label": labels.modelsShowOlder,
|
|
129583
|
-
title: labels.modelsShowOlderHint,
|
|
129584
|
-
onClick: () => {
|
|
129585
|
-
onShowOlderChange(!showOlder);
|
|
129586
|
-
inputRef.current?.focus({ preventScroll: true });
|
|
129587
|
-
},
|
|
129588
|
-
className: "zg-segment-item zg-press-subtle shrink-0 inline-flex items-center gap-1.5 h-8 rounded-zg-md px-2 border-0 bg-transparent cursor-pointer text-zg-meta text-[var(--zg-text-muted)]",
|
|
129589
|
-
children: [
|
|
129590
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-clock-counter-clockwise text-zg-ui" }),
|
|
129591
|
-
labels.modelsOlder,
|
|
129592
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(MenuSwitch, { on: showOlder })
|
|
129593
|
-
]
|
|
129914
|
+
icon: "i-ph-checkerboard",
|
|
129915
|
+
label: labels.imageModelTransparency,
|
|
129916
|
+
hint: labels.imageModelTransparencyHint
|
|
129594
129917
|
}
|
|
129595
|
-
)
|
|
129918
|
+
),
|
|
129919
|
+
entry.unavailable && /* @__PURE__ */ jsxRuntimeExports.jsx(ModelFlag, { icon: "i-ph-lock-simple", label: labels.modelUnavailable, hint: entry.unavailable })
|
|
129596
129920
|
] });
|
|
129597
129921
|
}
|
|
129598
129922
|
const ModelChainRow = reactExports.memo(function ModelChainRow2({
|
|
@@ -129605,7 +129929,7 @@ const ModelChainRow = reactExports.memo(function ModelChainRow2({
|
|
|
129605
129929
|
position: position2,
|
|
129606
129930
|
numbered,
|
|
129607
129931
|
blocked = false,
|
|
129608
|
-
|
|
129932
|
+
legacy: legacy2,
|
|
129609
129933
|
showProvider,
|
|
129610
129934
|
route = false,
|
|
129611
129935
|
isNew,
|
|
@@ -129624,19 +129948,6 @@ const ModelChainRow = reactExports.memo(function ModelChainRow2({
|
|
|
129624
129948
|
const color2 = providerColor(entry.providerKey);
|
|
129625
129949
|
const member = position2 !== null;
|
|
129626
129950
|
const oneLine = !dense && (route || !sub);
|
|
129627
|
-
const meta = /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
129628
|
-
older && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", title: labels.modelOlderHint, children: labels.modelOlder }),
|
|
129629
|
-
entry.details?.map((detail) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", children: detail }, detail)),
|
|
129630
|
-
entry.offCatalog && route ? null : entry.offCatalog ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", style: { color: "var(--zg-warn)" }, title: labels.modelNotInCatalogHint, children: labels.modelNotInCatalog }) : entry.contextWindow !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta shrink-0", title: labels.contextWindow, children: compactWindow(entry.contextWindow) }),
|
|
129631
|
-
entry.supportsReasoning && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
129632
|
-
"span",
|
|
129633
|
-
{
|
|
129634
|
-
"aria-label": labels.modelReasoning,
|
|
129635
|
-
title: labels.modelReasoningHint,
|
|
129636
|
-
className: "i-ph-brain shrink-0 text-zg-label text-[var(--zg-text-subtle)]"
|
|
129637
|
-
}
|
|
129638
|
-
)
|
|
129639
|
-
] });
|
|
129640
129951
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { ref: item, className: "group absolute inset-x-0", style: { top: top2, height }, children: [
|
|
129641
129952
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
129642
129953
|
"button",
|
|
@@ -129646,11 +129957,12 @@ const ModelChainRow = reactExports.memo(function ModelChainRow2({
|
|
|
129646
129957
|
"data-model": entry.modelId,
|
|
129647
129958
|
"data-account": entry.account?.id,
|
|
129648
129959
|
title: blocked ? labels.modelAccountBlocked(entry.providerLabel) : void 0,
|
|
129960
|
+
"aria-disabled": entry.unavailable ? true : void 0,
|
|
129649
129961
|
"data-size": dense ? "md" : "lg",
|
|
129650
129962
|
"data-active": isCursor ? "" : void 0,
|
|
129651
129963
|
onMouseMove: isCursor ? void 0 : () => onHover(idx),
|
|
129652
129964
|
onClick: (e2) => onPick(idx, e2.shiftKey),
|
|
129653
|
-
className: `zg-menu-row zg-press-subtle relative h-full ${oneLine ? "!items-center" : ""} ${
|
|
129965
|
+
className: `zg-menu-row zg-press-subtle relative h-full ${oneLine ? "!items-center" : ""} ${entry.unavailable ? "opacity-50 cursor-not-allowed" : legacy2 ? "opacity-75" : ""}`,
|
|
129654
129966
|
children: [
|
|
129655
129967
|
numbered && /*
|
|
129656
129968
|
* The place stands in the column of the In use pin above it: the
|
|
@@ -129682,18 +129994,8 @@ const ModelChainRow = reactExports.memo(function ModelChainRow2({
|
|
|
129682
129994
|
sub && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta truncate", children: sub })
|
|
129683
129995
|
] }),
|
|
129684
129996
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "shrink-0 flex items-center gap-2", children: [
|
|
129685
|
-
showProvider && /* @__PURE__ */ jsxRuntimeExports.
|
|
129686
|
-
|
|
129687
|
-
{
|
|
129688
|
-
className: "inline-flex items-center h-[18px] gap-1 rounded-zg-sm px-1.5 text-zg-badge",
|
|
129689
|
-
style: { color: color2, background: providerTint(entry.providerKey) },
|
|
129690
|
-
children: [
|
|
129691
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "w-1.5 h-1.5 rounded-full", style: { background: color2 } }),
|
|
129692
|
-
providerAccountLabel(entry)
|
|
129693
|
-
]
|
|
129694
|
-
}
|
|
129695
|
-
),
|
|
129696
|
-
meta,
|
|
129997
|
+
showProvider && /* @__PURE__ */ jsxRuntimeExports.jsx(ModelProviderChip, { entry }),
|
|
129998
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ModelMeta, { entry, legacy: legacy2, route }),
|
|
129697
129999
|
member && // The checked style; the remove button takes its place under the cursor.
|
|
129698
130000
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
129699
130001
|
"span",
|
|
@@ -129812,7 +130114,7 @@ const ModelChainRows = reactExports.memo(function ModelChainRows2({
|
|
|
129812
130114
|
position: position2,
|
|
129813
130115
|
numbered: multi && group.key === "in-use",
|
|
129814
130116
|
blocked: position2 === null && !canJoinChain(chain, pickRefOf(entry)),
|
|
129815
|
-
|
|
130117
|
+
legacy: !entry.offCatalog && !current2.has(lineupKeyOf(entry)),
|
|
129816
130118
|
showProvider: group.key === "in-use",
|
|
129817
130119
|
route: group.key === "typed",
|
|
129818
130120
|
isNew,
|
|
@@ -129844,7 +130146,6 @@ const ModelChainRows = reactExports.memo(function ModelChainRows2({
|
|
|
129844
130146
|
const ModelProviderPills = reactExports.memo(function ModelProviderPills2({
|
|
129845
130147
|
groups,
|
|
129846
130148
|
active: active2,
|
|
129847
|
-
pad,
|
|
129848
130149
|
dense,
|
|
129849
130150
|
onJump
|
|
129850
130151
|
}) {
|
|
@@ -129875,7 +130176,7 @@ const ModelProviderPills = reactExports.memo(function ModelProviderPills2({
|
|
|
129875
130176
|
});
|
|
129876
130177
|
return () => cancelAnimationFrame(frame2);
|
|
129877
130178
|
}, [active2, groups.length, dense]);
|
|
129878
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className:
|
|
130179
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 flex min-w-0 max-w-full", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
129879
130180
|
"div",
|
|
129880
130181
|
{
|
|
129881
130182
|
ref: pillRow,
|
|
@@ -129946,16 +130247,23 @@ function ModelChainList({
|
|
|
129946
130247
|
catalog: catalog2,
|
|
129947
130248
|
loadError = null,
|
|
129948
130249
|
onRetry,
|
|
129949
|
-
|
|
129950
|
-
|
|
130250
|
+
showLegacy,
|
|
130251
|
+
onShowLegacyChange,
|
|
129951
130252
|
onChainChange,
|
|
129952
130253
|
onQuickPick,
|
|
129953
130254
|
dense = false,
|
|
129954
130255
|
single = false,
|
|
129955
|
-
className = ""
|
|
130256
|
+
className = "",
|
|
130257
|
+
toolbar,
|
|
130258
|
+
customIds = true,
|
|
130259
|
+
emptyText,
|
|
130260
|
+
query: keptQuery,
|
|
130261
|
+
onQueryChange
|
|
129956
130262
|
}) {
|
|
129957
130263
|
const labels = useChatLabels();
|
|
129958
|
-
const [
|
|
130264
|
+
const [ownQuery, setOwnQuery] = reactExports.useState("");
|
|
130265
|
+
const query = keptQuery ?? ownQuery;
|
|
130266
|
+
const setQuery = onQueryChange ?? setOwnQuery;
|
|
129959
130267
|
const [cursor, setCursor] = reactExports.useState({ index: 0, by: "key" });
|
|
129960
130268
|
const [chain, setChain] = reactExports.useState(() => [...initialChain]);
|
|
129961
130269
|
const [jump, setJump] = reactExports.useState(null);
|
|
@@ -129972,8 +130280,8 @@ function ModelChainList({
|
|
|
129972
130280
|
const shown2 = reactExports.useMemo(() => resolveChain(chain, catalog2 ?? NO_MODELS), [chain, catalog2]);
|
|
129973
130281
|
const groups = reactExports.useMemo(() => {
|
|
129974
130282
|
if (!catalog2) return [];
|
|
129975
|
-
const found2 = pickerGroups(catalog2, query, shown2,
|
|
129976
|
-
if (!query.trim()) return found2;
|
|
130283
|
+
const found2 = pickerGroups(catalog2, query, shown2, showLegacy, current2);
|
|
130284
|
+
if (!query.trim() || !customIds) return found2;
|
|
129977
130285
|
const typed = offCatalogRows(catalog2, query, currentProviderKey, found2.length > 0);
|
|
129978
130286
|
if (typed.length === 0) return found2;
|
|
129979
130287
|
const group = {
|
|
@@ -129985,17 +130293,17 @@ function ModelChainList({
|
|
|
129985
130293
|
total: typed.length
|
|
129986
130294
|
};
|
|
129987
130295
|
return found2.length > 0 ? [...found2, group] : [group];
|
|
129988
|
-
}, [catalog2, query, shown2,
|
|
130296
|
+
}, [catalog2, query, shown2, showLegacy, current2, currentProviderKey, customIds]);
|
|
129989
130297
|
const rows2 = reactExports.useMemo(() => groups.flatMap((g2) => g2.rows), [groups]);
|
|
129990
130298
|
const layout2 = reactExports.useMemo(() => layoutModelList(groups, dense), [groups, dense]);
|
|
129991
130299
|
const tabs = reactExports.useMemo(
|
|
129992
130300
|
() => groups.filter((g2) => g2.key === "in-use" || g2.providerKey !== null && g2.key !== "typed"),
|
|
129993
130301
|
[groups]
|
|
129994
130302
|
);
|
|
129995
|
-
const
|
|
129996
|
-
if (!catalog2 ||
|
|
130303
|
+
const hiddenLegacy = reactExports.useMemo(() => {
|
|
130304
|
+
if (!catalog2 || showLegacy || query.trim()) return 0;
|
|
129997
130305
|
return catalog2.filter((e2) => !current2.has(lineupKeyOf(e2)) && positionKeyed(shown2, rowKey(e2), refKey) === null).length;
|
|
129998
|
-
}, [catalog2,
|
|
130306
|
+
}, [catalog2, showLegacy, query, current2, shown2]);
|
|
129999
130307
|
const seen2 = reactExports.useRef(null);
|
|
130000
130308
|
reactExports.useEffect(() => {
|
|
130001
130309
|
seen2.current ??= /* @__PURE__ */ new Set();
|
|
@@ -130009,6 +130317,7 @@ function ModelChainList({
|
|
|
130009
130317
|
live.current = { rows: rows2, chain, catalog: catalog2, single, onQuickPick, layout: layout2 };
|
|
130010
130318
|
});
|
|
130011
130319
|
const pick2 = reactExports.useCallback((entry) => {
|
|
130320
|
+
if (entry.unavailable) return;
|
|
130012
130321
|
const { chain: chain2, catalog: catalog22, single: single2, onQuickPick: onQuickPick2 } = live.current;
|
|
130013
130322
|
const ref = pickRefOf(entry);
|
|
130014
130323
|
const shown22 = resolveChain(chain2, catalog22 ?? NO_MODELS);
|
|
@@ -130022,6 +130331,7 @@ function ModelChainList({
|
|
|
130022
130331
|
pick2(entry);
|
|
130023
130332
|
return;
|
|
130024
130333
|
}
|
|
130334
|
+
if (entry.unavailable) return;
|
|
130025
130335
|
const ref = pickRefOf(entry);
|
|
130026
130336
|
setChain((prev) => {
|
|
130027
130337
|
const shown22 = resolveChain(prev, live.current.catalog ?? NO_MODELS);
|
|
@@ -130069,9 +130379,9 @@ function ModelChainList({
|
|
|
130069
130379
|
});
|
|
130070
130380
|
reactExports.useLayoutEffect(() => {
|
|
130071
130381
|
onKey2.current = (e2) => {
|
|
130072
|
-
if (e2.altKey && !e2.metaKey && !e2.ctrlKey && e2.code === "
|
|
130382
|
+
if (e2.altKey && !e2.metaKey && !e2.ctrlKey && e2.code === "KeyL") {
|
|
130073
130383
|
e2.preventDefault();
|
|
130074
|
-
|
|
130384
|
+
onShowLegacyChange(!showLegacy);
|
|
130075
130385
|
return;
|
|
130076
130386
|
}
|
|
130077
130387
|
if ((e2.metaKey || e2.ctrlKey) && !e2.shiftKey && !e2.altKey && /^Digit[1-9]$/.test(e2.code)) {
|
|
@@ -130124,27 +130434,41 @@ function ModelChainList({
|
|
|
130124
130434
|
return () => document.removeEventListener("keydown", listener);
|
|
130125
130435
|
}, []);
|
|
130126
130436
|
const pad = dense ? "px-3" : "px-4";
|
|
130437
|
+
const notice = loadError ? null : catalog2 === null ? labels.modelsLoading : catalog2.length === 0 ? emptyText ?? labels.modelsNoProviders : rows2.length === 0 ? customIds ? labels.modelsTypeAnId : labels.modelsNoMatch(query.trim()) : null;
|
|
130127
130438
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: `zg-model-picker flex flex-col min-h-0 ${className}`, children: [
|
|
130128
130439
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130129
|
-
|
|
130440
|
+
ModelChainHeader,
|
|
130130
130441
|
{
|
|
130131
130442
|
pad,
|
|
130132
130443
|
query,
|
|
130133
130444
|
onQuery: setQuery,
|
|
130134
|
-
|
|
130135
|
-
|
|
130445
|
+
showLegacy,
|
|
130446
|
+
onShowLegacyChange,
|
|
130447
|
+
toolbar,
|
|
130448
|
+
pills: tabs.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelProviderPills, { groups: tabs, active: spy.active, dense, onJump: jumpTo }) : void 0,
|
|
130136
130449
|
inputRef
|
|
130137
130450
|
}
|
|
130138
130451
|
),
|
|
130139
|
-
tabs.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx(ModelProviderPills, { groups: tabs, active: spy.active, pad, dense, onJump: jumpTo }),
|
|
130140
130452
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 h-px bg-[var(--zg-hairline)]" }),
|
|
130141
|
-
|
|
130142
|
-
|
|
130143
|
-
|
|
130144
|
-
|
|
130145
|
-
|
|
130146
|
-
|
|
130147
|
-
|
|
130453
|
+
loadError || notice ? /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
130454
|
+
"div",
|
|
130455
|
+
{
|
|
130456
|
+
role: "status",
|
|
130457
|
+
className: `flex-1 min-h-0 flex flex-col items-center justify-center gap-2 px-6 py-8 text-center text-xs ${loadError ? "text-zg-danger" : "text-[var(--zg-text-muted)]"}`,
|
|
130458
|
+
children: [
|
|
130459
|
+
loadError ? labels.modelsLoadFailed(loadError) : notice,
|
|
130460
|
+
loadError && onRetry && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130461
|
+
"button",
|
|
130462
|
+
{
|
|
130463
|
+
type: "button",
|
|
130464
|
+
className: "underline text-[var(--zg-text)] bg-transparent border-0 cursor-pointer",
|
|
130465
|
+
onClick: onRetry,
|
|
130466
|
+
children: labels.retry
|
|
130467
|
+
}
|
|
130468
|
+
)
|
|
130469
|
+
]
|
|
130470
|
+
}
|
|
130471
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130148
130472
|
ModelChainRows,
|
|
130149
130473
|
{
|
|
130150
130474
|
layout: layout2,
|
|
@@ -130155,7 +130479,7 @@ function ModelChainList({
|
|
|
130155
130479
|
isNew,
|
|
130156
130480
|
dense,
|
|
130157
130481
|
single,
|
|
130158
|
-
countHidden: !
|
|
130482
|
+
countHidden: !showLegacy && !query.trim(),
|
|
130159
130483
|
onHover,
|
|
130160
130484
|
onPick,
|
|
130161
130485
|
onRemove,
|
|
@@ -130170,18 +130494,140 @@ function ModelChainList({
|
|
|
130170
130494
|
single,
|
|
130171
130495
|
multi: chain.length > 1,
|
|
130172
130496
|
selected: chain.length,
|
|
130173
|
-
|
|
130174
|
-
|
|
130497
|
+
hiddenLegacy,
|
|
130498
|
+
onShowLegacy: () => onShowLegacyChange(true)
|
|
130175
130499
|
}
|
|
130176
130500
|
)
|
|
130177
130501
|
] });
|
|
130178
130502
|
}
|
|
130503
|
+
const imageModelKey = (row) => `${row.providerKey}/${row.modelId}`;
|
|
130504
|
+
function effectiveImageModel(rows2, value) {
|
|
130505
|
+
return rows2.find((r2) => r2.available && imageModelKey(r2) === value) ?? rows2.find((r2) => r2.available && r2.isDefault) ?? rows2.find((r2) => r2.available) ?? null;
|
|
130506
|
+
}
|
|
130507
|
+
function imageCatalogRows(rows2) {
|
|
130508
|
+
return rows2.map((row) => ({
|
|
130509
|
+
providerKey: row.providerKey,
|
|
130510
|
+
providerLabel: row.providerLabel,
|
|
130511
|
+
modelId: row.modelId,
|
|
130512
|
+
modelName: row.modelName,
|
|
130513
|
+
contextWindow: null,
|
|
130514
|
+
supportsReasoning: false,
|
|
130515
|
+
...row.references ? { references: true } : {},
|
|
130516
|
+
...row.transparency ? { transparency: true } : {},
|
|
130517
|
+
...row.available ? {} : { unavailable: row.reason ?? "" }
|
|
130518
|
+
}));
|
|
130519
|
+
}
|
|
130520
|
+
function ImageModelList({
|
|
130521
|
+
rows: rows2,
|
|
130522
|
+
value,
|
|
130523
|
+
loadError = null,
|
|
130524
|
+
onRetry,
|
|
130525
|
+
onPick,
|
|
130526
|
+
showLegacy,
|
|
130527
|
+
onShowLegacyChange,
|
|
130528
|
+
toolbar,
|
|
130529
|
+
query,
|
|
130530
|
+
onQueryChange,
|
|
130531
|
+
dense = true,
|
|
130532
|
+
className = ""
|
|
130533
|
+
}) {
|
|
130534
|
+
const labels = useChatLabels();
|
|
130535
|
+
const catalog2 = reactExports.useMemo(() => rows2 ? imageCatalogRows(rows2) : null, [rows2]);
|
|
130536
|
+
const current2 = rows2 ? effectiveImageModel(rows2, value) : null;
|
|
130537
|
+
const initialChain = reactExports.useMemo(
|
|
130538
|
+
() => current2 ? [{ providerKey: current2.providerKey, modelId: current2.modelId }] : [],
|
|
130539
|
+
[current2]
|
|
130540
|
+
);
|
|
130541
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130542
|
+
ModelChainList,
|
|
130543
|
+
{
|
|
130544
|
+
single: true,
|
|
130545
|
+
dense,
|
|
130546
|
+
customIds: false,
|
|
130547
|
+
emptyText: labels.imageModelsNone,
|
|
130548
|
+
initialChain,
|
|
130549
|
+
catalog: catalog2,
|
|
130550
|
+
loadError,
|
|
130551
|
+
...onRetry ? { onRetry } : {},
|
|
130552
|
+
showLegacy,
|
|
130553
|
+
onShowLegacyChange,
|
|
130554
|
+
onChainChange: () => void 0,
|
|
130555
|
+
onQuickPick: ([pick2]) => {
|
|
130556
|
+
if (pick2) onPick(imageModelKey(pick2));
|
|
130557
|
+
},
|
|
130558
|
+
toolbar,
|
|
130559
|
+
...query !== void 0 ? { query } : {},
|
|
130560
|
+
...onQueryChange ? { onQueryChange } : {},
|
|
130561
|
+
className
|
|
130562
|
+
},
|
|
130563
|
+
current2 ? imageModelKey(current2) : ""
|
|
130564
|
+
);
|
|
130565
|
+
}
|
|
130566
|
+
function rowOf$2(pick2, catalog2) {
|
|
130567
|
+
if (catalog2) {
|
|
130568
|
+
const key2 = refKey(resolvePick(pick2, catalog2));
|
|
130569
|
+
const hit = catalog2.find((entry) => rowKey(entry) === key2);
|
|
130570
|
+
if (hit) return hit;
|
|
130571
|
+
}
|
|
130572
|
+
return {
|
|
130573
|
+
providerKey: pick2.providerKey,
|
|
130574
|
+
providerLabel: catalog2?.find((entry) => entry.providerKey === pick2.providerKey)?.providerLabel ?? pick2.providerKey,
|
|
130575
|
+
modelId: pick2.modelId,
|
|
130576
|
+
modelName: pick2.modelId,
|
|
130577
|
+
contextWindow: null,
|
|
130578
|
+
supportsReasoning: false
|
|
130579
|
+
};
|
|
130580
|
+
}
|
|
130581
|
+
function ModelChainTooltip({
|
|
130582
|
+
chain,
|
|
130583
|
+
catalog: catalog2,
|
|
130584
|
+
serving = null,
|
|
130585
|
+
forNextChat = false,
|
|
130586
|
+
footer: footer2
|
|
130587
|
+
}) {
|
|
130588
|
+
const labels = useChatLabels();
|
|
130589
|
+
const rows2 = chain.map((pick2) => rowOf$2(pick2, catalog2));
|
|
130590
|
+
const primaryName = rows2[0] ? modelDisplayName(rows2[0]).name : labels.modelServingFallback;
|
|
130591
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex flex-col gap-1.5 py-0.5 text-left whitespace-normal", "data-testid": "model-chain-tooltip", children: [
|
|
130592
|
+
serving && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-zg-warn leading-snug", children: labels.modelServing(primaryName, serving) }),
|
|
130593
|
+
forNextChat && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta", children: labels.modelForNextChat }),
|
|
130594
|
+
rows2.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[var(--zg-text-muted)]", children: labels.modelChainNoModel }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130595
|
+
"span",
|
|
130596
|
+
{
|
|
130597
|
+
role: "list",
|
|
130598
|
+
"aria-label": labels.modelChain,
|
|
130599
|
+
className: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto_auto] items-center gap-x-2 gap-y-1",
|
|
130600
|
+
children: rows2.map((entry, i2) => {
|
|
130601
|
+
const display = modelDisplayName(entry);
|
|
130602
|
+
const sub = display.vendor ?? (display.name !== entry.modelId ? entry.modelId : null);
|
|
130603
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { role: "listitem", className: "contents", "data-model": entry.modelId, children: [
|
|
130604
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130605
|
+
"span",
|
|
130606
|
+
{
|
|
130607
|
+
className: `text-zg-badge font-semibold tabular-nums text-center ${i2 === 0 ? "text-[var(--zg-accent)]" : "text-[var(--zg-text-muted)]"}`,
|
|
130608
|
+
title: i2 === 0 ? labels.modelPrimaryHint : labels.modelFallbackPosition(i2),
|
|
130609
|
+
children: i2 + 1
|
|
130610
|
+
}
|
|
130611
|
+
),
|
|
130612
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "min-w-0 flex items-baseline gap-2", children: [
|
|
130613
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate text-[var(--zg-text)]", children: display.name }),
|
|
130614
|
+
sub && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta truncate", children: sub })
|
|
130615
|
+
] }),
|
|
130616
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelProviderChip, { entry }) }),
|
|
130617
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelWindow, { entry }) }),
|
|
130618
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex w-3 justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelReasoning, { entry }) })
|
|
130619
|
+
] }, `${rowKey(entry)}:${i2}`);
|
|
130620
|
+
})
|
|
130621
|
+
}
|
|
130622
|
+
),
|
|
130623
|
+
footer2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "zg-meta flex items-center gap-1.5 pt-0.5", children: footer2 })
|
|
130624
|
+
] });
|
|
130625
|
+
}
|
|
130179
130626
|
function ModelPickerFrame({
|
|
130180
130627
|
name: name2,
|
|
130181
|
-
account = null,
|
|
130182
130628
|
fallbacks = 0,
|
|
130183
130629
|
serving = null,
|
|
130184
|
-
|
|
130630
|
+
tooltip,
|
|
130185
130631
|
ariaLabel,
|
|
130186
130632
|
width = 440,
|
|
130187
130633
|
onDismiss,
|
|
@@ -130197,38 +130643,53 @@ function ModelPickerFrame({
|
|
|
130197
130643
|
width,
|
|
130198
130644
|
...onDismiss ? { onDismiss } : {},
|
|
130199
130645
|
...onOpenChange ? { onOpenChange } : {},
|
|
130200
|
-
trigger: (props) =>
|
|
130201
|
-
|
|
130202
|
-
|
|
130203
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium max-w-[12rem] min-w-0 truncate", children:
|
|
130204
|
-
|
|
130205
|
-
|
|
130206
|
-
|
|
130207
|
-
|
|
130208
|
-
|
|
130209
|
-
|
|
130210
|
-
|
|
130646
|
+
trigger: (props, open) => {
|
|
130647
|
+
const pill = (
|
|
130648
|
+
// Named by what it shows; the tooltip describes the chain (`aria-describedby`).
|
|
130649
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PickerPill, { ...props, "data-testid": "model-pill", children: serving ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium text-zg-warn max-w-[12rem] min-w-0 truncate", children: serving }) : name2 ? (
|
|
130650
|
+
// Baseline, not centre: the mono "+N" otherwise rides above the name.
|
|
130651
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-baseline gap-1 min-w-0", children: [
|
|
130652
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium max-w-[12rem] min-w-0 truncate", children: name2 }),
|
|
130653
|
+
fallbacks > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "zg-meta shrink-0", "data-testid": "model-chain-suffix", children: [
|
|
130654
|
+
"+",
|
|
130655
|
+
fallbacks
|
|
130656
|
+
] })
|
|
130657
|
+
] })
|
|
130658
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-medium min-w-0 truncate", children: labels.chooseModel }) })
|
|
130659
|
+
);
|
|
130660
|
+
return tooltip ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { label: tooltip, side: "top", portal: true, maxWidth: 420, disabled: open, className: "min-w-0 max-w-full", children: pill }) : pill;
|
|
130661
|
+
},
|
|
130211
130662
|
children
|
|
130212
130663
|
}
|
|
130213
130664
|
);
|
|
130214
130665
|
}
|
|
130666
|
+
const LIST_HEIGHT = "h-[min(60vh,460px)]";
|
|
130667
|
+
const LIST_MAX_HEIGHT = "max-h-[min(60vh,460px)]";
|
|
130215
130668
|
function ModelChainPopover({
|
|
130216
130669
|
catalog: catalog2,
|
|
130217
130670
|
loadError = null,
|
|
130218
130671
|
onRetry,
|
|
130219
130672
|
chain,
|
|
130220
130673
|
onCommit,
|
|
130221
|
-
|
|
130222
|
-
|
|
130674
|
+
showLegacy,
|
|
130675
|
+
onShowLegacyChange,
|
|
130223
130676
|
single = false,
|
|
130224
130677
|
serving = null,
|
|
130225
130678
|
name: name2,
|
|
130226
|
-
|
|
130679
|
+
forNextChat = false,
|
|
130680
|
+
shortcut,
|
|
130227
130681
|
ariaLabel,
|
|
130228
|
-
onOpenChange
|
|
130682
|
+
onOpenChange,
|
|
130683
|
+
images,
|
|
130684
|
+
kind
|
|
130229
130685
|
}) {
|
|
130686
|
+
const labels = useChatLabels();
|
|
130230
130687
|
const draft2 = reactExports.useRef(null);
|
|
130688
|
+
const [tab2, setTab] = reactExports.useState("chat");
|
|
130689
|
+
const [query, setQuery] = reactExports.useState("");
|
|
130231
130690
|
const primary = chain[0];
|
|
130691
|
+
const switchable = images !== void 0 && kind === void 0;
|
|
130692
|
+
const shown2 = kind === "image" && images ? "image" : switchable ? tab2 : "chat";
|
|
130232
130693
|
reactExports.useEffect(() => {
|
|
130233
130694
|
if (!catalog2 || catalog2.length === 0) return void 0;
|
|
130234
130695
|
const warm = () => void modelLineup(catalog2);
|
|
@@ -130239,33 +130700,112 @@ function ModelChainPopover({
|
|
|
130239
130700
|
const id2 = setTimeout(warm, 200);
|
|
130240
130701
|
return () => clearTimeout(id2);
|
|
130241
130702
|
}, [catalog2]);
|
|
130242
|
-
const account = primary?.account ? catalog2?.find((e2) => e2.providerKey === primary.providerKey && e2.account?.id === primary.account)?.account : void 0;
|
|
130243
130703
|
const commitDraft = async () => {
|
|
130244
130704
|
const edited = draft2.current;
|
|
130245
130705
|
draft2.current = null;
|
|
130246
130706
|
if (!edited?.chain[0] || chainsEqualKeyed(edited.chain, edited.initial, refKey)) return;
|
|
130247
130707
|
await onCommit(edited.chain);
|
|
130248
130708
|
};
|
|
130709
|
+
const listHeight = switchable ? LIST_HEIGHT : LIST_MAX_HEIGHT;
|
|
130710
|
+
const toolbar = switchable ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130711
|
+
Segmented,
|
|
130712
|
+
{
|
|
130713
|
+
size: "sm",
|
|
130714
|
+
ariaLabel: labels.modelKinds,
|
|
130715
|
+
value: tab2,
|
|
130716
|
+
onChange: setTab,
|
|
130717
|
+
options: [
|
|
130718
|
+
{ value: "chat", label: labels.modelsChatTab, icon: "i-ph-chat-circle" },
|
|
130719
|
+
{ value: "image", label: labels.modelsImageTab, icon: "i-ph-image" }
|
|
130720
|
+
]
|
|
130721
|
+
}
|
|
130722
|
+
) : void 0;
|
|
130723
|
+
if (kind === "image" && images) {
|
|
130724
|
+
const current2 = images.rows ? effectiveImageModel(images.rows, images.value) : null;
|
|
130725
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130726
|
+
ModelPickerFrame,
|
|
130727
|
+
{
|
|
130728
|
+
ariaLabel: ariaLabel ?? labels.imageModelsPill,
|
|
130729
|
+
tooltip: labels.imageModelsPill,
|
|
130730
|
+
onOpenChange: (open) => {
|
|
130731
|
+
if (!open) setQuery("");
|
|
130732
|
+
onOpenChange?.(open);
|
|
130733
|
+
},
|
|
130734
|
+
name: current2?.modelName ?? null,
|
|
130735
|
+
children: (close2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130736
|
+
ImageModelList,
|
|
130737
|
+
{
|
|
130738
|
+
rows: images.rows,
|
|
130739
|
+
value: images.value,
|
|
130740
|
+
loadError: images.loadError ?? null,
|
|
130741
|
+
onPick: (key2) => {
|
|
130742
|
+
images.onPick(key2);
|
|
130743
|
+
close2();
|
|
130744
|
+
},
|
|
130745
|
+
showLegacy,
|
|
130746
|
+
onShowLegacyChange,
|
|
130747
|
+
query,
|
|
130748
|
+
onQueryChange: setQuery,
|
|
130749
|
+
className: listHeight
|
|
130750
|
+
}
|
|
130751
|
+
)
|
|
130752
|
+
}
|
|
130753
|
+
);
|
|
130754
|
+
}
|
|
130249
130755
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130250
130756
|
ModelPickerFrame,
|
|
130251
130757
|
{
|
|
130252
130758
|
...ariaLabel ? { ariaLabel } : {},
|
|
130253
|
-
|
|
130254
|
-
|
|
130759
|
+
tooltip: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130760
|
+
ModelChainTooltip,
|
|
130761
|
+
{
|
|
130762
|
+
chain,
|
|
130763
|
+
catalog: catalog2,
|
|
130764
|
+
serving,
|
|
130765
|
+
forNextChat,
|
|
130766
|
+
footer: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
130767
|
+
ariaLabel ?? (chain.length > 0 ? labels.switchModel : labels.chooseModel),
|
|
130768
|
+
shortcut
|
|
130769
|
+
] })
|
|
130770
|
+
}
|
|
130771
|
+
),
|
|
130772
|
+
onOpenChange: (open) => {
|
|
130773
|
+
if (!open) {
|
|
130774
|
+
setTab("chat");
|
|
130775
|
+
setQuery("");
|
|
130776
|
+
}
|
|
130777
|
+
onOpenChange?.(open);
|
|
130778
|
+
},
|
|
130255
130779
|
onDismiss: () => void commitDraft(),
|
|
130256
130780
|
name: name2 !== void 0 ? name2 : primary ? modelNameOf(catalog2, primary.modelId, primary.providerKey) : null,
|
|
130257
|
-
account: account?.label ?? null,
|
|
130258
130781
|
fallbacks: Math.max(0, chain.length - 1),
|
|
130259
130782
|
serving,
|
|
130260
|
-
children: (close2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130783
|
+
children: (close2) => images && shown2 === "image" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130784
|
+
ImageModelList,
|
|
130785
|
+
{
|
|
130786
|
+
rows: images.rows,
|
|
130787
|
+
value: images.value,
|
|
130788
|
+
loadError: images.loadError ?? null,
|
|
130789
|
+
onPick: (key2) => {
|
|
130790
|
+
images.onPick(key2);
|
|
130791
|
+
close2();
|
|
130792
|
+
},
|
|
130793
|
+
showLegacy,
|
|
130794
|
+
onShowLegacyChange,
|
|
130795
|
+
toolbar,
|
|
130796
|
+
query,
|
|
130797
|
+
onQueryChange: setQuery,
|
|
130798
|
+
className: listHeight
|
|
130799
|
+
}
|
|
130800
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130261
130801
|
ModelChainMenu,
|
|
130262
130802
|
{
|
|
130263
130803
|
chain,
|
|
130264
130804
|
catalog: catalog2,
|
|
130265
130805
|
loadError,
|
|
130266
130806
|
...onRetry ? { onRetry } : {},
|
|
130267
|
-
|
|
130268
|
-
|
|
130807
|
+
showLegacy,
|
|
130808
|
+
onShowLegacyChange,
|
|
130269
130809
|
single,
|
|
130270
130810
|
onDraft: (initial, next) => {
|
|
130271
130811
|
draft2.current = { initial, chain: next };
|
|
@@ -130274,7 +130814,11 @@ function ModelChainPopover({
|
|
|
130274
130814
|
draft2.current = null;
|
|
130275
130815
|
await onCommit(next);
|
|
130276
130816
|
close2();
|
|
130277
|
-
}
|
|
130817
|
+
},
|
|
130818
|
+
toolbar,
|
|
130819
|
+
query,
|
|
130820
|
+
onQueryChange: setQuery,
|
|
130821
|
+
className: listHeight
|
|
130278
130822
|
}
|
|
130279
130823
|
)
|
|
130280
130824
|
}
|
|
@@ -130285,11 +130829,15 @@ function ModelChainMenu({
|
|
|
130285
130829
|
catalog: catalog2,
|
|
130286
130830
|
loadError,
|
|
130287
130831
|
onRetry,
|
|
130288
|
-
|
|
130289
|
-
|
|
130832
|
+
showLegacy,
|
|
130833
|
+
onShowLegacyChange,
|
|
130290
130834
|
single,
|
|
130291
130835
|
onDraft,
|
|
130292
|
-
onQuickPick
|
|
130836
|
+
onQuickPick,
|
|
130837
|
+
toolbar,
|
|
130838
|
+
query,
|
|
130839
|
+
onQueryChange,
|
|
130840
|
+
className
|
|
130293
130841
|
}) {
|
|
130294
130842
|
const [initial] = reactExports.useState(() => [...chain]);
|
|
130295
130843
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -130301,11 +130849,14 @@ function ModelChainMenu({
|
|
|
130301
130849
|
catalog: catalog2,
|
|
130302
130850
|
loadError,
|
|
130303
130851
|
...onRetry ? { onRetry } : {},
|
|
130304
|
-
|
|
130305
|
-
|
|
130852
|
+
showLegacy,
|
|
130853
|
+
onShowLegacyChange,
|
|
130306
130854
|
onChainChange: (next) => onDraft(initial, next),
|
|
130307
130855
|
onQuickPick: (next) => void onQuickPick(next),
|
|
130308
|
-
className
|
|
130856
|
+
className,
|
|
130857
|
+
toolbar,
|
|
130858
|
+
query,
|
|
130859
|
+
onQueryChange
|
|
130309
130860
|
}
|
|
130310
130861
|
);
|
|
130311
130862
|
}
|
|
@@ -130322,7 +130873,10 @@ function ModelPicker({
|
|
|
130322
130873
|
remember: remember2 = true
|
|
130323
130874
|
}) {
|
|
130324
130875
|
const { setDefaultModel, refresh } = useSessionsActions();
|
|
130325
|
-
const {
|
|
130876
|
+
const { settings, setSetting } = useSettings();
|
|
130877
|
+
const showImages = (activeSession ? activeSession.hostId : hostId) == null && settings.imageGeneration !== false;
|
|
130878
|
+
const imageModels = useIpcResource(showImages ? imageModelsResource(activeSession?.cwd ?? null, null) : null);
|
|
130879
|
+
const { showLegacy } = useModelPickerPrefs();
|
|
130326
130880
|
const [open, setOpen] = reactExports.useState(false);
|
|
130327
130881
|
const cacheHint = useCacheHints(activeSession?.id ?? null, open);
|
|
130328
130882
|
const rows2 = reactExports.useMemo(
|
|
@@ -130347,23 +130901,31 @@ function ModelPicker({
|
|
|
130347
130901
|
await refresh();
|
|
130348
130902
|
};
|
|
130349
130903
|
const nameOf2 = (id2, key2 = providerKey) => modelNameOf(catalog2, id2, key2);
|
|
130350
|
-
const
|
|
130351
|
-
const title = fallbackModel ? `${modelId ? nameOf2(modelId) : "The picked model"} failed this run, so ${nameOf2(fallbackModel.model, fallbackModel.provider)} took over. The next run tries the picked model again.` : activeSession ? chainFallbacks.length > 0 && modelId ? `Falls back in order: 1. ${nameOf2(modelId)}${chainFallbacks.map((f2, i2) => `, ${i2 + 2}. ${nameOf2(f2.modelId, f2.providerKey)}`).join("")} (Ctrl+M)` : `${nameOf2(modelId ?? "")} (${modelId})${pickedAccount && providerKey ? ` on ${providerAccountLabel({ providerLabel: catalog2?.find((e2) => e2.providerKey === providerKey)?.providerLabel ?? providerKey, account: pickedAccount })}` : ""}. Switch model (Ctrl+M)` : modelId ? "Model for the next chat" : "Pick a model for the next chat";
|
|
130904
|
+
const chord = activeSession ? getMergedKeybindings().openModelPicker : void 0;
|
|
130352
130905
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
130353
130906
|
ModelChainPopover,
|
|
130354
130907
|
{
|
|
130355
130908
|
ariaLabel: activeSession ? "Switch model" : "Pick default model",
|
|
130356
|
-
|
|
130909
|
+
forNextChat: !activeSession,
|
|
130910
|
+
...chord ? { shortcut: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyHint, { spec: chord, size: "sm" }) } : {},
|
|
130357
130911
|
name: modelId ? nameOf2(modelId) : null,
|
|
130358
130912
|
catalog: rows2,
|
|
130359
130913
|
loadError: catalogError,
|
|
130360
130914
|
...onRetryCatalog ? { onRetry: onRetryCatalog } : {},
|
|
130361
130915
|
chain,
|
|
130362
130916
|
onCommit: commit,
|
|
130363
|
-
|
|
130364
|
-
|
|
130917
|
+
showLegacy,
|
|
130918
|
+
onShowLegacyChange: (next) => setModelPickerPrefs({ showLegacy: next }),
|
|
130365
130919
|
serving: fallbackModel ? nameOf2(fallbackModel.model, fallbackModel.provider) : null,
|
|
130366
|
-
onOpenChange: setOpen
|
|
130920
|
+
onOpenChange: setOpen,
|
|
130921
|
+
...showImages ? {
|
|
130922
|
+
images: {
|
|
130923
|
+
rows: imageModels.data ?? null,
|
|
130924
|
+
value: settings.imageModel ?? "",
|
|
130925
|
+
loadError: imageModels.error ? String(imageModels.error) : null,
|
|
130926
|
+
onPick: (key2) => setSetting("imageModel", key2)
|
|
130927
|
+
}
|
|
130928
|
+
} : {}
|
|
130367
130929
|
}
|
|
130368
130930
|
);
|
|
130369
130931
|
}
|
|
@@ -135906,7 +136468,8 @@ function AddressBar({
|
|
|
135906
136468
|
icon,
|
|
135907
136469
|
placeholder,
|
|
135908
136470
|
normalize: normalize2,
|
|
135909
|
-
onSubmit
|
|
136471
|
+
onSubmit,
|
|
136472
|
+
onSubmitEmpty
|
|
135910
136473
|
}) {
|
|
135911
136474
|
const labels = useLabels();
|
|
135912
136475
|
const [draft2, setDraft] = reactExports.useState(null);
|
|
@@ -135953,6 +136516,12 @@ function AddressBar({
|
|
|
135953
136516
|
}
|
|
135954
136517
|
if (e2.key === "Enter") {
|
|
135955
136518
|
e2.preventDefault();
|
|
136519
|
+
if (onSubmitEmpty && !(draft2 ?? "").trim()) {
|
|
136520
|
+
onSubmitEmpty();
|
|
136521
|
+
setDraft(null);
|
|
136522
|
+
input.current?.blur();
|
|
136523
|
+
return;
|
|
136524
|
+
}
|
|
135956
136525
|
const next = normalize2(draft2 ?? "");
|
|
135957
136526
|
if (!next) {
|
|
135958
136527
|
setInvalid(true);
|
|
@@ -136128,7 +136697,8 @@ function BrowserNav({ sessionId, cwd: cwd2 }) {
|
|
|
136128
136697
|
icon: siteIcon2,
|
|
136129
136698
|
placeholder: "Enter a URL or a port (5173)",
|
|
136130
136699
|
normalize: normalizeBrowserUrl,
|
|
136131
|
-
onSubmit: (next) => browserStore.navigate(sessionId, next)
|
|
136700
|
+
onSubmit: (next) => browserStore.navigate(sessionId, next),
|
|
136701
|
+
onSubmitEmpty: () => browserStore.home(sessionId)
|
|
136132
136702
|
}
|
|
136133
136703
|
),
|
|
136134
136704
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "zg-segment shrink-0", children: [
|
|
@@ -136495,7 +137065,8 @@ function DevToolsDock({ sessionId }) {
|
|
|
136495
137065
|
] });
|
|
136496
137066
|
}
|
|
136497
137067
|
function BrowserEmpty({ cwd: cwd2, onOpen }) {
|
|
136498
|
-
const
|
|
137068
|
+
const [, setRevision] = reactExports.useState(0);
|
|
137069
|
+
const recent = recentBrowserPages(cwd2);
|
|
136499
137070
|
const [servers, setServers] = reactExports.useState([]);
|
|
136500
137071
|
const tabVisible = usePanelVisible();
|
|
136501
137072
|
reactExports.useEffect(() => {
|
|
@@ -136529,6 +137100,18 @@ function BrowserEmpty({ cwd: cwd2, onOpen }) {
|
|
|
136529
137100
|
};
|
|
136530
137101
|
}, [tabVisible]);
|
|
136531
137102
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute inset-0 overflow-y-auto px-5 py-8", "data-testid": "browser-empty", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-[420px] mx-auto flex flex-col gap-4", children: [
|
|
137103
|
+
recent.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "grid grid-cols-2 gap-2", "aria-label": "Recent pages", "data-testid": "browser-recent", children: recent.map((entry) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
137104
|
+
RecentCard,
|
|
137105
|
+
{
|
|
137106
|
+
entry,
|
|
137107
|
+
onOpen,
|
|
137108
|
+
onRemove: () => {
|
|
137109
|
+
removeRecentBrowserPage(cwd2, entry.url);
|
|
137110
|
+
setRevision((n2) => n2 + 1);
|
|
137111
|
+
}
|
|
137112
|
+
},
|
|
137113
|
+
entry.url
|
|
137114
|
+
)) }),
|
|
136532
137115
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
136533
137116
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[13px] font-medium text-[var(--zg-text)]", children: "Open a page" }),
|
|
136534
137117
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-[12px] text-[var(--zg-text-muted)]", children: "Type an address or a port above. The agent can use this browser too." })
|
|
@@ -136548,21 +137131,75 @@ function BrowserEmpty({ cwd: cwd2, onOpen }) {
|
|
|
136548
137131
|
},
|
|
136549
137132
|
s2.port
|
|
136550
137133
|
))
|
|
136551
|
-
] }),
|
|
136552
|
-
recent.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "flex flex-col gap-0.5 -mx-2", children: [
|
|
136553
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SectionLabel, { className: "px-2 pb-1", children: "Recent" }),
|
|
136554
|
-
recent.map((url) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
136555
|
-
MenuRow$1,
|
|
136556
|
-
{
|
|
136557
|
-
onClick: () => onOpen(url),
|
|
136558
|
-
icon: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "i-ph-globe-simple text-[13px]", "aria-hidden": true }),
|
|
136559
|
-
title: displayUrl(url)
|
|
136560
|
-
},
|
|
136561
|
-
url
|
|
136562
|
-
))
|
|
136563
137134
|
] })
|
|
136564
137135
|
] }) });
|
|
136565
137136
|
}
|
|
137137
|
+
function RecentCard({
|
|
137138
|
+
entry,
|
|
137139
|
+
onOpen,
|
|
137140
|
+
onRemove
|
|
137141
|
+
}) {
|
|
137142
|
+
const icon = useSiteIcon(entry.url);
|
|
137143
|
+
const address = displayUrl(entry.url);
|
|
137144
|
+
const dots = reactExports.useRef(null);
|
|
137145
|
+
const [menu, setMenu] = reactExports.useState(null);
|
|
137146
|
+
const items = [
|
|
137147
|
+
{ id: "open-external", label: "Open in browser", onSelect: () => window.open(entry.url, "_blank") },
|
|
137148
|
+
{ id: "remove", label: "Remove", group: "remove", destructive: true, onSelect: onRemove }
|
|
137149
|
+
];
|
|
137150
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
137151
|
+
"div",
|
|
137152
|
+
{
|
|
137153
|
+
className: "group relative min-w-0",
|
|
137154
|
+
onContextMenu: (event) => {
|
|
137155
|
+
event.preventDefault();
|
|
137156
|
+
setMenu({ x: event.clientX, y: event.clientY });
|
|
137157
|
+
},
|
|
137158
|
+
children: [
|
|
137159
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
137160
|
+
"button",
|
|
137161
|
+
{
|
|
137162
|
+
type: "button",
|
|
137163
|
+
onClick: () => onOpen(entry.url),
|
|
137164
|
+
title: entry.url,
|
|
137165
|
+
className: "zg-raised zg-press-soft w-full min-w-0 flex flex-col gap-1 px-2.5 py-2 rounded-[var(--zg-radius-md)] border cursor-pointer text-left hover:before:bg-[var(--zg-row-hover)]",
|
|
137166
|
+
children: [
|
|
137167
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-center gap-1.5 min-w-0 pr-5", children: [
|
|
137168
|
+
icon ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: icon, alt: "", draggable: false, className: "w-3.5 h-3.5 shrink-0 rounded-[3px] object-contain" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "i-ph-globe-simple w-3.5 h-3.5 shrink-0 text-[var(--zg-text-subtle)]" }),
|
|
137169
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate text-[12px] font-medium text-[var(--zg-text)]", children: entry.title || address })
|
|
137170
|
+
] }),
|
|
137171
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "flex items-baseline gap-2 min-w-0 zg-meta", children: [
|
|
137172
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate", children: address }),
|
|
137173
|
+
entry.visitedAt > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-auto shrink-0 tabular-nums", title: new Date(entry.visitedAt).toLocaleString(), children: relativeTime(entry.visitedAt, Date.now()) })
|
|
137174
|
+
] })
|
|
137175
|
+
]
|
|
137176
|
+
}
|
|
137177
|
+
),
|
|
137178
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
137179
|
+
IconButton,
|
|
137180
|
+
{
|
|
137181
|
+
ref: dots,
|
|
137182
|
+
icon: "i-ph-dots-three",
|
|
137183
|
+
label: `Actions for ${entry.title || address}`,
|
|
137184
|
+
size: "xs",
|
|
137185
|
+
active: menu === "dots",
|
|
137186
|
+
className: `absolute top-1.5 right-1.5 ${menu === "dots" ? "" : "opacity-0 group-hover:opacity-100 focus-visible:opacity-100"}`,
|
|
137187
|
+
onClick: () => setMenu((m2) => m2 === "dots" ? null : "dots")
|
|
137188
|
+
}
|
|
137189
|
+
),
|
|
137190
|
+
menu !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
137191
|
+
RowActionsMenu,
|
|
137192
|
+
{
|
|
137193
|
+
open: true,
|
|
137194
|
+
...menu === "dots" ? { anchorRef: dots } : { position: menu },
|
|
137195
|
+
onClose: () => setMenu(null),
|
|
137196
|
+
items
|
|
137197
|
+
}
|
|
137198
|
+
)
|
|
137199
|
+
]
|
|
137200
|
+
}
|
|
137201
|
+
);
|
|
137202
|
+
}
|
|
136566
137203
|
function BrowserError({ error, onReload }) {
|
|
136567
137204
|
const host = hostOf(error.url) || error.url;
|
|
136568
137205
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -178364,7 +179001,7 @@ function ModelChainPicker({
|
|
|
178364
179001
|
className = "",
|
|
178365
179002
|
sessionId = null
|
|
178366
179003
|
}) {
|
|
178367
|
-
const {
|
|
179004
|
+
const { showLegacy } = useModelPickerPrefs();
|
|
178368
179005
|
const { catalog: catalog2, error, retry } = useModelCatalog$1(outerCatalog, cwd2, hostId);
|
|
178369
179006
|
const cacheHint = useCacheHints(sessionId);
|
|
178370
179007
|
const primary = initialChain[0];
|
|
@@ -178386,8 +179023,8 @@ function ModelChainPicker({
|
|
|
178386
179023
|
catalog: rows2,
|
|
178387
179024
|
loadError: error,
|
|
178388
179025
|
...retry ? { onRetry: retry } : {},
|
|
178389
|
-
|
|
178390
|
-
|
|
179026
|
+
showLegacy,
|
|
179027
|
+
onShowLegacyChange: (next) => setModelPickerPrefs({ showLegacy: next }),
|
|
178391
179028
|
onChainChange,
|
|
178392
179029
|
...onQuickPick ? { onQuickPick } : {},
|
|
178393
179030
|
dense,
|
|
@@ -185935,7 +186572,8 @@ const AGENT = {
|
|
|
185935
186572
|
}
|
|
185936
186573
|
]
|
|
185937
186574
|
},
|
|
185938
|
-
{ key: "subagentModels" }
|
|
186575
|
+
{ key: "subagentModels" },
|
|
186576
|
+
{ key: "imageGeneration" }
|
|
185939
186577
|
]
|
|
185940
186578
|
},
|
|
185941
186579
|
{
|
|
@@ -188794,13 +189432,13 @@ function settingsSource(openSettings, chat) {
|
|
|
188794
189432
|
source: SETTINGS_SOURCE_ID
|
|
188795
189433
|
},
|
|
188796
189434
|
{
|
|
188797
|
-
id: "setting:models-
|
|
188798
|
-
title: "Show
|
|
189435
|
+
id: "setting:models-legacy",
|
|
189436
|
+
title: "Show legacy models",
|
|
188799
189437
|
description: "List every model a provider serves in the model picker",
|
|
188800
189438
|
group: "Settings",
|
|
188801
189439
|
icon: { gui: "i-ph-clock-counter-clockwise" },
|
|
188802
189440
|
kind: "toggle",
|
|
188803
|
-
checked: getModelPickerPrefs().
|
|
189441
|
+
checked: getModelPickerPrefs().showLegacy,
|
|
188804
189442
|
keywords: ["model picker", "legacy", "models", "lineup"],
|
|
188805
189443
|
source: SETTINGS_SOURCE_ID
|
|
188806
189444
|
},
|
|
@@ -188912,8 +189550,8 @@ function settingsSource(openSettings, chat) {
|
|
|
188912
189550
|
const a2 = getAppearance();
|
|
188913
189551
|
const e2 = getEditor();
|
|
188914
189552
|
switch (itemId) {
|
|
188915
|
-
case "setting:models-
|
|
188916
|
-
setModelPickerPrefs({
|
|
189553
|
+
case "setting:models-legacy":
|
|
189554
|
+
setModelPickerPrefs({ showLegacy: !getModelPickerPrefs().showLegacy });
|
|
188917
189555
|
return;
|
|
188918
189556
|
case "setting:transcript-compact":
|
|
188919
189557
|
chat.setTranscriptDensity(chat.transcriptDensity === "compact" ? "full" : "compact");
|
|
@@ -190236,7 +190874,7 @@ const GUI_LABELS = {
|
|
|
190236
190874
|
rename: "Rename chat",
|
|
190237
190875
|
previous: "Previous attachment",
|
|
190238
190876
|
next: "Next attachment",
|
|
190239
|
-
modelReasoningHint: "
|
|
190877
|
+
modelReasoningHint: "Can think before answering (Ctrl+L sets the effort)"
|
|
190240
190878
|
};
|
|
190241
190879
|
function AppProviders({ children }) {
|
|
190242
190880
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(LabelsProvider, { labels: GUI_LABELS, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SettingsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(HostsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProviderUsageProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SafeModeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(McpAuthProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(DiscoveryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(StreamProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PresenceProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(TodosProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ArtifactsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageQueueProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PromptHistoryProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectTurnProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(InteractionsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PanelsProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PaletteProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BadgeMenuProvider, { children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
|