aws-runtime-bridge 1.9.175 → 1.9.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/CHANGELOG.md +223 -0
  2. package/README.md +61 -2
  3. package/dist/adapter/AcodeSdkAdapter.d.ts +382 -0
  4. package/dist/adapter/AcodeSdkAdapter.js +3 -3
  5. package/dist/adapter/AdapterRegistry.d.ts +28 -0
  6. package/dist/adapter/ClaudeSdkAdapter.d.ts +71 -0
  7. package/dist/adapter/CodexSdkAdapter.d.ts +14 -0
  8. package/dist/adapter/OpencodeSdkAdapter.d.ts +44 -0
  9. package/dist/adapter/acode-tool-names.d.ts +9 -0
  10. package/dist/adapter/idle-poll-loop.d.ts +20 -0
  11. package/dist/adapter/index.d.ts +3 -0
  12. package/dist/adapter/instance-ai-config-resolver.d.ts +20 -0
  13. package/dist/adapter/prompts.d.ts +12 -0
  14. package/dist/adapter/types.d.ts +201 -0
  15. package/dist/browser/browser-bootstrap.d.ts +15 -0
  16. package/dist/browser/browser-connect-token.d.ts +11 -0
  17. package/dist/browser/browser-frame-encode.d.ts +32 -0
  18. package/dist/browser/browser-pool.d.ts +129 -0
  19. package/dist/browser/browser-profile-store.d.ts +41 -0
  20. package/dist/browser/browser-ws-bridge.d.ts +20 -0
  21. package/dist/browser/built-in-browser-tools.d.ts +44 -0
  22. package/dist/browser/element-locator.d.ts +25 -0
  23. package/dist/browser/element-picker.d.ts +30 -0
  24. package/dist/browser/frame-encode.d.ts +19 -0
  25. package/dist/browser/input-dispatcher.d.ts +35 -0
  26. package/dist/browser/listener-store.d.ts +44 -0
  27. package/dist/browser/page-listener-manager.d.ts +88 -0
  28. package/dist/browser/page-listener-types.d.ts +38 -0
  29. package/dist/browser/screencast-differ.d.ts +10 -0
  30. package/dist/browser/screencast-manager.d.ts +94 -0
  31. package/dist/browser/snapshot-serializer.d.ts +56 -0
  32. package/dist/browser/ssrf-guard.d.ts +44 -0
  33. package/dist/browser/stealth.d.ts +21 -0
  34. package/dist/browser/step-archive.d.ts +13 -0
  35. package/dist/browser/types.d.ts +100 -0
  36. package/dist/browser/ws-server.d.ts +54 -0
  37. package/dist/config.d.ts +138 -2
  38. package/dist/config.js +2 -2
  39. package/dist/desktop/built-in-desktop-tools.d.ts +68 -0
  40. package/dist/desktop/built-in-desktop-tools.js +2 -1
  41. package/dist/desktop/desktop-control.d.ts +142 -0
  42. package/dist/desktop/desktop-control.js +2 -0
  43. package/dist/desktop/desktop-mcp-client.d.ts +28 -0
  44. package/dist/desktop/desktop-staleness.d.ts +66 -0
  45. package/dist/desktop/desktop-staleness.js +2 -0
  46. package/dist/index.d.ts +4 -0
  47. package/dist/index.js +1 -1
  48. package/dist/middleware/auth.d.ts +26 -0
  49. package/dist/middleware/auth.js +1 -1
  50. package/dist/remote-desktop/computer-control.d.ts +3 -0
  51. package/dist/remote-desktop/coords.d.ts +6 -0
  52. package/dist/remote-desktop/frame-backpressure.d.ts +10 -0
  53. package/dist/remote-desktop/frame-encode.d.ts +3 -0
  54. package/dist/remote-desktop/index.js +2 -2
  55. package/dist/remote-desktop/input-dispatcher.d.ts +4 -0
  56. package/dist/remote-desktop/permission-manager.d.ts +3 -0
  57. package/dist/remote-desktop/screen-capture.d.ts +91 -0
  58. package/dist/remote-desktop/session-manager.d.ts +47 -0
  59. package/dist/remote-desktop/session-manager.js +1 -1
  60. package/dist/remote-desktop/system-backend.d.ts +64 -0
  61. package/dist/remote-desktop/types.d.ts +25 -0
  62. package/dist/remote-desktop/ui-automation.d.ts +11 -0
  63. package/dist/remote-desktop/win32-api.d.ts +10 -0
  64. package/dist/routes/acode-todos.d.ts +13 -0
  65. package/dist/routes/agent-state.d.ts +15 -0
  66. package/dist/routes/ai-sources.js +1 -1
  67. package/dist/routes/background-tasks.d.ts +18 -0
  68. package/dist/routes/background-tasks.js +2 -2
  69. package/dist/routes/browser-listeners.d.ts +17 -0
  70. package/dist/routes/browser-sessions.d.ts +10 -0
  71. package/dist/routes/capabilities.js +1 -1
  72. package/dist/routes/dashboard-icon.d.ts +9 -0
  73. package/dist/routes/dashboard-icon.js +2 -0
  74. package/dist/routes/dashboard-theme.d.ts +24 -0
  75. package/dist/routes/dashboard-theme.js +157 -0
  76. package/dist/routes/dashboard.d.ts +9 -0
  77. package/dist/routes/dashboard.js +1988 -625
  78. package/dist/routes/debug-mount.d.ts +16 -0
  79. package/dist/routes/desktop-control.d.ts +15 -0
  80. package/dist/routes/desktop-control.js +2 -0
  81. package/dist/routes/events.d.ts +4 -0
  82. package/dist/routes/file-browser.d.ts +11 -0
  83. package/dist/routes/file-change-diff.d.ts +25 -0
  84. package/dist/routes/file-diff-rollback.d.ts +28 -0
  85. package/dist/routes/file-snapshot.d.ts +7 -0
  86. package/dist/routes/git.d.ts +143 -0
  87. package/dist/routes/instance-tool-status.d.ts +5 -0
  88. package/dist/routes/instance.d.ts +8 -0
  89. package/dist/routes/instance.js +1 -1
  90. package/dist/routes/jdks.d.ts +4 -0
  91. package/dist/routes/launch.d.ts +5 -0
  92. package/dist/routes/lsp-providers.d.ts +11 -0
  93. package/dist/routes/lsp-providers.js +2 -0
  94. package/dist/routes/lsp.d.ts +41 -0
  95. package/dist/routes/lsp.js +4 -2
  96. package/dist/routes/mcp-extra.d.ts +15 -0
  97. package/dist/routes/mcp.d.ts +16 -0
  98. package/dist/routes/mcp.js +1 -1
  99. package/dist/routes/plugins.d.ts +19 -0
  100. package/dist/routes/plugins.js +1 -1
  101. package/dist/routes/processes.d.ts +4 -0
  102. package/dist/routes/properties.d.ts +4 -0
  103. package/dist/routes/pty.d.ts +29 -0
  104. package/dist/routes/runtime-binding.d.ts +3 -0
  105. package/dist/routes/sessions.d.ts +22 -0
  106. package/dist/routes/skills.d.ts +15 -0
  107. package/dist/routes/skills.js +1 -1
  108. package/dist/routes/sub-agents.d.ts +11 -0
  109. package/dist/routes/sub-agents.js +1 -1
  110. package/dist/routes/task-context.d.ts +5 -0
  111. package/dist/routes/tech-stack.d.ts +4 -0
  112. package/dist/routes/terminal.d.ts +131 -0
  113. package/dist/routes/terminal.js +25 -25
  114. package/dist/routes/workspace-index.d.ts +12 -0
  115. package/dist/routes/workspace-index.js +2 -0
  116. package/dist/routes/yml.d.ts +4 -0
  117. package/dist/scripts/migrate-user-scopes.d.ts +26 -0
  118. package/dist/scripts/migrate-user-scopes.js +2 -0
  119. package/dist/services/access-control.d.ts +21 -0
  120. package/dist/services/acode-bg-manager.d.ts +21 -0
  121. package/dist/services/acode-package.d.ts +10 -0
  122. package/dist/services/acode-package.js +1 -1
  123. package/dist/services/agent-capability-sync.d.ts +26 -0
  124. package/dist/services/agent-capability-sync.js +1 -1
  125. package/dist/services/agent-event-store.d.ts +20 -0
  126. package/dist/services/agent-ownership.d.ts +58 -0
  127. package/dist/services/agent-ownership.js +3 -0
  128. package/dist/services/agent-process-manager.d.ts +154 -0
  129. package/dist/services/agent-pty-manager.d.ts +37 -0
  130. package/dist/services/agent-startup-memory.d.ts +34 -0
  131. package/dist/services/agent-startup-memory.js +1 -1
  132. package/dist/services/ai-config-service.d.ts +26 -52
  133. package/dist/services/ai-config-service.js +1 -3
  134. package/dist/services/ai-source-apply.d.ts +7 -15
  135. package/dist/services/ai-source-apply.js +1 -1
  136. package/dist/services/auto-register.d.ts +165 -1
  137. package/dist/services/auto-register.js +1 -1
  138. package/dist/services/aws-client-agent-mcp.d.ts +14 -0
  139. package/dist/services/aws-client-agent-mcp.js +2 -2
  140. package/dist/services/bridge-package-publish-hooks.d.ts +14 -0
  141. package/dist/services/bridge-pairing.d.ts +82 -0
  142. package/dist/services/bridge-pairing.js +2 -0
  143. package/dist/services/bridge-temp-files.d.ts +29 -0
  144. package/dist/services/browser-session-manager.d.ts +71 -0
  145. package/dist/services/capability-config.d.ts +60 -15
  146. package/dist/services/capability-config.js +2 -2
  147. package/dist/services/change-cache-retention.d.ts +9 -0
  148. package/dist/services/changelog.d.ts +9 -0
  149. package/dist/services/cli-commands.d.ts +82 -0
  150. package/dist/services/cli-commands.js +6 -6
  151. package/dist/services/connection-key-rotation.d.ts +27 -0
  152. package/dist/services/connection-key-rotation.js +2 -0
  153. package/dist/services/debug-mount.d.ts +49 -0
  154. package/dist/services/desktop-mcp-manager.d.ts +103 -1
  155. package/dist/services/desktop-mcp-manager.js +1 -1
  156. package/dist/services/event-delta-pusher.d.ts +15 -0
  157. package/dist/services/fileSnapshotStore.d.ts +33 -0
  158. package/dist/services/gitignore.d.ts +9 -0
  159. package/dist/services/instance-ai-config-service.d.ts +9 -0
  160. package/dist/services/instance-ai-config-service.js +1 -1
  161. package/dist/services/instance-features.d.ts +127 -0
  162. package/dist/services/instance-features.js +1 -1
  163. package/dist/services/instance-init-service.d.ts +3 -0
  164. package/dist/services/instance-init-service.js +1 -1
  165. package/dist/services/instance-state.d.ts +23 -0
  166. package/dist/services/jdk-scanner.d.ts +15 -0
  167. package/dist/services/launch-manager.d.ts +138 -0
  168. package/dist/services/launch-metrics.d.ts +42 -0
  169. package/dist/services/launch-streams.d.ts +19 -0
  170. package/dist/services/lifecycle-state.d.ts +5 -0
  171. package/dist/services/log-retention.d.ts +38 -0
  172. package/dist/services/lsp/install-manager.d.ts +55 -0
  173. package/dist/services/lsp/install-manager.js +2 -0
  174. package/dist/services/lsp/provider-registry.d.ts +108 -0
  175. package/dist/services/lsp/provider-registry.js +2 -0
  176. package/dist/services/lsp/uri-rewrite.d.ts +44 -0
  177. package/dist/services/lsp/uri-rewrite.js +2 -0
  178. package/dist/services/lsp-stdio-bridge.d.ts +41 -4
  179. package/dist/services/lsp-stdio-bridge.js +3 -3
  180. package/dist/services/mcp-deploy.d.ts +45 -4
  181. package/dist/services/mcp-deploy.js +4 -4
  182. package/dist/services/mcp-env-injector.d.ts +52 -0
  183. package/dist/services/mcp-launch-binding-queue.d.ts +12 -0
  184. package/dist/services/mcp-package.d.ts +22 -0
  185. package/dist/services/mcp-package.js +1 -1
  186. package/dist/services/mcp-probe-client.d.ts +19 -0
  187. package/dist/services/mcp-probe-client.js +1 -1
  188. package/dist/services/open-doc-events.d.ts +22 -0
  189. package/dist/services/open-doc-registry.d.ts +35 -0
  190. package/dist/services/orphan-monitor.d.ts +43 -0
  191. package/dist/services/panel-auth.d.ts +24 -0
  192. package/dist/services/panel-env.d.ts +28 -0
  193. package/dist/services/plugin-deployment.d.ts +34 -1
  194. package/dist/services/plugin-deployment.js +2 -2
  195. package/dist/services/plugin-event-buffer.d.ts +21 -0
  196. package/dist/services/plugin-fs.d.ts +11 -0
  197. package/dist/services/plugin-handler-adapter.d.ts +13 -0
  198. package/dist/services/plugin-listener-runner.d.ts +10 -0
  199. package/dist/services/plugin-loader.d.ts +15 -0
  200. package/dist/services/plugin-manager.d.ts +95 -9
  201. package/dist/services/plugin-manager.js +4 -4
  202. package/dist/services/plugin-manifest.d.ts +14 -0
  203. package/dist/services/plugin-package.d.ts +13 -0
  204. package/dist/services/plugin-runtime.d.ts +15 -0
  205. package/dist/services/port-detector.d.ts +15 -0
  206. package/dist/services/process-detail.d.ts +3 -0
  207. package/dist/services/process-detector.d.ts +132 -0
  208. package/dist/services/process-registry.d.ts +120 -0
  209. package/dist/services/process-top.d.ts +6 -0
  210. package/dist/services/request-identity.d.ts +77 -0
  211. package/dist/services/request-identity.js +2 -0
  212. package/dist/services/request-invalid-dump.d.ts +4 -0
  213. package/dist/services/ring-buffer.d.ts +33 -0
  214. package/dist/services/runtime-binding.d.ts +56 -4
  215. package/dist/services/runtime-binding.js +4 -4
  216. package/dist/services/runtime-lifecycle-policy.d.ts +17 -0
  217. package/dist/services/runtime-resources-snapshot.d.ts +26 -0
  218. package/dist/services/sdk-tool-file-change-recorder.d.ts +9 -0
  219. package/dist/services/session-output.d.ts +63 -0
  220. package/dist/services/session-output.js +3 -3
  221. package/dist/services/skill-manager.d.ts +42 -5
  222. package/dist/services/skill-manager.js +3 -3
  223. package/dist/services/snapshot-retention.d.ts +23 -0
  224. package/dist/services/startup-config-wizard.d.ts +7 -1
  225. package/dist/services/startup-config-wizard.js +10 -10
  226. package/dist/services/system-metrics.d.ts +3 -0
  227. package/dist/services/tech-stack-scanner.d.ts +12 -0
  228. package/dist/services/terminal-persistence.d.ts +43 -0
  229. package/dist/services/tool-installer.d.ts +12 -0
  230. package/dist/services/tunnel-client.d.ts +57 -2
  231. package/dist/services/tunnel-client.js +1 -1
  232. package/dist/services/update-log.d.ts +6 -0
  233. package/dist/services/update-notifier.d.ts +17 -0
  234. package/dist/services/update-notifier.js +2 -2
  235. package/dist/services/user-scope.d.ts +115 -0
  236. package/dist/services/user-scope.js +2 -0
  237. package/dist/services/windows-service-manager.d.ts +12 -0
  238. package/dist/services/workspace-files.d.ts +64 -0
  239. package/dist/services/workspace-index/index-manager.d.ts +46 -0
  240. package/dist/services/workspace-index/index-manager.js +2 -0
  241. package/dist/services/workspace-index/indexer.d.ts +15 -0
  242. package/dist/services/workspace-index/indexer.js +2 -0
  243. package/dist/services/workspace-index/query.d.ts +74 -0
  244. package/dist/services/workspace-index/query.js +5 -0
  245. package/dist/services/workspace-index/resolver.d.ts +26 -0
  246. package/dist/services/workspace-index/resolver.js +2 -0
  247. package/dist/services/workspace-index/types.d.ts +89 -0
  248. package/dist/services/workspace-index/types.js +2 -0
  249. package/dist/services/workspace-watch.d.ts +4 -0
  250. package/dist/services/workspaceTaskChangeWatcher.d.ts +49 -0
  251. package/dist/services/workspaceTaskChangeWatcher.js +1 -1
  252. package/dist/types.d.ts +9 -0
  253. package/dist/utils/config-write-queue.d.ts +11 -0
  254. package/dist/utils/env-safety.d.ts +21 -0
  255. package/dist/utils/file-utils.d.ts +15 -0
  256. package/dist/utils/instance-ai-config-debug-logger.d.ts +15 -0
  257. package/dist/utils/lifecycle-log.d.ts +5 -0
  258. package/dist/utils/logger.d.ts +13 -0
  259. package/dist/utils/logger.js +2 -1
  260. package/dist/utils/npm-version.d.ts +10 -0
  261. package/dist/utils/path-utils.d.ts +12 -0
  262. package/dist/utils/scheduler-url.d.ts +18 -0
  263. package/dist/utils/scheduler-url.js +2 -0
  264. package/dist/utils/sdk-package-loader.d.ts +13 -0
  265. package/dist/utils/sdk-package-loader.js +1 -1
  266. package/dist/utils/target-identity.d.ts +31 -0
  267. package/dist/utils/target-identity.js +2 -0
  268. package/dist/utils/validation.d.ts +17 -0
  269. package/dist/utils/yaml-utils.d.ts +48 -0
  270. package/package/acode/dist/__tests__/summary-request-helper.d.ts +10 -0
  271. package/package/acode/dist/ask-user-question-tool.d.ts +17 -0
  272. package/package/acode/dist/await-complete-tool.d.ts +12 -0
  273. package/package/acode/dist/background-command-manager.d.ts +105 -0
  274. package/package/acode/dist/background-command-store.d.ts +27 -0
  275. package/package/acode/dist/background-command-tools.d.ts +8 -0
  276. package/package/acode/dist/background-output-ringbuffer.d.ts +15 -0
  277. package/package/acode/dist/built-in-file-tools.d.ts +65 -0
  278. package/package/acode/dist/built-in-symbols-tool.d.ts +3 -0
  279. package/package/acode/dist/builtins/commandArtifacts.d.ts +3 -0
  280. package/package/acode/dist/builtins/shellCommandPreparation.d.ts +17 -0
  281. package/package/acode/dist/builtins/shellCommandRunner.d.ts +4 -0
  282. package/package/acode/dist/builtins/shellOutputDecoder.d.ts +15 -0
  283. package/package/acode/dist/cache-control.d.ts +45 -0
  284. package/package/acode/dist/commands/commandLoader.d.ts +3 -0
  285. package/package/acode/dist/commands/commandParser.d.ts +3 -0
  286. package/package/acode/dist/commands/commandRegistry.d.ts +3 -0
  287. package/package/acode/dist/compaction.d.ts +354 -0
  288. package/package/acode/dist/config.d.ts +3 -0
  289. package/package/acode/dist/context-overflow.d.ts +32 -0
  290. package/package/acode/dist/fs-utils.d.ts +18 -0
  291. package/package/acode/dist/hooks/hookBus.d.ts +3 -0
  292. package/package/acode/dist/image-utils.d.ts +35 -0
  293. package/package/acode/dist/index.d.ts +1 -0
  294. package/package/acode/dist/index.js +1 -1
  295. package/package/acode/dist/mcpToolNames.d.ts +32 -0
  296. package/package/acode/dist/microcompact.d.ts +53 -0
  297. package/package/acode/dist/parsers/ast-cache.d.ts +41 -0
  298. package/package/acode/dist/parsers/file-index.d.ts +83 -0
  299. package/package/acode/dist/parsers/file-index.js +4 -0
  300. package/package/acode/dist/parsers/language-detector.d.ts +4 -0
  301. package/package/acode/dist/parsers/tree-sitter-loader.d.ts +12 -0
  302. package/package/acode/dist/parsers/types.d.ts +11 -0
  303. package/package/acode/dist/paths.d.ts +14 -0
  304. package/package/acode/dist/plugin-types.d.ts +34 -0
  305. package/package/acode/dist/read-file-state.d.ts +15 -0
  306. package/package/acode/dist/runtime-environment.d.ts +16 -0
  307. package/package/acode/dist/runtime.d.ts +824 -9
  308. package/package/acode/dist/runtime.js +22 -22
  309. package/package/acode/dist/skill-tool.d.ts +20 -0
  310. package/package/acode/dist/sub-agent-manager.d.ts +169 -0
  311. package/package/acode/dist/sub-agent-manager.js +1 -1
  312. package/package/acode/dist/sub-agent-store.d.ts +50 -0
  313. package/package/acode/dist/sub-agent-tools.d.ts +15 -0
  314. package/package/acode/dist/sub-agent-types.d.ts +13 -0
  315. package/package/acode/dist/terminal-tool.d.ts +15 -0
  316. package/package/acode/dist/terminal-types.d.ts +10 -0
  317. package/package/acode/dist/todo-store.d.ts +15 -0
  318. package/package/acode/dist/token-estimator.d.ts +17 -0
  319. package/package/acode/dist/tool-allocation.d.ts +113 -0
  320. package/package/acode/dist/tool-concurrency/index.d.ts +8 -0
  321. package/package/acode/dist/tool-concurrency/observability.d.ts +32 -0
  322. package/package/acode/dist/tool-concurrency/resource-lock.d.ts +30 -0
  323. package/package/acode/dist/tool-concurrency/scheduler.d.ts +19 -0
  324. package/package/acode/dist/tool-concurrency/types.d.ts +57 -0
  325. package/package/acode/dist/tool-group-manager.d.ts +195 -0
  326. package/package/acode/dist/tool-group-manager.js +4 -4
  327. package/package/acode/dist/types.d.ts +194 -0
  328. package/package/aws-client-agent-mcp/README.md +130 -215
  329. package/package/aws-client-agent-mcp/dist/ability-market-tools.d.ts +57 -0
  330. package/package/aws-client-agent-mcp/dist/agent-client.d.ts +277 -3
  331. package/package/aws-client-agent-mcp/dist/agent-client.js +1 -1
  332. package/package/aws-client-agent-mcp/dist/config.d.ts +18 -0
  333. package/package/aws-client-agent-mcp/dist/constants.d.ts +2 -0
  334. package/package/aws-client-agent-mcp/dist/context-manager.d.ts +70 -0
  335. package/package/aws-client-agent-mcp/dist/http-client.d.ts +61 -0
  336. package/package/aws-client-agent-mcp/dist/index.d.ts +10 -0
  337. package/package/aws-client-agent-mcp/dist/logger.d.ts +24 -0
  338. package/package/aws-client-agent-mcp/dist/mcp-server.d.ts +606 -1
  339. package/package/aws-client-agent-mcp/dist/mcp-server.js +4 -4
  340. package/package/aws-client-agent-mcp/dist/mcp-tools.d.ts +158 -0
  341. package/package/aws-client-agent-mcp/dist/mcp-tools.js +38 -22
  342. package/package/aws-client-agent-mcp/dist/memory-store.d.ts +81 -0
  343. package/package/aws-client-agent-mcp/dist/memory-tools.d.ts +18 -0
  344. package/package/aws-client-agent-mcp/dist/message-buffer.d.ts +86 -0
  345. package/package/aws-client-agent-mcp/dist/messageContent.d.ts +24 -0
  346. package/package/aws-client-agent-mcp/dist/office/office-equation.d.ts +19 -0
  347. package/package/aws-client-agent-mcp/dist/office/office-image.d.ts +18 -0
  348. package/package/aws-client-agent-mcp/dist/office/office-workspace.d.ts +29 -0
  349. package/package/aws-client-agent-mcp/dist/parent-lifecycle.d.ts +18 -0
  350. package/package/aws-client-agent-mcp/dist/runtime-launch-binding.d.ts +6 -0
  351. package/package/aws-client-agent-mcp/dist/server-memory-store.d.ts +4 -0
  352. package/package/aws-client-agent-mcp/dist/status-reporter.d.ts +41 -0
  353. package/package/aws-client-agent-mcp/dist/tool-groups.d.ts +136 -0
  354. package/package/aws-client-agent-mcp/dist/types.d.ts +123 -0
  355. package/package/aws-client-agent-mcp/dist/watchdog.d.ts +7 -0
  356. package/package/aws-client-agent-mcp/dist/websocket-client.d.ts +108 -0
  357. package/package.json +1 -1
@@ -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
- export declare function reserveBridgeListenPort(preferred?: number): Promise<number>;
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 u from"node:fs";import L from"node:net";import{homedir as C}from"node:os";import t from"node:path";import{fileURLToPath as I}from"node:url";import{logger as B}from"./utils/logger.js";function M(e){return String(e??"").replace(/[^a-zA-Z0-9_.-]/g,"_").replace(/^\.+/g,"")}function N(){return String(process.env.AWS_RUNTIME_ENV||"").trim().toLowerCase()==="development"}let S;function h(){if(S!==void 0)return S;const e=t.dirname(I(import.meta.url)),r=t.resolve(e,".."),n=t.resolve(r,".."),o=u.existsSync(t.join(n,".git"))||u.existsSync(t.join(n,"package.json"));return S=t.join(o?n:r,".dev-home"),S}function O(){return String(process.env.AWS_TEST_HOME||"").trim()||String(process.env.AWS_RUNTIME_HOME_DIR||"").trim()||C()}function f(){return N()?String(process.env.AWS_TEST_HOME||"").trim()||String(process.env.AWS_RUNTIME_HOME_DIR||"").trim()||h():O()}const H=18081,j=28081,v=Number(process.env.AWS_RUNTIME_BRIDGE_PORT||(N()?j:H));let R;function W(){return R??v}function k(e){R=e}function X(){R=void 0}function U(e){return new Promise(r=>{const n=L.createServer();n.once("error",o=>{const i=o.code==="EADDRINUSE"||o.code==="EACCES"||o.code==="EPERM";r(!i)}),n.once("listening",()=>{n.close(()=>r(!0))}),n.listen(e)})}async function x(e){return await U({port:e})&&await U({port:e,host:"0.0.0.0"})?e:null}async function w(e,r=20){let n=Math.floor(e);for(let i=0;i<r;i+=1){if(n>=1&&n<=65535){const c=await x(n);if(c!==null)return c}n+=1}return await x(0)??e}async function Z(e=v){const r=await w(e);return k(r),process.env.AWS_RUNTIME_BRIDGE_PORT=String(r),r!==e&&B.warn(`[runtime-bridge] \u9996\u9009\u7AEF\u53E3 ${e} \u5DF2\u88AB\u5360\u7528\uFF0C\u81EA\u52A8\u6539\u7528 ${r} \u542F\u52A8`),r}const d="http://localhost:8080";function m(e){return e==null?void 0:String(e).trim()||void 0}function _(e){const r=m(e);if(!r)return;const n=r.replace(/^((?:https?|wss?):\/\/(?:\[[^\]]+\]|[^/:?#]+):\d+):\d+(?=\/|$)/i,"$1");try{const o=new URL(n);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 n.replace(/\/+$/,"")}}function F(){return t.join(f(),".aws-bridge","config.json")}function y(){return t.join(f(),".aws-bridge","bridge-runtime.properties")}function Q(){const e=y();u.mkdirSync(t.dirname(e),{recursive:!0});const r=[`port=${W()}`,`pid=${process.pid}`,`startedAt=${new Date().toISOString()}`];u.writeFileSync(e,`${r.join(`
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 D(){const e=F();try{if(!u.existsSync(e))return[];const r=JSON.parse(u.readFileSync(e,"utf-8")),n=s=>({serverUrl:_(s.serverUrl)||_(s.schedulerBaseUrl),instanceId:m(s.instanceId),instanceName:m(s.instanceName)}),i=(Array.isArray(r.autoRegisterTargets)?r.autoRegisterTargets:[]).filter(s=>!!(s&&typeof s=="object"&&!Array.isArray(s))).map(n).filter(s=>!!s.serverUrl);if(i.length>0)return i;const c=n(r);return c.serverUrl?[c]:[]}catch{return[]}}function b(){const r=D().map(n=>n.serverUrl).filter(n=>!!n);return Array.from(new Set(r))}function ee(){return G(void 0)}function G(e,r,n){const o=_(e);if(o)return{url:o,source:"request",ambiguousTargetUrls:[]};const i=typeof r=="string"?r.trim():"",c=typeof n=="string"?n.trim():"";if(i||c){const A=D();let a;if(i&&(a=A.find(g=>g.instanceId===i)),!a&&c&&(a=A.find(g=>g.instanceName===c)),!a&&i&&!c&&(a=A.find(g=>g.instanceName===i)),a?.serverUrl)return{url:a.serverUrl,source:"instance-id-match",ambiguousTargetUrls:[],instanceId:a.instanceId,instanceName:a.instanceName}}const s=_(process.env.AWS_RUNTIME_SCHEDULER_BASE_URL);if(s)return{url:s,source:"env",ambiguousTargetUrls:[]};const l=b();return l.length===1?{url:l[0]||d,source:"single-auto-register-target",ambiguousTargetUrls:[]}:l.length>1?{url:d,source:"ambiguous-auto-register-targets",ambiguousTargetUrls:l}:{url:d,source:"default",ambiguousTargetUrls:[]}}const te=_(process.env.AWS_RUNTIME_SCHEDULER_BASE_URL)||d,re=process.env.NODE_ENV||"development",ne=process.env.AWS_ALLOW_HOST_FILE_BROWSER==="true",oe=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 ie(){}function se(e){return String(process.env.AWS_RUNTIME_CLAUDE_CONFIG_FILE||"").trim()||t.join(e,".claude","settings.json")}function ce(e){return String(process.env.AWS_RUNTIME_CLAUDE_MCP_CONFIG_FILE||"").trim()||t.join(e,".claude.json")}function ae(e){return String(process.env.AWS_RUNTIME_CLAUDE_SKILLS_DIR||"").trim()||t.join(e,".claude","skills")}function ue(e){return String(process.env.AWS_RUNTIME_OPENCODE_CONFIG_FILE||"").trim()||t.join(e,".config","opencode","opencode.json")}function P(){return t.join(f(),".aws-bridge")}function E(){return t.join(P(),"instance-template")}function pe(){return String(process.env.AWS_RUNTIME_ACODE_CONFIG_FILE||"").trim()||t.join(E(),"config.json")}function le(){return String(process.env.AWS_RUNTIME_ACODE_SKILLS_DIR||"").trim()||t.join(E(),"skills")}function ge(){return String(process.env.AWS_RUNTIME_ACODE_PLUGINS_DIR||"").trim()||t.join(E(),"plugins")}function V(){return t.join(E(),"mcp")}function _e(){return t.join(V(),"packages")}function Ee(){return t.join(E(),"agents")}function p(e){return t.join(P(),"instance-runtime",M(String(e)))}function Se(e){return t.join(p(e),"config.json")}function de(e){return t.join(p(e),"skills")}function Ae(e){return t.join(p(e),"plugins")}function fe(e){return t.join(p(e),"private-skills")}function Re(e){return t.join(p(e),"private-skills.json")}function me(e){return t.join(p(e),"mcp-extra.json")}function Te(){return String(process.env.ACODE_HOME||"").trim()||t.join(O(),".acode")}function Ie(e){return String(process.env.AWS_RUNTIME_CODEX_CONFIG_FILE||"").trim()||t.join(e,".codex","config.toml")}function Ne(e){return String(process.env.AWS_RUNTIME_CODEX_SKILLS_DIR||"").trim()||t.join(e,".codex","skills")}function Oe(e){return String(process.env.AWS_RUNTIME_OPENCODE_SKILLS_DIR||"").trim()||t.join(e,".opencode","skills")}const ve=Number(process.env.AWS_ORPHAN_SCAN_INTERVAL||3e4),Ue=process.env.AWS_ORPHAN_AUTO_CLEAN_MODE||"alert",xe=process.env.AWS_ORPHAN_SCAN_ENABLED!=="false",De=Number(process.env.AWS_ORPHAN_UNRESPONSIVE_TIMEOUT||3e5),Pe=Number(process.env.AWS_ORPHAN_CPU_THRESHOLD||100),Le=Number(process.env.AWS_ORPHAN_MEMORY_THRESHOLD||2048),Ce=process.env.AWS_AUTO_REGISTER==="true",Be=process.env.AWS_TENANT_ID||"",Me=process.env.AWS_USER_KEY||"",he=process.env.AWS_INSTANCE_NAME||"",He=process.env.AWS_PROJECT_NAME||"",je=process.env.AWS_ROLE_NAME||"",We=process.env.AWS_WORKSPACE_PATH||"",ke=process.env.AWS_REGISTER_IP||process.env.AWS_VIRTUAL_IP||"";let T;function we(){if(T!==void 0)return T;let e="unknown";try{const r=t.dirname(I(import.meta.url)),n=t.resolve(r,"..","package.json");u.existsSync(n)&&(e=JSON.parse(u.readFileSync(n,"utf-8")).version||"unknown")}catch{}return T=e,e}export{Ce as AUTO_REGISTER_ENABLED,he as AUTO_REGISTER_INSTANCE_NAME,He as AUTO_REGISTER_PROJECT_NAME,je as AUTO_REGISTER_ROLE_NAME,Be as AUTO_REGISTER_TENANT_ID,Me as AUTO_REGISTER_USER_KEY,ke as AUTO_REGISTER_VIRTUAL_IP,We as AUTO_REGISTER_WORKSPACE_PATH,H as DEFAULT_BRIDGE_PORT,d as DEFAULT_SCHEDULER_BASE_URL,j as DEV_DEFAULT_BRIDGE_PORT,Ue as ORPHAN_AUTO_CLEAN_MODE,Pe as ORPHAN_CPU_THRESHOLD,Le as ORPHAN_MEMORY_THRESHOLD,xe as ORPHAN_SCAN_ENABLED,ve as ORPHAN_SCAN_INTERVAL,De as ORPHAN_UNRESPONSIVE_TIMEOUT,ne as allowHostFileBrowser,oe as allowedCorsOrigins,w as findAvailableListenPort,Te as getAcodeDataHome,W as getActiveBridgeHttpPort,F as getAutoRegisterConfigFilePath,P as getBridgeDataHome,Se as getBridgeInstanceConfigFile,me as getBridgeInstanceMcpExtraFile,Ae as getBridgeInstancePluginsDir,fe as getBridgeInstancePrivateSkillsDir,Re as getBridgeInstancePrivateSkillsManifest,p as getBridgeInstanceRuntimeDir,de as getBridgeInstanceSkillsDir,y as getBridgeRuntimePropertiesFilePath,Ee as getBridgeTemplateAgentsDir,pe as getBridgeTemplateConfigFile,E as getBridgeTemplateDir,V as getBridgeTemplateMcpDir,_e as getBridgeTemplateMcpPackagesDir,ge as getBridgeTemplatePluginsDir,le as getBridgeTemplateSkillsDir,we as getBridgeVersion,se as getClaudeConfigFile,ce as getClaudeMcpConfigFile,ae as getClaudeSkillsDir,Ie as getCodexConfigFile,Ne as getCodexSkillsDir,ue as getOpencodeConfigFile,Oe as getOpencodeSkillsDir,f as getRuntimeHomeDir,O as getUserHomeDir,N as isDevMode,re as nodeEnv,v as port,Z as reserveBridgeListenPort,X as resetActiveBridgeHttpPort,ee as resolveSchedulerBaseUrl,G as resolveSchedulerBaseUrlFrom,te as schedulerBaseUrl,k as setActiveBridgeHttpPort,ie as validateProductionToken,Q as writeBridgeRuntimePropertiesFile};
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 _,readdir as w,rm as N,stat as O}from"node:fs/promises";import{dirname as x,join as f}from"node:path";const d=new Set(["desktop_screenshot","desktop_window_screenshot"]),g=" 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.";function j(e){const{tools:t,forwarder:o}=e,i=e.screenshotDir??f(process.cwd(),".desktop-mcp","screenshots");return t.filter(r=>r.name.startsWith("desktop_")).map(r=>{const s=d.has(r.name),c=r.name==="desktop_perceive",p=s?`${r.description??r.name}${g}`:r.description??r.name;return{kind:"builtin",toolName:r.name,exposedName:r.name,description:p,inputSchema:I(r.inputSchema),category:"desktop",async execute(n){let u=n;s?u=await T(r.name,n,i):c&&(u=k(n));const h=await o(r.name,u);return s&&b(r.name,u,h),h}}})}const a=new Map,E=500;function l(e){return e.trim().replace(/\//g,"\\").toLowerCase()}function m(e){return e!=null}function k(e){const t=typeof e.path=="string"?e.path.trim():"";if(!t||m(e.origin_x)||m(e.origin_y))return e;const o=a.get(l(t));return o?{...e,origin_x:o.x,origin_y:o.y}:e}function b(e,t,o){let i=null;try{i=JSON.parse(o)}catch{i=null}const s=(typeof i?.path=="string"?i.path:"")||(typeof t.path=="string"?t.path:"");if(!s.trim())return;let c=null;if(e==="desktop_window_screenshot"){const n=i?.origin;n&&typeof n.x=="number"&&typeof n.y=="number"&&(c={x:n.x,y:n.y,at:Date.now()})}else{const n=t.region;n&&typeof n.x=="number"&&typeof n.y=="number"?c={x:n.x,y:n.y,at:Date.now()}:n||(c={x:0,y:0,at:Date.now()})}if(!c)return;const p=l(s);for(a.delete(p),a.set(p,c);a.size>E;){const n=a.keys().next().value;if(n===void 0)break;a.delete(n)}}function M(){a.clear()}async function T(e,t,o){if(!d.has(e)||typeof t.path=="string"&&t.path.trim())return t;const i=D(o);return await _(x(i),{recursive:!0}).catch(()=>{}),P(o).catch(()=>{}),{...t,path:i}}const y=(()=>{const e=Number.parseInt(process.env.AWS_DESKTOP_MCP_SCREENSHOT_RETENTION_DAYS??"",10);return Number.isFinite(e)&&e>=0?e:7})(),v=2*36e5;let S=0;async function P(e,t){const o=t?.now??Date.now();if(y===0||!t?.force&&o-S<v)return;S=o;const i=o-y*864e5;let r;try{r=await w(e)}catch{return}await Promise.all(r.filter(s=>s.startsWith("shot-")&&s.endsWith(".png")).map(async s=>{const c=f(e,s);try{(await O(c)).mtimeMs<i&&await N(c,{force:!0})}catch{}}))}let R=0;function D(e){const t=(++R).toString(36).padStart(3,"0"),o=new Date().toISOString().replace(/[:.]/g,"-");return f(e,`shot-${o}-${t}.png`)}function I(e){if(!e||typeof e!="object")return{type:"object",properties:{}};try{return JSON.parse(JSON.stringify(e))}catch{return{type:"object",properties:{}}}}export{M as clearScreenshotOrigins,j as createBuiltInDesktopTools,k as injectRememberedOrigin,T as injectScreenshotPath,D as nextScreenshotFilePath,P as pruneOldScreenshots,b as rememberScreenshotOrigin};
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