@shawnstack/quickforge 1.7.5 → 1.7.6

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.
Files changed (66) hide show
  1. package/dist/assets/AgentProfilesPage-Dl5Peqov.js +1 -0
  2. package/dist/assets/ChatPanelHost-D3987TUJ.js +307 -0
  3. package/dist/assets/CloudAccountSettingsPage-BG5Nn3bq.js +1 -0
  4. package/dist/assets/PluginsPage-BDKYfLna.js +1 -0
  5. package/dist/assets/ScheduledTasksPage--GAki3lB.js +2 -0
  6. package/dist/assets/SettingsWorkspacePage-DSy66Tuw.js +1696 -0
  7. package/dist/assets/ShareLinksSettingsPage-BQQMsvJo.js +1 -0
  8. package/dist/assets/SharedConversationPage-B9BUVCri.js +1 -0
  9. package/dist/assets/TerminalDock-CT1nYo7P.js +2 -0
  10. package/dist/assets/{WorkspaceInspector-D9kdnLDd.js → WorkspaceInspector-BnfDLf9a.js} +5 -5
  11. package/dist/assets/{dist-DLKC_odd.js → dist-yDHbi5ux.js} +1 -1
  12. package/dist/assets/{esm-Df4edDpj.js → esm-sdsK6gaB.js} +2 -2
  13. package/dist/assets/{icons-CXPP1fFT.js → icons-2D18YbSI.js} +1 -1
  14. package/dist/assets/index-1ei6nhs-.css +3 -0
  15. package/dist/assets/index-BivLuZvX.js +65 -0
  16. package/dist/assets/{mcp-servers-dialog-BUSPvaqI.js → mcp-servers-dialog-BEV4_TXC.js} +2 -2
  17. package/dist/assets/{logger-8REuLPGK.js → model-display-label-C6-0eDxF.js} +1 -1
  18. package/dist/assets/{monaco-D6OhXgjg.js → monaco-DvXErxp2.js} +1 -1
  19. package/dist/assets/{react-vendor-1KC5PyRx.js → react-vendor-3UaA-C9W.js} +1 -1
  20. package/dist/assets/{skills-dialog-BThnIUBs.js → skills-dialog-BTJ7mzk_.js} +3 -3
  21. package/dist/assets/{web-DoV8MSMn.js → web-B5qgZJRv.js} +1 -1
  22. package/dist/index.html +8 -8
  23. package/dist/sw.js +17 -0
  24. package/package.json +2 -1
  25. package/runtime-assets/agent/darwin-arm64/qf-agent +0 -0
  26. package/runtime-assets/agent/darwin-x64/qf-agent +0 -0
  27. package/runtime-assets/agent/linux-arm64/qf-agent +0 -0
  28. package/runtime-assets/agent/linux-x64/qf-agent +0 -0
  29. package/runtime-assets/agent/win32-x64/qf-agent.exe +0 -0
  30. package/server/access-policy.mjs +11 -0
  31. package/server/agent-manager.mjs +349 -48
  32. package/server/agent-profiles.mjs +27 -8
  33. package/server/auto-compaction.mjs +35 -8
  34. package/server/cloud/client.mjs +4 -7
  35. package/server/cloud/config.mjs +6 -5
  36. package/server/cloud/credential-store.mjs +10 -3
  37. package/server/cloud/identity.mjs +17 -60
  38. package/server/cloud/models.mjs +1 -1
  39. package/server/cloud/qf-agent-process.mjs +571 -0
  40. package/server/cloud/runtime.mjs +11 -5
  41. package/server/cloud/service-config.mjs +8 -4
  42. package/server/index.mjs +96 -37
  43. package/server/mcp/registry.mjs +8 -7
  44. package/server/message-converters.mjs +40 -19
  45. package/server/model-catalog.mjs +11 -4
  46. package/server/opencode-acp-agent.mjs +1151 -0
  47. package/server/public-api.mjs +11 -5
  48. package/server/routes/agent-profiles.mjs +6 -3
  49. package/server/routes/agent.mjs +43 -3
  50. package/server/routes/backup.mjs +5 -4
  51. package/server/routes/cloud.mjs +54 -35
  52. package/server/routes/shares.mjs +7 -8
  53. package/server/routes/storage.mjs +9 -24
  54. package/server/routes/system.mjs +7 -4
  55. package/server/utils/process-tree.mjs +78 -0
  56. package/dist/assets/AgentProfilesPage-XNjuqJs7.js +0 -1
  57. package/dist/assets/ChatPanelHost-CuF-PZpc.js +0 -292
  58. package/dist/assets/CloudAccountSettingsPage-GJSoi6sO.js +0 -1
  59. package/dist/assets/PluginsPage-BQgp0qN-.js +0 -1
  60. package/dist/assets/ScheduledTasksPage-DdekATzq.js +0 -2
  61. package/dist/assets/SettingsWorkspacePage-Cb54Ic91.js +0 -1639
  62. package/dist/assets/ShareLinksSettingsPage-C75WJpaF.js +0 -1
  63. package/dist/assets/SharedConversationPage-CjMtSQTW.js +0 -1
  64. package/dist/assets/TerminalDock-D4zJBJc4.js +0 -2
  65. package/dist/assets/index-_ZhK6bvp.js +0 -65
  66. package/dist/assets/index-iVV2bP_f.css +0 -3
@@ -1,5 +1,5 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,E as n,G as r,Vt as i,Wt as a,_ as o,ct as s,o as c,x as l}from"./icons-CXPP1fFT.js";import{n as u}from"./react-vendor-1KC5PyRx.js";import{I as d,dn as f,in as p,on as m,ot as h,sn as g}from"./index-_ZhK6bvp.js";var _=e(a(),1),v=u();function y(e){return e===`connected`?`bg-emerald-500/12 text-emerald-700 dark:text-emerald-300`:e===`error`?`bg-destructive/12 text-destructive`:e===`disabled`?`bg-muted text-muted-foreground`:`bg-amber-500/12 text-amber-700 dark:text-amber-300`}var b=12;function x({server:e,toggling:n,reconnecting:i,onToggle:a,onEdit:o,onDelete:s,onReconnect:u}){let d=e.tools?.slice(0,b)??[],p=e.toolCount??e.tools?.length??0,h=Math.max(0,p-d.length),_=e.enabled&&e.status!==`connected`;return(0,v.jsxs)(`div`,{className:`rounded-lg border border-border p-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground/90`,children:e.name}),(0,v.jsx)(`span`,{className:g(`rounded-full px-2 py-0.5 text-[11px]`,y(e.status)),children:e.status||`unknown`}),(0,v.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:f(`mcpToolsCount`,{count:p})})]}),(0,v.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted-foreground/65`,children:e.transport===`stdio`?`${e.command} ${(e.args||[]).join(` `)}`:e.url}),e.error?(0,v.jsx)(`div`,{className:`mt-1 text-xs text-destructive`,children:e.error}):null]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.enabled,disabled:n,className:g(`relative h-6 w-11 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60`,e.enabled?`bg-emerald-500`:`bg-muted-foreground/30`),onClick:()=>a(e),title:e.enabled?f(`pauseTask`):f(`enable`),children:(0,v.jsx)(`span`,{className:g(`absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow transition-transform`,e.enabled?`translate-x-5`:`translate-x-0`)})}),_?(0,v.jsx)(m,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 text-muted-foreground`,onClick:()=>u(e.name),disabled:i,"aria-label":f(`mcpReconnectServer`),title:f(`mcpReconnectServer`),children:i?(0,v.jsx)(r,{className:`size-4 animate-spin`}):(0,v.jsx)(l,{className:`size-4`})}):null,(0,v.jsx)(m,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 text-muted-foreground`,onClick:()=>o(e),"aria-label":f(`editTask`),title:f(`editTask`),children:(0,v.jsx)(t,{className:`size-4`})}),(0,v.jsx)(m,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 text-destructive`,onClick:()=>s(e.name),"aria-label":f(`delete`),title:f(`delete`),children:(0,v.jsx)(c,{className:`size-4`})})]})]}),d.length>0?(0,v.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[d.map(e=>(0,v.jsx)(`span`,{className:`rounded-md bg-muted/28 px-1.5 py-0.5 text-[11px] text-muted-foreground/75`,title:e.quickForgeName,children:e.name},e.quickForgeName)),h>0?(0,v.jsx)(`span`,{className:`rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground/55`,children:f(`mcpMoreTools`,{count:h})}):null]}):null]})}function S(){return{name:``,transport:`stdio`,command:``,args:[],url:``,cwd:``,env:{}}}function C(e){return{name:e.name,transport:e.transport,command:e.command,args:e.args||[],url:e.url||``,cwd:e.cwd||``,env:e.env||{}}}function w(e){return(e||[]).join(`
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,E as n,Wt as r,_ as i,dt as a,q as o,qt as s,s as c,x as l}from"./icons-2D18YbSI.js";import{n as u}from"./react-vendor-3UaA-C9W.js";import{B as d,Tt as f,fn as p,hn as m,mn as h,yn as g}from"./index-BivLuZvX.js";var _=e(s(),1),v=u();function y(e){return e===`connected`?`bg-emerald-500/12 text-emerald-700 dark:text-emerald-300`:e===`error`?`bg-destructive/12 text-destructive`:e===`disabled`?`bg-muted text-muted-foreground`:`bg-amber-500/12 text-amber-700 dark:text-amber-300`}var b=12;function x({server:e,toggling:n,reconnecting:r,onToggle:i,onEdit:a,onDelete:s,onReconnect:u}){let d=e.tools?.slice(0,b)??[],f=e.toolCount??e.tools?.length??0,p=Math.max(0,f-d.length),_=e.enabled&&e.status!==`connected`;return(0,v.jsxs)(`div`,{className:`rounded-lg border border-border p-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,v.jsxs)(`div`,{className:`min-w-0`,children:[(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,v.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground/90`,children:e.name}),(0,v.jsx)(`span`,{className:m(`rounded-full px-2 py-0.5 text-[11px]`,y(e.status)),children:e.status||`unknown`}),(0,v.jsx)(`span`,{className:`text-[11px] text-muted-foreground/60`,children:g(`mcpToolsCount`,{count:f})})]}),(0,v.jsx)(`div`,{className:`mt-1 truncate text-xs text-muted-foreground/65`,children:e.transport===`stdio`?`${e.command} ${(e.args||[]).join(` `)}`:e.url}),e.error?(0,v.jsx)(`div`,{className:`mt-1 text-xs text-destructive`,children:e.error}):null]}),(0,v.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,v.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.enabled,disabled:n,className:m(`relative h-6 w-11 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60`,e.enabled?`bg-emerald-500`:`bg-muted-foreground/30`),onClick:()=>i(e),title:e.enabled?g(`pauseTask`):g(`enable`),children:(0,v.jsx)(`span`,{className:m(`absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow transition-transform`,e.enabled?`translate-x-5`:`translate-x-0`)})}),_?(0,v.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 text-muted-foreground`,onClick:()=>u(e.name),disabled:r,"aria-label":g(`mcpReconnectServer`),title:g(`mcpReconnectServer`),children:r?(0,v.jsx)(o,{className:`size-4 animate-spin`}):(0,v.jsx)(l,{className:`size-4`})}):null,(0,v.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 text-muted-foreground`,onClick:()=>a(e),"aria-label":g(`editTask`),title:g(`editTask`),children:(0,v.jsx)(t,{className:`size-4`})}),(0,v.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`size-8 text-destructive`,onClick:()=>s(e.name),"aria-label":g(`delete`),title:g(`delete`),children:(0,v.jsx)(c,{className:`size-4`})})]})]}),d.length>0?(0,v.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:[d.map(e=>(0,v.jsx)(`span`,{className:`rounded-md bg-muted/28 px-1.5 py-0.5 text-[11px] text-muted-foreground/75`,title:e.quickForgeName,children:e.name},e.quickForgeName)),p>0?(0,v.jsx)(`span`,{className:`rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground/55`,children:g(`mcpMoreTools`,{count:p})}):null]}):null]})}function S(){return{name:``,transport:`stdio`,command:``,args:[],url:``,cwd:``,env:{}}}function C(e){return{name:e.name,transport:e.transport,command:e.command,args:e.args||[],url:e.url||``,cwd:e.cwd||``,env:e.env||{}}}function w(e){return(e||[]).join(`
2
2
  `)}function T(e){return Object.entries(e||{}).map(([e,t])=>`${e}=${t}`).join(`
3
3
  `)}function E(e){return e.split(`
4
4
  `).map(e=>e.trim()).filter(Boolean)}function D(e){let t={};for(let n of e.split(`
5
- `)){let e=n.trim();if(!e)continue;let r=e.indexOf(`=`);if(r<=0)continue;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();i&&(t[i]=a)}return t}function O(e){let t={type:e.transport||`stdio`};e.transport===`stdio`?(t.command=e.command||``,t.args=e.args||[],e.cwd&&(t.cwd=e.cwd),e.env&&Object.keys(e.env).length>0&&(t.env=e.env)):(t.url=e.url||``,e.env&&Object.keys(e.env).length>0&&(t.headers=e.env));let n=e.name||`server`;return JSON.stringify({mcpServers:{[n]:t}},null,2)}function k(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function A(e){let t;try{t=JSON.parse(e)}catch{throw Error(f(`mcpInvalidJson`))}if(!k(t))throw Error(f(`mcpInvalidConfigJson`));let n=``,r=null;if(k(t.mcpServers)){let e=Object.entries(t.mcpServers);if(e.length===0)throw Error(f(`mcpEmptyConfigJson`));let[i,a]=e[0];n=i,k(a)&&(r=a)}else r=t;if(!r)throw Error(f(`mcpInvalidConfigJson`));let i=String(r.transport||r.type||`stdio`);if(![`stdio`,`http`,`sse`].includes(i))throw Error(f(`mcpInvalidTransport`,{name:n||`server`}));let a=r.env??r.headers??{};return{name:n,transport:i,command:String(r.command||``),args:Array.isArray(r.args)?r.args:[],url:String(r.url||``),cwd:String(r.cwd||``),env:k(a)?a:{}}}var j=`mb-1 block text-xs text-muted-foreground/72`,M=`min-h-20 w-full resize-y rounded-md border border-input bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-ring`,N=`flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm outline-none focus:border-ring`;function P({value:e,onChange:t,isEdit:n,disabled:r}){let i=e.transport===`stdio`,a=n=>t({...e,...n});return(0,v.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground/60`,children:f(n?`mcpEditServer`:`mcpAddServer`)}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-name`,children:f(`mcpServerName`)}),(0,v.jsx)(d,{id:`mcp-server-name`,value:e.name,onChange:e=>a({name:e.target.value}),placeholder:f(`mcpNamePlaceholder`),disabled:n||r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-transport`,children:f(`mcpTransport`)}),(0,v.jsxs)(`select`,{id:`mcp-server-transport`,className:N,value:e.transport,onChange:e=>a({transport:e.target.value}),disabled:r,children:[(0,v.jsx)(`option`,{value:`stdio`,children:`stdio`}),(0,v.jsx)(`option`,{value:`http`,children:`http`}),(0,v.jsx)(`option`,{value:`sse`,children:`sse`})]})]}),i?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-command`,children:f(`mcpCommand`)}),(0,v.jsx)(d,{id:`mcp-server-command`,value:e.command,onChange:e=>a({command:e.target.value}),placeholder:f(`mcpCommandPlaceholder`),disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-args`,children:f(`mcpArgs`)}),(0,v.jsx)(`textarea`,{id:`mcp-server-args`,className:M,value:w(e.args),onChange:e=>a({args:E(e.target.value)}),spellCheck:!1,disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-cwd`,children:f(`mcpCwd`)}),(0,v.jsx)(d,{id:`mcp-server-cwd`,value:e.cwd,onChange:e=>a({cwd:e.target.value}),disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-env`,children:f(`mcpEnv`)}),(0,v.jsx)(`textarea`,{id:`mcp-server-env`,className:M,value:T(e.env),onChange:e=>a({env:D(e.target.value)}),spellCheck:!1,disabled:r})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-url`,children:f(`mcpUrl`)}),(0,v.jsx)(d,{id:`mcp-server-url`,value:e.url,onChange:e=>a({url:e.target.value}),placeholder:f(`mcpUrlPlaceholder`),disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-headers`,children:f(`mcpHeaders`)}),(0,v.jsx)(`textarea`,{id:`mcp-server-headers`,className:M,value:T(e.env),onChange:e=>a({env:D(e.target.value)}),spellCheck:!1,disabled:r})]})]})]})}async function F(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||`HTTP ${e.status}`);return t}function I({active:e=!0,className:t}){let[a,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(!1),[d,y]=(0,_.useState)(!1),[b,w]=(0,_.useState)(new Set),[T,E]=(0,_.useState)(null),[D,k]=(0,_.useState)(``),[j,M]=(0,_.useState)(!1),[N,I]=(0,_.useState)(null),[L,R]=(0,_.useState)(S),[z,B]=(0,_.useState)(`form`),[V,H]=(0,_.useState)(``),[U,W]=(0,_.useState)(``),G=(0,_.useCallback)(e=>{c(e?.servers??[])},[]),K=(0,_.useCallback)(async()=>{u(!0),k(``);try{G(await F(await fetch(`/api/mcp/servers`)))}catch(e){k(e instanceof Error?e.message:f(`mcpLoadFailed`))}finally{u(!1)}},[G]);if((0,_.useEffect)(()=>{if(!e)return;let t=window.setTimeout(()=>{K()},0);return()=>window.clearTimeout(t)},[e,K]),!e)return null;let q=e=>{e===`json`&&(H(O(L)),W(``)),B(e)},J=()=>{I(null),R(S()),B(`form`),M(!0),k(``)},Y=e=>{let t=C(e);I(e),R(t),H(O(t)),W(``),B(`form`),M(!0),k(``)},X=()=>{M(!1),I(null),H(``),W(``),k(``)},Z=e=>{R(e)},Q=e=>{H(e);try{let t=A(e);R(e=>({...t,name:t.name||e.name})),W(``)}catch(e){W(e instanceof Error?e.message:f(`mcpInvalidJson`))}},ee=async()=>{if(!d){if(U&&z===`json`){k(U);return}y(!0),k(``);try{G(await F(await fetch(`/api/mcp/servers`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({server:{...L,enabled:N?.enabled??!0}})}))),X()}catch(e){k(e instanceof Error?e.message:f(`mcpSaveFailed`))}finally{y(!1)}}},te=async e=>{if(await h({description:f(`mcpDeleteConfirm`,{name:e}),confirmLabel:f(`confirmDelete`),cancelLabel:f(`cancel`),variant:`destructive`})){k(``);try{G(await F(await fetch(`/api/mcp/servers/${encodeURIComponent(e)}`,{method:`DELETE`})))}catch(e){k(e instanceof Error?e.message:f(`mcpDeleteFailed`))}}},ne=async e=>{if(!b.has(e.name)){w(t=>new Set(t).add(e.name)),k(``);try{G(await F(await fetch(`/api/mcp/servers/${encodeURIComponent(e.name)}/enabled`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:!e.enabled})})))}catch(e){k(e instanceof Error?e.message:f(`mcpSaveFailed`))}finally{w(t=>{let n=new Set(t);return n.delete(e.name),n})}}},re=async e=>{if(!T){E(e),k(``);try{G(await F(await fetch(`/api/mcp/reconnect/${encodeURIComponent(e)}`,{method:`POST`})))}catch(e){k(e instanceof Error?e.message:f(`mcpReconnectFailed`))}finally{E(null)}}},$=!!N,ie=!!L.name.trim()&&!!(L.transport===`stdio`?L.command.trim():L.url.trim());return j?(0,v.jsxs)(`div`,{className:g(`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,t),children:[(0,v.jsx)(`div`,{className:`border-b border-border px-6 py-5`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,onClick:X,children:[(0,v.jsx)(i,{className:`size-4`}),f(`mcpConfiguredServers`)]}),(0,v.jsx)(`span`,{className:`text-sm font-medium text-foreground/90`,children:f($?`mcpEditServer`:`mcpAddServer`)})]})}),D?(0,v.jsx)(`div`,{className:`m-6 mb-0 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:D}):null,(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,v.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[(0,v.jsxs)(`div`,{className:`flex border-b border-border`,children:[(0,v.jsxs)(`button`,{type:`button`,onClick:()=>q(`form`),className:g(`flex flex-1 items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors`,z===`form`?`border-b-2 border-primary text-foreground/90 -mb-px`:`text-muted-foreground/60 hover:text-foreground/85`),children:[(0,v.jsx)(o,{className:`size-3.5`}),f(`mcpTabServer`)]}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>q(`json`),className:g(`flex flex-1 items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors`,z===`json`?`border-b-2 border-primary text-foreground/90 -mb-px`:`text-muted-foreground/60 hover:text-foreground/85`),children:[(0,v.jsx)(s,{className:`size-3.5`}),f(`mcpTabJson`)]})]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:z===`form`?(0,v.jsx)(P,{value:L,onChange:Z,isEdit:$,disabled:d}):(0,v.jsxs)(`div`,{className:`space-y-2`,children:[(0,v.jsx)(`textarea`,{className:`min-h-96 w-full resize-y rounded-md border border-input bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-ring`,value:V,onChange:e=>Q(e.target.value),spellCheck:!1}),U?(0,v.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:U}):null,(0,v.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium text-foreground/90`,children:[f(`mcpTabJson`),(0,v.jsx)(p,{label:f(`mcpImportConfigDescription`)})]})]})}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-border pt-3`,children:[(0,v.jsx)(m,{type:`button`,variant:`outline`,size:`sm`,onClick:X,disabled:d,children:f(`cancel`)}),(0,v.jsxs)(m,{type:`button`,size:`sm`,onClick:()=>{ee()},disabled:d||!ie,children:[d?(0,v.jsx)(r,{className:`mr-1.5 size-3.5 animate-spin`}):null,f(`save`)]})]})]})})]}):(0,v.jsxs)(`div`,{className:g(`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,t),children:[(0,v.jsx)(`div`,{className:`border-b border-border px-6 py-5`,children:(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,v.jsx)(`h3`,{className:`text-sm font-medium text-foreground/90`,children:f(`mcpConfiguredServers`)}),(0,v.jsxs)(m,{type:`button`,variant:`ghost`,size:`sm`,onClick:J,children:[(0,v.jsx)(n,{className:`mr-1.5 size-3.5`}),f(`mcpAddServer`)]})]})}),D?(0,v.jsx)(`div`,{className:`m-6 mb-0 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:D}):null,(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,v.jsx)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:l&&a.length===0?(0,v.jsxs)(`div`,{className:`flex items-center justify-center gap-2 rounded-lg border border-border py-8 text-sm text-muted-foreground`,children:[(0,v.jsx)(r,{className:`size-4 animate-spin`}),f(`loading`)]}):a.length===0?(0,v.jsx)(`div`,{className:`rounded-lg border border-border bg-muted/15 p-4 text-sm text-muted-foreground/72`,children:f(`mcpNoServersDescription`)}):a.map(e=>(0,v.jsx)(x,{server:e,toggling:b.has(e.name),reconnecting:T===e.name,onToggle:e=>{ne(e)},onEdit:Y,onDelete:e=>{te(e)},onReconnect:e=>{re(e)}},e.name))})})]})}export{I as McpServersPanel};
5
+ `)){let e=n.trim();if(!e)continue;let r=e.indexOf(`=`);if(r<=0)continue;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();i&&(t[i]=a)}return t}function O(e){let t={type:e.transport||`stdio`};e.transport===`stdio`?(t.command=e.command||``,t.args=e.args||[],e.cwd&&(t.cwd=e.cwd),e.env&&Object.keys(e.env).length>0&&(t.env=e.env)):(t.url=e.url||``,e.env&&Object.keys(e.env).length>0&&(t.headers=e.env));let n=e.name||`server`;return JSON.stringify({mcpServers:{[n]:t}},null,2)}function k(e){return!!(e&&typeof e==`object`&&!Array.isArray(e))}function A(e){let t;try{t=JSON.parse(e)}catch{throw Error(g(`mcpInvalidJson`))}if(!k(t))throw Error(g(`mcpInvalidConfigJson`));let n=``,r=null;if(k(t.mcpServers)){let e=Object.entries(t.mcpServers);if(e.length===0)throw Error(g(`mcpEmptyConfigJson`));let[i,a]=e[0];n=i,k(a)&&(r=a)}else r=t;if(!r)throw Error(g(`mcpInvalidConfigJson`));let i=String(r.transport||r.type||`stdio`);if(![`stdio`,`http`,`sse`].includes(i))throw Error(g(`mcpInvalidTransport`,{name:n||`server`}));let a=r.env??r.headers??{};return{name:n,transport:i,command:String(r.command||``),args:Array.isArray(r.args)?r.args:[],url:String(r.url||``),cwd:String(r.cwd||``),env:k(a)?a:{}}}var j=`mb-1 block text-xs text-muted-foreground/72`,M=`min-h-20 w-full resize-y rounded-md border border-input bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-ring`,N=`flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm outline-none focus:border-ring`;function P({value:e,onChange:t,isEdit:n,disabled:r}){let i=e.transport===`stdio`,a=n=>t({...e,...n});return(0,v.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,v.jsx)(`div`,{className:`text-xs text-muted-foreground/60`,children:g(n?`mcpEditServer`:`mcpAddServer`)}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-name`,children:g(`mcpServerName`)}),(0,v.jsx)(d,{id:`mcp-server-name`,value:e.name,onChange:e=>a({name:e.target.value}),placeholder:g(`mcpNamePlaceholder`),disabled:n||r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-transport`,children:g(`mcpTransport`)}),(0,v.jsxs)(`select`,{id:`mcp-server-transport`,className:N,value:e.transport,onChange:e=>a({transport:e.target.value}),disabled:r,children:[(0,v.jsx)(`option`,{value:`stdio`,children:`stdio`}),(0,v.jsx)(`option`,{value:`http`,children:`http`}),(0,v.jsx)(`option`,{value:`sse`,children:`sse`})]})]}),i?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-command`,children:g(`mcpCommand`)}),(0,v.jsx)(d,{id:`mcp-server-command`,value:e.command,onChange:e=>a({command:e.target.value}),placeholder:g(`mcpCommandPlaceholder`),disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-args`,children:g(`mcpArgs`)}),(0,v.jsx)(`textarea`,{id:`mcp-server-args`,className:M,value:w(e.args),onChange:e=>a({args:E(e.target.value)}),spellCheck:!1,disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-cwd`,children:g(`mcpCwd`)}),(0,v.jsx)(d,{id:`mcp-server-cwd`,value:e.cwd,onChange:e=>a({cwd:e.target.value}),disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-env`,children:g(`mcpEnv`)}),(0,v.jsx)(`textarea`,{id:`mcp-server-env`,className:M,value:T(e.env),onChange:e=>a({env:D(e.target.value)}),spellCheck:!1,disabled:r})]})]}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-url`,children:g(`mcpUrl`)}),(0,v.jsx)(d,{id:`mcp-server-url`,value:e.url,onChange:e=>a({url:e.target.value}),placeholder:g(`mcpUrlPlaceholder`),disabled:r})]}),(0,v.jsxs)(`div`,{children:[(0,v.jsx)(`label`,{className:j,htmlFor:`mcp-server-headers`,children:g(`mcpHeaders`)}),(0,v.jsx)(`textarea`,{id:`mcp-server-headers`,className:M,value:T(e.env),onChange:e=>a({env:D(e.target.value)}),spellCheck:!1,disabled:r})]})]})]})}async function F(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||`HTTP ${e.status}`);return t}function I({active:e=!0,className:t}){let[s,c]=(0,_.useState)([]),[l,u]=(0,_.useState)(!1),[d,y]=(0,_.useState)(!1),[b,w]=(0,_.useState)(new Set),[T,E]=(0,_.useState)(null),[D,k]=(0,_.useState)(``),[j,M]=(0,_.useState)(!1),[N,I]=(0,_.useState)(null),[L,R]=(0,_.useState)(S),[z,B]=(0,_.useState)(`form`),[V,H]=(0,_.useState)(``),[U,W]=(0,_.useState)(``),G=(0,_.useCallback)(e=>{c(e?.servers??[])},[]),K=(0,_.useCallback)(async()=>{u(!0),k(``);try{G(await F(await fetch(`/api/mcp/servers`)))}catch(e){k(e instanceof Error?e.message:g(`mcpLoadFailed`))}finally{u(!1)}},[G]);if((0,_.useEffect)(()=>{if(!e)return;let t=window.setTimeout(()=>{K()},0);return()=>window.clearTimeout(t)},[e,K]),!e)return null;let q=e=>{e===`json`&&(H(O(L)),W(``)),B(e)},J=()=>{I(null),R(S()),B(`form`),M(!0),k(``)},Y=e=>{let t=C(e);I(e),R(t),H(O(t)),W(``),B(`form`),M(!0),k(``)},X=()=>{M(!1),I(null),H(``),W(``),k(``)},Z=e=>{R(e)},Q=e=>{H(e);try{let t=A(e);R(e=>({...t,name:t.name||e.name})),W(``)}catch(e){W(e instanceof Error?e.message:g(`mcpInvalidJson`))}},ee=async()=>{if(!d){if(U&&z===`json`){k(U);return}y(!0),k(``);try{G(await F(await fetch(`/api/mcp/servers`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({server:{...L,enabled:N?.enabled??!0}})}))),X()}catch(e){k(e instanceof Error?e.message:g(`mcpSaveFailed`))}finally{y(!1)}}},te=async e=>{if(await f({description:g(`mcpDeleteConfirm`,{name:e}),confirmLabel:g(`confirmDelete`),cancelLabel:g(`cancel`),variant:`destructive`})){k(``);try{G(await F(await fetch(`/api/mcp/servers/${encodeURIComponent(e)}`,{method:`DELETE`})))}catch(e){k(e instanceof Error?e.message:g(`mcpDeleteFailed`))}}},ne=async e=>{if(!b.has(e.name)){w(t=>new Set(t).add(e.name)),k(``);try{G(await F(await fetch(`/api/mcp/servers/${encodeURIComponent(e.name)}/enabled`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({enabled:!e.enabled})})))}catch(e){k(e instanceof Error?e.message:g(`mcpSaveFailed`))}finally{w(t=>{let n=new Set(t);return n.delete(e.name),n})}}},re=async e=>{if(!T){E(e),k(``);try{G(await F(await fetch(`/api/mcp/reconnect/${encodeURIComponent(e)}`,{method:`POST`})))}catch(e){k(e instanceof Error?e.message:g(`mcpReconnectFailed`))}finally{E(null)}}},$=!!N,ie=!!L.name.trim()&&!!(L.transport===`stdio`?L.command.trim():L.url.trim());return j?(0,v.jsxs)(`div`,{className:m(`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,t),children:[(0,v.jsx)(`div`,{className:`border-b border-border px-6 py-5`,children:(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,v.jsxs)(`button`,{type:`button`,className:`inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground`,onClick:X,children:[(0,v.jsx)(r,{className:`size-4`}),g(`mcpConfiguredServers`)]}),(0,v.jsx)(`span`,{className:`text-sm font-medium text-foreground/90`,children:g($?`mcpEditServer`:`mcpAddServer`)})]})}),D?(0,v.jsx)(`div`,{className:`m-6 mb-0 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:D}):null,(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,v.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[(0,v.jsxs)(`div`,{className:`flex border-b border-border`,children:[(0,v.jsxs)(`button`,{type:`button`,onClick:()=>q(`form`),className:m(`flex flex-1 items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors`,z===`form`?`border-b-2 border-primary text-foreground/90 -mb-px`:`text-muted-foreground/60 hover:text-foreground/85`),children:[(0,v.jsx)(i,{className:`size-3.5`}),g(`mcpTabServer`)]}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>q(`json`),className:m(`flex flex-1 items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors`,z===`json`?`border-b-2 border-primary text-foreground/90 -mb-px`:`text-muted-foreground/60 hover:text-foreground/85`),children:[(0,v.jsx)(a,{className:`size-3.5`}),g(`mcpTabJson`)]})]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:z===`form`?(0,v.jsx)(P,{value:L,onChange:Z,isEdit:$,disabled:d}):(0,v.jsxs)(`div`,{className:`space-y-2`,children:[(0,v.jsx)(`textarea`,{className:`min-h-96 w-full resize-y rounded-md border border-input bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-ring`,value:V,onChange:e=>Q(e.target.value),spellCheck:!1}),U?(0,v.jsx)(`div`,{className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:U}):null,(0,v.jsxs)(`div`,{className:`inline-flex items-center gap-1.5 text-[11px] font-medium text-foreground/90`,children:[g(`mcpTabJson`),(0,v.jsx)(p,{label:g(`mcpImportConfigDescription`)})]})]})}),(0,v.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-border pt-3`,children:[(0,v.jsx)(h,{type:`button`,variant:`outline`,size:`sm`,onClick:X,disabled:d,children:g(`cancel`)}),(0,v.jsxs)(h,{type:`button`,size:`sm`,onClick:()=>{ee()},disabled:d||!ie,children:[d?(0,v.jsx)(o,{className:`mr-1.5 size-3.5 animate-spin`}):null,g(`save`)]})]})]})})]}):(0,v.jsxs)(`div`,{className:m(`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,t),children:[(0,v.jsx)(`div`,{className:`border-b border-border px-6 py-5`,children:(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,v.jsx)(`h3`,{className:`text-sm font-medium text-foreground/90`,children:g(`mcpConfiguredServers`)}),(0,v.jsxs)(h,{type:`button`,variant:`ghost`,size:`sm`,onClick:J,children:[(0,v.jsx)(n,{className:`mr-1.5 size-3.5`}),g(`mcpAddServer`)]})]})}),D?(0,v.jsx)(`div`,{className:`m-6 mb-0 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:D}):null,(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,v.jsx)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:l&&s.length===0?(0,v.jsxs)(`div`,{className:`flex items-center justify-center gap-2 rounded-lg border border-border py-8 text-sm text-muted-foreground`,children:[(0,v.jsx)(o,{className:`size-4 animate-spin`}),g(`loading`)]}):s.length===0?(0,v.jsx)(`div`,{className:`rounded-lg border border-border bg-muted/15 p-4 text-sm text-muted-foreground/72`,children:g(`mcpNoServersDescription`)}):s.map(e=>(0,v.jsx)(x,{server:e,toggling:b.has(e.name),reconnecting:T===e.name,onToggle:e=>{ne(e)},onEdit:Y,onDelete:e=>{te(e)},onReconnect:e=>{re(e)}},e.name))})})]})}export{I as McpServersPanel};
@@ -1 +1 @@
1
- var e=`[QuickForge]`;function t(){try{return localStorage.getItem(`quickforge_debug`)===`1`}catch{return!1}}function n(e){return e===`debug`?t():!0}function r(e){if(typeof e==`string`)return e;if(e instanceof Error)return e.stack||e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(t,i,...a){if(!n(t))return;let o=new Date().toISOString(),s=a.length>0?` `+a.map(r).join(` `):``,c=`${o} [${t.toUpperCase()}] ${e} ${i}${s}`;switch(t){case`error`:console.error(c);break;case`warn`:console.warn(c);break;case`info`:console.info(c);break;case`debug`:console.debug(c);break}}var a={error:(e,...t)=>i(`error`,e,...t),warn:(e,...t)=>i(`warn`,e,...t),info:(e,...t)=>i(`info`,e,...t),debug:(e,...t)=>i(`debug`,e,...t)};export{a as t};
1
+ var e=`[QuickForge]`;function t(){try{return localStorage.getItem(`quickforge_debug`)===`1`}catch{return!1}}function n(e){return e===`debug`?t():!0}function r(e){if(typeof e==`string`)return e;if(e instanceof Error)return e.stack||e.message;try{return JSON.stringify(e)}catch{return String(e)}}function i(t,i,...a){if(!n(t))return;let o=new Date().toISOString(),s=a.length>0?` `+a.map(r).join(` `):``,c=`${o} [${t.toUpperCase()}] ${e} ${i}${s}`;switch(t){case`error`:console.error(c);break;case`warn`:console.warn(c);break;case`info`:console.info(c);break;case`debug`:console.debug(c);break}}var a={error:(e,...t)=>i(`error`,e,...t),warn:(e,...t)=>i(`warn`,e,...t),info:(e,...t)=>i(`info`,e,...t),debug:(e,...t)=>i(`debug`,e,...t)};function o(e){return`${e.provider} / ${e.id}`}export{a as n,o as t};
@@ -1,4 +1,4 @@
1
- import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Wt as t}from"./icons-CXPP1fFT.js";function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r(e){if(Array.isArray(e))return e}function i(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function o(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{qt as t}from"./icons-2D18YbSI.js";function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function r(e){if(Array.isArray(e))return e}function i(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function o(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?s(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t){if(e==null)return{};var n,r,i=u(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function u(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function d(e,t){return r(e)||a(e,t)||m(e,t)||o()}function f(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function p(e){var t=f(e,`string`);return typeof t==`symbol`?t:t+``}function m(e,t){if(e){if(typeof e==`string`)return n(e,t);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?g(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function v(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function y(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function b(e){return{}.toString.call(e).includes(`Object`)}function x(e){return!Object.keys(e).length}function S(e){return typeof e==`function`}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function w(e,t){return b(t)||k(`changeType`),Object.keys(t).some(function(t){return!C(e,t)})&&k(`changeField`),t}function T(e){S(e)||k(`selectorType`)}function E(e){S(e)||b(e)||k(`handlerType`),b(e)&&Object.values(e).some(function(e){return!S(e)})&&k(`handlersType`)}function D(e){e||k(`initialIsRequired`),b(e)||k(`initialType`),x(e)&&k(`initialContent`)}function O(e,t){throw Error(e[t]||e.default)}var k=y(O)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),A={changes:w,selector:T,handler:E,initial:D};function j(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A.initial(e),A.handler(t);var n={current:e},r=y(P)(n,t),i=y(N)(n),a=y(A.changes)(e),o=y(M)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return A.selector(e),e(n.current)}function c(e){v(r,i,a,o)(e)}return[s,c]}function M(e,t){return S(t)?t(e.current):t}function N(e,t){return e.current=_(_({},e.current),t),t}function P(e,t,n){return S(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var F={create:j},I={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function ee(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function te(e){return{}.toString.call(e).includes(`Object`)}function ne(e){return e||R(`configIsRequired`),te(e)||R(`configType`),e.urls?(re(),{paths:{vs:e.urls.monacoBase}}):e}function re(){console.warn(L.deprecation)}function ie(e,t){throw Error(e[t]||e.default)}var L={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
3
  You are using deprecated way of configuration.
4
4
 
@@ -1,4 +1,4 @@
1
- import{t as e}from"./rolldown-runtime-DWdDZTNf.js";import{Wt as t}from"./icons-CXPP1fFT.js";var n=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,ee=5,w=-1;function T(){return g?!0:!(e.unstable_now()-w<ee)}function E(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){_(E,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),r=e(((e,t)=>{t.exports=n()})),i=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.5`})),a=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e((e=>{var n=r(),i=t(),o=a();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},I=[],L=-1;function re(e){return{current:e}}function R(e){0>L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var B=re(null),ie=re(null),ae=re(null),oe=re(null);function se(e,t){switch(z(ae,t),z(ie,e),z(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(B),z(B,e)}function ce(){R(B),R(ie),R(ae)}function V(e){e.memoizedState!==null&&z(oe,e);var t=B.current,n=Hd(t,e.type);t!==n&&(z(ie,e),z(B,n))}function le(e){ie.current===e&&(R(B),R(ie)),oe.current===e&&(R(oe),Qf._currentValue=ne)}var H,ue;function de(e){if(H===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||``,ue=-1<e.stack.indexOf(`
1
+ import{t as e}from"./rolldown-runtime-DWdDZTNf.js";import{qt as t}from"./icons-2D18YbSI.js";var n=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,ee=5,w=-1;function T(){return g?!0:!(e.unstable_now()-w<ee)}function E(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&T());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=E,D=function(){k.postMessage(null)}}else D=function(){_(E,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),r=e(((e,t)=>{t.exports=n()})),i=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.5`})),a=e(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=e((e=>{var n=r(),i=t(),o=a();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){o=!0,n=i,r=a;break}if(c===r){o=!0,r=i,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=i;break}if(c===r){o=!0,r=a,n=i;break}c=c.sibling}if(!o)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),ee=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),A=Symbol.iterator;function te(e){return typeof e!=`object`||!e?null:(e=A&&e[A]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case ee:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},I=[],L=-1;function re(e){return{current:e}}function R(e){0>L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var B=re(null),ie=re(null),ae=re(null),oe=re(null);function se(e,t){switch(z(ae,t),z(ie,e),z(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(B),z(B,e)}function ce(){R(B),R(ie),R(ae)}function V(e){e.memoizedState!==null&&z(oe,e);var t=B.current,n=Hd(t,e.type);t!==n&&(z(ie,e),z(B,n))}function le(e){ie.current===e&&(R(B),R(ie)),oe.current===e&&(R(oe),Qf._currentValue=ne)}var H,ue;function de(e){if(H===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);H=t&&t[1]||``,ue=-1<e.stack.indexOf(`
2
2
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
3
  `+H+e+ue}var fe=!1;function pe(e,t){if(!e||fe)return``;fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
4
  `),l=s.split(`
@@ -1,3 +1,3 @@
1
- import{i as e,n as t}from"./rolldown-runtime-DWdDZTNf.js";import{G as n,It as r,Vt as i,Wt as a,n as o,y as s}from"./icons-CXPP1fFT.js";import{n as c}from"./react-vendor-1KC5PyRx.js";import{dn as l,in as u,sn as d}from"./index-_ZhK6bvp.js";var f=t({SkillsDialog:()=>_,SkillsManagerPanel:()=>g}),p=e(a(),1),m=c();async function h(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||`HTTP ${e.status}`);return t}function g({active:e=!0,scope:t,project:a,embedded:c=!1,onClose:f,onSaved:g}){let[_,v]=(0,p.useState)([]),[y,b]=(0,p.useState)(()=>new Set),[x,S]=(0,p.useState)(``),[C,w]=(0,p.useState)([]),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),j=t===`project`,[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)(null),[I,L]=(0,p.useState)(!1),[R,z]=(0,p.useState)(``),B=(0,p.useCallback)(()=>{N(null),F(null),z(``)},[]),V=(0,p.useCallback)(()=>{B(),f?.()},[f,B]);(0,p.useEffect)(()=>{if(!e||j&&!a)return;let t=!1;return(async()=>{E(!0),A(``);try{let e=j?`/api/skills?projectId=${encodeURIComponent(a.id)}`:`/api/skills?scope=global`,n=await h(await fetch(e));if(t)return;v(Array.isArray(n.skills)?n.skills:[]),b(new Set(Array.isArray(n.selectedSkills)?n.selectedSkills:[])),w(Array.isArray(n.searchPaths)?n.searchPaths:[])}catch(e){t||A(e instanceof Error?e.message:l(`failedToLoadSkills`))}finally{t||E(!1)}})(),()=>{t=!0}},[e,a,j]),(0,p.useEffect)(()=>{if(!e||c)return;let t=e=>{e.key===`Escape`&&(M?B():D||V())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,V,c,D,M,B]);let H=(0,p.useMemo)(()=>{let e=x.trim().toLowerCase();return e?_.filter(t=>[t.name,t.displayName,t.description,t.source,t.compatibility,t.allowedTools,...t.tags??[],...t.triggers??[]].filter(Boolean).join(` `).toLowerCase().includes(e)):_},[x,_]),U=async e=>{N(e),F(null),z(``),L(!0);try{let t=new URLSearchParams({name:e});j&&a?(t.set(`scope`,`project`),t.set(`projectId`,a.id)):t.set(`scope`,`global`),F(await h(await fetch(`/api/skills/content?${t}`)))}catch(e){z(e instanceof Error?e.message:l(`failedToReadSkill`))}finally{L(!1)}};if(!e||j&&!a)return null;let W=e=>{if(D)return;let t=new Set(y);t.has(e)?t.delete(e):t.add(e),b(t),G(t)},G=async e=>{O(!0),A(``);try{let n=await h(await fetch(j?`/api/skills/project`:`/api/skills/global`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(j?{projectId:a.id,selectedSkills:[...e]}:{selectedSkills:[...e]})}));g({scope:t,project:j?n.projects?.find(e=>e.id===a.id)??{...a,skills:n.selectedSkills}:void 0,projects:n.projects,selectedSkills:n.selectedSkills})}catch(e){b(y),A(e instanceof Error?e.message:l(`failedToSaveSkills`))}finally{O(!1)}},K=l(j?`projectSkills`:`globalSkills`),q=j?l(`projectSkillsDescription`,{project:a.name}):l(`globalSkillsDescription`),J=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`quickforge-settings-divider p-3`,children:(0,m.jsxs)(`div`,{className:`quickforge-settings-inline-field`,children:[(0,m.jsx)(s,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground/60`}),(0,m.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),placeholder:l(`searchSkills`),className:`quickforge-settings-input`,disabled:T||D})]})}),k?(0,m.jsx)(`div`,{className:`quickforge-settings-alert quickforge-settings-warning-attached`,children:k}):null,(0,m.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,m.jsx)(`span`,{className:`quickforge-settings-row-title`,children:l(`availableSkills`)}),(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-info`,children:l(`selectedSkillsCount`,{count:y.size})})]}),(0,m.jsx)(`div`,{className:c?``:`max-h-[46vh] overflow-y-auto`,children:T?(0,m.jsxs)(`div`,{className:`quickforge-settings-empty-row inline-flex items-center gap-2`,children:[(0,m.jsx)(n,{className:`size-4 animate-spin`}),l(`loading`)]}):H.length===0?(0,m.jsx)(`div`,{className:`quickforge-settings-empty-row`,children:l(`noMatchingSkills`)}):H.map(e=>{let t=y.has(e.name);return(0,m.jsxs)(`div`,{className:d(`quickforge-settings-list-item`,t&&`bg-muted/12`),children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-list-item-main`,children:[(0,m.jsx)(`div`,{className:`quickforge-settings-row-title`,children:e.displayName||e.name}),e.description?(0,m.jsx)(`div`,{className:`quickforge-settings-row-description`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`quickforge-settings-meta`,children:[e.source?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e.source}):null,e.compatibility?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e.compatibility}):null,e.allowedTools?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e.allowedTools}):null,e.tags?.slice(0,5).map(e=>(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e},e))]})]}),(0,m.jsxs)(`div`,{className:`quickforge-settings-list-item-actions`,onClick:e=>e.stopPropagation(),children:[(0,m.jsxs)(`label`,{className:`quickforge-settings-switch`,"aria-disabled":D?`true`:`false`,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:t,disabled:D,onChange:()=>W(e.name),"aria-label":t?`Disable ${e.name}`:`Enable ${e.name}`}),(0,m.jsx)(`span`,{"aria-hidden":`true`})]}),(0,m.jsx)(`button`,{type:`button`,className:`quickforge-settings-icon-action`,onClick:()=>void U(e.name),disabled:D||I,title:l(`readSkill`),"aria-label":`${l(`readSkill`)}: ${e.displayName||e.name}`,children:(0,m.jsx)(r,{className:`size-4`})})]})]},e.name)})})]}),Y=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`quickforge-settings-button quickforge-settings-button-secondary`,onClick:B,disabled:I,children:[(0,m.jsx)(i,{className:`mr-2 size-4`}),l(`backToSkillList`)]}),(0,m.jsx)(`div`,{className:`quickforge-settings-row-main min-w-0`,children:(0,m.jsx)(`div`,{className:`quickforge-settings-row-title truncate`,children:P?.displayName||P?.name||M})})]}),(0,m.jsx)(`div`,{className:`p-4`,children:I?(0,m.jsxs)(`div`,{className:`quickforge-settings-empty-row inline-flex items-center gap-2`,children:[(0,m.jsx)(n,{className:`size-4 animate-spin`}),l(`loading`)]}):R?(0,m.jsx)(`div`,{className:`quickforge-settings-alert quickforge-settings-warning-attached`,children:R}):P?(0,m.jsxs)(m.Fragment,{children:[P.description?(0,m.jsx)(`div`,{className:`quickforge-settings-row-description mb-3`,children:P.description}):null,(0,m.jsxs)(`div`,{className:`quickforge-settings-meta mb-3`,children:[P.version?(0,m.jsxs)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:[`v`,P.version]}):null,P.source?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.source}):null,P.compatibility?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.compatibility}):null,P.allowedTools?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.allowedTools}):null,P.license?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.license}):null,P.tags?.map(e=>(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e},e))]}),P.triggers?.length?(0,m.jsxs)(`div`,{className:`quickforge-settings-row-description mb-3`,children:[`Triggers: `,P.triggers.join(`, `)]}):null,P.instructions?(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap break-words rounded-md border border-border bg-muted/30 px-4 py-3 font-mono text-sm leading-6 text-foreground/80`,children:P.instructions}):(0,m.jsx)(`div`,{className:`quickforge-settings-empty-row`,children:l(`noSkillContent`)})]}):null})]});return c?(0,m.jsx)(`div`,{className:`quickforge-settings-stack`,children:(0,m.jsx)(`section`,{className:`quickforge-settings-section`,"aria-label":K,children:M?Y:(0,m.jsxs)(m.Fragment,{children:[C.length?(0,m.jsx)(`div`,{className:`px-5 pt-4`,children:(0,m.jsxs)(`span`,{className:`quickforge-settings-row-description inline-flex items-center`,children:[l(`skillSearchPaths`),(0,m.jsx)(u,{label:C.join(`
2
- `)})]})}):null,J]})})}):(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onClick:e=>{e.target===e.currentTarget&&!D&&V()},children:(0,m.jsxs)(`div`,{className:`flex max-h-[85vh] w-full max-w-2xl flex-col rounded-lg border border-border bg-background shadow-quickforge`,children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[K,(0,m.jsx)(u,{label:q})]}),(0,m.jsx)(`div`,{className:`quickforge-settings-row-description`,children:q}),C.length?(0,m.jsxs)(`div`,{className:`quickforge-settings-row-description inline-flex items-center`,children:[l(`skillSearchPaths`),(0,m.jsx)(u,{label:C.join(`
3
- `)})]}):null]}),(0,m.jsx)(`button`,{type:`button`,className:`quickforge-settings-icon-action`,onClick:V,disabled:D,"aria-label":l(`close`),children:(0,m.jsx)(o,{className:`size-4`})})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:M?Y:J})]})})}function _({open:e,scope:t,project:n,onOpenChange:r,onSaved:i}){return(0,m.jsx)(g,{active:e,scope:t,project:n,onClose:()=>r(!1),onSaved:i})}export{f as n,_ as t};
1
+ import{i as e,n as t}from"./rolldown-runtime-DWdDZTNf.js";import{Wt as n,n as r,q as i,qt as a,y as o,zt as s}from"./icons-2D18YbSI.js";import{n as c}from"./react-vendor-3UaA-C9W.js";import{fn as l,hn as u,yn as d}from"./index-BivLuZvX.js";var f=t({SkillsDialog:()=>_,SkillsManagerPanel:()=>g}),p=e(a(),1),m=c();async function h(e){let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||`HTTP ${e.status}`);return t}function g({active:e=!0,scope:t,project:a,embedded:c=!1,onClose:f,onSaved:g}){let[_,v]=(0,p.useState)([]),[y,b]=(0,p.useState)(()=>new Set),[x,S]=(0,p.useState)(``),[C,w]=(0,p.useState)([]),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),j=t===`project`,[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)(null),[I,L]=(0,p.useState)(!1),[R,z]=(0,p.useState)(``),B=(0,p.useCallback)(()=>{N(null),F(null),z(``)},[]),V=(0,p.useCallback)(()=>{B(),f?.()},[f,B]);(0,p.useEffect)(()=>{if(!e||j&&!a)return;let t=!1;return(async()=>{E(!0),A(``);try{let e=j?`/api/skills?projectId=${encodeURIComponent(a.id)}`:`/api/skills?scope=global`,n=await h(await fetch(e));if(t)return;v(Array.isArray(n.skills)?n.skills:[]),b(new Set(Array.isArray(n.selectedSkills)?n.selectedSkills:[])),w(Array.isArray(n.searchPaths)?n.searchPaths:[])}catch(e){t||A(e instanceof Error?e.message:d(`failedToLoadSkills`))}finally{t||E(!1)}})(),()=>{t=!0}},[e,a,j]),(0,p.useEffect)(()=>{if(!e||c)return;let t=e=>{e.key===`Escape`&&(M?B():D||V())};return document.addEventListener(`keydown`,t),()=>document.removeEventListener(`keydown`,t)},[e,V,c,D,M,B]);let H=(0,p.useMemo)(()=>{let e=x.trim().toLowerCase();return e?_.filter(t=>[t.name,t.displayName,t.description,t.source,t.compatibility,t.allowedTools,...t.tags??[],...t.triggers??[]].filter(Boolean).join(` `).toLowerCase().includes(e)):_},[x,_]),U=async e=>{N(e),F(null),z(``),L(!0);try{let t=new URLSearchParams({name:e});j&&a?(t.set(`scope`,`project`),t.set(`projectId`,a.id)):t.set(`scope`,`global`),F(await h(await fetch(`/api/skills/content?${t}`)))}catch(e){z(e instanceof Error?e.message:d(`failedToReadSkill`))}finally{L(!1)}};if(!e||j&&!a)return null;let W=e=>{if(D)return;let t=new Set(y);t.has(e)?t.delete(e):t.add(e),b(t),G(t)},G=async e=>{O(!0),A(``);try{let n=await h(await fetch(j?`/api/skills/project`:`/api/skills/global`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(j?{projectId:a.id,selectedSkills:[...e]}:{selectedSkills:[...e]})}));g({scope:t,project:j?n.projects?.find(e=>e.id===a.id)??{...a,skills:n.selectedSkills}:void 0,projects:n.projects,selectedSkills:n.selectedSkills})}catch(e){b(y),A(e instanceof Error?e.message:d(`failedToSaveSkills`))}finally{O(!1)}},K=d(j?`projectSkills`:`globalSkills`),q=j?d(`projectSkillsDescription`,{project:a.name}):d(`globalSkillsDescription`),J=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`quickforge-settings-divider p-3`,children:(0,m.jsxs)(`div`,{className:`quickforge-settings-inline-field`,children:[(0,m.jsx)(o,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground/60`}),(0,m.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),placeholder:d(`searchSkills`),className:`quickforge-settings-input`,disabled:T||D})]})}),k?(0,m.jsx)(`div`,{className:`quickforge-settings-alert quickforge-settings-warning-attached`,children:k}):null,(0,m.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,m.jsx)(`span`,{className:`quickforge-settings-row-title`,children:d(`availableSkills`)}),(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-info`,children:d(`selectedSkillsCount`,{count:y.size})})]}),(0,m.jsx)(`div`,{className:c?``:`max-h-[46vh] overflow-y-auto`,children:T?(0,m.jsxs)(`div`,{className:`quickforge-settings-empty-row inline-flex items-center gap-2`,children:[(0,m.jsx)(i,{className:`size-4 animate-spin`}),d(`loading`)]}):H.length===0?(0,m.jsx)(`div`,{className:`quickforge-settings-empty-row`,children:d(`noMatchingSkills`)}):H.map(e=>{let t=y.has(e.name);return(0,m.jsxs)(`div`,{className:u(`quickforge-settings-list-item`,t&&`bg-muted/12`),children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-list-item-main`,children:[(0,m.jsx)(`div`,{className:`quickforge-settings-row-title`,children:e.displayName||e.name}),e.description?(0,m.jsx)(`div`,{className:`quickforge-settings-row-description`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`quickforge-settings-meta`,children:[e.source?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e.source}):null,e.compatibility?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e.compatibility}):null,e.allowedTools?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e.allowedTools}):null,e.tags?.slice(0,5).map(e=>(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e},e))]})]}),(0,m.jsxs)(`div`,{className:`quickforge-settings-list-item-actions`,onClick:e=>e.stopPropagation(),children:[(0,m.jsxs)(`label`,{className:`quickforge-settings-switch`,"aria-disabled":D?`true`:`false`,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:t,disabled:D,onChange:()=>W(e.name),"aria-label":t?`Disable ${e.name}`:`Enable ${e.name}`}),(0,m.jsx)(`span`,{"aria-hidden":`true`})]}),(0,m.jsx)(`button`,{type:`button`,className:`quickforge-settings-icon-action`,onClick:()=>void U(e.name),disabled:D||I,title:d(`readSkill`),"aria-label":`${d(`readSkill`)}: ${e.displayName||e.name}`,children:(0,m.jsx)(s,{className:`size-4`})})]})]},e.name)})})]}),Y=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`quickforge-settings-button quickforge-settings-button-secondary`,onClick:B,disabled:I,children:[(0,m.jsx)(n,{className:`mr-2 size-4`}),d(`backToSkillList`)]}),(0,m.jsx)(`div`,{className:`quickforge-settings-row-main min-w-0`,children:(0,m.jsx)(`div`,{className:`quickforge-settings-row-title truncate`,children:P?.displayName||P?.name||M})})]}),(0,m.jsx)(`div`,{className:`p-4`,children:I?(0,m.jsxs)(`div`,{className:`quickforge-settings-empty-row inline-flex items-center gap-2`,children:[(0,m.jsx)(i,{className:`size-4 animate-spin`}),d(`loading`)]}):R?(0,m.jsx)(`div`,{className:`quickforge-settings-alert quickforge-settings-warning-attached`,children:R}):P?(0,m.jsxs)(m.Fragment,{children:[P.description?(0,m.jsx)(`div`,{className:`quickforge-settings-row-description mb-3`,children:P.description}):null,(0,m.jsxs)(`div`,{className:`quickforge-settings-meta mb-3`,children:[P.version?(0,m.jsxs)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:[`v`,P.version]}):null,P.source?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.source}):null,P.compatibility?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.compatibility}):null,P.allowedTools?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.allowedTools}):null,P.license?(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:P.license}):null,P.tags?.map(e=>(0,m.jsx)(`span`,{className:`quickforge-settings-badge quickforge-settings-badge-muted`,children:e},e))]}),P.triggers?.length?(0,m.jsxs)(`div`,{className:`quickforge-settings-row-description mb-3`,children:[`Triggers: `,P.triggers.join(`, `)]}):null,P.instructions?(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap break-words rounded-md border border-border bg-muted/30 px-4 py-3 font-mono text-sm leading-6 text-foreground/80`,children:P.instructions}):(0,m.jsx)(`div`,{className:`quickforge-settings-empty-row`,children:d(`noSkillContent`)})]}):null})]});return c?(0,m.jsx)(`div`,{className:`quickforge-settings-stack`,children:(0,m.jsx)(`section`,{className:`quickforge-settings-section`,"aria-label":K,children:M?Y:(0,m.jsxs)(m.Fragment,{children:[C.length?(0,m.jsx)(`div`,{className:`px-5 pt-4`,children:(0,m.jsxs)(`span`,{className:`quickforge-settings-row-description inline-flex items-center`,children:[d(`skillSearchPaths`),(0,m.jsx)(l,{label:C.join(`
2
+ `)})]})}):null,J]})})}):(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onClick:e=>{e.target===e.currentTarget&&!D&&V()},children:(0,m.jsxs)(`div`,{className:`flex max-h-[85vh] w-full max-w-2xl flex-col rounded-lg border border-border bg-background shadow-quickforge`,children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-toolbar`,children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-row-main`,children:[(0,m.jsxs)(`div`,{className:`quickforge-settings-row-title`,children:[K,(0,m.jsx)(l,{label:q})]}),(0,m.jsx)(`div`,{className:`quickforge-settings-row-description`,children:q}),C.length?(0,m.jsxs)(`div`,{className:`quickforge-settings-row-description inline-flex items-center`,children:[d(`skillSearchPaths`),(0,m.jsx)(l,{label:C.join(`
3
+ `)})]}):null]}),(0,m.jsx)(`button`,{type:`button`,className:`quickforge-settings-icon-action`,onClick:V,disabled:D,"aria-label":d(`close`),children:(0,m.jsx)(r,{className:`size-4`})})]}),(0,m.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:M?Y:J})]})})}function _({open:e,scope:t,project:n,onOpenChange:r,onSaved:i}){return(0,m.jsx)(g,{active:e,scope:t,project:n,onClose:()=>r(!1),onSaved:i})}export{f as n,_ as t};
@@ -1 +1 @@
1
- import{n as e}from"./dist-DLKC_odd.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
1
+ import{r as e}from"./dist-yDHbi5ux.js";var t=class extends e{constructor(){super(...arguments),this.pending=[],this.deliveredNotifications=[],this.hasNotificationSupport=()=>{if(!(`Notification`in window)||!Notification.requestPermission)return!1;if(Notification.permission!==`granted`)try{new Notification(``)}catch(e){if(e instanceof Error&&e.name===`TypeError`)return!1}return!0}}async getDeliveredNotifications(){let e=[];for(let t of this.deliveredNotifications){let n={title:t.title,id:parseInt(t.tag),body:t.body};e.push(n)}return{notifications:e}}async removeDeliveredNotifications(e){for(let t of e.notifications){let e=this.deliveredNotifications.find(e=>e.tag===String(t.id));e?.close(),this.deliveredNotifications=this.deliveredNotifications.filter(()=>!e)}}async removeAllDeliveredNotifications(){for(let e of this.deliveredNotifications)e.close();this.deliveredNotifications=[]}async createChannel(){throw this.unimplemented(`Not implemented on web.`)}async deleteChannel(){throw this.unimplemented(`Not implemented on web.`)}async listChannels(){throw this.unimplemented(`Not implemented on web.`)}async schedule(e){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);for(let t of e.notifications)this.sendNotification(t);return{notifications:e.notifications.map(e=>({id:e.id}))}}async getPending(){return{notifications:this.pending}}async registerActionTypes(){throw this.unimplemented(`Not implemented on web.`)}async cancel(e){this.pending=this.pending.filter(t=>!e.notifications.find(e=>e.id===t.id))}async areEnabled(){let{display:e}=await this.checkPermissions();return{value:e===`granted`}}async changeExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async checkExactNotificationSetting(){throw this.unimplemented(`Not implemented on web.`)}async requestPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(await Notification.requestPermission())}}async checkPermissions(){if(!this.hasNotificationSupport())throw this.unavailable(`Notifications not supported in this browser.`);return{display:this.transformNotificationPermission(Notification.permission)}}transformNotificationPermission(e){switch(e){case`granted`:return`granted`;case`denied`:return`denied`;default:return`prompt`}}sendPending(){let e=[],t=new Date().getTime();for(let n of this.pending)n.schedule?.at&&n.schedule.at.getTime()<=t&&(this.buildNotification(n),e.push(n));this.pending=this.pending.filter(t=>!e.find(e=>e===t))}sendNotification(e){if(e.schedule?.at){let t=e.schedule.at.getTime()-new Date().getTime();this.pending.push(e),setTimeout(()=>{this.sendPending()},t);return}this.buildNotification(e)}buildNotification(e){let t=new Notification(e.title,{body:e.body,tag:String(e.id)});return t.addEventListener(`click`,this.onClick.bind(this,e),!1),t.addEventListener(`show`,this.onShow.bind(this,e),!1),t.addEventListener(`close`,()=>{this.deliveredNotifications=this.deliveredNotifications.filter(()=>!this)},!1),this.deliveredNotifications.push(t),t}onClick(e){let t={actionId:`tap`,notification:e};this.notifyListeners(`localNotificationActionPerformed`,t)}onShow(e){this.notifyListeners(`localNotificationReceived`,e)}};export{t as LocalNotificationsWeb};
package/dist/index.html CHANGED
@@ -11,20 +11,20 @@
11
11
  <meta name="apple-mobile-web-app-title" content="QuickForge" />
12
12
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
13
13
  <title>速构 QuickForge</title>
14
- <script type="module" crossorigin src="/assets/index-_ZhK6bvp.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-BivLuZvX.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-DWdDZTNf.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/pi-ai-Cr2ee4a0.js">
17
- <link rel="modulepreload" crossorigin href="/assets/dist-DLKC_odd.js">
17
+ <link rel="modulepreload" crossorigin href="/assets/dist-yDHbi5ux.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/lit-vendor-DvaQX_UQ.js">
19
19
  <link rel="modulepreload" crossorigin href="/assets/pi-web-ui-DV5jKjSg.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/css-utils-31qzCXsk.js">
21
- <link rel="modulepreload" crossorigin href="/assets/icons-CXPP1fFT.js">
22
- <link rel="modulepreload" crossorigin href="/assets/react-vendor-1KC5PyRx.js">
23
- <link rel="modulepreload" crossorigin href="/assets/logger-8REuLPGK.js">
21
+ <link rel="modulepreload" crossorigin href="/assets/icons-2D18YbSI.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/react-vendor-3UaA-C9W.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/model-display-label-C6-0eDxF.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/model-reference-o41fJ6jQ.js">
25
- <link rel="modulepreload" crossorigin href="/assets/index-_ZhK6bvp.js">
26
- <link rel="modulepreload" crossorigin href="/assets/skills-dialog-BThnIUBs.js">
27
- <link rel="stylesheet" crossorigin href="/assets/index-iVV2bP_f.css">
25
+ <link rel="modulepreload" crossorigin href="/assets/index-BivLuZvX.js">
26
+ <link rel="modulepreload" crossorigin href="/assets/skills-dialog-BTJ7mzk_.js">
27
+ <link rel="stylesheet" crossorigin href="/assets/index-1ei6nhs-.css">
28
28
  </head>
29
29
  <body>
30
30
  <div id="root"></div>
package/dist/sw.js CHANGED
@@ -29,6 +29,23 @@ self.addEventListener('activate', (event) => {
29
29
  )
30
30
  })
31
31
 
32
+ self.addEventListener('notificationclick', (event) => {
33
+ event.notification.close()
34
+ const sessionId = event.notification.data?.sessionId
35
+ event.waitUntil(
36
+ self.clients.matchAll({ type: 'window', includeUncontrolled: true })
37
+ .then(async (windowClients) => {
38
+ const client = windowClients.find((candidate) => new URL(candidate.url).origin === self.location.origin)
39
+ if (client) {
40
+ await client.focus()
41
+ client.postMessage({ type: 'quickforge:open-session', sessionId })
42
+ return
43
+ }
44
+ await self.clients.openWindow('/')
45
+ }),
46
+ )
47
+ })
48
+
32
49
  self.addEventListener('fetch', (event) => {
33
50
  const { request } = event
34
51
  const url = new URL(request.url)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shawnstack/quickforge",
3
- "version": "1.7.5",
3
+ "version": "1.7.6",
4
4
  "description": "AI chat application with Agent access modes for local workspace tools. React + Vite + Tailwind CSS frontend, local Node.js storage server.",
5
5
  "keywords": [
6
6
  "ai",
@@ -41,6 +41,7 @@
41
41
  "server",
42
42
  "skills",
43
43
  "plugins",
44
+ "runtime-assets",
44
45
  "dist",
45
46
  "README.md",
46
47
  "LICENSE",
@@ -0,0 +1,11 @@
1
+ export function isAuthenticatedAppClient(context = {}) {
2
+ if (context.isLocalRequest === true) return true
3
+ // 云远程访问隧道(X-QuickForge-Tunnel: 1,仅 agent 与 qf 同机回环注入):视为已认证远程客户端。
4
+ // 认证等级提升,但本地能力裁剪不变——终端/系统代理/目录选择器/Explorer 等仍由 isLocalRequest 禁止。
5
+ if (context.tunnelClient === true) return true
6
+ return context.isLocalRequest === false && context.remoteAuthorized === true
7
+ }
8
+
9
+ export function isLocalClient(context = {}) {
10
+ return context.isLocalRequest === true
11
+ }