tianxincode 1.0.19 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +5 -1
  2. package/builder.html +98 -0
  3. package/dist/api/custom-actions.routes.d.ts +2 -0
  4. package/dist/api/custom-actions.routes.d.ts.map +1 -0
  5. package/dist/api/custom-actions.routes.js +101 -0
  6. package/dist/api/custom-actions.routes.js.map +1 -0
  7. package/dist/api/gateway.routes.d.ts.map +1 -1
  8. package/dist/api/gateway.routes.js +47 -0
  9. package/dist/api/gateway.routes.js.map +1 -1
  10. package/dist/api/index.d.ts.map +1 -1
  11. package/dist/api/index.js +2 -0
  12. package/dist/api/index.js.map +1 -1
  13. package/dist/components/Header.js +1 -1
  14. package/dist/modules/db/db.service.d.ts +2 -0
  15. package/dist/modules/db/db.service.d.ts.map +1 -1
  16. package/dist/modules/db/db.service.js +32 -0
  17. package/dist/modules/db/db.service.js.map +1 -1
  18. package/dist/modules/waf-gateway/index.d.ts +3 -0
  19. package/dist/modules/waf-gateway/index.d.ts.map +1 -0
  20. package/dist/modules/waf-gateway/index.js +2 -0
  21. package/dist/modules/waf-gateway/index.js.map +1 -0
  22. package/dist/modules/waf-gateway/waf-gateway.service.d.ts +32 -0
  23. package/dist/modules/waf-gateway/waf-gateway.service.d.ts.map +1 -0
  24. package/dist/modules/waf-gateway/waf-gateway.service.js +230 -0
  25. package/dist/modules/waf-gateway/waf-gateway.service.js.map +1 -0
  26. package/package.json +1 -1
  27. package/web/dist/assets/{AiLogsView-YNwXiYLj.js → AiLogsView-Dnk7hwQR.js} +1 -1
  28. package/web/dist/assets/CustomActionsView-DppAusC9.js +1 -0
  29. package/web/dist/assets/DevWorkflowView-BFRV0PSq.js +16 -0
  30. package/web/dist/assets/DevWorkflowView-m3rlqwHy.css +1 -0
  31. package/web/dist/assets/{GitChanges-aRQE_nKK.js → GitChanges-Ce91loC4.js} +1 -1
  32. package/web/dist/assets/{Layout-CjvPVc_q.js → Layout-CGd8ce9F.js} +1 -1
  33. package/web/dist/assets/{TasksView-BQeG7IlT.js → TasksView-BIVHfKfT.js} +1 -1
  34. package/web/dist/assets/{TerminalView-B6bgnhlc.js → TerminalView-MVCt-H7U.js} +1 -1
  35. package/web/dist/assets/{cssMode-MrcpzGyj.js → cssMode-b4McL4xZ.js} +1 -1
  36. package/web/dist/assets/{freemarker2-BmxDhO0V.js → freemarker2-DVKHC1DP.js} +1 -1
  37. package/web/dist/assets/{handlebars-gcG5qbcr.js → handlebars-BZJdpplH.js} +1 -1
  38. package/web/dist/assets/{html-DPniLrNg.js → html-BhdQsgMr.js} +1 -1
  39. package/web/dist/assets/{htmlMode-BoOnKRWM.js → htmlMode-DwBfibQy.js} +1 -1
  40. package/web/dist/assets/{index-ydlSv8Nj.css → index-2nC-4na6.css} +1 -1
  41. package/web/dist/assets/{index-gxvSC7oI.js → index-BR2hcxRn.js} +155 -155
  42. package/web/dist/assets/{javascript-DIh-4rjV.js → javascript-D1JSdfBe.js} +1 -1
  43. package/web/dist/assets/{jsonMode-DfQAhip9.js → jsonMode-BL6rI5IY.js} +1 -1
  44. package/web/dist/assets/{liquid-C9Ruy3XA.js → liquid-BJ_1CxIT.js} +1 -1
  45. package/web/dist/assets/{mdx-CSx8REuK.js → mdx-DF7vzSc0.js} +1 -1
  46. package/web/dist/assets/{python-CbBPpoMg.js → python-DxIO6p9P.js} +1 -1
  47. package/web/dist/assets/{razor-k1HEP5it.js → razor-IMF0jWc3.js} +1 -1
  48. package/web/dist/assets/{tsMode-ZPGfOmPP.js → tsMode-Dmcls-Gv.js} +1 -1
  49. package/web/dist/assets/{typescript-CPGMBX3f.js → typescript-Bi95U9ZL.js} +1 -1
  50. package/web/dist/assets/{xml-DpGT2I4w.js → xml-Vgp06Nxm.js} +1 -1
  51. package/web/dist/assets/{yaml-DyniUTVI.js → yaml-jEbIzjIx.js} +1 -1
  52. package/web/dist/index.html +2 -2
  53. package/doc/001.png +0 -0
  54. package/web/dist/assets/DevWorkflowView-DqtaAqQj.css +0 -1
  55. package/web/dist/assets/DevWorkflowView-lnG06gBv.js +0 -16
@@ -1,4 +1,4 @@
1
- import{conf as t,language as e}from"./typescript-CPGMBX3f.js";import"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{conf as t,language as e}from"./typescript-Bi95U9ZL.js";import"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as Et}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as Et}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as l}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as l}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as s}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as s}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as o}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as o}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{t as O,m as I}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{t as O,m as I}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as s}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as s}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as r}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as r}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as l}from"./index-gxvSC7oI.js";/*!-----------------------------------------------------------------------------
1
+ import{m as l}from"./index-BR2hcxRn.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>TXCode - AI 编程助手</title>
7
7
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
8
- <script type="module" crossorigin src="/assets/index-gxvSC7oI.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-ydlSv8Nj.css">
8
+ <script type="module" crossorigin src="/assets/index-BR2hcxRn.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-2nC-4na6.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="app"></div>
package/doc/001.png DELETED
Binary file
@@ -1 +0,0 @@
1
- .workflow-sidebar[data-v-8e3cf2bb]{width:280px;background:#2d2d2d;border-right:1px solid #1e1e1e;display:flex;flex-direction:column;flex-shrink:0}.sidebar-header[data-v-8e3cf2bb]{padding:16px;border-bottom:1px solid #1e1e1e}.sidebar-header h3[data-v-8e3cf2bb]{font-size:14px;color:#84848a;margin-bottom:12px}.sidebar-header .el-select[data-v-8e3cf2bb]{width:100%;margin-bottom:8px}.project-display-row[data-v-8e3cf2bb]{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-8e3cf2bb]{color:#84848a;font-size:12px}.project-display-row .value[data-v-8e3cf2bb]{color:#d4d4d8;font-size:12px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.step-list[data-v-8e3cf2bb]{flex:1;overflow-y:auto;padding:16px}.step-item[data-v-8e3cf2bb]{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-8e3cf2bb]:hover{background:#ffffff0d}.step-item.active[data-v-8e3cf2bb]{background:#409eff26;border-color:#409eff}.step-item.completed .step-icon[data-v-8e3cf2bb]{background:#22c55e}.step-item.active .step-icon[data-v-8e3cf2bb]{background:#409eff}.step-icon[data-v-8e3cf2bb]{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-8e3cf2bb]{flex:1}.step-title[data-v-8e3cf2bb]{font-size:14px;font-weight:500;margin-bottom:2px;color:#f4f4f5}.step-desc[data-v-8e3cf2bb]{font-size:12px;color:#84848a}.step-status[data-v-8e3cf2bb]{font-size:14px}.step1-container[data-v-bf976168]{height:100%;padding:24px;overflow:hidden}.step1-main[data-v-bf976168]{max-width:600px;margin:0 auto}.panel-section[data-v-bf976168]{background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden}.panel-section-header[data-v-bf976168]{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-bf976168]{padding:4px 8px;font-size:12px}.panel-section-body[data-v-bf976168]{padding:24px}.form-hint[data-v-bf976168]{font-size:12px;color:#84848a;margin-top:8px}.form-hint code[data-v-bf976168]{background:#18191b;padding:2px 6px;border-radius:4px;font-family:ui-monospace,monospace;color:#409eff}.flex[data-v-bf976168]{display:flex}.gap-2[data-v-bf976168]{gap:8px}.step2-container[data-v-61478fe3]{height:100%;display:flex;flex-direction:column}.step2-main[data-v-61478fe3]{display:flex;flex:1;gap:16px;overflow:hidden;padding:16px}.editor-panel[data-v-61478fe3]{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-61478fe3]{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-61478fe3]{flex:1;min-height:0}.chat-panel[data-v-61478fe3]{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-61478fe3]{background:#121212;border-bottom:1px solid #1e1e1e;padding:12px 16px;font-size:14px;font-weight:500;color:#f4f4f5;flex-shrink:0}.chat-messages[data-v-61478fe3]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-61478fe3]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-61478fe3]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-61478fe3]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-61478fe3]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-61478fe3]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-61478fe3] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-61478fe3]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-61478fe3]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-61478fe3]{color:#22c55e}.tool-fail[data-v-61478fe3]{color:#ef4444}.tool-input[data-v-61478fe3]{color:#60a5fa;margin-left:8px}.build-info[data-v-61478fe3]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-61478fe3]{border-top:1px solid #1e1e1e;padding:12px 16px;background:#121212;display:flex;flex-direction:column;gap:8px;flex-shrink:0}.input-area[data-v-61478fe3]{width:100%}.input-actions[data-v-61478fe3]{display:flex;justify-content:flex-end;gap:8px}.status-bar[data-v-61478fe3]{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-61478fe3]{color:#3f3f46}.status-ready[data-v-61478fe3]{color:#22c55e}.status-thinking[data-v-61478fe3]{color:#60a5fa}.thinking-spinner[data-v-61478fe3]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-61478fe3 .8s linear infinite}@keyframes spin-61478fe3{to{transform:rotate(360deg)}}.model-selector[data-v-61478fe3]{cursor:pointer}.model-selector[data-v-61478fe3]:hover{color:#60a5fa}.step3-container[data-v-43ff4355]{height:100%;display:flex;flex-direction:column}.step3-main[data-v-43ff4355]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-43ff4355]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-43ff4355]{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-43ff4355]{font-size:14px;font-weight:500;color:#f4f4f5}.chat-messages[data-v-43ff4355]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-43ff4355]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-43ff4355]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-43ff4355]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-43ff4355]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-43ff4355]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-43ff4355] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-43ff4355]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-43ff4355]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-43ff4355]{color:#22c55e}.tool-fail[data-v-43ff4355]{color:#ef4444}.tool-input[data-v-43ff4355]{color:#60a5fa;margin-left:8px}.build-info[data-v-43ff4355]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-43ff4355]{border-top:1px solid #1e1e1e;padding:12px 16px;background:#121212;display:flex;flex-direction:column;gap:8px;flex-shrink:0}.input-area[data-v-43ff4355]{width:100%}.input-actions[data-v-43ff4355]{display:flex;justify-content:flex-end;gap:8px}.status-bar[data-v-43ff4355]{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-43ff4355]{color:#3f3f46}.status-ready[data-v-43ff4355]{color:#22c55e}.status-thinking[data-v-43ff4355]{color:#60a5fa}.thinking-spinner[data-v-43ff4355]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-43ff4355 .8s linear infinite}@keyframes spin-43ff4355{to{transform:rotate(360deg)}}.model-selector[data-v-43ff4355]{cursor:pointer}.model-selector[data-v-43ff4355]:hover{color:#60a5fa}.step4-container[data-v-bb32b3e1]{height:100%;display:flex;flex-direction:column}.step4-main[data-v-bb32b3e1]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-bb32b3e1]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-bb32b3e1]{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-bb32b3e1]{font-size:14px;font-weight:500;color:#f4f4f5}.chat-messages[data-v-bb32b3e1]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-bb32b3e1]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-bb32b3e1]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-bb32b3e1]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-bb32b3e1]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-bb32b3e1]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-bb32b3e1] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-bb32b3e1]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-bb32b3e1]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-bb32b3e1]{color:#22c55e}.tool-fail[data-v-bb32b3e1]{color:#ef4444}.tool-input[data-v-bb32b3e1]{color:#60a5fa;margin-left:8px}.build-info[data-v-bb32b3e1]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-bb32b3e1]{border-top:1px solid #1e1e1e;padding:12px 16px;background:#121212;display:flex;flex-direction:column;gap:8px;flex-shrink:0}.input-area[data-v-bb32b3e1]{width:100%}.input-actions[data-v-bb32b3e1]{display:flex;justify-content:flex-end;gap:8px}.status-bar[data-v-bb32b3e1]{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-bb32b3e1]{color:#3f3f46}.status-ready[data-v-bb32b3e1]{color:#22c55e}.status-thinking[data-v-bb32b3e1]{color:#60a5fa}.thinking-spinner[data-v-bb32b3e1]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-bb32b3e1 .8s linear infinite}@keyframes spin-bb32b3e1{to{transform:rotate(360deg)}}.model-selector[data-v-bb32b3e1]{cursor:pointer}.model-selector[data-v-bb32b3e1]:hover{color:#60a5fa}.dev-workflow-view[data-v-df83d415]{display:flex;height:100%;overflow:hidden;background:#0a0a09}.main-content[data-v-df83d415]{flex:1;display:flex;flex-direction:column;overflow:hidden}.panel-header[data-v-df83d415]{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-df83d415]{font-size:16px;font-weight:500;color:#f4f4f5}.panel-actions[data-v-df83d415]{display:flex;gap:12px}.step-content[data-v-df83d415]{flex:1;overflow:hidden}.status-bar[data-v-df83d415]{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,16 +0,0 @@
1
- import{n as c,F as d,C as u,M as h,g as p,a as n,e as C,K as _,b as v}from"./index-gxvSC7oI.js";const b={name:"WorkflowSidebar",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>{}},currentCategory:{type:String,default:""},currentProject:{type:String,default:""},currentStep:{type:Number,default:1},isLoading:{type:Boolean,default:!1}},data(){return{selectedCategory:"",selectedProject:"",steps:[{id:1,title:"新建需求",desc:"创建新的需求项目",icon:"el-icon-folder-add"},{id:2,title:"方案设计",desc:"编写需求方案",icon:"el-icon-edit"},{id:3,title:"代码生成",desc:"根据方案生成代码",icon:"el-icon-document"},{id:4,title:"测试验收",desc:"测试验证功能",icon:"el-icon-s-check"}]}},computed:{hasAnyProject(){return Object.keys(this.projects||{}).length>0},visibleSteps(){return this.hasAnyProject?this.steps:this.steps.filter(s=>s.id===1)}},watch:{currentCategory(s){this.selectedCategory=s},currentProject(s){this.selectedProject=s}},methods:{onCategoryChange(s){this.selectedProject="",this.$emit("category-change",s)},onProjectChange(s){this.$emit("project-change",s)},onStepClick(s){this.$emit("step-change",s)},isStepCompleted(s){var i;if(!this.currentProject)return!1;const e=`${this.currentCategory}/${this.currentProject}`,t=this.projects[e];return((i=t==null?void 0:t.stepStatus)==null?void 0:i[s])===!0}}};var S=function(){var e=this,t=e._self._c;return t("div",{staticClass:"workflow-sidebar"},[t("div",{staticClass:"sidebar-header"},[t("h3",[e._v("当前项目")]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("大类")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentCategory||"-"))])]),t("div",{staticClass:"project-display-row"},[t("span",{staticClass:"label"},[e._v("需求")]),t("span",{staticClass:"value"},[e._v(e._s(e.currentProject||"-"))])])]),t("div",{staticClass:"step-list"},e._l(e.visibleSteps,function(i){return t("div",{key:i.id,class:["step-item",{active:e.currentStep===i.id,completed:e.isStepCompleted(i.id)}],on:{click:function(a){return e.onStepClick(i.id)}}},[t("div",{staticClass:"step-icon"},[t("i",{class:i.icon})]),t("div",{staticClass:"step-info"},[t("div",{staticClass:"step-title"},[e._v(e._s(i.title))]),t("div",{staticClass:"step-desc"},[e._v(e._s(i.desc))])]),t("div",{staticClass:"step-status"},[e.isStepCompleted(i.id)?t("i",{staticClass:"el-icon-circle-check",staticStyle:{color:"#22c55e"}}):e._e()])])}),0)])},I=[],w=c(b,S,I,!1,null,"8e3cf2bb");const $=w.exports,k={name:"Step1NewReq",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>({})},basePath:{type:String,default:""},currentCategory:{type:String,default:""},currentProject:{type:String,default:""}},data(){return{selectedCategory:"",selectedProject:"",dialogVisible:!1,dialogInput:"",requirementDialogVisible:!1,requirementDialogInput:""}},computed:{existingRequirementList(){if(!this.selectedCategory)return[];const s=`${this.selectedCategory}/`;return Object.keys(this.projects).filter(e=>e.startsWith(s)).map(e=>e.split("/")[1]).sort()}},watch:{currentCategory:{immediate:!0,handler(s){this.selectedCategory=s||""}},currentProject:{immediate:!0,handler(s){this.selectedProject=s||""}},selectedCategory(s){s||(this.selectedProject="")},existingRequirementList(s){this.selectedProject&&(!Array.isArray(s)||s.length===0||s.includes(this.selectedProject)||(this.selectedProject=""))}},methods:{onCategoryChange(){this.selectedProject="",this.$emit("category-change",this.selectedCategory||""),this.$emit("project-change","")},onProjectChange(){this.$emit("project-change",this.selectedProject||"")},showCreateRequirementDialog(){if(!this.selectedCategory){this.$message.warning("请先选择大类");return}this.requirementDialogInput="",this.requirementDialogVisible=!0},handleCreateRequirementConfirm(){const s=this.requirementDialogInput.trim();if(!s){this.$message.warning("需求名称不能为空");return}if(this.existingRequirementList.includes(s)){this.$message.warning("该需求已存在");return}this.$emit("create-requirement",{category:this.selectedCategory,name:s}),this.requirementDialogVisible=!1},showCreateCategoryDialog(){this.dialogInput="",this.dialogVisible=!0},handleDialogConfirm(){const s=this.dialogInput.trim();if(!s){this.$message.warning("名称不能为空");return}this.$emit("create-category",s),this.dialogVisible=!1}}};var M=function(){var e=this,t=e._self._c;return t("div",{staticClass:"step1-container"},[t("div",{staticClass:"step1-main"},[t("div",{staticClass:"panel-section"},[e._m(0),t("div",{staticClass:"panel-section-body"},[t("el-form",{attrs:{"label-position":"top",size:"small"}},[t("el-form-item",{attrs:{label:"所属大类"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"请选择大类"},on:{change:e.onCategoryChange},model:{value:e.selectedCategory,callback:function(i){e.selectedCategory=i},expression:"selectedCategory"}},e._l(e.categories,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{on:{click:e.showCreateCategoryDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("el-form-item",{attrs:{label:"选择需求"}},[t("div",{staticClass:"flex gap-2"},[t("el-select",{staticStyle:{flex:"1"},attrs:{placeholder:"选择已有需求目录",disabled:!e.selectedCategory},on:{change:e.onProjectChange},model:{value:e.selectedProject,callback:function(i){e.selectedProject=i},expression:"selectedProject"}},e._l(e.existingRequirementList,function(i){return t("el-option",{key:i,attrs:{label:i,value:i}})}),1),t("el-button",{attrs:{disabled:!e.selectedCategory},on:{click:e.showCreateRequirementDialog}},[t("i",{staticClass:"el-icon-plus"}),e._v(" 新建 ")])],1)]),t("div",{staticClass:"form-hint",staticStyle:{color:"#84848a"}},[e._v(" "+e._s(e.selectedCategory?"可直接选择已有需求,或点击“新建”创建需求目录":"请先选择大类")+" ")])],1)],1)])]),t("el-dialog",{attrs:{title:"新建大类",visible:e.dialogVisible,width:"400px"},on:{"update:visible":function(i){e.dialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"大类名称"}},[t("el-input",{attrs:{placeholder:"输入大类名称"},model:{value:e.dialogInput,callback:function(i){e.dialogInput=i},expression:"dialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.dialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleDialogConfirm}},[e._v("确定")])],1)],1),t("el-dialog",{attrs:{title:"新建需求",visible:e.requirementDialogVisible,width:"400px"},on:{"update:visible":function(i){e.requirementDialogVisible=i}}},[t("el-form",[t("el-form-item",{attrs:{label:"需求目录名称"}},[t("el-input",{attrs:{placeholder:"输入需求名称,如:用户管理"},model:{value:e.requirementDialogInput,callback:function(i){e.requirementDialogInput=i},expression:"requirementDialogInput"}})],1)],1),t("span",{attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(i){e.requirementDialogVisible=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleCreateRequirementConfirm}},[e._v("确定")])],1)],1)],1)},P=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-section-header"},[e("span",[e("i",{staticClass:"el-icon-folder-add"}),s._v(" 创建新需求")])])}],j=c(k,M,P,!1,null,"bf976168");const D=j.exports,T={name:"Step2Design",components:{ModelSelectDialog:h,CommandDialog:u,FileSelectDialog:d},props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{editor:null,specContent:"",inputMessage:"",disabled:!1,stopping:!1,promptTokens:0,logItems:[],modelName:"",modelSelectVisible:!1,commandDialogVisible:!1,fileSelectVisible:!1,sessionId:"",sessionStatus:"idle"}},computed:{specFilePath(){return!this.category||!this.name?"等待选择需求...":`${this.reqBasePath}\\${this.category}\\${this.name}\\${this.name}_方案.md`}},watch:{category:{handler(){this.loadData()}},name:{handler(){this.loadData()}}},async mounted(){this.initMonacoEditor(),await this.loadData(),await this.loadDefaultModel(),n.ws.init()},beforeDestroy(){this.editor&&(this.editor.dispose(),this.editor=null),this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{handleKeydown(s){if(s.key==="Enter")if(s.ctrlKey){const e=s.target,t=e.selectionStart,i=e.selectionEnd,a=this.inputMessage;this.inputMessage=a.substring(0,t)+`
2
- `+a.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadData(){await Promise.all([this.loadSpec(),this.loadSession()])},async loadSpec(){if(!this.category||!this.name){this.specContent=`# 选择或创建需求项目开始设计
3
- `,this.syncEditorContent(this.specContent);return}try{const s=this.specFilePath,e=await n.getFileContent(s);this.specContent=e.content||"",this.syncEditorContent(this.specContent)}catch(s){console.error("Load spec failed:",s),this.specContent="",this.syncEditorContent("")}},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const s=`${this.reqBasePath}\\${this.category}\\${this.name}\\session.json`,e=await n.getFileContent(s);if(e&&e.content){const t=JSON.parse(e.content);this.sessionId=t.designSessionId||""}else this.sessionId="";this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(s){console.error("Load session failed:",s),this.sessionId="",this.logItems=[]}},syncEditorContent(s){if(!this.editor||s===void 0||s===null)return;const e=String(s);this.editor.getValue()!==e&&this.editor.setValue(e)},initMonacoEditor(){this.editor||this.$nextTick(()=>{this.createEditor()})},createEditor(){this.editor||(this.editor=C.create(this.$refs.editorContainer,{value:this.specContent||`# 选择或创建需求项目开始设计
4
- `,language:"markdown",theme:"vs-dark",fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Monaco, Consolas, monospace",minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:16}}),this.editor.addCommand(_.CtrlCmd|v.KeyS,()=>{this.saveSpec()}),this.syncEditorContent(this.specContent))},saveSpec(){if(!this.editor)return;const s=this.editor.getValue();this.$emit("save-spec",s)},async sendMessage(){const s=this.inputMessage.trim();if(!s||this.disabled)return;if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession();const e=`先在 ${this.specFilePath} 生成方案,先不要修改代码。
5
-
6
- 用户输入: ${s}`;this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s}),n.sessionWsSend(this.sessionId,"chat",{message:e,sessionId:this.sessionId,modelName:this.modelName||void 0})},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,n.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=n.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.scrollToBottom()},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.scrollToBottom()},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.$emit("spec-updated"),this.scrollToBottom()},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollToBottom(){this.$nextTick(()=>{const s=this.$refs.messagesContainer;s&&(s.scrollTop=s.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await n.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await n.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,n.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},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 x=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"},[e._m(0),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,a){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(o,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(o.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(o.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",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(o,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(o.function.name)+" "),o.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(o.function.name,o.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"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:e.disabled&&!e.stopping},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("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},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("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}})],1)},F=[function(){var s=this,e=s._self._c;return e("div",{staticClass:"panel-header"},[e("span",[e("i",{staticClass:"el-icon-chat-dot-round"}),s._v(" AI 方案助手")])])}],q=c(T,x,F,!1,null,"61478fe3");const V=q.exports,B={name:"Step3CodeGen",components:{ModelSelectDialog:h,CommandDialog:u,FileSelectDialog:d},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,sessionId:"",sessionStatus:"idle"}},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(),n.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,a=this.inputMessage;this.inputMessage=a.substring(0,t)+`
7
- `+a.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const s=`${this.reqBasePath}\\${this.category}\\${this.name}\\session.json`,e=await n.getFileContent(s);if(e&&e.content){const t=JSON.parse(e.content);this.sessionId=t.codeSessionId||""}else this.sessionId="";this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(s){console.error("Load session failed:",s),this.sessionId="",this.logItems=[]}},insertGenerateCommand(){this.specFilePath&&(this.inputMessage=`根据 ${this.specFilePath} 方案开发相应功能,先不要修改方案文档。`)},async sendMessage(){const s=this.inputMessage.trim();if(!(!s||this.disabled)){if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession(),this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s}),n.sessionWsSend(this.sessionId,"chat",{message:s,sessionId:this.sessionId,modelName:this.modelName||void 0})}},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,n.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=n.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.scrollToBottom()},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.scrollToBottom()},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.scrollToBottom()},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollToBottom(){this.$nextTick(()=>{const s=this.$refs.messagesContainer;s&&(s.scrollTop=s.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await n.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await n.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,n.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},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 N=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("el-button",{attrs:{type:"primary",size:"small",disabled:e.disabled},on:{click:e.insertGenerateCommand}},[t("i",{staticClass:"el-icon-document"}),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,a){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(o,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(o.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(o.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",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(o,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(o.function.name)+" "),o.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(o.function.name,o.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"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入代码修改要求... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:e.disabled&&!e.stopping},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("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},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("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}})],1)},R=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-code"}),s._v(" 代码生成对话")])}],E=c(B,N,R,!1,null,"43ff4355");const L=E.exports,O={name:"Step4Test",components:{ModelSelectDialog:h,CommandDialog:u,FileSelectDialog:d},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,sessionId:"",sessionStatus:"idle"}},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(),n.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,a=this.inputMessage;this.inputMessage=a.substring(0,t)+`
8
- `+a.substring(i),this.$nextTick(()=>{e.selectionStart=e.selectionEnd=t+1})}else s.preventDefault(),this.sendMessage()},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const s=`${this.reqBasePath}\\${this.category}\\${this.name}\\session.json`,e=await n.getFileContent(s);if(e&&e.content){const t=JSON.parse(e.content);this.sessionId=t.testSessionId||""}else this.sessionId="";this.sessionId?(await this.loadMessages(),this.subscribeSession()):this.logItems=[]}catch(s){console.error("Load session failed:",s),this.sessionId="",this.logItems=[]}},insertTestCommand(){this.specFilePath&&(this.inputMessage=`根据 ${this.specFilePath} 方案测试相应功能是否实现。`)},async sendMessage(){const s=this.inputMessage.trim();if(!(!s||this.disabled)){if(!this.sessionId){this.$message.error("会话不存在,请刷新页面");return}this.wsUnsubscribe||this.subscribeSession(),this.inputMessage="",this.disabled=!0,this.stopping=!1,this.logItems.push({type:"chat",content:s}),n.sessionWsSend(this.sessionId,"chat",{message:s,sessionId:this.sessionId,modelName:this.modelName||void 0})}},stopChat(){!this.sessionId||this.stopping||(this.stopping=!0,n.sessionWsSend(this.sessionId,"stop",{sessionId:this.sessionId}))},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=n.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.scrollToBottom()},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.scrollToBottom()},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.scrollToBottom()},stopped:()=>{this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.logItems.push({type:"think",content:"【已停止】"}),this.scrollToBottom()},error:s=>{this.$message.error((s==null?void 0:s.error)||"发生错误"),this.disabled=!1,this.stopping=!1,this.sessionStatus="idle"}}))},scrollToBottom(){this.$nextTick(()=>{const s=this.$refs.messagesContainer;s&&(s.scrollTop=s.scrollHeight)})},async loadMessages(){if(this.sessionId)try{const s=await n.getMessages(this.sessionId);this.logItems=s.data||[]}catch(s){console.error("Load messages failed:",s)}},async loadDefaultModel(){var s;try{const e=await n.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,n.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},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:"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,a){return[i.type==="todos"?t("div",{staticClass:"todos-list"},e._l(i.todos,function(o,r){return t("div",{key:r,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[e._v(e._s(e.getTodoStatusIcon(o.status)))]),t("span",{staticClass:"todo-name"},[e._v(e._s(o.name))])])}),0):i.type==="chat"||i.type==="think"?t("div",{staticClass:"user-question",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(o,r){return t("div",{key:r,staticClass:"log-mute"},[t("span",{class:i.success!==!1?"tool-success":"tool-fail"},[e._v(" "+e._s(i.success!==!1?"✓":"✗")+" ")]),e._v(" "+e._s(o.function.name)+" "),o.function.arguments?t("span",{staticClass:"tool-input"},[e._v(e._s(e.formatInput(o.function.name,o.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"},[t("el-input",{staticClass:"input-area",attrs:{type:"textarea",rows:3,placeholder:"输入测试要求... (Enter 发送, Ctrl+Enter 换行, @ 选择文件)",disabled:e.disabled&&!e.stopping},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("div",{staticClass:"input-actions"},[e.disabled&&!e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"danger"},on:{click:e.stopChat}},[e._v(" ■ 停止 ")]):e.stopping?t("el-button",{staticClass:"stop-btn",attrs:{type:"info",disabled:""}},[e._v(" 停止中... ")]):t("el-button",{staticClass:"send-btn",attrs:{type:"primary",disabled:!e.inputMessage.trim()},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("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}})],1)},K=[function(){var s=this,e=s._self._c;return e("span",[e("i",{staticClass:"el-icon-s-check"}),s._v(" 测试验收对话")])}],W=c(O,U,K,!1,null,"bb32b3e1");const H=W.exports,A={name:"DevWorkflowView",components:{WorkflowSidebar:$,Step1NewReq:D,Step2Design:V,Step3CodeGen:L,Step4Test:H},props:{sidebarVisible:{type:Boolean,default:!0}},data(){return{currentCategory:"",currentProject:"",currentStep:1,categories:[],projects:{},reqBasePath:"",isLoadingProjects:!1}},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(){this.loadState(),this.loadCategories()},methods:{async loadState(){try{const e=(await n.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 n.updateWorkflowState(this.currentCategory,this.currentProject,this.currentStep)}catch(s){console.error("Save workflow state failed:",s)}},async loadCategories(){var s,e;try{const t=await n.getCwd();this.reqBasePath=((s=t.data)==null?void 0:s.basePath)||"";const a=((e=(await n.browseFilesystem(this.reqBasePath)).data)==null?void 0:e.items)||[];this.categories=a.filter(o=>o.is_directory).map(o=>o.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}`,a=((e=(await n.browseFilesystem(t)).data)==null?void 0:e.items)||[];this.projects={},a.filter(o=>o.is_directory).forEach(o=>{const r=`${s}/${o.name}`;this.projects[r]={name:o.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 n.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}`;await n.renameFile(t,e);const i=this.categories.indexOf(s);i>-1&&(this.categories[i]=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 n.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 o,r,g;if(this.projects[e]){this.$message.warning("需求已存在");return}try{const l=`${this.reqBasePath}\\${s}\\${e}`;await n.createDirectory(l)}catch(l){console.error("Create requirement directory failed:",l)}const t=`# ${e}方案
9
-
10
- > 所属大类:${s}
11
-
12
- ## 业务目标
13
-
14
- ## 功能点
15
-
16
- `;try{const l=`${this.reqBasePath}\\${s}\\${e}\\${e}_方案.md`;await n.writeFile(l,t)}catch(l){console.error("Write spec file failed:",l)}let i={designSessionId:"",codeSessionId:"",testSessionId:""};try{const[l,f,m]=await Promise.all([n.createSession(`workflow:${s}/${e}:design`),n.createSession(`workflow:${s}/${e}:code`),n.createSession(`workflow:${s}/${e}:test`)]);i={designSessionId:((o=l.data)==null?void 0:o.id)||"",codeSessionId:((r=f.data)==null?void 0:r.id)||"",testSessionId:((g=m.data)==null?void 0:g.id)||""};const y=`${this.reqBasePath}\\${s}\\${e}\\session.json`;await n.writeFile(y,JSON.stringify(i,null,2))}catch(l){console.error("Create sessions failed:",l)}const a=`${s}/${e}`;this.$set(this.projects,a,{name:e,stepStatus:{}}),this.currentCategory=s,this.currentProject=e,this.$message.success(`需求「${e}」创建成功`),this.$nextTick(()=>{this.currentStep=2})},async onSaveSpec(s){if(!this.projectKey)return;const e=`${this.reqBasePath}\\${this.currentCategory}\\${this.currentProject}\\${this.currentProject}_方案.md`;try{await n.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 J=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(" 刷新方案 ")])]: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()],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)},z=[],G=c(A,J,z,!1,null,"df83d415");const X=G.exports;export{X as default};