tianxincode 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -200
- package/dist/cli/commands.js +18 -18
- package/dist/core/ai/agents/caller/prompts/role.txt +50 -50
- package/dist/core/ai/agents/chat/chat.agent.js +30 -30
- package/dist/core/ai/agents/chat/prompts/role.txt +30 -30
- package/dist/core/ai/agents/code/code.agent.js +6 -6
- package/dist/core/ai/agents/code/prompts/role.txt +50 -50
- package/dist/core/ai/agents/common/prompt/role.txt +51 -51
- package/dist/core/ai/agents/common/prompts.js +26 -26
- package/dist/core/ai/agents/design/design.agent.js +6 -6
- package/dist/core/ai/agents/design/prompts/role.txt +36 -36
- package/dist/core/ai/agents/dream/prompts/init.txt +20 -20
- package/dist/core/ai/agents/mem/mem.agent.js +5 -5
- package/dist/core/ai/agents/mem/prompts/role.txt +35 -35
- package/dist/core/ai/agents/skill/prompts/role.txt +61 -61
- package/dist/core/ai/agents/skill/skill.agent.js +26 -26
- package/dist/core/ai/agents/summarizer/prompts/role.txt +30 -30
- package/dist/core/ai/agents/task/prompts/role.txt +50 -50
- package/dist/core/ai/agents/task/task.agent.js +30 -30
- package/dist/core/ai/provider/deepseek.provider.js +1 -1
- package/dist/core/ai/provider/deepseek.provider.js.map +1 -1
- package/dist/core/ai/provider/openai.provider.js +1 -1
- package/dist/core/ai/provider/openai.provider.js.map +1 -1
- package/dist/core/db/db.service.d.ts.map +1 -1
- package/dist/core/db/db.service.js +3 -1
- package/dist/core/db/db.service.js.map +1 -1
- package/dist/core/db/init_sql/ai_log.init.js +15 -15
- package/dist/core/db/init_sql/code_snippet.init.js +11 -11
- package/dist/core/db/init_sql/config.init.js +15 -15
- package/dist/core/db/init_sql/custom_action.init.js +10 -10
- package/dist/core/db/init_sql/dingding.init.js +9 -9
- package/dist/core/db/init_sql/email.init.js +14 -14
- package/dist/core/db/init_sql/lsp.init.js +8 -8
- package/dist/core/db/init_sql/message_file.init.js +11 -11
- package/dist/core/db/init_sql/project.init.js +20 -20
- package/dist/core/db/init_sql/provider.init.js +35 -35
- package/dist/core/db/init_sql/scheduler.init.js +32 -32
- package/dist/core/db/init_sql/session.init.js +23 -23
- package/dist/core/db/init_sql/spec.init.js +15 -15
- package/dist/core/db/init_sql/waf_gateway.init.js +9 -9
- package/dist/core/db/init_sql/zihao.init.js +11 -11
- package/dist/core/lsp/sql.js +11 -11
- package/dist/core/tools/provider/bash.txt +47 -47
- package/dist/core/tools/provider/code_search.txt +20 -20
- package/dist/core/tools/provider/edit_file.txt +13 -13
- package/dist/core/tools/provider/glob.txt +12 -12
- package/dist/core/tools/provider/grep.txt +14 -14
- package/dist/core/tools/provider/lsp.txt +19 -19
- package/dist/core/tools/provider/memory.txt +21 -21
- package/dist/core/tools/provider/read_file.txt +17 -17
- package/dist/core/tools/provider/todo_read.txt +16 -16
- package/dist/core/tools/provider/todo_write.txt +48 -48
- package/dist/core/tools/provider/web_fetch.txt +17 -17
- package/dist/core/tools/provider/web_search.txt +18 -18
- package/dist/core/tools/provider/write_file.txt +11 -11
- package/dist/gateway/api/skill/detail_skill.d.ts.map +1 -1
- package/dist/gateway/api/skill/detail_skill.js +7 -5
- package/dist/gateway/api/skill/detail_skill.js.map +1 -1
- package/dist/gateway/cli/commands.js +18 -18
- package/dist/modules/ai/agents/chat/prompts/role.txt +30 -30
- package/dist/modules/ai/agents/code/prompts/role.txt +50 -50
- package/dist/modules/ai/agents/mem/prompts/role.txt +35 -35
- package/dist/modules/ai/agents/skill/prompts/role.txt +61 -61
- package/dist/modules/ai/agents/task/prompts/role.txt +50 -50
- package/dist/modules/ai/ai-log.service.js +10 -10
- package/dist/modules/ai/provider/openai/prompt/role.txt +51 -51
- package/dist/modules/ai/summarizer/summarizer.prompts.js +30 -30
- package/dist/modules/config/config.service.js +5 -5
- package/dist/modules/db/db.service.js +252 -252
- package/dist/modules/email/email.config.repository.js +1 -1
- package/dist/modules/repositories/project.repository.d.ts +28 -0
- package/dist/modules/repositories/project.repository.d.ts.map +1 -0
- package/dist/modules/repositories/project.repository.js +47 -0
- package/dist/modules/repositories/project.repository.js.map +1 -0
- package/dist/modules/scheduler/task-log.service.js +1 -1
- package/dist/modules/services/project/project.service.d.ts +14 -0
- package/dist/modules/services/project/project.service.d.ts.map +1 -0
- package/dist/modules/services/project/project.service.js +47 -0
- package/dist/modules/services/project/project.service.js.map +1 -0
- package/dist/modules/skill/skill.txt +36 -36
- package/dist/modules/spec/spec.injector.js +24 -24
- package/dist/modules/tools/provider/bash.txt +47 -47
- package/dist/modules/tools/provider/code_search.txt +20 -20
- package/dist/modules/tools/provider/edit_file.txt +13 -13
- package/dist/modules/tools/provider/glob.txt +12 -12
- package/dist/modules/tools/provider/grep.txt +14 -14
- package/dist/modules/tools/provider/lsp.txt +19 -19
- package/dist/modules/tools/provider/memory.txt +21 -21
- package/dist/modules/tools/provider/read_file.txt +17 -17
- package/dist/modules/tools/provider/todo_read.txt +16 -16
- package/dist/modules/tools/provider/todo_write.txt +48 -48
- package/dist/modules/tools/provider/web_fetch.txt +17 -17
- package/dist/modules/tools/provider/web_search.txt +18 -18
- package/dist/modules/tools/provider/write_file.txt +11 -11
- package/dist/modules/waf-gateway/waf-gateway.module.js +8 -8
- package/dist/modules/waf-gateway/waf-gateway.service.js +12 -12
- package/dist/repositories/project.repository.d.ts +28 -0
- package/dist/repositories/project.repository.d.ts.map +1 -0
- package/dist/repositories/project.repository.js +47 -0
- package/dist/repositories/project.repository.js.map +1 -0
- package/dist/repository/ai_log.repository.js +1 -1
- package/dist/repository/config.repository.js +5 -5
- package/dist/repository/email.repository.js +1 -1
- package/dist/repository/memory.repository.js +1 -1
- package/dist/repository/project.repository.js +3 -3
- package/dist/repository/scheduler.repository.js +2 -2
- package/dist/repository/session.repository.js +1 -1
- package/dist/repository/zihao-config.repository.js +1 -1
- package/dist/services/skill/skill.tool.d.ts.map +1 -1
- package/dist/services/skill/skill.tool.js +6 -1
- package/dist/services/skill/skill.tool.js.map +1 -1
- package/dist/services/skill/skill.txt +36 -36
- package/package.json +76 -76
- package/scripts/copy-txt.js +31 -31
- package/scripts/ink-scroll-demo.tsx +147 -147
- package/tsconfig.test.json +9 -9
- package/web/dist/assets/{ConfirmDialog-B2bVsPFI.js → ConfirmDialog-B03GcCHQ.js} +1 -1
- package/web/dist/assets/PcLayout-CYW3zqcs.css +1 -0
- package/web/dist/assets/{PcLayout-DeXNBHu2.js → PcLayout-ZTdJNg7G.js} +1 -1
- package/web/dist/assets/{aiLogsView-JvjhLmyo.js → aiLogsView-Bt8Xg1Qx.js} +1 -1
- package/web/dist/assets/{cssMode-sYHhwUZh.js → cssMode-CBb6D87U.js} +1 -1
- package/web/dist/assets/{customActionsView-Cvmzxvl4.js → customActionsView-DdjnHzwm.js} +1 -1
- package/web/dist/assets/deployView-CD7ji9IS.css +1 -0
- package/web/dist/assets/{deployView-CjV4ySrf.js → deployView-Cj51_Job.js} +1 -1
- package/web/dist/assets/designView-C3pSX4nP.css +1 -0
- package/web/dist/assets/designView-RT8tKEN9.js +18 -0
- package/web/dist/assets/devWorkflowView-BTozmaiN.js +36 -0
- package/web/dist/assets/devWorkflowView-DYhIfbCB.css +1 -0
- package/web/dist/assets/devWorkflowViewApp-CErbhC2s.css +1 -0
- package/web/dist/assets/{devWorkflowViewApp-DPlFgiS_.js → devWorkflowViewApp-DLslXEq9.js} +3 -3
- package/web/dist/assets/{fileZihao-DvZmuTYu.js → fileZihao-CtZ4bUIH.js} +1 -1
- package/web/dist/assets/{freemarker2-DTyAQBBj.js → freemarker2-CX3jc3l2.js} +1 -1
- package/web/dist/assets/gitChanges-D6QxPcii.css +1 -0
- package/web/dist/assets/{gitChanges-Cpf4HHoF.js → gitChanges-DFRvzL5I.js} +1 -1
- package/web/dist/assets/gitChangesApp-Bjn-MCmr.css +1 -0
- package/web/dist/assets/{gitChangesApp-BOURDd_l.js → gitChangesApp-ZI7-V8oB.js} +2 -2
- package/web/dist/assets/{handlebars-DiWIXxOG.js → handlebars-CTaQD6FN.js} +1 -1
- package/web/dist/assets/{html-BCQWkFzH.js → html-BruJsfYv.js} +1 -1
- package/web/dist/assets/{htmlMode-BbMA34cR.js → htmlMode-wewroXLr.js} +1 -1
- package/web/dist/assets/{index-C_tz4Wda.css → index-C0xmVTIn.css} +1 -1
- package/web/dist/assets/{index-C7axH05o.js → index-Cn73hS12.js} +9 -9
- package/web/dist/assets/{javascript-By4MYHaO.js → javascript-B4ku8P1-.js} +1 -1
- package/web/dist/assets/{jsonMode-5JIz7tDN.js → jsonMode-BIvVuBMG.js} +1 -1
- package/web/dist/assets/{liquid-BQBVii4f.js → liquid-Bo3G0Ep7.js} +1 -1
- package/web/dist/assets/{mdx-Cwk7nqzM.js → mdx-Duv0ylZz.js} +1 -1
- package/web/dist/assets/{mediaChat-DivTDoIv.js → mediaChat-RT7iqqYb.js} +1 -1
- package/web/dist/assets/{python-L_kGfe1T.js → python-CEhCctGm.js} +1 -1
- package/web/dist/assets/{razor-XGuHliMI.js → razor-DPK8nTD7.js} +1 -1
- package/web/dist/assets/{taskView-BcJ3LAxp.js → taskView-sOyebRqn.js} +1 -1
- package/web/dist/assets/{terminalView-q-UKzK0M.js → terminalView-GTYtDlus.js} +2 -2
- package/web/dist/assets/{terminalView-CQVYh6D3.css → terminalView-eZ0agsPP.css} +1 -1
- package/web/dist/assets/{tsMode-SuiD3mJa.js → tsMode-BZvUU1nf.js} +1 -1
- package/web/dist/assets/{typescript-DJcyqRjT.js → typescript-CmEn-k1B.js} +1 -1
- package/web/dist/assets/{wikiView-ygHSGyPp.css → wikiView-C-oqMnJM.css} +1 -1
- package/web/dist/assets/{wikiView-B3GIPUlD.js → wikiView-CRjg-cZ8.js} +1 -1
- package/web/dist/assets/{xml-DQgCzk55.js → xml-bjvdKeyy.js} +1 -1
- package/web/dist/assets/{yaml-DBdEYBPA.js → yaml-N5RXWxJk.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/package.json +28 -28
- package/dist/modules/ai/react/index.d.ts +0 -5
- package/dist/modules/ai/react/index.d.ts.map +0 -1
- package/dist/modules/ai/react/index.js +0 -4
- package/dist/modules/ai/react/index.js.map +0 -1
- package/dist/modules/ai/react/prompt/role.txt +0 -51
- package/dist/modules/ai/react/provider.parser.d.ts +0 -20
- package/dist/modules/ai/react/provider.parser.d.ts.map +0 -1
- package/dist/modules/ai/react/provider.parser.js +0 -88
- package/dist/modules/ai/react/provider.parser.js.map +0 -1
- package/dist/modules/ai/react/react.parser.d.ts +0 -80
- package/dist/modules/ai/react/react.parser.d.ts.map +0 -1
- package/dist/modules/ai/react/react.parser.js +0 -365
- package/dist/modules/ai/react/react.parser.js.map +0 -1
- package/dist/modules/ai/react/react.prompts.d.ts +0 -26
- package/dist/modules/ai/react/react.prompts.d.ts.map +0 -1
- package/dist/modules/ai/react/react.prompts.js +0 -170
- package/dist/modules/ai/react/react.prompts.js.map +0 -1
- package/dist/modules/ai/react/react.types.d.ts +0 -50
- package/dist/modules/ai/react/react.types.d.ts.map +0 -1
- package/dist/modules/ai/react/react.types.js +0 -2
- package/dist/modules/ai/react/react.types.js.map +0 -1
- package/dist/modules/ai/react/react.validator.d.ts +0 -14
- package/dist/modules/ai/react/react.validator.d.ts.map +0 -1
- package/dist/modules/ai/react/react.validator.js +0 -53
- package/dist/modules/ai/react/react.validator.js.map +0 -1
- package/dist/modules/ai/react.agent.d.ts +0 -82
- package/dist/modules/ai/react.agent.d.ts.map +0 -1
- package/dist/modules/ai/react.agent.js +0 -220
- package/dist/modules/ai/react.agent.js.map +0 -1
- package/dist/modules/skill/skill.service.d.ts +0 -72
- package/dist/modules/skill/skill.service.d.ts.map +0 -1
- package/dist/modules/skill/skill.service.js +0 -283
- package/dist/modules/skill/skill.service.js.map +0 -1
- package/dist/modules/tools/builtin/bash.d.ts +0 -3
- package/dist/modules/tools/builtin/bash.d.ts.map +0 -1
- package/dist/modules/tools/builtin/bash.js +0 -126
- package/dist/modules/tools/builtin/bash.js.map +0 -1
- package/dist/modules/tools/builtin/bash.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/bash.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/bash.tool.js +0 -52
- package/dist/modules/tools/builtin/bash.tool.js.map +0 -1
- package/dist/modules/tools/builtin/bash.txt +0 -69
- package/dist/modules/tools/builtin/code_search.d.ts +0 -3
- package/dist/modules/tools/builtin/code_search.d.ts.map +0 -1
- package/dist/modules/tools/builtin/code_search.js +0 -86
- package/dist/modules/tools/builtin/code_search.js.map +0 -1
- package/dist/modules/tools/builtin/code_search.txt +0 -41
- package/dist/modules/tools/builtin/edit-file.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/edit-file.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/edit-file.tool.js +0 -58
- package/dist/modules/tools/builtin/edit-file.tool.js.map +0 -1
- package/dist/modules/tools/builtin/edit_file.d.ts +0 -3
- package/dist/modules/tools/builtin/edit_file.d.ts.map +0 -1
- package/dist/modules/tools/builtin/edit_file.js +0 -105
- package/dist/modules/tools/builtin/edit_file.js.map +0 -1
- package/dist/modules/tools/builtin/edit_file.txt +0 -61
- package/dist/modules/tools/builtin/glob.d.ts +0 -3
- package/dist/modules/tools/builtin/glob.d.ts.map +0 -1
- package/dist/modules/tools/builtin/glob.js +0 -85
- package/dist/modules/tools/builtin/glob.js.map +0 -1
- package/dist/modules/tools/builtin/glob.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/glob.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/glob.tool.js +0 -81
- package/dist/modules/tools/builtin/glob.tool.js.map +0 -1
- package/dist/modules/tools/builtin/glob.txt +0 -33
- package/dist/modules/tools/builtin/grep.d.ts +0 -3
- package/dist/modules/tools/builtin/grep.d.ts.map +0 -1
- package/dist/modules/tools/builtin/grep.js +0 -94
- package/dist/modules/tools/builtin/grep.js.map +0 -1
- package/dist/modules/tools/builtin/grep.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/grep.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/grep.tool.js +0 -96
- package/dist/modules/tools/builtin/grep.tool.js.map +0 -1
- package/dist/modules/tools/builtin/grep.txt +0 -37
- package/dist/modules/tools/builtin/index.d.ts +0 -8
- package/dist/modules/tools/builtin/index.d.ts.map +0 -1
- package/dist/modules/tools/builtin/index.js +0 -80
- package/dist/modules/tools/builtin/index.js.map +0 -1
- package/dist/modules/tools/builtin/lsp.d.ts +0 -7
- package/dist/modules/tools/builtin/lsp.d.ts.map +0 -1
- package/dist/modules/tools/builtin/lsp.js +0 -126
- package/dist/modules/tools/builtin/lsp.js.map +0 -1
- package/dist/modules/tools/builtin/lsp.txt +0 -45
- package/dist/modules/tools/builtin/memory.d.ts +0 -3
- package/dist/modules/tools/builtin/memory.d.ts.map +0 -1
- package/dist/modules/tools/builtin/memory.js +0 -77
- package/dist/modules/tools/builtin/memory.js.map +0 -1
- package/dist/modules/tools/builtin/memory.txt +0 -58
- package/dist/modules/tools/builtin/read-file.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/read-file.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/read-file.tool.js +0 -46
- package/dist/modules/tools/builtin/read-file.tool.js.map +0 -1
- package/dist/modules/tools/builtin/read_file.d.ts +0 -3
- package/dist/modules/tools/builtin/read_file.d.ts.map +0 -1
- package/dist/modules/tools/builtin/read_file.js +0 -107
- package/dist/modules/tools/builtin/read_file.js.map +0 -1
- package/dist/modules/tools/builtin/read_file.txt +0 -38
- package/dist/modules/tools/builtin/todo_read.d.ts +0 -6
- package/dist/modules/tools/builtin/todo_read.d.ts.map +0 -1
- package/dist/modules/tools/builtin/todo_read.js +0 -25
- package/dist/modules/tools/builtin/todo_read.js.map +0 -1
- package/dist/modules/tools/builtin/todo_read.txt +0 -34
- package/dist/modules/tools/builtin/todo_write.d.ts +0 -6
- package/dist/modules/tools/builtin/todo_write.d.ts.map +0 -1
- package/dist/modules/tools/builtin/todo_write.js +0 -46
- package/dist/modules/tools/builtin/todo_write.js.map +0 -1
- package/dist/modules/tools/builtin/todo_write.txt +0 -67
- package/dist/modules/tools/builtin/web_fetch.d.ts +0 -3
- package/dist/modules/tools/builtin/web_fetch.d.ts.map +0 -1
- package/dist/modules/tools/builtin/web_fetch.js +0 -52
- package/dist/modules/tools/builtin/web_fetch.js.map +0 -1
- package/dist/modules/tools/builtin/web_fetch.txt +0 -38
- package/dist/modules/tools/builtin/web_search.d.ts +0 -3
- package/dist/modules/tools/builtin/web_search.d.ts.map +0 -1
- package/dist/modules/tools/builtin/web_search.js +0 -100
- package/dist/modules/tools/builtin/web_search.js.map +0 -1
- package/dist/modules/tools/builtin/web_search.txt +0 -43
- package/dist/modules/tools/builtin/write-file.tool.d.ts +0 -6
- package/dist/modules/tools/builtin/write-file.tool.d.ts.map +0 -1
- package/dist/modules/tools/builtin/write-file.tool.js +0 -38
- package/dist/modules/tools/builtin/write-file.tool.js.map +0 -1
- package/dist/modules/tools/builtin/write_file.d.ts +0 -3
- package/dist/modules/tools/builtin/write_file.d.ts.map +0 -1
- package/dist/modules/tools/builtin/write_file.js +0 -61
- package/dist/modules/tools/builtin/write_file.js.map +0 -1
- package/dist/modules/tools/builtin/write_file.txt +0 -58
- package/dist/modules/tools/provider/openai/tools.d.ts +0 -3
- package/dist/modules/tools/provider/openai/tools.d.ts.map +0 -1
- package/dist/modules/tools/provider/openai/tools.js +0 -212
- package/dist/modules/tools/provider/openai/tools.js.map +0 -1
- package/dist/modules/tools/provider/skill.d.ts +0 -6
- package/dist/modules/tools/provider/skill.d.ts.map +0 -1
- package/dist/modules/tools/provider/skill.js +0 -64
- package/dist/modules/tools/provider/skill.js.map +0 -1
- package/web/dist/assets/PcLayout-L-XuK1oQ.css +0 -1
- package/web/dist/assets/deployView-hCh3_M8H.css +0 -1
- package/web/dist/assets/designView-CqZ75hOS.css +0 -1
- package/web/dist/assets/designView-DrUNRVEE.js +0 -18
- package/web/dist/assets/devWorkflowView-BpdJTMEb.js +0 -36
- package/web/dist/assets/devWorkflowView-D7EKjoLj.css +0 -1
- package/web/dist/assets/devWorkflowViewApp-BYYMIdCm.css +0 -1
- package/web/dist/assets/gitChanges-BYj-Y2K-.css +0 -1
- package/web/dist/assets/gitChangesApp-Btw-XKcP.css +0 -1
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{n as l,a as r,C as h,f,R as u,I as p,S as m,F as g,c as v,M as b,g as x,s as C,b as w,e as y,K as _,d as P}from"./index-C7axH05o.js";import{m as S}from"./mediaChat-DivTDoIv.js";const k={name:"CreatePageDialog",props:{visible:{type:Boolean,default:!1},targetPath:{type:String,default:""}},data(){return{pageName:"",pageType:"web",deviceTypes:[{value:"app",label:"App",icon:"fa-solid fa-mobile-screen"},{value:"web",label:"Web",icon:"fa-solid fa-desktop"},{value:"pad",label:"Pad",icon:"fa-solid fa-tablet-screen-button"}]}},computed:{previewFilename(){return`${this.pageName.trim()||"untitled"}_${this.pageType}.html`}},watch:{visible(s){s&&(this.pageName="",this.pageType="web",this.$nextTick(()=>{var e;return(e=this.$refs.nameInput)==null?void 0:e.focus()}))}},methods:{async confirm(){const s=this.pageName.trim();if(!s)return;const e=`${s}_${this.pageType}.html`,t=this.targetPath.includes("\\")?"\\":"/",i=this.targetPath+t+e,a=`<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>${s}</title>
|
|
7
|
-
<style>
|
|
8
|
-
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
-
body { font-family: system-ui, sans-serif; padding: 20px; }
|
|
10
|
-
</style>
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<h1>${s}</h1>
|
|
14
|
-
</body>
|
|
15
|
-
</html>`;try{await r.writeFile(i,a),this.$message.success("网页创建成功"),this.$emit("created"),this.$emit("update:visible",!1)}catch(n){console.error("Create page failed:",n),this.$message.error("创建网页失败: "+(n.message||"未知错误"))}},cancel(){this.$emit("update:visible",!1)}}};var D=function(){var e=this,t=e._self._c;return e.visible?t("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(i){return i.target!==i.currentTarget?null:e.cancel.apply(null,arguments)}}},[t("div",{staticClass:"bg-sidebar border border-border rounded p-5 w-96"},[t("p",{staticClass:"text-white text-sm font-medium mb-4"},[e._v("新建网页")]),t("div",{staticClass:"mb-3"},[t("label",{staticClass:"text-textMuted text-xs block mb-1"},[e._v("名称")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.pageName,expression:"pageName"}],ref:"nameInput",staticClass:"w-full px-3 py-2 bg-[#1e1e1e] border border-border rounded text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:"输入网页名称"},domProps:{value:e.pageName},on:{keyup:[function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.confirm.apply(null,arguments)},function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"escape",void 0,i.key,void 0)?null:e.cancel.apply(null,arguments)}],input:function(i){i.target.composing||(e.pageName=i.target.value)}}})]),t("div",{staticClass:"mb-3"},[t("label",{staticClass:"text-textMuted text-xs block mb-2"},[e._v("类型")]),t("div",{staticClass:"flex gap-2"},e._l(e.deviceTypes,function(i){return t("label",{key:i.value,staticClass:"flex items-center gap-1 px-3 py-2 rounded border text-sm cursor-pointer transition-colors",class:e.pageType===i.value?"border-accent bg-accent/10 text-white":"border-border text-textMuted hover:border-gray-500"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.pageType,expression:"pageType"}],staticClass:"hidden",attrs:{type:"radio"},domProps:{value:i.value,checked:e._q(e.pageType,i.value)},on:{change:function(a){e.pageType=i.value}}}),t("i",{staticClass:"text-xs",class:i.icon}),e._v(" "+e._s(i.label)+" ")])}),0)]),t("div",{staticClass:"mb-4 p-3 bg-[#1e1e1e] rounded border border-border"},[t("p",{staticClass:"text-xs text-textMuted mb-1"},[e._v("文件名预览")]),t("p",{staticClass:"text-xs text-textMain font-mono"},[e._v(e._s(e.previewFilename))])]),t("div",{staticClass:"flex justify-end gap-2"},[t("button",{staticClass:"px-3 py-1 text-xs text-textMuted hover:text-white",on:{click:e.cancel}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",attrs:{disabled:!e.pageName.trim()},on:{click:e.confirm}},[e._v("确定")])])])]):e._e()},M=[],F=l(k,D,M,!1,null,null);const $=F.exports,T={name:"DesignPageTree",components:{FileTreeNode:f,CreatePageDialog:$,CopyPathDialog:h},props:{basePath:{type:String,default:".txcode/design"}},data(){return{browseResult:{current_path:"",parent_path:null,items:[]},selectedPath:"",loading:!1,expandedPaths:new Set,contextMenu:{visible:!1,x:0,y:0,target:null},renameDialog:{visible:!1,title:"",value:"",placeholder:"",target:null,action:"rename"},createPageDialogVisible:!1,createPageTargetPath:""}},computed:{fileTreeData(){return this.browseResult.items.filter(e=>e.name!=="session.json").map(e=>({name:e.name,path:e.path,is_directory:e.is_directory,is_drive:e.is_drive||!1,size:e.size,has_children:e.is_directory,expanded:!1,children:[]})).sort((e,t)=>e.is_directory===t.is_directory?e.name.localeCompare(t.name):e.is_directory?-1:1)}},async created(){await this.initBrowse(),document.addEventListener("click",this.hideContextMenu)},beforeDestroy(){document.removeEventListener("click",this.hideContextMenu)},methods:{async initBrowse(){this.loading=!0;try{const s=await r.browseFilesystem(this.basePath);this.browseResult=s.data}catch{try{await r.createDirectory(this.basePath);const e=await r.browseFilesystem(this.basePath);this.browseResult=e.data}catch(e){console.error("Init design directory failed:",e),this.browseResult={current_path:this.basePath,parent_path:"",items:[]}}}finally{this.loading=!1}},async browse(s){this.loading=!0;try{const e=await r.browseFilesystem(s);this.browseResult=e.data}catch(e){console.error("Browse failed:",e)}finally{this.loading=!1}},refresh(){this.browse(this.browseResult.current_path||this.basePath)},createRootFolder(){this.renameDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",target:{path:this.browseResult.current_path||this.basePath,is_directory:!0},action:"createFolder"},this.$nextTick(()=>{var s;return(s=this.$refs.renameInput)==null?void 0:s.focus()})},handleSelect(s){this.selectedPath=s.path;let e=s.path;e.startsWith(this.basePath+"/")?e=e.slice(this.basePath.length+1):e===this.basePath&&(e=""),!s.is_directory&&e.endsWith(".html")?(console.log("[DesignPageTree] handleSelect emitting current-page:",e),this.$emit("current-page",e)):console.log("[DesignPageTree] handleSelect skipping (dir or non-html):",s.name,"isDir:",s.is_directory)},handleOpenFile(s){this.$emit("open-file",s)},async handleLoadChildren({path:s,callback:e}){try{const i=((await r.browseFilesystem(s)).data.items||[]).filter(a=>a.name!=="session.json").map(a=>({name:a.name,path:a.path,is_directory:a.is_directory,is_drive:!1,size:a.size,has_children:a.is_directory,expanded:!1,children:[]}));e(i.sort((a,n)=>a.is_directory===n.is_directory?a.name.localeCompare(n.name):a.is_directory?-1:1))}catch(t){console.error("Load children failed:",t),e([])}},showContextMenu(s,e){e&&(s.preventDefault(),this.contextMenu={visible:!0,x:s.pageX,y:s.pageY,target:e},this.selectedPath=e.path)},hideContextMenu(){this.contextMenu.visible=!1},copyPath(){this.hideContextMenu(),this.$refs.copyPathDialog.open(this.contextMenu.target.path)},createNewPage(){this.hideContextMenu(),this.createPageTargetPath=this.contextMenu.target.path,this.createPageDialogVisible=!0},createNewFolder(){this.hideContextMenu();const s=this.contextMenu.target;this.renameDialog={visible:!0,title:"新建文件夹",value:"",placeholder:"输入文件夹名",target:s,action:"createFolder"},this.$nextTick(()=>{var e;return(e=this.$refs.renameInput)==null?void 0:e.focus()})},renameItem(){this.hideContextMenu();const s=this.contextMenu.target;s.is_directory?this.renameDialog={visible:!0,title:"重命名文件夹",value:s.name,placeholder:"输入新名称",target:s,action:"rename"}:this.renameDialog={visible:!0,title:"重命名文件",value:s.name,placeholder:"输入新名称",target:s,action:"rename"},this.$nextTick(()=>{var e,t;(e=this.$refs.renameInput)==null||e.focus(),(t=this.$refs.renameInput)==null||t.select()})},confirmRename(){const{value:s,target:e,action:t}=this.renameDialog;if(!s.trim()){this.renameDialog.visible=!1;return}const i=e.path.includes("\\")?"\\":"/";let a,n;t==="createFolder"?(a=e.path+i+s.trim(),n=r.createDirectory(a)):(a=e.path.substring(0,e.path.lastIndexOf(i))+i+s.trim(),n=r.renameFile(e.path,a)),n.then(()=>{this.refresh(),this.$emit("file-changed")}).catch(o=>{console.error("Operation failed:",o),this.$message.error(t==="createFolder"?"创建文件夹失败":"重命名失败")}),this.renameDialog.visible=!1},cancelRename(){this.renameDialog.visible=!1},async deleteItem(){this.hideContextMenu();try{await this.$confirm(`确定要删除 "${this.contextMenu.target.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await r.deleteFile(this.contextMenu.target.path),this.$message.success("删除成功"),this.refresh(),this.$emit("file-changed")}catch(s){s!=="cancel"&&(console.error("Delete failed:",s),this.$message.error("删除失败"))}},downloadFile(){this.hideContextMenu();const s=this.contextMenu.target;s&&r.downloadFilesystemWithProgress(s.path,s.name,()=>{}).catch(e=>this.$message.error("下载失败: "+e.message))},onPageCreated(){this.createPageDialogVisible=!1,this.refresh(),this.$emit("file-changed")},onExpandPath(s){const e=new Set(this.expandedPaths);e.add(s),this.expandedPaths=e},onCollapsePath(s){const e=new Set(this.expandedPaths);e.delete(s),this.expandedPaths=e}}};var I=function(){var i;var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-full"},[t("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refresh}},[t("i",{staticClass:"fa-solid fa-refresh"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"新建文件夹"},on:{click:e.createRootFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus"})])]),t("div",{staticClass:"flex-1 overflow-y-auto py-1 sidebar-scroll"},[e.loading?t("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.fileTreeData.length===0?t("div",{staticClass:"flex flex-col items-center justify-center py-12 text-textMuted text-sm"},[t("i",{staticClass:"fa-solid fa-folder-open text-4xl mb-3 opacity-20"}),t("p",[e._v("设计目录为空")]),t("p",{staticClass:"text-xs mt-1"},[e._v("右键文件夹创建网页")])]):e._l(e.fileTreeData,function(a){return t("file-tree-node",{key:a.path,attrs:{node:a,level:0,"selected-path":e.selectedPath,"expanded-paths":e.expandedPaths},on:{select:e.handleSelect,"open-file":e.handleOpenFile,"load-children":e.handleLoadChildren,contextmenu:e.showContextMenu,"expand-path":e.onExpandPath,"collapse-path":e.onCollapsePath}})})],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.contextMenu.visible,expression:"contextMenu.visible"}],staticClass:"fixed bg-sidebar border border-border rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.contextMenu.x+"px",top:e.contextMenu.y+"px"}},[(i=e.contextMenu.target)!=null&&i.is_directory?[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewPage}},[t("i",{staticClass:"fa-solid fa-file-lines text-xs"}),e._v(" 新建网页 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.createNewFolder}},[t("i",{staticClass:"fa-solid fa-folder-plus text-xs"}),e._v(" 新建文件夹 ")]),t("div",{staticClass:"border-t border-border my-1"}),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]:[t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.copyPath}},[t("i",{staticClass:"fa-solid fa-copy text-xs"}),e._v(" 复制路径 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.downloadFile}},[t("i",{staticClass:"fa-solid fa-download text-xs"}),e._v(" 下载 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-textMain hover:bg-active flex items-center gap-2",on:{click:e.renameItem}},[t("i",{staticClass:"fa-solid fa-pen text-xs"}),e._v(" 重命名 ")]),t("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-active flex items-center gap-2",on:{click:e.deleteItem}},[t("i",{staticClass:"fa-solid fa-trash text-xs"}),e._v(" 删除 ")])]],2),t("div",{directives:[{name:"show",rawName:"v-show",value:e.renameDialog.visible,expression:"renameDialog.visible"}],staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(a){return a.target!==a.currentTarget?null:e.cancelRename.apply(null,arguments)}}},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-80"},[t("p",{staticClass:"text-white text-sm mb-3"},[e._v(e._s(e.renameDialog.title))]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.renameDialog.value,expression:"renameDialog.value"}],ref:"renameInput",staticClass:"w-full px-3 py-2 bg-[#1e1e1e] border border-border rounded text-white text-sm focus:outline-none focus:border-accent",attrs:{placeholder:e.renameDialog.placeholder},domProps:{value:e.renameDialog.value},on:{keyup:[function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"enter",13,a.key,"Enter")?null:e.confirmRename.apply(null,arguments)},function(a){return!a.type.indexOf("key")&&e._k(a.keyCode,"escape",void 0,a.key,void 0)?null:e.cancelRename.apply(null,arguments)}],input:function(a){a.target.composing||e.$set(e.renameDialog,"value",a.target.value)}}}),t("div",{staticClass:"flex justify-end gap-2 mt-4"},[t("button",{staticClass:"px-3 py-1 text-xs text-textMuted hover:text-white",on:{click:e.cancelRename}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600",on:{click:e.confirmRename}},[e._v("确定")])])])]),t("CreatePageDialog",{attrs:{visible:e.createPageDialogVisible,"target-path":e.createPageTargetPath},on:{"update:visible":function(a){e.createPageDialogVisible=a},created:e.onPageCreated}}),t("CopyPathDialog",{ref:"copyPathDialog"})],1)},N=[],V=l(T,I,N,!1,null,"8119cab7");const R=V.exports,z={name:"DesignAiChat",components:{ModelSelectDialog:b,CommandDialog:v,FileSelectDialog:g,SkillSelectDialog:m,ImagePreviewList:p,ResizableTextarea:u},mixins:[S()],props:{basePath:{type:String,default:".txcode/design"},currentPage:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1,skillSelectVisible:!1,skillCursorPos:-1,sessionId:"",sessionStatus:"idle",wsUnsubscribe:null,requestSeq:0}},watch:{currentPage:{immediate:!1,handler(s){this.loadSessionForPage(s)}}},async mounted(){await this.loadDefaultModel(),r.ws.init(),this.currentPage&&await this.loadSessionForPage(this.currentPage)},beforeDestroy(){this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{getSessionJsonPath(){return this.basePath+"/session.json"},async readSessionJson(){var s;try{const e=await r.getFileContent(this.getSessionJsonPath());if(e&&((s=e.data)!=null&&s.content)){const t=JSON.parse(e.data.content);if(t.pageSessions){const i={};for(const[a,n]of Object.entries(t.pageSessions))a.endsWith(".html")&&a!=="session.json"&&(i[a]=n);Object.keys(i).length!==Object.keys(t.pageSessions).length&&(t.pageSessions=i,this.writeSessionJson(t).catch(()=>{}))}return t}}catch{}return{pageSessions:{}}},async writeSessionJson(s){await r.writeFile(this.getSessionJsonPath(),JSON.stringify(s,null,2))},async loadSessionForPage(s){var n;const e=++this.requestSeq;console.log("[DesignAiChat] loadSessionForPage called:",s,"seq:",e);const t=performance.now();if(!s||!s.endsWith(".html")){this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null),this.sessionId="",this.logItems=[],this.promptTokens=0,this.sessionStatus="idle",console.log("[DesignAiChat] loadSessionForPage skipped (not html):",s);return}const i=await this.readSessionJson();if(this.requestSeq!==e)return;console.log("[DesignAiChat] sessionData loaded:",Object.keys(i.pageSessions||{}));const a=(n=i.pageSessions)==null?void 0:n[s];if(console.log("[DesignAiChat] pageSession for",s,":",!!a),a!=null&&a.sessionId)try{console.log("[DesignAiChat] loading existing session:",a.sessionId);const o=performance.now(),c=await r.getSession(a.sessionId);if(this.requestSeq!==e)return;if(console.log("[DesignAiChat] getSession took:",(performance.now()-o).toFixed(1),"ms"),c&&c.data){this.sessionId=a.sessionId,this.subscribeSession();const d=performance.now();if(await this.loadMessages(),this.requestSeq!==e)return;console.log("[DesignAiChat] loadMessages took:",(performance.now()-d).toFixed(1),"ms"),console.log("[DesignAiChat] loadSessionForPage done (existing), total:",(performance.now()-t).toFixed(1),"ms");return}}catch(o){console.error("[DesignAiChat] getSession failed:",o)}try{console.log("[DesignAiChat] creating new session for:",s);const o=await r.createSession(`设计页面: ${s}`);if(this.requestSeq!==e||(this.sessionId=o.data.id,i.pageSessions[s]={sessionId:this.sessionId},await this.writeSessionJson(i),this.requestSeq!==e))return;this.logItems=[],this.promptTokens=0,this.subscribeSession(),console.log("[DesignAiChat] loadSessionForPage done (new), total:",(performance.now()-t).toFixed(1),"ms")}catch(o){console.error("Create session failed:",o)}},async loadDefaultModel(){var s;try{const e=await r.getConfig("defaultModel");this.modelName=((s=e.data)==null?void 0:s.value)||""}catch(e){console.error("Load model failed:",e)}},async loadMessages(){if(this.sessionId)try{const s=await r.getMessages(this.sessionId);this.logItems=s.data||[],this.$nextTick(()=>this.scrollChatToBottom(!0))}catch(s){console.error("Load messages failed:",s)}},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)+`
|
|
16
|
-
`+a.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async sendMessage(){const s=this.inputMessage.trim(),e=this.mediaFiles&&this.mediaFiles.length>0;if(!s&&!e||this.disabled)return;if(!this.sessionId){this.$message.error("请在左侧选择设计页面");return}this.wsUnsubscribe||this.subscribeSession();let t=s;this.currentPage&&(t=`当前设计页面:${this.currentPage}
|
|
17
|
-
用户需求:${s}
|
|
18
|
-
请基于以上设计页面路径,对该页面进行设计或修改。`),this.inputMessage="",this.disabled=!0,this.stopping=!1;const i=(this.mediaFiles||[]).filter(a=>!a.uploading&&a.filePath).map(a=>({filePath:a.filePath,type:a.type,dataUrl:a.dataUrl}));this.logItems.push({type:"chat",content:s,mediaFiles:i}),this.scrollChatToBottom(!0),r.sessionWsSend(this.sessionId,"chat",{message:t,sessionId:this.sessionId,modelName:this.modelName||void 0,agent:"design",mediaFiles:i.map(a=>({filePath:a.filePath,type:a.type}))}),this.mediaFiles=[]},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,r.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=r.wsSubscribe(this.sessionId,{running_sessions:s=>{const t=((s==null?void 0:s.runningSessionIds)||[]).includes(this.sessionId);this.sessionStatus=t?"processing":"idle",this.disabled=t},step:s=>{var e;this.logItems.push({type:"step",thought:s.thought,toolCalls:s.toolCalls,success:s.success}),(e=s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollChatToBottom()},compact:()=>{this.logItems.push({type:"system",content:"【会话已压缩】"}),this.loadMessages()},done:s=>{var e;this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response}),this.scrollChatToBottom(),this.$emit("design-updated")},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollChatToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollChatToBottom(s=!1){const e=C(this.$refs.messagesContainer);this.$nextTick(()=>w(this.$refs.messagesContainer,{force:s,prevSnapshot:e}))},renderMarkdown(s){return s?x(s,{breaks:!0}):""},formatInput(s,e){try{const t=typeof e=="string"?JSON.parse(e):e;return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:JSON.stringify(t)}catch{return e}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,r.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},openSkillSelect(){const s=this.$el.querySelector(".input-area textarea");this.skillCursorPos=s?s.selectionStart:-1,this.skillSelectVisible=!0},onSkillSelected(s){const e=`[${s}] `,t=this.skillCursorPos>=0?this.skillCursorPos:0;this.inputMessage=this.inputMessage.slice(0,t)+e+this.inputMessage.slice(t),this.cancelSkillSelect()},cancelSkillSelect(){this.skillSelectVisible=!1}}};var E=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-full"},[t("div",{ref:"messagesContainer",staticClass:"chat-messages flex-1 overflow-y-auto px-3 py-2"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-solid fa-robot text-4xl mb-3 opacity-20 block text-center"}),t("p",{staticClass:"text-sm text-textMuted text-center"},[e._v("AI设计助手可协助您分析和优化设计")]),t("p",{staticClass:"text-xs text-textMuted text-center mt-1"},[e._v("Enter 发送,Ctrl+Enter 换行")])]),e._l(e.logItems,function(i,a){return[i.type==="chat"?t("div",{key:a,staticClass:"flex justify-end mb-3"},[t("div",{staticClass:"user-question"},[i.mediaFiles&&i.mediaFiles.length>0?t("div",{staticClass:"chat-images mb-1"},e._l(i.mediaFiles,function(n){return t("img",{key:n.filePath,staticClass:"chat-image-thumb",attrs:{src:n.url||n.dataUrl||n.filePath},on:{click:function(o){return o.stopPropagation(),e.openImagePreview(n)}}})}),0):e._e(),t("div",{staticClass:"text-sm"},[e._v(e._s(i.content))])])]):i.type==="system"?t("div",{key:a,staticClass:"system-message mb-2",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought mb-2",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(n,o){return t("div",{key:o,staticClass:"log-mute text-xs text-textMuted mb-1"},[t("span",{class:i.success!==!1?"text-green-400":"text-red-400"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(n.function.name)+" "),n.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(n.function.name,n.function.arguments)))]):e._e()])})]:i.type==="think"?t("div",{key:a,staticClass:"ai-thought mb-2",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[e.mediaFiles&&e.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:e.mediaFiles,disabled:e.disabled},on:{remove:e.removeMedia}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行)",disabled:e.disabled&&!e.stopping},on:{"paste-image":e.handlePasteImages},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("input",{ref:"mediaInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:e.handleImageSelected}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:e.disabled,size:"small"},on:{click:e.handleImageUpload}},[e._v("图片")]),e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()&&(!e.mediaFiles||e.mediaFiles.length===0),size:"small"},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.sessionStatus==="processing"?"status-thinking":"status-ready"},[e.sessionStatus==="processing"?t("span",{staticClass:"thinking-spinner"}):e._e(),e._v(" "+e._s(e.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:"+e._s(e.promptTokens||0))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openSkillSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择Skill")])])],1),e.previewImage?t("div",{staticClass:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center",on:{click:e.closeImagePreview}},[t("span",{staticClass:"absolute top-4 right-4 text-white text-2xl cursor-pointer"},[e._v("×")]),t("img",{staticClass:"max-w-[90vw] max-h-[90vh]",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(i){i.stopPropagation()}}})]):e._e(),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(i){e.skillSelectVisible=i},select:e.onSkillSelected,close:e.cancelSkillSelect}})],1)},L=[],j=l(z,E,L,!1,null,"3ac56279");const q=j.exports,O={name:"DesignSidebar",components:{DesignPageTree:R,DesignAiChat:q},props:{basePath:{type:String,default:".txcode/design"}},data(){return{activeTab:"pages",currentPage:""}}};var A=function(){var e=this,t=e._self._c;return t("aside",{staticClass:"bg-[#121212] border border-[#1e1e1e] flex flex-col shrink-0 overflow-hidden",staticStyle:{width:"480px"}},[t("div",{staticClass:"flex border-b border-[#1e1e1e] bg-[#121212]"},[t("div",{staticClass:"flex-1 text-center px-3 py-2.5 cursor-pointer text-sm border-b-2 transition-colors",class:e.activeTab==="pages"?"border-[#60a5fa] text-[#f4f4f5]":"border-transparent text-[#84848a] hover:text-[#f4f4f5]",on:{click:function(i){e.activeTab="pages"}}},[t("i",{staticClass:"fa-solid fa-file-code mr-1"}),e._v(" 设计页面 ")]),t("div",{staticClass:"flex-1 text-center px-3 py-2.5 cursor-pointer text-sm border-b-2 transition-colors",class:e.activeTab==="ai"?"border-[#60a5fa] text-[#f4f4f5]":"border-transparent text-[#84848a] hover:text-[#f4f4f5]",on:{click:function(i){e.activeTab="ai"}}},[t("i",{staticClass:"fa-solid fa-robot mr-1"}),e._v(" AI设计助手 ")])]),t("DesignPageTree",{directives:[{name:"show",rawName:"v-show",value:e.activeTab==="pages",expression:"activeTab === 'pages'"}],attrs:{"base-path":e.basePath},on:{"open-file":function(i){return e.$emit("open-file",i)},"current-page":function(i){e.currentPage=i},"file-changed":function(i){return e.$emit("file-changed")}}}),e.activeTab==="ai"?t("DesignAiChat",{attrs:{"base-path":e.basePath,"current-page":e.currentPage},on:{"design-updated":function(i){return e.$emit("file-changed")}}}):e._e()],1)},B=[],U=l(O,A,B,!1,null,null);const J=U.exports,W={name:"DesignPreview",props:{fileContent:{type:String,default:""},fileName:{type:String,default:""},relativePath:{type:String,default:""}},data(){return{activeDevice:"web",refreshKey:0,renderIframe:!1,_relativePathVersion:0,deviceSizes:[{value:"app",label:"App",icon:"fa-solid fa-mobile-screen",width:375},{value:"web",label:"Web",icon:"fa-solid fa-desktop",width:0},{value:"pad",label:"Pad",icon:"fa-solid fa-tablet-screen-button",width:768}]}},computed:{previewSrc(){if(!this.relativePath)return"";const s=`/design_html/${encodeURI(this.relativePath)}?_=${this._relativePathVersion}`;return console.log("[DesignPreview] previewSrc computed:",s),s},iframeStyle(){return{width:"100%",height:"100%"}},frameStyle(){switch(this.activeDevice){case"app":return{width:"390px"};case"pad":return{width:"800px"};default:return{}}}},watch:{fileName:{immediate:!0,handler(s){s&&(s.includes("_app.html")?this.activeDevice="app":s.includes("_web.html")?this.activeDevice="web":s.includes("_pad.html")?this.activeDevice="pad":this.activeDevice="web",console.log("[DesignPreview] fileName changed:",s,"→ activeDevice:",this.activeDevice))}},relativePath(s,e){console.log("[DesignPreview] relativePath changed:",e,"→",s),s?(this._relativePathVersion++,console.log("[DesignPreview] _relativePathVersion:",this._relativePathVersion),this.renderIframe=!1,console.log("[DesignPreview] renderIframe set to false, scheduling recreate"),this.$nextTick(()=>{this.renderIframe=!0,console.log("[DesignPreview] renderIframe set to true, iframe should be created with src:",this.previewSrc)})):(this.renderIframe=!1,console.log("[DesignPreview] renderIframe set to false (no file)"))}},mounted(){console.log("[DesignPreview] mounted, relativePath:",this.relativePath)},updated(){console.log("[DesignPreview] updated, relativePath:",this.relativePath,"previewSrc:",this.previewSrc)},beforeDestroy(){console.log("[DesignPreview] beforeDestroy")},methods:{refreshPreview(){this.refreshKey++,this._relativePathVersion++,this.renderIframe=!1,this.$nextTick(()=>{this.renderIframe=!0,console.log("[DesignPreview] refreshPreview, iframe recreated")})},openInNewTab(){this.previewSrc&&window.open(this.previewSrc,"_blank")},onIframeLoad(){console.log("[DesignPreview] iframe onload, src:",this.previewSrc)}}};var K=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-full"},[t("div",{staticClass:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar"},[t("span",{staticClass:"text-xs text-textMuted mr-2"},[e._v("视口:")]),e._l(e.deviceSizes,function(i){return t("button",{key:i.value,staticClass:"px-3 py-1 text-xs rounded border transition-colors",class:e.activeDevice===i.value?"border-accent bg-accent/10 text-white":"border-transparent text-textMuted hover:border-gray-500",attrs:{title:i.label},on:{click:function(a){e.activeDevice=i.value}}},[t("i",{staticClass:"mr-1",class:i.icon}),e._v(e._s(i.label)+" ")])})],2),t("div",{staticClass:"flex-1 flex items-center justify-center overflow-auto bg-[#f5f5f5] p-4"},[e.relativePath?t("div",{staticClass:"device-frame flex flex-col self-stretch",class:`device-frame-${e.activeDevice}`,style:e.frameStyle},[t("div",{staticClass:"flex justify-end mb-2 shrink-0 gap-1"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white text-xs rounded hover:bg-white/10 transition-colors",attrs:{title:"新窗口打开"},on:{click:e.openInNewTab}},[t("i",{staticClass:"fa-solid fa-up-right-from-square"})]),t("button",{staticClass:"p-1 text-textMuted hover:text-white text-xs rounded hover:bg-white/10 transition-colors",attrs:{title:"刷新预览"},on:{click:e.refreshPreview}},[t("i",{staticClass:"fa-solid fa-refresh"})])]),e.renderIframe?t("iframe",{ref:"previewFrame",staticClass:"w-full border-0",style:e.iframeStyle,attrs:{src:e.previewSrc,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups"},on:{load:e.onIframeLoad}}):e._e()]):t("div",{staticClass:"text-textMuted text-center mt-20"},[t("i",{staticClass:"fa-solid fa-eye text-6xl mb-4 opacity-20 block"}),t("p",[e._v("双击左侧 HTML 文件预览")])])])])},H=[],X=l(W,K,H,!1,null,"8444b9fd");const Y=X.exports,G={name:"DesignEditor",props:{fileContent:{type:String,default:""},fileName:{type:String,default:""},filePath:{type:String,default:""}},data(){return{editor:null,originalContent:"",contentChanged:!1,saving:!1}},watch:{fileContent:{immediate:!0,handler(s){if(!this.fileName||!this.editor&&(this.initEditor(),!this.editor))return;const e=s||"";this.editor.getValue()!==e&&(this.originalContent=e,this.editor.setValue(e),this.contentChanged=!1)}}},mounted(){this.$nextTick(()=>this.initEditor())},beforeDestroy(){this.editor&&(this.editor.dispose(),this.editor=null)},methods:{initEditor(){this.editor||this.$refs.editorContainer&&this.fileName&&(this.editor=y.create(this.$refs.editorContainer,{value:this.fileContent||"",language:"html",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.originalContent=this.fileContent||"",this.editor.onDidChangeModelContent(()=>{this.editor&&(this.contentChanged=this.editor.getValue()!==this.originalContent,this.$emit("content-changed",this.contentChanged))}),this.editor.addCommand(_.CtrlCmd|P.KeyS,()=>{this.saveFile()}))},updateContent(s){if(!this.editor){this.initEditor(),this.$nextTick(()=>this.updateContent(s));return}this.originalContent=s,this.editor.setValue(s),this.contentChanged=!1},layout(){!this.editor&&this.fileName&&this.initEditor(),this.editor&&this.$nextTick(()=>this.editor.layout())},async saveFile(){if(!(!this.editor||!this.filePath)){this.saving=!0;try{const s=this.editor.getValue();await r.writeFile(this.filePath,s),this.originalContent=s,this.contentChanged=!1,this.$emit("content-saved",s),this.$emit("content-changed",!1),this.$message.success("文件已保存")}catch(s){console.error("Save failed:",s),this.$message.error("保存文件失败")}finally{this.saving=!1}}}}};var Q=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex flex-col h-full"},[e.fileName?e._e():t("div",{staticClass:"flex-1 flex items-center justify-center text-textMuted"},[e._m(0)]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.fileName,expression:"fileName"}],ref:"editorContainer",staticClass:"monaco-editor-container flex-1"}),e.fileName?t("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3 shrink-0"},[t("div",{staticClass:"flex items-center gap-4 text-xs text-textMuted"},[t("span",[e._v(e._s(e.fileName))]),e.contentChanged?t("span",{staticClass:"text-yellow-500"},[e._v("已修改")]):e._e()]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white text-xs rounded hover:bg-white/10 transition-colors",attrs:{title:"刷新内容"},on:{click:function(i){return e.$emit("refresh")}}},[t("i",{staticClass:"fa-solid fa-refresh"})]),t("button",{staticClass:"px-3 py-1 text-xs bg-accent text-white rounded hover:bg-blue-600 disabled:opacity-50 disabled:cursor-not-allowed",attrs:{disabled:!e.contentChanged||e.saving},on:{click:e.saveFile}},[e.saving?t("i",{staticClass:"fa-solid fa-spinner fa-spin mr-1"}):t("i",{staticClass:"fa-solid fa-save mr-1"}),e._v(" 保存 ")])])]):e._e()])},Z=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fa-solid fa-file-code text-6xl mb-4 opacity-20 block"}),e("p",[s._v("双击左侧 HTML 文件编辑")])])}],ee=l(G,Q,Z,!1,null,"e697ca00");const te=ee.exports,se={name:"DesignView",components:{DesignSidebar:J,DesignPreview:Y,DesignEditor:te},data(){return{rightTab:"preview",designBasePath:".txcode/design",fileContent:"",activeFileName:"",activeFilePath:"",relativePath:"",hasChanges:!1,isResizing:!1}},mounted(){document.addEventListener("mousemove",this.handleResize),document.addEventListener("mouseup",this.stopResize)},watch:{rightTab(s){console.log("[DesignView] rightTab changed:",s),s==="editor"&&this.activeFilePath&&!this.fileContent&&(console.log("[DesignView] switching to editor, loading file content for:",this.activeFilePath),this.loadFileContent()),s==="editor"&&this.$nextTick(()=>{this.$refs.editor&&this.$refs.editor.layout()})}},beforeDestroy(){document.removeEventListener("mousemove",this.handleResize),document.removeEventListener("mouseup",this.stopResize)},methods:{async openFile(s){if(console.log("[DesignView] openFile called, node:",s.name,"path:",s.path,"is_dir:",s.is_directory),s.is_directory)return;this.activeFileName=s.name,this.activeFilePath=s.path;const e=this.extractRelativePath(s.path);console.log("[DesignView] extractRelativePath result:",e),this.relativePath=e,this.fileContent="",this.hasChanges=!1,this.rightTab="preview",console.log("[DesignView] openFile done, relativePath:",this.relativePath,"fileContent deferred to editor tab")},async loadFileContent(){var s;if(this.activeFilePath){console.log("[DesignView] loadFileContent:",this.activeFilePath);try{const e=performance.now(),t=await r.getFileContent(this.activeFilePath);console.log("[DesignView] getFileContent took:",(performance.now()-e).toFixed(1),"ms"),this.fileContent=((s=t.data)==null?void 0:s.content)||""}catch(e){console.error("[DesignView] loadFileContent failed:",e),this.fileContent=""}}},onContentChanged(s){this.hasChanges=s},onContentSaved(s){this.fileContent=s,this.hasChanges=!1},async refreshCurrentFile(){this.activeFilePath&&(console.log("[DesignView] refreshCurrentFile:",this.activeFilePath),await this.loadFileContent(),this.$refs.editor&&this.$refs.editor.updateContent(this.fileContent))},extractRelativePath(s){const e=["/.txcode/design/",".txcode/design/","\\.txcode\\design\\",".txcode\\design\\"];for(const t of e){const i=s.indexOf(t);if(i!==-1)return s.slice(i+t.length).replace(/\\/g,"/")}return""},startResize(s){this.isResizing=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},handleResize(s){if(!this.isResizing)return;const e=this.$refs.sidebar;if(!e)return;const t=s.clientX;t>=150&&t<=500&&(e.$el.style.width=t+"px")},stopResize(){this.isResizing=!1,document.body.style.cursor="",document.body.style.userSelect=""}}};var ie=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flex-1 flex overflow-hidden"},[t("DesignSidebar",{ref:"sidebar",attrs:{"base-path":e.designBasePath},on:{"open-file":e.openFile,"file-changed":e.refreshCurrentFile}}),t("div",{staticClass:"w-1 bg-border hover:bg-accent cursor-col-resize transition-colors",on:{mousedown:e.startResize}}),t("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[t("div",{staticClass:"flex border-b border-border bg-sidebar"},[t("div",{staticClass:"flex items-center"},[t("div",{staticClass:"px-4 py-2 cursor-pointer border-r border-border text-sm",class:e.rightTab==="preview"?"bg-[#1e1e1e] text-white border-t-2 border-t-accent":"text-textMuted hover:bg-[#2a2a2a]",on:{click:function(i){e.rightTab="preview"}}},[t("i",{staticClass:"fa-solid fa-eye mr-1"}),e._v(" 预览 ")]),t("div",{staticClass:"px-4 py-2 cursor-pointer border-r border-border text-sm",class:e.rightTab==="editor"?"bg-[#1e1e1e] text-white border-t-2 border-t-accent":"text-textMuted hover:bg-[#2a2a2a]",on:{click:function(i){e.rightTab="editor"}}},[t("i",{staticClass:"fa-solid fa-code mr-1"}),e._v(" 编辑 ")])])]),t("div",{staticClass:"flex-1 overflow-hidden"},[t("DesignPreview",{directives:[{name:"show",rawName:"v-show",value:e.rightTab==="preview",expression:"rightTab === 'preview'"}],attrs:{"file-content":e.fileContent,"file-name":e.activeFileName,"relative-path":e.relativePath}}),t("DesignEditor",{directives:[{name:"show",rawName:"v-show",value:e.rightTab==="editor",expression:"rightTab === 'editor'"}],ref:"editor",attrs:{"file-content":e.fileContent,"file-name":e.activeFileName,"file-path":e.activeFilePath},on:{"content-changed":e.onContentChanged,"content-saved":e.onContentSaved,refresh:e.refreshCurrentFile}})],1),t("div",{staticClass:"h-8 bg-sidebar border-t border-border flex items-center justify-between px-3"},[t("div",{staticClass:"flex items-center gap-4 text-xs text-textMuted"},[e.activeFilePath?t("span",[e._v(e._s(e.activeFilePath))]):t("span",{staticClass:"text-textMuted"},[e._v("双击左侧文件打开")]),e.hasChanges?t("span",{staticClass:"text-yellow-500"},[e._v("已修改")]):e._e()]),t("div",{staticClass:"flex items-center gap-2"},[t("button",{staticClass:"p-1 text-textMuted hover:text-white text-xs",attrs:{title:"刷新"},on:{click:e.refreshCurrentFile}},[t("i",{staticClass:"fa-solid fa-refresh"})])])])])],1)},ae=[],ne=l(se,ie,ae,!1,null,null);const le=ne.exports;export{le as default};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{n as d,I as g,R as m,S as f,M as v,g as p,a,s as C,b as y,F as b,c as k,e as $,K as P,d as D}from"./index-C7axH05o.js";import{m as _}from"./mediaChat-DivTDoIv.js";const M={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 x=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(o){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)])},T=[],F=d(M,x,T,!1,null,"79e287f7");const j=F.exports,V={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 q=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)},B=[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(" 创建新需求")])])}],R=d(V,q,B,!1,null,"7c60b333");const L=R.exports,N={name:"DesignDiscuss",components:{ModelSelectDialog:v,SkillSelectDialog:f,ResizableTextarea:m,ImagePreviewList:g},mixins:[_()],props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{discussions:[],currentDiscussion:null,dropdownOpen:!1,activeMenuId:null,renamingId:null,renameTitle:"",deleteDialogVisible:!1,deleteTarget:null,logItems:[],inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,modelName:"",modelSelectVisible:!1,skillSelectVisible:!1,skillCursorPos:-1,sessionStatus:"idle",wsUnsubscribe:null}},computed:{specFilePath(){return!this.category||!this.name?"":`${this.reqBasePath}/${this.category}/${this.name}/${this.name}_方案.md`},sessionFilePath(){return!this.category||!this.name?"":`${this.reqBasePath}/${this.category}/${this.name}/session.json`}},watch:{category:{handler(){this.loadData()}},name:{handler(){this.loadData()}}},async mounted(){document.addEventListener("mousedown",this.onDocumentMouseDown),await this.loadData(),await this.loadDefaultModel()},beforeDestroy(){document.removeEventListener("mousedown",this.onDocumentMouseDown),this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{handleKeydown(s){if(s.key==="Enter")if(s.ctrlKey){const e=s.target,t=e.selectionStart,i=e.selectionEnd,o=this.inputMessage;this.inputMessage=o.substring(0,t)+`
|
|
2
|
-
`+o.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},onDocumentMouseDown(s){this.activeMenuId&&!s.target.closest(".item-actions")&&(this.activeMenuId=null),this.dropdownOpen&&!s.target.closest(".discuss-dropdown")&&(this.dropdownOpen=!1)},async loadData(){await this.loadDiscussions()},async loadDiscussions(){var s;if(!this.category||!this.name){this.discussions=[],this.currentDiscussion=null;return}try{const e=await a.getFileContent(this.sessionFilePath);if(e&&((s=e.data)!=null&&s.content)){const t=JSON.parse(e.data.content);this.discussions=t.designDiscussions||[]}else this.discussions=[];this.discussions.length>0&&!this.currentDiscussion&&await this.switchDiscussion(this.discussions[0])}catch(e){console.error("Load discussions failed:",e),this.discussions=[],this.currentDiscussion=null}},async saveDiscussions(){var s;if(!(!this.category||!this.name))try{const e=await a.getFileContent(this.sessionFilePath);let t={};e&&((s=e.data)!=null&&s.content)&&(t=JSON.parse(e.data.content)),t.designDiscussions=this.discussions,await a.writeFile(this.sessionFilePath,JSON.stringify(t,null,2))}catch(e){console.error("Save discussions failed:",e)}},async createDiscussion(){var s,e,t,i;try{const o=`探讨${this.discussions.length+1}`,n=await a.createSession(o),l={id:((s=n.data)==null?void 0:s.id)||((e=n.data)==null?void 0:e.sessionId)||Date.now().toString(),sessionId:((t=n.data)==null?void 0:t.id)||((i=n.data)==null?void 0:i.sessionId),title:o,createdAt:new Date().toISOString()};this.discussions.push(l),await this.saveDiscussions(),this.dropdownOpen=!1,await this.switchDiscussion(l)}catch(o){console.error("Create discussion failed:",o),this.$message.error("创建探讨失败")}},async switchDiscussion(s){this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null),this.currentDiscussion=s,this.dropdownOpen=!1,this.activeMenuId=null,this.logItems=[],this.inputMessage="",this.disabled=!1,this.stopping=!1,this.promptTokens=0,this.sessionStatus="idle",this.mediaFiles=[],s&&s.sessionId&&(await this.loadMessages(),this.subscribeSession())},startRename(s){this.activeMenuId=null,this.$prompt("请输入新名称","重命名探讨",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:s.title}).then(async({value:e})=>{e&&e.trim()&&(s.title=e.trim(),await this.saveDiscussions())}).catch(()=>{})},confirmDelete(s){this.activeMenuId=null,this.deleteTarget=s,this.deleteDialogVisible=!0},async doDelete(){const s=this.deleteTarget;if(this.deleteDialogVisible=!1,this.deleteTarget=null,!!s)try{await a.deleteSession(s.sessionId);const e=this.discussions.findIndex(t=>t.id===s.id);e!==-1&&this.discussions.splice(e,1),await this.saveDiscussions(),this.currentDiscussion&&this.currentDiscussion.id===s.id&&(this.discussions.length>0?await this.switchDiscussion(this.discussions[0]):(this.wsUnsubscribe&&(this.wsUnsubscribe(),this.wsUnsubscribe=null),this.currentDiscussion=null,this.logItems=[],this.promptTokens=0,this.sessionStatus="idle"))}catch(e){console.error("Delete discussion failed:",e),this.$message.error("删除探讨失败")}},async sendMessage(){const s=this.inputMessage.trim(),e=this.mediaFiles&&this.mediaFiles.length>0;if(!s&&!e||this.disabled)return;if(!this.currentDiscussion||!this.currentDiscussion.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession();const t=`方案路径:${this.specFilePath}
|
|
3
|
-
|
|
4
|
-
这个是对这个方案的探讨 你只需要回答用户的问题即可 不需要修改方案 也不要修改代码
|
|
5
|
-
|
|
6
|
-
用户输入: ${s}`;this.inputMessage="",this.disabled=!0,this.stopping=!1;const i=(this.mediaFiles||[]).filter(o=>!o.uploading&&o.filePath).map(o=>({filePath:o.filePath,type:o.type,dataUrl:o.dataUrl}));this.logItems.push({type:"chat",content:s,mediaFiles:i}),this.scrollChatToBottom(!0),a.sessionWsSend(this.currentDiscussion.sessionId,"chat",{message:t,sessionId:this.currentDiscussion.sessionId,modelName:this.modelName||void 0,mediaFiles:i.map(o=>({filePath:o.filePath,type:o.type}))}),this.mediaFiles=[]},stopChat(){!this.currentDiscussion||!this.currentDiscussion.sessionId||this.stopping||(this.stopping=!0,a.sessionWsSend(this.currentDiscussion.sessionId,"stop",{sessionId:this.currentDiscussion.sessionId}))},subscribeSession(){!this.currentDiscussion||!this.currentDiscussion.sessionId||(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=a.wsSubscribe(this.currentDiscussion.sessionId,{running_sessions:s=>{const t=((s==null?void 0:s.runningSessionIds)||[]).includes(this.currentDiscussion.sessionId);this.sessionStatus=t?"processing":"idle",this.disabled=t},todos:s=>{s!=null&&s.todos&&this.logItems.push({type:"todos",todos:s.todos}),this.scrollChatToBottom()},step:s=>{var e;this.logItems.push({type:"step",thought:s.thought,toolCalls:s.toolCalls,success:s.success}),(e=s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollChatToBottom()},compact:s=>{this.logItems.push({type:"system",content:`【压缩完成】${s.summary||""}`}),this.loadMessages()},done:s=>{var e;this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response}),this.scrollChatToBottom()},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollChatToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollChatToBottom(s=!1){const e=C(this.$refs.messagesContainer);this.$nextTick(()=>{y(this.$refs.messagesContainer,{force:s,prevSnapshot:e})})},async loadMessages(){if(!(!this.currentDiscussion||!this.currentDiscussion.sessionId))try{const s=await a.getMessages(this.currentDiscussion.sessionId);this.logItems=s.data||[],this.scrollChatToBottom(!0)}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await a.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,a.setConfig("defaultModel",this.modelName)},openSkillSelect(){const s=this.$el.querySelector(".input-area textarea");this.skillCursorPos=s?s.selectionStart:-1,this.skillSelectVisible=!0},onSkillSelected(s){const e=`[${s}] `,t=this.skillCursorPos>=0?this.skillCursorPos:0;this.inputMessage=this.inputMessage.slice(0,t)+e+this.inputMessage.slice(t),this.skillSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?p(s):""}}};var U=function(){var e=this,t=e._self._c;return t("div",{staticClass:"discuss-container"},[e.discussions.length>0?t("div",{staticClass:"discuss-dropdown"},[t("div",{staticClass:"dropdown-trigger",on:{click:function(i){e.dropdownOpen=!e.dropdownOpen}}},[t("span",{staticClass:"dropdown-title"},[e._v(e._s(e.currentDiscussion?e.currentDiscussion.title:"选择探讨"))]),t("i",{staticClass:"el-icon-arrow-down",class:{rotated:e.dropdownOpen}})]),e.dropdownOpen?t("div",{staticClass:"dropdown-menu"},[e._l(e.discussions,function(i){return t("div",{key:i.id,staticClass:"dropdown-item",class:{active:e.currentDiscussion&&e.currentDiscussion.id===i.id}},[t("span",{staticClass:"item-title",on:{click:function(o){return e.switchDiscussion(i)}}},[e._v(e._s(i.title))]),t("span",{staticClass:"item-actions",on:{click:function(o){o.stopPropagation()}}},[t("span",{staticClass:"menu-trigger",on:{click:function(o){o.stopPropagation(),e.activeMenuId=e.activeMenuId===i.id?null:i.id}}},[e._v("⋮")]),e.activeMenuId===i.id?t("div",{staticClass:"menu-popup"},[t("div",{staticClass:"menu-item",on:{click:function(o){return o.stopPropagation(),e.startRename(i)}}},[e._v("重命名")]),t("div",{staticClass:"menu-item danger",on:{click:function(o){return o.stopPropagation(),e.confirmDelete(i)}}},[e._v("删除")])]):e._e()])])}),t("div",{staticClass:"dropdown-item add-item",on:{click:e.createDiscussion}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建探讨 ")])],2):e._e()]):e._e(),!e.currentDiscussion&&e.discussions.length===0?t("div",{staticClass:"empty-discuss"},[t("div",{staticClass:"empty-card",on:{click:e.createDiscussion}},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("新建探讨")]),t("span",[e._v("点击创建第一个方案探讨会话")])])]):e._e(),e.currentDiscussion?[t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("与AI探讨方案内容,不会修改方案文件")])]),e._l(e.logItems,function(i,o){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(n,l){return t("div",{key:l,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(n.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(n.name))])])}),0):e._e(),i.type==="chat"?t("div",{staticClass:"flex justify-end"},[t("div",{staticClass:"user-question"},[i.mediaFiles&&i.mediaFiles.length>0?t("div",{staticClass:"chat-images"},e._l(i.mediaFiles,function(n){return t("img",{key:n.filePath,staticClass:"chat-image-thumb",attrs:{src:n.url||n.dataUrl||n.filePath},on:{click:function(l){return l.stopPropagation(),e.openImagePreview(n)}}})}),0):e._e(),t("div",[e._v(e._s(i.content))])])]):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(n,l){return t("div",{key:l,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(n.function.name)+" "),n.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(n.function.name,n.function.arguments)))]):e._e()])})]:i.type==="think"?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[e.mediaFiles&&e.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:e.mediaFiles,disabled:e.disabled},on:{remove:e.removeMedia}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入探讨内容... (Enter 发送, Ctrl+Enter 换行)",disabled:e.disabled&&!e.stopping},on:{"paste-image":e.handlePasteImages},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("input",{ref:"mediaInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:e.handleImageSelected}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:e.disabled,size:"small"},on:{click:e.handleImageUpload}},[e._v("图片")]),e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()&&e.mediaFiles.length===0,size:"small"},on:{click:e.sendMessage}},[e._v(" 发送 ")])],1)],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.sessionStatus==="processing"?"status-thinking":"status-ready"},[e.sessionStatus==="processing"?t("span",{staticClass:"thinking-spinner"}):e._e(),e._v(" "+e._s(e.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.currentDiscussion.sessionId?e.currentDiscussion.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:"+e._s(e.promptTokens||0))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openSkillSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择Skill")])])]:e._e(),t("el-dialog",{attrs:{visible:e.deleteDialogVisible,title:"确认删除",width:"360px","close-on-click-modal":!1},on:{"update:visible":function(i){e.deleteDialogVisible=i}}},[t("p",[e._v("确定要删除探讨「"+e._s(e.deleteTarget?e.deleteTarget.title:"")+"」吗?此操作不可恢复。")]),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.deleteDialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"danger"},on:{click:e.doDelete}},[e._v("删除")])],1)]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(i){e.skillSelectVisible=i},select:e.onSkillSelected,close:function(i){e.skillSelectVisible=!1}}}),e.previewImage?t("div",{staticClass:"image-lightbox",on:{click:e.closeImagePreview}},[t("span",{staticClass:"lightbox-close",on:{click:e.closeImagePreview}},[e._v("×")]),t("img",{staticClass:"lightbox-image",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(i){i.stopPropagation()}}})]):e._e()],2)},E=[],O=d(N,U,E,!1,null,"c3f7f503");const A=O.exports,W={name:"Step2Design",components:{ModelSelectDialog:v,CommandDialog:k,FileSelectDialog:b,SkillSelectDialog:f,ResizableTextarea:m,ImagePreviewList:g,DesignDiscuss:A},mixins:[_()],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,skillSelectVisible:!1,skillCursorPos:-1,sessionId:"",sessionStatus:"idle",customActions:[],chatTab:"assistant",parentInfo:null}},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()}},reqBasePath:{handler(s){s&&this.loadData()}}},async mounted(){this.initMonacoEditor(),await this.loadData(),await this.loadDefaultModel(),await this.loadCustomActions(),a.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,o=this.inputMessage;this.inputMessage=o.substring(0,t)+`
|
|
7
|
-
`+o.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadData(){this.reqBasePath&&await Promise.all([this.loadSpec(),this.loadSession()])},async loadSpec(){var s;if(!this.category||!this.name){this.specContent=`# 选择或创建需求项目开始设计
|
|
8
|
-
`,this.syncEditorContent(this.specContent);return}try{const e=this.specFilePath,t=await a.getFileContent(e);this.specContent=((s=t.data)==null?void 0:s.content)||"",this.syncEditorContent(this.specContent)}catch(e){console.error("Load spec failed:",e),this.specContent="",this.syncEditorContent("")}},async loadSession(){var s;if(!this.category||!this.name){this.sessionId="",this.$emit("update:sessionId",""),this.parentInfo=null;return}try{const e=`${this.reqBasePath}/${this.category}/${this.name}/session.json`,t=await a.getFileContent(e);if(t&&((s=t.data)!=null&&s.content)){const i=JSON.parse(t.data.content);this.sessionId=i.designSessionId||"",this.parentInfo=i.parent||null}else this.sessionId="",this.parentInfo=null;this.$emit("update:sessionId",this.sessionId),this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(e){console.error("Load session failed:",e),this.sessionId="",this.$emit("update:sessionId",""),this.parentInfo=null,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=$.create(this.$refs.editorContainer,{value:this.specContent||`# 选择或创建需求项目开始设计
|
|
9
|
-
`,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(P.CtrlCmd|D.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(),e=this.mediaFiles&&this.mediaFiles.length>0;if(!s&&!e||this.disabled)return;if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession();let t="";this.logItems.length===0&&this.parentInfo&&(t=`
|
|
10
|
-
|
|
11
|
-
注意:当前方案是「${this.parentInfo.name}」的子方案,请参考父方案内容。父方案路径:${this.parentInfo.specPath}`);const i=`先在 ${this.specFilePath} 生成方案,先不要修改代码。${t}
|
|
12
|
-
|
|
13
|
-
用户输入: ${s}`;this.inputMessage="",this.disabled=!0,this.stopping=!1;const o=(this.mediaFiles||[]).filter(n=>!n.uploading&&n.filePath).map(n=>({filePath:n.filePath,type:n.type,dataUrl:n.dataUrl}));this.logItems.push({type:"chat",content:s,mediaFiles:o}),this.scrollChatToBottom(!0),a.sessionWsSend(this.sessionId,"chat",{message:i,sessionId:this.sessionId,modelName:this.modelName||void 0,mediaFiles:o.map(n=>({filePath:n.filePath,type:n.type}))}),this.mediaFiles=[]},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,a.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=a.wsSubscribe(this.sessionId,{running_sessions:s=>{const t=((s==null?void 0:s.runningSessionIds)||[]).includes(this.sessionId);this.sessionStatus=t?"processing":"idle",this.disabled=t},todos:s=>{var e;console.log("[Step2Design] WS todos event, todos count:",(e=s==null?void 0:s.todos)==null?void 0:e.length),s!=null&&s.todos&&this.logItems.push({type:"todos",todos:s.todos}),this.scrollChatToBottom()},step:s=>{var e,t;console.log("[Step2Design] WS step event, has thought:",!!s.thought,"toolCalls:",(e=s==null?void 0:s.toolCalls)==null?void 0:e.length),this.logItems.push({type:"step",thought:s.thought,toolCalls:s.toolCalls,success:s.success}),(t=s.usage)!=null&&t.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollChatToBottom()},compact:s=>{this.logItems.push({type:"system",content:`【压缩完成】${s.summary||""}`}),this.loadMessages()},done:s=>{var e;console.log("[Step2Design] WS done event"),this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response}),this.$emit("spec-updated"),this.scrollChatToBottom()},stopped:()=>{console.log("[Step2Design] WS stopped event"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollChatToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollChatToBottom(s=!1){const e=C(this.$refs.messagesContainer);console.log("[Step2Design] scrollChatToBottom called, force:",s,"snap:",JSON.stringify(e)),this.$nextTick(()=>{y(this.$refs.messagesContainer,{force:s,prevSnapshot:e})})},async loadMessages(){if(this.sessionId)try{const s=await a.getMessages(this.sessionId);this.logItems=s.data||[],this.scrollChatToBottom(!0)}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await a.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,a.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},openSkillSelect(){const s=this.$el.querySelector(".input-area textarea");this.skillCursorPos=s?s.selectionStart:-1,this.skillSelectVisible=!0},onSkillSelected(s){const e=`[${s}] `,t=this.skillCursorPos>=0?this.skillCursorPos:0;this.inputMessage=this.inputMessage.slice(0,t)+e+this.inputMessage.slice(t),this.cancelSkillSelect()},cancelSkillSelect(){this.skillSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?p(s):""},openCustomActions(){window.open("/#/views/pc/custom-actions","_blank")},async loadCustomActions(){try{const s=await a.getCustomActions("design");this.customActions=s.data||[]}catch(s){console.error("Load custom actions failed:",s)}},executeCustomAction(s){this.inputMessage=s.prompt,this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus(),s.auto_send&&this.sendMessage()})}}};var z=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step2-container"},[t("div",{staticClass:"step2-main"},[t("div",{staticClass:"editor-panel"},[t("div",{staticClass:"editor-header"},[t("i",{staticClass:"el-icon-document"}),t("span",[e._v(e._s(e.specFilePath))])]),t("div",{ref:"editorContainer",staticClass:"editor-container"})]),t("div",{staticClass:"chat-panel"},[t("div",{staticClass:"panel-header panel-tabs"},[t("div",{staticClass:"panel-tab",class:{active:e.chatTab==="assistant"},on:{click:function(i){e.chatTab="assistant"}}},[t("i",{staticClass:"el-icon-chat-dot-round"}),e._v(" AI生成方案 ")]),t("div",{staticClass:"panel-tab",class:{active:e.chatTab==="discuss"},on:{click:function(i){e.chatTab="discuss"}}},[t("i",{staticClass:"el-icon-chat-dot-square"}),e._v(" AI方案交流 ")])]),e.chatTab==="assistant"?[t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("输入需求描述,AI将协助您完善方案")])]),e._l(e.logItems,function(i,o){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(n,l){return t("div",{key:l,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(n.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(n.name))])])}),0):e._e(),i.type==="chat"?t("div",{staticClass:"flex justify-end"},[t("div",{staticClass:"user-question"},[i.mediaFiles&&i.mediaFiles.length>0?t("div",{staticClass:"chat-images"},e._l(i.mediaFiles,function(n){return t("img",{key:n.filePath,staticClass:"chat-image-thumb",attrs:{src:n.url||n.dataUrl||n.filePath},on:{click:function(l){return l.stopPropagation(),e.openImagePreview(n)}}})}),0):e._e(),t("div",[e._v(e._s(i.content))])])]):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(n,l){return t("div",{key:l,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(n.function.name)+" "),n.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(n.function.name,n.function.arguments)))]):e._e()])})]:i.type==="think"?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[e.mediaFiles&&e.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:e.mediaFiles,disabled:e.disabled},on:{remove:e.removeMedia}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:e.disabled&&!e.stopping},on:{"paste-image":e.handlePasteImages},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("input",{ref:"mediaInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:e.handleImageSelected}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:e.disabled,size:"small"},on:{click:e.handleImageUpload}},[e._v("图片")]),e._l(e.customActions,function(i){return t("el-button",{key:i.id,attrs:{type:"info",size:"small",disabled:e.disabled},on:{click:function(o){return e.executeCustomAction(i)}}},[e._v(" "+e._s(i.name)+" ")])}),e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()&&e.mediaFiles.length===0,size:"small"},on:{click:e.sendMessage}},[e._v(" 发送 ")])],2)],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.sessionStatus==="processing"?"status-thinking":"status-ready"},[e.sessionStatus==="processing"?t("span",{staticClass:"thinking-spinner"}):e._e(),e._v(" "+e._s(e.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:"+e._s(e.promptTokens||0))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openSkillSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择Skill")])])]:e._e(),e.chatTab==="discuss"?t("DesignDiscuss",{attrs:{category:e.category,name:e.name,reqBasePath:e.reqBasePath}}):e._e()],2)]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(i){e.skillSelectVisible=i},select:e.onSkillSelected,close:e.cancelSkillSelect}}),e.previewImage?t("div",{staticClass:"image-lightbox",on:{click:e.closeImagePreview}},[t("span",{staticClass:"lightbox-close",on:{click:e.closeImagePreview}},[e._v("×")]),t("img",{staticClass:"lightbox-image",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(i){i.stopPropagation()}}})]):e._e()],1)},K=[],J=d(W,z,K,!1,null,"d8b3e74d");const H=J.exports,G={name:"Step3CodeGen",components:{ModelSelectDialog:v,CommandDialog:k,FileSelectDialog:b,SkillSelectDialog:f,ResizableTextarea:m,ImagePreviewList:g},mixins:[_()],props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1,skillSelectVisible:!1,skillCursorPos:-1,sessionId:"",sessionStatus:"idle",customActions:[],devLogContent:"",devLogLoading:!1}},computed:{specFilePath(){return!this.category||!this.name?"":`${this.reqBasePath}/${this.category}/${this.name}/${this.name}_方案.md`},renderedDevLog(){return this.devLogContent?p(this.devLogContent):'<p style="color: #84848a;">暂无记录</p>'}},watch:{category:{handler(){this.loadSession()}},name:{handler(){this.loadSession()}}},async mounted(){await this.loadSession(),await this.loadDefaultModel(),await this.loadCustomActions(),a.ws.init()},beforeDestroy(){this.dotInterval&&clearInterval(this.dotInterval),this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{handleKeydown(s){if(s.key==="Enter")if(s.ctrlKey){const e=s.target,t=e.selectionStart,i=e.selectionEnd,o=this.inputMessage;this.inputMessage=o.substring(0,t)+`
|
|
14
|
-
`+o.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadSession(){var s;if(!this.category||!this.name){this.sessionId="",this.$emit("update:sessionId","");return}try{const e=`${this.reqBasePath}/${this.category}/${this.name}/session.json`,t=await a.getFileContent(e);if(t&&((s=t.data)!=null&&s.content)){const i=JSON.parse(t.data.content);this.sessionId=i.codeSessionId||""}else this.sessionId="";this.$emit("update:sessionId",this.sessionId),this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(e){console.error("Load session failed:",e),this.sessionId="",this.$emit("update:sessionId",""),this.logItems=[]}},insertGenerateCommand(){this.specFilePath&&(this.inputMessage=`根据 ${this.specFilePath} 方案开发相应功能,先不要修改方案文档。`)},async sendMessage(){const s=this.inputMessage.trim(),e=this.mediaFiles&&this.mediaFiles.length>0;if(!s&&!e||this.disabled)return;if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession(),this.inputMessage="",this.disabled=!0,this.stopping=!1;const t=(this.mediaFiles||[]).filter(i=>!i.uploading&&i.filePath).map(i=>({filePath:i.filePath,type:i.type,dataUrl:i.dataUrl}));this.logItems.push({type:"chat",content:s,mediaFiles:t}),this.scrollChatToBottom(!0),a.sessionWsSend(this.sessionId,"chat",{message:s,sessionId:this.sessionId,modelName:this.modelName||void 0,enableDevLog:!0,mediaFiles:t.map(i=>({filePath:i.filePath,type:i.type}))}),this.mediaFiles=[]},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,a.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=a.wsSubscribe(this.sessionId,{running_sessions:s=>{const t=((s==null?void 0:s.runningSessionIds)||[]).includes(this.sessionId);this.sessionStatus=t?"processing":"idle",this.disabled=t},todos:s=>{s!=null&&s.todos&&this.logItems.push({type:"todos",todos:s.todos}),this.scrollChatToBottom()},step:s=>{var e;this.logItems.push({type:"step",thought:s.thought,toolCalls:s.toolCalls,success:s.success}),(e=s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollChatToBottom()},compact:s=>{this.logItems.push({type:"system",content:`【压缩完成】${s.summary||""}`}),this.loadMessages()},done:s=>{var e;this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response}),this.loadDevLog(),this.scrollChatToBottom()},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollChatToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollChatToBottom(s=!1){const e=C(this.$refs.messagesContainer);console.log("[Step3CodeGen] scrollChatToBottom called, force:",s,"snap:",JSON.stringify(e)),this.$nextTick(()=>{y(this.$refs.messagesContainer,{force:s,prevSnapshot:e})})},async loadMessages(){if(this.sessionId)try{const s=await a.getMessages(this.sessionId);this.logItems=s.data||[],this.scrollChatToBottom(!0)}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await a.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,a.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},openSkillSelect(){const s=this.$el.querySelector(".input-area textarea");this.skillCursorPos=s?s.selectionStart:-1,this.skillSelectVisible=!0},onSkillSelected(s){const e=`[${s}] `,t=this.skillCursorPos>=0?this.skillCursorPos:0;this.inputMessage=this.inputMessage.slice(0,t)+e+this.inputMessage.slice(t),this.cancelSkillSelect()},cancelSkillSelect(){this.skillSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?p(s):""},async loadCustomActions(){try{const s=await a.getCustomActions("code");this.customActions=s.data||[]}catch(s){console.error("Load custom actions failed:",s),this.customActions=[]}},executeCustomAction(s){this.inputMessage=s.prompt,this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus(),s.auto_send&&this.sendMessage()})},openCustomActions(){window.open("/#/views/pc/custom-actions","_blank")},async loadDevLog(){var s;if(this.sessionId){this.devLogLoading=!0;try{const t=await(await fetch(`/api/devlog/list_devlog?sessionId=${this.sessionId}`)).json();t.success&&(this.devLogContent=((s=t.data)==null?void 0:s.content)||"")}catch(e){console.error("加载开发日志失败:",e)}finally{this.devLogLoading=!1}}},async refreshDevLog(){await this.loadDevLog()}}};var X=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step3-container"},[t("div",{staticClass:"step3-main"},[t("div",{staticClass:"code-chat-panel"},[t("div",{staticClass:"panel-header"},[e._m(0),t("div",{staticClass:"header-actions"},[t("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertGenerateCommand}},[t("i",{staticClass:"el-icon-document"}),e._v(" 根据方案生成代码 ")]),t("el-button",{attrs:{type:"warning",size:"small"},on:{click:e.openCustomActions}},[t("i",{staticClass:"el-icon-setting"}),e._v(" 动作配置 ")])],1)]),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("点击上方按钮或输入需求生成代码")])]),e._l(e.logItems,function(i,o){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(n,l){return t("div",{key:l,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(n.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(n.name))])])}),0):e._e(),i.type==="chat"?t("div",{staticClass:"flex justify-end"},[t("div",{staticClass:"user-question"},[i.mediaFiles&&i.mediaFiles.length>0?t("div",{staticClass:"chat-images"},e._l(i.mediaFiles,function(n){return t("img",{key:n.filePath,staticClass:"chat-image-thumb",attrs:{src:n.url||n.dataUrl||n.filePath},on:{click:function(l){return l.stopPropagation(),e.openImagePreview(n)}}})}),0):e._e(),t("div",[e._v(e._s(i.content))])])]):i.type==="think"?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(n,l){return t("div",{key:l,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(n.function.name)+" "),n.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(n.function.name,n.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[e.mediaFiles&&e.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:e.mediaFiles,disabled:e.disabled},on:{remove:e.removeMedia}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入代码修改要求... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:e.disabled&&!e.stopping},on:{"paste-image":e.handlePasteImages},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("input",{ref:"mediaInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:e.handleImageSelected}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:e.disabled,size:"small"},on:{click:e.handleImageUpload}},[e._v("图片")]),e._l(e.customActions,function(i){return t("el-button",{key:i.id,attrs:{type:"info",size:"small",disabled:e.disabled},on:{click:function(o){return e.executeCustomAction(i)}}},[e._v(" "+e._s(i.name)+" ")])}),e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()&&e.mediaFiles.length===0,size:"small"},on:{click:e.sendMessage}},[e._v(" 发送 ")])],2)],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.sessionStatus==="processing"?"status-thinking":"status-ready"},[e.sessionStatus==="processing"?t("span",{staticClass:"thinking-spinner"}):e._e(),e._v(" "+e._s(e.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:"+e._s(e.promptTokens||0))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openSkillSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择Skill")])])]),t("div",{staticClass:"devlog-panel"},[t("div",{staticClass:"panel-header"},[e._m(1),t("el-button",{attrs:{size:"small"},on:{click:e.refreshDevLog}},[t("i",{staticClass:"el-icon-refresh"}),e._v(" 刷新 ")])],1),t("div",{staticClass:"devlog-content",domProps:{innerHTML:e._s(e.renderedDevLog)}})])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(i){e.skillSelectVisible=i},select:e.onSkillSelected,close:e.cancelSkillSelect}}),e.previewImage?t("div",{staticClass:"image-lightbox",on:{click:e.closeImagePreview}},[t("span",{staticClass:"lightbox-close",on:{click:e.closeImagePreview}},[e._v("×")]),t("img",{staticClass:"lightbox-image",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(i){i.stopPropagation()}}})]):e._e()],1)},Q=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-code"}),s._v(" 代码生成对话")])},function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-document"}),s._v(" 开发记录")])}],Y=d(G,X,Q,!1,null,"de7957ec");const Z=Y.exports,ee={name:"Step4Test",components:{ModelSelectDialog:v,CommandDialog:k,FileSelectDialog:b,SkillSelectDialog:f,ResizableTextarea:m,ImagePreviewList:g},mixins:[_()],props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,dotAnimation:"",dotInterval:null,dots:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧"],logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1,skillSelectVisible:!1,skillCursorPos:-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.loadSession()}},name:{handler(){this.loadSession()}}},async mounted(){await this.loadSession(),await this.loadDefaultModel(),await this.loadCustomActions(),a.ws.init()},beforeDestroy(){this.dotInterval&&clearInterval(this.dotInterval),this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{handleKeydown(s){if(s.key==="Enter")if(s.ctrlKey){const e=s.target,t=e.selectionStart,i=e.selectionEnd,o=this.inputMessage;this.inputMessage=o.substring(0,t)+`
|
|
15
|
-
`+o.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadSession(){var s;if(!this.category||!this.name){this.sessionId="",this.$emit("update:sessionId","");return}try{const e=`${this.reqBasePath}/${this.category}/${this.name}/session.json`,t=await a.getFileContent(e);if(t&&((s=t.data)!=null&&s.content)){const i=JSON.parse(t.data.content);this.sessionId=i.testSessionId||""}else this.sessionId="";this.$emit("update:sessionId",this.sessionId),this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(e){console.error("Load session failed:",e),this.sessionId="",this.$emit("update:sessionId",""),this.logItems=[]}},insertTestCommand(){this.specFilePath&&(this.inputMessage=`根据 ${this.specFilePath} 方案测试相应功能是否实现。`)},async sendMessage(){const s=this.inputMessage.trim(),e=this.mediaFiles&&this.mediaFiles.length>0;if(!s&&!e||this.disabled)return;if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession(),this.inputMessage="",this.disabled=!0,this.stopping=!1;const t=(this.mediaFiles||[]).filter(i=>!i.uploading&&i.filePath).map(i=>({filePath:i.filePath,type:i.type,dataUrl:i.dataUrl}));this.logItems.push({type:"chat",content:s,mediaFiles:t}),this.scrollChatToBottom(!0),a.sessionWsSend(this.sessionId,"chat",{message:s,sessionId:this.sessionId,modelName:this.modelName||void 0,mediaFiles:t.map(i=>({filePath:i.filePath,type:i.type}))}),this.mediaFiles=[]},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,a.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=a.wsSubscribe(this.sessionId,{running_sessions:s=>{const t=((s==null?void 0:s.runningSessionIds)||[]).includes(this.sessionId);this.sessionStatus=t?"processing":"idle",this.disabled=t},todos:s=>{s!=null&&s.todos&&this.logItems.push({type:"todos",todos:s.todos}),this.scrollChatToBottom()},step:s=>{var e;this.logItems.push({type:"step",thought:s.thought,toolCalls:s.toolCalls,success:s.success}),(e=s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),this.scrollChatToBottom()},compact:s=>{this.logItems.push({type:"system",content:`【压缩完成】${s.summary||""}`}),this.loadMessages()},done:s=>{var e;this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",s!=null&&s.modelName&&(this.modelName=s.modelName),(e=s==null?void 0:s.usage)!=null&&e.promptTokens&&(this.promptTokens=s.usage.promptTokens),s!=null&&s.response&&this.logItems.push({type:"think",content:s.response}),this.scrollChatToBottom()},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollChatToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollChatToBottom(s=!1){const e=C(this.$refs.messagesContainer);console.log("[Step4Test] scrollChatToBottom called, force:",s,"snap:",JSON.stringify(e)),this.$nextTick(()=>{y(this.$refs.messagesContainer,{force:s,prevSnapshot:e})})},async loadMessages(){if(this.sessionId)try{const s=await a.getMessages(this.sessionId);this.logItems=s.data||[],this.scrollChatToBottom(!0)}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await a.getConfig("defaultModel");(s=e.data)!=null&&s.value&&(this.modelName=e.data.value)}catch(e){console.error("Load default model failed:",e)}},openModelSelector(){this.modelSelectVisible=!0},onModelSelected(s){const e=s.name.split("/");this.modelName=e.length>2?e.slice(1).join("/"):s.name,a.setConfig("defaultModel",this.modelName)},openCommandDialog(){this.commandDialogVisible=!0},handleExecuteCommand(s){this.inputMessage=s+" ",this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus()})},openFileSelect(){this.fileSelectVisible=!0},onFileSelected(s){const e=this.inputMessage.lastIndexOf("@");e!==-1?this.inputMessage=this.inputMessage.slice(0,e)+s+" ":this.inputMessage+=s+" ",this.cancelFileSelect()},cancelFileSelect(){this.fileSelectVisible=!1},openSkillSelect(){const s=this.$el.querySelector(".input-area textarea");this.skillCursorPos=s?s.selectionStart:-1,this.skillSelectVisible=!0},onSkillSelected(s){const e=`[${s}] `,t=this.skillCursorPos>=0?this.skillCursorPos:0;this.inputMessage=this.inputMessage.slice(0,t)+e+this.inputMessage.slice(t),this.cancelSkillSelect()},cancelSkillSelect(){this.skillSelectVisible=!1},getTodoStatusIcon(s){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[s]||"⬜"},formatInput(s,e){try{const t=JSON.parse(e);return s==="bash"||s==="execute_bash"?t.command+(t.workdir?` (${t.workdir})`:""):s==="read_file"?t.file_path+(t.offset?`:${t.offset}`:""):s==="edit_file"||s==="write_file"?t.file_path:s==="glob"||s==="find_files"?t.pattern+(t.directory?` (${t.directory})`:""):s==="grep"||s==="search_content"?`"${t.pattern}" (${t.directory||""})`:e}catch{return e}},renderMarkdown(s){return s?p(s):""},async loadCustomActions(){try{const s=await a.getCustomActions("test");this.customActions=s.data||[]}catch(s){console.error("Load custom actions failed:",s),this.customActions=[]}},executeCustomAction(s){this.inputMessage=s.prompt,this.$nextTick(()=>{const e=this.$el.querySelector(".input-area textarea");e&&e.focus(),s.auto_send&&this.sendMessage()})}}};var se=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step4-container"},[t("div",{staticClass:"step4-main"},[t("div",{staticClass:"code-chat-panel"},[t("div",{staticClass:"panel-header"},[e._m(0),t("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertTestCommand}},[t("i",{staticClass:"el-icon-s-claim"}),e._v(" 根据方案测试 ")])],1),t("div",{ref:"messagesContainer",staticClass:"chat-messages"},[e.logItems.length?e._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"el-icon-chat-dot-round"}),t("p",[e._v("点击上方按钮或输入测试要求进行验收")])]),e._l(e.logItems,function(i,o){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(n,l){return t("div",{key:l,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(n.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(n.name))])])}),0):e._e(),i.type==="chat"?t("div",{staticClass:"flex justify-end"},[t("div",{staticClass:"user-question"},[i.mediaFiles&&i.mediaFiles.length>0?t("div",{staticClass:"chat-images"},e._l(i.mediaFiles,function(n){return t("img",{key:n.filePath,staticClass:"chat-image-thumb",attrs:{src:n.url||n.dataUrl||n.filePath},on:{click:function(l){return l.stopPropagation(),e.openImagePreview(n)}}})}),0):e._e(),t("div",[e._v(e._s(i.content))])])]):i.type==="think"?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="system"?t("div",{staticClass:"system-message",domProps:{innerHTML:e._s(e.renderMarkdown(i.content))}}):i.type==="step"?[i.thought?t("div",{staticClass:"ai-thought",domProps:{innerHTML:e._s(e.renderMarkdown(i.thought))}}):e._e(),e._l(i.toolCalls,function(n,l){return t("div",{key:l,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(n.function.name)+" "),n.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(n.function.name,n.function.arguments)))]):e._e()])})]:e._e()]}),e.modelName?t("div",{staticClass:"build-info"},[t("span",{staticClass:"icon"},[e._v("▣")]),e._v(" Build · "+e._s(e.modelName)+" ")]):e._e()],2),t("div",{staticClass:"chat-input-area"},[e.mediaFiles&&e.mediaFiles.length>0?t("ImagePreviewList",{attrs:{files:e.mediaFiles,disabled:e.disabled},on:{remove:e.removeMedia}}):e._e(),t("div",{staticClass:"input-wrapper"},[t("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,placeholder:"输入测试要求... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:e.disabled&&!e.stopping},on:{"paste-image":e.handlePasteImages},nativeOn:{keydown:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleKeydown.apply(null,arguments)}},model:{value:e.inputMessage,callback:function(i){e.inputMessage=i},expression:"inputMessage"}}),t("input",{ref:"mediaInput",staticStyle:{display:"none"},attrs:{type:"file",accept:"image/*",multiple:""},on:{change:e.handleImageSelected}}),t("div",{staticClass:"input-actions"},[t("el-button",{staticClass:"upload-btn",attrs:{disabled:e.disabled,size:"small"},on:{click:e.handleImageUpload}},[e._v("图片")]),e._l(e.customActions,function(i){return t("el-button",{key:i.id,attrs:{type:"info",size:"small",disabled:e.disabled},on:{click:function(o){return e.executeCustomAction(i)}}},[e._v(" "+e._s(i.name)+" ")])}),e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger",size:"small"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:"",size:"small"}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()&&e.mediaFiles.length===0,size:"small"},on:{click:e.sendMessage}},[e._v(" 发送 ")])],2)],1)],1),t("div",{staticClass:"status-bar"},[t("span",{class:e.sessionStatus==="processing"?"status-thinking":"status-ready"},[e.sessionStatus==="processing"?t("span",{staticClass:"thinking-spinner"}):e._e(),e._v(" "+e._s(e.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"model-selector",on:{click:e.openModelSelector,mousedown:function(i){i.preventDefault()}}},[e._v(" 模型:"+e._s(e.modelName||"-")+" ▾ ")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("会话:"+e._s(e.sessionId?e.sessionId.slice(0,8):"--------"))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",[e._v("token:"+e._s(e.promptTokens||0))]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openCommandDialog,mousedown:function(i){i.preventDefault()}}},[e._v("命令")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openFileSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择文件")]),t("span",{staticClass:"separator"},[e._v("|")]),t("span",{staticClass:"status-action",on:{click:e.openSkillSelect,mousedown:function(i){i.preventDefault()}}},[e._v("选择Skill")])])])]),t("ModelSelectDialog",{attrs:{visible:e.modelSelectVisible,"current-model":e.modelName},on:{"update:visible":function(i){e.modelSelectVisible=i},select:e.onModelSelected}}),t("CommandDialog",{attrs:{visible:e.commandDialogVisible},on:{"update:visible":function(i){e.commandDialogVisible=i},execute:e.handleExecuteCommand}}),t("FileSelectDialog",{attrs:{visible:e.fileSelectVisible},on:{"update:visible":function(i){e.fileSelectVisible=i},select:e.onFileSelected,close:e.cancelFileSelect}}),t("SkillSelectDialog",{attrs:{visible:e.skillSelectVisible},on:{"update:visible":function(i){e.skillSelectVisible=i},select:e.onSkillSelected,close:e.cancelSkillSelect}}),e.previewImage?t("div",{staticClass:"image-lightbox",on:{click:e.closeImagePreview}},[t("span",{staticClass:"lightbox-close",on:{click:e.closeImagePreview}},[e._v("×")]),t("img",{staticClass:"lightbox-image",attrs:{src:e.previewImage.url||e.previewImage.dataUrl||e.previewImage.filePath},on:{click:function(i){i.stopPropagation()}}})]):e._e()],1)},te=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-s-check"}),s._v(" 测试验收对话")])}],ie=d(ee,se,te,!1,null,"f6ef6112");const ne=ie.exports,ae={name:"SubSchemeDialog",props:{visible:{type:Boolean,default:!1},category:{type:String,default:""},parentName:{type:String,default:""},defaultName:{type:String,default:""}},data(){return{name:""}},watch:{visible(s){s&&(this.name=this.defaultName)}},methods:{handleVisibleChange(s){this.$emit("update:visible",s)},handleClose(){this.$emit("cancel")},onConfirm(){const s=this.name.trim();s&&(this.$emit("confirm",s),this.$emit("update:visible",!1))},onCancel(){this.$emit("cancel"),this.$emit("update:visible",!1)}}};var oe=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{visible:e.visible,title:"新建子方案",width:"420px"},on:{"update:visible":e.handleVisibleChange,close:e.handleClose}},[t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"方案名称"}},[t("el-input",{attrs:{placeholder:"请输入子方案名称"},nativeOn:{keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.onConfirm.apply(null,arguments)}},model:{value:e.name,callback:function(i){e.name=i},expression:"name"}})],1),t("el-form-item",{attrs:{label:"所属大类"}},[t("span",[e._v(e._s(e.category))])]),t("el-form-item",{attrs:{label:"父方案"}},[t("span",[e._v(e._s(e.parentName))])])],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.onCancel}},[e._v("取消")]),t("el-button",{attrs:{type:"primary",disabled:!e.name.trim()},on:{click:e.onConfirm}},[e._v("确认")])],1)],1)},le=[],re=d(ae,oe,le,!1,null,null);const ce=re.exports,de={name:"DevWorkflowView",components:{WorkflowSidebar:j,Step1NewReq:L,Step2Design:H,Step3CodeGen:Z,Step4Test:ne,SubSchemeDialog:ce},props:{sidebarVisible:{type:Boolean,default:!0}},data(){return{currentCategory:"",currentProject:"",currentStep:1,categories:[],projects:{},reqBasePath:"",isLoadingProjects:!1,designSessionId:"",codeSessionId:"",testSessionId:"",taskStatus:"idle",unsubRunning:null,subSchemeDialogVisible:!1,subSchemeDefaultName:""}},computed:{projectKey(){return!this.currentCategory||!this.currentProject?"":`${this.currentCategory}/${this.currentProject}`},hasSelectedProject(){return!!this.currentProject},stepTitle(){return{1:"新建需求",2:"方案设计",3:"代码生成",4:"测试验收"}[this.currentStep]||""},statusText(){return this.projectKey?`步骤 ${this.currentStep} / 4`:"就绪"}},created(){var o,n,l;const s=(o=this.$route.query)==null?void 0:o.category,e=(n=this.$route.query)==null?void 0:n.project,t=parseInt((l=this.$route.query)==null?void 0:l.step)||1,i=!!(s&&e);this.loadCategories(),i?(this.currentCategory=s,this.currentProject=e,this.currentStep=t):this.loadState()},mounted(){console.log("[DevWorkflow][mounted] subscribing to running_sessions"),a.ws.init(),this.unsubRunning=a.ws.on("running_sessions",s=>{var t;const e=((t=s.data)==null?void 0:t.runningSessionIds)||[];console.log("[DevWorkflow][ws] running_sessions event:",e),this.updateTaskStatus(e)})},beforeDestroy(){this.unsubRunning&&(this.unsubRunning(),this.unsubRunning=null)},watch:{currentProject(){this.updateTitle()},taskStatus(){this.updateTitle()}},methods:{updateDesignSessionId(s){console.log("[DevWorkflow][sessionId] design:",s),this.designSessionId=s},updateCodeSessionId(s){console.log("[DevWorkflow][sessionId] code:",s),this.codeSessionId=s},updateTestSessionId(s){console.log("[DevWorkflow][sessionId] test:",s),this.testSessionId=s},updateTaskStatus(s){const e=[this.designSessionId,this.codeSessionId,this.testSessionId].filter(Boolean);if(console.log("[DevWorkflow][taskStatus] mySessions:",e,"runningIds:",s),e.length===0){console.log("[DevWorkflow][taskStatus] -> idle (no sessions)"),this.taskStatus="idle";return}const t=e.some(i=>s.includes(i));console.log("[DevWorkflow][taskStatus] isRunning:",t,"prevStatus:",this.taskStatus),t?(console.log("[DevWorkflow][taskStatus] -> running"),this.taskStatus="running"):this.taskStatus==="running"&&(console.log("[DevWorkflow][taskStatus] -> completed"),this.taskStatus="completed")},updateTitle(){var t;const s=((t=this.$route.meta)==null?void 0:t.title)||"软件研发";if(!this.currentProject){document.title=`${s} - TXCode`;return}let e="";this.taskStatus==="running"?e="⏳ ":this.taskStatus==="completed"&&(e="✅ "),console.log("[DevWorkflow][updateTitle] status:",this.taskStatus,"title:",`${e}${this.currentProject} · ${s} - TXCode`),document.title=`${e}${this.currentProject} · ${s} - TXCode`},async loadState(){try{const e=(await a.getWorkflowState()).data;e&&(this.currentCategory=e.currentCategory||"",this.currentProject=e.currentProject||"",this.currentStep=e.currentStep||1)}catch(s){console.error("Load workflow state failed:",s)}},async saveState(){try{await a.updateWorkflowState(this.currentCategory,this.currentProject,this.currentStep)}catch(s){console.error("Save workflow state failed:",s)}},async loadCategories(){var s,e;try{const i=((s=(await a.getCwd()).data)==null?void 0:s.current_path)||"";this.reqBasePath=i?`${i}/.txcode/req`:"";const n=((e=(await a.browseFilesystem(this.reqBasePath)).data)==null?void 0:e.items)||[];this.categories=n.filter(l=>l.is_directory).map(l=>l.name),this.categories.sort(),this.currentCategory&&this.categories.includes(this.currentCategory)&&await this.loadProjectsForCategory(this.currentCategory)}catch(t){console.error("Load categories failed:",t),this.categories=[]}},async loadProjectsForCategory(s){var e;if(s){this.isLoadingProjects=!0;try{const t=`${this.reqBasePath}/${s}`,o=((e=(await a.browseFilesystem(t)).data)==null?void 0:e.items)||[];this.projects={},o.filter(n=>n.is_directory).forEach(n=>{const l=`${s}/${n.name}`;this.projects[l]={name:n.name,stepStatus:{}}})}catch(t){console.error("Load projects failed:",t)}finally{this.isLoadingProjects=!1}}},async onCategoryChange(s){this.currentCategory=s,this.currentProject="",this.currentStep=1,s?await this.loadProjectsForCategory(s):this.projects={}},onProjectChange(s){this.currentProject=s,!this.currentProject&&this.currentStep>1&&(this.currentStep=1)},onStepChange(s){!this.currentProject&&s>1||(this.currentStep=s)},async createCategory(s){if(this.categories.includes(s)){this.$message.warning("大类已存在");return}try{const e=`${this.reqBasePath}/${s}`;await a.createDirectory(e),this.categories.push(s),this.categories.sort(),this.$message.success(`大类「${s}」创建成功`)}catch(e){console.error("Create category failed:",e),this.$message.error("创建大类失败")}},async renameCategory({oldName:s,newName:e}){if(this.categories.includes(e)){this.$message.warning("名称已存在");return}try{const t=`${this.reqBasePath}/${s}`,i=`${this.reqBasePath}/${e}`;await a.renameFile(t,i);const o=this.categories.indexOf(s);o>-1&&(this.categories[o]=e),this.categories.sort(),this.currentCategory===s&&(this.currentCategory=e,await this.loadProjectsForCategory(e)),await this.saveState(),this.$message.success(`已重命名为「${e}」`)}catch(t){console.error("Rename category failed:",t),this.$message.error("重命名大类失败")}},async deleteCategory(s){try{const e=`${this.reqBasePath}/${s}`;await a.deleteFile(e),this.categories=this.categories.filter(t=>t!==s),this.currentCategory===s&&(this.currentCategory="",this.currentProject="",this.currentStep=1,this.projects={}),await this.saveState(),this.$message.success(`大类「${s}」已删除`)}catch(e){console.error("Delete category failed:",e),this.$message.error("删除大类失败")}},async createRequirement({category:s,name:e}){var n,l,u;if(this.projects[e]){this.$message.warning("需求已存在");return}try{const r=`${this.reqBasePath}/${s}/${e}`;await a.createDirectory(r)}catch(r){console.error("Create requirement directory failed:",r)}const t=`# ${e}方案
|
|
16
|
-
|
|
17
|
-
> 所属大类:${s}
|
|
18
|
-
|
|
19
|
-
## 用户原始需求
|
|
20
|
-
|
|
21
|
-
## 业务目标
|
|
22
|
-
|
|
23
|
-
## 功能点
|
|
24
|
-
|
|
25
|
-
`;try{const r=`${this.reqBasePath}/${s}/${e}/${e}_方案.md`;await a.writeFile(r,t)}catch(r){console.error("Write spec file failed:",r)}let i={designSessionId:"",codeSessionId:"",testSessionId:""};try{const[r,h,c]=await Promise.all([a.createSession(`workflow:${s}/${e}:design`),a.createSession(`workflow:${s}/${e}:code`),a.createSession(`workflow:${s}/${e}:test`)]);i={designSessionId:((n=r.data)==null?void 0:n.id)||"",codeSessionId:((l=h.data)==null?void 0:l.id)||"",testSessionId:((u=c.data)==null?void 0:u.id)||""};const S=`${this.reqBasePath}/${s}/${e}/session.json`;await a.writeFile(S,JSON.stringify(i,null,2))}catch(r){console.error("Create sessions failed:",r)}const o=`${s}/${e}`;this.$set(this.projects,o,{name:e,stepStatus:{}}),this.currentCategory=s,this.currentProject=e,this.$message.success(`需求「${e}」创建成功`),this.$nextTick(()=>{this.currentStep=2})},async createSubScheme(){var e;if(!this.currentProject||!this.currentCategory){this.$message.warning("请先选择一个方案");return}const s=this.currentProject;try{const t=`${this.reqBasePath}/${this.currentCategory}`,o=((e=(await a.browseFilesystem(t)).data)==null?void 0:e.items)||[];let n=0;const l=new RegExp(`^${this.escapeRegex(s)}_(\\d+)$`);o.filter(r=>r.is_directory).forEach(r=>{const h=r.name.match(l);if(h){const c=parseInt(h[1],10);c>n&&(n=c)}});const u=String(n+1).padStart(2,"0");this.subSchemeDefaultName=`${s}_${u}`,this.subSchemeDialogVisible=!0}catch(t){console.error("Browse category failed:",t),this.$message.error("获取子方案列表失败")}},escapeRegex(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},async onSubSchemeConfirm(s){var u,r,h;this.subSchemeDialogVisible=!1;const e=this.currentProject,t=this.currentCategory;try{const c=`${this.reqBasePath}/${t}/${s}`;await a.createDirectory(c)}catch(c){console.error("Create sub-scheme directory failed:",c),this.$message.error("创建子方案目录失败");return}const i=`${this.reqBasePath}/${t}/${e}/${e}_方案.md`,o=`# ${s}_方案
|
|
26
|
-
|
|
27
|
-
> 所属大类:${t}
|
|
28
|
-
> 父方案:[../${e}/${e}_方案.md](../${e}/${e}_方案.md)
|
|
29
|
-
|
|
30
|
-
## 用户原始需求
|
|
31
|
-
|
|
32
|
-
## 业务目标
|
|
33
|
-
|
|
34
|
-
## 功能点
|
|
35
|
-
|
|
36
|
-
`;try{const c=`${this.reqBasePath}/${t}/${s}/${s}_方案.md`;await a.writeFile(c,o)}catch(c){console.error("Write spec file failed:",c)}let n={designSessionId:"",codeSessionId:"",testSessionId:""};try{const[c,S,w]=await Promise.all([a.createSession(`workflow:${t}/${s}:design`),a.createSession(`workflow:${t}/${s}:code`),a.createSession(`workflow:${t}/${s}:test`)]);n={designSessionId:((u=c.data)==null?void 0:u.id)||"",codeSessionId:((r=S.data)==null?void 0:r.id)||"",testSessionId:((h=w.data)==null?void 0:h.id)||"",parent:{name:e,specPath:i}};const I=`${this.reqBasePath}/${t}/${s}/session.json`;await a.writeFile(I,JSON.stringify(n,null,2))}catch(c){console.error("Create sessions failed:",c)}const l=`${t}/${s}`;this.$set(this.projects,l,{name:s,stepStatus:{}}),this.$message.success(`子方案「${s}」创建成功`),window.open(`#/views/pc/devWorkflow?category=${encodeURIComponent(t)}&project=${encodeURIComponent(s)}&step=2`,"_blank")},async onSaveSpec(s){if(!this.projectKey)return;const e=`${this.reqBasePath}/${this.currentCategory}/${this.currentProject}/${this.currentProject}_方案.md`;try{await a.writeFile(e,s),this.$message.success("方案已保存")}catch(t){console.error("Save spec failed:",t),this.$message.error("保存方案失败")}},saveSpec(){this.$refs.step2Ref&&this.$refs.step2Ref.saveSpec()},async refreshSpec(){var s;(s=this.$refs.step2Ref)!=null&&s.loadSpec&&await this.$refs.step2Ref.loadSpec(),this.$message.success("方案已刷新")}}};var ue=function(){var e=this,t=e._self._c;return t("div",{staticClass:"dev-workflow-view"},[t("WorkflowSidebar",{ref:"sidebar",attrs:{categories:e.categories,projects:e.projects,"current-category":e.currentCategory,"current-project":e.currentProject,"current-step":e.currentStep,"is-loading":e.isLoadingProjects},on:{"category-change":e.onCategoryChange,"project-change":e.onProjectChange,"step-change":e.onStepChange,"delete-category":e.deleteCategory,"rename-category":e.renameCategory}}),t("div",{staticClass:"main-content"},[t("div",{staticClass:"panel-header"},[t("span",{staticClass:"panel-title"},[e._v(e._s(e.stepTitle))]),t("div",{staticClass:"panel-actions"},[e.currentStep===2?[t("el-button",{attrs:{type:"primary",plain:""},on:{click:e.saveSpec}},[t("i",{staticClass:"el-icon-save"}),e._v(" 保存方案 ")]),t("el-button",{attrs:{type:"info",plain:""},on:{click:e.refreshSpec}},[t("i",{staticClass:"el-icon-refresh"}),e._v(" 刷新方案 ")]),t("el-button",{attrs:{type:"success",plain:"",disabled:!e.currentProject},on:{click:e.createSubScheme}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建子方案 ")])]:e._e()],2)]),t("div",{staticClass:"step-content"},[t("Step1NewReq",{directives:[{name:"show",rawName:"v-show",value:e.currentStep===1,expression:"currentStep === 1"}],attrs:{categories:e.categories,projects:e.projects,"base-path":e.reqBasePath,"current-category":e.currentCategory,"current-project":e.currentProject},on:{"category-change":e.onCategoryChange,"project-change":e.onProjectChange,"create-category":e.createCategory,"create-requirement":e.createRequirement}}),e.currentStep===2&&e.hasSelectedProject?t("Step2Design",{ref:"step2Ref",attrs:{category:e.currentCategory,name:e.currentProject,"req-base-path":e.reqBasePath},on:{"update:sessionId":e.updateDesignSessionId,"save-spec":e.onSaveSpec,"spec-updated":e.refreshSpec}}):e._e(),e.currentStep===3&&e.hasSelectedProject?t("Step3CodeGen",{ref:"step3Ref",attrs:{category:e.currentCategory,name:e.currentProject,"req-base-path":e.reqBasePath},on:{"update:sessionId":e.updateCodeSessionId}}):e._e(),e.currentStep===4&&e.hasSelectedProject?t("Step4Test",{ref:"step4Ref",attrs:{category:e.currentCategory,name:e.currentProject,"req-base-path":e.reqBasePath},on:{"update:sessionId":e.updateTestSessionId}}):e._e(),t("SubSchemeDialog",{attrs:{visible:e.subSchemeDialogVisible,category:e.currentCategory,"parent-name":e.currentProject,"default-name":e.subSchemeDefaultName},on:{"update:visible":function(i){e.subSchemeDialogVisible=i},confirm:e.onSubSchemeConfirm,cancel:function(i){e.subSchemeDialogVisible=!1}}})],1),t("div",{staticClass:"status-bar"},[t("span",[t("i",{staticClass:"el-icon-info"}),e._v(" "+e._s(e.statusText)+" ")]),t("span",[e._v(e._s(e.projectKey||"未选择项目"))])])])],1)},he=[],pe=d(de,ue,he,!1,null,"bb045eb3");const fe=pe.exports;export{fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.workflow-sidebar[data-v-79e287f7]{width:280px;background:#2d2d2d;border-right:1px solid #1e1e1e;display:flex;flex-direction:column;flex-shrink:0}.sidebar-header[data-v-79e287f7]{padding:16px;border-bottom:1px solid #1e1e1e}.sidebar-header h3[data-v-79e287f7]{font-size:14px;color:#84848a;margin-bottom:12px}.sidebar-header .el-select[data-v-79e287f7]{width:100%;margin-bottom:8px}.project-display-row[data-v-79e287f7]{display:flex;justify-content:space-between;gap:8px;margin-bottom:8px;padding:8px 10px;background:#ffffff0a;border:1px solid #3f3f46;border-radius:6px}.project-display-row .label[data-v-79e287f7]{color:#84848a;font-size:12px}.project-display-row .value[data-v-79e287f7]{color:#d4d4d8;font-size:12px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.step-list[data-v-79e287f7]{flex:1;overflow-y:auto;padding:16px}.step-item[data-v-79e287f7]{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:8px;margin-bottom:8px;cursor:pointer;transition:all .2s;border:1px solid transparent}.step-item[data-v-79e287f7]:hover{background:#ffffff0d}.step-item.active[data-v-79e287f7]{background:#409eff26;border-color:#409eff}.step-item.completed .step-icon[data-v-79e287f7]{background:#22c55e}.step-item.active .step-icon[data-v-79e287f7]{background:#409eff}.step-icon[data-v-79e287f7]{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:14px;color:#fff;flex-shrink:0}.step-info[data-v-79e287f7]{flex:1}.step-title[data-v-79e287f7]{font-size:14px;font-weight:500;margin-bottom:2px;color:#f4f4f5}.step-desc[data-v-79e287f7]{font-size:12px;color:#84848a}.step-status[data-v-79e287f7]{font-size:14px}.step1-container[data-v-7c60b333]{height:100%;padding:24px;overflow:hidden}.step1-main[data-v-7c60b333]{max-width:600px;margin:0 auto}.panel-section[data-v-7c60b333]{background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden}.panel-section-header[data-v-7c60b333]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;display:flex;align-items:center;justify-content:space-between;color:#f4f4f5}.panel-section-header .el-button[data-v-7c60b333]{padding:4px 8px;font-size:12px}.panel-section-body[data-v-7c60b333]{padding:24px}.form-hint[data-v-7c60b333]{font-size:12px;color:#84848a;margin-top:8px}.form-hint code[data-v-7c60b333]{background:#18191b;padding:2px 6px;border-radius:4px;font-family:ui-monospace,monospace;color:#409eff}.flex[data-v-7c60b333]{display:flex}.gap-2[data-v-7c60b333]{gap:8px}.discuss-container[data-v-c3f7f503]{flex:1;display:flex;flex-direction:column;overflow:hidden;min-height:0}.discuss-dropdown[data-v-c3f7f503]{position:relative;flex-shrink:0;border-bottom:1px solid #1e1e1e}.dropdown-trigger[data-v-c3f7f503]{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;cursor:pointer;color:#f4f4f5;font-size:13px}.dropdown-trigger[data-v-c3f7f503]:hover{background:#1a1a1a}.dropdown-title[data-v-c3f7f503]{font-weight:500}.dropdown-trigger .el-icon-arrow-down[data-v-c3f7f503]{transition:transform .2s;font-size:12px;color:#84848a}.dropdown-trigger .el-icon-arrow-down.rotated[data-v-c3f7f503]{transform:rotate(180deg)}.dropdown-menu[data-v-c3f7f503]{position:absolute;top:100%;left:0;right:0;background:#1a1a1a;border:1px solid #1e1e1e;border-top:none;z-index:100;max-height:240px;overflow-y:auto}.dropdown-item[data-v-c3f7f503]{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;cursor:pointer;color:#d4d4d8;font-size:13px}.dropdown-item[data-v-c3f7f503]:hover{background:#252525}.dropdown-item.active[data-v-c3f7f503]{background:#1a3a5c}.dropdown-item.add-item[data-v-c3f7f503]{border-top:1px solid #1e1e1e;color:#60a5fa;justify-content:flex-start;gap:6px}.item-title[data-v-c3f7f503]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item-actions[data-v-c3f7f503]{flex-shrink:0;margin-left:8px;position:relative}.menu-trigger[data-v-c3f7f503]{cursor:pointer;color:#84848a;padding:2px 6px;border-radius:4px}.menu-trigger[data-v-c3f7f503]:hover{background:#333;color:#f4f4f5}.menu-actions[data-v-c3f7f503]{display:flex;flex-direction:column;min-width:80px}.menu-popup[data-v-c3f7f503]{position:absolute;right:0;top:100%;background:#1a1a1a;border:1px solid #333;border-radius:6px;box-shadow:0 4px 12px #0006;z-index:200;min-width:100px;overflow:hidden}.menu-item[data-v-c3f7f503]{padding:6px 12px;cursor:pointer;font-size:13px;color:#d4d4d8}.menu-item[data-v-c3f7f503]:hover{background:#252525}.menu-item.danger[data-v-c3f7f503]{color:#ef4444}.empty-discuss[data-v-c3f7f503]{flex:1;display:flex;align-items:center;justify-content:center}.empty-card[data-v-c3f7f503]{display:flex;flex-direction:column;align-items:center;gap:12px;padding:32px 48px;border:2px dashed #3f3f46;border-radius:12px;cursor:pointer;transition:all .2s}.empty-card[data-v-c3f7f503]:hover{border-color:#60a5fa;background:#60a5fa0d}.empty-card i[data-v-c3f7f503]{font-size:36px;color:#60a5fa}.empty-card p[data-v-c3f7f503]{font-size:16px;color:#f4f4f5;margin:0}.empty-card span[data-v-c3f7f503]{font-size:13px;color:#84848a}.chat-messages[data-v-c3f7f503]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-c3f7f503]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-c3f7f503]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-c3f7f503]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-c3f7f503]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-c3f7f503]{color:#60a5fa;font-weight:700;border:1px solid #60a5fa;padding:15px;margin:15px;border-radius:10px;display:inline-block;max-width:80%;text-align:left}.ai-thought[data-v-c3f7f503]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-c3f7f503]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-c3f7f503]{color:#22c55e}.tool-fail[data-v-c3f7f503]{color:#ef4444}.tool-input[data-v-c3f7f503]{color:#60a5fa;margin-left:8px}.build-info[data-v-c3f7f503]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-c3f7f503]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e;flex-shrink:0}.input-wrapper[data-v-c3f7f503]{position:relative;flex:1}.input-area[data-v-c3f7f503]{flex:1}.input-wrapper .input-actions[data-v-c3f7f503]{position:absolute;right:8px;bottom:8px;display:flex;gap:6px;z-index:5}.input-wrapper[data-v-c3f7f503] .el-textarea__inner{padding-bottom:50px}.status-bar[data-v-c3f7f503]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-c3f7f503]{color:#3f3f46}.status-ready[data-v-c3f7f503]{color:#22c55e}.status-thinking[data-v-c3f7f503]{color:#60a5fa}.thinking-spinner[data-v-c3f7f503]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-c3f7f503 .8s linear infinite}@keyframes spin-c3f7f503{to{transform:rotate(360deg)}}.model-selector[data-v-c3f7f503]{cursor:pointer}.model-selector[data-v-c3f7f503]:hover{color:#60a5fa}.status-action[data-v-c3f7f503]{cursor:pointer}.status-action[data-v-c3f7f503]:hover{color:#60a5fa}.flex[data-v-c3f7f503]{display:flex}.justify-end[data-v-c3f7f503]{justify-content:flex-end}.chat-images[data-v-c3f7f503]{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.chat-image-thumb[data-v-c3f7f503]{width:120px;height:120px;-o-object-fit:cover;object-fit:cover;border-radius:6px;border:1px solid #3f3f46;cursor:zoom-in;transition:border-color .2s}.chat-image-thumb[data-v-c3f7f503]:hover{border-color:#60a5fa}.image-lightbox[data-v-c3f7f503]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background:#000000e6;display:flex;align-items:center;justify-content:center;cursor:zoom-out}.lightbox-close[data-v-c3f7f503]{position:absolute;top:20px;right:30px;color:#fff;font-size:40px;cursor:pointer;z-index:1}.lightbox-image[data-v-c3f7f503]{max-width:90vw;max-height:90vh;-o-object-fit:contain;object-fit:contain;cursor:default}.upload-btn[data-v-c3f7f503]{height:auto}.step2-container[data-v-d8b3e74d]{height:100%;display:flex;flex-direction:column}.step2-main[data-v-d8b3e74d]{display:flex;flex:1;gap:16px;overflow:hidden;padding:16px}.editor-panel[data-v-d8b3e74d]{flex:1;min-width:300px;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.editor-header[data-v-d8b3e74d]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:13px;color:#84848a;display:flex;align-items:center;gap:8px}.editor-container[data-v-d8b3e74d]{flex:1;min-height:0}.chat-panel[data-v-d8b3e74d]{width:480px;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column;flex-shrink:0}.panel-header[data-v-d8b3e74d]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;color:#f4f4f5;flex-shrink:0}.panel-tabs[data-v-d8b3e74d]{display:flex;gap:0;padding:0}.panel-tab[data-v-d8b3e74d]{flex:1;text-align:center;padding:10px 16px;cursor:pointer;color:#84848a;font-size:13px;border-bottom:2px solid transparent;transition:all .2s;display:flex;align-items:center;justify-content:center;gap:6px}.panel-tab[data-v-d8b3e74d]:hover{color:#d4d4d8}.panel-tab.active[data-v-d8b3e74d]{color:#60a5fa;border-bottom-color:#60a5fa}.chat-messages[data-v-d8b3e74d]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-d8b3e74d]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-d8b3e74d]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-d8b3e74d]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-d8b3e74d]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-d8b3e74d]{color:#60a5fa;font-weight:700;border:1px solid #60a5fa;padding:15px;margin:15px;border-radius:10px;display:inline-block;max-width:80%;text-align:left}.ai-thought[data-v-d8b3e74d]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-d8b3e74d]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-d8b3e74d]{color:#22c55e}.tool-fail[data-v-d8b3e74d]{color:#ef4444}.tool-input[data-v-d8b3e74d]{color:#60a5fa;margin-left:8px}.build-info[data-v-d8b3e74d]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-d8b3e74d]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-wrapper[data-v-d8b3e74d]{position:relative;flex:1}.input-area[data-v-d8b3e74d]{flex:1}.input-wrapper .input-actions[data-v-d8b3e74d]{position:absolute;right:8px;bottom:8px;display:flex;gap:6px;z-index:5}.input-wrapper[data-v-d8b3e74d] .el-textarea__inner{padding-bottom:50px}.status-bar[data-v-d8b3e74d]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-d8b3e74d]{color:#3f3f46}.status-ready[data-v-d8b3e74d]{color:#22c55e}.status-thinking[data-v-d8b3e74d]{color:#60a5fa}.thinking-spinner[data-v-d8b3e74d]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-d8b3e74d .8s linear infinite}@keyframes spin-d8b3e74d{to{transform:rotate(360deg)}}.model-selector[data-v-d8b3e74d]{cursor:pointer}.model-selector[data-v-d8b3e74d]:hover{color:#60a5fa}.status-action[data-v-d8b3e74d]{cursor:pointer}.status-action[data-v-d8b3e74d]:hover{color:#60a5fa}.chat-images[data-v-d8b3e74d]{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.chat-image-thumb[data-v-d8b3e74d]{width:120px;height:120px;-o-object-fit:cover;object-fit:cover;border-radius:6px;border:1px solid #3f3f46;cursor:zoom-in;transition:border-color .2s}.chat-image-thumb[data-v-d8b3e74d]:hover{border-color:#60a5fa}.image-lightbox[data-v-d8b3e74d]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background:#000000e6;display:flex;align-items:center;justify-content:center;cursor:zoom-out}.lightbox-close[data-v-d8b3e74d]{position:absolute;top:20px;right:30px;color:#fff;font-size:40px;cursor:pointer;z-index:1}.lightbox-image[data-v-d8b3e74d]{max-width:90vw;max-height:90vh;-o-object-fit:contain;object-fit:contain;cursor:default}.upload-btn[data-v-d8b3e74d]{height:auto}.step3-container[data-v-de7957ec]{height:100%;display:flex;flex-direction:column}.step3-main[data-v-de7957ec]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-de7957ec]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-de7957ec]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#121212;border-bottom:1px solid #1e1e1e;flex-shrink:0}.panel-header span[data-v-de7957ec]{font-size:14px;font-weight:500;color:#f4f4f5}.header-actions[data-v-de7957ec]{display:flex;gap:8px}.chat-messages[data-v-de7957ec]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-de7957ec]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-de7957ec]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-de7957ec]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-de7957ec]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-de7957ec]{color:#60a5fa;font-weight:700;border:1px solid #60a5fa;padding:15px;margin:15px;border-radius:10px;display:inline-block;max-width:80%;text-align:left}.ai-thought[data-v-de7957ec]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-de7957ec]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-de7957ec]{color:#22c55e}.tool-fail[data-v-de7957ec]{color:#ef4444}.tool-input[data-v-de7957ec]{color:#60a5fa;margin-left:8px}.build-info[data-v-de7957ec]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-de7957ec]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-wrapper[data-v-de7957ec]{position:relative;flex:1}.input-area[data-v-de7957ec]{flex:1}.input-wrapper .input-actions[data-v-de7957ec]{position:absolute;right:8px;bottom:8px;display:flex;gap:6px;z-index:5}.input-wrapper[data-v-de7957ec] .el-textarea__inner{padding-bottom:50px}.status-bar[data-v-de7957ec]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-de7957ec]{color:#3f3f46}.status-ready[data-v-de7957ec]{color:#22c55e}.status-thinking[data-v-de7957ec]{color:#60a5fa}.thinking-spinner[data-v-de7957ec]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-de7957ec .8s linear infinite}@keyframes spin-de7957ec{to{transform:rotate(360deg)}}.model-selector[data-v-de7957ec]{cursor:pointer}.model-selector[data-v-de7957ec]:hover{color:#60a5fa}.devlog-panel[data-v-de7957ec]{width:400px;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column;margin-left:16px}.devlog-panel .panel-header[data-v-de7957ec]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#121212;border-bottom:1px solid #1e1e1e}.devlog-panel .panel-header span[data-v-de7957ec]{font-size:14px;font-weight:500;color:#f4f4f5}.devlog-content[data-v-de7957ec]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6;color:#d4d4d8}.chat-images[data-v-de7957ec]{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.chat-image-thumb[data-v-de7957ec]{width:120px;height:120px;-o-object-fit:cover;object-fit:cover;border-radius:6px;border:1px solid #3f3f46;cursor:zoom-in;transition:border-color .2s}.chat-image-thumb[data-v-de7957ec]:hover{border-color:#60a5fa}.image-lightbox[data-v-de7957ec]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background:#000000e6;display:flex;align-items:center;justify-content:center;cursor:zoom-out}.lightbox-close[data-v-de7957ec]{position:absolute;top:20px;right:30px;color:#fff;font-size:40px;cursor:pointer;z-index:1}.lightbox-image[data-v-de7957ec]{max-width:90vw;max-height:90vh;-o-object-fit:contain;object-fit:contain;cursor:default}.upload-btn[data-v-de7957ec]{height:auto}.step4-container[data-v-f6ef6112]{height:100%;display:flex;flex-direction:column}.step4-main[data-v-f6ef6112]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-f6ef6112]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-f6ef6112]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#121212;border-bottom:1px solid #1e1e1e;flex-shrink:0}.panel-header span[data-v-f6ef6112]{font-size:14px;font-weight:500;color:#f4f4f5}.chat-messages[data-v-f6ef6112]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-f6ef6112]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-f6ef6112]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-f6ef6112]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-f6ef6112]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-f6ef6112]{color:#60a5fa;font-weight:700;border:1px solid #60a5fa;padding:15px;margin:15px;border-radius:10px;display:inline-block;max-width:80%;text-align:left}.ai-thought[data-v-f6ef6112]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-f6ef6112]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-f6ef6112]{color:#22c55e}.tool-fail[data-v-f6ef6112]{color:#ef4444}.tool-input[data-v-f6ef6112]{color:#60a5fa;margin-left:8px}.build-info[data-v-f6ef6112]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-f6ef6112]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-wrapper[data-v-f6ef6112]{position:relative;flex:1}.input-area[data-v-f6ef6112]{flex:1}.input-wrapper .input-actions[data-v-f6ef6112]{position:absolute;right:8px;bottom:8px;display:flex;gap:6px;z-index:5}.input-wrapper[data-v-f6ef6112] .el-textarea__inner{padding-bottom:50px}.status-bar[data-v-f6ef6112]{display:flex;gap:8px;align-items:center;padding:6px 16px;font-size:12px;color:#84848a;border-top:1px solid #1e1e1e;flex-shrink:0;flex-wrap:wrap;background:#0a0a09}.status-bar .separator[data-v-f6ef6112]{color:#3f3f46}.status-ready[data-v-f6ef6112]{color:#22c55e}.status-thinking[data-v-f6ef6112]{color:#60a5fa}.thinking-spinner[data-v-f6ef6112]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-f6ef6112 .8s linear infinite}@keyframes spin-f6ef6112{to{transform:rotate(360deg)}}.model-selector[data-v-f6ef6112]{cursor:pointer}.model-selector[data-v-f6ef6112]:hover{color:#60a5fa}.chat-images[data-v-f6ef6112]{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.chat-image-thumb[data-v-f6ef6112]{width:120px;height:120px;-o-object-fit:cover;object-fit:cover;border-radius:6px;border:1px solid #3f3f46;cursor:zoom-in;transition:border-color .2s}.chat-image-thumb[data-v-f6ef6112]:hover{border-color:#60a5fa}.image-lightbox[data-v-f6ef6112]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:9999;background:#000000e6;display:flex;align-items:center;justify-content:center;cursor:zoom-out}.lightbox-close[data-v-f6ef6112]{position:absolute;top:20px;right:30px;color:#fff;font-size:40px;cursor:pointer;z-index:1}.lightbox-image[data-v-f6ef6112]{max-width:90vw;max-height:90vh;-o-object-fit:contain;object-fit:contain;cursor:default}.upload-btn[data-v-f6ef6112]{height:auto}.dev-workflow-view[data-v-bb045eb3]{display:flex;height:100%;overflow:hidden;background:#0a0a09}.main-content[data-v-bb045eb3]{flex:1;display:flex;flex-direction:column;overflow:hidden}.panel-header[data-v-bb045eb3]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 24px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.panel-title[data-v-bb045eb3]{font-size:16px;font-weight:500;color:#f4f4f5}.panel-actions[data-v-bb045eb3]{display:flex;gap:12px}.step-content[data-v-bb045eb3]{flex:1;overflow:hidden}.status-bar[data-v-bb045eb3]{background:#121212;border-top:1px solid #1e1e1e;padding:8px 24px;font-size:12px;color:#84848a;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.workflow-step-bar[data-v-1cf39c0c]{display:flex;background:var(--bg-secondary, #121212);border-bottom:1px solid var(--border-color, #27272a);padding:8px 16px;gap:8px}.step-item[data-v-1cf39c0c]{display:flex;align-items:center;gap:8px;padding:8px 16px;border-radius:8px;cursor:pointer;color:#52525b;transition:all .2s}.step-item.active[data-v-1cf39c0c]{color:#a1a1aa}.step-item.current[data-v-1cf39c0c]{background:var(--accent, #3b82f6);color:#fff}.step-number[data-v-1cf39c0c]{width:24px;height:24px;border-radius:50%;background:var(--bg-tertiary, #18191b);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}.step-item.current .step-number[data-v-1cf39c0c]{background:#fff3}.step-label[data-v-1cf39c0c]{font-size:14px}.step1-req[data-v-ff2d2605]{height:100%;display:flex;flex-direction:column;background:#0a0a09}.section-header[data-v-ff2d2605]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;font-size:14px;font-weight:500;color:#f4f4f5}.category-section[data-v-ff2d2605]{background:#121212}.category-list[data-v-ff2d2605]{display:flex;flex-wrap:wrap;gap:8px;padding:0 16px 16px}.category-item[data-v-ff2d2605]{display:flex;align-items:center;gap:6px;padding:8px 16px;background:#1e1e1e;border-radius:20px;font-size:13px;color:#a1a1aa;cursor:pointer;transition:all .2s}.category-item[data-v-ff2d2605]:hover{background:#27272a;color:#f4f4f5}.category-item.active[data-v-ff2d2605]{background:#3b82f6;color:#fff}.category-item.add-btn[data-v-ff2d2605]{background:transparent;border:1px dashed #3f3f46}.category-item.add-btn[data-v-ff2d2605]:hover{border-color:#3b82f6;color:#3b82f6}.divider[data-v-ff2d2605]{height:1px;background:#27272a}.project-section[data-v-ff2d2605]{flex:1;display:flex;flex-direction:column;overflow:hidden}.project-list[data-v-ff2d2605]{flex:1;overflow-y:auto;padding:0 16px 16px}.project-item[data-v-ff2d2605]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:#121212;border-radius:8px;margin-bottom:8px;cursor:pointer;transition:all .2s}.project-item[data-v-ff2d2605]:hover{background:#1e1e1e}.project-info[data-v-ff2d2605]{display:flex;align-items:center;gap:10px;color:#f4f4f5;font-size:14px}.project-info i[data-v-ff2d2605]{color:#3b82f6}.project-item>i[data-v-ff2d2605]{color:#52525b;font-size:12px}.empty-hint[data-v-ff2d2605]{text-align:center;color:#52525b;font-size:13px;padding:32px 0}.btn-primary[data-v-ff2d2605]{display:flex;align-items:center;gap:4px;padding:6px 12px;background:#3b82f6;color:#fff;border:none;border-radius:6px;font-size:12px;cursor:pointer;transition:all .2s}.btn-primary[data-v-ff2d2605]:hover{background:#2563eb}.btn-primary[data-v-ff2d2605]:disabled{background:#27272a;color:#52525b;cursor:not-allowed}.dialog-overlay[data-v-ff2d2605]{position:fixed;top:0;left:0;right:0;bottom:0;background:#000000b3;display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}.dialog[data-v-ff2d2605]{width:100%;max-width:320px;background:#18181b;border-radius:12px;overflow:hidden}.dialog-header[data-v-ff2d2605]{display:flex;align-items:center;justify-content:space-between;padding:16px;border-bottom:1px solid #27272a;font-size:15px;font-weight:500;color:#f4f4f5}.close-btn[data-v-ff2d2605]{background:none;border:none;color:#71717a;font-size:18px;cursor:pointer}.dialog-body[data-v-ff2d2605]{padding:16px}.dialog-body input[data-v-ff2d2605]{width:100%;padding:12px;background:#0a0a09;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-size:14px;outline:none}.dialog-body input[data-v-ff2d2605]:focus{border-color:#3b82f6}.dialog-footer[data-v-ff2d2605]{display:flex;gap:12px;padding:16px;border-top:1px solid #27272a}.btn-cancel[data-v-ff2d2605],.btn-confirm[data-v-ff2d2605]{flex:1;padding:10px;border-radius:8px;font-size:14px;cursor:pointer;transition:all .2s}.btn-cancel[data-v-ff2d2605]{background:#27272a;border:none;color:#a1a1aa}.btn-cancel[data-v-ff2d2605]:hover{background:#3f3f46}.btn-confirm[data-v-ff2d2605]{background:#3b82f6;border:none;color:#fff}.btn-confirm[data-v-ff2d2605]:hover{background:#2563eb}.step2-design[data-v-3caa49bb]{height:100%;display:flex;flex-direction:column;background:#0a0a09}.mode-tabs[data-v-3caa49bb]{display:flex;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.tab-btn[data-v-3caa49bb]{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;background:none;border:none;color:#84848a;font-size:14px;cursor:pointer;transition:all .2s}.tab-btn.active[data-v-3caa49bb]{color:#3b82f6;border-bottom:2px solid #3b82f6}.chat-mode[data-v-3caa49bb],.spec-mode[data-v-3caa49bb]{flex:1;display:flex;flex-direction:column;overflow:hidden}.chat-toolbar[data-v-3caa49bb]{display:flex;align-items:center;gap:8px;padding:8px 16px;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.model-name[data-v-3caa49bb]{flex:1;color:#3b82f6;font-size:13px;cursor:pointer}.chat-area[data-v-3caa49bb]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.message[data-v-3caa49bb]{display:flex;flex-direction:column;max-width:85%}.message.user[data-v-3caa49bb]{align-self:flex-end}.message.assistant[data-v-3caa49bb]{align-self:flex-start}.message-bubble[data-v-3caa49bb]{padding:12px 14px;border-radius:14px;font-size:14px;line-height:1.5;word-break:break-word}.message.user .message-bubble[data-v-3caa49bb]{background:#3b82f6;color:#fff;border-bottom-right-radius:4px}.message.assistant .message-bubble[data-v-3caa49bb]{background:#121212;border:1px solid #27272a;border-bottom-left-radius:4px;color:#d4d4d8}.message.assistant.thinking .message-bubble[data-v-3caa49bb]{background:linear-gradient(135deg,#121212,#18191b)}.message-bubble.system[data-v-3caa49bb]{font-style:italic;color:#a1a1aa}.step-block[data-v-3caa49bb]{display:flex;flex-direction:column;gap:8px}.tool-log[data-v-3caa49bb]{font-size:12px;color:#84848a;padding:8px 12px;background:#18191b;border-radius:6px;font-family:ui-monospace,monospace;display:flex;align-items:center;gap:8px}.tool-success[data-v-3caa49bb]{color:#22c55e}.tool-fail[data-v-3caa49bb]{color:#ef4444}.tool-name[data-v-3caa49bb]{color:#3b82f6}.tool-args[data-v-3caa49bb]{color:#84848a}.todo-list[data-v-3caa49bb]{background:#121212;border:1px solid #27272a;border-radius:10px;padding:10px 14px}.todo-item[data-v-3caa49bb]{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:13px;color:#d4d4d8}.todo-item[data-v-3caa49bb]:not(:last-child){border-bottom:1px solid #27272a}.todo-status[data-v-3caa49bb]{width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px}.empty-state[data-v-3caa49bb]{flex:1;display:flex;align-items:center;justify-content:center;color:#52525b;font-size:14px;min-height:100px}.input-area[data-v-3caa49bb]{display:flex;gap:10px;padding:12px 16px;background:#121212;border-top:1px solid #27272a;flex-shrink:0}.input-wrapper[data-v-3caa49bb]{flex:1}.input-field[data-v-3caa49bb]{width:100%;min-height:44px;max-height:100px;padding:10px 14px;background:#0a0a09;border:1px solid #27272a;border-radius:20px;color:#f4f4f5;font-size:14px;resize:none;outline:none}.input-field[data-v-3caa49bb]:focus{border-color:#3b82f6}.input-field[data-v-3caa49bb]::-moz-placeholder{color:#52525b}.input-field[data-v-3caa49bb]::placeholder{color:#52525b}.send-btn[data-v-3caa49bb]{width:44px;height:44px;background:#3b82f6;border:none;border-radius:50%;color:#fff;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}.send-btn[data-v-3caa49bb]:disabled{background:#27272a;color:#52525b;cursor:not-allowed}.stop-btn[data-v-3caa49bb]{background:#ef4444}.status-bar[data-v-3caa49bb]{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#121212;border-top:1px solid #27272a;font-size:11px;color:#84848a;flex-shrink:0}.status-indicator[data-v-3caa49bb]{display:flex;align-items:center;gap:6px}.status-dot[data-v-3caa49bb]{width:6px;height:6px;border-radius:50%;background:#22c55e}.status-dot.processing[data-v-3caa49bb]{background:#ef4444;animation:pulse-3caa49bb 1.5s infinite}.status-processing[data-v-3caa49bb]{color:#ef4444}.status-ready[data-v-3caa49bb]{color:#22c55e}@keyframes pulse-3caa49bb{0%,to{opacity:1}50%{opacity:.4}}.spec-tabs[data-v-3caa49bb]{display:flex;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.spec-tab-btn[data-v-3caa49bb]{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:10px;background:none;border:none;color:#84848a;font-size:13px;cursor:pointer}.spec-tab-btn.active[data-v-3caa49bb]{color:#3b82f6;border-bottom:2px solid #3b82f6}.editor-area[data-v-3caa49bb]{flex:1;display:flex;flex-direction:column;overflow:hidden}.editor-toolbar[data-v-3caa49bb]{display:flex;padding:8px 16px;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.toolbar-btn[data-v-3caa49bb]{display:flex;align-items:center;gap:4px;padding:6px 12px;background:#18191b;color:#d4d4d8;border:1px solid #27272a;border-radius:6px;font-size:12px;cursor:pointer}.toolbar-btn.primary[data-v-3caa49bb]{background:#3b82f6;color:#fff;border-color:#3b82f6}.markdown-editor[data-v-3caa49bb]{flex:1;width:100%;padding:16px;background:#121212;border:none;color:#f4f4f5;font-size:14px;font-family:ui-monospace,monospace;line-height:1.6;resize:none;outline:none}.preview-area[data-v-3caa49bb]{flex:1;overflow-y:auto;padding:16px;background:#121212}.preview-content[data-v-3caa49bb]{color:#d4d4d8;font-size:14px;line-height:1.7}.preview-content[data-v-3caa49bb] h1,.preview-content[data-v-3caa49bb] h2,.preview-content[data-v-3caa49bb] h3{color:#f4f4f5;margin:16px 0 8px}.preview-content[data-v-3caa49bb] code{background:#27272a;padding:2px 6px;border-radius:4px;font-size:13px}.preview-content[data-v-3caa49bb] pre{background:#1e1e1e;padding:12px;border-radius:8px;overflow-x:auto}.drawer-overlay[data-v-3caa49bb]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;opacity:0;visibility:hidden;transition:all .3s;z-index:999}.drawer-overlay.show[data-v-3caa49bb]{opacity:1;visibility:visible}.model-drawer[data-v-3caa49bb],.command-drawer[data-v-3caa49bb]{position:fixed;bottom:0;left:0;right:0;max-width:430px;margin:0 auto;background:#121212;border-radius:16px 16px 0 0;transform:translateY(100%);transition:transform .3s ease;z-index:1000;max-height:60vh;display:flex;flex-direction:column}.model-drawer.show[data-v-3caa49bb],.command-drawer.show[data-v-3caa49bb]{transform:translateY(0)}.drawer-header[data-v-3caa49bb]{padding:16px;border-bottom:1px solid #27272a;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.drawer-title[data-v-3caa49bb]{font-size:16px;font-weight:500;color:#f4f4f5}.drawer-close[data-v-3caa49bb]{width:32px;height:32px;border-radius:50%;background:#18191b;border:none;color:#84848a;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.command-list[data-v-3caa49bb]{flex:1;overflow-y:auto;padding:8px 0}.command-item[data-v-3caa49bb]{display:flex;align-items:center;padding:14px 16px;gap:12px;transition:background .2s;cursor:pointer}.command-item[data-v-3caa49bb]:active{background:#18191b}.command-item.active[data-v-3caa49bb]{background:#3b82f61a}.command-icon[data-v-3caa49bb]{width:40px;height:40px;background:#18191b;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#3b82f6;flex-shrink:0}.command-item.active .command-icon[data-v-3caa49bb]{background:#3b82f6;color:#fff}.command-info[data-v-3caa49bb]{flex:1;min-width:0}.command-name[data-v-3caa49bb]{font-size:14px;font-weight:500;color:#f4f4f5;margin-bottom:4px}.command-desc[data-v-3caa49bb]{font-size:12px;color:#84848a}.message-bubble[data-v-3caa49bb] p{margin:0 0 10px}.message-bubble[data-v-3caa49bb] p:last-child{margin-bottom:0}.message-bubble[data-v-3caa49bb] code{background:#18191b;padding:2px 6px;border-radius:4px;font-family:monospace}.step3-code[data-v-e98624b2]{height:100%;display:flex;flex-direction:column;background:#0a0a09}.chat-toolbar[data-v-e98624b2]{display:flex;align-items:center;gap:8px;padding:8px 16px;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.model-name[data-v-e98624b2]{flex:1;color:#3b82f6;font-size:13px;cursor:pointer}.toolbar-btn[data-v-e98624b2]{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:#18191b;border:1px solid #27272a;border-radius:8px;color:#d4d4d8;cursor:pointer;font-size:14px}.toolbar-btn[data-v-e98624b2]:disabled{opacity:.5;cursor:not-allowed}.chat-area[data-v-e98624b2]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.empty-state[data-v-e98624b2]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#52525b;font-size:14px;min-height:100px}.empty-state i[data-v-e98624b2]{font-size:48px;margin-bottom:12px;opacity:.5}.message[data-v-e98624b2]{display:flex;flex-direction:column;max-width:85%}.message.user[data-v-e98624b2]{align-self:flex-end}.message.assistant[data-v-e98624b2]{align-self:flex-start}.message-bubble[data-v-e98624b2]{padding:12px 14px;border-radius:14px;font-size:14px;line-height:1.5;word-break:break-word}.message.user .message-bubble[data-v-e98624b2]{background:#3b82f6;color:#fff;border-bottom-right-radius:4px}.message.assistant .message-bubble[data-v-e98624b2]{background:#121212;border:1px solid #27272a;border-bottom-left-radius:4px;color:#d4d4d8}.message.assistant.thinking .message-bubble[data-v-e98624b2]{background:linear-gradient(135deg,#121212,#18191b)}.message-bubble.system[data-v-e98624b2]{font-style:italic;color:#a1a1aa}.step-block[data-v-e98624b2]{display:flex;flex-direction:column;gap:8px}.tool-log[data-v-e98624b2]{font-size:12px;color:#84848a;padding:8px 12px;background:#18191b;border-radius:6px;font-family:ui-monospace,monospace;display:flex;align-items:center;gap:8px}.tool-success[data-v-e98624b2]{color:#22c55e}.tool-fail[data-v-e98624b2]{color:#ef4444}.tool-name[data-v-e98624b2]{color:#3b82f6}.tool-args[data-v-e98624b2]{color:#84848a}.todo-list[data-v-e98624b2]{background:#121212;border:1px solid #27272a;border-radius:10px;padding:10px 14px}.todo-item[data-v-e98624b2]{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:13px;color:#d4d4d8}.todo-item[data-v-e98624b2]:not(:last-child){border-bottom:1px solid #27272a}.todo-status[data-v-e98624b2]{width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px}.input-area[data-v-e98624b2]{display:flex;gap:10px;padding:12px 16px;background:#121212;border-top:1px solid #27272a;flex-shrink:0}.input-wrapper[data-v-e98624b2]{flex:1}.input-field[data-v-e98624b2]{width:100%;min-height:44px;max-height:100px;padding:10px 14px;background:#0a0a09;border:1px solid #27272a;border-radius:20px;color:#f4f4f5;font-size:14px;resize:none;outline:none}.input-field[data-v-e98624b2]:focus{border-color:#3b82f6}.input-field[data-v-e98624b2]::-moz-placeholder{color:#52525b}.input-field[data-v-e98624b2]::placeholder{color:#52525b}.send-btn[data-v-e98624b2]{width:44px;height:44px;background:#3b82f6;border:none;border-radius:50%;color:#fff;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}.send-btn[data-v-e98624b2]:disabled{background:#27272a;color:#52525b;cursor:not-allowed}.stop-btn[data-v-e98624b2]{background:#ef4444}.status-bar[data-v-e98624b2]{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#121212;border-top:1px solid #27272a;font-size:11px;color:#84848a;flex-shrink:0}.status-indicator[data-v-e98624b2]{display:flex;align-items:center;gap:6px}.status-dot[data-v-e98624b2]{width:6px;height:6px;border-radius:50%;background:#22c55e}.status-dot.processing[data-v-e98624b2]{background:#ef4444;animation:pulse-e98624b2 1.5s infinite}@keyframes pulse-e98624b2{0%,to{opacity:1}50%{opacity:.4}}.drawer-overlay[data-v-e98624b2]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;opacity:0;visibility:hidden;transition:all .3s;z-index:999}.drawer-overlay.show[data-v-e98624b2]{opacity:1;visibility:visible}.model-drawer[data-v-e98624b2],.command-drawer[data-v-e98624b2]{position:fixed;bottom:0;left:0;right:0;max-width:430px;margin:0 auto;background:#121212;border-radius:16px 16px 0 0;transform:translateY(100%);transition:transform .3s ease;z-index:1000;max-height:60vh;display:flex;flex-direction:column}.model-drawer.show[data-v-e98624b2],.command-drawer.show[data-v-e98624b2]{transform:translateY(0)}.drawer-header[data-v-e98624b2]{padding:16px;border-bottom:1px solid #27272a;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.drawer-title[data-v-e98624b2]{font-size:16px;font-weight:500;color:#f4f4f5}.drawer-close[data-v-e98624b2]{width:32px;height:32px;border-radius:50%;background:#18191b;border:none;color:#84848a;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.command-list[data-v-e98624b2]{flex:1;overflow-y:auto;padding:8px 0}.command-item[data-v-e98624b2]{display:flex;align-items:center;padding:14px 16px;gap:12px;transition:background .2s;cursor:pointer}.command-item[data-v-e98624b2]:active{background:#18191b}.command-item.active[data-v-e98624b2]{background:#3b82f61a}.command-icon[data-v-e98624b2]{width:40px;height:40px;background:#18191b;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#3b82f6;flex-shrink:0}.command-item.active .command-icon[data-v-e98624b2]{background:#3b82f6;color:#fff}.command-info[data-v-e98624b2]{flex:1;min-width:0}.command-name[data-v-e98624b2]{font-size:14px;font-weight:500;color:#f4f4f5;margin-bottom:4px}.command-desc[data-v-e98624b2]{font-size:12px;color:#84848a}.message-bubble[data-v-e98624b2] p{margin:0 0 10px}.message-bubble[data-v-e98624b2] p:last-child{margin-bottom:0}.message-bubble[data-v-e98624b2] code{background:#18191b;padding:2px 6px;border-radius:4px;font-family:monospace}.step4-test[data-v-16780a20]{height:100%;display:flex;flex-direction:column;background:#0a0a09}.chat-toolbar[data-v-16780a20]{display:flex;align-items:center;gap:8px;padding:8px 16px;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.model-name[data-v-16780a20]{flex:1;color:#3b82f6;font-size:13px;cursor:pointer}.toolbar-btn[data-v-16780a20]{width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:#18191b;border:1px solid #27272a;border-radius:8px;color:#d4d4d8;cursor:pointer;font-size:14px}.toolbar-btn[data-v-16780a20]:disabled{opacity:.5;cursor:not-allowed}.chat-area[data-v-16780a20]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.empty-state[data-v-16780a20]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#52525b;font-size:14px;min-height:100px}.empty-state i[data-v-16780a20]{font-size:48px;margin-bottom:12px;opacity:.5}.message[data-v-16780a20]{display:flex;flex-direction:column;max-width:85%}.message.user[data-v-16780a20]{align-self:flex-end}.message.assistant[data-v-16780a20]{align-self:flex-start}.message-bubble[data-v-16780a20]{padding:12px 14px;border-radius:14px;font-size:14px;line-height:1.5;word-break:break-word}.message.user .message-bubble[data-v-16780a20]{background:#3b82f6;color:#fff;border-bottom-right-radius:4px}.message.assistant .message-bubble[data-v-16780a20]{background:#121212;border:1px solid #27272a;border-bottom-left-radius:4px;color:#d4d4d8}.message.assistant.thinking .message-bubble[data-v-16780a20]{background:linear-gradient(135deg,#121212,#18191b)}.message-bubble.system[data-v-16780a20]{font-style:italic;color:#a1a1aa}.step-block[data-v-16780a20]{display:flex;flex-direction:column;gap:8px}.tool-log[data-v-16780a20]{font-size:12px;color:#84848a;padding:8px 12px;background:#18191b;border-radius:6px;font-family:ui-monospace,monospace;display:flex;align-items:center;gap:8px}.tool-success[data-v-16780a20]{color:#22c55e}.tool-fail[data-v-16780a20]{color:#ef4444}.tool-name[data-v-16780a20]{color:#3b82f6}.tool-args[data-v-16780a20]{color:#84848a}.todo-list[data-v-16780a20]{background:#121212;border:1px solid #27272a;border-radius:10px;padding:10px 14px}.todo-item[data-v-16780a20]{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:13px;color:#d4d4d8}.todo-item[data-v-16780a20]:not(:last-child){border-bottom:1px solid #27272a}.todo-status[data-v-16780a20]{width:20px;height:20px;display:flex;align-items:center;justify-content:center;font-size:12px}.input-area[data-v-16780a20]{display:flex;gap:10px;padding:12px 16px;background:#121212;border-top:1px solid #27272a;flex-shrink:0}.input-wrapper[data-v-16780a20]{flex:1}.input-field[data-v-16780a20]{width:100%;min-height:44px;max-height:100px;padding:10px 14px;background:#0a0a09;border:1px solid #27272a;border-radius:20px;color:#f4f4f5;font-size:14px;resize:none;outline:none}.input-field[data-v-16780a20]:focus{border-color:#3b82f6}.input-field[data-v-16780a20]::-moz-placeholder{color:#52525b}.input-field[data-v-16780a20]::placeholder{color:#52525b}.send-btn[data-v-16780a20]{width:44px;height:44px;background:#3b82f6;border:none;border-radius:50%;color:#fff;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0}.send-btn[data-v-16780a20]:disabled{background:#27272a;color:#52525b;cursor:not-allowed}.stop-btn[data-v-16780a20]{background:#ef4444}.status-bar[data-v-16780a20]{display:flex;align-items:center;justify-content:space-between;padding:6px 16px;background:#121212;border-top:1px solid #27272a;font-size:11px;color:#84848a;flex-shrink:0}.status-indicator[data-v-16780a20]{display:flex;align-items:center;gap:6px}.status-dot[data-v-16780a20]{width:6px;height:6px;border-radius:50%;background:#22c55e}.status-dot.processing[data-v-16780a20]{background:#ef4444;animation:pulse-16780a20 1.5s infinite}@keyframes pulse-16780a20{0%,to{opacity:1}50%{opacity:.4}}.drawer-overlay[data-v-16780a20]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;opacity:0;visibility:hidden;transition:all .3s;z-index:999}.drawer-overlay.show[data-v-16780a20]{opacity:1;visibility:visible}.model-drawer[data-v-16780a20],.command-drawer[data-v-16780a20]{position:fixed;bottom:0;left:0;right:0;max-width:430px;margin:0 auto;background:#121212;border-radius:16px 16px 0 0;transform:translateY(100%);transition:transform .3s ease;z-index:1000;max-height:60vh;display:flex;flex-direction:column}.model-drawer.show[data-v-16780a20],.command-drawer.show[data-v-16780a20]{transform:translateY(0)}.drawer-header[data-v-16780a20]{padding:16px;border-bottom:1px solid #27272a;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.drawer-title[data-v-16780a20]{font-size:16px;font-weight:500;color:#f4f4f5}.drawer-close[data-v-16780a20]{width:32px;height:32px;border-radius:50%;background:#18191b;border:none;color:#84848a;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.command-list[data-v-16780a20]{flex:1;overflow-y:auto;padding:8px 0}.command-item[data-v-16780a20]{display:flex;align-items:center;padding:14px 16px;gap:12px;transition:background .2s;cursor:pointer}.command-item[data-v-16780a20]:active{background:#18191b}.command-item.active[data-v-16780a20]{background:#3b82f61a}.command-icon[data-v-16780a20]{width:40px;height:40px;background:#18191b;border-radius:10px;display:flex;align-items:center;justify-content:center;color:#3b82f6;flex-shrink:0}.command-item.active .command-icon[data-v-16780a20]{background:#3b82f6;color:#fff}.command-info[data-v-16780a20]{flex:1;min-width:0}.command-name[data-v-16780a20]{font-size:14px;font-weight:500;color:#f4f4f5;margin-bottom:4px}.command-desc[data-v-16780a20]{font-size:12px;color:#84848a}.message-bubble[data-v-16780a20] p{margin:0 0 10px}.message-bubble[data-v-16780a20] p:last-child{margin-bottom:0}.message-bubble[data-v-16780a20] code{background:#18191b;padding:2px 6px;border-radius:4px;font-family:monospace}.dialog-overlay[data-v-d31752c1]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;opacity:0;visibility:hidden;transition:all .3s;z-index:1000}.dialog-overlay.show[data-v-d31752c1]{opacity:1;visibility:visible}.dialog-sheet[data-v-d31752c1]{position:fixed;bottom:0;left:0;right:0;background:#121212;border-radius:16px 16px 0 0;transform:translateY(100%);transition:transform .3s ease;z-index:1001;max-width:430px;margin:0 auto}.dialog-sheet.show[data-v-d31752c1]{transform:translateY(0)}.dialog-header[data-v-d31752c1]{padding:16px;border-bottom:1px solid #27272a;display:flex;align-items:center;justify-content:space-between}.dialog-title[data-v-d31752c1]{font-size:16px;font-weight:500;color:#f4f4f5}.dialog-close[data-v-d31752c1]{width:32px;height:32px;border-radius:50%;background:#18191b;border:none;color:#84848a;font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.dialog-body[data-v-d31752c1]{padding:16px}.form-group[data-v-d31752c1]{margin-bottom:16px}.form-group label[data-v-d31752c1]{display:block;font-size:13px;color:#84848a;margin-bottom:6px}.form-input[data-v-d31752c1]{width:100%;padding:10px 14px;background:#0a0a09;border:1px solid #27272a;border-radius:8px;color:#f4f4f5;font-size:14px;outline:none;box-sizing:border-box}.form-input[data-v-d31752c1]:focus{border-color:#3b82f6}.form-text[data-v-d31752c1]{color:#d4d4d8;font-size:14px;padding:10px 0}.dialog-actions[data-v-d31752c1]{display:flex;gap:12px;padding:16px;border-top:1px solid #27272a}.dialog-actions button[data-v-d31752c1]{flex:1;padding:12px;border-radius:8px;font-size:14px;cursor:pointer;border:none}.btn-cancel[data-v-d31752c1]{background:#18191b;color:#d4d4d8}.btn-confirm[data-v-d31752c1]{background:#3b82f6;color:#fff}.btn-confirm[data-v-d31752c1]:disabled{background:#27272a;color:#52525b;cursor:not-allowed}.dev-workflow-view[data-v-052737bd]{height:100%;display:flex;flex-direction:column;background:#0a0a09}.step-toolbar[data-v-052737bd]{display:flex;justify-content:flex-end;padding:8px 16px;background:#121212;border-bottom:1px solid #27272a;flex-shrink:0}.btn-sub-scheme[data-v-052737bd]{display:flex;align-items:center;gap:6px;padding:8px 16px;background:#22c55e;color:#fff;border:none;border-radius:6px;font-size:13px;cursor:pointer}.step-content[data-v-052737bd]{flex:1;overflow:hidden}.status-bar[data-v-052737bd]{padding:10px 16px;background:#121212;border-top:1px solid #27272a;font-size:12px;color:#84848a;text-align:center}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.sidebar-scroll[data-v-fe5339c3]::-webkit-scrollbar{width:8px}.sidebar-scroll[data-v-fe5339c3]::-webkit-scrollbar-track{background:transparent}.sidebar-scroll[data-v-fe5339c3]::-webkit-scrollbar-thumb{background:#404040;border-radius:4px}.sidebar-scroll[data-v-fe5339c3]::-webkit-scrollbar-thumb:hover{background:#505050}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.git-changes-app[data-v-8c90dea4]{display:flex;flex-direction:column;height:100vh;max-width:430px;margin:0 auto;background:var(--bg-primary, #0a0a09)}.header[data-v-8c90dea4]{background:var(--bg-secondary, #121212);padding:12px 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--border-color, #27272a);flex-shrink:0}.header-back[data-v-8c90dea4]{color:var(--text-muted, #84848a);font-size:18px;text-decoration:none;padding:8px;margin:-8px}.header-title[data-v-8c90dea4]{font-size:16px;font-weight:500}.header-actions[data-v-8c90dea4]{display:flex;gap:8px}.header-btn[data-v-8c90dea4]{color:var(--text-muted, #84848a);font-size:16px;padding:8px;background:none;border:none;cursor:pointer;transition:color .2s}.header-btn[data-v-8c90dea4]:hover{color:var(--text-primary, #f4f4f5)}.change-summary[data-v-8c90dea4]{background:var(--bg-secondary, #121212);padding:12px 16px;border-bottom:1px solid var(--border-color, #27272a);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.summary-stats[data-v-8c90dea4]{display:flex;gap:16px}.stat-item[data-v-8c90dea4]{display:flex;align-items:center;gap:6px;font-size:13px}.stat-item.add[data-v-8c90dea4]{color:var(--success, #22c55e)}.stat-item.mod[data-v-8c90dea4]{color:var(--warning, #f59e0b)}.stat-item.del[data-v-8c90dea4]{color:var(--danger, #ef4444)}.branch-info[data-v-8c90dea4]{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-muted, #84848a)}.branch-info i[data-v-8c90dea4]{color:var(--accent, #3b82f6)}.tab-bar[data-v-8c90dea4]{background:var(--bg-secondary, #121212);padding:0 16px;display:flex;gap:24px;border-bottom:1px solid var(--border-color, #27272a);flex-shrink:0}.tab-item[data-v-8c90dea4]{padding:12px 0;font-size:14px;color:var(--text-muted, #84848a);border-bottom:2px solid transparent;cursor:pointer;transition:all .2s}.tab-item.active[data-v-8c90dea4]{color:var(--text-primary, #f4f4f5);border-bottom-color:var(--accent, #3b82f6)}.tab-item .count[data-v-8c90dea4]{margin-left:6px;font-size:12px;padding:2px 6px;background:var(--bg-tertiary, #18191b);border-radius:10px}.tab-item.active .count[data-v-8c90dea4]{background:var(--accent, #3b82f6);color:#fff}.filter-bar[data-v-8c90dea4]{background:var(--bg-secondary, #121212);padding:8px 16px;display:flex;gap:8px;border-bottom:1px solid var(--border-color, #27272a);flex-shrink:0;overflow-x:auto}.filter-bar[data-v-8c90dea4]::-webkit-scrollbar{display:none}.filter-chip[data-v-8c90dea4]{padding:6px 12px;font-size:12px;border-radius:16px;border:1px solid var(--border-color, #27272a);background:transparent;color:var(--text-muted, #84848a);cursor:pointer;white-space:nowrap;transition:all .2s;flex-shrink:0}.filter-chip.active[data-v-8c90dea4]{background:var(--accent, #3b82f6);border-color:var(--accent, #3b82f6);color:#fff}.file-list[data-v-8c90dea4]{flex:1;overflow-y:auto}.change-item[data-v-8c90dea4]{display:flex;align-items:center;padding:14px 16px;gap:12px;border-bottom:1px solid var(--border-color, #27272a);transition:background .2s;cursor:pointer}.change-item[data-v-8c90dea4]:active{background:var(--bg-secondary, #121212)}.change-item:active .change-name[data-v-8c90dea4],.change-item:active .change-path[data-v-8c90dea4]{color:var(--text-secondary, #d4d4d8)}.change-item.selected[data-v-8c90dea4]{background:var(--bg-secondary, #121212);border-left:3px solid var(--accent, #3b82f6);padding-left:13px}.change-item.selected .change-name[data-v-8c90dea4],.change-item.selected .change-path[data-v-8c90dea4]{color:var(--text-primary, #f4f4f5)}.change-status[data-v-8c90dea4]{width:24px;height:24px;border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0}.change-status.add[data-v-8c90dea4]{background:#22c55e26;color:#22c55e}.change-status.mod[data-v-8c90dea4]{background:#f59e0b26;color:#f59e0b}.change-status.del[data-v-8c90dea4]{background:#ef444426;color:#ef4444}.change-status.new[data-v-8c90dea4]{background:#3b82f626;color:#3b82f6}.change-info[data-v-8c90dea4]{flex:1;min-width:0}.change-name[data-v-8c90dea4]{font-size:14px;font-weight:500;margin-bottom:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#f4f4f5}.change-path[data-v-8c90dea4]{font-size:12px;color:#84848a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.change-stats[data-v-8c90dea4]{font-size:11px;color:var(--text-muted, #84848a);text-align:right;flex-shrink:0}.change-stats .add-line[data-v-8c90dea4]{color:var(--success, #22c55e)}.change-stats .del-line[data-v-8c90dea4]{color:var(--danger, #ef4444)}.diff-view[data-v-8c90dea4]{flex:1;overflow-y:auto;background:var(--bg-tertiary, #18191b);display:flex;flex-direction:column}.diff-header[data-v-8c90dea4]{background:var(--bg-secondary, #121212);padding:10px 16px;border-bottom:1px solid var(--border-color, #27272a);font-size:13px;color:var(--text-secondary, #d4d4d8);display:flex;align-items:center;gap:8px;flex-shrink:0;position:sticky;top:0;z-index:1}.diff-content[data-v-8c90dea4]{padding:8px 0;font-family:SF Mono,Fira Code,Monaco,Consolas,monospace;font-size:12px;line-height:1.5;flex:1;overflow-y:auto}.diff-loading[data-v-8c90dea4]{display:flex;align-items:center;justify-content:center;gap:8px;padding:20px;color:#84848a}.loading-spinner[data-v-8c90dea4]{width:14px;height:14px;border:2px solid #27272a;border-top-color:#3b82f6;border-radius:50%;animation:spin-8c90dea4 .8s linear infinite}@keyframes spin-8c90dea4{to{transform:rotate(360deg)}}.diff-line[data-v-8c90dea4]{display:flex;padding:2px 12px;white-space:pre-wrap;word-break:break-all;color:#d4d4d8}.diff-line.add[data-v-8c90dea4]{background:#22c55e33}.diff-line.add .line-sign[data-v-8c90dea4]{color:#22c55e}.diff-line.add .line-text[data-v-8c90dea4]{color:#4ade80}.diff-line.del[data-v-8c90dea4]{background:#ef444433}.diff-line.del .line-sign[data-v-8c90dea4]{color:#ef4444}.diff-line.del .line-text[data-v-8c90dea4]{color:#f87171}.diff-line.context[data-v-8c90dea4],.diff-line.context .line-text[data-v-8c90dea4]{color:#9ca3af}.diff-line.header[data-v-8c90dea4]{background:#121212;color:#3b82f6}.diff-line.header .line-text[data-v-8c90dea4]{color:#3b82f6}.line-num[data-v-8c90dea4]{width:40px;text-align:right;padding-right:12px;color:#6b7280;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0}.line-sign[data-v-8c90dea4]{width:16px;text-align:center;flex-shrink:0;color:#9ca3af}.line-sign.add[data-v-8c90dea4]{color:#22c55e}.line-sign.del[data-v-8c90dea4]{color:#ef4444}.line-text[data-v-8c90dea4]{flex:1}.empty-state[data-v-8c90dea4]{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px;text-align:center}.empty-icon[data-v-8c90dea4]{width:80px;height:80px;background:var(--bg-secondary, #121212);border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:20px}.empty-icon i[data-v-8c90dea4]{font-size:32px;color:var(--text-muted, #84848a)}.empty-title[data-v-8c90dea4]{font-size:16px;font-weight:500;margin-bottom:8px}.empty-desc[data-v-8c90dea4]{font-size:14px;color:var(--text-muted, #84848a)}.bottom-actions[data-v-8c90dea4]{background:var(--bg-secondary, #121212);border-top:1px solid var(--border-color, #27272a);padding:12px 16px;padding-bottom:max(12px,env(safe-area-inset-bottom));display:flex;gap:12px;flex-shrink:0}.action-btn[data-v-8c90dea4]{flex:1;padding:12px;border-radius:8px;font-size:14px;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;transition:all .2s}.action-btn[data-v-8c90dea4]:active{transform:scale(.98)}.action-btn[data-v-8c90dea4]:disabled{opacity:.5;cursor:not-allowed}.action-btn.primary[data-v-8c90dea4]{background:var(--accent, #3b82f6);color:#fff}.action-btn.danger[data-v-8c90dea4]{background:#ef444426;color:var(--danger, #ef4444)}.action-btn.secondary[data-v-8c90dea4]{background:var(--bg-tertiary, #18191b);color:var(--text-primary, #f4f4f5);border:1px solid var(--border-color, #27272a)}.drawer-overlay[data-v-8c90dea4]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;opacity:0;visibility:hidden;transition:all .3s;z-index:999}.drawer-overlay.show[data-v-8c90dea4]{opacity:1;visibility:visible}.commit-drawer[data-v-8c90dea4]{position:fixed;bottom:0;left:0;right:0;max-width:430px;margin:0 auto;background:var(--bg-secondary, #121212);border-radius:16px 16px 0 0;transform:translateY(100%);transition:transform .3s ease;z-index:1000;max-height:70vh;display:flex;flex-direction:column}.commit-drawer.show[data-v-8c90dea4]{transform:translateY(0)}.drawer-header[data-v-8c90dea4]{padding:16px;border-bottom:1px solid var(--border-color, #27272a);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.drawer-title[data-v-8c90dea4]{font-size:16px;font-weight:500}.drawer-close[data-v-8c90dea4]{width:32px;height:32px;border-radius:50%;background:var(--bg-tertiary, #18191b);border:none;color:var(--text-muted, #84848a);font-size:14px;cursor:pointer;display:flex;align-items:center;justify-content:center}.commit-form[data-v-8c90dea4]{padding:16px;overflow-y:auto}.form-group[data-v-8c90dea4]{margin-bottom:16px}.form-group label[data-v-8c90dea4]{display:block;font-size:14px;color:var(--text-secondary, #d4d4d8);margin-bottom:8px}.form-group textarea[data-v-8c90dea4]{width:100%;padding:12px;background:var(--bg-tertiary, #18191b);border:1px solid var(--border-color, #27272a);border-radius:8px;color:var(--text-primary, #f4f4f5);font-size:14px;resize:none;outline:none}.form-group textarea[data-v-8c90dea4]:focus{border-color:var(--accent, #3b82f6)}.form-group textarea[data-v-8c90dea4]::-moz-placeholder{color:var(--text-muted, #84848a)}.form-group textarea[data-v-8c90dea4]::placeholder{color:var(--text-muted, #84848a)}.commit-preview[data-v-8c90dea4]{background:var(--bg-tertiary, #18191b);border-radius:8px;padding:12px;margin-bottom:16px}.preview-title[data-v-8c90dea4]{font-size:13px;color:var(--text-muted, #84848a);margin-bottom:8px}.preview-stats[data-v-8c90dea4]{display:flex;gap:16px}.submit-btn[data-v-8c90dea4]{width:100%;padding:14px;background:var(--accent, #3b82f6);border:none;border-radius:10px;color:#fff;font-size:15px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px}.submit-btn[data-v-8c90dea4]:disabled{opacity:.5;cursor:not-allowed}
|