dsh-agy-link 0.6.21 → 0.6.23
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/CHANGELOG.md +83 -0
- package/README.md +1 -1
- package/dist/cli-image.mjs +552 -87
- package/dist/client.js +625 -225
- package/dist/index.js +886 -186
- package/docs/CONFIGURATION.md +12 -2
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -70,6 +70,7 @@ window.__ModuleLoader__.load({
|
|
|
70
70
|
"quota.fiveHour": "5 小时额度",
|
|
71
71
|
"quota.weekly": "周额度",
|
|
72
72
|
"quota.refreshed": "额度已刷新",
|
|
73
|
+
"quota.refreshStarted": "正在同步额度,稍后自动更新",
|
|
73
74
|
"quota.windowReset": "已重置 · 可用",
|
|
74
75
|
"proxy.button": "代理",
|
|
75
76
|
"proxy.placeholder": "专属代理 URL(如:http://127.0.0.1:7890;留空则使用全局)",
|
|
@@ -125,6 +126,8 @@ window.__ModuleLoader__.load({
|
|
|
125
126
|
"effort.low": "low",
|
|
126
127
|
"effort.medium": "medium",
|
|
127
128
|
"effort.high": "high",
|
|
129
|
+
"effort.xhigh": "extra",
|
|
130
|
+
"effort.max": "max",
|
|
128
131
|
"pool.label": "号池调度:",
|
|
129
132
|
"pool.sequential": "顺次耗尽",
|
|
130
133
|
"pool.roundRobin": "轮询均衡",
|
|
@@ -183,6 +186,12 @@ window.__ModuleLoader__.load({
|
|
|
183
186
|
"config.imageCopy": "复制命令",
|
|
184
187
|
"config.imageCopied": "命令已复制",
|
|
185
188
|
"config.imageCopyFailed": "复制失败,请手动选择命令",
|
|
189
|
+
"config.showHeaderBadge": "会话状态徽标",
|
|
190
|
+
"config.showHeaderBadgeDesc": "在会话头部工具栏显示 Antigravity 状态与账号徽标(窄屏/手机端会自动隐藏文字标签)",
|
|
191
|
+
"config.showTranslateAction": "单条翻译按钮",
|
|
192
|
+
"config.showTranslateActionDesc": "在助理消息下方操作栏显示「译成人话」按钮",
|
|
193
|
+
"config.poolWideCatalog": "号池全量模型并集",
|
|
194
|
+
"config.poolWideCatalogDesc": "在模型选择器展示所有启用账号支持的模型;选中后自动路由到支持该模型的账号(默认关闭:只显示当前账号的模型)",
|
|
186
195
|
"config.on": "开启",
|
|
187
196
|
"config.off": "关闭",
|
|
188
197
|
"config.runtimeTitle": "运行方式",
|
|
@@ -269,6 +278,7 @@ window.__ModuleLoader__.load({
|
|
|
269
278
|
"quota.fiveHour": "5-hour quota",
|
|
270
279
|
"quota.weekly": "Weekly quota",
|
|
271
280
|
"quota.refreshed": "Quota refreshed",
|
|
281
|
+
"quota.refreshStarted": "Syncing quota — figures update shortly",
|
|
272
282
|
"quota.windowReset": "Reset · available",
|
|
273
283
|
"proxy.button": "Proxy",
|
|
274
284
|
"proxy.placeholder": "Dedicated proxy URL (for example: http://127.0.0.1:7890; leave blank to use the global proxy)",
|
|
@@ -324,6 +334,8 @@ window.__ModuleLoader__.load({
|
|
|
324
334
|
"effort.low": "low",
|
|
325
335
|
"effort.medium": "medium",
|
|
326
336
|
"effort.high": "high",
|
|
337
|
+
"effort.xhigh": "extra",
|
|
338
|
+
"effort.max": "max",
|
|
327
339
|
"pool.label": "Account-pool scheduling:",
|
|
328
340
|
"pool.sequential": "Use sequentially",
|
|
329
341
|
"pool.roundRobin": "Round-robin",
|
|
@@ -382,6 +394,12 @@ window.__ModuleLoader__.load({
|
|
|
382
394
|
"config.imageCopy": "Copy command",
|
|
383
395
|
"config.imageCopied": "Command copied",
|
|
384
396
|
"config.imageCopyFailed": "Copy failed — select the command manually",
|
|
397
|
+
"config.showHeaderBadge": "Header status badge",
|
|
398
|
+
"config.showHeaderBadgeDesc": "Show the Antigravity status badge in the conversation header toolbar (text hidden on small screens)",
|
|
399
|
+
"config.showTranslateAction": "Translate button",
|
|
400
|
+
"config.showTranslateActionDesc": "Show the \"Translate to plain text\" button under assistant messages",
|
|
401
|
+
"config.poolWideCatalog": "Pool-wide model catalog",
|
|
402
|
+
"config.poolWideCatalogDesc": "Show every model supported by any enabled account in the picker; the scheduler routes to an account that can serve it (default off: active account only)",
|
|
385
403
|
"config.on": "On",
|
|
386
404
|
"config.off": "Off",
|
|
387
405
|
"config.runtimeTitle": "Runtime",
|
|
@@ -468,6 +486,7 @@ window.__ModuleLoader__.load({
|
|
|
468
486
|
"quota.fiveHour": "Cota de 5 horas",
|
|
469
487
|
"quota.weekly": "Cota semanal",
|
|
470
488
|
"quota.refreshed": "Cota atualizada",
|
|
489
|
+
"quota.refreshStarted": "Sincronizando a cota — os números atualizam em breve",
|
|
471
490
|
"quota.windowReset": "Redefinida · disponível",
|
|
472
491
|
"proxy.button": "Proxy",
|
|
473
492
|
"proxy.placeholder": "URL do proxy exclusivo (por exemplo: http://127.0.0.1:7890; deixe vazio para usar o proxy global)",
|
|
@@ -523,6 +542,8 @@ window.__ModuleLoader__.load({
|
|
|
523
542
|
"effort.low": "low",
|
|
524
543
|
"effort.medium": "medium",
|
|
525
544
|
"effort.high": "high",
|
|
545
|
+
"effort.xhigh": "extra",
|
|
546
|
+
"effort.max": "max",
|
|
526
547
|
"pool.label": "Agendamento do pool de contas:",
|
|
527
548
|
"pool.sequential": "Usar em sequência",
|
|
528
549
|
"pool.roundRobin": "Rodízio",
|
|
@@ -581,6 +602,12 @@ window.__ModuleLoader__.load({
|
|
|
581
602
|
"config.imageCopy": "Copiar comando",
|
|
582
603
|
"config.imageCopied": "Comando copiado",
|
|
583
604
|
"config.imageCopyFailed": "Falha ao copiar — selecione o comando manualmente",
|
|
605
|
+
"config.showHeaderBadge": "Ícone de status no cabeçalho",
|
|
606
|
+
"config.showHeaderBadgeDesc": "Exibe o emblema de status do Antigravity na barra de ferramentas do cabeçalho da conversa",
|
|
607
|
+
"config.showTranslateAction": "Botão de tradução",
|
|
608
|
+
"config.showTranslateActionDesc": "Exibe o botão de tradução sob as mensagens do assistente",
|
|
609
|
+
"config.poolWideCatalog": "Catálogo de modelos de todo o pool",
|
|
610
|
+
"config.poolWideCatalogDesc": "Mostra no seletor todos os modelos suportados por qualquer conta ativa; o escalonador escolhe a conta capaz de executá-lo (padrão desativado: apenas a conta atual)",
|
|
584
611
|
"config.on": "Ativado",
|
|
585
612
|
"config.off": "Desativado",
|
|
586
613
|
"config.runtimeTitle": "Execução",
|
|
@@ -667,6 +694,7 @@ window.__ModuleLoader__.load({
|
|
|
667
694
|
"quota.fiveHour": "Cuota de 5 horas",
|
|
668
695
|
"quota.weekly": "Cuota semanal",
|
|
669
696
|
"quota.refreshed": "Cuota actualizada",
|
|
697
|
+
"quota.refreshStarted": "Sincronizando la cuota — las cifras se actualizarán en breve",
|
|
670
698
|
"quota.windowReset": "Reiniciada · disponible",
|
|
671
699
|
"proxy.button": "Proxy",
|
|
672
700
|
"proxy.placeholder": "URL de proxy exclusivo (por ejemplo: http://127.0.0.1:7890; déjelo vacío para usar el proxy global)",
|
|
@@ -722,6 +750,8 @@ window.__ModuleLoader__.load({
|
|
|
722
750
|
"effort.low": "low",
|
|
723
751
|
"effort.medium": "medium",
|
|
724
752
|
"effort.high": "high",
|
|
753
|
+
"effort.xhigh": "extra",
|
|
754
|
+
"effort.max": "max",
|
|
725
755
|
"pool.label": "Programación del pool de cuentas:",
|
|
726
756
|
"pool.sequential": "Usar en secuencia",
|
|
727
757
|
"pool.roundRobin": "Turno rotativo",
|
|
@@ -780,6 +810,12 @@ window.__ModuleLoader__.load({
|
|
|
780
810
|
"config.imageCopy": "Copiar comando",
|
|
781
811
|
"config.imageCopied": "Comando copiado",
|
|
782
812
|
"config.imageCopyFailed": "Error al copiar — selecciona el comando manualmente",
|
|
813
|
+
"config.showHeaderBadge": "Insignia de estado en la cabecera",
|
|
814
|
+
"config.showHeaderBadgeDesc": "Muestra la insignia de estado de Antigravity en la barra de la cabecera de la conversación (el texto se oculta en pantallas pequeñas)",
|
|
815
|
+
"config.showTranslateAction": "Botón de traducción",
|
|
816
|
+
"config.showTranslateActionDesc": "Muestra el botón «Traducir a lenguaje sencillo» bajo los mensajes del asistente",
|
|
817
|
+
"config.poolWideCatalog": "Catálogo de modelos de todo el pool",
|
|
818
|
+
"config.poolWideCatalogDesc": "Muestra en el selector todos los modelos admitidos por cualquier cuenta activa; el planificador elige la cuenta que puede servirlo (desactivado por defecto: solo la cuenta actual)",
|
|
783
819
|
"config.on": "Activado",
|
|
784
820
|
"config.off": "Desactivado",
|
|
785
821
|
"config.runtimeTitle": "Ejecución",
|
|
@@ -1837,18 +1873,6 @@ window.__ModuleLoader__.load({
|
|
|
1837
1873
|
box-shadow: 0 2px 10px rgba(168, 85, 247, 0.25);
|
|
1838
1874
|
}
|
|
1839
1875
|
|
|
1840
|
-
.agy-chip-file {
|
|
1841
|
-
color: #34d399;
|
|
1842
|
-
background: rgba(52, 211, 153, 0.1);
|
|
1843
|
-
border-color: rgba(52, 211, 153, 0.28);
|
|
1844
|
-
}
|
|
1845
|
-
.agy-chip-file:hover {
|
|
1846
|
-
background: rgba(52, 211, 153, 0.22);
|
|
1847
|
-
border-color: rgba(52, 211, 153, 0.5);
|
|
1848
|
-
color: #6ee7b7;
|
|
1849
|
-
box-shadow: 0 2px 10px rgba(52, 211, 153, 0.25);
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
1876
|
.agy-image-chip-icon {
|
|
1853
1877
|
display: inline-flex;
|
|
1854
1878
|
align-items: center;
|
|
@@ -2467,6 +2491,129 @@ window.__ModuleLoader__.load({
|
|
|
2467
2491
|
}
|
|
2468
2492
|
//#endregion
|
|
2469
2493
|
//#region src/client/images/scanner.ts
|
|
2494
|
+
/**
|
|
2495
|
+
* Cached client context. `installImageEnhancer` receives it from `apply(ctx)` so
|
|
2496
|
+
* the click handler — which runs long after apply returned — can still reach
|
|
2497
|
+
* `ctx.get('sidebarRight')`. Never dereferenced eagerly: Cordis throws on a
|
|
2498
|
+
* non-injected service, so every read stays inside a guard.
|
|
2499
|
+
*/
|
|
2500
|
+
let clientContext = null;
|
|
2501
|
+
function setClientContext(ctx) {
|
|
2502
|
+
clientContext = ctx;
|
|
2503
|
+
}
|
|
2504
|
+
/** The tab type that previews a session file in the right Sidebar (documentpreview's fallback). */
|
|
2505
|
+
const DOCUMENT_PREVIEW_TAB = "@deepseek-ai/dsh-client-ui-sidebar-documentpreview";
|
|
2506
|
+
/**
|
|
2507
|
+
* Resolve one Cordis service without an injection declaration.
|
|
2508
|
+
*
|
|
2509
|
+
* Kept local (not imported from translate-context) on purpose: this module is
|
|
2510
|
+
* also loaded by SSR/toolview tests under plain ESM, and translate-context pulls
|
|
2511
|
+
* React in through `require`. A guarded `get()` plus a guarded property read is
|
|
2512
|
+
* enough here — Cordis throws on a non-injected service property, hence the try.
|
|
2513
|
+
*/
|
|
2514
|
+
function service$1(ctx, name) {
|
|
2515
|
+
const c = ctx;
|
|
2516
|
+
try {
|
|
2517
|
+
const fromGet = c.get?.(name);
|
|
2518
|
+
if (fromGet !== void 0 && fromGet !== null) return fromGet;
|
|
2519
|
+
} catch {}
|
|
2520
|
+
try {
|
|
2521
|
+
const direct = c[name];
|
|
2522
|
+
return direct === void 0 || direct === null ? void 0 : direct;
|
|
2523
|
+
} catch {
|
|
2524
|
+
return;
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
/** The Session the visible conversation belongs to; `''` when unknown. */
|
|
2528
|
+
function currentSessionId$1(ctx) {
|
|
2529
|
+
const value = service$1(ctx, "uiSession")?.current?.value;
|
|
2530
|
+
if (value !== void 0 && value !== null) for (const key of [
|
|
2531
|
+
"key",
|
|
2532
|
+
"sessionId",
|
|
2533
|
+
"id"
|
|
2534
|
+
]) {
|
|
2535
|
+
const id = value[key];
|
|
2536
|
+
if (typeof id === "string" && id !== "") return id;
|
|
2537
|
+
}
|
|
2538
|
+
const byId = service$1(ctx, "sessions")?.list?.getSnapshot?.()?.byId;
|
|
2539
|
+
if (byId !== void 0 && byId !== null) {
|
|
2540
|
+
const ids = Object.keys(byId);
|
|
2541
|
+
if (ids.length === 1 && ids[0] !== void 0) return ids[0];
|
|
2542
|
+
}
|
|
2543
|
+
return "";
|
|
2544
|
+
}
|
|
2545
|
+
function encodeSegment(segment) {
|
|
2546
|
+
return encodeURIComponent(segment).replace(/%3A/gi, ":");
|
|
2547
|
+
}
|
|
2548
|
+
/** `dsh-resource://file/session/<sessionId>/<path>`, mirroring DSH's `sessionFileAddress`. */
|
|
2549
|
+
function sessionFileAddress(sessionId, filePath) {
|
|
2550
|
+
const normalized = filePath.replace(/\\/g, "/").replace(/^(?:\.\/)+/, "");
|
|
2551
|
+
return `dsh-resource://file/session/${encodeSegment(sessionId)}/${normalized.split("/").map(encodeSegment).join("/")}`;
|
|
2552
|
+
}
|
|
2553
|
+
/** `file:///C:/x` | `file://C:/x` | `C:\x` → `C:/x`, dropping a `#L12` / `?v=1` suffix. */
|
|
2554
|
+
function normalizeLocalPath(raw) {
|
|
2555
|
+
let p = raw.trim();
|
|
2556
|
+
if (p.startsWith("file://")) {
|
|
2557
|
+
p = p.slice(7);
|
|
2558
|
+
if (/^\/[A-Za-z]:/.test(p)) p = p.slice(1);
|
|
2559
|
+
}
|
|
2560
|
+
const [pathPart] = p.replace(/\\/g, "/").split(/[?#]/);
|
|
2561
|
+
return (pathPart ?? "").replace(/^(?:\.\/)+/, "");
|
|
2562
|
+
}
|
|
2563
|
+
function sidebarRightOf(ctx) {
|
|
2564
|
+
const sidebarRight = service$1(ctx, "sidebarRight");
|
|
2565
|
+
return typeof sidebarRight?.openResource === "function" ? sidebarRight : void 0;
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Whether a tab type can follow a session file address. Web/headless profiles
|
|
2569
|
+
* omit `ui-sidebar-documentpreview`; opening there would silently do nothing, so
|
|
2570
|
+
* the caller must fall back to the OS opener instead of reporting success.
|
|
2571
|
+
*/
|
|
2572
|
+
function canPreviewFiles(ctx) {
|
|
2573
|
+
const tabs = service$1(ctx, "sidebarRightTabs");
|
|
2574
|
+
return tabs?.get?.(DOCUMENT_PREVIEW_TAB) !== void 0 && tabs?.get?.(DOCUMENT_PREVIEW_TAB) !== null;
|
|
2575
|
+
}
|
|
2576
|
+
function mountedSessionId(sidebarRight) {
|
|
2577
|
+
const mounted = sidebarRight.mounted?.getSnapshot?.();
|
|
2578
|
+
return typeof mounted === "string" ? mounted : "";
|
|
2579
|
+
}
|
|
2580
|
+
/** The on-screen Session's workspace root, normalized to forward slashes. */
|
|
2581
|
+
function sessionWorkspace(ctx, sessionId) {
|
|
2582
|
+
const cwd = service$1(ctx, "sessions")?.list?.getSnapshot?.()?.byId?.[sessionId]?.cwd;
|
|
2583
|
+
return typeof cwd === "string" ? cwd.replace(/\\/g, "/").replace(/\/+$/, "") : "";
|
|
2584
|
+
}
|
|
2585
|
+
/**
|
|
2586
|
+
* Open a local file in DSH's native right Sidebar (the `ui-sidebar-documentpreview`
|
|
2587
|
+
* tab), exactly like the native `fileMention` chip does.
|
|
2588
|
+
*
|
|
2589
|
+
* The address is built the way `fileAddressFor` builds it: a path inside the
|
|
2590
|
+
* Session workspace travels relative, anything else keeps its absolute spelling.
|
|
2591
|
+
* Returns `false` when no Sidebar can take it, so callers can fall back.
|
|
2592
|
+
*/
|
|
2593
|
+
function openInRightSidebar(rawPath) {
|
|
2594
|
+
if (clientContext === null) return false;
|
|
2595
|
+
const sidebarRight = sidebarRightOf(clientContext);
|
|
2596
|
+
if (sidebarRight === void 0) return false;
|
|
2597
|
+
if (!canPreviewFiles(clientContext)) return false;
|
|
2598
|
+
const sessionId = mountedSessionId(sidebarRight) || currentSessionId$1(clientContext);
|
|
2599
|
+
if (sessionId === "") return false;
|
|
2600
|
+
const target = normalizeLocalPath(rawPath);
|
|
2601
|
+
if (target === "") return false;
|
|
2602
|
+
const cwd = sessionWorkspace(clientContext, sessionId);
|
|
2603
|
+
let addressPath = target;
|
|
2604
|
+
if (cwd !== "") {
|
|
2605
|
+
const lowerCwd = cwd.toLowerCase();
|
|
2606
|
+
if (target.toLowerCase() === lowerCwd) addressPath = "";
|
|
2607
|
+
else if (target.toLowerCase().startsWith(`${lowerCwd}/`)) addressPath = target.slice(cwd.length + 1);
|
|
2608
|
+
}
|
|
2609
|
+
const line = /#L(\d+)/.exec(rawPath);
|
|
2610
|
+
try {
|
|
2611
|
+
sidebarRight.openResource(sessionFileAddress(sessionId, addressPath), line === null ? void 0 : { params: { line: Number(line[1]) } });
|
|
2612
|
+
return true;
|
|
2613
|
+
} catch {
|
|
2614
|
+
return false;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2470
2617
|
/** Get React props of a DOM element */
|
|
2471
2618
|
function getReactProps(el) {
|
|
2472
2619
|
const key = Object.keys(el).find((k) => k.startsWith("__reactProps"));
|
|
@@ -2621,6 +2768,31 @@ window.__ModuleLoader__.load({
|
|
|
2621
2768
|
}
|
|
2622
2769
|
}
|
|
2623
2770
|
}
|
|
2771
|
+
function enhanceFileLinks(links) {
|
|
2772
|
+
for (let i = 0; i < links.length; i++) {
|
|
2773
|
+
const link = links[i];
|
|
2774
|
+
if (!link || link.dataset.agyFileEnhanced === "true" || link.dataset.agyLinkEnhanced === "true" || link.dataset.agyVideoEnhanced === "true") continue;
|
|
2775
|
+
const rawHref = link.getAttribute("href") ?? "";
|
|
2776
|
+
const resolvedHref = link.href ?? "";
|
|
2777
|
+
if (isImageFile(rawHref) || isImageFile(resolvedHref) || isVideoFile(rawHref) || isVideoFile(resolvedHref)) continue;
|
|
2778
|
+
if (!rawHref.startsWith("file://") && !resolvedHref.startsWith("file://") && !isLocalFilePath(rawHref)) continue;
|
|
2779
|
+
link.dataset.agyFileEnhanced = "true";
|
|
2780
|
+
const pathToUse = rawHref.startsWith("file://") ? rawHref : resolvedHref.startsWith("file://") ? resolvedHref : rawHref || resolvedHref;
|
|
2781
|
+
link.addEventListener("click", (e) => {
|
|
2782
|
+
if (e.target?.closest?.(".agy-image-link-chip")) return;
|
|
2783
|
+
e.preventDefault();
|
|
2784
|
+
e.stopPropagation();
|
|
2785
|
+
const fileName = pathToUse.split(/[/\\]/).pop() || pathToUse;
|
|
2786
|
+
if (openInRightSidebar(pathToUse)) {
|
|
2787
|
+
showToast(`已在原生边栏打开: ${fileName}`);
|
|
2788
|
+
return;
|
|
2789
|
+
}
|
|
2790
|
+
openInSystem(pathToUse, false).then((res) => {
|
|
2791
|
+
showToast(res.ok ? `已在系统程序中打开: ${fileName}` : `打开失败: ${res.error || "未找到文件"}`);
|
|
2792
|
+
});
|
|
2793
|
+
});
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2624
2796
|
/**
|
|
2625
2797
|
* Scan DOM for imageAlt spans and enhance them with live rendered images
|
|
2626
2798
|
*/
|
|
@@ -2632,6 +2804,7 @@ window.__ModuleLoader__.load({
|
|
|
2632
2804
|
const links = document.querySelectorAll("a[href]");
|
|
2633
2805
|
enhanceImageLinks(links);
|
|
2634
2806
|
enhanceVideoLinks(links);
|
|
2807
|
+
enhanceFileLinks(links);
|
|
2635
2808
|
}
|
|
2636
2809
|
let imageEnhancerDispose = null;
|
|
2637
2810
|
let imageScanTimer = null;
|
|
@@ -2650,7 +2823,7 @@ window.__ModuleLoader__.load({
|
|
|
2650
2823
|
const target = e.target;
|
|
2651
2824
|
const a = target?.closest("a");
|
|
2652
2825
|
if (!a) return;
|
|
2653
|
-
if (a.dataset.agyLinkEnhanced === "true" || a.dataset.agyVideoEnhanced === "true") return;
|
|
2826
|
+
if (a.dataset.agyLinkEnhanced === "true" || a.dataset.agyVideoEnhanced === "true" || a.dataset.agyFileEnhanced === "true") return;
|
|
2654
2827
|
if (target?.closest?.(".agy-image-link-chip")) return;
|
|
2655
2828
|
const rawHref = a.getAttribute("href") ?? "";
|
|
2656
2829
|
const resolvedHref = a.href ?? "";
|
|
@@ -2659,13 +2832,18 @@ window.__ModuleLoader__.load({
|
|
|
2659
2832
|
if (/^https?:\/\//i.test(pathToUse) && !pathToUse.includes("/plugins/agy-link/")) return;
|
|
2660
2833
|
e.preventDefault();
|
|
2661
2834
|
e.stopPropagation();
|
|
2835
|
+
const fileName = pathToUse.split(/[/\\]/).pop() || pathToUse;
|
|
2836
|
+
if (openInRightSidebar(pathToUse)) {
|
|
2837
|
+
showToast(`已在原生边栏打开: ${fileName}`);
|
|
2838
|
+
return;
|
|
2839
|
+
}
|
|
2662
2840
|
openInSystem(pathToUse, false).then((res) => {
|
|
2663
|
-
|
|
2664
|
-
showToast(res.ok ? `已在系统默认程序中打开: ${fileName}` : `打开失败: ${res.error || "未找到文件"}`);
|
|
2841
|
+
showToast(res.ok ? `已在系统程序中打开: ${fileName}` : `打开失败: ${res.error || "未找到文件"}`);
|
|
2665
2842
|
});
|
|
2666
2843
|
}
|
|
2667
2844
|
}
|
|
2668
|
-
function installImageEnhancer() {
|
|
2845
|
+
function installImageEnhancer(ctx) {
|
|
2846
|
+
if (ctx) setClientContext(ctx);
|
|
2669
2847
|
if (typeof window === "undefined" || typeof document === "undefined") return () => {};
|
|
2670
2848
|
imageEnhancerDispose?.();
|
|
2671
2849
|
injectStyles$5();
|
|
@@ -2981,6 +3159,21 @@ window.__ModuleLoader__.load({
|
|
|
2981
3159
|
};
|
|
2982
3160
|
const { tool, input } = info;
|
|
2983
3161
|
const desc = pick(input, "Description", "description", "toolAction", "toolSummary", "Instruction", "instruction");
|
|
3162
|
+
if (tool === "invoke_subagent") {
|
|
3163
|
+
const directRole = pick(input, "Role", "role");
|
|
3164
|
+
const directTypeName = pick(input, "TypeName", "typeName");
|
|
3165
|
+
const effRole = directRole && directTypeName ? `${directRole} (${directTypeName})` : directRole ?? directTypeName;
|
|
3166
|
+
const prompt = pick(input, "Prompt", "prompt");
|
|
3167
|
+
return {
|
|
3168
|
+
kind: "generic",
|
|
3169
|
+
tool,
|
|
3170
|
+
server: info.server,
|
|
3171
|
+
title: desc ?? (effRole ? `Subagent · ${effRole}` : "Invoke Subagent"),
|
|
3172
|
+
command: prompt,
|
|
3173
|
+
output: out,
|
|
3174
|
+
raw: parsedArgsRaw(block)
|
|
3175
|
+
};
|
|
3176
|
+
}
|
|
2984
3177
|
if (QUESTION_TOOLS.has(tool)) {
|
|
2985
3178
|
const questionsRaw = input.questions ?? input.Questions;
|
|
2986
3179
|
const questions = Array.isArray(questionsRaw) ? questionsRaw : [];
|
|
@@ -4941,6 +5134,178 @@ body.dark .agy-tsl-card,
|
|
|
4941
5134
|
}, meta.join(" · ")), h$1("span", { className: "agy-tsl-actions" }, original === "" ? null : action("original", showOriginal ? t("tsl.hideOriginal", "Hide original") : t("tsl.showOriginal", "Show original"), () => setShowOriginal(!showOriginal), showOriginal), action("copy", copied ? t("tsl.copied", "Copied") : t("tsl.copy", "Copy"), copy), action("collapse", open ? t("tsl.collapse", "Collapse") : t("tsl.expand", "Expand"), () => setOpen(!open)))), open ? h$1("div", { className: "agy-tsl-body" }, renderMarkdown(text)) : null, showOriginal && original !== "" ? h$1("pre", { className: "agy-tsl-original" }, original) : null);
|
|
4942
5135
|
};
|
|
4943
5136
|
//#endregion
|
|
5137
|
+
//#region src/common/timeouts.ts
|
|
5138
|
+
/** Status poll: keep the console responsive, never stack polls. */
|
|
5139
|
+
const STATUS_TIMEOUT_MS = 5e3;
|
|
5140
|
+
/** A write (sync / warmup / config / auth): the busy flag must always clear. */
|
|
5141
|
+
const WRITE_TIMEOUT_MS = 2e4;
|
|
5142
|
+
//#endregion
|
|
5143
|
+
//#region src/client/api.ts
|
|
5144
|
+
const win = globalThis;
|
|
5145
|
+
const base = win.location?.origin ?? "";
|
|
5146
|
+
const PLUGIN_BASE = "/plugins/agy-link";
|
|
5147
|
+
/** One AbortSignal.timeout helper, shared by writes and the status poll. */
|
|
5148
|
+
function timedSignal(ms) {
|
|
5149
|
+
if (typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function") return AbortSignal.timeout(ms);
|
|
5150
|
+
}
|
|
5151
|
+
async function postJson(path, body) {
|
|
5152
|
+
try {
|
|
5153
|
+
const init = {
|
|
5154
|
+
method: "POST",
|
|
5155
|
+
headers: { "Content-Type": "application/json" },
|
|
5156
|
+
body: JSON.stringify(body)
|
|
5157
|
+
};
|
|
5158
|
+
const signal = timedSignal(WRITE_TIMEOUT_MS);
|
|
5159
|
+
if (signal !== void 0) init.signal = signal;
|
|
5160
|
+
const res = await win.fetch?.(base + path, init);
|
|
5161
|
+
if (!res) return null;
|
|
5162
|
+
try {
|
|
5163
|
+
const payload = await res.json();
|
|
5164
|
+
if (!res.ok && payload !== null && typeof payload === "object") return {
|
|
5165
|
+
ok: false,
|
|
5166
|
+
...payload
|
|
5167
|
+
};
|
|
5168
|
+
return payload;
|
|
5169
|
+
} catch {
|
|
5170
|
+
return { ok: res.ok };
|
|
5171
|
+
}
|
|
5172
|
+
} catch {
|
|
5173
|
+
return null;
|
|
5174
|
+
}
|
|
5175
|
+
}
|
|
5176
|
+
/** Small typed endpoint helper for the account-pool actions. */
|
|
5177
|
+
function postPool(action, body = {}) {
|
|
5178
|
+
return postJson(`${PLUGIN_BASE}/pool/${action}`, body);
|
|
5179
|
+
}
|
|
5180
|
+
/** The shared config-write helper (same /config endpoint the toggles use). */
|
|
5181
|
+
function postConfig(key, value) {
|
|
5182
|
+
return postJson(`${PLUGIN_BASE}/config`, {
|
|
5183
|
+
key,
|
|
5184
|
+
value
|
|
5185
|
+
});
|
|
5186
|
+
}
|
|
5187
|
+
const { createElement: h, useState, useEffect, useRef } = require("react");
|
|
5188
|
+
const reactDom = require("react-dom");
|
|
5189
|
+
//#endregion
|
|
5190
|
+
//#region src/client/status.ts
|
|
5191
|
+
const STATUS_CACHE_KEY = "dsh_agy_status_cache";
|
|
5192
|
+
function loadInitialStatusCache() {
|
|
5193
|
+
try {
|
|
5194
|
+
const raw = win.localStorage?.getItem(STATUS_CACHE_KEY);
|
|
5195
|
+
if (raw) {
|
|
5196
|
+
const parsed = JSON.parse(raw);
|
|
5197
|
+
if (parsed && typeof parsed === "object") return parsed;
|
|
5198
|
+
}
|
|
5199
|
+
} catch {}
|
|
5200
|
+
return null;
|
|
5201
|
+
}
|
|
5202
|
+
let statusCache = loadInitialStatusCache();
|
|
5203
|
+
async function getStatus() {
|
|
5204
|
+
try {
|
|
5205
|
+
const init = {};
|
|
5206
|
+
const signal = timedSignal(STATUS_TIMEOUT_MS);
|
|
5207
|
+
if (signal !== void 0) init.signal = signal;
|
|
5208
|
+
const res = await win.fetch?.(base + "/plugins/agy-link/status", init);
|
|
5209
|
+
if (!res || !res.ok) return null;
|
|
5210
|
+
return await res.json();
|
|
5211
|
+
} catch {
|
|
5212
|
+
return null;
|
|
5213
|
+
}
|
|
5214
|
+
}
|
|
5215
|
+
const statusListeners = /* @__PURE__ */ new Set();
|
|
5216
|
+
let statusPollTimer = null;
|
|
5217
|
+
let statusPollInterval = 3e3;
|
|
5218
|
+
let statusFetchSeq = 0;
|
|
5219
|
+
function isStatusEqual(a, b) {
|
|
5220
|
+
if (a === b) return true;
|
|
5221
|
+
if (a === null || b === null) return false;
|
|
5222
|
+
try {
|
|
5223
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
5224
|
+
} catch {
|
|
5225
|
+
return false;
|
|
5226
|
+
}
|
|
5227
|
+
}
|
|
5228
|
+
/**
|
|
5229
|
+
* UI visibility switches are opt-out: a missing/undefined flag means the
|
|
5230
|
+
* affordance stays visible (older hosts, a not-yet-polled status, or a status
|
|
5231
|
+
* payload fetched before this version shipped). Only an explicit `false`
|
|
5232
|
+
* hides it.
|
|
5233
|
+
*/
|
|
5234
|
+
function isUiVisible(status, key) {
|
|
5235
|
+
return status?.[key] !== false;
|
|
5236
|
+
}
|
|
5237
|
+
/** Single writer for the shared status snapshot (poll loop, refresh, tests). */
|
|
5238
|
+
function publishStatus(st) {
|
|
5239
|
+
statusCache = st;
|
|
5240
|
+
try {
|
|
5241
|
+
win.localStorage?.setItem(STATUS_CACHE_KEY, JSON.stringify(st));
|
|
5242
|
+
} catch {}
|
|
5243
|
+
for (const fn of [...statusListeners]) try {
|
|
5244
|
+
fn(st);
|
|
5245
|
+
} catch {}
|
|
5246
|
+
}
|
|
5247
|
+
async function statusPollTick() {
|
|
5248
|
+
const seq = ++statusFetchSeq;
|
|
5249
|
+
const st = await getStatus();
|
|
5250
|
+
if (st !== null && seq === statusFetchSeq) {
|
|
5251
|
+
if (!isStatusEqual(statusCache, st)) publishStatus(st);
|
|
5252
|
+
}
|
|
5253
|
+
}
|
|
5254
|
+
function ensureStatusPolling() {
|
|
5255
|
+
if (statusPollTimer !== null) {
|
|
5256
|
+
if (statusPollInterval !== 3e3) {
|
|
5257
|
+
clearInterval(statusPollTimer);
|
|
5258
|
+
statusPollTimer = null;
|
|
5259
|
+
} else return;
|
|
5260
|
+
}
|
|
5261
|
+
statusPollInterval = 3e3;
|
|
5262
|
+
statusPollTick();
|
|
5263
|
+
statusPollTimer = setInterval(() => {
|
|
5264
|
+
statusPollTick();
|
|
5265
|
+
}, 3e3);
|
|
5266
|
+
}
|
|
5267
|
+
function stopStatusPollingIfIdle() {
|
|
5268
|
+
if (statusListeners.size === 0 && statusPollTimer !== null && statusPollInterval === 3e3) {
|
|
5269
|
+
clearInterval(statusPollTimer);
|
|
5270
|
+
statusPollInterval = 15e3;
|
|
5271
|
+
statusPollTimer = setInterval(() => {
|
|
5272
|
+
statusPollTick();
|
|
5273
|
+
}, 15e3);
|
|
5274
|
+
}
|
|
5275
|
+
}
|
|
5276
|
+
/** Stop the shared poll loop (plugin teardown / reload). */
|
|
5277
|
+
function disposeStatusPolling() {
|
|
5278
|
+
if (statusPollTimer !== null) {
|
|
5279
|
+
clearInterval(statusPollTimer);
|
|
5280
|
+
statusPollTimer = null;
|
|
5281
|
+
}
|
|
5282
|
+
}
|
|
5283
|
+
/**
|
|
5284
|
+
* Subscribe a component to the shared status poll. Returns the latest
|
|
5285
|
+
* snapshot plus a manual refresh that keeps the last good snapshot on a
|
|
5286
|
+
* transient failure (a failed refresh used to flip the whole panel back to
|
|
5287
|
+
* its loading state).
|
|
5288
|
+
*/
|
|
5289
|
+
function useAgyStatus() {
|
|
5290
|
+
const [status, setStatus] = useState(statusCache);
|
|
5291
|
+
useEffect(() => {
|
|
5292
|
+
statusListeners.add(setStatus);
|
|
5293
|
+
ensureStatusPolling();
|
|
5294
|
+
return () => {
|
|
5295
|
+
statusListeners.delete(setStatus);
|
|
5296
|
+
stopStatusPollingIfIdle();
|
|
5297
|
+
};
|
|
5298
|
+
}, []);
|
|
5299
|
+
const refresh = async () => {
|
|
5300
|
+
const st = await getStatus();
|
|
5301
|
+
if (st !== null && !isStatusEqual(statusCache, st)) publishStatus(st);
|
|
5302
|
+
};
|
|
5303
|
+
return {
|
|
5304
|
+
status,
|
|
5305
|
+
refresh
|
|
5306
|
+
};
|
|
5307
|
+
}
|
|
5308
|
+
//#endregion
|
|
4944
5309
|
//#region src/client/translate-state.ts
|
|
4945
5310
|
async function postTranslate(body) {
|
|
4946
5311
|
try {
|
|
@@ -5222,6 +5587,8 @@ body.dark .agy-tsl-card,
|
|
|
5222
5587
|
messageId,
|
|
5223
5588
|
sessionId
|
|
5224
5589
|
]);
|
|
5590
|
+
const { status } = useAgyStatus();
|
|
5591
|
+
if (!isUiVisible(status, "showTranslateAction")) return null;
|
|
5225
5592
|
if (messageId === "" || sessionId === "") return null;
|
|
5226
5593
|
const apply = (next) => {
|
|
5227
5594
|
setActionState(key, next);
|
|
@@ -5745,8 +6112,6 @@ body.dark .agy-tsl-card,
|
|
|
5745
6112
|
compactionDispose = dispose;
|
|
5746
6113
|
return dispose;
|
|
5747
6114
|
}
|
|
5748
|
-
const { createElement: h, useState, useEffect, useRef } = require("react");
|
|
5749
|
-
const reactDom = require("react-dom");
|
|
5750
6115
|
//#endregion
|
|
5751
6116
|
//#region src/client/icons.ts
|
|
5752
6117
|
/** Inline brand logo (Gemini / Claude / OpenAI) as a crisp SVG mark. */
|
|
@@ -6017,152 +6382,6 @@ body.dark .agy-tsl-card,
|
|
|
6017
6382
|
};
|
|
6018
6383
|
}
|
|
6019
6384
|
//#endregion
|
|
6020
|
-
//#region src/client/api.ts
|
|
6021
|
-
const win = globalThis;
|
|
6022
|
-
const base = win.location?.origin ?? "";
|
|
6023
|
-
const PLUGIN_BASE = "/plugins/agy-link";
|
|
6024
|
-
async function postJson(path, body) {
|
|
6025
|
-
try {
|
|
6026
|
-
const res = await win.fetch?.(base + path, {
|
|
6027
|
-
method: "POST",
|
|
6028
|
-
headers: { "Content-Type": "application/json" },
|
|
6029
|
-
body: JSON.stringify(body)
|
|
6030
|
-
});
|
|
6031
|
-
if (!res) return null;
|
|
6032
|
-
try {
|
|
6033
|
-
const payload = await res.json();
|
|
6034
|
-
if (!res.ok && payload !== null && typeof payload === "object") return {
|
|
6035
|
-
ok: false,
|
|
6036
|
-
...payload
|
|
6037
|
-
};
|
|
6038
|
-
return payload;
|
|
6039
|
-
} catch {
|
|
6040
|
-
return { ok: res.ok };
|
|
6041
|
-
}
|
|
6042
|
-
} catch {
|
|
6043
|
-
return null;
|
|
6044
|
-
}
|
|
6045
|
-
}
|
|
6046
|
-
/** Small typed endpoint helper for the account-pool actions. */
|
|
6047
|
-
function postPool(action, body = {}) {
|
|
6048
|
-
return postJson(`${PLUGIN_BASE}/pool/${action}`, body);
|
|
6049
|
-
}
|
|
6050
|
-
/** The shared config-write helper (same /config endpoint the toggles use). */
|
|
6051
|
-
function postConfig(key, value) {
|
|
6052
|
-
return postJson(`${PLUGIN_BASE}/config`, {
|
|
6053
|
-
key,
|
|
6054
|
-
value
|
|
6055
|
-
});
|
|
6056
|
-
}
|
|
6057
|
-
//#endregion
|
|
6058
|
-
//#region src/client/status.ts
|
|
6059
|
-
const STATUS_CACHE_KEY = "dsh_agy_status_cache";
|
|
6060
|
-
function loadInitialStatusCache() {
|
|
6061
|
-
try {
|
|
6062
|
-
const raw = win.localStorage?.getItem(STATUS_CACHE_KEY);
|
|
6063
|
-
if (raw) {
|
|
6064
|
-
const parsed = JSON.parse(raw);
|
|
6065
|
-
if (parsed && typeof parsed === "object") return parsed;
|
|
6066
|
-
}
|
|
6067
|
-
} catch {}
|
|
6068
|
-
return null;
|
|
6069
|
-
}
|
|
6070
|
-
let statusCache = loadInitialStatusCache();
|
|
6071
|
-
async function getStatus() {
|
|
6072
|
-
try {
|
|
6073
|
-
const init = {};
|
|
6074
|
-
if (typeof AbortSignal !== "undefined" && typeof AbortSignal.timeout === "function") init.signal = AbortSignal.timeout(5e3);
|
|
6075
|
-
const res = await win.fetch?.(base + "/plugins/agy-link/status", init);
|
|
6076
|
-
if (!res || !res.ok) return null;
|
|
6077
|
-
return await res.json();
|
|
6078
|
-
} catch {
|
|
6079
|
-
return null;
|
|
6080
|
-
}
|
|
6081
|
-
}
|
|
6082
|
-
const statusListeners = /* @__PURE__ */ new Set();
|
|
6083
|
-
let statusPollTimer = null;
|
|
6084
|
-
let statusPollInterval = 3e3;
|
|
6085
|
-
let statusFetchSeq = 0;
|
|
6086
|
-
function isStatusEqual(a, b) {
|
|
6087
|
-
if (a === b) return true;
|
|
6088
|
-
if (a === null || b === null) return false;
|
|
6089
|
-
try {
|
|
6090
|
-
return JSON.stringify(a) === JSON.stringify(b);
|
|
6091
|
-
} catch {
|
|
6092
|
-
return false;
|
|
6093
|
-
}
|
|
6094
|
-
}
|
|
6095
|
-
function notifyStatus(st) {
|
|
6096
|
-
statusCache = st;
|
|
6097
|
-
try {
|
|
6098
|
-
win.localStorage?.setItem(STATUS_CACHE_KEY, JSON.stringify(st));
|
|
6099
|
-
} catch {}
|
|
6100
|
-
for (const fn of [...statusListeners]) try {
|
|
6101
|
-
fn(st);
|
|
6102
|
-
} catch {}
|
|
6103
|
-
}
|
|
6104
|
-
async function statusPollTick() {
|
|
6105
|
-
const seq = ++statusFetchSeq;
|
|
6106
|
-
const st = await getStatus();
|
|
6107
|
-
if (st !== null && seq === statusFetchSeq) {
|
|
6108
|
-
if (!isStatusEqual(statusCache, st)) notifyStatus(st);
|
|
6109
|
-
}
|
|
6110
|
-
}
|
|
6111
|
-
function ensureStatusPolling() {
|
|
6112
|
-
if (statusPollTimer !== null) {
|
|
6113
|
-
if (statusPollInterval !== 3e3) {
|
|
6114
|
-
clearInterval(statusPollTimer);
|
|
6115
|
-
statusPollTimer = null;
|
|
6116
|
-
} else return;
|
|
6117
|
-
}
|
|
6118
|
-
statusPollInterval = 3e3;
|
|
6119
|
-
statusPollTick();
|
|
6120
|
-
statusPollTimer = setInterval(() => {
|
|
6121
|
-
statusPollTick();
|
|
6122
|
-
}, 3e3);
|
|
6123
|
-
}
|
|
6124
|
-
function stopStatusPollingIfIdle() {
|
|
6125
|
-
if (statusListeners.size === 0 && statusPollTimer !== null && statusPollInterval === 3e3) {
|
|
6126
|
-
clearInterval(statusPollTimer);
|
|
6127
|
-
statusPollInterval = 15e3;
|
|
6128
|
-
statusPollTimer = setInterval(() => {
|
|
6129
|
-
statusPollTick();
|
|
6130
|
-
}, 15e3);
|
|
6131
|
-
}
|
|
6132
|
-
}
|
|
6133
|
-
/** Stop the shared poll loop (plugin teardown / reload). */
|
|
6134
|
-
function disposeStatusPolling() {
|
|
6135
|
-
if (statusPollTimer !== null) {
|
|
6136
|
-
clearInterval(statusPollTimer);
|
|
6137
|
-
statusPollTimer = null;
|
|
6138
|
-
}
|
|
6139
|
-
}
|
|
6140
|
-
/**
|
|
6141
|
-
* Subscribe a component to the shared status poll. Returns the latest
|
|
6142
|
-
* snapshot plus a manual refresh that keeps the last good snapshot on a
|
|
6143
|
-
* transient failure (a failed refresh used to flip the whole panel back to
|
|
6144
|
-
* its loading state).
|
|
6145
|
-
*/
|
|
6146
|
-
function useAgyStatus() {
|
|
6147
|
-
const [status, setStatus] = useState(statusCache);
|
|
6148
|
-
useEffect(() => {
|
|
6149
|
-
statusListeners.add(setStatus);
|
|
6150
|
-
ensureStatusPolling();
|
|
6151
|
-
return () => {
|
|
6152
|
-
statusListeners.delete(setStatus);
|
|
6153
|
-
stopStatusPollingIfIdle();
|
|
6154
|
-
};
|
|
6155
|
-
}, []);
|
|
6156
|
-
const refresh = async () => {
|
|
6157
|
-
const st = await getStatus();
|
|
6158
|
-
if (st !== null && !isStatusEqual(statusCache, st)) notifyStatus(st);
|
|
6159
|
-
};
|
|
6160
|
-
return {
|
|
6161
|
-
status,
|
|
6162
|
-
refresh
|
|
6163
|
-
};
|
|
6164
|
-
}
|
|
6165
|
-
//#endregion
|
|
6166
6385
|
//#region src/client/global-css.ts
|
|
6167
6386
|
const GLOBAL_CSS = `
|
|
6168
6387
|
@keyframes agy-spin {
|
|
@@ -6588,6 +6807,13 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
6588
6807
|
overrides here are deliberately blunt.
|
|
6589
6808
|
------------------------------------------------------------------ */
|
|
6590
6809
|
@media (max-width: 680px) {
|
|
6810
|
+
.agy-session-status-label {
|
|
6811
|
+
display: none !important;
|
|
6812
|
+
}
|
|
6813
|
+
.agy-session-status-btn {
|
|
6814
|
+
padding: 4px 6px !important;
|
|
6815
|
+
min-width: 0 !important;
|
|
6816
|
+
}
|
|
6591
6817
|
.agy-modal-backdrop {
|
|
6592
6818
|
padding: 0 !important;
|
|
6593
6819
|
align-items: stretch !important;
|
|
@@ -7160,13 +7386,37 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
7160
7386
|
}, children)));
|
|
7161
7387
|
}
|
|
7162
7388
|
//#endregion
|
|
7389
|
+
//#region src/common/model-lineup.ts
|
|
7390
|
+
/** Models the plugin treats as the Gemini family for UI filtering. */
|
|
7391
|
+
function isGeminiFamilyModel(id) {
|
|
7392
|
+
return /gemini/i.test(typeof id === "string" ? id : "");
|
|
7393
|
+
}
|
|
7394
|
+
//#endregion
|
|
7163
7395
|
//#region src/client/config-options.ts
|
|
7164
|
-
/**
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7396
|
+
/** Effort ids carried by a catalog entry (order preserved, deduped). */
|
|
7397
|
+
function modelEfforts(model) {
|
|
7398
|
+
if (model === void 0 || model === null) return [];
|
|
7399
|
+
const raw = model.efforts;
|
|
7400
|
+
if (!Array.isArray(raw)) return [];
|
|
7401
|
+
const out = [];
|
|
7402
|
+
for (const item of raw) {
|
|
7403
|
+
if (typeof item !== "string") continue;
|
|
7404
|
+
const id = item.trim().toLowerCase();
|
|
7405
|
+
if (id !== "" && !out.includes(id)) out.push(id);
|
|
7406
|
+
}
|
|
7407
|
+
return out;
|
|
7408
|
+
}
|
|
7409
|
+
/** Effort ids supported anywhere in the catalog (fallback when no model is chosen). */
|
|
7410
|
+
function catalogEfforts(models) {
|
|
7411
|
+
const out = [];
|
|
7412
|
+
for (const model of models) for (const id of modelEfforts(model)) if (!out.includes(id)) out.push(id);
|
|
7413
|
+
return out;
|
|
7414
|
+
}
|
|
7415
|
+
function findCatalogModel(modelId, models) {
|
|
7416
|
+
const wanted = typeof modelId === "string" ? modelId.trim() : "";
|
|
7417
|
+
if (wanted === "") return void 0;
|
|
7418
|
+
return models.find((model) => typeof model?.id === "string" && model.id.trim() === wanted);
|
|
7419
|
+
}
|
|
7170
7420
|
/**
|
|
7171
7421
|
* Translation-model dropdown: `''` (host fallback chain: gemini-3.8-flash →
|
|
7172
7422
|
* newest gemini-*-flash → conversation default) plus every catalog model.
|
|
@@ -7200,30 +7450,65 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
7200
7450
|
* hand is still appended by `translateModelOptions`, so the state stays honest.
|
|
7201
7451
|
*/
|
|
7202
7452
|
function geminiCatalogModels(models) {
|
|
7203
|
-
return models.filter((model) => typeof model?.id === "string" &&
|
|
7453
|
+
return models.filter((model) => typeof model?.id === "string" && isGeminiFamilyModel(model.id));
|
|
7204
7454
|
}
|
|
7205
7455
|
/**
|
|
7206
|
-
* Thinking-effort dropdown: `''` (follow the
|
|
7207
|
-
*
|
|
7208
|
-
*
|
|
7456
|
+
* Thinking-effort dropdown for a specific model: `''` (follow the model's
|
|
7457
|
+
* default) plus exactly the levels THAT model supports, in the catalog's own
|
|
7458
|
+
* order.
|
|
7459
|
+
*
|
|
7460
|
+
* Deriving from the catalog instead of a local low/medium/high list is what
|
|
7461
|
+
* keeps this control honest: a model with no `--effort` support gets no levels
|
|
7462
|
+
* at all, and a model with an extra level (agy 1.5.7's `xhigh` → "Extra") gets
|
|
7463
|
+
* it without any code change. An unrecognised configured level is still
|
|
7464
|
+
* appended verbatim so the select can display the real state.
|
|
7209
7465
|
*/
|
|
7210
|
-
function translateEffortOptions(current, labels) {
|
|
7466
|
+
function translateEffortOptions(current, labels, modelId = "", models = []) {
|
|
7211
7467
|
const options = [{
|
|
7212
7468
|
value: "",
|
|
7213
7469
|
label: labels.auto
|
|
7214
7470
|
}];
|
|
7215
|
-
|
|
7471
|
+
const chosen = findCatalogModel(modelId, models);
|
|
7472
|
+
const supported = chosen === void 0 ? catalogEfforts(models) : modelEfforts(chosen);
|
|
7473
|
+
for (const level of supported) options.push({
|
|
7216
7474
|
value: level,
|
|
7217
|
-
label: labels
|
|
7475
|
+
label: labels.level(level)
|
|
7218
7476
|
});
|
|
7219
7477
|
const wanted = typeof current === "string" ? current.trim().toLowerCase() : "";
|
|
7220
7478
|
if (wanted !== "" && !options.some((option) => option.value === wanted)) options.push({
|
|
7221
7479
|
value: wanted,
|
|
7222
|
-
label: wanted
|
|
7480
|
+
label: labels.level(wanted)
|
|
7223
7481
|
});
|
|
7224
7482
|
return options;
|
|
7225
7483
|
}
|
|
7226
7484
|
//#endregion
|
|
7485
|
+
//#region src/common/reasoning.ts
|
|
7486
|
+
/** Every effort id agy accepts, in ascending intensity order. */
|
|
7487
|
+
const REASONING_EFFORTS = [
|
|
7488
|
+
"low",
|
|
7489
|
+
"medium",
|
|
7490
|
+
"high",
|
|
7491
|
+
"xhigh",
|
|
7492
|
+
"max"
|
|
7493
|
+
];
|
|
7494
|
+
/**
|
|
7495
|
+
* Display names, matching agy's own model picker ("Extra" is `xhigh`, which is
|
|
7496
|
+
* how the GUI labels it while `agy --help` spells it `xhigh`).
|
|
7497
|
+
*/
|
|
7498
|
+
const EFFORT_LABELS = {
|
|
7499
|
+
low: "Low",
|
|
7500
|
+
medium: "Medium",
|
|
7501
|
+
high: "High",
|
|
7502
|
+
xhigh: "Extra",
|
|
7503
|
+
max: "Max"
|
|
7504
|
+
};
|
|
7505
|
+
/** Display name for an effort id; unknown ids are shown verbatim. */
|
|
7506
|
+
function effortLabel(id) {
|
|
7507
|
+
const key = typeof id === "string" ? id.trim().toLowerCase() : "";
|
|
7508
|
+
return EFFORT_LABELS[key] ?? (typeof id === "string" ? id.trim() : "");
|
|
7509
|
+
}
|
|
7510
|
+
[...REASONING_EFFORTS].sort((a, b) => b.length - a.length || a.localeCompare(b));
|
|
7511
|
+
//#endregion
|
|
7227
7512
|
//#region src/client/hooks/useTranslation.ts
|
|
7228
7513
|
function useAgyTranslation(locale) {
|
|
7229
7514
|
const [, rerender] = useState(0);
|
|
@@ -7337,7 +7622,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
7337
7622
|
return;
|
|
7338
7623
|
}
|
|
7339
7624
|
await refresh();
|
|
7340
|
-
showToast(t("quota.refreshed"), "success");
|
|
7625
|
+
showToast(res?.pending === true ? t("quota.refreshStarted") : t("quota.refreshed"), res?.pending === true ? "info" : "success");
|
|
7341
7626
|
} finally {
|
|
7342
7627
|
setLoadingAction(null);
|
|
7343
7628
|
}
|
|
@@ -7663,6 +7948,11 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
7663
7948
|
} }, left, right);
|
|
7664
7949
|
}
|
|
7665
7950
|
//#endregion
|
|
7951
|
+
//#region src/client/ui/SegGroup.ts
|
|
7952
|
+
function segGroup(children) {
|
|
7953
|
+
return h("div", { style: S.segGroup }, children);
|
|
7954
|
+
}
|
|
7955
|
+
//#endregion
|
|
7666
7956
|
//#region src/client/ui/Select.ts
|
|
7667
7957
|
function Select({ value, options, onChange, ariaLabel, title, disabled, style }) {
|
|
7668
7958
|
return h("select", {
|
|
@@ -8401,10 +8691,12 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8401
8691
|
gap: "6px"
|
|
8402
8692
|
} }, catalogModels.map((m) => {
|
|
8403
8693
|
const isHidden = hiddenModelSet.has(m.id);
|
|
8694
|
+
const efforts = (m.efforts ?? []).map((id) => effortLabel(id));
|
|
8695
|
+
const title = efforts.length > 0 ? m.id + " · " + efforts.join(" / ") : m.id;
|
|
8404
8696
|
return h(Button, {
|
|
8405
8697
|
key: m.id,
|
|
8406
8698
|
variant: isHidden ? "seg" : "segActive",
|
|
8407
|
-
title
|
|
8699
|
+
title,
|
|
8408
8700
|
disabled: loadingAction === "config:hiddenModels",
|
|
8409
8701
|
style: isHidden ? {
|
|
8410
8702
|
opacity: .45,
|
|
@@ -8415,8 +8707,102 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8415
8707
|
})), h("span", { style: S.muted }, t("models.hint")));
|
|
8416
8708
|
}
|
|
8417
8709
|
//#endregion
|
|
8710
|
+
//#region src/client/sections/VisibilityRows.ts
|
|
8711
|
+
function visibilityRow(o) {
|
|
8712
|
+
return h(Row, {
|
|
8713
|
+
left: h("div", { style: {
|
|
8714
|
+
display: "flex",
|
|
8715
|
+
flexDirection: "column"
|
|
8716
|
+
} }, h("span", { style: {
|
|
8717
|
+
color: "var(--agy-text-primary)",
|
|
8718
|
+
fontWeight: 600,
|
|
8719
|
+
fontSize: "12.5px"
|
|
8720
|
+
} }, o.t(o.label)), h("span", { style: S.muted }, o.t(o.desc))),
|
|
8721
|
+
right: segGroup([h(Button, {
|
|
8722
|
+
variant: o.visible ? "segActive" : "seg",
|
|
8723
|
+
disabled: o.loadingAction === "config:" + o.key,
|
|
8724
|
+
onClick: () => void o.setCfg(o.key, true)
|
|
8725
|
+
}, o.t("config.on")), h(Button, {
|
|
8726
|
+
variant: !o.visible ? "segActive" : "seg",
|
|
8727
|
+
disabled: o.loadingAction === "config:" + o.key,
|
|
8728
|
+
onClick: () => void o.setCfg(o.key, false)
|
|
8729
|
+
}, o.t("config.off"))])
|
|
8730
|
+
});
|
|
8731
|
+
}
|
|
8732
|
+
/** Returns two rows; React flattens the array inside the parent's children. */
|
|
8733
|
+
function renderVisibilityRows(args) {
|
|
8734
|
+
const common = {
|
|
8735
|
+
t: args.t,
|
|
8736
|
+
loadingAction: args.loadingAction,
|
|
8737
|
+
setCfg: args.setCfg
|
|
8738
|
+
};
|
|
8739
|
+
return [visibilityRow({
|
|
8740
|
+
...common,
|
|
8741
|
+
label: "config.showHeaderBadge",
|
|
8742
|
+
desc: "config.showHeaderBadgeDesc",
|
|
8743
|
+
key: "showHeaderBadge",
|
|
8744
|
+
visible: args.status.showHeaderBadge !== false
|
|
8745
|
+
}), visibilityRow({
|
|
8746
|
+
...common,
|
|
8747
|
+
label: "config.showTranslateAction",
|
|
8748
|
+
desc: "config.showTranslateActionDesc",
|
|
8749
|
+
key: "showTranslateAction",
|
|
8750
|
+
visible: args.status.showTranslateAction !== false
|
|
8751
|
+
})];
|
|
8752
|
+
}
|
|
8753
|
+
//#endregion
|
|
8754
|
+
//#region src/client/sections/CatalogRows.ts
|
|
8755
|
+
function renderPoolWideCatalogRow(args) {
|
|
8756
|
+
const { t, status, loadingAction, setCfg } = args;
|
|
8757
|
+
const on = status.poolWideCatalog === true;
|
|
8758
|
+
return h(Row, {
|
|
8759
|
+
left: h("div", { style: {
|
|
8760
|
+
display: "flex",
|
|
8761
|
+
flexDirection: "column"
|
|
8762
|
+
} }, h("span", { style: {
|
|
8763
|
+
color: "var(--agy-text-primary)",
|
|
8764
|
+
fontWeight: 600,
|
|
8765
|
+
fontSize: "12.5px"
|
|
8766
|
+
} }, t("config.poolWideCatalog")), h("span", { style: S.muted }, t("config.poolWideCatalogDesc"))),
|
|
8767
|
+
right: segGroup([h(Button, {
|
|
8768
|
+
variant: on ? "segActive" : "seg",
|
|
8769
|
+
disabled: loadingAction === "config:poolWideCatalog",
|
|
8770
|
+
onClick: () => void setCfg("poolWideCatalog", true)
|
|
8771
|
+
}, t("config.on")), h(Button, {
|
|
8772
|
+
variant: !on ? "segActive" : "seg",
|
|
8773
|
+
disabled: loadingAction === "config:poolWideCatalog",
|
|
8774
|
+
onClick: () => void setCfg("poolWideCatalog", false)
|
|
8775
|
+
}, t("config.off"))])
|
|
8776
|
+
});
|
|
8777
|
+
}
|
|
8778
|
+
//#endregion
|
|
8418
8779
|
//#region src/client/sections/SettingsSection.ts
|
|
8780
|
+
/**
|
|
8781
|
+
* BUSY-STATE WATCHDOG. Every action sets a busy flag and clears it when its
|
|
8782
|
+
* request settles. A host route with no .catch, a 20s `agy /usage` spawn, or a
|
|
8783
|
+
* browser fetch with no timeout each used to leave "同步中" spinning forever.
|
|
8784
|
+
* The request layer now bounds those; this is the final invariant — no busy
|
|
8785
|
+
* flag may outlive BUSY_TIMEOUT_MS.
|
|
8786
|
+
*/
|
|
8787
|
+
function useBusyAction() {
|
|
8788
|
+
const [loadingAction, setLoadingAction] = useState(null);
|
|
8789
|
+
const timerRef = useRef(null);
|
|
8790
|
+
const set = (value) => {
|
|
8791
|
+
setLoadingAction(value);
|
|
8792
|
+
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
8793
|
+
timerRef.current = value === null ? null : setTimeout(() => {
|
|
8794
|
+
timerRef.current = null;
|
|
8795
|
+
setLoadingAction(null);
|
|
8796
|
+
}, BUSY_TIMEOUT_MS);
|
|
8797
|
+
};
|
|
8798
|
+
useEffect(() => () => {
|
|
8799
|
+
if (timerRef.current !== null) clearTimeout(timerRef.current);
|
|
8800
|
+
}, []);
|
|
8801
|
+
return [loadingAction, set];
|
|
8802
|
+
}
|
|
8419
8803
|
const IMAGE_CLI_SAMPLE = "dsh-agy-image -p \"…\" -a 16:9 -o ./image.jpg";
|
|
8804
|
+
/** Slightly longer than a bounded write, so a normal failure still shows its own toast. */
|
|
8805
|
+
const BUSY_TIMEOUT_MS = 25e3;
|
|
8420
8806
|
function createSettingsSection(locale) {
|
|
8421
8807
|
return function AgySettingsSection(_props) {
|
|
8422
8808
|
const t = useAgyTranslation(locale);
|
|
@@ -8438,7 +8824,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8438
8824
|
setToast((prev) => prev !== null && prev.text === text ? null : prev);
|
|
8439
8825
|
}, 6e3);
|
|
8440
8826
|
};
|
|
8441
|
-
const [loadingAction, setLoadingAction] =
|
|
8827
|
+
const [loadingAction, setLoadingAction] = useBusyAction();
|
|
8442
8828
|
const [proxyInputs, setProxyInputs] = useState({});
|
|
8443
8829
|
const [editingProxyId, setEditingProxyId] = useState(null);
|
|
8444
8830
|
const [expandedModels, setExpandedModels] = useState({});
|
|
@@ -8779,8 +9165,20 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8779
9165
|
onClick: () => auth.setImportMode(true)
|
|
8780
9166
|
}, t("auth.tokenTab"))) : null), !flowActive ? auth.importMode ? renderTokenImportForm(t, auth, pool, isBusy, loadingAction) : renderBrowserOAuthForm(t, auth, pool, isBusy, loadingAction) : renderWaitingCodeForm(t, auth, isBusy, loadingAction));
|
|
8781
9167
|
}
|
|
8782
|
-
|
|
8783
|
-
|
|
9168
|
+
/**
|
|
9169
|
+
* Effort labels for the dropdowns. Localised when the locale defines the id,
|
|
9170
|
+
* otherwise agy's own English name (Low/Medium/High/Extra/Max) — the same
|
|
9171
|
+
* names the host's model menu shows, so both surfaces read identically.
|
|
9172
|
+
*/
|
|
9173
|
+
function effortLabels(t) {
|
|
9174
|
+
return {
|
|
9175
|
+
auto: t("config.translateEffortAuto"),
|
|
9176
|
+
level: (id) => {
|
|
9177
|
+
const key = "effort." + id;
|
|
9178
|
+
const localised = t(key);
|
|
9179
|
+
return localised === key ? effortLabel(id) : localised;
|
|
9180
|
+
}
|
|
9181
|
+
};
|
|
8784
9182
|
}
|
|
8785
9183
|
function renderRuntimeConfig(t, status, pool, catalogModels, hiddenModelSet, loadingAction, actions) {
|
|
8786
9184
|
const { setCfg, setMode, toggleModelHidden, copyImageCommand } = actions;
|
|
@@ -8869,14 +9267,19 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8869
9267
|
},
|
|
8870
9268
|
disabled: loadingAction === "config:translateEffort",
|
|
8871
9269
|
onChange: (e) => void setCfg("translateEffort", e?.target?.value ?? ""),
|
|
8872
|
-
options: translateEffortOptions(status.translateEffort ?? "",
|
|
8873
|
-
auto: t("config.translateEffortAuto"),
|
|
8874
|
-
low: t("effort.low"),
|
|
8875
|
-
medium: t("effort.medium"),
|
|
8876
|
-
high: t("effort.high")
|
|
8877
|
-
})
|
|
9270
|
+
options: translateEffortOptions(status.translateEffort ?? "", effortLabels(t), status.translateModel ?? "", catalogModels)
|
|
8878
9271
|
}))
|
|
8879
|
-
}), renderImageRow(t, status, catalogModels, loadingAction, setCfg, copyImageCommand),
|
|
9272
|
+
}), renderImageRow(t, status, catalogModels, loadingAction, setCfg, copyImageCommand), renderVisibilityRows({
|
|
9273
|
+
t,
|
|
9274
|
+
status,
|
|
9275
|
+
loadingAction,
|
|
9276
|
+
setCfg
|
|
9277
|
+
}), renderPoolWideCatalogRow({
|
|
9278
|
+
t,
|
|
9279
|
+
status,
|
|
9280
|
+
loadingAction,
|
|
9281
|
+
setCfg
|
|
9282
|
+
}), renderDefaultEffortRow(t, status, catalogModels, loadingAction, setCfg), h(ModelsPanel, {
|
|
8880
9283
|
t,
|
|
8881
9284
|
catalogModels,
|
|
8882
9285
|
hiddenModelSet,
|
|
@@ -8884,8 +9287,18 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8884
9287
|
toggleModelHidden
|
|
8885
9288
|
})));
|
|
8886
9289
|
}
|
|
8887
|
-
|
|
9290
|
+
/**
|
|
9291
|
+
* Default thinking effort. The buttons come from the LIVE catalog, not a local
|
|
9292
|
+
* low/medium/high list: when agy ships a new level (1.5.7 added `xhigh`) the
|
|
9293
|
+
* row gains it with no code change, and it can never offer a level no model
|
|
9294
|
+
* supports.
|
|
9295
|
+
*/
|
|
9296
|
+
function renderDefaultEffortRow(t, status, catalogModels, loadingAction, setCfg) {
|
|
8888
9297
|
const value = status.defaultEffort;
|
|
9298
|
+
const labels = effortLabels(t);
|
|
9299
|
+
const levels = catalogEfforts(catalogModels);
|
|
9300
|
+
const configured = (value ?? "").trim().toLowerCase();
|
|
9301
|
+
const shown = configured !== "" && !levels.includes(configured) ? [...levels, configured] : levels;
|
|
8889
9302
|
return h(Row, {
|
|
8890
9303
|
left: h("div", { style: {
|
|
8891
9304
|
display: "flex",
|
|
@@ -8895,28 +9308,16 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8895
9308
|
fontWeight: 600,
|
|
8896
9309
|
fontSize: "12.5px"
|
|
8897
9310
|
} }, t("config.defaultEffort")), h("span", { style: S.muted }, t("config.defaultEffortDesc"))),
|
|
8898
|
-
right: segGroup([
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
}, t("effort.low")),
|
|
8909
|
-
h(Button, {
|
|
8910
|
-
variant: value === "medium" ? "segActive" : "seg",
|
|
8911
|
-
disabled: loadingAction === "config:defaultEffort",
|
|
8912
|
-
onClick: () => void setCfg("defaultEffort", "medium")
|
|
8913
|
-
}, t("effort.medium")),
|
|
8914
|
-
h(Button, {
|
|
8915
|
-
variant: value === "high" ? "segActive" : "seg",
|
|
8916
|
-
disabled: loadingAction === "config:defaultEffort",
|
|
8917
|
-
onClick: () => void setCfg("defaultEffort", "high")
|
|
8918
|
-
}, t("effort.high"))
|
|
8919
|
-
])
|
|
9311
|
+
right: segGroup([h(Button, {
|
|
9312
|
+
variant: value === "" ? "segActive" : "seg",
|
|
9313
|
+
disabled: loadingAction === "config:defaultEffort",
|
|
9314
|
+
onClick: () => void setCfg("defaultEffort", "")
|
|
9315
|
+
}, t("effort.auto")), ...shown.map((level) => h(Button, {
|
|
9316
|
+
key: level,
|
|
9317
|
+
variant: value === level ? "segActive" : "seg",
|
|
9318
|
+
disabled: loadingAction === "config:defaultEffort",
|
|
9319
|
+
onClick: () => void setCfg("defaultEffort", level)
|
|
9320
|
+
}, labels.level(level)))])
|
|
8920
9321
|
});
|
|
8921
9322
|
}
|
|
8922
9323
|
function renderImageRow(t, status, catalogModels, loadingAction, setCfg, copyImageCommand) {
|
|
@@ -8955,12 +9356,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
8955
9356
|
},
|
|
8956
9357
|
disabled: loadingAction === "config:imageEffort",
|
|
8957
9358
|
onChange: (e) => void setCfg("imageEffort", e?.target?.value ?? ""),
|
|
8958
|
-
options: translateEffortOptions(status.imageEffort ?? "",
|
|
8959
|
-
auto: t("config.translateEffortAuto"),
|
|
8960
|
-
low: t("effort.low"),
|
|
8961
|
-
medium: t("effort.medium"),
|
|
8962
|
-
high: t("effort.high")
|
|
8963
|
-
})
|
|
9359
|
+
options: translateEffortOptions(status.imageEffort ?? "", effortLabels(t), status.imageModel ?? "", catalogModels)
|
|
8964
9360
|
}))), h("div", { style: {
|
|
8965
9361
|
display: "flex",
|
|
8966
9362
|
alignItems: "center",
|
|
@@ -9038,7 +9434,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
9038
9434
|
const badge = h(Button, {
|
|
9039
9435
|
variant: "pill",
|
|
9040
9436
|
title: badgeTitle,
|
|
9041
|
-
className: "agy-btn",
|
|
9437
|
+
className: "agy-btn agy-session-status-btn",
|
|
9042
9438
|
onClick: () => {
|
|
9043
9439
|
modalHostManager.claim(hostId);
|
|
9044
9440
|
agyModalStore.setOpen(true);
|
|
@@ -9048,12 +9444,15 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
9048
9444
|
width: "7px",
|
|
9049
9445
|
height: "7px",
|
|
9050
9446
|
borderRadius: "50%",
|
|
9051
|
-
background: color
|
|
9052
|
-
|
|
9053
|
-
|
|
9447
|
+
background: color,
|
|
9448
|
+
flexShrink: 0
|
|
9449
|
+
} }), h("span", { className: "agy-session-status-label" }, buttonLabel));
|
|
9450
|
+
const modalPortal = isPrimaryHost && isModalOpen ? portalToBody(h(ConsoleDialog, {
|
|
9054
9451
|
t,
|
|
9055
9452
|
SettingsSection
|
|
9056
|
-
})) : null
|
|
9453
|
+
})) : null;
|
|
9454
|
+
if (!isUiVisible(status, "showHeaderBadge")) return modalPortal;
|
|
9455
|
+
return h("div", { style: { display: "inline-block" } }, badge, modalPortal);
|
|
9057
9456
|
};
|
|
9058
9457
|
}
|
|
9059
9458
|
function ConsoleDialog({ t, SettingsSection }) {
|
|
@@ -9084,6 +9483,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
9084
9483
|
const name = "dsh-agy-link-client";
|
|
9085
9484
|
const inject = ["slots", "locale"];
|
|
9086
9485
|
function apply(ctx) {
|
|
9486
|
+
setClientContext(ctx);
|
|
9087
9487
|
injectGlobalStyles();
|
|
9088
9488
|
ctx.effect(() => {
|
|
9089
9489
|
ensureStatusPolling();
|
|
@@ -9193,7 +9593,7 @@ body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
|
9193
9593
|
}
|
|
9194
9594
|
ctx.effect(() => installAutoExpandReasoning());
|
|
9195
9595
|
ctx.effect(() => installMermaidRendering());
|
|
9196
|
-
ctx.effect(() => installImageEnhancer());
|
|
9596
|
+
ctx.effect(() => installImageEnhancer(ctx));
|
|
9197
9597
|
ctx.effect(() => installDecisionChips());
|
|
9198
9598
|
ctx.effect(() => installCompactionCard());
|
|
9199
9599
|
ctx.effect(() => {
|