dsh-code-server-app 0.2.3 → 0.2.4

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.en.md CHANGED
@@ -20,9 +20,15 @@ A static profile plugin (npm package with host + client bundle) that ships the *
20
20
  | older (no sidebar service) | **Unsupported**: nothing but one notice on the settings page | none (Settings → Plugins → Code Server shows an upgrade notice) |
21
21
 
22
22
  - Detection: first a synchronous `ctx.get('sidebarRightTabs') / ctx.get('sidebarRight')` probe; because the services may come up after this plugin, `ctx.inject(['sidebarRightTabs','sidebarRight'], …)` is awaited and a **2.5 s timeout marks the DSH as legacy** (no version comparison, and the plugin's own activation is never blocked).
23
+ Since 0.2.4 that verdict is **reversible** and registration no longer relies on `ctx` property access (which on desktop silently skipped registration — the symptom was "settings card looks normal but the sidebar has no entry"):
24
+ - services are looked up as `ctx.<name>` first and `ctx.get(name)` second, so either context shape registers;
25
+ - when the sync probe already sees the services but `inject` never calls back, registration falls back to the sync services after **1.5 s**;
26
+ - at 2.5 s only the settings notice appears; only after **10 s** does the client tell the host to recycle/stop prestarting (so a slow host is not punished);
27
+ - services arriving late automatically revoke the legacy verdict, register the sidebar, and report `{sidebar:true}` so the host re-enables;
28
+ - a failed registration is no longer silent: it logs an error and the card's entry row says "right-sidebar services were found but the tab could not be registered".
23
29
  - **0.2.3 dropped legacy-DSH compatibility**: the floating ball and the internal floating window are **deleted**. When the DSH is detected as legacy the plugin
24
30
  - registers only the settings card (an upgrade notice) — no ball, no floating window, no artifact buttons, no IDE preload;
25
- - reports `/api/code-server/ui-mode { sidebar:false }` to the host, which then **recycles an instance it auto-prestarted** and stops prestarting (a user-started/adopted instance is never touched);
31
+ - reports `/api/code-server/ui-mode { sidebar:false }` to the host (after the 10 s grace above); the host then **recycles an instance it auto-prestarted** and stops prestarting (a user-started/adopted instance is never touched), and `{sidebar:true}` reverses that if the services show up later;
26
32
  - upgrading DSH needs **no reinstall** — refresh the page and the card turns back into the full settings card.
27
33
  - The sidebar tab hosts the code-server page (iframe) and follows the current session workspace; the panel can be collapsed/split/floated/fullscreened by DSH's right sidebar.
28
34
  - **Resident IDE (0.2.2, on by default)**: switching to another tab or collapsing the sidebar and coming back **no longer reloads** code-server — unsaved editor buffers, terminals and debug sessions all stay put (see "Why switching tabs no longer reloads" below).
@@ -388,6 +394,8 @@ Host/Origin fence and browser auth); in the desktop profile `apps/desktop-host`
388
394
  and the plugin still works: `/api/*` requests travel Electron `dsh-app://` protocol handler → IPC framed pipe → `createSharedFetchHandler('/api')`.
389
395
  - The right-sidebar tab, guide entry box, artifact button, and settings card behave the same as in web (code-server remains an
390
396
  iframe to the local `http://127.0.0.1:<port>`; the desktop renderer uses `webSecurity: true` with no CSP, so the cross-origin iframe loads).
397
+ The desktop build ships `dsh-client-ui-sidebar-right` in its seed package set as well, so the 0.2.3 "right-sidebar DSH only" rule is
398
+ not a regression for desktop; the only difference is the missing `webServer`, where `serve: dsh` falls back to loopback.
391
399
  - Install into the desktop profile with `dsh plugin --profile desktop add dsh-code-server-app@<version>` (or the desktop plugin manager).
392
400
 
393
401
  ## Artifact open buttons
package/README.md CHANGED
@@ -32,10 +32,16 @@
32
32
  - 检测方式:先 `ctx.get('sidebarRightTabs') / ctx.get('sidebarRight')` 同步探测;
33
33
  服务可能晚于本插件就绪,则 `ctx.inject(['sidebarRightTabs','sidebarRight'], …)` 等待,
34
34
  **2.5 s 内仍未就绪即判定旧版 DSH**(不按版本号硬判,也不影响插件激活)。
35
+ 0.2.4 起判定**可逆**、且注册不再依赖 `ctx` 属性访问(desktop 上曾因此静默不注册、表现为"设置卡正常但侧栏没有入口"):
36
+ - 服务查找先读 `ctx.<name>`,再回退 `ctx.get(name)`——两种上下文形态都能注册;
37
+ - 同步已能看到服务、但 `inject` 迟迟不回调时,**1.5 s 后用同步服务兜底注册**;
38
+ - 2.5 s 只给设置页提示,**10 s** 仍无服务才通知 host 回收/停止预启动(避免误杀慢启动的宿主);
39
+ - 服务晚到 → 自动撤销旧版判定、补注册侧栏,并上报 `{sidebar:true}` 让 host 恢复;
40
+ - 注册失败不再静默:控制台报错,设置卡入口行显示"已探测到右侧栏服务,但标签注册失败"。
35
41
  - **0.2.3 起不再兼容旧版 DSH**:悬浮球与内部浮动窗口回退**已删除**。判定为旧版时:
36
42
  - 只注册设置卡片,内容是一条升级提示(见下),不注册悬浮球/浮窗/产物按钮,也不预热 IDE;
37
- - 客户端向 host 上报 `/api/code-server/ui-mode { sidebar:false }`,host 据此**回收自动预启动的实例**
38
- 并停止预启动(用户手动启动的实例不受影响);
43
+ - 客户端向 host 上报 `/api/code-server/ui-mode { sidebar:false }`(在上面的 10 s 宽限之后),host 据此**回收自动预启动的实例**
44
+ 并停止预启动(用户手动启动的实例不受影响);服务随后才出现时会再上报 `{sidebar:true}` 撤销;
39
45
  - 升级 DSH 后**无需重装插件**,刷新页面即可,本页会恢复为完整设置卡片。
40
46
  - 侧栏标签内即 code-server 页面(iframe),跟随当前会话工作区;面板可折叠/分屏/浮动/全屏(由 DSH 右侧栏提供)。
41
47
  - **IDE 常驻(0.2.2 起,默认开)**:切到别的标签/收起侧栏再回来**不再重载** code-server——
@@ -398,6 +404,8 @@ desktop profile 由 `apps/desktop-host` 把 `/api/*` 交给同一个 `createShar
398
404
  本插件照常工作;`/api/*` 请求由 Electron `dsh-app://` 协议处理器 → IPC 帧管道 → `createSharedFetchHandler('/api')`。
399
405
  - 右侧栏标签、guide 入口框、产物按钮、设置卡片在 desktop 下与 web 相同(code-server 仍是本机 `http://127.0.0.1:<port>` 的 iframe;
400
406
  桌面端 `webSecurity: true` 且页面无 CSP 限制,跨源 iframe 正常加载)。
407
+ 桌面端同样自带 `dsh-client-ui-sidebar-right`(见 desktop 构建 seed 包列表),因此 0.2.3 的
408
+ "只支持带右侧栏的 DSH" 对 desktop 不构成降级;唯一差别是 desktop 无 `webServer`,`serve: dsh` 会自动回退 loopback。
401
409
  - 安装到 desktop profile:`dsh plugin --profile desktop add dsh-code-server-app@<版本>`(或桌面端插件管理窗)。
402
410
 
403
411
  ## 已知限制
package/lib/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  window.__ModuleLoader__.load({id:'dsh-code-server-app',factory:function(require){var module={exports:{}};var exports=module.exports;
2
- var z=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var be=(e,r)=>{for(var n in r)z(e,n,{get:r[n],enumerable:!0})},ve=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of pe(r))!he.call(e,i)&&i!==n&&z(e,i,{get:()=>r[i],enumerable:!(s=fe(r,i))||s.enumerable});return e};var me=e=>ve(z({},"__esModule",{value:!0}),e);var qe={};be(qe,{apply:()=>Ye,inject:()=>Fe,name:()=>Je});module.exports=me(qe);var N=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",ge=-2e4,t={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function D(){return{ready:t.frame!==null,docked:t.owner!==null,owner:t.owner,src:t.currentSrc,sameOrigin:t.sameOrigin,parkStrategy:t.parkStrategy,degraded:t.degraded,preloaded:t.preloaded,supportsMoveBefore:N,nudgeCount:t.nudgeCount,lastNudgeAt:t.lastNudgeAt}}function C(){var e=D();t.listeners.forEach(function(r){try{r(e)}catch(n){}})}function Z(e){return t.listeners.add(e),function(){t.listeners.delete(e)}}function F(){return D()}function ye(e){e!=="offscreen"&&e!=="behind"||t.parkStrategy!==e&&(t.parkStrategy=e,t.frame!==null&&t.owner===null&&j(),C())}function we(){return t.parkStrategy}function xe(){var e=t.lastRect;e!==null&&(t.park.style.width=Math.max(1,Math.round(e.width))+"px",t.park.style.height=Math.max(1,Math.round(e.height))+"px")}function j(){if(t.park!==null){if(xe(),t.parkStrategy==="behind"&&t.lastRect!==null){t.park.style.left=Math.round(t.lastRect.left)+"px",t.park.style.top=Math.round(t.lastRect.top)+"px",t.park.style.visibility="visible",t.park.style.zIndex="0";return}t.park.style.left=ge+"px",t.park.style.top="0px",t.park.style.visibility="hidden",t.park.style.zIndex="0"}}function J(){t.frame!==null&&(t.frame.setAttribute("inert",""),t.frame.setAttribute("aria-hidden","true"))}function ke(){t.frame!==null&&(t.frame.removeAttribute("inert"),t.frame.removeAttribute("aria-hidden"))}function Se(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),t.park=e,t.frame=r,t.currentSrc="about:blank",t.owner=null,j(),J(),r}function Ee(e){var r=t.frame;if(r!==null){var n=t.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),t.sameOrigin=e)}}function I(e){var r=e||{};return t.frame===null&&Se(),typeof r.sameOrigin=="boolean"&&Ee(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==t.currentSrc&&Ne(r.src),t.frame}function Ne(e){t.frame===null||typeof e!="string"||e===""||e===t.currentSrc||(t.currentSrc=e,t.frame.src=e,C())}function q(){var e=t.frame;if(t.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,t.nudgeCount+=1,t.lastNudgeAt=Date.now(),!0}function Ce(e){return t.nudgeEnabled=e!==!1,t.nudgeEnabled}function X(e){if(t.frame!==null){if(N)try{e.moveBefore(t.frame,null);return}catch(r){t.degraded=!0,t.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else t.degraded=!0;e.appendChild(t.frame)}}function P(e,r){if(!(t.frame===null||e==null)){var n=t.owner===null,s=e.getBoundingClientRect();s.width>=1&&s.height>=1&&(t.lastRect={left:s.left,top:s.top,width:s.width,height:s.height}),t.owner=r===void 0?null:r,ke(),t.park.setAttribute("aria-hidden","true"),X(e),n&&q(),C()}}function T(e){t.frame!==null&&(e!==void 0&&t.owner!==e||(t.owner=null,j(),J(),t.park.setAttribute("aria-hidden","true"),X(t.park),C()))}function H(e){var r=e||{};return I(r),t.owner===null&&(typeof r.src=="string"&&r.src!==""&&(t.preloaded=!0),T()),t.frame}function Te(){t.park!==null&&t.park.parentNode!==null&&t.park.parentNode.removeChild(t.park),t.park=null,t.frame=null,t.currentSrc=null,t.sameOrigin=null,t.owner=null,t.lastRect=null,t.degraded=!1,t.preloaded=!1,t.nudgeCount=0,t.lastNudgeAt=0,C()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:D,setParkStrategy:ye,getParkStrategy:we,preload:H,dock:P,park:T,nudge:q,setNudgeEnabled:Ce,destroy:Te});var a=require("react"),B=new Set,G={status:null,busy:!1,sidebarActive:!1,sidebarUi:"unknown"};function m(e){G=Object.assign({},G,e),B.forEach(function(r){r()})}function Oe(e){return B.add(e),function(){B.delete(e)}}function _(){return G}function R(){return a.useSyncExternalStore(Oe,_)}var Le="/api",ne="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function y(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var s=await fetch(Le+e,n),i=await s.text(),l=null;try{l=i===""?null:JSON.parse(i)}catch(d){l=null}return s.ok?l!==null?l:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+s.status+(l!==null&&l.error!==void 0?": "+l.error:"")}}function L(e,r){try{var n=e(function(h){return h}),s=r===null?null:typeof r=="function"?r(function(h){return h}):null,i=n!=null?n.current:void 0;if(i!==void 0&&n!=null&&n.byId!=null){var l=n.byId[i];if(l!=null&&typeof l.cwd=="string"&&l.cwd!=="")return l.cwd}var d=s!=null&&Array.isArray(s.items)?s.items:[];if(i!==void 0)for(var o=0;o<d.length;o++){var b=d[o];if(b.sessionIds!=null&&b.sessionIds.indexOf(i)!==-1&&typeof b.path=="string"&&b.path!=="")return b.path}var c=s!=null?s.recentWorkspaceId:void 0;if(c!==void 0){for(var u=0;u<d.length;u++)if(d[u].workspaceId===c&&typeof d[u].path=="string"&&d[u].path!=="")return d[u].path}if(d.length>0&&typeof d[0].path=="string"&&d[0].path!=="")return d[0].path}catch(h){}}function V(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(n==null||n==="")return e.url;var s=n.replace(/\\/g,"/"),i=s;return(/^[A-Za-z]:\//.test(s)||s.charCodeAt(0)!==47)&&(i="/"+s),e.url+"?folder="+encodeURIComponent(i)}function Me(e){var r=e.status,n=e.pageUrl,s=e.reloadTick,i=e.owner,l=a.useRef(null),d=r!=null&&r.ok===!0&&r.running===!0,o=r!=null&&r.status==="starting",b=r!=null&&r.ok===!1,c=r!=null&&r.serve==="dsh";if(a.useLayoutEffect(function(){if(!d||n===null){T(i);return}I({src:n,sameOrigin:c}),l.current!==null&&P(l.current,i)},[d,n,c,s,i]),a.useLayoutEffect(function(){return function(){T(i)}},[i]),d&&n!==null)return a.createElement("div",{ref:l,className:"dshcs-slot","data-code-server-slot":i!=null?i:"code-server"});if(o)return a.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var u=b&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",h=c?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",v=N?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return a.createElement("div",{className:"dshcs-empty"},a.createElement("div",{className:"dshcs-emptybox"},a.createElement("div",null,b?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),a.createElement("pre",{className:"dshcs-error"},u),a.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u70B9\u300C\u68C0\u6D4B\u73AF\u5883\u300D\u67E5\u770B\u539F\u56E0\u3002"+h+v)))}function Re(e){var r=R(),n=r.status,s=n!=null&&n.ok===!0&&n.running===!0,i=n!=null&&n.keepResident===!0,l=L(e&&e.useSessions,e&&e.useWorkspaces),d=s?V(n,l):null;return a.useEffect(function(){!i||!s||d===null||H({src:d,sameOrigin:n!=null&&n.serve==="dsh"})},[i,s,d,n!=null?n.serve:null]),null}function K(e){var r=function(s){var i=V(s,e);i!=null&&typeof window.open=="function"&&window.open(i,"_blank","noopener")},n=_().status;if(n!=null&&n.running===!0){r(n);return}_().busy!==!0&&(m({busy:!0}),y("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(s){m({status:s,busy:!1}),r(s)}).catch(function(){m({busy:!1})}))}var Ae=".dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",$="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify($)+"]")===null&&(O=document.createElement("style"),O.setAttribute("data-dshcs",$),O.textContent=Ae,document.head.appendChild(O));var O,U="code-server",ee="dsh-code-server-app",ze=2500,E={openTab:null};function De(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return a.createElement("img",{src:ne,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function je(e){var r=e.useTabInfo(),n=r.tab,s=R(),i=s.status,l=L(e.useSessions,null),d=a.useRef(void 0),[o,b]=a.useState(0),c=n.navigation,u=c!=null&&typeof c.revision=="number"?c.revision:0;return a.useEffect(function(){if(!(typeof l!="string"||l==="")&&d.current!==l){var h=d.current!==void 0;d.current=l;var v=!1;return y("/code-server/start",{cwd:l}).then(function(g){v||(m({status:g}),h&&g!=null&&g.ok===!0&&g.running===!0&&b(function(x){return x+1}))}).catch(function(){}),function(){v=!0}}},[l]),a.useEffect(function(){y("/code-server/status").then(function(v){v!=null&&m({status:v})}).catch(function(){});var h=window.setInterval(function(){y("/code-server/status").then(function(v){m({status:v})}).catch(function(){})},3e3);return function(){window.clearInterval(h)}},[]),a.useEffect(function(){var h=c!=null?c.params:null,v=h!=null&&typeof h.path=="string"?h.path:"";v!==""&&y("/code-server/open-file",{file:v}).catch(function(){})},[u]),a.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},a.createElement(Me,{status:i,pageUrl:V(i,l),reloadTick:o,owner:"tab:"+n.id}))}function Ie(e){var r=e.sidebarRightTabs,n=e.sidebarRight;r==null||n==null||(e.effect(function(){return r.register({id:ee,kind:U,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:De}]})},"code-server: sidebar tab type"),e.effect(function(){return e.slots.inject("sidebar.right.pane.tab",function(){return e.slots.register({name:"sidebar.right.pane.tab",key:ee},je)})},"code-server: sidebar tab body"),E.openTab=function(s){try{return n.openTab(U,s!=null?{params:s}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){E.openTab=null,m({sidebarActive:!1,sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),m({sidebarActive:!0}),console.log("[code-server] right-sidebar tab registered (kind="+U+")"))}var Pe=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",He="dsh-code-server/Card.module.css";function Ue(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}Ue(He,Pe);function Be(e){return a.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},a.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function M(e){return a.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function re(e){return a.createElement("label",{className:"dshcs-check"},a.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),a.createElement("span",{className:"dshcs-hint"},e.children))}function ae(e){var r=[];return e.overridden===!0&&(r.push(a.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(a.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:a.createElement("span",{className:"dshcs-badges"},...r)}function te(e){var[r,n]=a.useState(e.defaultOpen===!0),s=e.state;if(s==null||s.available!==!0)return null;var i=e.title,l=e.noticeOnly===!0,d=s.dirty!==!0||s.invalid===!0||s.saving===!0;return a.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},a.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},a.createElement("span",{className:"dshcs-cardHeadText"},a.createElement("span",{className:"dshcs-cardName"},i),a.createElement("span",{className:"dshcs-cardDescription"},e.description)),s.dirty===!0?a.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,a.createElement(Be,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?a.createElement("div",{className:"dshcs-cardBody"},l===!0?null:s.writable!==!0?a.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,l===!0?null:a.createElement("div",{className:"dshcs-cardFooter"},s.failed===!0?a.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,a.createElement(M,{disabled:s.dirty!==!0||s.saving===!0,onClick:e.onDiscard},e.discardLabel),a.createElement(M,{variant:"primary",disabled:d,onClick:e.onSave},s.saving===!0?e.savingLabel:e.saveLabel))):null)}function Ge(e){try{let k=function(){y("/code-server/status").then(function(p){p!=null&&typeof p=="object"&&m({status:p})}).catch(function(){})};var r=e.scope,[n,s]=a.useState(function(){return r!==void 0?r.getSnapshot():null}),[i,l]=a.useState(null),[d,o]=a.useState(!1),[b,c]=a.useState(!1),u=R(),[h,v]=a.useState(F());if(a.useEffect(function(){return Z(function(p){v(p)})},[]),a.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function p(){try{s(r.getSnapshot())}catch(Ke){}}var w=r.subscribe(p);return function(){typeof w=="function"&&w()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var g=n.value!==void 0&&n.value!==null?n.value:{},x=n.user,S={windowedOpen:g.windowedOpen===!0,keepResident:g.keepResident!==!1};if(u!=null&&u.sidebarUi==="legacy")return a.createElement(te,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),a.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
3
- \u5347\u7EA7 DSH \u5230\u5E26\u53F3\u4FA7\u680F\u7684\u7248\u672C(\u2265 0.1.5-alpha.1)\u540E,Code Server \u4F1A\u51FA\u73B0\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC,\u672C\u9875\u540C\u65F6\u663E\u793A\u5B8C\u6574\u8BBE\u7F6E\u9879;\u5347\u7EA7\u540E\u65E0\u9700\u91CD\u88C5\u672C\u63D2\u4EF6,\u5237\u65B0\u9875\u9762\u5373\u53EF\u3002`)));var se=x!=null&&Object.prototype.hasOwnProperty.call(x,"windowedOpen"),ie=x!=null&&Object.prototype.hasOwnProperty.call(x,"keepResident"),le=u!=null&&u.sidebarActive===!0,A=i!==null&&(i.windowedOpen!==S.windowedOpen||i.keepResident!==S.keepResident),Xe=!A||d,de={available:!0,writable:n.writable,dirty:A,invalid:!1,saving:d,failed:b};async function ue(){if(A&&!d){o(!0),c(!1);try{var p=i!==null?i:S;await e.scope.set("windowedOpen",p.windowedOpen===!0),await e.scope.set("keepResident",p.keepResident===!0),l(null),k()}catch(w){c(!0)}o(!1)}}async function Y(){if(!(d||n.writable!==!0)){o(!0),c(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("windowedOpen"),await e.scope.unset("keepResident")):(await e.scope.set("windowedOpen",g.windowedOpen===!0),await e.scope.set("keepResident",g.keepResident===void 0||g.keepResident===null?!0:g.keepResident)),l(null),k()}catch(p){c(!0)}o(!1)}}var[f,ce]=a.useState(null),[W,Q]=a.useState(!1),oe=a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),a.createElement("span",{className:"dshcs-badges"},a.createElement(M,{variant:"primary",disabled:W,onClick:async function(){Q(!0);var p=await y("/code-server/status");ce(p!=null&&p.env!=null?p.env:{error:"status \u672A\u8FD4\u56DE env"}),Q(!1)}},W?"\u68C0\u6D4B\u4E2D\u2026":"\u68C0\u6D4B\u73AF\u5883"))),f!=null?a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},f.error!=null?a.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+f.error):a.createElement("span",null,"\u72B6\u6001: "+(f.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(f.treeVersion!=null?" \xB7 VS Code \u6811: "+f.treeVersion:"")+(f.upToDate===!1&&f.vendored!=null?"(\u5185\u7F6E "+f.vendored+") ":"")+(f.productPath!=null?" \xB7 \u5BA2\u6237\u7AEF\u8DEF\u5F84: "+f.productPath:"")+(f.entry!=null?" \xB7 \u5165\u53E3: "+f.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(f.vscodeInner===!0?"\u2705":"\u274C")+" \xB7 \u9884\u7F16\u8BD1\u539F\u751F\u5305: "+(f.nativeRuntime!=null&&f.nativeRuntime.packages>0?"\u2705 "+f.nativeRuntime.name+"@"+(f.nativeRuntime.version!=null?f.nativeRuntime.version:"?")+"("+f.nativeRuntime.packages+" \u5305)":"\u274C \u672A\u5B89\u88C5("+(f.nativeRuntime!=null&&f.nativeRuntime.name!=null?f.nativeRuntime.name:"\u5E73\u53F0\u805A\u5408\u5305")+")"))):a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B VS Code \u6811\u72B6\u6001(\u4F9D\u8D56\u7531\u5305\u7BA1\u7406\u5668\u5B89\u88C5,\u65E0\u9700\u5B89\u88C5\u6B65\u9AA4)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u8FD0\u884C\u4F4D\u7F6E: "+(f!=null&&f.tree!=null?f.tree:"<\u63D2\u4EF6\u76EE\u5F55>\\vendor\\vscode")+`
4
- \u5378\u8F7D: dsh plugin --profile web remove dsh-code-server-app`));return a.createElement(te,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1);\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\u65B0\u6807\u7B7E\u9875\u6253\u5F00",state:de,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:ue,onDiscard:function(){l(null),c(!1)}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),a.createElement("span",{className:"dshcs-badges"},a.createElement(M,{disabled:le!==!0,onClick:function(){E.openTab!==null&&E.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),se===!0?a.createElement(ae,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),a.createElement(re,{checked:i!==null?i.windowedOpen:S.windowedOpen,disabled:n.writable!==!0,onChange:function(p){l(function(w){return Object.assign({},w!==null?w:S,{windowedOpen:p===!0})}),c(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361)\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u53F3\u4FA7\u680F\u6807\u7B7E")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),ie===!0?a.createElement(ae,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),a.createElement(re,{checked:i!==null?i.keepResident:S.keepResident,disabled:n.writable!==!0,onChange:function(p){l(function(w){return Object.assign({},w!==null?w:S,{keepResident:p===!0})}),c(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},N?"\u5E38\u9A7B\u9762:"+(h.docked?"\u5DF2\u505C\u9760":h.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(h.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u4F9D\u8D56\u5B89\u88C5"),null),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"0.1.36 \u8D77 code-server \u672C\u4F53\u968F\u63D2\u4EF6\u5305\u53D1\u5E03,VS Code \u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757(\u5E73\u53F0\u805A\u5408\u5305)\u5168\u90E8\u7531\u5305\u7BA1\u7406\u5668\u5728 dsh plugin add \u65F6\u5B89\u88C5,\u4E0D\u518D\u9700\u8981\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4\u3002")),oe)}catch(k){return console.error("[code-server] card render error:",k!=null&&k.message!==void 0?k.message:String(k)),null}}function _e(e){var r=[];try{var n=e.turn.data.get("deliverables"),s=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(n!=null&&Array.isArray(n.produced))for(var i={},l=0;l<n.produced.length;l++){var d=n.produced[l];d==null||typeof d.path!="string"||d.path===""||d.seq!=null&&d.seq>s||i[d.path]!==!0&&(i[d.path]=!0,r.push(d.path))}}catch(o){}return r}function Ve(e){var r=_e(e);return r.length===0?null:r}function We(e){return a.createElement("img",{src:ne,alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Qe(e){var r=R();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var n=e.matched;function s(l){var d=String(l).replace(/\\/g,"/"),o=d.lastIndexOf("/");return o>=0?d.slice(o+1):d}function i(l){var d=r.status;if(d!=null&&d.windowedOpen===!0){K(L(e.useSessions,e.useWorkspaces));return}r.sidebarActive===!0&&E.openTab!==null&&E.openTab({path:l})===!0||(K(L(e.useSessions,e.useWorkspaces)),y("/code-server/open-file",{file:l}).then(function(o){(o==null||o.ok!==!0)&&window.alert(o!=null&&o.error?o.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(o){window.alert("\u6253\u5F00\u5931\u8D25: "+String(o))}))}return a.createElement("div",{className:"dshcs-artifacts"},a.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),a.createElement("div",{className:"dshcs-artrow"},n.slice(0,6).map(function(l){return a.createElement("span",{key:l,className:"dshcs-artitem"},a.createElement("button",{type:"button",className:"dshcs-artfile",title:l,"aria-label":"\u6253\u5F00: "+l,onClick:function(){i(l)}},s(l)),a.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+l,"aria-label":"\u5728 Code Server \u6253\u5F00: "+l,onClick:function(){i(l)}},a.createElement(We,null)))}),n.length>6?a.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function Ye(e){try{Ze(e)}catch(r){console.error("[code-server] apply failed:",r&&r.stack?r.stack:String(r));try{document.title="CS-ERR "+(r&&r.message||String(r))}catch(n){}}}function Ze(e){var r=e.get("slots");if(r===void 0){console.error("[code-server] slots service unavailable");return}var n=e.settingsScope,s=null;if(n!==void 0&&typeof n.bind=="function")s=n.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}y("/code-server/status").then(function(c){m({status:c})}).catch(function(){}),r.inject("settings.plugin.item",()=>r.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:s}}},Ge));function i(c){Ie(c),m({sidebarActive:!0,sidebarUi:"modern"}),r.inject("shell.overlay",()=>r.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},u=>a.createElement(Re,u)));try{r.inject("conversation.chat.turnTail",function(){return r.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:Ve},Qe)})}catch(u){console.warn("[code-server] turnTail register failed:",u!=null&&u.message!=null?u.message:String(u))}console.log("[code-server] client registered: right-sidebar tab + turnTail artifacts + resident preload + settings card")}function l(){m({sidebarActive:!1,sidebarUi:"legacy"}),console.warn("[code-server] \u672A\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1(sidebarRightTabs/sidebarRight): \u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH \u2014\u2014 \u9664\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server\u300D\u7684\u63D0\u793A\u5916\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3,\u4E5F\u4E0D\u9884\u70ED IDE\u3002\u8BF7\u5347\u7EA7 DSH\u3002"),y("/code-server/ui-mode",{sidebar:!1}).catch(function(){})}var d=typeof e.get=="function"?e.get("sidebarRightTabs")!==void 0&&e.get("sidebarRight")!==void 0:!1;if(d){try{i(e)}catch(c){console.error("[code-server] sidebar tab registration failed:",c!=null&&c.message!=null?c.message:String(c))}return}var o=!1,b=setTimeout(function(){o||(o=!0,l())},ze);try{typeof e.inject=="function"?e.inject(["sidebarRightTabs","sidebarRight"],function(c){if(!o){o=!0,clearTimeout(b);try{i(c)}catch(u){console.error("[code-server] sidebar tab registration failed:",u!=null&&u.message!=null?u.message:String(u))}}}):(clearTimeout(b),o=!0,l())}catch(c){clearTimeout(b),o=!0,console.warn("[code-server] sidebar inject failed:",c!=null&&c.message!=null?c.message:String(c)),l()}}var Fe=["slots","settingsScope"],Je="code-server";
2
+ var z=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var be=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var ve=(e,r)=>{for(var n in r)z(e,n,{get:r[n],enumerable:!0})},me=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of be(r))!he.call(e,l)&&l!==n&&z(e,l,{get:()=>r[l],enumerable:!(s=pe(r,l))||s.enumerable});return e};var ge=e=>me(z({},"__esModule",{value:!0}),e);var $e={};ve($e,{apply:()=>Je,inject:()=>Xe,name:()=>Ke});module.exports=ge($e);var C=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",ye=-2e4,t={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function I(){return{ready:t.frame!==null,docked:t.owner!==null,owner:t.owner,src:t.currentSrc,sameOrigin:t.sameOrigin,parkStrategy:t.parkStrategy,degraded:t.degraded,preloaded:t.preloaded,supportsMoveBefore:C,nudgeCount:t.nudgeCount,lastNudgeAt:t.lastNudgeAt}}function T(){var e=I();t.listeners.forEach(function(r){try{r(e)}catch(n){}})}function J(e){return t.listeners.add(e),function(){t.listeners.delete(e)}}function q(){return I()}function we(e){e!=="offscreen"&&e!=="behind"||t.parkStrategy!==e&&(t.parkStrategy=e,t.frame!==null&&t.owner===null&&P(),T())}function xe(){return t.parkStrategy}function ke(){var e=t.lastRect;e!==null&&(t.park.style.width=Math.max(1,Math.round(e.width))+"px",t.park.style.height=Math.max(1,Math.round(e.height))+"px")}function P(){if(t.park!==null){if(ke(),t.parkStrategy==="behind"&&t.lastRect!==null){t.park.style.left=Math.round(t.lastRect.left)+"px",t.park.style.top=Math.round(t.lastRect.top)+"px",t.park.style.visibility="visible",t.park.style.zIndex="0";return}t.park.style.left=ye+"px",t.park.style.top="0px",t.park.style.visibility="hidden",t.park.style.zIndex="0"}}function X(){t.frame!==null&&(t.frame.setAttribute("inert",""),t.frame.setAttribute("aria-hidden","true"))}function Se(){t.frame!==null&&(t.frame.removeAttribute("inert"),t.frame.removeAttribute("aria-hidden"))}function Ee(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),t.park=e,t.frame=r,t.currentSrc="about:blank",t.owner=null,P(),X(),r}function Ne(e){var r=t.frame;if(r!==null){var n=t.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),t.sameOrigin=e)}}function H(e){var r=e||{};return t.frame===null&&Ee(),typeof r.sameOrigin=="boolean"&&Ne(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==t.currentSrc&&Ce(r.src),t.frame}function Ce(e){t.frame===null||typeof e!="string"||e===""||e===t.currentSrc||(t.currentSrc=e,t.frame.src=e,T())}function K(){var e=t.frame;if(t.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,t.nudgeCount+=1,t.lastNudgeAt=Date.now(),!0}function Te(e){return t.nudgeEnabled=e!==!1,t.nudgeEnabled}function $(e){if(t.frame!==null){if(C)try{e.moveBefore(t.frame,null);return}catch(r){t.degraded=!0,t.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else t.degraded=!0;e.appendChild(t.frame)}}function U(e,r){if(!(t.frame===null||e==null)){var n=t.owner===null,s=e.getBoundingClientRect();s.width>=1&&s.height>=1&&(t.lastRect={left:s.left,top:s.top,width:s.width,height:s.height}),t.owner=r===void 0?null:r,Se(),t.park.setAttribute("aria-hidden","true"),$(e),n&&K(),T()}}function L(e){t.frame!==null&&(e!==void 0&&t.owner!==e||(t.owner=null,P(),X(),t.park.setAttribute("aria-hidden","true"),$(t.park),T()))}function B(e){var r=e||{};return H(r),t.owner===null&&(typeof r.src=="string"&&r.src!==""&&(t.preloaded=!0),L()),t.frame}function Le(){t.park!==null&&t.park.parentNode!==null&&t.park.parentNode.removeChild(t.park),t.park=null,t.frame=null,t.currentSrc=null,t.sameOrigin=null,t.owner=null,t.lastRect=null,t.degraded=!1,t.preloaded=!1,t.nudgeCount=0,t.lastNudgeAt=0,T()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:I,setParkStrategy:we,getParkStrategy:xe,preload:B,dock:U,park:L,nudge:K,setNudgeEnabled:Te,destroy:Le});var a=require("react"),V=new Set,R={status:null,busy:!1,sidebarActive:!1,sidebarUi:"unknown",sidebarRegisterFailed:!1};function k(e){R=Object.assign({},R,e),V.forEach(function(r){r()})}function Oe(e){return V.add(e),function(){V.delete(e)}}function W(){return R}function D(){return a.useSyncExternalStore(Oe,W)}var Re="/api",le="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function x(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var s=await fetch(Re+e,n),l=await s.text(),i=null;try{i=l===""?null:JSON.parse(l)}catch(d){i=null}return s.ok?i!==null?i:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+s.status+(i!==null&&i.error!==void 0?": "+i.error:"")}}function M(e,r){try{var n=e(function(p){return p}),s=r===null?null:typeof r=="function"?r(function(p){return p}):null,l=n!=null?n.current:void 0;if(l!==void 0&&n!=null&&n.byId!=null){var i=n.byId[l];if(i!=null&&typeof i.cwd=="string"&&i.cwd!=="")return i.cwd}var d=s!=null&&Array.isArray(s.items)?s.items:[];if(l!==void 0)for(var c=0;c<d.length;c++){var v=d[c];if(v.sessionIds!=null&&v.sessionIds.indexOf(l)!==-1&&typeof v.path=="string"&&v.path!=="")return v.path}var u=s!=null?s.recentWorkspaceId:void 0;if(u!==void 0){for(var b=0;b<d.length;b++)if(d[b].workspaceId===u&&typeof d[b].path=="string"&&d[b].path!=="")return d[b].path}if(d.length>0&&typeof d[0].path=="string"&&d[0].path!=="")return d[0].path}catch(p){}}function F(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(n==null||n==="")return e.url;var s=n.replace(/\\/g,"/"),l=s;return(/^[A-Za-z]:\//.test(s)||s.charCodeAt(0)!==47)&&(l="/"+s),e.url+"?folder="+encodeURIComponent(l)}function Me(e){var r=e.status,n=e.pageUrl,s=e.reloadTick,l=e.owner,i=a.useRef(null),d=r!=null&&r.ok===!0&&r.running===!0,c=r!=null&&r.status==="starting",v=r!=null&&r.ok===!1,u=r!=null&&r.serve==="dsh";if(a.useLayoutEffect(function(){if(!d||n===null){L(l);return}H({src:n,sameOrigin:u}),i.current!==null&&U(i.current,l)},[d,n,u,s,l]),a.useLayoutEffect(function(){return function(){L(l)}},[l]),d&&n!==null)return a.createElement("div",{ref:i,className:"dshcs-slot","data-code-server-slot":l!=null?l:"code-server"});if(c)return a.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var b=v&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",p=u?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",m=C?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return a.createElement("div",{className:"dshcs-empty"},a.createElement("div",{className:"dshcs-emptybox"},a.createElement("div",null,v?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),a.createElement("pre",{className:"dshcs-error"},b),a.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u70B9\u300C\u68C0\u6D4B\u73AF\u5883\u300D\u67E5\u770B\u539F\u56E0\u3002"+p+m)))}function Ae(e){var r=D(),n=r.status,s=n!=null&&n.ok===!0&&n.running===!0,l=n!=null&&n.keepResident===!0,i=M(e&&e.useSessions,e&&e.useWorkspaces),d=s?F(n,i):null;return a.useEffect(function(){!l||!s||d===null||B({src:d,sameOrigin:n!=null&&n.serve==="dsh"})},[l,s,d,n!=null?n.serve:null]),null}function ee(e){var r=function(s){var l=F(s,e);l!=null&&typeof window.open=="function"&&window.open(l,"_blank","noopener")},n=W().status;if(n!=null&&n.running===!0){r(n);return}W().busy!==!0&&(k({busy:!0}),x("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(s){k({status:s,busy:!1}),r(s)}).catch(function(){k({busy:!1})}))}var De=".dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",re="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(re)+"]")===null&&(O=document.createElement("style"),O.setAttribute("data-dshcs",re),O.textContent=De,document.head.appendChild(O));var O,_="code-server",ae="dsh-code-server-app",je=2500,ze=1e4,Ie=1500,N={openTab:null};function Pe(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return a.createElement("img",{src:le,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function He(e){var r=e.useTabInfo(),n=r.tab,s=D(),l=s.status,i=M(e.useSessions,null),d=a.useRef(void 0),[c,v]=a.useState(0),u=n.navigation,b=u!=null&&typeof u.revision=="number"?u.revision:0;return a.useEffect(function(){if(!(typeof i!="string"||i==="")&&d.current!==i){var p=d.current!==void 0;d.current=i;var m=!1;return x("/code-server/start",{cwd:i}).then(function(f){m||(k({status:f}),p&&f!=null&&f.ok===!0&&f.running===!0&&v(function(w){return w+1}))}).catch(function(){}),function(){m=!0}}},[i]),a.useEffect(function(){x("/code-server/status").then(function(m){m!=null&&k({status:m})}).catch(function(){});var p=window.setInterval(function(){x("/code-server/status").then(function(m){k({status:m})}).catch(function(){})},3e3);return function(){window.clearInterval(p)}},[]),a.useEffect(function(){var p=u!=null?u.params:null,m=p!=null&&typeof p.path=="string"?p.path:"";m!==""&&x("/code-server/open-file",{file:m}).catch(function(){})},[b]),a.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},a.createElement(Me,{status:l,pageUrl:F(l,i),reloadTick:c,owner:"tab:"+n.id}))}function G(e,r){if(e==null)return null;var n=e[r];if(n!=null)return n;if(typeof e.get=="function"){var s=e.get(r);if(s!=null)return s}return null}function Ue(e){var r=G(e,"sidebarRightTabs"),n=G(e,"sidebarRight");if(r==null||n==null)return console.error("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u4E0A\u4E0B\u6587\u4E0D\u53EF\u89C1(sidebarRightTabs="+(r!=null)+", sidebarRight="+(n!=null)+"):\u8DF3\u8FC7\u4FA7\u680F\u6CE8\u518C"),!1;var s=G(e,"slots");if(e.effect(function(){return r.register({id:ae,kind:_,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:Pe}]})},"code-server: sidebar tab type"),s!=null)e.effect(function(){return s.inject("sidebar.right.pane.tab",function(){return s.register({name:"sidebar.right.pane.tab",key:ae},He)})},"code-server: sidebar tab body");else return console.error("[code-server] slots \u670D\u52A1\u4E0D\u53EF\u89C1:\u4FA7\u680F\u6807\u7B7E body \u672A\u6CE8\u518C"),!1;return N.openTab=function(l){try{return n.openTab(_,l!=null?{params:l}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){N.openTab=null,k({sidebarActive:!1,sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),console.log("[code-server] right-sidebar tab registered (kind="+_+")"),!0}var Be=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",_e="dsh-code-server/Card.module.css";function Ge(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}Ge(_e,Be);function Ve(e){return a.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},a.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function A(e){return a.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function te(e){return a.createElement("label",{className:"dshcs-check"},a.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),a.createElement("span",{className:"dshcs-hint"},e.children))}function ne(e){var r=[];return e.overridden===!0&&(r.push(a.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(a.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:a.createElement("span",{className:"dshcs-badges"},...r)}function se(e){var[r,n]=a.useState(e.defaultOpen===!0),s=e.state;if(s==null||s.available!==!0)return null;var l=e.title,i=e.noticeOnly===!0,d=s.dirty!==!0||s.invalid===!0||s.saving===!0;return a.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},a.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},a.createElement("span",{className:"dshcs-cardHeadText"},a.createElement("span",{className:"dshcs-cardName"},l),a.createElement("span",{className:"dshcs-cardDescription"},e.description)),s.dirty===!0?a.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,a.createElement(Ve,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?a.createElement("div",{className:"dshcs-cardBody"},i===!0?null:s.writable!==!0?a.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,i===!0?null:a.createElement("div",{className:"dshcs-cardFooter"},s.failed===!0?a.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,a.createElement(A,{disabled:s.dirty!==!0||s.saving===!0,onClick:e.onDiscard},e.discardLabel),a.createElement(A,{variant:"primary",disabled:d,onClick:e.onSave},s.saving===!0?e.savingLabel:e.saveLabel))):null)}function We(e){try{let E=function(){x("/code-server/status").then(function(h){h!=null&&typeof h=="object"&&k({status:h})}).catch(function(){})};var r=e.scope,[n,s]=a.useState(function(){return r!==void 0?r.getSnapshot():null}),[l,i]=a.useState(null),[d,c]=a.useState(!1),[v,u]=a.useState(!1),b=D(),[p,m]=a.useState(q());if(a.useEffect(function(){return J(function(h){m(h)})},[]),a.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function h(){try{s(r.getSnapshot())}catch(rr){}}var S=r.subscribe(h);return function(){typeof S=="function"&&S()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var f=n.value!==void 0&&n.value!==null?n.value:{},w=n.user,y={windowedOpen:f.windowedOpen===!0,keepResident:f.keepResident!==!1};if(b!=null&&b.sidebarUi==="legacy")return a.createElement(se,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),a.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
3
+ \u5347\u7EA7 DSH \u5230\u5E26\u53F3\u4FA7\u680F\u7684\u7248\u672C(\u2265 0.1.5-alpha.1)\u540E,Code Server \u4F1A\u51FA\u73B0\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC,\u672C\u9875\u540C\u65F6\u663E\u793A\u5B8C\u6574\u8BBE\u7F6E\u9879;\u5347\u7EA7\u540E\u65E0\u9700\u91CD\u88C5\u672C\u63D2\u4EF6,\u5237\u65B0\u9875\u9762\u5373\u53EF\u3002`)));var g=w!=null&&Object.prototype.hasOwnProperty.call(w,"windowedOpen"),ie=w!=null&&Object.prototype.hasOwnProperty.call(w,"keepResident"),de=b!=null&&b.sidebarActive===!0,j=l!==null&&(l.windowedOpen!==y.windowedOpen||l.keepResident!==y.keepResident),er=!j||d,ce={available:!0,writable:n.writable,dirty:j,invalid:!1,saving:d,failed:v};async function fe(){if(j&&!d){c(!0),u(!1);try{var h=l!==null?l:y;await e.scope.set("windowedOpen",h.windowedOpen===!0),await e.scope.set("keepResident",h.keepResident===!0),i(null),E()}catch(S){u(!0)}c(!1)}}async function Z(){if(!(d||n.writable!==!0)){c(!0),u(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("windowedOpen"),await e.scope.unset("keepResident")):(await e.scope.set("windowedOpen",f.windowedOpen===!0),await e.scope.set("keepResident",f.keepResident===void 0||f.keepResident===null?!0:f.keepResident)),i(null),E()}catch(h){u(!0)}c(!1)}}var[o,oe]=a.useState(null),[Q,Y]=a.useState(!1),ue=a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),a.createElement("span",{className:"dshcs-badges"},a.createElement(A,{variant:"primary",disabled:Q,onClick:async function(){Y(!0);var h=await x("/code-server/status");oe(h!=null&&h.env!=null?h.env:{error:"status \u672A\u8FD4\u56DE env"}),Y(!1)}},Q?"\u68C0\u6D4B\u4E2D\u2026":"\u68C0\u6D4B\u73AF\u5883"))),o!=null?a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},o.error!=null?a.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+o.error):a.createElement("span",null,"\u72B6\u6001: "+(o.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(o.treeVersion!=null?" \xB7 VS Code \u6811: "+o.treeVersion:"")+(o.upToDate===!1&&o.vendored!=null?"(\u5185\u7F6E "+o.vendored+") ":"")+(o.productPath!=null?" \xB7 \u5BA2\u6237\u7AEF\u8DEF\u5F84: "+o.productPath:"")+(o.entry!=null?" \xB7 \u5165\u53E3: "+o.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(o.vscodeInner===!0?"\u2705":"\u274C")+" \xB7 \u9884\u7F16\u8BD1\u539F\u751F\u5305: "+(o.nativeRuntime!=null&&o.nativeRuntime.packages>0?"\u2705 "+o.nativeRuntime.name+"@"+(o.nativeRuntime.version!=null?o.nativeRuntime.version:"?")+"("+o.nativeRuntime.packages+" \u5305)":"\u274C \u672A\u5B89\u88C5("+(o.nativeRuntime!=null&&o.nativeRuntime.name!=null?o.nativeRuntime.name:"\u5E73\u53F0\u805A\u5408\u5305")+")"))):a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B VS Code \u6811\u72B6\u6001(\u4F9D\u8D56\u7531\u5305\u7BA1\u7406\u5668\u5B89\u88C5,\u65E0\u9700\u5B89\u88C5\u6B65\u9AA4)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u8FD0\u884C\u4F4D\u7F6E: "+(o!=null&&o.tree!=null?o.tree:"<\u63D2\u4EF6\u76EE\u5F55>\\vendor\\vscode")+`
4
+ \u5378\u8F7D: dsh plugin --profile web remove dsh-code-server-app`));return a.createElement(se,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1);\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\u65B0\u6807\u7B7E\u9875\u6253\u5F00",state:ce,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:fe,onDiscard:function(){i(null),u(!1)}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),a.createElement("span",{className:"dshcs-badges"},a.createElement(A,{disabled:de!==!0,onClick:function(){N.openTab!==null&&N.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),a.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},b!=null&&b.sidebarRegisterFailed===!0?'\u26A0 \u5DF2\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1,\u4F46\u6807\u7B7E\u6CE8\u518C\u5931\u8D25(\u63A7\u5236\u53F0\u6709 [code-server] \u62A5\u9519);IDE \u4ECD\u53EF\u901A\u8FC7"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"\u4F7F\u7528\u3002':"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),g===!0?a.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Z()}}):null),a.createElement(te,{checked:l!==null?l.windowedOpen:y.windowedOpen,disabled:n.writable!==!0,onChange:function(h){i(function(S){return Object.assign({},S!==null?S:y,{windowedOpen:h===!0})}),u(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361)\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u53F3\u4FA7\u680F\u6807\u7B7E")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),ie===!0?a.createElement(ne,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Z()}}):null),a.createElement(te,{checked:l!==null?l.keepResident:y.keepResident,disabled:n.writable!==!0,onChange:function(h){i(function(S){return Object.assign({},S!==null?S:y,{keepResident:h===!0})}),u(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},C?"\u5E38\u9A7B\u9762:"+(p.docked?"\u5DF2\u505C\u9760":p.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(p.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u4F9D\u8D56\u5B89\u88C5"),null),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"0.1.36 \u8D77 code-server \u672C\u4F53\u968F\u63D2\u4EF6\u5305\u53D1\u5E03,VS Code \u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757(\u5E73\u53F0\u805A\u5408\u5305)\u5168\u90E8\u7531\u5305\u7BA1\u7406\u5668\u5728 dsh plugin add \u65F6\u5B89\u88C5,\u4E0D\u518D\u9700\u8981\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4\u3002")),ue)}catch(E){return console.error("[code-server] card render error:",E!=null&&E.message!==void 0?E.message:String(E)),null}}function Fe(e){var r=[];try{var n=e.turn.data.get("deliverables"),s=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(n!=null&&Array.isArray(n.produced))for(var l={},i=0;i<n.produced.length;i++){var d=n.produced[i];d==null||typeof d.path!="string"||d.path===""||d.seq!=null&&d.seq>s||l[d.path]!==!0&&(l[d.path]=!0,r.push(d.path))}}catch(c){}return r}function Qe(e){var r=Fe(e);return r.length===0?null:r}function Ye(e){return a.createElement("img",{src:le,alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Ze(e){var r=D();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var n=e.matched;function s(i){var d=String(i).replace(/\\/g,"/"),c=d.lastIndexOf("/");return c>=0?d.slice(c+1):d}function l(i){var d=r.status;if(d!=null&&d.windowedOpen===!0){ee(M(e.useSessions,e.useWorkspaces));return}r.sidebarActive===!0&&N.openTab!==null&&N.openTab({path:i})===!0||(ee(M(e.useSessions,e.useWorkspaces)),x("/code-server/open-file",{file:i}).then(function(c){(c==null||c.ok!==!0)&&window.alert(c!=null&&c.error?c.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(c){window.alert("\u6253\u5F00\u5931\u8D25: "+String(c))}))}return a.createElement("div",{className:"dshcs-artifacts"},a.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),a.createElement("div",{className:"dshcs-artrow"},n.slice(0,6).map(function(i){return a.createElement("span",{key:i,className:"dshcs-artitem"},a.createElement("button",{type:"button",className:"dshcs-artfile",title:i,"aria-label":"\u6253\u5F00: "+i,onClick:function(){l(i)}},s(i)),a.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+i,"aria-label":"\u5728 Code Server \u6253\u5F00: "+i,onClick:function(){l(i)}},a.createElement(Ye,null)))}),n.length>6?a.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function Je(e){try{qe(e)}catch(r){console.error("[code-server] apply failed:",r&&r.stack?r.stack:String(r));try{document.title="CS-ERR "+(r&&r.message||String(r))}catch(n){}}}function qe(e){var r=e.get("slots");if(r===void 0){console.error("[code-server] slots service unavailable");return}var n=e.settingsScope,s=null;if(n!==void 0&&typeof n.bind=="function")s=n.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}x("/code-server/status").then(function(f){k({status:f})}).catch(function(){}),r.inject("settings.plugin.item",()=>r.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:s}}},We));var l=!1;function i(f,w){if(!l){l=!0,b();var y=!1;try{y=Ue(f)}catch(g){console.error("[code-server] sidebar tab registration failed:",g!=null&&g.message!=null?g.message:String(g))}R.sidebarUi==="legacy"&&(console.log("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u665A\u5230(\u7ECF "+w+"):\u64A4\u9500\u65E7\u7248 DSH \u5224\u5B9A"),x("/code-server/ui-mode",{sidebar:!0}).catch(function(){})),k({sidebarActive:y,sidebarUi:"modern",sidebarRegisterFailed:y!==!0}),r.inject("shell.overlay",()=>r.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},g=>a.createElement(Ae,g)));try{r.inject("conversation.chat.turnTail",function(){return r.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:Qe},Ze)})}catch(g){console.warn("[code-server] turnTail register failed:",g!=null&&g.message!=null?g.message:String(g))}console.log("[code-server] client registered via "+w+": sidebar tab="+y+" + turnTail artifacts + resident preload + settings card")}}function d(f){k({sidebarActive:!1,sidebarUi:"legacy"}),console.warn("[code-server] \u672A\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1(sidebarRightTabs/sidebarRight): \u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH \u2014\u2014 \u9664\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server\u300D\u7684\u63D0\u793A\u5916\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3,\u4E5F\u4E0D\u9884\u70ED IDE\u3002\u8BF7\u5347\u7EA7 DSH\u3002"),f===!0&&x("/code-server/ui-mode",{sidebar:!1}).catch(function(){})}var c=null,v=null,u=null;function b(){c!==null&&(clearTimeout(c),c=null),v!==null&&(clearTimeout(v),v=null),u!==null&&(clearTimeout(u),u=null)}var p=!1;try{typeof e.inject=="function"&&(p=!0,e.inject(["sidebarRightTabs","sidebarRight"],function(f){i(f,"inject")}))}catch(f){console.warn("[code-server] sidebar inject failed:",f!=null&&f.message!=null?f.message:String(f))}var m=typeof e.get=="function"&&e.get("sidebarRightTabs")!==void 0&&e.get("sidebarRight")!==void 0;if(m){u=setTimeout(function(){l||(console.warn("[code-server] ctx.inject \u672A\u5728 1.5s \u5185\u56DE\u8C03,\u6539\u7528\u540C\u6B65\u670D\u52A1\u6CE8\u518C\u4FA7\u680F"),i(e,"sync-fallback"))},Ie);return}if(p!==!0){d(!0);return}c=setTimeout(function(){l||d(!1)},je),v=setTimeout(function(){l||d(!0)},ze)}var Xe=["slots","settingsScope"],Ke="code-server";
5
5
  return module.exports;}});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads the workbench. Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions get a single upgrade notice on the settings page and no other UI. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.136.1",
4
4
  "productPath": "stable-8d5f383f301ca20681f5b6606b8207d9dc87bdd8",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-10T14:05:25.353Z",
6
+ "preparedAt": "2026-09-10T14:42:14.464Z",
7
7
  "source": "registry",
8
8
  "node": "v24.13.1",
9
9
  "platform": "win32",