tianxincode 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +57 -0
- package/dist/api/api.types.d.ts +350 -0
- package/dist/api/api.types.d.ts.map +1 -0
- package/dist/api/api.types.js +12 -0
- package/dist/api/api.types.js.map +1 -0
- package/dist/api/chat.routes.d.ts +26 -0
- package/dist/api/chat.routes.d.ts.map +1 -0
- package/dist/api/chat.routes.js +275 -0
- package/dist/api/chat.routes.js.map +1 -0
- package/dist/api/config.routes.d.ts +10 -0
- package/dist/api/config.routes.d.ts.map +1 -0
- package/dist/api/config.routes.js +150 -0
- package/dist/api/config.routes.js.map +1 -0
- package/dist/api/db.routes.d.ts +12 -0
- package/dist/api/db.routes.d.ts.map +1 -0
- package/dist/api/db.routes.js +108 -0
- package/dist/api/db.routes.js.map +1 -0
- package/dist/api/files.routes.d.ts +14 -0
- package/dist/api/files.routes.d.ts.map +1 -0
- package/dist/api/files.routes.js +220 -0
- package/dist/api/files.routes.js.map +1 -0
- package/dist/api/filesystem.routes.d.ts +10 -0
- package/dist/api/filesystem.routes.d.ts.map +1 -0
- package/dist/api/filesystem.routes.js +181 -0
- package/dist/api/filesystem.routes.js.map +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +25 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/lsp.d.ts +5 -0
- package/dist/api/lsp.d.ts.map +1 -0
- package/dist/api/lsp.js +103 -0
- package/dist/api/lsp.js.map +1 -0
- package/dist/api/projects.routes.d.ts +18 -0
- package/dist/api/projects.routes.d.ts.map +1 -0
- package/dist/api/projects.routes.js +306 -0
- package/dist/api/projects.routes.js.map +1 -0
- package/dist/api/session.routes.d.ts +18 -0
- package/dist/api/session.routes.d.ts.map +1 -0
- package/dist/api/session.routes.js +186 -0
- package/dist/api/session.routes.js.map +1 -0
- package/dist/api/skills.routes.d.ts +6 -0
- package/dist/api/skills.routes.d.ts.map +1 -0
- package/dist/api/skills.routes.js +54 -0
- package/dist/api/skills.routes.js.map +1 -0
- package/dist/cli/args.d.ts +49 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +77 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/cli.types.d.ts +22 -0
- package/dist/cli/cli.types.d.ts.map +1 -0
- package/dist/cli/cli.types.js +5 -0
- package/dist/cli/cli.types.js.map +1 -0
- package/dist/cli/commands.d.ts +30 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +263 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +6 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/components/App.d.ts +34 -0
- package/dist/components/App.d.ts.map +1 -0
- package/dist/components/App.js +639 -0
- package/dist/components/App.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/tx.config.d.ts +31 -0
- package/dist/config/tx.config.d.ts.map +1 -0
- package/dist/config/tx.config.js +29 -0
- package/dist/config/tx.config.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/lsp/client.d.ts +55 -0
- package/dist/lsp/client.d.ts.map +1 -0
- package/dist/lsp/client.js +252 -0
- package/dist/lsp/client.js.map +1 -0
- package/dist/lsp/downloader.d.ts +17 -0
- package/dist/lsp/downloader.d.ts.map +1 -0
- package/dist/lsp/downloader.js +302 -0
- package/dist/lsp/downloader.js.map +1 -0
- package/dist/lsp/index.d.ts +13 -0
- package/dist/lsp/index.d.ts.map +1 -0
- package/dist/lsp/index.js +30 -0
- package/dist/lsp/index.js.map +1 -0
- package/dist/lsp/launch.d.ts +17 -0
- package/dist/lsp/launch.d.ts.map +1 -0
- package/dist/lsp/launch.js +69 -0
- package/dist/lsp/launch.js.map +1 -0
- package/dist/lsp/manager.d.ts +19 -0
- package/dist/lsp/manager.d.ts.map +1 -0
- package/dist/lsp/manager.js +251 -0
- package/dist/lsp/manager.js.map +1 -0
- package/dist/lsp/server.d.ts +11 -0
- package/dist/lsp/server.d.ts.map +1 -0
- package/dist/lsp/server.js +302 -0
- package/dist/lsp/server.js.map +1 -0
- package/dist/lsp/sql.d.ts +11 -0
- package/dist/lsp/sql.d.ts.map +1 -0
- package/dist/lsp/sql.js +23 -0
- package/dist/lsp/sql.js.map +1 -0
- package/dist/lsp/types.d.ts +58 -0
- package/dist/lsp/types.d.ts.map +1 -0
- package/dist/lsp/types.js +13 -0
- package/dist/lsp/types.js.map +1 -0
- package/dist/modules/ai/ai.service.d.ts +182 -0
- package/dist/modules/ai/ai.service.d.ts.map +1 -0
- package/dist/modules/ai/ai.service.js +280 -0
- package/dist/modules/ai/ai.service.js.map +1 -0
- package/dist/modules/ai/ai.types.d.ts +54 -0
- package/dist/modules/ai/ai.types.d.ts.map +1 -0
- package/dist/modules/ai/ai.types.js +2 -0
- package/dist/modules/ai/ai.types.js.map +1 -0
- package/dist/modules/ai/index.d.ts +6 -0
- package/dist/modules/ai/index.d.ts.map +1 -0
- package/dist/modules/ai/index.js +5 -0
- package/dist/modules/ai/index.js.map +1 -0
- package/dist/modules/ai/openai.provider.d.ts +138 -0
- package/dist/modules/ai/openai.provider.d.ts.map +1 -0
- package/dist/modules/ai/openai.provider.js +279 -0
- package/dist/modules/ai/openai.provider.js.map +1 -0
- package/dist/modules/ai/react/index.d.ts +5 -0
- package/dist/modules/ai/react/index.d.ts.map +1 -0
- package/dist/modules/ai/react/index.js +4 -0
- package/dist/modules/ai/react/index.js.map +1 -0
- package/dist/modules/ai/react/prompt/role.txt +51 -0
- package/dist/modules/ai/react/react.parser.d.ts +75 -0
- package/dist/modules/ai/react/react.parser.d.ts.map +1 -0
- package/dist/modules/ai/react/react.parser.js +278 -0
- package/dist/modules/ai/react/react.parser.js.map +1 -0
- package/dist/modules/ai/react/react.prompts.d.ts +26 -0
- package/dist/modules/ai/react/react.prompts.d.ts.map +1 -0
- package/dist/modules/ai/react/react.prompts.js +180 -0
- package/dist/modules/ai/react/react.prompts.js.map +1 -0
- package/dist/modules/ai/react/react.types.d.ts +47 -0
- package/dist/modules/ai/react/react.types.d.ts.map +1 -0
- package/dist/modules/ai/react/react.types.js +2 -0
- package/dist/modules/ai/react/react.types.js.map +1 -0
- package/dist/modules/ai/react.agent.d.ts +40 -0
- package/dist/modules/ai/react.agent.d.ts.map +1 -0
- package/dist/modules/ai/react.agent.js +136 -0
- package/dist/modules/ai/react.agent.js.map +1 -0
- package/dist/modules/ai/summarizer/index.d.ts +4 -0
- package/dist/modules/ai/summarizer/index.d.ts.map +1 -0
- package/dist/modules/ai/summarizer/index.js +3 -0
- package/dist/modules/ai/summarizer/index.js.map +1 -0
- package/dist/modules/ai/summarizer/summarizer.prompts.d.ts +15 -0
- package/dist/modules/ai/summarizer/summarizer.prompts.d.ts.map +1 -0
- package/dist/modules/ai/summarizer/summarizer.prompts.js +47 -0
- package/dist/modules/ai/summarizer/summarizer.prompts.js.map +1 -0
- package/dist/modules/ai/summarizer/summarizer.service.d.ts +24 -0
- package/dist/modules/ai/summarizer/summarizer.service.d.ts.map +1 -0
- package/dist/modules/ai/summarizer/summarizer.service.js +153 -0
- package/dist/modules/ai/summarizer/summarizer.service.js.map +1 -0
- package/dist/modules/ai/summarizer/summarizer.types.d.ts +21 -0
- package/dist/modules/ai/summarizer/summarizer.types.d.ts.map +1 -0
- package/dist/modules/ai/summarizer/summarizer.types.js +5 -0
- package/dist/modules/ai/summarizer/summarizer.types.js.map +1 -0
- package/dist/modules/config/config.service.d.ts +32 -0
- package/dist/modules/config/config.service.d.ts.map +1 -0
- package/dist/modules/config/config.service.js +163 -0
- package/dist/modules/config/config.service.js.map +1 -0
- package/dist/modules/config/config.types.d.ts +44 -0
- package/dist/modules/config/config.types.d.ts.map +1 -0
- package/dist/modules/config/config.types.js +21 -0
- package/dist/modules/config/config.types.js.map +1 -0
- package/dist/modules/config/index.d.ts +10 -0
- package/dist/modules/config/index.d.ts.map +1 -0
- package/dist/modules/config/index.js +10 -0
- package/dist/modules/config/index.js.map +1 -0
- package/dist/modules/context/context.service.d.ts +46 -0
- package/dist/modules/context/context.service.d.ts.map +1 -0
- package/dist/modules/context/context.service.js +216 -0
- package/dist/modules/context/context.service.js.map +1 -0
- package/dist/modules/context/context.types.d.ts +30 -0
- package/dist/modules/context/context.types.d.ts.map +1 -0
- package/dist/modules/context/context.types.js +5 -0
- package/dist/modules/context/context.types.js.map +1 -0
- package/dist/modules/context/index.d.ts +10 -0
- package/dist/modules/context/index.d.ts.map +1 -0
- package/dist/modules/context/index.js +10 -0
- package/dist/modules/context/index.js.map +1 -0
- package/dist/modules/db/db.service.d.ts +97 -0
- package/dist/modules/db/db.service.d.ts.map +1 -0
- package/dist/modules/db/db.service.js +387 -0
- package/dist/modules/db/db.service.js.map +1 -0
- package/dist/modules/db/db.types.d.ts +8 -0
- package/dist/modules/db/db.types.d.ts.map +1 -0
- package/dist/modules/db/db.types.js +7 -0
- package/dist/modules/db/db.types.js.map +1 -0
- package/dist/modules/db/index.d.ts +10 -0
- package/dist/modules/db/index.d.ts.map +1 -0
- package/dist/modules/db/index.js +9 -0
- package/dist/modules/db/index.js.map +1 -0
- package/dist/modules/logger/index.d.ts +2 -0
- package/dist/modules/logger/index.d.ts.map +1 -0
- package/dist/modules/logger/index.js +2 -0
- package/dist/modules/logger/index.js.map +1 -0
- package/dist/modules/logger/logger.d.ts +26 -0
- package/dist/modules/logger/logger.d.ts.map +1 -0
- package/dist/modules/logger/logger.js +57 -0
- package/dist/modules/logger/logger.js.map +1 -0
- package/dist/modules/memory/index.d.ts +9 -0
- package/dist/modules/memory/index.d.ts.map +1 -0
- package/dist/modules/memory/index.js +9 -0
- package/dist/modules/memory/index.js.map +1 -0
- package/dist/modules/memory/memory.service.d.ts +191 -0
- package/dist/modules/memory/memory.service.d.ts.map +1 -0
- package/dist/modules/memory/memory.service.js +282 -0
- package/dist/modules/memory/memory.service.js.map +1 -0
- package/dist/modules/memory/memory.types.d.ts +13 -0
- package/dist/modules/memory/memory.types.d.ts.map +1 -0
- package/dist/modules/memory/memory.types.js +5 -0
- package/dist/modules/memory/memory.types.js.map +1 -0
- package/dist/modules/session/index.d.ts +9 -0
- package/dist/modules/session/index.d.ts.map +1 -0
- package/dist/modules/session/index.js +9 -0
- package/dist/modules/session/index.js.map +1 -0
- package/dist/modules/session/session.service.d.ts +252 -0
- package/dist/modules/session/session.service.d.ts.map +1 -0
- package/dist/modules/session/session.service.js +406 -0
- package/dist/modules/session/session.service.js.map +1 -0
- package/dist/modules/session/session.types.d.ts +34 -0
- package/dist/modules/session/session.types.d.ts.map +1 -0
- package/dist/modules/session/session.types.js +5 -0
- package/dist/modules/session/session.types.js.map +1 -0
- package/dist/modules/skill/index.d.ts +8 -0
- package/dist/modules/skill/index.d.ts.map +1 -0
- package/dist/modules/skill/index.js +7 -0
- package/dist/modules/skill/index.js.map +1 -0
- package/dist/modules/skill/skill.service.d.ts +72 -0
- package/dist/modules/skill/skill.service.d.ts.map +1 -0
- package/dist/modules/skill/skill.service.js +283 -0
- package/dist/modules/skill/skill.service.js.map +1 -0
- package/dist/modules/skill/skill.tool.d.ts +19 -0
- package/dist/modules/skill/skill.tool.d.ts.map +1 -0
- package/dist/modules/skill/skill.tool.js +92 -0
- package/dist/modules/skill/skill.tool.js.map +1 -0
- package/dist/modules/skill/skill.txt +18 -0
- package/dist/modules/skill/skill.types.d.ts +40 -0
- package/dist/modules/skill/skill.types.d.ts.map +1 -0
- package/dist/modules/skill/skill.types.js +6 -0
- package/dist/modules/skill/skill.types.js.map +1 -0
- package/dist/modules/skill/skills.manager.d.ts +30 -0
- package/dist/modules/skill/skills.manager.d.ts.map +1 -0
- package/dist/modules/skill/skills.manager.js +182 -0
- package/dist/modules/skill/skills.manager.js.map +1 -0
- package/dist/modules/tools/builtin/bash.d.ts +3 -0
- package/dist/modules/tools/builtin/bash.d.ts.map +1 -0
- package/dist/modules/tools/builtin/bash.js +124 -0
- package/dist/modules/tools/builtin/bash.js.map +1 -0
- package/dist/modules/tools/builtin/bash.tool.d.ts +6 -0
- package/dist/modules/tools/builtin/bash.tool.d.ts.map +1 -0
- package/dist/modules/tools/builtin/bash.tool.js +52 -0
- package/dist/modules/tools/builtin/bash.tool.js.map +1 -0
- package/dist/modules/tools/builtin/bash.txt +81 -0
- package/dist/modules/tools/builtin/code_search.d.ts +3 -0
- package/dist/modules/tools/builtin/code_search.d.ts.map +1 -0
- package/dist/modules/tools/builtin/code_search.js +85 -0
- package/dist/modules/tools/builtin/code_search.js.map +1 -0
- package/dist/modules/tools/builtin/code_search.txt +18 -0
- package/dist/modules/tools/builtin/edit-file.tool.d.ts +6 -0
- package/dist/modules/tools/builtin/edit-file.tool.d.ts.map +1 -0
- package/dist/modules/tools/builtin/edit-file.tool.js +58 -0
- package/dist/modules/tools/builtin/edit-file.tool.js.map +1 -0
- package/dist/modules/tools/builtin/edit_file.d.ts +3 -0
- package/dist/modules/tools/builtin/edit_file.d.ts.map +1 -0
- package/dist/modules/tools/builtin/edit_file.js +69 -0
- package/dist/modules/tools/builtin/edit_file.js.map +1 -0
- package/dist/modules/tools/builtin/edit_file.txt +10 -0
- package/dist/modules/tools/builtin/glob.d.ts +3 -0
- package/dist/modules/tools/builtin/glob.d.ts.map +1 -0
- package/dist/modules/tools/builtin/glob.js +84 -0
- package/dist/modules/tools/builtin/glob.js.map +1 -0
- package/dist/modules/tools/builtin/glob.tool.d.ts +6 -0
- package/dist/modules/tools/builtin/glob.tool.d.ts.map +1 -0
- package/dist/modules/tools/builtin/glob.tool.js +81 -0
- package/dist/modules/tools/builtin/glob.tool.js.map +1 -0
- package/dist/modules/tools/builtin/glob.txt +10 -0
- package/dist/modules/tools/builtin/grep.d.ts +3 -0
- package/dist/modules/tools/builtin/grep.d.ts.map +1 -0
- package/dist/modules/tools/builtin/grep.js +93 -0
- package/dist/modules/tools/builtin/grep.js.map +1 -0
- package/dist/modules/tools/builtin/grep.tool.d.ts +6 -0
- package/dist/modules/tools/builtin/grep.tool.d.ts.map +1 -0
- package/dist/modules/tools/builtin/grep.tool.js +96 -0
- package/dist/modules/tools/builtin/grep.tool.js.map +1 -0
- package/dist/modules/tools/builtin/grep.txt +12 -0
- package/dist/modules/tools/builtin/index.d.ts +8 -0
- package/dist/modules/tools/builtin/index.d.ts.map +1 -0
- package/dist/modules/tools/builtin/index.js +88 -0
- package/dist/modules/tools/builtin/index.js.map +1 -0
- package/dist/modules/tools/builtin/lsp.d.ts +7 -0
- package/dist/modules/tools/builtin/lsp.d.ts.map +1 -0
- package/dist/modules/tools/builtin/lsp.js +125 -0
- package/dist/modules/tools/builtin/lsp.js.map +1 -0
- package/dist/modules/tools/builtin/lsp.txt +19 -0
- package/dist/modules/tools/builtin/memory.d.ts +3 -0
- package/dist/modules/tools/builtin/memory.d.ts.map +1 -0
- package/dist/modules/tools/builtin/memory.js +76 -0
- package/dist/modules/tools/builtin/memory.js.map +1 -0
- package/dist/modules/tools/builtin/memory.txt +36 -0
- package/dist/modules/tools/builtin/read-file.tool.d.ts +6 -0
- package/dist/modules/tools/builtin/read-file.tool.d.ts.map +1 -0
- package/dist/modules/tools/builtin/read-file.tool.js +46 -0
- package/dist/modules/tools/builtin/read-file.tool.js.map +1 -0
- package/dist/modules/tools/builtin/read_file.d.ts +3 -0
- package/dist/modules/tools/builtin/read_file.d.ts.map +1 -0
- package/dist/modules/tools/builtin/read_file.js +99 -0
- package/dist/modules/tools/builtin/read_file.js.map +1 -0
- package/dist/modules/tools/builtin/read_file.txt +15 -0
- package/dist/modules/tools/builtin/todo_read.d.ts +6 -0
- package/dist/modules/tools/builtin/todo_read.d.ts.map +1 -0
- package/dist/modules/tools/builtin/todo_read.js +24 -0
- package/dist/modules/tools/builtin/todo_read.js.map +1 -0
- package/dist/modules/tools/builtin/todo_read.txt +14 -0
- package/dist/modules/tools/builtin/todo_write.d.ts +6 -0
- package/dist/modules/tools/builtin/todo_write.d.ts.map +1 -0
- package/dist/modules/tools/builtin/todo_write.js +45 -0
- package/dist/modules/tools/builtin/todo_write.js.map +1 -0
- package/dist/modules/tools/builtin/todo_write.txt +46 -0
- package/dist/modules/tools/builtin/web_fetch.d.ts +3 -0
- package/dist/modules/tools/builtin/web_fetch.d.ts.map +1 -0
- package/dist/modules/tools/builtin/web_fetch.js +51 -0
- package/dist/modules/tools/builtin/web_fetch.js.map +1 -0
- package/dist/modules/tools/builtin/web_fetch.txt +15 -0
- package/dist/modules/tools/builtin/web_search.d.ts +3 -0
- package/dist/modules/tools/builtin/web_search.d.ts.map +1 -0
- package/dist/modules/tools/builtin/web_search.js +99 -0
- package/dist/modules/tools/builtin/web_search.js.map +1 -0
- package/dist/modules/tools/builtin/web_search.txt +16 -0
- package/dist/modules/tools/builtin/write-file.tool.d.ts +6 -0
- package/dist/modules/tools/builtin/write-file.tool.d.ts.map +1 -0
- package/dist/modules/tools/builtin/write-file.tool.js +38 -0
- package/dist/modules/tools/builtin/write-file.tool.js.map +1 -0
- package/dist/modules/tools/builtin/write_file.d.ts +3 -0
- package/dist/modules/tools/builtin/write_file.d.ts.map +1 -0
- package/dist/modules/tools/builtin/write_file.js +46 -0
- package/dist/modules/tools/builtin/write_file.js.map +1 -0
- package/dist/modules/tools/builtin/write_file.txt +9 -0
- package/dist/modules/tools/index.d.ts +11 -0
- package/dist/modules/tools/index.d.ts.map +1 -0
- package/dist/modules/tools/index.js +10 -0
- package/dist/modules/tools/index.js.map +1 -0
- package/dist/modules/tools/tool.service.d.ts +207 -0
- package/dist/modules/tools/tool.service.d.ts.map +1 -0
- package/dist/modules/tools/tool.service.js +331 -0
- package/dist/modules/tools/tool.service.js.map +1 -0
- package/dist/modules/tools/tool.types.d.ts +39 -0
- package/dist/modules/tools/tool.types.d.ts.map +1 -0
- package/dist/modules/tools/tool.types.js +5 -0
- package/dist/modules/tools/tool.types.js.map +1 -0
- package/dist/web/index.d.ts +10 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +20 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/web.service.d.ts +95 -0
- package/dist/web/web.service.d.ts.map +1 -0
- package/dist/web/web.service.js +396 -0
- package/dist/web/web.service.js.map +1 -0
- package/package.json +57 -0
- package/web/dist/assets/Layout-Bb76CGAL.js +1 -0
- package/web/dist/assets/element-icons-B-tDfklg.woff +0 -0
- package/web/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
- package/web/dist/assets/index-DQRR0ggU.js +199 -0
- package/web/dist/assets/index-KTH-myBB.css +1 -0
- package/web/dist/index.html +14 -0
- package/web/index.html +13 -0
- package/web/package.json +24 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# txcode
|
|
2
|
+
|
|
3
|
+
AI Coding Assistant - 一个 AI 编程助手命令行工具。
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 开发
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# 开发模式运行
|
|
15
|
+
npm run dev
|
|
16
|
+
|
|
17
|
+
# 构建
|
|
18
|
+
npm run build
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 测试
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 运行测试
|
|
25
|
+
npm test
|
|
26
|
+
|
|
27
|
+
# 运行测试并生成覆盖率报告
|
|
28
|
+
npm run test:coverage
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 使用
|
|
32
|
+
|
|
33
|
+
构建完成后,可以通过以下方式使用:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npx txcode
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
或者全局安装后:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm link
|
|
43
|
+
txcode
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 项目结构
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
├── src/ # 源代码
|
|
50
|
+
├── tests/ # 测试文件
|
|
51
|
+
├── dist/ # 构建输出
|
|
52
|
+
└── package.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
ISC
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API 类型定义文件
|
|
3
|
+
*
|
|
4
|
+
* 这个文件定义了整个 API 系统的 TypeScript 接口和类型定义。
|
|
5
|
+
* 主要用于:
|
|
6
|
+
* 1. 统一 API 请求和响应的数据结构
|
|
7
|
+
* 2. 提供类型安全保证
|
|
8
|
+
* 3. 方便前后端类型同步
|
|
9
|
+
* 4. 作为 API 文档的一部分
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* 通用 API 响应接口
|
|
13
|
+
* @template T - 响应数据的类型(默认为 any)
|
|
14
|
+
*
|
|
15
|
+
* 所有 API 响应都应该遵循这个格式,确保前后端数据格式一致。
|
|
16
|
+
*
|
|
17
|
+
* @property success - 请求是否成功
|
|
18
|
+
* @property data - 成功时的响应数据(可选)
|
|
19
|
+
* @property error - 错误信息(可选)
|
|
20
|
+
* @property message - 一般消息(可选)
|
|
21
|
+
*/
|
|
22
|
+
export interface ApiResponse<T = any> {
|
|
23
|
+
success: boolean;
|
|
24
|
+
data?: T;
|
|
25
|
+
error?: string;
|
|
26
|
+
message?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 聊天请求接口
|
|
30
|
+
*
|
|
31
|
+
* 用于发送聊天消息到 AI 助手的请求数据结构
|
|
32
|
+
*
|
|
33
|
+
* @property message - 用户发送的消息内容
|
|
34
|
+
* @property sessionId - 会话ID,用于关联历史对话(可选)
|
|
35
|
+
* @property projectPath - 项目路径,用于上下文感知(可选)
|
|
36
|
+
* @property skill - 指定使用的技能或模型(可选)
|
|
37
|
+
* @property stream - 是否使用流式响应(可选)
|
|
38
|
+
*/
|
|
39
|
+
export interface ChatRequest {
|
|
40
|
+
message: string;
|
|
41
|
+
sessionId?: string;
|
|
42
|
+
projectPath?: string;
|
|
43
|
+
skill?: string;
|
|
44
|
+
stream?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 聊天响应接口
|
|
48
|
+
*
|
|
49
|
+
* AI 助手返回的聊天响应数据结构
|
|
50
|
+
*
|
|
51
|
+
* @property sessionId - 会话ID,用于后续对话关联
|
|
52
|
+
* @property response - AI 助手的回复内容
|
|
53
|
+
* @property toolCalls - 工具调用结果数组(可选)
|
|
54
|
+
*/
|
|
55
|
+
export interface ChatResponse {
|
|
56
|
+
sessionId: string;
|
|
57
|
+
response: string;
|
|
58
|
+
toolCalls?: ToolCallResult[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 工具调用结果接口
|
|
62
|
+
*
|
|
63
|
+
* 记录 AI 助手调用工具的结果
|
|
64
|
+
*
|
|
65
|
+
* @property tool - 调用的工具名称
|
|
66
|
+
* @property input - 工具调用的输入参数
|
|
67
|
+
* @property output - 工具调用的输出结果
|
|
68
|
+
*/
|
|
69
|
+
export interface ToolCallResult {
|
|
70
|
+
tool: string;
|
|
71
|
+
input: any;
|
|
72
|
+
output: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 会话创建请求接口
|
|
76
|
+
*
|
|
77
|
+
* 用于创建新的聊天会话
|
|
78
|
+
*
|
|
79
|
+
* @property title - 会话标题
|
|
80
|
+
* @property projectPath - 关联的项目路径(可选)
|
|
81
|
+
*/
|
|
82
|
+
export interface SessionCreateRequest {
|
|
83
|
+
title: string;
|
|
84
|
+
projectPath?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* AI 提供商创建请求接口
|
|
88
|
+
*
|
|
89
|
+
* 用于添加或配置 AI 服务提供商(如 OpenAI、Claude 等)
|
|
90
|
+
*
|
|
91
|
+
* @property id - 提供商唯一标识符(可选,不提供时自动生成)
|
|
92
|
+
* @property name - 提供商显示名称
|
|
93
|
+
* @property apiKey - API 密钥
|
|
94
|
+
* @property baseUrl - 自定义 API 基础URL(可选)
|
|
95
|
+
* @property enabled - 是否启用该提供商(可选)
|
|
96
|
+
*/
|
|
97
|
+
export interface ProviderCreateRequest {
|
|
98
|
+
id?: string;
|
|
99
|
+
name: string;
|
|
100
|
+
apiKey: string;
|
|
101
|
+
baseUrl?: string;
|
|
102
|
+
enabled?: boolean;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* 技能信息接口
|
|
106
|
+
*
|
|
107
|
+
* 用于描述 AI 技能的信息
|
|
108
|
+
*
|
|
109
|
+
* @property id - 技能唯一标识符
|
|
110
|
+
* @property name - 技能显示名称
|
|
111
|
+
* @property description - 技能描述
|
|
112
|
+
* @property enabled - 是否启用该技能(可选)
|
|
113
|
+
* @property category - 技能分类(可选)
|
|
114
|
+
*/
|
|
115
|
+
export interface SkillInfo {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
description: string;
|
|
119
|
+
enabled?: boolean;
|
|
120
|
+
category?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 会话信息接口
|
|
124
|
+
*
|
|
125
|
+
* 用于描述聊天会话的信息
|
|
126
|
+
*
|
|
127
|
+
* @property id - 会话唯一标识符
|
|
128
|
+
* @property title - 会话标题
|
|
129
|
+
* @property projectPath - 关联的项目路径(可选)
|
|
130
|
+
* @property createdAt - 创建时间戳
|
|
131
|
+
* @property updatedAt - 最后更新时间戳
|
|
132
|
+
* @property messageCount - 消息数量(可选)
|
|
133
|
+
*/
|
|
134
|
+
export interface SessionInfo {
|
|
135
|
+
id: string;
|
|
136
|
+
title: string;
|
|
137
|
+
projectPath?: string;
|
|
138
|
+
createdAt: number;
|
|
139
|
+
updatedAt: number;
|
|
140
|
+
messageCount?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* 消息信息接口
|
|
144
|
+
*
|
|
145
|
+
* 用于描述聊天消息的信息
|
|
146
|
+
*
|
|
147
|
+
* @property id - 消息唯一标识符
|
|
148
|
+
* @property sessionId - 所属会话ID
|
|
149
|
+
* @property role - 消息角色(user 或 assistant)
|
|
150
|
+
* @property content - 消息内容
|
|
151
|
+
* @property timestamp - 消息时间戳
|
|
152
|
+
* @property toolCalls - 工具调用结果数组(可选)
|
|
153
|
+
*/
|
|
154
|
+
export interface MessageInfo {
|
|
155
|
+
id: string;
|
|
156
|
+
sessionId: string;
|
|
157
|
+
role: 'user' | 'assistant';
|
|
158
|
+
content: string;
|
|
159
|
+
timestamp: number;
|
|
160
|
+
toolCalls?: ToolCallResult[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* 错误响应接口
|
|
164
|
+
*
|
|
165
|
+
* 用于统一的错误响应格式
|
|
166
|
+
*
|
|
167
|
+
* @property code - 错误代码
|
|
168
|
+
* @property message - 错误消息
|
|
169
|
+
* @property details - 错误详情(可选)
|
|
170
|
+
*/
|
|
171
|
+
export interface ErrorResponse {
|
|
172
|
+
code: string;
|
|
173
|
+
message: string;
|
|
174
|
+
details?: any;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* 分页参数接口
|
|
178
|
+
*
|
|
179
|
+
* 用于支持分页查询的请求参数
|
|
180
|
+
*
|
|
181
|
+
* @property page - 页码(从1开始)
|
|
182
|
+
* @property pageSize - 每页数量
|
|
183
|
+
* @property sortBy - 排序字段(可选)
|
|
184
|
+
* @property sortOrder - 排序顺序(asc 或 desc,可选)
|
|
185
|
+
*/
|
|
186
|
+
export interface PaginationParams {
|
|
187
|
+
page: number;
|
|
188
|
+
pageSize: number;
|
|
189
|
+
sortBy?: string;
|
|
190
|
+
sortOrder?: 'asc' | 'desc';
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* 分页响应接口
|
|
194
|
+
*
|
|
195
|
+
* 用于支持分页查询的响应格式
|
|
196
|
+
*
|
|
197
|
+
* @template T - 数据项的类型
|
|
198
|
+
*
|
|
199
|
+
* @property items - 当前页的数据项数组
|
|
200
|
+
* @property total - 总数据项数量
|
|
201
|
+
* @property page - 当前页码
|
|
202
|
+
* @property pageSize - 每页数量
|
|
203
|
+
* @property totalPages - 总页数
|
|
204
|
+
*/
|
|
205
|
+
export interface PaginatedResponse<T> {
|
|
206
|
+
items: T[];
|
|
207
|
+
total: number;
|
|
208
|
+
page: number;
|
|
209
|
+
pageSize: number;
|
|
210
|
+
totalPages: number;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* 模型信息接口
|
|
214
|
+
*
|
|
215
|
+
* 用于描述 AI 模型的信息
|
|
216
|
+
*
|
|
217
|
+
* @property id - 模型唯一标识符
|
|
218
|
+
* @property providerId - 所属提供商ID
|
|
219
|
+
* @property name - 模型显示名称
|
|
220
|
+
* @property enabled - 是否启用该模型(可选)
|
|
221
|
+
* @property contextLength - 上下文长度(可选)
|
|
222
|
+
* @property maxTokens - 最大输出token数(可选)
|
|
223
|
+
*/
|
|
224
|
+
export interface ModelInfo {
|
|
225
|
+
id: string;
|
|
226
|
+
providerId: string;
|
|
227
|
+
name: string;
|
|
228
|
+
enabled?: boolean;
|
|
229
|
+
contextLength?: number;
|
|
230
|
+
maxTokens?: number;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* 模型创建请求接口
|
|
234
|
+
*
|
|
235
|
+
* 用于添加新的 AI 模型
|
|
236
|
+
*
|
|
237
|
+
* @property id - 模型唯一标识符(可选,不提供时自动生成)
|
|
238
|
+
* @property providerId - 所属提供商ID
|
|
239
|
+
* @property name - 模型显示名称
|
|
240
|
+
* @property enabled - 是否启用该模型(可选)
|
|
241
|
+
* @property contextLength - 上下文长度(可选)
|
|
242
|
+
* @property maxTokens - 最大输出token数(可选)
|
|
243
|
+
*/
|
|
244
|
+
export interface ModelCreateRequest {
|
|
245
|
+
id?: string;
|
|
246
|
+
providerId: string;
|
|
247
|
+
name: string;
|
|
248
|
+
enabled?: boolean;
|
|
249
|
+
contextLength?: number;
|
|
250
|
+
maxTokens?: number;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* 提供商信息接口
|
|
254
|
+
*
|
|
255
|
+
* 用于描述 AI 提供商的信息
|
|
256
|
+
*
|
|
257
|
+
* @property id - 提供商唯一标识符
|
|
258
|
+
* @property name - 提供商显示名称
|
|
259
|
+
* @property baseUrl - API 基础URL
|
|
260
|
+
* @property enabled - 是否启用该提供商
|
|
261
|
+
* @property isDefault - 是否为默认提供商
|
|
262
|
+
*/
|
|
263
|
+
export interface ProviderInfo {
|
|
264
|
+
id: string;
|
|
265
|
+
name: string;
|
|
266
|
+
baseUrl: string;
|
|
267
|
+
enabled: boolean;
|
|
268
|
+
isDefault: boolean;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* 配置项接口
|
|
272
|
+
*
|
|
273
|
+
* 用于描述配置项的信息
|
|
274
|
+
*
|
|
275
|
+
* @property key - 配置项键名
|
|
276
|
+
* @property value - 配置项值
|
|
277
|
+
* @property description - 配置项描述(可选)
|
|
278
|
+
* @property type - 配置项类型(string、number、boolean、object、array,可选)
|
|
279
|
+
*/
|
|
280
|
+
export interface ConfigItem {
|
|
281
|
+
key: string;
|
|
282
|
+
value: any;
|
|
283
|
+
description?: string;
|
|
284
|
+
type?: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* 搜索请求接口
|
|
288
|
+
*
|
|
289
|
+
* 用于搜索会话、技能等资源的请求参数
|
|
290
|
+
*
|
|
291
|
+
* @property query - 搜索关键词
|
|
292
|
+
* @property limit - 返回结果数量限制(可选)
|
|
293
|
+
* @property offset - 结果偏移量(可选)
|
|
294
|
+
*/
|
|
295
|
+
export interface SearchRequest {
|
|
296
|
+
query: string;
|
|
297
|
+
limit?: number;
|
|
298
|
+
offset?: number;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* 流式聊天响应接口
|
|
302
|
+
*
|
|
303
|
+
* 用于流式聊天响应的数据结构
|
|
304
|
+
*
|
|
305
|
+
* @property chunk - 当前数据块
|
|
306
|
+
* @property done - 是否完成
|
|
307
|
+
* @property sessionId - 会话ID
|
|
308
|
+
* @property toolCalls - 工具调用结果数组(可选)
|
|
309
|
+
*/
|
|
310
|
+
export interface StreamChatResponse {
|
|
311
|
+
chunk: string;
|
|
312
|
+
done: boolean;
|
|
313
|
+
sessionId: string;
|
|
314
|
+
toolCalls?: ToolCallResult[];
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* 工具信息接口
|
|
318
|
+
*
|
|
319
|
+
* 用于描述工具的信息
|
|
320
|
+
*
|
|
321
|
+
* @property name - 工具名称
|
|
322
|
+
* @property description - 工具描述
|
|
323
|
+
* @property parameters - 工具参数定义
|
|
324
|
+
* @property required - 必需参数列表(可选)
|
|
325
|
+
*/
|
|
326
|
+
export interface ToolInfo {
|
|
327
|
+
name: string;
|
|
328
|
+
description: string;
|
|
329
|
+
parameters: Record<string, any>;
|
|
330
|
+
required?: string[];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* 技能详情接口
|
|
334
|
+
*
|
|
335
|
+
* 用于描述技能的详细信息
|
|
336
|
+
*
|
|
337
|
+
* @property name - 技能名称
|
|
338
|
+
* @property description - 技能描述
|
|
339
|
+
* @property tools - 技能包含的工具列表
|
|
340
|
+
* @property instructions - 技能使用说明(可选)
|
|
341
|
+
* @property examples - 使用示例(可选)
|
|
342
|
+
*/
|
|
343
|
+
export interface SkillDetail {
|
|
344
|
+
name: string;
|
|
345
|
+
description: string;
|
|
346
|
+
tools: ToolInfo[];
|
|
347
|
+
instructions?: string;
|
|
348
|
+
examples?: string[];
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=api.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../../src/api/api.types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.types.js","sourceRoot":"","sources":["../../src/api/api.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 聊天 API 路由模块
|
|
3
|
+
*
|
|
4
|
+
* 本模块提供聊天相关的 RESTful API 接口
|
|
5
|
+
*
|
|
6
|
+
* 路由列表:
|
|
7
|
+
* - POST /api/chat -> 发送聊天消息 (非流式)
|
|
8
|
+
* - POST /api/chat/stream -> 发送聊天消息 (流式响应)
|
|
9
|
+
* - GET /api/chat/history/:sessionId -> 获取会话历史消息
|
|
10
|
+
*
|
|
11
|
+
* 请求示例:
|
|
12
|
+
* POST /api/chat
|
|
13
|
+
* {
|
|
14
|
+
* "message": "帮我读取 src/index.ts 文件",
|
|
15
|
+
* "sessionId": "optional-session-id",
|
|
16
|
+
* "projectPath": "optional-project-path"
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* 创建聊天路由 Router
|
|
21
|
+
*
|
|
22
|
+
* Express Router 用于组织相关的路由和中间件
|
|
23
|
+
* 所有以 /chat 开头的请求都会路由到这里
|
|
24
|
+
*/
|
|
25
|
+
export declare const chatRouter: import("express-serve-static-core").Router;
|
|
26
|
+
//# sourceMappingURL=chat.routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.routes.d.ts","sourceRoot":"","sources":["../../src/api/chat.routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAUH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,4CAAW,CAAC"}
|