mercury-agent 0.5.13 → 0.5.14
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/package.json +1 -1
- package/src/core/routes/dashboard.ts +20 -2
package/package.json
CHANGED
|
@@ -1970,15 +1970,33 @@ export function createDashboardRoutes(ctx: DashboardContext) {
|
|
|
1970
1970
|
|
|
1971
1971
|
const modelSelectorPanel = (() => {
|
|
1972
1972
|
if (isMultiLeg) {
|
|
1973
|
+
const chainFromEnv = !!process.env.MERCURY_MODEL_CHAIN;
|
|
1974
|
+
const chainYaml = cfg.resolvedModelChain
|
|
1975
|
+
.map(
|
|
1976
|
+
(leg) =>
|
|
1977
|
+
` - provider: ${leg.provider}\n model: ${leg.model}`,
|
|
1978
|
+
)
|
|
1979
|
+
.join("\n");
|
|
1980
|
+
const configSnippet = chainFromEnv
|
|
1981
|
+
? `MERCURY_MODEL_CHAIN='${JSON.stringify(cfg.resolvedModelChain.map((l) => ({ provider: l.provider, model: l.model })))}'`
|
|
1982
|
+
: `model:\n chain:\n${chainYaml}`;
|
|
1983
|
+
const sourceLabel = chainFromEnv
|
|
1984
|
+
? `<span class="mono">MERCURY_MODEL_CHAIN</span> env var in <span class="mono">.env</span>`
|
|
1985
|
+
: `<span class="mono">model.chain</span> in <span class="mono">mercury.yaml</span>`;
|
|
1986
|
+
|
|
1973
1987
|
return `
|
|
1974
1988
|
<div class="panel" style="margin-bottom:16px">
|
|
1975
1989
|
<div class="panel-header" style="font-weight:600;font-size:13px">Active model</div>
|
|
1976
1990
|
<div class="panel-body">
|
|
1977
1991
|
${renderModelBlock(cfg)}
|
|
1978
1992
|
<p class="muted" style="font-size:12px;margin:8px 0 0">
|
|
1979
|
-
|
|
1980
|
-
<span class="mono">MERCURY_MODEL_CHAIN</span> — edit those to change.
|
|
1993
|
+
Configured via ${sourceLabel}. Edit that file to change.
|
|
1981
1994
|
</p>
|
|
1995
|
+
<details style="margin-top:8px">
|
|
1996
|
+
<summary class="muted" style="font-size:12px;cursor:pointer">Copy config</summary>
|
|
1997
|
+
<pre style="margin:6px 0 0;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:var(--radius,4px);font-size:12px;overflow-x:auto;cursor:pointer;position:relative"
|
|
1998
|
+
onclick="navigator.clipboard.writeText(this.textContent.trim());var s=this.querySelector('.copy-hint');if(s){s.textContent='Copied!';setTimeout(function(){s.textContent='Click to copy'},1500)}">${escapeHtml(configSnippet)}<span class="copy-hint muted" style="position:absolute;top:4px;right:8px;font-size:11px">Click to copy</span></pre>
|
|
1999
|
+
</details>
|
|
1982
2000
|
</div>
|
|
1983
2001
|
</div>`;
|
|
1984
2002
|
}
|