tianxincode 1.0.7 → 1.0.9

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 (128) hide show
  1. package/@.txcode/req//351/241/265/351/235/242/345/270/203/345/261/200/AI/346/234/215/345/212/241/345/225/206/345/222/214/346/250/241/345/236/213/351/205/215/347/275/256.html +241 -0
  2. package/dist/api/ai-log.routes.d.ts +2 -0
  3. package/dist/api/ai-log.routes.d.ts.map +1 -0
  4. package/dist/api/ai-log.routes.js +21 -0
  5. package/dist/api/ai-log.routes.js.map +1 -0
  6. package/dist/api/chat.routes.d.ts.map +1 -1
  7. package/dist/api/chat.routes.js +35 -1
  8. package/dist/api/chat.routes.js.map +1 -1
  9. package/dist/api/config.routes.js +21 -0
  10. package/dist/api/config.routes.js.map +1 -1
  11. package/dist/api/index.d.ts.map +1 -1
  12. package/dist/api/index.js +2 -0
  13. package/dist/api/index.js.map +1 -1
  14. package/dist/components/App.d.ts.map +1 -1
  15. package/dist/components/App.js +71 -19
  16. package/dist/components/App.js.map +1 -1
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/modules/ai/ai-log.service.d.ts +42 -0
  20. package/dist/modules/ai/ai-log.service.d.ts.map +1 -0
  21. package/dist/modules/ai/ai-log.service.js +52 -0
  22. package/dist/modules/ai/ai-log.service.js.map +1 -0
  23. package/dist/modules/ai/ai.service.d.ts +7 -6
  24. package/dist/modules/ai/ai.service.d.ts.map +1 -1
  25. package/dist/modules/ai/ai.service.js +53 -25
  26. package/dist/modules/ai/ai.service.js.map +1 -1
  27. package/dist/modules/ai/ai.types.d.ts +3 -0
  28. package/dist/modules/ai/ai.types.d.ts.map +1 -1
  29. package/dist/modules/ai/openai.provider.d.ts +2 -0
  30. package/dist/modules/ai/openai.provider.d.ts.map +1 -1
  31. package/dist/modules/ai/openai.provider.js +26 -2
  32. package/dist/modules/ai/openai.provider.js.map +1 -1
  33. package/dist/modules/ai/provider/base.d.ts +1 -0
  34. package/dist/modules/ai/provider/base.d.ts.map +1 -1
  35. package/dist/modules/ai/provider/openai/openai-agent.d.ts +2 -0
  36. package/dist/modules/ai/provider/openai/openai-agent.d.ts.map +1 -1
  37. package/dist/modules/ai/provider/openai/openai-agent.js +45 -8
  38. package/dist/modules/ai/provider/openai/openai-agent.js.map +1 -1
  39. package/dist/modules/ai/provider/openai/prompts.js +1 -1
  40. package/dist/modules/ai/provider/openai/prompts.js.map +1 -1
  41. package/dist/modules/ai/react.agent.d.ts +1 -0
  42. package/dist/modules/ai/react.agent.d.ts.map +1 -1
  43. package/dist/modules/ai/react.agent.js +14 -1
  44. package/dist/modules/ai/react.agent.js.map +1 -1
  45. package/dist/modules/db/db.service.d.ts +13 -66
  46. package/dist/modules/db/db.service.d.ts.map +1 -1
  47. package/dist/modules/db/db.service.js +171 -143
  48. package/dist/modules/db/db.service.js.map +1 -1
  49. package/dist/modules/db/db.types.d.ts +3 -3
  50. package/dist/modules/db/db.types.d.ts.map +1 -1
  51. package/dist/modules/db/db.types.js +1 -1
  52. package/dist/modules/tools/builtin/bash.js +3 -2
  53. package/dist/modules/tools/builtin/bash.js.map +1 -1
  54. package/dist/modules/tools/provider/bash.d.ts +3 -0
  55. package/dist/modules/tools/provider/bash.d.ts.map +1 -0
  56. package/dist/modules/tools/provider/bash.js +135 -0
  57. package/dist/modules/tools/provider/bash.js.map +1 -0
  58. package/dist/modules/tools/provider/code_search.d.ts +3 -0
  59. package/dist/modules/tools/provider/code_search.d.ts.map +1 -0
  60. package/dist/modules/tools/provider/code_search.js +90 -0
  61. package/dist/modules/tools/provider/code_search.js.map +1 -0
  62. package/dist/modules/tools/provider/edit_file.d.ts +3 -0
  63. package/dist/modules/tools/provider/edit_file.d.ts.map +1 -0
  64. package/dist/modules/tools/provider/edit_file.js +95 -0
  65. package/dist/modules/tools/provider/edit_file.js.map +1 -0
  66. package/dist/modules/tools/provider/glob.d.ts +3 -0
  67. package/dist/modules/tools/provider/glob.d.ts.map +1 -0
  68. package/dist/modules/tools/provider/glob.js +87 -0
  69. package/dist/modules/tools/provider/glob.js.map +1 -0
  70. package/dist/modules/tools/provider/grep.d.ts +3 -0
  71. package/dist/modules/tools/provider/grep.d.ts.map +1 -0
  72. package/dist/modules/tools/provider/grep.js +96 -0
  73. package/dist/modules/tools/provider/grep.js.map +1 -0
  74. package/dist/modules/tools/provider/index.d.ts +7 -0
  75. package/dist/modules/tools/provider/index.d.ts.map +1 -0
  76. package/dist/modules/tools/provider/index.js +37 -0
  77. package/dist/modules/tools/provider/index.js.map +1 -0
  78. package/dist/modules/tools/provider/lsp.d.ts +6 -0
  79. package/dist/modules/tools/provider/lsp.d.ts.map +1 -0
  80. package/dist/modules/tools/provider/lsp.js +128 -0
  81. package/dist/modules/tools/provider/lsp.js.map +1 -0
  82. package/dist/modules/tools/provider/memory.d.ts +3 -0
  83. package/dist/modules/tools/provider/memory.d.ts.map +1 -0
  84. package/dist/modules/tools/provider/memory.js +80 -0
  85. package/dist/modules/tools/provider/memory.js.map +1 -0
  86. package/dist/modules/tools/provider/read_file.d.ts +3 -0
  87. package/dist/modules/tools/provider/read_file.d.ts.map +1 -0
  88. package/dist/modules/tools/provider/read_file.js +109 -0
  89. package/dist/modules/tools/provider/read_file.js.map +1 -0
  90. package/dist/modules/tools/provider/skill.d.ts +6 -0
  91. package/dist/modules/tools/provider/skill.d.ts.map +1 -0
  92. package/dist/modules/tools/provider/skill.js +64 -0
  93. package/dist/modules/tools/provider/skill.js.map +1 -0
  94. package/dist/modules/tools/provider/todo_read.d.ts +3 -0
  95. package/dist/modules/tools/provider/todo_read.d.ts.map +1 -0
  96. package/dist/modules/tools/provider/todo_read.js +26 -0
  97. package/dist/modules/tools/provider/todo_read.js.map +1 -0
  98. package/dist/modules/tools/provider/todo_write.d.ts +3 -0
  99. package/dist/modules/tools/provider/todo_write.d.ts.map +1 -0
  100. package/dist/modules/tools/provider/todo_write.js +49 -0
  101. package/dist/modules/tools/provider/todo_write.js.map +1 -0
  102. package/dist/modules/tools/provider/tools.d.ts +4 -0
  103. package/dist/modules/tools/provider/tools.d.ts.map +1 -0
  104. package/dist/modules/tools/provider/tools.js +14 -0
  105. package/dist/modules/tools/provider/tools.js.map +1 -0
  106. package/dist/modules/tools/provider/web_fetch.d.ts +3 -0
  107. package/dist/modules/tools/provider/web_fetch.d.ts.map +1 -0
  108. package/dist/modules/tools/provider/web_fetch.js +56 -0
  109. package/dist/modules/tools/provider/web_fetch.js.map +1 -0
  110. package/dist/modules/tools/provider/web_search.d.ts +3 -0
  111. package/dist/modules/tools/provider/web_search.d.ts.map +1 -0
  112. package/dist/modules/tools/provider/web_search.js +104 -0
  113. package/dist/modules/tools/provider/web_search.js.map +1 -0
  114. package/dist/modules/tools/provider/write_file.d.ts +3 -0
  115. package/dist/modules/tools/provider/write_file.d.ts.map +1 -0
  116. package/dist/modules/tools/provider/write_file.js +63 -0
  117. package/dist/modules/tools/provider/write_file.js.map +1 -0
  118. package/dist/web/web.service.d.ts +2 -0
  119. package/dist/web/web.service.d.ts.map +1 -1
  120. package/dist/web/web.service.js +57 -8
  121. package/dist/web/web.service.js.map +1 -1
  122. package/package.json +5 -3
  123. package/web/dist/assets/AiLogsView-DWqwdXrD.js +1 -0
  124. package/web/dist/assets/Layout-CoiSqTWB.js +1 -0
  125. package/web/dist/assets/{index-CEHMSOel.js → index-B-R-RCGS.js} +65 -65
  126. package/web/dist/assets/{index-BnpKQafm.css → index-BGmGnKjT.css} +1 -1
  127. package/web/dist/index.html +2 -2
  128. package/web/dist/assets/Layout-Pvn6DBHZ.js +0 -1
@@ -0,0 +1,56 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
+ const web_fetch_description = fs.readFileSync(path.join(__dirname, 'web_fetch.txt'), 'utf-8');
6
+ export const webFetchTool = {
7
+ name: 'web_fetch',
8
+ description: web_fetch_description,
9
+ parameters: {
10
+ type: 'object',
11
+ properties: {
12
+ url: {
13
+ type: 'string',
14
+ description: '要获取的 URL(必须包含 http:// 或 https://)'
15
+ },
16
+ format: {
17
+ type: 'string',
18
+ enum: ['markdown', 'text', 'html'],
19
+ description: '输出格式:markdown, text, html(默认:markdown)'
20
+ }
21
+ },
22
+ required: ['url']
23
+ },
24
+ execute: async (params, context) => {
25
+ const { url, format = 'markdown' } = params;
26
+ let normalizedUrl = url;
27
+ if (url.startsWith('http://')) {
28
+ normalizedUrl = 'https://' + url.slice(7);
29
+ }
30
+ else if (!url.startsWith('https://')) {
31
+ return { success: false, output: '', error: 'URL must start with http:// or https://' };
32
+ }
33
+ try {
34
+ const response = await fetch(normalizedUrl, {
35
+ signal: context.abortSignal,
36
+ headers: { 'User-Agent': 'Mozilla/5.0' }
37
+ });
38
+ if (!response.ok) {
39
+ return { success: false, output: '', error: `HTTP ${response.status}: ${response.statusText}` };
40
+ }
41
+ const text = await response.text();
42
+ if (format === 'text') {
43
+ return { success: true, output: text.slice(0, 50000), metadata: { url: normalizedUrl, format, length: text.length } };
44
+ }
45
+ return {
46
+ success: true,
47
+ output: `[Web Fetch] URL: ${normalizedUrl}\n[Format: ${format}]\n\n${text.slice(0, 50000)}${text.length > 50000 ? '\n\n[content truncated - exceeded 50000 characters]' : ''}`,
48
+ metadata: { url: normalizedUrl, format, length: text.length }
49
+ };
50
+ }
51
+ catch (err) {
52
+ return { success: false, output: '', error: err.message };
53
+ }
54
+ }
55
+ };
56
+ //# sourceMappingURL=web_fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web_fetch.js","sourceRoot":"","sources":["../../../../src/modules/tools/provider/web_fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAGnC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,C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sources":["../../../../src/modules/tools/provider/web_search.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAA2B,MAAM,kBAAkB,CAAA;AAwChE,eAAO,MAAM,aAAa,EAAE,IAqG3B,CAAA"}
@@ -0,0 +1,104 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
+ const web_search_description = fs.readFileSync(path.join(__dirname, 'web_search.txt'), 'utf-8');
6
+ const API_CONFIG = {
7
+ BASE_URL: 'https://mcp.exa.ai',
8
+ ENDPOINTS: {
9
+ SEARCH: '/mcp',
10
+ },
11
+ DEFAULT_NUM_RESULTS: 8,
12
+ TIMEOUT: 25000,
13
+ };
14
+ export const webSearchTool = {
15
+ name: 'web_search',
16
+ description: web_search_description,
17
+ parameters: {
18
+ type: 'object',
19
+ properties: {
20
+ query: {
21
+ type: 'string',
22
+ description: '搜索查询字符串'
23
+ },
24
+ numResults: {
25
+ type: 'number',
26
+ description: '返回结果数量(可选,默认 8)'
27
+ },
28
+ livecrawl: {
29
+ type: 'string',
30
+ enum: ['fallback', 'preferred'],
31
+ description: '实时爬取模式:fallback(缓存不可用时备用),preferred(优先实时爬取)'
32
+ },
33
+ type: {
34
+ type: 'string',
35
+ enum: ['auto', 'fast', 'deep'],
36
+ description: '搜索类型:auto(平衡),fast(快速结果),deep(全面搜索)'
37
+ },
38
+ contextMaxCharacters: {
39
+ type: 'number',
40
+ description: 'LLM 上下文最大字符数(可选,默认 10000)'
41
+ }
42
+ },
43
+ required: ['query']
44
+ },
45
+ execute: async (params, context) => {
46
+ const searchRequest = {
47
+ jsonrpc: '2.0',
48
+ id: 1,
49
+ method: 'tools/call',
50
+ params: {
51
+ name: 'web_search_exa',
52
+ arguments: {
53
+ query: params.query,
54
+ type: params.type || 'auto',
55
+ numResults: params.numResults || API_CONFIG.DEFAULT_NUM_RESULTS,
56
+ livecrawl: params.livecrawl || 'fallback',
57
+ contextMaxCharacters: params.contextMaxCharacters,
58
+ },
59
+ },
60
+ };
61
+ const timeoutTimer = setTimeout(() => {
62
+ throw new Error('Search request timed out');
63
+ }, API_CONFIG.TIMEOUT);
64
+ try {
65
+ const response = await fetch(`${API_CONFIG.BASE_URL}${API_CONFIG.ENDPOINTS.SEARCH}`, {
66
+ method: 'POST',
67
+ headers: {
68
+ accept: 'application/json, text/event-stream',
69
+ 'content-type': 'application/json',
70
+ },
71
+ body: JSON.stringify(searchRequest),
72
+ signal: context.abortSignal,
73
+ });
74
+ clearTimeout(timeoutTimer);
75
+ if (!response.ok) {
76
+ const errorText = await response.text();
77
+ return { success: false, output: '', error: `Search error (${response.status}): ${errorText}` };
78
+ }
79
+ const responseText = await response.text();
80
+ const lines = responseText.split('\n');
81
+ for (const line of lines) {
82
+ if (line.startsWith('data: ')) {
83
+ const data = JSON.parse(line.substring(6));
84
+ if (data.result && data.result.content && data.result.content.length > 0) {
85
+ return {
86
+ success: true,
87
+ output: data.result.content[0].text,
88
+ metadata: { query: params.query, numResults: params.numResults || API_CONFIG.DEFAULT_NUM_RESULTS },
89
+ };
90
+ }
91
+ }
92
+ }
93
+ return { success: true, output: 'No search results found. Try a different query.' };
94
+ }
95
+ catch (err) {
96
+ clearTimeout(timeoutTimer);
97
+ if (err.message === 'Search request timed out') {
98
+ return { success: false, output: '', error: 'Search request timed out' };
99
+ }
100
+ return { success: false, output: '', error: err.message };
101
+ }
102
+ }
103
+ };
104
+ //# sourceMappingURL=web_search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web_search.js","sourceRoot":"","sources":["../../../../src/modules/tools/provider/web_search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAGnC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC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AAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAC9B,MAAM,IAAI,GAAsB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;oBAC7D,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACzE,OAAO;4BACL,OAAO,EAAE,IAAI;4BACb,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;4BACnC,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,UAAU,CAAC,mBAAmB,EAAE;yBACnG,CAAA;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iDAAiD,EAAE,CAAA;QACrF,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,YAAY,CAAC,YAAY,CAAC,CAAA;YAC1B,IAAI,GAAG,CAAC,OAAO,KAAK,0BAA0B,EAAE,CAAC;gBAC/C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAA;YAC1E,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAA;QAC3D,CAAC;IACH,CAAC;CACF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { Tool } from '../tool.types.js';
2
+ export declare const writeFileTool: Tool;
3
+ //# sourceMappingURL=write_file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write_file.d.ts","sourceRoot":"","sources":["../../../../src/modules/tools/provider/write_file.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAA2B,MAAM,kBAAkB,CAAA;AAKhE,eAAO,MAAM,aAAa,EAAE,IAgE3B,CAAA"}
@@ -0,0 +1,63 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
5
+ const write_file_description = fs.readFileSync(path.join(__dirname, 'write_file.txt'), 'utf-8');
6
+ export const writeFileTool = {
7
+ name: 'write_file',
8
+ description: write_file_description,
9
+ parameters: {
10
+ type: 'object',
11
+ properties: {
12
+ file_path: {
13
+ type: 'string',
14
+ description: '文件绝对路径'
15
+ },
16
+ content: {
17
+ type: 'string',
18
+ description: '要写入文件的内容'
19
+ }
20
+ },
21
+ required: ['file_path', 'content']
22
+ },
23
+ execute: async (params, context) => {
24
+ let { file_path, content } = params;
25
+ if (!file_path) {
26
+ return {
27
+ success: false,
28
+ output: '',
29
+ error: `Missing required parameter: file_path`
30
+ };
31
+ }
32
+ if (!content) {
33
+ return {
34
+ success: false,
35
+ output: '',
36
+ error: 'Missing required parameter: content'
37
+ };
38
+ }
39
+ if (file_path.startsWith('@')) {
40
+ file_path = file_path.substring(1);
41
+ }
42
+ if (!path.isAbsolute(file_path)) {
43
+ file_path = path.resolve(context.workDir || process.cwd(), file_path);
44
+ }
45
+ const exists = await fs.promises.access(file_path).then(() => true).catch(() => false);
46
+ if (exists) {
47
+ return {
48
+ success: false,
49
+ output: '',
50
+ error: `File already exists: ${file_path}\nUse edit_file to modify existing files.`
51
+ };
52
+ }
53
+ const dir = path.dirname(file_path);
54
+ await fs.promises.mkdir(dir, { recursive: true });
55
+ await fs.promises.writeFile(file_path, content, 'utf-8');
56
+ return {
57
+ success: true,
58
+ output: `成功: 新文件已创建 ${file_path} (${content.length} 字符)`,
59
+ metadata: { path: file_path, size: content.length }
60
+ };
61
+ }
62
+ };
63
+ //# sourceMappingURL=write_file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write_file.js","sourceRoot":"","sources":["../../../../src/modules/tools/provider/write_file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAGnC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAC9D,MAAM,sBAAsB,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC,CAAA;AAE/F,MAAM,CAAC,MAAM,aAAa,GAAS;IACjC,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,sBAAsB;IACnC,UAAU,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,QAAQ;aACtB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,UAAU;aACxB;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;KACnC;IACD,OAAO,EAAE,KAAK,EAAE,MAA8C,EAAE,OAAoB,EAAuB,EAAE;QAC3G,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,MAAM,CAAA;QAEnC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,uCAAuC;aAC/C,CAAA;QACH,CAAC;QAED,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,qCAAqC;aAC7C,CAAA;QACH,CAAC;QAED,IAAI,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QACpC,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAChC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAA;QACvE,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAA;QACtF,IAAI,MAAM,EAAE,CAAC;YACX,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,EAAE;gBACV,KAAK,EAAE,wBAAwB,SAAS,2CAA2C;aACpF,CAAA;QACH,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QACnC,MAAM,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAEjD,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;QAExD,OAAO;YACL,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,cAAc,SAAS,KAAK,OAAO,CAAC,MAAM,MAAM;YACxD,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,EAAE;SACpD,CAAA;IACH,CAAC;CACF,CAAA"}
@@ -30,6 +30,7 @@ export declare class WebService {
30
30
  private server;
31
31
  private wss;
32
32
  private wsClients;
33
+ private abortControllers;
33
34
  /**
34
35
  * 构造函数
35
36
  *
@@ -88,6 +89,7 @@ export declare class WebService {
88
89
  */
89
90
  start(): Promise<void>;
90
91
  private handleWsMessage;
92
+ private handleStop;
91
93
  private handleChat;
92
94
  broadcast(message: any): void;
93
95
  getApp(): Express;
@@ -1 +1 @@
1
- {"version":3,"file":"web.service.d.ts","sourceRoot":"","sources":["../../src/web/web.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAgB,EAAE,OAAO,EAAqB,MAAM,SAAS,CAAC;AAmB9D;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,GAAG,CAAgC;IAC3C,OAAO,CAAC,SAAS,CAA6B;IAE9C;;;;;;;;;;OAUG;gBACS,IAAI,GAAE,MAAc;IAOhC;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,eAAe;IAWvB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW;IAuInB;;;;;;;;;;;;OAYG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAsGd,eAAe;YAef,UAAU;IAqEjB,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IASpC,MAAM,IAAI,OAAO;CAGlB"}
1
+ {"version":3,"file":"web.service.d.ts","sourceRoot":"","sources":["../../src/web/web.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAgB,EAAE,OAAO,EAAqB,MAAM,SAAS,CAAC;AAqB9D;;;;;;;;GAQG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,GAAG,CAAU;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,GAAG,CAAgC;IAC3C,OAAO,CAAC,SAAS,CAA6B;IAC9C,OAAO,CAAC,gBAAgB,CAA2C;IAEnE;;;;;;;;;;OAUG;gBACS,IAAI,GAAE,MAAc;IAOhC;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,CAAC,eAAe;IAWvB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,WAAW;IAuInB;;;;;;;;;;;;OAYG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YA0Gd,eAAe;IAkB7B,OAAO,CAAC,UAAU;YAWJ,UAAU;IAqGjB,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,IAAI;IASpC,MAAM,IAAI,OAAO;CAGlB"}
@@ -31,6 +31,7 @@ import { dbService } from '../modules/db/db.service.js';
31
31
  import { aiService } from '../modules/ai/index.js';
32
32
  import { sessionService } from '../modules/session/index.js';
33
33
  import { memoryService } from '../modules/memory/index.js';
34
+ import { configService } from '../modules/config/config.service.js';
34
35
  /**
35
36
  * WebService 类
36
37
  *
@@ -56,6 +57,7 @@ export class WebService {
56
57
  this.server = null;
57
58
  this.wss = null;
58
59
  this.wsClients = new Set();
60
+ this.abortControllers = new Map();
59
61
  this.port = port;
60
62
  this.app = express();
61
63
  this.setupMiddleware(); // 配置中间件
@@ -242,7 +244,7 @@ npm run dev
242
244
  * @throws {Error} 如果端口已被占用或其他网络错误
243
245
  */
244
246
  async start() {
245
- dbService.init();
247
+ await dbService.init();
246
248
  return new Promise((resolve, reject) => {
247
249
  this.server = http.createServer(this.app);
248
250
  this.wss = new WebSocketServer({ server: this.server });
@@ -260,6 +262,10 @@ npm run dev
260
262
  });
261
263
  ws.on('close', () => {
262
264
  this.wsClients.delete(ws);
265
+ for (const [sessionId, controller] of this.abortControllers.entries()) {
266
+ controller.abort();
267
+ this.abortControllers.delete(sessionId);
268
+ }
263
269
  });
264
270
  });
265
271
  this.server.listen(this.port, () => {
@@ -339,6 +345,9 @@ npm run dev
339
345
  case 'chat':
340
346
  await this.handleChat(ws, data);
341
347
  break;
348
+ case 'stop':
349
+ this.handleStop(data);
350
+ break;
342
351
  case 'ping':
343
352
  ws.send(JSON.stringify({ type: 'pong' }));
344
353
  break;
@@ -346,8 +355,24 @@ npm run dev
346
355
  ws.send(JSON.stringify({ type: 'error', error: 'Unknown message type' }));
347
356
  }
348
357
  }
358
+ handleStop(data) {
359
+ const { sessionId } = data;
360
+ if (!sessionId)
361
+ return;
362
+ const controller = this.abortControllers.get(sessionId);
363
+ if (controller) {
364
+ controller.abort();
365
+ this.abortControllers.delete(sessionId);
366
+ }
367
+ }
349
368
  async handleChat(ws, data) {
350
369
  const { message, sessionId, projectPath } = data;
370
+ const existingController = this.abortControllers.get(sessionId);
371
+ if (existingController) {
372
+ existingController.abort();
373
+ }
374
+ const abortController = new AbortController();
375
+ this.abortControllers.set(sessionId, abortController);
351
376
  try {
352
377
  let session = sessionId ? sessionService.get(sessionId) : null;
353
378
  if (!session) {
@@ -355,13 +380,13 @@ npm run dev
355
380
  }
356
381
  sessionService.switchTo(session.id);
357
382
  ws.send(JSON.stringify({ type: 'session', data: { sessionId: session.id } }));
358
- const reactSteps = [];
359
383
  console.log('[WebSocket] Chat message:', message);
360
- console.log('[handleChat] calling chatWithReAct, sessionId:', session.id, 'message:', message.substring(0, 20));
361
- const result = await aiService.chatWithReAct(message, {
384
+ console.log('[handleChat] calling chatWithTools, sessionId:', session.id, 'message:', message.substring(0, 20));
385
+ const result = await aiService.chatWithTools(message, {
362
386
  sessionId: session.id,
363
387
  projectPath: session.projectPath || undefined,
364
388
  memoryService,
389
+ abortSignal: abortController.signal,
365
390
  onStep: (step, iteration) => {
366
391
  const actions = (step.actions || []).map((a) => ({
367
392
  actionName: a.actionName,
@@ -388,6 +413,9 @@ npm run dev
388
413
  });
389
414
  const lastStep = result.steps[result.steps.length - 1];
390
415
  const lastThought = lastStep && 'thought' in lastStep ? lastStep.thought : undefined;
416
+ const providerConfig = configService.getDefaultProvider();
417
+ const models = providerConfig ? configService.getModels(providerConfig.id) : [];
418
+ const defaultModel = models.find(m => m.enabled) || { name: 'gpt-4' };
391
419
  ws.send(JSON.stringify({
392
420
  type: 'done',
393
421
  data: {
@@ -395,14 +423,35 @@ npm run dev
395
423
  response: result.answer || lastThought,
396
424
  iterations: result.iterations,
397
425
  success: result.success,
426
+ modelName: defaultModel?.name || providerConfig?.name || 'unknown',
427
+ usage: result.usage ? {
428
+ promptTokens: result.usage.promptTokens,
429
+ completionTokens: result.usage.completionTokens,
430
+ totalTokens: result.usage.totalTokens,
431
+ } : undefined,
398
432
  }
399
433
  }));
400
434
  }
401
435
  catch (error) {
402
- ws.send(JSON.stringify({
403
- type: 'error',
404
- error: error instanceof Error ? error.message : 'Unknown error'
405
- }));
436
+ const errorMsg = error instanceof Error ? error.message : 'Unknown error';
437
+ const isAbort = error instanceof Error && (error.name === 'AbortError' ||
438
+ errorMsg === 'ABORTED' ||
439
+ errorMsg.toLowerCase().includes('abort'));
440
+ if (isAbort) {
441
+ ws.send(JSON.stringify({
442
+ type: 'stopped',
443
+ reason: 'user_cancelled'
444
+ }));
445
+ }
446
+ else {
447
+ ws.send(JSON.stringify({
448
+ type: 'error',
449
+ error: errorMsg
450
+ }));
451
+ }
452
+ }
453
+ finally {
454
+ this.abortControllers.delete(sessionId);
406
455
  }
407
456
  }
408
457
  broadcast(message) {
@@ -1 +1 @@
1
- {"version":3,"file":"web.service.js","sourceRoot":"","sources":["../../src/web/web.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,OAAuC,MAAM,SAAS,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAi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AAC;YACN,CAAC;iBAAM,CAAC;gBACN,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;oBACrB,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,QAAQ;iBAChB,CAAC,CAAC,CAAC;YACN,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IAEM,SAAS,CAAC,OAAY;QAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC9B,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;gBACzC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tianxincode",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "description": "AI Coding Assistant",
6
6
  "main": "dist/index.js",
@@ -27,20 +27,20 @@
27
27
  "author": "",
28
28
  "license": "ISC",
29
29
  "dependencies": {
30
- "better-sqlite3": "^12.8.0",
31
30
  "cors": "^2.8.6",
32
31
  "express": "^5.2.1",
33
32
  "ink": "^5.1.1",
34
33
  "js-yaml": "^4.1.1",
35
34
  "openai": "^5.5.1",
36
35
  "react": "^18.3.1",
36
+ "sql.js": "^1.12.0",
37
37
  "uuid": "^9.0.1",
38
+ "which": "^6.0.1",
38
39
  "ws": "^8.20.0",
39
40
  "xml2js": "^0.6.2",
40
41
  "yaml": "^2.8.3"
41
42
  },
42
43
  "devDependencies": {
43
- "@types/better-sqlite3": "^7.6.13",
44
44
  "@types/cors": "^2.8.19",
45
45
  "@types/express": "^5.0.6",
46
46
  "@types/jest": "^30.0.0",
@@ -48,7 +48,9 @@
48
48
  "@types/node": "^25.5.0",
49
49
  "@types/react": "^18.3.28",
50
50
  "@types/react-dom": "^18.3.7",
51
+ "@types/sql.js": "^1.4.9",
51
52
  "@types/uuid": "^10.0.0",
53
+ "@types/which": "^3.0.4",
52
54
  "@types/ws": "^8.18.1",
53
55
  "@types/xml2js": "^0.4.14",
54
56
  "jest": "^30.3.0",
@@ -0,0 +1 @@
1
+ import{n as x,a as n}from"./index-B-R-RCGS.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 as a,a as r}from"./index-B-R-RCGS.js";const o={name:"Layout",data(){return{sidebarVisible:!0,showSessionDropdown:!1,sessions:[],currentSessionId:null,currentSessionName:""}},methods:{toggleSidebar(){this.sidebarVisible=!this.sidebarVisible},toggleSessionDropdown(){this.showSessionDropdown=!this.showSessionDropdown},async switchSession(s){this.currentSessionId=s.id,this.currentSessionName=s.title,this.showSessionDropdown=!1,this.$route.params.id!==s.id&&this.$router.push({name:"chat-session",params:{id:s.id}}).catch(()=>{})},async createNewSession(){try{const s=await r.createSession("新会话");this.sessions.unshift(s.data),this.switchSession(s.data),this.showSessionDropdown=!1}catch(s){this.$message.error("创建会话失败: "+s.message)}},async loadSessions(){try{const s=await r.getSessions();this.sessions=s.data||[],this.sessions.length>0&&!this.currentSessionId&&(this.currentSessionId=this.sessions[0].id,this.currentSessionName=this.sessions[0].title)}catch(s){console.error("加载会话失败:",s)}}},async created(){await this.loadSessions(),document.addEventListener("click",s=>{this.$el.contains(s.target)||(this.showSessionDropdown=!1)})}};var n=function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex flex-col h-screen overflow-hidden"},[e("header",{staticClass:"h-10 bg-sidebar border-b border-black flex items-center justify-between px-4 shrink-0 z-20"},[e("div",{staticClass:"flex items-center gap-4"},[t._m(0),e("div",{staticClass:"relative"},[e("div",{staticClass:"bg-black/20 px-2 py-0.5 rounded text-xs text-textMuted border border-white/10 cursor-pointer hover:bg-black/40 flex items-center gap-2 select-none",on:{click:t.toggleSessionDropdown}},[e("i",{staticClass:"fa-solid fa-comment"}),t._v(" "),e("span",[t._v(t._s(t.currentSessionName||"选择会话"))]),t._v(" "),e("i",{staticClass:"fa-solid fa-chevron-down text-[10px] transition-transform",class:{"rotate-180":t.showSessionDropdown}})]),e("div",{directives:[{name:"show",rawName:"v-show",value:t.showSessionDropdown,expression:"showSessionDropdown"}],staticClass:"absolute top-full left-0 mt-1 w-56 bg-sidebar border border-border rounded shadow-lg py-1 z-50"},[e("div",{staticClass:"px-3 py-1.5 text-xs text-textMuted uppercase font-bold"},[t._v("最近会话")]),t._l(t.sessions,function(i){return e("button",{key:i.id,staticClass:"w-full text-left px-3 py-2 text-sm hover:bg-active flex items-center gap-2",class:i.id===t.currentSessionId?"text-white bg-active":"text-textMuted hover:text-white",on:{click:function(d){return t.switchSession(i)}}},[e("i",{staticClass:"fa-regular fa-comment text-xs"}),t._v(" "+t._s(i.title)+" ")])}),e("div",{staticClass:"border-t border-border my-1"}),e("button",{staticClass:"w-full text-left px-3 py-2 text-sm text-textMuted hover:bg-active hover:text-white flex items-center gap-2",on:{click:t.createNewSession}},[e("i",{staticClass:"fa-solid fa-plus text-xs"}),t._v(" 新建会话... ")])],2)])]),e("div",{staticClass:"flex items-center gap-3"},[t._m(1),e("button",{directives:[{name:"show",rawName:"v-show",value:t.$route.name==="chat",expression:"$route.name === 'chat'"}],staticClass:"hover:text-white",attrs:{title:t.sidebarVisible?"关闭侧栏":"显示侧栏"},on:{click:t.toggleSidebar}},[e("i",{staticClass:"fa-solid fa-columns"})]),e("router-link",{staticClass:"hover:text-white",attrs:{to:"/settings",title:"设置"}},[e("i",{staticClass:"fa-solid fa-gear"})])],1)]),e("div",{staticClass:"flex-1 flex overflow-hidden"},[e("nav",{staticClass:"w-12 bg-activityBar flex flex-col items-center py-2 shrink-0 border-r border-black z-10 justify-between"},[e("div",{staticClass:"flex flex-col items-center w-full"},[e("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:t.$route.name==="codeView"||t.$route.name==="codeView-session"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/codeView",title:"工作台"}},[e("i",{staticClass:"fa-regular fa-comments text-xl"})]),e("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:t.$route.name==="files"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/files",title:"文件"}},[e("i",{staticClass:"fa-solid fa-folder-open text-xl"})]),e("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center relative",class:t.$route.name==="skills"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/skills",title:"Skill 管理"}},[e("i",{staticClass:"fa-solid fa-shapes text-xl"})]),e("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:t.$route.name==="db"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/db",title:"数据库"}},[e("i",{staticClass:"fa-solid fa-database text-xl"})]),e("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:t.$route.name==="aiLogs"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent",attrs:{to:"/aiLogs",title:"AI 日志"}},[e("i",{staticClass:"fa-solid fa-robot text-xl"})])],1),e("div",{staticClass:"flex flex-col items-center w-full mb-2"},[e("router-link",{staticClass:"w-10 h-10 mb-2 rounded flex items-center justify-center",class:t.$route.name==="settings"?"text-white border-l-2 border-accent bg-sidebar":"text-textMuted hover:text-white border-l-2 border-transparent hover:bg-white/5",attrs:{to:"/settings",title:"设置"}},[e("i",{staticClass:"fa-solid fa-gear text-xl"})])],1)]),e("router-view",{staticClass:"flex-1 flex overflow-hidden",attrs:{"sidebar-visible":t.sidebarVisible},on:{"toggle-sidebar":t.toggleSidebar}})],1),t._m(2)])},l=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"font-bold text-white flex items-center gap-2"},[t("i",{staticClass:"fa-solid fa-robot text-accent"}),t("span",[s._v("TXCode Agent")])])},function(){var s=this,t=s._self._c;return t("span",{staticClass:"text-xs text-textMuted mr-2"},[t("i",{staticClass:"fa-solid fa-circle text-green-500 text-[8px]"}),s._v(" Server Connected")])},function(){var s=this,t=s._self._c;return t("footer",{staticClass:"h-6 bg-accent text-white text-xs flex items-center justify-between px-3 shrink-0 z-20"},[t("div",{staticClass:"flex items-center gap-4"},[t("span",[t("i",{staticClass:"fa-solid fa-code-branch"}),s._v(" main")])]),t("div",{staticClass:"flex items-center gap-4"},[t("span",[s._v("TXCode")]),t("span",[s._v("UTF-8")])])])}],c=a(o,n,l,!1,null,null);const f=c.exports;export{f as default};