@wingman-ai/gateway 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/backend/filtered-backend.cjs +130 -0
- package/dist/agent/backend/filtered-backend.d.ts +10 -0
- package/dist/agent/backend/filtered-backend.js +87 -0
- package/dist/agent/config/agentConfig.cjs +4 -0
- package/dist/agent/config/agentConfig.d.ts +12 -0
- package/dist/agent/config/agentConfig.js +4 -0
- package/dist/agent/config/toolRegistry.cjs +75 -1
- package/dist/agent/config/toolRegistry.d.ts +3 -0
- package/dist/agent/config/toolRegistry.js +75 -1
- package/dist/agent/middleware/additional-messages.cjs +4 -1
- package/dist/agent/middleware/additional-messages.js +4 -1
- package/dist/agent/middleware/large-tool-results.cjs +207 -0
- package/dist/agent/middleware/large-tool-results.d.ts +16 -0
- package/dist/agent/middleware/large-tool-results.js +173 -0
- package/dist/agent/tools/browser_control.cjs +9 -1231
- package/dist/agent/tools/browser_control.d.ts +126 -234
- package/dist/agent/tools/browser_control.js +7 -1226
- package/dist/agent/tools/browser_runtime.cjs +1358 -0
- package/dist/agent/tools/browser_runtime.d.ts +617 -0
- package/dist/agent/tools/browser_runtime.js +1288 -0
- package/dist/agent/tools/browser_session.cjs +189 -0
- package/dist/agent/tools/browser_session.d.ts +686 -0
- package/dist/agent/tools/browser_session.js +146 -0
- package/dist/agent/tools/browser_session_manager.cjs +213 -0
- package/dist/agent/tools/browser_session_manager.d.ts +70 -0
- package/dist/agent/tools/browser_session_manager.js +176 -0
- package/dist/cli/commands/init.cjs +80 -98
- package/dist/cli/commands/init.js +80 -98
- package/dist/cli/config/loader.cjs +0 -5
- package/dist/cli/config/loader.js +0 -5
- package/dist/cli/config/schema.cjs +3 -7
- package/dist/cli/config/schema.d.ts +6 -6
- package/dist/cli/config/schema.js +3 -7
- package/dist/cli/core/agentInvoker.cjs +88 -22
- package/dist/cli/core/agentInvoker.d.ts +10 -3
- package/dist/cli/core/agentInvoker.js +88 -25
- package/dist/cli/core/outputManager.cjs +7 -2
- package/dist/cli/core/outputManager.d.ts +2 -2
- package/dist/cli/core/outputManager.js +7 -2
- package/dist/cli/core/sessionManager.cjs +208 -41
- package/dist/cli/core/sessionManager.d.ts +20 -0
- package/dist/cli/core/sessionManager.js +208 -41
- package/dist/cli/index.cjs +16 -1
- package/dist/cli/index.js +16 -1
- package/dist/cli/services/updateCheck.cjs +212 -0
- package/dist/cli/services/updateCheck.d.ts +26 -0
- package/dist/cli/services/updateCheck.js +166 -0
- package/dist/cli/types.d.ts +2 -1
- package/dist/gateway/server.cjs +7 -0
- package/dist/gateway/server.js +7 -0
- package/dist/webui/assets/index-D3x3G75t.css +11 -0
- package/dist/webui/assets/index-UpMmcU1f.js +215 -0
- package/dist/webui/index.html +2 -2
- package/package.json +12 -12
- package/templates/agents/README.md +3 -1
- package/templates/agents/coding/agent.md +6 -13
- package/templates/agents/coding-v2/agent.md +6 -1
- package/templates/agents/game-dev/agent.md +9 -2
- package/templates/agents/game-dev/game-designer.md +4 -0
- package/templates/agents/game-dev/scene-engineer.md +4 -0
- package/templates/agents/main/agent.md +7 -2
- package/templates/agents/researcher/agent.md +14 -3
- package/templates/agents/stock-trader/agent.md +4 -0
- package/dist/agent/tests/agentConfig.test.cjs +0 -224
- package/dist/agent/tests/agentConfig.test.d.ts +0 -1
- package/dist/agent/tests/agentConfig.test.js +0 -218
- package/dist/agent/tests/agentLoader.test.cjs +0 -335
- package/dist/agent/tests/agentLoader.test.d.ts +0 -1
- package/dist/agent/tests/agentLoader.test.js +0 -329
- package/dist/agent/tests/backgroundTerminal.test.cjs +0 -70
- package/dist/agent/tests/backgroundTerminal.test.d.ts +0 -1
- package/dist/agent/tests/backgroundTerminal.test.js +0 -64
- package/dist/agent/tests/browserControlHelpers.test.cjs +0 -35
- package/dist/agent/tests/browserControlHelpers.test.d.ts +0 -1
- package/dist/agent/tests/browserControlHelpers.test.js +0 -29
- package/dist/agent/tests/browserControlTool.test.cjs +0 -2117
- package/dist/agent/tests/browserControlTool.test.d.ts +0 -1
- package/dist/agent/tests/browserControlTool.test.js +0 -2111
- package/dist/agent/tests/commandExecuteTool.test.cjs +0 -29
- package/dist/agent/tests/commandExecuteTool.test.d.ts +0 -1
- package/dist/agent/tests/commandExecuteTool.test.js +0 -23
- package/dist/agent/tests/internet_search.test.cjs +0 -107
- package/dist/agent/tests/internet_search.test.d.ts +0 -1
- package/dist/agent/tests/internet_search.test.js +0 -101
- package/dist/agent/tests/mcpClientManager.test.cjs +0 -290
- package/dist/agent/tests/mcpClientManager.test.d.ts +0 -1
- package/dist/agent/tests/mcpClientManager.test.js +0 -284
- package/dist/agent/tests/mcpResourceTools.test.cjs +0 -101
- package/dist/agent/tests/mcpResourceTools.test.d.ts +0 -1
- package/dist/agent/tests/mcpResourceTools.test.js +0 -95
- package/dist/agent/tests/modelFactory.test.cjs +0 -190
- package/dist/agent/tests/modelFactory.test.d.ts +0 -1
- package/dist/agent/tests/modelFactory.test.js +0 -184
- package/dist/agent/tests/terminalSessionManager.test.cjs +0 -121
- package/dist/agent/tests/terminalSessionManager.test.d.ts +0 -1
- package/dist/agent/tests/terminalSessionManager.test.js +0 -115
- package/dist/agent/tests/test-agent-loader.cjs +0 -33
- package/dist/agent/tests/test-agent-loader.d.ts +0 -1
- package/dist/agent/tests/test-agent-loader.js +0 -27
- package/dist/agent/tests/test-subagent-loading.cjs +0 -99
- package/dist/agent/tests/test-subagent-loading.d.ts +0 -1
- package/dist/agent/tests/test-subagent-loading.js +0 -93
- package/dist/agent/tests/toolRegistry.test.cjs +0 -147
- package/dist/agent/tests/toolRegistry.test.d.ts +0 -1
- package/dist/agent/tests/toolRegistry.test.js +0 -141
- package/dist/agent/tests/uiRegistryTools.test.cjs +0 -114
- package/dist/agent/tests/uiRegistryTools.test.d.ts +0 -1
- package/dist/agent/tests/uiRegistryTools.test.js +0 -105
- package/dist/agent/tests/xaiImageModel.test.cjs +0 -194
- package/dist/agent/tests/xaiImageModel.test.d.ts +0 -1
- package/dist/agent/tests/xaiImageModel.test.js +0 -188
- package/dist/tests/additionalMessageMiddleware.test.cjs +0 -216
- package/dist/tests/additionalMessageMiddleware.test.d.ts +0 -1
- package/dist/tests/additionalMessageMiddleware.test.js +0 -188
- package/dist/tests/agent-config-voice.test.cjs +0 -25
- package/dist/tests/agent-config-voice.test.d.ts +0 -1
- package/dist/tests/agent-config-voice.test.js +0 -19
- package/dist/tests/agentInvokerAttachments.test.cjs +0 -190
- package/dist/tests/agentInvokerAttachments.test.d.ts +0 -1
- package/dist/tests/agentInvokerAttachments.test.js +0 -184
- package/dist/tests/agentInvokerSummarization.test.cjs +0 -613
- package/dist/tests/agentInvokerSummarization.test.d.ts +0 -1
- package/dist/tests/agentInvokerSummarization.test.js +0 -607
- package/dist/tests/agentInvokerTokenUsage.test.cjs +0 -124
- package/dist/tests/agentInvokerTokenUsage.test.d.ts +0 -1
- package/dist/tests/agentInvokerTokenUsage.test.js +0 -118
- package/dist/tests/agentInvokerWorkdir.test.cjs +0 -150
- package/dist/tests/agentInvokerWorkdir.test.d.ts +0 -1
- package/dist/tests/agentInvokerWorkdir.test.js +0 -122
- package/dist/tests/agents-api.test.cjs +0 -324
- package/dist/tests/agents-api.test.d.ts +0 -1
- package/dist/tests/agents-api.test.js +0 -318
- package/dist/tests/attachments-utils.test.cjs +0 -46
- package/dist/tests/attachments-utils.test.d.ts +0 -1
- package/dist/tests/attachments-utils.test.js +0 -40
- package/dist/tests/browser-command.test.cjs +0 -264
- package/dist/tests/browser-command.test.d.ts +0 -1
- package/dist/tests/browser-command.test.js +0 -258
- package/dist/tests/browser-relay-server.test.cjs +0 -20
- package/dist/tests/browser-relay-server.test.d.ts +0 -1
- package/dist/tests/browser-relay-server.test.js +0 -14
- package/dist/tests/bunSqliteAdapter.test.cjs +0 -265
- package/dist/tests/bunSqliteAdapter.test.d.ts +0 -1
- package/dist/tests/bunSqliteAdapter.test.js +0 -259
- package/dist/tests/candleRange.test.cjs +0 -48
- package/dist/tests/candleRange.test.d.ts +0 -1
- package/dist/tests/candleRange.test.js +0 -42
- package/dist/tests/cli-config-loader.test.cjs +0 -532
- package/dist/tests/cli-config-loader.test.d.ts +0 -1
- package/dist/tests/cli-config-loader.test.js +0 -526
- package/dist/tests/cli-config-warnings.test.cjs +0 -94
- package/dist/tests/cli-config-warnings.test.d.ts +0 -1
- package/dist/tests/cli-config-warnings.test.js +0 -88
- package/dist/tests/cli-init.test.cjs +0 -225
- package/dist/tests/cli-init.test.d.ts +0 -1
- package/dist/tests/cli-init.test.js +0 -219
- package/dist/tests/cli-workspace-root.test.cjs +0 -114
- package/dist/tests/cli-workspace-root.test.d.ts +0 -1
- package/dist/tests/cli-workspace-root.test.js +0 -108
- package/dist/tests/codex-credentials-precedence.test.cjs +0 -94
- package/dist/tests/codex-credentials-precedence.test.d.ts +0 -1
- package/dist/tests/codex-credentials-precedence.test.js +0 -88
- package/dist/tests/codex-provider.test.cjs +0 -383
- package/dist/tests/codex-provider.test.d.ts +0 -1
- package/dist/tests/codex-provider.test.js +0 -377
- package/dist/tests/config-json-schema.test.cjs +0 -37
- package/dist/tests/config-json-schema.test.d.ts +0 -1
- package/dist/tests/config-json-schema.test.js +0 -31
- package/dist/tests/discord-adapter.test.cjs +0 -89
- package/dist/tests/discord-adapter.test.d.ts +0 -1
- package/dist/tests/discord-adapter.test.js +0 -83
- package/dist/tests/falRuntime.test.cjs +0 -78
- package/dist/tests/falRuntime.test.d.ts +0 -1
- package/dist/tests/falRuntime.test.js +0 -72
- package/dist/tests/falSummary.test.cjs +0 -51
- package/dist/tests/falSummary.test.d.ts +0 -1
- package/dist/tests/falSummary.test.js +0 -45
- package/dist/tests/fs-api.test.cjs +0 -138
- package/dist/tests/fs-api.test.d.ts +0 -1
- package/dist/tests/fs-api.test.js +0 -132
- package/dist/tests/gateway-command-workspace.test.cjs +0 -150
- package/dist/tests/gateway-command-workspace.test.d.ts +0 -1
- package/dist/tests/gateway-command-workspace.test.js +0 -144
- package/dist/tests/gateway-http-security.test.cjs +0 -318
- package/dist/tests/gateway-http-security.test.d.ts +0 -1
- package/dist/tests/gateway-http-security.test.js +0 -312
- package/dist/tests/gateway-node-mode.test.cjs +0 -174
- package/dist/tests/gateway-node-mode.test.d.ts +0 -1
- package/dist/tests/gateway-node-mode.test.js +0 -168
- package/dist/tests/gateway-origin-policy.test.cjs +0 -82
- package/dist/tests/gateway-origin-policy.test.d.ts +0 -1
- package/dist/tests/gateway-origin-policy.test.js +0 -76
- package/dist/tests/gateway-request-execution-overrides.test.cjs +0 -42
- package/dist/tests/gateway-request-execution-overrides.test.d.ts +0 -1
- package/dist/tests/gateway-request-execution-overrides.test.js +0 -36
- package/dist/tests/gateway.test.cjs +0 -700
- package/dist/tests/gateway.test.d.ts +0 -1
- package/dist/tests/gateway.test.js +0 -694
- package/dist/tests/hooks-matcher.test.cjs +0 -309
- package/dist/tests/hooks-matcher.test.d.ts +0 -1
- package/dist/tests/hooks-matcher.test.js +0 -303
- package/dist/tests/hooks-merger.test.cjs +0 -528
- package/dist/tests/hooks-merger.test.d.ts +0 -1
- package/dist/tests/hooks-merger.test.js +0 -522
- package/dist/tests/imagePersistence.test.cjs +0 -169
- package/dist/tests/imagePersistence.test.d.ts +0 -1
- package/dist/tests/imagePersistence.test.js +0 -163
- package/dist/tests/integration/agent-invocation.integration.test.cjs +0 -264
- package/dist/tests/integration/agent-invocation.integration.test.d.ts +0 -1
- package/dist/tests/integration/agent-invocation.integration.test.js +0 -258
- package/dist/tests/integration/finnhub-candles.integration.test.cjs +0 -98
- package/dist/tests/integration/finnhub-candles.integration.test.d.ts +0 -1
- package/dist/tests/integration/finnhub-candles.integration.test.js +0 -92
- package/dist/tests/integration/summarization-e2e.integration.test.cjs +0 -127
- package/dist/tests/integration/summarization-e2e.integration.test.d.ts +0 -1
- package/dist/tests/integration/summarization-e2e.integration.test.js +0 -121
- package/dist/tests/logger.test.cjs +0 -353
- package/dist/tests/logger.test.d.ts +0 -1
- package/dist/tests/logger.test.js +0 -347
- package/dist/tests/mediaCompatibilityMiddleware.test.cjs +0 -106
- package/dist/tests/mediaCompatibilityMiddleware.test.d.ts +0 -1
- package/dist/tests/mediaCompatibilityMiddleware.test.js +0 -100
- package/dist/tests/node-tools.test.cjs +0 -77
- package/dist/tests/node-tools.test.d.ts +0 -1
- package/dist/tests/node-tools.test.js +0 -71
- package/dist/tests/nodes-api.test.cjs +0 -86
- package/dist/tests/nodes-api.test.d.ts +0 -1
- package/dist/tests/nodes-api.test.js +0 -80
- package/dist/tests/outputManagerContextSummarized.test.cjs +0 -43
- package/dist/tests/outputManagerContextSummarized.test.d.ts +0 -1
- package/dist/tests/outputManagerContextSummarized.test.js +0 -37
- package/dist/tests/provider-command-codex.test.cjs +0 -57
- package/dist/tests/provider-command-codex.test.d.ts +0 -1
- package/dist/tests/provider-command-codex.test.js +0 -51
- package/dist/tests/routines-api.test.cjs +0 -107
- package/dist/tests/routines-api.test.d.ts +0 -1
- package/dist/tests/routines-api.test.js +0 -101
- package/dist/tests/run-terminal-bench-official-script.test.cjs +0 -61
- package/dist/tests/run-terminal-bench-official-script.test.d.ts +0 -1
- package/dist/tests/run-terminal-bench-official-script.test.js +0 -55
- package/dist/tests/sessionManager-uionly.test.cjs +0 -50
- package/dist/tests/sessionManager-uionly.test.d.ts +0 -1
- package/dist/tests/sessionManager-uionly.test.js +0 -44
- package/dist/tests/sessionMessageAttachments.test.cjs +0 -197
- package/dist/tests/sessionMessageAttachments.test.d.ts +0 -1
- package/dist/tests/sessionMessageAttachments.test.js +0 -191
- package/dist/tests/sessionMessageRole.test.cjs +0 -44
- package/dist/tests/sessionMessageRole.test.d.ts +0 -1
- package/dist/tests/sessionMessageRole.test.js +0 -38
- package/dist/tests/sessionStateMessages.test.cjs +0 -236
- package/dist/tests/sessionStateMessages.test.d.ts +0 -1
- package/dist/tests/sessionStateMessages.test.js +0 -230
- package/dist/tests/sessions-api.test.cjs +0 -250
- package/dist/tests/sessions-api.test.d.ts +0 -1
- package/dist/tests/sessions-api.test.js +0 -244
- package/dist/tests/skill-activation.test.cjs +0 -86
- package/dist/tests/skill-activation.test.d.ts +0 -1
- package/dist/tests/skill-activation.test.js +0 -80
- package/dist/tests/skill-metadata.test.cjs +0 -119
- package/dist/tests/skill-metadata.test.d.ts +0 -1
- package/dist/tests/skill-metadata.test.js +0 -113
- package/dist/tests/skill-repository.test.cjs +0 -469
- package/dist/tests/skill-repository.test.d.ts +0 -1
- package/dist/tests/skill-repository.test.js +0 -463
- package/dist/tests/skill-security-scanner.test.cjs +0 -126
- package/dist/tests/skill-security-scanner.test.d.ts +0 -1
- package/dist/tests/skill-security-scanner.test.js +0 -120
- package/dist/tests/sms-api.test.cjs +0 -183
- package/dist/tests/sms-api.test.d.ts +0 -1
- package/dist/tests/sms-api.test.js +0 -177
- package/dist/tests/sms-commands.test.cjs +0 -90
- package/dist/tests/sms-commands.test.d.ts +0 -1
- package/dist/tests/sms-commands.test.js +0 -84
- package/dist/tests/sms-policy-store.test.cjs +0 -69
- package/dist/tests/sms-policy-store.test.d.ts +0 -1
- package/dist/tests/sms-policy-store.test.js +0 -63
- package/dist/tests/teams-adapter.test.cjs +0 -58
- package/dist/tests/teams-adapter.test.d.ts +0 -1
- package/dist/tests/teams-adapter.test.js +0 -52
- package/dist/tests/technicalIndicators.test.cjs +0 -82
- package/dist/tests/technicalIndicators.test.d.ts +0 -1
- package/dist/tests/technicalIndicators.test.js +0 -76
- package/dist/tests/terminal-bench-adapters-helpers.test.cjs +0 -64
- package/dist/tests/terminal-bench-adapters-helpers.test.d.ts +0 -1
- package/dist/tests/terminal-bench-adapters-helpers.test.js +0 -58
- package/dist/tests/terminal-bench-cleanup.test.cjs +0 -93
- package/dist/tests/terminal-bench-cleanup.test.d.ts +0 -1
- package/dist/tests/terminal-bench-cleanup.test.js +0 -87
- package/dist/tests/terminal-bench-config.test.cjs +0 -62
- package/dist/tests/terminal-bench-config.test.d.ts +0 -1
- package/dist/tests/terminal-bench-config.test.js +0 -56
- package/dist/tests/terminal-bench-official.test.cjs +0 -194
- package/dist/tests/terminal-bench-official.test.d.ts +0 -1
- package/dist/tests/terminal-bench-official.test.js +0 -188
- package/dist/tests/terminal-bench-runner.test.cjs +0 -82
- package/dist/tests/terminal-bench-runner.test.d.ts +0 -1
- package/dist/tests/terminal-bench-runner.test.js +0 -76
- package/dist/tests/terminal-bench-scoring.test.cjs +0 -128
- package/dist/tests/terminal-bench-scoring.test.d.ts +0 -1
- package/dist/tests/terminal-bench-scoring.test.js +0 -122
- package/dist/tests/terminalProbe.test.cjs +0 -45
- package/dist/tests/terminalProbe.test.d.ts +0 -1
- package/dist/tests/terminalProbe.test.js +0 -39
- package/dist/tests/terminalProbeAuth.test.cjs +0 -85
- package/dist/tests/terminalProbeAuth.test.d.ts +0 -1
- package/dist/tests/terminalProbeAuth.test.js +0 -79
- package/dist/tests/toolDisplayHelpers.test.cjs +0 -46
- package/dist/tests/toolDisplayHelpers.test.d.ts +0 -1
- package/dist/tests/toolDisplayHelpers.test.js +0 -40
- package/dist/tests/uv.test.cjs +0 -47
- package/dist/tests/uv.test.d.ts +0 -1
- package/dist/tests/uv.test.js +0 -41
- package/dist/tests/voice-config.test.cjs +0 -35
- package/dist/tests/voice-config.test.d.ts +0 -1
- package/dist/tests/voice-config.test.js +0 -29
- package/dist/tests/websocket-transport.test.cjs +0 -31
- package/dist/tests/websocket-transport.test.d.ts +0 -1
- package/dist/tests/websocket-transport.test.js +0 -25
- package/dist/tests/yahooCandles.test.cjs +0 -111
- package/dist/tests/yahooCandles.test.d.ts +0 -1
- package/dist/tests/yahooCandles.test.js +0 -105
- package/dist/tools/finance/optionsAnalytics.test.cjs +0 -128
- package/dist/tools/finance/optionsAnalytics.test.d.ts +0 -1
- package/dist/tools/finance/optionsAnalytics.test.js +0 -122
- package/dist/webui/assets/index-BMf95nv5.js +0 -215
- package/dist/webui/assets/index-DhJQ8Mbn.css +0 -11
- package/dist/webui/assets/wingman_logo-Cogyt3qm.webp +0 -0
|
@@ -1,82 +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 runner_cjs_namespaceObject = require("../bench/runner.cjs");
|
|
8
|
-
(0, external_vitest_namespaceObject.describe)("terminal bench runner", ()=>{
|
|
9
|
-
const workdirs = [];
|
|
10
|
-
(0, external_vitest_namespaceObject.afterEach)(()=>{
|
|
11
|
-
for (const workdir of workdirs)(0, external_node_fs_namespaceObject.rmSync)(workdir, {
|
|
12
|
-
recursive: true,
|
|
13
|
-
force: true
|
|
14
|
-
});
|
|
15
|
-
workdirs.length = 0;
|
|
16
|
-
});
|
|
17
|
-
(0, external_vitest_namespaceObject.it)("runs tasks with command adapter and writes artifacts", async ()=>{
|
|
18
|
-
const workdir = (0, external_node_fs_namespaceObject.mkdtempSync)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-bench-runner-"));
|
|
19
|
-
workdirs.push(workdir);
|
|
20
|
-
const benchmarkDir = (0, external_node_path_namespaceObject.join)(workdir, "bench");
|
|
21
|
-
const tasksDir = (0, external_node_path_namespaceObject.join)(benchmarkDir, "tasks");
|
|
22
|
-
const sandboxDir = (0, external_node_path_namespaceObject.join)(benchmarkDir, "sandbox");
|
|
23
|
-
(0, external_node_fs_namespaceObject.mkdirSync)(tasksDir, {
|
|
24
|
-
recursive: true
|
|
25
|
-
});
|
|
26
|
-
(0, external_node_fs_namespaceObject.mkdirSync)(sandboxDir, {
|
|
27
|
-
recursive: true
|
|
28
|
-
});
|
|
29
|
-
(0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(tasksDir, "suite.json"), JSON.stringify({
|
|
30
|
-
tasks: [
|
|
31
|
-
{
|
|
32
|
-
id: "write-output",
|
|
33
|
-
prompt: "FILE_OK",
|
|
34
|
-
workingDirectory: "sandbox",
|
|
35
|
-
setup: [
|
|
36
|
-
{
|
|
37
|
-
command: "rm",
|
|
38
|
-
args: [
|
|
39
|
-
"-f",
|
|
40
|
-
"output.txt"
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
validator: {
|
|
45
|
-
type: "file_contains",
|
|
46
|
-
path: "output.txt",
|
|
47
|
-
includes: [
|
|
48
|
-
"FILE_OK"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
}, null, 2));
|
|
54
|
-
(0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(benchmarkDir, "config.json"), JSON.stringify({
|
|
55
|
-
taskFile: "tasks/suite.json",
|
|
56
|
-
resultsDir: "results",
|
|
57
|
-
adapter: {
|
|
58
|
-
type: "command",
|
|
59
|
-
command: {
|
|
60
|
-
command: "sh",
|
|
61
|
-
args: [
|
|
62
|
-
"-lc",
|
|
63
|
-
"printf '%s\\n' \"$WINGMAN_BENCH_PROMPT\" > output.txt; echo COMPLETE"
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}, null, 2));
|
|
68
|
-
const summary = await (0, runner_cjs_namespaceObject.runTerminalBench)({
|
|
69
|
-
configPath: (0, external_node_path_namespaceObject.join)(benchmarkDir, "config.json")
|
|
70
|
-
});
|
|
71
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.totalTasks).toBe(1);
|
|
72
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.passedTasks).toBe(1);
|
|
73
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.failedTasks).toBe(0);
|
|
74
|
-
(0, external_vitest_namespaceObject.expect)((0, external_node_fs_namespaceObject.existsSync)((0, external_node_path_namespaceObject.join)(summary.resultsDir, "summary.json"))).toBe(true);
|
|
75
|
-
(0, external_vitest_namespaceObject.expect)((0, external_node_fs_namespaceObject.existsSync)((0, external_node_path_namespaceObject.join)(summary.resultsDir, "write-output.assistant.txt"))).toBe(true);
|
|
76
|
-
(0, external_vitest_namespaceObject.expect)((0, external_node_fs_namespaceObject.readFileSync)((0, external_node_path_namespaceObject.join)(sandboxDir, "output.txt"), "utf-8")).toContain("FILE_OK");
|
|
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 { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } 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 { runTerminalBench } from "../bench/runner.js";
|
|
6
|
-
describe("terminal bench runner", ()=>{
|
|
7
|
-
const workdirs = [];
|
|
8
|
-
afterEach(()=>{
|
|
9
|
-
for (const workdir of workdirs)rmSync(workdir, {
|
|
10
|
-
recursive: true,
|
|
11
|
-
force: true
|
|
12
|
-
});
|
|
13
|
-
workdirs.length = 0;
|
|
14
|
-
});
|
|
15
|
-
it("runs tasks with command adapter and writes artifacts", async ()=>{
|
|
16
|
-
const workdir = mkdtempSync(join(tmpdir(), "wingman-bench-runner-"));
|
|
17
|
-
workdirs.push(workdir);
|
|
18
|
-
const benchmarkDir = join(workdir, "bench");
|
|
19
|
-
const tasksDir = join(benchmarkDir, "tasks");
|
|
20
|
-
const sandboxDir = join(benchmarkDir, "sandbox");
|
|
21
|
-
mkdirSync(tasksDir, {
|
|
22
|
-
recursive: true
|
|
23
|
-
});
|
|
24
|
-
mkdirSync(sandboxDir, {
|
|
25
|
-
recursive: true
|
|
26
|
-
});
|
|
27
|
-
writeFileSync(join(tasksDir, "suite.json"), JSON.stringify({
|
|
28
|
-
tasks: [
|
|
29
|
-
{
|
|
30
|
-
id: "write-output",
|
|
31
|
-
prompt: "FILE_OK",
|
|
32
|
-
workingDirectory: "sandbox",
|
|
33
|
-
setup: [
|
|
34
|
-
{
|
|
35
|
-
command: "rm",
|
|
36
|
-
args: [
|
|
37
|
-
"-f",
|
|
38
|
-
"output.txt"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
validator: {
|
|
43
|
-
type: "file_contains",
|
|
44
|
-
path: "output.txt",
|
|
45
|
-
includes: [
|
|
46
|
-
"FILE_OK"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}, null, 2));
|
|
52
|
-
writeFileSync(join(benchmarkDir, "config.json"), JSON.stringify({
|
|
53
|
-
taskFile: "tasks/suite.json",
|
|
54
|
-
resultsDir: "results",
|
|
55
|
-
adapter: {
|
|
56
|
-
type: "command",
|
|
57
|
-
command: {
|
|
58
|
-
command: "sh",
|
|
59
|
-
args: [
|
|
60
|
-
"-lc",
|
|
61
|
-
"printf '%s\\n' \"$WINGMAN_BENCH_PROMPT\" > output.txt; echo COMPLETE"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}, null, 2));
|
|
66
|
-
const summary = await runTerminalBench({
|
|
67
|
-
configPath: join(benchmarkDir, "config.json")
|
|
68
|
-
});
|
|
69
|
-
expect(summary.metrics.totalTasks).toBe(1);
|
|
70
|
-
expect(summary.metrics.passedTasks).toBe(1);
|
|
71
|
-
expect(summary.metrics.failedTasks).toBe(0);
|
|
72
|
-
expect(existsSync(join(summary.resultsDir, "summary.json"))).toBe(true);
|
|
73
|
-
expect(existsSync(join(summary.resultsDir, "write-output.assistant.txt"))).toBe(true);
|
|
74
|
-
expect(readFileSync(join(sandboxDir, "output.txt"), "utf-8")).toContain("FILE_OK");
|
|
75
|
-
});
|
|
76
|
-
});
|
|
@@ -1,128 +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 scoring_cjs_namespaceObject = require("../bench/scoring.cjs");
|
|
8
|
-
function createTask(id, status, durationMs) {
|
|
9
|
-
return {
|
|
10
|
-
taskId: id,
|
|
11
|
-
status,
|
|
12
|
-
workingDirectory: "/tmp",
|
|
13
|
-
prompt: "prompt",
|
|
14
|
-
startedAt: new Date().toISOString(),
|
|
15
|
-
endedAt: new Date().toISOString(),
|
|
16
|
-
durationMs,
|
|
17
|
-
setup: {
|
|
18
|
-
runCount: 0
|
|
19
|
-
},
|
|
20
|
-
adapter: {
|
|
21
|
-
exitCode: "passed" === status ? 0 : 1,
|
|
22
|
-
timedOut: false,
|
|
23
|
-
durationMs,
|
|
24
|
-
stdout: "",
|
|
25
|
-
stderr: "",
|
|
26
|
-
assistantText: "ok",
|
|
27
|
-
tokens: {
|
|
28
|
-
inputTokens: 100,
|
|
29
|
-
outputTokens: 200,
|
|
30
|
-
totalTokens: 300
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
validator: {
|
|
34
|
-
passed: "passed" === status,
|
|
35
|
-
details: status
|
|
36
|
-
},
|
|
37
|
-
artifacts: {
|
|
38
|
-
stdoutFile: "stdout.log",
|
|
39
|
-
stderrFile: "stderr.log",
|
|
40
|
-
assistantFile: "assistant.txt",
|
|
41
|
-
recordFile: "record.json"
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function createConfig(workdir) {
|
|
46
|
-
return {
|
|
47
|
-
version: 1,
|
|
48
|
-
configPath: (0, external_node_path_namespaceObject.join)(workdir, "config.json"),
|
|
49
|
-
taskFilePath: (0, external_node_path_namespaceObject.join)(workdir, "tasks.json"),
|
|
50
|
-
resultsDir: (0, external_node_path_namespaceObject.join)(workdir, "results"),
|
|
51
|
-
run: {
|
|
52
|
-
defaultTimeoutMs: 10000,
|
|
53
|
-
continueOnFailure: true
|
|
54
|
-
},
|
|
55
|
-
adapter: {
|
|
56
|
-
type: "command",
|
|
57
|
-
command: {
|
|
58
|
-
command: "echo"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
tasks: [],
|
|
62
|
-
scoring: {
|
|
63
|
-
weights: {
|
|
64
|
-
passRate: 0.8,
|
|
65
|
-
reliability: 0.2,
|
|
66
|
-
duration: 0,
|
|
67
|
-
cost: 0
|
|
68
|
-
},
|
|
69
|
-
budgets: {},
|
|
70
|
-
pricing: {
|
|
71
|
-
inputPer1kTokensUsd: 0.001,
|
|
72
|
-
outputPer1kTokensUsd: 0.002
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
qualityGate: {
|
|
76
|
-
enabled: true,
|
|
77
|
-
baselineFile: (0, external_node_path_namespaceObject.join)(workdir, "baseline.json"),
|
|
78
|
-
minPassRateDelta: -0.1,
|
|
79
|
-
maxCostIncreaseRatio: 1,
|
|
80
|
-
maxAvgDurationIncreaseRatio: 1
|
|
81
|
-
},
|
|
82
|
-
metadata: {}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
(0, external_vitest_namespaceObject.describe)("terminal bench scoring", ()=>{
|
|
86
|
-
const workdirs = [];
|
|
87
|
-
(0, external_vitest_namespaceObject.afterEach)(()=>{
|
|
88
|
-
for (const workdir of workdirs)(0, external_node_fs_namespaceObject.rmSync)(workdir, {
|
|
89
|
-
recursive: true,
|
|
90
|
-
force: true
|
|
91
|
-
});
|
|
92
|
-
workdirs.length = 0;
|
|
93
|
-
});
|
|
94
|
-
(0, external_vitest_namespaceObject.it)("computes summary metrics and applies quality gate", async ()=>{
|
|
95
|
-
const workdir = (0, external_node_fs_namespaceObject.mkdtempSync)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "wingman-bench-score-"));
|
|
96
|
-
workdirs.push(workdir);
|
|
97
|
-
const baseline = {
|
|
98
|
-
metrics: {
|
|
99
|
-
passRate: 1,
|
|
100
|
-
totalCostUsd: 0.001,
|
|
101
|
-
avgDurationMs: 100
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
(0, external_node_fs_namespaceObject.writeFileSync)((0, external_node_path_namespaceObject.join)(workdir, "baseline.json"), JSON.stringify(baseline));
|
|
105
|
-
const summary = await (0, scoring_cjs_namespaceObject.buildTerminalBenchSummary)({
|
|
106
|
-
runId: "run-1",
|
|
107
|
-
startedAt: new Date().toISOString(),
|
|
108
|
-
endedAt: new Date().toISOString(),
|
|
109
|
-
config: createConfig(workdir),
|
|
110
|
-
resultsDir: (0, external_node_path_namespaceObject.join)(workdir, "results", "run-1"),
|
|
111
|
-
tasks: [
|
|
112
|
-
createTask("a", "passed", 100),
|
|
113
|
-
createTask("b", "failed", 200)
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.totalTasks).toBe(2);
|
|
117
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.passedTasks).toBe(1);
|
|
118
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.passRate).toBeCloseTo(0.5);
|
|
119
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.totalTokens).toBe(600);
|
|
120
|
-
(0, external_vitest_namespaceObject.expect)(summary.metrics.totalCostUsd).toBeCloseTo(0.001);
|
|
121
|
-
(0, external_vitest_namespaceObject.expect)(summary.qualityGate.passed).toBe(false);
|
|
122
|
-
(0, external_vitest_namespaceObject.expect)(summary.qualityGate.messages.length).toBeGreaterThan(0);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
126
|
-
Object.defineProperty(exports, '__esModule', {
|
|
127
|
-
value: true
|
|
128
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { mkdtempSync, rmSync, writeFileSync } 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 { buildTerminalBenchSummary } from "../bench/scoring.js";
|
|
6
|
-
function createTask(id, status, durationMs) {
|
|
7
|
-
return {
|
|
8
|
-
taskId: id,
|
|
9
|
-
status,
|
|
10
|
-
workingDirectory: "/tmp",
|
|
11
|
-
prompt: "prompt",
|
|
12
|
-
startedAt: new Date().toISOString(),
|
|
13
|
-
endedAt: new Date().toISOString(),
|
|
14
|
-
durationMs,
|
|
15
|
-
setup: {
|
|
16
|
-
runCount: 0
|
|
17
|
-
},
|
|
18
|
-
adapter: {
|
|
19
|
-
exitCode: "passed" === status ? 0 : 1,
|
|
20
|
-
timedOut: false,
|
|
21
|
-
durationMs,
|
|
22
|
-
stdout: "",
|
|
23
|
-
stderr: "",
|
|
24
|
-
assistantText: "ok",
|
|
25
|
-
tokens: {
|
|
26
|
-
inputTokens: 100,
|
|
27
|
-
outputTokens: 200,
|
|
28
|
-
totalTokens: 300
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
validator: {
|
|
32
|
-
passed: "passed" === status,
|
|
33
|
-
details: status
|
|
34
|
-
},
|
|
35
|
-
artifacts: {
|
|
36
|
-
stdoutFile: "stdout.log",
|
|
37
|
-
stderrFile: "stderr.log",
|
|
38
|
-
assistantFile: "assistant.txt",
|
|
39
|
-
recordFile: "record.json"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function createConfig(workdir) {
|
|
44
|
-
return {
|
|
45
|
-
version: 1,
|
|
46
|
-
configPath: join(workdir, "config.json"),
|
|
47
|
-
taskFilePath: join(workdir, "tasks.json"),
|
|
48
|
-
resultsDir: join(workdir, "results"),
|
|
49
|
-
run: {
|
|
50
|
-
defaultTimeoutMs: 10000,
|
|
51
|
-
continueOnFailure: true
|
|
52
|
-
},
|
|
53
|
-
adapter: {
|
|
54
|
-
type: "command",
|
|
55
|
-
command: {
|
|
56
|
-
command: "echo"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
tasks: [],
|
|
60
|
-
scoring: {
|
|
61
|
-
weights: {
|
|
62
|
-
passRate: 0.8,
|
|
63
|
-
reliability: 0.2,
|
|
64
|
-
duration: 0,
|
|
65
|
-
cost: 0
|
|
66
|
-
},
|
|
67
|
-
budgets: {},
|
|
68
|
-
pricing: {
|
|
69
|
-
inputPer1kTokensUsd: 0.001,
|
|
70
|
-
outputPer1kTokensUsd: 0.002
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
qualityGate: {
|
|
74
|
-
enabled: true,
|
|
75
|
-
baselineFile: join(workdir, "baseline.json"),
|
|
76
|
-
minPassRateDelta: -0.1,
|
|
77
|
-
maxCostIncreaseRatio: 1,
|
|
78
|
-
maxAvgDurationIncreaseRatio: 1
|
|
79
|
-
},
|
|
80
|
-
metadata: {}
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
describe("terminal bench scoring", ()=>{
|
|
84
|
-
const workdirs = [];
|
|
85
|
-
afterEach(()=>{
|
|
86
|
-
for (const workdir of workdirs)rmSync(workdir, {
|
|
87
|
-
recursive: true,
|
|
88
|
-
force: true
|
|
89
|
-
});
|
|
90
|
-
workdirs.length = 0;
|
|
91
|
-
});
|
|
92
|
-
it("computes summary metrics and applies quality gate", async ()=>{
|
|
93
|
-
const workdir = mkdtempSync(join(tmpdir(), "wingman-bench-score-"));
|
|
94
|
-
workdirs.push(workdir);
|
|
95
|
-
const baseline = {
|
|
96
|
-
metrics: {
|
|
97
|
-
passRate: 1,
|
|
98
|
-
totalCostUsd: 0.001,
|
|
99
|
-
avgDurationMs: 100
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
writeFileSync(join(workdir, "baseline.json"), JSON.stringify(baseline));
|
|
103
|
-
const summary = await buildTerminalBenchSummary({
|
|
104
|
-
runId: "run-1",
|
|
105
|
-
startedAt: new Date().toISOString(),
|
|
106
|
-
endedAt: new Date().toISOString(),
|
|
107
|
-
config: createConfig(workdir),
|
|
108
|
-
resultsDir: join(workdir, "results", "run-1"),
|
|
109
|
-
tasks: [
|
|
110
|
-
createTask("a", "passed", 100),
|
|
111
|
-
createTask("b", "failed", 200)
|
|
112
|
-
]
|
|
113
|
-
});
|
|
114
|
-
expect(summary.metrics.totalTasks).toBe(2);
|
|
115
|
-
expect(summary.metrics.passedTasks).toBe(1);
|
|
116
|
-
expect(summary.metrics.passRate).toBeCloseTo(0.5);
|
|
117
|
-
expect(summary.metrics.totalTokens).toBe(600);
|
|
118
|
-
expect(summary.metrics.totalCostUsd).toBeCloseTo(0.001);
|
|
119
|
-
expect(summary.qualityGate.passed).toBe(false);
|
|
120
|
-
expect(summary.qualityGate.messages.length).toBeGreaterThan(0);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __webpack_exports__ = {};
|
|
3
|
-
const external_vitest_namespaceObject = require("vitest");
|
|
4
|
-
const terminalProbe_cjs_namespaceObject = require("../debug/terminalProbe.cjs");
|
|
5
|
-
(0, external_vitest_namespaceObject.describe)("shouldReportTerminalProbeEvent", ()=>{
|
|
6
|
-
(0, external_vitest_namespaceObject.it)("reports terminal events by default", ()=>{
|
|
7
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbe_cjs_namespaceObject.shouldReportTerminalProbeEvent)("agent-complete")).toBe(true);
|
|
8
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbe_cjs_namespaceObject.shouldReportTerminalProbeEvent)("agent-error")).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
(0, external_vitest_namespaceObject.it)("hides non-terminal events by default", ()=>{
|
|
11
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbe_cjs_namespaceObject.shouldReportTerminalProbeEvent)("agent-start")).toBe(false);
|
|
12
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbe_cjs_namespaceObject.shouldReportTerminalProbeEvent)("request-queued")).toBe(false);
|
|
13
|
-
});
|
|
14
|
-
(0, external_vitest_namespaceObject.it)("includes lifecycle events in verbose mode", ()=>{
|
|
15
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbe_cjs_namespaceObject.shouldReportTerminalProbeEvent)("agent-start", true)).toBe(true);
|
|
16
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbe_cjs_namespaceObject.shouldReportTerminalProbeEvent)("request-queued", true)).toBe(true);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
(0, external_vitest_namespaceObject.describe)("formatTerminalProbeEvent", ()=>{
|
|
20
|
-
(0, external_vitest_namespaceObject.it)("formats terminal events in a compact single line", ()=>{
|
|
21
|
-
const line = (0, terminalProbe_cjs_namespaceObject.formatTerminalProbeEvent)({
|
|
22
|
-
type: "agent-complete",
|
|
23
|
-
requestId: "req-1",
|
|
24
|
-
sessionId: "session-1",
|
|
25
|
-
timestampIso: "2026-02-12T18:12:00.000Z"
|
|
26
|
-
});
|
|
27
|
-
(0, external_vitest_namespaceObject.expect)(line).toContain("type=agent-complete");
|
|
28
|
-
(0, external_vitest_namespaceObject.expect)(line).toContain("req=req-1");
|
|
29
|
-
(0, external_vitest_namespaceObject.expect)(line).toContain("session=session-1");
|
|
30
|
-
});
|
|
31
|
-
(0, external_vitest_namespaceObject.it)("includes error text for error events", ()=>{
|
|
32
|
-
const line = (0, terminalProbe_cjs_namespaceObject.formatTerminalProbeEvent)({
|
|
33
|
-
type: "agent-error",
|
|
34
|
-
requestId: "req-2",
|
|
35
|
-
error: "Provider timeout",
|
|
36
|
-
timestampIso: "2026-02-12T18:12:01.000Z"
|
|
37
|
-
});
|
|
38
|
-
(0, external_vitest_namespaceObject.expect)(line).toContain("type=agent-error");
|
|
39
|
-
(0, external_vitest_namespaceObject.expect)(line).toContain('error="Provider timeout"');
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
43
|
-
Object.defineProperty(exports, '__esModule', {
|
|
44
|
-
value: true
|
|
45
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { formatTerminalProbeEvent, shouldReportTerminalProbeEvent } from "../debug/terminalProbe.js";
|
|
3
|
-
describe("shouldReportTerminalProbeEvent", ()=>{
|
|
4
|
-
it("reports terminal events by default", ()=>{
|
|
5
|
-
expect(shouldReportTerminalProbeEvent("agent-complete")).toBe(true);
|
|
6
|
-
expect(shouldReportTerminalProbeEvent("agent-error")).toBe(true);
|
|
7
|
-
});
|
|
8
|
-
it("hides non-terminal events by default", ()=>{
|
|
9
|
-
expect(shouldReportTerminalProbeEvent("agent-start")).toBe(false);
|
|
10
|
-
expect(shouldReportTerminalProbeEvent("request-queued")).toBe(false);
|
|
11
|
-
});
|
|
12
|
-
it("includes lifecycle events in verbose mode", ()=>{
|
|
13
|
-
expect(shouldReportTerminalProbeEvent("agent-start", true)).toBe(true);
|
|
14
|
-
expect(shouldReportTerminalProbeEvent("request-queued", true)).toBe(true);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
describe("formatTerminalProbeEvent", ()=>{
|
|
18
|
-
it("formats terminal events in a compact single line", ()=>{
|
|
19
|
-
const line = formatTerminalProbeEvent({
|
|
20
|
-
type: "agent-complete",
|
|
21
|
-
requestId: "req-1",
|
|
22
|
-
sessionId: "session-1",
|
|
23
|
-
timestampIso: "2026-02-12T18:12:00.000Z"
|
|
24
|
-
});
|
|
25
|
-
expect(line).toContain("type=agent-complete");
|
|
26
|
-
expect(line).toContain("req=req-1");
|
|
27
|
-
expect(line).toContain("session=session-1");
|
|
28
|
-
});
|
|
29
|
-
it("includes error text for error events", ()=>{
|
|
30
|
-
const line = formatTerminalProbeEvent({
|
|
31
|
-
type: "agent-error",
|
|
32
|
-
requestId: "req-2",
|
|
33
|
-
error: "Provider timeout",
|
|
34
|
-
timestampIso: "2026-02-12T18:12:01.000Z"
|
|
35
|
-
});
|
|
36
|
-
expect(line).toContain("type=agent-error");
|
|
37
|
-
expect(line).toContain('error="Provider timeout"');
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1,85 +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 terminalProbeAuth_cjs_namespaceObject = require("../debug/terminalProbeAuth.cjs");
|
|
8
|
-
function writeConfig(configDir, config) {
|
|
9
|
-
const wingmanDir = (0, external_node_path_namespaceObject.join)(configDir, ".wingman");
|
|
10
|
-
(0, external_node_fs_namespaceObject.mkdirSync)(wingmanDir, {
|
|
11
|
-
recursive: true
|
|
12
|
-
});
|
|
13
|
-
const configPath = (0, external_node_path_namespaceObject.join)(wingmanDir, "wingman.config.json");
|
|
14
|
-
(0, external_node_fs_namespaceObject.writeFileSync)(configPath, JSON.stringify(config), "utf-8");
|
|
15
|
-
return configPath;
|
|
16
|
-
}
|
|
17
|
-
(0, external_vitest_namespaceObject.describe)("resolveTerminalProbeAuth", ()=>{
|
|
18
|
-
(0, external_vitest_namespaceObject.it)("prefers CLI auth when provided", ()=>{
|
|
19
|
-
const auth = (0, terminalProbeAuth_cjs_namespaceObject.resolveTerminalProbeAuth)({
|
|
20
|
-
cliToken: "cli-token",
|
|
21
|
-
cliPassword: "cli-pass",
|
|
22
|
-
env: {
|
|
23
|
-
[terminalProbeAuth_cjs_namespaceObject.TERMINAL_PROBE_GATEWAY_TOKEN_ENV]: "env-token"
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
(0, external_vitest_namespaceObject.expect)(auth.source).toBe("cli");
|
|
27
|
-
(0, external_vitest_namespaceObject.expect)(auth.token).toBe("cli-token");
|
|
28
|
-
(0, external_vitest_namespaceObject.expect)(auth.password).toBe("cli-pass");
|
|
29
|
-
});
|
|
30
|
-
(0, external_vitest_namespaceObject.it)("falls back to env auth when CLI auth is missing", ()=>{
|
|
31
|
-
const auth = (0, terminalProbeAuth_cjs_namespaceObject.resolveTerminalProbeAuth)({
|
|
32
|
-
env: {
|
|
33
|
-
[terminalProbeAuth_cjs_namespaceObject.TERMINAL_PROBE_GATEWAY_TOKEN_ENV]: "env-token",
|
|
34
|
-
[terminalProbeAuth_cjs_namespaceObject.TERMINAL_PROBE_GATEWAY_PASSWORD_ENV]: "env-pass"
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
(0, external_vitest_namespaceObject.expect)(auth.source).toBe("env");
|
|
38
|
-
(0, external_vitest_namespaceObject.expect)(auth.token).toBe("env-token");
|
|
39
|
-
(0, external_vitest_namespaceObject.expect)(auth.password).toBe("env-pass");
|
|
40
|
-
});
|
|
41
|
-
(0, external_vitest_namespaceObject.it)("loads token auth from config when env and CLI are missing", ()=>{
|
|
42
|
-
const dir = (0, external_node_fs_namespaceObject.mkdtempSync)((0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "terminal-probe-auth-"));
|
|
43
|
-
const configPath = writeConfig(dir, {
|
|
44
|
-
gateway: {
|
|
45
|
-
auth: {
|
|
46
|
-
mode: "token",
|
|
47
|
-
token: "config-token"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const auth = (0, terminalProbeAuth_cjs_namespaceObject.resolveTerminalProbeAuth)({
|
|
52
|
-
env: {},
|
|
53
|
-
cwd: dir,
|
|
54
|
-
homeDir: (0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "non-existent-home")
|
|
55
|
-
});
|
|
56
|
-
(0, external_vitest_namespaceObject.expect)(auth.source).toBe("config");
|
|
57
|
-
(0, external_vitest_namespaceObject.expect)(auth.token).toBe("config-token");
|
|
58
|
-
(0, external_vitest_namespaceObject.expect)(auth.configPath).toBe(configPath);
|
|
59
|
-
});
|
|
60
|
-
(0, external_vitest_namespaceObject.it)("returns none when no auth material is available", ()=>{
|
|
61
|
-
const auth = (0, terminalProbeAuth_cjs_namespaceObject.resolveTerminalProbeAuth)({
|
|
62
|
-
env: {},
|
|
63
|
-
cwd: (0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "terminal-probe-auth-empty"),
|
|
64
|
-
homeDir: (0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), "terminal-probe-auth-empty-home")
|
|
65
|
-
});
|
|
66
|
-
(0, external_vitest_namespaceObject.expect)(auth.source).toBe("none");
|
|
67
|
-
(0, external_vitest_namespaceObject.expect)(auth.token).toBeUndefined();
|
|
68
|
-
(0, external_vitest_namespaceObject.expect)(auth.password).toBeUndefined();
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
(0, external_vitest_namespaceObject.describe)("formatTerminalProbeHandshakeFailure", ()=>{
|
|
72
|
-
(0, external_vitest_namespaceObject.it)("formats string payloads directly", ()=>{
|
|
73
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbeAuth_cjs_namespaceObject.formatTerminalProbeHandshakeFailure)("authentication failed")).toBe("authentication failed");
|
|
74
|
-
});
|
|
75
|
-
(0, external_vitest_namespaceObject.it)("formats structured payloads as JSON", ()=>{
|
|
76
|
-
(0, external_vitest_namespaceObject.expect)((0, terminalProbeAuth_cjs_namespaceObject.formatTerminalProbeHandshakeFailure)({
|
|
77
|
-
code: "AUTH_FAILED",
|
|
78
|
-
message: "bad token"
|
|
79
|
-
})).toContain('"code":"AUTH_FAILED"');
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
83
|
-
Object.defineProperty(exports, '__esModule', {
|
|
84
|
-
value: true
|
|
85
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { tmpdir } from "node:os";
|
|
3
|
-
import { join } from "node:path";
|
|
4
|
-
import { describe, expect, it } from "vitest";
|
|
5
|
-
import { TERMINAL_PROBE_GATEWAY_PASSWORD_ENV, TERMINAL_PROBE_GATEWAY_TOKEN_ENV, formatTerminalProbeHandshakeFailure, resolveTerminalProbeAuth } from "../debug/terminalProbeAuth.js";
|
|
6
|
-
function writeConfig(configDir, config) {
|
|
7
|
-
const wingmanDir = join(configDir, ".wingman");
|
|
8
|
-
mkdirSync(wingmanDir, {
|
|
9
|
-
recursive: true
|
|
10
|
-
});
|
|
11
|
-
const configPath = join(wingmanDir, "wingman.config.json");
|
|
12
|
-
writeFileSync(configPath, JSON.stringify(config), "utf-8");
|
|
13
|
-
return configPath;
|
|
14
|
-
}
|
|
15
|
-
describe("resolveTerminalProbeAuth", ()=>{
|
|
16
|
-
it("prefers CLI auth when provided", ()=>{
|
|
17
|
-
const auth = resolveTerminalProbeAuth({
|
|
18
|
-
cliToken: "cli-token",
|
|
19
|
-
cliPassword: "cli-pass",
|
|
20
|
-
env: {
|
|
21
|
-
[TERMINAL_PROBE_GATEWAY_TOKEN_ENV]: "env-token"
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
expect(auth.source).toBe("cli");
|
|
25
|
-
expect(auth.token).toBe("cli-token");
|
|
26
|
-
expect(auth.password).toBe("cli-pass");
|
|
27
|
-
});
|
|
28
|
-
it("falls back to env auth when CLI auth is missing", ()=>{
|
|
29
|
-
const auth = resolveTerminalProbeAuth({
|
|
30
|
-
env: {
|
|
31
|
-
[TERMINAL_PROBE_GATEWAY_TOKEN_ENV]: "env-token",
|
|
32
|
-
[TERMINAL_PROBE_GATEWAY_PASSWORD_ENV]: "env-pass"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
expect(auth.source).toBe("env");
|
|
36
|
-
expect(auth.token).toBe("env-token");
|
|
37
|
-
expect(auth.password).toBe("env-pass");
|
|
38
|
-
});
|
|
39
|
-
it("loads token auth from config when env and CLI are missing", ()=>{
|
|
40
|
-
const dir = mkdtempSync(join(tmpdir(), "terminal-probe-auth-"));
|
|
41
|
-
const configPath = writeConfig(dir, {
|
|
42
|
-
gateway: {
|
|
43
|
-
auth: {
|
|
44
|
-
mode: "token",
|
|
45
|
-
token: "config-token"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
const auth = resolveTerminalProbeAuth({
|
|
50
|
-
env: {},
|
|
51
|
-
cwd: dir,
|
|
52
|
-
homeDir: join(tmpdir(), "non-existent-home")
|
|
53
|
-
});
|
|
54
|
-
expect(auth.source).toBe("config");
|
|
55
|
-
expect(auth.token).toBe("config-token");
|
|
56
|
-
expect(auth.configPath).toBe(configPath);
|
|
57
|
-
});
|
|
58
|
-
it("returns none when no auth material is available", ()=>{
|
|
59
|
-
const auth = resolveTerminalProbeAuth({
|
|
60
|
-
env: {},
|
|
61
|
-
cwd: join(tmpdir(), "terminal-probe-auth-empty"),
|
|
62
|
-
homeDir: join(tmpdir(), "terminal-probe-auth-empty-home")
|
|
63
|
-
});
|
|
64
|
-
expect(auth.source).toBe("none");
|
|
65
|
-
expect(auth.token).toBeUndefined();
|
|
66
|
-
expect(auth.password).toBeUndefined();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
describe("formatTerminalProbeHandshakeFailure", ()=>{
|
|
70
|
-
it("formats string payloads directly", ()=>{
|
|
71
|
-
expect(formatTerminalProbeHandshakeFailure("authentication failed")).toBe("authentication failed");
|
|
72
|
-
});
|
|
73
|
-
it("formats structured payloads as JSON", ()=>{
|
|
74
|
-
expect(formatTerminalProbeHandshakeFailure({
|
|
75
|
-
code: "AUTH_FAILED",
|
|
76
|
-
message: "bad token"
|
|
77
|
-
})).toContain('"code":"AUTH_FAILED"');
|
|
78
|
-
});
|
|
79
|
-
});
|