tianxincode 1.0.25 → 1.0.26

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 (44) hide show
  1. package/dist/api/index.d.ts.map +1 -1
  2. package/dist/api/index.js +2 -0
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/api/wiki.routes.d.ts +5 -0
  5. package/dist/api/wiki.routes.d.ts.map +1 -0
  6. package/dist/api/wiki.routes.js +62 -0
  7. package/dist/api/wiki.routes.js.map +1 -0
  8. package/dist/components/Header.js +1 -1
  9. package/package.json +1 -1
  10. package/txcode/skills/llm-wiki/validate-menu.js +148 -0
  11. package/web/dist/assets/{AiLogsView-CVrYev7d.js → AiLogsView-TTa6moV3.js} +1 -1
  12. package/web/dist/assets/ConfirmDialog-eCpi8rBQ.js +1 -0
  13. package/web/dist/assets/{CustomActionsView-CQxKk6SO.js → CustomActionsView-Cq7LMVOm.js} +1 -1
  14. package/web/dist/assets/DevWorkflowView-3uw47AWR.js +11 -0
  15. package/web/dist/assets/{DevWorkflowView-BOszt_zy.css → DevWorkflowView-C48T1Vn9.css} +1 -1
  16. package/web/dist/assets/DevWorkflowView-DEua6ZP6.css +1 -0
  17. package/web/dist/assets/{DevWorkflowView-CpVJXbRj.js → DevWorkflowView-tWFUkf3j.js} +3 -3
  18. package/web/dist/assets/GitChanges-D430pnbK.js +2 -0
  19. package/web/dist/assets/GitChangesApp-Cxlq5udx.js +2 -0
  20. package/web/dist/assets/GitChangesApp-D8TsaOlK.css +1 -0
  21. package/web/dist/assets/{Layout-DSOX_ZQg.js → Layout-fAJ6zHSG.js} +1 -1
  22. package/web/dist/assets/{TasksView-BQLcnztt.js → TasksView-C2sykBn1.js} +1 -1
  23. package/web/dist/assets/{TerminalView-CaEdQC15.js → TerminalView-6zhWPcS2.js} +1 -1
  24. package/web/dist/assets/WikiView-B3ioU5qp.js +1 -0
  25. package/web/dist/assets/WikiView-OxwIcazz.css +1 -0
  26. package/web/dist/assets/{cssMode-Wg7UhMIG.js → cssMode-DL32wtS4.js} +1 -1
  27. package/web/dist/assets/{freemarker2-DaMvTxgM.js → freemarker2-BlocLFsd.js} +1 -1
  28. package/web/dist/assets/{handlebars-BmSrZuMd.js → handlebars-_Spxw7Li.js} +1 -1
  29. package/web/dist/assets/{html-wdaeQuim.js → html-CWQbZQWQ.js} +1 -1
  30. package/web/dist/assets/{htmlMode-CgOkorRk.js → htmlMode-DATEJehN.js} +1 -1
  31. package/web/dist/assets/{index-D3xzRDti.css → index-CYjLVF1N.css} +1 -1
  32. package/web/dist/assets/{index-n-xW_xO-.js → index-CpCSEd7o.js} +207 -207
  33. package/web/dist/assets/{javascript-D1li0PeC.js → javascript-BBvSL4U3.js} +1 -1
  34. package/web/dist/assets/{jsonMode-DXU-WgyL.js → jsonMode-DX7TVjfD.js} +1 -1
  35. package/web/dist/assets/{liquid-BQ5-AUOg.js → liquid-CL5JIb08.js} +1 -1
  36. package/web/dist/assets/{mdx-NaQ3utsA.js → mdx-C31_gl86.js} +1 -1
  37. package/web/dist/assets/{python-Bi2ecxh2.js → python-7Kp2T0Nb.js} +1 -1
  38. package/web/dist/assets/{razor-aB18BLo4.js → razor-W7cm7GQ5.js} +1 -1
  39. package/web/dist/assets/{tsMode-DnD0UWyD.js → tsMode-BZP54ZOj.js} +1 -1
  40. package/web/dist/assets/{typescript-CFJU3nfS.js → typescript-BiKyz9zw.js} +1 -1
  41. package/web/dist/assets/{xml-BoojtM7k.js → xml-CrkoIiwJ.js} +1 -1
  42. package/web/dist/assets/{yaml-DFVYjsED.js → yaml-CTJ6CfjA.js} +1 -1
  43. package/web/dist/index.html +2 -2
  44. package/web/dist/assets/GitChanges-CghJtlNa.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsBH,eAAO,MAAM,SAAS,4CAAW,CAAC;AAqBlC,mBAAmB,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH,eAAO,MAAM,SAAS,4CAAW,CAAC;AAsBlC,mBAAmB,gBAAgB,CAAC"}
package/dist/api/index.js CHANGED
@@ -20,6 +20,7 @@ import { workflowRouter } from './workflow.routes.js';
20
20
  import { gitRouter } from './git.routes.js';
21
21
  import { customActionsRouter } from './custom-actions.routes.js';
22
22
  import { specsRouter } from './specs.routes.js';
23
+ import { wikiRouter } from './wiki.routes.js';
23
24
  export const apiRouter = Router();
24
25
  apiRouter.use('/chat', chatRouter);
25
26
  apiRouter.use('/sessions', sessionRouter);
@@ -39,4 +40,5 @@ apiRouter.use('/workflow', workflowRouter);
39
40
  apiRouter.use('/git', gitRouter);
40
41
  apiRouter.use('/custom-actions', customActionsRouter);
41
42
  apiRouter.use('/specs', specsRouter);
43
+ apiRouter.use('/wiki', wikiRouter);
42
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAElC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACnC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC1C,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACvC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACvC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACjC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACrC,SAAS,CAAC,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAC/C,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACvC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACzC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AACzC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACrC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACjC,SAAS,CAAC,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AACtD,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAElC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACnC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC1C,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACvC,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACvC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACjC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC/B,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACrC,SAAS,CAAC,GAAG,CAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;AAC/C,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACvC,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACzC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AACzC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACrC,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;AAC3C,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACjC,SAAS,CAAC,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAAC;AACtD,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACrC,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Wiki API 路由
3
+ */
4
+ export declare const wikiRouter: import("express-serve-static-core").Router;
5
+ //# sourceMappingURL=wiki.routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wiki.routes.d.ts","sourceRoot":"","sources":["../../src/api/wiki.routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,eAAO,MAAM,UAAU,4CAAW,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Wiki API 路由
3
+ */
4
+ import { Router } from 'express';
5
+ import * as fs from 'fs';
6
+ import * as path from 'path';
7
+ import * as yaml from 'yaml';
8
+ export const wikiRouter = Router();
9
+ const DOCS_BASE_PATH = path.resolve(process.cwd(), '.txcode/wiki');
10
+ wikiRouter.get('/menu', (req, res) => {
11
+ try {
12
+ const menuPath = path.join(DOCS_BASE_PATH, 'menu.yaml');
13
+ if (!fs.existsSync(menuPath)) {
14
+ return res.status(404).json({ success: false, error: 'menu.yaml not found' });
15
+ }
16
+ const menuContent = fs.readFileSync(menuPath, 'utf-8');
17
+ const menuData = yaml.parse(menuContent);
18
+ res.json({ success: true, data: menuData });
19
+ }
20
+ catch (error) {
21
+ console.error('Error reading wiki menu:', error);
22
+ res.status(500).json({ success: false, error: 'Failed to read menu' });
23
+ }
24
+ });
25
+ wikiRouter.get('/content', (req, res) => {
26
+ try {
27
+ const { path: filePath } = req.query;
28
+ if (!filePath || typeof filePath !== 'string') {
29
+ return res.status(400).json({ success: false, error: 'path parameter is required' });
30
+ }
31
+ const normalizedPath = filePath.replace(/^\//, '');
32
+ const fullPath = path.join(DOCS_BASE_PATH, normalizedPath);
33
+ if (!fs.existsSync(fullPath)) {
34
+ return res.status(404).json({ success: false, error: 'File not found' });
35
+ }
36
+ const content = fs.readFileSync(fullPath, 'utf-8');
37
+ res.json({ success: true, data: content });
38
+ }
39
+ catch (error) {
40
+ console.error('Error reading wiki content:', error);
41
+ res.status(500).json({ success: false, error: 'Failed to read content' });
42
+ }
43
+ });
44
+ wikiRouter.get('/asset', (req, res) => {
45
+ try {
46
+ const { path: assetPath } = req.query;
47
+ if (!assetPath || typeof assetPath !== 'string') {
48
+ return res.status(400).json({ success: false, error: 'path parameter is required' });
49
+ }
50
+ const normalizedPath = assetPath.replace(/^\//, '');
51
+ const fullPath = path.join(DOCS_BASE_PATH, normalizedPath);
52
+ if (!fs.existsSync(fullPath)) {
53
+ return res.status(404).json({ success: false, error: 'Asset not found' });
54
+ }
55
+ res.sendFile(fullPath);
56
+ }
57
+ catch (error) {
58
+ console.error('Error reading wiki asset:', error);
59
+ res.status(500).json({ success: false, error: 'Failed to read asset' });
60
+ }
61
+ });
62
+ //# sourceMappingURL=wiki.routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wiki.routes.js","sourceRoot":"","sources":["../../src/api/wiki.routes.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAEnC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;AAEnE,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACnC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACxD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;QAChF,CAAC;QACD,MAAM,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACvD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACzC,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;QACjD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACtC,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC;QACrC,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC9C,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;QACvF,CAAC;QAED,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAE3D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC3E,CAAC;QAED,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACpC,IAAI,CAAC;QACH,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC;QACtC,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAChD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,4BAA4B,EAAE,CAAC,CAAC;QACvF,CAAC;QAED,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC;QAE3D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;QAClD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Box, Text } from 'ink';
3
- const VERSION = '1.0.25';
3
+ const VERSION = '1.0.26';
4
4
  export const Header = React.memo(function Header() {
5
5
  return (React.createElement(Box, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 1 },
6
6
  React.createElement(Text, { bold: true, cyan: true }, " "),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tianxincode",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "type": "module",
5
5
  "description": "AI Coding Assistant",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from 'fs';
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import yaml from 'js-yaml';
7
+ import { execSync } from 'child_process';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ const args = process.argv.slice(2);
13
+ let MENU_FILE = args[0];
14
+
15
+ if (!MENU_FILE) {
16
+ const wikiDir = path.join(process.cwd(), '.txcode/wiki');
17
+ MENU_FILE = path.join(wikiDir, 'menu.yaml');
18
+ }
19
+
20
+ const ERRORS = [];
21
+ const WARNINGS = [];
22
+
23
+ function validateMenu(menu, menuPath = []) {
24
+ if (!Array.isArray(menu)) {
25
+ ERRORS.push(`[${menuPath.join('.')}] 导航必须是数组`);
26
+ return;
27
+ }
28
+
29
+ for (let i = 0; i < menu.length; i++) {
30
+ const item = menu[i];
31
+ const currentPath = [...menuPath, i];
32
+
33
+ if (!item || typeof item !== 'object') {
34
+ ERRORS.push(`[${currentPath.join('.')}] 菜单项必须是对象`);
35
+ continue;
36
+ }
37
+
38
+ if (!item.title || typeof item.title !== 'string') {
39
+ ERRORS.push(`[${currentPath.join('.')}] 缺少或无效的 title 字段`);
40
+ }
41
+
42
+ const hasChildren = Array.isArray(item.children) && item.children.length > 0;
43
+ const hasUrl = item.url && typeof item.url === 'string';
44
+
45
+ if (hasChildren && hasUrl) {
46
+ ERRORS.push(`[${currentPath.join('.')} "${item.title}"] 不能同时有 children 和 url`);
47
+ }
48
+
49
+ if (!hasChildren && !hasUrl) {
50
+ ERRORS.push(`[${currentPath.join('.')} "${item.title}"] 必须有 children 或 url`);
51
+ }
52
+
53
+ if (item.icon && typeof item.icon !== 'string') {
54
+ WARNINGS.push(`[${currentPath.join('.')} "${item.title}"] icon 应该是字符串`);
55
+ }
56
+
57
+ if (hasChildren) {
58
+ validateMenu(item.children, currentPath);
59
+ } else if (hasUrl) {
60
+ if (!item.url.endsWith('.md')) {
61
+ WARNINGS.push(`[${currentPath.join('.')} "${item.title}"] url 应该以 .md 结尾: ${item.url}`);
62
+ }
63
+ const wikiRoot = path.dirname(MENU_FILE);
64
+ const mdPath = path.join(wikiRoot, item.url);
65
+ if (!fs.existsSync(mdPath)) {
66
+ WARNINGS.push(`[${currentPath.join('.')} "${item.title}"] 文件不存在: ${mdPath}`);
67
+ }
68
+ }
69
+ }
70
+ }
71
+
72
+ function validateMenuFile(menuFile) {
73
+ if (!fs.existsSync(menuFile)) {
74
+ console.error(`\n❌ 文件不存在: ${menuFile}`);
75
+ console.log(`\n用法: node validate-menu.js [menu.yaml路径]\n`);
76
+ process.exit(1);
77
+ }
78
+
79
+ const content = fs.readFileSync(menuFile, 'utf-8');
80
+ let data;
81
+
82
+ try {
83
+ data = yaml.load(content);
84
+ } catch (e) {
85
+ console.error(`\n❌ YAML 解析失败: ${e.message}\n`);
86
+ process.exit(1);
87
+ }
88
+
89
+ console.log(`\n📋 验证菜单文件: ${menuFile}\n`);
90
+
91
+ if (!data.site_name) {
92
+ ERRORS.push('缺少 site_name 字段');
93
+ }
94
+
95
+ if (!data.nav || !Array.isArray(data.nav)) {
96
+ ERRORS.push('缺少或无效的 nav 字段(必须是数组)');
97
+ } else {
98
+ validateMenu(data.nav, ['nav']);
99
+ }
100
+
101
+ if (data.git_commit) {
102
+ try {
103
+ const currentCommit = execSync('git rev-parse --short HEAD', { encoding: 'utf-8' }).trim();
104
+ if (data.git_commit !== currentCommit) {
105
+ WARNINGS.push(`git_commit (${data.git_commit}) 与当前 HEAD (${currentCommit}) 不一致`);
106
+ }
107
+ } catch {
108
+ // git 命令失败,忽略
109
+ }
110
+ }
111
+
112
+ console.log('─'.repeat(50));
113
+
114
+ if (ERRORS.length > 0) {
115
+ console.log('\n❌ 错误:\n');
116
+ ERRORS.forEach(e => console.log(` ${e}`));
117
+ }
118
+
119
+ if (WARNINGS.length > 0) {
120
+ console.log('\n⚠️ 警告:\n');
121
+ WARNINGS.forEach(w => console.log(` ${w}`));
122
+ }
123
+
124
+ if (ERRORS.length === 0) {
125
+ console.log('\n✅ 验证通过!\n');
126
+ printMenuTree(data.nav);
127
+ return true;
128
+ } else {
129
+ console.log('\n❌ 验证失败\n');
130
+ return false;
131
+ }
132
+ }
133
+
134
+ function printMenuTree(menu, indent = 0) {
135
+ const prefix = ' '.repeat(indent * 2);
136
+ for (const item of menu) {
137
+ const icon = item.icon ? `[${item.icon.split(' ').pop()}] ` : '';
138
+ if (item.children) {
139
+ console.log(`${prefix}📁 ${icon}${item.title}`);
140
+ printMenuTree(item.children, indent + 1);
141
+ } else {
142
+ console.log(`${prefix}📄 ${icon}${item.title}`);
143
+ }
144
+ }
145
+ }
146
+
147
+ const success = validateMenuFile(MENU_FILE);
148
+ process.exit(success ? 0 : 1);
@@ -1 +1 @@
1
- import{n as x,a as n}from"./index-n-xW_xO-.js";const c=[{key:"ai_call_logs",name:"AI 日志",icon:"fa-solid fa-robot text-xs"}],p={name:"AiLogsView",data(){return{logTypes:c,selectedLogType:c[0],logs:[],page:1,pageSize:20,total:0,totalPages:1,sessions:[],loading:!1,filters:{callType:"",sessionId:"",startTime:"",endTime:""}}},async created(){await this.loadSessions(),await this.loadLogs()},methods:{async loadSessions(){try{const s=await n.getSessions(100,0);this.sessions=s.data||[]}catch(s){console.error("Load sessions failed:",s)}},selectLogType(s){this.selectedLogType=s,this.resetFilters()},async loadLogs(){this.loading=!0;try{const s=await n.getAiCallLogs(this.page,this.pageSize);let t=s.data.rows||[];if(this.filters.callType&&(t=t.filter(e=>e.call_type===this.filters.callType)),this.filters.sessionId&&(t=t.filter(e=>e.session_id&&e.session_id.includes(this.filters.sessionId))),this.filters.startTime){const e=new Date(this.filters.startTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()>=e)}if(this.filters.endTime){const e=new Date(this.filters.endTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()<=e)}this.logs=t,this.total=s.data.total,this.totalPages=s.data.totalPages}catch(s){console.error("Load logs failed:",s),this.logs=[]}finally{this.loading=!1}},resetFilters(){this.filters.callType="",this.filters.sessionId="",this.filters.startTime="",this.filters.endTime="",this.page=1,this.loadLogs()},async prevPage(){this.page>1&&(this.page--,await this.loadLogs())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadLogs())},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},getSessionTitle(s){if(!s)return"-";const t=this.sessions.find(e=>e.id===s);return t?t.title:s.substring(0,8)},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"}}};var b=function(){var l,d;var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[t._m(0),e("div",{staticClass:"flex-1 overflow-y-auto py-1"},t._l(t.logTypes,function(a){var i;return e("div",{key:a.key,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:((i=t.selectedLogType)==null?void 0:i.key)===a.key?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(r){return t.selectLogType(a)}}},[e("i",{class:a.icon}),e("span",{staticClass:"truncate"},[t._v(t._s(a.name))])])}),0)]),e("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar"},[e("div",{staticClass:"flex items-center gap-4 mb-3"},[e("div",{staticClass:"flex items-center gap-2"},[e("i",{class:(l=t.selectedLogType)==null?void 0:l.icon}),e("span",{staticClass:"text-white font-medium"},[t._v(t._s((d=t.selectedLogType)==null?void 0:d.name))])]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.total)+" 条记录")])]),e("div",{staticClass:"flex items-center gap-4 flex-wrap"},[e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("调用类型:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.callType,expression:"filters.callType"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"callType",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部")]),e("option",{attrs:{value:"tool_call"}},[t._v("工具调用")]),e("option",{attrs:{value:"normal"}},[t._v("普通对话")])])]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("会话:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.sessionId,expression:"filters.sessionId"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"sessionId",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部会话")]),t._l(t.sessions,function(a){return e("option",{key:a.id,domProps:{value:a.id}},[t._v(t._s(a.title))])})],2)]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("开始时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.startTime,expression:"filters.startTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.startTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"startTime",a.target.value)}}})]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("结束时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.endTime,expression:"filters.endTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.endTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"endTime",a.target.value)}}})]),e("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:t.loadLogs}},[t._v(" 查询 ")]),e("button",{staticClass:"px-3 py-1 text-textMuted text-xs rounded hover:bg-white/10",on:{click:t.resetFilters}},[t._v(" 重置 ")])])]),e("div",{staticClass:"flex-1 overflow-auto p-4"},[e("table",{staticClass:"w-full text-sm"},[t._m(1),e("tbody",[t._l(t.logs,function(a){return e("tr",{key:a.id,staticClass:"hover:bg-white/5"},[e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.id))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatTime(a.request_time)))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[e("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.call_type==="tool_call"?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"},[t._v(" "+t._s(a.call_type==="tool_call"?"工具调用":"普通对话")+" ")])]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.model_name))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatDuration(a.duration_ms)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.input_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.output_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v("$"+t._s((a.cost||0).toFixed(4)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[150px]",attrs:{title:a.session_id}},[t._v(t._s(t.getSessionTitle(a.session_id)))])])}),t.logs.length===0?e("tr",[e("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"9"}},[t._v("暂无数据")])]):t._e()],2)])]),e("div",{staticClass:"flex items-center justify-between px-4 py-2 border-t border-border bg-sidebar"},[e("span",{staticClass:"text-xs text-textMuted"},[t._v("共 "+t._s(t.total)+" 条")]),e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page<=1},on:{click:t.prevPage}},[e("i",{staticClass:"fa-solid fa-chevron-left"}),t._v(" 上一页 ")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.page)+" / "+t._s(t.totalPages||1))]),e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page>=t.totalPages},on:{click:t.nextPage}},[t._v(" 下一页 "),e("i",{staticClass:"fa-solid fa-chevron-right"})])])])])])},f=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[t("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-list"}),s._v(" 日志 ")])])},function(){var s=this,t=s._self._c;return t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",[t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("ID")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("类型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输入Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输出Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("费用")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("会话ID")])])])}],u=x(p,b,f,!1,null,null);const _=u.exports;export{_ as default};
1
+ import{n as x,a as n}from"./index-CpCSEd7o.js";const c=[{key:"ai_call_logs",name:"AI 日志",icon:"fa-solid fa-robot text-xs"}],p={name:"AiLogsView",data(){return{logTypes:c,selectedLogType:c[0],logs:[],page:1,pageSize:20,total:0,totalPages:1,sessions:[],loading:!1,filters:{callType:"",sessionId:"",startTime:"",endTime:""}}},async created(){await this.loadSessions(),await this.loadLogs()},methods:{async loadSessions(){try{const s=await n.getSessions(100,0);this.sessions=s.data||[]}catch(s){console.error("Load sessions failed:",s)}},selectLogType(s){this.selectedLogType=s,this.resetFilters()},async loadLogs(){this.loading=!0;try{const s=await n.getAiCallLogs(this.page,this.pageSize);let t=s.data.rows||[];if(this.filters.callType&&(t=t.filter(e=>e.call_type===this.filters.callType)),this.filters.sessionId&&(t=t.filter(e=>e.session_id&&e.session_id.includes(this.filters.sessionId))),this.filters.startTime){const e=new Date(this.filters.startTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()>=e)}if(this.filters.endTime){const e=new Date(this.filters.endTime).getTime();t=t.filter(l=>new Date(l.request_time).getTime()<=e)}this.logs=t,this.total=s.data.total,this.totalPages=s.data.totalPages}catch(s){console.error("Load logs failed:",s),this.logs=[]}finally{this.loading=!1}},resetFilters(){this.filters.callType="",this.filters.sessionId="",this.filters.startTime="",this.filters.endTime="",this.page=1,this.loadLogs()},async prevPage(){this.page>1&&(this.page--,await this.loadLogs())},async nextPage(){this.page<this.totalPages&&(this.page++,await this.loadLogs())},formatTime(s){return s?new Date(s).toLocaleString("zh-CN"):"-"},getSessionTitle(s){if(!s)return"-";const t=this.sessions.find(e=>e.id===s);return t?t.title:s.substring(0,8)},formatDuration(s){return s?s<1e3?`${s}ms`:`${(s/1e3).toFixed(2)}s`:"0ms"}}};var b=function(){var l,d;var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("aside",{staticClass:"w-[260px] bg-sidebar border-r border-border flex flex-col shrink-0"},[t._m(0),e("div",{staticClass:"flex-1 overflow-y-auto py-1"},t._l(t.logTypes,function(a){var i;return e("div",{key:a.key,staticClass:"flex items-center gap-2 px-3 py-1.5 cursor-pointer text-sm",class:((i=t.selectedLogType)==null?void 0:i.key)===a.key?"bg-active text-white border-l-2 border-accent":"text-textMuted hover:text-white hover:bg-white/5 border-l-2 border-transparent",on:{click:function(r){return t.selectLogType(a)}}},[e("i",{class:a.icon}),e("span",{staticClass:"truncate"},[t._v(t._s(a.name))])])}),0)]),e("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[e("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar"},[e("div",{staticClass:"flex items-center gap-4 mb-3"},[e("div",{staticClass:"flex items-center gap-2"},[e("i",{class:(l=t.selectedLogType)==null?void 0:l.icon}),e("span",{staticClass:"text-white font-medium"},[t._v(t._s((d=t.selectedLogType)==null?void 0:d.name))])]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.total)+" 条记录")])]),e("div",{staticClass:"flex items-center gap-4 flex-wrap"},[e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("调用类型:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.callType,expression:"filters.callType"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"callType",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部")]),e("option",{attrs:{value:"tool_call"}},[t._v("工具调用")]),e("option",{attrs:{value:"normal"}},[t._v("普通对话")])])]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("会话:")]),e("select",{directives:[{name:"model",rawName:"v-model",value:t.filters.sessionId,expression:"filters.sessionId"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",on:{change:[function(a){var i=Array.prototype.filter.call(a.target.options,function(r){return r.selected}).map(function(r){var o="_value"in r?r._value:r.value;return o});t.$set(t.filters,"sessionId",a.target.multiple?i:i[0])},t.loadLogs]}},[e("option",{attrs:{value:""}},[t._v("全部会话")]),t._l(t.sessions,function(a){return e("option",{key:a.id,domProps:{value:a.id}},[t._v(t._s(a.title))])})],2)]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("开始时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.startTime,expression:"filters.startTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.startTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"startTime",a.target.value)}}})]),e("div",{staticClass:"flex items-center gap-2"},[e("label",{staticClass:"text-xs text-textMuted"},[t._v("结束时间:")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.filters.endTime,expression:"filters.endTime"}],staticClass:"bg-black/20 border border-white/10 text-white text-xs px-2 py-1 rounded",attrs:{type:"datetime-local"},domProps:{value:t.filters.endTime},on:{change:t.loadLogs,input:function(a){a.target.composing||t.$set(t.filters,"endTime",a.target.value)}}})]),e("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:t.loadLogs}},[t._v(" 查询 ")]),e("button",{staticClass:"px-3 py-1 text-textMuted text-xs rounded hover:bg-white/10",on:{click:t.resetFilters}},[t._v(" 重置 ")])])]),e("div",{staticClass:"flex-1 overflow-auto p-4"},[e("table",{staticClass:"w-full text-sm"},[t._m(1),e("tbody",[t._l(t.logs,function(a){return e("tr",{key:a.id,staticClass:"hover:bg-white/5"},[e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.id))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatTime(a.request_time)))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[e("span",{staticClass:"text-xs px-2 py-0.5 rounded",class:a.call_type==="tool_call"?"bg-blue-500/20 text-blue-400":"bg-green-500/20 text-green-400"},[t._v(" "+t._s(a.call_type==="tool_call"?"工具调用":"普通对话")+" ")])]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.model_name))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(t.formatDuration(a.duration_ms)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.input_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v(t._s(a.output_tokens||0))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30"},[t._v("$"+t._s((a.cost||0).toFixed(4)))]),e("td",{staticClass:"px-3 py-2 text-gray-300 border-b border-border/30 truncate max-w-[150px]",attrs:{title:a.session_id}},[t._v(t._s(t.getSessionTitle(a.session_id)))])])}),t.logs.length===0?e("tr",[e("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"9"}},[t._v("暂无数据")])]):t._e()],2)])]),e("div",{staticClass:"flex items-center justify-between px-4 py-2 border-t border-border bg-sidebar"},[e("span",{staticClass:"text-xs text-textMuted"},[t._v("共 "+t._s(t.total)+" 条")]),e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page<=1},on:{click:t.prevPage}},[e("i",{staticClass:"fa-solid fa-chevron-left"}),t._v(" 上一页 ")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.page)+" / "+t._s(t.totalPages||1))]),e("button",{staticClass:"px-2 py-1 text-xs text-textMuted hover:text-white disabled:opacity-30 disabled:cursor-not-allowed",attrs:{disabled:t.page>=t.totalPages},on:{click:t.nextPage}},[t._v(" 下一页 "),e("i",{staticClass:"fa-solid fa-chevron-right"})])])])])])},f=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"flex border-b border-border text-xs uppercase font-bold text-textMuted"},[t("div",{staticClass:"px-4 py-2 border-b-2 border-accent text-white flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-list"}),s._v(" 日志 ")])])},function(){var s=this,t=s._self._c;return t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",[t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("ID")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("时间")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("类型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("模型")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("耗时")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输入Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("输出Token")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("费用")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("会话ID")])])])}],u=x(p,b,f,!1,null,null);const _=u.exports;export{_ as default};
@@ -0,0 +1 @@
1
+ import{n}from"./index-CpCSEd7o.js";const r={name:"ConfirmDialog",props:{visible:{type:Boolean,default:!1},message:{type:String,default:""}}};var i=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"},[t("div",{staticClass:"bg-sidebar border border-border rounded p-4 w-96"},[t("p",{staticClass:"text-gray-200 text-sm mb-4"},[e._v(e._s(e.message))]),t("div",{staticClass:"flex justify-end gap-2"},[t("button",{staticClass:"px-3 py-1 text-xs text-gray-400 hover:text-white",on:{click:function(s){return e.$emit("cancel")}}},[e._v("取消")]),t("button",{staticClass:"px-3 py-1 text-xs bg-red-600 text-white rounded hover:bg-red-700",on:{click:function(s){return e.$emit("confirm")}}},[e._v("确定")])])])]):e._e()},a=[],o=n(r,i,a,!1,null,null);const d=o.exports;export{d as C};
@@ -1 +1 @@
1
- import{n as d,a as n}from"./index-n-xW_xO-.js";const u={name:"CustomActionsView",data(){return{actions:[],currentType:"design",showDialog:!1,isEditing:!1,currentAction:null,form:{action_type:"design",name:"",prompt:"",auto_send:!1,sort_order:0},actionTypes:[{value:"design",label:"方案设计"},{value:"code",label:"代码生成"},{value:"test",label:"测试验收"}]}},computed:{filteredActions(){return this.actions.filter(s=>s.action_type===this.currentType)}},async created(){await this.loadActions();const s=this.$route.query.type;s&&["design","code","test"].includes(s)&&(this.currentType=s)},methods:{async loadActions(){try{const s=await n.getCustomActions();this.actions=s.data||[]}catch(s){console.error("Load actions failed:",s),this.$message.error("加载动作失败")}},selectType(s){this.currentType=s},getCountByType(s){return this.actions.filter(t=>t.action_type===s).length},openCreateDialog(){this.isEditing=!1,this.form={action_type:this.currentType,name:"",prompt:"",auto_send:!1,sort_order:0},this.showDialog=!0},openEditDialog(s){this.isEditing=!0,this.currentAction=s,this.form={action_type:s.action_type,name:s.name,prompt:s.prompt,auto_send:!!s.auto_send,sort_order:s.sort_order||0},this.showDialog=!0},closeDialog(){this.showDialog=!1,this.currentAction=null},async saveAction(){if(!this.form.name||!this.form.prompt){this.$message.error("请填写必填项");return}try{this.isEditing&&this.currentAction?(await n.updateCustomAction(this.currentAction.id,this.form),this.$message.success("动作已更新")):(await n.createCustomAction(this.form),this.$message.success("动作已创建")),this.closeDialog(),await this.loadActions()}catch(s){this.$message.error("保存失败: "+s.message)}},async deleteAction(s){if(confirm(`确定删除动作 "${s.name}" 吗?`))try{await n.deleteCustomAction(s.id),this.$message.success("动作已删除"),await this.loadActions()}catch(t){this.$message.error("删除失败: "+t.message)}},getTypeLabel(s){return{design:"方案设计",code:"代码生成",test:"测试验收"}[s]||s}}};var p=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden bg-[#1e1e1e]"},[e("div",{staticClass:"w-48 border-r border-border bg-sidebar shrink-0 flex flex-col"},[t._m(0),e("div",{staticClass:"flex-1 overflow-auto py-2"},t._l(t.actionTypes,function(r){return e("div",{key:r.value,staticClass:"px-4 py-2 cursor-pointer flex items-center justify-between",class:t.currentType===r.value?"bg-accent/20 text-accent":"text-textMuted hover:bg-white/5",on:{click:function(a){return t.selectType(r.value)}}},[e("span",{staticClass:"text-sm"},[t._v(t._s(r.label))]),e("span",{staticClass:"text-xs opacity-60"},[t._v("("+t._s(t.getCountByType(r.value))+")")])])}),0)]),e("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[e("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar shrink-0"},[e("div",{staticClass:"flex items-center justify-between"},[e("div",{staticClass:"flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-bolt text-accent"}),e("span",{staticClass:"text-white font-medium"},[t._v("自定义动作")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v("("+t._s(t.getTypeLabel(t.currentType))+")")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.filteredActions.length)+" 个动作")])]),e("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:t.openCreateDialog}},[e("i",{staticClass:"fa-solid fa-plus mr-1"}),t._v(" 新增动作 ")])])]),e("div",{staticClass:"flex-1 overflow-auto p-4"},[e("table",{staticClass:"w-full text-sm"},[t._m(1),e("tbody",[t._l(t.filteredActions,function(r){return e("tr",{key:r.id,staticClass:"hover:bg-white/5"},[e("td",{staticClass:"px-3 py-2 border-b border-border/30 text-gray-200"},[t._v(t._s(r.name))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30 text-gray-300 max-w-[300px] truncate",attrs:{title:r.prompt}},[t._v(t._s(r.prompt))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[r.auto_send?e("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-green-500/20 text-green-400"},[t._v("是")]):e("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-gray-500/20 text-gray-400"},[t._v("否")])]),e("td",{staticClass:"px-3 py-2 border-b border-border/30 text-gray-300"},[t._v(t._s(r.sort_order))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"text-xs px-2 py-1 text-blue-400 hover:bg-blue-500/20 rounded",on:{click:function(a){return t.openEditDialog(r)}}},[t._v("编辑")]),e("button",{staticClass:"text-xs px-2 py-1 text-red-400 hover:bg-red-500/20 rounded",on:{click:function(a){return t.deleteAction(r)}}},[t._v("删除")])])])])}),t.filteredActions.length===0?e("tr",[e("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"5"}},[t._v('暂无动作,点击"新增动作"创建')])]):t._e()],2)])])]),t.showDialog?e("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[e("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[500px] max-h-[80vh] overflow-auto"},[e("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between"},[e("h3",{staticClass:"text-white font-medium"},[t._v(t._s(t.isEditing?"编辑动作":"新增动作"))]),e("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:t.closeDialog}},[t._v("关闭")])]),e("div",{staticClass:"p-4 space-y-4"},[e("div",[t._m(2),e("select",{directives:[{name:"model",rawName:"v-model",value:t.form.action_type,expression:"form.action_type"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{disabled:t.isEditing},on:{change:function(r){var a=Array.prototype.filter.call(r.target.options,function(o){return o.selected}).map(function(o){var l="_value"in o?o._value:o.value;return l});t.$set(t.form,"action_type",r.target.multiple?a:a[0])}}},[e("option",{attrs:{value:"design"}},[t._v("方案设计")]),e("option",{attrs:{value:"code"}},[t._v("代码生成")]),e("option",{attrs:{value:"test"}},[t._v("测试验收")])])]),e("div",[t._m(3),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"text",placeholder:"按钮显示名称"},domProps:{value:t.form.name},on:{input:function(r){r.target.composing||t.$set(t.form,"name",r.target.value)}}})]),e("div",[t._m(4),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.prompt,expression:"form.prompt"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded resize-none",attrs:{rows:"4",placeholder:"点击按钮后填入输入框的内容"},domProps:{value:t.form.prompt},on:{input:function(r){r.target.composing||t.$set(t.form,"prompt",r.target.value)}}})]),e("div",[e("label",{staticClass:"block text-xs text-textMuted mb-1"},[t._v("排序")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.form.sort_order,expression:"form.sort_order",modifiers:{number:!0}}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"number",placeholder:"数字越小越靠前"},domProps:{value:t.form.sort_order},on:{input:function(r){r.target.composing||t.$set(t.form,"sort_order",t._n(r.target.value))},blur:function(r){return t.$forceUpdate()}}})]),e("div",{staticClass:"flex items-center gap-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.auto_send,expression:"form.auto_send"}],staticClass:"accent-accent",attrs:{type:"checkbox",id:"autoSend"},domProps:{checked:Array.isArray(t.form.auto_send)?t._i(t.form.auto_send,null)>-1:t.form.auto_send},on:{change:function(r){var a=t.form.auto_send,o=r.target,l=!!o.checked;if(Array.isArray(a)){var c=null,i=t._i(a,c);o.checked?i<0&&t.$set(t.form,"auto_send",a.concat([c])):i>-1&&t.$set(t.form,"auto_send",a.slice(0,i).concat(a.slice(i+1)))}else t.$set(t.form,"auto_send",l)}}}),e("label",{staticClass:"text-xs text-textMuted",attrs:{for:"autoSend"}},[t._v("点击后自动发送(无需手动确认)")])])]),e("div",{staticClass:"px-4 py-3 border-t border-border flex justify-end gap-2"},[e("button",{staticClass:"px-4 py-1 text-textMuted text-sm rounded hover:bg-white/10",on:{click:t.closeDialog}},[t._v("取消")]),e("button",{staticClass:"px-4 py-1 bg-accent text-white text-sm rounded hover:bg-accent/80",on:{click:t.saveAction}},[t._v(" "+t._s(t.isEditing?"保存":"创建")+" ")])])])]):t._e()])},x=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"px-4 py-3 border-b border-border"},[t("span",{staticClass:"text-white text-sm font-medium"},[s._v("类型")])])},function(){var s=this,t=s._self._c;return t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",[t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("名称")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("提示词")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("自动发送")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("排序")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("操作")])])])},function(){var s=this,t=s._self._c;return t("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("类型 "),t("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,t=s._self._c;return t("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("名称 "),t("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,t=s._self._c;return t("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("提示词 "),t("span",{staticClass:"text-red-400"},[s._v("*")])])}],m=d(u,p,x,!1,null,null);const f=m.exports;export{f as default};
1
+ import{n as d,a as n}from"./index-CpCSEd7o.js";const u={name:"CustomActionsView",data(){return{actions:[],currentType:"design",showDialog:!1,isEditing:!1,currentAction:null,form:{action_type:"design",name:"",prompt:"",auto_send:!1,sort_order:0},actionTypes:[{value:"design",label:"方案设计"},{value:"code",label:"代码生成"},{value:"test",label:"测试验收"}]}},computed:{filteredActions(){return this.actions.filter(s=>s.action_type===this.currentType)}},async created(){await this.loadActions();const s=this.$route.query.type;s&&["design","code","test"].includes(s)&&(this.currentType=s)},methods:{async loadActions(){try{const s=await n.getCustomActions();this.actions=s.data||[]}catch(s){console.error("Load actions failed:",s),this.$message.error("加载动作失败")}},selectType(s){this.currentType=s},getCountByType(s){return this.actions.filter(t=>t.action_type===s).length},openCreateDialog(){this.isEditing=!1,this.form={action_type:this.currentType,name:"",prompt:"",auto_send:!1,sort_order:0},this.showDialog=!0},openEditDialog(s){this.isEditing=!0,this.currentAction=s,this.form={action_type:s.action_type,name:s.name,prompt:s.prompt,auto_send:!!s.auto_send,sort_order:s.sort_order||0},this.showDialog=!0},closeDialog(){this.showDialog=!1,this.currentAction=null},async saveAction(){if(!this.form.name||!this.form.prompt){this.$message.error("请填写必填项");return}try{this.isEditing&&this.currentAction?(await n.updateCustomAction(this.currentAction.id,this.form),this.$message.success("动作已更新")):(await n.createCustomAction(this.form),this.$message.success("动作已创建")),this.closeDialog(),await this.loadActions()}catch(s){this.$message.error("保存失败: "+s.message)}},async deleteAction(s){if(confirm(`确定删除动作 "${s.name}" 吗?`))try{await n.deleteCustomAction(s.id),this.$message.success("动作已删除"),await this.loadActions()}catch(t){this.$message.error("删除失败: "+t.message)}},getTypeLabel(s){return{design:"方案设计",code:"代码生成",test:"测试验收"}[s]||s}}};var p=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex-1 flex overflow-hidden bg-[#1e1e1e]"},[e("div",{staticClass:"w-48 border-r border-border bg-sidebar shrink-0 flex flex-col"},[t._m(0),e("div",{staticClass:"flex-1 overflow-auto py-2"},t._l(t.actionTypes,function(r){return e("div",{key:r.value,staticClass:"px-4 py-2 cursor-pointer flex items-center justify-between",class:t.currentType===r.value?"bg-accent/20 text-accent":"text-textMuted hover:bg-white/5",on:{click:function(a){return t.selectType(r.value)}}},[e("span",{staticClass:"text-sm"},[t._v(t._s(r.label))]),e("span",{staticClass:"text-xs opacity-60"},[t._v("("+t._s(t.getCountByType(r.value))+")")])])}),0)]),e("div",{staticClass:"flex-1 flex flex-col overflow-hidden"},[e("div",{staticClass:"px-4 py-3 border-b border-border bg-sidebar shrink-0"},[e("div",{staticClass:"flex items-center justify-between"},[e("div",{staticClass:"flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-bolt text-accent"}),e("span",{staticClass:"text-white font-medium"},[t._v("自定义动作")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v("("+t._s(t.getTypeLabel(t.currentType))+")")]),e("span",{staticClass:"text-xs text-textMuted"},[t._v(t._s(t.filteredActions.length)+" 个动作")])]),e("button",{staticClass:"px-3 py-1 bg-accent text-white text-xs rounded hover:bg-accent/80",on:{click:t.openCreateDialog}},[e("i",{staticClass:"fa-solid fa-plus mr-1"}),t._v(" 新增动作 ")])])]),e("div",{staticClass:"flex-1 overflow-auto p-4"},[e("table",{staticClass:"w-full text-sm"},[t._m(1),e("tbody",[t._l(t.filteredActions,function(r){return e("tr",{key:r.id,staticClass:"hover:bg-white/5"},[e("td",{staticClass:"px-3 py-2 border-b border-border/30 text-gray-200"},[t._v(t._s(r.name))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30 text-gray-300 max-w-[300px] truncate",attrs:{title:r.prompt}},[t._v(t._s(r.prompt))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[r.auto_send?e("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-green-500/20 text-green-400"},[t._v("是")]):e("span",{staticClass:"text-xs px-2 py-0.5 rounded bg-gray-500/20 text-gray-400"},[t._v("否")])]),e("td",{staticClass:"px-3 py-2 border-b border-border/30 text-gray-300"},[t._v(t._s(r.sort_order))]),e("td",{staticClass:"px-3 py-2 border-b border-border/30"},[e("div",{staticClass:"flex items-center gap-2"},[e("button",{staticClass:"text-xs px-2 py-1 text-blue-400 hover:bg-blue-500/20 rounded",on:{click:function(a){return t.openEditDialog(r)}}},[t._v("编辑")]),e("button",{staticClass:"text-xs px-2 py-1 text-red-400 hover:bg-red-500/20 rounded",on:{click:function(a){return t.deleteAction(r)}}},[t._v("删除")])])])])}),t.filteredActions.length===0?e("tr",[e("td",{staticClass:"px-3 py-8 text-center text-textMuted",attrs:{colspan:"5"}},[t._v('暂无动作,点击"新增动作"创建')])]):t._e()],2)])])]),t.showDialog?e("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[e("div",{staticClass:"bg-sidebar border border-border rounded-lg w-[500px] max-h-[80vh] overflow-auto"},[e("div",{staticClass:"px-4 py-3 border-b border-border flex items-center justify-between"},[e("h3",{staticClass:"text-white font-medium"},[t._v(t._s(t.isEditing?"编辑动作":"新增动作"))]),e("button",{staticClass:"text-textMuted hover:text-white text-sm",on:{click:t.closeDialog}},[t._v("关闭")])]),e("div",{staticClass:"p-4 space-y-4"},[e("div",[t._m(2),e("select",{directives:[{name:"model",rawName:"v-model",value:t.form.action_type,expression:"form.action_type"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{disabled:t.isEditing},on:{change:function(r){var a=Array.prototype.filter.call(r.target.options,function(o){return o.selected}).map(function(o){var l="_value"in o?o._value:o.value;return l});t.$set(t.form,"action_type",r.target.multiple?a:a[0])}}},[e("option",{attrs:{value:"design"}},[t._v("方案设计")]),e("option",{attrs:{value:"code"}},[t._v("代码生成")]),e("option",{attrs:{value:"test"}},[t._v("测试验收")])])]),e("div",[t._m(3),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.name,expression:"form.name"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"text",placeholder:"按钮显示名称"},domProps:{value:t.form.name},on:{input:function(r){r.target.composing||t.$set(t.form,"name",r.target.value)}}})]),e("div",[t._m(4),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.form.prompt,expression:"form.prompt"}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded resize-none",attrs:{rows:"4",placeholder:"点击按钮后填入输入框的内容"},domProps:{value:t.form.prompt},on:{input:function(r){r.target.composing||t.$set(t.form,"prompt",r.target.value)}}})]),e("div",[e("label",{staticClass:"block text-xs text-textMuted mb-1"},[t._v("排序")]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.form.sort_order,expression:"form.sort_order",modifiers:{number:!0}}],staticClass:"w-full bg-black/20 border border-white/10 text-white text-sm px-3 py-2 rounded",attrs:{type:"number",placeholder:"数字越小越靠前"},domProps:{value:t.form.sort_order},on:{input:function(r){r.target.composing||t.$set(t.form,"sort_order",t._n(r.target.value))},blur:function(r){return t.$forceUpdate()}}})]),e("div",{staticClass:"flex items-center gap-2"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.auto_send,expression:"form.auto_send"}],staticClass:"accent-accent",attrs:{type:"checkbox",id:"autoSend"},domProps:{checked:Array.isArray(t.form.auto_send)?t._i(t.form.auto_send,null)>-1:t.form.auto_send},on:{change:function(r){var a=t.form.auto_send,o=r.target,l=!!o.checked;if(Array.isArray(a)){var c=null,i=t._i(a,c);o.checked?i<0&&t.$set(t.form,"auto_send",a.concat([c])):i>-1&&t.$set(t.form,"auto_send",a.slice(0,i).concat(a.slice(i+1)))}else t.$set(t.form,"auto_send",l)}}}),e("label",{staticClass:"text-xs text-textMuted",attrs:{for:"autoSend"}},[t._v("点击后自动发送(无需手动确认)")])])]),e("div",{staticClass:"px-4 py-3 border-t border-border flex justify-end gap-2"},[e("button",{staticClass:"px-4 py-1 text-textMuted text-sm rounded hover:bg-white/10",on:{click:t.closeDialog}},[t._v("取消")]),e("button",{staticClass:"px-4 py-1 bg-accent text-white text-sm rounded hover:bg-accent/80",on:{click:t.saveAction}},[t._v(" "+t._s(t.isEditing?"保存":"创建")+" ")])])])]):t._e()])},x=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"px-4 py-3 border-b border-border"},[t("span",{staticClass:"text-white text-sm font-medium"},[s._v("类型")])])},function(){var s=this,t=s._self._c;return t("thead",{staticClass:"bg-sidebar sticky top-0"},[t("tr",[t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("名称")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("提示词")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("自动发送")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("排序")]),t("th",{staticClass:"px-3 py-2 text-left text-xs font-bold text-textMuted uppercase border-b border-border"},[s._v("操作")])])])},function(){var s=this,t=s._self._c;return t("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("类型 "),t("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,t=s._self._c;return t("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("名称 "),t("span",{staticClass:"text-red-400"},[s._v("*")])])},function(){var s=this,t=s._self._c;return t("label",{staticClass:"block text-xs text-textMuted mb-1"},[s._v("提示词 "),t("span",{staticClass:"text-red-400"},[s._v("*")])])}],m=d(u,p,x,!1,null,null);const f=m.exports;export{f as default};
@@ -0,0 +1,11 @@
1
+ import{n as h,c as p,g as u,w as c,d as m,a as o}from"./index-CpCSEd7o.js";const C={name:"AppWorkflowStep",props:{currentStep:{type:Number,default:1}},data(){return{steps:[{id:1,label:"需求"},{id:2,label:"设计"},{id:3,label:"代码"},{id:4,label:"测试"}]}}};var _=function(){var s=this,t=s._self._c;return t("div",{staticClass:"workflow-step-bar"},s._l(s.steps,function(i){return t("div",{key:i.id,staticClass:"step-item",class:{active:s.currentStep>=i.id,current:s.currentStep===i.id},on:{click:function(r){return s.$emit("step-change",i.id)}}},[t("div",{staticClass:"step-number"},[s._v(s._s(i.id))]),t("div",{staticClass:"step-label"},[s._v(s._s(i.label))])])}),0)},w=[],y=h(C,_,w,!1,null,"b4e41396");const b=y.exports,k={name:"AppStep1Req",props:{categories:{type:Array,default:()=>[]},projects:{type:Object,default:()=>({})},reqBasePath:{type:String,default:""},currentCategory:{type:String,default:""},currentProject:{type:String,default:""}},data(){return{selectedCategory:"",selectedProject:"",dialogVisible:!1,dialogInput:"",requirementDialogVisible:!1,requirementDialogInput:""}},computed:{requirementList(){if(!this.selectedCategory)return[];const e=`${this.selectedCategory}/`;return Object.keys(this.projects).filter(s=>s.startsWith(e)).map(s=>s.split("/")[1]).sort()}},watch:{currentCategory:{immediate:!0,handler(e){this.selectedCategory=e||""}},currentProject:{immediate:!0,handler(e){this.selectedProject=e||""}},selectedCategory(e){e||(this.selectedProject="")}},methods:{selectCategory(e){this.selectedCategory=e,this.$emit("category-change",e),this.$emit("project-change","")},selectProject(e){this.selectedProject=e,this.$emit("project-change",e)},showCreateCategoryDialog(){this.dialogInput="",this.dialogVisible=!0},handleDialogConfirm(){const e=this.dialogInput.trim();e&&(this.$emit("create-category",e),this.dialogVisible=!1)},showCreateRequirementDialog(){this.selectedCategory&&(this.requirementDialogInput="",this.requirementDialogVisible=!0)},handleCreateRequirementConfirm(){const e=this.requirementDialogInput.trim();e&&(this.requirementList.includes(e)||(this.$emit("create-requirement",{category:this.selectedCategory,name:e}),this.requirementDialogVisible=!1))}}};var S=function(){var s=this,t=s._self._c;return t("div",{staticClass:"step1-req"},[t("div",{staticClass:"category-section"},[s._m(0),t("div",{staticClass:"category-list"},[s._l(s.categories,function(i){return t("div",{key:i,staticClass:"category-item",class:{active:s.selectedCategory===i},on:{click:function(r){return s.selectCategory(i)}}},[t("i",{staticClass:"fa-solid fa-folder"}),t("span",[s._v(s._s(i))])])}),t("div",{staticClass:"category-item add-btn",on:{click:s.showCreateCategoryDialog}},[t("i",{staticClass:"fa-solid fa-plus"}),t("span",[s._v("新建大类")])])],2)]),t("div",{staticClass:"divider"}),t("div",{staticClass:"project-section"},[t("div",{staticClass:"section-header"},[t("span",[s._v("选择需求")]),t("button",{staticClass:"btn-primary",attrs:{disabled:!s.selectedCategory},on:{click:s.showCreateRequirementDialog}},[t("i",{staticClass:"fa-solid fa-plus"}),s._v(" 新建 ")])]),t("div",{staticClass:"project-list"},[s._l(s.requirementList,function(i){return t("div",{key:i,staticClass:"project-item",on:{click:function(r){return s.selectProject(i)}}},[t("div",{staticClass:"project-info"},[t("i",{staticClass:"fa-solid fa-folder-open"}),t("span",[s._v(s._s(i))])]),t("i",{staticClass:"fa-solid fa-chevron-right"})])}),!s.requirementList.length&&s.selectedCategory?t("div",{staticClass:"empty-hint"},[s._v(" 暂无需求,请点击新建 ")]):s._e(),s.selectedCategory?s._e():t("div",{staticClass:"empty-hint"},[s._v(" 请先选择大类 ")])],2)]),s.dialogVisible?t("div",{staticClass:"dialog-overlay",on:{click:function(i){if(i.target!==i.currentTarget)return null;s.dialogVisible=!1}}},[t("div",{staticClass:"dialog"},[t("div",{staticClass:"dialog-header"},[t("span",[s._v("新建大类")]),t("button",{staticClass:"close-btn",on:{click:function(i){s.dialogVisible=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"dialog-body"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.dialogInput,expression:"dialogInput"}],attrs:{type:"text",placeholder:"输入大类名称"},domProps:{value:s.dialogInput},on:{keydown:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.handleDialogConfirm.apply(null,arguments)},input:function(i){i.target.composing||(s.dialogInput=i.target.value)}}})]),t("div",{staticClass:"dialog-footer"},[t("button",{staticClass:"btn-cancel",on:{click:function(i){s.dialogVisible=!1}}},[s._v("取消")]),t("button",{staticClass:"btn-confirm",on:{click:s.handleDialogConfirm}},[s._v("确定")])])])]):s._e(),s.requirementDialogVisible?t("div",{staticClass:"dialog-overlay",on:{click:function(i){if(i.target!==i.currentTarget)return null;s.requirementDialogVisible=!1}}},[t("div",{staticClass:"dialog"},[t("div",{staticClass:"dialog-header"},[t("span",[s._v("新建需求")]),t("button",{staticClass:"close-btn",on:{click:function(i){s.requirementDialogVisible=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"dialog-body"},[t("input",{directives:[{name:"model",rawName:"v-model",value:s.requirementDialogInput,expression:"requirementDialogInput"}],attrs:{type:"text",placeholder:"输入需求名称"},domProps:{value:s.requirementDialogInput},on:{keydown:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")?null:s.handleCreateRequirementConfirm.apply(null,arguments)},input:function(i){i.target.composing||(s.requirementDialogInput=i.target.value)}}})]),t("div",{staticClass:"dialog-footer"},[t("button",{staticClass:"btn-cancel",on:{click:function(i){s.requirementDialogVisible=!1}}},[s._v("取消")]),t("button",{staticClass:"btn-confirm",on:{click:s.handleCreateRequirementConfirm}},[s._v("确定")])])])]):s._e()])},$=[function(){var e=this,s=e._self._c;return s("div",{staticClass:"section-header"},[s("span",[e._v("选择大类")])])}],P=h(k,S,$,!1,null,"df31eca7");const D=P.exports,I={name:"AppStep2Design",components:{FileSelectDrawer:p},props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{mode:"chat",specView:"edit",specContent:"",inputMessage:"",isProcessing:!1,stopping:!1,logItems:[],sessionId:"",modelName:"",promptTokens:0,showModelDrawer:!1,showCommandDrawer:!1,showFileDrawer:!1,models:[],logSeq:0,wsUnsubscribe:null}},computed:{specFilePath(){return!this.category||!this.name?"":`${this.reqBasePath}/${this.category}/${this.name}/${this.name}_方案.md`},renderedContent(){return u(this.specContent||"")}},watch:{category:{handler(){this.loadData()}},name:{handler(){this.loadData()}}},async mounted(){c.init(),await this.loadModels(),await this.loadDefaultModel(),await this.loadData()},beforeDestroy(){this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{async loadData(){await Promise.all([this.loadSpec(),this.loadSession()])},async loadSpec(){if(!this.category||!this.name){this.specContent="";return}try{const e=await o.getFileContent(this.specFilePath);this.specContent=e.content||""}catch{this.specContent=""}},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const e=`${this.reqBasePath}/${this.category}/${this.name}/session.json`,s=await o.getFileContent(e);if(s&&s.content){const t=JSON.parse(s.content);this.sessionId=t.designSessionId||""}else this.sessionId="";this.sessionId&&(await this.loadMessages(),this.subscribeSession())}catch{this.sessionId=""}},async saveSpec(){if(this.specFilePath)try{await o.writeFile(this.specFilePath,this.specContent),this.$emit("save-spec",this.specContent),this.$emit("spec-updated"),this.$message.success("方案已保存")}catch{this.$message.error("保存失败")}},async loadModels(){try{const e=await o.getModels();this.models=e.data||[]}catch(e){console.error("Load models failed:",e)}},async loadDefaultModel(){var e;try{const s=await o.getConfig("defaultModel");(e=s.data)!=null&&e.value&&(this.modelName=s.data.value)}catch{this.modelName="gpt-4o"}},selectModel(e){const s=e.name.split("/");this.modelName=s.length>2?s.slice(1).join("/"):e.name,o.setConfig("defaultModel",this.modelName),this.showModelDrawer=!1},async loadMessages(){if(this.sessionId)try{const e=await m(this.sessionId);this.logItems=(e.data||[]).map(s=>s.type==="think"?{type:"think",content:s.content||"",_id:`log-${++this.logSeq}`}:s.type==="step"?{type:"step",thought:s.thought,toolCalls:s.toolCalls||[],success:s.success,_id:`log-${++this.logSeq}`}:s.type==="chat"?{type:"chat",content:s.content,_id:`log-${++this.logSeq}`}:s.type==="todos"?{type:"todos",todos:s.todos||[],_id:`log-${++this.logSeq}`}:{type:"system",content:String(s),_id:`log-${++this.logSeq}`}),this.scrollToBottom()}catch(e){console.error("Load messages failed:",e)}},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=c.subscribe(this.sessionId,{running_sessions:e=>{const s=(e==null?void 0:e.runningSessionIds)||[];this.isProcessing=s.includes(this.sessionId)},todos:e=>{this.logItems.push({type:"todos",todos:e.todos,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},step:e=>{var s;this.logItems.push({type:"step",thought:e==null?void 0:e.thought,toolCalls:(e==null?void 0:e.toolCalls)||[],success:e==null?void 0:e.success,_id:`log-${++this.logSeq}`}),(s=e==null?void 0:e.usage)!=null&&s.promptTokens&&(this.promptTokens=e.usage.promptTokens),this.scrollToBottom()},compact:e=>{this.logItems.push({type:"system",content:`【压缩完成】${e.summary||""}`,_id:`log-${++this.logSeq}`}),this.loadMessages()},done:e=>{var s;this.isProcessing=!1,this.stopping=!1,e!=null&&e.modelName&&(this.modelName=e.modelName),(s=e==null?void 0:e.usage)!=null&&s.promptTokens&&(this.promptTokens=e.usage.promptTokens),e!=null&&e.response&&this.logItems.push({type:"think",content:e.response,_id:`log-${++this.logSeq}`}),this.$emit("spec-updated"),this.loadSpec(),this.scrollToBottom()},stopped:()=>{this.isProcessing=!1,this.stopping=!1,this.logItems.push({type:"think",content:"【已停止】",_id:`log-${++this.logSeq}`}),this.scrollToBottom()},error:e=>{this.isProcessing=!1,this.stopping=!1,this.$message.error((e==null?void 0:e.error)||"发生错误")}}))},async sendMessage(){const e=this.inputMessage.trim();if(!e||this.isProcessing||!this.sessionId)return;this.wsUnsubscribe||this.subscribeSession();const s=`先在 ${this.specFilePath} 生成方案,先不要修改代码。
2
+
3
+ 用户输入: ${e}`;this.inputMessage="",this.isProcessing=!0,this.logItems.push({type:"chat",content:e,_id:`log-${++this.logSeq}`}),this.scrollToBottom(),c.send("chat",{message:s,sessionId:this.sessionId,modelName:this.modelName||void 0})},stopGeneration(){this.sessionId&&(this.isProcessing=!1,this.stopping=!0,c.send("stop",{sessionId:this.sessionId}))},appendCommand(e){var s;this.inputMessage=e+" ",(s=this.$refs.inputField)==null||s.focus()},onFileSelected(e){var s;this.inputMessage=this.inputMessage+e+" ",this.showFileDrawer=!1,(s=this.$refs.inputField)==null||s.focus()},closeAllDrawers(){this.showModelDrawer=!1,this.showCommandDrawer=!1,this.showFileDrawer=!1},renderMarkdown(e){return e?u(e):""},getTodoStatusIcon(e){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[e]||"⬜"},formatToolArgs(e){var s;try{const t=JSON.parse(((s=e==null?void 0:e.function)==null?void 0:s.arguments)||"{}");return t.file_path?t.file_path:t.command?t.command:""}catch{return""}},scrollToBottom(){this.$nextTick(()=>{this.$refs.chatArea&&(this.$refs.chatArea.scrollTop=this.$refs.chatArea.scrollHeight)})}}};var M=function(){var s=this,t=s._self._c;return t("div",{staticClass:"step2-design"},[t("div",{staticClass:"mode-tabs"},[t("button",{staticClass:"tab-btn",class:{active:s.mode==="chat"},on:{click:function(i){s.mode="chat"}}},[t("i",{staticClass:"fa-solid fa-robot"}),s._v(" AI方案助手 ")]),t("button",{staticClass:"tab-btn",class:{active:s.mode==="spec"},on:{click:function(i){s.mode="spec"}}},[t("i",{staticClass:"fa-solid fa-file-alt"}),s._v(" 方案 ")])]),s.mode==="chat"?t("div",{staticClass:"chat-mode"},[t("div",{staticClass:"chat-toolbar"},[t("span",{staticClass:"model-name",on:{click:function(i){s.showModelDrawer=!0}}},[s._v(" "+s._s(s.modelName||"gpt-4o")+" "),t("i",{staticClass:"fa-solid fa-chevron-down"})]),t("button",{staticClass:"toolbar-btn",on:{click:function(i){s.showCommandDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-terminal"})]),t("button",{staticClass:"toolbar-btn",on:{click:function(i){s.showFileDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-file-circle-plus"})])]),t("div",{ref:"chatArea",staticClass:"chat-area"},[s.logItems.length?s._e():t("div",{staticClass:"empty-state"},[t("p",[s._v("描述你的需求,AI将协助完善方案")])]),s._l(s.logItems,function(i,r){return[i.type==="chat"?t("div",{staticClass:"message user"},[t("div",{staticClass:"message-bubble"},[s._v(s._s(i.content))])]):i.type==="think"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:s._s(s.renderMarkdown(i.content))}})]):i.type==="step"?t("div",{staticClass:"step-block"},[i.thought?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:s._s(s.renderMarkdown(i.thought))}})]):s._e(),s._l(i.toolCalls,function(a,n){var l;return t("div",{key:"tc-"+n,staticClass:"tool-log",class:i.success!==!1?"tool-success":"tool-fail"},[t("span",[s._v(s._s(i.success!==!1?"✓":"✗"))]),t("span",{staticClass:"tool-name"},[s._v(s._s(((l=a==null?void 0:a.function)==null?void 0:l.name)||"unknown"))]),t("span",{staticClass:"tool-args"},[s._v(s._s(s.formatToolArgs(a)))])])})],2):i.type==="system"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble system"},[s._v(s._s(i.content))])]):i.type==="todos"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"todo-list"},s._l(i.todos,function(a,n){return t("div",{key:n,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[s._v(s._s(s.getTodoStatusIcon(a.status)))]),t("span",[s._v(s._s(a.name))])])}),0)]):s._e()]}),s.isProcessing?t("div",{staticClass:"message assistant thinking"},[t("div",{staticClass:"message-bubble"},[s._v("思考中...")])]):s._e()],2),t("div",{staticClass:"input-area"},[t("div",{staticClass:"input-wrapper"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:s.inputMessage,expression:"inputMessage"}],ref:"inputField",staticClass:"input-field",attrs:{placeholder:"描述需求... (Enter发送)"},domProps:{value:s.inputMessage},on:{keydown:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")||i.ctrlKey||i.shiftKey||i.altKey||i.metaKey?null:(i.preventDefault(),s.sendMessage.apply(null,arguments))},input:function(i){i.target.composing||(s.inputMessage=i.target.value)}}})]),t("button",{staticClass:"send-btn",class:{"stop-btn":s.isProcessing},attrs:{disabled:!s.inputMessage.trim()&&!s.isProcessing},on:{click:function(i){s.isProcessing?s.stopGeneration():s.sendMessage()}}},[t("i",{class:s.isProcessing?"fa-solid fa-stop":"fa-solid fa-paper-plane"})])]),t("div",{staticClass:"status-bar"},[t("span",{staticClass:"status-indicator"},[t("span",{staticClass:"status-dot",class:{processing:s.isProcessing}}),s._v(" "+s._s(s.isProcessing?"处理中...":"就绪")+" ")]),t("span",[s._v("Token: "+s._s(s.promptTokens||0))])])]):t("div",{staticClass:"spec-mode"},[t("div",{staticClass:"spec-tabs"},[t("button",{staticClass:"spec-tab-btn",class:{active:s.specView==="edit"},on:{click:function(i){s.specView="edit"}}},[t("i",{staticClass:"fa-solid fa-edit"}),s._v(" 编辑 ")]),t("button",{staticClass:"spec-tab-btn",class:{active:s.specView==="preview"},on:{click:function(i){s.specView="preview"}}},[t("i",{staticClass:"fa-solid fa-eye"}),s._v(" 预览 ")])]),s.specView==="edit"?t("div",{staticClass:"editor-area"},[t("div",{staticClass:"editor-toolbar"},[t("button",{staticClass:"toolbar-btn primary",on:{click:s.saveSpec}},[t("i",{staticClass:"fa-solid fa-save"}),s._v(" 保存 ")])]),t("textarea",{directives:[{name:"model",rawName:"v-model",value:s.specContent,expression:"specContent"}],staticClass:"markdown-editor",attrs:{placeholder:"输入方案内容..."},domProps:{value:s.specContent},on:{keydown:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"s",void 0,i.key,void 0)||!i.ctrlKey?null:(i.preventDefault(),s.saveSpec.apply(null,arguments))},input:function(i){i.target.composing||(s.specContent=i.target.value)}}})]):t("div",{staticClass:"preview-area"},[t("div",{staticClass:"preview-content",domProps:{innerHTML:s._s(s.renderedContent)}})])]),t("div",{staticClass:"drawer-overlay",class:{show:s.showModelDrawer||s.showCommandDrawer||s.showFileDrawer},on:{click:s.closeAllDrawers}}),t("FileSelectDrawer",{attrs:{visible:s.showFileDrawer},on:{select:s.onFileSelected,close:function(i){s.showFileDrawer=!1}}}),t("div",{staticClass:"model-drawer",class:{show:s.showModelDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title"},[s._v("选择模型")]),t("button",{staticClass:"drawer-close",on:{click:function(i){s.showModelDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},s._l(s.models,function(i){return t("div",{key:i.id,staticClass:"command-item",class:{active:i.name===s.modelName},on:{click:function(r){return s.selectModel(i)}}},[s._m(0,!0),t("div",{staticClass:"command-info"},[t("div",{staticClass:"command-name"},[s._v(s._s(i.name))]),t("div",{staticClass:"command-desc"},[s._v(s._s(i.provider||"默认"))])])])}),0)]),t("div",{staticClass:"command-drawer",class:{show:s.showCommandDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title"},[s._v("快捷命令")]),t("button",{staticClass:"drawer-close",on:{click:function(i){s.showCommandDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},[t("div",{staticClass:"command-item",on:{click:function(i){s.appendCommand("/compact"),s.showCommandDrawer=!1}}},[s._m(1),s._m(2)]),t("div",{staticClass:"command-item",on:{click:function(i){s.appendCommand("/clear"),s.showCommandDrawer=!1}}},[s._m(3),s._m(4)])])])],1)},q=[function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-microchip"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-compress-alt"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("压缩会话")]),s("div",{staticClass:"command-desc"},[e._v("减少上下文长度")])])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-trash"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("清空对话")]),s("div",{staticClass:"command-desc"},[e._v("清空当前会话内容")])])}],F=h(I,M,q,!1,null,"9885421a");const T=F.exports,j={name:"AppStep3Code",components:{FileSelectDrawer:p},props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{inputMessage:"",isProcessing:!1,stopping:!1,logItems:[],sessionId:"",modelName:"",promptTokens:0,showModelDrawer:!1,showCommandDrawer:!1,showFileDrawer:!1,models:[],logSeq:0,wsUnsubscribe:null}},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(){c.init(),await this.loadModels(),await this.loadDefaultModel(),await this.loadSession()},beforeDestroy(){this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{async loadModels(){try{const e=await o.getModels();this.models=e.data||[]}catch(e){console.error("Load models failed:",e)}},async loadDefaultModel(){var e;try{const s=await o.getConfig("defaultModel");(e=s.data)!=null&&e.value&&(this.modelName=s.data.value)}catch{this.modelName="gpt-4o"}},selectModel(e){const s=e.name.split("/");this.modelName=s.length>2?s.slice(1).join("/"):e.name,o.setConfig("defaultModel",this.modelName),this.showModelDrawer=!1},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const e=`${this.reqBasePath}/${this.category}/${this.name}/session.json`,s=await o.getFileContent(e);if(s&&s.content){const t=JSON.parse(s.content);this.sessionId=t.codeSessionId||""}else this.sessionId="";this.sessionId&&(await this.loadMessages(),this.subscribeSession())}catch{this.sessionId=""}},async loadMessages(){if(this.sessionId)try{const e=await m(this.sessionId);this.logItems=(e.data||[]).map(s=>s.type==="think"?{type:"think",content:s.content||"",_id:`log-${++this.logSeq}`}:s.type==="step"?{type:"step",thought:s.thought,toolCalls:s.toolCalls||[],success:s.success,_id:`log-${++this.logSeq}`}:s.type==="chat"?{type:"chat",content:s.content,_id:`log-${++this.logSeq}`}:s.type==="todos"?{type:"todos",todos:s.todos||[],_id:`log-${++this.logSeq}`}:{type:"system",content:String(s),_id:`log-${++this.logSeq}`}),this.scrollToBottom()}catch(e){console.error("Load messages failed:",e)}},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=c.subscribe(this.sessionId,{running_sessions:e=>{const s=(e==null?void 0:e.runningSessionIds)||[];this.isProcessing=s.includes(this.sessionId)},todos:e=>{this.logItems.push({type:"todos",todos:e.todos,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},step:e=>{var s;this.logItems.push({type:"step",thought:e==null?void 0:e.thought,toolCalls:(e==null?void 0:e.toolCalls)||[],success:e==null?void 0:e.success,_id:`log-${++this.logSeq}`}),(s=e==null?void 0:e.usage)!=null&&s.promptTokens&&(this.promptTokens=e.usage.promptTokens),this.scrollToBottom()},compact:e=>{this.logItems.push({type:"system",content:`【压缩完成】${e.summary||""}`,_id:`log-${++this.logSeq}`}),this.loadMessages()},done:e=>{var s;this.isProcessing=!1,this.stopping=!1,e!=null&&e.modelName&&(this.modelName=e.modelName),(s=e==null?void 0:e.usage)!=null&&s.promptTokens&&(this.promptTokens=e.usage.promptTokens),e!=null&&e.response&&this.logItems.push({type:"think",content:e.response,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},stopped:()=>{this.isProcessing=!1,this.stopping=!1,this.logItems.push({type:"think",content:"【已停止】",_id:`log-${++this.logSeq}`}),this.scrollToBottom()},error:e=>{this.isProcessing=!1,this.stopping=!1,this.$message.error((e==null?void 0:e.error)||"发生错误")}}))},insertGenerateCommand(){this.specFilePath&&(this.inputMessage=`根据 ${this.specFilePath} 方案开发相应功能,先不要修改方案文档。`)},async sendMessage(){const e=this.inputMessage.trim();!e||this.isProcessing||!this.sessionId||(this.wsUnsubscribe||this.subscribeSession(),this.inputMessage="",this.isProcessing=!0,this.logItems.push({type:"chat",content:e,_id:`log-${++this.logSeq}`}),this.scrollToBottom(),c.send("chat",{message:e,sessionId:this.sessionId,modelName:this.modelName||void 0}))},stopGeneration(){this.sessionId&&(this.isProcessing=!1,this.stopping=!0,c.send("stop",{sessionId:this.sessionId}))},appendCommand(e){var s;this.inputMessage=e+" ",(s=this.$refs.inputField)==null||s.focus()},openFileSelect(){this.showFileDrawer=!0},onFileSelected(e){var s;this.inputMessage=this.inputMessage+e+" ",this.showFileDrawer=!1,(s=this.$refs.inputField)==null||s.focus()},closeAllDrawers(){this.showModelDrawer=!1,this.showCommandDrawer=!1,this.showFileDrawer=!1},renderMarkdown(e){return e?u(e):""},getTodoStatusIcon(e){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[e]||"⬜"},formatToolArgs(e){var s;try{const t=JSON.parse(((s=e==null?void 0:e.function)==null?void 0:s.arguments)||"{}");return t.file_path?t.file_path:t.command?t.command:""}catch{return""}},scrollToBottom(){this.$nextTick(()=>{this.$refs.chatArea&&(this.$refs.chatArea.scrollTop=this.$refs.chatArea.scrollHeight)})}}};var N=function(){var s=this,t=s._self._c;return t("div",{staticClass:"step3-code"},[t("div",{staticClass:"chat-toolbar"},[t("span",{staticClass:"model-name",on:{click:function(i){s.showModelDrawer=!0}}},[s._v(" "+s._s(s.modelName||"gpt-4o")+" "),t("i",{staticClass:"fa-solid fa-chevron-down"})]),t("button",{staticClass:"toolbar-btn",attrs:{disabled:s.isProcessing},on:{click:s.insertGenerateCommand}},[t("i",{staticClass:"fa-solid fa-code"})]),t("button",{staticClass:"toolbar-btn",on:{click:function(i){s.showCommandDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-terminal"})]),t("button",{staticClass:"toolbar-btn",on:{click:function(i){s.showFileDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-file-circle-plus"})])]),t("div",{ref:"chatArea",staticClass:"chat-area"},[s.logItems.length?s._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-solid fa-code"}),t("p",[s._v("描述代码需求,AI将生成代码")])]),s._l(s.logItems,function(i,r){return[i.type==="chat"?t("div",{staticClass:"message user"},[t("div",{staticClass:"message-bubble"},[s._v(s._s(i.content))])]):i.type==="think"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:s._s(s.renderMarkdown(i.content))}})]):i.type==="step"?t("div",{staticClass:"step-block"},[i.thought?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:s._s(s.renderMarkdown(i.thought))}})]):s._e(),s._l(i.toolCalls,function(a,n){var l;return t("div",{key:"tc-"+n,staticClass:"tool-log",class:i.success!==!1?"tool-success":"tool-fail"},[t("span",[s._v(s._s(i.success!==!1?"✓":"✗"))]),t("span",{staticClass:"tool-name"},[s._v(s._s(((l=a==null?void 0:a.function)==null?void 0:l.name)||"unknown"))]),t("span",{staticClass:"tool-args"},[s._v(s._s(s.formatToolArgs(a)))])])})],2):i.type==="system"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble system"},[s._v(s._s(i.content))])]):i.type==="todos"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"todo-list"},s._l(i.todos,function(a,n){return t("div",{key:n,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[s._v(s._s(s.getTodoStatusIcon(a.status)))]),t("span",[s._v(s._s(a.name))])])}),0)]):s._e()]}),s.isProcessing?t("div",{staticClass:"message assistant thinking"},[t("div",{staticClass:"message-bubble"},[s._v("生成中...")])]):s._e()],2),t("div",{staticClass:"input-area"},[t("div",{staticClass:"input-wrapper"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:s.inputMessage,expression:"inputMessage"}],ref:"inputField",staticClass:"input-field",attrs:{placeholder:"描述代码需求... (Enter发送)"},domProps:{value:s.inputMessage},on:{keydown:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")||i.ctrlKey||i.shiftKey||i.altKey||i.metaKey?null:(i.preventDefault(),s.sendMessage.apply(null,arguments))},input:function(i){i.target.composing||(s.inputMessage=i.target.value)}}})]),t("button",{staticClass:"send-btn",class:{"stop-btn":s.isProcessing},attrs:{disabled:!s.inputMessage.trim()&&!s.isProcessing},on:{click:function(i){s.isProcessing?s.stopGeneration():s.sendMessage()}}},[t("i",{class:s.isProcessing?"fa-solid fa-stop":"fa-solid fa-paper-plane"})])]),t("div",{staticClass:"status-bar"},[t("span",{staticClass:"status-indicator"},[t("span",{staticClass:"status-dot",class:{processing:s.isProcessing}}),s._v(" "+s._s(s.isProcessing?"生成中...":"就绪")+" ")]),t("span",[s._v("Token: "+s._s(s.promptTokens||0))])]),t("div",{staticClass:"drawer-overlay",class:{show:s.showModelDrawer||s.showCommandDrawer||s.showFileDrawer},on:{click:s.closeAllDrawers}}),t("FileSelectDrawer",{attrs:{visible:s.showFileDrawer},on:{select:s.onFileSelected,close:function(i){s.showFileDrawer=!1}}}),t("div",{staticClass:"model-drawer",class:{show:s.showModelDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title"},[s._v("选择模型")]),t("button",{staticClass:"drawer-close",on:{click:function(i){s.showModelDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},s._l(s.models,function(i){return t("div",{key:i.id,staticClass:"command-item",class:{active:i.name===s.modelName},on:{click:function(r){return s.selectModel(i)}}},[s._m(0,!0),t("div",{staticClass:"command-info"},[t("div",{staticClass:"command-name"},[s._v(s._s(i.name))]),t("div",{staticClass:"command-desc"},[s._v(s._s(i.provider||"默认"))])])])}),0)]),t("div",{staticClass:"command-drawer",class:{show:s.showCommandDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title"},[s._v("快捷命令")]),t("button",{staticClass:"drawer-close",on:{click:function(i){s.showCommandDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},[t("div",{staticClass:"command-item",on:{click:function(i){s.appendCommand("/compact"),s.showCommandDrawer=!1}}},[s._m(1),s._m(2)]),t("div",{staticClass:"command-item",on:{click:function(i){s.appendCommand("/clear"),s.showCommandDrawer=!1}}},[s._m(3),s._m(4)]),t("div",{staticClass:"command-item",on:{click:function(i){s.openFileSelect(),s.showCommandDrawer=!1}}},[s._m(5),s._m(6)])])])],1)},A=[function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-microchip"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-compress-alt"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("压缩会话")]),s("div",{staticClass:"command-desc"},[e._v("减少上下文长度")])])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-trash"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("清空对话")]),s("div",{staticClass:"command-desc"},[e._v("清空当前会话内容")])])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-file-circle-plus"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("选择文件")]),s("div",{staticClass:"command-desc"},[e._v("添加参考文件到上下文")])])}],B=h(j,N,A,!1,null,"e3e5781f");const x=B.exports,R={name:"AppStep4Test",components:{FileSelectDrawer:p},props:{category:{type:String,default:""},name:{type:String,default:""},reqBasePath:{type:String,default:""}},data(){return{inputMessage:"",isProcessing:!1,stopping:!1,logItems:[],sessionId:"",modelName:"",promptTokens:0,showModelDrawer:!1,showCommandDrawer:!1,showFileDrawer:!1,models:[],logSeq:0,wsUnsubscribe:null}},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(){c.init(),await this.loadModels(),await this.loadDefaultModel(),await this.loadSession()},beforeDestroy(){this.wsUnsubscribe&&this.wsUnsubscribe()},methods:{async loadModels(){try{const e=await o.getModels();this.models=e.data||[]}catch(e){console.error("Load models failed:",e)}},async loadDefaultModel(){var e;try{const s=await o.getConfig("defaultModel");(e=s.data)!=null&&e.value&&(this.modelName=s.data.value)}catch{this.modelName="gpt-4o"}},selectModel(e){const s=e.name.split("/");this.modelName=s.length>2?s.slice(1).join("/"):e.name,o.setConfig("defaultModel",this.modelName),this.showModelDrawer=!1},async loadSession(){if(!this.category||!this.name){this.sessionId="";return}try{const e=`${this.reqBasePath}/${this.category}/${this.name}/session.json`,s=await o.getFileContent(e);if(s&&s.content){const t=JSON.parse(s.content);this.sessionId=t.testSessionId||""}else this.sessionId="";this.sessionId&&(await this.loadMessages(),this.subscribeSession())}catch{this.sessionId=""}},async loadMessages(){if(this.sessionId)try{const e=await m(this.sessionId);this.logItems=(e.data||[]).map(s=>s.type==="think"?{type:"think",content:s.content||"",_id:`log-${++this.logSeq}`}:s.type==="step"?{type:"step",thought:s.thought,toolCalls:s.toolCalls||[],success:s.success,_id:`log-${++this.logSeq}`}:s.type==="chat"?{type:"chat",content:s.content,_id:`log-${++this.logSeq}`}:s.type==="todos"?{type:"todos",todos:s.todos||[],_id:`log-${++this.logSeq}`}:{type:"system",content:String(s),_id:`log-${++this.logSeq}`}),this.scrollToBottom()}catch(e){console.error("Load messages failed:",e)}},subscribeSession(){this.sessionId&&(this.wsUnsubscribe&&this.wsUnsubscribe(),this.wsUnsubscribe=c.subscribe(this.sessionId,{running_sessions:e=>{const s=(e==null?void 0:e.runningSessionIds)||[];this.isProcessing=s.includes(this.sessionId)},todos:e=>{this.logItems.push({type:"todos",todos:e.todos,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},step:e=>{var s;this.logItems.push({type:"step",thought:e==null?void 0:e.thought,toolCalls:(e==null?void 0:e.toolCalls)||[],success:e==null?void 0:e.success,_id:`log-${++this.logSeq}`}),(s=e==null?void 0:e.usage)!=null&&s.promptTokens&&(this.promptTokens=e.usage.promptTokens),this.scrollToBottom()},compact:e=>{this.logItems.push({type:"system",content:`【压缩完成】${e.summary||""}`,_id:`log-${++this.logSeq}`}),this.loadMessages()},done:e=>{var s;this.isProcessing=!1,this.stopping=!1,e!=null&&e.modelName&&(this.modelName=e.modelName),(s=e==null?void 0:e.usage)!=null&&s.promptTokens&&(this.promptTokens=e.usage.promptTokens),e!=null&&e.response&&this.logItems.push({type:"think",content:e.response,_id:`log-${++this.logSeq}`}),this.scrollToBottom()},stopped:()=>{this.isProcessing=!1,this.stopping=!1,this.logItems.push({type:"think",content:"【已停止】",_id:`log-${++this.logSeq}`}),this.scrollToBottom()},error:e=>{this.isProcessing=!1,this.stopping=!1,this.$message.error((e==null?void 0:e.error)||"发生错误")}}))},insertTestCommand(){this.specFilePath&&(this.inputMessage=`根据 ${this.specFilePath} 方案测试相应功能是否实现。`)},async sendMessage(){const e=this.inputMessage.trim();!e||this.isProcessing||!this.sessionId||(this.wsUnsubscribe||this.subscribeSession(),this.inputMessage="",this.isProcessing=!0,this.logItems.push({type:"chat",content:e,_id:`log-${++this.logSeq}`}),this.scrollToBottom(),c.send("chat",{message:e,sessionId:this.sessionId,modelName:this.modelName||void 0}))},stopGeneration(){this.sessionId&&(this.isProcessing=!1,this.stopping=!0,c.send("stop",{sessionId:this.sessionId}))},appendCommand(e){var s;this.inputMessage=e+" ",(s=this.$refs.inputField)==null||s.focus()},openFileSelect(){this.showFileDrawer=!0},onFileSelected(e){var s;this.inputMessage=this.inputMessage+e+" ",this.showFileDrawer=!1,(s=this.$refs.inputField)==null||s.focus()},closeAllDrawers(){this.showModelDrawer=!1,this.showCommandDrawer=!1,this.showFileDrawer=!1},renderMarkdown(e){return e?u(e):""},getTodoStatusIcon(e){return{completed:"✅",in_progress:"🔄",pending:"⬜",cancelled:"❌"}[e]||"⬜"},formatToolArgs(e){var s;try{const t=JSON.parse(((s=e==null?void 0:e.function)==null?void 0:s.arguments)||"{}");return t.file_path?t.file_path:t.command?t.command:""}catch{return""}},scrollToBottom(){this.$nextTick(()=>{this.$refs.chatArea&&(this.$refs.chatArea.scrollTop=this.$refs.chatArea.scrollHeight)})}}};var V=function(){var s=this,t=s._self._c;return t("div",{staticClass:"step4-test"},[t("div",{staticClass:"chat-toolbar"},[t("span",{staticClass:"model-name",on:{click:function(i){s.showModelDrawer=!0}}},[s._v(" "+s._s(s.modelName||"gpt-4o")+" "),t("i",{staticClass:"fa-solid fa-chevron-down"})]),t("button",{staticClass:"toolbar-btn",attrs:{disabled:s.isProcessing},on:{click:s.insertTestCommand}},[t("i",{staticClass:"fa-solid fa-check-circle"})]),t("button",{staticClass:"toolbar-btn",on:{click:function(i){s.showCommandDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-terminal"})]),t("button",{staticClass:"toolbar-btn",on:{click:function(i){s.showFileDrawer=!0}}},[t("i",{staticClass:"fa-solid fa-file-circle-plus"})])]),t("div",{ref:"chatArea",staticClass:"chat-area"},[s.logItems.length?s._e():t("div",{staticClass:"empty-state"},[t("i",{staticClass:"fa-solid fa-clipboard-check"}),t("p",[s._v("描述测试需求,AI将进行验收测试")])]),s._l(s.logItems,function(i,r){return[i.type==="chat"?t("div",{staticClass:"message user"},[t("div",{staticClass:"message-bubble"},[s._v(s._s(i.content))])]):i.type==="think"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:s._s(s.renderMarkdown(i.content))}})]):i.type==="step"?t("div",{staticClass:"step-block"},[i.thought?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble",domProps:{innerHTML:s._s(s.renderMarkdown(i.thought))}})]):s._e(),s._l(i.toolCalls,function(a,n){var l;return t("div",{key:"tc-"+n,staticClass:"tool-log",class:i.success!==!1?"tool-success":"tool-fail"},[t("span",[s._v(s._s(i.success!==!1?"✓":"✗"))]),t("span",{staticClass:"tool-name"},[s._v(s._s(((l=a==null?void 0:a.function)==null?void 0:l.name)||"unknown"))]),t("span",{staticClass:"tool-args"},[s._v(s._s(s.formatToolArgs(a)))])])})],2):i.type==="system"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"message-bubble system"},[s._v(s._s(i.content))])]):i.type==="todos"?t("div",{staticClass:"message assistant"},[t("div",{staticClass:"todo-list"},s._l(i.todos,function(a,n){return t("div",{key:n,staticClass:"todo-item"},[t("span",{staticClass:"todo-status"},[s._v(s._s(s.getTodoStatusIcon(a.status)))]),t("span",[s._v(s._s(a.name))])])}),0)]):s._e()]}),s.isProcessing?t("div",{staticClass:"message assistant thinking"},[t("div",{staticClass:"message-bubble"},[s._v("测试中...")])]):s._e()],2),t("div",{staticClass:"input-area"},[t("div",{staticClass:"input-wrapper"},[t("textarea",{directives:[{name:"model",rawName:"v-model",value:s.inputMessage,expression:"inputMessage"}],ref:"inputField",staticClass:"input-field",attrs:{placeholder:"描述测试需求... (Enter发送)"},domProps:{value:s.inputMessage},on:{keydown:function(i){return!i.type.indexOf("key")&&s._k(i.keyCode,"enter",13,i.key,"Enter")||i.ctrlKey||i.shiftKey||i.altKey||i.metaKey?null:(i.preventDefault(),s.sendMessage.apply(null,arguments))},input:function(i){i.target.composing||(s.inputMessage=i.target.value)}}})]),t("button",{staticClass:"send-btn",class:{"stop-btn":s.isProcessing},attrs:{disabled:!s.inputMessage.trim()&&!s.isProcessing},on:{click:function(i){s.isProcessing?s.stopGeneration():s.sendMessage()}}},[t("i",{class:s.isProcessing?"fa-solid fa-stop":"fa-solid fa-paper-plane"})])]),t("div",{staticClass:"status-bar"},[t("span",{staticClass:"status-indicator"},[t("span",{staticClass:"status-dot",class:{processing:s.isProcessing}}),s._v(" "+s._s(s.isProcessing?"测试中...":"就绪")+" ")]),t("span",[s._v("Token: "+s._s(s.promptTokens||0))])]),t("div",{staticClass:"drawer-overlay",class:{show:s.showModelDrawer||s.showCommandDrawer||s.showFileDrawer},on:{click:s.closeAllDrawers}}),t("FileSelectDrawer",{attrs:{visible:s.showFileDrawer},on:{select:s.onFileSelected,close:function(i){s.showFileDrawer=!1}}}),t("div",{staticClass:"model-drawer",class:{show:s.showModelDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title"},[s._v("选择模型")]),t("button",{staticClass:"drawer-close",on:{click:function(i){s.showModelDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},s._l(s.models,function(i){return t("div",{key:i.id,staticClass:"command-item",class:{active:i.name===s.modelName},on:{click:function(r){return s.selectModel(i)}}},[s._m(0,!0),t("div",{staticClass:"command-info"},[t("div",{staticClass:"command-name"},[s._v(s._s(i.name))]),t("div",{staticClass:"command-desc"},[s._v(s._s(i.provider||"默认"))])])])}),0)]),t("div",{staticClass:"command-drawer",class:{show:s.showCommandDrawer}},[t("div",{staticClass:"drawer-header"},[t("span",{staticClass:"drawer-title"},[s._v("快捷命令")]),t("button",{staticClass:"drawer-close",on:{click:function(i){s.showCommandDrawer=!1}}},[t("i",{staticClass:"fa-solid fa-xmark"})])]),t("div",{staticClass:"command-list"},[t("div",{staticClass:"command-item",on:{click:function(i){s.appendCommand("/compact"),s.showCommandDrawer=!1}}},[s._m(1),s._m(2)]),t("div",{staticClass:"command-item",on:{click:function(i){s.appendCommand("/clear"),s.showCommandDrawer=!1}}},[s._m(3),s._m(4)]),t("div",{staticClass:"command-item",on:{click:function(i){s.openFileSelect(),s.showCommandDrawer=!1}}},[s._m(5),s._m(6)])])])],1)},U=[function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-microchip"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-compress-alt"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("压缩会话")]),s("div",{staticClass:"command-desc"},[e._v("减少上下文长度")])])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-trash"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("清空对话")]),s("div",{staticClass:"command-desc"},[e._v("清空当前会话内容")])])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-icon"},[s("i",{staticClass:"fa-solid fa-file-circle-plus"})])},function(){var e=this,s=e._self._c;return s("div",{staticClass:"command-info"},[s("div",{staticClass:"command-name"},[e._v("选择文件")]),s("div",{staticClass:"command-desc"},[e._v("添加参考文件到上下文")])])}],L=h(R,V,U,!1,null,"7362b26f");const K=L.exports,O={name:"AppDevWorkflowView",components:{AppWorkflowStep:b,AppStep1Req:D,AppStep2Design:T,AppStep3Code:x,AppStep4Test:K},data(){return{currentCategory:"",currentProject:"",currentStep:1,categories:[],projects:{},reqBasePath:""}},computed:{projectKey(){return!this.currentCategory||!this.currentProject?"":`${this.currentCategory}/${this.currentProject}`}},async created(){await this.loadState(),await this.loadCategories()},methods:{async loadState(){try{const s=(await o.getWorkflowState()).data;s&&(this.currentCategory=s.currentCategory||"",this.currentProject=s.currentProject||"",this.currentStep=s.currentStep||1)}catch(e){console.error("Load workflow state failed:",e)}},async saveState(){try{await o.updateWorkflowState(this.currentCategory,this.currentProject,this.currentStep)}catch(e){console.error("Save workflow state failed:",e)}},async loadCategories(){var e,s;try{const t=await o.getCwd();this.reqBasePath=((e=t.data)==null?void 0:e.basePath)||"";const r=((s=(await o.browseFilesystem(this.reqBasePath)).data)==null?void 0:s.items)||[];this.categories=r.filter(a=>a.is_directory).map(a=>a.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(e){var s;if(e)try{const t=`${this.reqBasePath}/${e}`,r=((s=(await o.browseFilesystem(t)).data)==null?void 0:s.items)||[];this.projects={},r.filter(a=>a.is_directory).forEach(a=>{const n=`${e}/${a.name}`;this.projects[n]={name:a.name,stepStatus:{}}})}catch(t){console.error("Load projects failed:",t)}},async onCategoryChange(e){this.currentCategory=e,this.currentProject="",this.currentStep=1,e?await this.loadProjectsForCategory(e):this.projects={},await this.saveState()},onProjectChange(e){this.currentProject=e,this.currentProject?this.currentStep=2:this.currentStep>1&&(this.currentStep=1),this.saveState()},onStepChange(e){!this.currentProject&&e>1||(this.currentStep=e,this.saveState())},async createCategory(e){if(!this.categories.includes(e))try{const s=`${this.reqBasePath}/${e}`;await o.createDirectory(s),this.categories.push(e),this.categories.sort()}catch(s){console.error("Create category failed:",s)}},async createRequirement({category:e,name:s}){var a,n,l;if(this.projects[s])return;try{const d=`${this.reqBasePath}/${e}/${s}`;await o.createDirectory(d)}catch(d){console.error("Create requirement directory failed:",d)}const t=`# ${s}方案
4
+
5
+ > 所属大类:${e}
6
+
7
+ ## 业务目标
8
+
9
+ ## 功能点
10
+
11
+ `;try{const d=`${this.reqBasePath}/${e}/${s}/${s}_方案.md`;await o.writeFile(d,t)}catch(d){console.error("Write spec file failed:",d)}let i={designSessionId:"",codeSessionId:"",testSessionId:""};try{const[d,f,g]=await Promise.all([o.createSession(`workflow:${e}/${s}:design`),o.createSession(`workflow:${e}/${s}:code`),o.createSession(`workflow:${e}/${s}:test`)]);i={designSessionId:((a=d.data)==null?void 0:a.id)||"",codeSessionId:((n=f.data)==null?void 0:n.id)||"",testSessionId:((l=g.data)==null?void 0:l.id)||""};const v=`${this.reqBasePath}/${e}/${s}/session.json`;await o.writeFile(v,JSON.stringify(i,null,2))}catch(d){console.error("Create sessions failed:",d)}const r=`${e}/${s}`;this.$set(this.projects,r,{name:s,stepStatus:{}}),this.currentCategory=e,this.currentProject=s,this.currentStep=2,await this.saveState()},async onSaveSpec(e){if(!this.projectKey)return;const s=`${this.reqBasePath}/${this.currentCategory}/${this.currentProject}/${this.currentProject}_方案.md`;try{await o.writeFile(s,e)}catch(t){console.error("Save spec failed:",t)}},async refreshSpec(){this.currentCategory&&this.currentProject&&await this.loadProjectsForCategory(this.currentCategory)}}};var H=function(){var s=this,t=s._self._c;return t("div",{staticClass:"dev-workflow-view"},[t("AppWorkflowStep",{attrs:{"current-step":s.currentStep},on:{"step-change":s.onStepChange}}),t("div",{staticClass:"step-content"},[s.currentStep===1?t("AppStep1Req",{attrs:{categories:s.categories,projects:s.projects,"req-base-path":s.reqBasePath,"current-category":s.currentCategory,"current-project":s.currentProject},on:{"category-change":s.onCategoryChange,"project-change":s.onProjectChange,"create-category":s.createCategory,"create-requirement":s.createRequirement}}):s.currentStep===2?t("AppStep2Design",{attrs:{category:s.currentCategory,name:s.currentProject,"req-base-path":s.reqBasePath},on:{"save-spec":s.onSaveSpec,"spec-updated":s.refreshSpec}}):s.currentStep===3?t("AppStep3Code",{attrs:{category:s.currentCategory,name:s.currentProject,"req-base-path":s.reqBasePath}}):s.currentStep===4?t("AppStep4Test",{attrs:{category:s.currentCategory,name:s.currentProject,"req-base-path":s.reqBasePath}}):s._e()],1),t("div",{staticClass:"status-bar"},[s.projectKey?t("span",[s._v(s._s(s.projectKey))]):t("span",[s._v("选择需求开始")])])],1)},E=[],W=h(O,H,E,!1,null,"54d535a4");const J=W.exports;export{J as default};
@@ -1 +1 @@
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-88ac271d]{height:100%;display:flex;flex-direction:column}.step2-main[data-v-88ac271d]{display:flex;flex:1;gap:16px;overflow:hidden;padding:16px}.editor-panel[data-v-88ac271d]{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-88ac271d]{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-88ac271d]{flex:1;min-height:0}.chat-panel[data-v-88ac271d]{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-88ac271d]{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-88ac271d]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-88ac271d]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-88ac271d]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-88ac271d]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-88ac271d]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-88ac271d]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-88ac271d] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-88ac271d]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-88ac271d]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-88ac271d]{color:#22c55e}.tool-fail[data-v-88ac271d]{color:#ef4444}.tool-input[data-v-88ac271d]{color:#60a5fa;margin-left:8px}.build-info[data-v-88ac271d]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-88ac271d]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-row[data-v-88ac271d]{display:flex;gap:12px;align-items:flex-end}.input-row .input-area[data-v-88ac271d]{flex:1}.input-row .input-actions[data-v-88ac271d]{display:flex;flex-direction:column;gap:8px;align-items:flex-end}.status-bar[data-v-88ac271d]{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-88ac271d]{color:#3f3f46}.status-ready[data-v-88ac271d]{color:#22c55e}.status-thinking[data-v-88ac271d]{color:#60a5fa}.thinking-spinner[data-v-88ac271d]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-88ac271d .8s linear infinite}@keyframes spin-88ac271d{to{transform:rotate(360deg)}}.model-selector[data-v-88ac271d]{cursor:pointer}.model-selector[data-v-88ac271d]:hover{color:#60a5fa}.step3-container[data-v-558ba9c1]{height:100%;display:flex;flex-direction:column}.step3-main[data-v-558ba9c1]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-558ba9c1]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-558ba9c1]{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-558ba9c1]{font-size:14px;font-weight:500;color:#f4f4f5}.header-actions[data-v-558ba9c1]{display:flex;gap:8px}.chat-messages[data-v-558ba9c1]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-558ba9c1]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-558ba9c1]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-558ba9c1]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-558ba9c1]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-558ba9c1]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-558ba9c1] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-558ba9c1]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-558ba9c1]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-558ba9c1]{color:#22c55e}.tool-fail[data-v-558ba9c1]{color:#ef4444}.tool-input[data-v-558ba9c1]{color:#60a5fa;margin-left:8px}.build-info[data-v-558ba9c1]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-558ba9c1]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-row[data-v-558ba9c1]{display:flex;gap:12px;align-items:flex-end}.input-row .input-area[data-v-558ba9c1]{flex:1}.input-row .input-actions[data-v-558ba9c1]{display:flex;flex-direction:column;gap:8px;align-items:flex-end}.status-bar[data-v-558ba9c1]{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-558ba9c1]{color:#3f3f46}.status-ready[data-v-558ba9c1]{color:#22c55e}.status-thinking[data-v-558ba9c1]{color:#60a5fa}.thinking-spinner[data-v-558ba9c1]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-558ba9c1 .8s linear infinite}@keyframes spin-558ba9c1{to{transform:rotate(360deg)}}.model-selector[data-v-558ba9c1]{cursor:pointer}.model-selector[data-v-558ba9c1]:hover{color:#60a5fa}.step4-container[data-v-a358150e]{height:100%;display:flex;flex-direction:column}.step4-main[data-v-a358150e]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-a358150e]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-a358150e]{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-a358150e]{font-size:14px;font-weight:500;color:#f4f4f5}.chat-messages[data-v-a358150e]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-a358150e]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-a358150e]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-a358150e]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-a358150e]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-a358150e]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-a358150e] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-a358150e]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-a358150e]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-a358150e]{color:#22c55e}.tool-fail[data-v-a358150e]{color:#ef4444}.tool-input[data-v-a358150e]{color:#60a5fa;margin-left:8px}.build-info[data-v-a358150e]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-a358150e]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-row[data-v-a358150e]{display:flex;gap:12px;align-items:flex-end}.input-row .input-area[data-v-a358150e]{flex:1}.input-row .input-actions[data-v-a358150e]{display:flex;flex-direction:column;gap:8px;align-items:flex-end}.status-bar[data-v-a358150e]{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-a358150e]{color:#3f3f46}.status-ready[data-v-a358150e]{color:#22c55e}.status-thinking[data-v-a358150e]{color:#60a5fa}.thinking-spinner[data-v-a358150e]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-a358150e .8s linear infinite}@keyframes spin-a358150e{to{transform:rotate(360deg)}}.model-selector[data-v-a358150e]{cursor:pointer}.model-selector[data-v-a358150e]:hover{color:#60a5fa}.dev-workflow-view[data-v-05a3971e]{display:flex;height:100%;overflow:hidden;background:#0a0a09}.main-content[data-v-05a3971e]{flex:1;display:flex;flex-direction:column;overflow:hidden}.panel-header[data-v-05a3971e]{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-05a3971e]{font-size:16px;font-weight:500;color:#f4f4f5}.panel-actions[data-v-05a3971e]{display:flex;gap:12px}.step-content[data-v-05a3971e]{flex:1;overflow:hidden}.status-bar[data-v-05a3971e]{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
+ .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-ba04f8e5]{height:100%;display:flex;flex-direction:column}.step2-main[data-v-ba04f8e5]{display:flex;flex:1;gap:16px;overflow:hidden;padding:16px}.editor-panel[data-v-ba04f8e5]{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-ba04f8e5]{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-ba04f8e5]{flex:1;min-height:0}.chat-panel[data-v-ba04f8e5]{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-ba04f8e5]{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-ba04f8e5]{flex:1;overflow-y:auto;padding:0 16px 16px;font-size:14px;line-height:1.6}.empty-state[data-v-ba04f8e5]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-ba04f8e5]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-ba04f8e5]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-ba04f8e5]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-ba04f8e5]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-ba04f8e5] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-ba04f8e5]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-ba04f8e5]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-ba04f8e5]{color:#22c55e}.tool-fail[data-v-ba04f8e5]{color:#ef4444}.tool-input[data-v-ba04f8e5]{color:#60a5fa;margin-left:8px}.build-info[data-v-ba04f8e5]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-ba04f8e5]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-row[data-v-ba04f8e5]{display:flex;gap:12px;align-items:flex-end}.input-row .input-area[data-v-ba04f8e5]{flex:1}.input-row .input-actions[data-v-ba04f8e5]{display:flex;flex-direction:column;gap:8px;align-items:flex-end}.status-bar[data-v-ba04f8e5]{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-ba04f8e5]{color:#3f3f46}.status-ready[data-v-ba04f8e5]{color:#22c55e}.status-thinking[data-v-ba04f8e5]{color:#60a5fa}.thinking-spinner[data-v-ba04f8e5]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-ba04f8e5 .8s linear infinite}@keyframes spin-ba04f8e5{to{transform:rotate(360deg)}}.model-selector[data-v-ba04f8e5]{cursor:pointer}.model-selector[data-v-ba04f8e5]:hover{color:#60a5fa}.step3-container[data-v-c17daff4]{height:100%;display:flex;flex-direction:column}.step3-main[data-v-c17daff4]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-c17daff4]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-c17daff4]{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-c17daff4]{font-size:14px;font-weight:500;color:#f4f4f5}.header-actions[data-v-c17daff4]{display:flex;gap:8px}.chat-messages[data-v-c17daff4]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-c17daff4]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-c17daff4]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-c17daff4]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-c17daff4]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-c17daff4]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-c17daff4] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-c17daff4]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-c17daff4]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-c17daff4]{color:#22c55e}.tool-fail[data-v-c17daff4]{color:#ef4444}.tool-input[data-v-c17daff4]{color:#60a5fa;margin-left:8px}.build-info[data-v-c17daff4]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-c17daff4]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-row[data-v-c17daff4]{display:flex;gap:12px;align-items:flex-end}.input-row .input-area[data-v-c17daff4]{flex:1}.input-row .input-actions[data-v-c17daff4]{display:flex;flex-direction:column;gap:8px;align-items:flex-end}.status-bar[data-v-c17daff4]{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-c17daff4]{color:#3f3f46}.status-ready[data-v-c17daff4]{color:#22c55e}.status-thinking[data-v-c17daff4]{color:#60a5fa}.thinking-spinner[data-v-c17daff4]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-c17daff4 .8s linear infinite}@keyframes spin-c17daff4{to{transform:rotate(360deg)}}.model-selector[data-v-c17daff4]{cursor:pointer}.model-selector[data-v-c17daff4]:hover{color:#60a5fa}.step4-container[data-v-a358150e]{height:100%;display:flex;flex-direction:column}.step4-main[data-v-a358150e]{display:flex;flex:1;overflow:hidden;padding:16px}.code-chat-panel[data-v-a358150e]{flex:1;background:#121212;border:1px solid #1e1e1e;border-radius:8px;overflow:hidden;display:flex;flex-direction:column}.panel-header[data-v-a358150e]{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-a358150e]{font-size:14px;font-weight:500;color:#f4f4f5}.chat-messages[data-v-a358150e]{flex:1;overflow-y:auto;padding:16px;font-size:14px;line-height:1.6}.empty-state[data-v-a358150e]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#84848a}.empty-state i[data-v-a358150e]{font-size:48px;margin-bottom:16px;opacity:.5}.todos-list[data-v-a358150e]{margin-bottom:16px;color:#d4d4d8}.todo-item[data-v-a358150e]{display:flex;align-items:center;gap:8px;padding:2px 0}.user-question[data-v-a358150e]{color:#60a5fa;font-weight:700;margin-bottom:16px}.user-question[data-v-a358150e] p{color:#d4d4d8;font-weight:400;margin:0 0 8px}.ai-thought[data-v-a358150e]{color:#d4d4d8;margin-bottom:16px}.log-mute[data-v-a358150e]{color:#84848a;margin-bottom:16px;white-space:pre}.tool-success[data-v-a358150e]{color:#22c55e}.tool-fail[data-v-a358150e]{color:#ef4444}.tool-input[data-v-a358150e]{color:#60a5fa;margin-left:8px}.build-info[data-v-a358150e]{color:#84848a;display:flex;align-items:center;gap:8px;margin-bottom:16px}.chat-input-area[data-v-a358150e]{padding:12px 16px;background:#121212;border-top:1px solid #1e1e1e}.input-row[data-v-a358150e]{display:flex;gap:12px;align-items:flex-end}.input-row .input-area[data-v-a358150e]{flex:1}.input-row .input-actions[data-v-a358150e]{display:flex;flex-direction:column;gap:8px;align-items:flex-end}.status-bar[data-v-a358150e]{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-a358150e]{color:#3f3f46}.status-ready[data-v-a358150e]{color:#22c55e}.status-thinking[data-v-a358150e]{color:#60a5fa}.thinking-spinner[data-v-a358150e]{display:inline-block;width:12px;height:12px;border:2px solid #60a5fa;border-top-color:transparent;border-radius:50%;animation:spin-a358150e .8s linear infinite}@keyframes spin-a358150e{to{transform:rotate(360deg)}}.model-selector[data-v-a358150e]{cursor:pointer}.model-selector[data-v-a358150e]:hover{color:#60a5fa}.dev-workflow-view[data-v-05a3971e]{display:flex;height:100%;overflow:hidden;background:#0a0a09}.main-content[data-v-05a3971e]{flex:1;display:flex;flex-direction:column;overflow:hidden}.panel-header[data-v-05a3971e]{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-05a3971e]{font-size:16px;font-weight:500;color:#f4f4f5}.panel-actions[data-v-05a3971e]{display:flex;gap:12px}.step-content[data-v-05a3971e]{flex:1;overflow:hidden}.status-bar[data-v-05a3971e]{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}