aws-runtime-bridge 1.9.175 → 1.9.179
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/CHANGELOG.md +188 -0
- package/README.md +61 -2
- package/dist/adapter/AcodeSdkAdapter.d.ts +369 -0
- package/dist/adapter/AcodeSdkAdapter.js +2 -2
- package/dist/adapter/AdapterRegistry.d.ts +28 -0
- package/dist/adapter/ClaudeSdkAdapter.d.ts +71 -0
- package/dist/adapter/CodexSdkAdapter.d.ts +14 -0
- package/dist/adapter/OpencodeSdkAdapter.d.ts +44 -0
- package/dist/adapter/acode-tool-names.d.ts +9 -0
- package/dist/adapter/idle-poll-loop.d.ts +20 -0
- package/dist/adapter/index.d.ts +3 -0
- package/dist/adapter/instance-ai-config-resolver.d.ts +20 -0
- package/dist/adapter/prompts.d.ts +12 -0
- package/dist/adapter/types.d.ts +182 -0
- package/dist/browser/browser-bootstrap.d.ts +15 -0
- package/dist/browser/browser-connect-token.d.ts +11 -0
- package/dist/browser/browser-frame-encode.d.ts +32 -0
- package/dist/browser/browser-pool.d.ts +129 -0
- package/dist/browser/browser-profile-store.d.ts +41 -0
- package/dist/browser/browser-ws-bridge.d.ts +20 -0
- package/dist/browser/built-in-browser-tools.d.ts +44 -0
- package/dist/browser/element-locator.d.ts +25 -0
- package/dist/browser/element-picker.d.ts +30 -0
- package/dist/browser/frame-encode.d.ts +19 -0
- package/dist/browser/input-dispatcher.d.ts +35 -0
- package/dist/browser/listener-store.d.ts +44 -0
- package/dist/browser/page-listener-manager.d.ts +88 -0
- package/dist/browser/page-listener-types.d.ts +38 -0
- package/dist/browser/screencast-differ.d.ts +10 -0
- package/dist/browser/screencast-manager.d.ts +94 -0
- package/dist/browser/snapshot-serializer.d.ts +56 -0
- package/dist/browser/ssrf-guard.d.ts +44 -0
- package/dist/browser/stealth.d.ts +21 -0
- package/dist/browser/step-archive.d.ts +13 -0
- package/dist/browser/types.d.ts +100 -0
- package/dist/browser/ws-server.d.ts +54 -0
- package/dist/config.d.ts +138 -2
- package/dist/config.js +2 -2
- package/dist/desktop/built-in-desktop-tools.d.ts +68 -0
- package/dist/desktop/built-in-desktop-tools.js +2 -1
- package/dist/desktop/desktop-control.d.ts +142 -0
- package/dist/desktop/desktop-control.js +2 -0
- package/dist/desktop/desktop-mcp-client.d.ts +28 -0
- package/dist/desktop/desktop-staleness.d.ts +66 -0
- package/dist/desktop/desktop-staleness.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/middleware/auth.d.ts +26 -0
- package/dist/middleware/auth.js +1 -1
- package/dist/remote-desktop/computer-control.d.ts +3 -0
- package/dist/remote-desktop/coords.d.ts +6 -0
- package/dist/remote-desktop/frame-backpressure.d.ts +10 -0
- package/dist/remote-desktop/frame-encode.d.ts +3 -0
- package/dist/remote-desktop/index.js +2 -2
- package/dist/remote-desktop/input-dispatcher.d.ts +4 -0
- package/dist/remote-desktop/permission-manager.d.ts +3 -0
- package/dist/remote-desktop/screen-capture.d.ts +91 -0
- package/dist/remote-desktop/session-manager.d.ts +47 -0
- package/dist/remote-desktop/session-manager.js +1 -1
- package/dist/remote-desktop/system-backend.d.ts +64 -0
- package/dist/remote-desktop/types.d.ts +25 -0
- package/dist/remote-desktop/ui-automation.d.ts +11 -0
- package/dist/remote-desktop/win32-api.d.ts +10 -0
- package/dist/routes/acode-todos.d.ts +13 -0
- package/dist/routes/agent-state.d.ts +15 -0
- package/dist/routes/ai-sources.js +1 -1
- package/dist/routes/background-tasks.d.ts +18 -0
- package/dist/routes/background-tasks.js +2 -2
- package/dist/routes/browser-listeners.d.ts +17 -0
- package/dist/routes/browser-sessions.d.ts +10 -0
- package/dist/routes/capabilities.js +1 -1
- package/dist/routes/dashboard-icon.d.ts +9 -0
- package/dist/routes/dashboard-icon.js +2 -0
- package/dist/routes/dashboard-theme.d.ts +24 -0
- package/dist/routes/dashboard-theme.js +157 -0
- package/dist/routes/dashboard.d.ts +9 -0
- package/dist/routes/dashboard.js +1988 -625
- package/dist/routes/debug-mount.d.ts +16 -0
- package/dist/routes/desktop-control.d.ts +15 -0
- package/dist/routes/desktop-control.js +2 -0
- package/dist/routes/events.d.ts +4 -0
- package/dist/routes/file-browser.d.ts +11 -0
- package/dist/routes/file-change-diff.d.ts +25 -0
- package/dist/routes/file-diff-rollback.d.ts +28 -0
- package/dist/routes/file-snapshot.d.ts +7 -0
- package/dist/routes/git.d.ts +143 -0
- package/dist/routes/instance-tool-status.d.ts +5 -0
- package/dist/routes/instance.d.ts +8 -0
- package/dist/routes/instance.js +1 -1
- package/dist/routes/jdks.d.ts +4 -0
- package/dist/routes/launch.d.ts +5 -0
- package/dist/routes/lsp-providers.d.ts +11 -0
- package/dist/routes/lsp-providers.js +2 -0
- package/dist/routes/lsp.d.ts +41 -0
- package/dist/routes/lsp.js +4 -2
- package/dist/routes/mcp-extra.d.ts +15 -0
- package/dist/routes/mcp.d.ts +16 -0
- package/dist/routes/mcp.js +1 -1
- package/dist/routes/plugins.d.ts +19 -0
- package/dist/routes/plugins.js +1 -1
- package/dist/routes/processes.d.ts +4 -0
- package/dist/routes/properties.d.ts +4 -0
- package/dist/routes/pty.d.ts +29 -0
- package/dist/routes/runtime-binding.d.ts +3 -0
- package/dist/routes/sessions.d.ts +22 -0
- package/dist/routes/skills.d.ts +15 -0
- package/dist/routes/skills.js +1 -1
- package/dist/routes/sub-agents.d.ts +11 -0
- package/dist/routes/sub-agents.js +1 -1
- package/dist/routes/task-context.d.ts +5 -0
- package/dist/routes/tech-stack.d.ts +4 -0
- package/dist/routes/terminal.d.ts +122 -0
- package/dist/routes/terminal.js +16 -16
- package/dist/routes/workspace-index.d.ts +12 -0
- package/dist/routes/workspace-index.js +2 -0
- package/dist/routes/yml.d.ts +4 -0
- package/dist/scripts/migrate-user-scopes.d.ts +26 -0
- package/dist/scripts/migrate-user-scopes.js +2 -0
- package/dist/services/access-control.d.ts +21 -0
- package/dist/services/acode-bg-manager.d.ts +21 -0
- package/dist/services/acode-package.d.ts +10 -0
- package/dist/services/acode-package.js +1 -1
- package/dist/services/agent-capability-sync.d.ts +26 -0
- package/dist/services/agent-capability-sync.js +1 -1
- package/dist/services/agent-event-store.d.ts +20 -0
- package/dist/services/agent-ownership.d.ts +58 -0
- package/dist/services/agent-ownership.js +3 -0
- package/dist/services/agent-process-manager.d.ts +154 -0
- package/dist/services/agent-pty-manager.d.ts +37 -0
- package/dist/services/agent-startup-memory.d.ts +34 -0
- package/dist/services/agent-startup-memory.js +1 -1
- package/dist/services/ai-config-service.d.ts +26 -52
- package/dist/services/ai-config-service.js +1 -3
- package/dist/services/ai-source-apply.d.ts +7 -15
- package/dist/services/ai-source-apply.js +1 -1
- package/dist/services/auto-register.d.ts +165 -1
- package/dist/services/auto-register.js +1 -1
- package/dist/services/aws-client-agent-mcp.d.ts +14 -0
- package/dist/services/aws-client-agent-mcp.js +2 -2
- package/dist/services/bridge-package-publish-hooks.d.ts +14 -0
- package/dist/services/bridge-pairing.d.ts +82 -0
- package/dist/services/bridge-pairing.js +2 -0
- package/dist/services/bridge-temp-files.d.ts +29 -0
- package/dist/services/browser-session-manager.d.ts +71 -0
- package/dist/services/capability-config.d.ts +60 -15
- package/dist/services/capability-config.js +2 -2
- package/dist/services/change-cache-retention.d.ts +9 -0
- package/dist/services/changelog.d.ts +9 -0
- package/dist/services/cli-commands.d.ts +82 -0
- package/dist/services/cli-commands.js +6 -6
- package/dist/services/connection-key-rotation.d.ts +27 -0
- package/dist/services/connection-key-rotation.js +2 -0
- package/dist/services/debug-mount.d.ts +49 -0
- package/dist/services/desktop-mcp-manager.d.ts +103 -1
- package/dist/services/desktop-mcp-manager.js +1 -1
- package/dist/services/event-delta-pusher.d.ts +15 -0
- package/dist/services/fileSnapshotStore.d.ts +33 -0
- package/dist/services/gitignore.d.ts +9 -0
- package/dist/services/instance-ai-config-service.d.ts +9 -0
- package/dist/services/instance-ai-config-service.js +1 -1
- package/dist/services/instance-features.d.ts +127 -0
- package/dist/services/instance-features.js +1 -1
- package/dist/services/instance-init-service.d.ts +3 -0
- package/dist/services/instance-init-service.js +1 -1
- package/dist/services/instance-state.d.ts +23 -0
- package/dist/services/jdk-scanner.d.ts +15 -0
- package/dist/services/launch-manager.d.ts +138 -0
- package/dist/services/launch-metrics.d.ts +42 -0
- package/dist/services/launch-streams.d.ts +19 -0
- package/dist/services/lifecycle-state.d.ts +5 -0
- package/dist/services/log-retention.d.ts +38 -0
- package/dist/services/lsp/install-manager.d.ts +55 -0
- package/dist/services/lsp/install-manager.js +2 -0
- package/dist/services/lsp/provider-registry.d.ts +108 -0
- package/dist/services/lsp/provider-registry.js +2 -0
- package/dist/services/lsp/uri-rewrite.d.ts +44 -0
- package/dist/services/lsp/uri-rewrite.js +2 -0
- package/dist/services/lsp-stdio-bridge.d.ts +41 -4
- package/dist/services/lsp-stdio-bridge.js +3 -3
- package/dist/services/mcp-deploy.d.ts +45 -4
- package/dist/services/mcp-deploy.js +4 -4
- package/dist/services/mcp-env-injector.d.ts +52 -0
- package/dist/services/mcp-launch-binding-queue.d.ts +12 -0
- package/dist/services/mcp-package.d.ts +22 -0
- package/dist/services/mcp-package.js +1 -1
- package/dist/services/mcp-probe-client.d.ts +19 -0
- package/dist/services/mcp-probe-client.js +1 -1
- package/dist/services/open-doc-events.d.ts +22 -0
- package/dist/services/open-doc-registry.d.ts +35 -0
- package/dist/services/orphan-monitor.d.ts +43 -0
- package/dist/services/panel-auth.d.ts +24 -0
- package/dist/services/panel-env.d.ts +28 -0
- package/dist/services/plugin-deployment.d.ts +34 -1
- package/dist/services/plugin-deployment.js +2 -2
- package/dist/services/plugin-event-buffer.d.ts +21 -0
- package/dist/services/plugin-fs.d.ts +11 -0
- package/dist/services/plugin-handler-adapter.d.ts +13 -0
- package/dist/services/plugin-listener-runner.d.ts +10 -0
- package/dist/services/plugin-loader.d.ts +15 -0
- package/dist/services/plugin-manager.d.ts +95 -9
- package/dist/services/plugin-manager.js +4 -4
- package/dist/services/plugin-manifest.d.ts +14 -0
- package/dist/services/plugin-package.d.ts +13 -0
- package/dist/services/plugin-runtime.d.ts +15 -0
- package/dist/services/port-detector.d.ts +15 -0
- package/dist/services/process-detail.d.ts +3 -0
- package/dist/services/process-detector.d.ts +132 -0
- package/dist/services/process-registry.d.ts +120 -0
- package/dist/services/process-top.d.ts +6 -0
- package/dist/services/request-identity.d.ts +77 -0
- package/dist/services/request-identity.js +2 -0
- package/dist/services/request-invalid-dump.d.ts +4 -0
- package/dist/services/ring-buffer.d.ts +33 -0
- package/dist/services/runtime-binding.d.ts +56 -4
- package/dist/services/runtime-binding.js +4 -4
- package/dist/services/runtime-lifecycle-policy.d.ts +17 -0
- package/dist/services/runtime-resources-snapshot.d.ts +26 -0
- package/dist/services/sdk-tool-file-change-recorder.d.ts +9 -0
- package/dist/services/session-output.d.ts +63 -0
- package/dist/services/session-output.js +3 -3
- package/dist/services/skill-manager.d.ts +42 -5
- package/dist/services/skill-manager.js +3 -3
- package/dist/services/snapshot-retention.d.ts +23 -0
- package/dist/services/startup-config-wizard.d.ts +7 -1
- package/dist/services/startup-config-wizard.js +10 -10
- package/dist/services/system-metrics.d.ts +3 -0
- package/dist/services/tech-stack-scanner.d.ts +12 -0
- package/dist/services/terminal-persistence.d.ts +43 -0
- package/dist/services/tool-installer.d.ts +12 -0
- package/dist/services/tunnel-client.d.ts +57 -2
- package/dist/services/tunnel-client.js +1 -1
- package/dist/services/update-log.d.ts +6 -0
- package/dist/services/update-notifier.d.ts +17 -0
- package/dist/services/update-notifier.js +2 -2
- package/dist/services/user-scope.d.ts +115 -0
- package/dist/services/user-scope.js +2 -0
- package/dist/services/windows-service-manager.d.ts +12 -0
- package/dist/services/workspace-files.d.ts +64 -0
- package/dist/services/workspace-index/index-manager.d.ts +46 -0
- package/dist/services/workspace-index/index-manager.js +2 -0
- package/dist/services/workspace-index/indexer.d.ts +15 -0
- package/dist/services/workspace-index/indexer.js +2 -0
- package/dist/services/workspace-index/query.d.ts +74 -0
- package/dist/services/workspace-index/query.js +5 -0
- package/dist/services/workspace-index/resolver.d.ts +26 -0
- package/dist/services/workspace-index/resolver.js +2 -0
- package/dist/services/workspace-index/types.d.ts +89 -0
- package/dist/services/workspace-index/types.js +2 -0
- package/dist/services/workspace-watch.d.ts +4 -0
- package/dist/services/workspaceTaskChangeWatcher.d.ts +49 -0
- package/dist/services/workspaceTaskChangeWatcher.js +1 -1
- package/dist/types.d.ts +9 -0
- package/dist/utils/config-write-queue.d.ts +11 -0
- package/dist/utils/env-safety.d.ts +21 -0
- package/dist/utils/file-utils.d.ts +15 -0
- package/dist/utils/instance-ai-config-debug-logger.d.ts +15 -0
- package/dist/utils/lifecycle-log.d.ts +5 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.js +2 -1
- package/dist/utils/npm-version.d.ts +10 -0
- package/dist/utils/path-utils.d.ts +12 -0
- package/dist/utils/scheduler-url.d.ts +18 -0
- package/dist/utils/scheduler-url.js +2 -0
- package/dist/utils/sdk-package-loader.d.ts +13 -0
- package/dist/utils/sdk-package-loader.js +1 -1
- package/dist/utils/target-identity.d.ts +31 -0
- package/dist/utils/target-identity.js +2 -0
- package/dist/utils/validation.d.ts +17 -0
- package/dist/utils/yaml-utils.d.ts +48 -0
- package/package/acode/dist/__tests__/summary-request-helper.d.ts +10 -0
- package/package/acode/dist/ask-user-question-tool.d.ts +17 -0
- package/package/acode/dist/await-complete-tool.d.ts +12 -0
- package/package/acode/dist/background-command-manager.d.ts +105 -0
- package/package/acode/dist/background-command-store.d.ts +27 -0
- package/package/acode/dist/background-command-tools.d.ts +8 -0
- package/package/acode/dist/background-output-ringbuffer.d.ts +15 -0
- package/package/acode/dist/built-in-file-tools.d.ts +65 -0
- package/package/acode/dist/built-in-symbols-tool.d.ts +3 -0
- package/package/acode/dist/builtins/commandArtifacts.d.ts +3 -0
- package/package/acode/dist/builtins/shellCommandPreparation.d.ts +17 -0
- package/package/acode/dist/builtins/shellCommandRunner.d.ts +4 -0
- package/package/acode/dist/builtins/shellOutputDecoder.d.ts +15 -0
- package/package/acode/dist/cache-control.d.ts +45 -0
- package/package/acode/dist/commands/commandLoader.d.ts +3 -0
- package/package/acode/dist/commands/commandParser.d.ts +3 -0
- package/package/acode/dist/commands/commandRegistry.d.ts +3 -0
- package/package/acode/dist/compaction.d.ts +354 -0
- package/package/acode/dist/config.d.ts +3 -0
- package/package/acode/dist/context-overflow.d.ts +32 -0
- package/package/acode/dist/fs-utils.d.ts +18 -0
- package/package/acode/dist/hooks/hookBus.d.ts +3 -0
- package/package/acode/dist/image-utils.d.ts +35 -0
- package/package/acode/dist/index.d.ts +1 -0
- package/package/acode/dist/index.js +1 -1
- package/package/acode/dist/mcpToolNames.d.ts +32 -0
- package/package/acode/dist/microcompact.d.ts +53 -0
- package/package/acode/dist/parsers/ast-cache.d.ts +41 -0
- package/package/acode/dist/parsers/file-index.d.ts +83 -0
- package/package/acode/dist/parsers/file-index.js +4 -0
- package/package/acode/dist/parsers/language-detector.d.ts +4 -0
- package/package/acode/dist/parsers/tree-sitter-loader.d.ts +12 -0
- package/package/acode/dist/parsers/types.d.ts +11 -0
- package/package/acode/dist/paths.d.ts +14 -0
- package/package/acode/dist/plugin-types.d.ts +34 -0
- package/package/acode/dist/read-file-state.d.ts +15 -0
- package/package/acode/dist/runtime-environment.d.ts +16 -0
- package/package/acode/dist/runtime.d.ts +824 -9
- package/package/acode/dist/runtime.js +21 -21
- package/package/acode/dist/skill-tool.d.ts +20 -0
- package/package/acode/dist/sub-agent-manager.d.ts +169 -0
- package/package/acode/dist/sub-agent-manager.js +1 -1
- package/package/acode/dist/sub-agent-store.d.ts +50 -0
- package/package/acode/dist/sub-agent-tools.d.ts +15 -0
- package/package/acode/dist/sub-agent-types.d.ts +13 -0
- package/package/acode/dist/terminal-tool.d.ts +15 -0
- package/package/acode/dist/terminal-types.d.ts +10 -0
- package/package/acode/dist/todo-store.d.ts +15 -0
- package/package/acode/dist/token-estimator.d.ts +17 -0
- package/package/acode/dist/tool-allocation.d.ts +113 -0
- package/package/acode/dist/tool-concurrency/index.d.ts +8 -0
- package/package/acode/dist/tool-concurrency/observability.d.ts +32 -0
- package/package/acode/dist/tool-concurrency/resource-lock.d.ts +30 -0
- package/package/acode/dist/tool-concurrency/scheduler.d.ts +19 -0
- package/package/acode/dist/tool-concurrency/types.d.ts +57 -0
- package/package/acode/dist/tool-group-manager.d.ts +195 -0
- package/package/acode/dist/tool-group-manager.js +4 -4
- package/package/acode/dist/types.d.ts +179 -0
- package/package/aws-client-agent-mcp/README.md +130 -215
- package/package/aws-client-agent-mcp/dist/ability-market-tools.d.ts +57 -0
- package/package/aws-client-agent-mcp/dist/agent-client.d.ts +277 -3
- package/package/aws-client-agent-mcp/dist/agent-client.js +1 -1
- package/package/aws-client-agent-mcp/dist/config.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/constants.d.ts +2 -0
- package/package/aws-client-agent-mcp/dist/context-manager.d.ts +70 -0
- package/package/aws-client-agent-mcp/dist/http-client.d.ts +61 -0
- package/package/aws-client-agent-mcp/dist/index.d.ts +10 -0
- package/package/aws-client-agent-mcp/dist/logger.d.ts +24 -0
- package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +606 -1
- package/package/aws-client-agent-mcp/dist/mcp-server.js +4 -4
- package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts +158 -0
- package/package/aws-client-agent-mcp/dist/mcp-tools.js +38 -22
- package/package/aws-client-agent-mcp/dist/memory-store.d.ts +81 -0
- package/package/aws-client-agent-mcp/dist/memory-tools.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/message-buffer.d.ts +86 -0
- package/package/aws-client-agent-mcp/dist/messageContent.d.ts +24 -0
- package/package/aws-client-agent-mcp/dist/office/office-equation.d.ts +19 -0
- package/package/aws-client-agent-mcp/dist/office/office-image.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/office/office-workspace.d.ts +29 -0
- package/package/aws-client-agent-mcp/dist/parent-lifecycle.d.ts +18 -0
- package/package/aws-client-agent-mcp/dist/runtime-launch-binding.d.ts +6 -0
- package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts +4 -0
- package/package/aws-client-agent-mcp/dist/status-reporter.d.ts +41 -0
- package/package/aws-client-agent-mcp/dist/tool-groups.d.ts +136 -0
- package/package/aws-client-agent-mcp/dist/types.d.ts +123 -0
- package/package/aws-client-agent-mcp/dist/watchdog.d.ts +7 -0
- package/package/aws-client-agent-mcp/dist/websocket-client.d.ts +108 -0
- package/package.json +1 -1
package/dist/browser/types.d.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
2
11
|
import type { Browser, BrowserContext, Page } from "playwright";
|
|
3
12
|
import type { PageListenerManager } from "./page-listener-manager.js";
|
|
4
13
|
import type { ScreencastManager } from "./screencast-manager.js";
|
|
@@ -41,6 +50,9 @@ export interface SessionBrowser {
|
|
|
41
50
|
|
|
42
51
|
browserId: string;
|
|
43
52
|
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
44
56
|
title: string;
|
|
45
57
|
|
|
46
58
|
browser: Browser;
|
|
@@ -59,17 +71,36 @@ export interface SessionBrowser {
|
|
|
59
71
|
|
|
60
72
|
lastActivityAt: number;
|
|
61
73
|
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
62
77
|
humanTakeover: boolean;
|
|
63
78
|
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
64
82
|
takeoverClientId?: string;
|
|
65
83
|
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
66
87
|
qualityPreset: QualityPreset;
|
|
67
88
|
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
68
93
|
listenerManager: PageListenerManager;
|
|
69
94
|
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
70
98
|
autoSaveTimer?: ReturnType<typeof setInterval>;
|
|
71
99
|
}
|
|
72
100
|
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
73
104
|
export declare function makeBrowserKey(agentId: string, browserId: string): string;
|
|
74
105
|
|
|
75
106
|
export declare function parseBrowserKey(key: string): {
|
|
@@ -105,6 +136,11 @@ export interface StepArchiveConfig {
|
|
|
105
136
|
|
|
106
137
|
export interface SsrfConfig {
|
|
107
138
|
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
108
144
|
allowPrivate?: boolean;
|
|
109
145
|
|
|
110
146
|
blocklist?: string[];
|
|
@@ -131,6 +167,15 @@ export interface BrowserPoolConfig {
|
|
|
131
167
|
|
|
132
168
|
executablePath?: string;
|
|
133
169
|
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
134
179
|
stealth?: boolean;
|
|
135
180
|
|
|
136
181
|
viewportWidth?: number;
|
|
@@ -157,23 +202,66 @@ export interface BrowserPoolConfig {
|
|
|
157
202
|
|
|
158
203
|
timezone?: string;
|
|
159
204
|
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
160
213
|
profileDir?: string;
|
|
161
214
|
}
|
|
162
215
|
|
|
163
216
|
export declare const MAX_SESSIONS = 8;
|
|
164
217
|
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
165
223
|
export declare const MAX_SESSIONS_PER_AGENT = 4;
|
|
166
224
|
|
|
167
225
|
export declare const MAX_PAGES_PER_SESSION = 5;
|
|
168
226
|
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
169
233
|
export declare const SESSION_TIMEOUT_MS = 0;
|
|
170
234
|
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
171
240
|
export declare const IDLE_TIMEOUT_MS = 0;
|
|
172
241
|
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
173
247
|
export declare const WS_PORT = 7891;
|
|
174
248
|
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
175
256
|
export declare const WS_HOST = "127.0.0.1";
|
|
176
257
|
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
177
265
|
export declare const WS_DEFAULT_MAX_SEND_BYTES: number;
|
|
178
266
|
|
|
179
267
|
export declare const WS_DEFAULT_HEARTBEAT_MS: number;
|
|
@@ -188,6 +276,11 @@ export interface QualityPresetConfig {
|
|
|
188
276
|
|
|
189
277
|
format: ImageFormat;
|
|
190
278
|
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
191
284
|
quality: number;
|
|
192
285
|
|
|
193
286
|
maxWidth: number;
|
|
@@ -195,6 +288,11 @@ export interface QualityPresetConfig {
|
|
|
195
288
|
maxHeight: number;
|
|
196
289
|
}
|
|
197
290
|
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
198
296
|
export declare const QUALITY_PRESETS: Record<QualityPreset, QualityPresetConfig>;
|
|
199
297
|
|
|
200
298
|
export declare function isQualityPreset(value: unknown): value is QualityPreset;
|
|
@@ -203,6 +301,8 @@ export declare const TILE_DIFF_CONFIG: {
|
|
|
203
301
|
|
|
204
302
|
readonly tileSize: 160;
|
|
205
303
|
|
|
304
|
+
|
|
305
|
+
|
|
206
306
|
readonly sampleStep: 8;
|
|
207
307
|
|
|
208
308
|
readonly diffThreshold: 24;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
2
16
|
import type { BrowserPool } from "./browser-pool.js";
|
|
3
17
|
import type { PageListenerInfo } from "./page-listener-types.js";
|
|
4
18
|
import { type WsServerConfig } from "./types.js";
|
|
5
19
|
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
export declare class BrowserWsServer {
|
|
7
25
|
private readonly pool;
|
|
8
26
|
private readonly config;
|
|
@@ -19,6 +37,13 @@ export declare class BrowserWsServer {
|
|
|
19
37
|
private lastCursor;
|
|
20
38
|
constructor(pool: BrowserPool, config?: WsServerConfig);
|
|
21
39
|
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
22
47
|
start(): Promise<{
|
|
23
48
|
port: number;
|
|
24
49
|
host: string;
|
|
@@ -30,14 +55,30 @@ export declare class BrowserWsServer {
|
|
|
30
55
|
|
|
31
56
|
getPort(): number;
|
|
32
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
33
63
|
getUrl(agentId: string, browserId?: string): string;
|
|
34
64
|
private attachHandlers;
|
|
35
65
|
private handleConnection;
|
|
36
66
|
|
|
67
|
+
|
|
68
|
+
|
|
37
69
|
private handleInputMessage;
|
|
38
70
|
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
39
77
|
private queryAndPushSelection;
|
|
40
78
|
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
41
82
|
private queryAndPushCursor;
|
|
42
83
|
|
|
43
84
|
private sendFrame;
|
|
@@ -49,8 +90,17 @@ export declare class BrowserWsServer {
|
|
|
49
90
|
private startMainHeartbeat;
|
|
50
91
|
private stopMainHeartbeat;
|
|
51
92
|
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
52
98
|
broadcastListenerUpdate(agentId: string, browserId: string, listeners: PageListenerInfo[]): void;
|
|
53
99
|
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
54
104
|
broadcastListenerTriggered(agentId: string, browserId: string, payload: {
|
|
55
105
|
listenerId: string;
|
|
56
106
|
selector: string;
|
|
@@ -62,6 +112,10 @@ export declare class BrowserWsServer {
|
|
|
62
112
|
}): void;
|
|
63
113
|
}
|
|
64
114
|
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
65
119
|
export declare function getBrowserWsServer(pool: BrowserPool, config?: WsServerConfig): Promise<BrowserWsServer>;
|
|
66
120
|
|
|
67
121
|
export declare function stopBrowserWsServer(): Promise<void>;
|
package/dist/config.d.ts
CHANGED
|
@@ -1,15 +1,55 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
3
12
|
export declare function isDevMode(): boolean;
|
|
4
13
|
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export declare function isDesktopAppMode(): boolean;
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
export declare function getBridgeListenHost(): string | undefined;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
5
35
|
export declare function getUserHomeDir(): string;
|
|
6
36
|
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
7
43
|
export declare function getRuntimeHomeDir(): string;
|
|
8
44
|
|
|
9
45
|
export declare const DEFAULT_BRIDGE_PORT = 18081;
|
|
10
46
|
|
|
11
47
|
export declare const DEV_DEFAULT_BRIDGE_PORT = 28081;
|
|
12
48
|
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
13
53
|
export declare const port: number;
|
|
14
54
|
|
|
15
55
|
export declare function getActiveBridgeHttpPort(): number;
|
|
@@ -18,9 +58,19 @@ export declare function setActiveBridgeHttpPort(value: number): void;
|
|
|
18
58
|
|
|
19
59
|
export declare function resetActiveBridgeHttpPort(): void;
|
|
20
60
|
|
|
21
|
-
export declare function findAvailableListenPort(preferred: number, maxAttempts?: number): Promise<number>;
|
|
22
61
|
|
|
23
|
-
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
export declare function findAvailableListenPort(preferred: number, maxAttempts?: number, host?: string): Promise<number>;
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
export declare function reserveBridgeListenPort(preferred?: number, host?: string | undefined): Promise<number>;
|
|
24
74
|
|
|
25
75
|
export declare const DEFAULT_SCHEDULER_BASE_URL = "http://localhost:8080";
|
|
26
76
|
export type SchedulerBaseUrlSource = "request" | "instance-id-match" | "env" | "single-auto-register-target" | "default" | "ambiguous-auto-register-targets" | "token-match";
|
|
@@ -32,16 +82,41 @@ export interface SchedulerBaseUrlResolution {
|
|
|
32
82
|
instanceId?: string;
|
|
33
83
|
|
|
34
84
|
instanceName?: string;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
userKey?: string;
|
|
35
91
|
}
|
|
36
92
|
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
37
97
|
export declare function getAutoRegisterConfigFilePath(): string;
|
|
38
98
|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
39
103
|
export declare function getBridgeRuntimePropertiesFilePath(): string;
|
|
40
104
|
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
41
109
|
export declare function writeBridgeRuntimePropertiesFile(): void;
|
|
42
110
|
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
43
114
|
export declare function resolveSchedulerBaseUrl(): SchedulerBaseUrlResolution;
|
|
44
115
|
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
45
120
|
export declare function resolveSchedulerBaseUrlFrom(requestSchedulerBaseUrl: unknown, instanceId?: unknown, instanceName?: unknown): SchedulerBaseUrlResolution;
|
|
46
121
|
|
|
47
122
|
export declare const schedulerBaseUrl: string;
|
|
@@ -61,21 +136,64 @@ export declare function getClaudeMcpConfigFile(runtimeHome: string): string;
|
|
|
61
136
|
export declare function getClaudeSkillsDir(runtimeHome: string): string;
|
|
62
137
|
|
|
63
138
|
export declare function getOpencodeConfigFile(runtimeHome: string): string;
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
64
159
|
|
|
65
160
|
export declare function getBridgeDataHome(): string;
|
|
66
161
|
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
67
166
|
export declare function getBridgeTemplateDir(): string;
|
|
68
167
|
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
69
171
|
export declare function getBridgeTemplateConfigFile(): string;
|
|
70
172
|
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
71
176
|
export declare function getBridgeTemplateSkillsDir(): string;
|
|
72
177
|
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
73
181
|
export declare function getBridgeTemplatePluginsDir(): string;
|
|
74
182
|
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
75
186
|
export declare function getBridgeTemplateMcpDir(): string;
|
|
76
187
|
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
77
192
|
export declare function getBridgeTemplateMcpPackagesDir(): string;
|
|
78
193
|
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
79
197
|
export declare function getBridgeTemplateAgentsDir(): string;
|
|
80
198
|
|
|
81
199
|
export declare function getBridgeInstanceRuntimeDir(agentId: string): string;
|
|
@@ -86,12 +204,23 @@ export declare function getBridgeInstanceSkillsDir(agentId: string): string;
|
|
|
86
204
|
|
|
87
205
|
export declare function getBridgeInstancePluginsDir(agentId: string): string;
|
|
88
206
|
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
89
213
|
export declare function getBridgeInstancePrivateSkillsDir(agentId: string): string;
|
|
90
214
|
|
|
91
215
|
export declare function getBridgeInstancePrivateSkillsManifest(agentId: string): string;
|
|
92
216
|
|
|
93
217
|
export declare function getBridgeInstanceMcpExtraFile(agentId: string): string;
|
|
94
218
|
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
95
224
|
export declare function getAcodeDataHome(): string;
|
|
96
225
|
|
|
97
226
|
export declare function getCodexConfigFile(runtimeHome: string): string;
|
|
@@ -101,6 +230,8 @@ export declare function getCodexSkillsDir(runtimeHome: string): string;
|
|
|
101
230
|
export declare function getOpencodeSkillsDir(runtimeHome: string): string;
|
|
102
231
|
|
|
103
232
|
|
|
233
|
+
|
|
234
|
+
|
|
104
235
|
export declare const ORPHAN_SCAN_INTERVAL: number;
|
|
105
236
|
|
|
106
237
|
export declare const ORPHAN_AUTO_CLEAN_MODE: "auto" | "alert" | "manual";
|
|
@@ -114,6 +245,8 @@ export declare const ORPHAN_CPU_THRESHOLD: number;
|
|
|
114
245
|
export declare const ORPHAN_MEMORY_THRESHOLD: number;
|
|
115
246
|
|
|
116
247
|
|
|
248
|
+
|
|
249
|
+
|
|
117
250
|
export declare const AUTO_REGISTER_ENABLED: boolean;
|
|
118
251
|
|
|
119
252
|
export declare const AUTO_REGISTER_TENANT_ID: string;
|
|
@@ -130,4 +263,7 @@ export declare const AUTO_REGISTER_WORKSPACE_PATH: string;
|
|
|
130
263
|
|
|
131
264
|
export declare const AUTO_REGISTER_VIRTUAL_IP: string;
|
|
132
265
|
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
133
269
|
export declare function getBridgeVersion(): string;
|
package/dist/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"node:fs";import C from"node:net";import{homedir as B}from"node:os";import r from"node:path";import{fileURLToPath as v}from"node:url";import{logger as M}from"./utils/logger.js";function h(e){return String(e??"").replace(/[^a-zA-Z0-9_.-]/g,"_").replace(/^\.+/g,"")}function U(){return String(process.env.AWS_RUNTIME_ENV||"").trim().toLowerCase()==="development"}function ee(){return String(process.env.AWS_BRIDGE_APP_MODE||"").trim().toLowerCase()==="desktop"}function H(){return String(process.env.AWS_BRIDGE_LISTEN_HOST||"").trim()||void 0}let S;function W(){if(S!==void 0)return S;const e=r.dirname(v(import.meta.url)),n=r.resolve(e,".."),t=r.resolve(n,".."),o=a.existsSync(r.join(t,".git"))||a.existsSync(r.join(t,"package.json"));return S=r.join(o?t:n,".dev-home"),S}function x(){return String(process.env.AWS_TEST_HOME||"").trim()||String(process.env.AWS_RUNTIME_HOME_DIR||"").trim()||B()}function m(){return U()?String(process.env.AWS_TEST_HOME||"").trim()||String(process.env.AWS_RUNTIME_HOME_DIR||"").trim()||W():x()}const j=18081,k=28081,D=Number(process.env.AWS_RUNTIME_BRIDGE_PORT||(U()?k:j));let T;function w(){return T??D}function y(e){T=e}function te(){T=void 0}function I(e){return new Promise(n=>{const t=C.createServer();t.once("error",o=>{const s=o.code==="EADDRINUSE"||o.code==="EACCES"||o.code==="EPERM";n(!s)}),t.once("listening",()=>{t.close(()=>n(!0))}),t.listen(e)})}async function P(e,n){return n?await I({port:e,host:n})?e:null:await I({port:e})&&await I({port:e,host:"0.0.0.0"})?e:null}async function F(e,n=20,t){let o=Math.floor(e);for(let c=0;c<n;c+=1){if(o>=1&&o<=65535){const i=await P(o,t);if(i!==null)return i}o+=1}return await P(0,t)??e}async function re(e=D,n=H()){const t=await F(e,20,n);return y(t),process.env.AWS_RUNTIME_BRIDGE_PORT=String(t),t!==e&&M.warn(`[runtime-bridge] \u9996\u9009\u7AEF\u53E3 ${e} \u5DF2\u88AB\u5360\u7528\uFF0C\u81EA\u52A8\u6539\u7528 ${t} \u542F\u52A8`),t}const d="http://localhost:8080";function A(e){return e==null?void 0:String(e).trim()||void 0}function _(e){const n=A(e);if(!n)return;const t=n.replace(/^((?:https?|wss?):\/\/(?:\[[^\]]+\]|[^/:?#]+):\d+):\d+(?=\/|$)/i,"$1");try{const o=new URL(t);return o.protocol==="ws:"?o.protocol="http:":o.protocol==="wss:"?o.protocol="https:":o.protocol=o.protocol.toLowerCase(),o.hostname=o.hostname.toLowerCase(),o.origin}catch{return t.replace(/\/+$/,"")}}function G(){return r.join(m(),".aws-bridge","config.json")}function b(){return r.join(m(),".aws-bridge","bridge-runtime.properties")}function ne(){const e=b();a.mkdirSync(r.dirname(e),{recursive:!0});const n=[`port=${w()}`,`pid=${process.pid}`,`startedAt=${new Date().toISOString()}`];a.writeFileSync(e,`${n.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`,{encoding:"utf8",mode:384})}function
|
|
3
|
+
`,{encoding:"utf8",mode:384})}function f(){const e=G();try{if(!a.existsSync(e))return[];const n=JSON.parse(a.readFileSync(e,"utf-8")),t=i=>({serverUrl:_(i.serverUrl)||_(i.schedulerBaseUrl),instanceId:A(i.instanceId),instanceName:A(i.instanceName),userKey:A(i.userKey)}),s=(Array.isArray(n.autoRegisterTargets)?n.autoRegisterTargets:[]).filter(i=>!!(i&&typeof i=="object"&&!Array.isArray(i))).map(t).filter(i=>!!i.serverUrl);if(s.length>0)return s;const c=t(n);return c.serverUrl?[c]:[]}catch{return[]}}function K(){const n=f().map(t=>t.serverUrl).filter(t=>!!t);return Array.from(new Set(n))}function V(){return f().length}function oe(){return $(void 0)}function $(e,n,t){const o=_(e);if(o)return{url:o,source:"request",ambiguousTargetUrls:[]};const s=typeof n=="string"?n.trim():"",c=typeof t=="string"?t.trim():"";if(s||c){const R=f();let u;if(s&&(u=R.find(g=>g.instanceId===s)),!u&&c&&(u=R.find(g=>g.instanceName===c)),!u&&s&&!c&&(u=R.find(g=>g.instanceName===s)),u?.serverUrl)return{url:u.serverUrl,source:"instance-id-match",ambiguousTargetUrls:[],instanceId:u.instanceId,instanceName:u.instanceName,userKey:u.userKey}}const i=_(process.env.AWS_RUNTIME_SCHEDULER_BASE_URL);if(i)return{url:i,source:"env",ambiguousTargetUrls:[]};const l=K(),N=V();return N===1&&l.length===1?{url:l[0]||d,source:"single-auto-register-target",ambiguousTargetUrls:[],userKey:f()[0]?.userKey}:N>1||l.length>1?{url:d,source:"ambiguous-auto-register-targets",ambiguousTargetUrls:l}:{url:d,source:"default",ambiguousTargetUrls:[]}}const ie=_(process.env.AWS_RUNTIME_SCHEDULER_BASE_URL)||d,se=process.env.NODE_ENV||"development",ce=process.env.AWS_ALLOW_HOST_FILE_BROWSER==="true",ue=String(process.env.AWS_RUNTIME_CORS_ORIGINS||"http://localhost:3000,http://127.0.0.1:3000,http://localhost:5173,http://127.0.0.1:5173").split(",").map(e=>e.trim()).filter(e=>e.length>0);function ae(){}function pe(e){return String(process.env.AWS_RUNTIME_CLAUDE_CONFIG_FILE||"").trim()||r.join(e,".claude","settings.json")}function le(e){return String(process.env.AWS_RUNTIME_CLAUDE_MCP_CONFIG_FILE||"").trim()||r.join(e,".claude.json")}function ge(e){return String(process.env.AWS_RUNTIME_CLAUDE_SKILLS_DIR||"").trim()||r.join(e,".claude","skills")}function _e(e){return String(process.env.AWS_RUNTIME_OPENCODE_CONFIG_FILE||"").trim()||r.join(e,".config","opencode","opencode.json")}function L(){return r.join(m(),".aws-bridge")}function E(){return r.join(L(),"instance-template")}function Ee(){return String(process.env.AWS_RUNTIME_ACODE_CONFIG_FILE||"").trim()||r.join(E(),"config.json")}function Se(){return String(process.env.AWS_RUNTIME_ACODE_SKILLS_DIR||"").trim()||r.join(E(),"skills")}function de(){return String(process.env.AWS_RUNTIME_ACODE_PLUGINS_DIR||"").trim()||r.join(E(),"plugins")}function z(){return r.join(E(),"mcp")}function Ae(){return r.join(z(),"packages")}function fe(){return r.join(E(),"agents")}function p(e){return r.join(L(),"instance-runtime",h(String(e)))}function Re(e){return r.join(p(e),"config.json")}function me(e){return r.join(p(e),"skills")}function Te(e){return r.join(p(e),"plugins")}function Ie(e){return r.join(p(e),"private-skills")}function Oe(e){return r.join(p(e),"private-skills.json")}function Ne(e){return r.join(p(e),"mcp-extra.json")}function ve(){return String(process.env.ACODE_HOME||"").trim()||r.join(x(),".acode")}function Ue(e){return String(process.env.AWS_RUNTIME_CODEX_CONFIG_FILE||"").trim()||r.join(e,".codex","config.toml")}function xe(e){return String(process.env.AWS_RUNTIME_CODEX_SKILLS_DIR||"").trim()||r.join(e,".codex","skills")}function De(e){return String(process.env.AWS_RUNTIME_OPENCODE_SKILLS_DIR||"").trim()||r.join(e,".opencode","skills")}const Pe=Number(process.env.AWS_ORPHAN_SCAN_INTERVAL||3e4),Le=process.env.AWS_ORPHAN_AUTO_CLEAN_MODE||"alert",Ce=process.env.AWS_ORPHAN_SCAN_ENABLED!=="false",Be=Number(process.env.AWS_ORPHAN_UNRESPONSIVE_TIMEOUT||3e5),Me=Number(process.env.AWS_ORPHAN_CPU_THRESHOLD||100),he=Number(process.env.AWS_ORPHAN_MEMORY_THRESHOLD||2048),He=process.env.AWS_AUTO_REGISTER==="true",We=process.env.AWS_TENANT_ID||"",je=process.env.AWS_USER_KEY||"",ke=process.env.AWS_INSTANCE_NAME||"",we=process.env.AWS_PROJECT_NAME||"",ye=process.env.AWS_ROLE_NAME||"",Fe=process.env.AWS_WORKSPACE_PATH||"",Ge=process.env.AWS_REGISTER_IP||process.env.AWS_VIRTUAL_IP||"";let O;function be(){if(O!==void 0)return O;let e="unknown";try{const n=r.dirname(v(import.meta.url)),t=r.resolve(n,"..","package.json");a.existsSync(t)&&(e=JSON.parse(a.readFileSync(t,"utf-8")).version||"unknown")}catch{}return O=e,e}export{He as AUTO_REGISTER_ENABLED,ke as AUTO_REGISTER_INSTANCE_NAME,we as AUTO_REGISTER_PROJECT_NAME,ye as AUTO_REGISTER_ROLE_NAME,We as AUTO_REGISTER_TENANT_ID,je as AUTO_REGISTER_USER_KEY,Ge as AUTO_REGISTER_VIRTUAL_IP,Fe as AUTO_REGISTER_WORKSPACE_PATH,j as DEFAULT_BRIDGE_PORT,d as DEFAULT_SCHEDULER_BASE_URL,k as DEV_DEFAULT_BRIDGE_PORT,Le as ORPHAN_AUTO_CLEAN_MODE,Me as ORPHAN_CPU_THRESHOLD,he as ORPHAN_MEMORY_THRESHOLD,Ce as ORPHAN_SCAN_ENABLED,Pe as ORPHAN_SCAN_INTERVAL,Be as ORPHAN_UNRESPONSIVE_TIMEOUT,ce as allowHostFileBrowser,ue as allowedCorsOrigins,F as findAvailableListenPort,ve as getAcodeDataHome,w as getActiveBridgeHttpPort,G as getAutoRegisterConfigFilePath,L as getBridgeDataHome,Re as getBridgeInstanceConfigFile,Ne as getBridgeInstanceMcpExtraFile,Te as getBridgeInstancePluginsDir,Ie as getBridgeInstancePrivateSkillsDir,Oe as getBridgeInstancePrivateSkillsManifest,p as getBridgeInstanceRuntimeDir,me as getBridgeInstanceSkillsDir,H as getBridgeListenHost,b as getBridgeRuntimePropertiesFilePath,fe as getBridgeTemplateAgentsDir,Ee as getBridgeTemplateConfigFile,E as getBridgeTemplateDir,z as getBridgeTemplateMcpDir,Ae as getBridgeTemplateMcpPackagesDir,de as getBridgeTemplatePluginsDir,Se as getBridgeTemplateSkillsDir,be as getBridgeVersion,pe as getClaudeConfigFile,le as getClaudeMcpConfigFile,ge as getClaudeSkillsDir,Ue as getCodexConfigFile,xe as getCodexSkillsDir,_e as getOpencodeConfigFile,De as getOpencodeSkillsDir,m as getRuntimeHomeDir,x as getUserHomeDir,ee as isDesktopAppMode,U as isDevMode,se as nodeEnv,D as port,re as reserveBridgeListenPort,te as resetActiveBridgeHttpPort,oe as resolveSchedulerBaseUrl,$ as resolveSchedulerBaseUrlFrom,ie as schedulerBaseUrl,y as setActiveBridgeHttpPort,ae as validateProductionToken,ne as writeBridgeRuntimePropertiesFile};
|
|
4
4
|
|
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
3
44
|
export type DesktopJsonValue = string | number | boolean | null | DesktopJsonValue[] | {
|
|
4
45
|
[key: string]: DesktopJsonValue;
|
|
5
46
|
};
|
|
@@ -34,19 +75,46 @@ export interface CreateBuiltInDesktopToolsOptions {
|
|
|
34
75
|
|
|
35
76
|
forwarder: DesktopToolForwarder;
|
|
36
77
|
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
internalForwarder?: DesktopToolForwarder;
|
|
82
|
+
|
|
83
|
+
agentId?: string;
|
|
84
|
+
|
|
37
85
|
screenshotDir?: string;
|
|
38
86
|
}
|
|
39
87
|
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
40
91
|
export declare function createBuiltInDesktopTools(options: CreateBuiltInDesktopToolsOptions): ACodeBuiltInToolLike[];
|
|
41
92
|
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
42
97
|
export declare function injectRememberedOrigin(args: DesktopJsonObject): DesktopJsonObject;
|
|
43
98
|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
44
104
|
export declare function rememberScreenshotOrigin(toolName: string, args: DesktopJsonObject, result: string): void;
|
|
45
105
|
|
|
46
106
|
export declare function clearScreenshotOrigins(): void;
|
|
47
107
|
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
48
112
|
export declare function injectScreenshotPath(toolName: string, args: DesktopJsonObject, screenshotDir: string): Promise<DesktopJsonObject>;
|
|
49
113
|
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
50
118
|
export declare function pruneOldScreenshots(dir: string, options?: {
|
|
51
119
|
now?: number;
|
|
52
120
|
force?: boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import{mkdir as
|
|
1
|
+
import{mkdir as g,readdir as k,rm as E,stat as T}from"node:fs/promises";import{dirname as b,join as f}from"node:path";import{markFreshObservation as x,normalizePathKey as A,recordPerceiveBasis as v,recordScreenshotCapture as I,resolveStalenessNote as R}from"./desktop-staleness.js";const S=new Set(["desktop_screenshot","desktop_window_screenshot"]),P=" Note: when no `path` is given, the bridge auto-saves the PNG to a local file and returns its path (NOT base64). COORDINATES: the bridge remembers each auto-saved screenshot's screen origin \u2014 running desktop_perceive on that file returns SCREEN coordinates directly, ready for desktop_mouse. Never do coordinate arithmetic yourself. For native windows prefer desktop_uia_tree + desktop_uia_click instead \u2014 precise and vision-free.",D=new Set(["desktop_mouse","desktop_mouse_drag","desktop_click_mark"]),C=' FRESHNESS: the bridge tracks which screenshot your coordinates came from \u2014 if the screen changed since, the tool result carries a "[bridge] STALE COORDINATES" warning. When you see it, re-capture with desktop_screenshot + desktop_perceive before retrying.';function q(e){const{tools:n,forwarder:o,internalForwarder:i,agentId:s}=e,a=e.screenshotDir??f(process.cwd(),".desktop-mcp","screenshots");return n.filter(t=>t.name.startsWith("desktop_")).map(t=>{const p=S.has(t.name),r=t.name==="desktop_perceive",l=D.has(t.name),O=p?`${t.description??t.name}${P}`:l?`${t.description??t.name}${C}`:t.description??t.name;return{kind:"builtin",toolName:t.name,exposedName:t.name,description:O,inputSchema:z(t.inputSchema),category:"desktop",async execute(d){let c=d;p?c=await F(t.name,d,a):r&&(c=H(d));const m=s&&l?await R({agentId:s,toolName:t.name,args:c,internalForwarder:i,screenshotDir:a}):null,h=await o(t.name,c);return p?(j(t.name,c,h),I(s??"",t.name,c,h)):r&&typeof c.path=="string"&&c.path.trim()?await v(s??"",c.path):r&&s&&x(s),m?`${h}
|
|
2
|
+
${m}`:h}}})}const u=new Map,$=500;function _(e){return A(e)}function y(e){return e!=null}function H(e){const n=typeof e.path=="string"?e.path.trim():"";if(!n||y(e.origin_x)||y(e.origin_y))return e;const o=u.get(_(n));return o?{...e,origin_x:o.x,origin_y:o.y}:e}function j(e,n,o){let i=null;try{i=JSON.parse(o)}catch{i=null}const a=(typeof i?.path=="string"?i.path:"")||(typeof n.path=="string"?n.path:"");if(!a.trim())return;let t=null;if(e==="desktop_window_screenshot"){const r=i?.origin;r&&typeof r.x=="number"&&typeof r.y=="number"&&(t={x:r.x,y:r.y,at:Date.now()})}else{const r=n.region;r&&typeof r.x=="number"&&typeof r.y=="number"?t={x:r.x,y:r.y,at:Date.now()}:r||(t={x:0,y:0,at:Date.now()})}if(!t)return;const p=_(a);for(u.delete(p),u.set(p,t);u.size>$;){const r=u.keys().next().value;if(r===void 0)break;u.delete(r)}}function B(){u.clear()}async function F(e,n,o){if(!S.has(e)||typeof n.path=="string"&&n.path.trim())return n;const i=G(o);return await g(b(i),{recursive:!0}).catch(()=>{}),L(o).catch(()=>{}),{...n,path:i}}const w=(()=>{const e=Number.parseInt(process.env.AWS_DESKTOP_MCP_SCREENSHOT_RETENTION_DAYS??"",10);return Number.isFinite(e)&&e>=0?e:7})(),M=2*36e5;let N=0;async function L(e,n){const o=n?.now??Date.now();if(w===0||!n?.force&&o-N<M)return;N=o;const i=o-w*864e5;let s;try{s=await k(e)}catch{return}await Promise.all(s.filter(a=>a.startsWith("shot-")&&a.endsWith(".png")).map(async a=>{const t=f(e,a);try{(await T(t)).mtimeMs<i&&await E(t,{force:!0})}catch{}}))}let W=0;function G(e){const n=(++W).toString(36).padStart(3,"0"),o=new Date().toISOString().replace(/[:.]/g,"-");return f(e,`shot-${o}-${n}.png`)}function z(e){if(!e||typeof e!="object")return{type:"object",properties:{}};try{return JSON.parse(JSON.stringify(e))}catch{return{type:"object",properties:{}}}}export{B as clearScreenshotOrigins,q as createBuiltInDesktopTools,H as injectRememberedOrigin,F as injectScreenshotPath,G as nextScreenshotFilePath,L as pruneOldScreenshots,j as rememberScreenshotOrigin};
|
|
2
3
|
|