@amalgm/browser 0.1.2-preview.39017048402 → 0.1.2-preview.44182928298

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 (463) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/PURPOSE.md +106 -153
  3. package/README.md +27 -16
  4. package/SECURITY.md +28 -10
  5. package/dist/native/automation/LICENSE +201 -0
  6. package/dist/native/automation/README.md +31 -0
  7. package/dist/native/automation/control-auth.patch +129 -0
  8. package/dist/native/automation/source.json +6 -0
  9. package/dist/native/automation.json +90 -0
  10. package/dist/native/darwin-universal/amalgm-browser-keychain +0 -0
  11. package/dist/native/encoder-notices/README.md +7 -0
  12. package/dist/native/encoder-notices/darwin-arm64.LICENSE +129 -0
  13. package/dist/native/encoder-notices/darwin-arm64.README +46 -0
  14. package/dist/native/encoder-notices/darwin-x64.LICENSE +127 -0
  15. package/dist/native/encoder-notices/darwin-x64.README +293 -0
  16. package/dist/native/encoder-notices/linux-arm64.LICENSE +674 -0
  17. package/dist/native/encoder-notices/linux-arm64.README +67 -0
  18. package/dist/native/encoder-notices/linux-x64.LICENSE +674 -0
  19. package/dist/native/encoder-notices/linux-x64.README +67 -0
  20. package/dist/native/encoder-notices/win32-x64.LICENSE +674 -0
  21. package/dist/native/encoder-notices/win32-x64.README +792 -0
  22. package/dist/native/encoder.json +90 -0
  23. package/dist/native/engine.json +5016 -0
  24. package/dist/src/adapters/http/desktop-link.d.ts +7 -0
  25. package/dist/src/adapters/http/desktop-link.js +29 -0
  26. package/dist/src/adapters/http/desktop-link.js.map +1 -0
  27. package/dist/src/adapters/http/internal-routes.js +0 -11
  28. package/dist/src/adapters/http/internal-routes.js.map +1 -1
  29. package/dist/src/adapters/http/openapi.js +8 -1
  30. package/dist/src/adapters/http/openapi.js.map +1 -1
  31. package/dist/src/adapters/http/server.js +17 -3
  32. package/dist/src/adapters/http/server.js.map +1 -1
  33. package/dist/src/adapters/http/session-routes.js +1 -0
  34. package/dist/src/adapters/http/session-routes.js.map +1 -1
  35. package/dist/src/adapters/http/stream.d.ts +3 -2
  36. package/dist/src/adapters/http/stream.js +36 -52
  37. package/dist/src/adapters/http/stream.js.map +1 -1
  38. package/dist/src/adapters/http/types.d.ts +5 -0
  39. package/dist/src/{electron/adblock → adblock}/cache.d.ts +1 -1
  40. package/dist/src/{electron/adblock → adblock}/cache.js +8 -2
  41. package/dist/src/adblock/cache.js.map +1 -0
  42. package/dist/src/adblock/cosmetics.d.ts +33 -0
  43. package/dist/src/adblock/cosmetics.js +122 -0
  44. package/dist/src/adblock/cosmetics.js.map +1 -0
  45. package/dist/src/adblock/monitor.d.ts +4 -0
  46. package/dist/src/adblock/monitor.js +51 -0
  47. package/dist/src/adblock/monitor.js.map +1 -0
  48. package/dist/src/adblock/network.d.ts +15 -0
  49. package/dist/src/adblock/network.js +20 -0
  50. package/dist/src/adblock/network.js.map +1 -0
  51. package/dist/src/adblock/policy.js.map +1 -0
  52. package/dist/src/adblock/runtime.d.ts +30 -0
  53. package/dist/src/adblock/runtime.js +221 -0
  54. package/dist/src/adblock/runtime.js.map +1 -0
  55. package/dist/src/adblock/settings.js.map +1 -0
  56. package/dist/src/auth/vault.d.ts +3 -2
  57. package/dist/src/auth/vault.js.map +1 -1
  58. package/dist/src/cdp/capability.d.ts +2 -0
  59. package/dist/src/cdp/capability.js +8 -0
  60. package/dist/src/cdp/capability.js.map +1 -0
  61. package/dist/src/cdp/capture-png.d.ts +2 -0
  62. package/dist/src/cdp/capture-png.js +40 -0
  63. package/dist/src/cdp/capture-png.js.map +1 -0
  64. package/dist/src/cdp/capture.js +12 -13
  65. package/dist/src/cdp/capture.js.map +1 -1
  66. package/dist/src/cdp/navigation.d.ts +5 -0
  67. package/dist/src/cdp/navigation.js +53 -1
  68. package/dist/src/cdp/navigation.js.map +1 -1
  69. package/dist/src/cdp/screencast.d.ts +0 -1
  70. package/dist/src/cdp/screencast.js +7 -18
  71. package/dist/src/cdp/screencast.js.map +1 -1
  72. package/dist/src/chrome/cookie-adapter.d.ts +3 -0
  73. package/dist/src/chrome/cookie-adapter.js +6 -32
  74. package/dist/src/chrome/cookie-adapter.js.map +1 -1
  75. package/dist/src/chrome/cookie-changes.d.ts +1 -1
  76. package/dist/src/chrome/cookie-format.d.ts +19 -0
  77. package/dist/src/chrome/cookie-format.js +31 -0
  78. package/dist/src/chrome/cookie-format.js.map +1 -0
  79. package/dist/src/cookies/coordinator.d.ts +2 -2
  80. package/dist/src/cookies/coordinator.js +58 -24
  81. package/dist/src/cookies/coordinator.js.map +1 -1
  82. package/dist/src/cookies/database.d.ts +0 -1
  83. package/dist/src/cookies/database.js +10 -6
  84. package/dist/src/cookies/database.js.map +1 -1
  85. package/dist/src/cookies/jar.d.ts +1 -2
  86. package/dist/src/cookies/jar.js +2 -22
  87. package/dist/src/cookies/jar.js.map +1 -1
  88. package/dist/src/cookies/secret-file.d.ts +4 -2
  89. package/dist/src/cookies/secret-file.js +8 -32
  90. package/dist/src/cookies/secret-file.js.map +1 -1
  91. package/dist/src/cookies/types.d.ts +7 -0
  92. package/dist/src/credentials/keyring-helper.js +30 -0
  93. package/dist/src/credentials/keyring-helper.js.map +1 -0
  94. package/dist/src/credentials/platform-key.d.ts +3 -0
  95. package/dist/src/credentials/platform-key.js +92 -0
  96. package/dist/src/credentials/platform-key.js.map +1 -0
  97. package/dist/src/defaults.d.ts +3 -0
  98. package/dist/src/defaults.js +12 -10
  99. package/dist/src/defaults.js.map +1 -1
  100. package/dist/src/driver/attachment.d.ts +5 -0
  101. package/dist/src/driver/attachment.js +23 -0
  102. package/dist/src/driver/attachment.js.map +1 -0
  103. package/dist/src/driver/cli-policy.js +1 -1
  104. package/dist/src/driver/cli-policy.js.map +1 -1
  105. package/dist/src/driver/cli.d.ts +7 -0
  106. package/dist/src/driver/cli.js +21 -0
  107. package/dist/src/driver/cli.js.map +1 -0
  108. package/dist/src/driver/command.d.ts +5 -4
  109. package/dist/src/driver/command.js +86 -85
  110. package/dist/src/driver/command.js.map +1 -1
  111. package/dist/src/driver/cua.d.ts +8 -0
  112. package/dist/src/driver/cua.js +36 -0
  113. package/dist/src/driver/cua.js.map +1 -0
  114. package/dist/src/driver/daemon-start.d.ts +1 -0
  115. package/dist/src/driver/daemon-start.js +19 -0
  116. package/dist/src/driver/daemon-start.js.map +1 -0
  117. package/dist/src/driver/daemon.d.ts +28 -0
  118. package/dist/src/driver/daemon.js +125 -0
  119. package/dist/src/driver/daemon.js.map +1 -0
  120. package/dist/src/driver/driver.d.ts +9 -6
  121. package/dist/src/driver/driver.js +62 -63
  122. package/dist/src/driver/driver.js.map +1 -1
  123. package/dist/src/driver/response.d.ts +4 -0
  124. package/dist/src/driver/response.js +53 -0
  125. package/dist/src/driver/response.js.map +1 -0
  126. package/dist/src/electron/bounds.d.ts +4 -0
  127. package/dist/src/electron/bounds.js +11 -0
  128. package/dist/src/electron/bounds.js.map +1 -0
  129. package/dist/src/electron/contracts.d.ts +10 -1
  130. package/dist/src/electron/contracts.js +3 -0
  131. package/dist/src/electron/contracts.js.map +1 -1
  132. package/dist/src/electron/desktop-link.d.ts +25 -0
  133. package/dist/src/electron/desktop-link.js +153 -0
  134. package/dist/src/electron/desktop-link.js.map +1 -0
  135. package/dist/src/electron/native-context-menu.d.ts +18 -0
  136. package/dist/src/electron/native-context-menu.js +98 -0
  137. package/dist/src/electron/native-context-menu.js.map +1 -0
  138. package/dist/src/electron/native-downloads.d.ts +13 -0
  139. package/dist/src/electron/native-downloads.js +72 -0
  140. package/dist/src/electron/native-downloads.js.map +1 -0
  141. package/dist/src/electron/native-interactions.d.ts +21 -0
  142. package/dist/src/electron/native-interactions.js +101 -0
  143. package/dist/src/electron/native-interactions.js.map +1 -0
  144. package/dist/src/electron/native-popups.d.ts +19 -0
  145. package/dist/src/electron/native-popups.js +109 -0
  146. package/dist/src/electron/native-popups.js.map +1 -0
  147. package/dist/src/electron/native-presentation.d.ts +8 -0
  148. package/dist/src/electron/native-presentation.js +2 -0
  149. package/dist/src/electron/native-presentation.js.map +1 -0
  150. package/dist/src/electron/native-surfaces.d.ts +7 -0
  151. package/dist/src/electron/native-surfaces.js +214 -0
  152. package/dist/src/electron/native-surfaces.js.map +1 -0
  153. package/dist/src/electron/policy.d.ts +0 -4
  154. package/dist/src/electron/policy.js +0 -24
  155. package/dist/src/electron/policy.js.map +1 -1
  156. package/dist/src/electron/runtime-windows.d.ts +19 -0
  157. package/dist/src/electron/runtime-windows.js +115 -0
  158. package/dist/src/electron/runtime-windows.js.map +1 -0
  159. package/dist/src/electron/shell.d.ts +10 -2
  160. package/dist/src/electron/shell.js +22 -68
  161. package/dist/src/electron/shell.js.map +1 -1
  162. package/dist/src/electron.cjs +4551 -12940
  163. package/dist/src/electron.d.cts +4 -1
  164. package/dist/src/electron.d.ts +4 -1
  165. package/dist/src/electron.js +2 -1
  166. package/dist/src/electron.js.map +1 -1
  167. package/dist/src/host/desktop-protocol.d.ts +71 -0
  168. package/dist/src/host/desktop-protocol.js +13 -0
  169. package/dist/src/host/desktop-protocol.js.map +1 -0
  170. package/dist/src/host/desktop-windows.d.ts +6 -0
  171. package/dist/src/host/desktop-windows.js +34 -0
  172. package/dist/src/host/desktop-windows.js.map +1 -0
  173. package/dist/src/host/desktop.d.ts +5 -0
  174. package/dist/src/host/desktop.js +138 -0
  175. package/dist/src/host/desktop.js.map +1 -0
  176. package/dist/src/host/engine.d.ts +43 -0
  177. package/dist/src/host/engine.js +2 -0
  178. package/dist/src/host/engine.js.map +1 -0
  179. package/dist/src/host/host.d.ts +38 -0
  180. package/dist/src/host/host.js +213 -0
  181. package/dist/src/host/host.js.map +1 -0
  182. package/dist/src/host/live-stream.d.ts +20 -0
  183. package/dist/src/host/live-stream.js +115 -0
  184. package/dist/src/host/live-stream.js.map +1 -0
  185. package/dist/src/host/relay/editing.js.map +1 -0
  186. package/dist/src/host/relay/server.d.ts +30 -0
  187. package/dist/src/host/relay/server.js +219 -0
  188. package/dist/src/host/relay/server.js.map +1 -0
  189. package/dist/src/{chrome → host}/relay/view.d.ts +2 -1
  190. package/dist/src/{chrome → host}/relay/view.js +11 -5
  191. package/dist/src/host/relay/view.js.map +1 -0
  192. package/dist/src/host/sessions.d.ts +42 -0
  193. package/dist/src/host/sessions.js +158 -0
  194. package/dist/src/host/sessions.js.map +1 -0
  195. package/dist/src/host/stream-input.d.ts +4 -0
  196. package/dist/src/host/stream-input.js +46 -0
  197. package/dist/src/host/stream-input.js.map +1 -0
  198. package/dist/src/host/stream-viewport.d.ts +6 -0
  199. package/dist/src/host/stream-viewport.js +70 -0
  200. package/dist/src/host/stream-viewport.js.map +1 -0
  201. package/dist/src/host/window-protocol.d.ts +67 -0
  202. package/dist/src/host/window-protocol.js +2 -0
  203. package/dist/src/host/window-protocol.js.map +1 -0
  204. package/dist/src/native/artifact-archive.d.ts +4 -0
  205. package/dist/src/native/artifact-archive.js +110 -0
  206. package/dist/src/native/artifact-archive.js.map +1 -0
  207. package/dist/src/native/artifact-cache.d.ts +9 -0
  208. package/dist/src/native/artifact-cache.js +113 -0
  209. package/dist/src/native/artifact-cache.js.map +1 -0
  210. package/dist/src/native/artifact-manifest.d.ts +25 -0
  211. package/dist/src/native/artifact-manifest.js +60 -0
  212. package/dist/src/native/artifact-manifest.js.map +1 -0
  213. package/dist/src/native/artifact-zip.d.ts +3 -0
  214. package/dist/src/native/artifact-zip.js +59 -0
  215. package/dist/src/native/artifact-zip.js.map +1 -0
  216. package/dist/src/native/automation.d.ts +2 -0
  217. package/dist/src/native/automation.js +33 -0
  218. package/dist/src/native/automation.js.map +1 -0
  219. package/dist/src/native/cache-directory.d.ts +1 -0
  220. package/dist/src/native/cache-directory.js +11 -0
  221. package/dist/src/native/cache-directory.js.map +1 -0
  222. package/dist/src/native/cdp-bridge.d.ts +17 -0
  223. package/dist/src/native/cdp-bridge.js +240 -0
  224. package/dist/src/native/cdp-bridge.js.map +1 -0
  225. package/dist/src/native/cdp-dialogs.d.ts +19 -0
  226. package/dist/src/native/cdp-dialogs.js +54 -0
  227. package/dist/src/native/cdp-dialogs.js.map +1 -0
  228. package/dist/src/native/cdp-pipe.d.ts +19 -0
  229. package/dist/src/native/cdp-pipe.js +112 -0
  230. package/dist/src/native/cdp-pipe.js.map +1 -0
  231. package/dist/src/native/cdp.d.ts +4 -0
  232. package/dist/src/native/cdp.js +71 -0
  233. package/dist/src/native/cdp.js.map +1 -0
  234. package/dist/src/native/downloads.d.ts +16 -0
  235. package/dist/src/native/downloads.js +76 -0
  236. package/dist/src/native/downloads.js.map +1 -0
  237. package/dist/src/native/encoder.d.ts +3 -0
  238. package/dist/src/native/encoder.js +37 -0
  239. package/dist/src/native/encoder.js.map +1 -0
  240. package/dist/src/native/engine.d.ts +20 -0
  241. package/dist/src/native/engine.js +267 -0
  242. package/dist/src/native/engine.js.map +1 -0
  243. package/dist/src/native/executable.d.ts +1 -0
  244. package/dist/src/native/executable.js +23 -0
  245. package/dist/src/native/executable.js.map +1 -0
  246. package/dist/src/native/interactions.d.ts +30 -0
  247. package/dist/src/native/interactions.js +16 -0
  248. package/dist/src/native/interactions.js.map +1 -0
  249. package/dist/src/native/permissions.d.ts +10 -0
  250. package/dist/src/native/permissions.js +62 -0
  251. package/dist/src/native/permissions.js.map +1 -0
  252. package/dist/src/native/process.d.ts +32 -0
  253. package/dist/src/native/process.js +212 -0
  254. package/dist/src/native/process.js.map +1 -0
  255. package/dist/src/native/profile-cookies.d.ts +3 -0
  256. package/dist/src/native/profile-cookies.js +160 -0
  257. package/dist/src/native/profile-cookies.js.map +1 -0
  258. package/dist/src/persistence/session-pages.d.ts +10 -0
  259. package/dist/src/persistence/session-pages.js +31 -0
  260. package/dist/src/persistence/session-pages.js.map +1 -0
  261. package/dist/src/persistence/sqlite-registry.js +7 -1
  262. package/dist/src/persistence/sqlite-registry.js.map +1 -1
  263. package/dist/src/ports.d.ts +5 -1
  264. package/dist/src/ports.js.map +1 -1
  265. package/dist/src/recording/service.js +2 -1
  266. package/dist/src/recording/service.js.map +1 -1
  267. package/dist/src/registry.js +2 -0
  268. package/dist/src/registry.js.map +1 -1
  269. package/dist/src/runtime-electron/downloads.d.ts +11 -0
  270. package/dist/src/runtime-electron/downloads.js +60 -0
  271. package/dist/src/runtime-electron/downloads.js.map +1 -0
  272. package/dist/src/runtime-electron/engine.d.ts +4 -0
  273. package/dist/src/runtime-electron/engine.js +46 -0
  274. package/dist/src/runtime-electron/engine.js.map +1 -0
  275. package/dist/src/runtime-electron/interactions.d.ts +24 -0
  276. package/dist/src/runtime-electron/interactions.js +211 -0
  277. package/dist/src/runtime-electron/interactions.js.map +1 -0
  278. package/dist/src/runtime-electron/main.cjs +6312 -0
  279. package/dist/src/runtime-electron/main.d.ts +1 -0
  280. package/dist/src/runtime-electron/main.js +133 -0
  281. package/dist/src/runtime-electron/main.js.map +1 -0
  282. package/dist/src/runtime-electron/media-components.d.ts +3 -0
  283. package/dist/src/runtime-electron/media-components.js +18 -0
  284. package/dist/src/runtime-electron/media-components.js.map +1 -0
  285. package/dist/src/runtime-electron/native-frame.d.ts +5 -0
  286. package/dist/src/runtime-electron/native-frame.js +21 -0
  287. package/dist/src/runtime-electron/native-frame.js.map +1 -0
  288. package/dist/src/runtime-electron/network.d.ts +23 -0
  289. package/dist/src/runtime-electron/network.js +98 -0
  290. package/dist/src/runtime-electron/network.js.map +1 -0
  291. package/dist/src/runtime-electron/page-preload.cjs +13 -0
  292. package/dist/src/runtime-electron/page-preload.d.ts +1 -0
  293. package/dist/src/runtime-electron/page-preload.js +10 -0
  294. package/dist/src/runtime-electron/page-preload.js.map +1 -0
  295. package/dist/src/runtime-electron/page-rendering.d.ts +19 -0
  296. package/dist/src/runtime-electron/page-rendering.js +100 -0
  297. package/dist/src/runtime-electron/page-rendering.js.map +1 -0
  298. package/dist/src/runtime-electron/page-viewport.d.ts +14 -0
  299. package/dist/src/runtime-electron/page-viewport.js +39 -0
  300. package/dist/src/runtime-electron/page-viewport.js.map +1 -0
  301. package/dist/src/runtime-electron/page-views.d.ts +22 -0
  302. package/dist/src/runtime-electron/page-views.js +137 -0
  303. package/dist/src/runtime-electron/page-views.js.map +1 -0
  304. package/dist/src/runtime-electron/pages.d.ts +50 -0
  305. package/dist/src/runtime-electron/pages.js +213 -0
  306. package/dist/src/runtime-electron/pages.js.map +1 -0
  307. package/dist/src/runtime-electron/permission-scopes.d.ts +5 -0
  308. package/dist/src/runtime-electron/permission-scopes.js +12 -0
  309. package/dist/src/runtime-electron/permission-scopes.js.map +1 -0
  310. package/dist/src/runtime-electron/presentation.d.ts +22 -0
  311. package/dist/src/runtime-electron/presentation.js +143 -0
  312. package/dist/src/runtime-electron/presentation.js.map +1 -0
  313. package/dist/src/runtime-electron/profile-migration.d.ts +3 -0
  314. package/dist/src/runtime-electron/profile-migration.js +112 -0
  315. package/dist/src/runtime-electron/profile-migration.js.map +1 -0
  316. package/dist/src/runtime-electron/prompt-preload.cjs +24 -0
  317. package/dist/src/runtime-electron/prompt-preload.d.ts +1 -0
  318. package/dist/src/runtime-electron/prompt-preload.js +18 -0
  319. package/dist/src/runtime-electron/prompt-preload.js.map +1 -0
  320. package/dist/src/runtime-electron/prompt-window.d.ts +16 -0
  321. package/dist/src/runtime-electron/prompt-window.js +52 -0
  322. package/dist/src/runtime-electron/prompt-window.js.map +1 -0
  323. package/dist/src/runtime-electron/protocol.d.ts +8 -0
  324. package/dist/src/runtime-electron/protocol.js +43 -0
  325. package/dist/src/runtime-electron/protocol.js.map +1 -0
  326. package/dist/src/runtime-electron/ui-profile.d.ts +15 -0
  327. package/dist/src/runtime-electron/ui-profile.js +128 -0
  328. package/dist/src/runtime-electron/ui-profile.js.map +1 -0
  329. package/dist/src/runtime-electron/window-control.d.ts +4 -0
  330. package/dist/src/runtime-electron/window-control.js +40 -0
  331. package/dist/src/runtime-electron/window-control.js.map +1 -0
  332. package/dist/src/runtime-electron/windows.d.ts +28 -0
  333. package/dist/src/runtime-electron/windows.js +186 -0
  334. package/dist/src/runtime-electron/windows.js.map +1 -0
  335. package/dist/src/service-options.d.ts +2 -0
  336. package/dist/src/service.d.ts +3 -0
  337. package/dist/src/service.js +12 -40
  338. package/dist/src/service.js.map +1 -1
  339. package/dist/src/sessions/admission.d.ts +12 -0
  340. package/dist/src/sessions/admission.js +68 -0
  341. package/dist/src/sessions/admission.js.map +1 -0
  342. package/dist/src/testing.d.ts +2 -1
  343. package/dist/src/testing.js +5 -1
  344. package/dist/src/testing.js.map +1 -1
  345. package/dist/src/types.d.ts +0 -1
  346. package/dist/src/viewport.d.ts +7 -0
  347. package/dist/src/viewport.js +8 -0
  348. package/dist/src/viewport.js.map +1 -0
  349. package/docs/ARCHITECTURE.md +114 -58
  350. package/docs/AXIOMS.md +39 -17
  351. package/docs/CHROME.md +74 -155
  352. package/docs/COMPATIBILITY.md +11 -4
  353. package/docs/COOKIES.md +33 -19
  354. package/docs/ELECTRON_INTEGRATION.md +70 -100
  355. package/docs/ENGINE_DELIVERY.md +143 -0
  356. package/docs/ENGINE_RELEASE.md +72 -0
  357. package/docs/NATIVE_BROWSER.md +138 -0
  358. package/docs/OPERATIONS.md +28 -12
  359. package/docs/README.md +3 -1
  360. package/docs/REALTIME_BOUNDARY.md +3 -4
  361. package/docs/REST.md +13 -9
  362. package/docs/SDK.md +13 -8
  363. package/docs/SHELL_INTEGRATION.md +11 -8
  364. package/docs/TESTING.md +56 -62
  365. package/docs/TROUBLESHOOTING.md +24 -24
  366. package/package.json +37 -17
  367. package/skills/use-amalgm-browser/SKILL.md +4 -3
  368. package/dist/src/chrome/executable.d.ts +0 -1
  369. package/dist/src/chrome/executable.js +0 -55
  370. package/dist/src/chrome/executable.js.map +0 -1
  371. package/dist/src/chrome/flags.d.ts +0 -7
  372. package/dist/src/chrome/flags.js +0 -59
  373. package/dist/src/chrome/flags.js.map +0 -1
  374. package/dist/src/chrome/host.d.ts +0 -25
  375. package/dist/src/chrome/host.js +0 -135
  376. package/dist/src/chrome/host.js.map +0 -1
  377. package/dist/src/chrome/launch.d.ts +0 -11
  378. package/dist/src/chrome/launch.js +0 -121
  379. package/dist/src/chrome/launch.js.map +0 -1
  380. package/dist/src/chrome/relay/editing.js.map +0 -1
  381. package/dist/src/chrome/relay/server.d.ts +0 -18
  382. package/dist/src/chrome/relay/server.js +0 -120
  383. package/dist/src/chrome/relay/server.js.map +0 -1
  384. package/dist/src/chrome/relay/targets.d.ts +0 -11
  385. package/dist/src/chrome/relay/targets.js +0 -59
  386. package/dist/src/chrome/relay/targets.js.map +0 -1
  387. package/dist/src/chrome/relay/view.js.map +0 -1
  388. package/dist/src/driver/executable.d.ts +0 -8
  389. package/dist/src/driver/executable.js +0 -56
  390. package/dist/src/driver/executable.js.map +0 -1
  391. package/dist/src/driver/stream.d.ts +0 -1
  392. package/dist/src/driver/stream.js +0 -22
  393. package/dist/src/driver/stream.js.map +0 -1
  394. package/dist/src/electron/adblock/cache.js.map +0 -1
  395. package/dist/src/electron/adblock/cosmetics.d.ts +0 -11
  396. package/dist/src/electron/adblock/cosmetics.js +0 -45
  397. package/dist/src/electron/adblock/cosmetics.js.map +0 -1
  398. package/dist/src/electron/adblock/index.d.ts +0 -43
  399. package/dist/src/electron/adblock/index.js +0 -157
  400. package/dist/src/electron/adblock/index.js.map +0 -1
  401. package/dist/src/electron/adblock/policy.js.map +0 -1
  402. package/dist/src/electron/adblock/preload.js +0 -131
  403. package/dist/src/electron/adblock/preload.js.map +0 -1
  404. package/dist/src/electron/adblock/settings.js.map +0 -1
  405. package/dist/src/electron/cookie-adapter.d.ts +0 -17
  406. package/dist/src/electron/cookie-adapter.js +0 -72
  407. package/dist/src/electron/cookie-adapter.js.map +0 -1
  408. package/dist/src/electron/cookie-sync.d.ts +0 -6
  409. package/dist/src/electron/cookie-sync.js +0 -18
  410. package/dist/src/electron/cookie-sync.js.map +0 -1
  411. package/dist/src/electron/session.d.ts +0 -2
  412. package/dist/src/electron/session.js +0 -9
  413. package/dist/src/electron/session.js.map +0 -1
  414. package/dist/src/electron/shell/adblock-ipc.d.ts +0 -10
  415. package/dist/src/electron/shell/adblock-ipc.js +0 -44
  416. package/dist/src/electron/shell/adblock-ipc.js.map +0 -1
  417. package/dist/src/electron/shell/context-menu.d.ts +0 -11
  418. package/dist/src/electron/shell/context-menu.js +0 -129
  419. package/dist/src/electron/shell/context-menu.js.map +0 -1
  420. package/dist/src/electron/shell/downloads.d.ts +0 -11
  421. package/dist/src/electron/shell/downloads.js +0 -90
  422. package/dist/src/electron/shell/downloads.js.map +0 -1
  423. package/dist/src/electron/shell/helpers.d.ts +0 -5
  424. package/dist/src/electron/shell/helpers.js +0 -53
  425. package/dist/src/electron/shell/helpers.js.map +0 -1
  426. package/dist/src/electron/shell/permissions.d.ts +0 -16
  427. package/dist/src/electron/shell/permissions.js +0 -107
  428. package/dist/src/electron/shell/permissions.js.map +0 -1
  429. package/dist/src/electron/shell/sites.d.ts +0 -22
  430. package/dist/src/electron/shell/sites.js +0 -87
  431. package/dist/src/electron/shell/sites.js.map +0 -1
  432. package/dist/src/electron/shell/types.d.ts +0 -12
  433. package/dist/src/electron/shell/types.js +0 -2
  434. package/dist/src/electron/shell/types.js.map +0 -1
  435. package/dist/src/electron/surface/commands.d.ts +0 -4
  436. package/dist/src/electron/surface/commands.js +0 -49
  437. package/dist/src/electron/surface/commands.js.map +0 -1
  438. package/dist/src/electron/surface/create.d.ts +0 -4
  439. package/dist/src/electron/surface/create.js +0 -40
  440. package/dist/src/electron/surface/create.js.map +0 -1
  441. package/dist/src/electron/surface/events.d.ts +0 -3
  442. package/dist/src/electron/surface/events.js +0 -43
  443. package/dist/src/electron/surface/events.js.map +0 -1
  444. package/dist/src/electron/surface/presentation.d.ts +0 -8
  445. package/dist/src/electron/surface/presentation.js +0 -29
  446. package/dist/src/electron/surface/presentation.js.map +0 -1
  447. package/dist/src/electron/surface/state.d.ts +0 -12
  448. package/dist/src/electron/surface/state.js +0 -51
  449. package/dist/src/electron/surface/state.js.map +0 -1
  450. package/dist/src/electron/surface/types.d.ts +0 -33
  451. package/dist/src/electron/surface/types.js +0 -2
  452. package/dist/src/electron/surface/types.js.map +0 -1
  453. package/dist/src/electron/surface-controller.d.ts +0 -6
  454. package/dist/src/electron/surface-controller.js +0 -135
  455. package/dist/src/electron/surface-controller.js.map +0 -1
  456. package/dist/src/electron-preload.cjs +0 -113
  457. /package/dist/src/{electron/adblock → adblock}/policy.d.ts +0 -0
  458. /package/dist/src/{electron/adblock → adblock}/policy.js +0 -0
  459. /package/dist/src/{electron/adblock → adblock}/settings.d.ts +0 -0
  460. /package/dist/src/{electron/adblock → adblock}/settings.js +0 -0
  461. /package/dist/src/{electron/adblock/preload.d.ts → credentials/keyring-helper.d.ts} +0 -0
  462. /package/dist/src/{chrome → host}/relay/editing.d.ts +0 -0
  463. /package/dist/src/{chrome → host}/relay/editing.js +0 -0
@@ -1,66 +1,122 @@
1
1
  # Architecture
2
2
 
3
- `BrowserProductService` is the product boundary. It holds session policy, the
4
- account, auth bundles, login handoffs, recordings, and the account's cookie
5
- jar. The driver operates the runtime's one Chrome. Transport adapters turn
6
- their inputs into service calls and own no browser policy.
3
+ `BrowserProductService` owns sessions, account identity, authentication,
4
+ recordings and the encrypted cookie jar. `BrowserHost` owns one native
5
+ Chromium runtime and records each session's targets. Viewers present targets
6
+ and submit input; they never own website execution. Transport adapters call
7
+ the service without defining browser policy.
7
8
 
8
- ## Flow of one action
9
+ ## Flow of an action
9
10
 
10
- 1. An adapter picks the session (an explicit `session`, else the caller's
11
- `callerId`, else `default`) and calls `createSession`, which creates it or,
12
- after a restart, reopens it.
13
- 2. `BrowserService.execute` checks the session is ready and idle, authorizes
14
- the action, and takes the session lease.
15
- 3. The driver runs the action through the session's agent-browser daemon, or
16
- over CDP for capture and some input, and then syncs cookies.
17
- 4. The service stores the result and emits a sanitized event.
11
+ 1. The adapter resolves the existing session contract: explicit session,
12
+ caller ID, then default.
13
+ 2. The service checks readiness, authorization and the session lease.
14
+ 3. The driver runs the action through that session's filtered CDP relay,
15
+ using agent-browser or direct CDP for capture, history navigation and supported input.
16
+ 4. The service stores the result and emits sanitized metadata.
18
17
 
19
- MCP, REST, and Toolbox dispatch through one action descriptor array. The
20
- parity test calls all 22 actions through all four surfaces.
18
+ Automation Back, Forward and Reload use Chromium's page controls. Their completion
19
+ listener is installed before the one navigation command, so document replacement
20
+ does not turn a successful traversal into a failed JavaScript evaluation. The
21
+ driver first re-selects the same tab to invalidate its prior element and frame
22
+ references; page identity and execution are never recreated to clear driver state.
23
+
24
+ Each automation session has a private IPC directory derived from the canonical
25
+ Browser root and session identity. The daemon runs there, so its startup records
26
+ cannot collide with another session and its working directory cannot hold the
27
+ account profile open. Shutdown waits for the daemon process after its close reply.
28
+
29
+ MCP, REST and Toolbox project one action descriptor array. Native
30
+ presentation is a private adapter and adds no public tool actions.
31
+
32
+ The caller owns each forwarded CDP command's deadline. The private pipe retains
33
+ its response until the command finishes or that connection closes; disconnect
34
+ cancels its pending transport waits without affecting other connections.
35
+ Direct owner-control requests have a bounded internal deadline, and the shared
36
+ pipe bounds pending requests and buffered output.
37
+ Replies and events retain Chromium's wire order, including when several arrive
38
+ in one pipe chunk, so clients learn each frame before its execution contexts.
21
39
 
22
40
  ## Ownership map
23
41
 
24
- - `service.ts`, `product-service.ts`, `account.ts`: the mutation boundary,
25
- product services, and the one browsing identity
26
- - `sessions/`: leases and pruning
27
- - `chrome/`: finding, launching, owning, and restarting Chrome; the per-session
28
- CDP relay; the Chrome cookie adapter
29
- - `driver/`: the agent-browser driver, command runner, waits, action evidence,
30
- and live-view stream
31
- - `cdp/`: page capture, screencast, input, and a cancellable protocol client
32
- - `cookies/`: the encrypted jar, cookie policy, and the coordinator that syncs
33
- each browser with the jar
34
- - `electron/`: the Electron shell (native tabs, policy, downloads,
35
- permissions, context menus, ad blocking) and a cookie adapter for its
36
- partition
37
- - `auth/`: named bundles and TTL-bound human login
38
- - `recording/`: screencast sampling and the bounded WebM encoder
39
- - `persistence/`: SQLite state
40
- - `adapters/`: MCP, REST with SSE and the live-view WebSocket, and Toolbox
41
-
42
- ## One Chrome, many sessions
43
-
44
- A runtime has one `ChromeHost`. Each session reaches it through its own relay
45
- endpoint, which shows the session only its own tabs and places new tabs in the
46
- account's browser context. All sessions therefore share one set of cookies.
47
- See [Chrome runtime](./CHROME.md).
48
-
49
- ## Persistence and concurrency
50
-
51
- SQLite stores each metadata entity separately, uses WAL and a busy timeout,
52
- and holds cross-process session leases. Encrypted cookie, login, and auth
53
- payloads live in atomic private files. Registry writes are transactional. Sessions are durable: after a restart, a ready session reopens
54
- when `createSession` names it again. Chrome itself has one owning process per
55
- root, enforced by the OS-held `<root>/chrome.lease.sqlite` lease.
56
- `browser.close()` stops admission, cancels and drains admitted work, then stops
57
- recordings, detaches every session, stops Chrome, and closes the registry.
58
-
59
- ## Data movement
60
-
61
- The account's encrypted jar is the store of record for cookies. The
62
- coordinator keeps each registered browser store in two-way sync with it; the
63
- runtime registers Chrome's account context. Deletions are tombstones, and
64
- ordering by timestamp then source makes merges deterministic. Named auth
65
- bundles are explicit filtered snapshots and can also carry origin storage.
66
- Events and ordinary resource projections contain metadata only.
42
+ - `service.ts`, `product-service.ts`, `account.ts`: product mutation boundary.
43
+ - `sessions/`: session leases and pruning.
44
+ - `host/`: runtime ownership, selected targets, shared live streams, session relay and viewer admission.
45
+ - `native/` under `src/`: process protocol, runtime engine and interaction policy.
46
+ - `runtime-electron/`: runtime-owned pages, native windows, dialogs and isolated application profiles.
47
+ - `native/credentials/`: the macOS platform credential helper.
48
+ - `chrome/`: Chromium cookie representation and the runtime cookie adapter.
49
+ - `adblock/`: runtime network, cosmetic, scriptlet and site settings policy.
50
+ - `electron/`: trusted IPC, native surface/popup lifetimes and OS dialogs.
51
+ - `driver/`, `cdp/`: actions, page identity, capture, input and streaming.
52
+
53
+ - `cookies/`: encrypted records, tombstones and synchronization authority.
54
+ - `auth/`, `recording/`: bounded login and media lifetimes.
55
+ - `persistence/`: durable metadata.
56
+ - `adapters/`: public MCP, REST and Toolbox projections.
57
+
58
+ Each runtime page owns its compositor readiness. Navigation and native view
59
+ placement invalidate that readiness. The owner reapplies rendering policy to
60
+ the current platform view and observes its first native frame. One page-owned
61
+ frame subscription serves readiness and passive native viewers without retaining
62
+ frames or changing the viewport. Input, captures and stream subscriptions wait
63
+ for this barrier, and existing streams resume when a replacement document paints. Chromium's surface screenshot path
64
+ captures newly produced pixels without waiting for an OS presentation callback
65
+ from hidden windows. Public captures sample the requested rectangle onto the
66
+ CSS pixel grid; native rounding and display density never change that grid.
67
+
68
+ Network policy receives the page's main-frame identity before the owner releases
69
+ its first request. Child frames remain paused until their request interception
70
+ and document policy finish installing. Frame queries observe state; they do not
71
+ establish admission order.
72
+
73
+ ## Page and viewer lifetime
74
+
75
+ All viewers of a page address one Chromium target. Native and remote input
76
+ reach that target, and actions run once. Removing a viewer revokes access and
77
+ releases presentation resources. Only explicit close or browser-owner shutdown
78
+ ends pages. A child page belongs to its opener's session and preserves its
79
+ Chromium opener and tab/window disposition. Only popup children create a
80
+ separate desktop window; ordinary child tabs remain selectable in the session.
81
+
82
+ Each website has one runtime-owned WebContentsView. Native windows attach that
83
+ view; detaching parks it in a hidden runtime container so rendering and remote
84
+ streaming continue. The controller owns stable window handles and reconnects
85
+ presentation using the same persistent application partition. Page lifetime
86
+ is independent of those handles. Several windows can present one page: the focused window holds its native input
87
+ view, while passive windows receive current uncompressed native frames.
88
+
89
+ The visible native input view owns the page's layout bounds. Without one, the
90
+ most recently active streamed viewer supplies its CSS size; passive viewers fit
91
+ the same rendering. Disconnect releases that viewer's sizing claim without
92
+ replacing the page. Native window and UI panel resizing report actual available
93
+ bounds, including fractional CSS sizes rounded at the native boundary.
94
+
95
+ Browser owns one CDP screencast per watched session and forwards each frame with
96
+ that frame's original Chromium metadata. Viewers therefore map input through the
97
+ dimensions of the pixels they receive. The automation daemon's configured
98
+ viewport is not a frame measurement. Viewer input stays bounded, ordered and
99
+ scoped to the selected page; a selection change cancels queued input to its old
100
+ page. SDK stream endpoints carry revocable capabilities separate from CDP grants.
101
+
102
+ Dialogs and permissions are page-scoped, one-shot requests. Native UI and CDP
103
+ resolve the same decision. Detaching a native viewer settles its pending
104
+ decisions in the page owner before destroying the dialog or parent window.
105
+ Electron's missing text prompt uses a restricted
106
+ sandboxed preload; loaded same-origin frames participate, while blank-frame
107
+ prompt compatibility remains a release limitation.
108
+
109
+ ## Durable state
110
+
111
+ SQLite stores metadata, uses WAL and holds cross-process leases. The runtime
112
+ profile and encrypted cookie jar belong to one account. The encrypted jar is authoritative; Chromium's working cookies are cleared
113
+ and rebuilt from it before browsing is admitted. Native cookie notifications
114
+ trigger partition-aware snapshots; only changed encrypted records are written.
115
+ The persistent desktop application partition is isolated from website storage
116
+ and is seeded once under serialized, atomic adoption.
117
+
118
+ Viewer failure preserves the live page. Runtime failure ends its execution;
119
+ reopening remembered URLs and durable storage cannot restore JavaScript memory.
120
+ `browser.close()` stops admission, drains operations and cookies, ends pages,
121
+ then releases the runtime and registry. See [purpose](../PURPOSE.md),
122
+ [native evidence](NATIVE_BROWSER.md) and [Chromium runtime](CHROME.md).
package/docs/AXIOMS.md CHANGED
@@ -1,23 +1,45 @@
1
1
  # Axiom map
2
2
 
3
- [PURPOSE.md](../PURPOSE.md) is the authoritative list of primitives and 21
4
- numbered product axioms. This map ties them to the tests that show them.
3
+ [PURPOSE.md](../PURPOSE.md) defines the authoritative primitives and axioms.
4
+ This map identifies relevant retained checks; it does not certify platforms
5
+ that have not run their native journey.
5
6
 
6
7
  | Axioms | Consequence | Evidence |
7
8
  | --- | --- | --- |
8
- | 1–3 | Browser owns state; every session browses as the one account | `service.test.ts` account tests |
9
- | 4 | One owned Chrome, restarted on next use | `real-browser.test.ts` crash recovery and competing-owner tests |
10
- | 5–6 | Sessions see only their own tabs, reopen after restarts, and stream only themselves | real-browser side-by-side and live-view tests; real-lifecycle CDP and CLI isolation; `service.test.ts` restart reopen |
11
- | 7–9 | Page identity, cancellation, and bounded output | real-browser duplicate-URL capture; real-lifecycle operation drain; `service`, `process` and `parity` tests |
12
- | 10–14 | Cookies sync through the encrypted jar without idle scans; secrets stay out of output; cookie observation never blocks browsing | `cookies`, `cookie-coordinator`, `cookie-notifications`, `auth`, `adapters` tests; real-browser idle and loopback tests; real-cookie-events upgraded-profile and refused-observer tests |
13
- | 15 | Recording proves capture and stays bounded | `recording.test.ts`; real-lifecycle records and decodes page imagery |
14
- | 16 | Context enters through ports; events are sanitized | `events.test.ts`, `adapters.test.ts` |
15
- | 17 | One handed root holds all state; nothing is imported | `core.test.ts`, `persistence.test.ts`, `cookie-persistence.test.ts` |
16
- | 18–19 | One TypeScript implementation works without Shell, Engine, or Electron | `parity.test.ts`, `surfaces.test.ts`, `verify:pack` |
17
- | 20 | Shell composes one service; Electron keeps each account in its own partition | `electron-cookies`, `electron-policy` tests; UI's `test:browser` drives real Electron cookie sharing and sign-out through Shell |
18
- | 21 | agent-browser IPC fits the socket limit | source only (`driver/command.ts`) |
9
+ | 1–6, 18 | Runtime owns pages; viewer lifetime cannot interrupt them | `host-lifetime.test.ts`, `real-desktop.test.ts`, UI native browser journey |
10
+ | 7 | Existing actions and results remain compatible | `parity.test.ts`, `surfaces.test.ts`, adapter tests |
11
+ | 8–10 | Device-resolution native frames, explicit OS input, bounded ownership | native window/frame tests; UI geometry journey; OS interaction and measurements remain explicit gates |
12
+ | 11–12 | Admission binds account/session/page; application authentication is separate | HTTP adapter and host lifetime tests; real stream authorization journey |
13
+ | 13, 17 | One encrypted cookie authority; Chromium working copies are rebuilt before browsing | cookie/coordinator/notification tests; `real-cookie-events.test.ts`; working-copy restart acceptance passes locally; supplier findings are in `ENGINE_DELIVERY.md` |
14
+ | 14 | Live viewing never replays an action or execution context | in-flight action and retained JavaScript checks in `real-desktop.test.ts` |
15
+ | 15–16 | Exact selected-page captures, bounded work and cleanup | recording/process tests; `real-lifecycle.test.ts` |
16
+ | 19 | TypeScript policy admits explicit native programs behind the unchanged consumer boundary | source ownership, strict types and package examination |
17
+ | 20–21 | Unsupported platforms fail explicitly; existing state is preserved | native build pin, process lease and migration tests; platform gates remain explicit |
18
+ | 22 | Interactive replies are page-scoped, one-shot and fail closed; microphone grants cannot grant camera access | `native-permissions.test.ts`, `electron-permission-scopes.test.ts`, `real-native-interactions.test.ts` |
19
+ | 23 | Session network policy precedes every page request independently of renderer setup | adblock tests; `real-native-adblock.test.ts` deliberately delays renderer policy installation |
20
+ | 24 | Child page and popup viewer have separate lifetimes | popup journey in `real-desktop.test.ts` |
21
+ | 25 | Native drag resources belong to their source view | Electron OS drag journey remains unverified; archived CEF results do not certify it |
22
+ | 26 | Chromium uses private inherited control and Amalgm revokes session capabilities | `real-control.test.ts` |
23
+ | 27 | Native artifact cache admits only complete pinned engines, automation programs and encoders and reuses verified bytes | `artifact-cache.test.ts`; installed-package native examination |
24
+ | 28 | Platform credentials protect secrets and failed access cannot replace existing keys | `platform-key.test.ts`; signed background `real-keychain.test.ts` |
25
+ | 29 | Actual common-media playback and approved DRM require independent acceptance | `real-engine-acceptance.test.ts` passes common media; production DRM passes on both Mac candidates and native Windows x64/ARM hosts; service-specific acceptance remains separate |
26
+ | 30 | The host supplies one absolute mutable record root | SDK construction and persistence tests; UI/Shell isolated browser journey |
27
+ | 31 | Session control can access only its own pages | relay authorization tests; `real-control.test.ts` |
28
+ | 32 | Legacy adoption preserves newer records and retains data through decoding, commit and retirement failures | `native-profile-cookies.test.ts`, `native-profile-lease.test.ts`, coordinator initialization race; actual CEF-to-Electron origin storage and cookie migration passed locally |
29
+ | 33 | Concurrent session admission owns one live page independently of website loading and automation; attaching never replays an address | `session-admission.test.ts`; `real-session-admission.test.ts`; UI app-preview journey |
30
+ | 34 | The same registry retains tab addresses and selection across owner loss | `session-pages.test.ts`; live targets are recovered only after engine loss |
31
+ | 35–37 | Runtime native windows retain website pages while desktop UI storage stays isolated | `real-desktop.test.ts`; actual UI main/preload native journey |
32
+ | 38–40 | Dialogs retain one decision and revoked/reconnected UI capabilities cannot interrupt the owner | Native interaction, prompt, reconnect and late-event tests |
33
+ | 41 | Multiple windows share one page and its native input view | `real-desktop-views.test.ts` |
34
+ | 42 | Migration verifies publication and retains original website storage | `electron-profile-migration.test.ts`; actual CEF migration probe |
35
+ | 43 | Page-owned compositor readiness survives navigation and viewer changes; captures use CSS pixels | `page-rendering.test.ts`; `real-page-rendering.test.ts`; capture density tests; `real-browser.test.ts`; `real-lifecycle.test.ts` |
36
+ | 44–45 | Production pins bind final signatures; native permissions belong to process roles | engine signing and notarization checks; actual production VMP playback |
37
+ | 46 | Declared program artifacts must run their required operations on every supported host; explicit programs remain caller-owned | `automation.test.ts`; `artifact-gzip.test.ts`; `encoder.test.ts`; real recordings and codec playback |
38
+ | 47 | Scriptlet helpers remain private while their intended page changes compose | `adblock-scriptlets.test.ts`; scriptlet composition in `real-native-adblock.test.ts` |
39
+ | 48 | One viewport follows native bounds or the active streamed viewer without replacing the page | `page-viewport.test.ts`; `real-viewport.test.ts`; UI native and web resize journeys |
40
+ | 49 | Frame pixels and their viewport metadata come from the same Chromium frame | Real stream resizing and UI click/typing examinations |
41
+ | 50 | Automation requires owner-authenticated commands, admission follows listener shutdown and expires with the process | `daemon-admission.test.ts`; supplier protocol examination; real daemon control and crash recovery |
19
42
 
20
- When behavior fails, classify it against this map. If code drifted, restore the
21
- axiom everywhere it applies. If the axiom is incomplete, update
22
- `PURPOSE.md`, implementation, documentation, and invariant tests together. A
23
- transport-specific exception is not an acceptable fix for a domain rule.
43
+ When behavior fails, classify it against its axiom. Restore implementation
44
+ drift or revise an incomplete axiom and its dependents together. A test of one
45
+ symptom does not replace an invariant check.
package/docs/CHROME.md CHANGED
@@ -1,155 +1,74 @@
1
- # Chrome runtime
2
-
3
- Each runtime runs one headless Chrome. Every session drives its own tabs in
4
- that Chrome, and every tab browses as the runtime's account. `ChromeHost`
5
- (`src/chrome/`) owns the Chrome process. `AgentBrowserDriver` (`src/driver/`)
6
- runs each session's actions through its own agent-browser daemon.
7
-
8
- ## Finding Chrome
9
-
10
- Browser uses the first match:
11
-
12
- 1. `AMALGM_BROWSER_EXECUTABLE_PATH` (or `AGENT_BROWSER_EXECUTABLE_PATH`). If
13
- the path does not exist, launch fails.
14
- 2. An installed Google Chrome, Chrome Canary, Chromium, or Brave in the
15
- platform's usual install locations.
16
- 3. Chrome for Testing downloaded by `npx agent-browser install` into
17
- `~/.agent-browser/browsers`, newest first.
18
-
19
- If nothing is found, the first action fails with `PROCESS_FAILED` and a hint
20
- to install Chrome.
21
-
22
- ## Launch
23
-
24
- Chrome starts on the first action, not when the service is created. It runs
25
- `--headless=new` with remote debugging on a random loopback port and its user
26
- data in `<root>/chrome`. It presents a desktop user agent built from the
27
- installed Chrome's version and turns off the `AutomationControlled` blink
28
- feature, so sign-in pages see an ordinary desktop Chrome. Sync, first-run,
29
- translate, and component-update behavior are off, and the window is 1280×800.
30
- On Linux, `--no-sandbox` is added only when running as root.
31
-
32
- Chrome's native debugging-listening event admits the process, within a
33
- 20-second deadline. Browser attaches its private cookie extension to the
34
- account's default profile and reconciles it with the encrypted jar
35
- (see [cookies](./COOKIES.md)). The extension uses one session on the existing
36
- control connection, independently of the number of pages. Chrome reports a
37
- worker's context before it runs the worker script, so Browser's bindings can
38
- arrive before or after that script. Both sides ask to start delivery, and
39
- whichever comes second starts it; the worker then announces that it is
40
- observing. Chrome stops an idle extension worker and restarts it for the next
41
- cookie change; the new worker announces itself again, and that second
42
- announcement brings one snapshot to cover the stop. Chrome keeps running the
43
- script it saved under a worker's file name even after that file changes, so the
44
- worker's file is named after its source and a profile from an earlier release
45
- runs this release's worker. Cookie observation never decides whether Chrome may
46
- browse: if it cannot start within 10 seconds, or stops later, Browser logs a
47
- warning and keeps browsing with the account's cookies; cookie changes made in
48
- Chrome while it is unobserved do not reach the account. Chrome keeps its
49
- normal platform credential storage; Browser does not request the basic password
50
- store or mock keychain.
51
-
52
- ## One owner per root
53
-
54
- Only one process may run a root's Chrome. An exclusive SQLite transaction in
55
- `<root>/chrome.lease.sqlite` holds an OS lease for the process lifetime; another
56
- owner gets `CONFLICT`. The file is never removed. After a dead owner releases
57
- the lease, Browser retires its exact Chrome through the random browser endpoint
58
- in that profile's `DevToolsActivePort`, then starts the replacement. No PID or
59
- command-line match can authorize killing a process.
60
-
61
- ## Restart on next use
62
-
63
- If Chrome exits, Browser logs a warning and forgets it. The next action starts
64
- a new Chrome and loads the account's cookies into it. Tabs that were open are
65
- gone. An action caught by the crash can fail; retry it and it runs in the new
66
- Chrome.
67
-
68
- ## Sessions and the relay
69
-
70
- Each session is one agent-browser daemon attached with `--cdp` to the session's
71
- own relay endpoint, `ws://127.0.0.1:<port>/session/<id>`. The relay gives that
72
- connection a filtered view of the shared Chrome:
73
-
74
- - it lists and controls only the session's own tabs;
75
- - every tab it opens is placed in a new window in the account's browser context;
76
- - browser-wide methods (`Browser.close`, `Browser.crash`,
77
- `Target.createBrowserContext`, `Target.disposeBrowserContext`,
78
- `Target.attachToBrowserTarget`, `Target.setAutoAttach`) are refused.
79
-
80
- The first time a process uses a session, Browser closes any daemon left by an
81
- earlier process, then attaches a new one, which opens the session's first tab.
82
- Closing a session detaches its daemon and closes its tabs in Chrome.
83
-
84
- agent-browser's IPC sockets live in a private per-user directory under `/tmp`
85
- (the OS temporary directory on Windows). Each daemon's name is a digest of the
86
- real Browser root and the session ID, so long roots and IDs fit the socket
87
- path limit.
88
- The daemon uses Browser's own empty configuration and explicit launch inputs;
89
- ambient agent-browser profiles, sessions and providers cannot alter this
90
- identity. Page-operation argv travels through the CLI's JSON batch input,
91
- separate from its global flag parser.
92
-
93
- ## Capture and input
94
-
95
- Snapshots give stable `@eN` references for ordinary DOM actions. Screenshots,
96
- the `cua` double click, and recording connect straight to the session's page
97
- over CDP. The relay records the selected target's identity; repeated URLs do
98
- not make different tabs interchangeable. Without an owned selected target,
99
- the operation fails with `SURFACE_IDENTITY_FAILED`.
100
-
101
- Viewport screenshots are in CSS pixels at any device pixel ratio, and
102
- full-page capture is capped at 8192×16384. Computer use supports screenshot,
103
- click, double click, move, scroll, type, keypress, and drag. Use it for canvas,
104
- WebGL, image-only, or hostile custom controls; prefer snapshot references
105
- elsewhere.
106
-
107
- ## Live view
108
-
109
- `browser.streamUrl(sessionId)` returns agent-browser's stream for that session,
110
- `ws://127.0.0.1:<port>`, and turns the stream on if needed. The stream sends
111
- `status`, `tabs`, and `frame` messages and accepts `input_mouse`,
112
- `input_keyboard`, and `input_touch`. It shows and drives only that session's
113
- tabs. Viewers outside the process use the REST route
114
- `/v1/sessions/<id>/stream` (see [REST](./REST.md)), which also reports the
115
- selected page's actual Back/Forward availability. Editor shortcuts carry CDP
116
- editor commands, so they behave consistently in a streamed headless page.
117
- Navigation observation follows selected-tab and page events; an idle viewer
118
- does not poll history, and closing it releases its observation connection.
119
-
120
- ## Shutdown
121
-
122
- `browser.close()` stops admission, cancels and drains in-flight operations,
123
- then stops recordings, detaches every daemon, drains queued cookie changes,
124
- asks Chrome to close over CDP, and closes the registry. Chrome writes its
125
- profile only when it closes itself; a signal skips that, and on Windows every
126
- signal is a hard kill. A cookie Chrome had not yet reported is therefore on its
127
- disk, and the next start reconciles it. Chrome is killed if it has not exited
128
- 3 seconds after the request, or if the Node process exits.
129
-
130
- ## Configuration
131
-
132
- - `AMALGM_BROWSER_EXECUTABLE_PATH`: the Chrome executable
133
- - `AMALGM_AGENT_BROWSER_BIN`: the agent-browser executable. Without it,
134
- Browser uses the platform binary shipped with the `agent-browser` package
135
- (from `app.asar.unpacked` in packaged Electron apps), then the package's
136
- JavaScript wrapper, then `agent-browser` on `PATH`.
137
- - `AMALGM_FFMPEG`: the ffmpeg executable for recording
138
-
139
- ## Real verification
140
-
141
- `npm run test:real` drives real Chrome and agent-browser against a real site. It
142
- checks that chats browse side by side as one account, that a viewer can watch
143
- and drive one chat's live view only with the runtime token, that sign-ins
144
- survive restarts and follow sign-outs, that a chat keeps browsing after Chrome
145
- is killed, and that loopback cookies never enter the account. It also measures
146
- zero cookie scans and history reads while idle, including with a live viewer,
147
- and verifies background cookie writes and tab-switch history updates. The busy
148
- page examination starts with 1000 cookies and requires 60 edits to cause zero
149
- full-store scans, one encrypted row write per commit (edits that arrive during a
150
- commit coalesce, so at most 60), and under 120 KB of encoded state. Observer
151
- reload, worker restart, HttpOnly and partitioned events are exercised in real
152
- Chrome. Another browser's edits that arrive while Chrome is still writing the
153
- previous one must leave Chrome and the account at the last edit, with none of
154
- Chrome's reports of those writes taken for its own edits. Timing/CPU observations describe this local workload, not a universal
155
- website latency guarantee.
1
+ # Chromium runtime
2
+
3
+ Browser owns one castLabs Electron process per account and machine. Website
4
+ pages and desktop application windows live in that process. A desktop controller
5
+ connects through a private capability; it owns neither website renderers nor
6
+ website storage. Remote viewers use authenticated CDP streaming of the same pages.
7
+
8
+ ## Distribution and launch
9
+
10
+ `native/engine.json` pins Electron 44.5.1+wvcus for macOS, Windows and Linux on
11
+ arm64 and x64. Archive hashes and complete file inventories are verified on
12
+ installation and reuse. Engine bytes live outside package generations in a
13
+ private machine cache. The npm package contains the TypeScript runtime bundle,
14
+ preloads, native artifact pins and credential adapters. It does not contain Chromium.
15
+ The authenticated automation program and encoder are verified before engine
16
+ startup through the same cache. Their source and delivery rules live in
17
+ [engine delivery](ENGINE_DELIVERY.md).
18
+
19
+ `npm run build:native` builds only the macOS universal Keychain helper. The
20
+ maintained engine supplies native windows, rendering and OS interaction.
21
+ `AMALGM_BROWSER_ELECTRON_EXECUTABLE` and `AMALGM_BROWSER_ELECTRON_ENTRY` are
22
+ explicit development overrides; normal installations use their pinned engine
23
+ and packaged entry. A missing entry fails before starting an incomplete app.
24
+
25
+ The profile is `<root>/electron`. CDP uses inherited private pipes, with no
26
+ Chromium TCP listener. The account-root SQLite lease and older chrome-profile
27
+ lease exclude competing owners, including an older installed engine. Pipe EOF
28
+ ends the child; the OS releases leases if the owner dies.
29
+
30
+ ## Ownership and recovery
31
+
32
+ Closing, crashing, signing out or replacing a viewer revokes its windows and
33
+ surfaces. Website targets, actions, history, JavaScript memory and storage
34
+ continue. Only explicit page/session close or owner shutdown ends a page.
35
+ After an actual engine crash, saved addresses reopen in new execution contexts;
36
+ this does not restore JavaScript memory or replay unfinished actions.
37
+
38
+ Each session has its own authenticated CDP relay. It can address only its owned
39
+ targets, including children with genuine Chromium openers. Browser-wide close,
40
+ crash and context creation are refused. Duplicate URLs never substitute for
41
+ selected-target identity in capture, recording or input.
42
+
43
+ ## Storage and policy
44
+
45
+ The encrypted Amalgm jar is the website cookie authority. Before network
46
+ admission, Electron clears its derived cookie cache and restores the jar,
47
+ including tombstones and partitioned attributes. Local storage, IndexedDB and
48
+ other origin storage remain in the persistent profile. Desktop authentication
49
+ uses a separate persistent UI partition, seeded once from the bootstrap UI.
50
+
51
+ Electron cookie notifications trigger coalesced CDP snapshots because its
52
+ public notification omits partition keys. There is no idle scan timer. Durable
53
+ writes and encrypted delta reads concern changed records. A failed observation
54
+ or durable commit stops the owner rather than silently losing cookie changes.
55
+
56
+ Runtime-owned network blocking, cosmetics, downloads, permissions and dialogs
57
+ continue independently of viewers. Synchronous text prompts use a restricted
58
+ sandboxed preload and share one decision with CDP and native viewers. Blank
59
+ iframes do not receive Electron's preload; text prompts there remain a documented
60
+ supplier limitation.
61
+
62
+ ## Migration
63
+
64
+ First Electron admission can migrate `<root>/chrome` in flat or `Default`
65
+ layout. Both leases remain held. Existing jar records and tombstones win over
66
+ legacy cookies; unknown cookies require an explicit
67
+ `AMALGM_BROWSER_LEGACY_EXECUTABLE` capable of decoding the original profile.
68
+ Website files are copied to staging, hashed, flushed and atomically published
69
+ with a receipt. The original storage remains available. Conflicting populated
70
+ profiles, unreadable cookies or unexpected filesystem links stop migration.
71
+ Subsequent starts reuse the adopted profile without copying stale data again.
72
+
73
+ See [native integration](NATIVE_BROWSER.md) for observed evidence and open gates,
74
+ and [engine delivery](ENGINE_DELIVERY.md) for supplier and package updates.
@@ -6,10 +6,17 @@
6
6
  - modules: ESM core imports; ESM and generated CommonJS for
7
7
  `@amalgm/browser/electron`
8
8
  - Electron: optional peer, version 33 or newer
9
- - browser: an installed Chrome, Chrome Canary, Chromium, or Brave, or Chrome
10
- for Testing (see [Chrome runtime](./CHROME.md))
11
- - Electron browser partition: `persist:amalgm-browser-<SHA-256 account ID>`;
12
- application authentication stays in Electron's default partition
9
+ - browser: integrity-pinned castLabs Electron for Content Security 44.5.1
10
+ - native presentation: runtime-owned Electron WebContentsViews and windows
11
+ - application authentication: persistent UI partition, separate from websites
12
+ - website storage: one runtime Chromium profile and encrypted cookie authority per account
13
+
14
+ The pin inventories darwin, win32 and linux archives for arm64 and x64.
15
+ Inventory verification is not native-platform acceptance. macOS arm64 has
16
+ local runtime, media, cookie, package and desktop evidence. Other native
17
+ platform journeys, protected-media playback and complete native input coverage
18
+ remain release gates. An installed Chrome cannot substitute for the private
19
+ embedding protocol.
13
20
 
14
21
  Core imports do not load Electron. The Electron code is available only from
15
22
  `@amalgm/browser/electron`.