dsh-thinking-levels 2.0.0-beta.1 → 2.0.0-beta.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/CHANGELOG.md +23 -0
- package/dsh.plugin.json +1 -1
- package/lib/client.js +255 -146
- package/lib/client.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,29 @@ All notable changes to `dsh-thinking-levels` are documented here.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
### Changed — the context control lives in the composer row — 2.0.0-beta.2
|
|
12
|
+
|
|
13
|
+
- **The context-window quick control sits in the composer tool row again**
|
|
14
|
+
(`conversation.input.right`, next to the model/effort control). The model card is not an option:
|
|
15
|
+
the shipped `ModelSelect` calls `renderSlot` zero times and owns its popup outright, so the
|
|
16
|
+
`conversation.input.model.section` seat declared in `2.0.0-beta.1` is rendered by no released
|
|
17
|
+
harness — a plugin cannot put a row inside that card on its own. `conversation.input.right` is a
|
|
18
|
+
session-scoped `list` seat any plugin may occupy, which is where a tool-row control belongs.
|
|
19
|
+
- **The slot-entry crash stays fixed.** The old pill called a standard seat as a bare getter
|
|
20
|
+
(`useSession()`) — every renderer seat is a `useSyncExternalStoreWithSelector` selector hook, so
|
|
21
|
+
the call threw `TypeError: l is not a function` and took the whole entry down on each render. The
|
|
22
|
+
control now reads the active model through a mandatory selector.
|
|
23
|
+
- **The model source is seat-agnostic.** It prefers the session `useTrajectory` seat (the request
|
|
24
|
+
ledger, DSH 0.1.2+) and falls back to `useConversation`
|
|
25
|
+
(`ConversationSnapshot.views.get('trajectory')`) on harness lines without it; a harness that
|
|
26
|
+
provides neither seat renders nothing instead of a dead control.
|
|
27
|
+
- **The popover is one slider row**: preset slider (64K / 128K / 256K / 400K / 512K / 1M) writing
|
|
28
|
+
once per gesture (pointer release, key release, blur), the committed value, a collapsed
|
|
29
|
+
custom-integer editor (`⋯`) and Clear. The pill shows the value only; `input.context.*` copy is
|
|
30
|
+
restored in all four dictionaries.
|
|
31
|
+
- **Unchanged: the settings card editor.** Per-model context-window presets, the custom integer and
|
|
32
|
+
Clear stay exactly as they are, writing the same `llm-pi-ai` / `llm-deepseek` namespaces.
|
|
33
|
+
|
|
11
34
|
### Breaking — DSH v0.1.2+ only (`dsh-client-runtime` removal) — 0.7.2-beta.1
|
|
12
35
|
|
|
13
36
|
- **`engines.dsh` is now `>=0.1.2-alpha.1 <0.2.0-0`.** `@deepseek-ai/dsh-client-runtime`
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-thinking-levels",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"description": "thinking-level (reasoning_effort) control — auto-adjust per tool round, with optional manual lock and per-tool timing telemetry.",
|
|
6
6
|
"engines": {
|
package/lib/client.js
CHANGED
|
@@ -447,7 +447,7 @@ window.__ModuleLoader__.load({
|
|
|
447
447
|
padding: "3px 8px",
|
|
448
448
|
fontSize: "13px"
|
|
449
449
|
};
|
|
450
|
-
const sectionStyle
|
|
450
|
+
const sectionStyle = {
|
|
451
451
|
marginTop: "14px",
|
|
452
452
|
paddingTop: "12px",
|
|
453
453
|
borderTop: "1px solid var(--dsw-alias-border-l2)"
|
|
@@ -883,14 +883,14 @@ window.__ModuleLoader__.load({
|
|
|
883
883
|
commitContextWindow(entry, void 0);
|
|
884
884
|
};
|
|
885
885
|
if (unavailable) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
886
|
-
style: sectionStyle
|
|
886
|
+
style: sectionStyle,
|
|
887
887
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
888
888
|
style: hintStyle,
|
|
889
889
|
children: t("card.capabilities.unavailable")
|
|
890
890
|
})
|
|
891
891
|
});
|
|
892
892
|
if (allEntries.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
893
|
-
style: sectionStyle
|
|
893
|
+
style: sectionStyle,
|
|
894
894
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
895
895
|
style: fieldLabelStyle,
|
|
896
896
|
children: t("card.capabilities")
|
|
@@ -903,7 +903,7 @@ window.__ModuleLoader__.load({
|
|
|
903
903
|
const visible = needle === "" ? allEntries : allEntries.filter((entry) => entry.modelId.toLowerCase().includes(needle) || entry.providerId.toLowerCase().includes(needle));
|
|
904
904
|
const providerIds = [...new Set(visible.map((entry) => entry.providerId))];
|
|
905
905
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
906
|
-
style: sectionStyle
|
|
906
|
+
style: sectionStyle,
|
|
907
907
|
children: [
|
|
908
908
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
909
909
|
style: fieldLabelStyle,
|
|
@@ -1508,15 +1508,25 @@ window.__ModuleLoader__.load({
|
|
|
1508
1508
|
//#endregion
|
|
1509
1509
|
//#region src/client/context-quick.tsx
|
|
1510
1510
|
/**
|
|
1511
|
-
* Context-window quick control for the
|
|
1512
|
-
* (`conversation.input.
|
|
1513
|
-
*
|
|
1511
|
+
* Context-window quick control for the composer tool row
|
|
1512
|
+
* (`conversation.input.right`, the seat just left of the model/effort select).
|
|
1513
|
+
*
|
|
1514
|
+
* Why this seat: the model *card* has no injection point (the shipped
|
|
1515
|
+
* `ModelSelect` calls `renderSlot` zero times and owns its popup outright), so a
|
|
1516
|
+
* plugin can only contribute inside the composer area. `conversation.input.right`
|
|
1517
|
+
* is a session-scoped `list` seat, which is where the harness lets any plugin put
|
|
1518
|
+
* a tool-row control. The trigger is a compact pill showing the committed value
|
|
1519
|
+
* only; the popover holds one slider row over the shared presets, a collapsed
|
|
1520
|
+
* custom-integer editor and Clear — no preset button grid.
|
|
1514
1521
|
*
|
|
1515
|
-
*
|
|
1516
|
-
* `useTrajectory`
|
|
1517
|
-
*
|
|
1518
|
-
*
|
|
1519
|
-
* and
|
|
1522
|
+
* Model source: whichever session seat this harness provides, in order —
|
|
1523
|
+
* `useTrajectory` (the trajectory ledger's `requests`, DSH 0.1.2+) or
|
|
1524
|
+
* `useConversation` (`ConversationSnapshot.views.get('trajectory')`). Every
|
|
1525
|
+
* renderer standard seat is a `useSyncExternalStoreWithSelector` selector hook
|
|
1526
|
+
* and the selector is mandatory: calling one without a selector throws
|
|
1527
|
+
* `TypeError: <minified> is not a function` inside the binding shim and takes the
|
|
1528
|
+
* whole slot entry down. A harness that provides neither seat renders nothing
|
|
1529
|
+
* here instead of a dead control.
|
|
1520
1530
|
*
|
|
1521
1531
|
* Two model families are served, each with its own writable settings
|
|
1522
1532
|
* namespace (both consumed live by `resolveModelInfo(...).context.contextWindow`,
|
|
@@ -1541,13 +1551,42 @@ window.__ModuleLoader__.load({
|
|
|
1541
1551
|
const DEEPSEEK_DEFAULT_WINDOW = 1e6;
|
|
1542
1552
|
/** Slider stop an unset window parks on: the thumb needs a position, the readout stays "unset". */
|
|
1543
1553
|
const UNSET_STOP_INDEX = CONTEXT_WINDOW_PRESETS.findIndex((preset) => preset.value === 256e3);
|
|
1544
|
-
const
|
|
1554
|
+
const pillStyle = {
|
|
1555
|
+
display: "inline-flex",
|
|
1556
|
+
alignItems: "center",
|
|
1557
|
+
gap: "4px",
|
|
1558
|
+
height: "24px",
|
|
1559
|
+
padding: "0 8px",
|
|
1560
|
+
background: "var(--dsw-alias-bg-surface, #fff)",
|
|
1561
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
1562
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1563
|
+
borderRadius: "6px",
|
|
1564
|
+
fontSize: "11px",
|
|
1565
|
+
lineHeight: "16px",
|
|
1566
|
+
fontFamily: "var(--ds-font-family-code, monospace)",
|
|
1567
|
+
cursor: "pointer",
|
|
1568
|
+
whiteSpace: "nowrap"
|
|
1569
|
+
};
|
|
1570
|
+
const popStyle = {
|
|
1571
|
+
position: "absolute",
|
|
1572
|
+
bottom: "calc(100% + 8px)",
|
|
1573
|
+
right: "0",
|
|
1574
|
+
zIndex: 1200,
|
|
1575
|
+
minWidth: "260px",
|
|
1576
|
+
padding: "10px",
|
|
1577
|
+
background: "var(--dsw-alias-bg-layer-3, rgba(127,127,127,0.05))",
|
|
1578
|
+
color: "var(--dsw-alias-label-primary)",
|
|
1579
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
1580
|
+
borderRadius: "10px",
|
|
1581
|
+
boxShadow: "0 8px 28px rgba(0,0,0,0.18)",
|
|
1545
1582
|
display: "flex",
|
|
1546
1583
|
flexDirection: "column",
|
|
1547
|
-
gap: "
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1584
|
+
gap: "8px"
|
|
1585
|
+
};
|
|
1586
|
+
const backdropStyle = {
|
|
1587
|
+
position: "fixed",
|
|
1588
|
+
inset: 0,
|
|
1589
|
+
zIndex: 1199
|
|
1551
1590
|
};
|
|
1552
1591
|
const rowStyle = {
|
|
1553
1592
|
display: "flex",
|
|
@@ -1645,26 +1684,35 @@ window.__ModuleLoader__.load({
|
|
|
1645
1684
|
};
|
|
1646
1685
|
}
|
|
1647
1686
|
/**
|
|
1648
|
-
* The stable trajectory selector
|
|
1649
|
-
* selector reference, so it must not be a fresh
|
|
1650
|
-
*
|
|
1651
|
-
*
|
|
1652
|
-
*
|
|
1653
|
-
* @
|
|
1654
|
-
* @returns the assembled request ledger.
|
|
1687
|
+
* The stable trajectory-ledger selector (the `useTrajectory` seat): the seat
|
|
1688
|
+
* memoizes its selection on the selector reference, so it must not be a fresh
|
|
1689
|
+
* closure per render. The ledger is a store-owned array whose reference only
|
|
1690
|
+
* moves when the trajectory changes.
|
|
1691
|
+
* @param snapshot - the current trajectory snapshot.
|
|
1692
|
+
* @returns the request ledger.
|
|
1655
1693
|
*/
|
|
1656
1694
|
const selectRequests = (snapshot) => snapshot.requests;
|
|
1657
1695
|
/**
|
|
1696
|
+
* The stable trajectory-view selector (the `useConversation` seat): selecting
|
|
1697
|
+
* the view snapshot (a store-owned reference, not a derived object) keeps the
|
|
1698
|
+
* selected value stable between snapshots — a selector that built a new object
|
|
1699
|
+
* would re-render forever.
|
|
1700
|
+
* @param snapshot - the current conversation snapshot.
|
|
1701
|
+
* @returns the trajectory view snapshot, absent while the view is unregistered.
|
|
1702
|
+
*/
|
|
1703
|
+
const selectTrajectory = (snapshot) => snapshot.views?.get?.("trajectory");
|
|
1704
|
+
/**
|
|
1658
1705
|
* The current session's active model, taken from the trajectory ledger's
|
|
1659
1706
|
* latest assistant request prompt config. Absent for a blank session (no
|
|
1660
|
-
* request yet) — the control then renders
|
|
1661
|
-
* @param
|
|
1707
|
+
* request yet) — the control then renders disabled.
|
|
1708
|
+
* @param source - the request ledger, or a trajectory snapshot carrying it.
|
|
1709
|
+
* @returns the provider/model pair, or undefined when the ledger has none.
|
|
1662
1710
|
*/
|
|
1663
|
-
function activeModelOf(
|
|
1664
|
-
const
|
|
1665
|
-
for (let index =
|
|
1666
|
-
const config =
|
|
1667
|
-
if (
|
|
1711
|
+
function activeModelOf(source) {
|
|
1712
|
+
const requests = Array.isArray(source) ? source ?? [] : typeof source === "object" && source !== null ? source.requests ?? [] : [];
|
|
1713
|
+
for (let index = requests.length - 1; index >= 0; index -= 1) {
|
|
1714
|
+
const config = requests[index]?.prompt?.config;
|
|
1715
|
+
if (requests[index]?.purpose === "assistant" && typeof config?.provider === "string" && typeof config?.model === "string") return {
|
|
1668
1716
|
provider: config.provider,
|
|
1669
1717
|
model: config.model
|
|
1670
1718
|
};
|
|
@@ -1677,7 +1725,7 @@ window.__ModuleLoader__.load({
|
|
|
1677
1725
|
}
|
|
1678
1726
|
/**
|
|
1679
1727
|
* The slider stop nearest to a committed token count; a window that matches no
|
|
1680
|
-
* preset
|
|
1728
|
+
* preset still parks the thumb on its closest stop.
|
|
1681
1729
|
* @param value - the committed context window, when one is set.
|
|
1682
1730
|
* @returns the stop index, or the unset park position.
|
|
1683
1731
|
*/
|
|
@@ -1695,14 +1743,50 @@ window.__ModuleLoader__.load({
|
|
|
1695
1743
|
return best;
|
|
1696
1744
|
}
|
|
1697
1745
|
/**
|
|
1698
|
-
* The
|
|
1699
|
-
*
|
|
1700
|
-
*
|
|
1701
|
-
* namespace each writes).
|
|
1746
|
+
* The composer context-window quick control. Renders nothing when this harness
|
|
1747
|
+
* provides neither session seat, so a missing seat never leaves a dead control
|
|
1748
|
+
* (or a crash) in the tool row.
|
|
1702
1749
|
* @param props - injected scopes, session standard seats, copy.
|
|
1703
1750
|
*/
|
|
1704
|
-
function ContextQuick(
|
|
1705
|
-
|
|
1751
|
+
function ContextQuick(props) {
|
|
1752
|
+
if (typeof props.useTrajectory === "function") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TrajectoryBound, {
|
|
1753
|
+
...props,
|
|
1754
|
+
useTrajectory: props.useTrajectory
|
|
1755
|
+
});
|
|
1756
|
+
if (typeof props.useConversation === "function") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConversationBound, {
|
|
1757
|
+
...props,
|
|
1758
|
+
useConversation: props.useConversation
|
|
1759
|
+
});
|
|
1760
|
+
return null;
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* The trajectory-seat binding (DSH 0.1.2+).
|
|
1764
|
+
* @param props - the control props plus the present trajectory seat.
|
|
1765
|
+
*/
|
|
1766
|
+
function TrajectoryBound({ useTrajectory, ...rest }) {
|
|
1767
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextQuickView, {
|
|
1768
|
+
...rest,
|
|
1769
|
+
active: activeModelOf(useTrajectory(selectRequests))
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* The conversation-seat binding (harness lines without the trajectory seat).
|
|
1774
|
+
* @param props - the control props plus the present conversation seat.
|
|
1775
|
+
*/
|
|
1776
|
+
function ConversationBound({ useConversation, ...rest }) {
|
|
1777
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ContextQuickView, {
|
|
1778
|
+
...rest,
|
|
1779
|
+
active: activeModelOf(useConversation(selectTrajectory))
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
/**
|
|
1783
|
+
* The bound control: a value pill that opens a one-row slider popover
|
|
1784
|
+
* (preset slider, committed value, collapsed custom-integer editor, Clear).
|
|
1785
|
+
* Custom gateways and official DeepSeek models are both supported (see module
|
|
1786
|
+
* doc for the namespace each writes).
|
|
1787
|
+
* @param props - injected scopes, the resolved active model, copy.
|
|
1788
|
+
*/
|
|
1789
|
+
function ContextQuickView({ active, piAiScope, deepseekScope, t }) {
|
|
1706
1790
|
const official = active !== void 0 && active.provider === DEEPSEEK_PROVIDER;
|
|
1707
1791
|
const piSnapshot = (0, react.useSyncExternalStore)((listener) => piAiScope.subscribe(listener), () => piAiScope.getSnapshot());
|
|
1708
1792
|
const dsSnapshot = (0, react.useSyncExternalStore)((listener) => deepseekScope.subscribe(listener), () => deepseekScope.getSnapshot());
|
|
@@ -1724,6 +1808,7 @@ window.__ModuleLoader__.load({
|
|
|
1724
1808
|
currentWindow = model === void 0 ? void 0 : contextWindowOf(model);
|
|
1725
1809
|
writableTarget = model !== void 0;
|
|
1726
1810
|
}
|
|
1811
|
+
const [open, setOpen] = (0, react.useState)(false);
|
|
1727
1812
|
const [draft, setDraft] = (0, react.useState)(null);
|
|
1728
1813
|
const [custom, setCustom] = (0, react.useState)(false);
|
|
1729
1814
|
const [raw, setRaw] = (0, react.useState)("");
|
|
@@ -1800,112 +1885,136 @@ window.__ModuleLoader__.load({
|
|
|
1800
1885
|
commitWindow(validation.value);
|
|
1801
1886
|
};
|
|
1802
1887
|
const value = draft === null ? currentWindow === void 0 ? t("input.context.unset") : formatContextWindow(currentWindow) : formatContextWindow(CONTEXT_WINDOW_PRESETS[draft]?.value ?? 0);
|
|
1803
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
1804
|
-
style:
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1888
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1889
|
+
style: { position: "relative" },
|
|
1890
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1891
|
+
type: "button",
|
|
1892
|
+
disabled,
|
|
1893
|
+
"aria-expanded": open,
|
|
1894
|
+
"aria-label": t("input.context.title"),
|
|
1895
|
+
title: active === void 0 ? t("input.context.noModel") : `${active.provider}/${active.model}`,
|
|
1896
|
+
style: {
|
|
1897
|
+
...pillStyle,
|
|
1898
|
+
cursor: disabled ? "default" : "pointer",
|
|
1899
|
+
opacity: disabled ? .55 : 1
|
|
1900
|
+
},
|
|
1901
|
+
onClick: () => {
|
|
1902
|
+
setOpen((value) => !value);
|
|
1903
|
+
setError(null);
|
|
1904
|
+
},
|
|
1905
|
+
children: value
|
|
1906
|
+
}), open ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1907
|
+
style: backdropStyle,
|
|
1908
|
+
onClick: () => {
|
|
1909
|
+
setOpen(false);
|
|
1910
|
+
setError(null);
|
|
1911
|
+
}
|
|
1912
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1913
|
+
style: popStyle,
|
|
1914
|
+
role: "group",
|
|
1915
|
+
"aria-label": t("input.context.title"),
|
|
1916
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1917
|
+
style: rowStyle,
|
|
1918
|
+
children: [
|
|
1919
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1920
|
+
style: labelStyle,
|
|
1921
|
+
title: t("input.context.globalHint"),
|
|
1922
|
+
children: t("input.context.title")
|
|
1923
|
+
}),
|
|
1924
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1925
|
+
type: "range",
|
|
1926
|
+
min: 0,
|
|
1927
|
+
max: CONTEXT_WINDOW_PRESETS.length - 1,
|
|
1928
|
+
step: 1,
|
|
1929
|
+
value: stop,
|
|
1930
|
+
disabled,
|
|
1931
|
+
"aria-label": t("input.context.title"),
|
|
1932
|
+
style: {
|
|
1933
|
+
...sliderStyle,
|
|
1934
|
+
cursor: disabled ? "default" : "pointer",
|
|
1935
|
+
opacity: disabled ? .55 : 1
|
|
1936
|
+
},
|
|
1937
|
+
onChange: (event) => {
|
|
1938
|
+
setDraft(Number(event.currentTarget.value));
|
|
1939
|
+
},
|
|
1940
|
+
onPointerUp: commitStop,
|
|
1941
|
+
onKeyUp: commitStop,
|
|
1942
|
+
onBlur: commitStop
|
|
1943
|
+
}),
|
|
1944
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1945
|
+
style: valueStyle,
|
|
1946
|
+
children: value
|
|
1947
|
+
}),
|
|
1948
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1949
|
+
type: "button",
|
|
1950
|
+
disabled,
|
|
1951
|
+
"aria-label": t("input.context.custom"),
|
|
1952
|
+
"aria-expanded": custom,
|
|
1953
|
+
title: t("input.context.custom"),
|
|
1954
|
+
style: {
|
|
1955
|
+
...glyphButtonStyle,
|
|
1956
|
+
cursor: disabled ? "default" : "pointer",
|
|
1957
|
+
opacity: disabled ? .55 : 1
|
|
1958
|
+
},
|
|
1959
|
+
onClick: () => {
|
|
1960
|
+
setCustom((open) => !open);
|
|
1961
|
+
setError(null);
|
|
1962
|
+
},
|
|
1963
|
+
children: "⋯"
|
|
1964
|
+
}),
|
|
1965
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1966
|
+
type: "button",
|
|
1967
|
+
disabled: disabled || currentWindow === void 0,
|
|
1968
|
+
style: {
|
|
1969
|
+
...actionButtonStyle,
|
|
1970
|
+
cursor: disabled || currentWindow === void 0 ? "default" : "pointer",
|
|
1971
|
+
opacity: disabled || currentWindow === void 0 ? .55 : 1
|
|
1972
|
+
},
|
|
1973
|
+
onClick: () => {
|
|
1974
|
+
setDraft(null);
|
|
1975
|
+
setError(null);
|
|
1976
|
+
setRaw("");
|
|
1977
|
+
commitWindow(void 0);
|
|
1978
|
+
},
|
|
1979
|
+
children: t("input.context.clear")
|
|
1980
|
+
})
|
|
1981
|
+
]
|
|
1982
|
+
}), custom ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1983
|
+
style: customRowStyle,
|
|
1984
|
+
children: [
|
|
1985
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1986
|
+
type: "text",
|
|
1987
|
+
inputMode: "numeric",
|
|
1988
|
+
value: raw,
|
|
1989
|
+
disabled,
|
|
1990
|
+
placeholder: t("input.context.customPlaceholder"),
|
|
1991
|
+
"aria-label": t("input.context.customPlaceholder"),
|
|
1992
|
+
style: inputStyle,
|
|
1993
|
+
onChange: (event) => {
|
|
1994
|
+
setRaw(event.currentTarget.value);
|
|
1995
|
+
},
|
|
1996
|
+
onKeyDown: (event) => {
|
|
1997
|
+
if (event.key === "Enter") applyCustom();
|
|
1998
|
+
}
|
|
1999
|
+
}),
|
|
2000
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
2001
|
+
type: "button",
|
|
2002
|
+
disabled,
|
|
2003
|
+
style: {
|
|
2004
|
+
...actionButtonStyle,
|
|
2005
|
+
cursor: disabled ? "default" : "pointer",
|
|
2006
|
+
opacity: disabled ? .55 : 1
|
|
2007
|
+
},
|
|
2008
|
+
onClick: applyCustom,
|
|
2009
|
+
children: t("input.context.apply")
|
|
2010
|
+
}),
|
|
2011
|
+
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2012
|
+
style: errorStyle,
|
|
2013
|
+
children: error
|
|
2014
|
+
})
|
|
2015
|
+
]
|
|
2016
|
+
}) : null]
|
|
2017
|
+
})] }) : null]
|
|
1909
2018
|
});
|
|
1910
2019
|
}
|
|
1911
2020
|
//#endregion
|
|
@@ -1950,9 +2059,9 @@ window.__ModuleLoader__.load({
|
|
|
1950
2059
|
}
|
|
1951
2060
|
}, ThinkingLevelsCard);
|
|
1952
2061
|
});
|
|
1953
|
-
ctx.slots.inject("conversation.input.
|
|
2062
|
+
ctx.slots.inject("conversation.input.right", function* () {
|
|
1954
2063
|
yield ctx.slots.register({
|
|
1955
|
-
name: "conversation.input.
|
|
2064
|
+
name: "conversation.input.right",
|
|
1956
2065
|
id: "context-window-quick",
|
|
1957
2066
|
locale: NS,
|
|
1958
2067
|
inject: () => {
|