@amalgm/browser 0.1.2-preview.44182723491 → 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 +36 -16
  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
package/docs/COOKIES.md CHANGED
@@ -1,9 +1,14 @@
1
1
  # Cookies
2
2
 
3
- The account's encrypted jar (`cookie-jar.sqlite`) is the store of record.
4
- Chrome uses one account profile; Electron uses one persistent partition per
5
- account. Application authentication in Electron's `defaultSession` is outside
6
- Browser. Physical browser storage follows the browser's own storage policy.
3
+ The account's encrypted jar is the store of record: one set of cookies per
4
+ account, in `cookie-jar.sqlite` inside the browser root the runtime passes;
5
+ the runtime's layout decides where that root is. Chromium uses one account
6
+ profile. The runtime owns its Electron website partition. Application authentication uses
7
+ a separate persistent UI partition and never enters the website jar.
8
+
9
+ Native and remote viewers address pages in that same profile. Runtime
10
+ cookie changes reconcile with the jar; attaching, signing out or closing a
11
+ viewer cannot move or synchronize another physical website store.
7
12
 
8
13
  ## Events and consequences
9
14
 
@@ -11,17 +16,23 @@ Browser. Physical browser storage follows the browser's own storage policy.
11
16
  | --- | --- |
12
17
  | Physical cookie added, changed, expired, evicted or deleted | Commit that record or tombstone to the jar. |
13
18
  | Jar transaction committed | Notify the new revision; deliver only records changed since the receiver's acknowledged revision. |
14
- | Adapter connected, or Chrome restarted the observer's stopped worker | Read one snapshot and reconcile that physical store. |
19
+ | Adapter connected or native cookie notification received | Read one coalesced snapshot, preserving all partition keys. |
15
20
  | Live revision stream ended after delivering | Rejoin it once. A refused stream is not retried. |
16
21
  | Runtime binding published or native cookie changed while disconnected | Attempt the connection with the current credentials. |
17
22
  | Account closed | Drain admitted changes, unsubscribe and release resources. |
18
23
 
19
- Chrome's SDK-owned private extension listens to `chrome.cookies.onChanged`.
20
- It observes HttpOnly and partitioned cookies independently of websites and page
21
- activity. Electron's `cookies.changed` supplies the same record information.
22
- Neither adapter installs website listeners, enables network observation, scans
23
- on input/actions, or runs a synchronization timer. A replacement's intermediate
24
- `overwrite` removal is followed by its insertion event and is not a logout.
24
+ Electron's `session.cookies` notification indicates a physical change, but omits
25
+ partition keys. Browser therefore reads a coalesced CDP cookie snapshot, diffs
26
+ it against its last observation and commits changed records. An explicit sync
27
+ also checkpoints changes whose native notification has not arrived. The jar's
28
+ revision cursor remains intact: a physical snapshot does not decrypt the whole
29
+ jar again. Initial admission and an authority-epoch replacement bootstrap once.
30
+
31
+ Startup clears the Chromium working cookie cache before any website network
32
+ request and restores the encrypted jar. Unknown working-copy rows and old
33
+ logout cookies cannot reappear. Local storage and IndexedDB remain persistent.
34
+ A failed snapshot, unhealthy authority or failed durable write stops the owner
35
+ after attempting to drain admitted changes. There is no idle polling timer.
25
36
 
26
37
  Each adapter serializes its events. Pending changes to the same identity
27
38
  coalesce while existing work is in flight; there is no debounce delay. Applying
@@ -72,11 +83,14 @@ cache and private `0700` directories / `0600` files. A committed change
72
83
  survives an application crash (`synchronous=NORMAL`); Chrome itself writes
73
84
  cookies to disk in batches. The previous encrypted whole-file jar is imported
74
85
  transactionally on first open and then removed, so it is never a second writer.
75
- The key (`browser.key`) sits beside the jar on the same device. This prevents accidental plaintext exposure; it does not
76
- defend against an attacker who can read both the jar and the key.
86
+ The default key uses macOS Keychain, Windows Credential Manager or Linux
87
+ durable Secret Service; `browser.keychain` contains only its
88
+ public reference. A signed helper forbids authentication prompts and returns
89
+ bounded errors. Migration verifies the old key in Keychain before removing the
90
+ plaintext `browser.key`. Embedders can supply an explicit credential authority.
77
91
 
78
92
  If the jar is corrupt or the key is wrong, the jar reports itself unhealthy,
79
- sync stops, and browsing continues with whatever cookies Chrome already has.
93
+ startup refuses to open the browser with an unavailable cookie authority.
80
94
  Cookie values never enter an error message.
81
95
 
82
96
  ## Public versus trusted APIs
@@ -98,9 +112,9 @@ not the jar.
98
112
 
99
113
  ## Performance contract
100
114
 
101
- After connection, an idle adapter performs zero cookie reads or writes. A
102
- sequence of N independent cookie changes performs zero full-store scans and
103
- at most N durable mutations; encrypted work and delta payloads depend on the
104
- changed records, not on the total jar size. Functional and performance evidence
105
- are separate: native Chrome/Electron tests verify event delivery, while the
115
+ After connection, an idle adapter performs zero cookie reads or writes. Native changes and explicit checkpoints may read full physical snapshots.
116
+ Notifications coalesce while work is in flight. Encrypted work, indexed jar
117
+ deltas and durable mutations concern changed records rather than the whole jar;
118
+ a physical snapshot is not a full encrypted rewrite. Functional and performance evidence
119
+ are separate: native Chromium tests verify event delivery, while the
106
120
  bounded load examination counts physical reads, encrypted rows, and writes.
@@ -1,100 +1,70 @@
1
- # Electron integration
2
-
3
- `@amalgm/browser/electron` is the desktop app's in-app browser: native tabs
4
- the user browses in, with Browser's navigation policy, downloads, permissions,
5
- context menus, and ad blocking. Agents do not drive these tabs; agent sessions
6
- run in the runtime's Chrome (see [Chrome runtime](./CHROME.md)).
7
-
8
- Electron is an optional peer dependency and loads only through this entry
9
- point. It has ESM and generated CommonJS conditions. Desktop builds may copy
10
- `electron.cjs` and `electron-preload.cjs` into their own output. Both are
11
- build products of Browser's TypeScript source; a host app must not edit or
12
- reimplement them.
13
-
14
- ## What it exports
15
-
16
- - `createBrowserShell({ accountId, cookieStore?, isTrustedAppUrl, isDev, adBlockFetch? })`
17
- installs the account's IPC handlers and returns asynchronous `dispose`.
18
- - `createHttpCookieStore` and `readCookieAdapter` connect a trusted native host
19
- to the runtime's separately credentialed cookie port.
20
- - `BROWSER_IPC`, the IPC channel names, and the typed payloads for tabs,
21
- context menus, permissions, downloads, ad blocking, and shortcuts.
22
-
23
- The renderer supplies presentation and IPC wiring. It is not a browser-state
24
- authority.
25
-
26
- ## Partition
27
-
28
- Every account uses a separate persistent partition:
29
-
30
- ```text
31
- persist:amalgm-browser-<sha256 of the Amalgm account ID>
32
- ```
33
-
34
- Each tab runs sandboxed in that partition with context isolation and web
35
- security on and Node integration off. Application authentication stays in
36
- Electron's `defaultSession`, which Browser never uses.
37
- The host retires the old account's views and adapter before activating another
38
- account. Signing out disposes the shell; native cookies remain in that account's
39
- partition for the next authenticated activation.
40
-
41
- ## Native tabs
42
-
43
- The shell hosts each tab as a native `WebContentsView` created through
44
- `BROWSER_IPC.surfaceCreate`. The renderer places it over the tab's box with
45
- `surfaceUpdate`, sending the box exactly as it measures it, in its own CSS
46
- pixels. The shell scales the box by the renderer's zoom and puts each edge on
47
- the nearest whole window point, the only positions a native view can take.
48
- The view paints its own white page background, so the box under it paints
49
- nothing. A hidden tab's view stays in its window, invisible. Only the
50
- renderer that created a tab can update, command, capture, or destroy it, and
51
- its tabs close when that renderer navigates away or is destroyed. Capture
52
- returns the tab's current frame as a JPEG, or `null` when the tab paints no
53
- frame within two seconds. The first frame after a move or resize takes a few
54
- hundred milliseconds; the renderer decides how long to wait for it. Commands are
55
- navigate, back, forward, reload, focus, find, stop-find, and zoom. The preload
56
- reports `capabilities.version` 2 for this contract.
57
-
58
- ## Shell policy
59
-
60
- - navigation limited to `http`, `https`, and `about`, with `mailto:` and
61
- `tel:` handed to the OS
62
- - popups become tabs; real child windows stay windows
63
- - page state, favicon, navigation, and load-failure updates
64
- - spellcheck-aware context menus
65
- - basename-only download paths that never overwrite, plus download actions
66
- - permission prompts keyed to the requesting frame's origin, failing closed
67
- - browser shortcuts: focus location, new or close tab, find, reload, zoom
68
-
69
- ## Ad blocking
70
-
71
- `NativeAdBlocker` uses Ghostery-compatible filter lists, a compiled cache
72
- under Electron's `userData/browser/adblock`, a seven-day refresh, a
73
- last-good-cache fallback, cosmetic rules, scriptlets, and per-site settings.
74
- `AMALGM_BROWSER_ADBLOCK=0` turns it off. It applies only to Browser tabs, not
75
- to the application renderer, API, or auth traffic.
76
-
77
- ## Cookies
78
-
79
- When supplied a `cookieStore`, the shell registers `ElectronCookieAdapter` as
80
- `electron:account`. Native cookie records and jar revision notifications
81
- converge through the account's jar; disposal drains pending work. Shell publishes the Browser state root
82
- in its private runtime discovery record and a separate private adapter token
83
- in that root. The UI's Electron main process rediscovers the exact runtime and
84
- account for each connection; cookies and credentials never enter renderer IPC.
85
- The host passes `subscribeReady` to `createHttpCookieStore`, using its runtime
86
- publication events to reopen the authenticated stream when the binding changes.
87
- A stream that ends after delivering rejoins at once; a refused stream waits for
88
- that event. There is no reconnect timer. Native edits can also attempt a disconnected port.
89
- Offline native browsing retains its physical cookies; uncommitted edits remain
90
- pending during the active account connection. Tombstones prevent stale partitions from undoing a sign-out.
91
-
92
- ## Verification
93
-
94
- `electron-policy`, `electron-surface`, `electron-adblock`, and
95
- `electron-cookies` tests cover URL, popup, permission, and download policy,
96
- where a tab's page goes in a zoomed window, the ad-block cache and kill
97
- switch, and the cookie adapter against an injected partition store.
98
- The UI's source examination additionally drives actual Electron views and the
99
- Shell/Browser runtime, proving bidirectional cookies, scope, deletion, account
100
- switching, sign-out and fractional native bounds on the examined platform.
1
+ # Desktop integration
2
+
3
+ The independently supervised runtime owns Electron, website WebContentsViews
4
+ and desktop application windows. The desktop application process is a controller
5
+ that connects through `connectRuntimeDesktop` from `@amalgm/browser/electron`.
6
+ The existing toolbar, tab layout and public Browser action contracts are unchanged.
7
+
8
+ ## Controller and packaging
9
+
10
+ `connectRuntimeDesktop` opens runtime-hosted UI windows with their preload,
11
+ loopback application URL, allowed IPC channels and persistent profile identity.
12
+ Its stable window handles survive connection replacement. Reconnect recreates
13
+ presentation containers and reuses UI storage; it never replays website actions.
14
+ An owner crash restores saved addresses in new execution contexts.
15
+
16
+ The application copies the generated `electron.cjs` SDK and its own preload.
17
+ There is no presentation addon to copy. `prepareBrowserShell()` remains a
18
+ compatibility no-op; `createBrowserShell()` installs trusted surface IPC inside
19
+ the runtime and receives its native presentation implementation explicitly.
20
+ Electron remains an optional peer for the desktop entry point.
21
+
22
+ The controller's IPC registry serves both the local bootstrap window and the
23
+ runtime-hosted window. Only the owning main frame and declared channels are
24
+ admitted. A queued event from a destroyed window is discarded; a revoked request
25
+ receives an error without interrupting the runtime.
26
+
27
+ ## Surfaces and input
28
+
29
+ The UI creates surfaces with existing `surfaceId`, `sessionId`, bounds and
30
+ visibility messages. Surface names are scoped to their UI WebContents. A surface
31
+ holds a revocable account/machine/page/connection capability. Credentials never
32
+ enter renderer IPC. `BrowserHolding.native` reports local presentation availability.
33
+
34
+ Each page has one native WebContentsView. It is attached to the focused window;
35
+ other windows display current uncompressed NativeImage frames in ImageViews.
36
+ Focus moves the existing view, retaining the target and page state. Native frame
37
+ subscription exists only while readiness or passive windows need frames; there is
38
+ no encoded frame queue. One window can present a page once. With no native viewers, the page
39
+ is parked in a hidden native container so remote rendering can continue.
40
+
41
+ Input, focus, clipboard, accessibility and composition use Electron's native
42
+ view. Menus, permissions, file selection and JavaScript dialogs use bounded,
43
+ page-scoped requests. Text prompts have a sandboxed native dialog and a CDP
44
+ compatibility path. Electron does not run the preload in blank iframes, so their
45
+ text prompts are not yet supported.
46
+
47
+ Child pages keep their actual opener and tab/window disposition. Explicit popup
48
+ close ends the child; controller exit and parent-view destruction only detach
49
+ viewers. Downloads belong to the runtime and continue after the desktop closes.
50
+
51
+ ## Application storage
52
+
53
+ Application authentication is isolated from the website profile. The first
54
+ bootstrap handoff seeds its persistent UI partition once. Later windows reuse
55
+ it, including deleted cookies and changed local storage. Adoption is serialized
56
+ per profile. Account sign-out revokes browser capabilities; account selection
57
+ uses the matching runtime binding. New authentication cookies are applied
58
+ explicitly through a fresh `cookieHandoff` ID before loading an account's UI.
59
+ The durable adoption receipt consumes each handoff once, so reconnect and owner
60
+ restart cannot replay it over a newer login or logout. Workspace storage is
61
+ retained across those sign-in handoffs.
62
+
63
+ ## Evidence
64
+
65
+ The macOS desktop suite covers shared targets, native and remote viewers, quit,
66
+ crash, reconnect, owner loss, popup ownership, downloads, native prompt input,
67
+ and two-window native view placement with live uncompressed frames. UI's native
68
+ integration test uses its actual main entry, preload, browser components and
69
+ Shell gateway. OS accessibility, IME, clipboard and drag require separate native
70
+ interaction evidence; earlier CEF results do not certify Electron.
@@ -0,0 +1,143 @@
1
+ # Engine delivery
2
+
3
+ ## Current supplier
4
+
5
+ Amalgm consumes the maintained castLabs Electron distribution. The approved
6
+ storage contract uses Amalgm's encrypted cookie jar as authority and Chromium's
7
+ disk cookies as a rebuildable working copy. A separate runtime process owns all
8
+ website pages and desktop UI windows.
9
+
10
+ `native/engine.json` pins 44.5.1+wvcus and inventories the upstream archives for
11
+ macOS, Windows and Linux, arm64 and x64. All six archive digests and inventories
12
+ were verified locally. The native CI matrix exercises execution and common-media
13
+ playback on macOS, Windows and Linux. Release acceptance additionally requires
14
+ the exact signed candidate on every supported OS/CPU.
15
+
16
+ The earlier custom CEF source, cookie patch, supplier assessment and borrowed
17
+ build-host plan are preserved in `research/cef`. They are paused, excluded from
18
+ product builds and superseded by this supplier decision. No rental or custom
19
+ Chromium build is needed for the current implementation.
20
+
21
+ ## Updating the pin
22
+
23
+ `npx tsx scripts/pin-electron.ts <exact-version> <archive-cache> [output.json]`
24
+ reads the exact upstream release, verifies each archive against its published
25
+ size and SHA-256 digest, and generates its complete file inventory. A local
26
+ archive cache avoids downloading unchanged verified bytes again. Review the
27
+ new pin and run native acceptance before adopting it.
28
+
29
+ The engine cache is private and content addressed. Extraction validates every
30
+ path, file, directory and symlink against the inventory, including empty
31
+ directories. A cache hit rechecks its contents. A damaged entry is replaced only
32
+ after a complete verified staging installation is ready. A SQLite lease bounds
33
+ concurrent installation and releases automatically on process exit.
34
+
35
+ Default cache roots are `~/Library/Caches/Amalgm/browser-engines` on macOS,
36
+ `%LOCALAPPDATA%/Amalgm/browser-engines` on Windows and
37
+ `${XDG_CACHE_HOME:-~/.cache}/Amalgm/browser-engines` on Linux.
38
+ `AMALGM_BROWSER_ENGINE_CACHE` can select an explicit cache location.
39
+
40
+ ## Native media encoder
41
+
42
+ `native/encoder.json` pins FFmpeg on the same six OS/CPU targets. Browser verifies
43
+ it before native startup, capture resampling or recording. It uses the same
44
+ content-addressed cache, bounded extraction and repair rules as the engine,
45
+ under `browser-encoders`. `AMALGM_BROWSER_ENCODER_CACHE` selects that cache;
46
+ `AMALGM_FFMPEG` supplies an explicit caller-owned encoder.
47
+
48
+ Encoder artifacts use the [ffmpeg-static b6.1.1 distribution](https://github.com/eugeneware/ffmpeg-static/releases/tag/b6.1.1).
49
+ Windows 11 ARM uses that same x64 encoder through
50
+ [Windows application emulation](https://learn.microsoft.com/en-us/windows/arm/apps-on-arm-x86-emulation).
51
+ This is an explicit artifact pin. Qualification runs on the ARM runner with
52
+ the native ARM browser. The examined native ARM encoder omits libvpx and cannot satisfy
53
+ Browser's VP9 recording contract. The browser engine and Node host still use
54
+ their native ARM builds.
55
+ Downloads come directly from the upstream releases. Their complete file
56
+ inventories or single-file gzip contents are pinned; supplier notices are
57
+ retained in `native/encoder-notices` for each distinct upstream platform.
58
+ The npm package carries the pins and notices. Installation does not run an
59
+ encoder download script or fall back to an unverified program on PATH.
60
+
61
+ Regenerate the pins from the exact upstream release:
62
+
63
+ ```sh
64
+ node --import tsx scripts/pin-encoder.ts b6.1.1 /private/archive-cache
65
+ ```
66
+
67
+ Each changed encoder must pass real capture, recording and codec playback on
68
+ its native target. Archive verification alone does not certify execution.
69
+
70
+ ## Authenticated automation
71
+
72
+ `native/automation.json` pins Browser's agent-browser build from the exact source,
73
+ compiler and patch recorded in `native/automation`. The patch requires an HMAC
74
+ on every daemon command and prevents retries after uncertain delivery. Browser
75
+ stores a fresh credential in its private IPC directory for each process and
76
+ passes it through the environment, never arguments. It disables the supplier's
77
+ auxiliary stream before granting that process access to pages.
78
+
79
+ The native build workflow examines authentication, listener shutdown and
80
+ uncertain-delivery behavior before retaining each binary and its pin record.
81
+ Windows ARM uses the same x64 automation executable; both hosts must pass the
82
+ full Browser native journey. The artifact uses the shared verified cache under
83
+ `browser-automation`; `AMALGM_BROWSER_AUTOMATION_CACHE` changes its location and
84
+ `AMALGM_AGENT_BROWSER_BIN` supplies an explicit caller-owned implementation.
85
+ The package carries the source pin, patch and Apache-2.0 notice. End users need
86
+ neither Rust nor an upstream npm installer. A native build does not publish or
87
+ promote itself; its verified artifacts must be published and pinned explicitly.
88
+ Automation downloads use the public `amalgm-desktop-releases` repository, like
89
+ the signed engines; private source access is never an installation requirement.
90
+
91
+ ## Package and acceptance
92
+
93
+ The npm package ships the runtime bundle, sandboxed preloads, SDK, native artifact pins and
94
+ credential adapters. It does not duplicate Chromium archives. macOS builds add
95
+ a universal Keychain helper; Windows/Linux use the pinned native keyring binding.
96
+ The same candidate archive must be installed and exercised on each release OS.
97
+ A package prepared on Linux without the macOS helper is not a universal release.
98
+
99
+ `npm run check`, `npm test`, `npm run test:real` and `npm run verify:pack` cover
100
+ source, invariants, live runtime journeys and fresh-consumer execution. The real
101
+ suite builds its runtime entry before execution and includes media/storage
102
+ acceptance. Linux execution needs a display and a functioning Chromium sandbox;
103
+ credential tests need a durable Secret Service. Windows and Linux checks must
104
+ run on their actual operating systems. Windows control examinations use
105
+ PowerShell 7 (included in the supported CI images) to inspect native ACLs and
106
+ process arguments; this is an examination dependency, not a runtime dependency.
107
+ The Linux package gate uses the runner's designated scratch directory and checks
108
+ that its filesystem permits executable files and the setuid sandbox helper.
109
+ The OS temporary directory may be mounted `nosuid`, as with Ubuntu's upstream
110
+ `tmp.mount`; file ownership and mode alone cannot establish sandbox readiness.
111
+ The gate preserves these mount restrictions and runs the same packaged browser
112
+ with its sandbox enabled.
113
+
114
+ The macOS helper must retain its signed application identity across updates.
115
+ Development builds may be ad-hoc signed; that does not establish production
116
+ Keychain access. Browser repository signing secrets were provisioned on October 21,
117
+ 2026 after an approved export of the Amalgm Developer ID identity. Their presence
118
+ does not certify a CI-signed candidate. The prepare job requires `CSC_LINK`
119
+ (base64 PKCS#12) and `CSC_KEY_PASSWORD`, imports the Amalgm Developer ID into a temporary CI keychain, and removes it after preparation.
120
+ Missing signing inputs stop the candidate before publication.
121
+
122
+ ## Protected media
123
+
124
+ The selected castLabs build includes Widevine support and common codecs.
125
+ The runtime eagerly initializes the supplier's signed Widevine component with
126
+ a bounded startup wait; an unavailable component service does not stop ordinary
127
+ browsing. Linux requires a runtime restart after its first CDM installation.
128
+ Actual Widevine-protected playback has passed against the public Shaka/Widevine
129
+ UAT service on macOS arm64. That service accepts the supplier's development VMP
130
+ signature. EVS enrollment and production signatures are complete for Mac and Windows.
131
+ Production Widevine playback passes on Apple Silicon, the Intel build under
132
+ Rosetta and native Windows x64/ARM hosts. The original development-signed Mac build
133
+ fails the same production license request. Both final Mac archives pass Apple
134
+ notarization, stapling and Gatekeeper after extraction. The full native source
135
+ matrix passed on October 21, 2026. Both final Mac downloads are publicly verified,
136
+ pinned and pass actual production playback locally (Intel through Rosetta).
137
+ The complete source matrix passes with the final pins, including native Intel
138
+ production playback. Final package qualification remains a release gate.
139
+ Intended-service checks remain separate; Linux has different VMP requirements. Never infer
140
+ Netflix or other service compatibility from the public canary.
141
+
142
+ Primary supplier references: [castLabs releases](https://github.com/castlabs/electron-releases),
143
+ [EVS](https://github.com/castlabs/electron-releases/wiki/EVS).
@@ -0,0 +1,72 @@
1
+ # Browser engine release
2
+
3
+ Browser owns the immutable engine archives and their final integrity pins. An
4
+ engine is prepared and signed outside the repository and installed cache. Only
5
+ the stage's `content/` directory enters the archive; credentials, EVS caches,
6
+ Apple receipts and upload state stay outside it.
7
+
8
+ ## Signatures and staging
9
+
10
+ Generate an exact upstream inventory with `scripts/pin-electron.ts`. Keep it as
11
+ the source manifest when preparing a production revision. For each Mac and
12
+ Windows architecture, use a new private directory:
13
+
14
+ ```sh
15
+ node --import tsx scripts/engine/prepare.ts PLATFORM upstream.json upstream.zip STAGE
16
+ node --import tsx scripts/engine/sign.ts STAGE
17
+ ```
18
+
19
+ The signer uses the official `castlabs-evs` Python package selected through
20
+ `AMALGM_BROWSER_EVS_PYTHON`. Enrollment and authentication happen with its own
21
+ account CLI. Its credentials never enter a build or source file. Mac signing
22
+ requires `AMALGM_BROWSER_SIGNING_IDENTITY`, a Developer ID Application identity
23
+ for Amalgm's team. VMP is applied before Apple signing. Windows retains the
24
+ upstream executable and its publisher signature; EVS supplies the production
25
+ VMP sidecar. Linux retains its verified upstream distribution.
26
+
27
+ The pinned Electron signing library supplies hardened-runtime permissions for
28
+ each process role. The generic utility helper additionally admits independently
29
+ signed libraries because ECS loads Google's Widevine CDM there. Renderer, GPU
30
+ and main-process policy remains the pinned library's policy.
31
+
32
+ ## Apple approval and final bytes
33
+
34
+ Set `APPLE_API_KEY` to the private key path, `APPLE_API_KEY_ID` to its key ID and
35
+ `APPLE_API_ISSUER` to its issuer UUID. The notarization owner uploads sequentially
36
+ through Apple's Notary API and temporary S3 credentials. Its transport and
37
+ durable ledger are intentionally shared with UI's proven implementation, kept
38
+ inside Browser so releasing this owner needs no other private repository.
39
+
40
+ ```sh
41
+ node --import tsx scripts/engine/notarize-stage.ts STAGE
42
+ node --import tsx scripts/engine/archive.ts STAGE IMMUTABLE_HTTPS_ARCHIVE_URL
43
+ ```
44
+
45
+ Notarization creates one immutable submission ZIP. Reruns reconcile its retained
46
+ Apple job instead of creating another. Acceptance must bind the exact input
47
+ hash to an error-free Apple log. Stapling must preserve the accepted signed
48
+ code. Finalization verifies the production VMP signature and, on Mac, the
49
+ accepted code, staple and Gatekeeper assessment before creating the archive.
50
+ It then extracts and verifies the entire archive again. `artifact.json` records
51
+ the final SHA-256, size, modes, links and complete inventory.
52
+
53
+ ## Qualification and publication
54
+
55
+ Real playback uses both `AMALGM_BROWSER_DRM_REAL=1` and
56
+ `AMALGM_BROWSER_DRM_PRODUCTION=1` with `scripts/test-real.ts`. The production
57
+ test requires Widevine's production license server to report software verified
58
+ and the video to advance through decoded frames. A development-only VMP
59
+ signature cannot pass that gate. Service-specific login/playback remains a
60
+ separate examination.
61
+
62
+ A production VMP pin automatically enables that playback gate in native CI.
63
+ Source and package qualification cover all six OS/CPU targets. Managed package
64
+ publication requires final production pins for both Mac and Windows
65
+ architectures; an upstream development signature cannot satisfy that gate.
66
+
67
+ Qualify the exact final artifacts on each claimed OS and CPU, including native
68
+ OS interaction and fresh-consumer execution. Upload immutable archives before
69
+ updating `native/engine.json`; download and verify the public bytes against the
70
+ recorded final digest. Never replace an existing engine URL or publish staging
71
+ credentials. Browser package publication, Shell composition and installed
72
+ adoption are separate subsequent gates.
@@ -0,0 +1,138 @@
1
+ # Native browser integration
2
+
3
+ ## Purpose and boundaries
4
+
5
+ There is one runtime browser, one account cookie authority and one set of live
6
+ sessions/tabs. Every UI presents those same pages. The desktop controller can
7
+ close or crash while browser actions and website execution continue.
8
+
9
+ - `src/runtime-electron/`: runtime pages, native placement, application windows,
10
+ policies, dialogs, profile migration and isolated UI storage.
11
+ - `src/host/`: runtime ownership, sessions, persisted addresses and viewer admission.
12
+ - `src/native/`: private process protocol, CDP bridge and verified engine cache.
13
+ - `src/electron/`: controller SDK and trusted surface IPC.
14
+ - `native/credentials/`: macOS Keychain helper; Windows/Linux use platform keyring bindings.
15
+ - `research/cef/`: archived custom-engine work, excluded from product builds.
16
+
17
+ The session network hook asks the runtime for one decision before each HTTP request
18
+ leaves Chromium. Filtering follows an owned page's top-level site. It works before a popup has a renderer, retains upload bytes
19
+ inside Chromium and binds added CSP to the exact request. Pending decisions have
20
+ a finite queue and deadline; failure releases them and reports policy unavailable.
21
+ Cosmetic rules attach to renderer contexts and seed documents that already exist.
22
+ Application windows can open while media components and filter rules prepare.
23
+ Website requests remain behind cookie, policy and media admission. Closing the
24
+ owner cancels filter downloads and waits for preparation cleanup.
25
+
26
+ ## Verified locally on macOS arm64
27
+
28
+ The pinned castLabs Electron 44.5.1+wvcus runtime has passed:
29
+
30
+ - Unchanged Browser actions, private CDP ownership and cookie authority checks.
31
+ - Desktop quit, crash and reconnect preserving target identity, form drafts,
32
+ session/local storage, history and actions already running.
33
+ - Engine loss restoring saved addresses with explicitly new JavaScript execution.
34
+ - Two desktop windows displaying one target, live uncompressed passive frames,
35
+ native view placement on focus, and continuity after either viewer closes.
36
+ - Native window and web panel resizing reflowing that same page; passive windows
37
+ preserve device density and fit the complete rendering at different aspect ratios.
38
+ Streamed frames retain Chromium's actual viewport metadata for accurate input.
39
+ - Popup opener identity, explicit popup close, runtime downloads after viewer exit,
40
+ text prompts through native input and CDP, and revoked IPC during teardown.
41
+ - Runtime ad blocking across initial pages, frames, popups and large uploads.
42
+ - H.264/AAC, VP9/Opus, AV1/AAC and fragmented MediaSource playback through completion.
43
+ - Rebuilding cookies before browsing while preserving other origin storage.
44
+ - Actual previous-CEF to Electron migration retaining local storage, IndexedDB
45
+ and cookies, with the original profile retained.
46
+ - Fresh-consumer execution of the packaged adapter and pinned engine cache.
47
+ - First remote frames and input without a desktop window, continued input and
48
+ streaming across cross-site navigation and native viewer changes, and CSS
49
+ captures across display densities, page zoom and full-page extents.
50
+ - The production-identity macOS credential helper, including legacy key migration
51
+ and unattended access from an actual background launch service.
52
+ - Actual Widevine-protected playback against the public UAT service and production
53
+ Widevine validation with the production-signed Mac candidates.
54
+ - Fresh sign-in handoffs applied once, with newer authentication and workspace
55
+ state retained through controller reconnect and browser-owner restart.
56
+
57
+ These local results do not certify another native host or an intended streaming service.
58
+
59
+ ### Public streaming services, October 22, 2026
60
+
61
+ The public [Bitmovin DRM demo](https://bitmovin.com/demos/drm) requires no account
62
+ and passed protected 1920 × 1080 H.264/AAC playback on the final public Apple
63
+ Silicon engine. Chromium reported CENC tracks, a decrypting video decoder and
64
+ advancing video frames and decoded audio bytes. Playback advanced continuously
65
+ for 75 seconds before a seek to 150 seconds, then continued beyond 197 seconds
66
+ without a media error. An authorized web viewer received frames while closing
67
+ the native viewer preserved the page identity and playback. Fullscreen entry,
68
+ exit and window resizing also passed with the same page.
69
+
70
+ This verifies public protected-media playback, not Netflix account or service
71
+ acceptance. Netflix playback remains untested without a signed-in account.
72
+ YouTube starts with default filtering after the isolated-scriptlet correction,
73
+ but later stalls in both Amalgm and a fresh Google Chrome session; the cause is
74
+ unresolved. The examined Tubi title did not produce a first frame in Amalgm and
75
+ reported unavailable in the Chrome comparison, so it is not a playback pass.
76
+
77
+ ## Manual macOS interaction check
78
+
79
+ On October 21, 2026, the owner used the public, notarized Apple Silicon engine
80
+ in an isolated native desktop window and reported normal typing, clipboard,
81
+ drag/drop and focus behavior. The page observed trusted keyboard and copy events,
82
+ an internal drag/drop and focus return. The owner also confirmed VoiceOver field
83
+ labels and keyboard focus. The exact pasted test phrase was not observed, so
84
+ clipboard success is a human report rather than an automated byte comparison.
85
+ No composition event or external file drop was observed; those remain unverified.
86
+
87
+ ## Automated native verification
88
+
89
+ The CI matrix runs the same native journey on x64 and ARM hosts for macOS, Windows and Linux.
90
+ It checks private control, cookie authority, media, captures, remote input,
91
+ native windows, prompts and page continuity through viewer quit/crash/reconnect.
92
+ Native Linux CI uses an isolated X display and a window manager for modal focus.
93
+ Production credential access and protected-media acceptance have separate gates;
94
+ passing this matrix does not replace signed-package or intended-service acceptance.
95
+ The full native matrix passed on October 21, 2026. Production Widevine playback
96
+ passed on native Apple Silicon, Intel Mac and both Windows hosts with the final
97
+ public pins. Both final Mac downloads also pass protected playback locally
98
+ (Intel through Rosetta).
99
+
100
+ ## Local performance observation
101
+
102
+ On October 22, 2026, a macOS arm64 fixture animated a 2000 × 1400 canvas in a
103
+ 1000 × 700 CSS viewport at device scale 2. Two native windows shared that page
104
+ while two Browser live-view connections used the shared stream for ten minutes.
105
+ Animation callbacks remained at 60/s and each stream delivered 59.1 frames/s.
106
+ The p95 callback interval was 18.6 ms. Synthetic CDP clicks through two animation
107
+ callbacks took 74.0 ms at the 95th percentile. Aggregate runtime RSS moved from
108
+ 543 to 451 MiB, with a sampled peak of 561 MiB.
109
+
110
+ The predeclared budgets were at least 50 animation callbacks/s, at least
111
+ 20 frames/s per stream, p95 callback intervals below 35 ms, p95 synthetic input
112
+ below 100 ms and RSS growth below 128 MiB. All passed. This measures a ten-minute
113
+ synthetic workload with the production Apple Silicon engine, not physical display
114
+ presentation, OS input-to-photon latency or remote network latency.
115
+
116
+ ## Remaining release gates
117
+
118
+ 1. Repeat package, lifecycle and credential-store journeys on supported OS/CPU
119
+ combinations; downloaded and verified archives alone do not certify a platform.
120
+ 2. Complete IME composition and external file drag/drop on macOS, and the full
121
+ OS accessibility, clipboard, drag/drop and focus checks on Windows and Linux.
122
+ The manual Mac result above covers basic interaction. The local computer-use
123
+ service lists apps but times out inspecting native windows.
124
+ 3. Measure OS input-to-photon latency; the ten-minute local resource soak with
125
+ multiple native windows and remote streams above passes.
126
+ 4. Verify protected playback on the intended services. EVS enrollment and production
127
+ Widevine validation are complete for Mac and Windows. Both final Mac engine
128
+ archives are notarized and pass Gatekeeper after extraction. Both public
129
+ downloads are pinned and pass actual production playback locally and on their
130
+ native CI hosts. Final package qualification remains pending.
131
+ 5. Validate the exact CI-signed candidate archives before promotion. The production
132
+ identity is provisioned in Browser CI; local signed-helper execution passes.
133
+
134
+ Blank-iframe text prompts remain unsupported because Electron skips their
135
+ preload. A page can be presented once per native window; separate windows share
136
+ its view on focus. Neither limit is hidden by creating another website renderer.
137
+ Manual and intended-service acceptance remain required before claiming complete
138
+ native qualification, independently of managed candidate publication.