@wingman-ai/gateway 0.5.3 → 0.5.4

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/dist/agent/config/agentConfig.cjs +4 -0
  2. package/dist/agent/config/agentConfig.d.ts +12 -0
  3. package/dist/agent/config/agentConfig.js +4 -0
  4. package/dist/agent/config/toolRegistry.cjs +75 -1
  5. package/dist/agent/config/toolRegistry.d.ts +3 -0
  6. package/dist/agent/config/toolRegistry.js +75 -1
  7. package/dist/agent/middleware/large-tool-results.cjs +207 -0
  8. package/dist/agent/middleware/large-tool-results.d.ts +16 -0
  9. package/dist/agent/middleware/large-tool-results.js +173 -0
  10. package/dist/agent/tools/browser_control.cjs +9 -1231
  11. package/dist/agent/tools/browser_control.d.ts +126 -234
  12. package/dist/agent/tools/browser_control.js +7 -1226
  13. package/dist/agent/tools/browser_runtime.cjs +1189 -0
  14. package/dist/agent/tools/browser_runtime.d.ts +560 -0
  15. package/dist/agent/tools/browser_runtime.js +1122 -0
  16. package/dist/agent/tools/browser_session.cjs +153 -0
  17. package/dist/agent/tools/browser_session.d.ts +741 -0
  18. package/dist/agent/tools/browser_session.js +110 -0
  19. package/dist/agent/tools/browser_session_manager.cjs +202 -0
  20. package/dist/agent/tools/browser_session_manager.d.ts +64 -0
  21. package/dist/agent/tools/browser_session_manager.js +165 -0
  22. package/dist/cli/commands/init.cjs +5 -1
  23. package/dist/cli/commands/init.js +5 -1
  24. package/dist/cli/config/loader.cjs +0 -5
  25. package/dist/cli/config/loader.js +0 -5
  26. package/dist/cli/config/schema.cjs +3 -7
  27. package/dist/cli/config/schema.d.ts +6 -6
  28. package/dist/cli/config/schema.js +3 -7
  29. package/dist/cli/core/agentInvoker.cjs +86 -22
  30. package/dist/cli/core/agentInvoker.d.ts +10 -3
  31. package/dist/cli/core/agentInvoker.js +86 -25
  32. package/dist/cli/core/outputManager.cjs +7 -2
  33. package/dist/cli/core/outputManager.d.ts +2 -2
  34. package/dist/cli/core/outputManager.js +7 -2
  35. package/dist/cli/types.d.ts +2 -1
  36. package/dist/webui/assets/index-XrEnkZiq.css +11 -0
  37. package/dist/webui/assets/index-mDs6HbKM.js +215 -0
  38. package/dist/webui/index.html +2 -2
  39. package/package.json +10 -10
  40. package/templates/agents/README.md +2 -1
  41. package/templates/agents/coding/agent.md +6 -13
  42. package/templates/agents/coding-v2/agent.md +6 -1
  43. package/templates/agents/game-dev/agent.md +8 -2
  44. package/templates/agents/game-dev/game-designer.md +4 -0
  45. package/templates/agents/game-dev/scene-engineer.md +4 -0
  46. package/templates/agents/main/agent.md +5 -0
  47. package/templates/agents/researcher/agent.md +11 -0
  48. package/templates/agents/stock-trader/agent.md +4 -0
  49. package/dist/agent/tests/agentConfig.test.cjs +0 -224
  50. package/dist/agent/tests/agentConfig.test.d.ts +0 -1
  51. package/dist/agent/tests/agentConfig.test.js +0 -218
  52. package/dist/agent/tests/agentLoader.test.cjs +0 -335
  53. package/dist/agent/tests/agentLoader.test.d.ts +0 -1
  54. package/dist/agent/tests/agentLoader.test.js +0 -329
  55. package/dist/agent/tests/backgroundTerminal.test.cjs +0 -70
  56. package/dist/agent/tests/backgroundTerminal.test.d.ts +0 -1
  57. package/dist/agent/tests/backgroundTerminal.test.js +0 -64
  58. package/dist/agent/tests/browserControlHelpers.test.cjs +0 -35
  59. package/dist/agent/tests/browserControlHelpers.test.d.ts +0 -1
  60. package/dist/agent/tests/browserControlHelpers.test.js +0 -29
  61. package/dist/agent/tests/browserControlTool.test.cjs +0 -2117
  62. package/dist/agent/tests/browserControlTool.test.d.ts +0 -1
  63. package/dist/agent/tests/browserControlTool.test.js +0 -2111
  64. package/dist/agent/tests/commandExecuteTool.test.cjs +0 -29
  65. package/dist/agent/tests/commandExecuteTool.test.d.ts +0 -1
  66. package/dist/agent/tests/commandExecuteTool.test.js +0 -23
  67. package/dist/agent/tests/internet_search.test.cjs +0 -107
  68. package/dist/agent/tests/internet_search.test.d.ts +0 -1
  69. package/dist/agent/tests/internet_search.test.js +0 -101
  70. package/dist/agent/tests/mcpClientManager.test.cjs +0 -290
  71. package/dist/agent/tests/mcpClientManager.test.d.ts +0 -1
  72. package/dist/agent/tests/mcpClientManager.test.js +0 -284
  73. package/dist/agent/tests/mcpResourceTools.test.cjs +0 -101
  74. package/dist/agent/tests/mcpResourceTools.test.d.ts +0 -1
  75. package/dist/agent/tests/mcpResourceTools.test.js +0 -95
  76. package/dist/agent/tests/modelFactory.test.cjs +0 -190
  77. package/dist/agent/tests/modelFactory.test.d.ts +0 -1
  78. package/dist/agent/tests/modelFactory.test.js +0 -184
  79. package/dist/agent/tests/terminalSessionManager.test.cjs +0 -121
  80. package/dist/agent/tests/terminalSessionManager.test.d.ts +0 -1
  81. package/dist/agent/tests/terminalSessionManager.test.js +0 -115
  82. package/dist/agent/tests/test-agent-loader.cjs +0 -33
  83. package/dist/agent/tests/test-agent-loader.d.ts +0 -1
  84. package/dist/agent/tests/test-agent-loader.js +0 -27
  85. package/dist/agent/tests/test-subagent-loading.cjs +0 -99
  86. package/dist/agent/tests/test-subagent-loading.d.ts +0 -1
  87. package/dist/agent/tests/test-subagent-loading.js +0 -93
  88. package/dist/agent/tests/toolRegistry.test.cjs +0 -147
  89. package/dist/agent/tests/toolRegistry.test.d.ts +0 -1
  90. package/dist/agent/tests/toolRegistry.test.js +0 -141
  91. package/dist/agent/tests/uiRegistryTools.test.cjs +0 -114
  92. package/dist/agent/tests/uiRegistryTools.test.d.ts +0 -1
  93. package/dist/agent/tests/uiRegistryTools.test.js +0 -105
  94. package/dist/agent/tests/xaiImageModel.test.cjs +0 -194
  95. package/dist/agent/tests/xaiImageModel.test.d.ts +0 -1
  96. package/dist/agent/tests/xaiImageModel.test.js +0 -188
  97. package/dist/tests/additionalMessageMiddleware.test.cjs +0 -216
  98. package/dist/tests/additionalMessageMiddleware.test.d.ts +0 -1
  99. package/dist/tests/additionalMessageMiddleware.test.js +0 -188
  100. package/dist/tests/agent-config-voice.test.cjs +0 -25
  101. package/dist/tests/agent-config-voice.test.d.ts +0 -1
  102. package/dist/tests/agent-config-voice.test.js +0 -19
  103. package/dist/tests/agentInvokerAttachments.test.cjs +0 -190
  104. package/dist/tests/agentInvokerAttachments.test.d.ts +0 -1
  105. package/dist/tests/agentInvokerAttachments.test.js +0 -184
  106. package/dist/tests/agentInvokerSummarization.test.cjs +0 -613
  107. package/dist/tests/agentInvokerSummarization.test.d.ts +0 -1
  108. package/dist/tests/agentInvokerSummarization.test.js +0 -607
  109. package/dist/tests/agentInvokerTokenUsage.test.cjs +0 -124
  110. package/dist/tests/agentInvokerTokenUsage.test.d.ts +0 -1
  111. package/dist/tests/agentInvokerTokenUsage.test.js +0 -118
  112. package/dist/tests/agentInvokerWorkdir.test.cjs +0 -150
  113. package/dist/tests/agentInvokerWorkdir.test.d.ts +0 -1
  114. package/dist/tests/agentInvokerWorkdir.test.js +0 -122
  115. package/dist/tests/agents-api.test.cjs +0 -324
  116. package/dist/tests/agents-api.test.d.ts +0 -1
  117. package/dist/tests/agents-api.test.js +0 -318
  118. package/dist/tests/attachments-utils.test.cjs +0 -46
  119. package/dist/tests/attachments-utils.test.d.ts +0 -1
  120. package/dist/tests/attachments-utils.test.js +0 -40
  121. package/dist/tests/browser-command.test.cjs +0 -264
  122. package/dist/tests/browser-command.test.d.ts +0 -1
  123. package/dist/tests/browser-command.test.js +0 -258
  124. package/dist/tests/browser-relay-server.test.cjs +0 -20
  125. package/dist/tests/browser-relay-server.test.d.ts +0 -1
  126. package/dist/tests/browser-relay-server.test.js +0 -14
  127. package/dist/tests/bunSqliteAdapter.test.cjs +0 -265
  128. package/dist/tests/bunSqliteAdapter.test.d.ts +0 -1
  129. package/dist/tests/bunSqliteAdapter.test.js +0 -259
  130. package/dist/tests/candleRange.test.cjs +0 -48
  131. package/dist/tests/candleRange.test.d.ts +0 -1
  132. package/dist/tests/candleRange.test.js +0 -42
  133. package/dist/tests/cli-config-loader.test.cjs +0 -532
  134. package/dist/tests/cli-config-loader.test.d.ts +0 -1
  135. package/dist/tests/cli-config-loader.test.js +0 -526
  136. package/dist/tests/cli-config-warnings.test.cjs +0 -94
  137. package/dist/tests/cli-config-warnings.test.d.ts +0 -1
  138. package/dist/tests/cli-config-warnings.test.js +0 -88
  139. package/dist/tests/cli-init.test.cjs +0 -225
  140. package/dist/tests/cli-init.test.d.ts +0 -1
  141. package/dist/tests/cli-init.test.js +0 -219
  142. package/dist/tests/cli-workspace-root.test.cjs +0 -114
  143. package/dist/tests/cli-workspace-root.test.d.ts +0 -1
  144. package/dist/tests/cli-workspace-root.test.js +0 -108
  145. package/dist/tests/codex-credentials-precedence.test.cjs +0 -94
  146. package/dist/tests/codex-credentials-precedence.test.d.ts +0 -1
  147. package/dist/tests/codex-credentials-precedence.test.js +0 -88
  148. package/dist/tests/codex-provider.test.cjs +0 -383
  149. package/dist/tests/codex-provider.test.d.ts +0 -1
  150. package/dist/tests/codex-provider.test.js +0 -377
  151. package/dist/tests/config-json-schema.test.cjs +0 -37
  152. package/dist/tests/config-json-schema.test.d.ts +0 -1
  153. package/dist/tests/config-json-schema.test.js +0 -31
  154. package/dist/tests/discord-adapter.test.cjs +0 -89
  155. package/dist/tests/discord-adapter.test.d.ts +0 -1
  156. package/dist/tests/discord-adapter.test.js +0 -83
  157. package/dist/tests/falRuntime.test.cjs +0 -78
  158. package/dist/tests/falRuntime.test.d.ts +0 -1
  159. package/dist/tests/falRuntime.test.js +0 -72
  160. package/dist/tests/falSummary.test.cjs +0 -51
  161. package/dist/tests/falSummary.test.d.ts +0 -1
  162. package/dist/tests/falSummary.test.js +0 -45
  163. package/dist/tests/fs-api.test.cjs +0 -138
  164. package/dist/tests/fs-api.test.d.ts +0 -1
  165. package/dist/tests/fs-api.test.js +0 -132
  166. package/dist/tests/gateway-command-workspace.test.cjs +0 -150
  167. package/dist/tests/gateway-command-workspace.test.d.ts +0 -1
  168. package/dist/tests/gateway-command-workspace.test.js +0 -144
  169. package/dist/tests/gateway-http-security.test.cjs +0 -318
  170. package/dist/tests/gateway-http-security.test.d.ts +0 -1
  171. package/dist/tests/gateway-http-security.test.js +0 -312
  172. package/dist/tests/gateway-node-mode.test.cjs +0 -174
  173. package/dist/tests/gateway-node-mode.test.d.ts +0 -1
  174. package/dist/tests/gateway-node-mode.test.js +0 -168
  175. package/dist/tests/gateway-origin-policy.test.cjs +0 -82
  176. package/dist/tests/gateway-origin-policy.test.d.ts +0 -1
  177. package/dist/tests/gateway-origin-policy.test.js +0 -76
  178. package/dist/tests/gateway-request-execution-overrides.test.cjs +0 -42
  179. package/dist/tests/gateway-request-execution-overrides.test.d.ts +0 -1
  180. package/dist/tests/gateway-request-execution-overrides.test.js +0 -36
  181. package/dist/tests/gateway.test.cjs +0 -700
  182. package/dist/tests/gateway.test.d.ts +0 -1
  183. package/dist/tests/gateway.test.js +0 -694
  184. package/dist/tests/hooks-matcher.test.cjs +0 -309
  185. package/dist/tests/hooks-matcher.test.d.ts +0 -1
  186. package/dist/tests/hooks-matcher.test.js +0 -303
  187. package/dist/tests/hooks-merger.test.cjs +0 -528
  188. package/dist/tests/hooks-merger.test.d.ts +0 -1
  189. package/dist/tests/hooks-merger.test.js +0 -522
  190. package/dist/tests/imagePersistence.test.cjs +0 -169
  191. package/dist/tests/imagePersistence.test.d.ts +0 -1
  192. package/dist/tests/imagePersistence.test.js +0 -163
  193. package/dist/tests/integration/agent-invocation.integration.test.cjs +0 -264
  194. package/dist/tests/integration/agent-invocation.integration.test.d.ts +0 -1
  195. package/dist/tests/integration/agent-invocation.integration.test.js +0 -258
  196. package/dist/tests/integration/finnhub-candles.integration.test.cjs +0 -98
  197. package/dist/tests/integration/finnhub-candles.integration.test.d.ts +0 -1
  198. package/dist/tests/integration/finnhub-candles.integration.test.js +0 -92
  199. package/dist/tests/integration/summarization-e2e.integration.test.cjs +0 -127
  200. package/dist/tests/integration/summarization-e2e.integration.test.d.ts +0 -1
  201. package/dist/tests/integration/summarization-e2e.integration.test.js +0 -121
  202. package/dist/tests/logger.test.cjs +0 -353
  203. package/dist/tests/logger.test.d.ts +0 -1
  204. package/dist/tests/logger.test.js +0 -347
  205. package/dist/tests/mediaCompatibilityMiddleware.test.cjs +0 -106
  206. package/dist/tests/mediaCompatibilityMiddleware.test.d.ts +0 -1
  207. package/dist/tests/mediaCompatibilityMiddleware.test.js +0 -100
  208. package/dist/tests/node-tools.test.cjs +0 -77
  209. package/dist/tests/node-tools.test.d.ts +0 -1
  210. package/dist/tests/node-tools.test.js +0 -71
  211. package/dist/tests/nodes-api.test.cjs +0 -86
  212. package/dist/tests/nodes-api.test.d.ts +0 -1
  213. package/dist/tests/nodes-api.test.js +0 -80
  214. package/dist/tests/outputManagerContextSummarized.test.cjs +0 -43
  215. package/dist/tests/outputManagerContextSummarized.test.d.ts +0 -1
  216. package/dist/tests/outputManagerContextSummarized.test.js +0 -37
  217. package/dist/tests/provider-command-codex.test.cjs +0 -57
  218. package/dist/tests/provider-command-codex.test.d.ts +0 -1
  219. package/dist/tests/provider-command-codex.test.js +0 -51
  220. package/dist/tests/routines-api.test.cjs +0 -107
  221. package/dist/tests/routines-api.test.d.ts +0 -1
  222. package/dist/tests/routines-api.test.js +0 -101
  223. package/dist/tests/run-terminal-bench-official-script.test.cjs +0 -61
  224. package/dist/tests/run-terminal-bench-official-script.test.d.ts +0 -1
  225. package/dist/tests/run-terminal-bench-official-script.test.js +0 -55
  226. package/dist/tests/sessionManager-uionly.test.cjs +0 -50
  227. package/dist/tests/sessionManager-uionly.test.d.ts +0 -1
  228. package/dist/tests/sessionManager-uionly.test.js +0 -44
  229. package/dist/tests/sessionMessageAttachments.test.cjs +0 -197
  230. package/dist/tests/sessionMessageAttachments.test.d.ts +0 -1
  231. package/dist/tests/sessionMessageAttachments.test.js +0 -191
  232. package/dist/tests/sessionMessageRole.test.cjs +0 -44
  233. package/dist/tests/sessionMessageRole.test.d.ts +0 -1
  234. package/dist/tests/sessionMessageRole.test.js +0 -38
  235. package/dist/tests/sessionStateMessages.test.cjs +0 -236
  236. package/dist/tests/sessionStateMessages.test.d.ts +0 -1
  237. package/dist/tests/sessionStateMessages.test.js +0 -230
  238. package/dist/tests/sessions-api.test.cjs +0 -250
  239. package/dist/tests/sessions-api.test.d.ts +0 -1
  240. package/dist/tests/sessions-api.test.js +0 -244
  241. package/dist/tests/skill-activation.test.cjs +0 -86
  242. package/dist/tests/skill-activation.test.d.ts +0 -1
  243. package/dist/tests/skill-activation.test.js +0 -80
  244. package/dist/tests/skill-metadata.test.cjs +0 -119
  245. package/dist/tests/skill-metadata.test.d.ts +0 -1
  246. package/dist/tests/skill-metadata.test.js +0 -113
  247. package/dist/tests/skill-repository.test.cjs +0 -469
  248. package/dist/tests/skill-repository.test.d.ts +0 -1
  249. package/dist/tests/skill-repository.test.js +0 -463
  250. package/dist/tests/skill-security-scanner.test.cjs +0 -126
  251. package/dist/tests/skill-security-scanner.test.d.ts +0 -1
  252. package/dist/tests/skill-security-scanner.test.js +0 -120
  253. package/dist/tests/sms-api.test.cjs +0 -183
  254. package/dist/tests/sms-api.test.d.ts +0 -1
  255. package/dist/tests/sms-api.test.js +0 -177
  256. package/dist/tests/sms-commands.test.cjs +0 -90
  257. package/dist/tests/sms-commands.test.d.ts +0 -1
  258. package/dist/tests/sms-commands.test.js +0 -84
  259. package/dist/tests/sms-policy-store.test.cjs +0 -69
  260. package/dist/tests/sms-policy-store.test.d.ts +0 -1
  261. package/dist/tests/sms-policy-store.test.js +0 -63
  262. package/dist/tests/teams-adapter.test.cjs +0 -58
  263. package/dist/tests/teams-adapter.test.d.ts +0 -1
  264. package/dist/tests/teams-adapter.test.js +0 -52
  265. package/dist/tests/technicalIndicators.test.cjs +0 -82
  266. package/dist/tests/technicalIndicators.test.d.ts +0 -1
  267. package/dist/tests/technicalIndicators.test.js +0 -76
  268. package/dist/tests/terminal-bench-adapters-helpers.test.cjs +0 -64
  269. package/dist/tests/terminal-bench-adapters-helpers.test.d.ts +0 -1
  270. package/dist/tests/terminal-bench-adapters-helpers.test.js +0 -58
  271. package/dist/tests/terminal-bench-cleanup.test.cjs +0 -93
  272. package/dist/tests/terminal-bench-cleanup.test.d.ts +0 -1
  273. package/dist/tests/terminal-bench-cleanup.test.js +0 -87
  274. package/dist/tests/terminal-bench-config.test.cjs +0 -62
  275. package/dist/tests/terminal-bench-config.test.d.ts +0 -1
  276. package/dist/tests/terminal-bench-config.test.js +0 -56
  277. package/dist/tests/terminal-bench-official.test.cjs +0 -194
  278. package/dist/tests/terminal-bench-official.test.d.ts +0 -1
  279. package/dist/tests/terminal-bench-official.test.js +0 -188
  280. package/dist/tests/terminal-bench-runner.test.cjs +0 -82
  281. package/dist/tests/terminal-bench-runner.test.d.ts +0 -1
  282. package/dist/tests/terminal-bench-runner.test.js +0 -76
  283. package/dist/tests/terminal-bench-scoring.test.cjs +0 -128
  284. package/dist/tests/terminal-bench-scoring.test.d.ts +0 -1
  285. package/dist/tests/terminal-bench-scoring.test.js +0 -122
  286. package/dist/tests/terminalProbe.test.cjs +0 -45
  287. package/dist/tests/terminalProbe.test.d.ts +0 -1
  288. package/dist/tests/terminalProbe.test.js +0 -39
  289. package/dist/tests/terminalProbeAuth.test.cjs +0 -85
  290. package/dist/tests/terminalProbeAuth.test.d.ts +0 -1
  291. package/dist/tests/terminalProbeAuth.test.js +0 -79
  292. package/dist/tests/toolDisplayHelpers.test.cjs +0 -46
  293. package/dist/tests/toolDisplayHelpers.test.d.ts +0 -1
  294. package/dist/tests/toolDisplayHelpers.test.js +0 -40
  295. package/dist/tests/uv.test.cjs +0 -47
  296. package/dist/tests/uv.test.d.ts +0 -1
  297. package/dist/tests/uv.test.js +0 -41
  298. package/dist/tests/voice-config.test.cjs +0 -35
  299. package/dist/tests/voice-config.test.d.ts +0 -1
  300. package/dist/tests/voice-config.test.js +0 -29
  301. package/dist/tests/websocket-transport.test.cjs +0 -31
  302. package/dist/tests/websocket-transport.test.d.ts +0 -1
  303. package/dist/tests/websocket-transport.test.js +0 -25
  304. package/dist/tests/yahooCandles.test.cjs +0 -111
  305. package/dist/tests/yahooCandles.test.d.ts +0 -1
  306. package/dist/tests/yahooCandles.test.js +0 -105
  307. package/dist/tools/finance/optionsAnalytics.test.cjs +0 -128
  308. package/dist/tools/finance/optionsAnalytics.test.d.ts +0 -1
  309. package/dist/tools/finance/optionsAnalytics.test.js +0 -122
  310. package/dist/webui/assets/index-BMf95nv5.js +0 -215
  311. package/dist/webui/assets/index-DhJQ8Mbn.css +0 -11
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __webpack_exports__ = {};
3
- const external_node_fs_namespaceObject = require("node:fs");
4
- const external_node_os_namespaceObject = require("node:os");
5
- const external_node_path_namespaceObject = require("node:path");
6
- const external_vitest_namespaceObject = require("vitest");
7
- const policyStore_cjs_namespaceObject = require("../gateway/sms/policyStore.cjs");
8
- const requireTempDir = (value)=>{
9
- if (!value) throw new Error("temp dir not initialized");
10
- return value;
11
- };
12
- (0, external_vitest_namespaceObject.describe)("sms policy store", ()=>{
13
- let tempDir = null;
14
- (0, external_vitest_namespaceObject.afterEach)(()=>{
15
- if (!tempDir) return;
16
- (0, external_node_fs_namespaceObject.rmSync)(tempDir, {
17
- recursive: true,
18
- force: true
19
- });
20
- tempDir = null;
21
- });
22
- (0, external_vitest_namespaceObject.it)("creates defaults for unknown targets without persisting", ()=>{
23
- tempDir = (0, external_node_fs_namespaceObject.mkdtempSync)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-sms-policy-"));
24
- const store = (0, policyStore_cjs_namespaceObject.createSmsPolicyStore)(()=>requireTempDir(tempDir));
25
- const record = store.resolve("sms-macos:+15555550000", 1000);
26
- (0, external_vitest_namespaceObject.expect)(record.target).toBe("sms-macos:+15555550000");
27
- (0, external_vitest_namespaceObject.expect)(record.paused).toBe(false);
28
- (0, external_vitest_namespaceObject.expect)(record.stopEnabled).toBe(false);
29
- (0, external_vitest_namespaceObject.expect)(store.list()).toHaveLength(0);
30
- });
31
- (0, external_vitest_namespaceObject.it)("persists updates and clears expired pauses on resolve", ()=>{
32
- tempDir = (0, external_node_fs_namespaceObject.mkdtempSync)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-sms-policy-"));
33
- const store = (0, policyStore_cjs_namespaceObject.createSmsPolicyStore)(()=>requireTempDir(tempDir));
34
- const target = "sms-macos:+15555550000";
35
- const saved = store.upsert(target, {
36
- paused: true,
37
- pausedUntil: 50000,
38
- stopEnabled: true
39
- }, 1000);
40
- (0, external_vitest_namespaceObject.expect)(saved.paused).toBe(true);
41
- (0, external_vitest_namespaceObject.expect)(saved.pausedUntil).toBe(50000);
42
- (0, external_vitest_namespaceObject.expect)(saved.stopEnabled).toBe(true);
43
- const active = store.resolve(target, 49000);
44
- (0, external_vitest_namespaceObject.expect)(active.paused).toBe(true);
45
- const expired = store.resolve(target, 50000);
46
- (0, external_vitest_namespaceObject.expect)(expired.paused).toBe(false);
47
- (0, external_vitest_namespaceObject.expect)(expired.pausedUntil).toBeNull();
48
- (0, external_vitest_namespaceObject.expect)(expired.stopEnabled).toBe(true);
49
- });
50
- (0, external_vitest_namespaceObject.it)("resets policies back to defaults", ()=>{
51
- tempDir = (0, external_node_fs_namespaceObject.mkdtempSync)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-sms-policy-"));
52
- const store = (0, policyStore_cjs_namespaceObject.createSmsPolicyStore)(()=>requireTempDir(tempDir));
53
- const target = "sms-macos:+15555550000";
54
- store.upsert(target, {
55
- paused: true,
56
- stopEnabled: true
57
- }, 1000);
58
- (0, external_vitest_namespaceObject.expect)(store.list()).toHaveLength(1);
59
- store.reset(target);
60
- (0, external_vitest_namespaceObject.expect)(store.list()).toHaveLength(0);
61
- const defaultRecord = store.resolve(target, 2000);
62
- (0, external_vitest_namespaceObject.expect)(defaultRecord.paused).toBe(false);
63
- (0, external_vitest_namespaceObject.expect)(defaultRecord.stopEnabled).toBe(false);
64
- });
65
- });
66
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
67
- Object.defineProperty(exports, '__esModule', {
68
- value: true
69
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,63 +0,0 @@
1
- import { mkdtempSync, rmSync } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- import { afterEach, describe, expect, it } from "vitest";
5
- import { createSmsPolicyStore } from "../gateway/sms/policyStore.js";
6
- const requireTempDir = (value)=>{
7
- if (!value) throw new Error("temp dir not initialized");
8
- return value;
9
- };
10
- describe("sms policy store", ()=>{
11
- let tempDir = null;
12
- afterEach(()=>{
13
- if (!tempDir) return;
14
- rmSync(tempDir, {
15
- recursive: true,
16
- force: true
17
- });
18
- tempDir = null;
19
- });
20
- it("creates defaults for unknown targets without persisting", ()=>{
21
- tempDir = mkdtempSync(join(tmpdir(), "wingman-sms-policy-"));
22
- const store = createSmsPolicyStore(()=>requireTempDir(tempDir));
23
- const record = store.resolve("sms-macos:+15555550000", 1000);
24
- expect(record.target).toBe("sms-macos:+15555550000");
25
- expect(record.paused).toBe(false);
26
- expect(record.stopEnabled).toBe(false);
27
- expect(store.list()).toHaveLength(0);
28
- });
29
- it("persists updates and clears expired pauses on resolve", ()=>{
30
- tempDir = mkdtempSync(join(tmpdir(), "wingman-sms-policy-"));
31
- const store = createSmsPolicyStore(()=>requireTempDir(tempDir));
32
- const target = "sms-macos:+15555550000";
33
- const saved = store.upsert(target, {
34
- paused: true,
35
- pausedUntil: 50000,
36
- stopEnabled: true
37
- }, 1000);
38
- expect(saved.paused).toBe(true);
39
- expect(saved.pausedUntil).toBe(50000);
40
- expect(saved.stopEnabled).toBe(true);
41
- const active = store.resolve(target, 49000);
42
- expect(active.paused).toBe(true);
43
- const expired = store.resolve(target, 50000);
44
- expect(expired.paused).toBe(false);
45
- expect(expired.pausedUntil).toBeNull();
46
- expect(expired.stopEnabled).toBe(true);
47
- });
48
- it("resets policies back to defaults", ()=>{
49
- tempDir = mkdtempSync(join(tmpdir(), "wingman-sms-policy-"));
50
- const store = createSmsPolicyStore(()=>requireTempDir(tempDir));
51
- const target = "sms-macos:+15555550000";
52
- store.upsert(target, {
53
- paused: true,
54
- stopEnabled: true
55
- }, 1000);
56
- expect(store.list()).toHaveLength(1);
57
- store.reset(target);
58
- expect(store.list()).toHaveLength(0);
59
- const defaultRecord = store.resolve(target, 2000);
60
- expect(defaultRecord.paused).toBe(false);
61
- expect(defaultRecord.stopEnabled).toBe(false);
62
- });
63
- });
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var __webpack_exports__ = {};
3
- const external_vitest_namespaceObject = require("vitest");
4
- const teams_cjs_namespaceObject = require("../gateway/adapters/teams.cjs");
5
- (0, external_vitest_namespaceObject.describe)("teams adapter helpers", ()=>{
6
- (0, external_vitest_namespaceObject.it)("normalizes endpoint path and falls back to default", ()=>{
7
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.normalizeTeamsEndpointPath)(void 0)).toBe(teams_cjs_namespaceObject.DEFAULT_TEAMS_ENDPOINT_PATH);
8
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.normalizeTeamsEndpointPath)("")).toBe(teams_cjs_namespaceObject.DEFAULT_TEAMS_ENDPOINT_PATH);
9
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.normalizeTeamsEndpointPath)("api/teams")).toBe("/api/teams");
10
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.normalizeTeamsEndpointPath)("/api/teams")).toBe("/api/teams");
11
- });
12
- (0, external_vitest_namespaceObject.it)("extracts mention entities for the bot", ()=>{
13
- const activity = {
14
- recipient: {
15
- name: "Wingman",
16
- id: "bot-1"
17
- },
18
- entities: [
19
- {
20
- type: "mention",
21
- text: "<at>Wingman</at>",
22
- mentioned: {
23
- id: "bot-1",
24
- name: "Wingman"
25
- }
26
- }
27
- ]
28
- };
29
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.extractTeamsMentionTexts)(activity, "bot-1")).toEqual([
30
- "<at>Wingman</at>"
31
- ]);
32
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.isTeamsBotMentioned)(activity, "bot-1")).toBe(true);
33
- });
34
- (0, external_vitest_namespaceObject.it)("strips mention tags and mention text from messages", ()=>{
35
- const text = "<at>Wingman</at> hello there";
36
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.stripTeamsBotMention)(text, [
37
- "<at>Wingman</at>"
38
- ])).toBe("hello there");
39
- });
40
- (0, external_vitest_namespaceObject.it)("splits long responses into chunks", ()=>{
41
- const input = "a".repeat(9500);
42
- const chunks = (0, teams_cjs_namespaceObject.splitTeamsMessage)(input, 3500);
43
- (0, external_vitest_namespaceObject.expect)(chunks.length).toBeGreaterThan(2);
44
- for (const chunk of chunks)(0, external_vitest_namespaceObject.expect)(chunk.length).toBeLessThanOrEqual(3500);
45
- (0, external_vitest_namespaceObject.expect)(chunks.join("")).toBe(input);
46
- });
47
- (0, external_vitest_namespaceObject.it)("resolves channel session mapping", ()=>{
48
- const map = {
49
- "19:channel:id": "agent:wingman:teams:channel"
50
- };
51
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.resolveTeamsChannelSessionKey)("19:channel:id", map)).toBe("agent:wingman:teams:channel");
52
- (0, external_vitest_namespaceObject.expect)((0, teams_cjs_namespaceObject.resolveTeamsChannelSessionKey)("missing", map)).toBeUndefined();
53
- });
54
- });
55
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
56
- Object.defineProperty(exports, '__esModule', {
57
- value: true
58
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,52 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { DEFAULT_TEAMS_ENDPOINT_PATH, extractTeamsMentionTexts, isTeamsBotMentioned, normalizeTeamsEndpointPath, resolveTeamsChannelSessionKey, splitTeamsMessage, stripTeamsBotMention } from "../gateway/adapters/teams.js";
3
- describe("teams adapter helpers", ()=>{
4
- it("normalizes endpoint path and falls back to default", ()=>{
5
- expect(normalizeTeamsEndpointPath(void 0)).toBe(DEFAULT_TEAMS_ENDPOINT_PATH);
6
- expect(normalizeTeamsEndpointPath("")).toBe(DEFAULT_TEAMS_ENDPOINT_PATH);
7
- expect(normalizeTeamsEndpointPath("api/teams")).toBe("/api/teams");
8
- expect(normalizeTeamsEndpointPath("/api/teams")).toBe("/api/teams");
9
- });
10
- it("extracts mention entities for the bot", ()=>{
11
- const activity = {
12
- recipient: {
13
- name: "Wingman",
14
- id: "bot-1"
15
- },
16
- entities: [
17
- {
18
- type: "mention",
19
- text: "<at>Wingman</at>",
20
- mentioned: {
21
- id: "bot-1",
22
- name: "Wingman"
23
- }
24
- }
25
- ]
26
- };
27
- expect(extractTeamsMentionTexts(activity, "bot-1")).toEqual([
28
- "<at>Wingman</at>"
29
- ]);
30
- expect(isTeamsBotMentioned(activity, "bot-1")).toBe(true);
31
- });
32
- it("strips mention tags and mention text from messages", ()=>{
33
- const text = "<at>Wingman</at> hello there";
34
- expect(stripTeamsBotMention(text, [
35
- "<at>Wingman</at>"
36
- ])).toBe("hello there");
37
- });
38
- it("splits long responses into chunks", ()=>{
39
- const input = "a".repeat(9500);
40
- const chunks = splitTeamsMessage(input, 3500);
41
- expect(chunks.length).toBeGreaterThan(2);
42
- for (const chunk of chunks)expect(chunk.length).toBeLessThanOrEqual(3500);
43
- expect(chunks.join("")).toBe(input);
44
- });
45
- it("resolves channel session mapping", ()=>{
46
- const map = {
47
- "19:channel:id": "agent:wingman:teams:channel"
48
- };
49
- expect(resolveTeamsChannelSessionKey("19:channel:id", map)).toBe("agent:wingman:teams:channel");
50
- expect(resolveTeamsChannelSessionKey("missing", map)).toBeUndefined();
51
- });
52
- });
@@ -1,82 +0,0 @@
1
- "use strict";
2
- var __webpack_exports__ = {};
3
- const external_vitest_namespaceObject = require("vitest");
4
- const technicalIndicators_cjs_namespaceObject = require("../tools/finance/technicalIndicators.cjs");
5
- (0, external_vitest_namespaceObject.describe)("Technical indicators", ()=>{
6
- (0, external_vitest_namespaceObject.it)("returns null when data is insufficient", ()=>{
7
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateEma)([
8
- 1,
9
- 2,
10
- 3
11
- ], 5)).toBeNull();
12
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateRsi)([
13
- 1,
14
- 2,
15
- 3
16
- ], 5)).toBeNull();
17
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateAtr)([
18
- 1,
19
- 2
20
- ], [
21
- 1,
22
- 2
23
- ], [
24
- 1,
25
- 2
26
- ], 3)).toBeNull();
27
- });
28
- (0, external_vitest_namespaceObject.it)("calculates EMA for constant series", ()=>{
29
- const values = Array.from({
30
- length: 30
31
- }, ()=>10);
32
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateEma)(values, 20)).toBeCloseTo(10, 6);
33
- });
34
- (0, external_vitest_namespaceObject.it)("calculates RSI extremes for monotonic series", ()=>{
35
- const up = Array.from({
36
- length: 20
37
- }, (_, i)=>i + 1);
38
- const down = Array.from({
39
- length: 20
40
- }, (_, i)=>20 - i);
41
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateRsi)(up, 14)).toBe(100);
42
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateRsi)(down, 14)).toBe(0);
43
- });
44
- (0, external_vitest_namespaceObject.it)("calculates ATR for stable ranges", ()=>{
45
- const highs = Array.from({
46
- length: 20
47
- }, ()=>11);
48
- const lows = Array.from({
49
- length: 20
50
- }, ()=>9);
51
- const closes = Array.from({
52
- length: 20
53
- }, ()=>10);
54
- (0, external_vitest_namespaceObject.expect)((0, technicalIndicators_cjs_namespaceObject.calculateAtr)(highs, lows, closes, 14)).toBeCloseTo(2, 6);
55
- });
56
- (0, external_vitest_namespaceObject.it)("builds a snapshot with expected keys", ()=>{
57
- const closes = Array.from({
58
- length: 250
59
- }, ()=>10);
60
- const highs = Array.from({
61
- length: 250
62
- }, ()=>11);
63
- const lows = Array.from({
64
- length: 250
65
- }, ()=>9);
66
- const snapshot = (0, technicalIndicators_cjs_namespaceObject.buildTechnicalSnapshot)({
67
- closes,
68
- highs,
69
- lows
70
- });
71
- (0, external_vitest_namespaceObject.expect)(snapshot.lastClose).toBe(10);
72
- (0, external_vitest_namespaceObject.expect)(snapshot.ema20).toBeCloseTo(10, 6);
73
- (0, external_vitest_namespaceObject.expect)(snapshot.ema50).toBeCloseTo(10, 6);
74
- (0, external_vitest_namespaceObject.expect)(snapshot.ema200).toBeCloseTo(10, 6);
75
- (0, external_vitest_namespaceObject.expect)(snapshot.rsi14).toBe(100);
76
- (0, external_vitest_namespaceObject.expect)(snapshot.atr14).toBeCloseTo(2, 6);
77
- });
78
- });
79
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
80
- Object.defineProperty(exports, '__esModule', {
81
- value: true
82
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,76 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { buildTechnicalSnapshot, calculateAtr, calculateEma, calculateRsi } from "../tools/finance/technicalIndicators.js";
3
- describe("Technical indicators", ()=>{
4
- it("returns null when data is insufficient", ()=>{
5
- expect(calculateEma([
6
- 1,
7
- 2,
8
- 3
9
- ], 5)).toBeNull();
10
- expect(calculateRsi([
11
- 1,
12
- 2,
13
- 3
14
- ], 5)).toBeNull();
15
- expect(calculateAtr([
16
- 1,
17
- 2
18
- ], [
19
- 1,
20
- 2
21
- ], [
22
- 1,
23
- 2
24
- ], 3)).toBeNull();
25
- });
26
- it("calculates EMA for constant series", ()=>{
27
- const values = Array.from({
28
- length: 30
29
- }, ()=>10);
30
- expect(calculateEma(values, 20)).toBeCloseTo(10, 6);
31
- });
32
- it("calculates RSI extremes for monotonic series", ()=>{
33
- const up = Array.from({
34
- length: 20
35
- }, (_, i)=>i + 1);
36
- const down = Array.from({
37
- length: 20
38
- }, (_, i)=>20 - i);
39
- expect(calculateRsi(up, 14)).toBe(100);
40
- expect(calculateRsi(down, 14)).toBe(0);
41
- });
42
- it("calculates ATR for stable ranges", ()=>{
43
- const highs = Array.from({
44
- length: 20
45
- }, ()=>11);
46
- const lows = Array.from({
47
- length: 20
48
- }, ()=>9);
49
- const closes = Array.from({
50
- length: 20
51
- }, ()=>10);
52
- expect(calculateAtr(highs, lows, closes, 14)).toBeCloseTo(2, 6);
53
- });
54
- it("builds a snapshot with expected keys", ()=>{
55
- const closes = Array.from({
56
- length: 250
57
- }, ()=>10);
58
- const highs = Array.from({
59
- length: 250
60
- }, ()=>11);
61
- const lows = Array.from({
62
- length: 250
63
- }, ()=>9);
64
- const snapshot = buildTechnicalSnapshot({
65
- closes,
66
- highs,
67
- lows
68
- });
69
- expect(snapshot.lastClose).toBe(10);
70
- expect(snapshot.ema20).toBeCloseTo(10, 6);
71
- expect(snapshot.ema50).toBeCloseTo(10, 6);
72
- expect(snapshot.ema200).toBeCloseTo(10, 6);
73
- expect(snapshot.rsi14).toBe(100);
74
- expect(snapshot.atr14).toBeCloseTo(2, 6);
75
- });
76
- });
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __webpack_exports__ = {};
3
- const external_vitest_namespaceObject = require("vitest");
4
- const helpers_cjs_namespaceObject = require("../bench/adapters/helpers.cjs");
5
- (0, external_vitest_namespaceObject.describe)("parseWingmanJsonOutput", ()=>{
6
- (0, external_vitest_namespaceObject.it)("extracts assistant text from ai-role messages", ()=>{
7
- const output = JSON.stringify({
8
- type: "agent-complete",
9
- result: {
10
- messages: [
11
- {
12
- role: "user",
13
- content: "ignore"
14
- },
15
- {
16
- role: "ai",
17
- content: "hello from ai role"
18
- }
19
- ]
20
- }
21
- });
22
- const parsed = (0, helpers_cjs_namespaceObject.parseWingmanJsonOutput)(output);
23
- (0, external_vitest_namespaceObject.expect)(parsed.assistantText).toBe("hello from ai role");
24
- });
25
- (0, external_vitest_namespaceObject.it)("extracts assistant text from serialized AIMessage payloads", ()=>{
26
- const output = JSON.stringify({
27
- type: "agent-complete",
28
- result: {
29
- messages: [
30
- {
31
- id: [
32
- "langchain_core",
33
- "messages",
34
- "AIMessage"
35
- ],
36
- kwargs: {
37
- content: [
38
- {
39
- type: "text",
40
- text: "hello from kwargs content"
41
- }
42
- ]
43
- }
44
- }
45
- ]
46
- }
47
- });
48
- const parsed = (0, helpers_cjs_namespaceObject.parseWingmanJsonOutput)(output);
49
- (0, external_vitest_namespaceObject.expect)(parsed.assistantText).toBe("hello from kwargs content");
50
- });
51
- });
52
- (0, external_vitest_namespaceObject.describe)("detectAssistantFailureMessage", ()=>{
53
- (0, external_vitest_namespaceObject.it)("detects provider bad request failures", ()=>{
54
- const error = (0, helpers_cjs_namespaceObject.detectAssistantFailureMessage)("Model call failed after 3 attempts with BadRequestError: 400 status code (no body)");
55
- (0, external_vitest_namespaceObject.expect)(error).toContain("BadRequestError");
56
- });
57
- (0, external_vitest_namespaceObject.it)("ignores normal assistant content", ()=>{
58
- (0, external_vitest_namespaceObject.expect)((0, helpers_cjs_namespaceObject.detectAssistantFailureMessage)('{"state_analysis":"ok","commands":[],"is_task_complete":false}')).toBeUndefined();
59
- });
60
- });
61
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
62
- Object.defineProperty(exports, '__esModule', {
63
- value: true
64
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,58 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { detectAssistantFailureMessage, parseWingmanJsonOutput } from "../bench/adapters/helpers.js";
3
- describe("parseWingmanJsonOutput", ()=>{
4
- it("extracts assistant text from ai-role messages", ()=>{
5
- const output = JSON.stringify({
6
- type: "agent-complete",
7
- result: {
8
- messages: [
9
- {
10
- role: "user",
11
- content: "ignore"
12
- },
13
- {
14
- role: "ai",
15
- content: "hello from ai role"
16
- }
17
- ]
18
- }
19
- });
20
- const parsed = parseWingmanJsonOutput(output);
21
- expect(parsed.assistantText).toBe("hello from ai role");
22
- });
23
- it("extracts assistant text from serialized AIMessage payloads", ()=>{
24
- const output = JSON.stringify({
25
- type: "agent-complete",
26
- result: {
27
- messages: [
28
- {
29
- id: [
30
- "langchain_core",
31
- "messages",
32
- "AIMessage"
33
- ],
34
- kwargs: {
35
- content: [
36
- {
37
- type: "text",
38
- text: "hello from kwargs content"
39
- }
40
- ]
41
- }
42
- }
43
- ]
44
- }
45
- });
46
- const parsed = parseWingmanJsonOutput(output);
47
- expect(parsed.assistantText).toBe("hello from kwargs content");
48
- });
49
- });
50
- describe("detectAssistantFailureMessage", ()=>{
51
- it("detects provider bad request failures", ()=>{
52
- const error = detectAssistantFailureMessage("Model call failed after 3 attempts with BadRequestError: 400 status code (no body)");
53
- expect(error).toContain("BadRequestError");
54
- });
55
- it("ignores normal assistant content", ()=>{
56
- expect(detectAssistantFailureMessage('{"state_analysis":"ok","commands":[],"is_task_complete":false}')).toBeUndefined();
57
- });
58
- });
@@ -1,93 +0,0 @@
1
- "use strict";
2
- var __webpack_exports__ = {};
3
- const external_node_fs_namespaceObject = require("node:fs");
4
- const promises_namespaceObject = require("node:fs/promises");
5
- const external_node_os_namespaceObject = require("node:os");
6
- const external_node_path_namespaceObject = require("node:path");
7
- const external_vitest_namespaceObject = require("vitest");
8
- const cleanup_cjs_namespaceObject = require("../bench/cleanup.cjs");
9
- const tempDirs = [];
10
- async function pathExists(path) {
11
- try {
12
- await (0, promises_namespaceObject.access)(path);
13
- return true;
14
- } catch {
15
- return false;
16
- }
17
- }
18
- (0, external_vitest_namespaceObject.describe)("terminal bench cleanup", ()=>{
19
- (0, external_vitest_namespaceObject.afterEach)(async ()=>{
20
- for (const dir of tempDirs)await (0, promises_namespaceObject.rm)(dir, {
21
- recursive: true,
22
- force: true
23
- });
24
- tempDirs.length = 0;
25
- });
26
- (0, external_vitest_namespaceObject.it)("targets generated bench artifacts only", async ()=>{
27
- const root = await (0, promises_namespaceObject.mkdtemp)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-bench-cleanup-"));
28
- tempDirs.push(root);
29
- const jobsRun = (0, external_node_path_namespaceObject.join)(root, "jobs", "2026-01-01__00-00-00");
30
- const officialRun = (0, external_node_path_namespaceObject.join)(root, "bench", "results", "official", "2026-01-01__00-00-00");
31
- const wrapperRun = (0, external_node_path_namespaceObject.join)(root, "bench", "results", "official-wrapper", "2026-01-01T00-00-00-000Z");
32
- const pycacheDir = (0, external_node_path_namespaceObject.join)(root, "bench", "harbor_agents", "__pycache__");
33
- const configPath = (0, external_node_path_namespaceObject.join)(root, "bench", "config.tb2-wingman.json");
34
- (0, external_node_fs_namespaceObject.mkdirSync)(jobsRun, {
35
- recursive: true
36
- });
37
- (0, external_node_fs_namespaceObject.mkdirSync)(officialRun, {
38
- recursive: true
39
- });
40
- (0, external_node_fs_namespaceObject.mkdirSync)(wrapperRun, {
41
- recursive: true
42
- });
43
- (0, external_node_fs_namespaceObject.mkdirSync)(pycacheDir, {
44
- recursive: true
45
- });
46
- (0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(jobsRun, "result.json"), "{}");
47
- (0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(officialRun, "result.json"), "{}");
48
- (0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(wrapperRun, "summary.json"), "{}");
49
- (0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(pycacheDir, "cache.pyc"), "x");
50
- (0, external_node_fs_namespaceObject.writeFileSync)(configPath, "{}");
51
- const targets = await (0, cleanup_cjs_namespaceObject.getBenchCleanupTargets)(root);
52
- (0, external_vitest_namespaceObject.expect)(targets).toContain(jobsRun);
53
- (0, external_vitest_namespaceObject.expect)(targets).toContain(officialRun);
54
- (0, external_vitest_namespaceObject.expect)(targets).toContain(wrapperRun);
55
- (0, external_vitest_namespaceObject.expect)(targets).toContain(pycacheDir);
56
- (0, external_vitest_namespaceObject.expect)(targets).not.toContain(configPath);
57
- });
58
- (0, external_vitest_namespaceObject.it)("removes generated artifacts and keeps config files", async ()=>{
59
- const root = await (0, promises_namespaceObject.mkdtemp)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-bench-cleanup-"));
60
- tempDirs.push(root);
61
- const jobsRun = (0, external_node_path_namespaceObject.join)(root, "jobs", "2026-01-01__00-00-00");
62
- const officialRun = (0, external_node_path_namespaceObject.join)(root, "bench", "results", "official", "2026-01-01__00-00-00");
63
- const wrapperRun = (0, external_node_path_namespaceObject.join)(root, "bench", "results", "official-wrapper", "2026-01-01T00-00-00-000Z");
64
- const pycacheDir = (0, external_node_path_namespaceObject.join)(root, "bench", "harbor_agents", "__pycache__");
65
- const configPath = (0, external_node_path_namespaceObject.join)(root, "bench", "config.tb2-wingman.json");
66
- (0, external_node_fs_namespaceObject.mkdirSync)(jobsRun, {
67
- recursive: true
68
- });
69
- (0, external_node_fs_namespaceObject.mkdirSync)(officialRun, {
70
- recursive: true
71
- });
72
- (0, external_node_fs_namespaceObject.mkdirSync)(wrapperRun, {
73
- recursive: true
74
- });
75
- (0, external_node_fs_namespaceObject.mkdirSync)(pycacheDir, {
76
- recursive: true
77
- });
78
- (0, external_node_fs_namespaceObject.writeFileSync)(configPath, '{"dataset":"terminal-bench@2.0"}');
79
- const result = await (0, cleanup_cjs_namespaceObject.cleanBenchArtifacts)(root);
80
- (0, external_vitest_namespaceObject.expect)(result.missingPaths).toHaveLength(0);
81
- (0, external_vitest_namespaceObject.expect)(result.removedPaths.length).toBeGreaterThanOrEqual(4);
82
- (0, external_vitest_namespaceObject.expect)(await pathExists(jobsRun)).toBe(false);
83
- (0, external_vitest_namespaceObject.expect)(await pathExists(officialRun)).toBe(false);
84
- (0, external_vitest_namespaceObject.expect)(await pathExists(wrapperRun)).toBe(false);
85
- (0, external_vitest_namespaceObject.expect)(await pathExists(pycacheDir)).toBe(false);
86
- (0, external_vitest_namespaceObject.expect)(await pathExists(configPath)).toBe(true);
87
- (0, external_vitest_namespaceObject.expect)(await (0, promises_namespaceObject.readFile)(configPath, "utf-8")).toContain("terminal-bench@2.0");
88
- });
89
- });
90
- for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
91
- Object.defineProperty(exports, '__esModule', {
92
- value: true
93
- });
@@ -1 +0,0 @@
1
- export {};