tianxincode 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/api/gateway.routes.d.ts.map +1 -1
  2. package/dist/api/gateway.routes.js +47 -0
  3. package/dist/api/gateway.routes.js.map +1 -1
  4. package/dist/modules/db/db.service.d.ts +1 -0
  5. package/dist/modules/db/db.service.d.ts.map +1 -1
  6. package/dist/modules/db/db.service.js +16 -0
  7. package/dist/modules/db/db.service.js.map +1 -1
  8. package/dist/modules/waf-gateway/index.d.ts +3 -0
  9. package/dist/modules/waf-gateway/index.d.ts.map +1 -0
  10. package/dist/modules/waf-gateway/index.js +2 -0
  11. package/dist/modules/waf-gateway/index.js.map +1 -0
  12. package/dist/modules/waf-gateway/waf-gateway.service.d.ts +32 -0
  13. package/dist/modules/waf-gateway/waf-gateway.service.d.ts.map +1 -0
  14. package/dist/modules/waf-gateway/waf-gateway.service.js +230 -0
  15. package/dist/modules/waf-gateway/waf-gateway.service.js.map +1 -0
  16. package/package.json +1 -1
  17. package/web/dist/assets/{AiLogsView-WAigW3xr.js → AiLogsView-Dnk7hwQR.js} +1 -1
  18. package/web/dist/assets/{CustomActionsView-CNI4Mt-1.js → CustomActionsView-DppAusC9.js} +1 -1
  19. package/web/dist/assets/{DevWorkflowView-BdgJWBut.js → DevWorkflowView-BFRV0PSq.js} +1 -1
  20. package/web/dist/assets/{GitChanges-DELhVhf1.js → GitChanges-Ce91loC4.js} +1 -1
  21. package/web/dist/assets/{Layout-nMj-Q_nP.js → Layout-CGd8ce9F.js} +1 -1
  22. package/web/dist/assets/{TasksView-BX2Y5ePb.js → TasksView-BIVHfKfT.js} +1 -1
  23. package/web/dist/assets/{TerminalView-BwS0wtKD.js → TerminalView-MVCt-H7U.js} +1 -1
  24. package/web/dist/assets/{cssMode-DEOlh9nJ.js → cssMode-b4McL4xZ.js} +1 -1
  25. package/web/dist/assets/{freemarker2-BIOBUwm4.js → freemarker2-DVKHC1DP.js} +1 -1
  26. package/web/dist/assets/{handlebars-CI4NCgxY.js → handlebars-BZJdpplH.js} +1 -1
  27. package/web/dist/assets/{html-D7QxDszE.js → html-BhdQsgMr.js} +1 -1
  28. package/web/dist/assets/{htmlMode-BoePnkeH.js → htmlMode-DwBfibQy.js} +1 -1
  29. package/web/dist/assets/{index-BUeX43RX.css → index-2nC-4na6.css} +1 -1
  30. package/web/dist/assets/{index-CztsEf_z.js → index-BR2hcxRn.js} +47 -47
  31. package/web/dist/assets/{javascript-CnJkz3tG.js → javascript-D1JSdfBe.js} +1 -1
  32. package/web/dist/assets/{jsonMode-gKJIoqZk.js → jsonMode-BL6rI5IY.js} +1 -1
  33. package/web/dist/assets/{liquid-F3gGRKrR.js → liquid-BJ_1CxIT.js} +1 -1
  34. package/web/dist/assets/{mdx-RsKU9MkN.js → mdx-DF7vzSc0.js} +1 -1
  35. package/web/dist/assets/{python-BWboDc6f.js → python-DxIO6p9P.js} +1 -1
  36. package/web/dist/assets/{razor-P3h5GTU6.js → razor-IMF0jWc3.js} +1 -1
  37. package/web/dist/assets/{tsMode-DrLSSEod.js → tsMode-Dmcls-Gv.js} +1 -1
  38. package/web/dist/assets/{typescript-QehpEqV-.js → typescript-Bi95U9ZL.js} +1 -1
  39. package/web/dist/assets/{xml-BAmlhwNW.js → xml-Vgp06Nxm.js} +1 -1
  40. package/web/dist/assets/{yaml-DSogwCN3.js → yaml-jEbIzjIx.js} +1 -1
  41. package/web/dist/index.html +2 -2
@@ -1,4 +1,4 @@
1
- import{n as c,F as d,C as u,M as h,a as o,g as p,e as C,K as _,b as v}from"./index-CztsEf_z.js";const b={name:"WorkflowSidebar",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>{}},currentCategory:{type:String,default:""},currentProject:{type:String,default:""},currentStep:{type:Number,default:1},isLoading:{type:Boolean,default:!1}},data(){return{selectedCategory:"",selectedProject:"",steps:[{id:1,title:"新建需求",desc:"创建新的需求项目",icon:"el-icon-folder-add"},{id:2,title:"方案设计",desc:"编写需求方案",icon:"el-icon-edit"},{id:3,title:"代码生成",desc:"根据方案生成代码",icon:"el-icon-document"},{id:4,title:"测试验收",desc:"测试验证功能",icon:"el-icon-s-check"}]}},computed:{hasAnyProject(){return Object.keys(this.projects||{}).length>0},visibleSteps(){return this.hasAnyProject?this.steps:this.steps.filter(s=>s.id===1)}},watch:{currentCategory(s){this.selectedCategory=s},currentProject(s){this.selectedProject=s}},methods:{onCategoryChange(s){this.selectedProject="",this.$emit("category-change",s)},onProjectChange(s){this.$emit("project-change",s)},onStepClick(s){this.$emit("step-change",s)},isStepCompleted(s){var i;if(!this.currentProject)return!1;const e=`${this.currentCategory}/${this.currentProject}`,t=this.projects[e];return((i=t==null?void 0:t.stepStatus)==null?void 0:i[s])===!0}}};var S=function(){var e=this,t=e._self._c;return t("div",{staticClass:"workflow-sidebar"},[t("div",{staticClass:"sidebar-header"},[t("h3",[e._v("当前项目")]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("大类")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentCategory||"-"))])]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("需求")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentProject||"-"))])])]),t("div",{staticClass:"step-list"},e._l(e.visibleSteps,function(i){return t("div",{key:i.id,class:["step-item",{active:e.currentStep===i.id,completed:e.isStepCompleted(i.id)}],on:{click:function(a){return e.onStepClick(i.id)}}},[t("div",{staticClass:"step-icon"},[t("i",{class:i.icon})]),t("div",{staticClass:"step-info"},[t("div",{staticClass:"step-title"},[e._v(e._s(i.title))]),t("div",{staticClass:"step-desc"},[e._v(e._s(i.desc))])]),t("div",{staticClass:"step-status"},[e.isStepCompleted(i.id)?t("i",{staticClass:"el-icon-circle-check",staticStyle:{color:"#22c55e"}}):e._e()])])}),0)])},w=[],k=c(b,S,w,!1,null,"8e3cf2bb");const $=k.exports,I={name:"Step1NewReq",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>({})},basePath:{type:String,default:""},currentCategory:{type:String,default:""},currentProject:{type:String,default:""}},data(){return{selectedCategory:"",selectedProject:"",dialogVisible:!1,dialogInput:"",requirementDialogVisible:!1,requirementDialogInput:""}},computed:{existingRequirementList(){if(!this.selectedCategory)return[];const s=`${this.selectedCategory}/`;return Object.keys(this.projects).filter(e=>e.startsWith(s)).map(e=>e.split("/")[1]).sort()}},watch:{currentCategory:{immediate:!0,handler(s){this.selectedCategory=s||""}},currentProject:{immediate:!0,handler(s){this.selectedProject=s||""}},selectedCategory(s){s||(this.selectedProject="")},existingRequirementList(s){this.selectedProject&&(!Array.isArray(s)||s.length===0||s.includes(this.selectedProject)||(this.selectedProject=""))}},methods:{onCategoryChange(){this.selectedProject="",this.$emit("category-change",this.selectedCategory||""),this.$emit("project-change","")},onProjectChange(){this.$emit("project-change",this.selectedProject||"")},showCreateRequirementDialog(){if(!this.selectedCategory){this.$message.warning("请先选择大类");return}this.requirementDialogInput="",this.requirementDialogVisible=!0},handleCreateRequirementConfirm(){const s=this.requirementDialogInput.trim();if(!s){this.$message.warning("需求名称不能为空");return}if(this.existingRequirementList.includes(s)){this.$message.warning("该需求已存在");return}this.$emit("create-requirement",{category:this.selectedCategory,name:s}),this.requirementDialogVisible=!1},showCreateCategoryDialog(){this.dialogInput="",this.dialogVisible=!0},handleDialogConfirm(){const s=this.dialogInput.trim();if(!s){this.$message.warning("名称不能为空");return}this.$emit("create-category",s),this.dialogVisible=!1}}};var M=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step1-container"},[t("div",{staticClass:"step1-main"},[t("div",{staticClass:"panel-section"},[e._m(0),t("div",{staticClass:"panel-section-body"},[t("el-form",{attrs:{"label-position":"top",size:"small"}},[t("el-form-item",{attrs:{label:"所属大类"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"请选择大类"},on:{change:e.onCategoryChange},model:{value:e.selectedCategory,callback:function(i){e.selectedCategory=i},expression:"selectedCategory"}},e._l(e.categories,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{on:{click:e.showCreateCategoryDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("el-form-item",{attrs:{label:"选择需求"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"选择已有需求目录",disabled:!e.selectedCategory},on:{change:e.onProjectChange},model:{value:e.selectedProject,callback:function(i){e.selectedProject=i},expression:"selectedProject"}},e._l(e.existingRequirementList,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{attrs:{disabled:!e.selectedCategory},on:{click:e.showCreateRequirementDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("div",{staticClass:"form-hint",staticStyle:{color:"#84848a"}},[e._v(" "+e._s(e.selectedCategory?"可直接选择已有需求,或点击“新建”创建需求目录":"请先选择大类")+" ")])],1)],1)])]),t("el-dialog",{attrs:{title:"新建大类",visible:e.dialogVisible,width:"400px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"大类名称"}},[t("el-input",{attrs:{placeholder:"输入大类名称"},model:{value:e.dialogInput,callback:function(i){e.dialogInput=i},expression:"dialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确定")])],1)],1),t("el-dialog",{attrs:{title:"新建需求",visible:e.requirementDialogVisible,width:"400px"},on:{"update:visible":function(i){e.requirementDialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"需求目录名称"}},[t("el-input",{attrs:{placeholder:"输入需求名称,如:用户管理"},model:{value:e.requirementDialogInput,callback:function(i){e.requirementDialogInput=i},expression:"requirementDialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.requirementDialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCreateRequirementConfirm}},[e._v("确定")])],1)],1)],1)},P=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-section-header"},[e("span",[e("i",{staticClass:"el-icon-folder-add"}),s._v(" 创建新需求")])])}],j=c(I,M,P,!1,null,"bf976168");const x=j.exports,D={name:"Step2Design",components:{ModelSelectDialog:h,CommandDialog:u,FileSelectDialog:d},props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{editor:null,specContent:"",inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1,sessionId:"",sessionStatus:"idle",customActions:[]}},computed:{specFilePath(){return!this.category||!this.name?"等待选择需求...":`${this.reqBasePath}\\${this.category}\\${this.name}\\${this.name}_方案.md`}},watch:{category:{handler(){this.loadData()}},name:{handler(){this.loadData()}}},async mounted(){this.initMonacoEditor(),await this.loadData(),await this.loadDefaultModel(),await this.loadCustomActions(),o.ws.init()},beforeDestroy(){this.editor&&(this.editor.dispose(),this.editor=null),this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{handleKeydown(s){if(s.key==="Enter")if(s.ctrlKey){const e=s.target,t=e.selectionStart,i=e.selectionEnd,a=this.inputMessage;this.inputMessage=a.substring(0,t)+`
1
+ import{n as c,F as d,C as u,M as h,a as o,g as p,e as C,K as _,b as v}from"./index-BR2hcxRn.js";const b={name:"WorkflowSidebar",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>{}},currentCategory:{type:String,default:""},currentProject:{type:String,default:""},currentStep:{type:Number,default:1},isLoading:{type:Boolean,default:!1}},data(){return{selectedCategory:"",selectedProject:"",steps:[{id:1,title:"新建需求",desc:"创建新的需求项目",icon:"el-icon-folder-add"},{id:2,title:"方案设计",desc:"编写需求方案",icon:"el-icon-edit"},{id:3,title:"代码生成",desc:"根据方案生成代码",icon:"el-icon-document"},{id:4,title:"测试验收",desc:"测试验证功能",icon:"el-icon-s-check"}]}},computed:{hasAnyProject(){return Object.keys(this.projects||{}).length>0},visibleSteps(){return this.hasAnyProject?this.steps:this.steps.filter(s=>s.id===1)}},watch:{currentCategory(s){this.selectedCategory=s},currentProject(s){this.selectedProject=s}},methods:{onCategoryChange(s){this.selectedProject="",this.$emit("category-change",s)},onProjectChange(s){this.$emit("project-change",s)},onStepClick(s){this.$emit("step-change",s)},isStepCompleted(s){var i;if(!this.currentProject)return!1;const e=`${this.currentCategory}/${this.currentProject}`,t=this.projects[e];return((i=t==null?void 0:t.stepStatus)==null?void 0:i[s])===!0}}};var S=function(){var e=this,t=e._self._c;return t("div",{staticClass:"workflow-sidebar"},[t("div",{staticClass:"sidebar-header"},[t("h3",[e._v("当前项目")]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("大类")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentCategory||"-"))])]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("需求")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentProject||"-"))])])]),t("div",{staticClass:"step-list"},e._l(e.visibleSteps,function(i){return t("div",{key:i.id,class:["step-item",{active:e.currentStep===i.id,completed:e.isStepCompleted(i.id)}],on:{click:function(a){return e.onStepClick(i.id)}}},[t("div",{staticClass:"step-icon"},[t("i",{class:i.icon})]),t("div",{staticClass:"step-info"},[t("div",{staticClass:"step-title"},[e._v(e._s(i.title))]),t("div",{staticClass:"step-desc"},[e._v(e._s(i.desc))])]),t("div",{staticClass:"step-status"},[e.isStepCompleted(i.id)?t("i",{staticClass:"el-icon-circle-check",staticStyle:{color:"#22c55e"}}):e._e()])])}),0)])},w=[],k=c(b,S,w,!1,null,"8e3cf2bb");const $=k.exports,I={name:"Step1NewReq",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>({})},basePath:{type:String,default:""},currentCategory:{type:String,default:""},currentProject:{type:String,default:""}},data(){return{selectedCategory:"",selectedProject:"",dialogVisible:!1,dialogInput:"",requirementDialogVisible:!1,requirementDialogInput:""}},computed:{existingRequirementList(){if(!this.selectedCategory)return[];const s=`${this.selectedCategory}/`;return Object.keys(this.projects).filter(e=>e.startsWith(s)).map(e=>e.split("/")[1]).sort()}},watch:{currentCategory:{immediate:!0,handler(s){this.selectedCategory=s||""}},currentProject:{immediate:!0,handler(s){this.selectedProject=s||""}},selectedCategory(s){s||(this.selectedProject="")},existingRequirementList(s){this.selectedProject&&(!Array.isArray(s)||s.length===0||s.includes(this.selectedProject)||(this.selectedProject=""))}},methods:{onCategoryChange(){this.selectedProject="",this.$emit("category-change",this.selectedCategory||""),this.$emit("project-change","")},onProjectChange(){this.$emit("project-change",this.selectedProject||"")},showCreateRequirementDialog(){if(!this.selectedCategory){this.$message.warning("请先选择大类");return}this.requirementDialogInput="",this.requirementDialogVisible=!0},handleCreateRequirementConfirm(){const s=this.requirementDialogInput.trim();if(!s){this.$message.warning("需求名称不能为空");return}if(this.existingRequirementList.includes(s)){this.$message.warning("该需求已存在");return}this.$emit("create-requirement",{category:this.selectedCategory,name:s}),this.requirementDialogVisible=!1},showCreateCategoryDialog(){this.dialogInput="",this.dialogVisible=!0},handleDialogConfirm(){const s=this.dialogInput.trim();if(!s){this.$message.warning("名称不能为空");return}this.$emit("create-category",s),this.dialogVisible=!1}}};var M=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step1-container"},[t("div",{staticClass:"step1-main"},[t("div",{staticClass:"panel-section"},[e._m(0),t("div",{staticClass:"panel-section-body"},[t("el-form",{attrs:{"label-position":"top",size:"small"}},[t("el-form-item",{attrs:{label:"所属大类"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"请选择大类"},on:{change:e.onCategoryChange},model:{value:e.selectedCategory,callback:function(i){e.selectedCategory=i},expression:"selectedCategory"}},e._l(e.categories,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{on:{click:e.showCreateCategoryDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("el-form-item",{attrs:{label:"选择需求"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"选择已有需求目录",disabled:!e.selectedCategory},on:{change:e.onProjectChange},model:{value:e.selectedProject,callback:function(i){e.selectedProject=i},expression:"selectedProject"}},e._l(e.existingRequirementList,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{attrs:{disabled:!e.selectedCategory},on:{click:e.showCreateRequirementDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("div",{staticClass:"form-hint",staticStyle:{color:"#84848a"}},[e._v(" "+e._s(e.selectedCategory?"可直接选择已有需求,或点击“新建”创建需求目录":"请先选择大类")+" ")])],1)],1)])]),t("el-dialog",{attrs:{title:"新建大类",visible:e.dialogVisible,width:"400px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"大类名称"}},[t("el-input",{attrs:{placeholder:"输入大类名称"},model:{value:e.dialogInput,callback:function(i){e.dialogInput=i},expression:"dialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确定")])],1)],1),t("el-dialog",{attrs:{title:"新建需求",visible:e.requirementDialogVisible,width:"400px"},on:{"update:visible":function(i){e.requirementDialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"需求目录名称"}},[t("el-input",{attrs:{placeholder:"输入需求名称,如:用户管理"},model:{value:e.requirementDialogInput,callback:function(i){e.requirementDialogInput=i},expression:"requirementDialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.requirementDialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCreateRequirementConfirm}},[e._v("确定")])],1)],1)],1)},P=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-section-header"},[e("span",[e("i",{staticClass:"el-icon-folder-add"}),s._v(" 创建新需求")])])}],j=c(I,M,P,!1,null,"bf976168");const x=j.exports,D={name:"Step2Design",components:{ModelSelectDialog:h,CommandDialog:u,FileSelectDialog:d},props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{editor:null,specContent:"",inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1,sessionId:"",sessionStatus:"idle",customActions:[]}},computed:{specFilePath(){return!this.category||!this.name?"等待选择需求...":`${this.reqBasePath}\\${this.category}\\${this.name}\\${this.name}_方案.md`}},watch:{category:{handler(){this.loadData()}},name:{handler(){this.loadData()}}},async mounted(){this.initMonacoEditor(),await this.loadData(),await this.loadDefaultModel(),await this.loadCustomActions(),o.ws.init()},beforeDestroy(){this.editor&&(this.editor.dispose(),this.editor=null),this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{handleKeydown(s){if(s.key==="Enter")if(s.ctrlKey){const e=s.target,t=e.selectionStart,i=e.selectionEnd,a=this.inputMessage;this.inputMessage=a.substring(0,t)+`
2
2
  `+a.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadData(){await Promise.all([this.loadSpec(),this.loadSession()])},async loadSpec(){if(!this.category||!this.name){this.specContent=`# 选择或创建需求项目开始设计
3
3
  `,this.syncEditorContent(this.specContent);return}try{const s=this.specFilePath,e=await o.getFileContent(s);this.specContent=e.content||"",this.syncEditorContent(this.specContent)}catch(s){console.error("Load spec failed:",s),this.specContent="",this.syncEditorContent("")}},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const s=`${this.reqBasePath}\\${this.category}\\${this.name}\\session.json`,e=await o.getFileContent(s);if(e&&e.content){const t=JSON.parse(e.content);this.sessionId=t.designSessionId||""}else this.sessionId="";this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(s){console.error("Load session failed:",s),this.sessionId="",this.logItems=[]}},syncEditorContent(s){if(!this.editor||s===void 0||s===null)return;const e=String(s);this.editor.getValue()!==e&&this.editor.setValue(e)},initMonacoEditor(){this.editor||this.$nextTick(()=>{this.createEditor()})},createEditor(){this.editor||(this.editor=C.create(this.$refs.editorContainer,{value:this.specContent||`# 选择或创建需求项目开始设计
4
4
  `,language:"markdown",theme:"vs-dark",fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Monaco, Consolas, monospace",minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:16}}),this.editor.addCommand(_.CtrlCmd|v.KeyS,()=>{this.saveSpec()}),this.syncEditorContent(this.specContent))},saveSpec(){if(!this.editor)return;const s=this.editor.getValue();this.$emit("save-spec",s)},async sendMessage(){const s=this.inputMessage.trim();if(!s||this.disabled)return;if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession();const e=`先在 ${this.specFilePath} 生成方案,先不要修改代码。
@@ -1,2 +1,2 @@
1
- import{n,e as o,K as c,b as d,a as r}from"./index-CztsEf_z.js";const f={name:"GitChangesSidebar",props:{changes:{type:Array,default:()=>[]},selectedPath:{type:String,default:null},isRepo:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},width:{type:Number,default:320}},methods:{getStatusClass(s){return{modified:"bg-blue-600 text-white",added:"bg-green-600 text-white",deleted:"bg-red-600 text-white",untracked:"bg-gray-600 text-white",renamed:"bg-purple-600 text-white"}[s]||"bg-gray-600 text-white"},getFileName(s){return s.split("/").pop()||s.split("\\").pop()||s},getDirPath(s){const t=s.split("/");return t.pop(),t.join("/")||"."}}};var h=function(){var t=this,e=t._self._c;return e("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",style:{width:t.width+"px"}},[e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[t._m(0),e("button",{staticClass:"ml-auto px-3 py-2 hover:text-white text-textMuted",attrs:{title:"刷新"},on:{click:function(i){return t.$emit("refresh")}}},[e("i",{staticClass:"fa-solid fa-refresh"})]),e("button",{staticClass:"px-3 py-2 hover:text-yellow-400 text-textMuted disabled:opacity-30",attrs:{disabled:t.changes.length===0,title:"撤销全部"},on:{click:function(i){return t.$emit("revert-all")}}},[e("i",{staticClass:"fa-solid fa-undo-alt"})])]),e("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[t.loading?e("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[e("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),t._v(" 加载中... ")]):t.isRepo?t.changes.length===0?e("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[t._m(2)]):e("div",t._l(t.changes,function(i){return e("div",{key:i.path,staticClass:"px-3 py-2 cursor-pointer border-b border-border/50 hover:bg-[#2a2a2a] transition-colors",class:t.selectedPath===i.path?"bg-[#2a2a2a] border-l-2 border-l-accent":"",on:{click:function(a){return t.$emit("select",i)}}},[e("div",{staticClass:"flex items-center gap-2"},[e("span",{staticClass:"text-xs font-bold px-1.5 py-0.5 rounded shrink-0",class:t.getStatusClass(i.status)},[t._v(" "+t._s(i.statusCode)+" ")]),e("div",{staticClass:"flex-1 min-w-0"},[e("div",{staticClass:"text-sm text-gray-200 truncate",attrs:{title:i.path}},[t._v(" "+t._s(t.getFileName(i.path))+" ")]),e("div",{staticClass:"text-xs text-gray-500 truncate",attrs:{title:i.path}},[t._v(" "+t._s(t.getDirPath(i.path))+" ")])]),e("div",{staticClass:"flex items-center gap-1 shrink-0",on:{click:function(a){a.stopPropagation()}}},[e("button",{staticClass:"p-1 text-gray-500 hover:text-blue-400 transition-colors",attrs:{title:"打开"},on:{click:function(a){return t.$emit("open-file",i)}}},[e("i",{staticClass:"fa-solid fa-external-link-alt text-xs"})]),e("button",{staticClass:"p-1 text-gray-500 hover:text-yellow-400 transition-colors",attrs:{title:"撤销"},on:{click:function(a){return t.$emit("revert",i)}}},[e("i",{staticClass:"fa-solid fa-undo text-xs"})])])])])}),0):e("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[t._m(1)])]),e("div",{staticClass:"border-t border-border px-3 py-2 text-xs text-textMuted"},[e("span",[t._v(t._s(t.changes.length)+" 个文件变更")])])])},u=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[t("i",{staticClass:"fa-brands fa-git-alt"}),s._v(" Git Changes ")])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"text-center"},[t("i",{staticClass:"fa-brands fa-git-alt text-4xl mb-4 opacity-30"}),t("p",[s._v("当前目录不是 Git 仓库")])])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"text-center"},[t("i",{staticClass:"fa-solid fa-check-circle text-4xl mb-4 opacity-30 text-green-500"}),t("p",[s._v("没有待提交的变更")])])}],g=n(f,h,u,!1,null,"42cc079f");const p=g.exports,x={name:"DiffViewer",props:{change:{type:Object,default:null},diffContent:{type:String,default:""},loading:{type:Boolean,default:!1}},data(){return{oldLines:[],newLines:[]}},watch:{diffContent:{immediate:!0,handler(s){this.parseDiff(s)}}},methods:{getStatusClass(s){return{modified:"bg-blue-600 text-white",added:"bg-green-600 text-white",deleted:"bg-red-600 text-white",untracked:"bg-gray-600 text-white",renamed:"bg-purple-600 text-white"}[s]||"bg-gray-600 text-white"},getLinePrefix(s){return s.removed?"-":s.added?"+":" "},getLineClass(s){return s.type==="header"?"bg-[#1a1a1a] text-blue-400":s.removed?"bg-red-900/50 text-red-300":s.added?"bg-green-900/50 text-green-300":s.empty?"bg-[#252525]":"text-gray-200"},parseDiff(s){if(this.oldLines=[],this.newLines=[],!s)return;const t=s.split(`
1
+ import{n,e as o,K as c,b as d,a as r}from"./index-BR2hcxRn.js";const f={name:"GitChangesSidebar",props:{changes:{type:Array,default:()=>[]},selectedPath:{type:String,default:null},isRepo:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},width:{type:Number,default:320}},methods:{getStatusClass(s){return{modified:"bg-blue-600 text-white",added:"bg-green-600 text-white",deleted:"bg-red-600 text-white",untracked:"bg-gray-600 text-white",renamed:"bg-purple-600 text-white"}[s]||"bg-gray-600 text-white"},getFileName(s){return s.split("/").pop()||s.split("\\").pop()||s},getDirPath(s){const t=s.split("/");return t.pop(),t.join("/")||"."}}};var h=function(){var t=this,e=t._self._c;return e("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",style:{width:t.width+"px"}},[e("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[t._m(0),e("button",{staticClass:"ml-auto px-3 py-2 hover:text-white text-textMuted",attrs:{title:"刷新"},on:{click:function(i){return t.$emit("refresh")}}},[e("i",{staticClass:"fa-solid fa-refresh"})]),e("button",{staticClass:"px-3 py-2 hover:text-yellow-400 text-textMuted disabled:opacity-30",attrs:{disabled:t.changes.length===0,title:"撤销全部"},on:{click:function(i){return t.$emit("revert-all")}}},[e("i",{staticClass:"fa-solid fa-undo-alt"})])]),e("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[t.loading?e("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[e("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),t._v(" 加载中... ")]):t.isRepo?t.changes.length===0?e("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[t._m(2)]):e("div",t._l(t.changes,function(i){return e("div",{key:i.path,staticClass:"px-3 py-2 cursor-pointer border-b border-border/50 hover:bg-[#2a2a2a] transition-colors",class:t.selectedPath===i.path?"bg-[#2a2a2a] border-l-2 border-l-accent":"",on:{click:function(a){return t.$emit("select",i)}}},[e("div",{staticClass:"flex items-center gap-2"},[e("span",{staticClass:"text-xs font-bold px-1.5 py-0.5 rounded shrink-0",class:t.getStatusClass(i.status)},[t._v(" "+t._s(i.statusCode)+" ")]),e("div",{staticClass:"flex-1 min-w-0"},[e("div",{staticClass:"text-sm text-gray-200 truncate",attrs:{title:i.path}},[t._v(" "+t._s(t.getFileName(i.path))+" ")]),e("div",{staticClass:"text-xs text-gray-500 truncate",attrs:{title:i.path}},[t._v(" "+t._s(t.getDirPath(i.path))+" ")])]),e("div",{staticClass:"flex items-center gap-1 shrink-0",on:{click:function(a){a.stopPropagation()}}},[e("button",{staticClass:"p-1 text-gray-500 hover:text-blue-400 transition-colors",attrs:{title:"打开"},on:{click:function(a){return t.$emit("open-file",i)}}},[e("i",{staticClass:"fa-solid fa-external-link-alt text-xs"})]),e("button",{staticClass:"p-1 text-gray-500 hover:text-yellow-400 transition-colors",attrs:{title:"撤销"},on:{click:function(a){return t.$emit("revert",i)}}},[e("i",{staticClass:"fa-solid fa-undo text-xs"})])])])])}),0):e("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[t._m(1)])]),e("div",{staticClass:"border-t border-border px-3 py-2 text-xs text-textMuted"},[e("span",[t._v(t._s(t.changes.length)+" 个文件变更")])])])},u=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[t("i",{staticClass:"fa-brands fa-git-alt"}),s._v(" Git Changes ")])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"text-center"},[t("i",{staticClass:"fa-brands fa-git-alt text-4xl mb-4 opacity-30"}),t("p",[s._v("当前目录不是 Git 仓库")])])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"text-center"},[t("i",{staticClass:"fa-solid fa-check-circle text-4xl mb-4 opacity-30 text-green-500"}),t("p",[s._v("没有待提交的变更")])])}],g=n(f,h,u,!1,null,"42cc079f");const p=g.exports,x={name:"DiffViewer",props:{change:{type:Object,default:null},diffContent:{type:String,default:""},loading:{type:Boolean,default:!1}},data(){return{oldLines:[],newLines:[]}},watch:{diffContent:{immediate:!0,handler(s){this.parseDiff(s)}}},methods:{getStatusClass(s){return{modified:"bg-blue-600 text-white",added:"bg-green-600 text-white",deleted:"bg-red-600 text-white",untracked:"bg-gray-600 text-white",renamed:"bg-purple-600 text-white"}[s]||"bg-gray-600 text-white"},getLinePrefix(s){return s.removed?"-":s.added?"+":" "},getLineClass(s){return s.type==="header"?"bg-[#1a1a1a] text-blue-400":s.removed?"bg-red-900/50 text-red-300":s.added?"bg-green-900/50 text-green-300":s.empty?"bg-[#252525]":"text-gray-200"},parseDiff(s){if(this.oldLines=[],this.newLines=[],!s)return;const t=s.split(`
2
2
  `);let e=1,i=1;for(const a of t)if(a.startsWith("@@")){const l=a.match(/@@ -(\d+),?\d* \+(\d+),?\d* @@/);l&&(e=parseInt(l[1]),i=parseInt(l[2])),this.oldLines.push({lineNum:"",content:a,type:"header"}),this.newLines.push({lineNum:"",content:a,type:"header"})}else a.startsWith("---")||a.startsWith("+++")||a.startsWith("diff ")||a.startsWith("index ")||(a.startsWith("-")?(this.oldLines.push({lineNum:e++,content:a.substring(1),removed:!0}),this.newLines.push({lineNum:"",content:"",empty:!0})):a.startsWith("+")?(this.oldLines.push({lineNum:"",content:"",empty:!0}),this.newLines.push({lineNum:i++,content:a.substring(1),added:!0})):(this.oldLines.push({lineNum:e++,content:a}),this.newLines.push({lineNum:i++,content:a})))}}};var v=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[t.change?e("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[e("div",{staticClass:"flex items-center justify-between px-4 py-2 border-b border-border bg-sidebar"},[e("div",{staticClass:"flex items-center gap-2"},[e("span",{staticClass:"text-xs font-bold px-1.5 py-0.5 rounded",class:t.getStatusClass(t.change.status)},[t._v(" "+t._s(t.change.statusCode)+" ")]),e("span",{staticClass:"text-white text-sm"},[t._v(t._s(t.change.path))])]),e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"px-3 py-1 text-xs bg-blue-600 hover:bg-blue-700 text-white rounded",on:{click:function(i){return t.$emit("open-file",t.change)}}},[e("i",{staticClass:"fa-solid fa-external-link-alt mr-1"}),t._v(" 打开文件 ")]),e("button",{staticClass:"px-3 py-1 text-xs bg-yellow-600 hover:bg-yellow-700 text-white rounded",on:{click:function(i){return t.$emit("revert",t.change)}}},[e("i",{staticClass:"fa-solid fa-undo mr-1"}),t._v(" 撤销 ")])])]),t.loading?e("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[e("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),t._v(" 加载 diff 中... ")]):t.diffContent?e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("div",{staticClass:"flex-1 flex flex-col overflow-hidden border-r border-border"},[e("div",{staticClass:"px-4 py-2 bg-[#3c3c3c] border-b border-border text-xs text-gray-300 font-bold"},[t._v(" 旧版本 (Original) ")]),e("div",{staticClass:"flex-1 overflow-auto bg-[#2d2d2d]"},t._l(t.oldLines,function(i,a){return e("div",{key:"old-"+a,staticClass:"flex font-mono text-sm",class:t.getLineClass(i)},[e("span",{staticClass:"w-12 shrink-0 text-right pr-2 select-none opacity-40"},[t._v(t._s(i.lineNum||""))]),e("span",{staticClass:"flex-1 whitespace-pre"},[e("span",{staticClass:"select-none font-bold w-4 inline-block"},[t._v(t._s(t.getLinePrefix(i)))]),t._v(t._s(i.content))])])}),0)]),e("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[e("div",{staticClass:"px-4 py-2 bg-[#3c3c3c] border-b border-border text-xs text-gray-300 font-bold"},[t._v(" 新版本 (Modified) ")]),e("div",{staticClass:"flex-1 overflow-auto bg-[#2d2d2d]"},t._l(t.newLines,function(i,a){return e("div",{key:"new-"+a,staticClass:"flex font-mono text-sm",class:t.getLineClass(i)},[e("span",{staticClass:"w-12 shrink-0 text-right pr-2 select-none opacity-40"},[t._v(t._s(i.lineNum||""))]),e("span",{staticClass:"flex-1 whitespace-pre"},[e("span",{staticClass:"select-none font-bold w-4 inline-block"},[t._v(t._s(t.getLinePrefix(i)))]),t._v(t._s(i.content))])])}),0)])]):e("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[t._m(1)])]):e("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[t._m(0)])])},m=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"text-center"},[t("i",{staticClass:"fa-solid fa-code text-6xl mb-4 opacity-20"}),t("p",[s._v("点击文件查看变更详情")])])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"text-center"},[t("i",{staticClass:"fa-solid fa-file text-4xl mb-4 opacity-30"}),t("p",[s._v("无法显示此文件的 diff")])])}],b=n(x,v,m,!1,null,null);const C=b.exports,_=console.error;console.error=(...s)=>{var t;(t=s[0])!=null&&t.toString().includes("toUrl")||_(...s)};const y={name:"FileViewerModal",data(){return{visible:!1,fullPath:"",fileStatus:null,loading:!1,saving:!1,editor:null,originalContent:""}},computed:{filePath(){if(!this.fullPath)return"";const s=this.fullPath.split("/");return s[s.length-1]},hasChanges(){return this.editor?this.editor.getValue()!==this.originalContent:!1},statusCode(){return this.fileStatus&&this.fileStatus.statusCode||""},statusClass(){return this.fileStatus&&{modified:"bg-blue-600 text-white",added:"bg-green-600 text-white",deleted:"bg-red-600 text-white",untracked:"bg-gray-600 text-white",renamed:"bg-purple-600 text-white"}[this.fileStatus.status]||"bg-gray-600 text-white"}},beforeDestroy(){this.destroyEditor()},methods:{async open(s,t=null){this.fullPath=s,this.fileStatus=t,this.visible=!0,this.loading=!0;try{const e=await r.getFileContent(s);this.originalContent=e.content||"",this.$nextTick(()=>{this.initEditor(this.originalContent)})}catch(e){console.error("Failed to load file:",e),this.$message.error("加载文件失败")}finally{this.loading=!1}},close(){this.visible=!1},async save(){if(!(!this.fullPath||!this.hasChanges)){this.saving=!0;try{await r.writeFile(this.fullPath,this.editor.getValue()),this.originalContent=this.editor.getValue(),this.$message.success("文件已保存")}catch(s){console.error("Save file failed:",s),this.$message.error("保存文件失败")}finally{this.saving=!1}}},initEditor(s){console.log("-----------initEditor called with content length:",s.length),this.$refs.editorContainer&&(console.log("-----------initEditor called with content length:aaaa",s.length),this.editor=o.create(this.$refs.editorContainer,{value:s||"",language:this.getLanguage(),theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:14,fontFamily:'Consolas, Monaco, "Courier New", monospace',lineNumbers:"on",scrollbar:{useShadows:!1,vertical:"auto",horizontal:"auto"}}),this.editor.addCommand(c.CtrlCmd|d.KeyS,()=>{this.save()}))},destroyEditor(){this.editor&&(this.editor.dispose(),this.editor=null)},getLanguage(){const s=this.filePath.split(".").pop().toLowerCase();return{js:"javascript",ts:"typescript",html:"html",css:"css",vue:"html",py:"python",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",sql:"sql",sh:"shell",go:"go",rs:"rust",java:"java",cpp:"cpp",c:"c",jsx:"javascript",tsx:"typescript"}[s]||"plaintext"}}};var w=function(){var t=this,e=t._self._c;return t.visible?e("div",{staticClass:"fixed inset-0 bg-black/70 flex items-center justify-center z-50",on:{click:function(i){return i.target!==i.currentTarget?null:t.close.apply(null,arguments)}}},[e("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[90%] h-[80%] flex flex-col overflow-hidden"},[e("div",{staticClass:"flex items-center justify-between px-4 py-3 border-b border-border"},[e("div",{staticClass:"flex items-center gap-2"},[t.fileStatus?e("span",{staticClass:"text-xs font-bold px-1.5 py-0.5 rounded",class:t.statusClass},[t._v(" "+t._s(t.statusCode)+" ")]):t._e(),e("span",{staticClass:"text-white text-sm"},[t._v(t._s(t.filePath))])]),e("button",{staticClass:"text-gray-400 hover:text-white",on:{click:t.close}},[e("i",{staticClass:"fa-solid fa-times text-lg"})])]),e("div",{staticClass:"flex-1 overflow-hidden bg-[#1e1e1e]"},[e("div",{ref:"editorContainer",staticClass:"w-full h-full"})]),e("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3"},[e("div",{staticClass:"flex items-center gap-4 text-xs text-gray-400"},[e("span",[t._v(t._s(t.fullPath))]),t.hasChanges?e("span",{staticClass:"text-yellow-500"},[t._v("已修改")]):t._e()]),e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"px-3 py-1 text-xs bg-primary hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded",attrs:{disabled:!t.hasChanges||t.saving},on:{click:t.save}},[t.saving?e("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}):e("i",{staticClass:"fa-solid fa-save mr-1"}),t._v(" 保存 ")])])])])]):t._e()},$=[],R=n(y,w,$,!1,null,null);const k=R.exports,L={name:"ConfirmDialog",props:{visible:{type:Boolean,default:!1},message:{type:String,default:""}}};var D=function(){var t=this,e=t._self._c;return t.visible?e("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[e("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-96"},[e("p",{staticClass:"text-gray-200 text-sm mb-4"},[t._v(t._s(t.message))]),e("div",{staticClass:"flex justify-end gap-2"},[e("button",{staticClass:"px-3 py-1 text-xs text-gray-400 hover:text-white",on:{click:function(i){return t.$emit("cancel")}}},[t._v("取消")]),e("button",{staticClass:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700",on:{click:function(i){return t.$emit("confirm")}}},[t._v("确定")])])])]):t._e()},S=[],j=n(L,D,S,!1,null,null);const F=j.exports,z={name:"GitChanges",components:{GitChangesSidebar:p,DiffViewer:C,FileViewerModal:k,ConfirmDialog:F},data(){return{isRepo:!1,gitRoot:null,changes:[],selectedChange:null,diffContent:null,loading:!1,diffLoading:!1,sidebarWidth:320,isResizing:!1,confirmDialog:{visible:!1,message:"",action:null,target:null}}},async created(){await this.checkRepo(),await this.refreshChanges(),document.addEventListener("mousemove",this.handleResize),document.addEventListener("mouseup",this.stopResize)},beforeDestroy(){document.removeEventListener("mousemove",this.handleResize),document.removeEventListener("mouseup",this.stopResize)},methods:{async checkRepo(){try{const s=await r.gitIsRepo();this.isRepo=s.isRepo,this.gitRoot=s.gitRoot}catch{this.isRepo=!1}},async refreshChanges(){if(this.isRepo){this.loading=!0;try{const s=await r.gitStatus();this.changes=s.changes||[],this.selectedChange&&(this.changes.find(e=>e.path===this.selectedChange.path)||(this.selectedChange=null,this.diffContent=null))}catch(s){console.error("Failed to get git status:",s),this.$message.error("获取变更列表失败")}finally{this.loading=!1}}},async refresh(){await this.refreshChanges(),this.selectedChange&&await this.loadDiff(this.selectedChange)},selectChange(s){this.selectedChange=s,this.loadDiff(s)},async loadDiff(s){this.diffLoading=!0,this.diffContent=null;try{const t=await r.gitDiff(s.path);this.diffContent=t.diff||""}catch(t){console.error("Failed to get diff:",t),this.diffContent=""}finally{this.diffLoading=!1}},async openFile(s){var e;const t=this.gitRoot?`${this.gitRoot.replace(/\\/g,"/")}/${s.path}`:s.path;(e=this.$refs.fileModalRef)==null||e.open(t,s)},revertFile(s){const t=s.isNew?"delete":"revert",e=s.isNew?`确定要删除未跟踪的文件 "${s.path}" 吗?`:`确定要撤销对 "${s.path}" 的修改吗?`;this.confirmDialog={visible:!0,message:e,action:t,target:s}},confirmRevertAll(){this.changes.length!==0&&(this.confirmDialog={visible:!0,message:`确定要撤销所有 ${this.changes.length} 个文件的变更吗?此操作不可恢复。`,action:"revertAll",target:null})},cancelConfirm(){this.confirmDialog.visible=!1},async executeConfirm(){const{action:s,target:t}=this.confirmDialog;this.confirmDialog.visible=!1;try{s==="revertAll"?(await r.gitRevertAll(),await r.gitDiscardUntracked(),this.$message.success("所有变更已撤销")):s==="revert"?(await r.gitRevert(t.path),this.$message.success("文件已撤销")):s==="delete"&&(await r.gitDeleteFile(t.path),this.$message.success("文件已删除")),await this.refreshChanges()}catch(e){console.error("Operation failed:",e),this.$message.error("操作失败: "+(e.message||"未知错误"))}},startResize(s){this.isResizing=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},handleResize(s){if(!this.isResizing)return;const t=s.clientX;t>=200&&t<=500&&(this.sidebarWidth=t)},stopResize(){this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect=""}}};var M=function(){var i;var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("git-changes-sidebar",{attrs:{width:t.sidebarWidth,changes:t.changes,"selected-path":(i=t.selectedChange)==null?void 0:i.path,"is-repo":t.isRepo,loading:t.loading},on:{refresh:t.refresh,select:t.selectChange,"open-file":t.openFile,revert:t.revertFile,"revert-all":t.confirmRevertAll}}),e("div",{staticClass:"w-1 bg-border hover:bg-accent cursor-col-resize transition-colors shrink-0",on:{mousedown:t.startResize}}),e("diff-viewer",{attrs:{change:t.selectedChange,"diff-content":t.diffContent,loading:t.diffLoading},on:{"open-file":t.openFile,revert:t.revertFile}}),e("file-viewer-modal",{ref:"fileModalRef"}),e("confirm-dialog",{attrs:{visible:t.confirmDialog.visible,message:t.confirmDialog.message},on:{confirm:t.executeConfirm,cancel:t.cancelConfirm}})],1)},N=[],P=n(z,M,N,!1,null,null);const W=P.exports;export{W as default};
@@ -1 +1 @@
1
- import{n as i,a as r}from"./index-CztsEf_z.js";const o={name:"Layout",data(){return{sidebarVisible:!0,showSessionDropdown:!1,sessions:[],currentSessionId:null,currentSessionName:""}},methods:{openDevWorkflow(){window.open("/devWorkflow","_blank")},toggleSidebar(){this.sidebarVisible=!this.sidebarVisible},toggleSessionDropdown(){this.showSessionDropdown=!this.showSessionDropdown},async switchSession(s){this.currentSessionId=s.id,this.currentSessionName=s.title,this.showSessionDropdown=!1,this.$route.params.id!==s.id&&this.$router.push({name:"chat-session",params:{id:s.id}}).catch(()=>{})},async createNewSession(){try{const s=await r.createSession("新会话");this.sessions.unshift(s.data),this.switchSession(s.data),this.showSessionDropdown=!1}catch(s){this.$message.error("创建会话失败: "+s.message)}},async loadSessions(){try{const s=await r.getSessions();this.sessions=s.data||[],this.sessions.length>0&&!this.currentSessionId&&(this.currentSessionId=this.sessions[0].id,this.currentSessionName=this.sessions[0].title)}catch(s){console.error("加载会话失败:",s)}}},async created(){await this.loadSessions(),document.addEventListener("click",s=>{this.$el.contains(s.target)||(this.showSessionDropdown=!1)})}};var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-screen overflow-hidden"},[t("header",{staticClass:"h-10 bg-sidebar border-b border-black flex items-center justify-between px-4 shrink-0 z-20"},[t("div",{staticClass:"flex items-center gap-4"},[e._m(0),t("div",{staticClass:"relative"},[t("a",{staticClass:"hover:text-white px-3 py-1 rounded border border-transparent hover:border-accent transition-colors cursor-pointer",class:e.$route.name==="devWorkflow"?"text-accent border-accent":"text-gray-400",attrs:{href:"/devWorkflow",target:"_blank"},on:{click:function(a){return a.preventDefault(),e.openDevWorkflow.apply(null,arguments)}}},[t("i",{staticClass:"fa-solid fa-laptop-code mr-1"}),e._v(" 软件研发 ")])])]),t("div",{staticClass:"flex items-center gap-3"},[e._m(1),t("button",{directives:[{name:"show",rawName:"v-show",value:e.$route.name==="chat",expression:"$route.name === 'chat'"}],staticClass:"hover:text-white",attrs:{title:e.sidebarVisible?"关闭侧栏":"显示侧栏"},on:{click:e.toggleSidebar}},[t("i",{staticClass:"fa-solid fa-columns"})])])]),t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("nav",{staticClass:"w-12 bg-activityBar flex flex-col items-center py-2 shrink-0 border-r border-black z-10 justify-between"},[t("div",{staticClass:"flex flex-col items-center w-full"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="codeView"||e.$route.name==="codeView-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/codeView",title:"工作台"}},[t("i",{staticClass:"fa-regular fa-comments text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="files"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/files",title:"文件"}},[t("i",{staticClass:"fa-solid fa-folder-open text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="gitChanges"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/git-changes",title:"Git 变更"}},[t("i",{staticClass:"fa-brands fa-git-alt text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="terminal"||e.$route.name==="terminal-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/terminal",title:"终端"}},[t("i",{staticClass:"fa-solid fa-terminal text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="skills"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/skills",title:"Skill 管理"}},[t("i",{staticClass:"fa-solid fa-shapes text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="db"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/db",title:"数据库"}},[t("i",{staticClass:"fa-solid fa-database text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="tasks"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/tasks",title:"任务"}},[t("i",{staticClass:"fa-solid fa-clock text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="aiLogs"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/aiLogs",title:"AI 日志"}},[t("i",{staticClass:"fa-solid fa-robot text-xl"})])],1),t("div",{staticClass:"flex flex-col items-center w-full mb-2"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="settings"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent hover:bg-white/5",attrs:{to:"/settings",title:"设置"}},[t("i",{staticClass:"fa-solid fa-gear text-xl"})])],1)]),t("keep-alive",{attrs:{include:["CodeView","TerminalView","Files"]}},[t("router-view",{staticClass:"flex-1 flex overflow-hidden",attrs:{"sidebar-visible":e.sidebarVisible},on:{"toggle-sidebar":e.toggleSidebar}})],1)],1),e._m(2)])},l=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"font-bold text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-robot text-accent"}),e("span",[s._v("TXCode Agent")])])},function(){var s=this,e=s._self._c;return e("span",{staticClass:"text-xs text-textMuted mr-2"},[e("i",{staticClass:"fa-solid fa-circle text-green-500 text-[8px]"}),s._v(" Server Connected")])},function(){var s=this,e=s._self._c;return e("footer",{staticClass:"h-6 bg-accent text-white text-xs flex items-center justify-between px-3 shrink-0 z-20"},[e("div",{staticClass:"flex items-center gap-4"},[e("span",[e("i",{staticClass:"fa-solid fa-code-branch"}),s._v(" main")])]),e("div",{staticClass:"flex items-center gap-4"},[e("span",[s._v("TXCode")]),e("span",[s._v("UTF-8")])])])}],c=i(o,n,l,!1,null,null);const b=c.exports;export{b as default};
1
+ import{n as i,a as r}from"./index-BR2hcxRn.js";const o={name:"Layout",data(){return{sidebarVisible:!0,showSessionDropdown:!1,sessions:[],currentSessionId:null,currentSessionName:""}},methods:{openDevWorkflow(){window.open("/devWorkflow","_blank")},toggleSidebar(){this.sidebarVisible=!this.sidebarVisible},toggleSessionDropdown(){this.showSessionDropdown=!this.showSessionDropdown},async switchSession(s){this.currentSessionId=s.id,this.currentSessionName=s.title,this.showSessionDropdown=!1,this.$route.params.id!==s.id&&this.$router.push({name:"chat-session",params:{id:s.id}}).catch(()=>{})},async createNewSession(){try{const s=await r.createSession("新会话");this.sessions.unshift(s.data),this.switchSession(s.data),this.showSessionDropdown=!1}catch(s){this.$message.error("创建会话失败: "+s.message)}},async loadSessions(){try{const s=await r.getSessions();this.sessions=s.data||[],this.sessions.length>0&&!this.currentSessionId&&(this.currentSessionId=this.sessions[0].id,this.currentSessionName=this.sessions[0].title)}catch(s){console.error("加载会话失败:",s)}}},async created(){await this.loadSessions(),document.addEventListener("click",s=>{this.$el.contains(s.target)||(this.showSessionDropdown=!1)})}};var n=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-screen overflow-hidden"},[t("header",{staticClass:"h-10 bg-sidebar border-b border-black flex items-center justify-between px-4 shrink-0 z-20"},[t("div",{staticClass:"flex items-center gap-4"},[e._m(0),t("div",{staticClass:"relative"},[t("a",{staticClass:"hover:text-white px-3 py-1 rounded border border-transparent hover:border-accent transition-colors cursor-pointer",class:e.$route.name==="devWorkflow"?"text-accent border-accent":"text-gray-400",attrs:{href:"/devWorkflow",target:"_blank"},on:{click:function(a){return a.preventDefault(),e.openDevWorkflow.apply(null,arguments)}}},[t("i",{staticClass:"fa-solid fa-laptop-code mr-1"}),e._v(" 软件研发 ")])])]),t("div",{staticClass:"flex items-center gap-3"},[e._m(1),t("button",{directives:[{name:"show",rawName:"v-show",value:e.$route.name==="chat",expression:"$route.name === 'chat'"}],staticClass:"hover:text-white",attrs:{title:e.sidebarVisible?"关闭侧栏":"显示侧栏"},on:{click:e.toggleSidebar}},[t("i",{staticClass:"fa-solid fa-columns"})])])]),t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("nav",{staticClass:"w-12 bg-activityBar flex flex-col items-center py-2 shrink-0 border-r border-black z-10 justify-between"},[t("div",{staticClass:"flex flex-col items-center w-full"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="codeView"||e.$route.name==="codeView-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/codeView",title:"工作台"}},[t("i",{staticClass:"fa-regular fa-comments text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="files"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/files",title:"文件"}},[t("i",{staticClass:"fa-solid fa-folder-open text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="gitChanges"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/git-changes",title:"Git 变更"}},[t("i",{staticClass:"fa-brands fa-git-alt text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="terminal"||e.$route.name==="terminal-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/terminal",title:"终端"}},[t("i",{staticClass:"fa-solid fa-terminal text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:e.$route.name==="skills"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/skills",title:"Skill 管理"}},[t("i",{staticClass:"fa-solid fa-shapes text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="db"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/db",title:"数据库"}},[t("i",{staticClass:"fa-solid fa-database text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="tasks"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/tasks",title:"任务"}},[t("i",{staticClass:"fa-solid fa-clock text-xl"})]),t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="aiLogs"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/aiLogs",title:"AI 日志"}},[t("i",{staticClass:"fa-solid fa-robot text-xl"})])],1),t("div",{staticClass:"flex flex-col items-center w-full mb-2"},[t("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:e.$route.name==="settings"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent hover:bg-white/5",attrs:{to:"/settings",title:"设置"}},[t("i",{staticClass:"fa-solid fa-gear text-xl"})])],1)]),t("keep-alive",{attrs:{include:["CodeView","TerminalView","Files"]}},[t("router-view",{staticClass:"flex-1 flex overflow-hidden",attrs:{"sidebar-visible":e.sidebarVisible},on:{"toggle-sidebar":e.toggleSidebar}})],1)],1),e._m(2)])},l=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"font-bold text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-robot text-accent"}),e("span",[s._v("TXCode Agent")])])},function(){var s=this,e=s._self._c;return e("span",{staticClass:"text-xs text-textMuted mr-2"},[e("i",{staticClass:"fa-solid fa-circle text-green-500 text-[8px]"}),s._v(" Server Connected")])},function(){var s=this,e=s._self._c;return e("footer",{staticClass:"h-6 bg-accent text-white text-xs flex items-center justify-between px-3 shrink-0 z-20"},[e("div",{staticClass:"flex items-center gap-4"},[e("span",[e("i",{staticClass:"fa-solid fa-code-branch"}),s._v(" main")])]),e("div",{staticClass:"flex items-center gap-4"},[e("span",[s._v("TXCode")]),e("span",[s._v("UTF-8")])])])}],c=i(o,n,l,!1,null,null);const b=c.exports;export{b as default};
@@ -1 +1 @@
1
- import{n as x,a as i}from"./index-CztsEf_z.js";const b={"*/5 * * * *":"每5分钟","*/30 * * * *":"每30分钟","0 * * * *":"每小时","0 */2 * * *":"每2小时","0 */12 * * *":"每12小时","0 0 * * *":"每天0点","0 0 1 * *":"每月1日0点"},p={name:"TasksView",data(){return{tasks:[],models:[],availableSkills:[],showDialog:!1,showLogDialog:!1,isEditing:!1,currentTask:null,logs:[],form:{name:"",model:"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0}}},async created(){await this.loadTasks(),await this.loadModels(),await this.loadSkills()},methods:{async loadTasks(){try{const s=await i.getScheduledTasks();this.tasks=s.data||[]}catch(s){console.error("Load tasks failed:",s),this.$message.error("加载任务失败")}},async loadModels(){try{const s=await i.getModels();this.models=s.data||[],this.models.length>0&&!this.form.model&&(this.form.model=this.models[0].name)}catch(s){console.error("Load models failed:",s)}},async loadSkills(){var s;try{const e=await i.getSkills();this.availableSkills=((s=e.data)==null?void 0:s.map(t=>t.name))||[]}catch(e){console.error("Load skills failed:",e)}},formatSchedule(s){return b[s]||s},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"},openCreateDialog(){var s;this.isEditing=!1,this.form={name:"",model:((s=this.models[0])==null?void 0:s.name)||"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0},this.showDialog=!0},openEditDialog(s){this.isEditing=!0,this.currentTask=s,this.form={name:s.name,model:s.model,scheduleType:s.scheduleType,notifyType:s.notifyType,skills:[...s.skills||[]],content:s.content,enabled:s.enabled},this.showDialog=!0},closeDialog(){this.showDialog=!1,this.currentTask=null},async saveTask(){if(!this.form.name||!this.form.content){this.$message.error("请填写必填项");return}try{this.isEditing&&this.currentTask?(await i.updateScheduledTask(this.currentTask.id,this.form),this.$message.success("任务已更新")):(await i.createScheduledTask(this.form),this.$message.success("任务已创建")),this.closeDialog(),await this.loadTasks()}catch(s){this.$message.error("保存失败: "+s.message)}},async deleteTask(s){if(confirm(`确定删除任务 "${s.name}" 吗?`))try{await i.deleteScheduledTask(s.id),this.$message.success("任务已删除"),await this.loadTasks()}catch(e){this.$message.error("删除失败: "+e.message)}},async startTask(s){try{await i.startScheduledTask(s.id),this.$message.success("任务已启动"),await this.loadTasks()}catch(e){this.$message.error("启动失败: "+e.message)}},async stopTask(s){try{await i.stopScheduledTask(s.id),this.$message.success("任务已停用"),await this.loadTasks()}catch(e){this.$message.error("停用失败: "+e.message)}},async runTask(s){try{await i.runTaskNow(s.id),this.$message.success("任务已开始执行")}catch(e){this.$message.error("执行失败: "+e.message)}},async openLogDialog(s){this.currentTask=s,this.showLogDialog=!0;try{const e=await i.getTaskLogs(s.id);this.logs=e.data||[]}catch(e){console.error("Load logs failed:",e),this.logs=[]}}}};var m=function(){var u;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex flex-col overflow-hidden bg-[#1e1e1e]"},[t("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar shrink-0"},[t("div",{staticClass:"flex items-center justify-between"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-clock text-accent"}),t("span",{staticClass:"text-white font-medium"},[e._v("定时任务")]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.tasks.length)+" 个任务")])]),t("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:e.openCreateDialog}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" 新建任务 ")])])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(0),t("tbody",[e._l(e.tasks,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[a.enabled?t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-green-500/20 text-green-400"},[e._v("启用")]):t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-gray-500/20 text-gray-400"},[e._v("停用")])]),t("td",{staticClass:"px-3 py-2 text-gray-200 border-b border-border/30"},[e._v(e._s(a.name))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(a.model))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatSchedule(a.scheduleType)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},e._l(a.skills,function(o){var r;return(r=a.skills)!=null&&r.length?t("span",{key:o,staticClass:"text-xs px-1 py-0.5 bg-blue-500/20 text-blue-400 rounded mr-1"},[e._v(e._s(o))]):t("span",{staticClass:"text-textMuted"},[e._v("-")])}),0),t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("div",{staticClass:"flex items-center gap-2"},[a.enabled?t("button",{staticClass:"text-xs px-2 py-1 text-yellow-400 hover:bg-yellow-500/20 rounded",on:{click:function(o){return e.stopTask(a)}}},[e._v("停用")]):t("button",{staticClass:"text-xs px-2 py-1 text-green-400 hover:bg-green-500/20 rounded",on:{click:function(o){return e.startTask(a)}}},[e._v("启动")]),t("button",{staticClass:"text-xs px-2 py-1 text-blue-400 hover:bg-blue-500/20 rounded",on:{click:function(o){return e.runTask(a)}}},[e._v("执行")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openLogDialog(a)}}},[e._v("日志")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openEditDialog(a)}}},[e._v("编辑")]),t("button",{staticClass:"text-xs px-2 py-1 text-red-400 hover:bg-red-500/20 rounded",on:{click:function(o){return e.deleteTask(a)}}},[e._v("删除")])])])])}),e.tasks.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"6"}},[e._v('暂无任务,点击"新建任务"创建')])]):e._e()],2)])]),e.showDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[600px] max-h-[80vh] overflow-auto"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s(e.isEditing?"编辑任务":"新建任务"))]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:e.closeDialog}},[e._v("关闭")])]),t("div",{staticClass:"p-4 space-y-4"},[t("div",[e._m(1),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.name,expression:"form.name"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"text",placeholder:"任务名称"},domProps:{value:e.form.name},on:{input:function(a){a.target.composing||e.$set(e.form,"name",a.target.value)}}})]),t("div",[e._m(2),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.model,expression:"form.model"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"model",a.target.multiple?o:o[0])}}},e._l(e.models,function(a){return t("option",{key:a.id,domProps:{value:a.name}},[e._v(e._s(a.name))])}),0)]),t("div",[e._m(3),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.scheduleType,expression:"form.scheduleType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"scheduleType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"*/5 * * * *"}},[e._v("每5分钟")]),t("option",{attrs:{value:"*/30 * * * *"}},[e._v("每30分钟")]),t("option",{attrs:{value:"0 * * * *"}},[e._v("每小时")]),t("option",{attrs:{value:"0 */2 * * *"}},[e._v("每2小时")]),t("option",{attrs:{value:"0 */12 * * *"}},[e._v("每12小时")]),t("option",{attrs:{value:"0 0 * * *"}},[e._v("每天0点")]),t("option",{attrs:{value:"0 0 1 * *"}},[e._v("每月1日0点")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("通知方式")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.notifyType,expression:"form.notifyType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"notifyType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"message"}},[e._v("消息")]),t("option",{attrs:{value:"email"}},[e._v("邮件")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("关联技能")]),t("div",{staticClass:"flex flex-wrap gap-2"},e._l(e.availableSkills,function(a){return t("label",{key:a,staticClass:"flex items-center gap-1 text-xs text-textMuted cursor-pointer"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.skills,expression:"form.skills"}],staticClass:"accent-accent",attrs:{type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.form.skills)?e._i(e.form.skills,a)>-1:e.form.skills},on:{change:function(o){var r=e.form.skills,l=o.target,d=!!l.checked;if(Array.isArray(r)){var n=a,c=e._i(r,n);l.checked?c<0&&e.$set(e.form,"skills",r.concat([n])):c>-1&&e.$set(e.form,"skills",r.slice(0,c).concat(r.slice(c+1)))}else e.$set(e.form,"skills",d)}}}),e._v(" "+e._s(a)+" ")])}),0)]),t("div",[e._m(4),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.form.content,expression:"form.content"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded resize-none",attrs:{rows:"5",placeholder:"请描述任务内容..."},domProps:{value:e.form.content},on:{input:function(a){a.target.composing||e.$set(e.form,"content",a.target.value)}}})]),t("div",{staticClass:"flex items-center gap-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.enabled,expression:"form.enabled"}],staticClass:"accent-accent",attrs:{type:"checkbox",id:"taskEnabled"},domProps:{checked:Array.isArray(e.form.enabled)?e._i(e.form.enabled,null)>-1:e.form.enabled},on:{change:function(a){var o=e.form.enabled,r=a.target,l=!!r.checked;if(Array.isArray(o)){var d=null,n=e._i(o,d);r.checked?n<0&&e.$set(e.form,"enabled",o.concat([d])):n>-1&&e.$set(e.form,"enabled",o.slice(0,n).concat(o.slice(n+1)))}else e.$set(e.form,"enabled",l)}}}),t("label",{staticClass:"text-xs text-textMuted",attrs:{for:"taskEnabled"}},[e._v("立即启用")])])]),t("div",{staticClass:"px-4 py-3 border-t border-border flex justify-end gap-2"},[t("button",{staticClass:"px-4 py-1 text-textMuted text-sm rounded hover:bg-white/10",on:{click:e.closeDialog}},[e._v("取消")]),t("button",{staticClass:"px-4 py-1 bg-accent text-white text-sm rounded hover:bg-accent/80",on:{click:e.saveTask}},[e._v(" "+e._s(e.isEditing?"保存":"创建")+" ")])])])]):e._e(),e.showLogDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[900px] max-h-[80vh] overflow-hidden flex flex-col"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s((u=e.currentTask)==null?void 0:u.name)+" - 执行日志")]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:function(a){e.showLogDialog=!1}}},[e._v("关闭")])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(5),t("tbody",[e._l(e.logs,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.status==="success"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"},[e._v(" "+e._s(a.status==="success"?"成功":"失败")+" ")])]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatTime(a.executedAt)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatDuration(a.duration)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[400px]",attrs:{title:a.result}},[e._v(e._s(a.result||a.error||"-"))])])}),e.logs.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"4"}},[e._v("暂无执行记录")])]):e._e()],2)])])])]):e._e()])},f=[function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("名称")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("调度")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("技能")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("操作")])])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务名称 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("AI 模型 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("调度周期 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务内容 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("结果")])])])}],v=x(p,m,f,!1,null,null);const g=v.exports;export{g as default};
1
+ import{n as x,a as i}from"./index-BR2hcxRn.js";const b={"*/5 * * * *":"每5分钟","*/30 * * * *":"每30分钟","0 * * * *":"每小时","0 */2 * * *":"每2小时","0 */12 * * *":"每12小时","0 0 * * *":"每天0点","0 0 1 * *":"每月1日0点"},p={name:"TasksView",data(){return{tasks:[],models:[],availableSkills:[],showDialog:!1,showLogDialog:!1,isEditing:!1,currentTask:null,logs:[],form:{name:"",model:"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0}}},async created(){await this.loadTasks(),await this.loadModels(),await this.loadSkills()},methods:{async loadTasks(){try{const s=await i.getScheduledTasks();this.tasks=s.data||[]}catch(s){console.error("Load tasks failed:",s),this.$message.error("加载任务失败")}},async loadModels(){try{const s=await i.getModels();this.models=s.data||[],this.models.length>0&&!this.form.model&&(this.form.model=this.models[0].name)}catch(s){console.error("Load models failed:",s)}},async loadSkills(){var s;try{const e=await i.getSkills();this.availableSkills=((s=e.data)==null?void 0:s.map(t=>t.name))||[]}catch(e){console.error("Load skills failed:",e)}},formatSchedule(s){return b[s]||s},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"},openCreateDialog(){var s;this.isEditing=!1,this.form={name:"",model:((s=this.models[0])==null?void 0:s.name)||"gpt-4",scheduleType:"0 * * * *",notifyType:"message",skills:[],content:"",enabled:!0},this.showDialog=!0},openEditDialog(s){this.isEditing=!0,this.currentTask=s,this.form={name:s.name,model:s.model,scheduleType:s.scheduleType,notifyType:s.notifyType,skills:[...s.skills||[]],content:s.content,enabled:s.enabled},this.showDialog=!0},closeDialog(){this.showDialog=!1,this.currentTask=null},async saveTask(){if(!this.form.name||!this.form.content){this.$message.error("请填写必填项");return}try{this.isEditing&&this.currentTask?(await i.updateScheduledTask(this.currentTask.id,this.form),this.$message.success("任务已更新")):(await i.createScheduledTask(this.form),this.$message.success("任务已创建")),this.closeDialog(),await this.loadTasks()}catch(s){this.$message.error("保存失败: "+s.message)}},async deleteTask(s){if(confirm(`确定删除任务 "${s.name}" 吗?`))try{await i.deleteScheduledTask(s.id),this.$message.success("任务已删除"),await this.loadTasks()}catch(e){this.$message.error("删除失败: "+e.message)}},async startTask(s){try{await i.startScheduledTask(s.id),this.$message.success("任务已启动"),await this.loadTasks()}catch(e){this.$message.error("启动失败: "+e.message)}},async stopTask(s){try{await i.stopScheduledTask(s.id),this.$message.success("任务已停用"),await this.loadTasks()}catch(e){this.$message.error("停用失败: "+e.message)}},async runTask(s){try{await i.runTaskNow(s.id),this.$message.success("任务已开始执行")}catch(e){this.$message.error("执行失败: "+e.message)}},async openLogDialog(s){this.currentTask=s,this.showLogDialog=!0;try{const e=await i.getTaskLogs(s.id);this.logs=e.data||[]}catch(e){console.error("Load logs failed:",e),this.logs=[]}}}};var m=function(){var u;var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex flex-col overflow-hidden bg-[#1e1e1e]"},[t("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar shrink-0"},[t("div",{staticClass:"flex items-center justify-between"},[t("div",{staticClass:"flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-clock text-accent"}),t("span",{staticClass:"text-white font-medium"},[e._v("定时任务")]),t("span",{staticClass:"text-xs text-textMuted"},[e._v(e._s(e.tasks.length)+" 个任务")])]),t("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:e.openCreateDialog}},[t("i",{staticClass:"fa-solid fa-plus mr-1"}),e._v(" 新建任务 ")])])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(0),t("tbody",[e._l(e.tasks,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[a.enabled?t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-green-500/20 text-green-400"},[e._v("启用")]):t("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-gray-500/20 text-gray-400"},[e._v("停用")])]),t("td",{staticClass:"px-3 py-2 text-gray-200 border-b border-border/30"},[e._v(e._s(a.name))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(a.model))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatSchedule(a.scheduleType)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},e._l(a.skills,function(o){var r;return(r=a.skills)!=null&&r.length?t("span",{key:o,staticClass:"text-xs px-1 py-0.5 bg-blue-500/20 text-blue-400 rounded mr-1"},[e._v(e._s(o))]):t("span",{staticClass:"text-textMuted"},[e._v("-")])}),0),t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("div",{staticClass:"flex items-center gap-2"},[a.enabled?t("button",{staticClass:"text-xs px-2 py-1 text-yellow-400 hover:bg-yellow-500/20 rounded",on:{click:function(o){return e.stopTask(a)}}},[e._v("停用")]):t("button",{staticClass:"text-xs px-2 py-1 text-green-400 hover:bg-green-500/20 rounded",on:{click:function(o){return e.startTask(a)}}},[e._v("启动")]),t("button",{staticClass:"text-xs px-2 py-1 text-blue-400 hover:bg-blue-500/20 rounded",on:{click:function(o){return e.runTask(a)}}},[e._v("执行")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openLogDialog(a)}}},[e._v("日志")]),t("button",{staticClass:"text-xs px-2 py-1 text-gray-400 hover:bg-white/10 rounded",on:{click:function(o){return e.openEditDialog(a)}}},[e._v("编辑")]),t("button",{staticClass:"text-xs px-2 py-1 text-red-400 hover:bg-red-500/20 rounded",on:{click:function(o){return e.deleteTask(a)}}},[e._v("删除")])])])])}),e.tasks.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"6"}},[e._v('暂无任务,点击"新建任务"创建')])]):e._e()],2)])]),e.showDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[600px] max-h-[80vh] overflow-auto"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s(e.isEditing?"编辑任务":"新建任务"))]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:e.closeDialog}},[e._v("关闭")])]),t("div",{staticClass:"p-4 space-y-4"},[t("div",[e._m(1),t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.name,expression:"form.name"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"text",placeholder:"任务名称"},domProps:{value:e.form.name},on:{input:function(a){a.target.composing||e.$set(e.form,"name",a.target.value)}}})]),t("div",[e._m(2),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.model,expression:"form.model"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"model",a.target.multiple?o:o[0])}}},e._l(e.models,function(a){return t("option",{key:a.id,domProps:{value:a.name}},[e._v(e._s(a.name))])}),0)]),t("div",[e._m(3),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.scheduleType,expression:"form.scheduleType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"scheduleType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"*/5 * * * *"}},[e._v("每5分钟")]),t("option",{attrs:{value:"*/30 * * * *"}},[e._v("每30分钟")]),t("option",{attrs:{value:"0 * * * *"}},[e._v("每小时")]),t("option",{attrs:{value:"0 */2 * * *"}},[e._v("每2小时")]),t("option",{attrs:{value:"0 */12 * * *"}},[e._v("每12小时")]),t("option",{attrs:{value:"0 0 * * *"}},[e._v("每天0点")]),t("option",{attrs:{value:"0 0 1 * *"}},[e._v("每月1日0点")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("通知方式")]),t("select",{directives:[{name:"model",rawName:"v-model",value:e.form.notifyType,expression:"form.notifyType"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",on:{change:function(a){var o=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var l="_value"in r?r._value:r.value;return l});e.$set(e.form,"notifyType",a.target.multiple?o:o[0])}}},[t("option",{attrs:{value:"message"}},[e._v("消息")]),t("option",{attrs:{value:"email"}},[e._v("邮件")])])]),t("div",[t("label",{staticClass:"block text-xs text-textMuted mb-1"},[e._v("关联技能")]),t("div",{staticClass:"flex flex-wrap gap-2"},e._l(e.availableSkills,function(a){return t("label",{key:a,staticClass:"flex items-center gap-1 text-xs text-textMuted cursor-pointer"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.skills,expression:"form.skills"}],staticClass:"accent-accent",attrs:{type:"checkbox"},domProps:{value:a,checked:Array.isArray(e.form.skills)?e._i(e.form.skills,a)>-1:e.form.skills},on:{change:function(o){var r=e.form.skills,l=o.target,d=!!l.checked;if(Array.isArray(r)){var n=a,c=e._i(r,n);l.checked?c<0&&e.$set(e.form,"skills",r.concat([n])):c>-1&&e.$set(e.form,"skills",r.slice(0,c).concat(r.slice(c+1)))}else e.$set(e.form,"skills",d)}}}),e._v(" "+e._s(a)+" ")])}),0)]),t("div",[e._m(4),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.form.content,expression:"form.content"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded resize-none",attrs:{rows:"5",placeholder:"请描述任务内容..."},domProps:{value:e.form.content},on:{input:function(a){a.target.composing||e.$set(e.form,"content",a.target.value)}}})]),t("div",{staticClass:"flex items-center gap-2"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.enabled,expression:"form.enabled"}],staticClass:"accent-accent",attrs:{type:"checkbox",id:"taskEnabled"},domProps:{checked:Array.isArray(e.form.enabled)?e._i(e.form.enabled,null)>-1:e.form.enabled},on:{change:function(a){var o=e.form.enabled,r=a.target,l=!!r.checked;if(Array.isArray(o)){var d=null,n=e._i(o,d);r.checked?n<0&&e.$set(e.form,"enabled",o.concat([d])):n>-1&&e.$set(e.form,"enabled",o.slice(0,n).concat(o.slice(n+1)))}else e.$set(e.form,"enabled",l)}}}),t("label",{staticClass:"text-xs text-textMuted",attrs:{for:"taskEnabled"}},[e._v("立即启用")])])]),t("div",{staticClass:"px-4 py-3 border-t border-border flex justify-end gap-2"},[t("button",{staticClass:"px-4 py-1 text-textMuted text-sm rounded hover:bg-white/10",on:{click:e.closeDialog}},[e._v("取消")]),t("button",{staticClass:"px-4 py-1 bg-accent text-white text-sm rounded hover:bg-accent/80",on:{click:e.saveTask}},[e._v(" "+e._s(e.isEditing?"保存":"创建")+" ")])])])]):e._e(),e.showLogDialog?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[t("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[900px] max-h-[80vh] overflow-hidden flex flex-col"},[t("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0"},[t("h3",{staticClass:"text-white font-medium"},[e._v(e._s((u=e.currentTask)==null?void 0:u.name)+" - 执行日志")]),t("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:function(a){e.showLogDialog=!1}}},[e._v("关闭")])]),t("div",{staticClass:"flex-1 overflow-auto p-4"},[t("table",{staticClass:"w-full text-sm"},[e._m(5),t("tbody",[e._l(e.logs,function(a){return t("tr",{key:a.id,staticClass:"hover:bg-white/5"},[t("td",{staticClass:"px-3 py-2 border-b border-border/30"},[t("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.status==="success"?"bg-green-500/20 text-green-400":"bg-red-500/20 text-red-400"},[e._v(" "+e._s(a.status==="success"?"成功":"失败")+" ")])]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatTime(a.executedAt)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[e._v(e._s(e.formatDuration(a.duration)))]),t("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[400px]",attrs:{title:a.result}},[e._v(e._s(a.result||a.error||"-"))])])}),e.logs.length===0?t("tr",[t("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"4"}},[e._v("暂无执行记录")])]):e._e()],2)])])])]):e._e()])},f=[function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("名称")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("调度")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("技能")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("操作")])])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务名称 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("AI 模型 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("调度周期 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("任务内容 "),e("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,e=s._self._c;return e("thead",{staticClass:"bg-sidebar sticky top-0"},[e("tr",[e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("状态")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),e("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("结果")])])])}],v=x(p,m,f,!1,null,null);const g=v.exports;export{g as default};
@@ -1,4 +1,4 @@
1
- import{n as pe,a as re}from"./index-CztsEf_z.js";var ge={exports:{}};(function(N,F){(function(j,Y){N.exports=Y()})(self,()=>(()=>{var j={4567:function(O,r,a){var c=this&&this.__decorate||function(i,o,l,v){var m,h=arguments.length,p=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,l,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(p=(h<3?m(p):h>3?m(o,l,p):m(o,l))||p);return h>3&&p&&Object.defineProperty(o,l,p),p},_=this&&this.__param||function(i,o){return function(l,v){o(l,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),g=a(844),u=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(i,o){super(),this._terminal=i,this._renderService=o,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(l=>this._handleResize(l.rows))),this.register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(l=>this._handleChar(l))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
1
+ import{n as pe,a as re}from"./index-BR2hcxRn.js";var ge={exports:{}};(function(N,F){(function(j,Y){N.exports=Y()})(self,()=>(()=>{var j={4567:function(O,r,a){var c=this&&this.__decorate||function(i,o,l,v){var m,h=arguments.length,p=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,l,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(p=(h<3?m(p):h>3?m(o,l,p):m(o,l))||p);return h>3&&p&&Object.defineProperty(o,l,p),p},_=this&&this.__param||function(i,o){return function(l,v){o(l,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),g=a(844),u=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends g.Disposable{constructor(i,o){super(),this._terminal=i,this._renderService=o,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(l=>this._handleResize(l.rows))),this.register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(l=>this._handleChar(l))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
2
  `))),this.register(this._terminal.onA11yTab(l=>this._handleTab(l))),this.register(this._terminal.onKey(l=>this._handleKey(l.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new u.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,s.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,g.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let o=0;o<i;o++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
3
3
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const l=this._terminal.buffer,v=l.lines.length.toString();for(let m=i;m<=o;m++){const h=l.translateBufferLineToString(l.ydisp+m,!0),p=(l.ydisp+m+1).toString(),b=this._rowElements[m];b&&(h.length===0?b.innerText=" ":b.textContent=h,b.setAttribute("aria-posinset",p),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const l=i.target,v=this._rowElements[o===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==v)return;let m,h;if(o===0?(m=l,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=l,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=c([_(1,e.IRenderService)],t)},3614:(O,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function c(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function _(d,f,g,u){d=c(d=a(d),g.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),f.value=""}function n(d,f,g){const u=g.getBoundingClientRect(),e=d.clientX-u.left-10,s=d.clientY-u.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=c,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,g,u){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),f,g,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,g,u,e){n(d,f,g),e&&u.rightClickSelect(d),f.value=u.selectionText,f.select()}},7239:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=a(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,c,_,n){a.addEventListener(c,_,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(c,_,n))}}}},6465:function(O,r,a){var c=this&&this.__decorate||function(e,s,t,i){var o,l=arguments.length,v=l<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(l<3?o(v):l>3?o(s,t,v):o(s,t))||v);return l>3&&v&&Object.defineProperty(s,t,v),v},_=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=a(3656),d=a(8460),f=a(844),g=a(2585);let u=r.Linkifier2=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const t=e.composedPath();for(let i=0;i<t.length;i++){const o=t[i];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,s){var t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach(l=>{l==null||l.forEach(v=>{v.link.dispose&&v.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let o=!1;for(const[l,v]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(l)&&(o=this._checkLinkProviderResult(l,e,o)):v.provideLinks(e.y,m=>{var h,p;if(this._isMouseOut)return;const b=m==null?void 0:m.map(L=>({link:L}));(h=this._activeProviderReplies)===null||h===void 0||h.set(l,b),o=this._checkLinkProviderResult(l,e,o),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const o=s.get(i);if(o)for(let l=0;l<o.length;l++){const v=o[l],m=v.link.range.start.y<e?0:v.link.range.start.x,h=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let p=m;p<=h;p++){if(t.has(p)){o.splice(l--,1);break}t.add(p)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const o=this._activeProviderReplies.get(e);let l=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(l=!0);if(!l&&o){const v=o.find(m=>this._linkAtPosition(m.link,s));v&&(t=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let v=0;v<this._activeProviderReplies.size;v++){const m=(i=this._activeProviderReplies.get(v))===null||i===void 0?void 0:i.find(h=>this._linkAtPosition(h.link,s));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,o;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((o=this._element)===null||o===void 0||o.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,o,l;!((i=this._currentLink)===null||i===void 0)&&i.state&&((l=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||l===void 0?void 0:l.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent&&this._element)){const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=s.y*this._bufferService.cols+s.x;return t<=o&&o<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,o){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:o}}};r.Linkifier2=u=c([_(0,g.IBufferService)],u)},9042:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,r,a){var c=this&&this.__decorate||function(u,e,s,t){var i,o=arguments.length,l=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,e,s,t);else for(var v=u.length-1;v>=0;v--)(i=u[v])&&(l=(o<3?i(l):o>3?i(e,s,l):i(e,s))||l);return o>3&&l&&Object.defineProperty(e,s,l),l},_=this&&this.__param||function(u,e){return function(s,t){e(s,t,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=r.OscLinkProvider=class{constructor(u,e,s){this._bufferService=u,this._optionsService=e,this._oscLinkService=s}provideLinks(u,e){var s;const t=this._bufferService.buffer.lines.get(u-1);if(!t)return void e(void 0);const i=[],o=this._optionsService.rawOptions.linkHandler,l=new n.CellData,v=t.getTrimmedLength();let m=-1,h=-1,p=!1;for(let b=0;b<v;b++)if(h!==-1||t.hasContent(b)){if(t.loadCell(b,l),l.hasExtendedAttrs()&&l.extended.urlId){if(h===-1){h=b,m=l.extended.urlId;continue}p=l.extended.urlId!==m}else h!==-1&&(p=!0);if(p||h!==-1&&b===v-1){const L=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(L){const y={start:{x:h+1,y:u},end:{x:b+(p||b!==v-1?0:1),y:u}};let k=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const x=new URL(L);["http:","https:"].includes(x.protocol)||(k=!0)}catch{k=!0}k||i.push({text:L,range:y,activate:(x,T)=>o?o.activate(x,T,y):g(0,T),hover:(x,T)=>{var P;return(P=o==null?void 0:o.hover)===null||P===void 0?void 0:P.call(o,x,T,y)},leave:(x,T)=>{var P;return(P=o==null?void 0:o.leave)===null||P===void 0?void 0:P.call(o,x,T,y)}})}p=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=b,m=l.extended.urlId):(h=-1,m=-1)}}e(i)}};function g(u,e){if(confirm(`Do you want to navigate to ${e}?
4
4
 
@@ -1,4 +1,4 @@
1
- import{m as et}from"./index-CztsEf_z.js";/*!-----------------------------------------------------------------------------
1
+ import{m as et}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as f}from"./index-CztsEf_z.js";/*!-----------------------------------------------------------------------------
1
+ import{m as f}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as l}from"./index-CztsEf_z.js";/*!-----------------------------------------------------------------------------
1
+ import{m as l}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as s}from"./index-CztsEf_z.js";/*!-----------------------------------------------------------------------------
1
+ import{m as s}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as lt}from"./index-CztsEf_z.js";/*!-----------------------------------------------------------------------------
1
+ import{m as lt}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license