@shawnstack/quickforge 1.6.8 → 1.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +452 -452
- package/dist/assets/AgentProfilesPage-BtZpDV-3.js +1 -0
- package/dist/assets/ChatPanelHost-BF1V-xOV.js +244 -0
- package/dist/assets/{PluginsPage-3pZG7D7e.js → PluginsPage-CCIj8-Mn.js} +1 -1
- package/dist/assets/ScheduledTasksPage-DIMewQ3i.js +2 -0
- package/dist/assets/{SettingsWorkspacePage-DWkPyGP_.js → SettingsWorkspacePage-BPD495WT.js} +296 -290
- package/dist/assets/SharedConversationPage-B_oMTp7B.js +1 -0
- package/dist/assets/TerminalDock-wgW7kSC4.js +2 -0
- package/dist/assets/WorkspaceInspector-CdX45r3u.js +13 -0
- package/dist/assets/abnfDiagram-VRR7QNED-Dl_Fvlqg.js +1 -0
- package/dist/assets/arc-Bhg4c0ht.js +1 -0
- package/dist/assets/architecture-TIHT7OUA-BgP-IMeo.js +1 -0
- package/dist/assets/architectureDiagram-ZJ3FMSHR-BuojN27B.js +36 -0
- package/dist/assets/array-CYkMkqnU.js +1 -0
- package/dist/assets/blockDiagram-677ZJIJ3-alDLbrR1.js +132 -0
- package/dist/assets/c4Diagram-LMCZKHZV-D1lKa4VT.js +10 -0
- package/dist/assets/channel-Rz20dKTK.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-Cb14ZF_k.js +1 -0
- package/dist/assets/chunk-32BRIVSS-CwWLNjMZ.js +1 -0
- package/dist/assets/chunk-52WLFC77-Be569m7d.js +10 -0
- package/dist/assets/chunk-5FCAYU7R-BSvoiWV1.js +1 -0
- package/dist/assets/chunk-5HE753X5-CRgsy8WS.js +1 -0
- package/dist/assets/chunk-5JV3BV7I-CdW477UR.js +1 -0
- package/dist/assets/chunk-5TONJI2A-CdtKzSmp.js +2 -0
- package/dist/assets/chunk-5VM5RSS4-BKjjssLZ.js +15 -0
- package/dist/assets/chunk-7BUUIJ7U-ByAXiXdn.js +1 -0
- package/dist/assets/chunk-BIQX33UG-DeG8SCT1.js +1 -0
- package/dist/assets/chunk-C7G6YPKG-D_zHT68Q.js +1 -0
- package/dist/assets/chunk-CQNSW5MT-CHpHoUSu.js +1 -0
- package/dist/assets/chunk-CYSBUYHQ-CRP50Vov.js +1 -0
- package/dist/assets/chunk-EMLP6XTP-DX6uQQ2v.js +1 -0
- package/dist/assets/chunk-EX3LRPZG-DAJRNkHR.js +231 -0
- package/dist/assets/chunk-FWX5IMBZ-XbM5yomC.js +2 -0
- package/dist/assets/chunk-HOUHSVGY-Ci0ljnb1.js +1 -0
- package/dist/assets/chunk-ICXQ74PX-Dy2WJ71z.js +2 -0
- package/dist/assets/chunk-JG7HCLWE-2PrkzHkt.js +2 -0
- package/dist/assets/chunk-JWPE2WC7-D32uacSM.js +1 -0
- package/dist/assets/chunk-KEIR6QF5-77hsebd7.js +161 -0
- package/dist/assets/chunk-MOJQB5TN-DIAFLtiS.js +88 -0
- package/dist/assets/chunk-MOZMSUNE-BbscOaEz.js +1 -0
- package/dist/assets/chunk-OGEWGWER-ivBVxzKe.js +1 -0
- package/dist/assets/chunk-OSBZ3O6U-frD0hkdx.js +1 -0
- package/dist/assets/chunk-PUDLZKDR-B-37Rxae.js +156 -0
- package/dist/assets/chunk-Q4XR5HBZ-Y90m2RTe.js +11 -0
- package/dist/assets/chunk-QBLGF6JB-DixBqslB.js +1 -0
- package/dist/assets/chunk-R7FJI6CG-DXS1UXn_.js +1 -0
- package/dist/assets/chunk-RYQCIY6F-n4JxhNd0.js +1 -0
- package/dist/assets/chunk-U6XO7XAA-yHlgxMmn.js +2 -0
- package/dist/assets/chunk-V7JOEXUC-Z6kuZfbl.js +206 -0
- package/dist/assets/chunk-VAUOI2AC-BOZvd2Sn.js +1 -0
- package/dist/assets/chunk-VR4S4FIN-Cs_SIQma.js +1 -0
- package/dist/assets/chunk-WYO6CB5R-CGExYbV-.js +128 -0
- package/dist/assets/chunk-XXDRQBXY-CD_EGCtT.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-CQltPwYk.js +1 -0
- package/dist/assets/chunk-YOTPTUD7-DopPXWSl.js +1 -0
- package/dist/assets/chunk-ZGVPDNZ5-CJHOeqMb.js +62 -0
- package/dist/assets/chunk-ZIRB5QZD-BBVc5mf6.js +32 -0
- package/dist/assets/classDiagram-OUVF2IWQ-C_ozTKCt.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-FOfFbbZF.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-DLjV-dTm.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-BzPhLtd5.js +1 -0
- package/dist/assets/cynefinDiagram-TSTJHNR4-BfH3zVS-.js +62 -0
- package/dist/assets/cytoscape.esm-DwdZnGOm.js +321 -0
- package/dist/assets/dagre-CY3D84Cl.js +1 -0
- package/dist/assets/dagre-VKFMJZFB-BIhwZCIZ.js +4 -0
- package/dist/assets/defaultLocale-Beh6XjaL.js +1 -0
- package/dist/assets/diagram-FQU43EPY-BHnzNM2w.js +3 -0
- package/dist/assets/diagram-G47NLZAW-C7-ZlmFT.js +24 -0
- package/dist/assets/diagram-NH7WQ7WH-C-P9Y7IR.js +24 -0
- package/dist/assets/diagram-OA4YK3LP-Ci5lZ_T5.js +30 -0
- package/dist/assets/diagram-WEI45ONY-C1xuK2bs.js +41 -0
- package/dist/assets/dist-DelZBZpK.js +1 -0
- package/dist/assets/ebnfDiagram-CCIWWBDH-DKQ5NWMD.js +1 -0
- package/dist/assets/erDiagram-Q63AITRT-HAWySadP.js +85 -0
- package/dist/assets/eventmodeling-45OFAUF4-BcgGbVJ-.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-dtkzcC8E.js +1 -0
- package/dist/assets/ganttDiagram-NO4QXBWP-C1hwIcOA.js +292 -0
- package/dist/assets/gitGraph-TEB2WS4Q-VByWboBU.js +1 -0
- package/dist/assets/gitGraphDiagram-IHSO6WYX-DYUYxs1R.js +106 -0
- package/dist/assets/graphlib-CAISHZh4.js +1 -0
- package/dist/assets/icons-C7j5jdKo.js +1 -0
- package/dist/assets/index-Bxg5fT2p.css +3 -0
- package/dist/assets/index-DKmdePUP.js +63 -0
- package/dist/assets/info-DKCQHKI2-CZeDLZxx.js +1 -0
- package/dist/assets/infoDiagram-FWYZ7A6U-CnIL6tv4.js +2 -0
- package/dist/assets/init-Rr1s_RiX.js +1 -0
- package/dist/assets/ishikawaDiagram-FXEZZL3T-B7WXNycQ.js +70 -0
- package/dist/assets/journeyDiagram-5HDEW3XC-D4HvioyY.js +139 -0
- package/dist/assets/kanban-definition-HUTT4EX6-CDs763eS.js +89 -0
- package/dist/assets/line-ikKkQiFp.js +1 -0
- package/dist/assets/linear-GqPyxQkN.js +1 -0
- package/dist/assets/map-CJwjCvwr.js +1 -0
- package/dist/assets/mcp-servers-dialog-jHlDR9jP.js +5 -0
- package/dist/assets/mermaid-parser.core-CoE8cccr.js +4 -0
- package/dist/assets/mermaid-renderer-BmbSAmpG.js +2 -0
- package/dist/assets/mermaid.core-DlFSL90j.js +11 -0
- package/dist/assets/mindmap-definition-LN4V7U3C-DLdq0K9C.js +96 -0
- package/dist/assets/{monaco-CzxeAjEw.js → monaco-CdOyGlWD.js} +1 -1
- package/dist/assets/ordinal-CibZU3PM.js +1 -0
- package/dist/assets/{otel-DQf3c6v2.js → otel-BNGM50C-.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-decrrxyX.js +1 -0
- package/dist/assets/path-BAQ3hXlG.js +1 -0
- package/dist/assets/pegDiagram-2B236MQR-Cm1kPRC2.js +1 -0
- package/dist/assets/{pi-ai-DjJwSQBQ.js → pi-ai-Cr3rpCXT.js} +2 -2
- package/dist/assets/{pi-web-ui-DqxtBlZL.js → pi-web-ui-DoRGtREc.js} +371 -371
- package/dist/assets/pie-RZYD4A2V-J1CasQZl.js +1 -0
- package/dist/assets/pieDiagram-ENE6RG2P-Df05wjjo.js +39 -0
- package/dist/assets/quadrantDiagram-ABIIQ3AL-BjCwGxJC.js +7 -0
- package/dist/assets/radar-I7S5WNFK-B-sZytUA.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-BSaqNPm8.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-lzZR7PxT.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-DQtz1Fh9.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-CpMsuGY3.js +1 -0
- package/dist/assets/railroadDiagram-RFXS5EU6-CTUvpKkv.js +1 -0
- package/dist/assets/{react-vendor-BR9MG2D-.js → react-vendor-VqdnQHHS.js} +1 -1
- package/dist/assets/requirementDiagram-TGXJPOKE-BU1kvEku.js +84 -0
- package/dist/assets/rough.esm-Djo4Abte.js +1 -0
- package/dist/assets/sankeyDiagram-HTMAVEWB-BHmvxVqH.js +40 -0
- package/dist/assets/sequenceDiagram-DBY2YBRQ-CTpwICgg.js +162 -0
- package/dist/assets/sizeCapture-X5ZJPWSS-BbLhGaa4.js +1 -0
- package/dist/assets/{skills-dialog-B0jNVGZW.js → skills-dialog-DvSnPPzu.js} +1 -1
- package/dist/assets/src-B4Tvg3gT.js +1 -0
- package/dist/assets/stateDiagram-2N3HPSRC-BxuDwIgT.js +1 -0
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BGLshxcY.js +1 -0
- package/dist/assets/swimlanes-5IMT3BWC-EkZsiylV.js +2 -0
- package/dist/assets/swimlanesDiagram-G3AALYLV-CqdqxA-b.js +8 -0
- package/dist/assets/timeline-definition-FHXFAJF6-C9ewOCTa.js +120 -0
- package/dist/assets/treeView-QDETBFTQ-Byb71heW.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-CMV1SJsq.js +1 -0
- package/dist/assets/vennDiagram-L72KCM5P-CR49Y4Lp.js +34 -0
- package/dist/assets/wardley-OPB4EBWU-DtCHtr2V.js +1 -0
- package/dist/assets/wardleyDiagram-EHGQE667-Cn0GgwWi.js +78 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-DlmPNAvd.js +7 -0
- package/dist/index.html +8 -8
- package/package.json +2 -1
- package/server/agent-manager.mjs +174 -9
- package/server/agent-profile-files.mjs +86 -6
- package/server/agent-profile-schema.mjs +197 -0
- package/server/agent-profiles.mjs +172 -41
- package/server/auto-compaction.mjs +2 -2
- package/server/project-route-context.mjs +25 -0
- package/server/routes/agent-profiles.mjs +9 -3
- package/server/routes/backup.mjs +135 -48
- package/server/routes/project.mjs +6 -10
- package/server/routes/workspace.mjs +240 -11
- package/server/storage.mjs +34 -0
- package/server/subagents.mjs +64 -0
- package/server/tools/definitions.mjs +17 -1
- package/server/utils/platform.mjs +4 -4
- package/dist/assets/AgentProfilesPage-R7N7eDq5.js +0 -1
- package/dist/assets/ChatPanelHost-C4orgd5l.js +0 -242
- package/dist/assets/ScheduledTasksPage-BAqoK4xk.js +0 -2
- package/dist/assets/SharedConversationPage-C-1n_MmB.js +0 -1
- package/dist/assets/TerminalDock-B6KAXkIU.js +0 -2
- package/dist/assets/WorkspaceInspector-CkXyD_k4.js +0 -3
- package/dist/assets/WorkspaceReaderDialog-Dp2QAwBo.js +0 -1
- package/dist/assets/diff-line-counts-Dm5kKQOo.js +0 -10
- package/dist/assets/icons-DHoaB5uq.js +0 -1
- package/dist/assets/index-C77QCHE9.css +0 -3
- package/dist/assets/index-CZb_mGGF.js +0 -63
- package/dist/assets/mcp-servers-dialog-VbGvNekJ.js +0 -5
- package/dist/assets/useAppTheme-DsabFF9D.js +0 -1
- /package/dist/assets/{plugin-api-Ds5xGIL7.js → plugin-api-BbUkYm3Y.js} +0 -0
- /package/dist/assets/{xterm-aPHkK8RR.js → xterm-CGiQzDiR.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage-BtZpDV-3.js","assets/rolldown-runtime-DWdDZTNf.js","assets/index-DKmdePUP.js","assets/pi-ai-Cr3rpCXT.js","assets/pi-web-ui-DoRGtREc.js","assets/lit-vendor-Dr3cpBGF.js","assets/css-utils-rkE68RDy.js","assets/icons-C7j5jdKo.js","assets/react-vendor-VqdnQHHS.js","assets/skills-dialog-DvSnPPzu.js","assets/logger-B65Akg8A.js","assets/index-Bxg5fT2p.css","assets/mcp-servers-dialog-jHlDR9jP.js","assets/PluginsPage-CCIj8-Mn.js","assets/plugin-api-BbUkYm3Y.js","assets/ScheduledTasksPage-DIMewQ3i.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{Ft as t,H as n,It as r,Nt as i,Rt as a,S as o,Vt as s,_ as c,c as l,g as u,j as d,mt as f,p,pt as m,u as h,yt as g,zt as ee}from"./icons-C7j5jdKo.js";import{n as te,r as ne}from"./react-vendor-VqdnQHHS.js";import{p as _}from"./lit-vendor-Dr3cpBGF.js";import{m as v,x as y}from"./pi-web-ui-DoRGtREc.js";import{J as b}from"./pi-ai-Cr3rpCXT.js";import{t as x}from"./logger-B65Akg8A.js";import{$ as re,A as S,B as ie,C as ae,D as oe,E as se,F as ce,H as C,I as le,L as ue,M as de,O as fe,Q as pe,T as me,V as w,Z as T,at as E,ct as he,dt as ge,ft as _e,ht as D,it as ve,k as O,mt as ye,ot as be,pt as xe,rt as Se,tt as Ce,ut as we,w as Te,z as Ee}from"./index-DKmdePUP.js";var k=e(s(),1),De={openai:{name:`OpenAI`,baseUrl:`https://api.openai.com/v1`,protocol:`openai-completions`,modelId:`gpt-4o`,supportsImages:!0},deepseek:{name:`DeepSeek`,baseUrl:`https://api.deepseek.com/v1`,protocol:`openai-completions`,modelId:`deepseek-chat`},glm:{name:`Zhipu GLM`,baseUrl:`https://open.bigmodel.cn/api/paas/v4`,protocol:`openai-completions`,modelId:`glm-4-plus`},ollama:{name:`Ollama`,baseUrl:`http://localhost:11434/v1`,protocol:`openai-completions`,modelId:`llama3.1`},litellm:{name:T.name,baseUrl:T.baseUrl,protocol:`openai-completions`,modelId:T.modelId,supportsImages:T.supportsImages}},Oe=[{key:`openai`,label:D(`presetOpenai`)},{key:`deepseek`,label:D(`presetDeepseek`)},{key:`glm`,label:D(`presetGlm`)},{key:`ollama`,label:D(`presetOllama`)},{key:`litellm`,label:D(`presetLitellm`)},{key:`custom`,label:D(`presetCustom`)}],A=()=>({modelId:``,contextWindow:T.contextWindow,maxTokens:T.maxTokens,reasoning:!0,supportsImages:!1,open:!1}),j=()=>({name:T.name,baseUrl:T.baseUrl,apiKey:``,headerRows:[],protocol:`openai-completions`,models:[A()]}),ke=class extends v{providers=[];form=j();editingProviderId;formOpen=!1;loading=!0;apiKeyVisible=!1;advancedOpen=!1;activePreset=``;testing=!1;testResult=`idle`;testError=``;autoEditProviderName=null;async connectedCallback(){if(super.connectedCallback(),await this.loadProviders(),this.autoEditProviderName){let e=this.providers.find(e=>e.name===this.autoEditProviderName);e&&await this.openEditForm(e),this.autoEditProviderName=null}}getTabName(){return D(`customModels`)}async loadProviders(){this.loading=!0,this.requestUpdate();try{this.providers=await y().customProviders.getAll()}catch(e){x.error(`Failed to load custom providers:`,e),this.providers=[]}finally{this.loading=!1,this.requestUpdate()}}resetTestState(){this.testing=!1,this.testResult=`idle`,this.testError=``}openAddForm(){this.editingProviderId=void 0,this.form=j(),this.apiKeyVisible=!1,this.advancedOpen=!1,this.activePreset=``,this.resetTestState(),this.formOpen=!0,this.requestUpdate()}async openEditForm(e){let t=await y().providerKeys.get(e.name)??e.apiKey??``,n=e.models??[],r=n.length>0?n.map(e=>({modelId:e.id,contextWindow:e.contextWindow??T.contextWindow,maxTokens:e.maxTokens??T.maxTokens,reasoning:e.reasoning===!0,supportsImages:e.input?.includes(`image`)===!0,open:!1})):[A()],i=n[0]?.headers??{},a=Object.entries(i).map(([e,t])=>({key:e,value:String(t)}));this.editingProviderId=e.id,this.form={providerId:e.id,id:e.id,name:e.name,baseUrl:e.baseUrl,apiKey:t,headerRows:a,protocol:e.type===`anthropic-messages`?`anthropic-messages`:`openai-completions`,models:r},this.apiKeyVisible=!1,this.advancedOpen=a.length>0||e.type===`anthropic-messages`,this.activePreset=``,this.resetTestState(),this.formOpen=!0,this.requestUpdate()}closeForm(){this.formOpen=!1,this.editingProviderId=void 0,this.form=j(),this.apiKeyVisible=!1,this.advancedOpen=!1,this.activePreset=``,this.resetTestState(),this.requestUpdate()}toggleApiKeyVisibility(){this.apiKeyVisible=!this.apiKeyVisible,this.requestUpdate()}updateForm(e,t){this.form={...this.form,[e]:t},(e===`name`||e===`baseUrl`)&&(this.activePreset=``),this.resetTestState(),this.requestUpdate()}updateModelField(e,t,n){let r=this.form.models.map((r,i)=>i===e?{...r,[t]:n}:r);this.form={...this.form,models:r},t===`modelId`&&(this.activePreset=``,this.resetTestState()),this.requestUpdate()}addModelRow(){this.form={...this.form,models:[...this.form.models,A()]},this.requestUpdate()}removeModelRow(e){let t=this.form.models.filter((t,n)=>n!==e);this.form={...this.form,models:t},this.requestUpdate()}toggleModelExpanded(e){let t=this.form.models.map((t,n)=>n===e?{...t,open:!t.open}:t);this.form={...this.form,models:t},this.requestUpdate()}addHeaderRow(){this.form={...this.form,headerRows:[...this.form.headerRows,{key:``,value:``}]},this.requestUpdate()}updateHeaderRow(e,t,n){let r=this.form.headerRows.map((r,i)=>i===e?{...r,[t]:n}:r);this.form={...this.form,headerRows:r},this.requestUpdate()}removeHeaderRow(e){let t=this.form.headerRows.filter((t,n)=>n!==e);this.form={...this.form,headerRows:t},this.requestUpdate()}applyPreset(e){if(this.activePreset=e,e===`custom`)this.form={...this.form,name:``,baseUrl:``,protocol:`openai-completions`,models:[A()]};else{let t=De[e];this.form={...this.form,name:t.name,baseUrl:t.baseUrl,protocol:t.protocol,models:[{...A(),modelId:t.modelId,supportsImages:t.supportsImages===!0,open:!1}]}}this.resetTestState(),this.requestUpdate()}buildHeadersFromRows(){let e={};for(let t of this.form.headerRows){let n=t.key.trim(),r=t.value.trim();n&&r&&(e[n]=r)}return e}buildModel(e,t){let n=this.form.name.trim(),r=this.form.baseUrl.trim(),i=e.reasoning===!0,a=e.supportsImages===!0?[`text`,`image`]:[`text`],o=r.includes(`api.deepseek.com`);return Se({id:e.modelId,name:`${e.modelId} (${n})`,api:this.form.protocol,provider:n,baseUrl:r.replace(/\/$/,``),reasoning:i,input:a,cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:Number(e.contextWindow)||T.contextWindow,maxTokens:Number(e.maxTokens)||T.maxTokens,headers:Object.keys(t).length>0?t:void 0,thinkingLevelMap:o&&i?{low:`high`,medium:`high`,high:`high`,xhigh:`max`}:void 0,compat:this.form.protocol===`openai-completions`?{supportsStore:!1,supportsDeveloperRole:!1,supportsReasoningEffort:i,supportsUsageInStreaming:!1,supportsStrictMode:!1,maxTokensField:`max_tokens`,...o&&i?{requiresReasoningContentOnAssistantMessages:!0,thinkingFormat:`deepseek`}:{}}:void 0})}async testConnection(){let e=this.form.baseUrl.trim(),t=this.form.models.find(e=>e.modelId.trim());if(!e||!t){this.testing=!1,this.testResult=`fail`,this.testError=D(`testRequiresFields`),this.requestUpdate();return}let n=this.buildHeadersFromRows(),r=this.buildModel(t,n);this.testing=!0,this.testResult=`idle`,this.testError=``,this.requestUpdate();try{let e=await(await fetch(`/api/models/test-connection`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({model:r,apiKey:this.form.apiKey.trim()})})).json().catch(()=>({}));e?.ok?(this.testResult=`ok`,this.testError=``):(this.testResult=`fail`,this.testError=e?.error||D(`connectionFailed`))}catch(e){this.testResult=`fail`,this.testError=e?.message||D(`connectionFailed`)}finally{this.testing=!1,this.requestUpdate()}}async saveModel(){let e=this.form.name.trim(),t=this.form.baseUrl.trim();if(!e||!t){w(D(`fillProviderBaseUrlModel`));return}let n=this.form.models.filter(e=>e.modelId.trim());if(n.length===0){w(D(`atLeastOneModel`));return}let r=n.map(e=>e.modelId.trim());if(new Set(r).size!==r.length){w(D(`duplicateModelId`));return}let i=this.buildHeadersFromRows(),a=n.map(e=>this.buildModel(e,i)),o=this.form.apiKey.trim(),s=this.editingProviderId?this.providers.find(e=>e.id===this.editingProviderId):void 0,c={id:this.editingProviderId??be(),name:e,type:this.form.protocol,baseUrl:a[0].baseUrl,apiKey:o||void 0,models:a};try{let e=y();await e.customProviders.set(c),s&&s.name!==c.name&&await e.providerKeys.delete(s.name),o?await e.providerKeys.set(c.name,o):await e.providerKeys.delete(c.name),this.closeForm(),await this.loadProviders()}catch(e){x.error(`Failed to save custom model:`,e),w(D(`saveCustomModelFailed`))}}async deleteProvider(e){if(await C({description:D(`confirmDeleteProvider`,{name:e.name}),confirmLabel:D(`confirmDelete`),cancelLabel:D(`cancel`),variant:`destructive`}))try{let t=y();await t.customProviders.delete(e.id),await t.providerKeys.delete(e.name),await this.loadProviders()}catch(e){x.error(`Failed to delete custom provider:`,e),w(D(`deleteFailed`))}}renderProvider(e){let t=e.models??[],n=t.length,r=e.type===`anthropic-messages`?`Anthropic Messages`:`OpenAI Compatible`;return _`
|
|
3
3
|
<div class="quickforge-settings-list-item">
|
|
4
4
|
<div class="quickforge-settings-list-item-main">
|
|
5
5
|
<div class="flex min-w-0 items-start gap-3">
|
|
@@ -8,9 +8,9 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
8
8
|
<div class="quickforge-settings-row-title">${e.name}</div>
|
|
9
9
|
<div class="quickforge-settings-row-description break-all">${e.baseUrl}</div>
|
|
10
10
|
<div class="quickforge-settings-meta">
|
|
11
|
-
<span class="quickforge-settings-badge quickforge-settings-badge-muted">${
|
|
12
|
-
<span class="quickforge-settings-badge quickforge-settings-badge-info">${
|
|
13
|
-
${n===0?_`<span class="quickforge-settings-badge quickforge-settings-badge-warning">${
|
|
11
|
+
<span class="quickforge-settings-badge quickforge-settings-badge-muted">${D(`providerProtocol`)}: ${r}</span>
|
|
12
|
+
<span class="quickforge-settings-badge quickforge-settings-badge-info">${D(`modelsCount`,{count:n})}</span>
|
|
13
|
+
${n===0?_`<span class="quickforge-settings-badge quickforge-settings-badge-warning">${D(`noModelAdded`)}</span>`:null}
|
|
14
14
|
</div>
|
|
15
15
|
${n>0?_`
|
|
16
16
|
<div class="quickforge-settings-meta">
|
|
@@ -29,22 +29,22 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
29
29
|
type="button"
|
|
30
30
|
@click=${()=>this.openEditForm(e)}
|
|
31
31
|
>
|
|
32
|
-
${
|
|
32
|
+
${D(`editModel`)}
|
|
33
33
|
</button>
|
|
34
34
|
<button
|
|
35
35
|
class="quickforge-settings-button quickforge-settings-button-danger quickforge-settings-button-compact"
|
|
36
36
|
type="button"
|
|
37
37
|
@click=${()=>this.deleteProvider(e)}
|
|
38
38
|
>
|
|
39
|
-
${
|
|
39
|
+
${D(`delete`)}
|
|
40
40
|
</button>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
`}renderPresetChips(){return _`
|
|
44
44
|
<div class="quickforge-settings-form-row">
|
|
45
|
-
<span class="quickforge-settings-form-label">${
|
|
45
|
+
<span class="quickforge-settings-form-label">${D(`presets`)}</span>
|
|
46
46
|
<div class="quickforge-settings-segmented quickforge-settings-segmented-wrap">
|
|
47
|
-
${
|
|
47
|
+
${Oe.map(e=>_`
|
|
48
48
|
<button
|
|
49
49
|
class="quickforge-settings-segmented-option ${this.activePreset===e.key?`quickforge-settings-segmented-option-active`:``}"
|
|
50
50
|
type="button"
|
|
@@ -60,7 +60,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
60
60
|
<button
|
|
61
61
|
class="quickforge-settings-icon-action"
|
|
62
62
|
type="button"
|
|
63
|
-
title=${
|
|
63
|
+
title=${D(`expandModel`)}
|
|
64
64
|
aria-expanded=${n?`true`:`false`}
|
|
65
65
|
@click=${()=>this.toggleModelExpanded(t)}
|
|
66
66
|
>
|
|
@@ -71,12 +71,12 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
71
71
|
class="quickforge-settings-input quickforge-settings-mono"
|
|
72
72
|
.value=${e.modelId}
|
|
73
73
|
@input=${e=>this.updateModelField(t,`modelId`,e.target.value)}
|
|
74
|
-
placeholder=${
|
|
74
|
+
placeholder=${D(`modelIdPlaceholder`)}
|
|
75
75
|
/>
|
|
76
76
|
${n?_`
|
|
77
77
|
<div class="quickforge-settings-model-grid mt-3">
|
|
78
78
|
<label class="quickforge-settings-form-row">
|
|
79
|
-
<span class="quickforge-settings-form-label">${
|
|
79
|
+
<span class="quickforge-settings-form-label">${D(`contextWindow`)}</span>
|
|
80
80
|
<input
|
|
81
81
|
class="quickforge-settings-input"
|
|
82
82
|
.value=${String(e.contextWindow)}
|
|
@@ -85,7 +85,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
85
85
|
/>
|
|
86
86
|
</label>
|
|
87
87
|
<label class="quickforge-settings-form-row">
|
|
88
|
-
<span class="quickforge-settings-form-label">${
|
|
88
|
+
<span class="quickforge-settings-form-label">${D(`maxTokens`)}</span>
|
|
89
89
|
<input
|
|
90
90
|
class="quickforge-settings-input"
|
|
91
91
|
.value=${String(e.maxTokens)}
|
|
@@ -100,7 +100,18 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
100
100
|
.checked=${e.reasoning}
|
|
101
101
|
@change=${e=>this.updateModelField(t,`reasoning`,e.target.checked)}
|
|
102
102
|
/>
|
|
103
|
-
<span>${
|
|
103
|
+
<span>${D(`reasoningModel`)}</span>
|
|
104
|
+
</label>
|
|
105
|
+
<label class="mt-2 flex items-center gap-2 text-sm text-muted-foreground">
|
|
106
|
+
<input
|
|
107
|
+
type="checkbox"
|
|
108
|
+
.checked=${e.supportsImages}
|
|
109
|
+
@change=${e=>this.updateModelField(t,`supportsImages`,e.target.checked)}
|
|
110
|
+
/>
|
|
111
|
+
<span>
|
|
112
|
+
${D(`imageInputModel`)}
|
|
113
|
+
<quickforge-info-tip .label=${D(`imageInputModelHelp`)}></quickforge-info-tip>
|
|
114
|
+
</span>
|
|
104
115
|
</label>
|
|
105
116
|
`:null}
|
|
106
117
|
</div>
|
|
@@ -108,7 +119,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
108
119
|
<button
|
|
109
120
|
class="quickforge-settings-icon-action quickforge-settings-icon-action-danger"
|
|
110
121
|
type="button"
|
|
111
|
-
title=${
|
|
122
|
+
title=${D(`delete`)}
|
|
112
123
|
@click=${()=>this.removeModelRow(t)}
|
|
113
124
|
>
|
|
114
125
|
✕
|
|
@@ -118,8 +129,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
118
129
|
`}renderHeadersEditor(){return _`
|
|
119
130
|
<div class="quickforge-settings-form-row">
|
|
120
131
|
<span class="quickforge-settings-form-label">
|
|
121
|
-
${
|
|
122
|
-
<quickforge-info-tip .label=${
|
|
132
|
+
${D(`customHeaders`)}
|
|
133
|
+
<quickforge-info-tip .label=${D(`customHeadersHelp`)}></quickforge-info-tip>
|
|
123
134
|
</span>
|
|
124
135
|
${this.form.headerRows.length===0?_``:_`
|
|
125
136
|
<div class="quickforge-settings-nested-list">
|
|
@@ -129,18 +140,18 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
129
140
|
class="quickforge-settings-input"
|
|
130
141
|
.value=${e.key}
|
|
131
142
|
@input=${e=>this.updateHeaderRow(t,`key`,e.target.value)}
|
|
132
|
-
placeholder=${
|
|
143
|
+
placeholder=${D(`headerName`)}
|
|
133
144
|
/>
|
|
134
145
|
<input
|
|
135
146
|
class="quickforge-settings-input"
|
|
136
147
|
.value=${e.value}
|
|
137
148
|
@input=${e=>this.updateHeaderRow(t,`value`,e.target.value)}
|
|
138
|
-
placeholder=${
|
|
149
|
+
placeholder=${D(`headerValue`)}
|
|
139
150
|
/>
|
|
140
151
|
<button
|
|
141
152
|
class="quickforge-settings-icon-action quickforge-settings-icon-action-danger"
|
|
142
153
|
type="button"
|
|
143
|
-
title=${
|
|
154
|
+
title=${D(`removeHeader`)}
|
|
144
155
|
@click=${()=>this.removeHeaderRow(t)}
|
|
145
156
|
>
|
|
146
157
|
✕
|
|
@@ -154,11 +165,11 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
154
165
|
type="button"
|
|
155
166
|
@click=${()=>this.addHeaderRow()}
|
|
156
167
|
>
|
|
157
|
-
+ ${
|
|
168
|
+
+ ${D(`addHeader`)}
|
|
158
169
|
</button>
|
|
159
170
|
</div>
|
|
160
|
-
`}renderTestStatus(){return this.testResult===`idle`&&!this.testing?_``:this.testing?_`<span class="quickforge-settings-status">${
|
|
161
|
-
<section class="quickforge-settings-section" aria-label=${this.editingProviderId?
|
|
171
|
+
`}renderTestStatus(){return this.testResult===`idle`&&!this.testing?_``:this.testing?_`<span class="quickforge-settings-status">${D(`testingConnection`)}</span>`:this.testResult===`ok`?_`<span class="quickforge-settings-badge quickforge-settings-badge-success">✓ ${D(`connectionOk`)}</span>`:_`<span class="quickforge-settings-alert">✗ ${this.testError||D(`connectionFailed`)}</span>`}renderForm(){return _`
|
|
172
|
+
<section class="quickforge-settings-section" aria-label=${this.editingProviderId?D(`editCustomModel`):D(`addCustomModel`)}>
|
|
162
173
|
<div class="quickforge-settings-toolbar">
|
|
163
174
|
<button
|
|
164
175
|
class="quickforge-settings-button quickforge-settings-button-secondary"
|
|
@@ -166,11 +177,11 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
166
177
|
@click=${()=>this.closeForm()}
|
|
167
178
|
>
|
|
168
179
|
<svg class="size-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m12 19-7-7 7-7"/><path d="M19 12H5"/></svg>
|
|
169
|
-
${
|
|
180
|
+
${D(`back`)}
|
|
170
181
|
</button>
|
|
171
182
|
<div class="quickforge-settings-row-main">
|
|
172
|
-
<div class="quickforge-settings-row-title">${this.editingProviderId?
|
|
173
|
-
<div class="quickforge-settings-row-description">${
|
|
183
|
+
<div class="quickforge-settings-row-title">${this.editingProviderId?D(`editCustomModel`):D(`addCustomModel`)}</div>
|
|
184
|
+
<div class="quickforge-settings-row-description">${D(`customModelsDescription`)}</div>
|
|
174
185
|
</div>
|
|
175
186
|
</div>
|
|
176
187
|
|
|
@@ -178,12 +189,12 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
178
189
|
${this.renderPresetChips()}
|
|
179
190
|
|
|
180
191
|
<label class="quickforge-settings-form-row">
|
|
181
|
-
<span class="quickforge-settings-form-label">${
|
|
192
|
+
<span class="quickforge-settings-form-label">${D(`providerName`)}</span>
|
|
182
193
|
<input
|
|
183
194
|
class="quickforge-settings-input"
|
|
184
195
|
.value=${this.form.name}
|
|
185
196
|
@input=${e=>this.updateForm(`name`,e.target.value)}
|
|
186
|
-
placeholder=${
|
|
197
|
+
placeholder=${D(`providerNamePlaceholder`)}
|
|
187
198
|
/>
|
|
188
199
|
</label>
|
|
189
200
|
|
|
@@ -198,20 +209,20 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
198
209
|
</label>
|
|
199
210
|
|
|
200
211
|
<label class="quickforge-settings-form-row">
|
|
201
|
-
<span class="quickforge-settings-form-label">${
|
|
212
|
+
<span class="quickforge-settings-form-label">${D(`apiKey`)}</span>
|
|
202
213
|
<div class="quickforge-settings-inline-field">
|
|
203
214
|
<input
|
|
204
215
|
class="quickforge-settings-input pr-10"
|
|
205
216
|
.value=${this.form.apiKey}
|
|
206
217
|
type=${this.apiKeyVisible?`text`:`password`}
|
|
207
218
|
@input=${e=>this.updateForm(`apiKey`,e.target.value)}
|
|
208
|
-
placeholder=${
|
|
219
|
+
placeholder=${D(`apiKeyPlaceholder`)}
|
|
209
220
|
/>
|
|
210
221
|
<button
|
|
211
222
|
class="quickforge-settings-inline-field-button"
|
|
212
223
|
type="button"
|
|
213
|
-
title=${this.apiKeyVisible?
|
|
214
|
-
aria-label=${this.apiKeyVisible?
|
|
224
|
+
title=${this.apiKeyVisible?D(`hideApiKey`):D(`showApiKey`)}
|
|
225
|
+
aria-label=${this.apiKeyVisible?D(`hideApiKey`):D(`showApiKey`)}
|
|
215
226
|
aria-pressed=${this.apiKeyVisible?`true`:`false`}
|
|
216
227
|
@click=${()=>this.toggleApiKeyVisibility()}
|
|
217
228
|
>
|
|
@@ -222,13 +233,13 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
222
233
|
|
|
223
234
|
<div class="quickforge-settings-form-row">
|
|
224
235
|
<div class="flex items-center justify-between gap-3">
|
|
225
|
-
<span class="quickforge-settings-form-label">${
|
|
236
|
+
<span class="quickforge-settings-form-label">${D(`modelsList`)}</span>
|
|
226
237
|
<button
|
|
227
238
|
class="quickforge-settings-button quickforge-settings-button-secondary quickforge-settings-button-compact"
|
|
228
239
|
type="button"
|
|
229
240
|
@click=${()=>this.addModelRow()}
|
|
230
241
|
>
|
|
231
|
-
+ ${
|
|
242
|
+
+ ${D(`addModel`)}
|
|
232
243
|
</button>
|
|
233
244
|
</div>
|
|
234
245
|
<div class="quickforge-settings-nested-list">
|
|
@@ -243,15 +254,15 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
243
254
|
@click=${()=>{this.advancedOpen=!this.advancedOpen,this.requestUpdate()}}
|
|
244
255
|
>
|
|
245
256
|
<span>${this.advancedOpen?`▾`:`▸`}</span>
|
|
246
|
-
${
|
|
257
|
+
${D(`providerAdvanced`)}
|
|
247
258
|
</button>
|
|
248
259
|
|
|
249
260
|
${this.advancedOpen?_`
|
|
250
261
|
<div class="quickforge-settings-form-grid rounded-lg border border-border p-3">
|
|
251
262
|
<label class="quickforge-settings-form-row">
|
|
252
263
|
<span class="quickforge-settings-form-label">
|
|
253
|
-
${
|
|
254
|
-
<quickforge-info-tip .label=${
|
|
264
|
+
${D(`protocolType`)}
|
|
265
|
+
<quickforge-info-tip .label=${D(`protocolHelp`)}></quickforge-info-tip>
|
|
255
266
|
</span>
|
|
256
267
|
<select
|
|
257
268
|
class="quickforge-settings-select"
|
|
@@ -277,7 +288,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
277
288
|
type="button"
|
|
278
289
|
@click=${()=>this.closeForm()}
|
|
279
290
|
>
|
|
280
|
-
${
|
|
291
|
+
${D(`cancel`)}
|
|
281
292
|
</button>
|
|
282
293
|
<button
|
|
283
294
|
class="quickforge-settings-button quickforge-settings-button-secondary"
|
|
@@ -285,14 +296,14 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
285
296
|
?disabled=${this.testing}
|
|
286
297
|
@click=${()=>this.testConnection()}
|
|
287
298
|
>
|
|
288
|
-
${this.testing?
|
|
299
|
+
${this.testing?D(`testingConnection`):D(`testConnection`)}
|
|
289
300
|
</button>
|
|
290
301
|
<button
|
|
291
302
|
class="quickforge-settings-button quickforge-settings-button-primary"
|
|
292
303
|
type="button"
|
|
293
304
|
@click=${()=>this.saveModel()}
|
|
294
305
|
>
|
|
295
|
-
${
|
|
306
|
+
${D(`save`)}
|
|
296
307
|
</button>
|
|
297
308
|
</div>
|
|
298
309
|
</div>
|
|
@@ -301,33 +312,33 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
301
312
|
<div class="quickforge-settings-stack">
|
|
302
313
|
<div class="quickforge-settings-heading">
|
|
303
314
|
<h3 class="quickforge-settings-title">
|
|
304
|
-
${this.editingProviderId?
|
|
305
|
-
<quickforge-info-tip .label=${
|
|
315
|
+
${this.editingProviderId?D(`editCustomModel`):D(`addCustomModel`)}
|
|
316
|
+
<quickforge-info-tip .label=${D(`customModelsDescription`)}></quickforge-info-tip>
|
|
306
317
|
</h3>
|
|
307
318
|
</div>
|
|
308
319
|
${this.renderForm()}
|
|
309
320
|
</div>
|
|
310
321
|
`:_`
|
|
311
322
|
<div class="quickforge-settings-stack">
|
|
312
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
323
|
+
<section class="quickforge-settings-section" aria-label=${D(`customModelsTitle`)}>
|
|
313
324
|
<div class="quickforge-settings-toolbar">
|
|
314
325
|
<div>
|
|
315
|
-
<div class="quickforge-settings-row-title">${
|
|
316
|
-
<div class="quickforge-settings-row-description">${
|
|
326
|
+
<div class="quickforge-settings-row-title">${D(`customModelsTitle`)}</div>
|
|
327
|
+
<div class="quickforge-settings-row-description">${D(`customModelsDescription`)}</div>
|
|
317
328
|
</div>
|
|
318
329
|
<button
|
|
319
330
|
class="quickforge-settings-button quickforge-settings-button-primary"
|
|
320
331
|
type="button"
|
|
321
332
|
@click=${()=>this.openAddForm()}
|
|
322
333
|
>
|
|
323
|
-
${
|
|
334
|
+
${D(`addModel`)}
|
|
324
335
|
</button>
|
|
325
336
|
</div>
|
|
326
337
|
|
|
327
|
-
${this.loading?_`<div class="quickforge-settings-empty-row">${
|
|
338
|
+
${this.loading?_`<div class="quickforge-settings-empty-row">${D(`loading`)}</div>`:this.providers.length===0?_`<div class="quickforge-settings-empty-row">${D(`noCustomModels`)}</div>`:this.providers.map(e=>this.renderProvider(e))}
|
|
328
339
|
</section>
|
|
329
340
|
</div>
|
|
330
|
-
`}},
|
|
341
|
+
`}},M=`quickforge-custom-providers-only-tab`;customElements.get(M)||customElements.define(M,ke);function Ae(e){let t=document.createElement(M);return e&&(t.autoEditProviderName=e),t}var je=[{value:`light`,label:()=>D(`lightTheme`)},{value:`dark`,label:()=>D(`darkTheme`)}],Me=class extends v{theme=se();interfaceFontSizePx=O.interfaceFontSizePx;messageFontSizePx=O.messageFontSizePx;loading=!0;error=``;getTabName(){return D(`appearance`)}async connectedCallback(){super.connectedCallback(),await this.loadSettings()}async loadSettings(){this.loading=!0,this.error=``,this.requestUpdate();try{let e=y(),[t,n]=await Promise.all([oe(e),ce(e)]);this.theme=t.theme,this.interfaceFontSizePx=n.interfaceFontSizePx,this.messageFontSizePx=n.messageFontSizePx}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}async selectTheme(e){if(this.theme!==e){this.theme=e,this.requestUpdate();try{await fe(y(),{theme:e}),this.error=``,this.requestUpdate()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}}currentFontSizeSettings(){return le({interfaceFontSizePx:this.interfaceFontSizePx,messageFontSizePx:this.messageFontSizePx})}previewFontSize(e){let t=le(e);this.interfaceFontSizePx=t.interfaceFontSizePx,this.messageFontSizePx=t.messageFontSizePx,de(t),this.requestUpdate()}updateInterfaceFontSize(e){this.previewFontSize({...this.currentFontSizeSettings(),interfaceFontSizePx:Number(e)||O.interfaceFontSizePx})}updateMessageFontSize(e){this.previewFontSize({...this.currentFontSizeSettings(),messageFontSizePx:Number(e)||O.messageFontSizePx})}async saveFontSize(){try{await ue(y(),this.currentFontSizeSettings()),this.error=``,this.requestUpdate()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}renderThemeOption(e){let t=this.theme===e.value;return _`
|
|
331
342
|
<button
|
|
332
343
|
type="button"
|
|
333
344
|
class="quickforge-settings-segmented-option ${t?`quickforge-settings-segmented-option-active`:``}"
|
|
@@ -343,7 +354,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
343
354
|
${e}
|
|
344
355
|
${t?_`<quickforge-info-tip .label=${t}></quickforge-info-tip>`:null}
|
|
345
356
|
</div>
|
|
346
|
-
<div class="quickforge-settings-row-description">${
|
|
357
|
+
<div class="quickforge-settings-row-description">${D(`fontSizeRangeDescription`)}</div>
|
|
347
358
|
</div>
|
|
348
359
|
<div class="quickforge-settings-row-control quickforge-settings-slider-control">
|
|
349
360
|
<span class="quickforge-settings-value-badge">${n}px</span>
|
|
@@ -360,44 +371,44 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
360
371
|
/>
|
|
361
372
|
</div>
|
|
362
373
|
</div>
|
|
363
|
-
`}render(){return this.loading?_`<div class="text-sm text-muted-foreground">${
|
|
374
|
+
`}render(){return this.loading?_`<div class="text-sm text-muted-foreground">${D(`loading`)}</div>`:_`
|
|
364
375
|
<div class="quickforge-settings-stack">
|
|
365
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
376
|
+
<section class="quickforge-settings-section" aria-label=${D(`appearance`)}>
|
|
366
377
|
<div class="quickforge-settings-row">
|
|
367
378
|
<div class="quickforge-settings-row-main">
|
|
368
379
|
<div class="quickforge-settings-row-title">
|
|
369
|
-
${
|
|
370
|
-
<quickforge-info-tip .label=${
|
|
380
|
+
${D(`theme`)}
|
|
381
|
+
<quickforge-info-tip .label=${D(`themeDescription`)}></quickforge-info-tip>
|
|
371
382
|
</div>
|
|
372
|
-
<div class="quickforge-settings-row-description">${
|
|
383
|
+
<div class="quickforge-settings-row-description">${D(`themeDescription`)}</div>
|
|
373
384
|
</div>
|
|
374
385
|
<div class="quickforge-settings-row-control">
|
|
375
|
-
<div class="quickforge-settings-segmented" role="group" aria-label=${
|
|
376
|
-
${
|
|
386
|
+
<div class="quickforge-settings-segmented" role="group" aria-label=${D(`theme`)}>
|
|
387
|
+
${je.map(e=>this.renderThemeOption(e))}
|
|
377
388
|
</div>
|
|
378
389
|
</div>
|
|
379
390
|
</div>
|
|
380
391
|
|
|
381
|
-
${this.renderFontSizeSlider(
|
|
392
|
+
${this.renderFontSizeSlider(D(`interfaceFontSize`),null,this.interfaceFontSizePx,e=>this.updateInterfaceFontSize(e))}
|
|
382
393
|
|
|
383
|
-
${this.renderFontSizeSlider(
|
|
394
|
+
${this.renderFontSizeSlider(D(`messageFontSize`),D(`messageFontSizeNote`),this.messageFontSizePx,e=>this.updateMessageFontSize(e))}
|
|
384
395
|
</section>
|
|
385
396
|
|
|
386
397
|
${this.error?_`<span class="quickforge-settings-error">${this.error}</span>`:null}
|
|
387
398
|
</div>
|
|
388
|
-
`}},
|
|
399
|
+
`}},N=`quickforge-appearance-settings-tab`;customElements.get(N)||customElements.define(N,Me);function Ne(){return document.createElement(N)}var Pe=`auto-compact-settings`,P={enabled:!0,thresholdPercent:80,keepRecentTurns:3,minSourceChars:1600,requireConfirmation:!0};function F(e,t,n,r){let i=Number(e);return Number.isFinite(i)?Math.min(r,Math.max(n,Math.round(i))):t}function Fe(e){if(!e||typeof e!=`object`)return{...P};let t=e;return{enabled:t.enabled!==!1,thresholdPercent:F(t.thresholdPercent,P.thresholdPercent,50,95),keepRecentTurns:F(t.keepRecentTurns,P.keepRecentTurns,1,20),minSourceChars:F(t.minSourceChars,P.minSourceChars,0,2e5),requireConfirmation:t.requireConfirmation!==!1}}async function Ie(e){return Fe(await e.settings.get(Pe))}async function Le(e,t){await e.settings.set(Pe,Fe(t))}var Re=[{value:`off`,label:()=>D(`thinkingOff`)},{value:`low`,label:()=>D(`thinkingLow`)},{value:`medium`,label:()=>D(`thinkingMedium`)},{value:`high`,label:()=>D(`thinkingHigh`)},{value:`xhigh`,label:()=>D(`thinkingXHigh`)}];function ze(e){return(e??``).trim().replace(/\/$/,``)}function I(e){return JSON.stringify([e.provider,e.id,e.api,ze(e.baseUrl)])}function Be(e){return`${e.provider} / ${e.id}`}function Ve(){return`custom_${globalThis.crypto?.randomUUID?.().slice(0,8)||Date.now().toString(36)}`}function He(e){let t=e.trim(),n=t.split(/[\\/]/).pop()?.replace(/^"|"$/g,``)||t;return/^bash(\.exe)?$/i.test(n)?`Bash`:/^zsh$/i.test(n)?`Zsh`:/^fish$/i.test(n)?`Fish`:/^cmd(\.exe)?$/i.test(n)?`Command Prompt`:/^powershell(\.exe)?$/i.test(n)?`Windows PowerShell`:/^pwsh(\.exe)?$/i.test(n)?`PowerShell 7+`:n||`Custom Shell`}var Ue=_`
|
|
389
400
|
<svg class="size-3.5" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
390
401
|
<path d="M3.5 8.2 6.6 11.3 12.7 4.7" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" />
|
|
391
402
|
</svg>
|
|
392
|
-
`,
|
|
403
|
+
`,We=_`
|
|
393
404
|
<svg class="size-3.5" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
394
405
|
<circle cx="8" cy="8" r="4.8" stroke="currentColor" stroke-width="1.5" />
|
|
395
406
|
</svg>
|
|
396
|
-
`,
|
|
407
|
+
`,Ge=_`
|
|
397
408
|
<svg class="size-3.5" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
398
409
|
<path d="M4.5 4.5 11.5 11.5M11.5 4.5 4.5 11.5" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" />
|
|
399
410
|
</svg>
|
|
400
|
-
`,
|
|
411
|
+
`,Ke=class extends v{models=[];selectedModel;thinkingLevel=`off`;showToolDetails=!1;expandToolsByDefault=!1;autoCompactEnabled=!0;autoCompactRequireConfirmation=!0;autoCompactThresholdPercent=80;autoCompactThresholdPercentInput=`80`;autoCompactKeepRecentTurns=3;selectedLanguage=xe();loading=!0;saved=!1;savedMessage=``;error=``;terminalShellConfig={terminalShell:`auto`,defaultProfileId:`auto`,profiles:[]};customShellCommand=``;getTabName(){return D(`defaultOptions`)}async connectedCallback(){super.connectedCallback(),await this.loadSettings()}updated(){this.syncSelectValues()}syncSelectValues(){let e=this.querySelector(`[data-default-model-select]`);e&&this.selectedModel&&(e.value=I(this.selectedModel));let t=this.querySelector(`[data-default-thinking-select]`);t&&(t.value=this.thinkingLevel);let n=this.querySelector(`[data-language-select]`);n&&(n.value=this.selectedLanguage)}async loadSettings(){this.loading=!0,this.error=``,this.requestUpdate();try{let e=y(),[t,n,r,i]=await Promise.all([re(e),Ce(e),Ee(e),Ie(e)]);this.models=t,this.selectedModel=n.model?t.find(e=>I(e)===I(n.model))??n.model:t[0],this.thinkingLevel=n.thinkingLevel??pe(this.selectedModel),this.showToolDetails=r.showToolDetails,this.expandToolsByDefault=r.expandToolsByDefault,this.autoCompactEnabled=i.enabled,this.autoCompactRequireConfirmation=i.requireConfirmation,this.autoCompactThresholdPercent=i.thresholdPercent,this.autoCompactThresholdPercentInput=String(i.thresholdPercent),this.autoCompactKeepRecentTurns=i.keepRecentTurns,await this.loadTerminalShell()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}updateModel(e){let t=this.models.find(t=>I(t)===e);this.selectedModel=t,this.thinkingLevel=pe(t),this.saved=!1,this.requestUpdate(),this.saveDefaultModelOptions()}updateThinkingLevel(e){this.thinkingLevel=Re.some(t=>t.value===e)?e:`off`,this.saved=!1,this.requestUpdate(),this.saveDefaultModelOptions()}updateLanguage(e){this.selectedLanguage=e===`zh`?`zh`:`en`,this.requestUpdate(),this.applyLanguage()}async applyLanguage(){await _e(y(),this.selectedLanguage)}updateShowToolDetails(e){this.showToolDetails=e,this.saved=!1,this.requestUpdate(),this.saveToolDisplayOptions()}updateExpandToolsByDefault(e){this.expandToolsByDefault=e,this.saved=!1,this.requestUpdate(),this.saveToolDisplayOptions()}updateAutoCompactEnabled(e){this.autoCompactEnabled=e,this.saved=!1,this.requestUpdate(),this.saveAutoCompactOptions()}updateAutoCompactRequireConfirmation(e){this.autoCompactRequireConfirmation=e,this.saved=!1,this.requestUpdate(),this.saveAutoCompactOptions()}updateAutoCompactThresholdPercent(e){this.autoCompactThresholdPercentInput=e;let t=Number(e);e!==``&&Number.isFinite(t)&&(this.autoCompactThresholdPercent=t),this.saved=!1,this.requestUpdate()}updateAutoCompactKeepRecentTurns(e){this.autoCompactKeepRecentTurns=Number(e)||3,this.saved=!1,this.requestUpdate()}commitAutoCompactThresholdPercent(){let e=Number(this.autoCompactThresholdPercentInput);if(!Number.isFinite(e)){this.autoCompactThresholdPercentInput=String(this.autoCompactThresholdPercent),this.requestUpdate();return}let t=Math.max(50,Math.min(95,Math.round(e)));this.autoCompactThresholdPercent=t,this.autoCompactThresholdPercentInput=String(t),this.requestUpdate(),this.saveAutoCompactOptions()}commitAutoCompactKeepRecentTurns(){let e=Math.max(1,Math.min(20,Math.round(this.autoCompactKeepRecentTurns||3)));this.autoCompactKeepRecentTurns=e,this.requestUpdate(),this.saveAutoCompactOptions()}markSaved(e=D(`defaultOptionsSaved`)){this.saved=!0,this.savedMessage=e,this.error=``,this.requestUpdate()}customShellProfiles(){return this.terminalShellConfig.profiles.filter(e=>!e.builtin)}async loadTerminalShell(){try{let e=await fetch(`/api/system/terminal-shell`,{cache:`no-store`}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||D(`requestFailed`));this.terminalShellConfig={terminalShell:t?.terminalShell||`auto`,defaultProfileId:t?.defaultProfileId||`auto`,profiles:Array.isArray(t?.profiles)?t.profiles:[]}}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}}async saveTerminalShellConfig(e,t=this.customShellProfiles(),n=D(`terminalShellSaved`)){try{let r=await fetch(`/api/system/terminal-shell`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({defaultProfileId:e,profiles:t})}),i=await r.json().catch(()=>null);if(!r.ok)throw Error(i?.error||D(`requestFailed`));this.terminalShellConfig=i,this.markSaved(n)}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}async addCustomTerminalShell(){let e=this.customShellCommand.trim();if(!e){this.error=D(`terminalShellProfileRequired`),this.requestUpdate();return}let t=[...this.customShellProfiles(),{id:Ve(),name:He(e),command:e,builtin:!1}];this.customShellCommand=``,await this.saveTerminalShellConfig(this.terminalShellConfig.defaultProfileId,t,D(`terminalShellProfilesSaved`))}async deleteCustomTerminalShell(e){let t=this.terminalShellConfig.profiles.find(t=>t.id===e);if(!t||t.builtin||!await C({description:D(`terminalShellDeleteConfirm`,{name:t.name}),confirmLabel:D(`confirmDelete`),cancelLabel:D(`cancel`),variant:`destructive`}))return;let n=this.customShellProfiles().filter(t=>t.id!==e),r=this.terminalShellConfig.defaultProfileId===e?`auto`:this.terminalShellConfig.defaultProfileId;await this.saveTerminalShellConfig(r,n,D(`terminalShellProfilesSaved`))}async saveDefaultModelOptions(){try{let e=this.selectedModel?.reasoning?this.thinkingLevel:`off`;await ve(y(),{model:this.selectedModel,thinkingLevel:e}),this.markSaved()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}async saveToolDisplayOptions(){try{await ie(y(),{showToolDetails:this.showToolDetails,expandToolsByDefault:this.expandToolsByDefault}),this.markSaved()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}async saveAutoCompactOptions(){try{await Le(y(),{enabled:this.autoCompactEnabled,thresholdPercent:this.autoCompactThresholdPercent,keepRecentTurns:this.autoCompactKeepRecentTurns,minSourceChars:1600,requireConfirmation:this.autoCompactRequireConfirmation}),this.markSaved()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}modelOptions(){if(!this.selectedModel)return this.models;let e=I(this.selectedModel);return this.models.some(t=>I(t)===e)?this.models:[this.selectedModel,...this.models]}shellProfileRow(e,t=!1){let n=e.id===this.terminalShellConfig.defaultProfileId||this.terminalShellConfig.defaultProfileId===`auto`&&t;return _`
|
|
401
412
|
<div class="quickforge-settings-subrow">
|
|
402
413
|
<div class="quickforge-settings-row-main">
|
|
403
414
|
<div class="quickforge-settings-row-title">${e.name}</div>
|
|
@@ -405,70 +416,70 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
405
416
|
</div>
|
|
406
417
|
<div class="quickforge-settings-row-control quickforge-settings-icon-actions">
|
|
407
418
|
${n?_`
|
|
408
|
-
<span class="quickforge-settings-icon-action quickforge-settings-icon-action-success" title=${
|
|
409
|
-
${
|
|
419
|
+
<span class="quickforge-settings-icon-action quickforge-settings-icon-action-success" title=${D(`terminalShellDefaultBadge`)} aria-label=${D(`terminalShellDefaultBadge`)}>
|
|
420
|
+
${Ue}
|
|
410
421
|
</span>
|
|
411
422
|
`:_`
|
|
412
423
|
<button
|
|
413
424
|
class="quickforge-settings-icon-action"
|
|
414
425
|
type="button"
|
|
415
|
-
title=${
|
|
416
|
-
aria-label=${
|
|
426
|
+
title=${D(`terminalShellSetDefault`)}
|
|
427
|
+
aria-label=${D(`terminalShellSetDefault`)}
|
|
417
428
|
@click=${()=>this.saveTerminalShellConfig(e.id)}
|
|
418
429
|
>
|
|
419
|
-
${
|
|
430
|
+
${We}
|
|
420
431
|
</button>
|
|
421
432
|
`}
|
|
422
433
|
${e.builtin?null:_`
|
|
423
434
|
<button
|
|
424
435
|
class="quickforge-settings-icon-action quickforge-settings-icon-action-danger"
|
|
425
436
|
type="button"
|
|
426
|
-
title=${
|
|
427
|
-
aria-label=${
|
|
437
|
+
title=${D(`delete`)}
|
|
438
|
+
aria-label=${D(`delete`)}
|
|
428
439
|
@click=${()=>this.deleteCustomTerminalShell(e.id)}
|
|
429
440
|
>
|
|
430
|
-
${
|
|
441
|
+
${Ge}
|
|
431
442
|
</button>
|
|
432
443
|
`}
|
|
433
444
|
</div>
|
|
434
445
|
</div>
|
|
435
446
|
`}terminalShellSettings(){let e=this.terminalShellConfig.profiles;return _`
|
|
436
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
447
|
+
<section class="quickforge-settings-section" aria-label=${D(`terminalShell`)}>
|
|
437
448
|
<div class="quickforge-settings-row quickforge-settings-row-top">
|
|
438
449
|
<div class="quickforge-settings-row-main">
|
|
439
450
|
<div class="quickforge-settings-row-title">
|
|
440
|
-
${
|
|
441
|
-
<quickforge-info-tip .label=${
|
|
451
|
+
${D(`terminalShell`)}
|
|
452
|
+
<quickforge-info-tip .label=${D(`terminalShellDescription`)}></quickforge-info-tip>
|
|
442
453
|
</div>
|
|
443
|
-
<div class="quickforge-settings-row-description">${
|
|
454
|
+
<div class="quickforge-settings-row-description">${D(`terminalShellAutoDetectedHint`)}</div>
|
|
444
455
|
</div>
|
|
445
456
|
</div>
|
|
446
457
|
|
|
447
458
|
<div class="quickforge-settings-nested-list">
|
|
448
|
-
${e.length>0?e.map((e,t)=>this.shellProfileRow(e,t===0)):_`<div class="quickforge-settings-empty-row">${
|
|
459
|
+
${e.length>0?e.map((e,t)=>this.shellProfileRow(e,t===0)):_`<div class="quickforge-settings-empty-row">${D(`terminalShellNoDetected`)}</div>`}
|
|
449
460
|
</div>
|
|
450
461
|
|
|
451
462
|
<div class="quickforge-settings-row">
|
|
452
463
|
<div class="quickforge-settings-row-main">
|
|
453
|
-
<div class="quickforge-settings-row-title">${
|
|
454
|
-
<div class="quickforge-settings-row-description">${
|
|
464
|
+
<div class="quickforge-settings-row-title">${D(`terminalShellCommand`)}</div>
|
|
465
|
+
<div class="quickforge-settings-row-description">${D(`terminalShellCustomDescription`)}</div>
|
|
455
466
|
</div>
|
|
456
467
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-terminal-shell-command-control">
|
|
457
468
|
<input
|
|
458
469
|
class="quickforge-settings-input quickforge-settings-mono"
|
|
459
470
|
type="text"
|
|
460
471
|
.value=${this.customShellCommand}
|
|
461
|
-
placeholder=${
|
|
472
|
+
placeholder=${D(`terminalShellCommandPlaceholder`)}
|
|
462
473
|
@input=${e=>{this.customShellCommand=e.target.value}}
|
|
463
474
|
/>
|
|
464
475
|
<button
|
|
465
476
|
class="quickforge-settings-button quickforge-settings-button-primary"
|
|
466
477
|
type="button"
|
|
467
|
-
title=${
|
|
468
|
-
aria-label=${
|
|
478
|
+
title=${D(`terminalShellAdd`)}
|
|
479
|
+
aria-label=${D(`terminalShellAdd`)}
|
|
469
480
|
@click=${()=>this.addCustomTerminalShell()}
|
|
470
481
|
>
|
|
471
|
-
${
|
|
482
|
+
${D(`terminalShellAdd`)}
|
|
472
483
|
</button>
|
|
473
484
|
</div>
|
|
474
485
|
</div>
|
|
@@ -483,16 +494,16 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
483
494
|
/>
|
|
484
495
|
<span aria-hidden="true"></span>
|
|
485
496
|
</label>
|
|
486
|
-
`}render(){return this.loading?_`<div class="text-sm text-muted-foreground">${
|
|
497
|
+
`}render(){return this.loading?_`<div class="text-sm text-muted-foreground">${D(`loading`)}</div>`:_`
|
|
487
498
|
<div class="quickforge-settings-stack">
|
|
488
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
499
|
+
<section class="quickforge-settings-section" aria-label=${D(`defaultOptions`)}>
|
|
489
500
|
<div class="quickforge-settings-row">
|
|
490
501
|
<div class="quickforge-settings-row-main">
|
|
491
502
|
<div class="quickforge-settings-row-title">
|
|
492
|
-
${
|
|
493
|
-
<quickforge-info-tip .label=${
|
|
503
|
+
${D(`language`)}
|
|
504
|
+
<quickforge-info-tip .label=${D(`languageDescription`)}></quickforge-info-tip>
|
|
494
505
|
</div>
|
|
495
|
-
<div class="quickforge-settings-row-description">${
|
|
506
|
+
<div class="quickforge-settings-row-description">${D(`displayLanguage`)}</div>
|
|
496
507
|
</div>
|
|
497
508
|
<div class="quickforge-settings-row-control">
|
|
498
509
|
<select
|
|
@@ -501,26 +512,26 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
501
512
|
.value=${this.selectedLanguage}
|
|
502
513
|
@change=${e=>this.updateLanguage(e.target.value)}
|
|
503
514
|
>
|
|
504
|
-
<option value="zh">${
|
|
505
|
-
<option value="en">${
|
|
515
|
+
<option value="zh">${D(`simplifiedChinese`)}</option>
|
|
516
|
+
<option value="en">${D(`english`)}</option>
|
|
506
517
|
</select>
|
|
507
518
|
</div>
|
|
508
519
|
</div>
|
|
509
520
|
|
|
510
521
|
<div class="quickforge-settings-row">
|
|
511
522
|
<div class="quickforge-settings-row-main">
|
|
512
|
-
<div class="quickforge-settings-row-title">${
|
|
513
|
-
<div class="quickforge-settings-row-description">${
|
|
523
|
+
<div class="quickforge-settings-row-title">${D(`defaultModel`)}</div>
|
|
524
|
+
<div class="quickforge-settings-row-description">${D(`defaultModelDescription`)}</div>
|
|
514
525
|
</div>
|
|
515
526
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
516
527
|
<select
|
|
517
528
|
data-default-model-select
|
|
518
529
|
class="quickforge-settings-select"
|
|
519
|
-
.value=${this.selectedModel?
|
|
530
|
+
.value=${this.selectedModel?I(this.selectedModel):``}
|
|
520
531
|
@change=${e=>this.updateModel(e.target.value)}
|
|
521
532
|
>
|
|
522
|
-
${this.modelOptions().length===0?_`<option value="">${
|
|
523
|
-
<option .value=${
|
|
533
|
+
${this.modelOptions().length===0?_`<option value="">${D(`noModelAvailable`)}</option>`:this.modelOptions().map(e=>_`
|
|
534
|
+
<option .value=${I(e)}>${Be(e)}</option>
|
|
524
535
|
`)}
|
|
525
536
|
</select>
|
|
526
537
|
</div>
|
|
@@ -528,9 +539,9 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
528
539
|
|
|
529
540
|
<div class="quickforge-settings-row">
|
|
530
541
|
<div class="quickforge-settings-row-main">
|
|
531
|
-
<div class="quickforge-settings-row-title">${
|
|
542
|
+
<div class="quickforge-settings-row-title">${D(`defaultThinkingLevel`)}</div>
|
|
532
543
|
<div class="quickforge-settings-row-description">
|
|
533
|
-
${this.selectedModel?.reasoning?
|
|
544
|
+
${this.selectedModel?.reasoning?D(`defaultThinkingLevelDescription`):D(`thinkingRequiresReasoningModel`)}
|
|
534
545
|
</div>
|
|
535
546
|
</div>
|
|
536
547
|
<div class="quickforge-settings-row-control">
|
|
@@ -541,7 +552,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
541
552
|
?disabled=${!this.selectedModel?.reasoning}
|
|
542
553
|
@change=${e=>this.updateThinkingLevel(e.target.value)}
|
|
543
554
|
>
|
|
544
|
-
${
|
|
555
|
+
${Re.map(e=>_`
|
|
545
556
|
<option .value=${e.value}>${e.label()}</option>
|
|
546
557
|
`)}
|
|
547
558
|
</select>
|
|
@@ -551,10 +562,10 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
551
562
|
<div class="quickforge-settings-row">
|
|
552
563
|
<div class="quickforge-settings-row-main">
|
|
553
564
|
<div class="quickforge-settings-row-title">
|
|
554
|
-
${
|
|
555
|
-
<quickforge-info-tip .label=${
|
|
565
|
+
${D(`showToolDetails`)}
|
|
566
|
+
<quickforge-info-tip .label=${D(`showToolDetailsDescription`)}></quickforge-info-tip>
|
|
556
567
|
</div>
|
|
557
|
-
<div class="quickforge-settings-row-description">${
|
|
568
|
+
<div class="quickforge-settings-row-description">${D(`showToolDetailsDescriptionShort`)}</div>
|
|
558
569
|
</div>
|
|
559
570
|
<div class="quickforge-settings-row-control">
|
|
560
571
|
${this.renderSwitch(this.showToolDetails,e=>this.updateShowToolDetails(e))}
|
|
@@ -563,8 +574,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
563
574
|
|
|
564
575
|
<div class="quickforge-settings-row">
|
|
565
576
|
<div class="quickforge-settings-row-main">
|
|
566
|
-
<div class="quickforge-settings-row-title">${
|
|
567
|
-
<div class="quickforge-settings-row-description">${
|
|
577
|
+
<div class="quickforge-settings-row-title">${D(`expandToolsByDefault`)}</div>
|
|
578
|
+
<div class="quickforge-settings-row-description">${D(`expandToolsByDefaultDescription`)}</div>
|
|
568
579
|
</div>
|
|
569
580
|
<div class="quickforge-settings-row-control">
|
|
570
581
|
${this.renderSwitch(this.expandToolsByDefault,e=>this.updateExpandToolsByDefault(e))}
|
|
@@ -574,10 +585,10 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
574
585
|
<div class="quickforge-settings-row">
|
|
575
586
|
<div class="quickforge-settings-row-main">
|
|
576
587
|
<div class="quickforge-settings-row-title">
|
|
577
|
-
${
|
|
578
|
-
<quickforge-info-tip .label=${
|
|
588
|
+
${D(`autoCompactEnabled`)}
|
|
589
|
+
<quickforge-info-tip .label=${D(`autoCompactDescription`)}></quickforge-info-tip>
|
|
579
590
|
</div>
|
|
580
|
-
<div class="quickforge-settings-row-description">${
|
|
591
|
+
<div class="quickforge-settings-row-description">${D(`autoCompactTriggerNote`)}</div>
|
|
581
592
|
</div>
|
|
582
593
|
<div class="quickforge-settings-row-control">
|
|
583
594
|
${this.renderSwitch(this.autoCompactEnabled,e=>this.updateAutoCompactEnabled(e))}
|
|
@@ -586,8 +597,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
586
597
|
|
|
587
598
|
<div class="quickforge-settings-row">
|
|
588
599
|
<div class="quickforge-settings-row-main">
|
|
589
|
-
<div class="quickforge-settings-row-title">${
|
|
590
|
-
<div class="quickforge-settings-row-description">${
|
|
600
|
+
<div class="quickforge-settings-row-title">${D(`autoCompactRequireConfirmation`)}</div>
|
|
601
|
+
<div class="quickforge-settings-row-description">${D(`autoCompactRequireConfirmationDescription`)}</div>
|
|
591
602
|
</div>
|
|
592
603
|
<div class="quickforge-settings-row-control">
|
|
593
604
|
${this.renderSwitch(this.autoCompactRequireConfirmation,e=>this.updateAutoCompactRequireConfirmation(e),!this.autoCompactEnabled)}
|
|
@@ -596,8 +607,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
596
607
|
|
|
597
608
|
<div class="quickforge-settings-row">
|
|
598
609
|
<div class="quickforge-settings-row-main">
|
|
599
|
-
<div class="quickforge-settings-row-title">${
|
|
600
|
-
<div class="quickforge-settings-row-description">${
|
|
610
|
+
<div class="quickforge-settings-row-title">${D(`autoCompactThresholdPercent`)}</div>
|
|
611
|
+
<div class="quickforge-settings-row-description">${D(`autoCompactThresholdDescription`)}</div>
|
|
601
612
|
</div>
|
|
602
613
|
<div class="quickforge-settings-row-control">
|
|
603
614
|
<input
|
|
@@ -618,10 +629,10 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
618
629
|
<div class="quickforge-settings-row">
|
|
619
630
|
<div class="quickforge-settings-row-main">
|
|
620
631
|
<div class="quickforge-settings-row-title">
|
|
621
|
-
${
|
|
622
|
-
<quickforge-info-tip .label=${
|
|
632
|
+
${D(`autoCompactKeepRecentTurns`)}
|
|
633
|
+
<quickforge-info-tip .label=${D(`autoCompactHistoryPreserved`)}></quickforge-info-tip>
|
|
623
634
|
</div>
|
|
624
|
-
<div class="quickforge-settings-row-description">${
|
|
635
|
+
<div class="quickforge-settings-row-description">${D(`autoCompactKeepRecentTurnsDescription`)}</div>
|
|
625
636
|
</div>
|
|
626
637
|
<div class="quickforge-settings-row-control">
|
|
627
638
|
<input
|
|
@@ -642,10 +653,10 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
642
653
|
|
|
643
654
|
${this.terminalShellSettings()}
|
|
644
655
|
|
|
645
|
-
${this.saved?_`<div class="quickforge-settings-message">${this.savedMessage||
|
|
656
|
+
${this.saved?_`<div class="quickforge-settings-message">${this.savedMessage||D(`defaultOptionsSaved`)}</div>`:null}
|
|
646
657
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
647
658
|
</div>
|
|
648
|
-
`}},
|
|
659
|
+
`}},L=`quickforge-default-options-settings-tab`;customElements.get(L)||customElements.define(L,Ke);function qe(){return document.createElement(L)}var Je=`quickforge-backup`,R=[{id:`settings`,countKey:`settings`,label:()=>D(`restoreSettings`),description:()=>D(`restoreSettingsDescription`)},{id:`mcp`,countKey:`mcp`,label:()=>D(`restoreMcp`),description:()=>D(`restoreMcpDescription`)},{id:`providerKeys`,countKey:`providerKeys`,label:()=>D(`restoreProviderKeys`),description:()=>D(`restoreProviderKeysDescription`)},{id:`customProviders`,countKey:`customProviders`,label:()=>D(`restoreCustomProviders`),description:()=>D(`restoreCustomProvidersDescription`)},{id:`projects`,countKey:`projects`,label:()=>D(`restoreProjects`),description:()=>D(`restoreProjectsDescription`)},{id:`scheduledTasks`,countKey:`scheduledTasks`,label:()=>D(`restoreScheduledTasks`),description:()=>D(`restoreScheduledTasksDescription`)}],Ye=R;function Xe(e,t){let n=new Blob([`${JSON.stringify(t,null,2)}\n`],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}function Ze(){return new Date().toISOString().replace(/[:.]/g,`-`)}function Qe(e){return e?Object.entries(e).map(([e,t])=>`${e}: ${t}`).join(`, `):``}function $e(e){return Ye.filter(t=>(e.sections?.[t.countKey]??0)>0)}function et(e){return $e(e).map(e=>e.id)}function tt(e){return e instanceof RangeError||e instanceof Error&&e.message.includes(`Invalid string length`)}function z(e,t){return tt(e)?D(`backupStringTooLarge`):e instanceof Error?e.message:t}var nt=class extends v{exportSections=new Set(R.map(e=>e.id));busy=!1;message=``;error=``;safetyBackupPath=``;pendingImport=null;getTabName(){return D(`backupRestore`)}toggleExportSection(e,t){t?this.exportSections.add(e):this.exportSections.delete(e),this.clearStatus(),this.requestUpdate()}clearStatus(){this.message=``,this.error=``,this.safetyBackupPath=``}async exportBackup(){if(this.exportSections.size===0){this.error=D(`selectAtLeastOneExportSection`),this.requestUpdate();return}this.busy=!0,this.clearStatus(),this.requestUpdate();try{let e=new URLSearchParams({sections:[...this.exportSections].join(`,`)}),t=await fetch(`/api/backup/export?${e.toString()}`,{cache:`no-store`}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error||D(`backupExportFailed`));Xe(`${Je}-settings-${Ze()}.json`,n),this.message=D(`backupExported`)}catch(e){this.error=z(e,D(`backupExportFailed`))}finally{this.busy=!1,this.requestUpdate()}}async inspectBackupFile(e){let t=await fetch(`/api/backup/inspect-file`,{method:`POST`,headers:{"content-type":`application/json`},body:e}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error||D(`backupInspectFailed`));if(!n)throw Error(D(`backupInspectFailed`));return n}async importBackupFromFile(e){this.busy=!0,this.clearStatus(),this.pendingImport=null,this.requestUpdate();try{let t=await this.inspectBackupFile(e),n=new Set(et(t));this.pendingImport={backup:null,importToken:t.importToken,inspect:t,selectedSections:n,mode:`replace`},this.message=t.ignoredConversations?D(`backupInspectedWithIgnoredConversations`):D(`backupInspected`)}catch(e){this.error=z(e,D(`backupImportFailed`))}finally{this.busy=!1,this.requestUpdate()}}togglePendingSection(e,t){this.pendingImport&&(t?this.pendingImport.selectedSections.add(e):this.pendingImport.selectedSections.delete(e),this.message=``,this.error=``,this.requestUpdate())}setRestoreMode(e){this.pendingImport&&(this.pendingImport.mode=e,this.message=``,this.error=``,this.requestUpdate())}cancelPendingImport(){this.pendingImport=null,this.message=``,this.error=``,this.requestUpdate()}async confirmPendingImport(){if(this.pendingImport){if(this.pendingImport.selectedSections.size===0){this.error=D(`selectAtLeastOneRestoreSection`),this.requestUpdate();return}if(await C({description:this.pendingImport.mode===`replace`?D(`backupImportReplaceConfirm`):D(`backupImportMergeConfirm`),confirmLabel:D(`confirmImportSelected`),cancelLabel:D(`cancel`)})){this.busy=!0,this.clearStatus(),this.requestUpdate();try{let e=this.pendingImport.importToken?{importToken:this.pendingImport.importToken,sections:[...this.pendingImport.selectedSections],mode:this.pendingImport.mode}:{backup:this.pendingImport.backup,sections:[...this.pendingImport.selectedSections],mode:this.pendingImport.mode},t=await fetch(`/api/backup/import`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error||D(`backupImportFailed`));let r=Qe(n?.summary);this.safetyBackupPath=n?.safetyBackupPath||``,this.pendingImport=null,this.message=r?`${D(`backupImported`)} ${r}`:D(`backupImported`),window.setTimeout(()=>window.location.reload(),1500)}catch(e){this.error=z(e,D(`backupImportFailed`))}finally{this.busy=!1,this.requestUpdate()}}}}handleFileChange(e){let t=e.target,n=t.files?.[0];t.value=``,n&&this.importBackupFromFile(n)}renderSwitch(e,t,n=!1){return _`
|
|
649
660
|
<label class="quickforge-settings-switch" aria-disabled=${n?`true`:`false`}>
|
|
650
661
|
<input
|
|
651
662
|
type="checkbox"
|
|
@@ -655,39 +666,39 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
655
666
|
/>
|
|
656
667
|
<span aria-hidden="true"></span>
|
|
657
668
|
</label>
|
|
658
|
-
`}renderPendingImport(){if(!this.pendingImport)return null;let{inspect:e,selectedSections:t}=this.pendingImport,n
|
|
659
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
669
|
+
`}renderPendingImport(){if(!this.pendingImport)return null;let{inspect:e,selectedSections:t}=this.pendingImport,n=$e(e);return _`
|
|
670
|
+
<section class="quickforge-settings-section" aria-label=${D(`backupInspectTitle`)}>
|
|
660
671
|
<div class="quickforge-settings-row quickforge-settings-row-top">
|
|
661
672
|
<div class="quickforge-settings-row-main">
|
|
662
|
-
<div class="quickforge-settings-row-title">${
|
|
663
|
-
<div class="quickforge-settings-row-description">${
|
|
673
|
+
<div class="quickforge-settings-row-title">${D(`backupInspectTitle`)}</div>
|
|
674
|
+
<div class="quickforge-settings-row-description">${D(`backupInspectDescription`)}</div>
|
|
664
675
|
</div>
|
|
665
676
|
</div>
|
|
666
677
|
|
|
667
678
|
<div class="quickforge-settings-nested-list">
|
|
668
679
|
<div class="quickforge-settings-subrow">
|
|
669
680
|
<div class="quickforge-settings-row-main">
|
|
670
|
-
<div class="quickforge-settings-row-title">${
|
|
681
|
+
<div class="quickforge-settings-row-title">${D(`backupInspectExportedAt`)}</div>
|
|
671
682
|
</div>
|
|
672
683
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.exportedAt||`-`}</div>
|
|
673
684
|
</div>
|
|
674
685
|
<div class="quickforge-settings-subrow">
|
|
675
686
|
<div class="quickforge-settings-row-main">
|
|
676
|
-
<div class="quickforge-settings-row-title">${
|
|
687
|
+
<div class="quickforge-settings-row-title">${D(`backupInspectVersion`)}</div>
|
|
677
688
|
</div>
|
|
678
689
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.version??`-`}</div>
|
|
679
690
|
</div>
|
|
680
691
|
<div class="quickforge-settings-subrow">
|
|
681
692
|
<div class="quickforge-settings-row-main">
|
|
682
|
-
<div class="quickforge-settings-row-title">${
|
|
693
|
+
<div class="quickforge-settings-row-title">${D(`backupInspectScope`)}</div>
|
|
683
694
|
</div>
|
|
684
695
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.scope||`-`}</div>
|
|
685
696
|
</div>
|
|
686
697
|
<div class="quickforge-settings-subrow">
|
|
687
698
|
<div class="quickforge-settings-row-main">
|
|
688
|
-
<div class="quickforge-settings-row-title">${
|
|
699
|
+
<div class="quickforge-settings-row-title">${D(`backupInspectSecrets`)}</div>
|
|
689
700
|
</div>
|
|
690
|
-
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.includeSecrets?
|
|
701
|
+
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.includeSecrets?D(`yes`):D(`no`)}</div>
|
|
691
702
|
</div>
|
|
692
703
|
</div>
|
|
693
704
|
|
|
@@ -697,20 +708,27 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
697
708
|
</div>
|
|
698
709
|
`:null}
|
|
699
710
|
|
|
711
|
+
${e.invalidSections&&Object.keys(e.invalidSections).length?_`
|
|
712
|
+
<div class="quickforge-settings-warning quickforge-settings-warning-attached">
|
|
713
|
+
<div>${D(`backupInvalidSections`)}</div>
|
|
714
|
+
${Object.entries(e.invalidSections).map(([e,t])=>_`<div>${e}: ${t}</div>`)}
|
|
715
|
+
</div>
|
|
716
|
+
`:null}
|
|
717
|
+
|
|
700
718
|
<div class="quickforge-settings-row">
|
|
701
719
|
<div class="quickforge-settings-row-main">
|
|
702
|
-
<div class="quickforge-settings-row-title">${
|
|
703
|
-
<div class="quickforge-settings-row-description">${
|
|
720
|
+
<div class="quickforge-settings-row-title">${D(`restoreMode`)}</div>
|
|
721
|
+
<div class="quickforge-settings-row-description">${D(`restoreModeDescription`)}</div>
|
|
704
722
|
</div>
|
|
705
723
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
706
|
-
<div class="quickforge-settings-segmented" role="group" aria-label=${
|
|
724
|
+
<div class="quickforge-settings-segmented" role="group" aria-label=${D(`restoreMode`)}>
|
|
707
725
|
<button
|
|
708
726
|
type="button"
|
|
709
727
|
class="quickforge-settings-segmented-option ${this.pendingImport.mode===`replace`?`quickforge-settings-segmented-option-active`:``}"
|
|
710
728
|
?disabled=${this.busy}
|
|
711
729
|
@click=${()=>this.setRestoreMode(`replace`)}
|
|
712
730
|
>
|
|
713
|
-
${
|
|
731
|
+
${D(`restoreModeReplace`)}
|
|
714
732
|
</button>
|
|
715
733
|
<button
|
|
716
734
|
type="button"
|
|
@@ -718,7 +736,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
718
736
|
?disabled=${this.busy}
|
|
719
737
|
@click=${()=>this.setRestoreMode(`merge`)}
|
|
720
738
|
>
|
|
721
|
-
${
|
|
739
|
+
${D(`restoreModeMerge`)}
|
|
722
740
|
</button>
|
|
723
741
|
</div>
|
|
724
742
|
</div>
|
|
@@ -726,9 +744,9 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
726
744
|
|
|
727
745
|
<div class="quickforge-settings-row quickforge-settings-row-top">
|
|
728
746
|
<div class="quickforge-settings-row-main">
|
|
729
|
-
<div class="quickforge-settings-row-title">${
|
|
747
|
+
<div class="quickforge-settings-row-title">${D(`selectRestoreSections`)}</div>
|
|
730
748
|
<div class="quickforge-settings-row-description">
|
|
731
|
-
${this.pendingImport.mode===`replace`?
|
|
749
|
+
${this.pendingImport.mode===`replace`?D(`restoreModeReplaceDescription`):D(`restoreModeMergeDescription`)}
|
|
732
750
|
</div>
|
|
733
751
|
</div>
|
|
734
752
|
</div>
|
|
@@ -748,8 +766,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
748
766
|
|
|
749
767
|
<div class="quickforge-settings-row">
|
|
750
768
|
<div class="quickforge-settings-row-main">
|
|
751
|
-
<div class="quickforge-settings-row-title">${
|
|
752
|
-
<div class="quickforge-settings-row-description">${
|
|
769
|
+
<div class="quickforge-settings-row-title">${D(`backupImportActions`)}</div>
|
|
770
|
+
<div class="quickforge-settings-row-description">${D(`backupImportActionsDescription`)}</div>
|
|
753
771
|
</div>
|
|
754
772
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
755
773
|
<button
|
|
@@ -758,7 +776,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
758
776
|
?disabled=${this.busy||t.size===0}
|
|
759
777
|
@click=${()=>this.confirmPendingImport()}
|
|
760
778
|
>
|
|
761
|
-
${this.busy?
|
|
779
|
+
${this.busy?D(`loading`):D(`confirmImportSelected`)}
|
|
762
780
|
</button>
|
|
763
781
|
<button
|
|
764
782
|
class="quickforge-settings-button quickforge-settings-button-secondary"
|
|
@@ -766,78 +784,66 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
766
784
|
?disabled=${this.busy}
|
|
767
785
|
@click=${()=>this.cancelPendingImport()}
|
|
768
786
|
>
|
|
769
|
-
${
|
|
787
|
+
${D(`cancel`)}
|
|
770
788
|
</button>
|
|
771
789
|
</div>
|
|
772
790
|
</div>
|
|
773
791
|
</section>
|
|
774
792
|
`}render(){return _`
|
|
775
793
|
<div class="quickforge-settings-stack">
|
|
776
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
777
|
-
<div class="quickforge-settings-row">
|
|
794
|
+
<section class="quickforge-settings-section" aria-label=${D(`exportData`)}>
|
|
795
|
+
<div class="quickforge-settings-row quickforge-settings-row-top">
|
|
778
796
|
<div class="quickforge-settings-row-main">
|
|
779
797
|
<div class="quickforge-settings-row-title">
|
|
780
|
-
${
|
|
781
|
-
<quickforge-info-tip .label=${
|
|
798
|
+
${D(`selectExportSections`)}
|
|
799
|
+
<quickforge-info-tip .label=${D(`exportDataDescription`)}></quickforge-info-tip>
|
|
782
800
|
</div>
|
|
783
|
-
<div class="quickforge-settings-row-description">${
|
|
784
|
-
</div>
|
|
785
|
-
<div class="quickforge-settings-row-control">
|
|
786
|
-
<select
|
|
787
|
-
class="quickforge-settings-select"
|
|
788
|
-
.value=${this.exportScope}
|
|
789
|
-
?disabled=${this.busy}
|
|
790
|
-
@change=${e=>this.setScope(e.target.value)}
|
|
791
|
-
>
|
|
792
|
-
<option value="all">${k(`exportScopeAll`)}</option>
|
|
793
|
-
<option value="config">${k(`exportScopeConfig`)}</option>
|
|
794
|
-
<option value="sessions">${k(`exportScopeSessions`)}</option>
|
|
795
|
-
</select>
|
|
801
|
+
<div class="quickforge-settings-row-description">${D(`selectExportSectionsDescription`)}</div>
|
|
796
802
|
</div>
|
|
797
803
|
</div>
|
|
798
804
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
${this.renderSwitch(this.includeSecrets,e=>this.setIncludeSecrets(e),this.busy||this.exportScope===`sessions`)}
|
|
812
|
-
</div>
|
|
805
|
+
<div class="quickforge-settings-nested-list">
|
|
806
|
+
${R.map(e=>_`
|
|
807
|
+
<div class="quickforge-settings-subrow">
|
|
808
|
+
<div class="quickforge-settings-row-main">
|
|
809
|
+
<div class="quickforge-settings-row-title">${e.label()}</div>
|
|
810
|
+
<div class="quickforge-settings-row-description">${e.description()}</div>
|
|
811
|
+
</div>
|
|
812
|
+
<div class="quickforge-settings-row-control">
|
|
813
|
+
${this.renderSwitch(this.exportSections.has(e.id),t=>this.toggleExportSection(e.id,t),this.busy)}
|
|
814
|
+
</div>
|
|
815
|
+
</div>
|
|
816
|
+
`)}
|
|
813
817
|
</div>
|
|
814
818
|
|
|
819
|
+
<div class="quickforge-settings-note">${D(`conversationBackupExcluded`)}</div>
|
|
820
|
+
|
|
815
821
|
<div class="quickforge-settings-row">
|
|
816
822
|
<div class="quickforge-settings-row-main">
|
|
817
|
-
<div class="quickforge-settings-row-title">${
|
|
818
|
-
<div class="quickforge-settings-row-description">${
|
|
823
|
+
<div class="quickforge-settings-row-title">${D(`exportBackup`)}</div>
|
|
824
|
+
<div class="quickforge-settings-row-description">${D(`exportBackupDescription`)}</div>
|
|
819
825
|
</div>
|
|
820
826
|
<div class="quickforge-settings-row-control">
|
|
821
827
|
<button
|
|
822
828
|
class="quickforge-settings-button quickforge-settings-button-primary"
|
|
823
829
|
type="button"
|
|
824
|
-
?disabled=${this.busy}
|
|
830
|
+
?disabled=${this.busy||this.exportSections.size===0}
|
|
825
831
|
@click=${()=>this.exportBackup()}
|
|
826
832
|
>
|
|
827
|
-
${this.busy?
|
|
833
|
+
${this.busy?D(`loading`):D(`exportBackup`)}
|
|
828
834
|
</button>
|
|
829
835
|
</div>
|
|
830
836
|
</div>
|
|
831
837
|
</section>
|
|
832
838
|
|
|
833
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
839
|
+
<section class="quickforge-settings-section" aria-label=${D(`importData`)}>
|
|
834
840
|
<div class="quickforge-settings-row">
|
|
835
841
|
<div class="quickforge-settings-row-main">
|
|
836
842
|
<div class="quickforge-settings-row-title">
|
|
837
|
-
${
|
|
838
|
-
<quickforge-info-tip .label=${
|
|
843
|
+
${D(`importBackup`)}
|
|
844
|
+
<quickforge-info-tip .label=${D(`importDataDescription`)}></quickforge-info-tip>
|
|
839
845
|
</div>
|
|
840
|
-
<div class="quickforge-settings-row-description">${
|
|
846
|
+
<div class="quickforge-settings-row-description">${D(`importDataDescription`)}</div>
|
|
841
847
|
</div>
|
|
842
848
|
<div class="quickforge-settings-row-control">
|
|
843
849
|
<label class="quickforge-settings-button quickforge-settings-button-secondary ${this.busy?`pointer-events-none opacity-60`:``}">
|
|
@@ -848,7 +854,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
848
854
|
?disabled=${this.busy}
|
|
849
855
|
@change=${e=>this.handleFileChange(e)}
|
|
850
856
|
/>
|
|
851
|
-
${
|
|
857
|
+
${D(`importBackup`)}
|
|
852
858
|
</label>
|
|
853
859
|
</div>
|
|
854
860
|
</div>
|
|
@@ -856,16 +862,16 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
856
862
|
|
|
857
863
|
${this.renderPendingImport()}
|
|
858
864
|
${this.message?_`<div class="quickforge-settings-message">${this.message}</div>`:null}
|
|
859
|
-
${this.safetyBackupPath?_`<div class="quickforge-settings-note">${
|
|
865
|
+
${this.safetyBackupPath?_`<div class="quickforge-settings-note">${D(`backupSafetyBackupPath`)}: <code>${this.safetyBackupPath}</code></div>`:null}
|
|
860
866
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
861
867
|
</div>
|
|
862
|
-
`}},
|
|
868
|
+
`}},B=`quickforge-backup-settings-tab`;customElements.get(B)||customElements.define(B,nt);function rt(){return document.createElement(B)}function it(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(ye())}function at(e){let t={...e};return delete t.archivedAt,t}function V(){if(!(typeof BroadcastChannel>`u`))try{let e=new BroadcastChannel(`quickforge-sync`);e.postMessage({type:`sessions-changed`,sourceTabId:`archived-conversations-settings-tab`,timestamp:Date.now()}),e.close()}catch{}}var ot=class extends v{sessions=[];projects=[];loading=!0;busySessionId=``;query=``;projectFilter=`all`;message=``;error=``;getTabName(){return D(`archivedConversations`)}async connectedCallback(){super.connectedCallback(),await this.loadData()}get projectNameById(){return new Map(this.projects.map(e=>[e.id,e.name]))}async loadData(){this.loading=!0,this.error=``,this.requestUpdate();try{let[e,t]=await Promise.all([fetch(`/api/storage/sessions-metadata/index/lastModified?direction=desc&limit=1000&offset=0&archived=only`,{cache:`no-store`}),fetch(`/api/project`,{cache:`no-store`}).catch(()=>null)]),n=await e.json().catch(()=>null);if(!e.ok)throw Error(n?.error||D(`requestFailed`));if(this.sessions=Array.isArray(n?.values)?n.values:[],t?.ok){let e=await t.json().catch(()=>null);this.projects=Array.isArray(e?.projects)?e.projects:[]}}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}filteredSessions(){let e=this.query.trim().toLowerCase();return this.sessions.filter(t=>{if(this.projectFilter!==`all`&&(this.projectFilter===`global`&&t.scope===`project`||this.projectFilter!==`global`&&t.projectId!==this.projectFilter))return!1;if(!e)return!0;let n=t.projectId&&this.projectNameById.get(t.projectId)||``;return`${E(t.title)} ${n}`.toLowerCase().includes(e)})}groupedSessions(){let e=new Map;for(let t of this.filteredSessions()){let n=t.scope===`project`&&t.projectId?t.projectId:`global`;e.set(n,[...e.get(n)??[],t])}return[...e.entries()]}projectLabel(e){return e===`global`?D(`normalChat`):this.projectNameById.get(e)||D(`unknownProject`)}async restoreSession(e){if(!this.busySessionId){this.busySessionId=e,this.message=``,this.error=``,this.requestUpdate();try{let t=y(),n=await t.sessions.get(e),r=await t.sessions.getMetadata(e);if(!n||!r)throw Error(D(`sessionNotFound`));await t.sessions.save(at(n),at(r)),this.sessions=this.sessions.filter(t=>t.id!==e),this.message=D(`sessionRestored`),V()}catch(e){this.error=e instanceof Error?e.message:D(`restoreSessionFailed`)}finally{this.busySessionId=``,this.requestUpdate()}}}async deleteSession(e){if(!this.busySessionId&&await C({description:D(`deleteArchivedSessionConfirm`,{title:E(e.title)}),confirmLabel:D(`confirmDelete`),cancelLabel:D(`cancel`),variant:`destructive`})){this.busySessionId=e.id,this.message=``,this.error=``,this.requestUpdate();try{await y().sessions.delete(e.id),this.sessions=this.sessions.filter(t=>t.id!==e.id),this.message=D(`archivedSessionDeleted`),V()}catch(e){this.error=e instanceof Error?e.message:D(`deleteSessionFailed`)}finally{this.busySessionId=``,this.requestUpdate()}}}async deleteAllArchivedSessions(){if(!(this.busySessionId||this.sessions.length===0)&&await C({description:D(`deleteAllArchivedSessionsConfirm`),confirmLabel:D(`confirmDelete`),cancelLabel:D(`cancel`),variant:`destructive`})){this.busySessionId=`__all__`,this.message=``,this.error=``,this.requestUpdate();try{let e=y();await Promise.all(this.sessions.map(t=>e.sessions.delete(t.id))),this.sessions=[],this.message=D(`archivedSessionsDeleted`),V()}catch(e){this.error=e instanceof Error?e.message:D(`deleteSessionFailed`)}finally{this.busySessionId=``,this.requestUpdate()}}}renderSession(e){let t=this.busySessionId===e.id||this.busySessionId===`__all__`;return _`
|
|
863
869
|
<div class="border-t border-border px-4 py-3 first:border-t-0">
|
|
864
870
|
<div class="flex items-start justify-between gap-3">
|
|
865
871
|
<div class="min-w-0">
|
|
866
|
-
<div class="truncate text-sm font-medium text-foreground">${
|
|
872
|
+
<div class="truncate text-sm font-medium text-foreground">${E(e.title)}</div>
|
|
867
873
|
<div class="mt-1 text-xs text-muted-foreground">
|
|
868
|
-
${
|
|
874
|
+
${D(`lastModified`)}: ${it(e.lastModified)} · ${D(`archivedAt`)}: ${it(e.archivedAt)}
|
|
869
875
|
</div>
|
|
870
876
|
</div>
|
|
871
877
|
<div class="flex shrink-0 items-center gap-2">
|
|
@@ -875,7 +881,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
875
881
|
?disabled=${t}
|
|
876
882
|
@click=${()=>this.restoreSession(e.id)}
|
|
877
883
|
>
|
|
878
|
-
${
|
|
884
|
+
${D(`restoreSession`)}
|
|
879
885
|
</button>
|
|
880
886
|
<button
|
|
881
887
|
class="rounded-md px-2.5 py-1 text-xs text-destructive hover:bg-destructive/10 disabled:opacity-60"
|
|
@@ -883,7 +889,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
883
889
|
?disabled=${t}
|
|
884
890
|
@click=${()=>this.deleteSession(e)}
|
|
885
891
|
>
|
|
886
|
-
${
|
|
892
|
+
${D(`deletePermanently`)}
|
|
887
893
|
</button>
|
|
888
894
|
</div>
|
|
889
895
|
</div>
|
|
@@ -897,7 +903,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
897
903
|
?disabled=${!!this.busySessionId||this.sessions.length===0}
|
|
898
904
|
@click=${()=>this.deleteAllArchivedSessions()}
|
|
899
905
|
>
|
|
900
|
-
${
|
|
906
|
+
${D(`deleteAll`)}
|
|
901
907
|
</button>
|
|
902
908
|
</div>
|
|
903
909
|
|
|
@@ -907,7 +913,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
907
913
|
class="rounded-md border border-input bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-ring/30"
|
|
908
914
|
type="search"
|
|
909
915
|
.value=${this.query}
|
|
910
|
-
placeholder=${
|
|
916
|
+
placeholder=${D(`searchArchivedConversations`)}
|
|
911
917
|
@input=${e=>{this.query=e.target.value,this.requestUpdate()}}
|
|
912
918
|
/>
|
|
913
919
|
<select
|
|
@@ -915,23 +921,23 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
915
921
|
.value=${this.projectFilter}
|
|
916
922
|
@change=${e=>{this.projectFilter=e.target.value,this.requestUpdate()}}
|
|
917
923
|
>
|
|
918
|
-
<option value="all">${
|
|
919
|
-
<option value="global">${
|
|
924
|
+
<option value="all">${D(`allProjects`)}</option>
|
|
925
|
+
<option value="global">${D(`normalChat`)}</option>
|
|
920
926
|
${this.projects.map(e=>_`<option value=${e.id}>${e.name}</option>`)}
|
|
921
927
|
</select>
|
|
922
928
|
</div>
|
|
923
929
|
|
|
924
930
|
${this.loading?_`
|
|
925
|
-
<div class="px-4 py-8 text-center text-sm text-muted-foreground">${
|
|
931
|
+
<div class="px-4 py-8 text-center text-sm text-muted-foreground">${D(`loading`)}</div>
|
|
926
932
|
`:e.length===0?_`
|
|
927
|
-
<div class="px-4 py-8 text-center text-sm text-muted-foreground">${
|
|
933
|
+
<div class="px-4 py-8 text-center text-sm text-muted-foreground">${D(`noArchivedConversations`)}</div>
|
|
928
934
|
`:_`
|
|
929
935
|
<div>
|
|
930
936
|
${e.map(([e,t])=>_`
|
|
931
937
|
<div class="border-b border-border last:border-b-0">
|
|
932
938
|
<div class="flex items-center justify-between gap-3 bg-muted/20 px-4 py-2 text-sm text-muted-foreground">
|
|
933
939
|
<div class="truncate">${this.projectLabel(e)}</div>
|
|
934
|
-
<div class="shrink-0">${
|
|
940
|
+
<div class="shrink-0">${D(`conversationCount`,{count:t.length})}</div>
|
|
935
941
|
</div>
|
|
936
942
|
${t.map(e=>this.renderSession(e))}
|
|
937
943
|
</div>
|
|
@@ -943,7 +949,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
943
949
|
${this.message?_`<div class="rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2 text-sm text-emerald-700 dark:text-emerald-300">${this.message}</div>`:null}
|
|
944
950
|
${this.error?_`<div class="rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">${this.error}</div>`:null}
|
|
945
951
|
</div>
|
|
946
|
-
`}},
|
|
952
|
+
`}},H=`quickforge-archived-conversations-settings-tab`;customElements.get(H)||customElements.define(H,ot);function st(){return document.createElement(H)}function ct(){return Array.from({length:16},()=>`ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789!@#$%^&*`[Math.floor(Math.random()*65)]).join(``)}var lt=class extends v{loading=!0;saving=!1;enabled=!1;hasPassword=!1;password=``;sessionTtlHours=12;activeTokenCount=0;lanUrls=[];error=``;message=``;getTabName(){return D(`lanAccess`)}async connectedCallback(){super.connectedCallback(),await this.loadStatus()}async request(e,t){let n=await fetch(e,{...t,cache:`no-store`,headers:{...t?.body?{"content-type":`application/json`}:void 0,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||D(`requestFailed`));return r}applyStatus(e){this.enabled=!!e.enabled,this.hasPassword=!!e.hasPassword,this.sessionTtlHours=Number(e.sessionTtlHours||12),this.activeTokenCount=Number(e.activeTokenCount||0),this.lanUrls=Array.isArray(e.lanUrls)?e.lanUrls:[]}async loadStatus(){this.loading=!0,this.error=``,this.requestUpdate();try{this.applyStatus(await this.request(`/api/lan-access/status`))}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}updatePassword(e){this.password=e,this.requestUpdate()}updateEnabled(e){this.enabled=e,this.requestUpdate()}updateTtl(e){this.sessionTtlHours=Number(e)||12,this.requestUpdate()}async saveSettings(){if(!this.saving){if(this.enabled&&!this.hasPassword&&!this.password.trim()){this.error=D(`lanAccessPasswordRequired`),this.requestUpdate();return}if(this.password.trim()&&this.password.trim().length<8){this.error=D(`lanAccessPasswordTooShort`),this.requestUpdate();return}if(!(this.enabled&&!await C({description:D(`lanAccessEnableConfirm`),confirmLabel:D(`enabled`),cancelLabel:D(`cancel`)}))){this.saving=!0,this.error=``,this.message=``,this.requestUpdate();try{let e=await this.request(`/api/lan-access/settings`,{method:`PUT`,body:JSON.stringify({enabled:this.enabled,password:this.password.trim()||void 0,sessionTtlHours:this.sessionTtlHours})});this.applyStatus(e),this.password=``,this.message=D(`lanAccessSaved`)}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.saving=!1,this.requestUpdate()}}}}async revokeAll(){if(await C({description:D(`lanAccessRevokeAllConfirm`),confirmLabel:D(`lanAccessRevokeAll`),cancelLabel:D(`cancel`),variant:`destructive`})){this.saving=!0,this.error=``,this.message=``,this.requestUpdate();try{let e=await this.request(`/api/lan-access/revoke-all`,{method:`POST`});this.applyStatus(e),this.message=D(`lanAccessRevoked`)}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.saving=!1,this.requestUpdate()}}}renderSwitch(e,t,n=!1){return _`
|
|
947
953
|
<label class="quickforge-settings-switch" aria-disabled=${n?`true`:`false`}>
|
|
948
954
|
<input
|
|
949
955
|
type="checkbox"
|
|
@@ -953,36 +959,36 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
953
959
|
/>
|
|
954
960
|
<span aria-hidden="true"></span>
|
|
955
961
|
</label>
|
|
956
|
-
`}render(){return this.loading?_`<div class="text-sm text-muted-foreground">${
|
|
962
|
+
`}render(){return this.loading?_`<div class="text-sm text-muted-foreground">${D(`loading`)}</div>`:_`
|
|
957
963
|
<div class="quickforge-settings-stack">
|
|
958
|
-
<div class="quickforge-settings-warning">${
|
|
964
|
+
<div class="quickforge-settings-warning">${D(`lanAccessRiskWarning`)}</div>
|
|
959
965
|
|
|
960
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
966
|
+
<section class="quickforge-settings-section" aria-label=${D(`lanAccessStatus`)}>
|
|
961
967
|
<div class="quickforge-settings-row">
|
|
962
968
|
<div class="quickforge-settings-row-main">
|
|
963
|
-
<div class="quickforge-settings-row-title">${
|
|
964
|
-
<div class="quickforge-settings-row-description">${
|
|
969
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessEnabled`)}</div>
|
|
970
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessEnabledDescription`)}</div>
|
|
965
971
|
</div>
|
|
966
|
-
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${this.enabled?
|
|
972
|
+
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${this.enabled?D(`enabled`):D(`disabled`)}</div>
|
|
967
973
|
</div>
|
|
968
974
|
<div class="quickforge-settings-row">
|
|
969
975
|
<div class="quickforge-settings-row-main">
|
|
970
|
-
<div class="quickforge-settings-row-title">${
|
|
971
|
-
<div class="quickforge-settings-row-description">${
|
|
976
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessPassword`)}</div>
|
|
977
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessPasswordStatusDescription`)}</div>
|
|
972
978
|
</div>
|
|
973
|
-
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${this.hasPassword?
|
|
979
|
+
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${this.hasPassword?D(`configured`):D(`notConfigured`)}</div>
|
|
974
980
|
</div>
|
|
975
981
|
<div class="quickforge-settings-row">
|
|
976
982
|
<div class="quickforge-settings-row-main">
|
|
977
|
-
<div class="quickforge-settings-row-title">${
|
|
978
|
-
<div class="quickforge-settings-row-description">${
|
|
983
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessActiveDevices`)}</div>
|
|
984
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessActiveDevicesDescription`)}</div>
|
|
979
985
|
</div>
|
|
980
986
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${this.activeTokenCount}</div>
|
|
981
987
|
</div>
|
|
982
988
|
<div class="quickforge-settings-row">
|
|
983
989
|
<div class="quickforge-settings-row-main">
|
|
984
|
-
<div class="quickforge-settings-row-title">${
|
|
985
|
-
<div class="quickforge-settings-row-description">${
|
|
990
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessUrls`)}</div>
|
|
991
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessUrlsDescription`)}</div>
|
|
986
992
|
</div>
|
|
987
993
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-readonly-value">
|
|
988
994
|
${this.lanUrls.length?this.lanUrls.map(e=>_`<div>${e}</div>`):`-`}
|
|
@@ -990,11 +996,11 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
990
996
|
</div>
|
|
991
997
|
</section>
|
|
992
998
|
|
|
993
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
999
|
+
<section class="quickforge-settings-section" aria-label=${D(`lanAccess`)}>
|
|
994
1000
|
<div class="quickforge-settings-row">
|
|
995
1001
|
<div class="quickforge-settings-row-main">
|
|
996
|
-
<div class="quickforge-settings-row-title">${
|
|
997
|
-
<div class="quickforge-settings-row-description">${
|
|
1002
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessAllowFull`)}</div>
|
|
1003
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessAllowFullDescription`)}</div>
|
|
998
1004
|
</div>
|
|
999
1005
|
<div class="quickforge-settings-row-control">
|
|
1000
1006
|
${this.renderSwitch(this.enabled,e=>this.updateEnabled(e),this.saving)}
|
|
@@ -1003,8 +1009,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1003
1009
|
|
|
1004
1010
|
<div class="quickforge-settings-row">
|
|
1005
1011
|
<div class="quickforge-settings-row-main">
|
|
1006
|
-
<div class="quickforge-settings-row-title">${
|
|
1007
|
-
<div class="quickforge-settings-row-description">${this.hasPassword?
|
|
1012
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessPassword`)}</div>
|
|
1013
|
+
<div class="quickforge-settings-row-description">${this.hasPassword?D(`lanAccessPasswordPlaceholderConfigured`):D(`lanAccessPasswordPlaceholder`)}</div>
|
|
1008
1014
|
</div>
|
|
1009
1015
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-lan-password-control">
|
|
1010
1016
|
<input
|
|
@@ -1012,44 +1018,44 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1012
1018
|
type="password"
|
|
1013
1019
|
.value=${this.password}
|
|
1014
1020
|
@input=${e=>this.updatePassword(e.target.value)}
|
|
1015
|
-
placeholder=${this.hasPassword?
|
|
1021
|
+
placeholder=${this.hasPassword?D(`lanAccessPasswordPlaceholderConfigured`):D(`lanAccessPasswordPlaceholder`)}
|
|
1016
1022
|
/>
|
|
1017
1023
|
<button
|
|
1018
1024
|
class="quickforge-settings-button quickforge-settings-button-secondary"
|
|
1019
1025
|
type="button"
|
|
1020
|
-
@click=${()=>this.updatePassword(
|
|
1026
|
+
@click=${()=>this.updatePassword(ct())}
|
|
1021
1027
|
>
|
|
1022
|
-
${
|
|
1028
|
+
${D(`generatePassword`)}
|
|
1023
1029
|
</button>
|
|
1024
1030
|
</div>
|
|
1025
1031
|
</div>
|
|
1026
1032
|
|
|
1027
1033
|
<div class="quickforge-settings-row">
|
|
1028
1034
|
<div class="quickforge-settings-row-main">
|
|
1029
|
-
<div class="quickforge-settings-row-title">${
|
|
1030
|
-
<div class="quickforge-settings-row-description">${
|
|
1035
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessSessionTtl`)}</div>
|
|
1036
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessSessionTtlDescription`)}</div>
|
|
1031
1037
|
</div>
|
|
1032
1038
|
<div class="quickforge-settings-row-control">
|
|
1033
1039
|
<select class="quickforge-settings-select" .value=${String(this.sessionTtlHours)} @change=${e=>this.updateTtl(e.target.value)}>
|
|
1034
|
-
<option value="1">1 ${
|
|
1035
|
-
<option value="12">12 ${
|
|
1036
|
-
<option value="24">24 ${
|
|
1037
|
-
<option value="168">7 ${
|
|
1040
|
+
<option value="1">1 ${D(`hour`)}</option>
|
|
1041
|
+
<option value="12">12 ${D(`hours`)}</option>
|
|
1042
|
+
<option value="24">24 ${D(`hours`)}</option>
|
|
1043
|
+
<option value="168">7 ${D(`days`)}</option>
|
|
1038
1044
|
</select>
|
|
1039
1045
|
</div>
|
|
1040
1046
|
</div>
|
|
1041
1047
|
|
|
1042
1048
|
<div class="quickforge-settings-row">
|
|
1043
1049
|
<div class="quickforge-settings-row-main">
|
|
1044
|
-
<div class="quickforge-settings-row-title">${
|
|
1045
|
-
<div class="quickforge-settings-row-description">${
|
|
1050
|
+
<div class="quickforge-settings-row-title">${D(`lanAccessActions`)}</div>
|
|
1051
|
+
<div class="quickforge-settings-row-description">${D(`lanAccessActionsDescription`)}</div>
|
|
1046
1052
|
</div>
|
|
1047
1053
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
1048
1054
|
<button class="quickforge-settings-button quickforge-settings-button-primary" type="button" ?disabled=${this.saving} @click=${()=>this.saveSettings()}>
|
|
1049
|
-
${this.saving?
|
|
1055
|
+
${this.saving?D(`saving`):D(`save`)}
|
|
1050
1056
|
</button>
|
|
1051
1057
|
<button class="quickforge-settings-button quickforge-settings-button-danger" type="button" ?disabled=${this.saving} @click=${()=>this.revokeAll()}>
|
|
1052
|
-
${
|
|
1058
|
+
${D(`lanAccessRevokeAll`)}
|
|
1053
1059
|
</button>
|
|
1054
1060
|
</div>
|
|
1055
1061
|
</div>
|
|
@@ -1058,7 +1064,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1058
1064
|
${this.message?_`<div class="quickforge-settings-message">${this.message}</div>`:null}
|
|
1059
1065
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
1060
1066
|
</div>
|
|
1061
|
-
`}},
|
|
1067
|
+
`}},U=`quickforge-lan-access-settings-tab`;customElements.get(U)||customElements.define(U,lt);function ut(){return document.createElement(U)}var dt=18e4,ft=3e4,pt=1e3,mt=`https://github.com/shawnstack/quickforge/releases/latest`;function W(){if(typeof document>`u`)return!1;let e=window;return document.body.classList.contains(`quickforge-desktop-app`)||e.__quickforgeDesktopApp===!0}function ht(e){return new Promise(t=>window.setTimeout(t,e))}var gt=[{value:`startup`,label:()=>D(`frequencyStartup`)},{value:`daily`,label:()=>D(`frequencyDaily`)},{value:`weekly`,label:()=>D(`frequencyWeekly`)},{value:`off`,label:()=>D(`frequencyOff`)}],_t=class extends v{about;updateInfo;loading=!0;checking=!1;updating=!1;restarting=!1;message=``;error=``;frequency=ae.frequency;lastCheckAt=null;serviceStatus;getTabName(){return D(`about`)}async connectedCallback(){super.connectedCallback(),await this.loadAbout()}async loadAbout(){this.loading=!0,this.error=``,this.requestUpdate();try{let e=await fetch(`/api/system/about`,{cache:`no-store`}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||D(`requestFailed`));this.about=t;try{let[e,t]=await Promise.all([Te(y()),this.loadServiceStatus()]);this.frequency=e.frequency,this.lastCheckAt=e.lastCheckAt,this.serviceStatus=t}catch{}}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}async loadServiceStatus(){let e=await fetch(`/api/health`,{cache:`no-store`}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||D(`requestFailed`));return t}async checkUpdate(){if(!(this.checking||this.updating)){if(W()){window.open(mt,`_blank`,`noopener,noreferrer`),this.message=D(`desktopUpdateHint`),this.error=``,this.requestUpdate();return}this.checking=!0,this.message=``,this.error=``,this.requestUpdate();try{let e=await fetch(`/api/system/update/check`,{cache:`no-store`}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||D(`updateCheckFailed`));this.updateInfo=t,this.about=t,this.updateInfo.updateAvailable?this.message=D(`updateAvailableMessage`,{current:this.updateInfo.currentVersion,latest:this.updateInfo.latestVersion}):this.updateInfo.localVersionIsNewer?this.message=D(`localVersionNewerMessage`,{current:this.updateInfo.currentVersion,latest:this.updateInfo.latestVersion}):this.message=D(`alreadyLatestVersion`,{version:this.updateInfo.currentVersion})}catch(e){this.error=e instanceof Error?e.message:D(`updateCheckFailed`)}finally{this.checking=!1,this.requestUpdate()}}}async pollUntilUpdated(e){let t=Date.now();for(;Date.now()-t<dt;){await ht(pt);try{let t=await fetch(`/api/health?updatePoll=${Date.now()}`,{cache:`no-store`}),n=await t.json().catch(()=>null);if(t.ok&&n?.ok&&n.bootId&&n.bootId!==e){this.message=D(`updateRestarted`),this.requestUpdate(),window.setTimeout(()=>window.location.reload(),300);return}}catch{}}throw Error(D(`updateRestartTimeout`))}async pollUntilRestarted(e){let t=Date.now();for(;Date.now()-t<ft;){await ht(pt);try{let t=await fetch(`/api/health?restartPoll=${Date.now()}`,{cache:`no-store`}),n=await t.json().catch(()=>null);if(t.ok&&n?.ok&&n.bootId&&n.bootId!==e){this.message=D(`backendRestarted`),this.requestUpdate(),window.setTimeout(()=>window.location.reload(),300);return}}catch{}}throw Error(D(`backendRestartTimeout`))}async restartService(){if(!this.serviceStatus||this.restarting||!await C({description:D(`restartBackendConfirm`),confirmLabel:D(`restartBackendService`),cancelLabel:D(`cancel`)}))return;this.restarting=!0,this.message=D(`backendRestarting`),this.error=``,this.requestUpdate();let e=this.serviceStatus.bootId;try{let t=await fetch(`/api/system/restart`,{method:`POST`,headers:{"x-quickforge-action":`restart`}}),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error||D(`backendRestartFailed`));await this.pollUntilRestarted(e)}catch(e){this.error=e instanceof Error?e.message:D(`backendRestartFailed`),this.message=``,this.restarting=!1,this.requestUpdate()}}async updateQuickForge(){if(W()){window.open(mt,`_blank`,`noopener,noreferrer`),this.message=D(`desktopUpdateHint`),this.error=``,this.requestUpdate();return}if(!(!this.updateInfo?.updateAvailable||this.updating)&&await C({description:D(`updateConfirm`,{command:this.updateInfo.installCommand}),confirmLabel:D(`updateRuntimeNow`),cancelLabel:D(`cancel`)})){this.updating=!0,this.message=D(`updatingQuickForge`),this.error=``,this.requestUpdate();try{let e=await fetch(`/api/system/update`,{method:`POST`,headers:{"x-quickforge-action":`update`}}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error||D(`updateFailed`));if(this.updateInfo=t,t?.updateStarted){let e=t.logFile?` ${D(`updateLogFile`,{path:t.logFile})}`:``;this.message=`${D(`updateStarted`)}${e}`,this.requestUpdate(),await this.pollUntilUpdated(t.bootId)}else this.message=t?.updated?D(`updateCompleted`):D(`alreadyLatestVersion`,{version:t?.currentVersion||this.about?.version||`-`}),this.updating=!1}catch(e){this.error=e instanceof Error?e.message:D(`updateFailed`),this.message=``,this.updating=!1}finally{this.requestUpdate()}}}async selectFrequency(e){if(this.frequency!==e){this.frequency=e,this.requestUpdate();try{let t=y();await me(t,{...await Te(t),frequency:e}),this.error=``}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.requestUpdate()}}}renderFrequencyOption(e){let t=this.frequency===e.value;return _`
|
|
1062
1068
|
<button
|
|
1063
1069
|
type="button"
|
|
1064
1070
|
class="quickforge-settings-segmented-option ${t?`quickforge-settings-segmented-option-active`:``}"
|
|
@@ -1070,22 +1076,22 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1070
1076
|
`}infoRows(){let e=this.about;return e?_`
|
|
1071
1077
|
<div class="quickforge-settings-row">
|
|
1072
1078
|
<div class="quickforge-settings-row-main">
|
|
1073
|
-
<div class="quickforge-settings-row-title">${
|
|
1074
|
-
<div class="quickforge-settings-row-description">${
|
|
1079
|
+
<div class="quickforge-settings-row-title">${D(`packageName`)}</div>
|
|
1080
|
+
<div class="quickforge-settings-row-description">${D(`packageNameDescription`)}</div>
|
|
1075
1081
|
</div>
|
|
1076
1082
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.name}</div>
|
|
1077
1083
|
</div>
|
|
1078
1084
|
<div class="quickforge-settings-row">
|
|
1079
1085
|
<div class="quickforge-settings-row-main">
|
|
1080
|
-
<div class="quickforge-settings-row-title">${
|
|
1081
|
-
<div class="quickforge-settings-row-description">${
|
|
1086
|
+
<div class="quickforge-settings-row-title">${D(`currentVersion`)}</div>
|
|
1087
|
+
<div class="quickforge-settings-row-description">${D(`currentVersionDescription`)}</div>
|
|
1082
1088
|
</div>
|
|
1083
1089
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${e.version}</div>
|
|
1084
1090
|
</div>
|
|
1085
1091
|
<div class="quickforge-settings-row">
|
|
1086
1092
|
<div class="quickforge-settings-row-main">
|
|
1087
|
-
<div class="quickforge-settings-row-title">${
|
|
1088
|
-
<div class="quickforge-settings-row-description">${
|
|
1093
|
+
<div class="quickforge-settings-row-title">${D(`github`)}</div>
|
|
1094
|
+
<div class="quickforge-settings-row-description">${D(`githubDescription`)}</div>
|
|
1089
1095
|
</div>
|
|
1090
1096
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-readonly-value">
|
|
1091
1097
|
<a class="quickforge-settings-link" href=${e.repositoryUrl} target="_blank" rel="noreferrer">
|
|
@@ -1096,32 +1102,32 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1096
1102
|
`:null}updateStatus(){return this.updateInfo?_`
|
|
1097
1103
|
<div class="quickforge-settings-row">
|
|
1098
1104
|
<div class="quickforge-settings-row-main">
|
|
1099
|
-
<div class="quickforge-settings-row-title">${
|
|
1100
|
-
<div class="quickforge-settings-row-description">${
|
|
1105
|
+
<div class="quickforge-settings-row-title">${D(`latestVersion`)}</div>
|
|
1106
|
+
<div class="quickforge-settings-row-description">${D(`latestVersionDescription`)}</div>
|
|
1101
1107
|
</div>
|
|
1102
1108
|
<div class="quickforge-settings-row-control quickforge-settings-readonly-value">${this.updateInfo.latestVersion}</div>
|
|
1103
1109
|
</div>
|
|
1104
1110
|
${this.updateInfo.logFile?_`
|
|
1105
1111
|
<div class="quickforge-settings-row">
|
|
1106
1112
|
<div class="quickforge-settings-row-main">
|
|
1107
|
-
<div class="quickforge-settings-row-title">${
|
|
1108
|
-
<div class="quickforge-settings-row-description">${
|
|
1113
|
+
<div class="quickforge-settings-row-title">${D(`updateLog`)}</div>
|
|
1114
|
+
<div class="quickforge-settings-row-description">${D(`updateLogDescription`)}</div>
|
|
1109
1115
|
</div>
|
|
1110
1116
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-readonly-value">
|
|
1111
1117
|
<code>${this.updateInfo.logFile}</code>
|
|
1112
1118
|
</div>
|
|
1113
1119
|
</div>
|
|
1114
1120
|
`:null}
|
|
1115
|
-
`:null}restartSection(){let e=this.serviceStatus?.restartUnsupportedReason||
|
|
1116
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
1121
|
+
`:null}restartSection(){let e=this.serviceStatus?.restartUnsupportedReason||D(`backendRestartUnsupported`),t=this.restarting||!this.serviceStatus?.restartSupported;return _`
|
|
1122
|
+
<section class="quickforge-settings-section" aria-label=${D(`restartBackendService`)}>
|
|
1117
1123
|
<div class="quickforge-settings-row">
|
|
1118
1124
|
<div class="quickforge-settings-row-main">
|
|
1119
1125
|
<div class="quickforge-settings-row-title">
|
|
1120
|
-
${
|
|
1121
|
-
<quickforge-info-tip .label=${
|
|
1126
|
+
${D(`restartBackendService`)}
|
|
1127
|
+
<quickforge-info-tip .label=${D(`restartBackendServiceDescription`)}></quickforge-info-tip>
|
|
1122
1128
|
</div>
|
|
1123
1129
|
<div class="quickforge-settings-row-description">
|
|
1124
|
-
${this.serviceStatus?.restartSupported?
|
|
1130
|
+
${this.serviceStatus?.restartSupported?D(`restartBackendServiceDescription`):e}
|
|
1125
1131
|
</div>
|
|
1126
1132
|
</div>
|
|
1127
1133
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
@@ -1131,32 +1137,32 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1131
1137
|
?disabled=${t}
|
|
1132
1138
|
@click=${()=>this.restartService()}
|
|
1133
1139
|
>
|
|
1134
|
-
${this.restarting?
|
|
1140
|
+
${this.restarting?D(`backendRestarting`):D(`restartBackendService`)}
|
|
1135
1141
|
</button>
|
|
1136
1142
|
</div>
|
|
1137
1143
|
</div>
|
|
1138
1144
|
</section>
|
|
1139
|
-
`}render(){if(this.loading)return _`<div class="text-sm text-muted-foreground">${
|
|
1145
|
+
`}render(){if(this.loading)return _`<div class="text-sm text-muted-foreground">${D(`loading`)}</div>`;let e=this.checking||this.updating||!this.updateInfo?.updateAvailable,t=W();return _`
|
|
1140
1146
|
<div class="quickforge-settings-stack">
|
|
1141
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
1147
|
+
<section class="quickforge-settings-section" aria-label=${D(`projectInfo`)}>
|
|
1142
1148
|
${this.infoRows()}
|
|
1143
1149
|
</section>
|
|
1144
1150
|
|
|
1145
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
1151
|
+
<section class="quickforge-settings-section" aria-label=${D(t?`desktopUpdates`:`runtimeUpdates`)}>
|
|
1146
1152
|
${t?null:_`
|
|
1147
1153
|
<div class="quickforge-settings-row">
|
|
1148
1154
|
<div class="quickforge-settings-row-main">
|
|
1149
1155
|
<div class="quickforge-settings-row-title">
|
|
1150
|
-
${
|
|
1151
|
-
<quickforge-info-tip .label=${
|
|
1156
|
+
${D(`updateFrequencySection`)}
|
|
1157
|
+
<quickforge-info-tip .label=${D(`updateFrequencyDescription`)}></quickforge-info-tip>
|
|
1152
1158
|
</div>
|
|
1153
1159
|
<div class="quickforge-settings-row-description">
|
|
1154
|
-
${this.lastCheckAt?
|
|
1160
|
+
${this.lastCheckAt?D(`lastCheckedAt`,{time:new Date(this.lastCheckAt).toLocaleString(ye())}):D(`lastCheckedNever`)}
|
|
1155
1161
|
</div>
|
|
1156
1162
|
</div>
|
|
1157
1163
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
1158
|
-
<div class="quickforge-settings-segmented quickforge-settings-segmented-wrap" role="group" aria-label=${
|
|
1159
|
-
${
|
|
1164
|
+
<div class="quickforge-settings-segmented quickforge-settings-segmented-wrap" role="group" aria-label=${D(`updateFrequencySection`)}>
|
|
1165
|
+
${gt.map(e=>this.renderFrequencyOption(e))}
|
|
1160
1166
|
</div>
|
|
1161
1167
|
</div>
|
|
1162
1168
|
</div>
|
|
@@ -1167,11 +1173,11 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1167
1173
|
<div class="quickforge-settings-row">
|
|
1168
1174
|
<div class="quickforge-settings-row-main">
|
|
1169
1175
|
<div class="quickforge-settings-row-title">
|
|
1170
|
-
${
|
|
1171
|
-
<quickforge-info-tip .label=${
|
|
1176
|
+
${D(t?`desktopUpdates`:`runtimeUpdates`)}
|
|
1177
|
+
<quickforge-info-tip .label=${D(t?`desktopUpdatesDescription`:`runtimeUpdatesDescription`)}></quickforge-info-tip>
|
|
1172
1178
|
</div>
|
|
1173
1179
|
<div class="quickforge-settings-row-description">
|
|
1174
|
-
${
|
|
1180
|
+
${D(t?`desktopUpdatesDescription`:`runtimeUpdatesDescription`)}
|
|
1175
1181
|
</div>
|
|
1176
1182
|
</div>
|
|
1177
1183
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
@@ -1181,7 +1187,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1181
1187
|
?disabled=${this.checking||this.updating}
|
|
1182
1188
|
@click=${()=>this.checkUpdate()}
|
|
1183
1189
|
>
|
|
1184
|
-
${this.checking?
|
|
1190
|
+
${this.checking?D(`checkingUpdate`):D(t?`openDesktopReleases`:`checkRuntimeUpdate`)}
|
|
1185
1191
|
</button>
|
|
1186
1192
|
${t?null:_`
|
|
1187
1193
|
<button
|
|
@@ -1190,7 +1196,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1190
1196
|
?disabled=${e}
|
|
1191
1197
|
@click=${()=>this.updateQuickForge()}
|
|
1192
1198
|
>
|
|
1193
|
-
${this.updating?
|
|
1199
|
+
${this.updating?D(`updatingQuickForge`):D(`updateRuntimeNow`)}
|
|
1194
1200
|
</button>
|
|
1195
1201
|
`}
|
|
1196
1202
|
</div>
|
|
@@ -1202,19 +1208,19 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1202
1208
|
${this.message?_`<div class="quickforge-settings-message">${this.message}</div>`:null}
|
|
1203
1209
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
1204
1210
|
</div>
|
|
1205
|
-
`}},
|
|
1211
|
+
`}},G=`quickforge-about-settings-tab`;customElements.get(G)||customElements.define(G,_t);function vt(){return document.createElement(G)}var yt=class extends v{loading=!0;saving=!1;saved=!1;error=``;message=``;projects=[];project;commandDir=``;commands=[];loadingCommands=!1;saveTimer=null;lastSavedCommandDir=``;pendingSaveAfterCurrent=!1;getTabName(){return D(`projectCommands`)}async connectedCallback(){super.connectedCallback(),await this.loadProjects()}async request(e,t){let n=await fetch(e,{...t,cache:`no-store`,headers:{...t?.body?{"content-type":`application/json`}:void 0,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||D(`requestFailed`));return r}async loadProjects(){this.loading=!0,this.error=``,this.requestUpdate();try{let e=await this.request(`/api/project`);this.projects=e?.projects??(e?.project?[e.project]:[]),this.project=e?.project??this.projects[0],this.commandDir=typeof this.project?.commandDir==`string`?this.project.commandDir:``,this.lastSavedCommandDir=this.commandDir,await this.loadCommands()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}selectProject(e){this.clearSaveTimer();let t=e.target,n=this.projects.find(e=>e.id===t.value);n&&(this.project=n,this.commandDir=typeof n.commandDir==`string`?n.commandDir:``,this.lastSavedCommandDir=this.commandDir,this.saved=!1,this.message=``,this.error=``,this.commands=[],this.requestUpdate(),this.loadCommands())}async loadCommands(){if(this.project?.id){this.loadingCommands=!0,this.requestUpdate();try{let e=await this.request(`/api/project/commands?projectId=${encodeURIComponent(this.project.id)}`);this.commands=e?.commands??[]}catch{this.commands=[]}finally{this.loadingCommands=!1,this.requestUpdate()}}}updateCommandDir(e){this.commandDir=e,this.saved=!1,this.message=``,this.scheduleSave(),this.requestUpdate()}clearSaveTimer(){this.saveTimer!==null&&(window.clearTimeout(this.saveTimer),this.saveTimer=null)}scheduleSave(){this.clearSaveTimer(),this.saveTimer=window.setTimeout(()=>{this.saveTimer=null,this.save()},800)}disconnectedCallback(){this.clearSaveTimer(),super.disconnectedCallback()}async save(){if(!this.project)return;if(this.saving){this.pendingSaveAfterCurrent=!0;return}let e=this.project.id,t=this.commandDir;if(t!==this.lastSavedCommandDir){this.saving=!0,this.saved=!1,this.error=``,this.message=``,this.requestUpdate();try{let n=await this.request(`/api/project/${encodeURIComponent(e)}/command-dir`,{method:`PUT`,body:JSON.stringify({commandDir:t})});if(this.project?.id===e){if(this.project=n?.project??this.project,this.project){let e=this.projects.findIndex(e=>e.id===this.project.id);e>=0&&(this.projects[e]=this.project)}this.commandDir=typeof this.project?.commandDir==`string`?this.project.commandDir:t,this.lastSavedCommandDir=this.commandDir,this.saved=!0,await this.loadCommands()}}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.saving=!1,this.pendingSaveAfterCurrent&&(this.pendingSaveAfterCurrent=!1,this.scheduleSave()),this.requestUpdate()}}}async openCommandDir(){if(this.project){this.error=``,this.message=``,this.requestUpdate();try{await this.request(`/api/project/open-path`,{method:`POST`,body:JSON.stringify({path:`.ai/commands`,projectId:this.project.id})})}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`),this.requestUpdate()}}}async createCommand(){if(!this.project)return;let e=window.prompt(D(`newCommandPrompt`));if(e?.trim()){this.error=``,this.message=``,this.requestUpdate();try{let t=await this.request(`/api/project/command`,{method:`POST`,body:JSON.stringify({name:e.trim(),projectId:this.project.id})});t.ok?(this.message=D(`commandCreated`,{name:t.name??e.trim()}),await this.loadCommands()):t.reason===`exists`?this.error=D(`commandAlreadyExists`,{name:t.name??e.trim()}):this.error=D(`invalidCommandName`)}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.requestUpdate()}}}render(){return this.loading?_`<div class="quickforge-settings-note">${D(`loading`)}</div>`:this.projects.length===0?_`
|
|
1206
1212
|
<div class="quickforge-settings-stack">
|
|
1207
|
-
<div class="quickforge-settings-note">${
|
|
1213
|
+
<div class="quickforge-settings-note">${D(`selectProjectForCommands`)}</div>
|
|
1208
1214
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
1209
1215
|
</div>
|
|
1210
1216
|
`:_`
|
|
1211
1217
|
<div class="quickforge-settings-stack">
|
|
1212
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
1218
|
+
<section class="quickforge-settings-section" aria-label=${D(`projectCommands`)}>
|
|
1213
1219
|
<div class="quickforge-settings-row">
|
|
1214
1220
|
<div class="quickforge-settings-row-main">
|
|
1215
|
-
<div class="quickforge-settings-row-title">${
|
|
1221
|
+
<div class="quickforge-settings-row-title">${D(`project`)}</div>
|
|
1216
1222
|
<div class="quickforge-settings-row-description">
|
|
1217
|
-
${this.project?.path?this.project.path:
|
|
1223
|
+
${this.project?.path?this.project.path:D(`projectCommandsProjectDescription`)}
|
|
1218
1224
|
</div>
|
|
1219
1225
|
</div>
|
|
1220
1226
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
@@ -1231,16 +1237,16 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1231
1237
|
<div class="quickforge-settings-row quickforge-settings-row-align-start">
|
|
1232
1238
|
<div class="quickforge-settings-row-main">
|
|
1233
1239
|
<div class="quickforge-settings-row-title">
|
|
1234
|
-
${
|
|
1235
|
-
<quickforge-info-tip .label=${
|
|
1240
|
+
${D(`commandDirectories`)}
|
|
1241
|
+
<quickforge-info-tip .label=${D(`commandDirectoryHelp`)}></quickforge-info-tip>
|
|
1236
1242
|
</div>
|
|
1237
|
-
<div class="quickforge-settings-row-description">${
|
|
1243
|
+
<div class="quickforge-settings-row-description">${D(`commandDirectoriesDescription`)}</div>
|
|
1238
1244
|
</div>
|
|
1239
1245
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
1240
1246
|
<textarea
|
|
1241
1247
|
class="quickforge-settings-textarea quickforge-settings-mono"
|
|
1242
1248
|
.value=${this.commandDir}
|
|
1243
|
-
placeholder=${
|
|
1249
|
+
placeholder=${D(`commandDirectoryPlaceholder`)}
|
|
1244
1250
|
@input=${e=>this.updateCommandDir(e.target.value)}
|
|
1245
1251
|
></textarea>
|
|
1246
1252
|
</div>
|
|
@@ -1248,8 +1254,8 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1248
1254
|
|
|
1249
1255
|
<div class="quickforge-settings-row quickforge-settings-row-align-start">
|
|
1250
1256
|
<div class="quickforge-settings-row-main">
|
|
1251
|
-
<div class="quickforge-settings-row-title">${
|
|
1252
|
-
<div class="quickforge-settings-row-description">${
|
|
1257
|
+
<div class="quickforge-settings-row-title">${D(`commandDirectoryExamples`)}</div>
|
|
1258
|
+
<div class="quickforge-settings-row-description">${D(`commandDirectoryExamplesDescription`)}</div>
|
|
1253
1259
|
</div>
|
|
1254
1260
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-code-list">
|
|
1255
1261
|
<code>.ai/commands</code>
|
|
@@ -1260,11 +1266,11 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1260
1266
|
</div>
|
|
1261
1267
|
</section>
|
|
1262
1268
|
|
|
1263
|
-
<section class="quickforge-settings-section" aria-label=${
|
|
1269
|
+
<section class="quickforge-settings-section" aria-label=${D(`loadedCommands`,{count:this.commands.length})}>
|
|
1264
1270
|
<div class="quickforge-settings-row">
|
|
1265
1271
|
<div class="quickforge-settings-row-main">
|
|
1266
|
-
<div class="quickforge-settings-row-title">${
|
|
1267
|
-
<div class="quickforge-settings-row-description">${
|
|
1272
|
+
<div class="quickforge-settings-row-title">${D(`loadedCommands`,{count:this.commands.length})}</div>
|
|
1273
|
+
<div class="quickforge-settings-row-description">${D(`loadedCommandsDescription`)}</div>
|
|
1268
1274
|
</div>
|
|
1269
1275
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
1270
1276
|
<button
|
|
@@ -1273,7 +1279,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1273
1279
|
?disabled=${this.loadingCommands}
|
|
1274
1280
|
@click=${()=>this.openCommandDir()}
|
|
1275
1281
|
>
|
|
1276
|
-
${
|
|
1282
|
+
${D(`openCommandDir`)}
|
|
1277
1283
|
</button>
|
|
1278
1284
|
<button
|
|
1279
1285
|
class="quickforge-settings-button quickforge-settings-button-primary"
|
|
@@ -1281,20 +1287,20 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1281
1287
|
?disabled=${this.loadingCommands}
|
|
1282
1288
|
@click=${()=>this.createCommand()}
|
|
1283
1289
|
>
|
|
1284
|
-
${
|
|
1290
|
+
${D(`createCommand`)}
|
|
1285
1291
|
</button>
|
|
1286
1292
|
</div>
|
|
1287
1293
|
</div>
|
|
1288
1294
|
|
|
1289
1295
|
<div class="quickforge-settings-nested-list">
|
|
1290
|
-
${this.loadingCommands?_`<div class="quickforge-settings-empty-row">${
|
|
1296
|
+
${this.loadingCommands?_`<div class="quickforge-settings-empty-row">${D(`loading`)}</div>`:this.commands.length===0?_`<div class="quickforge-settings-empty-row">${D(`noCommandsLoaded`)}</div>`:this.commands.map(e=>{let t=e.argumentHint?` ${e.argumentHint}`:``;return _`
|
|
1291
1297
|
<div class="quickforge-settings-subrow">
|
|
1292
1298
|
<div class="quickforge-settings-row-main">
|
|
1293
1299
|
<div class="quickforge-settings-row-title">
|
|
1294
1300
|
<code class="quickforge-settings-command-name">/${e.name}${t}</code>
|
|
1295
1301
|
</div>
|
|
1296
1302
|
<div class="quickforge-settings-row-description">
|
|
1297
|
-
${e.description||
|
|
1303
|
+
${e.description||D(`noDescription`)}
|
|
1298
1304
|
</div>
|
|
1299
1305
|
</div>
|
|
1300
1306
|
${e.relativePath?_`<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-readonly-value">${e.relativePath}</div>`:null}
|
|
@@ -1303,19 +1309,19 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1303
1309
|
</div>
|
|
1304
1310
|
</section>
|
|
1305
1311
|
|
|
1306
|
-
${this.saving?_`<div class="quickforge-settings-note">${
|
|
1307
|
-
${this.saved?_`<div class="quickforge-settings-message">${
|
|
1312
|
+
${this.saving?_`<div class="quickforge-settings-note">${D(`saving`)}</div>`:null}
|
|
1313
|
+
${this.saved?_`<div class="quickforge-settings-message">${D(`projectCommandsSaved`)}</div>`:null}
|
|
1308
1314
|
${this.message?_`<div class="quickforge-settings-message">${this.message}</div>`:null}
|
|
1309
1315
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
1310
1316
|
</div>
|
|
1311
|
-
`}},
|
|
1317
|
+
`}},K=`quickforge-project-commands-settings-tab`;customElements.get(K)||customElements.define(K,yt);function bt(){return document.createElement(K)}var q={"x-quickforge-action":`channel-action`};function xt(e){switch(e){case`running`:return`quickforge-settings-badge-success`;case`waiting_scan`:case`starting`:case`stopping`:return`quickforge-settings-badge-warning`;case`error`:return`quickforge-settings-badge-danger`;default:return`quickforge-settings-badge-muted`}}function St(e){switch(e){case`starting`:return D(`channelStatusStarting`);case`waiting_scan`:return D(`channelStatusWaitingScan`);case`running`:return D(`channelStatusRunning`);case`stopping`:return D(`channelStatusStopping`);case`error`:return D(`channelStatusError`);default:return D(`channelStatusStopped`)}}function Ct(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}var wt=class extends v{loading=!0;channels=[];workspaces=[];selectedWorkspaceIdByChannel={};error=``;message=``;eventSource;busyChannelId=``;getTabName(){return D(`channels`)}async connectedCallback(){super.connectedCallback(),await Promise.all([this.loadChannels(),this.loadWorkspaces()]),this.connectEvents()}disconnectedCallback(){this.eventSource?.close(),this.eventSource=void 0,super.disconnectedCallback()}async request(e,t){let n=await fetch(e,{...t,cache:`no-store`,headers:{...t?.headers||{}}}),r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error||D(`requestFailed`));return r}async loadChannels(){this.loading=!0,this.error=``,this.requestUpdate();try{let e=await this.request(`/api/channels`);this.channels=Array.isArray(e.channels)?e.channels:[],this.ensureWorkspaceSelections()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.loading=!1,this.requestUpdate()}}async loadWorkspaces(){try{let e=await this.request(`/api/project`),t=e.defaultWorkspaceRoot||``,n=t?[{id:`default`,name:D(`channelDefaultWorkspace`),path:t,kind:`default`}]:[],r=(Array.isArray(e.projects)?e.projects:[]).map(e=>({id:e.id,name:e.name,path:e.path,kind:`project`}));this.workspaces=[...n,...r],this.ensureWorkspaceSelections()}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.requestUpdate()}}ensureWorkspaceSelections(){let e=new Set(this.workspaces.map(e=>e.id)),t={...this.selectedWorkspaceIdByChannel};for(let n of this.channels){if(!n.supportsWorkspaceSelection)continue;let r=t[n.id],i=n.launchWorkspace?.id,a=n.status!==`stopped`&&n.status!==`error`;if(i&&e.has(i)&&a){t[n.id]=i;continue}r&&e.has(r)||(t[n.id]=i&&e.has(i)?i:`default`)}this.selectedWorkspaceIdByChannel=t}connectEvents(){this.eventSource?.close();let e=new EventSource(`/api/channels/events`);this.eventSource=e;let t=e=>{try{let t=JSON.parse(e.data);this.applyChannelEvent(t)}catch{}};e.addEventListener(`snapshot`,t),e.addEventListener(`status`,t),e.addEventListener(`log`,t),e.addEventListener(`qrcode`,t),e.addEventListener(`error`,()=>{})}applyChannelEvent(e){if(Array.isArray(e.channels)){this.channels=e.channels,this.ensureWorkspaceSelections(),this.requestUpdate();return}if(e.snapshot){this.upsertChannel(e.snapshot);return}if(e.channelId&&e.log){let t=this.channels.find(t=>t.id===e.channelId);t&&(t.logs=[...t.logs||[],e.log].slice(-300),this.requestUpdate())}}upsertChannel(e){let t=this.channels.findIndex(t=>t.id===e.id);t>=0?this.channels=[...this.channels.slice(0,t),e,...this.channels.slice(t+1)]:this.channels=[...this.channels,e],this.ensureWorkspaceSelections(),this.requestUpdate()}selectedWorkspaceId(e){return this.selectedWorkspaceIdByChannel[e.id]||e.launchWorkspace?.id||`default`}handleWorkspaceChange(e,t){let n=t.currentTarget;n&&(this.selectedWorkspaceIdByChannel={...this.selectedWorkspaceIdByChannel,[e.id]:n.value||`default`},this.requestUpdate())}startOptions(e){return e.supportsWorkspaceSelection?{projectId:this.selectedWorkspaceId(e)}:void 0}async invoke(e,t){if(!this.busyChannelId&&!(t===`restart`&&!await C({description:D(`channelRestartConfirm`,{name:e.name}),confirmLabel:D(`restart`),cancelLabel:D(`cancel`)}))){this.busyChannelId=e.id,this.error=``,this.message=``,this.requestUpdate();try{let n=t===`start`||t===`restart`?this.startOptions(e):void 0,r=await this.request(`/api/channels/${encodeURIComponent(e.id)}/${t}`,{method:`POST`,headers:n?{...q,"content-type":`application/json`}:q,body:n?JSON.stringify(n):void 0});this.upsertChannel(r)}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.busyChannelId=``,this.requestUpdate()}}}async invokeAction(e,t){if(!this.busyChannelId&&!((t.destructive||t.id===`relogin`)&&!await C({description:t.id===`relogin`?D(`channelReloginConfirm`,{name:e.name}):D(`channelLogoutConfirm`,{name:e.name}),confirmLabel:t.label,cancelLabel:D(`cancel`),variant:t.destructive?`destructive`:void 0}))){this.busyChannelId=e.id,this.error=``,this.message=``,this.requestUpdate();try{let n=t.id===`relogin`?this.startOptions(e):void 0,r=await this.request(`/api/channels/${encodeURIComponent(e.id)}/actions/${encodeURIComponent(t.id)}`,{method:`POST`,headers:n?{...q,"content-type":`application/json`}:q,body:n?JSON.stringify(n):void 0});this.upsertChannel(r)}catch(e){this.error=e instanceof Error?e.message:D(`requestFailed`)}finally{this.busyChannelId=``,this.requestUpdate()}}}workspaceSection(e,t){if(!e.supportsWorkspaceSelection)return null;let n=this.selectedWorkspaceId(e),r=e.launchWorkspace;return _`
|
|
1312
1318
|
<div class="quickforge-settings-row quickforge-settings-row-align-start">
|
|
1313
1319
|
<div class="quickforge-settings-row-main">
|
|
1314
1320
|
<div class="quickforge-settings-row-title">
|
|
1315
|
-
${
|
|
1316
|
-
<quickforge-info-tip .label=${
|
|
1321
|
+
${D(`channelWorkspace`)}
|
|
1322
|
+
<quickforge-info-tip .label=${D(`channelWorkspaceDescription`)}></quickforge-info-tip>
|
|
1317
1323
|
</div>
|
|
1318
|
-
${r?_`<div class="quickforge-settings-row-description">${
|
|
1324
|
+
${r?_`<div class="quickforge-settings-row-description">${D(`channelCurrentWorkspace`)}: <span class="quickforge-settings-mono">${r.path}</span></div>`:_`<div class="quickforge-settings-row-description">${D(`channelWorkspaceDescription`)}</div>`}
|
|
1319
1325
|
</div>
|
|
1320
1326
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
1321
1327
|
<select
|
|
@@ -1325,19 +1331,19 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1325
1331
|
@change=${t=>this.handleWorkspaceChange(e,t)}
|
|
1326
1332
|
>
|
|
1327
1333
|
${this.workspaces.map(e=>_`
|
|
1328
|
-
<option value=${e.id}>${e.kind===`default`?
|
|
1334
|
+
<option value=${e.id}>${e.kind===`default`?D(`channelDefaultWorkspace`):e.name} — ${e.path}</option>
|
|
1329
1335
|
`)}
|
|
1330
1336
|
</select>
|
|
1331
1337
|
</div>
|
|
1332
1338
|
</div>
|
|
1333
1339
|
`}channelMeta(e){return _`
|
|
1334
1340
|
<div class="quickforge-settings-nested-list">
|
|
1335
|
-
${[[
|
|
1341
|
+
${[[D(`channelProvider`),e.provider||`-`],[D(`channelCommand`),e.commandLabel||`-`],[D(`channelPid`),e.pid?String(e.pid):`-`],[D(`channelStartedAt`),Ct(e.startedAt)]].map(([e,t])=>_`
|
|
1336
1342
|
<div class="quickforge-settings-subrow">
|
|
1337
1343
|
<div class="quickforge-settings-row-main">
|
|
1338
1344
|
<div class="quickforge-settings-row-title">${e}</div>
|
|
1339
1345
|
</div>
|
|
1340
|
-
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-readonly-value ${e===
|
|
1346
|
+
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide quickforge-settings-readonly-value ${e===D(`channelCommand`)?`quickforge-settings-mono`:``}">${t}</div>
|
|
1341
1347
|
</div>
|
|
1342
1348
|
`)}
|
|
1343
1349
|
</div>
|
|
@@ -1345,10 +1351,10 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1345
1351
|
<div class="quickforge-settings-row quickforge-settings-row-align-start">
|
|
1346
1352
|
<div class="quickforge-settings-row-main">
|
|
1347
1353
|
<div class="quickforge-settings-row-title">
|
|
1348
|
-
${
|
|
1349
|
-
<quickforge-info-tip .label=${
|
|
1354
|
+
${D(`channelQrTitle`)}
|
|
1355
|
+
<quickforge-info-tip .label=${D(`channelQrDescription`)}></quickforge-info-tip>
|
|
1350
1356
|
</div>
|
|
1351
|
-
<div class="quickforge-settings-row-description">${
|
|
1357
|
+
<div class="quickforge-settings-row-description">${D(`channelQrDescription`)}</div>
|
|
1352
1358
|
${e.qrCodeUrl?_`
|
|
1353
1359
|
<div class="quickforge-settings-meta">
|
|
1354
1360
|
<a class="quickforge-settings-link quickforge-settings-mono" href=${e.qrCodeUrl} target="_blank" rel="noreferrer">${e.qrCodeUrl}</a>
|
|
@@ -1359,7 +1365,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1359
1365
|
</div>
|
|
1360
1366
|
`}logsSection(e){let t=e.logs||[];return _`
|
|
1361
1367
|
<details class="quickforge-channel-logs" open>
|
|
1362
|
-
<summary class="quickforge-channel-logs-summary">${
|
|
1368
|
+
<summary class="quickforge-channel-logs-summary">${D(`channelRecentLogs`)}</summary>
|
|
1363
1369
|
<div class="quickforge-channel-logs-body">
|
|
1364
1370
|
${t.length?t.slice(-80).map(e=>_`
|
|
1365
1371
|
<div class="quickforge-channel-log-row">
|
|
@@ -1367,7 +1373,7 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1367
1373
|
<span class=${e.stream===`stderr`?`text-destructive/80`:`text-muted-foreground/70`}>${e.stream}</span>
|
|
1368
1374
|
<span class="min-w-0 whitespace-pre-wrap break-words text-foreground/85">${e.text}</span>
|
|
1369
1375
|
</div>
|
|
1370
|
-
`):_`<div class="quickforge-settings-empty-row">${
|
|
1376
|
+
`):_`<div class="quickforge-settings-empty-row">${D(`channelNoLogs`)}</div>`}
|
|
1371
1377
|
</div>
|
|
1372
1378
|
</details>
|
|
1373
1379
|
`}channelCard(e){let t=this.busyChannelId===e.id||!!e.activeAction,n=e.status===`running`||e.status===`waiting_scan`||e.status===`starting`,r=e.status===`stopping`,i=!!(e.supportsWorkspaceSelection&&this.workspaces.length===0);return _`
|
|
@@ -1376,15 +1382,15 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1376
1382
|
<div class="quickforge-settings-row-main">
|
|
1377
1383
|
<div class="quickforge-settings-row-title">
|
|
1378
1384
|
${e.name}
|
|
1379
|
-
<span class="quickforge-settings-badge ${
|
|
1385
|
+
<span class="quickforge-settings-badge ${xt(e.status)}">${St(e.status)}</span>
|
|
1380
1386
|
</div>
|
|
1381
1387
|
<div class="quickforge-settings-row-description">${e.description}</div>
|
|
1382
|
-
${e.requirements?.length?_`<div class="quickforge-settings-row-description">${
|
|
1388
|
+
${e.requirements?.length?_`<div class="quickforge-settings-row-description">${D(`channelRequirements`)}: ${e.requirements.join(` · `)}</div>`:null}
|
|
1383
1389
|
</div>
|
|
1384
1390
|
<div class="quickforge-settings-row-control quickforge-settings-row-control-wide">
|
|
1385
|
-
<button class="quickforge-settings-button quickforge-settings-button-primary" type="button" ?disabled=${t||n||r||i} @click=${()=>this.invoke(e,`start`)}>${
|
|
1386
|
-
<button class="quickforge-settings-button quickforge-settings-button-secondary" type="button" ?disabled=${t||!n||r} @click=${()=>this.invoke(e,`stop`)}>${
|
|
1387
|
-
<button class="quickforge-settings-button quickforge-settings-button-secondary" type="button" ?disabled=${t||r||i} @click=${()=>this.invoke(e,`restart`)}>${
|
|
1391
|
+
<button class="quickforge-settings-button quickforge-settings-button-primary" type="button" ?disabled=${t||n||r||i} @click=${()=>this.invoke(e,`start`)}>${D(`start`)}</button>
|
|
1392
|
+
<button class="quickforge-settings-button quickforge-settings-button-secondary" type="button" ?disabled=${t||!n||r} @click=${()=>this.invoke(e,`stop`)}>${D(`stop`)}</button>
|
|
1393
|
+
<button class="quickforge-settings-button quickforge-settings-button-secondary" type="button" ?disabled=${t||r||i} @click=${()=>this.invoke(e,`restart`)}>${D(`restart`)}</button>
|
|
1388
1394
|
${e.actions?.map(n=>_`
|
|
1389
1395
|
<button class="quickforge-settings-button ${n.destructive?`quickforge-settings-button-danger`:`quickforge-settings-button-secondary`}" type="button" ?disabled=${t} @click=${()=>this.invokeAction(e,n)}>${n.label}</button>
|
|
1390
1396
|
`)}
|
|
@@ -1392,21 +1398,21 @@ import{i as e}from"./rolldown-runtime-DWdDZTNf.js";import{A as t,Ft as n,It as r
|
|
|
1392
1398
|
</div>
|
|
1393
1399
|
|
|
1394
1400
|
${this.workspaceSection(e,t||n||r)}
|
|
1395
|
-
${i?_`<div class="quickforge-settings-alert quickforge-settings-warning-attached">${
|
|
1401
|
+
${i?_`<div class="quickforge-settings-alert quickforge-settings-warning-attached">${D(`channelNoWorkspaces`)}</div>`:null}
|
|
1396
1402
|
${this.channelMeta(e)}
|
|
1397
1403
|
${e.error?_`<div class="quickforge-settings-alert quickforge-settings-warning-attached">${e.error}</div>`:null}
|
|
1398
1404
|
${this.qrSection(e)}
|
|
1399
1405
|
${this.logsSection(e)}
|
|
1400
1406
|
</section>
|
|
1401
|
-
`}render(){return this.loading?_`<div class="quickforge-settings-note">${
|
|
1407
|
+
`}render(){return this.loading?_`<div class="quickforge-settings-note">${D(`loading`)}</div>`:_`
|
|
1402
1408
|
<div class="quickforge-settings-stack">
|
|
1403
1409
|
<section class="quickforge-settings-warning">
|
|
1404
|
-
${
|
|
1410
|
+
${D(`channelsSecurityWarning`)}
|
|
1405
1411
|
</section>
|
|
1406
1412
|
|
|
1407
|
-
${this.channels.length?_`${this.channels.map(e=>this.channelCard(e))}`:_`<div class="quickforge-settings-note">${
|
|
1413
|
+
${this.channels.length?_`${this.channels.map(e=>this.channelCard(e))}`:_`<div class="quickforge-settings-note">${D(`channelsEmpty`)}</div>`}
|
|
1408
1414
|
|
|
1409
1415
|
${this.message?_`<div class="quickforge-settings-message">${this.message}</div>`:null}
|
|
1410
1416
|
${this.error?_`<div class="quickforge-settings-alert">${this.error}</div>`:null}
|
|
1411
1417
|
</div>
|
|
1412
|
-
`}},
|
|
1418
|
+
`}},J=`quickforge-channels-settings-tab`;customElements.get(J)||customElements.define(J,wt);function Tt(){return document.createElement(J)}var Et=ne(),Y=te(),Dt=(0,k.lazy)(()=>b(()=>import(`./AgentProfilesPage-BtZpDV-3.js`).then(e=>({default:e.AgentProfilesPage})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Ot=(0,k.lazy)(()=>b(()=>import(`./mcp-servers-dialog-jHlDR9jP.js`).then(e=>({default:e.McpServersPanel})),__vite__mapDeps([12,1,2,3,4,5,6,7,8,9,10,11]))),kt=(0,k.lazy)(()=>b(()=>import(`./skills-dialog-DvSnPPzu.js`).then(e=>e.n).then(e=>({default:e.SkillsManagerPanel})),__vite__mapDeps([9,1,2,3,4,5,6,7,8,10,11]))),At=(0,k.lazy)(()=>b(()=>import(`./PluginsPage-CCIj8-Mn.js`).then(e=>({default:e.PluginsPage})),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,10,11,14]))),jt=(0,k.lazy)(()=>b(()=>import(`./ScheduledTasksPage-DIMewQ3i.js`).then(e=>({default:e.ScheduledTasksPage})),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9,10,11]))),Mt=class extends v{tabName=``;renderReact;root;getTabName(){return this.tabName}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>this.mountReact())}disconnectedCallback(){this.root?.unmount(),this.root=void 0,super.disconnectedCallback()}render(){return _`<div class="quickforge-react-settings-tab h-full min-h-0"></div>`}mountReact(){let e=this.querySelector(`.quickforge-react-settings-tab`);!e||!this.renderReact||(this.root??=(0,Et.createRoot)(e),this.root.render(this.renderReact()))}},X=`quickforge-react-settings-tab`;customElements.get(X)||customElements.define(X,Mt);function Z(e,t){let n=document.createElement(X);return n.tabName=e,n.renderReact=t,n}function Q({children:e}){return(0,Y.jsx)(`div`,{className:`quickforge-settings-stack h-full min-h-[30rem]`,children:(0,Y.jsx)(k.Suspense,{fallback:(0,Y.jsx)(`div`,{className:`quickforge-settings-note`,children:D(`loading`)}),children:e})})}function Nt(e){window.dispatchEvent(new CustomEvent(`quickforge:open-session-from-settings`,{detail:{sessionId:e}}))}function Pt(){return Z(D(`agentsTab`),()=>(0,Y.jsx)(Q,{children:(0,Y.jsx)(Dt,{})}))}function Ft(){return Z(D(`skills`),()=>(0,Y.jsx)(Q,{children:(0,Y.jsx)(kt,{active:!0,scope:`global`,embedded:!0,onSaved:()=>void 0})}))}function It(){return Z(D(`mcpServers`),()=>(0,Y.jsx)(Q,{children:(0,Y.jsx)(Ot,{active:!0})}))}function Lt(){return Z(D(`plugins`),()=>(0,Y.jsx)(Q,{children:(0,Y.jsx)(At,{})}))}function Rt(){return Z(D(`scheduledTasks`),()=>(0,Y.jsx)(Q,{children:(0,Y.jsx)(jt,{onOpenSession:Nt})}))}function zt(e){let t=[{key:`appearance`,tab:Ne(),getDescription:()=>D(`appearanceDescription`)},{key:`defaults`,tab:qe(),getDescription:()=>D(`defaultOptionsDescription`)},{key:`customModels`,tab:Ae(e),getDescription:()=>D(`customModelsDescription`)},{key:`agents`,tab:Pt(),getDescription:()=>D(`agentsDescription`)},{key:`skills`,tab:Ft(),getDescription:()=>D(`globalSkillsDescription`)},{key:`mcp`,tab:It(),getDescription:void 0},{key:`plugins`,tab:Lt(),getDescription:()=>D(`pluginsDescription`)},{key:`scheduledTasks`,tab:Rt(),getDescription:()=>D(`scheduledTasksDescription`)},{key:`projectCommands`,tab:bt(),getDescription:()=>D(`projectCommandsDescription`)},{key:`backup`,tab:rt(),getDescription:()=>D(`backupRestoreDescription`)},{key:`archivedConversations`,tab:st(),getDescription:()=>D(`archivedConversationsDescription`)},{key:`channels`,tab:Tt(),getDescription:()=>D(`channelsDescription`)},{key:`lanAccess`,tab:ut(),getDescription:()=>D(`lanAccessDescription`)},{key:`about`,tab:vt(),getDescription:()=>D(`aboutQuickForgeDescription`)}];return{items:[...t],tabs:t.map(e=>e.tab),indexOf:e=>t.findIndex(t=>t.key===e)}}var $={appearance:d,defaults:h,customModels:f,agents:t,skills:r,mcp:u,plugins:o,scheduledTasks:i,projectCommands:l,backup:g,archivedConversations:ee,channels:p,lanAccess:m,about:n};function Bt({tab:e}){let t=(0,k.useRef)(null);return(0,k.useEffect)(()=>{let n=t.current;if(n)return n.replaceChildren(e),()=>{e.parentNode===n&&n.removeChild(e)}},[e]),(0,Y.jsx)(`div`,{ref:t,className:`quickforge-settings-tab-host min-h-0 flex-1`})}function Vt({initialTab:e,customProvider:t,onBack:n}){let r=(0,k.useMemo)(()=>zt(t),[t]),i=Math.max(0,r.indexOf(e)),[o,s]=(0,k.useState)(),l=o??i,u=r.items[l]??r.items[0],d=u?.getDescription?.(),f=u?$[u.key]:void 0,[p,m]=(0,k.useState)(``),h=p.trim().toLowerCase(),g=(0,k.useMemo)(()=>r.items.map((e,t)=>({item:e,index:t})).filter(({item:e})=>h?[e.key,e.tab.getTabName(),e.getDescription?.()??``].join(` `).toLowerCase().includes(h):!0),[r.items,h]);return(0,Y.jsxs)(`div`,{className:`flex h-screen min-h-0 bg-[var(--quickforge-sidebar-bg)] text-foreground`,children:[(0,Y.jsxs)(`aside`,{className:`relative z-10 hidden w-80 shrink-0 overflow-hidden bg-[var(--quickforge-sidebar-bg)] md:flex md:min-h-0 md:flex-col`,children:[(0,Y.jsxs)(`div`,{className:`shrink-0 px-3 pb-2 pt-3`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:`group relative flex w-full items-center gap-2 overflow-hidden rounded-lg px-2 py-1.5 text-left text-muted-foreground/72 transition-[background-color,color,box-shadow] duration-160 ease-out hover:bg-[var(--quickforge-sidebar-hover-bg)] hover:text-foreground/86 hover:shadow-[0_8px_20px_-18px_rgb(15_23_42_/_0.35)]`,onClick:n,"aria-label":`返回工作区`,children:[(0,Y.jsx)(`span`,{className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground/55 transition-colors group-hover:text-foreground/70`,children:(0,Y.jsx)(a,{className:`size-4`})}),(0,Y.jsx)(`span`,{className:`truncate text-sm leading-5`,children:`返回工作区`})]}),(0,Y.jsxs)(`div`,{className:`quickforge-settings-inline-field mt-3`,children:[(0,Y.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground/60`,"aria-hidden":`true`}),(0,Y.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:D(`searchSettings`),"aria-label":D(`searchSettings`),className:`quickforge-settings-input`})]})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 pb-4 pt-4`,children:(0,Y.jsxs)(`nav`,{className:`space-y-1`,"aria-label":D(`settings`),children:[g.map(({item:e,index:t})=>{let n=t===l,r=$[e.key];return(0,Y.jsxs)(`button`,{type:`button`,className:ge(`group relative flex w-full items-center gap-2.5 overflow-hidden rounded-lg px-2 py-1.5 text-left text-sm leading-5 transition-[background-color,color,box-shadow] duration-160 ease-out`,n?`bg-[var(--quickforge-sidebar-active-bg)] font-medium text-foreground/92 shadow-[0_8px_22px_-20px_rgb(15_23_42_/_0.32)]`:`text-muted-foreground/76 hover:bg-[var(--quickforge-sidebar-hover-bg)] hover:text-foreground/90 hover:shadow-[0_8px_20px_-18px_rgb(15_23_42_/_0.35)]`),onClick:()=>s(t),"aria-current":n?`page`:void 0,children:[(0,Y.jsx)(`span`,{className:ge(`inline-flex size-5 shrink-0 items-center justify-center transition-colors`,n?`text-foreground/72`:`text-muted-foreground/52 group-hover:text-foreground/68`),children:(0,Y.jsx)(r,{className:`size-4`,"aria-hidden":`true`})}),(0,Y.jsx)(`span`,{className:`truncate`,children:e.tab.getTabName()})]},e.key)}),g.length===0?(0,Y.jsx)(`div`,{className:`px-2 py-3 text-sm text-muted-foreground/70`,children:D(`noSettingsResults`)}):null]})})]}),(0,Y.jsxs)(`main`,{className:`flex min-w-0 flex-1 flex-col bg-[var(--quickforge-main-bg)] md:overflow-hidden md:rounded-l-2xl`,children:[(0,Y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center gap-2 border-b-[0.5px] border-[color-mix(in_oklab,var(--border)_34%,transparent)] px-3 pr-4 md:px-5`,children:[(0,Y.jsx)(we,{variant:`ghost`,size:`icon`,className:`md:hidden`,onClick:n,"aria-label":`返回工作区`,children:(0,Y.jsx)(a,{className:`size-4`})}),(0,Y.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[f?(0,Y.jsx)(f,{className:`size-4 shrink-0 text-muted-foreground/65`,"aria-hidden":`true`}):null,(0,Y.jsx)(`div`,{className:`min-w-0 truncate text-sm font-medium text-foreground/90`,children:u?.tab.getTabName()}),d?(0,Y.jsx)(he,{label:d}):null]})})]}),(0,Y.jsx)(`div`,{className:`shrink-0 border-b-[0.5px] border-[color-mix(in_oklab,var(--border)_30%,transparent)] px-3 py-2 md:hidden`,children:(0,Y.jsxs)(`div`,{className:`quickforge-settings-inline-field`,children:[(0,Y.jsx)(c,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground/60`,"aria-hidden":`true`}),(0,Y.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:D(`searchSettings`),"aria-label":D(`searchSettings`),className:`quickforge-settings-input`})]})}),(0,Y.jsxs)(`div`,{className:`quickforge-settings-mobile-tabs flex shrink-0 gap-1 overflow-x-auto border-b-[0.5px] border-[color-mix(in_oklab,var(--border)_30%,transparent)] px-3 py-2 md:hidden`,children:[g.map(({item:e,index:t})=>{let n=t===l,r=$[e.key];return(0,Y.jsxs)(`button`,{type:`button`,className:ge(`inline-flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-sm transition-colors`,n?`bg-muted text-foreground`:`text-muted-foreground hover:bg-muted/55 hover:text-foreground`),onClick:()=>s(t),children:[(0,Y.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:e.tab.getTabName()})]},e.key)}),g.length===0?(0,Y.jsx)(`div`,{className:`shrink-0 px-1 py-1.5 text-sm text-muted-foreground/70`,children:D(`noSettingsResults`)}):null]}),(0,Y.jsx)(`section`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-5 md:px-8 md:py-7`,children:(0,Y.jsx)(`div`,{className:`mx-auto flex min-h-full w-full max-w-5xl flex-col`,children:u?(0,Y.jsx)(Bt,{tab:u.tab}):null})})]})]})}export{Vt as SettingsWorkspacePage};
|