@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
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
BLOCKED_BACKEND_PATH_MESSAGE: ()=>BLOCKED_BACKEND_PATH_MESSAGE,
|
|
28
|
+
DEFAULT_HIDDEN_BACKEND_SEGMENTS: ()=>DEFAULT_HIDDEN_BACKEND_SEGMENTS,
|
|
29
|
+
createFilteredBackend: ()=>createFilteredBackend,
|
|
30
|
+
pathUsesHiddenSegment: ()=>pathUsesHiddenSegment
|
|
31
|
+
});
|
|
32
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
33
|
+
function _define_property(obj, key, value) {
|
|
34
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
35
|
+
value: value,
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true
|
|
39
|
+
});
|
|
40
|
+
else obj[key] = value;
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
const DEFAULT_HIDDEN_BACKEND_SEGMENTS = [
|
|
44
|
+
"conversation_history"
|
|
45
|
+
];
|
|
46
|
+
const BLOCKED_BACKEND_PATH_MESSAGE = "Access to conversation history archives is unavailable to agent file tools. Use the current thread context or /memories/ instead.";
|
|
47
|
+
const normalizeSegment = (value)=>value.trim().replace(/\\/g, "/").replace(/^\/+|\/+$/g, "").toLowerCase();
|
|
48
|
+
const normalizeVirtualPath = (value)=>{
|
|
49
|
+
const normalized = value.replace(/\\/g, "/").trim();
|
|
50
|
+
if (!normalized) return "/";
|
|
51
|
+
if (normalized.startsWith("/")) return external_node_path_namespaceObject.posix.normalize(normalized);
|
|
52
|
+
return external_node_path_namespaceObject.posix.normalize(`/${normalized.replace(/^\.?\//, "")}`);
|
|
53
|
+
};
|
|
54
|
+
const resolveHiddenSegments = (segments)=>{
|
|
55
|
+
const normalized = [
|
|
56
|
+
...segments
|
|
57
|
+
].map(normalizeSegment).filter((segment)=>segment.length > 0);
|
|
58
|
+
return new Set(normalized);
|
|
59
|
+
};
|
|
60
|
+
const getPathSegments = (value)=>normalizeVirtualPath(value).split("/").map((segment)=>segment.trim().toLowerCase()).filter(Boolean);
|
|
61
|
+
const pathUsesHiddenSegment = (value, hiddenPathSegments = DEFAULT_HIDDEN_BACKEND_SEGMENTS)=>{
|
|
62
|
+
const hiddenSegments = resolveHiddenSegments(hiddenPathSegments);
|
|
63
|
+
if (0 === hiddenSegments.size) return false;
|
|
64
|
+
return getPathSegments(value).some((segment)=>hiddenSegments.has(segment));
|
|
65
|
+
};
|
|
66
|
+
const filterPathEntries = (entries, hiddenSegments)=>entries.filter((entry)=>!getPathSegments(entry.path).some((segment)=>hiddenSegments.has(segment)));
|
|
67
|
+
const createBlockedResult = (path, message)=>({
|
|
68
|
+
error: message,
|
|
69
|
+
path,
|
|
70
|
+
filesUpdate: null
|
|
71
|
+
});
|
|
72
|
+
class FilteredBackend {
|
|
73
|
+
isHiddenPath(value) {
|
|
74
|
+
return this.hiddenSegments.size > 0 && getPathSegments(value).some((segment)=>this.hiddenSegments.has(segment));
|
|
75
|
+
}
|
|
76
|
+
async lsInfo(path) {
|
|
77
|
+
if (this.isHiddenPath(path)) return [];
|
|
78
|
+
const entries = await this.delegate.lsInfo(path);
|
|
79
|
+
return filterPathEntries(entries, this.hiddenSegments);
|
|
80
|
+
}
|
|
81
|
+
async read(filePath, offset, limit) {
|
|
82
|
+
if (this.isHiddenPath(filePath)) return this.blockedPathMessage;
|
|
83
|
+
return await this.delegate.read(filePath, offset, limit);
|
|
84
|
+
}
|
|
85
|
+
async readRaw(filePath) {
|
|
86
|
+
if (this.isHiddenPath(filePath)) throw new Error(this.blockedPathMessage);
|
|
87
|
+
return await this.delegate.readRaw(filePath);
|
|
88
|
+
}
|
|
89
|
+
async grepRaw(pattern, path, glob) {
|
|
90
|
+
if ("string" == typeof path && this.isHiddenPath(path)) return [];
|
|
91
|
+
const result = await this.delegate.grepRaw(pattern, path, glob);
|
|
92
|
+
if ("string" == typeof result) return result;
|
|
93
|
+
return filterPathEntries(result, this.hiddenSegments);
|
|
94
|
+
}
|
|
95
|
+
async globInfo(pattern, path = "/") {
|
|
96
|
+
if (this.isHiddenPath(path)) return [];
|
|
97
|
+
const entries = await this.delegate.globInfo(pattern, path);
|
|
98
|
+
return filterPathEntries(entries, this.hiddenSegments);
|
|
99
|
+
}
|
|
100
|
+
async write(filePath, content) {
|
|
101
|
+
if (this.isHiddenPath(filePath)) return createBlockedResult(filePath, this.blockedPathMessage);
|
|
102
|
+
return await this.delegate.write(filePath, content);
|
|
103
|
+
}
|
|
104
|
+
async edit(filePath, oldString, newString, replaceAll) {
|
|
105
|
+
if (this.isHiddenPath(filePath)) return createBlockedResult(filePath, this.blockedPathMessage);
|
|
106
|
+
return await this.delegate.edit(filePath, oldString, newString, replaceAll);
|
|
107
|
+
}
|
|
108
|
+
constructor(delegate, options = {}){
|
|
109
|
+
_define_property(this, "delegate", void 0);
|
|
110
|
+
_define_property(this, "hiddenSegments", void 0);
|
|
111
|
+
_define_property(this, "blockedPathMessage", void 0);
|
|
112
|
+
this.delegate = delegate;
|
|
113
|
+
this.hiddenSegments = resolveHiddenSegments(options.hiddenPathSegments ?? DEFAULT_HIDDEN_BACKEND_SEGMENTS);
|
|
114
|
+
this.blockedPathMessage = options.blockedPathMessage ?? BLOCKED_BACKEND_PATH_MESSAGE;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const createFilteredBackend = (delegate, options = {})=>new FilteredBackend(delegate, options);
|
|
118
|
+
exports.BLOCKED_BACKEND_PATH_MESSAGE = __webpack_exports__.BLOCKED_BACKEND_PATH_MESSAGE;
|
|
119
|
+
exports.DEFAULT_HIDDEN_BACKEND_SEGMENTS = __webpack_exports__.DEFAULT_HIDDEN_BACKEND_SEGMENTS;
|
|
120
|
+
exports.createFilteredBackend = __webpack_exports__.createFilteredBackend;
|
|
121
|
+
exports.pathUsesHiddenSegment = __webpack_exports__.pathUsesHiddenSegment;
|
|
122
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
123
|
+
"BLOCKED_BACKEND_PATH_MESSAGE",
|
|
124
|
+
"DEFAULT_HIDDEN_BACKEND_SEGMENTS",
|
|
125
|
+
"createFilteredBackend",
|
|
126
|
+
"pathUsesHiddenSegment"
|
|
127
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
128
|
+
Object.defineProperty(exports, '__esModule', {
|
|
129
|
+
value: true
|
|
130
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BackendProtocol } from "deepagents";
|
|
2
|
+
export declare const DEFAULT_HIDDEN_BACKEND_SEGMENTS: readonly ["conversation_history"];
|
|
3
|
+
export declare const BLOCKED_BACKEND_PATH_MESSAGE = "Access to conversation history archives is unavailable to agent file tools. Use the current thread context or /memories/ instead.";
|
|
4
|
+
type FilteredBackendOptions = {
|
|
5
|
+
hiddenPathSegments?: Iterable<string>;
|
|
6
|
+
blockedPathMessage?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const pathUsesHiddenSegment: (value: string, hiddenPathSegments?: Iterable<string>) => boolean;
|
|
9
|
+
export declare const createFilteredBackend: (delegate: BackendProtocol, options?: FilteredBackendOptions) => BackendProtocol;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
function _define_property(obj, key, value) {
|
|
3
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
else obj[key] = value;
|
|
10
|
+
return obj;
|
|
11
|
+
}
|
|
12
|
+
const DEFAULT_HIDDEN_BACKEND_SEGMENTS = [
|
|
13
|
+
"conversation_history"
|
|
14
|
+
];
|
|
15
|
+
const BLOCKED_BACKEND_PATH_MESSAGE = "Access to conversation history archives is unavailable to agent file tools. Use the current thread context or /memories/ instead.";
|
|
16
|
+
const normalizeSegment = (value)=>value.trim().replace(/\\/g, "/").replace(/^\/+|\/+$/g, "").toLowerCase();
|
|
17
|
+
const normalizeVirtualPath = (value)=>{
|
|
18
|
+
const normalized = value.replace(/\\/g, "/").trim();
|
|
19
|
+
if (!normalized) return "/";
|
|
20
|
+
if (normalized.startsWith("/")) return posix.normalize(normalized);
|
|
21
|
+
return posix.normalize(`/${normalized.replace(/^\.?\//, "")}`);
|
|
22
|
+
};
|
|
23
|
+
const resolveHiddenSegments = (segments)=>{
|
|
24
|
+
const normalized = [
|
|
25
|
+
...segments
|
|
26
|
+
].map(normalizeSegment).filter((segment)=>segment.length > 0);
|
|
27
|
+
return new Set(normalized);
|
|
28
|
+
};
|
|
29
|
+
const getPathSegments = (value)=>normalizeVirtualPath(value).split("/").map((segment)=>segment.trim().toLowerCase()).filter(Boolean);
|
|
30
|
+
const pathUsesHiddenSegment = (value, hiddenPathSegments = DEFAULT_HIDDEN_BACKEND_SEGMENTS)=>{
|
|
31
|
+
const hiddenSegments = resolveHiddenSegments(hiddenPathSegments);
|
|
32
|
+
if (0 === hiddenSegments.size) return false;
|
|
33
|
+
return getPathSegments(value).some((segment)=>hiddenSegments.has(segment));
|
|
34
|
+
};
|
|
35
|
+
const filterPathEntries = (entries, hiddenSegments)=>entries.filter((entry)=>!getPathSegments(entry.path).some((segment)=>hiddenSegments.has(segment)));
|
|
36
|
+
const createBlockedResult = (path, message)=>({
|
|
37
|
+
error: message,
|
|
38
|
+
path,
|
|
39
|
+
filesUpdate: null
|
|
40
|
+
});
|
|
41
|
+
class FilteredBackend {
|
|
42
|
+
isHiddenPath(value) {
|
|
43
|
+
return this.hiddenSegments.size > 0 && getPathSegments(value).some((segment)=>this.hiddenSegments.has(segment));
|
|
44
|
+
}
|
|
45
|
+
async lsInfo(path) {
|
|
46
|
+
if (this.isHiddenPath(path)) return [];
|
|
47
|
+
const entries = await this.delegate.lsInfo(path);
|
|
48
|
+
return filterPathEntries(entries, this.hiddenSegments);
|
|
49
|
+
}
|
|
50
|
+
async read(filePath, offset, limit) {
|
|
51
|
+
if (this.isHiddenPath(filePath)) return this.blockedPathMessage;
|
|
52
|
+
return await this.delegate.read(filePath, offset, limit);
|
|
53
|
+
}
|
|
54
|
+
async readRaw(filePath) {
|
|
55
|
+
if (this.isHiddenPath(filePath)) throw new Error(this.blockedPathMessage);
|
|
56
|
+
return await this.delegate.readRaw(filePath);
|
|
57
|
+
}
|
|
58
|
+
async grepRaw(pattern, path, glob) {
|
|
59
|
+
if ("string" == typeof path && this.isHiddenPath(path)) return [];
|
|
60
|
+
const result = await this.delegate.grepRaw(pattern, path, glob);
|
|
61
|
+
if ("string" == typeof result) return result;
|
|
62
|
+
return filterPathEntries(result, this.hiddenSegments);
|
|
63
|
+
}
|
|
64
|
+
async globInfo(pattern, path = "/") {
|
|
65
|
+
if (this.isHiddenPath(path)) return [];
|
|
66
|
+
const entries = await this.delegate.globInfo(pattern, path);
|
|
67
|
+
return filterPathEntries(entries, this.hiddenSegments);
|
|
68
|
+
}
|
|
69
|
+
async write(filePath, content) {
|
|
70
|
+
if (this.isHiddenPath(filePath)) return createBlockedResult(filePath, this.blockedPathMessage);
|
|
71
|
+
return await this.delegate.write(filePath, content);
|
|
72
|
+
}
|
|
73
|
+
async edit(filePath, oldString, newString, replaceAll) {
|
|
74
|
+
if (this.isHiddenPath(filePath)) return createBlockedResult(filePath, this.blockedPathMessage);
|
|
75
|
+
return await this.delegate.edit(filePath, oldString, newString, replaceAll);
|
|
76
|
+
}
|
|
77
|
+
constructor(delegate, options = {}){
|
|
78
|
+
_define_property(this, "delegate", void 0);
|
|
79
|
+
_define_property(this, "hiddenSegments", void 0);
|
|
80
|
+
_define_property(this, "blockedPathMessage", void 0);
|
|
81
|
+
this.delegate = delegate;
|
|
82
|
+
this.hiddenSegments = resolveHiddenSegments(options.hiddenPathSegments ?? DEFAULT_HIDDEN_BACKEND_SEGMENTS);
|
|
83
|
+
this.blockedPathMessage = options.blockedPathMessage ?? BLOCKED_BACKEND_PATH_MESSAGE;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const createFilteredBackend = (delegate, options = {})=>new FilteredBackend(delegate, options);
|
|
87
|
+
export { BLOCKED_BACKEND_PATH_MESSAGE, DEFAULT_HIDDEN_BACKEND_SEGMENTS, createFilteredBackend, pathUsesHiddenSegment };
|
|
@@ -40,6 +40,10 @@ const AvailableToolNames = external_zod_namespaceObject["enum"]([
|
|
|
40
40
|
"internet_search",
|
|
41
41
|
"web_crawler",
|
|
42
42
|
"browser_control",
|
|
43
|
+
"browser_session_start",
|
|
44
|
+
"browser_session_action",
|
|
45
|
+
"browser_session_close",
|
|
46
|
+
"browser_session_list",
|
|
43
47
|
"command_execute",
|
|
44
48
|
"background_terminal",
|
|
45
49
|
"node_notify",
|
|
@@ -7,6 +7,10 @@ export declare const AvailableToolNames: z.ZodEnum<{
|
|
|
7
7
|
internet_search: "internet_search";
|
|
8
8
|
web_crawler: "web_crawler";
|
|
9
9
|
browser_control: "browser_control";
|
|
10
|
+
browser_session_start: "browser_session_start";
|
|
11
|
+
browser_session_action: "browser_session_action";
|
|
12
|
+
browser_session_close: "browser_session_close";
|
|
13
|
+
browser_session_list: "browser_session_list";
|
|
10
14
|
command_execute: "command_execute";
|
|
11
15
|
background_terminal: "background_terminal";
|
|
12
16
|
node_notify: "node_notify";
|
|
@@ -44,6 +48,10 @@ export declare const AgentConfigSchema: z.ZodObject<{
|
|
|
44
48
|
internet_search: "internet_search";
|
|
45
49
|
web_crawler: "web_crawler";
|
|
46
50
|
browser_control: "browser_control";
|
|
51
|
+
browser_session_start: "browser_session_start";
|
|
52
|
+
browser_session_action: "browser_session_action";
|
|
53
|
+
browser_session_close: "browser_session_close";
|
|
54
|
+
browser_session_list: "browser_session_list";
|
|
47
55
|
command_execute: "command_execute";
|
|
48
56
|
background_terminal: "background_terminal";
|
|
49
57
|
node_notify: "node_notify";
|
|
@@ -150,6 +158,10 @@ export declare const AgentConfigSchema: z.ZodObject<{
|
|
|
150
158
|
internet_search: "internet_search";
|
|
151
159
|
web_crawler: "web_crawler";
|
|
152
160
|
browser_control: "browser_control";
|
|
161
|
+
browser_session_start: "browser_session_start";
|
|
162
|
+
browser_session_action: "browser_session_action";
|
|
163
|
+
browser_session_close: "browser_session_close";
|
|
164
|
+
browser_session_list: "browser_session_list";
|
|
153
165
|
command_execute: "command_execute";
|
|
154
166
|
background_terminal: "background_terminal";
|
|
155
167
|
node_notify: "node_notify";
|
|
@@ -7,6 +7,10 @@ const AvailableToolNames = external_zod_enum([
|
|
|
7
7
|
"internet_search",
|
|
8
8
|
"web_crawler",
|
|
9
9
|
"browser_control",
|
|
10
|
+
"browser_session_start",
|
|
11
|
+
"browser_session_action",
|
|
12
|
+
"browser_session_close",
|
|
13
|
+
"browser_session_list",
|
|
10
14
|
"command_execute",
|
|
11
15
|
"background_terminal",
|
|
12
16
|
"node_notify",
|
|
@@ -33,6 +33,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
33
33
|
const external_logger_cjs_namespaceObject = require("../../logger.cjs");
|
|
34
34
|
const background_terminal_cjs_namespaceObject = require("../tools/background_terminal.cjs");
|
|
35
35
|
const browser_control_cjs_namespaceObject = require("../tools/browser_control.cjs");
|
|
36
|
+
const browser_session_cjs_namespaceObject = require("../tools/browser_session.cjs");
|
|
37
|
+
const browser_session_manager_cjs_namespaceObject = require("../tools/browser_session_manager.cjs");
|
|
36
38
|
const code_search_cjs_namespaceObject = require("../tools/code_search.cjs");
|
|
37
39
|
const command_execute_cjs_namespaceObject = require("../tools/command_execute.cjs");
|
|
38
40
|
const git_status_cjs_namespaceObject = require("../tools/git_status.cjs");
|
|
@@ -54,7 +56,7 @@ const NODE_TOOL_NAMES = [
|
|
|
54
56
|
"node_run"
|
|
55
57
|
];
|
|
56
58
|
function createTool(name, options = {}) {
|
|
57
|
-
const { workspace = process.cwd(), executionWorkspace, blockedCommands, allowScriptExecution = true, timeout = 300000, terminalOwnerId = "default", terminalSessionManager = (0, terminal_session_manager_cjs_namespaceObject.getSharedTerminalSessionManager)(), searchConfig = {
|
|
59
|
+
const { workspace = process.cwd(), executionWorkspace, blockedCommands, allowScriptExecution = true, timeout = 300000, terminalOwnerId = "default", terminalSessionManager = (0, terminal_session_manager_cjs_namespaceObject.getSharedTerminalSessionManager)(), browserSessionOwnerId = "default", browserSessionManager = (0, browser_session_manager_cjs_namespaceObject.getSharedBrowserSessionManager)(), searchConfig = {
|
|
58
60
|
provider: "duckduckgo",
|
|
59
61
|
maxResults: 5
|
|
60
62
|
}, skillsDirectory = "skills", dynamicUiEnabled = true } = options;
|
|
@@ -99,6 +101,74 @@ function createTool(name, options = {}) {
|
|
|
99
101
|
allowScriptExecution,
|
|
100
102
|
commandTimeout: timeout
|
|
101
103
|
});
|
|
104
|
+
case "browser_session_start":
|
|
105
|
+
return (0, browser_session_cjs_namespaceObject.createBrowserSessionStartTool)({
|
|
106
|
+
workspace: runtimeWorkspace,
|
|
107
|
+
configWorkspace: workspace,
|
|
108
|
+
launchTimeoutMs: timeout,
|
|
109
|
+
browserProfile: options.browserProfile,
|
|
110
|
+
browserTransport: options.browserTransport,
|
|
111
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
112
|
+
profilePaths: options.browserProfiles,
|
|
113
|
+
browserExtensions: options.browserExtensions,
|
|
114
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
115
|
+
extensionPaths: options.browserExtensionsById,
|
|
116
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
117
|
+
relayConfig: options.browserRelay,
|
|
118
|
+
ownerId: browserSessionOwnerId,
|
|
119
|
+
sessionManager: browserSessionManager
|
|
120
|
+
});
|
|
121
|
+
case "browser_session_action":
|
|
122
|
+
return (0, browser_session_cjs_namespaceObject.createBrowserSessionActionTool)({
|
|
123
|
+
workspace: runtimeWorkspace,
|
|
124
|
+
configWorkspace: workspace,
|
|
125
|
+
launchTimeoutMs: timeout,
|
|
126
|
+
browserProfile: options.browserProfile,
|
|
127
|
+
browserTransport: options.browserTransport,
|
|
128
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
129
|
+
profilePaths: options.browserProfiles,
|
|
130
|
+
browserExtensions: options.browserExtensions,
|
|
131
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
132
|
+
extensionPaths: options.browserExtensionsById,
|
|
133
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
134
|
+
relayConfig: options.browserRelay,
|
|
135
|
+
ownerId: browserSessionOwnerId,
|
|
136
|
+
sessionManager: browserSessionManager
|
|
137
|
+
});
|
|
138
|
+
case "browser_session_close":
|
|
139
|
+
return (0, browser_session_cjs_namespaceObject.createBrowserSessionCloseTool)({
|
|
140
|
+
workspace: runtimeWorkspace,
|
|
141
|
+
configWorkspace: workspace,
|
|
142
|
+
launchTimeoutMs: timeout,
|
|
143
|
+
browserProfile: options.browserProfile,
|
|
144
|
+
browserTransport: options.browserTransport,
|
|
145
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
146
|
+
profilePaths: options.browserProfiles,
|
|
147
|
+
browserExtensions: options.browserExtensions,
|
|
148
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
149
|
+
extensionPaths: options.browserExtensionsById,
|
|
150
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
151
|
+
relayConfig: options.browserRelay,
|
|
152
|
+
ownerId: browserSessionOwnerId,
|
|
153
|
+
sessionManager: browserSessionManager
|
|
154
|
+
});
|
|
155
|
+
case "browser_session_list":
|
|
156
|
+
return (0, browser_session_cjs_namespaceObject.createBrowserSessionListTool)({
|
|
157
|
+
workspace: runtimeWorkspace,
|
|
158
|
+
configWorkspace: workspace,
|
|
159
|
+
launchTimeoutMs: timeout,
|
|
160
|
+
browserProfile: options.browserProfile,
|
|
161
|
+
browserTransport: options.browserTransport,
|
|
162
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
163
|
+
profilePaths: options.browserProfiles,
|
|
164
|
+
browserExtensions: options.browserExtensions,
|
|
165
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
166
|
+
extensionPaths: options.browserExtensionsById,
|
|
167
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
168
|
+
relayConfig: options.browserRelay,
|
|
169
|
+
ownerId: browserSessionOwnerId,
|
|
170
|
+
sessionManager: browserSessionManager
|
|
171
|
+
});
|
|
102
172
|
case "node_notify":
|
|
103
173
|
return (0, node_invoke_cjs_namespaceObject.createNodeNotifyTool)({
|
|
104
174
|
nodeInvoker: options.nodeInvoker,
|
|
@@ -154,6 +224,10 @@ function getAvailableTools() {
|
|
|
154
224
|
"internet_search",
|
|
155
225
|
"web_crawler",
|
|
156
226
|
"browser_control",
|
|
227
|
+
"browser_session_start",
|
|
228
|
+
"browser_session_action",
|
|
229
|
+
"browser_session_close",
|
|
230
|
+
"browser_session_list",
|
|
157
231
|
"command_execute",
|
|
158
232
|
"background_terminal",
|
|
159
233
|
...NODE_TOOL_NAMES,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { StructuredTool } from "@langchain/core/tools";
|
|
2
2
|
import type { MCPServersConfig } from "@/types/mcp.js";
|
|
3
3
|
import type { SearchConfig } from "../../cli/config/schema.js";
|
|
4
|
+
import { type BrowserSessionManager } from "../tools/browser_session_manager.js";
|
|
4
5
|
import { type NodeInvokeRequest, type NodeInvokeResult } from "../tools/node_invoke.js";
|
|
5
6
|
import { type TerminalSessionManager } from "../tools/terminal_session_manager.js";
|
|
6
7
|
import type { AvailableToolName } from "./agentConfig.js";
|
|
@@ -27,6 +28,8 @@ export interface ToolOptions {
|
|
|
27
28
|
};
|
|
28
29
|
terminalOwnerId?: string;
|
|
29
30
|
terminalSessionManager?: TerminalSessionManager;
|
|
31
|
+
browserSessionOwnerId?: string;
|
|
32
|
+
browserSessionManager?: BrowserSessionManager;
|
|
30
33
|
searchConfig?: SearchConfig;
|
|
31
34
|
mcpConfigs?: MCPServersConfig[];
|
|
32
35
|
skillsDirectory?: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../logger.js";
|
|
2
2
|
import { createBackgroundTerminalTool } from "../tools/background_terminal.js";
|
|
3
3
|
import { createBrowserControlTool } from "../tools/browser_control.js";
|
|
4
|
+
import { createBrowserSessionActionTool, createBrowserSessionCloseTool, createBrowserSessionListTool, createBrowserSessionStartTool } from "../tools/browser_session.js";
|
|
5
|
+
import { getSharedBrowserSessionManager } from "../tools/browser_session_manager.js";
|
|
4
6
|
import { createCodeSearchTool } from "../tools/code_search.js";
|
|
5
7
|
import { createCommandExecuteTool } from "../tools/command_execute.js";
|
|
6
8
|
import { createGitStatusTool } from "../tools/git_status.js";
|
|
@@ -22,7 +24,7 @@ const NODE_TOOL_NAMES = [
|
|
|
22
24
|
"node_run"
|
|
23
25
|
];
|
|
24
26
|
function createTool(name, options = {}) {
|
|
25
|
-
const { workspace = process.cwd(), executionWorkspace, blockedCommands, allowScriptExecution = true, timeout = 300000, terminalOwnerId = "default", terminalSessionManager = getSharedTerminalSessionManager(), searchConfig = {
|
|
27
|
+
const { workspace = process.cwd(), executionWorkspace, blockedCommands, allowScriptExecution = true, timeout = 300000, terminalOwnerId = "default", terminalSessionManager = getSharedTerminalSessionManager(), browserSessionOwnerId = "default", browserSessionManager = getSharedBrowserSessionManager(), searchConfig = {
|
|
26
28
|
provider: "duckduckgo",
|
|
27
29
|
maxResults: 5
|
|
28
30
|
}, skillsDirectory = "skills", dynamicUiEnabled = true } = options;
|
|
@@ -67,6 +69,74 @@ function createTool(name, options = {}) {
|
|
|
67
69
|
allowScriptExecution,
|
|
68
70
|
commandTimeout: timeout
|
|
69
71
|
});
|
|
72
|
+
case "browser_session_start":
|
|
73
|
+
return createBrowserSessionStartTool({
|
|
74
|
+
workspace: runtimeWorkspace,
|
|
75
|
+
configWorkspace: workspace,
|
|
76
|
+
launchTimeoutMs: timeout,
|
|
77
|
+
browserProfile: options.browserProfile,
|
|
78
|
+
browserTransport: options.browserTransport,
|
|
79
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
80
|
+
profilePaths: options.browserProfiles,
|
|
81
|
+
browserExtensions: options.browserExtensions,
|
|
82
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
83
|
+
extensionPaths: options.browserExtensionsById,
|
|
84
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
85
|
+
relayConfig: options.browserRelay,
|
|
86
|
+
ownerId: browserSessionOwnerId,
|
|
87
|
+
sessionManager: browserSessionManager
|
|
88
|
+
});
|
|
89
|
+
case "browser_session_action":
|
|
90
|
+
return createBrowserSessionActionTool({
|
|
91
|
+
workspace: runtimeWorkspace,
|
|
92
|
+
configWorkspace: workspace,
|
|
93
|
+
launchTimeoutMs: timeout,
|
|
94
|
+
browserProfile: options.browserProfile,
|
|
95
|
+
browserTransport: options.browserTransport,
|
|
96
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
97
|
+
profilePaths: options.browserProfiles,
|
|
98
|
+
browserExtensions: options.browserExtensions,
|
|
99
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
100
|
+
extensionPaths: options.browserExtensionsById,
|
|
101
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
102
|
+
relayConfig: options.browserRelay,
|
|
103
|
+
ownerId: browserSessionOwnerId,
|
|
104
|
+
sessionManager: browserSessionManager
|
|
105
|
+
});
|
|
106
|
+
case "browser_session_close":
|
|
107
|
+
return createBrowserSessionCloseTool({
|
|
108
|
+
workspace: runtimeWorkspace,
|
|
109
|
+
configWorkspace: workspace,
|
|
110
|
+
launchTimeoutMs: timeout,
|
|
111
|
+
browserProfile: options.browserProfile,
|
|
112
|
+
browserTransport: options.browserTransport,
|
|
113
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
114
|
+
profilePaths: options.browserProfiles,
|
|
115
|
+
browserExtensions: options.browserExtensions,
|
|
116
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
117
|
+
extensionPaths: options.browserExtensionsById,
|
|
118
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
119
|
+
relayConfig: options.browserRelay,
|
|
120
|
+
ownerId: browserSessionOwnerId,
|
|
121
|
+
sessionManager: browserSessionManager
|
|
122
|
+
});
|
|
123
|
+
case "browser_session_list":
|
|
124
|
+
return createBrowserSessionListTool({
|
|
125
|
+
workspace: runtimeWorkspace,
|
|
126
|
+
configWorkspace: workspace,
|
|
127
|
+
launchTimeoutMs: timeout,
|
|
128
|
+
browserProfile: options.browserProfile,
|
|
129
|
+
browserTransport: options.browserTransport,
|
|
130
|
+
profilesRootDir: options.browserProfilesDirectory,
|
|
131
|
+
profilePaths: options.browserProfiles,
|
|
132
|
+
browserExtensions: options.browserExtensions,
|
|
133
|
+
extensionsRootDir: options.browserExtensionsDirectory,
|
|
134
|
+
extensionPaths: options.browserExtensionsById,
|
|
135
|
+
defaultExtensions: options.browserDefaultExtensions,
|
|
136
|
+
relayConfig: options.browserRelay,
|
|
137
|
+
ownerId: browserSessionOwnerId,
|
|
138
|
+
sessionManager: browserSessionManager
|
|
139
|
+
});
|
|
70
140
|
case "node_notify":
|
|
71
141
|
return createNodeNotifyTool({
|
|
72
142
|
nodeInvoker: options.nodeInvoker,
|
|
@@ -122,6 +192,10 @@ function getAvailableTools() {
|
|
|
122
192
|
"internet_search",
|
|
123
193
|
"web_crawler",
|
|
124
194
|
"browser_control",
|
|
195
|
+
"browser_session_start",
|
|
196
|
+
"browser_session_action",
|
|
197
|
+
"browser_session_close",
|
|
198
|
+
"browser_session_list",
|
|
125
199
|
"command_execute",
|
|
126
200
|
"background_terminal",
|
|
127
201
|
...NODE_TOOL_NAMES,
|
|
@@ -27,6 +27,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
additionalMessageMiddleware: ()=>additionalMessageMiddleware
|
|
28
28
|
});
|
|
29
29
|
const external_node_path_namespaceObject = require("node:path");
|
|
30
|
+
const messages_namespaceObject = require("@langchain/core/messages");
|
|
30
31
|
const external_langchain_namespaceObject = require("langchain");
|
|
31
32
|
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
32
33
|
const external_uiRegistry_cjs_namespaceObject = require("../uiRegistry.cjs");
|
|
@@ -57,6 +58,7 @@ const buildWorkingDirectoryMessage = (context)=>{
|
|
|
57
58
|
if (!context.workspaceRoot) return null;
|
|
58
59
|
return "** Working Directory **\n- Treat `./` as the current working directory for file and tool operations in this session.\n- Use relative paths such as `./test.md`; do not prepend the working directory absolute path.";
|
|
59
60
|
};
|
|
61
|
+
const buildSessionArtifactsMessage = ()=>"** Session Artifacts **\n- Treat /conversation_history as an internal summarization archive, not working context.\n- Do not inspect conversation history files through file tools or shell commands during normal task work.\n- Prefer the current thread state and /memories/ for durable context.";
|
|
60
62
|
const resolveConnectedNodeIds = async (context)=>{
|
|
61
63
|
if (context.nodeConnectedTargetsProvider) try {
|
|
62
64
|
const rawTargets = await context.nodeConnectedTargetsProvider();
|
|
@@ -167,6 +169,7 @@ const additionalMessageMiddleware = (context = {})=>({
|
|
|
167
169
|
if (outputLocation) lines.push(outputLocation);
|
|
168
170
|
const workingDirectory = buildWorkingDirectoryMessage(context);
|
|
169
171
|
if (workingDirectory) lines.push(workingDirectory);
|
|
172
|
+
lines.push(buildSessionArtifactsMessage());
|
|
170
173
|
const nodeTargets = await buildNodeTargetsMessage(context);
|
|
171
174
|
if (nodeTargets) lines.push(nodeTargets);
|
|
172
175
|
lines.push("** Long-term memory **\n- Use /memories/ for durable notes across threads.\n- Store stable preferences, project context, decisions, and research notes.\n- Avoid transient logs; keep entries concise and organized.\n- Suggested paths: /memories/preferences.md, /memories/projects/<name>/context.md, /memories/projects/<name>/decisions.md");
|
|
@@ -184,7 +187,7 @@ const additionalMessageMiddleware = (context = {})=>({
|
|
|
184
187
|
return {
|
|
185
188
|
...input,
|
|
186
189
|
messages: [
|
|
187
|
-
new
|
|
190
|
+
new messages_namespaceObject.HumanMessage({
|
|
188
191
|
content: lines.join("\n\n"),
|
|
189
192
|
additional_kwargs: {
|
|
190
193
|
ui_hidden: true,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isAbsolute, relative } from "node:path";
|
|
2
|
-
import { HumanMessage
|
|
2
|
+
import { HumanMessage } from "@langchain/core/messages";
|
|
3
|
+
import { MIDDLEWARE_BRAND } from "langchain";
|
|
3
4
|
import { getConfidentialityNotice } from "../utils.js";
|
|
4
5
|
import { loadUiRegistry, resolveUiRegistryPath, summarizeUiRegistry } from "../uiRegistry.js";
|
|
5
6
|
const INJECTION_SOURCE = "additional-message-middleware";
|
|
@@ -29,6 +30,7 @@ const buildWorkingDirectoryMessage = (context)=>{
|
|
|
29
30
|
if (!context.workspaceRoot) return null;
|
|
30
31
|
return "** Working Directory **\n- Treat `./` as the current working directory for file and tool operations in this session.\n- Use relative paths such as `./test.md`; do not prepend the working directory absolute path.";
|
|
31
32
|
};
|
|
33
|
+
const buildSessionArtifactsMessage = ()=>"** Session Artifacts **\n- Treat /conversation_history as an internal summarization archive, not working context.\n- Do not inspect conversation history files through file tools or shell commands during normal task work.\n- Prefer the current thread state and /memories/ for durable context.";
|
|
32
34
|
const resolveConnectedNodeIds = async (context)=>{
|
|
33
35
|
if (context.nodeConnectedTargetsProvider) try {
|
|
34
36
|
const rawTargets = await context.nodeConnectedTargetsProvider();
|
|
@@ -139,6 +141,7 @@ const additionalMessageMiddleware = (context = {})=>({
|
|
|
139
141
|
if (outputLocation) lines.push(outputLocation);
|
|
140
142
|
const workingDirectory = buildWorkingDirectoryMessage(context);
|
|
141
143
|
if (workingDirectory) lines.push(workingDirectory);
|
|
144
|
+
lines.push(buildSessionArtifactsMessage());
|
|
142
145
|
const nodeTargets = await buildNodeTargetsMessage(context);
|
|
143
146
|
if (nodeTargets) lines.push(nodeTargets);
|
|
144
147
|
lines.push("** Long-term memory **\n- Use /memories/ for durable notes across threads.\n- Store stable preferences, project context, decisions, and research notes.\n- Avoid transient logs; keep entries concise and organized.\n- Suggested paths: /memories/preferences.md, /memories/projects/<name>/context.md, /memories/projects/<name>/decisions.md");
|