@vectorx/agent-simulator 1.0.1 → 1.1.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.
Files changed (311) hide show
  1. package/lib/app.d.ts +1 -1
  2. package/lib/app.js +4 -4
  3. package/lib/config/api.config.d.ts +0 -1
  4. package/lib/config/api.config.js +3 -2
  5. package/lib/config/app.config.d.ts +2 -1
  6. package/lib/config/app.config.js +0 -1
  7. package/lib/config/upload.config.d.ts +0 -1
  8. package/lib/config/upload.config.js +0 -1
  9. package/lib/container/container.d.ts +0 -1
  10. package/lib/container/container.js +4 -2
  11. package/lib/container/identifiers.d.ts +0 -1
  12. package/lib/container/identifiers.js +0 -1
  13. package/lib/container/index.d.ts +0 -1
  14. package/lib/container/index.js +0 -1
  15. package/lib/container/types.d.ts +9 -1
  16. package/lib/container/types.js +0 -1
  17. package/lib/controllers/agent.controller.d.ts +6 -3
  18. package/lib/controllers/agent.controller.js +17 -3
  19. package/lib/controllers/auth.controller.d.ts +4 -5
  20. package/lib/controllers/auth.controller.js +3 -4
  21. package/lib/controllers/simulator.controller.d.ts +2 -3
  22. package/lib/controllers/simulator.controller.js +1 -2
  23. package/lib/controllers/upload.controller.d.ts +1 -2
  24. package/lib/controllers/upload.controller.js +5 -2
  25. package/lib/index.d.ts +1 -2
  26. package/lib/index.js +0 -1
  27. package/lib/middleware/cors.middleware.d.ts +0 -1
  28. package/lib/middleware/cors.middleware.js +0 -1
  29. package/lib/middleware/error.middleware.d.ts +3 -4
  30. package/lib/middleware/error.middleware.js +2 -3
  31. package/lib/middleware/proxy.middleware.d.ts +1 -2
  32. package/lib/middleware/proxy.middleware.js +0 -1
  33. package/lib/middleware/upload.middleware.d.ts +0 -1
  34. package/lib/middleware/upload.middleware.js +0 -1
  35. package/lib/routes/agent.d.ts +0 -1
  36. package/lib/routes/agent.js +2 -1
  37. package/lib/routes/auth.d.ts +0 -1
  38. package/lib/routes/auth.js +0 -1
  39. package/lib/routes/index.d.ts +0 -1
  40. package/lib/routes/index.js +0 -1
  41. package/lib/routes/simulator.d.ts +0 -1
  42. package/lib/routes/simulator.js +0 -1
  43. package/lib/routes/upload.d.ts +0 -1
  44. package/lib/routes/upload.js +0 -1
  45. package/lib/services/agent.service.d.ts +15 -2
  46. package/lib/services/agent.service.js +34 -8
  47. package/lib/services/auth.service.d.ts +1 -2
  48. package/lib/services/auth.service.js +5 -6
  49. package/lib/services/simulator.service.d.ts +0 -1
  50. package/lib/services/simulator.service.js +0 -1
  51. package/lib/services/upload.service.d.ts +0 -1
  52. package/lib/services/upload.service.js +0 -1
  53. package/lib/simulator.d.ts +11 -1
  54. package/lib/simulator.js +90 -6
  55. package/lib/utils/env-helper.d.ts +0 -1
  56. package/lib/utils/env-helper.js +0 -1
  57. package/lib/utils/logger.d.ts +0 -1
  58. package/lib/utils/logger.js +0 -1
  59. package/lib/utils/request.d.ts +0 -1
  60. package/lib/utils/request.js +6 -2
  61. package/lib/utils/url-parser.d.ts +0 -1
  62. package/lib/utils/url-parser.js +1 -2
  63. package/lib/utils.d.ts +0 -1
  64. package/lib/utils.js +0 -1
  65. package/lib/webview-ui/Agent.d.ts +0 -1
  66. package/lib/webview-ui/Agent.js +0 -1
  67. package/lib/webview-ui/App.d.ts +0 -1
  68. package/lib/webview-ui/App.js +176 -34
  69. package/lib/webview-ui/ErrorBoundary.d.ts +0 -1
  70. package/lib/webview-ui/ErrorBoundary.js +0 -1
  71. package/lib/webview-ui/components/AsyncTaskBlock.d.ts +1 -2
  72. package/lib/webview-ui/components/AsyncTaskBlock.js +16 -5
  73. package/lib/webview-ui/components/AuthIndicator.d.ts +1 -2
  74. package/lib/webview-ui/components/AuthIndicator.js +0 -1
  75. package/lib/webview-ui/components/ErrorCard.d.ts +1 -2
  76. package/lib/webview-ui/components/ErrorCard.js +7 -5
  77. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.d.ts +1 -2
  78. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.js +4 -3
  79. package/lib/webview-ui/components/KnowledgeBaseSearchResult.d.ts +1 -2
  80. package/lib/webview-ui/components/KnowledgeBaseSearchResult.js +1 -2
  81. package/lib/webview-ui/components/MarkdownRenderer.d.ts +1 -2
  82. package/lib/webview-ui/components/MarkdownRenderer.js +3 -8
  83. package/lib/webview-ui/components/MessageRenderer.d.ts +1 -2
  84. package/lib/webview-ui/components/MessageRenderer.js +48 -5
  85. package/lib/webview-ui/components/MultimodalFileRenderer.d.ts +2 -2
  86. package/lib/webview-ui/components/MultimodalFileRenderer.js +97 -40
  87. package/lib/webview-ui/components/ThinkingBlock.d.ts +2 -3
  88. package/lib/webview-ui/components/ThinkingBlock.js +0 -1
  89. package/lib/webview-ui/components/ToolUseBlock.d.ts +1 -2
  90. package/lib/webview-ui/components/ToolUseBlock.js +1 -2
  91. package/lib/webview-ui/components/ToolUseBlockHeader.d.ts +1 -2
  92. package/lib/webview-ui/components/ToolUseBlockHeader.js +1 -2
  93. package/lib/webview-ui/components/UploadPreview.d.ts +1 -2
  94. package/lib/webview-ui/components/UploadPreview.js +0 -1
  95. package/lib/webview-ui/components/WelcomeModule.d.ts +0 -1
  96. package/lib/webview-ui/components/WelcomeModule.js +46 -16
  97. package/lib/webview-ui/components/index.d.ts +0 -1
  98. package/lib/webview-ui/components/index.js +0 -1
  99. package/lib/webview-ui/config/cos-config.d.ts +0 -1
  100. package/lib/webview-ui/config/cos-config.js +0 -1
  101. package/lib/webview-ui/config/http-config.d.ts +0 -1
  102. package/lib/webview-ui/config/http-config.js +0 -1
  103. package/lib/webview-ui/constants.d.ts +0 -1
  104. package/lib/webview-ui/constants.js +0 -1
  105. package/lib/webview-ui/contexts/AgentContext.d.ts +1 -2
  106. package/lib/webview-ui/contexts/AgentContext.js +0 -1
  107. package/lib/webview-ui/contexts/AuthContext.d.ts +2 -2
  108. package/lib/webview-ui/contexts/AuthContext.js +0 -1
  109. package/lib/webview-ui/contexts/ThemeContext.d.ts +2 -2
  110. package/lib/webview-ui/contexts/ThemeContext.js +0 -1
  111. package/lib/webview-ui/hooks/useAgentStatus.d.ts +4 -2
  112. package/lib/webview-ui/hooks/useAgentStatus.js +31 -5
  113. package/lib/webview-ui/hooks/useUploader.d.ts +0 -1
  114. package/lib/webview-ui/hooks/useUploader.js +5 -2
  115. package/lib/webview-ui/hooks/useUserAvatar.d.ts +0 -1
  116. package/lib/webview-ui/hooks/useUserAvatar.js +0 -1
  117. package/lib/webview-ui/index.d.ts +1 -1
  118. package/lib/webview-ui/index.js +1 -1
  119. package/lib/webview-ui/services/agent-service.d.ts +14 -1
  120. package/lib/webview-ui/services/agent-service.js +7 -1
  121. package/lib/webview-ui/services/index.d.ts +0 -1
  122. package/lib/webview-ui/services/index.js +0 -1
  123. package/lib/webview-ui/services/logger-service.d.ts +0 -1
  124. package/lib/webview-ui/services/logger-service.js +0 -1
  125. package/lib/webview-ui/styles/copilot.d.ts +0 -1
  126. package/lib/webview-ui/styles/copilot.js +80 -22
  127. package/lib/webview-ui/styles/workarea.d.ts +0 -1
  128. package/lib/webview-ui/styles/workarea.js +7 -2
  129. package/lib/webview-ui/types.d.ts +11 -2
  130. package/lib/webview-ui/types.js +0 -1
  131. package/lib/webview-ui/utils/cos.d.ts +0 -1
  132. package/lib/webview-ui/utils/cos.js +4 -3
  133. package/lib/webview-ui/utils/env-helper.d.ts +6 -1
  134. package/lib/webview-ui/utils/env-helper.js +16 -2
  135. package/lib/webview-ui/utils/http-client.d.ts +1 -2
  136. package/lib/webview-ui/utils/http-client.js +0 -1
  137. package/lib/webview-ui/utils/markdownHighlight.d.ts +3 -0
  138. package/lib/webview-ui/utils/markdownHighlight.js +75 -0
  139. package/lib/webview-ui/utils/stream-text-handler.d.ts +0 -1
  140. package/lib/webview-ui/utils/stream-text-handler.js +6 -3
  141. package/lib/webview-ui/utils/upload.d.ts +0 -1
  142. package/lib/webview-ui/utils/upload.js +5 -2
  143. package/lib/webview-ui/widgets/BubbleComponents.d.ts +1 -2
  144. package/lib/webview-ui/widgets/BubbleComponents.js +1 -2
  145. package/lib/webview-ui/widgets/ChatInput.d.ts +1 -2
  146. package/lib/webview-ui/widgets/ChatInput.js +63 -90
  147. package/lib/webview-ui/widgets/LogPanel.d.ts +2 -3
  148. package/lib/webview-ui/widgets/LogPanel.js +5 -2
  149. package/lib/webview-ui/widgets/SystemLogs.d.ts +1 -2
  150. package/lib/webview-ui/widgets/SystemLogs.js +26 -9
  151. package/lib/webview-ui/widgets/ToolBar.d.ts +4 -3
  152. package/lib/webview-ui/widgets/ToolBar.js +6 -4
  153. package/lib/webview-ui/widgets/WebSocketDebugger.d.ts +6 -0
  154. package/lib/webview-ui/widgets/WebSocketDebugger.js +226 -0
  155. package/lib/webview-ui/widgets/index.d.ts +0 -1
  156. package/lib/webview-ui/widgets/index.js +0 -1
  157. package/package.json +9 -7
  158. package/public/assets/main.js +193 -166
  159. package/public/assets/style.css +1 -1
  160. package/lib/app.d.ts.map +0 -1
  161. package/lib/app.js.map +0 -1
  162. package/lib/config/api.config.d.ts.map +0 -1
  163. package/lib/config/api.config.js.map +0 -1
  164. package/lib/config/app.config.d.ts.map +0 -1
  165. package/lib/config/app.config.js.map +0 -1
  166. package/lib/config/upload.config.d.ts.map +0 -1
  167. package/lib/config/upload.config.js.map +0 -1
  168. package/lib/container/container.d.ts.map +0 -1
  169. package/lib/container/container.js.map +0 -1
  170. package/lib/container/identifiers.d.ts.map +0 -1
  171. package/lib/container/identifiers.js.map +0 -1
  172. package/lib/container/index.d.ts.map +0 -1
  173. package/lib/container/index.js.map +0 -1
  174. package/lib/container/types.d.ts.map +0 -1
  175. package/lib/container/types.js.map +0 -1
  176. package/lib/controllers/agent.controller.d.ts.map +0 -1
  177. package/lib/controllers/agent.controller.js.map +0 -1
  178. package/lib/controllers/auth.controller.d.ts.map +0 -1
  179. package/lib/controllers/auth.controller.js.map +0 -1
  180. package/lib/controllers/simulator.controller.d.ts.map +0 -1
  181. package/lib/controllers/simulator.controller.js.map +0 -1
  182. package/lib/controllers/upload.controller.d.ts.map +0 -1
  183. package/lib/controllers/upload.controller.js.map +0 -1
  184. package/lib/index.d.ts.map +0 -1
  185. package/lib/index.js.map +0 -1
  186. package/lib/middleware/cors.middleware.d.ts.map +0 -1
  187. package/lib/middleware/cors.middleware.js.map +0 -1
  188. package/lib/middleware/error.middleware.d.ts.map +0 -1
  189. package/lib/middleware/error.middleware.js.map +0 -1
  190. package/lib/middleware/proxy.middleware.d.ts.map +0 -1
  191. package/lib/middleware/proxy.middleware.js.map +0 -1
  192. package/lib/middleware/upload.middleware.d.ts.map +0 -1
  193. package/lib/middleware/upload.middleware.js.map +0 -1
  194. package/lib/routes/agent.d.ts.map +0 -1
  195. package/lib/routes/agent.js.map +0 -1
  196. package/lib/routes/auth.d.ts.map +0 -1
  197. package/lib/routes/auth.js.map +0 -1
  198. package/lib/routes/index.d.ts.map +0 -1
  199. package/lib/routes/index.js.map +0 -1
  200. package/lib/routes/simulator.d.ts.map +0 -1
  201. package/lib/routes/simulator.js.map +0 -1
  202. package/lib/routes/upload.d.ts.map +0 -1
  203. package/lib/routes/upload.js.map +0 -1
  204. package/lib/services/agent.service.d.ts.map +0 -1
  205. package/lib/services/agent.service.js.map +0 -1
  206. package/lib/services/auth.service.d.ts.map +0 -1
  207. package/lib/services/auth.service.js.map +0 -1
  208. package/lib/services/simulator.service.d.ts.map +0 -1
  209. package/lib/services/simulator.service.js.map +0 -1
  210. package/lib/services/upload.service.d.ts.map +0 -1
  211. package/lib/services/upload.service.js.map +0 -1
  212. package/lib/simulator.d.ts.map +0 -1
  213. package/lib/simulator.js.map +0 -1
  214. package/lib/utils/env-helper.d.ts.map +0 -1
  215. package/lib/utils/env-helper.js.map +0 -1
  216. package/lib/utils/logger.d.ts.map +0 -1
  217. package/lib/utils/logger.js.map +0 -1
  218. package/lib/utils/request.d.ts.map +0 -1
  219. package/lib/utils/request.js.map +0 -1
  220. package/lib/utils/url-parser.d.ts.map +0 -1
  221. package/lib/utils/url-parser.js.map +0 -1
  222. package/lib/utils.d.ts.map +0 -1
  223. package/lib/utils.js.map +0 -1
  224. package/lib/webview-ui/Agent.d.ts.map +0 -1
  225. package/lib/webview-ui/Agent.js.map +0 -1
  226. package/lib/webview-ui/App.d.ts.map +0 -1
  227. package/lib/webview-ui/App.js.map +0 -1
  228. package/lib/webview-ui/ErrorBoundary.d.ts.map +0 -1
  229. package/lib/webview-ui/ErrorBoundary.js.map +0 -1
  230. package/lib/webview-ui/components/AsyncTaskBlock.d.ts.map +0 -1
  231. package/lib/webview-ui/components/AsyncTaskBlock.js.map +0 -1
  232. package/lib/webview-ui/components/AuthIndicator.d.ts.map +0 -1
  233. package/lib/webview-ui/components/AuthIndicator.js.map +0 -1
  234. package/lib/webview-ui/components/ErrorCard.d.ts.map +0 -1
  235. package/lib/webview-ui/components/ErrorCard.js.map +0 -1
  236. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.d.ts.map +0 -1
  237. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.js.map +0 -1
  238. package/lib/webview-ui/components/KnowledgeBaseSearchResult.d.ts.map +0 -1
  239. package/lib/webview-ui/components/KnowledgeBaseSearchResult.js.map +0 -1
  240. package/lib/webview-ui/components/MarkdownRenderer.d.ts.map +0 -1
  241. package/lib/webview-ui/components/MarkdownRenderer.js.map +0 -1
  242. package/lib/webview-ui/components/MessageRenderer.d.ts.map +0 -1
  243. package/lib/webview-ui/components/MessageRenderer.js.map +0 -1
  244. package/lib/webview-ui/components/MultimodalFileRenderer.d.ts.map +0 -1
  245. package/lib/webview-ui/components/MultimodalFileRenderer.js.map +0 -1
  246. package/lib/webview-ui/components/ThinkingBlock.d.ts.map +0 -1
  247. package/lib/webview-ui/components/ThinkingBlock.js.map +0 -1
  248. package/lib/webview-ui/components/ToolUseBlock.d.ts.map +0 -1
  249. package/lib/webview-ui/components/ToolUseBlock.js.map +0 -1
  250. package/lib/webview-ui/components/ToolUseBlockHeader.d.ts.map +0 -1
  251. package/lib/webview-ui/components/ToolUseBlockHeader.js.map +0 -1
  252. package/lib/webview-ui/components/UploadPreview.d.ts.map +0 -1
  253. package/lib/webview-ui/components/UploadPreview.js.map +0 -1
  254. package/lib/webview-ui/components/WelcomeModule.d.ts.map +0 -1
  255. package/lib/webview-ui/components/WelcomeModule.js.map +0 -1
  256. package/lib/webview-ui/components/index.d.ts.map +0 -1
  257. package/lib/webview-ui/components/index.js.map +0 -1
  258. package/lib/webview-ui/config/cos-config.d.ts.map +0 -1
  259. package/lib/webview-ui/config/cos-config.js.map +0 -1
  260. package/lib/webview-ui/config/http-config.d.ts.map +0 -1
  261. package/lib/webview-ui/config/http-config.js.map +0 -1
  262. package/lib/webview-ui/constants.d.ts.map +0 -1
  263. package/lib/webview-ui/constants.js.map +0 -1
  264. package/lib/webview-ui/contexts/AgentContext.d.ts.map +0 -1
  265. package/lib/webview-ui/contexts/AgentContext.js.map +0 -1
  266. package/lib/webview-ui/contexts/AuthContext.d.ts.map +0 -1
  267. package/lib/webview-ui/contexts/AuthContext.js.map +0 -1
  268. package/lib/webview-ui/contexts/ThemeContext.d.ts.map +0 -1
  269. package/lib/webview-ui/contexts/ThemeContext.js.map +0 -1
  270. package/lib/webview-ui/hooks/useAgentStatus.d.ts.map +0 -1
  271. package/lib/webview-ui/hooks/useAgentStatus.js.map +0 -1
  272. package/lib/webview-ui/hooks/useUploader.d.ts.map +0 -1
  273. package/lib/webview-ui/hooks/useUploader.js.map +0 -1
  274. package/lib/webview-ui/hooks/useUserAvatar.d.ts.map +0 -1
  275. package/lib/webview-ui/hooks/useUserAvatar.js.map +0 -1
  276. package/lib/webview-ui/index.d.ts.map +0 -1
  277. package/lib/webview-ui/index.js.map +0 -1
  278. package/lib/webview-ui/services/agent-service.d.ts.map +0 -1
  279. package/lib/webview-ui/services/agent-service.js.map +0 -1
  280. package/lib/webview-ui/services/index.d.ts.map +0 -1
  281. package/lib/webview-ui/services/index.js.map +0 -1
  282. package/lib/webview-ui/services/logger-service.d.ts.map +0 -1
  283. package/lib/webview-ui/services/logger-service.js.map +0 -1
  284. package/lib/webview-ui/styles/copilot.d.ts.map +0 -1
  285. package/lib/webview-ui/styles/copilot.js.map +0 -1
  286. package/lib/webview-ui/styles/workarea.d.ts.map +0 -1
  287. package/lib/webview-ui/styles/workarea.js.map +0 -1
  288. package/lib/webview-ui/types.d.ts.map +0 -1
  289. package/lib/webview-ui/types.js.map +0 -1
  290. package/lib/webview-ui/utils/cos.d.ts.map +0 -1
  291. package/lib/webview-ui/utils/cos.js.map +0 -1
  292. package/lib/webview-ui/utils/env-helper.d.ts.map +0 -1
  293. package/lib/webview-ui/utils/env-helper.js.map +0 -1
  294. package/lib/webview-ui/utils/http-client.d.ts.map +0 -1
  295. package/lib/webview-ui/utils/http-client.js.map +0 -1
  296. package/lib/webview-ui/utils/stream-text-handler.d.ts.map +0 -1
  297. package/lib/webview-ui/utils/stream-text-handler.js.map +0 -1
  298. package/lib/webview-ui/utils/upload.d.ts.map +0 -1
  299. package/lib/webview-ui/utils/upload.js.map +0 -1
  300. package/lib/webview-ui/widgets/BubbleComponents.d.ts.map +0 -1
  301. package/lib/webview-ui/widgets/BubbleComponents.js.map +0 -1
  302. package/lib/webview-ui/widgets/ChatInput.d.ts.map +0 -1
  303. package/lib/webview-ui/widgets/ChatInput.js.map +0 -1
  304. package/lib/webview-ui/widgets/LogPanel.d.ts.map +0 -1
  305. package/lib/webview-ui/widgets/LogPanel.js.map +0 -1
  306. package/lib/webview-ui/widgets/SystemLogs.d.ts.map +0 -1
  307. package/lib/webview-ui/widgets/SystemLogs.js.map +0 -1
  308. package/lib/webview-ui/widgets/ToolBar.d.ts.map +0 -1
  309. package/lib/webview-ui/widgets/ToolBar.js.map +0 -1
  310. package/lib/webview-ui/widgets/index.d.ts.map +0 -1
  311. package/lib/webview-ui/widgets/index.js.map +0 -1
package/lib/app.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare class App {
10
10
  port: number;
11
11
  agentServerUrl: string;
12
12
  open?: boolean;
13
+ agentId?: string;
13
14
  });
14
15
  /**
15
16
  * 设置中间件
@@ -40,4 +41,3 @@ export declare class App {
40
41
  */
41
42
  getConfig(): import("./config/app.config").AppConfig;
42
43
  }
43
- //# sourceMappingURL=app.d.ts.map
package/lib/app.js CHANGED
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.App = void 0;
7
7
  require("reflect-metadata");
8
- const path_1 = __importDefault(require("path"));
8
+ const node_path_1 = __importDefault(require("node:path"));
9
9
  const express_1 = __importDefault(require("express"));
10
10
  const app_config_1 = require("./config/app.config");
11
11
  const container_1 = require("./container/container");
@@ -21,6 +21,7 @@ class App {
21
21
  config,
22
22
  agentServerUrl: options.agentServerUrl,
23
23
  parsedServerUrl,
24
+ agentId: options.agentId,
24
25
  };
25
26
  // 初始化 Inversify 依赖注入容器
26
27
  this.container = (0, container_1.initializeContainer)(this.context);
@@ -41,7 +42,7 @@ class App {
41
42
  // 注意:文件上传使用 multer 中间件处理,不需要在这里配置大的 limit
42
43
  // multer 会在特定路由上处理 multipart/form-data 请求
43
44
  // 静态文件服务
44
- const publicPath = path_1.default.resolve(__dirname, "../public");
45
+ const publicPath = node_path_1.default.resolve(__dirname, "../public");
45
46
  this.app.use(express_1.default.static(publicPath));
46
47
  }
47
48
  /**
@@ -58,7 +59,7 @@ class App {
58
59
  return next();
59
60
  }
60
61
  // 返回React应用的index.html
61
- res.sendFile(path_1.default.resolve(__dirname, "../public/index.html"));
62
+ res.sendFile(node_path_1.default.resolve(__dirname, "../public/index.html"));
62
63
  });
63
64
  }
64
65
  /**
@@ -96,4 +97,3 @@ class App {
96
97
  }
97
98
  }
98
99
  exports.App = App;
99
- //# sourceMappingURL=app.js.map
@@ -1,2 +1 @@
1
1
  export declare function getBaseUrl(): string;
2
- //# sourceMappingURL=api.config.d.ts.map
@@ -8,6 +8,7 @@ const apiUrls = {
8
8
  };
9
9
  const env = process.env.AGENT_BUILD_ENV || "production";
10
10
  function getBaseUrl() {
11
- return apiUrls[env in apiUrls ? env : "development"];
11
+ return apiUrls[env in apiUrls
12
+ ? env
13
+ : "development"];
12
14
  }
13
- //# sourceMappingURL=api.config.js.map
@@ -13,10 +13,11 @@ export interface AppContext {
13
13
  config: AppConfig;
14
14
  agentServerUrl: string;
15
15
  parsedServerUrl: ReturnType<typeof import("../utils/url-parser").parseAgentServerUrl>;
16
+ /** Agent ID(来自 project.config.json),用于直接向 agentbase 查询 Agent 信息 */
17
+ agentId?: string;
16
18
  }
17
19
  export declare const createAppConfig: (options: {
18
20
  port: number;
19
21
  agentServerUrl: string;
20
22
  open?: boolean;
21
23
  }) => AppConfig;
22
- //# sourceMappingURL=app.config.d.ts.map
@@ -15,4 +15,3 @@ const createAppConfig = (options) => {
15
15
  };
16
16
  };
17
17
  exports.createAppConfig = createAppConfig;
18
- //# sourceMappingURL=app.config.js.map
@@ -3,4 +3,3 @@ export declare const uploadBizConfig: {
3
3
  readonly bizName: "sns";
4
4
  readonly scene: "chatbox_img";
5
5
  };
6
- //# sourceMappingURL=upload.config.d.ts.map
@@ -7,4 +7,3 @@ exports.uploadBizConfig = {
7
7
  // scene: "cloudbase_agent_simulator_files", // 未注册
8
8
  scene: "chatbox_img",
9
9
  };
10
- //# sourceMappingURL=upload.config.js.map
@@ -3,4 +3,3 @@ import type { AppContext } from "../config/app.config";
3
3
  declare const container: Container;
4
4
  export declare function initializeContainer(context: AppContext): Container;
5
5
  export { container };
6
- //# sourceMappingURL=container.d.ts.map
@@ -22,7 +22,10 @@ container.bind(identifiers_1.SERVICE_IDENTIFIERS.AuthService).to(auth_service_1.
22
22
  container.bind(identifiers_1.SERVICE_IDENTIFIERS.UploadService).to(upload_service_1.UploadService).inSingletonScope();
23
23
  // 绑定控制器
24
24
  container.bind(identifiers_1.CONTROLLER_IDENTIFIERS.AgentController).to(agent_controller_1.AgentController).inSingletonScope();
25
- container.bind(identifiers_1.CONTROLLER_IDENTIFIERS.SimulatorController).to(simulator_controller_1.SimulatorController).inSingletonScope();
25
+ container
26
+ .bind(identifiers_1.CONTROLLER_IDENTIFIERS.SimulatorController)
27
+ .to(simulator_controller_1.SimulatorController)
28
+ .inSingletonScope();
26
29
  container.bind(identifiers_1.CONTROLLER_IDENTIFIERS.AuthController).to(auth_controller_1.AuthController).inSingletonScope();
27
30
  container.bind(identifiers_1.CONTROLLER_IDENTIFIERS.UploadController).to(upload_controller_1.UploadController).inSingletonScope();
28
31
  // 初始化容器的函数
@@ -31,4 +34,3 @@ function initializeContainer(context) {
31
34
  container.bind(identifiers_1.APP_CONTEXT).toConstantValue(context);
32
35
  return container;
33
36
  }
34
- //# sourceMappingURL=container.js.map
@@ -11,4 +11,3 @@ export declare const CONTROLLER_IDENTIFIERS: {
11
11
  AuthController: symbol;
12
12
  UploadController: symbol;
13
13
  };
14
- //# sourceMappingURL=identifiers.d.ts.map
@@ -17,4 +17,3 @@ exports.CONTROLLER_IDENTIFIERS = {
17
17
  AuthController: Symbol.for("AuthController"),
18
18
  UploadController: Symbol.for("UploadController"),
19
19
  };
20
- //# sourceMappingURL=identifiers.js.map
@@ -1,4 +1,3 @@
1
1
  export * from "./container";
2
2
  export * from "./identifiers";
3
3
  export * from "./types";
4
- //# sourceMappingURL=index.d.ts.map
@@ -17,4 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./container"), exports);
18
18
  __exportStar(require("./identifiers"), exports);
19
19
  __exportStar(require("./types"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -2,6 +2,14 @@ import type { Request, Response } from "express";
2
2
  export interface IAgentService {
3
3
  getAgentInfo(): Promise<any>;
4
4
  getAgentStatus(): Promise<any>;
5
+ getFunctionMeta(): Promise<{
6
+ functions: Array<{
7
+ name: string;
8
+ features: {
9
+ websocket: boolean;
10
+ };
11
+ }>;
12
+ }>;
5
13
  uploadFile(params: {
6
14
  filename: string;
7
15
  fileContent: Buffer;
@@ -34,6 +42,7 @@ export interface IUploadController {
34
42
  export interface IAgentController {
35
43
  getAgentInfo(req: Request, res: Response): Promise<void>;
36
44
  getAgentStatus(req: Request, res: Response): Promise<void>;
45
+ getFunctionMeta(req: Request, res: Response): Promise<void>;
37
46
  uploadFile(req: Request, res: Response): Promise<void>;
38
47
  }
39
48
  export interface ISimulatorController {
@@ -45,4 +54,3 @@ export interface IAuthController {
45
54
  hasLogin(req: Request, res: Response): Promise<void>;
46
55
  checkLoginStatus(req: Request, res: Response): Promise<void>;
47
56
  }
48
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -6,14 +6,17 @@ export declare class AgentController implements IAgentController {
6
6
  /**
7
7
  * 获取Agent信息
8
8
  */
9
- getAgentInfo: (req: Request, res: Response) => Promise<void>;
9
+ getAgentInfo: (_req: Request, res: Response) => Promise<void>;
10
10
  /**
11
11
  * 获取Agent状态
12
12
  */
13
- getAgentStatus: (req: Request, res: Response) => Promise<void>;
13
+ getAgentStatus: (_req: Request, res: Response) => Promise<void>;
14
+ /**
15
+ * 获取函数能力元数据
16
+ */
17
+ getFunctionMeta: (_req: Request, res: Response) => Promise<void>;
14
18
  /**
15
19
  * 上传文件(使用 multipart/form-data,对齐 OpenAI 标准)
16
20
  */
17
21
  uploadFile: (req: Request, res: Response) => Promise<void>;
18
22
  }
19
- //# sourceMappingURL=agent.controller.d.ts.map
@@ -20,7 +20,7 @@ let AgentController = class AgentController {
20
20
  /**
21
21
  * 获取Agent信息
22
22
  */
23
- this.getAgentInfo = async (req, res) => {
23
+ this.getAgentInfo = async (_req, res) => {
24
24
  try {
25
25
  const agentInfo = await this.agentService.getAgentInfo();
26
26
  res.json(agentInfo);
@@ -35,7 +35,7 @@ let AgentController = class AgentController {
35
35
  /**
36
36
  * 获取Agent状态
37
37
  */
38
- this.getAgentStatus = async (req, res) => {
38
+ this.getAgentStatus = async (_req, res) => {
39
39
  try {
40
40
  const status = await this.agentService.getAgentStatus();
41
41
  res.json(status);
@@ -47,6 +47,21 @@ let AgentController = class AgentController {
47
47
  });
48
48
  }
49
49
  };
50
+ /**
51
+ * 获取函数能力元数据
52
+ */
53
+ this.getFunctionMeta = async (_req, res) => {
54
+ try {
55
+ const meta = await this.agentService.getFunctionMeta();
56
+ res.json(meta);
57
+ }
58
+ catch (error) {
59
+ console.error("获取函数元数据失败:", error);
60
+ res.status(500).json({
61
+ error: error instanceof Error ? error.message : `获取函数元数据失败: ${error}`,
62
+ });
63
+ }
64
+ };
50
65
  /**
51
66
  * 上传文件(使用 multipart/form-data,对齐 OpenAI 标准)
52
67
  */
@@ -99,4 +114,3 @@ exports.AgentController = AgentController = __decorate([
99
114
  __param(0, (0, inversify_1.inject)(identifiers_1.SERVICE_IDENTIFIERS.AgentService)),
100
115
  __metadata("design:paramtypes", [Object])
101
116
  ], AgentController);
102
- //# sourceMappingURL=agent.controller.js.map
@@ -1,4 +1,4 @@
1
- import { Request, Response } from "express";
1
+ import type { Request, Response } from "express";
2
2
  import type { IAuthController, IAuthService } from "../container/types";
3
3
  export declare class AuthController implements IAuthController {
4
4
  private authService;
@@ -6,18 +6,17 @@ export declare class AuthController implements IAuthController {
6
6
  /**
7
7
  * 获取认证状态
8
8
  */
9
- getAuthStatus: (req: Request, res: Response) => Promise<void>;
9
+ getAuthStatus: (_req: Request, res: Response) => Promise<void>;
10
10
  /**
11
11
  * 获取登录信息
12
12
  */
13
- getLoginInfo: (req: Request, res: Response) => Promise<void>;
13
+ getLoginInfo: (_req: Request, res: Response) => Promise<void>;
14
14
  /**
15
15
  * 检查是否已登录
16
16
  */
17
- hasLogin: (req: Request, res: Response) => Promise<void>;
17
+ hasLogin: (_req: Request, res: Response) => Promise<void>;
18
18
  /**
19
19
  * 检查登录状态(调用下游服务)
20
20
  */
21
21
  checkLoginStatus: (req: Request, res: Response) => Promise<void>;
22
22
  }
23
- //# sourceMappingURL=auth.controller.d.ts.map
@@ -20,7 +20,7 @@ let AuthController = class AuthController {
20
20
  /**
21
21
  * 获取认证状态
22
22
  */
23
- this.getAuthStatus = async (req, res) => {
23
+ this.getAuthStatus = async (_req, res) => {
24
24
  try {
25
25
  const authStatus = await this.authService.getAuthStatus();
26
26
  res.json({
@@ -40,7 +40,7 @@ let AuthController = class AuthController {
40
40
  /**
41
41
  * 获取登录信息
42
42
  */
43
- this.getLoginInfo = async (req, res) => {
43
+ this.getLoginInfo = async (_req, res) => {
44
44
  try {
45
45
  const loginInfo = await this.authService.getLoginInfo();
46
46
  if (!loginInfo) {
@@ -68,7 +68,7 @@ let AuthController = class AuthController {
68
68
  /**
69
69
  * 检查是否已登录
70
70
  */
71
- this.hasLogin = async (req, res) => {
71
+ this.hasLogin = async (_req, res) => {
72
72
  try {
73
73
  const isLoggedIn = this.authService.hasLogin();
74
74
  res.json({
@@ -129,4 +129,3 @@ exports.AuthController = AuthController = __decorate([
129
129
  __param(0, (0, inversify_1.inject)(identifiers_1.SERVICE_IDENTIFIERS.AuthService)),
130
130
  __metadata("design:paramtypes", [Object])
131
131
  ], AuthController);
132
- //# sourceMappingURL=auth.controller.js.map
@@ -1,4 +1,4 @@
1
- import { Request, Response } from "express";
1
+ import type { Request, Response } from "express";
2
2
  import type { ISimulatorController, ISimulatorService } from "../container/types";
3
3
  export declare class SimulatorController implements ISimulatorController {
4
4
  private simulatorService;
@@ -6,6 +6,5 @@ export declare class SimulatorController implements ISimulatorController {
6
6
  /**
7
7
  * 获取模拟器状态
8
8
  */
9
- getSimulatorStatus: (req: Request, res: Response) => void;
9
+ getSimulatorStatus: (_req: Request, res: Response) => void;
10
10
  }
11
- //# sourceMappingURL=simulator.controller.d.ts.map
@@ -20,7 +20,7 @@ let SimulatorController = class SimulatorController {
20
20
  /**
21
21
  * 获取模拟器状态
22
22
  */
23
- this.getSimulatorStatus = (req, res) => {
23
+ this.getSimulatorStatus = (_req, res) => {
24
24
  try {
25
25
  const status = this.simulatorService.getSimulatorStatus();
26
26
  res.json(status);
@@ -41,4 +41,3 @@ exports.SimulatorController = SimulatorController = __decorate([
41
41
  __param(0, (0, inversify_1.inject)(identifiers_1.SERVICE_IDENTIFIERS.SimulatorService)),
42
42
  __metadata("design:paramtypes", [Object])
43
43
  ], SimulatorController);
44
- //# sourceMappingURL=simulator.controller.js.map
@@ -1,8 +1,7 @@
1
- import { Request, Response } from "express";
1
+ import type { Request, Response } from "express";
2
2
  import type { IUploadController, IUploadService } from "../container/types";
3
3
  export declare class UploadController implements IUploadController {
4
4
  private readonly uploadService;
5
5
  constructor(uploadService: IUploadService);
6
6
  getToken: (_req: Request, res: Response) => Promise<void>;
7
7
  }
8
- //# sourceMappingURL=upload.controller.d.ts.map
@@ -30,7 +30,11 @@ let UploadController = class UploadController {
30
30
  res.json({ code: 0, message: "ok", data });
31
31
  }
32
32
  catch (error) {
33
- res.status(500).json({ code: 500, message: error?.message || "获取上传Token失败", data: null });
33
+ res.status(500).json({
34
+ code: 500,
35
+ message: error?.message || "获取上传Token失败",
36
+ data: null,
37
+ });
34
38
  }
35
39
  };
36
40
  }
@@ -41,4 +45,3 @@ exports.UploadController = UploadController = __decorate([
41
45
  __param(0, (0, inversify_1.inject)(identifiers_1.SERVICE_IDENTIFIERS.UploadService)),
42
46
  __metadata("design:paramtypes", [Object])
43
47
  ], UploadController);
44
- //# sourceMappingURL=upload.controller.js.map
package/lib/index.d.ts CHANGED
@@ -3,5 +3,4 @@ export { App } from "./app";
3
3
  export { Logger } from "./utils/logger";
4
4
  export { AgentService } from "./services/agent.service";
5
5
  export { SimulatorService } from "./services/simulator.service";
6
- export { createAppConfig, type AppConfig, type AppContext } from "./config/app.config";
7
- //# sourceMappingURL=index.d.ts.map
6
+ export { createAppConfig, type AppConfig, type AppContext, } from "./config/app.config";
package/lib/index.js CHANGED
@@ -15,4 +15,3 @@ Object.defineProperty(exports, "SimulatorService", { enumerable: true, get: func
15
15
  // 配置导出
16
16
  var app_config_1 = require("./config/app.config");
17
17
  Object.defineProperty(exports, "createAppConfig", { enumerable: true, get: function () { return app_config_1.createAppConfig; } });
18
- //# sourceMappingURL=index.js.map
@@ -4,4 +4,3 @@ export declare const corsMiddleware: (req: cors.CorsRequest, res: {
4
4
  setHeader(key: string, value: string): any;
5
5
  end(): any;
6
6
  }, next: (err?: any) => any) => void;
7
- //# sourceMappingURL=cors.middleware.d.ts.map
@@ -11,4 +11,3 @@ exports.corsMiddleware = (0, cors_1.default)({
11
11
  methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
12
12
  allowedHeaders: ["Content-Type", "Authorization", "X-Requested-With"],
13
13
  });
14
- //# sourceMappingURL=cors.middleware.js.map
@@ -1,8 +1,7 @@
1
- import { NextFunction, Request, Response } from "express";
1
+ import type { NextFunction, Request, Response } from "express";
2
2
  export interface AppError extends Error {
3
3
  statusCode?: number;
4
4
  isOperational?: boolean;
5
5
  }
6
- export declare const errorHandler: (err: AppError, req: Request, res: Response, next: NextFunction) => void;
7
- export declare const notFoundHandler: (req: Request, res: Response) => void;
8
- //# sourceMappingURL=error.middleware.d.ts.map
6
+ export declare const errorHandler: (err: AppError, req: Request, res: Response, _next: NextFunction) => void;
7
+ export declare const notFoundHandler: (_req: Request, res: Response) => void;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.notFoundHandler = exports.errorHandler = void 0;
4
- const errorHandler = (err, req, res, next) => {
4
+ const errorHandler = (err, req, res, _next) => {
5
5
  const statusCode = err.statusCode || 500;
6
6
  const message = err.message || "服务器内部错误";
7
7
  console.error("Error:", {
@@ -20,7 +20,7 @@ const errorHandler = (err, req, res, next) => {
20
20
  });
21
21
  };
22
22
  exports.errorHandler = errorHandler;
23
- const notFoundHandler = (req, res) => {
23
+ const notFoundHandler = (_req, res) => {
24
24
  res.status(404).json({
25
25
  error: {
26
26
  message: "未找到请求路径",
@@ -30,4 +30,3 @@ const notFoundHandler = (req, res) => {
30
30
  });
31
31
  };
32
32
  exports.notFoundHandler = notFoundHandler;
33
- //# sourceMappingURL=error.middleware.js.map
@@ -1,3 +1,2 @@
1
- import { NextFunction, Request, Response } from "express";
1
+ import type { NextFunction, Request, Response } from "express";
2
2
  export declare const createProxyMiddleware: (agentServerUrl: string) => (req: Request, res: Response, next: NextFunction) => void;
3
- //# sourceMappingURL=proxy.middleware.d.ts.map
@@ -18,4 +18,3 @@ const createProxyMiddleware = (agentServerUrl) => {
18
18
  };
19
19
  };
20
20
  exports.createProxyMiddleware = createProxyMiddleware;
21
- //# sourceMappingURL=proxy.middleware.js.map
@@ -7,4 +7,3 @@ export declare const upload: multer.Multer;
7
7
  * 单文件上传中间件(字段名为 "openai-file",对齐 OpenAI 标准)
8
8
  */
9
9
  export declare const uploadSingleFile: any;
10
- //# sourceMappingURL=upload.middleware.d.ts.map
@@ -24,4 +24,3 @@ exports.upload = (0, multer_1.default)({
24
24
  * 单文件上传中间件(字段名为 "openai-file",对齐 OpenAI 标准)
25
25
  */
26
26
  exports.uploadSingleFile = exports.upload.single(bodyFileName);
27
- //# sourceMappingURL=upload.middleware.js.map
@@ -1,4 +1,3 @@
1
1
  import { Router } from "express";
2
2
  import type { Container } from "inversify";
3
3
  export declare const createAgentRoutes: (container: Container) => Router;
4
- //# sourceMappingURL=agent.d.ts.map
@@ -11,9 +11,10 @@ const createAgentRoutes = (container) => {
11
11
  router.get("/info/get", agentController.getAgentInfo);
12
12
  // 获取Agent状态
13
13
  router.get("/info/status", agentController.getAgentStatus);
14
+ // 获取函数能力元数据(WebSocket 等特性检测)
15
+ router.get("/meta", agentController.getFunctionMeta);
14
16
  // 上传文件(使用 multipart/form-data 接收,元数据和文件都在 body 里)
15
17
  router.post("/upload-openai-file", upload_middleware_1.uploadSingleFile, agentController.uploadFile);
16
18
  return router;
17
19
  };
18
20
  exports.createAgentRoutes = createAgentRoutes;
19
- //# sourceMappingURL=agent.js.map
@@ -1,4 +1,3 @@
1
1
  import { Router } from "express";
2
2
  import type { Container } from "inversify";
3
3
  export declare const createAuthRoutes: (container: Container) => Router;
4
- //# sourceMappingURL=auth.d.ts.map
@@ -17,4 +17,3 @@ const createAuthRoutes = (container) => {
17
17
  return router;
18
18
  };
19
19
  exports.createAuthRoutes = createAuthRoutes;
20
- //# sourceMappingURL=auth.js.map
@@ -1,4 +1,3 @@
1
1
  import { Router } from "express";
2
2
  import type { Container } from "inversify";
3
3
  export declare const createRoutes: (container: Container) => Router;
4
- //# sourceMappingURL=index.d.ts.map
@@ -16,4 +16,3 @@ const createRoutes = (container) => {
16
16
  return router;
17
17
  };
18
18
  exports.createRoutes = createRoutes;
19
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,3 @@
1
1
  import { Router } from "express";
2
2
  import type { Container } from "inversify";
3
3
  export declare const createSimulatorRoutes: (container: Container) => Router;
4
- //# sourceMappingURL=simulator.d.ts.map
@@ -11,4 +11,3 @@ const createSimulatorRoutes = (container) => {
11
11
  return router;
12
12
  };
13
13
  exports.createSimulatorRoutes = createSimulatorRoutes;
14
- //# sourceMappingURL=simulator.js.map
@@ -1,4 +1,3 @@
1
1
  import { Router } from "express";
2
2
  import type { Container } from "inversify";
3
3
  export declare const createUploadRoutes: (container: Container) => Router;
4
- //# sourceMappingURL=upload.d.ts.map
@@ -10,4 +10,3 @@ const createUploadRoutes = (container) => {
10
10
  return router;
11
11
  };
12
12
  exports.createUploadRoutes = createUploadRoutes;
13
- //# sourceMappingURL=upload.js.map
@@ -22,15 +22,29 @@ export interface AgentStatus {
22
22
  }
23
23
  export declare class AgentService implements IAgentService {
24
24
  private parsedServerUrl;
25
+ private agentId?;
25
26
  constructor(context: any);
26
27
  /**
27
- * 获取Agent信息
28
+ * 获取 Agent 信息。
29
+ * 直接请求 agentbase `/agent/info`,不经过开发者 Agent Server(rcb-ff),
30
+ * 避免开发者代码异常导致获取失败。
28
31
  */
29
32
  getAgentInfo(): Promise<AgentSimulatorInfo>;
30
33
  /**
31
34
  * 获取Agent状态
32
35
  */
33
36
  getAgentStatus(): Promise<AgentStatus>;
37
+ /**
38
+ * 获取函数能力元数据(用于检测函数是否支持 WebSocket 等特性)
39
+ */
40
+ getFunctionMeta(): Promise<{
41
+ functions: Array<{
42
+ name: string;
43
+ features: {
44
+ websocket: boolean;
45
+ };
46
+ }>;
47
+ }>;
34
48
  /**
35
49
  * 上传文件到云函数
36
50
  * 使用 multipart/form-data 格式传输,对齐 OpenAI 文件上传标准
@@ -46,4 +60,3 @@ export declare class AgentService implements IAgentService {
46
60
  */
47
61
  private transformToAgentSimulatorInfo;
48
62
  }
49
- //# sourceMappingURL=agent.service.d.ts.map