@mars-sea/dsh-commandcode-provider 0.14.1 → 0.14.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 CHANGED
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased]
7
+ ## [0.14.2] - 2026-10-18
8
8
 
9
9
  ### Changed
10
10
 
@@ -21,6 +21,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
21
21
  - 复核**无变化**的项:峰谷计价仍是 5 个 DeepSeek 模型、窗口 `01–04 & 06–10 UTC, Mon–Fri` 与本地常量逐值一致;订阅条目与每月额度零变化;`reflection/beam:free` 支持图像输入这一点未被目录宣告,图像能力表保持 70 条;effort 词汇表仍是 `off|low|medium|high|xhigh|max`。
22
22
 
23
23
  - **证据边界**:本轮 `scripts/` 巡检工具的状态为 `incomplete`、`readyToApply=false`、`protocol=not-verified`;唯一一条 error 是 `reflection/beam:free: absent from CLI registry`——该模型只出现在两个目录视图里,`1.84.0` 产物注册表完全不认它,因此 `KNOWN_EFFORTS` 与 `KNOWN_NON_ZDR_MODELS` 里这一行属**目录侧单源证据**(与 `1.82.4` 时 `stealth/cat-jam:free` 的处境相同)。16 个数据源全部返回 HTTP 200。**未做**:真实账号登录、付费生成、浏览器渲染验证,也没有在真实账号上验证价格与订阅额度的页面读数;`?view=client` 与定价页均为公开数据采集。
24
+ - **设置页「模型与上下文」分组改为可折叠,默认收起(issue #94)。**该分组是页面上最长的一组(套餐过滤开关 → 可见模型白名单 → 自定义上下文长度 → 按模型覆盖行),折起后「隐私与安全」与「集成与显示」两个分组不必翻过白名单即可到达。折叠头与「高级设置」共用同一实现(`DisclosureHead`/`CollapsibleGroup`),三条行为两边逐字一致:整行可点、箭头在行尾、状态不跨刷新记忆(组件内 `useState`,既不进配置文档也不进 localStorage——折叠是呈现偏好,不该由设置文档承载)。**「高级设置」呈现与交互零变化**,只是换成共用实现;`cc-groupHead`/`cc-disclosure`/`cc-chevron`/`cc-badgeWarn` 四个既有类原样复用,样式表零改动。**边界:纯呈现层开关**——`filterModelsByPlan`/`visibleModels`/`contextWindow`/`maxOutputTokens`/`contextWindowOverrides` 五个字段的暂存、校验、整批提交与写入所有权一律不变(沿用[《决策记录》第六章第1、2条](docs/决策记录.md#六设置写入所有权)),收起只决定组内 DOM 是否渲染,已暂存的编辑不会丢。**连带处理**:默认收起会把组内的无效数字一并藏起,而保存按钮会因此禁用,故折叠时在标题行显示警告徽标(新 locale 键 `modelsInvalid`,与「高级设置」的既有徽标同形);不新增「已选 N 个模型」式摘要徽标——诉求只是可收起,「非默认」口径需要另行定义。**已知取舍**:折叠头的标题仍是 `span` 而非 `h3`(该分组在标题导航里不再是一个 heading),沿用「高级设置」的既有写法(`button` 内不能放 heading),以换取与它逐字一致的 DOM 与零 CSS 布局风险。新增 `tests/section.test.ts` 12 项 React-free 用例固定两个分组「组内是否有未填好的数字」的判定(含按模型覆盖行分支);检查集与保存守卫走的**同一份 staged plan** 对齐——连 UI 上填不错的 `filterModelsByPlan` 开关也纳入,免得呈现判定比保存条件窄。两组变异对照(删 rows 分支、删 `filterModelsByPlan`)各自精准命中对应用例、恢复后 12/12 全通过,证明用例有判别力。
25
+
26
+ - **设置页「自定义上下文长度」与「单轮输出上限」的界面说明精简约一半。**两段 hint 只留「填什么 → 会怎样」:中文 124 → 61 字、240 → 98 字,英文 325 → 228、686 → 223 字符;删掉的是机制叙述(为何影响压缩与选择器标注、`0` 的动机、二进制换算示例、宿主限定预算的辅助调用),这些在 README 的对应段落里原样保留(**用户选定:README 保持不动**)。**两个信息点不可删**——「影响上下文计量与自动压缩」与「`0` 只在 CLI 与 OpenAI 传输生效,Claude 的 Messages 端点必填该字段」;后者由 `tests/settings.test.ts` 的既有文案护栏守着:首轮精简把它删掉后护栏立即失败(`zh hint names the route that requires the field`),遂以精简措辞加回,同组英文断言随之从 `/sends no such field/` 改为 `/omits the field/`(断言语义不变:文案必须说明 `0` 不发送该字段)。顺带去掉 hint 里的反引号——它经 `.cc-rowDesc` 纯文本渲染,反引号会在界面上原样显示。
24
27
 
25
28
  ## [0.14.1] - 2026-10-18
26
29
 
package/README.md CHANGED
@@ -210,7 +210,7 @@ llm-commandcode:
210
210
 
211
211
  ## Configure
212
212
 
213
- **Settings → Command Code** is organized as **Accounts** (keys, sign-in, live quota, pinning, dedicated models), **Models & context** (hide out-of-plan models, visible models, then the **Custom context length** field and the **Per-model overrides** rows right after the allowlist — global and per model, see below), **Privacy & security** (zero data retention, off by default, see below), **Integrations & display** (serve web search with Command Code, show the quota card in the sidebar, off by default), and a collapsed **Advanced** section (API base URL, request/stream timeouts, transport retries, cache-aware image offload). The working directory is no longer on the page; `workingDir` in config still works.
213
+ **Settings → Command Code** is organized as **Accounts** (keys, sign-in, live quota, pinning, dedicated models), a collapsed **Models & context** group (click its heading to unfold: hide out-of-plan models, visible models, then the **Custom context length** field and the **Per-model overrides** rows right after the allowlist — global and per model, see below), **Privacy & security** (zero data retention, off by default, see below), **Integrations & display** (serve web search with Command Code, show the quota card in the sidebar, off by default), and a collapsed **Advanced** section (API base URL, request/stream timeouts, transport retries, cache-aware image offload). Both foldable groups toggle from their whole heading row, and neither remembers its expanded state across visits. The working directory is no longer on the page; `workingDir` in config still works.
214
214
 
215
215
  The same options live in `$DSH_HOME/settings.yaml` (changes apply immediately, no restart):
216
216
 
package/README.zh-CN.md CHANGED
@@ -191,7 +191,7 @@ llm-commandcode:
191
191
 
192
192
  ## 配置
193
193
 
194
- **设置 → Command Code** 分为:**账户**(密钥、网页登录、实时额度、固定账户、专用模型)、**模型与上下文**(隐藏套餐外模型、可见模型,以及紧随白名单之后的**自定义上下文长度**字段与**按模型覆盖**列表,全局与按模型,见下)、**隐私与安全**(零数据保留 ZDR,默认关闭,见下)、**集成与显示**(用 Command Code 承载联网搜索、在侧边栏显示额度卡片,默认关闭),以及默认折叠的**高级设置**(API 地址、请求/流超时、传输重试次数、历史图片缓存优化)。工作目录已不在页面上显示,配置中的 `workingDir` 仍然有效。
194
+ **设置 → Command Code** 分为:**账户**(密钥、网页登录、实时额度、固定账户、专用模型)、**模型与上下文**(默认折叠,点标题展开:隐藏套餐外模型、可见模型,以及紧随白名单之后的**自定义上下文长度**字段与**按模型覆盖**列表,全局与按模型,见下)、**隐私与安全**(零数据保留 ZDR,默认关闭,见下)、**集成与显示**(用 Command Code 承载联网搜索、在侧边栏显示额度卡片,默认关闭),以及默认折叠的**高级设置**(API 地址、请求/流超时、传输重试次数、历史图片缓存优化)。两个可折叠分组都点标题整行展开/收起,展开状态不跨刷新记忆。工作目录已不在页面上显示,配置中的 `workingDir` 仍然有效。
195
195
 
196
196
  同一组选项也位于 `$DSH_HOME/settings.yaml`(修改即刻生效,无需重启):
197
197
 
package/lib/client.js CHANGED
@@ -3129,7 +3129,7 @@ window.__ModuleLoader__.load({
3129
3129
  visibleModelsStaleHint: "有 {count} 个已选模型在目录中找不到了(可能已下架),不影响其他模型;可清理或保留。",
3130
3130
  visibleModelsCleanStale: "清理失效({count})",
3131
3131
  contextWindow: "自定义上下文长度",
3132
- contextWindowHint: "覆盖模型目录公布的上下文窗口(token):上下文计量、自动压缩时机与模型选择器的上下文标注都按此值计算,对未单独设置的模型生效。留空则跟随目录;支持 32K、1M 这样的简写(二进制换算:32K = 32 768,1M = 1 048 576)。",
3132
+ contextWindowHint: "覆盖模型目录公布的上下文窗口(对未单独覆盖的模型生效),影响上下文计量与自动压缩;留空跟随目录。支持 32K、1M 简写。",
3133
3133
  contextOverridesTitle: "按模型覆盖",
3134
3134
  contextOverridesHint: "为单个模型单独设置上下文长度,优先于上面的全局值;模型下拉只列出模型白名单中的可见模型(显示全部时即整个目录)。",
3135
3135
  contextOverrideAdd: "添加模型",
@@ -3141,7 +3141,7 @@ window.__ModuleLoader__.load({
3141
3141
  contextWindowTooLarge: "上下文长度不能大于 10,000,000",
3142
3142
  contextWindowInvalid: "请输入有效的整数 token 数",
3143
3143
  maxOutputTokens: "单轮输出上限",
3144
- maxOutputTokensHint: "每次请求发送的输出预算(token)。留空=按模型自身输出上限推导(默认,行为不变);填正整数=与推导值取较小者,永远不会超过模型上限或网关上限 131072。填 `0`=请求中不发送该字段,把单轮输出规模交回平台自行限制——这是「长回答被硬切」的解法,但仅 CLI 与 OpenAI 两条传输支持;Claude 走的 Messages 端点必填该字段,因此那里仍按推导值发送,填 0 对它无效。会话标题这类由宿主明确限定预算的辅助调用也不受此设置影响。支持 64K 这样的简写。",
3144
+ maxOutputTokensHint: "留空=按模型推导(默认);正整数=不超过模型上限与网关上限 131072;0=不发送该字段(仅 CLI 与 OpenAI 有效,Claude 的 Messages 端点必填)。支持 64K 简写。",
3145
3145
  maxOutputTokensTooSmall: "输出上限不能小于 0(0 表示不发送该字段)",
3146
3146
  maxOutputTokensTooLarge: "输出上限不能大于 131072(网关上限)",
3147
3147
  maxOutputTokensInvalid: "请输入 0 或有效的整数 token 数",
@@ -3279,6 +3279,7 @@ window.__ModuleLoader__.load({
3279
3279
  modelCount: "已选 {count} 个模型",
3280
3280
  modelCatalogFailed: "模型目录获取失败,暂时无法选择模型;已保存的设置仍会生效。",
3281
3281
  modelsTitle: "模型与上下文",
3282
+ modelsInvalid: "模型与上下文中有未填好的数字,请展开修正后再保存。",
3282
3283
  privacyTitle: "隐私与安全",
3283
3284
  integrationsTitle: "集成与显示",
3284
3285
  enrollmentCreating: "正在创建账号",
@@ -3354,7 +3355,7 @@ window.__ModuleLoader__.load({
3354
3355
  visibleModelsStaleHint: "{count} selected model(s) are no longer in the catalog (possibly retired); other models are unaffected. Clean them up or keep them.",
3355
3356
  visibleModelsCleanStale: "Clean stale ({count})",
3356
3357
  contextWindow: "Custom context length",
3357
- contextWindowHint: "Overrides the context window published by the model catalog (in tokens): the context meter, auto-compaction timing and the model-picker annotation all follow it, for every model without a per-model override below. Empty follows the catalog; shorthand like 32K or 1M is accepted (binary units: 32K is 32,768, 1M is 1,048,576).",
3358
+ contextWindowHint: "Overrides the context window published by the model catalog, for every model without an override of its own below; the context meter and auto-compaction follow it. Empty follows the catalog. Shorthand like 32K or 1M is accepted.",
3358
3359
  contextOverridesTitle: "Per-model overrides",
3359
3360
  contextOverridesHint: "Set a context length for one model; it wins over the global value above. The picker lists only the models kept by the visible-models allowlist (the whole catalog while showing all).",
3360
3361
  contextOverrideAdd: "Add model",
@@ -3366,7 +3367,7 @@ window.__ModuleLoader__.load({
3366
3367
  contextWindowTooLarge: "Context length must not exceed 10,000,000",
3367
3368
  contextWindowInvalid: "Enter a valid whole-token count",
3368
3369
  maxOutputTokens: "Output limit per turn",
3369
- maxOutputTokensHint: "The output budget sent with each request, in tokens. Empty derives it from the model’s own ceiling (the default; nothing changes). A positive number is taken as a cap alongside that derived value, so it can never exceed the model ceiling or the gateway’s 131,072. `0` sends no such field at all and leaves the per-turn output size to the platform — the fix for answers being cut short — but only the CLI and OpenAI transports support it: the Messages endpoint Claude uses requires the field, so Claude keeps its derived budget and `0` has no effect there. Auxiliary calls whose budget the host fixes itself, such as the session title, are unaffected too. Shorthand like 64K is accepted.",
3370
+ maxOutputTokensHint: "Empty derives it from the model (default). A positive number never exceeds the model ceiling or the gateway’s 131,072. 0 omits the field (CLI and OpenAI only; Claude’s Messages endpoint requires it). 64K shorthand accepted.",
3370
3371
  maxOutputTokensTooSmall: "Output limit must be at least 0 (0 omits the field)",
3371
3372
  maxOutputTokensTooLarge: "Output limit must not exceed 131,072 (the gateway cap)",
3372
3373
  maxOutputTokensInvalid: "Enter 0 or a valid whole-token count",
@@ -3504,6 +3505,7 @@ window.__ModuleLoader__.load({
3504
3505
  modelCount: "{count} models selected",
3505
3506
  modelCatalogFailed: "The model catalog could not be loaded; saved settings still apply.",
3506
3507
  modelsTitle: "Models & context",
3508
+ modelsInvalid: "A number in Models & context is not ready to save; expand to fix it.",
3507
3509
  privacyTitle: "Privacy & security",
3508
3510
  integrationsTitle: "Integrations & display",
3509
3511
  enrollmentCreating: "Creating the account",
@@ -3702,7 +3704,7 @@ window.__ModuleLoader__.load({
3702
3704
  }
3703
3705
  //#endregion
3704
3706
  //#region package.json
3705
- var version = "0.14.1";
3707
+ var version = "0.14.2";
3706
3708
  var repository = {
3707
3709
  "type": "git",
3708
3710
  "url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
@@ -3892,6 +3894,13 @@ window.__ModuleLoader__.load({
3892
3894
  * below Accounts is a flat group of rows (title/description left, control
3893
3895
  * right) inside the staged form the floating save bar writes.
3894
3896
  *
3897
+ * Two of those groups fold from their own heading — Models & context (issue
3898
+ * #94) and Advanced — and both start collapsed on every visit, with no
3899
+ * remembered state. While a group is collapsed its rows are not on screen, so
3900
+ * anything inside it that blocks the save is reported on the heading itself
3901
+ * (see `CollapsibleGroup`); the save bar alone would leave the disabled Save
3902
+ * button unexplained.
3903
+ *
3895
3904
  * Styles are injected once by the client entry (see src/client/index.ts) and
3896
3905
  * class-prefixed `cc-` to stay local.
3897
3906
  */
@@ -3902,6 +3911,28 @@ window.__ModuleLoader__.load({
3902
3911
  "transportMaxRetries",
3903
3912
  "offloadSeenImagesForCache"
3904
3913
  ];
3914
+ const MODELS_FIELDS = [
3915
+ "filterModelsByPlan",
3916
+ "contextWindow",
3917
+ "maxOutputTokens"
3918
+ ];
3919
+ /**
3920
+ * Whether anything the collapsed Advanced card owns is blocking the save. The
3921
+ * card is folded on arrival, so this drives the warning badge on its heading.
3922
+ */
3923
+ function advancedGroupInvalid(state) {
3924
+ return ADVANCED_FIELDS.some((field) => state[field].invalid);
3925
+ }
3926
+ /**
3927
+ * Whether anything the collapsed Models & context group owns is blocking the
3928
+ * save (issue #94). Besides its staged drafts — the plan switch and the two
3929
+ * numbers — that group owns the per-model context rows, whose drafts are
3930
+ * validated one by one: a bad row must surface on the heading just like a bad
3931
+ * number, or Save would sit disabled with nothing on screen explaining why.
3932
+ */
3933
+ function modelsGroupInvalid(state) {
3934
+ return MODELS_FIELDS.some((field) => state[field].invalid) || state.contextWindowOverrides.some((row) => row.invalid);
3935
+ }
3905
3936
  /** The "customized" tag and reset link a staged field shows once it differs from the default. */
3906
3937
  function FieldOverride({ label, state, disabled, t, onReset }) {
3907
3938
  if (!state.overridden && !state.clear) return null;
@@ -4453,17 +4484,86 @@ window.__ModuleLoader__.load({
4453
4484
  });
4454
4485
  }
4455
4486
  /**
4487
+ * The heading of a foldable group: the whole row is the toggle and the chevron
4488
+ * sits at its trailing edge. Shared by Models & context (issue #94: the
4489
+ * reporter asked for it to fold "like Advanced below") and Advanced itself, so
4490
+ * the two cannot drift apart in either markup or behaviour.
4491
+ *
4492
+ * The title is a `span`, not the `h3` a static group uses, because a heading
4493
+ * element cannot sit inside a button — the same trade-off Advanced has always
4494
+ * made on its own.
4495
+ */
4496
+ function DisclosureHead({ title, bodyId, expanded, onToggle, badges }) {
4497
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4498
+ type: "button",
4499
+ className: "cc-groupHead cc-disclosure",
4500
+ "aria-expanded": expanded,
4501
+ "aria-controls": bodyId,
4502
+ onClick: onToggle,
4503
+ children: [
4504
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4505
+ className: "cc-groupTitle",
4506
+ children: title
4507
+ }),
4508
+ badges?.(expanded),
4509
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cc-spacer" }),
4510
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4511
+ className: expanded ? "cc-chevron cc-chevronUp" : "cc-chevron",
4512
+ "aria-hidden": "true"
4513
+ })
4514
+ ]
4515
+ });
4516
+ }
4517
+ /**
4518
+ * A titled group that folds from its own heading and starts collapsed. The
4519
+ * state is deliberately component-local — not persisted, not lifted into the
4520
+ * controller — so every visit opens at the same, predictable page length, and
4521
+ * folding can never turn into a stored preference the settings document would
4522
+ * have to carry.
4523
+ */
4524
+ function CollapsibleGroup({ title, bodyId, divided = false, badges, footer, children }) {
4525
+ const [expanded, setExpanded] = (0, react.useState)(false);
4526
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4527
+ className: divided ? "cc-group cc-groupDivided" : "cc-group",
4528
+ "aria-label": title,
4529
+ children: [
4530
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DisclosureHead, {
4531
+ title,
4532
+ bodyId,
4533
+ expanded,
4534
+ onToggle: () => setExpanded((value) => !value),
4535
+ badges
4536
+ }),
4537
+ expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4538
+ id: bodyId,
4539
+ className: "cc-rows",
4540
+ children
4541
+ }) : null,
4542
+ expanded ? footer : null
4543
+ ]
4544
+ });
4545
+ }
4546
+ /**
4456
4547
  * Models & context: the plan filter and the allowlist sit together because both
4457
4548
  * decide what the model picker lists (the allowlist applies after the plan
4458
4549
  * filter), and the context-length fields follow them because they are the same
4459
4550
  * subject seen from the other side — the window each listed model advertises.
4460
4551
  * Those fields carry no heading or divider of their own: they are rows of this
4461
- * group, not a section inside it.
4552
+ * group, not a section inside it. The group folds from its heading and starts
4553
+ * collapsed (issue #94, "same as Advanced below"): it is the longest group on
4554
+ * the page and its rows are set-and-forget, so folding keeps Accounts and the
4555
+ * two switches below it reachable without scrolling past the allowlist.
4462
4556
  */
4463
4557
  function ModelsCard({ state, disabled, t, onEdit, onReset, onSelect, onClear, onOverrides }) {
4464
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SettingsGroup, {
4558
+ const invalid = modelsGroupInvalid(state);
4559
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CollapsibleGroup, {
4465
4560
  title: t("modelsTitle"),
4561
+ bodyId: "cc-models-body",
4466
4562
  divided: true,
4563
+ badges: (expanded) => !expanded && invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4564
+ className: "cc-badge cc-badgeWarn",
4565
+ children: t("modelsInvalid")
4566
+ }) : null,
4467
4567
  children: [
4468
4568
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleField, {
4469
4569
  id: "cc-filter-models-by-plan",
@@ -4699,116 +4799,92 @@ window.__ModuleLoader__.load({
4699
4799
  });
4700
4800
  }
4701
4801
  /**
4702
- * The collapsed "Advanced" card: the API base and the network limits. Starts
4703
- * collapsed on every visit; while collapsed, a badge names the customized
4802
+ * The collapsed "Advanced" card: the API base and the network limits. Folds
4803
+ * through the same `CollapsibleGroup` the Models & context group uses, so the
4804
+ * two disclosures stay identical; while collapsed, a badge names the customized
4704
4805
  * count and an invalid number (which blocks save) is surfaced on the header.
4705
4806
  */
4706
4807
  function AdvancedSection({ state, disabled, t, onEdit, onReset }) {
4707
- const [expanded, setExpanded] = (0, react.useState)(false);
4708
4808
  const overridden = ADVANCED_FIELDS.filter((field) => state[field].overridden).length;
4709
- const invalid = ADVANCED_FIELDS.some((field) => state[field].invalid);
4710
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4711
- className: "cc-group cc-groupDivided",
4712
- "aria-label": t("advancedSettings"),
4809
+ const invalid = advancedGroupInvalid(state);
4810
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(CollapsibleGroup, {
4811
+ title: t("advancedSettings"),
4812
+ bodyId: "cc-advanced-body",
4813
+ divided: true,
4814
+ badges: (expanded) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [overridden > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4815
+ className: "cc-badge",
4816
+ children: overridden === 1 ? t("advancedOverriddenOne") : t("advancedOverriddenMany", { count: overridden })
4817
+ }) : null, !expanded && invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4818
+ className: "cc-badge cc-badgeWarn",
4819
+ children: t("advancedInvalid")
4820
+ }) : null] }),
4821
+ footer: invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4822
+ className: "cc-rowError",
4823
+ role: "status",
4824
+ children: t("advancedInvalid")
4825
+ }) : null,
4713
4826
  children: [
4714
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4715
- type: "button",
4716
- className: "cc-groupHead cc-disclosure",
4717
- "aria-expanded": expanded,
4718
- "aria-controls": "cc-advanced-body",
4719
- onClick: () => setExpanded((value) => !value),
4720
- children: [
4721
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4722
- className: "cc-groupTitle",
4723
- children: t("advancedSettings")
4724
- }),
4725
- overridden > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4726
- className: "cc-badge",
4727
- children: overridden === 1 ? t("advancedOverriddenOne") : t("advancedOverriddenMany", { count: overridden })
4728
- }) : null,
4729
- !expanded && invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4730
- className: "cc-badge cc-badgeWarn",
4731
- children: t("advancedInvalid")
4732
- }) : null,
4733
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "cc-spacer" }),
4734
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
4735
- className: expanded ? "cc-chevron cc-chevronUp" : "cc-chevron",
4736
- "aria-hidden": "true"
4737
- })
4738
- ]
4827
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4828
+ className: "cc-groupDesc",
4829
+ children: t("advancedSettingsHint")
4739
4830
  }),
4740
- expanded ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4741
- id: "cc-advanced-body",
4742
- className: "cc-rows",
4743
- children: [
4744
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4745
- className: "cc-groupDesc",
4746
- children: t("advancedSettingsHint")
4747
- }),
4748
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4749
- id: "cc-api-base",
4750
- label: t("apiBase"),
4751
- hint: t("apiBaseHint"),
4752
- state: state.apiBase,
4753
- disabled,
4754
- wide: true,
4755
- onEdit: (text) => onEdit("apiBase", text),
4756
- onReset: () => onReset("apiBase"),
4757
- t
4758
- }),
4759
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4760
- id: "cc-request-timeout",
4761
- label: t("requestTimeoutMs"),
4762
- hint: t("requestTimeoutMsHint"),
4763
- state: state.requestTimeoutMs,
4764
- disabled,
4765
- numeric: true,
4766
- decimal: true,
4767
- onEdit: (text) => onEdit("requestTimeoutMs", text),
4768
- onReset: () => onReset("requestTimeoutMs"),
4769
- t
4770
- }),
4771
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4772
- id: "cc-stream-idle-timeout",
4773
- label: t("streamIdleTimeoutMs"),
4774
- hint: t("streamIdleTimeoutMsHint"),
4775
- state: state.streamIdleTimeoutMs,
4776
- disabled,
4777
- numeric: true,
4778
- decimal: true,
4779
- onEdit: (text) => onEdit("streamIdleTimeoutMs", text),
4780
- onReset: () => onReset("streamIdleTimeoutMs"),
4781
- t
4782
- }),
4783
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4784
- id: "cc-transport-max-retries",
4785
- label: t("transportMaxRetries"),
4786
- hint: t("transportMaxRetriesHint"),
4787
- state: state.transportMaxRetries,
4788
- disabled,
4789
- numeric: true,
4790
- onEdit: (text) => onEdit("transportMaxRetries", text),
4791
- onReset: () => onReset("transportMaxRetries"),
4792
- t
4793
- }),
4794
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleField, {
4795
- id: "cc-offload-seen-images-for-cache",
4796
- label: t("offloadSeenImagesForCache"),
4797
- hint: t("offloadSeenImagesForCacheHint"),
4798
- state: state.offloadSeenImagesForCache,
4799
- disabled,
4800
- defaultChecked: false,
4801
- onEdit: (text) => onEdit("offloadSeenImagesForCache", text),
4802
- onReset: () => onReset("offloadSeenImagesForCache"),
4803
- t
4804
- })
4805
- ]
4806
- }) : null,
4807
- expanded && invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4808
- className: "cc-rowError",
4809
- role: "status",
4810
- children: t("advancedInvalid")
4811
- }) : null
4831
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4832
+ id: "cc-api-base",
4833
+ label: t("apiBase"),
4834
+ hint: t("apiBaseHint"),
4835
+ state: state.apiBase,
4836
+ disabled,
4837
+ wide: true,
4838
+ onEdit: (text) => onEdit("apiBase", text),
4839
+ onReset: () => onReset("apiBase"),
4840
+ t
4841
+ }),
4842
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4843
+ id: "cc-request-timeout",
4844
+ label: t("requestTimeoutMs"),
4845
+ hint: t("requestTimeoutMsHint"),
4846
+ state: state.requestTimeoutMs,
4847
+ disabled,
4848
+ numeric: true,
4849
+ decimal: true,
4850
+ onEdit: (text) => onEdit("requestTimeoutMs", text),
4851
+ onReset: () => onReset("requestTimeoutMs"),
4852
+ t
4853
+ }),
4854
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4855
+ id: "cc-stream-idle-timeout",
4856
+ label: t("streamIdleTimeoutMs"),
4857
+ hint: t("streamIdleTimeoutMsHint"),
4858
+ state: state.streamIdleTimeoutMs,
4859
+ disabled,
4860
+ numeric: true,
4861
+ decimal: true,
4862
+ onEdit: (text) => onEdit("streamIdleTimeoutMs", text),
4863
+ onReset: () => onReset("streamIdleTimeoutMs"),
4864
+ t
4865
+ }),
4866
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
4867
+ id: "cc-transport-max-retries",
4868
+ label: t("transportMaxRetries"),
4869
+ hint: t("transportMaxRetriesHint"),
4870
+ state: state.transportMaxRetries,
4871
+ disabled,
4872
+ numeric: true,
4873
+ onEdit: (text) => onEdit("transportMaxRetries", text),
4874
+ onReset: () => onReset("transportMaxRetries"),
4875
+ t
4876
+ }),
4877
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToggleField, {
4878
+ id: "cc-offload-seen-images-for-cache",
4879
+ label: t("offloadSeenImagesForCache"),
4880
+ hint: t("offloadSeenImagesForCacheHint"),
4881
+ state: state.offloadSeenImagesForCache,
4882
+ disabled,
4883
+ defaultChecked: false,
4884
+ onEdit: (text) => onEdit("offloadSeenImagesForCache", text),
4885
+ onReset: () => onReset("offloadSeenImagesForCache"),
4886
+ t
4887
+ })
4812
4888
  ]
4813
4889
  });
4814
4890
  }