@shawnstack/quickforge 1.5.5 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +450 -450
  2. package/dist/assets/AgentProfilesPage-wpt1cJV0.js +1 -0
  3. package/dist/assets/{ChatPanelHost-u0K5IWMF.js → ChatPanelHost-CnQoAfxW.js} +55 -55
  4. package/dist/assets/PluginsPage-0wwQydcP.js +1 -0
  5. package/dist/assets/ScheduledTasksPage-qGHyGkjw.js +2 -0
  6. package/dist/assets/SettingsWorkspacePage-CeYg_VJl.js +1320 -0
  7. package/dist/assets/SharedConversationPage-D97o9Ycp.js +1 -0
  8. package/dist/assets/TerminalDock-D4zLoahb.js +2 -0
  9. package/dist/assets/WorkspaceInspector-Bn-am8g6.js +3 -0
  10. package/dist/assets/WorkspaceReaderDialog-B2WEMVuF.js +1 -0
  11. package/dist/assets/{diff-line-counts-N83e7__F.js → diff-line-counts-B60LmPZX.js} +1 -1
  12. package/dist/assets/icons-BlAm_pUr.js +1 -0
  13. package/dist/assets/index-C3bhHGO4.css +3 -0
  14. package/dist/assets/index-C_DXqhW8.js +69 -0
  15. package/dist/assets/mcp-servers-dialog-DEyq3gmP.js +20 -0
  16. package/dist/assets/{monaco-DtXl4zfe.js → monaco-C5Lhy6-h.js} +1 -1
  17. package/dist/assets/{pi-web-ui-CBet4bMl.js → pi-web-ui-DFNE2m5b.js} +1 -1
  18. package/dist/assets/{react-vendor-BjDQPVuK.js → react-vendor--m65aOgw.js} +1 -1
  19. package/dist/assets/skills-dialog-CZ3CuVtQ.js +1 -0
  20. package/dist/assets/{useAppTheme-Bm6HIzLF.js → useAppTheme-ChXh3B2c.js} +1 -1
  21. package/dist/index.html +7 -5
  22. package/package.json +4 -1
  23. package/server/agent-manager.mjs +15 -0
  24. package/server/approval-store.mjs +34 -2
  25. package/server/index.mjs +3 -0
  26. package/server/public-api.mjs +45 -0
  27. package/server/routes/storage.mjs +29 -9
  28. package/server/storage.mjs +13 -4
  29. package/dist/assets/AgentProfilesPage-nVhgwanY.js +0 -1
  30. package/dist/assets/PluginsPage-BVRTC0rz.js +0 -1
  31. package/dist/assets/ScheduledTasksPage-D37TE2cM.js +0 -2
  32. package/dist/assets/SharedConversationPage-D5hnzsZC.js +0 -1
  33. package/dist/assets/TerminalDock-NvH9esAS.js +0 -2
  34. package/dist/assets/WorkspaceInspector-DbnO1fei.js +0 -3
  35. package/dist/assets/WorkspaceReaderDialog-BcxIbNBq.js +0 -1
  36. package/dist/assets/icons-Uo4Gd-eK.js +0 -1
  37. package/dist/assets/index-DiaCCmXE.js +0 -1482
  38. package/dist/assets/index-KdiXReMI.css +0 -3
  39. /package/dist/assets/{plugin-api-YfYj_Bd7.js → plugin-api-UKg_cgSG.js} +0 -0
  40. /package/dist/assets/{xterm-5XDrJ343.js → xterm-BtSXYfUR.js} +0 -0
@@ -0,0 +1 @@
1
+ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Dt as t,Mt as n,T as r,a as i,at as a,c as o}from"./icons-BlAm_pUr.js";import{n as s}from"./react-vendor--m65aOgw.js";import{$ as c,G as l,H as u,K as d,M as f,Q as p,U as m,W as h,et as g,it as _}from"./index-C_DXqhW8.js";var v=e(n(),1),y=s();function b(){return{name:``,label:``,description:``,systemPrompt:``,allowedTools:[`read_file`,`grep_files`],maxRuntimeMs:`1800000`,maxToolCalls:`300`,enabledAsSubagent:!0}}function x(e){return{name:e.name,label:e.label,description:e.description??``,systemPrompt:e.systemPrompt??``,allowedTools:e.allowedTools??[],maxRuntimeMs:String(e.maxRuntimeMs??18e5),maxToolCalls:String(e.maxToolCalls??300),enabledAsSubagent:e.enabledAsSubagent}}function S(e){return{name:e.name.trim().toLowerCase(),label:e.label.trim(),description:e.description.trim(),systemPrompt:e.systemPrompt.trim(),allowedTools:e.allowedTools,maxRuntimeMs:Number(e.maxRuntimeMs||18e5),maxToolCalls:Number(e.maxToolCalls||300),enabledAsSubagent:e.enabledAsSubagent}}function C(e){return!!(e.name.trim()&&e.label.trim()&&e.allowedTools.length>0)}async function w(e,t){let n=await fetch(e,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||`请求失败`);return r}function T(){let[e,n]=(0,v.useState)([]),[s,T]=(0,v.useState)([]),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(null),[A,j]=(0,v.useState)(()=>b()),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(``),[I,L]=(0,v.useState)(!1),[R,z]=(0,v.useState)(),[B,V]=(0,v.useState)(`off`),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(null);async function K(){let[e,t]=await Promise.all([w(`/api/agent-profiles`),w(`/api/agent-profiles/available-tools`)]);n(e.agents),T(t.tools)}(0,v.useEffect)(()=>{let e=!1;async function t(){try{let[t,r]=await Promise.all([w(`/api/agent-profiles`),w(`/api/agent-profiles/available-tools`)]);if(e)return;n(t.agents),T(r.tools)}catch(t){e||U(t instanceof Error?t.message:_(`requestFailed`))}}return t(),()=>{e=!0}},[]),(0,v.useEffect)(()=>{let e=!1;async function t(){try{let t=await h(),n=await m(t),r=await l(t),i=r.model??await d(t)??n[0];if(e)return;z(i),V(r.thinkingLevel??u(i))}catch{}}return t(),()=>{e=!0}},[]),(0,v.useEffect)(()=>{if(!W)return;let e=()=>G(null);return window.addEventListener(`click`,e),window.addEventListener(`blur`,e),()=>{window.removeEventListener(`click`,e),window.removeEventListener(`blur`,e)}},[W]);let q=(0,v.useMemo)(()=>e.find(e=>e.id===O)??null,[e,O]);function J(e,t){j(n=>({...n,[e]:t}))}function Y(e){j(t=>({...t,allowedTools:t.allowedTools.includes(e)?t.allowedTools.filter(t=>t!==e):[...t.allowedTools,e]}))}function X(){k(null),j(b()),F(``),U(``),D(!0)}function Z(e){k(e.id),j(x(e)),F(``),U(``),D(!0)}function Q(){M||I||(D(!1),k(null),j(b()),F(``))}async function $(){let e=P.trim();if(!e){U(_(`aiFillAgentInputRequired`));return}if(!R){U(_(`aiFillAgentNoModel`));return}L(!0),U(``);try{let t=await w(`/api/agent-profiles/ai-fill`,{method:`POST`,body:JSON.stringify({instruction:e,model:R,thinkingLevel:B})});j(e=>({...e,name:t.agent.name,label:t.agent.label,description:t.agent.description,systemPrompt:t.agent.systemPrompt}))}catch(e){U(e instanceof Error?e.message:_(`aiFillAgentFailed`))}finally{L(!1)}}async function ee(){if(C(A)){N(!0),U(``);try{let e=S(A);O?await w(`/api/agent-profiles/${encodeURIComponent(O)}`,{method:`PATCH`,body:JSON.stringify(e)}):await w(`/api/agent-profiles`,{method:`POST`,body:JSON.stringify(e)}),Q(),await K()}catch(e){U(e instanceof Error?e.message:_(`requestFailed`))}finally{N(!1)}}}async function te(e){if(e.builtin||e.readonly)return;let t=!e.enabledAsSubagent,r=e.enabledAsSubagent;n(n=>n.map(n=>n.id===e.id?{...n,enabledAsSubagent:t}:n)),G(null);try{await w(`/api/agent-profiles/${encodeURIComponent(e.id)}`,{method:`PATCH`,body:JSON.stringify({enabledAsSubagent:t})})}catch(t){n(t=>t.map(t=>t.id===e.id?{...t,enabledAsSubagent:r}:t)),U(t instanceof Error?t.message:_(`requestFailed`))}}async function ne(e){if(!(e.builtin||e.readonly)&&await f({description:_(`confirmDeleteAgent`),confirmLabel:_(`confirmDelete`),cancelLabel:_(`cancel`),variant:`destructive`})){U(``);try{await w(`/api/agent-profiles/${encodeURIComponent(e.id)}`,{method:`DELETE`}),await K()}catch(e){U(e instanceof Error?e.message:_(`requestFailed`))}}}return(0,y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden bg-background`,children:[(0,y.jsx)(`div`,{className:`border-b border-border px-6 py-5`,children:(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded-2xl bg-primary/10 text-primary`,children:(0,y.jsx)(t,{className:`size-5`})}),(0,y.jsx)(`div`,{children:(0,y.jsxs)(`h1`,{className:`inline-flex items-center gap-1.5 text-lg font-semibold text-foreground`,children:[_(`agentsTab`),(0,y.jsx)(p,{label:_(`agentsDescription`)})]})})]}),(0,y.jsx)(c,{onClick:X,children:_(`createAgent`)})]})}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,y.jsxs)(`div`,{className:`mx-auto max-w-5xl space-y-5`,children:[H&&!E?(0,y.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:H}):null,(0,y.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:e.map(e=>(0,y.jsxs)(`div`,{className:`rounded-xl border border-border bg-card p-4`,children:[(0,y.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,y.jsxs)(`div`,{className:`min-w-0`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`h3`,{className:g(`truncate text-sm font-medium`,e.enabledAsSubagent?`text-foreground/90`:`text-muted-foreground`),children:e.label}),e.builtin?(0,y.jsx)(`span`,{className:`rounded-full bg-primary/10 px-2 py-0.5 text-xs text-primary`,children:_(`builtinAgent`)}):null]}),(0,y.jsx)(`p`,{className:`mt-1 font-mono text-xs text-muted-foreground`,children:e.name}),e.source&&!e.builtin?(0,y.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[e.source,e.relativePath?` · ${e.relativePath}`:``]}):null,(0,y.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:e.description||_(`noDescription`)})]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,onClick:e=>e.stopPropagation(),children:[(0,y.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e.enabledAsSubagent,disabled:e.builtin||e.readonly,className:g(`relative h-6 w-11 rounded-full transition-colors disabled:cursor-not-allowed disabled:opacity-60`,e.enabledAsSubagent?`bg-emerald-500`:`bg-muted-foreground/30`),onClick:()=>void te(e),title:e.enabledAsSubagent?_(`disableAsSubagent`):_(`enableAsSubagent`),children:(0,y.jsx)(`span`,{className:g(`absolute left-0.5 top-0.5 size-5 rounded-full bg-white shadow transition-transform`,e.enabledAsSubagent?`translate-x-5`:`translate-x-0`)})}),(0,y.jsxs)(`div`,{className:`relative`,children:[(0,y.jsx)(c,{variant:`ghost`,size:`icon`,onClick:()=>G(W===e.id?null:e.id),title:_(`moreActions`),children:(0,y.jsx)(a,{className:`size-4`})}),W===e.id?(0,y.jsxs)(`div`,{className:`absolute right-0 z-20 mt-1 w-36 overflow-hidden rounded-xl border border-border bg-popover py-1 text-sm shadow-quickforge`,children:[(0,y.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:e.builtin||e.readonly,onClick:()=>{G(null),Z(e)},children:[(0,y.jsx)(r,{className:`size-3.5`}),_(`editTask`)]}),(0,y.jsxs)(`button`,{className:`flex w-full items-center gap-2 px-3 py-2 text-left text-destructive hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50`,disabled:e.builtin||e.readonly,onClick:()=>{G(null),ne(e)},children:[(0,y.jsx)(i,{className:`size-3.5`}),_(`delete`)]})]}):null]})]})]}),(0,y.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-1`,children:e.allowedTools.map(e=>(0,y.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 font-mono text-xs text-muted-foreground`,children:e},e))}),(0,y.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t border-border pt-3 text-xs text-muted-foreground sm:grid-cols-2`,children:[(0,y.jsxs)(`span`,{children:[_(`maxRuntimeMs`),e.maxRuntimeMs??`-`]}),(0,y.jsxs)(`span`,{children:[_(`maxToolCalls`),e.maxToolCalls??`-`]})]})]},e.id))})]})}),E?(0,y.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4`,onMouseDown:e=>{e.target===e.currentTarget&&Q()},children:(0,y.jsxs)(`div`,{className:`flex max-h-[90vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-background shadow-quickforge`,onMouseDown:e=>e.stopPropagation(),children:[(0,y.jsxs)(`div`,{className:`shrink-0 border-b border-border px-5 py-4`,children:[(0,y.jsx)(`h2`,{className:`text-base font-medium text-foreground`,children:_(q?`editAgent`:`createAgent`)}),q?.readonly?(0,y.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:_(`builtinAgentReadonly`)}):null]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:(0,y.jsxs)(`div`,{className:`space-y-4`,children:[(0,y.jsxs)(`div`,{className:`rounded-2xl border border-border bg-muted/20 p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-sm font-medium text-foreground`,children:[(0,y.jsx)(o,{className:`size-4 text-primary`}),_(`aiFillAgent`),(0,y.jsx)(p,{label:_(`aiFillAgentDescription`)})]}),(0,y.jsx)(`textarea`,{className:`min-h-20 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground/65 focus:border-ring disabled:opacity-60`,value:P,disabled:!!q?.readonly||I,onChange:e=>F(e.target.value),placeholder:_(`aiFillAgentPlaceholder`)}),(0,y.jsx)(`div`,{className:`mt-2 flex justify-end`,children:(0,y.jsxs)(c,{variant:`outline`,size:`sm`,onClick:()=>void $(),disabled:!!q?.readonly||I||!P.trim(),children:[(0,y.jsx)(o,{className:`mr-1 size-3.5`}),_(I?`aiFillAgentLoading`:`aiFillAgent`)]})})]}),(0,y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,y.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[_(`agentName`),(0,y.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:A.name,disabled:!!q?.readonly,onChange:e=>J(`name`,e.target.value),placeholder:`reviewer`})]}),(0,y.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[_(`agentLabel`),(0,y.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:A.label,disabled:!!q?.readonly,onChange:e=>J(`label`,e.target.value),placeholder:_(`agentLabelPlaceholder`)})]})]}),(0,y.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[_(`agentDescription`),(0,y.jsx)(`input`,{className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:A.description,disabled:!!q?.readonly,onChange:e=>J(`description`,e.target.value)})]}),(0,y.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[_(`agentSystemPrompt`),(0,y.jsx)(`textarea`,{className:`mt-1 min-h-36 w-full resize-y rounded-xl border border-input bg-background px-3 py-2 text-sm outline-none focus:border-ring disabled:opacity-60`,value:A.systemPrompt,disabled:!!q?.readonly,onChange:e=>J(`systemPrompt`,e.target.value)})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`mb-2 text-sm font-medium text-foreground`,children:_(`allowedTools`)}),(0,y.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:s.map(e=>(0,y.jsxs)(`label`,{className:`flex items-start gap-2 rounded-xl border border-border bg-muted/20 p-3 text-sm disabled:opacity-60`,children:[(0,y.jsx)(`input`,{type:`checkbox`,className:`mt-1`,disabled:!!q?.readonly,checked:A.allowedTools.includes(e.name),onChange:()=>Y(e.name)}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),(0,y.jsx)(`span`,{className:`ml-2 font-mono text-xs text-muted-foreground`,children:e.name}),e.riskLevel===`dangerous`?(0,y.jsx)(`span`,{className:`ml-2 rounded-full bg-amber-500/10 px-2 py-0.5 text-xs text-amber-700`,children:_(`highRiskTool`)}):null,(0,y.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:e.description})]})]},e.name))})]}),(0,y.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[(0,y.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[_(`maxRuntimeMs`),(0,y.jsx)(`input`,{type:`number`,className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:A.maxRuntimeMs,disabled:!!q?.readonly,onChange:e=>J(`maxRuntimeMs`,e.target.value)})]}),(0,y.jsxs)(`label`,{className:`block text-sm font-medium text-foreground`,children:[_(`maxToolCalls`),(0,y.jsx)(`input`,{type:`number`,className:`mt-1 h-10 w-full rounded-md border border-input bg-background px-3 text-sm outline-none focus:border-ring disabled:opacity-60`,value:A.maxToolCalls,disabled:!!q?.readonly,onChange:e=>J(`maxToolCalls`,e.target.value)})]})]}),(0,y.jsxs)(`label`,{className:`flex items-center gap-2 text-sm text-foreground`,children:[(0,y.jsx)(`input`,{type:`checkbox`,checked:A.enabledAsSubagent,disabled:!!q?.readonly,onChange:e=>J(`enabledAsSubagent`,e.target.checked)}),_(`enabledAsSubagent`)]}),H?(0,y.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:H}):null]})}),(0,y.jsx)(`div`,{className:`shrink-0 border-t border-border px-5 py-4`,children:(0,y.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,y.jsx)(c,{variant:`outline`,onClick:Q,disabled:M||I,children:_(`cancel`)}),(0,y.jsx)(c,{onClick:ee,disabled:M||I||!!q?.readonly||!C(A),children:_(`save`)})]})})]})}):null]})}export{T as AgentProfilesPage};