@vectorx/agent-simulator 0.0.0-beta-20251112071234

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 (303) hide show
  1. package/README.md +76 -0
  2. package/bin/agent.js +55 -0
  3. package/lib/app.d.ts +43 -0
  4. package/lib/app.d.ts.map +1 -0
  5. package/lib/app.js +99 -0
  6. package/lib/app.js.map +1 -0
  7. package/lib/config/api.config.d.ts +2 -0
  8. package/lib/config/api.config.d.ts.map +1 -0
  9. package/lib/config/api.config.js +13 -0
  10. package/lib/config/api.config.js.map +1 -0
  11. package/lib/config/app.config.d.ts +22 -0
  12. package/lib/config/app.config.d.ts.map +1 -0
  13. package/lib/config/app.config.js +18 -0
  14. package/lib/config/app.config.js.map +1 -0
  15. package/lib/config/upload.config.d.ts +6 -0
  16. package/lib/config/upload.config.d.ts.map +1 -0
  17. package/lib/config/upload.config.js +10 -0
  18. package/lib/config/upload.config.js.map +1 -0
  19. package/lib/container/container.d.ts +6 -0
  20. package/lib/container/container.d.ts.map +1 -0
  21. package/lib/container/container.js +34 -0
  22. package/lib/container/container.js.map +1 -0
  23. package/lib/container/identifiers.d.ts +14 -0
  24. package/lib/container/identifiers.d.ts.map +1 -0
  25. package/lib/container/identifiers.js +20 -0
  26. package/lib/container/identifiers.js.map +1 -0
  27. package/lib/container/index.d.ts +4 -0
  28. package/lib/container/index.d.ts.map +1 -0
  29. package/lib/container/index.js +20 -0
  30. package/lib/container/index.js.map +1 -0
  31. package/lib/container/types.d.ts +48 -0
  32. package/lib/container/types.d.ts.map +1 -0
  33. package/lib/container/types.js +3 -0
  34. package/lib/container/types.js.map +1 -0
  35. package/lib/controllers/agent.controller.d.ts +19 -0
  36. package/lib/controllers/agent.controller.d.ts.map +1 -0
  37. package/lib/controllers/agent.controller.js +102 -0
  38. package/lib/controllers/agent.controller.js.map +1 -0
  39. package/lib/controllers/auth.controller.d.ts +23 -0
  40. package/lib/controllers/auth.controller.d.ts.map +1 -0
  41. package/lib/controllers/auth.controller.js +132 -0
  42. package/lib/controllers/auth.controller.js.map +1 -0
  43. package/lib/controllers/simulator.controller.d.ts +11 -0
  44. package/lib/controllers/simulator.controller.d.ts.map +1 -0
  45. package/lib/controllers/simulator.controller.js +44 -0
  46. package/lib/controllers/simulator.controller.js.map +1 -0
  47. package/lib/controllers/upload.controller.d.ts +8 -0
  48. package/lib/controllers/upload.controller.d.ts.map +1 -0
  49. package/lib/controllers/upload.controller.js +44 -0
  50. package/lib/controllers/upload.controller.js.map +1 -0
  51. package/lib/index.d.ts +7 -0
  52. package/lib/index.d.ts.map +1 -0
  53. package/lib/index.js +18 -0
  54. package/lib/index.js.map +1 -0
  55. package/lib/middleware/cors.middleware.d.ts +7 -0
  56. package/lib/middleware/cors.middleware.d.ts.map +1 -0
  57. package/lib/middleware/cors.middleware.js +14 -0
  58. package/lib/middleware/cors.middleware.js.map +1 -0
  59. package/lib/middleware/error.middleware.d.ts +8 -0
  60. package/lib/middleware/error.middleware.d.ts.map +1 -0
  61. package/lib/middleware/error.middleware.js +33 -0
  62. package/lib/middleware/error.middleware.js.map +1 -0
  63. package/lib/middleware/proxy.middleware.d.ts +3 -0
  64. package/lib/middleware/proxy.middleware.d.ts.map +1 -0
  65. package/lib/middleware/proxy.middleware.js +21 -0
  66. package/lib/middleware/proxy.middleware.js.map +1 -0
  67. package/lib/middleware/upload.middleware.d.ts +10 -0
  68. package/lib/middleware/upload.middleware.d.ts.map +1 -0
  69. package/lib/middleware/upload.middleware.js +27 -0
  70. package/lib/middleware/upload.middleware.js.map +1 -0
  71. package/lib/routes/agent.d.ts +3 -0
  72. package/lib/routes/agent.d.ts.map +1 -0
  73. package/lib/routes/agent.js +19 -0
  74. package/lib/routes/agent.js.map +1 -0
  75. package/lib/routes/auth.d.ts +3 -0
  76. package/lib/routes/auth.d.ts.map +1 -0
  77. package/lib/routes/auth.js +20 -0
  78. package/lib/routes/auth.js.map +1 -0
  79. package/lib/routes/index.d.ts +3 -0
  80. package/lib/routes/index.d.ts.map +1 -0
  81. package/lib/routes/index.js +19 -0
  82. package/lib/routes/index.js.map +1 -0
  83. package/lib/routes/simulator.d.ts +3 -0
  84. package/lib/routes/simulator.d.ts.map +1 -0
  85. package/lib/routes/simulator.js +14 -0
  86. package/lib/routes/simulator.js.map +1 -0
  87. package/lib/routes/upload.d.ts +3 -0
  88. package/lib/routes/upload.d.ts.map +1 -0
  89. package/lib/routes/upload.js +13 -0
  90. package/lib/routes/upload.js.map +1 -0
  91. package/lib/services/agent.service.d.ts +49 -0
  92. package/lib/services/agent.service.d.ts.map +1 -0
  93. package/lib/services/agent.service.js +147 -0
  94. package/lib/services/agent.service.js.map +1 -0
  95. package/lib/services/auth.service.d.ts +55 -0
  96. package/lib/services/auth.service.d.ts.map +1 -0
  97. package/lib/services/auth.service.js +124 -0
  98. package/lib/services/auth.service.js.map +1 -0
  99. package/lib/services/simulator.service.d.ts +23 -0
  100. package/lib/services/simulator.service.d.ts.map +1 -0
  101. package/lib/services/simulator.service.js +49 -0
  102. package/lib/services/simulator.service.js.map +1 -0
  103. package/lib/services/upload.service.d.ts +32 -0
  104. package/lib/services/upload.service.d.ts.map +1 -0
  105. package/lib/services/upload.service.js +61 -0
  106. package/lib/services/upload.service.js.map +1 -0
  107. package/lib/simulator.d.ts +27 -0
  108. package/lib/simulator.d.ts.map +1 -0
  109. package/lib/simulator.js +79 -0
  110. package/lib/simulator.js.map +1 -0
  111. package/lib/utils/logger.d.ts +8 -0
  112. package/lib/utils/logger.d.ts.map +1 -0
  113. package/lib/utils/logger.js +28 -0
  114. package/lib/utils/logger.js.map +1 -0
  115. package/lib/utils/request.d.ts +11 -0
  116. package/lib/utils/request.d.ts.map +1 -0
  117. package/lib/utils/request.js +36 -0
  118. package/lib/utils/request.js.map +1 -0
  119. package/lib/utils/url-parser.d.ts +14 -0
  120. package/lib/utils/url-parser.d.ts.map +1 -0
  121. package/lib/utils/url-parser.js +25 -0
  122. package/lib/utils/url-parser.js.map +1 -0
  123. package/lib/utils.d.ts +6 -0
  124. package/lib/utils.d.ts.map +1 -0
  125. package/lib/utils.js +12 -0
  126. package/lib/utils.js.map +1 -0
  127. package/lib/webview-ui/Agent.d.ts +5 -0
  128. package/lib/webview-ui/Agent.d.ts.map +1 -0
  129. package/lib/webview-ui/Agent.js +24 -0
  130. package/lib/webview-ui/Agent.js.map +1 -0
  131. package/lib/webview-ui/App.d.ts +3 -0
  132. package/lib/webview-ui/App.d.ts.map +1 -0
  133. package/lib/webview-ui/App.js +775 -0
  134. package/lib/webview-ui/App.js.map +1 -0
  135. package/lib/webview-ui/ErrorBoundary.d.ts +19 -0
  136. package/lib/webview-ui/ErrorBoundary.d.ts.map +1 -0
  137. package/lib/webview-ui/ErrorBoundary.js +54 -0
  138. package/lib/webview-ui/ErrorBoundary.js.map +1 -0
  139. package/lib/webview-ui/components/AsyncTaskBlock.d.ts +13 -0
  140. package/lib/webview-ui/components/AsyncTaskBlock.d.ts.map +1 -0
  141. package/lib/webview-ui/components/AsyncTaskBlock.js +179 -0
  142. package/lib/webview-ui/components/AsyncTaskBlock.js.map +1 -0
  143. package/lib/webview-ui/components/AuthIndicator.d.ts +3 -0
  144. package/lib/webview-ui/components/AuthIndicator.d.ts.map +1 -0
  145. package/lib/webview-ui/components/AuthIndicator.js +17 -0
  146. package/lib/webview-ui/components/AuthIndicator.js.map +1 -0
  147. package/lib/webview-ui/components/ErrorCard.d.ts +11 -0
  148. package/lib/webview-ui/components/ErrorCard.d.ts.map +1 -0
  149. package/lib/webview-ui/components/ErrorCard.js +18 -0
  150. package/lib/webview-ui/components/ErrorCard.js.map +1 -0
  151. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.d.ts +20 -0
  152. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.d.ts.map +1 -0
  153. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.js +45 -0
  154. package/lib/webview-ui/components/KnowledgeBaseSearchBlock.js.map +1 -0
  155. package/lib/webview-ui/components/KnowledgeBaseSearchResult.d.ts +9 -0
  156. package/lib/webview-ui/components/KnowledgeBaseSearchResult.d.ts.map +1 -0
  157. package/lib/webview-ui/components/KnowledgeBaseSearchResult.js +31 -0
  158. package/lib/webview-ui/components/KnowledgeBaseSearchResult.js.map +1 -0
  159. package/lib/webview-ui/components/MarkdownRenderer.d.ts +7 -0
  160. package/lib/webview-ui/components/MarkdownRenderer.d.ts.map +1 -0
  161. package/lib/webview-ui/components/MarkdownRenderer.js +28 -0
  162. package/lib/webview-ui/components/MarkdownRenderer.js.map +1 -0
  163. package/lib/webview-ui/components/MessageRenderer.d.ts +7 -0
  164. package/lib/webview-ui/components/MessageRenderer.d.ts.map +1 -0
  165. package/lib/webview-ui/components/MessageRenderer.js +33 -0
  166. package/lib/webview-ui/components/MessageRenderer.js.map +1 -0
  167. package/lib/webview-ui/components/MultimodalFileRenderer.d.ts +20 -0
  168. package/lib/webview-ui/components/MultimodalFileRenderer.d.ts.map +1 -0
  169. package/lib/webview-ui/components/MultimodalFileRenderer.js +216 -0
  170. package/lib/webview-ui/components/MultimodalFileRenderer.js.map +1 -0
  171. package/lib/webview-ui/components/ThinkingBlock.d.ts +8 -0
  172. package/lib/webview-ui/components/ThinkingBlock.d.ts.map +1 -0
  173. package/lib/webview-ui/components/ThinkingBlock.js +75 -0
  174. package/lib/webview-ui/components/ThinkingBlock.js.map +1 -0
  175. package/lib/webview-ui/components/ToolUseBlock.d.ts +10 -0
  176. package/lib/webview-ui/components/ToolUseBlock.d.ts.map +1 -0
  177. package/lib/webview-ui/components/ToolUseBlock.js +14 -0
  178. package/lib/webview-ui/components/ToolUseBlock.js.map +1 -0
  179. package/lib/webview-ui/components/ToolUseBlockHeader.d.ts +10 -0
  180. package/lib/webview-ui/components/ToolUseBlockHeader.d.ts.map +1 -0
  181. package/lib/webview-ui/components/ToolUseBlockHeader.js +31 -0
  182. package/lib/webview-ui/components/ToolUseBlockHeader.js.map +1 -0
  183. package/lib/webview-ui/components/UploadPreview.d.ts +6 -0
  184. package/lib/webview-ui/components/UploadPreview.d.ts.map +1 -0
  185. package/lib/webview-ui/components/UploadPreview.js +12 -0
  186. package/lib/webview-ui/components/UploadPreview.js.map +1 -0
  187. package/lib/webview-ui/components/WelcomeModule.d.ts +10 -0
  188. package/lib/webview-ui/components/WelcomeModule.d.ts.map +1 -0
  189. package/lib/webview-ui/components/WelcomeModule.js +161 -0
  190. package/lib/webview-ui/components/WelcomeModule.js.map +1 -0
  191. package/lib/webview-ui/components/index.d.ts +14 -0
  192. package/lib/webview-ui/components/index.d.ts.map +1 -0
  193. package/lib/webview-ui/components/index.js +30 -0
  194. package/lib/webview-ui/components/index.js.map +1 -0
  195. package/lib/webview-ui/config/cos-config.d.ts +41 -0
  196. package/lib/webview-ui/config/cos-config.d.ts.map +1 -0
  197. package/lib/webview-ui/config/cos-config.js +83 -0
  198. package/lib/webview-ui/config/cos-config.js.map +1 -0
  199. package/lib/webview-ui/config/http-config.d.ts +8 -0
  200. package/lib/webview-ui/config/http-config.d.ts.map +1 -0
  201. package/lib/webview-ui/config/http-config.js +36 -0
  202. package/lib/webview-ui/config/http-config.js.map +1 -0
  203. package/lib/webview-ui/constants.d.ts +18 -0
  204. package/lib/webview-ui/constants.d.ts.map +1 -0
  205. package/lib/webview-ui/constants.js +25 -0
  206. package/lib/webview-ui/constants.js.map +1 -0
  207. package/lib/webview-ui/contexts/AgentContext.d.ts +13 -0
  208. package/lib/webview-ui/contexts/AgentContext.d.ts.map +1 -0
  209. package/lib/webview-ui/contexts/AgentContext.js +19 -0
  210. package/lib/webview-ui/contexts/AgentContext.js.map +1 -0
  211. package/lib/webview-ui/contexts/AuthContext.d.ts +17 -0
  212. package/lib/webview-ui/contexts/AuthContext.d.ts.map +1 -0
  213. package/lib/webview-ui/contexts/AuthContext.js +79 -0
  214. package/lib/webview-ui/contexts/AuthContext.js.map +1 -0
  215. package/lib/webview-ui/contexts/ThemeContext.d.ts +12 -0
  216. package/lib/webview-ui/contexts/ThemeContext.d.ts.map +1 -0
  217. package/lib/webview-ui/contexts/ThemeContext.js +21 -0
  218. package/lib/webview-ui/contexts/ThemeContext.js.map +1 -0
  219. package/lib/webview-ui/hooks/useAgentStatus.d.ts +17 -0
  220. package/lib/webview-ui/hooks/useAgentStatus.d.ts.map +1 -0
  221. package/lib/webview-ui/hooks/useAgentStatus.js +117 -0
  222. package/lib/webview-ui/hooks/useAgentStatus.js.map +1 -0
  223. package/lib/webview-ui/hooks/useUploader.d.ts +19 -0
  224. package/lib/webview-ui/hooks/useUploader.d.ts.map +1 -0
  225. package/lib/webview-ui/hooks/useUploader.js +132 -0
  226. package/lib/webview-ui/hooks/useUploader.js.map +1 -0
  227. package/lib/webview-ui/hooks/useUserAvatar.d.ts +28 -0
  228. package/lib/webview-ui/hooks/useUserAvatar.d.ts.map +1 -0
  229. package/lib/webview-ui/hooks/useUserAvatar.js +74 -0
  230. package/lib/webview-ui/hooks/useUserAvatar.js.map +1 -0
  231. package/lib/webview-ui/index.d.ts +3 -0
  232. package/lib/webview-ui/index.d.ts.map +1 -0
  233. package/lib/webview-ui/index.js +17 -0
  234. package/lib/webview-ui/index.js.map +1 -0
  235. package/lib/webview-ui/services/agent-service.d.ts +124 -0
  236. package/lib/webview-ui/services/agent-service.d.ts.map +1 -0
  237. package/lib/webview-ui/services/agent-service.js +80 -0
  238. package/lib/webview-ui/services/agent-service.js.map +1 -0
  239. package/lib/webview-ui/services/index.d.ts +3 -0
  240. package/lib/webview-ui/services/index.d.ts.map +1 -0
  241. package/lib/webview-ui/services/index.js +19 -0
  242. package/lib/webview-ui/services/index.js.map +1 -0
  243. package/lib/webview-ui/services/logger-service.d.ts +46 -0
  244. package/lib/webview-ui/services/logger-service.d.ts.map +1 -0
  245. package/lib/webview-ui/services/logger-service.js +69 -0
  246. package/lib/webview-ui/services/logger-service.js.map +1 -0
  247. package/lib/webview-ui/styles/copilot.d.ts +14 -0
  248. package/lib/webview-ui/styles/copilot.d.ts.map +1 -0
  249. package/lib/webview-ui/styles/copilot.js +119 -0
  250. package/lib/webview-ui/styles/copilot.js.map +1 -0
  251. package/lib/webview-ui/styles/workarea.d.ts +11 -0
  252. package/lib/webview-ui/styles/workarea.d.ts.map +1 -0
  253. package/lib/webview-ui/styles/workarea.js +73 -0
  254. package/lib/webview-ui/styles/workarea.js.map +1 -0
  255. package/lib/webview-ui/types.d.ts +65 -0
  256. package/lib/webview-ui/types.d.ts.map +1 -0
  257. package/lib/webview-ui/types.js +3 -0
  258. package/lib/webview-ui/types.js.map +1 -0
  259. package/lib/webview-ui/utils/cos.d.ts +65 -0
  260. package/lib/webview-ui/utils/cos.d.ts.map +1 -0
  261. package/lib/webview-ui/utils/cos.js +113 -0
  262. package/lib/webview-ui/utils/cos.js.map +1 -0
  263. package/lib/webview-ui/utils/http-client.d.ts +44 -0
  264. package/lib/webview-ui/utils/http-client.d.ts.map +1 -0
  265. package/lib/webview-ui/utils/http-client.js +101 -0
  266. package/lib/webview-ui/utils/http-client.js.map +1 -0
  267. package/lib/webview-ui/utils/stream-text-handler.d.ts +4 -0
  268. package/lib/webview-ui/utils/stream-text-handler.d.ts.map +1 -0
  269. package/lib/webview-ui/utils/stream-text-handler.js +54 -0
  270. package/lib/webview-ui/utils/stream-text-handler.js.map +1 -0
  271. package/lib/webview-ui/utils/upload.d.ts +8 -0
  272. package/lib/webview-ui/utils/upload.d.ts.map +1 -0
  273. package/lib/webview-ui/utils/upload.js +22 -0
  274. package/lib/webview-ui/utils/upload.js.map +1 -0
  275. package/lib/webview-ui/widgets/BubbleComponents.d.ts +8 -0
  276. package/lib/webview-ui/widgets/BubbleComponents.d.ts.map +1 -0
  277. package/lib/webview-ui/widgets/BubbleComponents.js +62 -0
  278. package/lib/webview-ui/widgets/BubbleComponents.js.map +1 -0
  279. package/lib/webview-ui/widgets/ChatInput.d.ts +27 -0
  280. package/lib/webview-ui/widgets/ChatInput.d.ts.map +1 -0
  281. package/lib/webview-ui/widgets/ChatInput.js +203 -0
  282. package/lib/webview-ui/widgets/ChatInput.js.map +1 -0
  283. package/lib/webview-ui/widgets/LogPanel.d.ts +15 -0
  284. package/lib/webview-ui/widgets/LogPanel.d.ts.map +1 -0
  285. package/lib/webview-ui/widgets/LogPanel.js +59 -0
  286. package/lib/webview-ui/widgets/LogPanel.js.map +1 -0
  287. package/lib/webview-ui/widgets/SystemLogs.d.ts +30 -0
  288. package/lib/webview-ui/widgets/SystemLogs.d.ts.map +1 -0
  289. package/lib/webview-ui/widgets/SystemLogs.js +460 -0
  290. package/lib/webview-ui/widgets/SystemLogs.js.map +1 -0
  291. package/lib/webview-ui/widgets/ToolBar.d.ts +18 -0
  292. package/lib/webview-ui/widgets/ToolBar.d.ts.map +1 -0
  293. package/lib/webview-ui/widgets/ToolBar.js +90 -0
  294. package/lib/webview-ui/widgets/ToolBar.js.map +1 -0
  295. package/lib/webview-ui/widgets/index.d.ts +6 -0
  296. package/lib/webview-ui/widgets/index.d.ts.map +1 -0
  297. package/lib/webview-ui/widgets/index.js +22 -0
  298. package/lib/webview-ui/widgets/index.js.map +1 -0
  299. package/package.json +92 -0
  300. package/public/assets/index-j_rEEDWU.js +93 -0
  301. package/public/assets/main.js +603 -0
  302. package/public/assets/style.css +1 -0
  303. package/public/index.html +15 -0
@@ -0,0 +1,32 @@
1
+ import type { IAuthService, IUploadService } from "../container/types";
2
+ export interface UploadTempPermit {
3
+ secretId?: string;
4
+ secretKey?: string;
5
+ token: string;
6
+ uploadAddr: string;
7
+ expireTime: number;
8
+ qos: number;
9
+ cloudType: number;
10
+ bucket: string;
11
+ region: string;
12
+ fileIds: string[];
13
+ masterCloudId: number;
14
+ uploadId: number;
15
+ cdnDomain?: string;
16
+ }
17
+ export interface TokenResponse {
18
+ uploadLimitPolicy?: {
19
+ fileTypes?: string[];
20
+ maxSize?: number;
21
+ };
22
+ uploadTempPermits: UploadTempPermit[];
23
+ }
24
+ export declare class UploadService implements IUploadService {
25
+ private readonly authService;
26
+ constructor(authService: IAuthService);
27
+ getToken(params: {
28
+ bizName: string;
29
+ scene: string;
30
+ }): Promise<TokenResponse>;
31
+ }
32
+ //# sourceMappingURL=upload.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.service.d.ts","sourceRoot":"","sources":["../../src/services/upload.service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,iBAAiB,CAAC,EAAE;QAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAID,qBACa,aAAc,YAAW,cAAc;IACG,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAAX,WAAW,EAAE,YAAY;IAEzF,QAAQ,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC;CAgCnF"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.UploadService = void 0;
16
+ const inversify_1 = require("inversify");
17
+ const api_config_1 = require("../config/api.config");
18
+ const identifiers_1 = require("../container/identifiers");
19
+ const request_1 = require("../utils/request");
20
+ // baseUrl 与请求已抽离到统一配置与工具
21
+ let UploadService = class UploadService {
22
+ constructor(authService) {
23
+ this.authService = authService;
24
+ }
25
+ async getToken(params) {
26
+ const loginInfo = await this.authService.getLoginInfo();
27
+ if (!loginInfo) {
28
+ throw new Error("未登录,请先登录");
29
+ }
30
+ const url = `${(0, api_config_1.getBaseUrl)()}/api/eros/mp/red/code/agent_pkg/upload/permit`;
31
+ // 罗通新开发
32
+ // const url = `${getBaseUrl()}/api/eros/mp/red/code/upload/common_permit`;
33
+ // const url = `${getBaseUrl()}/mp/red/mp/apps/upload/permit`;
34
+ const res = await request_1.request.fetch({
35
+ url,
36
+ method: "GET",
37
+ headers: { "Content-Type": "application/json" },
38
+ data: {
39
+ params: {
40
+ secret_id: loginInfo.secret_id,
41
+ cli_token: loginInfo.cli_token,
42
+ biz_name: params.bizName,
43
+ scene: params.scene,
44
+ file_count: 1,
45
+ version: 1,
46
+ },
47
+ },
48
+ });
49
+ if (res.ok && res.data?.code === 0) {
50
+ return res.data.data;
51
+ }
52
+ throw new Error(res.data?.msg || res.data?.message || `获取上传Token失败: ${res.status}`);
53
+ }
54
+ };
55
+ exports.UploadService = UploadService;
56
+ exports.UploadService = UploadService = __decorate([
57
+ (0, inversify_1.injectable)(),
58
+ __param(0, (0, inversify_1.inject)(identifiers_1.SERVICE_IDENTIFIERS.AuthService)),
59
+ __metadata("design:paramtypes", [Object])
60
+ ], UploadService);
61
+ //# sourceMappingURL=upload.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.service.js","sourceRoot":"","sources":["../../src/services/upload.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA+C;AAC/C,qDAAkD;AAClD,0DAA+D;AAE/D,8CAA2C;AAyB3C,yBAAyB;AAGlB,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAAsE,WAAyB;QAAzB,gBAAW,GAAX,WAAW,CAAc;IAAG,CAAC;IAEnG,KAAK,CAAC,QAAQ,CAAC,MAA0C;QACvD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;QACxD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9B,CAAC;QAED,MAAM,GAAG,GAAG,GAAG,IAAA,uBAAU,GAAE,+CAA+C,CAAC;QAC3E,QAAQ;QACR,2EAA2E;QAC3E,8DAA8D;QAC9D,MAAM,GAAG,GAAG,MAAM,iBAAO,CAAC,KAAK,CAAC;YAC9B,GAAG;YACH,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE;gBACJ,MAAM,EAAE;oBACN,SAAS,EAAE,SAAS,CAAC,SAAS;oBAC9B,SAAS,EAAE,SAAS,CAAC,SAAS;oBAC9B,QAAQ,EAAE,MAAM,CAAC,OAAO;oBACxB,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,UAAU,EAAE,CAAC;oBACb,OAAO,EAAE,CAAC;iBACX;aACF;SACF,CAAC,CAAC;QAEH,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,GAAG,CAAC,IAAI,CAAC,IAAqB,CAAC;QACxC,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,gBAAgB,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;IACtF,CAAC;CACF,CAAA;AAnCY,sCAAa;wBAAb,aAAa;IADzB,IAAA,sBAAU,GAAE;IAEE,WAAA,IAAA,kBAAM,EAAC,iCAAmB,CAAC,WAAW,CAAC,CAAA;;GADzC,aAAa,CAmCzB"}
@@ -0,0 +1,27 @@
1
+ export interface SimulatorOptions {
2
+ port: number;
3
+ agentServerUrl: string;
4
+ open?: boolean;
5
+ }
6
+ /**
7
+ * Agent模拟器实现
8
+ */
9
+ export declare class AgentSimulator {
10
+ private app;
11
+ private server;
12
+ options: SimulatorOptions;
13
+ /**
14
+ * 创建模拟器实例
15
+ * @param options 模拟器配置选项
16
+ */
17
+ constructor(options: SimulatorOptions);
18
+ /**
19
+ * 配置并启动模拟器
20
+ */
21
+ start(): Promise<void>;
22
+ /**
23
+ * 停止模拟器
24
+ */
25
+ stop(): Promise<void>;
26
+ }
27
+ //# sourceMappingURL=simulator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../src/simulator.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AACD;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA4B;IACnC,OAAO,EAAE,gBAAgB,CAAC;IAEjC;;;OAGG;gBACS,OAAO,EAAE,gBAAgB;IAarC;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA4B5B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAoBtB"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AgentSimulator = void 0;
4
+ const app_1 = require("./app");
5
+ const logger_1 = require("./utils/logger");
6
+ /**
7
+ * Agent模拟器实现
8
+ */
9
+ class AgentSimulator {
10
+ /**
11
+ * 创建模拟器实例
12
+ * @param options 模拟器配置选项
13
+ */
14
+ constructor(options) {
15
+ this.server = null;
16
+ this.options = {
17
+ open: true,
18
+ ...options,
19
+ };
20
+ this.app = new app_1.App({
21
+ port: options.port,
22
+ agentServerUrl: options.agentServerUrl,
23
+ open: options.open,
24
+ });
25
+ }
26
+ /**
27
+ * 配置并启动模拟器
28
+ */
29
+ async start() {
30
+ const config = this.app.getConfig();
31
+ const expressApp = this.app.getApp();
32
+ // 启动服务器
33
+ return new Promise((resolve) => {
34
+ this.server = expressApp.listen(config.port, () => {
35
+ logger_1.Logger.success(`
36
+ ┌────────────────────────────────────────────────────┐
37
+ │ │
38
+ │ 🚀 Agent模拟器已启动! │
39
+ │ │
40
+ │ 📡 模拟器地址: ${`http://localhost:${config.port}`} │
41
+ │ 🔄 Agent服务: ${config.agentServerUrl} │
42
+ │ │
43
+ └────────────────────────────────────────────────────┘
44
+ `);
45
+ // 自动打开浏览器提示
46
+ if (config.open) {
47
+ logger_1.Logger.warning(`请手动在浏览器中打开: ${logger_1.Logger.info(`http://localhost:${config.port}`)}`);
48
+ }
49
+ resolve();
50
+ });
51
+ });
52
+ }
53
+ /**
54
+ * 停止模拟器
55
+ */
56
+ stop() {
57
+ return new Promise((resolve, reject) => {
58
+ if (this.server) {
59
+ this.server.close((err) => {
60
+ if (err) {
61
+ return reject(err);
62
+ }
63
+ logger_1.Logger.warning("模拟器已停止");
64
+ resolve();
65
+ });
66
+ // 关闭所有连接
67
+ this.server.closeAllConnections();
68
+ setTimeout(() => {
69
+ resolve();
70
+ }, 2000);
71
+ }
72
+ else {
73
+ resolve();
74
+ }
75
+ });
76
+ }
77
+ }
78
+ exports.AgentSimulator = AgentSimulator;
79
+ //# sourceMappingURL=simulator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulator.js","sourceRoot":"","sources":["../src/simulator.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAC5B,2CAAwC;AAOxC;;GAEG;AACH,MAAa,cAAc;IAKzB;;;OAGG;IACH,YAAY,OAAyB;QAP7B,WAAM,GAAuB,IAAI,CAAC;QAQxC,IAAI,CAAC,OAAO,GAAG;YACb,IAAI,EAAE,IAAI;YACV,GAAG,OAAO;SACX,CAAC;QAEF,IAAI,CAAC,GAAG,GAAG,IAAI,SAAG,CAAC;YACjB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QAErC,QAAQ;QACR,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;gBAChD,eAAM,CAAC,OAAO,CAAC;;;;;eAKR,oBAAoB,MAAM,CAAC,IAAI,EAAE;iBAC/B,MAAM,CAAC,cAAc;;;SAG7B,CAAC,CAAC;gBAEH,YAAY;gBACZ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;oBAChB,eAAM,CAAC,OAAO,CAAC,eAAe,eAAM,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;gBAClF,CAAC;gBAED,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,IAAI;QACF,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAChB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAW,EAAE,EAAE;oBAChC,IAAI,GAAG,EAAE,CAAC;wBACR,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;oBACrB,CAAC;oBACD,eAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;oBACzB,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;gBACH,SAAS;gBACT,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;gBAClC,UAAU,CAAC,GAAG,EAAE;oBACd,OAAO,EAAE,CAAC;gBACZ,CAAC,EAAE,IAAI,CAAC,CAAC;YACX,CAAC;iBAAM,CAAC;gBACN,OAAO,EAAE,CAAC;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA5ED,wCA4EC"}
@@ -0,0 +1,8 @@
1
+ export declare class Logger {
2
+ static info(message: string, data?: any): void;
3
+ static success(message: string, data?: any): void;
4
+ static warning(message: string, data?: any): void;
5
+ static error(message: string, error?: any): void;
6
+ static debug(message: string, data?: any): void;
7
+ }
8
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,qBAAa,MAAM;IACjB,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAI9C,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAIjD,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAIjD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,IAAI;IAIhD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;CAKhD"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Logger = void 0;
7
+ const chalk_1 = __importDefault(require("chalk"));
8
+ class Logger {
9
+ static info(message, data) {
10
+ console.log(chalk_1.default.blue(`[INFO] ${message}`), data ? data : "");
11
+ }
12
+ static success(message, data) {
13
+ console.log(chalk_1.default.green(`[SUCCESS] ${message}`), data ? data : "");
14
+ }
15
+ static warning(message, data) {
16
+ console.log(chalk_1.default.yellow(`[WARNING] ${message}`), data ? data : "");
17
+ }
18
+ static error(message, error) {
19
+ console.error(chalk_1.default.red(`[ERROR] ${message}`), error ? error : "");
20
+ }
21
+ static debug(message, data) {
22
+ if (process.env.NODE_ENV === "development") {
23
+ console.log(chalk_1.default.gray(`[DEBUG] ${message}`), data ? data : "");
24
+ }
25
+ }
26
+ }
27
+ exports.Logger = Logger;
28
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,MAAa,MAAM;IACjB,MAAM,CAAC,IAAI,CAAC,OAAe,EAAE,IAAU;QACrC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,UAAU,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,IAAU;QACxC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,aAAa,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,IAAU;QACxC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,aAAa,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,KAAW;QACvC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAe,EAAE,IAAU;QACtC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;CACF;AAtBD,wBAsBC"}
@@ -0,0 +1,11 @@
1
+ export interface FetchOptions {
2
+ method?: string;
3
+ headers?: Record<string, string>;
4
+ data?: any;
5
+ }
6
+ export declare const request: {
7
+ fetch(options: {
8
+ url: string;
9
+ } & FetchOptions): Promise<any>;
10
+ };
11
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/utils/request.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;CACZ;AAED,eAAO,MAAM,OAAO;mBACG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC;CA4BnE,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.request = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ exports.request = {
9
+ async fetch(options) {
10
+ const { url, method = "GET", headers = {}, data } = options;
11
+ let finalUrl = url;
12
+ let body;
13
+ const finalHeaders = {
14
+ "Content-Type": "application/json",
15
+ ...headers,
16
+ };
17
+ if (method.toUpperCase() === "GET") {
18
+ if (data && typeof data === "object") {
19
+ const urlObj = new URL(url);
20
+ if (data.params && typeof data.params === "object") {
21
+ Object.entries(data.params).forEach(([k, v]) => urlObj.searchParams.set(k, String(v)));
22
+ }
23
+ finalUrl = urlObj.toString();
24
+ }
25
+ }
26
+ else {
27
+ if (data && typeof data === "object") {
28
+ body = JSON.stringify(data);
29
+ }
30
+ }
31
+ const res = await (0, node_fetch_1.default)(finalUrl, { method, headers: finalHeaders, body: body, timeout: 1000 * 20 });
32
+ const json = await res.json().catch(() => ({}));
33
+ return { status: res.status, ok: res.ok, data: json };
34
+ },
35
+ };
36
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/utils/request.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAQtB,QAAA,OAAO,GAAG;IACrB,KAAK,CAAC,KAAK,CAAC,OAAuC;QACjD,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QAE5D,IAAI,QAAQ,GAAG,GAAG,CAAC;QACnB,IAAI,IAA0B,CAAC;QAC/B,MAAM,YAAY,GAA2B;YAC3C,cAAc,EAAE,kBAAkB;YAClC,GAAG,OAAO;SACX,CAAC;QAEF,IAAI,MAAM,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;YACnC,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;gBAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACnD,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACzF,CAAC;gBACD,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC/B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,IAAA,oBAAS,EAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,IAAW,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,CAAC;QAChH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChD,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxD,CAAC;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 解析 Agent Server URL
3
+ * @param url 完整的 Agent Server URL
4
+ * @returns 解析后的信息
5
+ */
6
+ export declare function parseAgentServerUrl(url: string): {
7
+ protocol: string;
8
+ hostname: string;
9
+ port: string;
10
+ pathname: string;
11
+ baseUrl: string;
12
+ fullUrl: string;
13
+ };
14
+ //# sourceMappingURL=url-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-parser.d.ts","sourceRoot":"","sources":["../../src/utils/url-parser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM;;;;;;;EAc9C"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseAgentServerUrl = parseAgentServerUrl;
4
+ /**
5
+ * 解析 Agent Server URL
6
+ * @param url 完整的 Agent Server URL
7
+ * @returns 解析后的信息
8
+ */
9
+ function parseAgentServerUrl(url) {
10
+ try {
11
+ const urlObj = new URL(url);
12
+ return {
13
+ protocol: urlObj.protocol,
14
+ hostname: urlObj.hostname,
15
+ port: urlObj.port || (urlObj.protocol === "https:" ? "443" : "80"),
16
+ pathname: urlObj.pathname,
17
+ baseUrl: `${urlObj.protocol}//${urlObj.hostname}${urlObj.port ? ":" + urlObj.port : ""}`,
18
+ fullUrl: url,
19
+ };
20
+ }
21
+ catch (error) {
22
+ throw new Error(`无效的 Agent Server URL: ${url}`);
23
+ }
24
+ }
25
+ //# sourceMappingURL=url-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url-parser.js","sourceRoot":"","sources":["../../src/utils/url-parser.ts"],"names":[],"mappings":";;AAKA,kDAcC;AAnBD;;;;GAIG;AACH,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO;YACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;YAClE,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,OAAO,EAAE,GAAG,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;YACxF,OAAO,EAAE,GAAG;SACb,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
package/lib/utils.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 生成唯一ID
3
+ * @returns 唯一ID字符串
4
+ */
5
+ export declare const generateId: () => string;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,MAE7B,CAAC"}
package/lib/utils.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateId = void 0;
4
+ /**
5
+ * 生成唯一ID
6
+ * @returns 唯一ID字符串
7
+ */
8
+ const generateId = () => {
9
+ return Date.now() + "-" + Math.random().toString(36).substr(2, 9);
10
+ };
11
+ exports.generateId = generateId;
12
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,UAAU,GAAG,GAAW,EAAE;IACrC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,UAAU,cAErB"}
@@ -0,0 +1,5 @@
1
+ import type { AgentSimulatorInfo } from "./services/agent-service";
2
+ export declare function getSendMessageUri(agentSimulatorInfo: AgentSimulatorInfo): string;
3
+ export declare function getHealthUri(agentSimulatorInfo: AgentSimulatorInfo): string;
4
+ export declare function getQueryTasksUri(agentSimulatorInfo: AgentSimulatorInfo, taskId?: string): string;
5
+ //# sourceMappingURL=Agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../src/webview-ui/Agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,kBAAkB,EAAE,kBAAkB,UAKvE;AAED,wBAAgB,YAAY,CAAC,kBAAkB,EAAE,kBAAkB,UAKlE;AAED,wBAAgB,gBAAgB,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,MAAM,UAKvF"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSendMessageUri = getSendMessageUri;
4
+ exports.getHealthUri = getHealthUri;
5
+ exports.getQueryTasksUri = getQueryTasksUri;
6
+ function getSendMessageUri(agentSimulatorInfo) {
7
+ if (!agentSimulatorInfo) {
8
+ throw new Error("agentSimulatorInfo is not set");
9
+ }
10
+ return `${agentSimulatorInfo.agentServerUrl}/send-message`;
11
+ }
12
+ function getHealthUri(agentSimulatorInfo) {
13
+ if (!agentSimulatorInfo) {
14
+ throw new Error("agentSimulatorInfo is not set");
15
+ }
16
+ return `${agentSimulatorInfo.agentServerUrl}/health`;
17
+ }
18
+ function getQueryTasksUri(agentSimulatorInfo, taskId) {
19
+ if (!agentSimulatorInfo) {
20
+ throw new Error("agentSimulatorInfo is not set");
21
+ }
22
+ return `${agentSimulatorInfo.agentServerUrl}/query-tasks${taskId ? `/${taskId}` : ""}`;
23
+ }
24
+ //# sourceMappingURL=Agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Agent.js","sourceRoot":"","sources":["../../src/webview-ui/Agent.ts"],"names":[],"mappings":";;AAEA,8CAKC;AAED,oCAKC;AAED,4CAKC;AAnBD,SAAgB,iBAAiB,CAAC,kBAAsC;IACtE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,GAAG,kBAAkB,CAAC,cAAc,eAAe,CAAC;AAC7D,CAAC;AAED,SAAgB,YAAY,CAAC,kBAAsC;IACjE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,GAAG,kBAAkB,CAAC,cAAc,SAAS,CAAC;AACvD,CAAC;AAED,SAAgB,gBAAgB,CAAC,kBAAsC,EAAE,MAAe;IACtF,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,GAAG,kBAAkB,CAAC,cAAc,eAAe,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACzF,CAAC"}
@@ -0,0 +1,3 @@
1
+ declare const CopilotSimulator: () => import("react/jsx-runtime").JSX.Element;
2
+ export default CopilotSimulator;
3
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/webview-ui/App.tsx"],"names":[],"mappings":"AAk3BA,QAAA,MAAM,gBAAgB,+CAqCrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}