aws-runtime-bridge 1.9.33 → 1.9.40

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 (276) hide show
  1. package/dist/adapter/AcodeSdkAdapter.d.ts +35 -1
  2. package/dist/adapter/AcodeSdkAdapter.d.ts.map +1 -1
  3. package/dist/adapter/AcodeSdkAdapter.js +417 -40
  4. package/dist/adapter/ClaudeSdkAdapter.d.ts +6 -0
  5. package/dist/adapter/ClaudeSdkAdapter.d.ts.map +1 -1
  6. package/dist/adapter/ClaudeSdkAdapter.js +23 -1
  7. package/dist/adapter/idle-poll-loop.d.ts +2 -1
  8. package/dist/adapter/idle-poll-loop.d.ts.map +1 -1
  9. package/dist/adapter/types.d.ts +65 -3
  10. package/dist/adapter/types.d.ts.map +1 -1
  11. package/dist/adapter/types.js +5 -4
  12. package/dist/index.js +4 -0
  13. package/dist/routes/acode-todos.d.ts +11 -0
  14. package/dist/routes/acode-todos.d.ts.map +1 -0
  15. package/dist/routes/acode-todos.js +75 -0
  16. package/dist/routes/memory.d.ts +1 -1
  17. package/dist/routes/memory.d.ts.map +1 -1
  18. package/dist/routes/memory.js +3 -3
  19. package/dist/routes/pty.d.ts.map +1 -1
  20. package/dist/routes/pty.js +9 -0
  21. package/dist/routes/sub-agents.d.ts +14 -0
  22. package/dist/routes/sub-agents.d.ts.map +1 -0
  23. package/dist/routes/sub-agents.js +253 -0
  24. package/dist/routes/terminal.d.ts +9 -1
  25. package/dist/routes/terminal.d.ts.map +1 -1
  26. package/dist/routes/terminal.js +207 -22
  27. package/dist/services/agent-event-store.d.ts +1 -0
  28. package/dist/services/agent-event-store.d.ts.map +1 -1
  29. package/dist/services/event-delta-pusher.js +4 -4
  30. package/dist/services/session-output.d.ts +3 -0
  31. package/dist/services/session-output.d.ts.map +1 -1
  32. package/dist/services/session-output.js +38 -2
  33. package/dist/services/sub-agent-manager-instance.d.ts +4 -0
  34. package/dist/services/sub-agent-manager-instance.d.ts.map +1 -0
  35. package/dist/services/sub-agent-manager-instance.js +12 -0
  36. package/dist/services/workspace-files.d.ts +1 -0
  37. package/dist/services/workspace-files.d.ts.map +1 -1
  38. package/dist/services/workspace-files.js +57 -1
  39. package/package/acode/dist/ask-user-question-tool.d.ts +47 -0
  40. package/package/acode/dist/ask-user-question-tool.d.ts.map +1 -0
  41. package/package/acode/dist/ask-user-question-tool.js +233 -0
  42. package/package/acode/dist/built-in-file-tools.d.ts +2 -0
  43. package/package/acode/dist/built-in-file-tools.d.ts.map +1 -1
  44. package/package/acode/dist/compaction.d.ts +206 -0
  45. package/package/acode/dist/compaction.d.ts.map +1 -0
  46. package/package/acode/dist/compaction.js +664 -0
  47. package/package/acode/dist/config.d.ts +6 -1
  48. package/package/acode/dist/config.d.ts.map +1 -1
  49. package/package/acode/dist/config.js +27 -2
  50. package/package/acode/dist/index.d.ts +4 -0
  51. package/package/acode/dist/index.d.ts.map +1 -1
  52. package/package/acode/dist/index.js +4 -0
  53. package/package/acode/dist/runtime.d.ts +137 -0
  54. package/package/acode/dist/runtime.d.ts.map +1 -1
  55. package/package/acode/dist/runtime.js +974 -172
  56. package/package/acode/dist/skill-tool.d.ts +30 -0
  57. package/package/acode/dist/skill-tool.d.ts.map +1 -0
  58. package/package/acode/dist/skill-tool.js +174 -0
  59. package/package/acode/dist/sub-agent-manager.d.ts +169 -0
  60. package/package/acode/dist/sub-agent-manager.d.ts.map +1 -0
  61. package/package/acode/dist/sub-agent-manager.js +535 -0
  62. package/package/acode/dist/sub-agent-store.d.ts +33 -0
  63. package/package/acode/dist/sub-agent-store.d.ts.map +1 -0
  64. package/package/acode/dist/sub-agent-store.js +109 -0
  65. package/package/acode/dist/sub-agent-tools.d.ts +72 -0
  66. package/package/acode/dist/sub-agent-tools.d.ts.map +1 -0
  67. package/package/acode/dist/sub-agent-tools.js +429 -0
  68. package/package/acode/dist/sub-agent-types.d.ts +81 -0
  69. package/package/acode/dist/sub-agent-types.d.ts.map +1 -0
  70. package/package/acode/dist/sub-agent-types.js +8 -0
  71. package/package/acode/dist/todo-store.d.ts +42 -0
  72. package/package/acode/dist/todo-store.d.ts.map +1 -0
  73. package/package/acode/dist/todo-store.js +68 -0
  74. package/package/acode/dist/todo-tool.d.ts +6 -0
  75. package/package/acode/dist/todo-tool.d.ts.map +1 -0
  76. package/package/acode/dist/todo-tool.js +138 -0
  77. package/package/acode/dist/types.d.ts +22 -1
  78. package/package/acode/dist/types.d.ts.map +1 -1
  79. package/package/acode/package.json +13 -2
  80. package/package/aws-client-agent-mcp/dist/context-manager.test.js +0 -3
  81. package/package/aws-client-agent-mcp/dist/context-manager.test.js.map +1 -1
  82. package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +83 -50
  83. package/package/aws-client-agent-mcp/dist/mcp-server.d.ts.map +1 -1
  84. package/package/aws-client-agent-mcp/dist/mcp-server.js +451 -346
  85. package/package/aws-client-agent-mcp/dist/mcp-server.js.map +1 -1
  86. package/package/aws-client-agent-mcp/dist/mcp-server.test.js +259 -241
  87. package/package/aws-client-agent-mcp/dist/mcp-server.test.js.map +1 -1
  88. package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts +1 -19
  89. package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts.map +1 -1
  90. package/package/aws-client-agent-mcp/dist/mcp-tools.js +4 -77
  91. package/package/aws-client-agent-mcp/dist/mcp-tools.js.map +1 -1
  92. package/package/aws-client-agent-mcp/dist/memory-store.d.ts +17 -40
  93. package/package/aws-client-agent-mcp/dist/memory-store.d.ts.map +1 -1
  94. package/package/aws-client-agent-mcp/dist/memory-store.js +62 -149
  95. package/package/aws-client-agent-mcp/dist/memory-store.js.map +1 -1
  96. package/package/aws-client-agent-mcp/dist/memory-store.test.js +175 -164
  97. package/package/aws-client-agent-mcp/dist/memory-store.test.js.map +1 -1
  98. package/package/aws-client-agent-mcp/dist/memory-tools.d.ts +3 -9
  99. package/package/aws-client-agent-mcp/dist/memory-tools.d.ts.map +1 -1
  100. package/package/aws-client-agent-mcp/dist/memory-tools.js +28 -55
  101. package/package/aws-client-agent-mcp/dist/memory-tools.js.map +1 -1
  102. package/package/aws-client-agent-mcp/dist/message-buffer.d.ts +27 -9
  103. package/package/aws-client-agent-mcp/dist/message-buffer.d.ts.map +1 -1
  104. package/package/aws-client-agent-mcp/dist/message-buffer.js +100 -23
  105. package/package/aws-client-agent-mcp/dist/message-buffer.js.map +1 -1
  106. package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts +1 -14
  107. package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts.map +1 -1
  108. package/package/aws-client-agent-mcp/dist/server-memory-store.js +7 -18
  109. package/package/aws-client-agent-mcp/dist/server-memory-store.js.map +1 -1
  110. package/package/aws-client-agent-mcp/dist/status-reporter.d.ts.map +1 -1
  111. package/package/aws-client-agent-mcp/dist/status-reporter.js +8 -5
  112. package/package/aws-client-agent-mcp/dist/status-reporter.js.map +1 -1
  113. package/package/aws-client-agent-mcp/dist/status-reporter.test.js +93 -0
  114. package/package/aws-client-agent-mcp/dist/status-reporter.test.js.map +1 -1
  115. package/package/aws-client-agent-mcp/dist/types.d.ts +3 -25
  116. package/package/aws-client-agent-mcp/dist/types.d.ts.map +1 -1
  117. package/package.json +17 -7
  118. package/dist/adapter/AcodeSdkAdapter.test.d.ts +0 -2
  119. package/dist/adapter/AcodeSdkAdapter.test.d.ts.map +0 -1
  120. package/dist/adapter/AcodeSdkAdapter.test.js +0 -2000
  121. package/dist/adapter/AdapterRegistry.test.d.ts +0 -5
  122. package/dist/adapter/AdapterRegistry.test.d.ts.map +0 -1
  123. package/dist/adapter/AdapterRegistry.test.js +0 -118
  124. package/dist/adapter/ClaudeSdkAdapter.test.d.ts +0 -2
  125. package/dist/adapter/ClaudeSdkAdapter.test.d.ts.map +0 -1
  126. package/dist/adapter/ClaudeSdkAdapter.test.js +0 -311
  127. package/dist/adapter/CodexSdkAdapter.test.d.ts +0 -2
  128. package/dist/adapter/CodexSdkAdapter.test.d.ts.map +0 -1
  129. package/dist/adapter/CodexSdkAdapter.test.js +0 -270
  130. package/dist/adapter/OpencodeSdkAdapter.test.d.ts +0 -2
  131. package/dist/adapter/OpencodeSdkAdapter.test.d.ts.map +0 -1
  132. package/dist/adapter/OpencodeSdkAdapter.test.js +0 -158
  133. package/dist/adapter/acode-tool-names.test.d.ts +0 -2
  134. package/dist/adapter/acode-tool-names.test.d.ts.map +0 -1
  135. package/dist/adapter/acode-tool-names.test.js +0 -28
  136. package/dist/adapter/adapter.test.d.ts +0 -5
  137. package/dist/adapter/adapter.test.d.ts.map +0 -1
  138. package/dist/adapter/adapter.test.js +0 -180
  139. package/dist/adapter/idle-poll-loop.test.d.ts +0 -2
  140. package/dist/adapter/idle-poll-loop.test.d.ts.map +0 -1
  141. package/dist/adapter/idle-poll-loop.test.js +0 -85
  142. package/dist/adapter/types.test.d.ts +0 -2
  143. package/dist/adapter/types.test.d.ts.map +0 -1
  144. package/dist/adapter/types.test.js +0 -50
  145. package/dist/adapters/cc-switch/mcp-acode.test.d.ts +0 -2
  146. package/dist/adapters/cc-switch/mcp-acode.test.d.ts.map +0 -1
  147. package/dist/adapters/cc-switch/mcp-acode.test.js +0 -80
  148. package/dist/adapters/cc-switch/mcp-claudecode.test.d.ts +0 -2
  149. package/dist/adapters/cc-switch/mcp-claudecode.test.d.ts.map +0 -1
  150. package/dist/adapters/cc-switch/mcp-claudecode.test.js +0 -75
  151. package/dist/adapters/cc-switch/mcp-codex.test.d.ts +0 -2
  152. package/dist/adapters/cc-switch/mcp-codex.test.d.ts.map +0 -1
  153. package/dist/adapters/cc-switch/mcp-codex.test.js +0 -126
  154. package/dist/adapters/cc-switch/mcp-opencode.test.d.ts +0 -2
  155. package/dist/adapters/cc-switch/mcp-opencode.test.d.ts.map +0 -1
  156. package/dist/adapters/cc-switch/mcp-opencode.test.js +0 -62
  157. package/dist/adapters/cc-switch/skill-directory.test.d.ts +0 -2
  158. package/dist/adapters/cc-switch/skill-directory.test.d.ts.map +0 -1
  159. package/dist/adapters/cc-switch/skill-directory.test.js +0 -74
  160. package/dist/config.test.d.ts +0 -2
  161. package/dist/config.test.d.ts.map +0 -1
  162. package/dist/config.test.js +0 -107
  163. package/dist/routes/ai-sources.test.d.ts +0 -2
  164. package/dist/routes/ai-sources.test.d.ts.map +0 -1
  165. package/dist/routes/ai-sources.test.js +0 -169
  166. package/dist/routes/file-browser.test.d.ts +0 -5
  167. package/dist/routes/file-browser.test.d.ts.map +0 -1
  168. package/dist/routes/file-browser.test.js +0 -155
  169. package/dist/routes/git.test.d.ts +0 -2
  170. package/dist/routes/git.test.d.ts.map +0 -1
  171. package/dist/routes/git.test.js +0 -330
  172. package/dist/routes/instance.test.d.ts +0 -5
  173. package/dist/routes/instance.test.d.ts.map +0 -1
  174. package/dist/routes/instance.test.js +0 -389
  175. package/dist/routes/mcp.test.d.ts +0 -5
  176. package/dist/routes/mcp.test.d.ts.map +0 -1
  177. package/dist/routes/mcp.test.js +0 -92
  178. package/dist/routes/memory-route-wiring.test.d.ts +0 -2
  179. package/dist/routes/memory-route-wiring.test.d.ts.map +0 -1
  180. package/dist/routes/memory-route-wiring.test.js +0 -15
  181. package/dist/routes/memory.test.d.ts +0 -2
  182. package/dist/routes/memory.test.d.ts.map +0 -1
  183. package/dist/routes/memory.test.js +0 -177
  184. package/dist/routes/properties.test.d.ts +0 -5
  185. package/dist/routes/properties.test.d.ts.map +0 -1
  186. package/dist/routes/properties.test.js +0 -72
  187. package/dist/routes/pty.test.d.ts +0 -2
  188. package/dist/routes/pty.test.d.ts.map +0 -1
  189. package/dist/routes/pty.test.js +0 -82
  190. package/dist/routes/runtime-binding.test.d.ts +0 -2
  191. package/dist/routes/runtime-binding.test.d.ts.map +0 -1
  192. package/dist/routes/runtime-binding.test.js +0 -32
  193. package/dist/routes/sessions.test.d.ts +0 -5
  194. package/dist/routes/sessions.test.d.ts.map +0 -1
  195. package/dist/routes/sessions.test.js +0 -86
  196. package/dist/routes/skills.test.d.ts +0 -5
  197. package/dist/routes/skills.test.d.ts.map +0 -1
  198. package/dist/routes/skills.test.js +0 -50
  199. package/dist/routes/system-metrics.test.d.ts +0 -2
  200. package/dist/routes/system-metrics.test.d.ts.map +0 -1
  201. package/dist/routes/system-metrics.test.js +0 -16
  202. package/dist/routes/terminal.stop-options.test.d.ts +0 -2
  203. package/dist/routes/terminal.stop-options.test.d.ts.map +0 -1
  204. package/dist/routes/terminal.stop-options.test.js +0 -39
  205. package/dist/routes/terminal.test.d.ts +0 -2
  206. package/dist/routes/terminal.test.d.ts.map +0 -1
  207. package/dist/routes/terminal.test.js +0 -746
  208. package/dist/routes/yml.test.d.ts +0 -5
  209. package/dist/routes/yml.test.d.ts.map +0 -1
  210. package/dist/routes/yml.test.js +0 -58
  211. package/dist/services/ai-source-apply.test.d.ts +0 -2
  212. package/dist/services/ai-source-apply.test.d.ts.map +0 -1
  213. package/dist/services/ai-source-apply.test.js +0 -138
  214. package/dist/services/auto-register.test.d.ts +0 -2
  215. package/dist/services/auto-register.test.d.ts.map +0 -1
  216. package/dist/services/auto-register.test.js +0 -184
  217. package/dist/services/aws-client-agent-mcp.test.d.ts +0 -2
  218. package/dist/services/aws-client-agent-mcp.test.d.ts.map +0 -1
  219. package/dist/services/aws-client-agent-mcp.test.js +0 -242
  220. package/dist/services/bridge-package-publish-hooks.test.d.ts +0 -2
  221. package/dist/services/bridge-package-publish-hooks.test.d.ts.map +0 -1
  222. package/dist/services/bridge-package-publish-hooks.test.js +0 -136
  223. package/dist/services/cc-switch-discovery.test.d.ts +0 -2
  224. package/dist/services/cc-switch-discovery.test.d.ts.map +0 -1
  225. package/dist/services/cc-switch-discovery.test.js +0 -56
  226. package/dist/services/cli-commands.test.d.ts +0 -2
  227. package/dist/services/cli-commands.test.d.ts.map +0 -1
  228. package/dist/services/cli-commands.test.js +0 -230
  229. package/dist/services/instance-init-service.test.d.ts +0 -2
  230. package/dist/services/instance-init-service.test.d.ts.map +0 -1
  231. package/dist/services/instance-init-service.test.js +0 -140
  232. package/dist/services/instance-state.test.d.ts +0 -2
  233. package/dist/services/instance-state.test.d.ts.map +0 -1
  234. package/dist/services/instance-state.test.js +0 -245
  235. package/dist/services/mcp-launch-binding-queue.test.d.ts +0 -2
  236. package/dist/services/mcp-launch-binding-queue.test.d.ts.map +0 -1
  237. package/dist/services/mcp-launch-binding-queue.test.js +0 -181
  238. package/dist/services/runtime-binding.test.d.ts +0 -2
  239. package/dist/services/runtime-binding.test.d.ts.map +0 -1
  240. package/dist/services/runtime-binding.test.js +0 -78
  241. package/dist/services/runtime-lifecycle-policy.test.d.ts +0 -2
  242. package/dist/services/runtime-lifecycle-policy.test.d.ts.map +0 -1
  243. package/dist/services/runtime-lifecycle-policy.test.js +0 -41
  244. package/dist/services/session-output.test.d.ts +0 -5
  245. package/dist/services/session-output.test.d.ts.map +0 -1
  246. package/dist/services/session-output.test.js +0 -177
  247. package/dist/services/startup-config-wizard.test.d.ts +0 -2
  248. package/dist/services/startup-config-wizard.test.d.ts.map +0 -1
  249. package/dist/services/startup-config-wizard.test.js +0 -184
  250. package/dist/services/terminal-persistence.test.d.ts +0 -5
  251. package/dist/services/terminal-persistence.test.d.ts.map +0 -1
  252. package/dist/services/terminal-persistence.test.js +0 -159
  253. package/dist/services/tool-installer.test.d.ts +0 -2
  254. package/dist/services/tool-installer.test.d.ts.map +0 -1
  255. package/dist/services/tool-installer.test.js +0 -225
  256. package/dist/services/workspace-files.test.d.ts +0 -2
  257. package/dist/services/workspace-files.test.d.ts.map +0 -1
  258. package/dist/services/workspace-files.test.js +0 -648
  259. package/dist/services/workspace-watch.test.d.ts +0 -2
  260. package/dist/services/workspace-watch.test.d.ts.map +0 -1
  261. package/dist/services/workspace-watch.test.js +0 -38
  262. package/dist/utils/file-utils.test.d.ts +0 -2
  263. package/dist/utils/file-utils.test.d.ts.map +0 -1
  264. package/dist/utils/file-utils.test.js +0 -244
  265. package/dist/utils/logger.test.d.ts +0 -2
  266. package/dist/utils/logger.test.d.ts.map +0 -1
  267. package/dist/utils/logger.test.js +0 -93
  268. package/dist/utils/sdk-package-loader.test.d.ts +0 -2
  269. package/dist/utils/sdk-package-loader.test.d.ts.map +0 -1
  270. package/dist/utils/sdk-package-loader.test.js +0 -84
  271. package/dist/utils/validation.test.d.ts +0 -2
  272. package/dist/utils/validation.test.d.ts.map +0 -1
  273. package/dist/utils/validation.test.js +0 -88
  274. package/dist/utils/yaml-utils.test.d.ts +0 -2
  275. package/dist/utils/yaml-utils.test.d.ts.map +0 -1
  276. package/dist/utils/yaml-utils.test.js +0 -363
@@ -1,85 +0,0 @@
1
- import { afterEach, describe, expect, it, vi } from 'vitest';
2
- import { IdlePollLoop } from './idle-poll-loop.js';
3
- afterEach(() => {
4
- vi.useRealTimers();
5
- });
6
- describe('IdlePollLoop', () => {
7
- it('dispatches poll commands immediately when the session is waiting for input', async () => {
8
- const dispatchPollingPrompt = vi.fn();
9
- const loop = new IdlePollLoop({
10
- getStatus: () => 'waiting_input',
11
- getCommand: () => 'poll_message',
12
- isPollingCommand: (command) => command.includes('poll_message'),
13
- dispatchPollingPrompt,
14
- dispatchRegularIdleCommand: vi.fn(),
15
- });
16
- loop.start();
17
- expect(dispatchPollingPrompt).toHaveBeenCalledTimes(1);
18
- expect(dispatchPollingPrompt).toHaveBeenCalledWith('poll_message');
19
- });
20
- it('supports an explicit poll command delay for compatibility', async () => {
21
- vi.useFakeTimers();
22
- const dispatchPollingPrompt = vi.fn();
23
- const loop = new IdlePollLoop({
24
- getStatus: () => 'waiting_input',
25
- getCommand: () => 'poll_message',
26
- isPollingCommand: (command) => command.includes('poll_message'),
27
- dispatchPollingPrompt,
28
- dispatchRegularIdleCommand: vi.fn(),
29
- pollDelayMs: 1500,
30
- });
31
- loop.start();
32
- await vi.advanceTimersByTimeAsync(1499);
33
- expect(dispatchPollingPrompt).not.toHaveBeenCalled();
34
- await vi.advanceTimersByTimeAsync(1);
35
- expect(dispatchPollingPrompt).toHaveBeenCalledTimes(1);
36
- expect(dispatchPollingPrompt).toHaveBeenCalledWith('poll_message');
37
- });
38
- it('does not dispatch when the session is busy', () => {
39
- const dispatchPollingPrompt = vi.fn();
40
- const loop = new IdlePollLoop({
41
- getStatus: () => 'thinking',
42
- getCommand: () => 'poll_message',
43
- isPollingCommand: (command) => command.includes('poll_message'),
44
- dispatchPollingPrompt,
45
- dispatchRegularIdleCommand: vi.fn(),
46
- });
47
- loop.start();
48
- expect(dispatchPollingPrompt).not.toHaveBeenCalled();
49
- });
50
- it('keeps only one delayed regular idle command scheduled', async () => {
51
- vi.useFakeTimers();
52
- const dispatchRegularIdleCommand = vi.fn();
53
- const loop = new IdlePollLoop({
54
- getStatus: () => 'waiting_input',
55
- getCommand: () => 'continue',
56
- isPollingCommand: () => false,
57
- dispatchPollingPrompt: vi.fn(),
58
- dispatchRegularIdleCommand,
59
- regularIdleDelayMs: 1500,
60
- });
61
- loop.start();
62
- loop.start();
63
- await vi.advanceTimersByTimeAsync(1499);
64
- expect(dispatchRegularIdleCommand).not.toHaveBeenCalled();
65
- await vi.advanceTimersByTimeAsync(1);
66
- expect(dispatchRegularIdleCommand).toHaveBeenCalledTimes(1);
67
- expect(dispatchRegularIdleCommand).toHaveBeenCalledWith('continue');
68
- });
69
- it('can cancel a scheduled regular idle command', async () => {
70
- vi.useFakeTimers();
71
- const dispatchRegularIdleCommand = vi.fn();
72
- const loop = new IdlePollLoop({
73
- getStatus: () => 'waiting_input',
74
- getCommand: () => 'continue',
75
- isPollingCommand: () => false,
76
- dispatchPollingPrompt: vi.fn(),
77
- dispatchRegularIdleCommand,
78
- regularIdleDelayMs: 1500,
79
- });
80
- loop.start();
81
- loop.stop();
82
- await vi.advanceTimersByTimeAsync(1500);
83
- expect(dispatchRegularIdleCommand).not.toHaveBeenCalled();
84
- });
85
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../src/adapter/types.test.ts"],"names":[],"mappings":""}
@@ -1,50 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import { getToolActionInfo, isTransientClipboardPasteFilePath, redactTransientClipboardPastePaths, redactTransientClipboardPastePathsInValue, } from './types.js';
3
- describe('getToolActionInfo', () => {
4
- it('reports poll_message as an idle MCP listening tool call', () => {
5
- expect(getToolActionInfo('poll_message')).toEqual({
6
- actionType: 'idle',
7
- actionLabel: '监听消息',
8
- actionDetail: 'aws-mcp/poll_message',
9
- });
10
- });
11
- it('reports prefixed poll_message as a canonical idle MCP listening tool call', () => {
12
- expect(getToolActionInfo('aws-mcp__poll_message')).toEqual({
13
- actionType: 'idle',
14
- actionLabel: '监听消息',
15
- actionDetail: 'aws-mcp/poll_message',
16
- });
17
- });
18
- it('redacts transient mini-term paste paths from file action details', () => {
19
- const info = getToolActionInfo('read', {
20
- path: 'C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp\\mini-term-clipboard\\paste-1780484619651.txt',
21
- });
22
- expect(info).toEqual({
23
- actionType: 'read_file',
24
- actionLabel: '读取文件',
25
- actionDetail: '[temp clipboard paste file]',
26
- });
27
- });
28
- it('redacts transient mini-term paste paths inside displayed tool input values', () => {
29
- expect(redactTransientClipboardPastePathsInValue({
30
- command: 'type "C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp\\mini-term-clipboard\\paste-1780484619651.txt"',
31
- })).toEqual({
32
- command: 'type "[temp clipboard paste file]"',
33
- });
34
- });
35
- it('keeps normal project paths unchanged', () => {
36
- const info = getToolActionInfo('read', {
37
- path: 'D:\\code\\AgentsWorkStudio\\README.md',
38
- });
39
- expect(info.actionDetail).toBe('D:\\code\\AgentsWorkStudio\\README.md');
40
- });
41
- it('detects only standalone transient mini-term paste file paths', () => {
42
- expect(isTransientClipboardPasteFilePath('"C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp\\mini-term-clipboard\\paste-1780484619651.txt"')).toBe(true);
43
- expect(isTransientClipboardPasteFilePath('type "C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp\\mini-term-clipboard\\paste-1780484619651.txt"')).toBe(false);
44
- expect(isTransientClipboardPasteFilePath('D:\\code\\AgentsWorkStudio\\README.md')).toBe(false);
45
- });
46
- it('redacts transient mini-term paste paths before terminal display/status output', () => {
47
- expect(redactTransientClipboardPastePaths('C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp\\mini-term-clipboard\\paste-1780484619651.txt')).toBe('[temp clipboard paste file]');
48
- expect(redactTransientClipboardPastePaths('type "C:\\Users\\ZHUANG~1\\AppData\\Local\\Temp\\mini-term-clipboard\\paste-1780484619651.txt"')).toBe('type "[temp clipboard paste file]"');
49
- });
50
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mcp-acode.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-acode.test.d.ts","sourceRoot":"","sources":["../../../src/adapters/cc-switch/mcp-acode.test.ts"],"names":[],"mappings":""}
@@ -1,80 +0,0 @@
1
- import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { afterEach, beforeEach, describe, expect, it } from 'vitest';
5
- import { AcodeMcpAdapter } from './mcp-acode.js';
6
- let tempDir;
7
- let configPath;
8
- function buildServer(name = 'agents-work-studio') {
9
- return {
10
- id: 'mcp_test',
11
- name,
12
- server: {
13
- type: 'stdio',
14
- command: 'cmd',
15
- args: ['/c', 'node', 'D:\\code\\AgentsWorkStudio\\aws-runtime-bridge\\package\\aws-client-agent-mcp\\dist\\index.js'],
16
- env: {
17
- AWS_SERVER_URL: 'ws://localhost:8080/ws/agent',
18
- },
19
- },
20
- apps: {
21
- acode: true,
22
- claude: false,
23
- claudecode: false,
24
- codex: false,
25
- gemini: false,
26
- opencode: false,
27
- openclaw: false,
28
- },
29
- };
30
- }
31
- beforeEach(async () => {
32
- tempDir = await mkdtemp(path.join(os.tmpdir(), 'acode-mcp-adapter-'));
33
- configPath = path.join(tempDir, '.acode', 'config.json');
34
- });
35
- afterEach(async () => {
36
- await rm(tempDir, { recursive: true, force: true });
37
- });
38
- describe('AcodeMcpAdapter', () => {
39
- it('syncs MCP servers into ACode config mcpServers while preserving provider config', async () => {
40
- const adapter = new AcodeMcpAdapter(configPath);
41
- await mkdir(path.dirname(configPath), { recursive: true });
42
- await writeFile(configPath, JSON.stringify({ provider: { default: { model: 'test-model' } } }), 'utf-8');
43
- await adapter.syncServer(buildServer());
44
- const written = JSON.parse(await readFile(configPath, 'utf-8'));
45
- expect(written.provider?.default).toEqual({ model: 'test-model' });
46
- expect(written.mcpServers?.['agents-work-studio']).toMatchObject({
47
- type: 'stdio',
48
- command: 'cmd',
49
- args: ['/c', 'node', 'D:\\code\\AgentsWorkStudio\\aws-runtime-bridge\\package\\aws-client-agent-mcp\\dist\\index.js'],
50
- env: {
51
- AWS_SERVER_URL: 'ws://localhost:8080/ws/agent',
52
- },
53
- });
54
- });
55
- it('imports and removes ACode MCP servers', async () => {
56
- const adapter = new AcodeMcpAdapter(configPath);
57
- await mkdir(path.dirname(configPath), { recursive: true });
58
- await writeFile(configPath, JSON.stringify({
59
- mcpServers: {
60
- 'agents-work-studio': {
61
- type: 'stdio',
62
- command: 'cmd',
63
- args: ['/c', 'node', 'old.js'],
64
- },
65
- playwright: {
66
- type: 'stdio',
67
- command: 'npx',
68
- args: ['@playwright/mcp@latest'],
69
- },
70
- },
71
- }), 'utf-8');
72
- const imported = await adapter.importServers();
73
- await adapter.removeServer(buildServer());
74
- const written = JSON.parse(await readFile(configPath, 'utf-8'));
75
- expect(imported).toHaveLength(2);
76
- expect(imported[0]?.apps.acode).toBe(true);
77
- expect(written.mcpServers?.['agents-work-studio']).toBeUndefined();
78
- expect(written.mcpServers?.playwright).toBeDefined();
79
- });
80
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mcp-claudecode.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-claudecode.test.d.ts","sourceRoot":"","sources":["../../../src/adapters/cc-switch/mcp-claudecode.test.ts"],"names":[],"mappings":""}
@@ -1,75 +0,0 @@
1
- import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { afterEach, beforeEach, describe, expect, it } from 'vitest';
5
- import { ClaudecodeMcpAdapter } from './mcp-claudecode.js';
6
- let tempDir;
7
- let configPath;
8
- function buildServer(name = 'agents-work-studio') {
9
- return {
10
- id: 'mcp_test',
11
- name,
12
- server: {
13
- type: 'stdio',
14
- command: 'cmd',
15
- args: ['/c', 'node', 'D:\\code\\AgentsWorkStudio\\aws-runtime-bridge\\package\\aws-client-agent-mcp\\dist\\index.js'],
16
- env: {
17
- AWS_SERVER_URL: 'ws://localhost:8080/ws/agent',
18
- },
19
- },
20
- apps: {
21
- acode: false,
22
- claude: false,
23
- claudecode: true,
24
- codex: false,
25
- gemini: false,
26
- opencode: false,
27
- openclaw: false,
28
- },
29
- };
30
- }
31
- beforeEach(async () => {
32
- tempDir = await mkdtemp(path.join(os.tmpdir(), 'claudecode-mcp-adapter-'));
33
- configPath = path.join(tempDir, '.claude.json');
34
- });
35
- afterEach(async () => {
36
- await rm(tempDir, { recursive: true, force: true });
37
- });
38
- describe('ClaudecodeMcpAdapter', () => {
39
- it('syncs MCP servers into Claude Code global mcpServers', async () => {
40
- const adapter = new ClaudecodeMcpAdapter(configPath);
41
- await adapter.syncServer(buildServer());
42
- const written = JSON.parse(await readFile(configPath, 'utf-8'));
43
- expect(written.mcpServers?.['agents-work-studio']).toMatchObject({
44
- type: 'stdio',
45
- command: 'cmd',
46
- args: ['/c', 'node', 'D:\\code\\AgentsWorkStudio\\aws-runtime-bridge\\package\\aws-client-agent-mcp\\dist\\index.js'],
47
- env: {
48
- AWS_SERVER_URL: 'ws://localhost:8080/ws/agent',
49
- },
50
- });
51
- });
52
- it('removes MCP servers from Claude Code global mcpServers while preserving other settings', async () => {
53
- const adapter = new ClaudecodeMcpAdapter(configPath);
54
- await writeFile(configPath, JSON.stringify({
55
- env: { ANTHROPIC_MODEL: 'test' },
56
- mcpServers: {
57
- 'agents-work-studio': {
58
- command: 'cmd',
59
- args: ['/c', 'node', 'old.js'],
60
- type: 'stdio',
61
- },
62
- playwright: {
63
- command: 'cmd',
64
- args: ['/c', 'npx', '@playwright/mcp@latest'],
65
- type: 'stdio',
66
- },
67
- },
68
- }), 'utf-8');
69
- await adapter.removeServer(buildServer());
70
- const written = JSON.parse(await readFile(configPath, 'utf-8'));
71
- expect(written.env?.ANTHROPIC_MODEL).toBe('test');
72
- expect(written.mcpServers?.['agents-work-studio']).toBeUndefined();
73
- expect(written.mcpServers?.playwright).toBeDefined();
74
- });
75
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mcp-codex.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-codex.test.d.ts","sourceRoot":"","sources":["../../../src/adapters/cc-switch/mcp-codex.test.ts"],"names":[],"mappings":""}
@@ -1,126 +0,0 @@
1
- import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { afterEach, beforeEach, describe, expect, it } from 'vitest';
5
- import { CodexMcpAdapter } from './mcp-codex.js';
6
- let tempDir;
7
- let configPath;
8
- function buildServer(name = 'aws-client-agent-mcp') {
9
- return {
10
- id: 'mcp_test',
11
- name,
12
- server: {
13
- type: 'stdio',
14
- command: 'node',
15
- args: ['D:\\code\\AgentsWorkStudio\\aws-runtime-bridge\\package\\cc-switch-sdk\\dist\\index.js'],
16
- env: {
17
- AWS_AGENT_ID: 'agent-1',
18
- },
19
- },
20
- apps: {
21
- acode: false,
22
- claude: false,
23
- claudecode: false,
24
- codex: true,
25
- gemini: false,
26
- opencode: false,
27
- openclaw: false,
28
- },
29
- };
30
- }
31
- beforeEach(async () => {
32
- tempDir = await mkdtemp(path.join(os.tmpdir(), 'codex-mcp-adapter-'));
33
- configPath = path.join(tempDir, 'config.toml');
34
- });
35
- afterEach(async () => {
36
- await rm(tempDir, { recursive: true, force: true });
37
- });
38
- describe('CodexMcpAdapter', () => {
39
- it('creates a Codex config with an MCP block when none exists', async () => {
40
- const adapter = new CodexMcpAdapter(configPath);
41
- await adapter.syncServer(buildServer());
42
- const written = await readFile(configPath, 'utf-8');
43
- expect(written).toContain('[mcp_servers."aws-client-agent-mcp"]');
44
- expect(written).toContain('command = "node"');
45
- expect(written).toContain('args = ["D:\\\\code\\\\AgentsWorkStudio\\\\aws-runtime-bridge\\\\package\\\\cc-switch-sdk\\\\dist\\\\index.js"]');
46
- expect(written).toContain('[mcp_servers."aws-client-agent-mcp".env]');
47
- expect(written).toContain('AWS_AGENT_ID = "agent-1"');
48
- });
49
- it('preserves unrelated Codex model/provider config while appending MCP config', async () => {
50
- const existing = [
51
- '# user comment',
52
- 'model = "gpt-5.1"',
53
- 'model_provider = "custom"',
54
- '',
55
- '[model_providers.custom]',
56
- 'name = "Custom"',
57
- 'base_url = "https://example.test/v1"',
58
- '',
59
- ].join('\n');
60
- await writeFile(configPath, existing, 'utf-8');
61
- const adapter = new CodexMcpAdapter(configPath);
62
- await adapter.syncServer(buildServer());
63
- const written = await readFile(configPath, 'utf-8');
64
- expect(written).toContain(existing.trimEnd());
65
- expect(written).toContain('[mcp_servers."aws-client-agent-mcp"]');
66
- });
67
- it('updates an existing MCP block without duplicating it', async () => {
68
- const adapter = new CodexMcpAdapter(configPath);
69
- await adapter.syncServer(buildServer());
70
- await adapter.syncServer({
71
- ...buildServer(),
72
- server: {
73
- type: 'stdio',
74
- command: 'node',
75
- args: ['new-index.js'],
76
- env: {
77
- AWS_AGENT_ID: 'agent-2',
78
- },
79
- },
80
- });
81
- const written = await readFile(configPath, 'utf-8');
82
- expect(written.match(/\[mcp_servers\."aws-client-agent-mcp"\]/g)).toHaveLength(1);
83
- expect(written).toContain('args = ["new-index.js"]');
84
- expect(written).toContain('AWS_AGENT_ID = "agent-2"');
85
- expect(written).not.toContain('agent-1');
86
- });
87
- it('removes the MCP block and its nested env table only', async () => {
88
- const adapter = new CodexMcpAdapter(configPath);
89
- await writeFile(configPath, [
90
- 'model = "gpt-5.1"',
91
- '',
92
- '[mcp_servers."aws-client-agent-mcp"]',
93
- 'command = "node"',
94
- 'args = ["old.js"]',
95
- '',
96
- '[mcp_servers."aws-client-agent-mcp".env]',
97
- 'AWS_AGENT_ID = "agent-1"',
98
- '',
99
- '[model_providers.custom]',
100
- 'name = "Custom"',
101
- '',
102
- ].join('\n'), 'utf-8');
103
- await adapter.removeServer(buildServer());
104
- const written = await readFile(configPath, 'utf-8');
105
- expect(written).toContain('model = "gpt-5.1"');
106
- expect(written).toContain('[model_providers.custom]');
107
- expect(written).not.toContain('aws-client-agent-mcp');
108
- expect(written).not.toContain('AWS_AGENT_ID');
109
- });
110
- it('imports Codex MCP blocks', async () => {
111
- const adapter = new CodexMcpAdapter(configPath);
112
- await adapter.syncServer(buildServer());
113
- const servers = await adapter.importServers();
114
- expect(servers).toHaveLength(1);
115
- expect(servers[0]).toMatchObject({
116
- name: 'aws-client-agent-mcp',
117
- apps: { codex: true },
118
- server: {
119
- type: 'stdio',
120
- command: 'node',
121
- args: ['D:\\code\\AgentsWorkStudio\\aws-runtime-bridge\\package\\cc-switch-sdk\\dist\\index.js'],
122
- env: { AWS_AGENT_ID: 'agent-1' },
123
- },
124
- });
125
- });
126
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mcp-opencode.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mcp-opencode.test.d.ts","sourceRoot":"","sources":["../../../src/adapters/cc-switch/mcp-opencode.test.ts"],"names":[],"mappings":""}
@@ -1,62 +0,0 @@
1
- import { mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { afterEach, beforeEach, describe, expect, it } from 'vitest';
5
- import { OpenCodeMcpAdapter } from './mcp-opencode.js';
6
- let tempDir;
7
- let configPath;
8
- function buildServer(name = 'new-server') {
9
- return {
10
- id: 'mcp_test',
11
- name,
12
- server: { type: 'stdio', command: 'node', args: ['server.js'] },
13
- apps: {
14
- acode: false,
15
- claude: false,
16
- claudecode: false,
17
- codex: false,
18
- gemini: false,
19
- opencode: true,
20
- openclaw: false,
21
- },
22
- };
23
- }
24
- beforeEach(async () => {
25
- tempDir = await mkdtemp(path.join(os.tmpdir(), 'opencode-mcp-adapter-'));
26
- configPath = path.join(tempDir, 'opencode.json');
27
- });
28
- afterEach(async () => {
29
- await rm(tempDir, { recursive: true, force: true });
30
- });
31
- describe('OpenCodeMcpAdapter', () => {
32
- it('imports both current mcp and legacy mcpServers maps', async () => {
33
- await writeFile(configPath, JSON.stringify({
34
- mcp: {
35
- current: { type: 'local', command: ['node', 'current.js'] },
36
- },
37
- mcpServers: {
38
- legacy: { type: 'remote', url: 'http://legacy.example.com/sse' },
39
- },
40
- }), 'utf-8');
41
- const adapter = new OpenCodeMcpAdapter(configPath);
42
- const imported = await adapter.importServers();
43
- expect(imported.map((item) => item.name).sort()).toEqual(['current', 'legacy']);
44
- });
45
- it('writes merged MCP map back to mcp and removes legacy mcpServers', async () => {
46
- await writeFile(configPath, JSON.stringify({
47
- theme: 'dark',
48
- mcpServers: {
49
- legacy: { type: 'remote', url: 'http://legacy.example.com/sse' },
50
- },
51
- }), 'utf-8');
52
- const adapter = new OpenCodeMcpAdapter(configPath);
53
- await adapter.syncServer(buildServer());
54
- const written = JSON.parse(await readFile(configPath, 'utf-8'));
55
- expect(written.theme).toBe('dark');
56
- expect(written.mcpServers).toBeUndefined();
57
- expect(written.mcp).toMatchObject({
58
- legacy: { type: 'remote', url: 'http://legacy.example.com/sse' },
59
- 'new-server': { type: 'local', command: ['node', 'server.js'] },
60
- });
61
- });
62
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=skill-directory.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill-directory.test.d.ts","sourceRoot":"","sources":["../../../src/adapters/cc-switch/skill-directory.test.ts"],"names":[],"mappings":""}
@@ -1,74 +0,0 @@
1
- import { mkdir, mkdtemp, readFile, rm, symlink, writeFile } from 'node:fs/promises';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- import { afterEach, beforeEach, describe, expect, it } from 'vitest';
5
- import { DirectorySkillAdapter } from './skill-directory.js';
6
- let tempDir;
7
- let skillsDir;
8
- async function writeSkill(directory, body) {
9
- await mkdir(directory, { recursive: true });
10
- await writeFile(path.join(directory, 'SKILL.md'), body, 'utf-8');
11
- }
12
- function buildSkill(name = 'frontend-design') {
13
- return {
14
- id: 'skill_test',
15
- name,
16
- directory: path.join(tempDir, 'source'),
17
- description: 'A design skill',
18
- apps: {
19
- acode: false,
20
- claude: false,
21
- claudecode: true,
22
- codex: false,
23
- gemini: false,
24
- opencode: false,
25
- openclaw: false,
26
- },
27
- installedAt: Date.now(),
28
- };
29
- }
30
- beforeEach(async () => {
31
- tempDir = await mkdtemp(path.join(os.tmpdir(), 'skill-directory-adapter-'));
32
- skillsDir = path.join(tempDir, 'skills');
33
- });
34
- afterEach(async () => {
35
- await rm(tempDir, { recursive: true, force: true });
36
- });
37
- describe('DirectorySkillAdapter', () => {
38
- it('imports only skill directories with SKILL.md and parses front matter', async () => {
39
- await writeSkill(path.join(skillsDir, 'frontend-design'), '---\nname: Frontend Design\ndescription: Polished UI work\n---\n# Skill\n');
40
- await mkdir(path.join(skillsDir, 'ordinary-folder'), { recursive: true });
41
- await writeSkill(path.join(skillsDir, '.hidden-skill'), '---\nname: Hidden\n---\n');
42
- const adapter = new DirectorySkillAdapter('claudecode', skillsDir);
43
- const imported = await adapter.importSkills();
44
- expect(imported).toHaveLength(1);
45
- expect(imported[0]).toMatchObject({
46
- id: 'skill_import_claudecode_frontend-design',
47
- name: 'Frontend Design',
48
- description: 'Polished UI work',
49
- directory: path.join(skillsDir, 'frontend-design'),
50
- });
51
- });
52
- it('imports symlinked skill directories', async () => {
53
- const source = path.join(tempDir, 'linked-source');
54
- await writeSkill(source, '---\nname: Linked Skill\n---\n# Skill\n');
55
- await mkdir(skillsDir, { recursive: true });
56
- await symlink(source, path.join(skillsDir, 'linked-skill'), 'junction');
57
- const adapter = new DirectorySkillAdapter('opencode', skillsDir);
58
- const imported = await adapter.importSkills();
59
- expect(imported).toHaveLength(1);
60
- expect(imported[0]?.name).toBe('Linked Skill');
61
- });
62
- it('syncs and removes skill directories', async () => {
63
- const source = path.join(tempDir, 'source');
64
- await writeSkill(source, '# Skill\n');
65
- await writeFile(path.join(source, 'README.md'), 'hello', 'utf-8');
66
- const adapter = new DirectorySkillAdapter('codex', skillsDir);
67
- await adapter.syncSkill(buildSkill('copied-skill'), source, 'copy');
68
- const copiedReadme = await readFile(path.join(skillsDir, 'copied-skill', 'README.md'), 'utf-8');
69
- expect(copiedReadme).toBe('hello');
70
- await adapter.removeSkill(buildSkill('copied-skill'));
71
- const imported = await adapter.importSkills();
72
- expect(imported).toHaveLength(0);
73
- });
74
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=config.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../src/config.test.ts"],"names":[],"mappings":""}