Show xhigh effort as Extra in the model seat; rebuild client.js
This commit is contained in:
1 parent
22db8c4596
commit
81630ed477
4 files changed
+14
-5
No files matched your search
@@ -7,6 +7,7 @@ An enhanced model selector for the DeepSeek Harness (DSH) Web UI: **pinned, drag
|
||||
- Replaces the composer model seat (slot `conversation.input.model`).
|
||||
- Pin favourite models to the top and reorder them with drag and drop; pins persist in `localStorage` and sync across tabs.
|
||||
- Brand icons (Anthropic, OpenAI, Gemini, DeepSeek, Qwen, Mistral, Grok, Meta, …) matched by model id/name first, then by provider; serving platforms (OpenRouter, Bedrock, Azure, Together, …) only when the model name says nothing.
|
||||
- Friendlier effort labels: the `xhigh` level is shown as **Extra** (the stored key stays `xhigh`).
|
||||
- Shortcut to open **Settings → Models**.
|
||||
- English and Chinese strings.
|
||||
|
||||
|
||||
@@ -119,6 +119,10 @@ window.__ModuleLoader__.load({
|
||||
pinStore.listeners.forEach((fn) => fn());
|
||||
};
|
||||
|
||||
// DSH derives effort names from the level key ("xhigh" -> "Xhigh"); show friendlier ones.
|
||||
const EFFORT_NAMES = { xhigh: 'Extra' };
|
||||
const effortName = (e) => (e === undefined ? undefined : EFFORT_NAMES[e.id] ?? e.name);
|
||||
|
||||
function moveKey(order, from, to, pos) {
|
||||
if (from === to) return order;
|
||||
const without = order.filter((k) => k !== from);
|
||||
@@ -347,10 +351,10 @@ window.__ModuleLoader__.load({
|
||||
? state.retainedEffort
|
||||
: effectiveEffort === undefined
|
||||
? t('effort.providerDefault')
|
||||
: reasoning.efforts.find((l) => l.id === effectiveEffort)?.name ?? effectiveEffort;
|
||||
: effortName(reasoning.efforts.find((l) => l.id === effectiveEffort)) ?? effectiveEffort;
|
||||
const effortChoices = React.useMemo(() => (reasoning === undefined ? [] : [
|
||||
...(reasoning.defaultEffort === undefined ? [{ key: 'provider-default', effort: undefined, label: t('effort.providerDefault') }] : []),
|
||||
...reasoning.efforts.map((e) => ({ key: 'effort:' + e.id, effort: e.id, label: e.name })),
|
||||
...reasoning.efforts.map((e) => ({ key: 'effort:' + e.id, effort: e.id, label: effortName(e) })),
|
||||
]), [reasoning, t]);
|
||||
|
||||
const { pending } = state;
|
||||
|
||||
+6
-2
@@ -119,6 +119,10 @@ window.__ModuleLoader__.load({
|
||||
pinStore.listeners.forEach((fn) => fn());
|
||||
};
|
||||
|
||||
// DSH derives effort names from the level key ("xhigh" -> "Xhigh"); show friendlier ones.
|
||||
const EFFORT_NAMES = { xhigh: 'Extra' };
|
||||
const effortName = (e) => (e === undefined ? undefined : EFFORT_NAMES[e.id] ?? e.name);
|
||||
|
||||
function moveKey(order, from, to, pos) {
|
||||
if (from === to) return order;
|
||||
const without = order.filter((k) => k !== from);
|
||||
@@ -347,10 +351,10 @@ window.__ModuleLoader__.load({
|
||||
? state.retainedEffort
|
||||
: effectiveEffort === undefined
|
||||
? t('effort.providerDefault')
|
||||
: reasoning.efforts.find((l) => l.id === effectiveEffort)?.name ?? effectiveEffort;
|
||||
: effortName(reasoning.efforts.find((l) => l.id === effectiveEffort)) ?? effectiveEffort;
|
||||
const effortChoices = React.useMemo(() => (reasoning === undefined ? [] : [
|
||||
...(reasoning.defaultEffort === undefined ? [{ key: 'provider-default', effort: undefined, label: t('effort.providerDefault') }] : []),
|
||||
...reasoning.efforts.map((e) => ({ key: 'effort:' + e.id, effort: e.id, label: e.name })),
|
||||
...reasoning.efforts.map((e) => ({ key: 'effort:' + e.id, effort: e.id, label: effortName(e) })),
|
||||
]), [reasoning, t]);
|
||||
|
||||
const { pending } = state;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@local/model-selector-plus",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": { ".": "./index.js", "./client": "./client.js" },
|
||||
|
||||
Reference in new issue
Block a user