@codexhost/cli-linux-arm64 0.18.0-beta.4 → 0.18.0
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/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +98 -55
- package/app/console-web.js +276 -188
- package/app/desktop-controller.mjs +283 -113
- package/app/host-runtime.mjs +2129 -1529
- package/app/plugins/antigravity/plugin.mjs +787 -303
- package/app/plugins/claude-code/plugin.mjs +85 -45
- package/app/plugins/codebuddy/plugin.mjs +99 -59
- package/app/plugins/codex-usage/plugin.mjs +85 -45
- package/app/plugins/copilot/plugin.mjs +90 -50
- package/app/plugins/cursor-cli/plugin.mjs +113 -73
- package/app/plugins/deepseek-harness/plugin.mjs +116 -76
- package/app/plugins/devin/plugin.mjs +90 -50
- package/app/plugins/grok/plugin.mjs +96 -56
- package/app/plugins/hermes/plugin.mjs +77 -37
- package/app/plugins/kimi-code/plugin.mjs +94 -54
- package/app/plugins/kiro-cli/plugin.mjs +90 -50
- package/app/plugins/omp/plugin.mjs +81 -41
- package/app/plugins/opencode/plugin.mjs +78 -38
- package/app/plugins/pi/plugin.mjs +94 -54
- package/app/plugins/qoder/plugin.mjs +106 -66
- package/app/plugins/qoder-cn/plugin.mjs +106 -66
- package/app/plugins/qwen-code/plugin.mjs +101 -61
- package/app/plugins/workbuddy/plugin.mjs +99 -59
- package/app/plugins/zcode/plugin.mjs +82 -42
- package/app/renderer-extension.js +435 -361
- package/app/web/assets/{index-D1dOzBMI.js → index-C0aXz2jD.js} +63 -63
- package/app/web/codex-agent.png +0 -0
- package/app/web/codexhost-settings.js +229 -175
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +61 -61
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +12 -12
- package/app/web/plugins/deepseek-ai__dsh-client-ui-permission-presets/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
- package/app/web/sw.js +41 -6
- package/app/web-modules/server.mjs +2079 -1201
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-permission-presets`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("react"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("react/jsx-runtime");function o(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=o(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function s(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=o(e))&&(r&&(r+=` `),r+=t);return r}let c=`permission.access`,l={mode:`访问模式,当前:{name}`,"codex.:read-only":`只读`,"codex.:workspace":`工作区写入`,"codex.:danger-full-access":`完全访问`,"native.configuration":`原生配置`,"native.configuration.description":`使用 Harness 原生权限配置,尚未匹配到已确认的权限模式。`,"native.atCreate":`此 Harness 仅允许在创建原生会话前选择权限模式。`,"native.confirm.title":`启用 {name}?`,"native.confirm.description":`此原生模式可能跳过权限确认,请确认你信任当前任务。`,"native.confirm.enable":`启用此模式`,"native.error":`权限切换失败:{message}`,close:`关闭`,"preset.readOnly":`仅可查看`,"preset.workspaceWrite":`工作区内修改`,"preset.fullAccess":`完全权限`,"confirm.title":`确认启用完全权限?`,"confirm.description":`启用完全权限后,智能体将减少确认步骤,并且可以直接执行更多操作,包括敏感操作、文件修改或外部命令。仅建议在你信任当前任务时使用。`,"confirm.acknowledge":`我已了解风险,并愿意继续`,"confirm.cancel":`取消`,"confirm.enable":`启用完全权限`,"auto.label":`Auto review`,"auto.badge":`EXP`,"auto.description":`无沙箱运行;每次原生工具调用和 PTC 内层调用前由同一模型进行实验性审查。`,"auto.confirm.title":`确认启用 Auto review(实验)?`,"auto.confirm.description":`Auto review 不使用沙箱。每次原生工具调用和 PTC 内层调用前,都会由与当前 agent 相同的模型进行审查;审查拒绝的调用由你批准或拒绝。此功能仍属实验性,可能误放行或误拒绝,并会消耗额外 token。`,"auto.confirm.acknowledge":`我已了解这些风险,并愿意继续`,"auto.confirm.enable":`启用 Auto review`},u={mode:`Access mode, current: {name}`,"codex.:read-only":`Read only`,"codex.:workspace":`Workspace write`,"codex.:danger-full-access":`Full access`,"native.configuration":`Native configuration`,"native.configuration.description":`Using the Harness's native permissions; no confirmed permission mode matches the catalog.`,"native.atCreate":`This Harness only allows permission selection before creating its native session.`,"native.confirm.title":`Enable {name}?`,"native.confirm.description":`This native mode may skip permission checks. Only enable it for a trusted task.`,"native.confirm.enable":`Enable mode`,"native.error":`Permission switch failed: {message}`,close:`Close`,"preset.readOnly":`Read Only`,"preset.workspaceWrite":`Workspace Write`,"preset.fullAccess":`Full access`,"confirm.title":`Enable Full access?`,"confirm.description":`Full access reduces confirmation steps and lets the agent perform more actions directly, including sensitive operations, file changes, or external commands. Only use it when you trust the current task.`,"confirm.acknowledge":`I understand the risks and want to continue`,"confirm.cancel":`Cancel`,"confirm.enable":`Enable Full access`,"auto.label":`Auto review`,"auto.badge":`EXP`,"auto.description":`Run without a sandbox after an experimental same-model review of every native tool call and PTC inner call.`,"auto.confirm.title":`Enable Auto review (experimental)?`,"auto.confirm.description":`Auto review runs without a sandbox. Before every native tool call and PTC inner call, the same model as the current agent reviews whether to allow it; you approve or reject each call it denies. This feature is experimental, can falsely allow or deny actions, and uses additional tokens.`,"auto.confirm.acknowledge":`I understand these risks and want to continue`,"auto.confirm.enable":`Enable Auto review`},d=`@deepseek-ai/dsh-client-ui-permission-presets/PermissionSelect.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(d)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-permission-presets`,e.dataset.pluginCss=d,e.textContent=`.DWdtSq_trigger{border-radius:var(--dsw-radius-sm);min-width:0;max-width:220px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:500;line-height:20px;display:inline-flex}.DWdtSq_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.DWdtSq_trigger.DWdtSq_triggerDangerous:not(:disabled){color:#f28048}.DWdtSq_trigger.DWdtSq_triggerDangerous .DWdtSq_chevron{color:inherit;opacity:.7}.DWdtSq_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary))}.DWdtSq_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}.DWdtSq_triggerIcon{flex:none;display:inline-flex}.DWdtSq_triggerIcon svg{width:14px;height:14px}.DWdtSq_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.DWdtSq_optionLabel{align-items:baseline;gap:4px;min-width:0;max-width:100%;display:inline-flex}.DWdtSq_optionLabelText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.DWdtSq_badge{color:var(--dsw-alias-label-tertiary);letter-spacing:.2px;flex:none;align-self:flex-start;margin-top:-1px;font-size:8px;font-weight:600;line-height:10px}.DWdtSq_chevron{color:var(--dsw-alias-label-caption);flex:none;transition:transform .12s;display:inline-flex}@container (width<=460px){.DWdtSq_trigger:has(.DWdtSq_triggerIcon) .DWdtSq_triggerLabel{display:none}}.DWdtSq_chevronOpen{transform:rotate(180deg)}.DWdtSq_optionCopy{white-space:normal;text-align:left;flex-direction:column;gap:3px;min-width:0;max-width:270px;display:flex}.DWdtSq_description{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.DWdtSq_dangerous{color:var(--dsw-alias-state-danger-primary,#c2413b)}`,document.head.appendChild(e)}var f={badge:`DWdtSq_badge`,chevron:`DWdtSq_chevron`,chevronOpen:`DWdtSq_chevronOpen`,dangerous:`DWdtSq_dangerous`,description:`DWdtSq_description`,optionCopy:`DWdtSq_optionCopy`,optionLabel:`DWdtSq_optionLabel`,optionLabelText:`DWdtSq_optionLabelText`,trigger:`DWdtSq_trigger`,triggerDangerous:`DWdtSq_triggerDangerous`,triggerIcon:`DWdtSq_triggerIcon`,triggerLabel:`DWdtSq_triggerLabel`};let p=()=>/* @__PURE__ */ (0,a.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[/* @__PURE__ */ (0,a.jsx)(`path`,{d:`M8 1.75 2.75 3.6v3.9c0 3.1 2.1 5.4 5.25 6.75 3.15-1.35 5.25-3.65 5.25-6.75V3.6L8 1.75Z`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinejoin:`round`}),/* @__PURE__ */ (0,a.jsx)(`path`,{d:`M8 5.6v3`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`}),/* @__PURE__ */ (0,a.jsx)(`circle`,{cx:`8`,cy:`10.6`,r:`0.75`,fill:`currentColor`})]});function m({locked:e,select:t,useProjection:n,t:o}){let c=n(`permissions`),l=n(`nativePermissions`),[d,m]=(0,r.useState)(null),[h,g]=(0,r.useState)(!1),[_,v]=(0,r.useState)(null),[y,b]=(0,r.useState)(!1),[x,S]=(0,r.useState)(null),C=e||l?.locked===!0;if((0,r.useEffect)(()=>{(C||!l?.selectable||!l.catalog||_!==null&&!l.catalog.modes.some(e=>e.id===_.id))&&(g(!1),v(null),b(!1))},[l,C,_]),c===void 0||!l?.selectable||l.catalog===null)return null;let w=l.catalog.modes.map(e=>{let t=`codex.${e.id}`;return l.harnessId===`codex`&&Object.hasOwn(u,t)?{...e,label:o(t)}:e}),T=w.find(e=>e.id===c.currentValue),E=T?.label??o(`native.configuration`),D=d!==null||_!==null,O=()=>{b(!1),v(null)},k=e=>{m(e),t(e).catch(e=>{let t=e instanceof Error?e.message:String(e);S(e=>({text:t,seq:(e?.seq??0)+1}))}).finally(()=>m(null))};return/* @__PURE__ */ (0,a.jsxs)(a.Fragment,{children:[/* @__PURE__ */ (0,a.jsx)(i.Menu,{open:h,portal:!0,side:`top`,selectedId:c.currentValue,items:w.map(e=>({id:e.id,label:/* @__PURE__ */ (0,a.jsxs)(`span`,{className:s(f.optionCopy,e.dangerous&&f.dangerous),children:[/* @__PURE__ */ (0,a.jsx)(`span`,{children:e.label}),e.description?/* @__PURE__ */ (0,a.jsx)(`span`,{className:f.description,children:e.description}):null]}),...e.dangerous?{icon:/* @__PURE__ */ (0,a.jsx)(i.IconWarningOutlineRegular,{size:16})}:{}})),onSelect:e=>{if(g(!1),C||D||e===c.currentValue)return;let t=w.find(t=>t.id===e);t&&(t.dangerous?(b(!1),v(t)):k(e))},onClose:()=>g(!1),footer:l.scope===`atCreate`?[{type:`label`,id:`scope`,text:o(`native.atCreate`)}]:[],anchor:/* @__PURE__ */ (0,a.jsxs)(`button`,{type:`button`,className:s(f.trigger,T?.dangerous&&f.triggerDangerous),"aria-label":o(`mode`,{name:E}),title:l.locked?o(`native.atCreate`):T?T.description:o(`native.configuration.description`),disabled:C||D,onClick:()=>g(!h),children:[/* @__PURE__ */ (0,a.jsx)(`span`,{className:f.triggerIcon,children:T?.dangerous?/* @__PURE__ */ (0,a.jsx)(p,{}):/* @__PURE__ */ (0,a.jsx)(i.IconShieldOutlineRegular,{})}),/* @__PURE__ */ (0,a.jsx)(`span`,{className:f.triggerLabel,children:E}),/* @__PURE__ */ (0,a.jsx)(`span`,{className:s(f.chevron,h&&f.chevronOpen),children:/* @__PURE__ */ (0,a.jsx)(i.IconChevronDownOutlineRegular,{})})]})}),_?/* @__PURE__ */ (0,a.jsx)(i.RiskConfirmation,{open:!0,title:o(`native.confirm.title`,{name:_.label}),description:_.description??o(`native.confirm.description`),acknowledgeLabel:o(`confirm.acknowledge`),cancelLabel:o(`confirm.cancel`),closeLabel:o(`close`),confirmLabel:o(`native.confirm.enable`),acknowledged:y,disabled:C,onAcknowledgedChange:b,onCancel:O,onConfirm:()=>{let e=_.id;O(),k(e)}}):null,x?/* @__PURE__ */ (0,a.jsx)(i.Toast,{text:o(`native.error`,{message:x.text}),icon:/* @__PURE__ */ (0,a.jsx)(i.IconWarningOutlineRegular,{}),onDone:()=>S(null)},x.seq):null]})}let h=[`commandUi`,`sessions`,`slots`,`locale`,`remote`,`remote.commands`];function g(e){return e?.projections.faceOf(`nativePermissions`).getSnapshot()}function _(e){let t=e.get(`commandUi`),n=e.sessions;e.effect(()=>e.locale.register(c,{zh:l,en:u}),`ui-permission: native dictionaries`);let r=e.locale.bind(c),i=async(t,r)=>{if(n.binding(t)===void 0)throw Error(`This session is not materialized yet.`);let i=g(n.binding(t)?.session);if(!i?.selectable||i.locked||!i.catalog?.modes.some(e=>e.id===r))throw Error(`Native permission mode selection is unavailable for this session.`);let a=await e.remote.commands.execute(t,`/permission ${r}`,[]);if(!a.ok)throw Error(a.error.message);if(a.value===void 0)throw Error(`The Host offers no /permission command.`);if(a.value.result?.kind===`error`)throw Error(a.value.result.text??`Native permission switch failed.`);return!0};e.slots.inject(`conversation.input.permission`,()=>e.slots.register({name:`conversation.input.permission`,locale:c,inject:e=>({select:t=>i(e,t)})},m)),e.effect(()=>t.decorate({name:`permission`,available:e=>{let t=g(n.binding(e.sessionId)?.session);return t?.selectable===!0&&!t.locked},ui:{kind:`popupSelect`,options:async e=>{let t=n.binding(e.sessionId)?.session,i=g(t);if(!i?.selectable||i.locked||!i.catalog)throw Error(`Native permissions unavailable.`);let a=t?.projections.faceOf(`permissions`).getSnapshot();return i.catalog.modes.map(e=>({id:e.id,label:e.label,...e.description?{detail:e.description}:{},...e.id===a?.currentValue?{active:!0}:{},...e.dangerous?{confirmation:{title:r(`native.confirm.title`,{name:e.label}),description:e.description??r(`native.confirm.description`),acknowledgeLabel:r(`confirm.acknowledge`),cancelLabel:r(`confirm.cancel`),confirmLabel:r(`native.confirm.enable`)}}:{}}))},onSelect:(e,t)=>i(t.sessionId,e.id).then(()=>void 0)}}),`ui-permission: native /permission picker`)}return n.apply=_,n.inject=h,t.exports}});
|
|
1
|
+
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-permission-presets`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("react"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("react/jsx-runtime");function o(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=o(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function s(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=o(e))&&(r&&(r+=` `),r+=t);return r}let c=`permission.access`,l={mode:`访问模式,当前:{name}`,"codex.:read-only":`只读`,"codex.:workspace":`工作区写入`,"codex.:danger-full-access":`完全访问`,"codex.configuration":`跟随 Codex 设置`,"codex.configuration.description":`未选择权限档案,由 Codex 当前配置决定。`,"native.configuration":`原生配置`,"native.configuration.description":`使用 Harness 原生权限配置,尚未匹配到已确认的权限模式。`,"native.atCreate":`此 Harness 仅允许在创建原生会话前选择权限模式。`,"native.confirm.title":`启用 {name}?`,"native.confirm.description":`此原生模式可能跳过权限确认,请确认你信任当前任务。`,"native.confirm.enable":`启用此模式`,"native.error":`权限切换失败:{message}`,close:`关闭`,"preset.readOnly":`仅可查看`,"preset.workspaceWrite":`工作区内修改`,"preset.fullAccess":`完全权限`,"confirm.title":`确认启用完全权限?`,"confirm.description":`启用完全权限后,智能体将减少确认步骤,并且可以直接执行更多操作,包括敏感操作、文件修改或外部命令。仅建议在你信任当前任务时使用。`,"confirm.acknowledge":`我已了解风险,并愿意继续`,"confirm.cancel":`取消`,"confirm.enable":`启用完全权限`,"auto.label":`Auto review`,"auto.badge":`EXP`,"auto.description":`无沙箱运行;每次原生工具调用和 PTC 内层调用前由同一模型进行实验性审查。`,"auto.confirm.title":`确认启用 Auto review(实验)?`,"auto.confirm.description":`Auto review 不使用沙箱。每次原生工具调用和 PTC 内层调用前,都会由与当前 agent 相同的模型进行审查;审查拒绝的调用由你批准或拒绝。此功能仍属实验性,可能误放行或误拒绝,并会消耗额外 token。`,"auto.confirm.acknowledge":`我已了解这些风险,并愿意继续`,"auto.confirm.enable":`启用 Auto review`},u={mode:`Access mode, current: {name}`,"codex.:read-only":`Read only`,"codex.:workspace":`Workspace write`,"codex.:danger-full-access":`Full access`,"codex.configuration":`Follow Codex settings`,"codex.configuration.description":`No permission profile is selected; Codex applies its current configuration.`,"native.configuration":`Native configuration`,"native.configuration.description":`Using the Harness's native permissions; no confirmed permission mode matches the catalog.`,"native.atCreate":`This Harness only allows permission selection before creating its native session.`,"native.confirm.title":`Enable {name}?`,"native.confirm.description":`This native mode may skip permission checks. Only enable it for a trusted task.`,"native.confirm.enable":`Enable mode`,"native.error":`Permission switch failed: {message}`,close:`Close`,"preset.readOnly":`Read Only`,"preset.workspaceWrite":`Workspace Write`,"preset.fullAccess":`Full access`,"confirm.title":`Enable Full access?`,"confirm.description":`Full access reduces confirmation steps and lets the agent perform more actions directly, including sensitive operations, file changes, or external commands. Only use it when you trust the current task.`,"confirm.acknowledge":`I understand the risks and want to continue`,"confirm.cancel":`Cancel`,"confirm.enable":`Enable Full access`,"auto.label":`Auto review`,"auto.badge":`EXP`,"auto.description":`Run without a sandbox after an experimental same-model review of every native tool call and PTC inner call.`,"auto.confirm.title":`Enable Auto review (experimental)?`,"auto.confirm.description":`Auto review runs without a sandbox. Before every native tool call and PTC inner call, the same model as the current agent reviews whether to allow it; you approve or reject each call it denies. This feature is experimental, can falsely allow or deny actions, and uses additional tokens.`,"auto.confirm.acknowledge":`I understand these risks and want to continue`,"auto.confirm.enable":`Enable Auto review`},d=`@deepseek-ai/dsh-client-ui-permission-presets/PermissionSelect.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(d)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-permission-presets`,e.dataset.pluginCss=d,e.textContent=`.DWdtSq_trigger{border-radius:var(--dsw-radius-sm);min-width:0;max-width:220px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:500;line-height:20px;display:inline-flex}.DWdtSq_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.DWdtSq_trigger.DWdtSq_triggerDangerous:not(:disabled){color:#f28048}.DWdtSq_trigger.DWdtSq_triggerDangerous .DWdtSq_chevron{color:inherit;opacity:.7}.DWdtSq_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary))}.DWdtSq_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}.DWdtSq_triggerIcon{flex:none;display:inline-flex}.DWdtSq_triggerIcon svg{width:14px;height:14px}.DWdtSq_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.DWdtSq_optionLabel{align-items:baseline;gap:4px;min-width:0;max-width:100%;display:inline-flex}.DWdtSq_optionLabelText{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.DWdtSq_badge{color:var(--dsw-alias-label-tertiary);letter-spacing:.2px;flex:none;align-self:flex-start;margin-top:-1px;font-size:8px;font-weight:600;line-height:10px}.DWdtSq_chevron{color:var(--dsw-alias-label-caption);flex:none;transition:transform .12s;display:inline-flex}@container (width<=460px){.DWdtSq_trigger:has(.DWdtSq_triggerIcon) .DWdtSq_triggerLabel{display:none}}.DWdtSq_chevronOpen{transform:rotate(180deg)}.DWdtSq_optionCopy{white-space:normal;text-align:left;flex-direction:column;gap:3px;min-width:0;max-width:270px;display:flex}.DWdtSq_description{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.DWdtSq_dangerous{color:var(--dsw-alias-state-danger-primary,#c2413b)}`,document.head.appendChild(e)}var f={badge:`DWdtSq_badge`,chevron:`DWdtSq_chevron`,chevronOpen:`DWdtSq_chevronOpen`,dangerous:`DWdtSq_dangerous`,description:`DWdtSq_description`,optionCopy:`DWdtSq_optionCopy`,optionLabel:`DWdtSq_optionLabel`,optionLabelText:`DWdtSq_optionLabelText`,trigger:`DWdtSq_trigger`,triggerDangerous:`DWdtSq_triggerDangerous`,triggerIcon:`DWdtSq_triggerIcon`,triggerLabel:`DWdtSq_triggerLabel`};let p=()=>/* @__PURE__ */ (0,a.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,"aria-hidden":`true`,children:[/* @__PURE__ */ (0,a.jsx)(`path`,{d:`M8 1.75 2.75 3.6v3.9c0 3.1 2.1 5.4 5.25 6.75 3.15-1.35 5.25-3.65 5.25-6.75V3.6L8 1.75Z`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinejoin:`round`}),/* @__PURE__ */ (0,a.jsx)(`path`,{d:`M8 5.6v3`,stroke:`currentColor`,strokeWidth:`1.2`,strokeLinecap:`round`}),/* @__PURE__ */ (0,a.jsx)(`circle`,{cx:`8`,cy:`10.6`,r:`0.75`,fill:`currentColor`})]});function m({locked:e,select:t,useProjection:n,t:o}){let c=n(`permissions`),l=n(`nativePermissions`),[d,m]=(0,r.useState)(null),[h,g]=(0,r.useState)(!1),[_,v]=(0,r.useState)(null),[y,b]=(0,r.useState)(!1),[x,S]=(0,r.useState)(null),C=e||l?.locked===!0;if((0,r.useEffect)(()=>{(C||!l?.selectable||!l.catalog||_!==null&&!l.catalog.modes.some(e=>e.id===_.id))&&(g(!1),v(null),b(!1))},[l,C,_]),c===void 0||!l?.selectable||l.catalog===null)return null;let w=l.catalog.modes.map(e=>{let t=`codex.${e.id}`;return l.harnessId===`codex`&&Object.hasOwn(u,t)?{...e,label:o(t)}:e}),T=w.find(e=>e.id===c.currentValue),E=l.harnessId===`codex`&&c.currentValue===``,D=T?.label??o(E?`codex.configuration`:`native.configuration`),O=o(E?`codex.configuration.description`:`native.configuration.description`),k=d!==null||_!==null,A=()=>{b(!1),v(null)},j=e=>{m(e),t(e).catch(e=>{let t=e instanceof Error?e.message:String(e);S(e=>({text:t,seq:(e?.seq??0)+1}))}).finally(()=>m(null))};return/* @__PURE__ */ (0,a.jsxs)(a.Fragment,{children:[/* @__PURE__ */ (0,a.jsx)(i.Menu,{open:h,portal:!0,side:`top`,selectedId:c.currentValue,items:w.map(e=>({id:e.id,label:/* @__PURE__ */ (0,a.jsxs)(`span`,{className:s(f.optionCopy,e.dangerous&&f.dangerous),children:[/* @__PURE__ */ (0,a.jsx)(`span`,{children:e.label}),e.description?/* @__PURE__ */ (0,a.jsx)(`span`,{className:f.description,children:e.description}):null]}),...e.dangerous?{icon:/* @__PURE__ */ (0,a.jsx)(i.IconWarningOutlineRegular,{size:16})}:{}})),onSelect:e=>{if(g(!1),C||k||e===c.currentValue)return;let t=w.find(t=>t.id===e);t&&(t.dangerous?(b(!1),v(t)):j(e))},onClose:()=>g(!1),footer:l.scope===`atCreate`?[{type:`label`,id:`scope`,text:o(`native.atCreate`)}]:[],anchor:/* @__PURE__ */ (0,a.jsxs)(`button`,{type:`button`,className:s(f.trigger,T?.dangerous&&f.triggerDangerous),"aria-label":o(`mode`,{name:D}),title:l.locked?o(`native.atCreate`):T?T.description:O,disabled:C||k,onClick:()=>g(!h),children:[/* @__PURE__ */ (0,a.jsx)(`span`,{className:f.triggerIcon,children:T?.dangerous?/* @__PURE__ */ (0,a.jsx)(p,{}):/* @__PURE__ */ (0,a.jsx)(i.IconShieldOutlineRegular,{})}),/* @__PURE__ */ (0,a.jsx)(`span`,{className:f.triggerLabel,children:D}),/* @__PURE__ */ (0,a.jsx)(`span`,{className:s(f.chevron,h&&f.chevronOpen),children:/* @__PURE__ */ (0,a.jsx)(i.IconChevronDownOutlineRegular,{})})]})}),_?/* @__PURE__ */ (0,a.jsx)(i.RiskConfirmation,{open:!0,title:o(`native.confirm.title`,{name:_.label}),description:_.description??o(`native.confirm.description`),acknowledgeLabel:o(`confirm.acknowledge`),cancelLabel:o(`confirm.cancel`),closeLabel:o(`close`),confirmLabel:o(`native.confirm.enable`),acknowledged:y,disabled:C,onAcknowledgedChange:b,onCancel:A,onConfirm:()=>{let e=_.id;A(),j(e)}}):null,x?/* @__PURE__ */ (0,a.jsx)(i.Toast,{text:o(`native.error`,{message:x.text}),icon:/* @__PURE__ */ (0,a.jsx)(i.IconWarningOutlineRegular,{}),onDone:()=>S(null)},x.seq):null]})}let h=[`commandUi`,`sessions`,`slots`,`locale`,`remote`,`remote.commands`];function g(e){return e?.projections.faceOf(`nativePermissions`).getSnapshot()}function _(e){let t=e.get(`commandUi`),n=e.sessions;e.effect(()=>e.locale.register(c,{zh:l,en:u}),`ui-permission: native dictionaries`);let r=e.locale.bind(c),i=async(t,r)=>{if(n.binding(t)===void 0)throw Error(`This session is not materialized yet.`);let i=g(n.binding(t)?.session);if(!i?.selectable||i.locked||!i.catalog?.modes.some(e=>e.id===r))throw Error(`Native permission mode selection is unavailable for this session.`);let a=await e.remote.commands.execute(t,`/permission ${r}`,[]);if(!a.ok)throw Error(a.error.message);if(a.value===void 0)throw Error(`The Host offers no /permission command.`);if(a.value.result?.kind===`error`)throw Error(a.value.result.text??`Native permission switch failed.`);return!0};e.slots.inject(`conversation.input.permission`,()=>e.slots.register({name:`conversation.input.permission`,locale:c,inject:e=>({select:t=>i(e,t)})},m)),e.effect(()=>t.decorate({name:`permission`,available:e=>{let t=g(n.binding(e.sessionId)?.session);return t?.selectable===!0&&!t.locked},ui:{kind:`popupSelect`,options:async e=>{let t=n.binding(e.sessionId)?.session,i=g(t);if(!i?.selectable||i.locked||!i.catalog)throw Error(`Native permissions unavailable.`);let a=t?.projections.faceOf(`permissions`).getSnapshot();return i.catalog.modes.map(e=>({id:e.id,label:e.label,...e.description?{detail:e.description}:{},...e.id===a?.currentValue?{active:!0}:{},...e.dangerous?{confirmation:{title:r(`native.confirm.title`,{name:e.label}),description:e.description??r(`native.confirm.description`),acknowledgeLabel:r(`confirm.acknowledge`),cancelLabel:r(`confirm.cancel`),confirmLabel:r(`native.confirm.enable`)}}:{}}))},onSelect:(e,t)=>i(t.sessionId,e.id).then(()=>void 0)}}),`ui-permission: native /permission picker`)}return n.apply=_,n.inject=h,t.exports}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-settings`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("@deepseek-ai/cordis"),i=e("@deepseek-ai/dsh-client-store");function a(e){return e==null}function o(e){return e&&typeof e==`object`&&!Array.isArray(e)}function s(e,t){return Object.fromEntries(Object.entries(e).filter(([e,n])=>t(e,n)))}function c(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n,e)]))}function l(e,t,n){if(!t)return{...e};let r={};for(let i of t)(n||e[i]!==void 0)&&(r[i]=e[i]);return r}let u=Symbol.for(`cosmokit.volatile.write`);function d(e,t=/* @__PURE__ */ new Set){if(typeof e==`function`)throw TypeError(`volatile config cannot contain functions`);if(typeof e!=`object`||!e)return e;if(t.has(e))throw TypeError(`volatile config cannot contain cycles`);t.add(e);try{if(Array.isArray(e))return Object.freeze(e.map(e=>d(e,t)));if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`volatile config objects must be plain objects or arrays`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,n])=>[e,d(n,t)])))}finally{t.delete(e)}}function f(e){let t=d(e);return Object.freeze({get:()=>t,[u]:e=>{t=e}})}function p(e){return typeof e==`object`&&!!e&&u in e}function m(e,t){return arguments.length===1?t=>m(e,t):e in globalThis&&t instanceof globalThis[e]||Object.prototype.toString.call(t).slice(8,-1)===e}function h(e){return m(`ArrayBuffer`,e)||m(`SharedArrayBuffer`,e)}function g(e){return h(e)||ArrayBuffer.isView(e)}let _;(function(e){e.is=h,e.isSource=g;function t(e){return ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e}e.fromSource=t;function n(e){if(e=t(e),typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let n=``,r=new Uint8Array(e);for(let e=0;e<r.byteLength;e++)n+=String.fromCharCode(r[e]);return btoa(n)}e.toBase64=n;function r(e){return typeof Buffer<`u`?t(Buffer.from(e,`base64`)):Uint8Array.from(atob(e),e=>e.charCodeAt(0))}e.fromBase64=r;function i(e){return e=t(e),typeof Buffer<`u`?Buffer.from(e).toString(`hex`):Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``)}e.toHex=i;function a(e){if(typeof Buffer<`u`)return t(Buffer.from(e,`hex`));let n=e.length%2==0?e:e.slice(0,e.length-1),r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(`${n[e]}${n[e+1]}`,16));return Uint8Array.from(r).buffer}e.fromHex=a})(_||={}),_.fromBase64,_.toBase64,_.fromHex,_.toHex;function v(e,t=/* @__PURE__ */ new Map){if(!e||typeof e!=`object`)return e;if(m(`Date`,e))return new Date(e.valueOf());if(m(`RegExp`,e))return new RegExp(e.source,e.flags);if(h(e))return e.slice(0);if(ArrayBuffer.isView(e))return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);let n=t.get(e);if(n)return n;if(Array.isArray(e)){let n=[];return t.set(e,n),e.forEach((e,r)=>{n[r]=Reflect.apply(v,null,[e,t])}),n}let r=Object.create(Object.getPrototypeOf(e));t.set(e,r);for(let n of Reflect.ownKeys(e)){let i={...Reflect.getOwnPropertyDescriptor(e,n)};`value`in i&&(i.value=Reflect.apply(v,null,[i.value,t])),Reflect.defineProperty(r,n,i)}return r}function y(e,t,n){let r=/* @__PURE__ */ new Set;function i(e,t){if(e===t)return!0;if(p(e)||p(t))return p(e)&&p(t);if(!n&&a(e)&&a(t))return!0;if(typeof e!=typeof t||typeof e!=`object`||!e||!t||r.has(e))return!1;function o(n,r){return n(e)?n(t)?r(e,t):!1:!n(t)&&void 0}r.add(e);try{return o(Array.isArray,(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1;return!0})??o(m(`Date`),(e,t)=>e.valueOf()===t.valueOf())??o(m(`URL`),(e,t)=>e.href===t.href)??o(m(`RegExp`),(e,t)=>e.source===t.source&&e.flags===t.flags)??o(h,(e,t)=>{if(e.byteLength!==t.byteLength)return!1;let n=new Uint8Array(e),r=new Uint8Array(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0})??((!n||[e,t].every(e=>Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null))&&Object.keys({...e,...t}).every(n=>i(e[n],t[n])))}finally{r.delete(e)}}return i(e,t)}let b;(function(e){e.millisecond=1;let t=e.second=1e3,n=e.minute=t*60,r=e.hour=n*60,i=e.day=r*24,a=e.week=i*7,o=(/* @__PURE__ */ new Date()).getTimezoneOffset();function s(e){o=e}e.setTimezoneOffset=s;function c(){return o}e.getTimezoneOffset=c;function l(e=/* @__PURE__ */ new Date,t){return typeof e==`number`&&(e=new Date(e)),t===void 0&&(t=o),Math.floor((e.valueOf()/n-t)/1440)}e.getDateNumber=l;function u(e,t){let r=new Date(e*i);return t===void 0&&(t=o),new Date(+r+t*n)}e.fromDateNumber=u;let d=RegExp(`^${[`w(?:eek(?:s)?)?`,`d(?:ay(?:s)?)?`,`h(?:our(?:s)?)?`,`m(?:in(?:ute)?(?:s)?)?`,`s(?:ec(?:ond)?(?:s)?)?`].map(e=>`(\\d+(?:\\.\\d+)?${e})?`).join(``)}$`);function f(e){let o=d.exec(e);return o?(parseFloat(o[1])*a||0)+(parseFloat(o[2])*i||0)+(parseFloat(o[3])*r||0)+(parseFloat(o[4])*n||0)+(parseFloat(o[5])*t||0):0}e.parseTime=f;function p(e){let t=f(e);return t?e=Date.now()+t:/^\d{1,2}(:\d{1,2}){1,2}$/.test(e)?e=`${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${e}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(e)&&(e=`${(/* @__PURE__ */ new Date()).getFullYear()}-${e}`),e?new Date(e):/* @__PURE__ */ new Date}e.parseDate=p;function m(e){let a=Math.abs(e);return a>=i-r/2?Math.round(e/i)+`d`:a>=r-n/2?Math.round(e/r)+`h`:a>=n-t/2?Math.round(e/n)+`m`:a>=t?Math.round(e/t)+`s`:e+`ms`}e.format=m;function h(e,t=2){return e.toString().padStart(t,`0`)}e.toDigits=h;function g(e,t=/* @__PURE__ */ new Date){return e.replace(`yyyy`,t.getFullYear().toString()).replace(`yy`,t.getFullYear().toString().slice(2)).replace(`MM`,h(t.getMonth()+1)).replace(`dd`,h(t.getDate())).replace(`hh`,h(t.getHours())).replace(`mm`,h(t.getMinutes())).replace(`ss`,h(t.getSeconds())).replace(`SSS`,h(t.getMilliseconds(),3))}e.template=g})(b||={});let x=Symbol.for(`schemastery`),S=Symbol.for(`ValidationError`);globalThis.__schemastery_index__??=0,globalThis.__schemastery_refs__=void 0;var C=class extends TypeError{options;name=`ValidationError`;constructor(e,t){let n=`$`;for(let e of t.path||[])typeof e==`string`?n+=`.`+e:typeof e==`number`?n+=`[`+e+`]`:typeof e==`symbol`&&(n+=`[Symbol(${e.toString()})]`);n.startsWith(`.`)&&(n=n.slice(1)),super((n===`$`?``:`${n} `)+e),this.options=t}static is(e){return!!e?.[S]}};Object.defineProperty(C.prototype,S,{value:!0});let w=function(e){let t=function(e,n={}){return w.resolve(e,t,n)[0]};if(e.refs){let t=c(e.refs,e=>new w(e)),n=e=>t[e];for(let e in t){let r=t[e];r.sKey=n(r.sKey),r.inner=n(r.inner),r.list=r.list&&r.list.map(n),r.dict=r.dict&&c(r.dict,n)}return t[e.uid]}if(Object.assign(t,e),typeof t.callback==`string`)try{t.callback=Function(`return `+t.callback)()}catch{}return Object.defineProperty(t,"uid",{value:globalThis.__schemastery_index__++}),Object.setPrototypeOf(t,w.prototype),t.meta||={},t.toString=t.toString.bind(t),t};w.prototype=Object.create(Function.prototype),w.prototype[x]=!0,Object.defineProperty(w.prototype,"~standard",{get(){return{version:1,vendor:`schemastery`,validate:e=>{try{return{value:w.resolve(e,this,{})[0]}}catch(e){if(C.is(e))return{issues:[{message:e.message,path:e.options.path}]};throw e}}}}}),w.ValidationError=C,w.prototype.toJSON=function(){if(globalThis.__schemastery_refs__)return globalThis.__schemastery_refs__[this.uid]??=JSON.parse(JSON.stringify({...this})),this.uid;globalThis.__schemastery_refs__={[this.uid]:{...this}},globalThis.__schemastery_refs__[this.uid]=JSON.parse(JSON.stringify({...this}));let e={uid:this.uid,refs:globalThis.__schemastery_refs__};return globalThis.__schemastery_refs__=void 0,e},w.prototype.set=function(e,t){return this.dict[e]=t,this},w.prototype.push=function(e){return this.list.push(e),this};function T(e,t){let n=typeof e==`string`?{"":e}:{...e};for(let e in t){let r=t[e];r?.$description||r?.$desc?n[e]=r.$description||r.$desc:typeof r==`string`&&(n[e]=r)}return n}function E(e){return e?.$value??e?.$inner}function D(e){return s(e??{},e=>!e.startsWith(`$`))}w.prototype.i18n=function(e){let t=w(this),n=T(t.meta.description,e);return Object.keys(n).length&&(t.meta.description=n),t.dict&&=c(t.dict,(t,n)=>t.i18n(c(e,e=>E(e)?.[n]??e?.[n]))),t.list&&=t.list.map((t,n)=>t.i18n(c(e,(e={})=>Array.isArray(E(e))?E(e)[n]:Array.isArray(e)?e[n]:D(e)))),t.inner&&=t.inner.i18n(c(e,e=>E(e)?E(e):D(e))),t.sKey&&=t.sKey.i18n(c(e,e=>e?.$key)),t},w.prototype.extra=function(e,t){let n=w(this);return n.meta={...n.meta,[e]:t},n};for(let e of[`required`,`disabled`,`collapse`,`hidden`,`loose`])Object.assign(w.prototype,{[e](t=!0){let n=w(this);return n.meta={...n.meta,[e]:t},n}});w.prototype.deprecated=function(){let e=w(this);return e.meta.badges||=[],e.meta.badges.push({text:`deprecated`,type:`danger`}),e},w.prototype.experimental=function(){let e=w(this);return e.meta.badges||=[],e.meta.badges.push({text:`experimental`,type:`warning`}),e},w.prototype.pattern=function(e){let t=w(this),n=l(e,[`source`,`flags`]);return t.meta={...t.meta,pattern:n},t},w.prototype.simplify=function(e){if(p(e)&&(e=e.get()),y(e,this.meta.default,this.type===`dict`))return null;if(a(e))return e;if(this.type===`object`||this.type===`dict`){let t={};for(let n in e){let r=(this.type===`object`?this.dict[n]:this.inner)?.simplify(e[n]);(this.type===`dict`||!a(r))&&(t[n]=r)}return y(t,this.meta.default,this.type===`dict`)?null:t}if(this.type===`array`||this.type===`tuple`){let t=[];return e.forEach((e,n)=>{let r=this.type===`array`?this.inner:this.list[n],i=r?r.simplify(e):e;t.push(i)}),t}if(this.type===`intersect`){let t={};for(let n of this.list)Object.assign(t,n.simplify(e));return t}if(this.type===`union`)for(let t of this.list)try{return w.resolve(e,t,{}),t.simplify(e)}catch{}return e},w.prototype.toString=function(e){return I[this.type]?.(this,e)??`Schema<${this.type}>`},w.prototype.role=function(e,t){let n=w(this);return n.meta={...n.meta,role:e,extra:t},n};for(let e of[`default`,`link`,`comment`,`description`,`max`,`min`,`step`])Object.assign(w.prototype,{[e](t){let n=w(this);return n.meta={...n.meta,[e]:t},n}});w.prototype.volatile=function(){if(this.meta.volatile)throw TypeError(`volatile schema is already wrapped`);return this.extra(`volatile`,!0)};let O={},k=Symbol(`checked-volatile-schema`);function A(e,t=[],n=!1,r=/* @__PURE__ */ new Map){let i=r.get(e)??/* @__PURE__ */ new Set;if(i.has(n))return;if(i.add(n),r.set(e,i),e.meta?.volatile&&n)throw new C(`volatile fields require a fixed object path without an enclosing volatile field`,{path:t});let a=n||!!e.meta?.volatile;if(e.dict)for(let[n,i]of Object.entries(e.dict))A(i,[...t,n],a,r);if(e.sKey&&A(e.sKey,[...t,`<key>`],!0,r),e.inner&&(e.type!==`lazy`||e.inner[x])&&A(e.inner,[...t,`*`],!0,r),e.list)for(let n=0;n<e.list.length;n++)A(e.list[n],[...t,String(n)],!0,r)}w.extend=function(e,t){O[e]=t},w.resolve=function(e,t,n={},r=!1){if(!t)return[e];if(n[k]||(A(t,n.path),n={...n,[k]:!0}),t.meta?.volatile){let i=w(t);i.meta={...t.meta,volatile:!1};let[a,o]=w.resolve(e,i,n,r);try{return[f(a),o]}catch(e){throw new C(e instanceof Error?e.message:String(e),n)}}if(n.ignore?.(e,t))return[e];if(a(e)&&t.type!==`lazy`){if(t.meta.required)throw new C(`missing required value`,n);let r=t,i=t.meta.default;for(;r?.type===`intersect`&&a(i);)r=r.list[0],i=r?.meta.default;if(a(i))return[e];e=v(i)}let i=O[t.type];if(!i)throw new C(`unsupported type "${t.type}"`,n);try{return i(e,t,n,r)}catch(e){if(!t.meta.loose)throw e;return[t.meta.default]}},w.from=function(e){if(a(e))return w.any();if([`string`,`number`,`boolean`].includes(typeof e))return w.const(e).required();if(e[x])return e;if(typeof e==`function`)switch(e){case String:return w.string().required();case Number:return w.number().required();case Boolean:return w.boolean().required();case Function:return w.function().required();default:return w.is(e).required()}else throw TypeError(`cannot infer schema from ${e}`)},w.lazy=function(e){let t=new w({type:`lazy`,builder:e,inner:{toJSON:()=>(t.inner[x]||(t.inner=t.builder(),t.inner.meta={...t.meta,...t.inner.meta}),t.inner.toJSON())}});return t},w.natural=function(){return w.number().step(1).min(0)},w.percent=function(){return w.number().step(.01).min(0).max(1).role(`slider`)},w.date=function(){return w.union([w.is(Date),w.transform(w.string().role(`datetime`),(e,t)=>{let n=new Date(e);if(isNaN(+n))throw new C(`invalid date "${e}"`,t);return n},!0)])},w.regExp=function(e=``){return w.union([w.is(RegExp),w.transform(w.string().role(`regexp`,{flag:e}),(t,n)=>{try{return new RegExp(t,e)}catch(e){throw new C(e.message,n)}},!0)])},w.arrayBuffer=function(e){return w.union([w.is(ArrayBuffer),w.is(SharedArrayBuffer),w.transform(w.any(),(e,t)=>{if(_.isSource(e))return _.fromSource(e);throw new C(`expected ArrayBufferSource but got ${e}`,t)},!0),...e?[w.transform(w.string(),(t,n)=>{try{return e===`base64`?_.fromBase64(t):_.fromHex(t)}catch(e){throw new C(e.message,n)}},!0)]:[]])},w.extend(`lazy`,(e,t,n,r)=>(t.inner[x]||(t.inner=t.builder(),t.inner.meta={...t.meta,...t.inner.meta},A(t.inner,n.path,!0)),w.resolve(e,t.inner,n,r))),w.extend(`any`,e=>[e]),w.extend(`never`,(e,t,n)=>{throw new C(`expected nullable but got ${e}`,n)}),w.extend(`const`,(e,{value:t},n)=>{if(y(e,t))return[t];throw new C(`expected ${t} but got ${e}`,n)});function j(e,t,n,r,i=!1){let{max:a=1/0,min:o=-1/0}=t;if(e>a)throw new C(`expected ${n} <= ${a} but got ${e}`,r);if(e<o&&!i)throw new C(`expected ${n} >= ${o} but got ${e}`,r)}w.extend(`string`,(e,{meta:t},n)=>{if(typeof e!=`string`)throw new C(`expected string but got ${e}`,n);if(t.pattern){let r=new RegExp(t.pattern.source,t.pattern.flags);if(!r.test(e))throw new C(`expect string to match regexp ${r}`,n)}return j(e.length,t,`string length`,n),[e]});function M(e,t){let n=e.toString();if(n.includes(`e`))return e*10**t;let r=n.indexOf(`.`);if(r===-1)return e*10**t;let i=n.slice(r+1),a=n.slice(0,r);return i.length<=t?+(a+i.padEnd(t,`0`)):+(a+i.slice(0,t)+`.`+i.slice(t))}function N(e,t,n){if(n=Math.abs(n),!/^\d+\.\d+$/.test(n.toString()))return(e-t)%n===0;let r=n.toString().indexOf(`.`),i=n.toString().slice(r+1).length;return Math.abs(M(e,i)-M(t,i))%M(n,i)===0}w.extend(`number`,(e,{meta:t},n)=>{if(typeof e!=`number`)throw new C(`expected number but got ${e}`,n);j(e,t,`number`,n);let{step:r}=t;if(r&&!N(e,t.min??0,r))throw new C(`expected number multiple of ${r} but got ${e}`,n);return[e]}),w.extend(`boolean`,(e,t,n)=>{if(typeof e==`boolean`)return[e];throw new C(`expected boolean but got ${e}`,n)}),w.extend(`bitset`,(e,{bits:t,meta:n},r)=>{let i=0,a=[];if(typeof e==`number`){i=e;for(let n in t)e&t[n]&&a.push(n)}else if(Array.isArray(e)){a=e;for(let e of a){if(typeof e!=`string`)throw new C(`expected string but got ${e}`,r);e in t&&(i|=t[e])}}else throw new C(`expected number or array but got ${e}`,r);return i===n.default?[i]:[i,a]}),w.extend(`function`,(e,t,n)=>{if(typeof e==`function`)return[e];throw new C(`expected function but got ${e}`,n)}),w.extend(`is`,(e,{constructor:t},n)=>{if(typeof t==`function`){if(e instanceof t)return[e];throw new C(`expected ${t.name} but got ${e}`,n)}{if(a(e))throw new C(`expected ${t} but got ${e}`,n);let r=Object.getPrototypeOf(e);for(;r;){if(r.constructor?.name===t)return[e];r=Object.getPrototypeOf(r)}throw new C(`expected ${t} but got ${e}`,n)}});function P(e,t,n,r){try{let[i,a]=w.resolve(e[t],n,{...r,path:[...r.path||[],t]});return a!==void 0&&(e[t]=a),i}catch(i){if(!r?.autofix)throw i;return delete e[t],n.meta.volatile?f(n.meta.default):n.meta.default}}w.extend(`array`,(e,{inner:t,meta:n},r)=>{if(!Array.isArray(e))throw new C(`expected array but got ${e}`,r);return j(e.length,n,`array length`,r,!a(t.meta.default)),[e.map((n,i)=>P(e,i,t,r))]}),w.extend(`dict`,(e,{inner:t,sKey:n},r,i)=>{if(!o(e))throw new C(`expected object but got ${e}`,r);let a={};for(let o in e){let s;try{s=w.resolve(o,n,r)[0]}catch(e){if(i)continue;throw e}a[s]=P(e,o,t,r),e[s]=e[o],o!==s&&delete e[o]}return[a]}),w.extend(`tuple`,(e,{list:t},n,r)=>{if(!Array.isArray(e))throw new C(`expected array but got ${e}`,n);let i=t.map((t,r)=>P(e,r,t,n));return r||i.push(...e.slice(t.length)),[i]});function F(e,t){for(let n in t)n in e||(e[n]=t[n])}w.extend(`object`,(e,{dict:t},n,r)=>{if(!o(e))throw new C(`expected object but got ${e}`,n);let i={};for(let r in t){let o=P(e,r,t[r],n);(!a(o)||r in e)&&(i[r]=o)}return r||F(i,e),[i]}),w.extend(`union`,(e,{list:t,toString:n},r,i)=>{let a=[];for(let n of t)try{return w.resolve(e,n,r,i)}catch(e){a.push(e)}throw new C(`expected ${n()} but got ${JSON.stringify(e)}`,r)}),w.extend(`intersect`,(e,{list:t,toString:n},r,i)=>{if(!t.length)return[e];let s;for(let i of t){let t=w.resolve(e,i,r,!0)[0];if(!a(t)){if(a(s))s=t;else if(typeof s!=typeof t)throw new C(`expected ${n()} but got ${JSON.stringify(e)}`,r);else if(typeof t==`object`)F(s??={},t);else if(s!==t)throw new C(`expected ${n()} but got ${JSON.stringify(e)}`,r)}}return!i&&o(e)&&F(s,e),[s]}),w.extend(`transform`,(e,{inner:t,callback:n,preserve:r},i)=>{let[a,o=e]=w.resolve(e,t,i,!0);return r?[n(a)]:[n(a),n(o)]});let I={};function L(e,t,n){I[e]=n,Object.assign(w,{[e](...n){let r=new w({type:e});return t.forEach((e,t)=>{switch(e){case`sKey`:r.sKey=n[t]??w.string();break;case`inner`:r.inner=w.from(n[t]);break;case`list`:r.list=n[t].map(w.from);break;case`dict`:r.dict=c(n[t],w.from);break;case`bits`:r.bits={};for(let e in n[t])typeof n[t][e]==`number`&&(r.bits[e]=n[t][e]);break;case`callback`:{let e=r.callback=n[t];e.toJSON||=()=>e.toString();break}case`constructor`:{let e=r.constructor=n[t];typeof e==`function`&&(e.toJSON||=()=>e.name);break}default:r[e]=n[t]}}),e===`object`||e===`dict`?r.meta.default={}:e===`array`||e===`tuple`?r.meta.default=[]:e===`bitset`&&(r.meta.default=0),r}})}L(`is`,[`constructor`],({constructor:e})=>typeof e==`function`?e.name:e),L(`any`,[],()=>`any`),L(`never`,[],()=>`never`),L(`const`,[`value`],({value:e})=>typeof e==`string`?JSON.stringify(e):e),L(`string`,[],()=>`string`),L(`number`,[],()=>`number`),L(`boolean`,[],()=>`boolean`),L(`bitset`,[`bits`],()=>`bitset`),L(`function`,[],()=>`function`),L(`array`,[`inner`],({inner:e})=>`${e.toString(!0)}[]`),L(`dict`,[`inner`,`sKey`],({inner:e,sKey:t})=>`{ [key: ${t.toString()}]: ${e.toString()} }`),L(`tuple`,[`list`],({list:e})=>`[${e.map(e=>e.toString()).join(`, `)}]`),L(`object`,[`dict`],({dict:e})=>Object.keys(e).length===0?`{}`:`{ ${Object.entries(e).map(([e,t])=>`${e}${t.meta.required?``:`?`}: ${t.toString()}`).join(`, `)} }`),L(`union`,[`list`],({list:e},t)=>{let n=e.map(({toString:e})=>e()).join(` | `);return t?`(${n})`:n}),L(`intersect`,[`list`],({list:e})=>`${e.map(e=>e.toString(!0)).join(` & `)}`),L(`transform`,[`inner`,`callback`,`preserve`],({inner:e},t)=>e.toString(t));function R(e,t){return Array.isArray(e)?[...e]:typeof e==`object`&&e?{...e}:/^\d+$/.test(t)?[]:{}}function z(e,t){let n={...e},r=n;for(let e=0;e<t.length-1;e++){let n=t[e],i=R(Array.isArray(r)?r[Number(n)]:r[n],t[e+1]);Array.isArray(r)?r[Number(n)]=i:r[n]=i,r=i}return{result:n,parent:r,leaf:t[t.length-1]}}var B=class extends r.Service{constructor(e){super(e,`settingsSchema`)}rehydrate(e){return new w(e)}validate(e,t){try{e(t);return}catch(e){return e instanceof Error?e.message:String(e)}}nodeAtPath(e,t){let n=e;for(let e of t){if(n===void 0)return;if(n.type===`object`)n=n.dict?.[e];else if(n.type===`dict`||n.type===`array`)n=n.inner;else return}return n}getPath(e,t){let n=e;for(let e of t)if(Array.isArray(n))n=n[Number(e)];else{if(typeof n!=`object`||!n)return;n=n[e]}return n}hasPath(e,t){if(t.length===0)return e!==void 0;let n=this.getPath(e,t.slice(0,-1)),r=t[t.length-1];return Array.isArray(n)?Number(r)<n.length:typeof n!=`object`||!n?!1:r in n}setPath(e,t,n){if(t.length===0)throw Error(`ui-settings: setPath needs a non-empty path`);let{result:r,parent:i,leaf:a}=z(e,t);return Array.isArray(i)?i[Number(a)]=n:i[a]=n,r}deletePath(e,t){if(t.length===0)throw Error(`ui-settings: deletePath needs a non-empty path`);if(!this.hasPath(e,t))return e;let{result:n,parent:r,leaf:i}=z(e,t);return Array.isArray(r)?r.splice(Number(i),1):Reflect.deleteProperty(r,i),n}},V=class{scope;enabled;local=(0,i.createSnapshotStore)(!0);constructor(e){this.scope=e,this.enabled=e.getSnapshot().mode===`memory`?this.local:{getSnapshot:()=>e.getSnapshot().value?.enabled??!1,subscribe:t=>{let n=this.enabled.getSnapshot();return e.subscribe(()=>{let e=this.enabled.getSnapshot();e!==n&&(n=e,t())})}}}async setEnabled(e){if(this.scope.getSnapshot().mode===`memory`)this.local.set(e);else if(!await this.scope.set(`enabled`,e))throw Error(`Developer tools preference was not saved`)}};let H={enabled:w.boolean().default(!0)};w.object(H);let U=/* @__PURE__ */ new Set([`ui-theme`,`locale`,`ui-chat`,`ui-conversation`,`ui-settings`,`ui-workspace`]);function W(e){return U.has(e)}function G(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var K=class{schema;key;constructor(e,t){this.schema=t,this.key=`codexhost.web.preferences.v1:${e}`}read(e){let t;try{let n=JSON.parse(localStorage.getItem(this.key)??`null`);G(n)&&G(n.user)&&Number.isSafeInteger(n.revision)&&n.revision>=0&&this.valid(e,n.user)&&(t=n)}catch{}return t===void 0&&(t={user:G(e.user)?e.user:{},revision:0},this.valid(e,t.user)||(t.user={}),this.save(t)),{...e,...t,value:{...G(e.base)?e.base:{},...t.user}}}write(e,t,n){let r=this.read(e);if(n!==void 0&&n!==r.revision)return!1;let i={...G(r.user)?r.user:{}};for(let e of t){if(e.path.length!==1)return!1;let t=e.path[0];e.op===`set`?i={...i,[t]:e.value}:delete i[t]}return this.valid(e,i)?this.save({user:i,revision:r.revision+1}):!1}valid(e,t){try{return this.schema.validate(this.schema.rehydrate(e.schema),{...G(e.base)?e.base:{},...t})===void 0}catch{return!1}}save(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),!0}catch{return!1}}},q=class{ctx;spec;mirror;persistence;schema;store;tail=Promise.resolve();writeGeneration=0;disposed=!1;unsubscribe;browser;pendingRevision;constructor(e,t,n,r,a){if(this.ctx=e,this.spec=t,this.mirror=n,this.persistence=r,this.schema=a,this.browser=r===`browser`?new K(t.namespace,a):void 0,this.store=(0,i.createSnapshotStore)({status:r===`memory`?`unavailable`:`loading`,value:void 0,base:void 0,user:void 0,revision:void 0,writable:!1,mode:r}),r!==`memory`){let e=t.browserView===void 0?n.subscribe(()=>{this.derive()}):void 0,r=e=>{(e.key===null||e.key===this.browser?.key)&&this.derive()};this.browser!==void 0&&window.addEventListener(`storage`,r),this.unsubscribe=()=>{e?.(),this.browser!==void 0&&window.removeEventListener(`storage`,r)},this.derive()}}getSnapshot(){return this.store.getSnapshot()}subscribe(e){return this.store.subscribe(e)}set(e,t){return this.mutate([{op:`set`,path:[e],value:t}])}unset(e){return this.mutate([{op:`unset`,path:[e]}])}mutate(e,t){let n=structuredClone(e),r=this.browser;if(r!==void 0)return this.enqueue(()=>{let e=this.spec.browserView??this.mirror.namespace(this.spec.namespace),i=e!==void 0&&r.write(e,n,t);return this.derive(),Promise.resolve(i)});let i=++this.writeGeneration;return this.enqueue(async()=>{let e=t??this.pendingRevision??this.getSnapshot().revision,r=await this.ctx.remote.settings.mutate(this.spec.namespace,n,e);return r.ok?(this.disposed||(i===this.writeGeneration?(this.pendingRevision=void 0,this.mirror.acceptView(r.value)):this.pendingRevision=r.value.revision),!0):(await this.recover(i),!1)})}async recover(e){this.disposed||e!==this.writeGeneration||(this.pendingRevision=void 0,await this.mirror.load())}async dispose(){this.disposed=!0,this.writeGeneration+=1,this.unsubscribe?.(),await this.tail}enqueue(e){if(this.persistence===`memory`||this.disposed)return Promise.resolve(!1);let t=this.tail.then(async()=>!this.disposed&&await e());return this.tail=t.then(()=>{},()=>{}),t}derive(){if(this.disposed)return;let e=this.mirror.getSnapshot();if(this.spec.browserView===void 0&&e.view===void 0)return;let t=e.view?.writable??!1,n=this.spec.browserView??this.mirror.namespace(this.spec.namespace);if(n===void 0){this.store.update(e=>{e.status=`unavailable`,e.writable=t});return}let r=this.browser?.read(n)??n,i=this.decode(r);this.store.update(e=>{e.revision=r.revision,e.base=r.base,e.user=r.user,e.writable=this.browser!==void 0||t,i!==void 0&&(e.status=`ready`,e.value=i)})}decode(e){if(this.spec.decode!==void 0)return this.spec.decode(e.value);if(typeof e.value!=`object`||e.value===null||Array.isArray(e.value))return;let t;try{t=this.schema.validate(this.schema.rehydrate(e.schema),e.value)}catch{return}return t===void 0?e.value:void 0}},J=class extends r.Service{forms=/* @__PURE__ */ new Map;developerTools;mirror;schema;persistence;owner;constructor(e,t){super(e,`configForms`),this.mirror=t.mirror,this.schema=t.schema,this.persistence=t.persistence,this.owner=e,this.developerTools=new V(this.get(`ui-settings`)),e.effect(()=>async()=>{await Promise.all([...this.forms.values()].map(e=>e.dispose())),this.forms.clear()},`ui-settings: configuration forms`)}describe(){return this.mirror}get(e){let t=this.forms.get(e);if(t!==void 0)return t;let n=new q(this.owner,{namespace:e},this.mirror,W(e)?`browser`:this.persistence,this.schema);return this.forms.set(e,n),this.mirror.ensure(),n}registerBrowser(e,t,n){if(!W(e))throw Error(`ui-settings: ${e} is not a browser preference namespace`);let r=this.forms.get(e);if(r!==void 0)return r;let i={ns:e,autoGenerate:!1,applies:`live`,secrets:[],schema:t,base:n,user:{},value:n,revision:0},a=new q(this.owner,{namespace:e,browserView:i},this.mirror,`browser`,this.schema);return this.forms.set(e,a),a}whileServed(e,t){let n,r=()=>{let r=new Set(this.mirror.getSnapshot().view?.namespaces.map(e=>e.ns)??[]),i=e.some(e=>r.has(e));i&&n===void 0?n=t(r):!i&&n!==void 0&&(n(),n=void 0)},i=this.mirror.subscribe(r);return this.mirror.ensure(),r(),()=>{i(),n?.(),n=void 0}}},Y=class{ctx;persistence;store;inFlight;rerun=!1;generation=0;constructor(e,t=`host`){this.ctx=e,this.persistence=t,this.store=(0,i.createSnapshotStore)({status:t===`host`?`idle`:`unavailable`,view:void 0,error:null})}getSnapshot(){return this.store.getSnapshot()}subscribe(e){return this.store.subscribe(e)}load(){if(this.persistence===`memory`)return Promise.resolve();if(this.inFlight!==void 0)return this.rerun=!0,this.inFlight;let e=Promise.resolve().then(()=>this.run());return this.inFlight=e,e}ensure(){return this.persistence===`memory`?Promise.resolve():this.inFlight===void 0?this.getSnapshot().status===`idle`?this.load():Promise.resolve():this.inFlight}acceptView(e){let t=this.store.getSnapshot();if(this.generation+=1,this.inFlight!==void 0&&(this.rerun=!0),t.view===void 0)return;let n=t.view.namespaces.some(t=>t.ns===e.ns)?t.view.namespaces.map(t=>t.ns===e.ns?e:t):[...t.view.namespaces,e];this.store.set({...t,view:{...t.view,namespaces:n}})}namespace(e){return this.store.getSnapshot().view?.namespaces.find(t=>t.ns===e)}async run(){try{do{let e=this.store.getSnapshot();e.status===`idle`&&this.store.set({...e,status:`loading`}),this.rerun=!1;let t=++this.generation,n;try{let e=await this.ctx.remote.settings.describe();n=e.ok?{view:e.value}:{failure:e.error.message}}catch(e){n={failure:e instanceof Error?e.message:String(e)}}if(t===this.generation){if(`view`in n)this.store.set({status:`ready`,view:n.view,error:null});else{let e=this.store.getSnapshot();this.store.set({status:e.view===void 0?`idle`:`ready`,view:e.view,error:n.failure})}}}while(this.shouldRerun())}finally{this.inFlight=void 0}}shouldRerun(){return this.rerun}};let X=[`remote`,`remote.settings`];function Z(e){let t=new B(e),n=`host`,r=new Y(e,n);e.effect(()=>{let t=[e.remote.$on(`settings/document-updated`,()=>{r.load()}),e.on(`connection/reset`,()=>{r.load()})];return r.ensure(),()=>{for(let e of t)e()}},`ui-settings: describe mirror invalidations`),new J(e,{mirror:r,schema:t,persistence:n})}return n.apply=Z,n.inject=X,t.exports}});
|
|
1
|
+
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-settings`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("@deepseek-ai/cordis"),i=e("@deepseek-ai/dsh-client-store");function a(e){return e==null}function o(e){return e&&typeof e==`object`&&!Array.isArray(e)}function s(e,t){return Object.fromEntries(Object.entries(e).filter(([e,n])=>t(e,n)))}function c(e,t){return Object.fromEntries(Object.entries(e).map(([e,n])=>[e,t(n,e)]))}function l(e,t,n){if(!t)return{...e};let r={};for(let i of t)(n||e[i]!==void 0)&&(r[i]=e[i]);return r}let u=Symbol.for(`cosmokit.volatile.write`);function d(e,t=/* @__PURE__ */ new Set){if(typeof e==`function`)throw TypeError(`volatile config cannot contain functions`);if(typeof e!=`object`||!e)return e;if(t.has(e))throw TypeError(`volatile config cannot contain cycles`);t.add(e);try{if(Array.isArray(e))return Object.freeze(e.map(e=>d(e,t)));if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`volatile config objects must be plain objects or arrays`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([e,n])=>[e,d(n,t)])))}finally{t.delete(e)}}function f(e){let t=d(e);return Object.freeze({get:()=>t,[u]:e=>{t=e}})}function p(e){return typeof e==`object`&&!!e&&u in e}function m(e,t){return arguments.length===1?t=>m(e,t):e in globalThis&&t instanceof globalThis[e]||Object.prototype.toString.call(t).slice(8,-1)===e}function h(e){return m(`ArrayBuffer`,e)||m(`SharedArrayBuffer`,e)}function g(e){return h(e)||ArrayBuffer.isView(e)}let _;(function(e){e.is=h,e.isSource=g;function t(e){return ArrayBuffer.isView(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e}e.fromSource=t;function n(e){if(e=t(e),typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let n=``,r=new Uint8Array(e);for(let e=0;e<r.byteLength;e++)n+=String.fromCharCode(r[e]);return btoa(n)}e.toBase64=n;function r(e){return typeof Buffer<`u`?t(Buffer.from(e,`base64`)):Uint8Array.from(atob(e),e=>e.charCodeAt(0))}e.fromBase64=r;function i(e){return e=t(e),typeof Buffer<`u`?Buffer.from(e).toString(`hex`):Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``)}e.toHex=i;function a(e){if(typeof Buffer<`u`)return t(Buffer.from(e,`hex`));let n=e.length%2==0?e:e.slice(0,e.length-1),r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(`${n[e]}${n[e+1]}`,16));return Uint8Array.from(r).buffer}e.fromHex=a})(_||={}),_.fromBase64,_.toBase64,_.fromHex,_.toHex;function v(e,t=/* @__PURE__ */ new Map){if(!e||typeof e!=`object`)return e;if(m(`Date`,e))return new Date(e.valueOf());if(m(`RegExp`,e))return new RegExp(e.source,e.flags);if(h(e))return e.slice(0);if(ArrayBuffer.isView(e))return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);let n=t.get(e);if(n)return n;if(Array.isArray(e)){let n=[];return t.set(e,n),e.forEach((e,r)=>{n[r]=Reflect.apply(v,null,[e,t])}),n}let r=Object.create(Object.getPrototypeOf(e));t.set(e,r);for(let n of Reflect.ownKeys(e)){let i={...Reflect.getOwnPropertyDescriptor(e,n)};`value`in i&&(i.value=Reflect.apply(v,null,[i.value,t])),Reflect.defineProperty(r,n,i)}return r}function y(e,t,n){let r=/* @__PURE__ */ new Set;function i(e,t){if(e===t)return!0;if(p(e)||p(t))return p(e)&&p(t);if(!n&&a(e)&&a(t))return!0;if(typeof e!=typeof t||typeof e!=`object`||!e||!t||r.has(e))return!1;function o(n,r){return n(e)?n(t)?r(e,t):!1:!n(t)&&void 0}r.add(e);try{return o(Array.isArray,(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1;return!0})??o(m(`Date`),(e,t)=>e.valueOf()===t.valueOf())??o(m(`URL`),(e,t)=>e.href===t.href)??o(m(`RegExp`),(e,t)=>e.source===t.source&&e.flags===t.flags)??o(h,(e,t)=>{if(e.byteLength!==t.byteLength)return!1;let n=new Uint8Array(e),r=new Uint8Array(t);for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0})??((!n||[e,t].every(e=>Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null))&&Object.keys({...e,...t}).every(n=>i(e[n],t[n])))}finally{r.delete(e)}}return i(e,t)}let b;(function(e){e.millisecond=1;let t=e.second=1e3,n=e.minute=t*60,r=e.hour=n*60,i=e.day=r*24,a=e.week=i*7,o=(/* @__PURE__ */ new Date()).getTimezoneOffset();function s(e){o=e}e.setTimezoneOffset=s;function c(){return o}e.getTimezoneOffset=c;function l(e=/* @__PURE__ */ new Date,t){return typeof e==`number`&&(e=new Date(e)),t===void 0&&(t=o),Math.floor((e.valueOf()/n-t)/1440)}e.getDateNumber=l;function u(e,t){let r=new Date(e*i);return t===void 0&&(t=o),new Date(+r+t*n)}e.fromDateNumber=u;let d=RegExp(`^${[`w(?:eek(?:s)?)?`,`d(?:ay(?:s)?)?`,`h(?:our(?:s)?)?`,`m(?:in(?:ute)?(?:s)?)?`,`s(?:ec(?:ond)?(?:s)?)?`].map(e=>`(\\d+(?:\\.\\d+)?${e})?`).join(``)}$`);function f(e){let o=d.exec(e);return o?(parseFloat(o[1])*a||0)+(parseFloat(o[2])*i||0)+(parseFloat(o[3])*r||0)+(parseFloat(o[4])*n||0)+(parseFloat(o[5])*t||0):0}e.parseTime=f;function p(e){let t=f(e);return t?e=Date.now()+t:/^\d{1,2}(:\d{1,2}){1,2}$/.test(e)?e=`${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${e}`:/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(e)&&(e=`${(/* @__PURE__ */ new Date()).getFullYear()}-${e}`),e?new Date(e):/* @__PURE__ */ new Date}e.parseDate=p;function m(e){let a=Math.abs(e);return a>=i-r/2?Math.round(e/i)+`d`:a>=r-n/2?Math.round(e/r)+`h`:a>=n-t/2?Math.round(e/n)+`m`:a>=t?Math.round(e/t)+`s`:e+`ms`}e.format=m;function h(e,t=2){return e.toString().padStart(t,`0`)}e.toDigits=h;function g(e,t=/* @__PURE__ */ new Date){return e.replace(`yyyy`,t.getFullYear().toString()).replace(`yy`,t.getFullYear().toString().slice(2)).replace(`MM`,h(t.getMonth()+1)).replace(`dd`,h(t.getDate())).replace(`hh`,h(t.getHours())).replace(`mm`,h(t.getMinutes())).replace(`ss`,h(t.getSeconds())).replace(`SSS`,h(t.getMilliseconds(),3))}e.template=g})(b||={});let x=Symbol.for(`schemastery`),S=Symbol.for(`ValidationError`);globalThis.__schemastery_index__??=0,globalThis.__schemastery_refs__=void 0;var C=class extends TypeError{options;name=`ValidationError`;constructor(e,t){let n=`$`;for(let e of t.path||[])typeof e==`string`?n+=`.`+e:typeof e==`number`?n+=`[`+e+`]`:typeof e==`symbol`&&(n+=`[Symbol(${e.toString()})]`);n.startsWith(`.`)&&(n=n.slice(1)),super((n===`$`?``:`${n} `)+e),this.options=t}static is(e){return!!e?.[S]}};Object.defineProperty(C.prototype,S,{value:!0});let w=function(e){let t=function(e,n={}){return w.resolve(e,t,n)[0]};if(e.refs){let t=c(e.refs,e=>new w(e)),n=e=>t[e];for(let e in t){let r=t[e];r.sKey=n(r.sKey),r.inner=n(r.inner),r.list=r.list&&r.list.map(n),r.dict=r.dict&&c(r.dict,n)}return t[e.uid]}if(Object.assign(t,e),typeof t.callback==`string`)try{t.callback=Function(`return `+t.callback)()}catch{}return Object.defineProperty(t,"uid",{value:globalThis.__schemastery_index__++}),Object.setPrototypeOf(t,w.prototype),t.meta||={},t.toString=t.toString.bind(t),t};w.prototype=Object.create(Function.prototype),w.prototype[x]=!0,Object.defineProperty(w.prototype,"~standard",{get(){return{version:1,vendor:`schemastery`,validate:e=>{try{return{value:w.resolve(e,this,{})[0]}}catch(e){if(C.is(e))return{issues:[{message:e.message,path:e.options.path}]};throw e}}}}}),w.ValidationError=C,w.prototype.toJSON=function(){if(globalThis.__schemastery_refs__)return globalThis.__schemastery_refs__[this.uid]??=JSON.parse(JSON.stringify({...this})),this.uid;globalThis.__schemastery_refs__={[this.uid]:{...this}},globalThis.__schemastery_refs__[this.uid]=JSON.parse(JSON.stringify({...this}));let e={uid:this.uid,refs:globalThis.__schemastery_refs__};return globalThis.__schemastery_refs__=void 0,e},w.prototype.set=function(e,t){return this.dict[e]=t,this},w.prototype.push=function(e){return this.list.push(e),this};function T(e,t){let n=typeof e==`string`?{"":e}:{...e};for(let e in t){let r=t[e];r?.$description||r?.$desc?n[e]=r.$description||r.$desc:typeof r==`string`&&(n[e]=r)}return n}function E(e){return e?.$value??e?.$inner}function D(e){return s(e??{},e=>!e.startsWith(`$`))}w.prototype.i18n=function(e){let t=w(this),n=T(t.meta.description,e);return Object.keys(n).length&&(t.meta.description=n),t.dict&&=c(t.dict,(t,n)=>t.i18n(c(e,e=>E(e)?.[n]??e?.[n]))),t.list&&=t.list.map((t,n)=>t.i18n(c(e,(e={})=>Array.isArray(E(e))?E(e)[n]:Array.isArray(e)?e[n]:D(e)))),t.inner&&=t.inner.i18n(c(e,e=>E(e)?E(e):D(e))),t.sKey&&=t.sKey.i18n(c(e,e=>e?.$key)),t},w.prototype.extra=function(e,t){let n=w(this);return n.meta={...n.meta,[e]:t},n};for(let e of[`required`,`disabled`,`collapse`,`hidden`,`loose`])Object.assign(w.prototype,{[e](t=!0){let n=w(this);return n.meta={...n.meta,[e]:t},n}});w.prototype.deprecated=function(){let e=w(this);return e.meta.badges||=[],e.meta.badges.push({text:`deprecated`,type:`danger`}),e},w.prototype.experimental=function(){let e=w(this);return e.meta.badges||=[],e.meta.badges.push({text:`experimental`,type:`warning`}),e},w.prototype.pattern=function(e){let t=w(this),n=l(e,[`source`,`flags`]);return t.meta={...t.meta,pattern:n},t},w.prototype.simplify=function(e){if(p(e)&&(e=e.get()),y(e,this.meta.default,this.type===`dict`))return null;if(a(e))return e;if(this.type===`object`||this.type===`dict`){let t={};for(let n in e){let r=(this.type===`object`?this.dict[n]:this.inner)?.simplify(e[n]);(this.type===`dict`||!a(r))&&(t[n]=r)}return y(t,this.meta.default,this.type===`dict`)?null:t}if(this.type===`array`||this.type===`tuple`){let t=[];return e.forEach((e,n)=>{let r=this.type===`array`?this.inner:this.list[n],i=r?r.simplify(e):e;t.push(i)}),t}if(this.type===`intersect`){let t={};for(let n of this.list)Object.assign(t,n.simplify(e));return t}if(this.type===`union`)for(let t of this.list)try{return w.resolve(e,t,{}),t.simplify(e)}catch{}return e},w.prototype.toString=function(e){return I[this.type]?.(this,e)??`Schema<${this.type}>`},w.prototype.role=function(e,t){let n=w(this);return n.meta={...n.meta,role:e,extra:t},n};for(let e of[`default`,`link`,`comment`,`description`,`max`,`min`,`step`])Object.assign(w.prototype,{[e](t){let n=w(this);return n.meta={...n.meta,[e]:t},n}});w.prototype.volatile=function(){if(this.meta.volatile)throw TypeError(`volatile schema is already wrapped`);return this.extra(`volatile`,!0)};let O={},k=Symbol(`checked-volatile-schema`);function A(e,t=[],n=!1,r=/* @__PURE__ */ new Map){let i=r.get(e)??/* @__PURE__ */ new Set;if(i.has(n))return;if(i.add(n),r.set(e,i),e.meta?.volatile&&n)throw new C(`volatile fields require a fixed object path without an enclosing volatile field`,{path:t});let a=n||!!e.meta?.volatile;if(e.dict)for(let[n,i]of Object.entries(e.dict))A(i,[...t,n],a,r);if(e.sKey&&A(e.sKey,[...t,`<key>`],!0,r),e.inner&&(e.type!==`lazy`||e.inner[x])&&A(e.inner,[...t,`*`],!0,r),e.list)for(let n=0;n<e.list.length;n++)A(e.list[n],[...t,String(n)],!0,r)}w.extend=function(e,t){O[e]=t},w.resolve=function(e,t,n={},r=!1){if(!t)return[e];if(n[k]||(A(t,n.path),n={...n,[k]:!0}),t.meta?.volatile){let i=w(t);i.meta={...t.meta,volatile:!1};let[a,o]=w.resolve(e,i,n,r);try{return[f(a),o]}catch(e){throw new C(e instanceof Error?e.message:String(e),n)}}if(n.ignore?.(e,t))return[e];if(a(e)&&t.type!==`lazy`){if(t.meta.required)throw new C(`missing required value`,n);let r=t,i=t.meta.default;for(;r?.type===`intersect`&&a(i);)r=r.list[0],i=r?.meta.default;if(a(i))return[e];e=v(i)}let i=O[t.type];if(!i)throw new C(`unsupported type "${t.type}"`,n);try{return i(e,t,n,r)}catch(e){if(!t.meta.loose)throw e;return[t.meta.default]}},w.from=function(e){if(a(e))return w.any();if([`string`,`number`,`boolean`].includes(typeof e))return w.const(e).required();if(e[x])return e;if(typeof e==`function`)switch(e){case String:return w.string().required();case Number:return w.number().required();case Boolean:return w.boolean().required();case Function:return w.function().required();default:return w.is(e).required()}else throw TypeError(`cannot infer schema from ${e}`)},w.lazy=function(e){let t=new w({type:`lazy`,builder:e,inner:{toJSON:()=>(t.inner[x]||(t.inner=t.builder(),t.inner.meta={...t.meta,...t.inner.meta}),t.inner.toJSON())}});return t},w.natural=function(){return w.number().step(1).min(0)},w.percent=function(){return w.number().step(.01).min(0).max(1).role(`slider`)},w.date=function(){return w.union([w.is(Date),w.transform(w.string().role(`datetime`),(e,t)=>{let n=new Date(e);if(isNaN(+n))throw new C(`invalid date "${e}"`,t);return n},!0)])},w.regExp=function(e=``){return w.union([w.is(RegExp),w.transform(w.string().role(`regexp`,{flag:e}),(t,n)=>{try{return new RegExp(t,e)}catch(e){throw new C(e.message,n)}},!0)])},w.arrayBuffer=function(e){return w.union([w.is(ArrayBuffer),w.is(SharedArrayBuffer),w.transform(w.any(),(e,t)=>{if(_.isSource(e))return _.fromSource(e);throw new C(`expected ArrayBufferSource but got ${e}`,t)},!0),...e?[w.transform(w.string(),(t,n)=>{try{return e===`base64`?_.fromBase64(t):_.fromHex(t)}catch(e){throw new C(e.message,n)}},!0)]:[]])},w.extend(`lazy`,(e,t,n,r)=>(t.inner[x]||(t.inner=t.builder(),t.inner.meta={...t.meta,...t.inner.meta},A(t.inner,n.path,!0)),w.resolve(e,t.inner,n,r))),w.extend(`any`,e=>[e]),w.extend(`never`,(e,t,n)=>{throw new C(`expected nullable but got ${e}`,n)}),w.extend(`const`,(e,{value:t},n)=>{if(y(e,t))return[t];throw new C(`expected ${t} but got ${e}`,n)});function j(e,t,n,r,i=!1){let{max:a=1/0,min:o=-1/0}=t;if(e>a)throw new C(`expected ${n} <= ${a} but got ${e}`,r);if(e<o&&!i)throw new C(`expected ${n} >= ${o} but got ${e}`,r)}w.extend(`string`,(e,{meta:t},n)=>{if(typeof e!=`string`)throw new C(`expected string but got ${e}`,n);if(t.pattern){let r=new RegExp(t.pattern.source,t.pattern.flags);if(!r.test(e))throw new C(`expect string to match regexp ${r}`,n)}return j(e.length,t,`string length`,n),[e]});function M(e,t){let n=e.toString();if(n.includes(`e`))return e*10**t;let r=n.indexOf(`.`);if(r===-1)return e*10**t;let i=n.slice(r+1),a=n.slice(0,r);return i.length<=t?+(a+i.padEnd(t,`0`)):+(a+i.slice(0,t)+`.`+i.slice(t))}function N(e,t,n){if(n=Math.abs(n),!/^\d+\.\d+$/.test(n.toString()))return(e-t)%n===0;let r=n.toString().indexOf(`.`),i=n.toString().slice(r+1).length;return Math.abs(M(e,i)-M(t,i))%M(n,i)===0}w.extend(`number`,(e,{meta:t},n)=>{if(typeof e!=`number`)throw new C(`expected number but got ${e}`,n);j(e,t,`number`,n);let{step:r}=t;if(r&&!N(e,t.min??0,r))throw new C(`expected number multiple of ${r} but got ${e}`,n);return[e]}),w.extend(`boolean`,(e,t,n)=>{if(typeof e==`boolean`)return[e];throw new C(`expected boolean but got ${e}`,n)}),w.extend(`bitset`,(e,{bits:t,meta:n},r)=>{let i=0,a=[];if(typeof e==`number`){i=e;for(let n in t)e&t[n]&&a.push(n)}else if(Array.isArray(e)){a=e;for(let e of a){if(typeof e!=`string`)throw new C(`expected string but got ${e}`,r);e in t&&(i|=t[e])}}else throw new C(`expected number or array but got ${e}`,r);return i===n.default?[i]:[i,a]}),w.extend(`function`,(e,t,n)=>{if(typeof e==`function`)return[e];throw new C(`expected function but got ${e}`,n)}),w.extend(`is`,(e,{constructor:t},n)=>{if(typeof t==`function`){if(e instanceof t)return[e];throw new C(`expected ${t.name} but got ${e}`,n)}{if(a(e))throw new C(`expected ${t} but got ${e}`,n);let r=Object.getPrototypeOf(e);for(;r;){if(r.constructor?.name===t)return[e];r=Object.getPrototypeOf(r)}throw new C(`expected ${t} but got ${e}`,n)}});function P(e,t,n,r){try{let[i,a]=w.resolve(e[t],n,{...r,path:[...r.path||[],t]});return a!==void 0&&(e[t]=a),i}catch(i){if(!r?.autofix)throw i;return delete e[t],n.meta.volatile?f(n.meta.default):n.meta.default}}w.extend(`array`,(e,{inner:t,meta:n},r)=>{if(!Array.isArray(e))throw new C(`expected array but got ${e}`,r);return j(e.length,n,`array length`,r,!a(t.meta.default)),[e.map((n,i)=>P(e,i,t,r))]}),w.extend(`dict`,(e,{inner:t,sKey:n},r,i)=>{if(!o(e))throw new C(`expected object but got ${e}`,r);let a={};for(let o in e){let s;try{s=w.resolve(o,n,r)[0]}catch(e){if(i)continue;throw e}a[s]=P(e,o,t,r),e[s]=e[o],o!==s&&delete e[o]}return[a]}),w.extend(`tuple`,(e,{list:t},n,r)=>{if(!Array.isArray(e))throw new C(`expected array but got ${e}`,n);let i=t.map((t,r)=>P(e,r,t,n));return r||i.push(...e.slice(t.length)),[i]});function F(e,t){for(let n in t)n in e||(e[n]=t[n])}w.extend(`object`,(e,{dict:t},n,r)=>{if(!o(e))throw new C(`expected object but got ${e}`,n);let i={};for(let r in t){let o=P(e,r,t[r],n);(!a(o)||r in e)&&(i[r]=o)}return r||F(i,e),[i]}),w.extend(`union`,(e,{list:t,toString:n},r,i)=>{let a=[];for(let n of t)try{return w.resolve(e,n,r,i)}catch(e){a.push(e)}throw new C(`expected ${n()} but got ${JSON.stringify(e)}`,r)}),w.extend(`intersect`,(e,{list:t,toString:n},r,i)=>{if(!t.length)return[e];let s;for(let i of t){let t=w.resolve(e,i,r,!0)[0];if(!a(t)){if(a(s))s=t;else if(typeof s!=typeof t)throw new C(`expected ${n()} but got ${JSON.stringify(e)}`,r);else if(typeof t==`object`)F(s??={},t);else if(s!==t)throw new C(`expected ${n()} but got ${JSON.stringify(e)}`,r)}}return!i&&o(e)&&F(s,e),[s]}),w.extend(`transform`,(e,{inner:t,callback:n,preserve:r},i)=>{let[a,o=e]=w.resolve(e,t,i,!0);return r?[n(a)]:[n(a),n(o)]});let I={};function L(e,t,n){I[e]=n,Object.assign(w,{[e](...n){let r=new w({type:e});return t.forEach((e,t)=>{switch(e){case`sKey`:r.sKey=n[t]??w.string();break;case`inner`:r.inner=w.from(n[t]);break;case`list`:r.list=n[t].map(w.from);break;case`dict`:r.dict=c(n[t],w.from);break;case`bits`:r.bits={};for(let e in n[t])typeof n[t][e]==`number`&&(r.bits[e]=n[t][e]);break;case`callback`:{let e=r.callback=n[t];e.toJSON||=()=>e.toString();break}case`constructor`:{let e=r.constructor=n[t];typeof e==`function`&&(e.toJSON||=()=>e.name);break}default:r[e]=n[t]}}),e===`object`||e===`dict`?r.meta.default={}:e===`array`||e===`tuple`?r.meta.default=[]:e===`bitset`&&(r.meta.default=0),r}})}L(`is`,[`constructor`],({constructor:e})=>typeof e==`function`?e.name:e),L(`any`,[],()=>`any`),L(`never`,[],()=>`never`),L(`const`,[`value`],({value:e})=>typeof e==`string`?JSON.stringify(e):e),L(`string`,[],()=>`string`),L(`number`,[],()=>`number`),L(`boolean`,[],()=>`boolean`),L(`bitset`,[`bits`],()=>`bitset`),L(`function`,[],()=>`function`),L(`array`,[`inner`],({inner:e})=>`${e.toString(!0)}[]`),L(`dict`,[`inner`,`sKey`],({inner:e,sKey:t})=>`{ [key: ${t.toString()}]: ${e.toString()} }`),L(`tuple`,[`list`],({list:e})=>`[${e.map(e=>e.toString()).join(`, `)}]`),L(`object`,[`dict`],({dict:e})=>Object.keys(e).length===0?`{}`:`{ ${Object.entries(e).map(([e,t])=>`${e}${t.meta.required?``:`?`}: ${t.toString()}`).join(`, `)} }`),L(`union`,[`list`],({list:e},t)=>{let n=e.map(({toString:e})=>e()).join(` | `);return t?`(${n})`:n}),L(`intersect`,[`list`],({list:e})=>`${e.map(e=>e.toString(!0)).join(` & `)}`),L(`transform`,[`inner`,`callback`,`preserve`],({inner:e},t)=>e.toString(t));function R(e,t){return Array.isArray(e)?[...e]:typeof e==`object`&&e?{...e}:/^\d+$/.test(t)?[]:{}}function z(e,t){let n={...e},r=n;for(let e=0;e<t.length-1;e++){let n=t[e],i=R(Array.isArray(r)?r[Number(n)]:r[n],t[e+1]);Array.isArray(r)?r[Number(n)]=i:r[n]=i,r=i}return{result:n,parent:r,leaf:t[t.length-1]}}var B=class extends r.Service{constructor(e){super(e,`settingsSchema`)}rehydrate(e){return new w(e)}validate(e,t){try{e(t);return}catch(e){return e instanceof Error?e.message:String(e)}}nodeAtPath(e,t){let n=e;for(let e of t){if(n===void 0)return;if(n.type===`object`)n=n.dict?.[e];else if(n.type===`dict`||n.type===`array`)n=n.inner;else return}return n}getPath(e,t){let n=e;for(let e of t)if(Array.isArray(n))n=n[Number(e)];else{if(typeof n!=`object`||!n)return;n=n[e]}return n}hasPath(e,t){if(t.length===0)return e!==void 0;let n=this.getPath(e,t.slice(0,-1)),r=t[t.length-1];return Array.isArray(n)?Number(r)<n.length:typeof n!=`object`||!n?!1:r in n}setPath(e,t,n){if(t.length===0)throw Error(`ui-settings: setPath needs a non-empty path`);let{result:r,parent:i,leaf:a}=z(e,t);return Array.isArray(i)?i[Number(a)]=n:i[a]=n,r}deletePath(e,t){if(t.length===0)throw Error(`ui-settings: deletePath needs a non-empty path`);if(!this.hasPath(e,t))return e;let{result:n,parent:r,leaf:i}=z(e,t);return Array.isArray(r)?r.splice(Number(i),1):Reflect.deleteProperty(r,i),n}},V=class{scope;enabled;local=(0,i.createSnapshotStore)(!0);constructor(e){this.scope=e,this.enabled=e.getSnapshot().mode===`memory`?this.local:{getSnapshot:()=>e.getSnapshot().value?.enabled??!1,subscribe:t=>{let n=this.enabled.getSnapshot();return e.subscribe(()=>{let e=this.enabled.getSnapshot();e!==n&&(n=e,t())})}}}async setEnabled(e){if(this.scope.getSnapshot().mode===`memory`)this.local.set(e);else if(!await this.scope.set(`enabled`,e))throw Error(`Developer tools preference was not saved`)}};let H={enabled:w.boolean().default(!0)};w.object(H);let U=/* @__PURE__ */ new Set([`ui-theme`,`locale`,`ui-chat`,`ui-conversation`,`ui-settings`,`ui-workspace`]);function W(e){return U.has(e)}function G(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var K=class{schema;key;constructor(e,t){this.schema=t,this.key=`codexhost.web.preferences.v1:${e}`}read(e){let t;try{let n=JSON.parse(localStorage.getItem(this.key)??`null`);G(n)&&G(n.user)&&Number.isSafeInteger(n.revision)&&n.revision>=0&&this.valid(e,n.user)&&(t=n)}catch{}return t===void 0&&(t={user:G(e.user)?e.user:{},revision:0},this.valid(e,t.user)||(t.user={}),this.save(t)),{...e,...t,value:{...G(e.base)?e.base:{},...t.user}}}write(e,t,n){let r=this.read(e);if(n!==void 0&&n!==r.revision)return!1;let i={...G(r.user)?r.user:{}};for(let e of t){if(e.path.length!==1)return!1;let t=e.path[0];e.op===`set`?i={...i,[t]:e.value}:delete i[t]}return this.valid(e,i)?this.save({user:i,revision:r.revision+1}):!1}valid(e,t){try{return this.schema.validate(this.schema.rehydrate(e.schema),{...G(e.base)?e.base:{},...t})===void 0}catch{return!1}}save(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),!0}catch{return!1}}},q=class{ctx;spec;mirror;persistence;schema;store;tail=Promise.resolve();writeGeneration=0;disposed=!1;unsubscribe;browser;pendingRevision;constructor(e,t,n,r,a){if(this.ctx=e,this.spec=t,this.mirror=n,this.persistence=r,this.schema=a,this.browser=r===`browser`?new K(t.namespace,a):void 0,this.store=(0,i.createSnapshotStore)({status:r===`memory`?`unavailable`:`loading`,value:void 0,base:void 0,user:void 0,revision:void 0,writable:!1,mode:r}),r!==`memory`){let e=t.browserView===void 0?n.subscribe(()=>{this.derive()}):void 0,r=e=>{(e.key===null||e.key===this.browser?.key)&&this.derive()};this.browser!==void 0&&window.addEventListener(`storage`,r),this.unsubscribe=()=>{e?.(),this.browser!==void 0&&window.removeEventListener(`storage`,r)},this.derive()}}getSnapshot(){return this.store.getSnapshot()}subscribe(e){return this.store.subscribe(e)}updateBrowserView(e){if(this.browser===void 0||e.ns!==this.spec.namespace)throw Error(`ui-settings: browser view does not belong to this form`);this.spec.browserView=e,this.derive()}set(e,t){return this.mutate([{op:`set`,path:[e],value:t}])}unset(e){return this.mutate([{op:`unset`,path:[e]}])}mutate(e,t){let n=structuredClone(e),r=this.browser;if(r!==void 0)return this.enqueue(()=>{let e=this.spec.browserView??this.mirror.namespace(this.spec.namespace),i=e!==void 0&&r.write(e,n,t);return this.derive(),Promise.resolve(i)});let i=++this.writeGeneration;return this.enqueue(async()=>{let e=t??this.pendingRevision??this.getSnapshot().revision,r=await this.ctx.remote.settings.mutate(this.spec.namespace,n,e);return r.ok?(this.disposed||(i===this.writeGeneration?(this.pendingRevision=void 0,this.mirror.acceptView(r.value)):this.pendingRevision=r.value.revision),!0):(await this.recover(i),!1)})}async recover(e){this.disposed||e!==this.writeGeneration||(this.pendingRevision=void 0,await this.mirror.load())}async dispose(){this.disposed=!0,this.writeGeneration+=1,this.unsubscribe?.(),await this.tail}enqueue(e){if(this.persistence===`memory`||this.disposed)return Promise.resolve(!1);let t=this.tail.then(async()=>!this.disposed&&await e());return this.tail=t.then(()=>{},()=>{}),t}derive(){if(this.disposed)return;let e=this.mirror.getSnapshot();if(this.spec.browserView===void 0&&e.view===void 0)return;let t=e.view?.writable??!1,n=this.spec.browserView??this.mirror.namespace(this.spec.namespace);if(n===void 0){this.store.update(e=>{e.status=`unavailable`,e.writable=t});return}let r=this.browser?.read(n)??n,i=this.decode(r);this.store.update(e=>{e.revision=r.revision,e.base=r.base,e.user=r.user,e.writable=this.browser!==void 0||t,i!==void 0&&(e.status=`ready`,e.value=i)})}decode(e){if(this.spec.decode!==void 0)return this.spec.decode(e.value);if(typeof e.value!=`object`||e.value===null||Array.isArray(e.value))return;let t;try{t=this.schema.validate(this.schema.rehydrate(e.schema),e.value)}catch{return}return t===void 0?e.value:void 0}},J=class extends r.Service{forms=/* @__PURE__ */ new Map;developerTools;mirror;schema;persistence;owner;constructor(e,t){super(e,`configForms`),this.mirror=t.mirror,this.schema=t.schema,this.persistence=t.persistence,this.owner=e,this.developerTools=new V(this.get(`ui-settings`)),e.effect(()=>async()=>{await Promise.all([...this.forms.values()].map(e=>e.dispose())),this.forms.clear()},`ui-settings: configuration forms`)}describe(){return this.mirror}get(e){let t=this.forms.get(e);if(t!==void 0)return t;let n=new q(this.owner,{namespace:e},this.mirror,W(e)?`browser`:this.persistence,this.schema);return this.forms.set(e,n),this.mirror.ensure(),n}registerBrowser(e,t,n){if(!W(e))throw Error(`ui-settings: ${e} is not a browser preference namespace`);let r={ns:e,autoGenerate:!1,applies:`live`,secrets:[],schema:t,base:n,user:{},value:n,revision:0},i=this.forms.get(e);if(i!==void 0)return i.updateBrowserView(r),i;let a=new q(this.owner,{namespace:e,browserView:r},this.mirror,`browser`,this.schema);return this.forms.set(e,a),a}whileServed(e,t){let n,r=()=>{let r=new Set(this.mirror.getSnapshot().view?.namespaces.map(e=>e.ns)??[]),i=e.some(e=>r.has(e));i&&n===void 0?n=t(r):!i&&n!==void 0&&(n(),n=void 0)},i=this.mirror.subscribe(r);return this.mirror.ensure(),r(),()=>{i(),n?.(),n=void 0}}},Y=class{ctx;persistence;store;inFlight;rerun=!1;generation=0;constructor(e,t=`host`){this.ctx=e,this.persistence=t,this.store=(0,i.createSnapshotStore)({status:t===`host`?`idle`:`unavailable`,view:void 0,error:null})}getSnapshot(){return this.store.getSnapshot()}subscribe(e){return this.store.subscribe(e)}load(){if(this.persistence===`memory`)return Promise.resolve();if(this.inFlight!==void 0)return this.rerun=!0,this.inFlight;let e=Promise.resolve().then(()=>this.run());return this.inFlight=e,e}ensure(){return this.persistence===`memory`?Promise.resolve():this.inFlight===void 0?this.getSnapshot().status===`idle`?this.load():Promise.resolve():this.inFlight}acceptView(e){let t=this.store.getSnapshot();if(this.generation+=1,this.inFlight!==void 0&&(this.rerun=!0),t.view===void 0)return;let n=t.view.namespaces.some(t=>t.ns===e.ns)?t.view.namespaces.map(t=>t.ns===e.ns?e:t):[...t.view.namespaces,e];this.store.set({...t,view:{...t.view,namespaces:n}})}namespace(e){return this.store.getSnapshot().view?.namespaces.find(t=>t.ns===e)}async run(){try{do{let e=this.store.getSnapshot();e.status===`idle`&&this.store.set({...e,status:`loading`}),this.rerun=!1;let t=++this.generation,n;try{let e=await this.ctx.remote.settings.describe();n=e.ok?{view:e.value}:{failure:e.error.message}}catch(e){n={failure:e instanceof Error?e.message:String(e)}}if(t===this.generation){if(`view`in n)this.store.set({status:`ready`,view:n.view,error:null});else{let e=this.store.getSnapshot();this.store.set({status:e.view===void 0?`idle`:`ready`,view:e.view,error:n.failure})}}}while(this.shouldRerun())}finally{this.inFlight=void 0}}shouldRerun(){return this.rerun}};let X=[`remote`,`remote.settings`];function Z(e){let t=new B(e),n=`host`,r=new Y(e,n);e.effect(()=>{let t=[e.remote.$on(`settings/document-updated`,()=>{r.load()}),e.on(`connection/reset`,()=>{r.load()})];return r.ensure(),()=>{for(let e of t)e()}},`ui-settings: describe mirror invalidations`),new J(e,{mirror:r,schema:t,persistence:n})}return n.apply=Z,n.inject=X,t.exports}});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-settings-general`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("@deepseek-ai/dsh-client-ui-slots"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("@deepseek-ai/dsh-client-store"),o=e("react"),s=e("react-dom"),c=e("react/jsx-runtime");function l(){return(0,a.defineStore)({init:()=>({open:!1,activeId:void 0}),actions:{open:e=>{e.open=!0},close:e=>{e.open=!1,e.activeId=void 0},select:(e,t)=>{e.activeId=t},openSection:(e,t)=>{e.activeId=t,e.open=!0}}})}function u(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function d(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u(e))&&(r&&(r+=` `),r+=t);return r}let f=`@deepseek-ai/dsh-client-ui-settings-general/SettingsRoot.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(f)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=f,e.textContent=`.xLlTGq_triggerRow{flex:none;align-items:center;gap:8px;width:calc(100% + 4px);margin:4px -2px;display:flex;position:relative}.xLlTGq_triggerRow.xLlTGq_railRow{width:36px;margin:8px 0 10px}.xLlTGq_trigger{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;width:auto;min-width:0;height:42px;color:var(--dsw-alias-label-primary);background:0 0;border:none;flex:1;align-items:center;gap:8px;margin:0;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.xLlTGq_trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}.xLlTGq_trigger.xLlTGq_rail{flex:none;justify-content:center;gap:0;width:36px;height:36px;margin:0;padding:0}.xLlTGq_triggerLabel{white-space:nowrap;overflow:hidden}.xLlTGq_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.xLlTGq_mask{inset:var(--dsh-frame-chrome-top,0px) 0 0;background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute}.xLlTGq_panel{z-index:1;width:1040px;height:min(800px, calc(100vh - 2 * max(24px, var(--dsh-frame-overlay-top,24px))));border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-2);max-width:calc(100vw - 48px);box-shadow:var(--dsw-elevation-prominent);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);display:flex;position:relative;overflow:hidden}.xLlTGq_panel:focus{outline:none}.xLlTGq_nav{box-sizing:border-box;flex-direction:column;flex:none;gap:18px;width:188px;padding:22px 12px 0;display:flex}.xLlTGq_navTitle{color:var(--dsw-alias-label-primary);padding:0 12px;font-size:16px;font-weight:500;line-height:24px}.xLlTGq_navList{flex-direction:column;gap:4px;display:flex;overflow-y:auto}.xLlTGq_navCell{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;height:40px;color:var(--dsw-alias-label-primary);text-align:left;background:0 0;border:none;align-items:center;gap:8px;padding:9px 16px 9px 12px;font-family:inherit;font-size:14px;font-weight:400;line-height:22px;display:flex}.xLlTGq_navCell:hover{background:var(--dsw-specific-sidebar-nav-item-hover)}.xLlTGq_navCell.xLlTGq_active{background:var(--dsw-specific-sidebar-nav-item-active)}.xLlTGq_navIcon{flex:none}.xLlTGq_navLabel{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.xLlTGq_content{flex-direction:column;flex:1;min-width:0;display:flex}.xLlTGq_header{box-sizing:border-box;flex:none;justify-content:space-between;align-items:flex-start;gap:8px;height:54px;padding:20px 14px 8px 10px;display:flex}.xLlTGq_actions{justify-content:flex-end;align-items:center;gap:8px;min-width:0;margin-left:auto;display:flex}.xLlTGq_close{border-radius:var(--dsw-radius-sm);cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.xLlTGq_close:hover{background:var(--dsw-alias-interactive-bg-hover)}.xLlTGq_options{flex:1;min-height:0;padding:0 24px 24px;overflow-y:auto}@media (width<=600px){.xLlTGq_panel{max-width:calc(100vw - 24px);height:calc(100dvh - 2 * max(12px, env(safe-area-inset-top), env(safe-area-inset-bottom)));flex-direction:column}.xLlTGq_nav{gap:12px;width:100%;padding:16px 12px 8px}.xLlTGq_navTitle{padding:0 44px 0 4px}.xLlTGq_navList{flex-direction:row;overflow-x:auto}.xLlTGq_navCell{flex:none;height:44px}.xLlTGq_content{min-height:0}.xLlTGq_header{height:auto;padding:0 16px}.xLlTGq_close{width:44px;height:44px;position:absolute;top:6px;right:6px}.xLlTGq_options{padding:0 16px 16px}}.xLlTGq_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}`,document.head.appendChild(e)}var p={actions:`xLlTGq_actions`,active:`xLlTGq_active`,close:`xLlTGq_close`,content:`xLlTGq_content`,header:`xLlTGq_header`,hiddenLabel:`xLlTGq_hiddenLabel`,mask:`xLlTGq_mask`,nav:`xLlTGq_nav`,navCell:`xLlTGq_navCell`,navIcon:`xLlTGq_navIcon`,navLabel:`xLlTGq_navLabel`,navList:`xLlTGq_navList`,navTitle:`xLlTGq_navTitle`,options:`xLlTGq_options`,overlay:`xLlTGq_overlay`,panel:`xLlTGq_panel`,rail:`xLlTGq_rail`,railRow:`xLlTGq_railRow`,trigger:`xLlTGq_trigger`,triggerLabel:`xLlTGq_triggerLabel`,triggerRow:`xLlTGq_triggerRow`};let m=`@deepseek-ai/dsh-client-ui-settings-general/DesktopUpdateIndicator.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(m)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=m,e.textContent=`.kZjXEq_indicator{box-sizing:border-box;border:1px solid color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 20%, transparent);border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-brand-primary-new-colorprimary-new-color);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 8%, transparent);text-align:left;white-space:nowrap;cursor:pointer;flex:none;grid-template-columns:14px max-content;align-items:center;column-gap:4px;padding:0 8px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;display:inline-grid}.kZjXEq_icon{place-items:center;width:14px;height:14px;display:grid}.kZjXEq_badge{inset-inline-end:2px;corner-shape:round;background:var(--dsw-alias-brand-primary-new-colorprimary-new-color);border-radius:50%;width:6px;height:6px;position:absolute;top:2px}.kZjXEq_errorDot{corner-shape:round;background:currentColor;border-radius:50%;width:6px;height:6px}.kZjXEq_spinner{animation:1s linear infinite kZjXEq_spin}@keyframes kZjXEq_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.kZjXEq_spinner{animation:none}}.kZjXEq_indicator[aria-disabled=true]{cursor:default}`,document.head.appendChild(e)}var h={badge:`kZjXEq_badge`,errorDot:`kZjXEq_errorDot`,icon:`kZjXEq_icon`,indicator:`kZjXEq_indicator`,spin:`kZjXEq_spin`,spinner:`kZjXEq_spinner`};let g=/* @__PURE__ */ new Set([`checking`,`downloading`,`verifying`,`installing`]);function _(e,t){let n={idle:``,checking:t(`desktop.update.checking`),available:t(`desktop.update.available`),downloading:t(`desktop.update.progress`,{percent:e.percent??0}),verifying:t(`desktop.update.verifying`),installing:t(`desktop.update.installing`),ready:t(`desktop.update.ready`),error:t(`desktop.update.retry`)}[e.phase];return e.phase===`checking`||e.phase===`verifying`||e.phase===`installing`?{label:n,detail:e.version??n}:e.phase===`error`?{label:n,detail:{check:t(`desktop.update.checkFailed`),"check-network":t(`desktop.update.checkNetworkFailed`),download:t(`desktop.update.downloadFailed`),"download-network":t(`desktop.update.downloadNetworkFailed`),install:t(`desktop.update.installFailed`),"install-network":t(`desktop.update.installNetworkFailed`),"stop-failed":t(`desktop.update.stopFailed`),"tasks-changed":t(`desktop.update.tasksChanged`),"tasks-unavailable":t(`desktop.update.tasksUnavailable`)}[e.failure??`install`]}:e.phase===`downloading`&&e.version!==void 0?{label:n,detail:t(`desktop.update.downloadDetail`,{percent:e.percent??0,version:e.version})}:{label:n,detail:e.version===void 0?n:t(`desktop.update.versionDetail`,{label:n,version:e.version})}}function v({wide:e,hidden:t,t:n,view:r,onOpen:a}){let{presentation:o,failed:s,opening:l}=r;if(!e||t||!s&&(o===void 0||o.phase===`idle`))return null;let u=n(`desktop.update.retry`),d=o===void 0?{label:u,detail:u}:_(o,n),f=s?u:d.label,p=s||o?.phase===`error`,m=l||o!==void 0&&g.has(o.phase);return/* @__PURE__ */ (0,c.jsx)(i.Tooltip,{label:s?u:d.detail,side:`top`,children:/* @__PURE__ */ (0,c.jsxs)(`button`,{type:`button`,className:h.indicator,"aria-label":f,"aria-disabled":m,onClick:()=>{m||a()},children:[/* @__PURE__ */ (0,c.jsx)(`span`,{className:h.icon,"aria-hidden":`true`,children:p?/* @__PURE__ */ (0,c.jsx)(`span`,{className:h.errorDot}):m?/* @__PURE__ */ (0,c.jsx)(i.IconLoadingOutlineRegular,{className:h.spinner,size:14}):/* @__PURE__ */ (0,c.jsx)(i.IconDownloadOutlineRegular,{size:14})}),/* @__PURE__ */ (0,c.jsx)(`span`,{children:f})]})})}function y({useDesktopUpdate:e,useConnectionState:t,t:n}){let{presentation:r,failed:a}=e(e=>e),o=t(e=>e);if((o===`disconnected`||o===`connecting`)&&r?.phase!==`installing`||!a&&(r===void 0||r.phase===`idle`))return null;let s=n(`desktop.update.retry`),l=r===void 0?{label:s,detail:s}:_(r,n),u=a?s:l.label;return/* @__PURE__ */ (0,c.jsx)(i.Tooltip,{label:a?u:l.detail,side:`right`,children:/* @__PURE__ */ (0,c.jsx)(`span`,{role:`img`,"aria-label":u,className:h.badge})})}function b(e){return e===`account`||e===`codexhost-accounts`?/* @__PURE__ */ (0,c.jsx)(i.IconUserOutlineMedium,{className:p.navIcon,size:16}):e===`models`||e===`codexhost-usage-statistics`?/* @__PURE__ */ (0,c.jsx)(i.IconDataOutlineMedium,{className:p.navIcon,size:16}):e===`agent-presets`?/* @__PURE__ */ (0,c.jsx)(i.IconAgentPresetOutlineMedium,{className:p.navIcon,size:16}):e===`plugins`||e===`codexhost-connections`?/* @__PURE__ */ (0,c.jsx)(i.IconPersonalizationOutlineMedium,{className:p.navIcon,size:16}):e===`archived-sessions`?/* @__PURE__ */ (0,c.jsx)(i.IconArchiveOutlineMedium,{className:p.navIcon,size:16}):/* @__PURE__ */ (0,c.jsx)(i.IconSettingsOutlineMedium,{className:p.navIcon,size:16})}function x({rows:e,renderSlot:t,activeId:n,onSelect:r,onClose:a}){let l=e.find(e=>e.id===n)?.id??e[0]?.id,u=(0,o.useId)(),f=(0,o.useRef)(null);return(0,i.useModalLayer)(f,!0,a),(0,s.createPortal)(/* @__PURE__ */ (0,c.jsxs)(`div`,{className:p.overlay,role:`presentation`,children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.mask,"aria-hidden":`true`,onClick:a}),/* @__PURE__ */ (0,c.jsxs)(`div`,{ref:f,tabIndex:-1,"data-shortcut-modal":`settings`,className:p.panel,role:`dialog`,"aria-modal":`true`,"aria-labelledby":u,children:[/* @__PURE__ */ (0,c.jsxs)(`nav`,{className:p.nav,children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.navTitle,id:u,tabIndex:-1,"data-modal-autofocus":l===void 0?``:void 0,children:t(`settings.header`,{})}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.navList,children:e.map(e=>/* @__PURE__ */ (0,c.jsxs)(`button`,{type:`button`,className:d(p.navCell,e.id===l&&p.active),"aria-current":e.id===l?`true`:void 0,"data-modal-autofocus":e.id===l?``:void 0,onClick:()=>{r(e.id)},children:[b(e.id),/* @__PURE__ */ (0,c.jsx)(`span`,{className:p.navLabel,children:e.label})]},e.id))})]}),/* @__PURE__ */ (0,c.jsxs)(`div`,{className:p.content,children:[/* @__PURE__ */ (0,c.jsxs)(`div`,{className:p.header,children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.actions,children:t(`settings.action`,{})}),/* @__PURE__ */ (0,c.jsxs)(`button`,{type:`button`,className:p.close,onClick:a,children:[/* @__PURE__ */ (0,c.jsx)(i.IconCloseOutlineRegular,{size:14}),/* @__PURE__ */ (0,c.jsx)(`span`,{className:p.hiddenLabel,children:t(`settings.close`,{})})]})]}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.options,children:l!==void 0&&t(`settings.section`,{close:a},{only:l})})]})]})]}),document.body)}function S(e){let{wide:t,reconnect:n,useConnectionState:r,useSections:a,useOnboardingSteps:s,useSessions:l,renderSlot:u,t:f,useDesktopUpdate:m,openDesktopUpdate:h,useStore:g,actions:_,useShortcuts:y}=e,{open:b,activeId:S}=g(e=>e),C=y(e=>e.find(e=>e.id===`settings.open`)),{close:w,openSection:T}=_;(0,o.useEffect)(()=>{if(window.location.hash!==`#connect-devices`)return;T(`codexhost-connect-devices`);let e=new URL(window.location.href);e.hash=``,window.history.replaceState(window.history.state,``,e.href)},[T]);let[E,D]=(0,o.useState)(),[O,k]=(0,o.useState)(()=>/* @__PURE__ */ new Set),[A,j]=(0,o.useState)(!1),[M,N]=(0,o.useState)(!1),P=(0,o.useRef)(void 0),F=a(e=>e),I=m(e=>e),L=r(e=>e),R=(0,o.useRef)(L),z=s(e=>e),B=l(e=>{let t=Object.values(e.byId).find(e=>(e.retainedBy.mainView??0)>0);return e.phase===`ready`&&(t===void 0||t.blank)}),V=E===void 0?B?z.find(e=>!O.has(e.id)):void 0:z.find(e=>e.id===E);(0,o.useEffect)(()=>{B||k(/* @__PURE__ */ new Set)},[B]);let H=(0,o.useRef)(V);(0,o.useEffect)(()=>{let e=H.current===void 0&&V!==void 0;H.current=V,e&&b&&w()},[V,b,w]),(0,o.useLayoutEffect)(()=>{let e=R.current;R.current=L,L===`connected`?(e===`disconnected`||e===`connecting`)&&j(!0):j(!1)},[L]),(0,o.useLayoutEffect)(()=>{if(!A||M)return;let e=window.setTimeout(()=>{j(!1)},2e3);return()=>{window.clearTimeout(e)}},[A,M]),(0,o.useLayoutEffect)(()=>{if(L===`connecting`){P.current=Date.now();return}let e=P.current;if(e===void 0)return;P.current=void 0;let t=800-(Date.now()-e);if(t<=0)return;N(!0);let n=window.setTimeout(()=>{N(!1)},t);return()=>{window.clearTimeout(n),N(!1)}},[L]);let U=(0,o.useCallback)(e=>{D(void 0),k(t=>t.has(e)?t:/* @__PURE__ */ new Set([...t,e]))},[]),W;return L===`connecting`||M?W=`connecting`:L===`disconnected`?W=`disconnected`:A&&(W=`recovered`),/* @__PURE__ */ (0,c.jsxs)(c.Fragment,{children:[/* @__PURE__ */ (0,c.jsxs)(`div`,{className:d(p.triggerRow,!t&&p.railRow),children:[u(`settings.launcher`,{wide:t,settingsOpen:b,openSettings:_.open,...C?.keys.length?{settingsShortcut:{keys:C.keys,aria:C.aria}}:{},openOnboarding:e=>{w(),D(e)}},{fallback:/* @__PURE__ */ (0,c.jsx)(i.Tooltip,{disabled:b,label:f(`trigger`),shortcutKeys:C?.keys,children:/* @__PURE__ */ (0,c.jsx)(`button`,{type:`button`,className:d(p.trigger,!t&&p.rail),"aria-label":f(`trigger`),"aria-keyshortcuts":C?.aria,"aria-haspopup":`dialog`,"aria-expanded":b,onClick:()=>{_.open()},children:u(`settings.trigger`,{wide:t})})})}),/* @__PURE__ */ (0,c.jsx)(i.ConnectionIndicator,{state:t&&I.presentation?.phase!==`installing`?W:void 0,disconnectedLabel:f(`connection.error`),connectingLabel:f(`connection.connecting`),recoveredLabel:f(`connection.connected`),reconnectActionLabel:f(`connection.reconnect`),restartActionLabel:f(`connection.restart`),onReconnect:n}),/* @__PURE__ */ (0,c.jsx)(v,{wide:t,hidden:W!==void 0&&I.presentation?.phase!==`installing`,t:f,view:I,onOpen:h})]}),b&&/* @__PURE__ */ (0,c.jsx)(x,{rows:F,renderSlot:u,activeId:S,onSelect:_.select,onClose:w}),V!==void 0&&u(`settings.onboarding`,{stepId:V.id,explicit:E!==void 0,complete:()=>{U(V.id)},openSection:T},{only:V.id})]})}var C=class{bridge;store=(0,a.createSnapshotStore)({failed:!1,opening:!1});live=!0;received=!1;unsubscribe;constructor(e){this.bridge=e,this.unsubscribe=e?.subscribe(e=>{this.live&&(this.received=!0,this.store.set({...this.store.getSnapshot(),presentation:e,failed:!1}))}),e?.status().then(e=>{this.live&&!this.received&&this.store.set({...this.store.getSnapshot(),presentation:e})},()=>{this.live&&!this.received&&this.store.set({...this.store.getSnapshot(),failed:!0})})}open(){if(!this.live||this.bridge===void 0)return;let e=this.store.getSnapshot();e.opening||e.presentation!==void 0&&[`checking`,`downloading`,`verifying`,`installing`].includes(e.presentation.phase)||(this.store.set({...e,opening:!0}),this.bridge.open().catch(()=>{this.live&&this.store.set({...this.store.getSnapshot(),failed:!0})}).finally(()=>{this.live&&this.store.set({...this.store.getSnapshot(),opening:!1})}))}dispose(){this.live=!1,this.unsubscribe?.()}};let w=`@deepseek-ai/dsh-client-ui-settings-general/chrome.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(w)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=w,e.textContent=`.xYdq5q_triggerLabel{white-space:nowrap;overflow:hidden}`,document.head.appendChild(e)}var T={triggerLabel:`xYdq5q_triggerLabel`};function E({wide:e,t}){return/* @__PURE__ */ (0,c.jsxs)(c.Fragment,{children:[/* @__PURE__ */ (0,c.jsx)(i.IconSettingsOutlineMedium,{size:e?16:18}),e&&/* @__PURE__ */ (0,c.jsx)(`span`,{className:T.triggerLabel,children:t(`trigger`)})]})}function D({t:e}){return/* @__PURE__ */ (0,c.jsx)(c.Fragment,{children:e(`title`)})}function O({t:e}){return/* @__PURE__ */ (0,c.jsx)(c.Fragment,{children:e(`close`)})}let k=`@deepseek-ai/dsh-client-ui-settings-general/GeneralSection.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(k)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=k,e.textContent=`.jNGSqa_section{flex-direction:column;width:100%;display:flex}.jNGSqa_heading{margin-bottom:28px}.jNGSqa_title{color:var(--dsw-alias-label-primary);letter-spacing:-.5px;margin:0;font-size:24px;font-weight:600;line-height:32px}.jNGSqa_description{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.jNGSqa_group+.jNGSqa_group{margin-top:28px}.jNGSqa_groupTitle{color:var(--dsw-alias-label-primary);margin:0 0 10px;font-size:13px;font-weight:600;line-height:20px}.jNGSqa_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px}.jNGSqa_item{min-width:0;margin:0 20px}.jNGSqa_item+.jNGSqa_item{border-top:1px solid var(--dsw-alias-border-l1)}.jNGSqa_item>[data-slot="settings.general.item"]>*{border-bottom:none}.jNGSqa_footer{margin-top:8px}@media (width<=600px){.jNGSqa_heading{margin-bottom:24px}.jNGSqa_group+.jNGSqa_group{margin-top:24px}.jNGSqa_item{margin:0 12px}}`,document.head.appendChild(e)}var A={card:`jNGSqa_card`,description:`jNGSqa_description`,footer:`jNGSqa_footer`,group:`jNGSqa_group`,groupTitle:`jNGSqa_groupTitle`,heading:`jNGSqa_heading`,item:`jNGSqa_item`,section:`jNGSqa_section`,title:`jNGSqa_title`};let j=[{title:`general.display`,items:[`language`,`appearance`,`font-size`,`workspace.recent-navigation`]},{title:`general.interaction`,items:[`transcript-view`,`developer-tools`,`shortcuts`,`link-opening`,`composer-enter`]},{title:`general.notifications`,items:[`codexhost.notifications`]}],M=new Set(j.flatMap(e=>e.items));function N({renderSlot:e,t,useItems:n}){let r=(0,o.useId)(),i=n(e=>e),a=j.map(e=>({title:e.title,items:i.filter(t=>e.items.includes(t))}));return a.push({title:`general.other`,items:i.filter(e=>e!==`current-version`&&!M.has(e))}),/* @__PURE__ */ (0,c.jsxs)(`div`,{className:A.section,children:[/* @__PURE__ */ (0,c.jsxs)(`header`,{className:A.heading,children:[/* @__PURE__ */ (0,c.jsx)(`h2`,{className:A.title,children:t(`general.nav`)}),/* @__PURE__ */ (0,c.jsx)(`p`,{className:A.description,children:t(`general.description`)})]}),a.filter(e=>e.items.length>0).map(n=>/* @__PURE__ */ (0,c.jsxs)(`section`,{className:A.group,"aria-labelledby":`${r}-${n.title}`,children:[/* @__PURE__ */ (0,c.jsx)(`h3`,{className:A.groupTitle,id:`${r}-${n.title}`,children:t(n.title)}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:A.card,children:n.items.map(t=>/* @__PURE__ */ (0,c.jsx)(`div`,{className:A.item,children:e(`settings.general.item`,{},{only:t})},t))})]},n.title)),i.includes(`current-version`)&&/* @__PURE__ */ (0,c.jsx)(`div`,{className:A.footer,children:e(`settings.general.item`,{},{only:`current-version`})})]})}let P=`@deepseek-ai/dsh-client-ui-settings-general/CurrentVersionRow.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(P)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=P,e.textContent=`.QE76Ba_row{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;padding:16px 0;font-size:14px;line-height:22px}`,document.head.appendChild(e)}var F={row:`QE76Ba_row`};function I({t:e}){let t={}.DSH_CLIENT_VERSION;return t===void 0?null:/* @__PURE__ */ (0,c.jsx)(`div`,{className:F.row,children:e(`general.currentVersion`,{version:t})})}let L=`@deepseek-ai/dsh-client-ui-settings-general/DeveloperToolsRow.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(L)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=L,e.textContent=`.yszu3a_row{border-bottom:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:24px;padding:16px 0;display:flex}.yszu3a_title{font-size:14px;line-height:20px}.yszu3a_description{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px;line-height:18px}`,document.head.appendChild(e)}var R={description:`yszu3a_description`,row:`yszu3a_row`,title:`yszu3a_title`};function z({useDeveloperTools:e,setEnabled:t,t:n}){let r=e(e=>e),[a,s]=(0,o.useState)(!1),[l,u]=(0,o.useState)(!1);return/* @__PURE__ */ (0,c.jsxs)(`div`,{className:R.row,children:[/* @__PURE__ */ (0,c.jsxs)(`div`,{children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:R.title,children:n(`developerTools.title`)}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:R.description,children:n(`developerTools.description`)}),l&&/* @__PURE__ */ (0,c.jsx)(`div`,{role:`alert`,children:n(`developerTools.error`)})]}),/* @__PURE__ */ (0,c.jsx)(i.Switch,{checked:r,disabled:a,label:n(`developerTools.title`),onChange:e=>{u(!1),s(!0),t(e).catch(()=>{u(!0)}).finally(()=>{s(!1)})}})]})}let B=`@deepseek-ai/dsh-client-ui-settings-general/SettingsDocumentAction.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(B)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=B,e.textContent=`.P1hEBq_action{align-items:center;gap:8px;min-width:0;display:flex}.P1hEBq_error{max-width:180px;color:var(--dsw-alias-state-error-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}`,document.head.appendChild(e)}var V={action:`P1hEBq_action`,error:`P1hEBq_error`};function H({controller:e,useSnapshot:t,t:n}){let r=t(e=>e);return(0,o.useEffect)(()=>{e.load()},[e]),r.status===`ready`?/* @__PURE__ */ (0,c.jsxs)(`div`,{className:V.action,children:[r.error===null?null:/* @__PURE__ */ (0,c.jsx)(`span`,{className:V.error,role:`alert`,children:n(`openDocument.error`)}),/* @__PURE__ */ (0,c.jsx)(i.Button,{variant:`outline`,size:`sm`,disabled:r.opening,onClick:()=>{e.open()},children:n(`openDocument`)})]}):null}var U=class{ctx;describeFace;store=(0,a.createSnapshotStore)({status:`idle`,opening:!1,error:null});following;constructor(e,t){this.ctx=e,this.describeFace=t}async load(){this.following??=this.describeFace.subscribe(()=>{this.derive()}),this.store.update(e=>{e.status=`loading`,e.error=null}),await this.describeFace.ensure(),this.derive()}async open(){let e=this.store.getSnapshot();if(!(e.status!==`ready`||e.opening)){this.store.update(e=>{e.opening=!0,e.error=null});try{let e=await this.ctx.remote.settings.openSettingsDocument();if(!e.ok){let{message:t}=e.error;this.store.update(e=>{e.error=t})}}finally{this.store.update(e=>{e.opening=!1})}}}dispose(){this.following?.(),this.following=void 0}derive(){let e=this.describeFace.getSnapshot();if(e.view===void 0){e.error!==null&&this.store.update(t=>{t.status=`unavailable`,t.error=e.error});return}let{hasDocument:t}=e.view;this.store.update(e=>{e.status=t?`ready`:`unavailable`,e.error=null})}};let W={trigger:`设置`,"shortcut.open":`打开设置`,"desktop.update.available":`新版本`,"desktop.update.checking":`正在检查更新…`,"desktop.update.progress":`{percent}%`,"desktop.update.verifying":`正在校验更新文件…`,"desktop.update.installing":`正在准备重启…`,"desktop.update.ready":`安装并重启`,"desktop.update.retry":`重试更新`,"desktop.update.versionDetail":`{label}:{version}`,"desktop.update.downloadDetail":`正在下载更新:{percent}%
|
|
2
|
-
目标版本:{version}`,"desktop.update.checkFailed":`检查更新失败,请稍后重试。`,"desktop.update.downloadFailed":`下载更新失败,请重试。`,"desktop.update.installFailed":`安装更新失败,请稍后重试。`,"desktop.update.checkNetworkFailed":`检查更新失败,请检查网络连接后重试。`,"desktop.update.downloadNetworkFailed":`下载更新失败,请检查网络连接后重试。`,"desktop.update.installNetworkFailed":`安装更新失败,请检查网络连接后重试。`,"desktop.update.stopFailed":`未能安全停止任务,更新尚未安装,请稍后重试。`,"desktop.update.tasksChanged":`有新任务开始运行,请重新确认是否停止任务并更新。`,"desktop.update.tasksUnavailable":`无法确认任务状态,请在工作区就绪后重试更新。`,title:`设置`,close:`关闭`,openDocument:`打开配置文件`,"openDocument.error":`无法打开配置文件`,"general.nav":`通用设置`,"general.description":`调整界面显示、阅读与交互偏好。`,"general.display":`显示与语言`,"general.interaction":`交互与阅读`,"general.
|
|
3
|
-
Target version: {version}`,"desktop.update.checkFailed":`Could not check for updates. Please try again later.`,"desktop.update.downloadFailed":`Could not download the update. Please try again.`,"desktop.update.installFailed":`Could not install the update. Please try again later.`,"desktop.update.checkNetworkFailed":`Could not check for updates. Check your connection and try again.`,"desktop.update.downloadNetworkFailed":`Could not download the update. Check your connection and try again.`,"desktop.update.installNetworkFailed":`Could not install the update. Check your connection and try again.`,"desktop.update.stopFailed":`Could not safely stop the tasks. The update has not been installed. Please try again later.`,"desktop.update.tasksChanged":`New tasks have started. Confirm again to stop the tasks and update.`,"desktop.update.tasksUnavailable":`Task status is unavailable. Try updating again when the workspace is ready.`,title:`Settings`,close:`Close`,openDocument:`Open configuration file`,"openDocument.error":`Could not open configuration file`,"general.nav":`General`,"general.description":`Adjust your display, reading, and interaction preferences.`,"general.display":`Display & language`,"general.interaction":`Interaction & reading`,"general.
|
|
1
|
+
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-settings-general`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("@deepseek-ai/dsh-client-ui-slots"),i=e("@deepseek-ai/dsh-client-ui-primitives"),a=e("@deepseek-ai/dsh-client-store"),o=e("react"),s=e("react-dom"),c=e("react/jsx-runtime");function l(){return(0,a.defineStore)({init:()=>({open:!1,activeId:void 0}),actions:{open:e=>{e.open=!0},close:e=>{e.open=!1,e.activeId=void 0},select:(e,t)=>{e.activeId=t},openSection:(e,t)=>{e.activeId=t,e.open=!0}}})}function u(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=u(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function d(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=u(e))&&(r&&(r+=` `),r+=t);return r}let f=`@deepseek-ai/dsh-client-ui-settings-general/SettingsRoot.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(f)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=f,e.textContent=`.xLlTGq_triggerRow{flex:none;align-items:center;gap:8px;width:calc(100% + 4px);margin:4px -2px;display:flex;position:relative}.xLlTGq_triggerRow.xLlTGq_railRow{width:36px;margin:8px 0 10px}.xLlTGq_trigger{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;width:auto;min-width:0;height:42px;color:var(--dsw-alias-label-primary);background:0 0;border:none;flex:1;align-items:center;gap:8px;margin:0;padding:0 10px 0 8px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.xLlTGq_trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}.xLlTGq_trigger.xLlTGq_rail{flex:none;justify-content:center;gap:0;width:36px;height:36px;margin:0;padding:0}.xLlTGq_triggerLabel{white-space:nowrap;overflow:hidden}.xLlTGq_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.xLlTGq_mask{inset:var(--dsh-frame-chrome-top,0px) 0 0;background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute}.xLlTGq_panel{z-index:1;width:1040px;height:min(800px, calc(100vh - 2 * max(24px, var(--dsh-frame-overlay-top,24px))));border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-2);max-width:calc(100vw - 48px);box-shadow:var(--dsw-elevation-prominent);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);display:flex;position:relative;overflow:hidden}.xLlTGq_panel:focus{outline:none}.xLlTGq_nav{box-sizing:border-box;flex-direction:column;flex:none;gap:18px;width:188px;padding:22px 12px 0;display:flex}.xLlTGq_navTitle{color:var(--dsw-alias-label-primary);padding:0 12px;font-size:16px;font-weight:500;line-height:24px}.xLlTGq_navList{flex-direction:column;gap:4px;display:flex;overflow-y:auto}.xLlTGq_navCell{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;height:40px;color:var(--dsw-alias-label-primary);text-align:left;background:0 0;border:none;align-items:center;gap:8px;padding:9px 16px 9px 12px;font-family:inherit;font-size:14px;font-weight:400;line-height:22px;display:flex}.xLlTGq_navCell:hover{background:var(--dsw-specific-sidebar-nav-item-hover)}.xLlTGq_navCell.xLlTGq_active{background:var(--dsw-specific-sidebar-nav-item-active)}.xLlTGq_navIcon{flex:none}.xLlTGq_navLabel{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.xLlTGq_content{flex-direction:column;flex:1;min-width:0;display:flex}.xLlTGq_header{box-sizing:border-box;flex:none;justify-content:space-between;align-items:flex-start;gap:8px;height:54px;padding:20px 14px 8px 10px;display:flex}.xLlTGq_actions{justify-content:flex-end;align-items:center;gap:8px;min-width:0;margin-left:auto;display:flex}.xLlTGq_close{border-radius:var(--dsw-radius-sm);cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.xLlTGq_close:hover{background:var(--dsw-alias-interactive-bg-hover)}.xLlTGq_options{flex:1;min-height:0;padding:0 24px 24px;overflow-y:auto}@media (width<=600px){.xLlTGq_panel{max-width:calc(100vw - 24px);height:calc(100dvh - 2 * max(12px, env(safe-area-inset-top), env(safe-area-inset-bottom)));flex-direction:column}.xLlTGq_nav{gap:12px;width:100%;padding:16px 12px 8px}.xLlTGq_navTitle{padding:0 44px 0 4px}.xLlTGq_navList{flex-direction:row;overflow-x:auto}.xLlTGq_navCell{flex:none;height:44px}.xLlTGq_content{min-height:0}.xLlTGq_header{height:auto;padding:0 16px}.xLlTGq_close{width:44px;height:44px;position:absolute;top:6px;right:6px}.xLlTGq_options{padding:0 16px 16px}}.xLlTGq_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}`,document.head.appendChild(e)}var p={actions:`xLlTGq_actions`,active:`xLlTGq_active`,close:`xLlTGq_close`,content:`xLlTGq_content`,header:`xLlTGq_header`,hiddenLabel:`xLlTGq_hiddenLabel`,mask:`xLlTGq_mask`,nav:`xLlTGq_nav`,navCell:`xLlTGq_navCell`,navIcon:`xLlTGq_navIcon`,navLabel:`xLlTGq_navLabel`,navList:`xLlTGq_navList`,navTitle:`xLlTGq_navTitle`,options:`xLlTGq_options`,overlay:`xLlTGq_overlay`,panel:`xLlTGq_panel`,rail:`xLlTGq_rail`,railRow:`xLlTGq_railRow`,trigger:`xLlTGq_trigger`,triggerLabel:`xLlTGq_triggerLabel`,triggerRow:`xLlTGq_triggerRow`};let m=`@deepseek-ai/dsh-client-ui-settings-general/DesktopUpdateIndicator.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(m)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=m,e.textContent=`.kZjXEq_indicator{box-sizing:border-box;border:1px solid color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 20%, transparent);border-radius:var(--dsw-radius-sm);height:28px;color:var(--dsw-alias-brand-primary-new-colorprimary-new-color);background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 8%, transparent);text-align:left;white-space:nowrap;cursor:pointer;flex:none;grid-template-columns:14px max-content;align-items:center;column-gap:4px;padding:0 8px;font-family:inherit;font-size:12px;font-weight:500;line-height:18px;display:inline-grid}.kZjXEq_icon{place-items:center;width:14px;height:14px;display:grid}.kZjXEq_badge{inset-inline-end:2px;corner-shape:round;background:var(--dsw-alias-brand-primary-new-colorprimary-new-color);border-radius:50%;width:6px;height:6px;position:absolute;top:2px}.kZjXEq_errorDot{corner-shape:round;background:currentColor;border-radius:50%;width:6px;height:6px}.kZjXEq_spinner{animation:1s linear infinite kZjXEq_spin}@keyframes kZjXEq_spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.kZjXEq_spinner{animation:none}}.kZjXEq_indicator[aria-disabled=true]{cursor:default}`,document.head.appendChild(e)}var h={badge:`kZjXEq_badge`,errorDot:`kZjXEq_errorDot`,icon:`kZjXEq_icon`,indicator:`kZjXEq_indicator`,spin:`kZjXEq_spin`,spinner:`kZjXEq_spinner`};let g=/* @__PURE__ */ new Set([`checking`,`downloading`,`verifying`,`installing`]);function _(e,t){let n={idle:``,checking:t(`desktop.update.checking`),available:t(`desktop.update.available`),downloading:t(`desktop.update.progress`,{percent:e.percent??0}),verifying:t(`desktop.update.verifying`),installing:t(`desktop.update.installing`),ready:t(`desktop.update.ready`),error:t(`desktop.update.retry`)}[e.phase];return e.phase===`checking`||e.phase===`verifying`||e.phase===`installing`?{label:n,detail:e.version??n}:e.phase===`error`?{label:n,detail:{check:t(`desktop.update.checkFailed`),"check-network":t(`desktop.update.checkNetworkFailed`),download:t(`desktop.update.downloadFailed`),"download-network":t(`desktop.update.downloadNetworkFailed`),install:t(`desktop.update.installFailed`),"install-network":t(`desktop.update.installNetworkFailed`),"stop-failed":t(`desktop.update.stopFailed`),"tasks-changed":t(`desktop.update.tasksChanged`),"tasks-unavailable":t(`desktop.update.tasksUnavailable`)}[e.failure??`install`]}:e.phase===`downloading`&&e.version!==void 0?{label:n,detail:t(`desktop.update.downloadDetail`,{percent:e.percent??0,version:e.version})}:{label:n,detail:e.version===void 0?n:t(`desktop.update.versionDetail`,{label:n,version:e.version})}}function v({wide:e,hidden:t,t:n,view:r,onOpen:a}){let{presentation:o,failed:s,opening:l}=r;if(!e||t||!s&&(o===void 0||o.phase===`idle`))return null;let u=n(`desktop.update.retry`),d=o===void 0?{label:u,detail:u}:_(o,n),f=s?u:d.label,p=s||o?.phase===`error`,m=l||o!==void 0&&g.has(o.phase);return/* @__PURE__ */ (0,c.jsx)(i.Tooltip,{label:s?u:d.detail,side:`top`,children:/* @__PURE__ */ (0,c.jsxs)(`button`,{type:`button`,className:h.indicator,"aria-label":f,"aria-disabled":m,onClick:()=>{m||a()},children:[/* @__PURE__ */ (0,c.jsx)(`span`,{className:h.icon,"aria-hidden":`true`,children:p?/* @__PURE__ */ (0,c.jsx)(`span`,{className:h.errorDot}):m?/* @__PURE__ */ (0,c.jsx)(i.IconLoadingOutlineRegular,{className:h.spinner,size:14}):/* @__PURE__ */ (0,c.jsx)(i.IconDownloadOutlineRegular,{size:14})}),/* @__PURE__ */ (0,c.jsx)(`span`,{children:f})]})})}function y({useDesktopUpdate:e,useConnectionState:t,t:n}){let{presentation:r,failed:a}=e(e=>e),o=t(e=>e);if((o===`disconnected`||o===`connecting`)&&r?.phase!==`installing`||!a&&(r===void 0||r.phase===`idle`))return null;let s=n(`desktop.update.retry`),l=r===void 0?{label:s,detail:s}:_(r,n),u=a?s:l.label;return/* @__PURE__ */ (0,c.jsx)(i.Tooltip,{label:a?u:l.detail,side:`right`,children:/* @__PURE__ */ (0,c.jsx)(`span`,{role:`img`,"aria-label":u,className:h.badge})})}function b(e){return e===`account`||e===`codexhost-accounts`?/* @__PURE__ */ (0,c.jsx)(i.IconUserOutlineMedium,{className:p.navIcon,size:16}):e===`models`||e===`codexhost-usage-statistics`?/* @__PURE__ */ (0,c.jsx)(i.IconDataOutlineMedium,{className:p.navIcon,size:16}):e===`agent-presets`?/* @__PURE__ */ (0,c.jsx)(i.IconAgentPresetOutlineMedium,{className:p.navIcon,size:16}):e===`plugins`||e===`codexhost-connections`?/* @__PURE__ */ (0,c.jsx)(i.IconPersonalizationOutlineMedium,{className:p.navIcon,size:16}):e===`archived-sessions`?/* @__PURE__ */ (0,c.jsx)(i.IconArchiveOutlineMedium,{className:p.navIcon,size:16}):/* @__PURE__ */ (0,c.jsx)(i.IconSettingsOutlineMedium,{className:p.navIcon,size:16})}function x({rows:e,renderSlot:t,activeId:n,onSelect:r,onClose:a}){let l=e.find(e=>e.id===n)?.id??e[0]?.id,u=(0,o.useId)(),f=(0,o.useRef)(null);return(0,i.useModalLayer)(f,!0,a),(0,s.createPortal)(/* @__PURE__ */ (0,c.jsxs)(`div`,{className:p.overlay,role:`presentation`,children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.mask,"aria-hidden":`true`,onClick:a}),/* @__PURE__ */ (0,c.jsxs)(`div`,{ref:f,tabIndex:-1,"data-shortcut-modal":`settings`,className:p.panel,role:`dialog`,"aria-modal":`true`,"aria-labelledby":u,children:[/* @__PURE__ */ (0,c.jsxs)(`nav`,{className:p.nav,children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.navTitle,id:u,tabIndex:-1,"data-modal-autofocus":l===void 0?``:void 0,children:t(`settings.header`,{})}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.navList,children:e.map(e=>/* @__PURE__ */ (0,c.jsxs)(`button`,{type:`button`,className:d(p.navCell,e.id===l&&p.active),"aria-current":e.id===l?`true`:void 0,"data-modal-autofocus":e.id===l?``:void 0,onClick:()=>{r(e.id)},children:[b(e.id),/* @__PURE__ */ (0,c.jsx)(`span`,{className:p.navLabel,children:e.label})]},e.id))})]}),/* @__PURE__ */ (0,c.jsxs)(`div`,{className:p.content,children:[/* @__PURE__ */ (0,c.jsxs)(`div`,{className:p.header,children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.actions,children:t(`settings.action`,{})}),/* @__PURE__ */ (0,c.jsxs)(`button`,{type:`button`,className:p.close,onClick:a,children:[/* @__PURE__ */ (0,c.jsx)(i.IconCloseOutlineRegular,{size:14}),/* @__PURE__ */ (0,c.jsx)(`span`,{className:p.hiddenLabel,children:t(`settings.close`,{})})]})]}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:p.options,children:l!==void 0&&t(`settings.section`,{close:a},{only:l})})]})]})]}),document.body)}function S(e){let{wide:t,reconnect:n,useConnectionState:r,useSections:a,useOnboardingSteps:s,useSessions:l,renderSlot:u,t:f,useDesktopUpdate:m,openDesktopUpdate:h,useStore:g,actions:_,useShortcuts:y}=e,{open:b,activeId:S}=g(e=>e),C=y(e=>e.find(e=>e.id===`settings.open`)),{close:w,openSection:T}=_;(0,o.useEffect)(()=>{if(window.location.hash!==`#connect-devices`)return;T(`codexhost-connect-devices`);let e=new URL(window.location.href);e.hash=``,window.history.replaceState(window.history.state,``,e.href)},[T]);let[E,D]=(0,o.useState)(),[O,k]=(0,o.useState)(()=>/* @__PURE__ */ new Set),[A,j]=(0,o.useState)(!1),[M,N]=(0,o.useState)(!1),P=(0,o.useRef)(void 0),F=a(e=>e),I=m(e=>e),L=r(e=>e),R=(0,o.useRef)(L),z=s(e=>e),B=l(e=>{let t=Object.values(e.byId).find(e=>(e.retainedBy.mainView??0)>0);return e.phase===`ready`&&(t===void 0||t.blank)}),V=E===void 0?B?z.find(e=>!O.has(e.id)):void 0:z.find(e=>e.id===E);(0,o.useEffect)(()=>{B||k(/* @__PURE__ */ new Set)},[B]);let H=(0,o.useRef)(V);(0,o.useEffect)(()=>{let e=H.current===void 0&&V!==void 0;H.current=V,e&&b&&w()},[V,b,w]),(0,o.useLayoutEffect)(()=>{let e=R.current;R.current=L,L===`connected`?(e===`disconnected`||e===`connecting`)&&j(!0):j(!1)},[L]),(0,o.useLayoutEffect)(()=>{if(!A||M)return;let e=window.setTimeout(()=>{j(!1)},2e3);return()=>{window.clearTimeout(e)}},[A,M]),(0,o.useLayoutEffect)(()=>{if(L===`connecting`){P.current=Date.now();return}let e=P.current;if(e===void 0)return;P.current=void 0;let t=800-(Date.now()-e);if(t<=0)return;N(!0);let n=window.setTimeout(()=>{N(!1)},t);return()=>{window.clearTimeout(n),N(!1)}},[L]);let U=(0,o.useCallback)(e=>{D(void 0),k(t=>t.has(e)?t:/* @__PURE__ */ new Set([...t,e]))},[]),W;return L===`connecting`||M?W=`connecting`:L===`disconnected`?W=`disconnected`:A&&(W=`recovered`),/* @__PURE__ */ (0,c.jsxs)(c.Fragment,{children:[/* @__PURE__ */ (0,c.jsxs)(`div`,{className:d(p.triggerRow,!t&&p.railRow),children:[u(`settings.launcher`,{wide:t,settingsOpen:b,openSettings:_.open,...C?.keys.length?{settingsShortcut:{keys:C.keys,aria:C.aria}}:{},openOnboarding:e=>{w(),D(e)}},{fallback:/* @__PURE__ */ (0,c.jsx)(i.Tooltip,{disabled:b,label:f(`trigger`),shortcutKeys:C?.keys,children:/* @__PURE__ */ (0,c.jsx)(`button`,{type:`button`,className:d(p.trigger,!t&&p.rail),"aria-label":f(`trigger`),"aria-keyshortcuts":C?.aria,"aria-haspopup":`dialog`,"aria-expanded":b,onClick:()=>{_.open()},children:u(`settings.trigger`,{wide:t})})})}),/* @__PURE__ */ (0,c.jsx)(i.ConnectionIndicator,{state:t&&I.presentation?.phase!==`installing`?W:void 0,disconnectedLabel:f(`connection.error`),connectingLabel:f(`connection.connecting`),recoveredLabel:f(`connection.connected`),reconnectActionLabel:f(`connection.reconnect`),restartActionLabel:f(`connection.restart`),onReconnect:n}),/* @__PURE__ */ (0,c.jsx)(v,{wide:t,hidden:W!==void 0&&I.presentation?.phase!==`installing`,t:f,view:I,onOpen:h})]}),b&&/* @__PURE__ */ (0,c.jsx)(x,{rows:F,renderSlot:u,activeId:S,onSelect:_.select,onClose:w}),V!==void 0&&u(`settings.onboarding`,{stepId:V.id,explicit:E!==void 0,complete:()=>{U(V.id)},openSection:T},{only:V.id})]})}var C=class{bridge;store=(0,a.createSnapshotStore)({failed:!1,opening:!1});live=!0;received=!1;unsubscribe;constructor(e){this.bridge=e,this.unsubscribe=e?.subscribe(e=>{this.live&&(this.received=!0,this.store.set({...this.store.getSnapshot(),presentation:e,failed:!1}))}),e?.status().then(e=>{this.live&&!this.received&&this.store.set({...this.store.getSnapshot(),presentation:e})},()=>{this.live&&!this.received&&this.store.set({...this.store.getSnapshot(),failed:!0})})}open(){if(!this.live||this.bridge===void 0)return;let e=this.store.getSnapshot();e.opening||e.presentation!==void 0&&[`checking`,`downloading`,`verifying`,`installing`].includes(e.presentation.phase)||(this.store.set({...e,opening:!0}),this.bridge.open().catch(()=>{this.live&&this.store.set({...this.store.getSnapshot(),failed:!0})}).finally(()=>{this.live&&this.store.set({...this.store.getSnapshot(),opening:!1})}))}dispose(){this.live=!1,this.unsubscribe?.()}};let w=`@deepseek-ai/dsh-client-ui-settings-general/chrome.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(w)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=w,e.textContent=`.xYdq5q_triggerLabel{white-space:nowrap;overflow:hidden}`,document.head.appendChild(e)}var T={triggerLabel:`xYdq5q_triggerLabel`};function E({wide:e,t}){return/* @__PURE__ */ (0,c.jsxs)(c.Fragment,{children:[/* @__PURE__ */ (0,c.jsx)(i.IconSettingsOutlineMedium,{size:e?16:18}),e&&/* @__PURE__ */ (0,c.jsx)(`span`,{className:T.triggerLabel,children:t(`trigger`)})]})}function D({t:e}){return/* @__PURE__ */ (0,c.jsx)(c.Fragment,{children:e(`title`)})}function O({t:e}){return/* @__PURE__ */ (0,c.jsx)(c.Fragment,{children:e(`close`)})}let k=`@deepseek-ai/dsh-client-ui-settings-general/GeneralSection.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(k)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=k,e.textContent=`.jNGSqa_section{flex-direction:column;width:100%;display:flex}.jNGSqa_heading{margin-bottom:28px}.jNGSqa_title{color:var(--dsw-alias-label-primary);letter-spacing:-.5px;margin:0;font-size:24px;font-weight:600;line-height:32px}.jNGSqa_description{color:var(--dsw-alias-label-secondary);margin:8px 0 0;font-size:13px;line-height:20px}.jNGSqa_group+.jNGSqa_group{margin-top:28px}.jNGSqa_groupTitle{color:var(--dsw-alias-label-primary);margin:0 0 10px;font-size:13px;font-weight:600;line-height:20px}.jNGSqa_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px}.jNGSqa_item{min-width:0;margin:0 20px}.jNGSqa_item+.jNGSqa_item{border-top:1px solid var(--dsw-alias-border-l1)}.jNGSqa_item>[data-slot="settings.general.item"]>*{border-bottom:none}.jNGSqa_footer{margin-top:8px}@media (width<=600px){.jNGSqa_heading{margin-bottom:20px}.jNGSqa_title{font-size:20px;line-height:28px}.jNGSqa_description{margin-top:4px}.jNGSqa_group+.jNGSqa_group{margin-top:24px}.jNGSqa_item{margin:0 12px}}`,document.head.appendChild(e)}var A={card:`jNGSqa_card`,description:`jNGSqa_description`,footer:`jNGSqa_footer`,group:`jNGSqa_group`,groupTitle:`jNGSqa_groupTitle`,heading:`jNGSqa_heading`,item:`jNGSqa_item`,section:`jNGSqa_section`,title:`jNGSqa_title`};let j=[{title:`general.appAndNotifications`,items:[`codexhost.notifications`,`codexhost.pwa-install`]},{title:`general.display`,items:[`language`,`appearance`,`font-size`,`workspace.recent-navigation`]},{title:`general.interaction`,items:[`transcript-view`,`developer-tools`,`shortcuts`,`link-opening`,`composer-enter`]}],M=new Set(j.flatMap(e=>e.items));function N({renderSlot:e,t,useItems:n}){let r=(0,o.useId)(),i=n(e=>e),a=j.map(e=>({title:e.title,items:i.filter(t=>e.items.includes(t))}));return a.push({title:`general.other`,items:i.filter(e=>e!==`current-version`&&!M.has(e))}),/* @__PURE__ */ (0,c.jsxs)(`div`,{className:A.section,children:[/* @__PURE__ */ (0,c.jsxs)(`header`,{className:A.heading,children:[/* @__PURE__ */ (0,c.jsx)(`h2`,{className:A.title,children:t(`general.nav`)}),/* @__PURE__ */ (0,c.jsx)(`p`,{className:A.description,children:t(`general.description`)})]}),a.filter(e=>e.items.length>0).map(n=>/* @__PURE__ */ (0,c.jsxs)(`section`,{className:A.group,"aria-labelledby":`${r}-${n.title}`,children:[/* @__PURE__ */ (0,c.jsx)(`h3`,{className:A.groupTitle,id:`${r}-${n.title}`,children:t(n.title)}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:A.card,children:n.items.map(t=>/* @__PURE__ */ (0,c.jsx)(`div`,{className:A.item,children:e(`settings.general.item`,{},{only:t})},t))})]},n.title)),i.includes(`current-version`)&&/* @__PURE__ */ (0,c.jsx)(`div`,{className:A.footer,children:e(`settings.general.item`,{},{only:`current-version`})})]})}let P=`@deepseek-ai/dsh-client-ui-settings-general/CurrentVersionRow.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(P)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=P,e.textContent=`.QE76Ba_row{color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;padding:16px 0;font-size:14px;line-height:22px}`,document.head.appendChild(e)}var F={row:`QE76Ba_row`};function I({t:e}){let t={}.DSH_CLIENT_VERSION;return t===void 0?null:/* @__PURE__ */ (0,c.jsx)(`div`,{className:F.row,children:e(`general.currentVersion`,{version:t})})}let L=`@deepseek-ai/dsh-client-ui-settings-general/DeveloperToolsRow.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(L)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=L,e.textContent=`.yszu3a_row{border-bottom:.5px solid var(--dsw-alias-border-l2);justify-content:space-between;align-items:center;gap:24px;padding:16px 0;display:flex}.yszu3a_title{font-size:14px;line-height:20px}.yszu3a_description{color:var(--dsw-alias-label-secondary);margin-top:4px;font-size:12px;line-height:18px}`,document.head.appendChild(e)}var R={description:`yszu3a_description`,row:`yszu3a_row`,title:`yszu3a_title`};function z({useDeveloperTools:e,setEnabled:t,t:n}){let r=e(e=>e),[a,s]=(0,o.useState)(!1),[l,u]=(0,o.useState)(!1);return/* @__PURE__ */ (0,c.jsxs)(`div`,{className:R.row,children:[/* @__PURE__ */ (0,c.jsxs)(`div`,{children:[/* @__PURE__ */ (0,c.jsx)(`div`,{className:R.title,children:n(`developerTools.title`)}),/* @__PURE__ */ (0,c.jsx)(`div`,{className:R.description,children:n(`developerTools.description`)}),l&&/* @__PURE__ */ (0,c.jsx)(`div`,{role:`alert`,children:n(`developerTools.error`)})]}),/* @__PURE__ */ (0,c.jsx)(i.Switch,{checked:r,disabled:a,label:n(`developerTools.title`),onChange:e=>{u(!1),s(!0),t(e).catch(()=>{u(!0)}).finally(()=>{s(!1)})}})]})}let B=`@deepseek-ai/dsh-client-ui-settings-general/SettingsDocumentAction.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(B)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-settings-general`,e.dataset.pluginCss=B,e.textContent=`.P1hEBq_action{align-items:center;gap:8px;min-width:0;display:flex}.P1hEBq_error{max-width:180px;color:var(--dsw-alias-state-error-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}`,document.head.appendChild(e)}var V={action:`P1hEBq_action`,error:`P1hEBq_error`};function H({controller:e,useSnapshot:t,t:n}){let r=t(e=>e);return(0,o.useEffect)(()=>{e.load()},[e]),r.status===`ready`?/* @__PURE__ */ (0,c.jsxs)(`div`,{className:V.action,children:[r.error===null?null:/* @__PURE__ */ (0,c.jsx)(`span`,{className:V.error,role:`alert`,children:n(`openDocument.error`)}),/* @__PURE__ */ (0,c.jsx)(i.Button,{variant:`outline`,size:`sm`,disabled:r.opening,onClick:()=>{e.open()},children:n(`openDocument`)})]}):null}var U=class{ctx;describeFace;store=(0,a.createSnapshotStore)({status:`idle`,opening:!1,error:null});following;constructor(e,t){this.ctx=e,this.describeFace=t}async load(){this.following??=this.describeFace.subscribe(()=>{this.derive()}),this.store.update(e=>{e.status=`loading`,e.error=null}),await this.describeFace.ensure(),this.derive()}async open(){let e=this.store.getSnapshot();if(!(e.status!==`ready`||e.opening)){this.store.update(e=>{e.opening=!0,e.error=null});try{let e=await this.ctx.remote.settings.openSettingsDocument();if(!e.ok){let{message:t}=e.error;this.store.update(e=>{e.error=t})}}finally{this.store.update(e=>{e.opening=!1})}}}dispose(){this.following?.(),this.following=void 0}derive(){let e=this.describeFace.getSnapshot();if(e.view===void 0){e.error!==null&&this.store.update(t=>{t.status=`unavailable`,t.error=e.error});return}let{hasDocument:t}=e.view;this.store.update(e=>{e.status=t?`ready`:`unavailable`,e.error=null})}};let W={trigger:`设置`,"shortcut.open":`打开设置`,"desktop.update.available":`新版本`,"desktop.update.checking":`正在检查更新…`,"desktop.update.progress":`{percent}%`,"desktop.update.verifying":`正在校验更新文件…`,"desktop.update.installing":`正在准备重启…`,"desktop.update.ready":`安装并重启`,"desktop.update.retry":`重试更新`,"desktop.update.versionDetail":`{label}:{version}`,"desktop.update.downloadDetail":`正在下载更新:{percent}%
|
|
2
|
+
目标版本:{version}`,"desktop.update.checkFailed":`检查更新失败,请稍后重试。`,"desktop.update.downloadFailed":`下载更新失败,请重试。`,"desktop.update.installFailed":`安装更新失败,请稍后重试。`,"desktop.update.checkNetworkFailed":`检查更新失败,请检查网络连接后重试。`,"desktop.update.downloadNetworkFailed":`下载更新失败,请检查网络连接后重试。`,"desktop.update.installNetworkFailed":`安装更新失败,请检查网络连接后重试。`,"desktop.update.stopFailed":`未能安全停止任务,更新尚未安装,请稍后重试。`,"desktop.update.tasksChanged":`有新任务开始运行,请重新确认是否停止任务并更新。`,"desktop.update.tasksUnavailable":`无法确认任务状态,请在工作区就绪后重试更新。`,title:`设置`,close:`关闭`,openDocument:`打开配置文件`,"openDocument.error":`无法打开配置文件`,"general.nav":`通用设置`,"general.description":`调整界面显示、阅读与交互偏好。`,"general.display":`显示与语言`,"general.interaction":`交互与阅读`,"general.appAndNotifications":`应用与通知`,"general.other":`其他设置`,"general.currentVersion":`当前版本:{version}`,"developerTools.title":`显示代码工作视图`,"developerTools.error":`保存失败,请重试`,"developerTools.description":`在对话中显示代码 diff 和工具调用详情`,"connection.error":`连接异常,刷新重试`,"connection.connecting":`重新连接中`,"connection.connected":`连接成功`,"connection.reconnect":`连接异常,点击立即重连`,"connection.restart":`连接中断,正在重试,点击立即重连`},G={trigger:`Settings`,"shortcut.open":`Open settings`,"desktop.update.available":`Update`,"desktop.update.checking":`Checking for updates…`,"desktop.update.progress":`{percent}%`,"desktop.update.verifying":`Verifying update files…`,"desktop.update.installing":`Preparing to restart…`,"desktop.update.ready":`Install and Restart`,"desktop.update.retry":`Retry update`,"desktop.update.versionDetail":`{label}: {version}`,"desktop.update.downloadDetail":`Downloading update: {percent}%
|
|
3
|
+
Target version: {version}`,"desktop.update.checkFailed":`Could not check for updates. Please try again later.`,"desktop.update.downloadFailed":`Could not download the update. Please try again.`,"desktop.update.installFailed":`Could not install the update. Please try again later.`,"desktop.update.checkNetworkFailed":`Could not check for updates. Check your connection and try again.`,"desktop.update.downloadNetworkFailed":`Could not download the update. Check your connection and try again.`,"desktop.update.installNetworkFailed":`Could not install the update. Check your connection and try again.`,"desktop.update.stopFailed":`Could not safely stop the tasks. The update has not been installed. Please try again later.`,"desktop.update.tasksChanged":`New tasks have started. Confirm again to stop the tasks and update.`,"desktop.update.tasksUnavailable":`Task status is unavailable. Try updating again when the workspace is ready.`,title:`Settings`,close:`Close`,openDocument:`Open configuration file`,"openDocument.error":`Could not open configuration file`,"general.nav":`General`,"general.description":`Adjust your display, reading, and interaction preferences.`,"general.display":`Display & language`,"general.interaction":`Interaction & reading`,"general.appAndNotifications":`App & notifications`,"general.other":`Other settings`,"general.currentVersion":`Current version: {version}`,"developerTools.title":`Show coding view`,"developerTools.error":`Could not save. Please try again.`,"developerTools.description":`Shows code diffs and detailed tool output in conversations`,"connection.error":`Disconnected`,"connection.connecting":`Reconnecting`,"connection.connected":`Connected`,"connection.reconnect":`Disconnected, reconnect now`,"connection.restart":`Reconnecting, reconnect now`},K=`settings`,q=[`slots`,`locale`,`connection`,`remote`,`remote.settings`,`configForms`,`shortcuts`];function J(e){e.slots.inject(`settings.general.item`,()=>e.slots.register({name:`settings.general.item`,id:`developer-tools`,order:15,locale:K,inject:()=>({hooks:{developerTools:e.configForms.developerTools.enabled},setEnabled:t=>e.configForms.developerTools.setEnabled(t)})},z)),e.slots.inject(`settings.general.item`,()=>e.slots.register({name:`settings.general.item`,id:`current-version`,order:100,locale:K},I)),e.effect(()=>e.locale.register(K,{zh:W,en:G}),`ui-settings-general: dictionaries`);let t=e.get(`connection`),n=globalThis.dshDesktop,a=new C(n?.protocolVersion===1?n.updates:void 0);e.effect(()=>()=>{a.dispose()},`ui-settings-general: desktop update carrier`),e.slots.inject(`sidebar.toggle.badge`,()=>e.slots.register({name:`sidebar.toggle.badge`,locale:K,inject:()=>({hooks:{desktopUpdate:a.store,connectionState:t.state}})},y));let o=e.locale.bind(K),s=e.remote.$host.isLoopback?new U(e,e.configForms.describe()):void 0,c=s===void 0?void 0:()=>({controller:s,hooks:{snapshot:s.store}});e.effect(()=>()=>{s?.dispose()},`ui-settings-general: document action directory`);let u=-1,d=-1,f=[],p=-1,m=[],h=()=>({openDesktopUpdate:()=>{a.open()},reconnect:()=>{t.reconnect()},hooks:{shortcuts:e.shortcuts.catalog,desktopUpdate:a.store,connectionState:t.state,sections:{getSnapshot:()=>{let t=e.slots.getVersion(`settings.section`),n=e.locale.getSnapshot().revision;return(t!==u||n!==d)&&(u=t,d=n,f=e.slots.entries(`settings.section`).map(e=>({
|
|
4
4
|
/* v8 ignore next -- list-slot registration requires id (SlotCore rejects an entry without one) */
|
|
5
5
|
id:e.options.id??``,order:e.options.order??0,label:(0,r.resolveSlotLabel)(e.options.label)??``})).sort((e,t)=>e.order-t.order)),f},subscribe:t=>{let n=e.slots.subscribe(`settings.section`,t),r=e.locale.subscribe(t);return()=>{n(),r()}}},onboardingSteps:{getSnapshot:()=>{let t=e.slots.getVersion(`settings.onboarding`);return t!==p&&(p=t,m=e.slots.entries(`settings.onboarding`).map(e=>({
|
|
6
6
|
/* v8 ignore next -- list-slot registration requires id */
|