dsh-builtin-browser 0.5.8 → 1.0.1

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 (401) hide show
  1. package/CHANGELOG.md +410 -1
  2. package/README.en.md +16 -64
  3. package/README.md +33 -64
  4. package/assets/browser-carriers.svg +20 -0
  5. package/assets/browser-extension-identity.d.mts +2 -0
  6. package/assets/browser-extension-identity.mjs +2 -0
  7. package/assets/browser-messages.d.mts +5 -0
  8. package/assets/browser-messages.mjs +64 -0
  9. package/assets/browser-panel-locales.d.mts +2 -0
  10. package/assets/browser-panel-locales.mjs +380 -0
  11. package/assets/browser-policy.d.mts +37 -0
  12. package/assets/browser-policy.mjs +37 -0
  13. package/assets/browser-products.d.mts +6 -0
  14. package/assets/browser-products.mjs +76 -0
  15. package/assets/screenshots/1-main.png +0 -0
  16. package/assets/screenshots/2-form-fill.png +0 -0
  17. package/assets/screenshots/3-challenge.png +0 -0
  18. package/browser-extension/constants.mjs +20 -0
  19. package/browser-extension/controller.mjs +293 -0
  20. package/browser-extension/locales.mjs +15 -0
  21. package/browser-extension/manifest.json +12 -0
  22. package/browser-extension/options.html +14 -0
  23. package/browser-extension/options.mjs +9 -0
  24. package/browser-extension/permission-guard.mjs +13 -0
  25. package/browser-extension/worker.mjs +74 -0
  26. package/cordis.patch.yml +23 -48
  27. package/desktop-bridge/desktop-discovery.d.mts +2 -0
  28. package/desktop-bridge/desktop-discovery.mjs +36 -0
  29. package/desktop-bridge/desktop-identity.json +17 -1
  30. package/desktop-bridge/desktop-processes.d.mts +1 -0
  31. package/desktop-bridge/desktop-processes.mjs +15 -0
  32. package/desktop-bridge/guest-proxy.mjs +109 -0
  33. package/desktop-bridge/install.mjs +197 -74
  34. package/desktop-bridge/main.mjs +11 -0
  35. package/desktop-bridge/maintenance-files.d.mts +8 -0
  36. package/desktop-bridge/maintenance-files.mjs +28 -0
  37. package/desktop-bridge/maintenance-progress.ps1 +2 -2
  38. package/desktop-bridge/native-guests.mjs +41 -0
  39. package/desktop-bridge/plugin-browser-bridge.js +618 -370
  40. package/desktop-bridge/profile-loader.mjs +26 -0
  41. package/dist/client.cjs +43167 -0
  42. package/dist/client.d.cts +516 -0
  43. package/dist/client.d.mts +516 -0
  44. package/dist/index.cjs +92 -0
  45. package/dist/index.d.mts +2960 -0
  46. package/dist/index.mjs +24 -0
  47. package/docs/HANDOVER-2026-11-15.md +178 -0
  48. package/docs/README.md +10 -19
  49. package/docs/architecture.md +17 -145
  50. package/docs/child-tabs.md +13 -0
  51. package/docs/desktop-acceptance.md +9 -0
  52. package/docs/development.md +88 -18
  53. package/docs/extension-browser.md +44 -0
  54. package/docs/hardcoding-audit.md +64 -0
  55. package/docs/limitations.md +23 -73
  56. package/docs/pr64-extension-status.md +46 -0
  57. package/docs/pr64-maintenance.md +25 -0
  58. package/docs/pr64-native-children.md +52 -0
  59. package/docs/pr64-native-views.md +60 -0
  60. package/docs/tool-reference.md +87 -11
  61. package/docs/user-guide.md +47 -255
  62. package/docs/why-browser.md +6 -39
  63. package/dsh-host-patch/README.md +60 -0
  64. package/dsh-host-patch/apply.mjs +194 -0
  65. package/dsh-host-patch/legacy-bridge.mjs +53 -0
  66. package/dsh-host-patch/rc3-revision1.json +90 -0
  67. package/dsh-host-patch/rc3-revision2.json +112 -0
  68. package/dsh-host-patch/rc3-revision3.json.gz +0 -0
  69. package/dsh-host-patch/rc3-revision4.json.gz +0 -0
  70. package/dsh-host-patch/rc3-revision5.json.gz +0 -0
  71. package/dsh-host-patch/rc3-revision6.json.gz +0 -0
  72. package/dsh-host-patch/rc3-revision7.json.gz +0 -0
  73. package/dsh-host-patch/rc3-revision8.json.gz +0 -0
  74. package/dsh-host-patch/rc3.json +148 -0
  75. package/dsh-host-patch/rc5-revision1.json +90 -0
  76. package/dsh-host-patch/rc5-revision2.json +112 -0
  77. package/dsh-host-patch/rc5-revision3.json.gz +0 -0
  78. package/dsh-host-patch/rc5-revision4.json.gz +0 -0
  79. package/dsh-host-patch/rc5-revision5.json.gz +0 -0
  80. package/dsh-host-patch/rc5-revision6.json.gz +0 -0
  81. package/dsh-host-patch/rc5-revision7.json.gz +0 -0
  82. package/dsh-host-patch/rc5-revision8.json.gz +0 -0
  83. package/dsh-host-patch/rc5.json +148 -0
  84. package/lib/bridge-compatibility.js +38 -0
  85. package/lib/browser/handles.js +78 -0
  86. package/lib/browser/runtime.js +155 -43
  87. package/lib/browser/takeover-target.js +24 -0
  88. package/lib/browser-electron/authenticated-route.js +23 -0
  89. package/lib/browser-electron/automatic-maintenance.js +394 -51
  90. package/lib/browser-electron/bridge-auto.js +2 -1
  91. package/lib/browser-electron/bridge-connection.js +8 -1
  92. package/lib/browser-electron/bridge-install.js +27 -2
  93. package/lib/browser-electron/bridge-maintenance.js +35 -10
  94. package/lib/browser-electron/bridge-status.js +98 -27
  95. package/lib/browser-electron/desktop-bridge-host.js +193 -560
  96. package/lib/browser-electron/desktop-identity.js +40 -2
  97. package/lib/browser-electron/document-readiness.js +34 -0
  98. package/lib/browser-electron/electron-provision.js +14 -44
  99. package/lib/browser-electron/entry.js +659 -252
  100. package/lib/browser-electron/extension-browser.js +234 -0
  101. package/lib/browser-electron/extension-setup.js +69 -0
  102. package/lib/browser-electron/guest-cookie-jar.LICENSE.txt +32 -0
  103. package/lib/browser-electron/guest-cookie-jar.js +10559 -0
  104. package/lib/browser-electron/guest-cookie-store.js +74 -0
  105. package/lib/browser-electron/guest-css-runtime.js +75 -0
  106. package/lib/browser-electron/guest-css.js +106 -0
  107. package/lib/browser-electron/guest-route.js +603 -0
  108. package/lib/browser-electron/guest-runtime.js +356 -0
  109. package/lib/browser-electron/guest-storage-runtime.js +52 -0
  110. package/lib/browser-electron/guest-storage.js +163 -0
  111. package/lib/browser-electron/history-store.js +2 -1
  112. package/lib/browser-electron/host-main.js +162 -7
  113. package/lib/browser-electron/host-patch-maintenance.js +141 -0
  114. package/lib/browser-electron/http-body.js +22 -0
  115. package/lib/browser-electron/maintenance-broker.js +35 -5
  116. package/lib/browser-electron/maintenance-lifecycle.js +7 -5
  117. package/lib/browser-electron/maintenance-route.js +9 -6
  118. package/lib/browser-electron/open-slot.js +47 -0
  119. package/lib/browser-electron/paths.js +4 -1
  120. package/lib/browser-electron/preferred-browser.js +144 -0
  121. package/lib/browser-electron/preview-route.js +11 -8
  122. package/lib/browser-electron/process-ownership.js +198 -0
  123. package/lib/browser-electron/profile-checkpoint.js +222 -0
  124. package/lib/browser-electron/profile-command.js +60 -0
  125. package/lib/browser-electron/profile-extension.js +126 -0
  126. package/lib/browser-electron/profile-lease.js +157 -0
  127. package/lib/browser-electron/profile-residue.js +61 -0
  128. package/lib/browser-electron/provider.js +719 -262
  129. package/lib/browser-electron/reference-route.js +635 -0
  130. package/lib/browser-electron/remote-host.js +12 -13
  131. package/lib/browser-electron/runtime-route.js +6 -5
  132. package/lib/browser-electron/runtime-status.js +30 -29
  133. package/lib/browser-electron/settings-store.js +10 -5
  134. package/lib/browser-electron/shortcuts-route.js +108 -0
  135. package/lib/browser-electron/sidebar-only-host.js +119 -18
  136. package/lib/browser-electron/startpage-shortcuts.js +172 -0
  137. package/lib/browser-electron/system-browser.js +352 -371
  138. package/lib/browser-electron/windows-system.js +2 -1
  139. package/lib/browser-reference/delivery.js +326 -0
  140. package/lib/browser-reference/entry.js +597 -0
  141. package/lib/browser-reference/export.js +298 -0
  142. package/lib/browser-reference/import.js +295 -0
  143. package/lib/browser-reference/page-script.js +1406 -0
  144. package/lib/browser-reference/service.js +1062 -0
  145. package/lib/browser-reference/store.js +177 -0
  146. package/lib/browser-reference/submission-receipts.js +139 -0
  147. package/lib/browser-reference/text-quote.js +167 -0
  148. package/lib/browser-reference/types.js +11 -0
  149. package/lib/browser-reference/visible.js +311 -0
  150. package/lib/browser-reference/web-sources.js +97 -0
  151. package/lib/index.js +10 -3
  152. package/lib/reference-owner.js +5 -0
  153. package/lib/reference-page.js +12 -0
  154. package/lib/reference-source.js +2 -0
  155. package/lib/reference-text.js +188 -0
  156. package/lib/startpage-settings.js +63 -0
  157. package/lib/startpage.js +44 -0
  158. package/lib/takeover-protocol.js +2 -0
  159. package/lib/tool-browser/code-tool.js +416 -0
  160. package/lib/tool-browser/code-worker.js +872 -0
  161. package/lib/tool-browser/index.js +940 -76
  162. package/lib/tool-browser/page-probe.js +3 -3
  163. package/lib/tool-browser/panel-page.js +95 -0
  164. package/lib/tool-browser/screenshot-image.js +51 -0
  165. package/lib/tool-browser/takeover.js +205 -0
  166. package/lib/types.js +1 -0
  167. package/lib/web-guest.js +26 -0
  168. package/native-host/client.d.mts +17 -0
  169. package/native-host/client.mjs +100 -0
  170. package/native-host/host.mjs +150 -0
  171. package/native-host/identity.d.mts +2 -0
  172. package/native-host/identity.mjs +1 -0
  173. package/native-host/install.mjs +168 -0
  174. package/native-host/protocol.mjs +75 -0
  175. package/package.json +80 -92
  176. package/scripts/build.mjs +66 -0
  177. package/scripts/bundle-host.mjs +28 -0
  178. package/scripts/fix-exports.mjs +50 -0
  179. package/scripts/install-electron.mjs +11 -26
  180. package/scripts/verify-exports.mjs +47 -0
  181. package/scripts/verify-preview-sdk.mjs +93 -0
  182. package/skills/dsh-builtin-browser/SKILL.md +56 -47
  183. package/skills/dsh-builtin-browser/references/batch.md +31 -1
  184. package/skills/dsh-debug-host/SKILL.md +56 -0
  185. package/skills/dsh-debug-self/SKILL.md +50 -0
  186. package/src/bridge-compatibility.ts +39 -0
  187. package/src/browser/handles.ts +89 -0
  188. package/src/browser/runtime.ts +146 -50
  189. package/src/browser/takeover-target.ts +36 -0
  190. package/src/browser/types.ts +19 -7
  191. package/src/browser-electron/authenticated-route.ts +29 -1
  192. package/src/browser-electron/automatic-maintenance.ts +368 -56
  193. package/src/browser-electron/bridge-auto.ts +5 -4
  194. package/src/browser-electron/bridge-connection.ts +20 -2
  195. package/src/browser-electron/bridge-endpoint.ts +3 -3
  196. package/src/browser-electron/bridge-install.ts +40 -4
  197. package/src/browser-electron/bridge-maintenance.ts +42 -14
  198. package/src/browser-electron/bridge-status.ts +94 -23
  199. package/src/browser-electron/desktop-bridge-host.ts +185 -585
  200. package/src/browser-electron/desktop-identity.ts +53 -2
  201. package/src/browser-electron/document-readiness.ts +45 -0
  202. package/src/browser-electron/electron-provision.ts +12 -45
  203. package/src/browser-electron/entry.ts +1299 -882
  204. package/src/browser-electron/ephemeral-profile.ts +1 -1
  205. package/src/browser-electron/extension-browser.ts +223 -0
  206. package/src/browser-electron/extension-setup.ts +67 -0
  207. package/src/browser-electron/guest-cookie-jar.ts +176 -0
  208. package/src/browser-electron/guest-cookie-store.ts +59 -0
  209. package/src/browser-electron/guest-css-runtime.ts +76 -0
  210. package/src/browser-electron/guest-css.ts +68 -0
  211. package/src/browser-electron/guest-route.ts +568 -0
  212. package/src/browser-electron/guest-runtime.ts +357 -0
  213. package/src/browser-electron/guest-storage-runtime.ts +54 -0
  214. package/src/browser-electron/guest-storage.ts +117 -0
  215. package/src/browser-electron/history-store.ts +5 -4
  216. package/src/browser-electron/host-main.ts +156 -11
  217. package/src/browser-electron/host-patch-maintenance.ts +112 -0
  218. package/src/browser-electron/http-body.ts +23 -0
  219. package/src/browser-electron/maintenance-broker.ts +29 -5
  220. package/src/browser-electron/maintenance-lifecycle.ts +14 -9
  221. package/src/browser-electron/maintenance-route.ts +17 -14
  222. package/src/browser-electron/missing-system-browser.ts +2 -2
  223. package/src/browser-electron/open-slot.ts +49 -0
  224. package/src/browser-electron/paths.ts +5 -1
  225. package/src/browser-electron/preferred-browser.ts +120 -0
  226. package/src/browser-electron/preview-route.ts +18 -11
  227. package/src/browser-electron/process-ownership.ts +168 -0
  228. package/src/browser-electron/profile-checkpoint.ts +187 -0
  229. package/src/browser-electron/profile-command.ts +46 -0
  230. package/src/browser-electron/profile-extension.ts +124 -0
  231. package/src/browser-electron/profile-lease.ts +115 -0
  232. package/src/browser-electron/profile-residue.ts +49 -0
  233. package/src/browser-electron/provider.ts +771 -289
  234. package/src/browser-electron/reference-route.ts +608 -0
  235. package/src/browser-electron/remote-host.ts +15 -15
  236. package/src/browser-electron/runtime-route.ts +11 -10
  237. package/src/browser-electron/runtime-status.ts +51 -32
  238. package/src/browser-electron/settings-store.ts +27 -7
  239. package/src/browser-electron/shortcuts-route.ts +112 -0
  240. package/src/browser-electron/sidebar-only-host.ts +118 -19
  241. package/src/browser-electron/startpage-shortcuts.ts +213 -0
  242. package/src/browser-electron/system-browser.ts +309 -338
  243. package/src/browser-electron/windows-system.ts +2 -1
  244. package/src/browser-reference/delivery.ts +384 -0
  245. package/src/browser-reference/entry.ts +631 -0
  246. package/src/browser-reference/export.ts +339 -0
  247. package/src/browser-reference/import.ts +303 -0
  248. package/src/browser-reference/page-script.ts +1537 -0
  249. package/src/browser-reference/service.ts +1315 -0
  250. package/src/browser-reference/store.ts +172 -0
  251. package/src/browser-reference/submission-receipts.ts +122 -0
  252. package/src/browser-reference/text-quote.ts +219 -0
  253. package/src/browser-reference/types.ts +195 -0
  254. package/src/browser-reference/visible.ts +367 -0
  255. package/src/browser-reference/web-sources.ts +103 -0
  256. package/src/client/browser/BrowserController.ts +693 -0
  257. package/src/client/browser/BrowserFrame.ts +78 -0
  258. package/src/client/browser/BrowserNavigation.ts +169 -0
  259. package/src/client/browser/BrowserPage.ts +23 -0
  260. package/src/client/browser/BrowserPersistence.ts +44 -0
  261. package/src/client/browser/IframeImpl.ts +176 -0
  262. package/src/client/browser/child-tabs.ts +14 -0
  263. package/src/client/browser/iframe-reference.ts +67 -0
  264. package/src/client/browser/initialization.ts +262 -0
  265. package/src/client/browser/omnibox.ts +243 -0
  266. package/src/client/browser/store.ts +38 -0
  267. package/src/client/browser/takeover-channel.ts +72 -0
  268. package/src/client/browser/url.ts +46 -0
  269. package/src/client/browser/web-reference-source.ts +52 -0
  270. package/src/client/css-modules.d.ts +4 -0
  271. package/src/client/definition.tsx +30 -0
  272. package/src/client/electron/ElectronWebViewImpl.ts +364 -0
  273. package/src/client/electron/ElectronWebviewPresentation.ts +138 -0
  274. package/src/client/electron/NativeChildPresentation.ts +45 -0
  275. package/src/client/electron/NativeViewPage.ts +251 -0
  276. package/src/client/electron/pages.ts +23 -0
  277. package/src/client/electron/reference-overlay.ts +53 -0
  278. package/src/client/electron/workspace.ts +33 -0
  279. package/src/client/index.ts +293 -0
  280. package/src/client/locales.ts +857 -0
  281. package/src/client/pages.ts +28 -0
  282. package/src/client/reference/client/BrowserRefLink.tsx +142 -0
  283. package/src/client/reference/client/draft-reference.ts +167 -0
  284. package/src/client/reference/client/index.ts +7 -0
  285. package/src/client/reference/client/ordered-submission.ts +108 -0
  286. package/src/client/reference/client/pending-delivery.ts +216 -0
  287. package/src/client/reference/client/plugin.ts +189 -0
  288. package/src/client/reference/client/production/ReferenceCapsules.tsx +345 -0
  289. package/src/client/reference/client/production/ReferenceDock.module.css +193 -0
  290. package/src/client/reference/client/production/ReferenceDock.tsx +6 -0
  291. package/src/client/reference/client/production/ReferenceFeedback.tsx +15 -0
  292. package/src/client/reference/client/production/ReferenceMath.tsx +44 -0
  293. package/src/client/reference/client/production/ReferenceText.tsx +36 -0
  294. package/src/client/reference/client/production/assembly.ts +471 -0
  295. package/src/client/reference/client/production/asset-store.ts +144 -0
  296. package/src/client/reference/client/production/availability.ts +74 -0
  297. package/src/client/reference/client/production/bytes.ts +36 -0
  298. package/src/client/reference/client/production/delivery-client.ts +211 -0
  299. package/src/client/reference/client/production/draft-adapter.ts +508 -0
  300. package/src/client/reference/client/production/http-transport.ts +217 -0
  301. package/src/client/reference/client/production/production-submission.ts +310 -0
  302. package/src/client/reference/client/production/protocol.ts +231 -0
  303. package/src/client/reference/client/production/reference-card.ts +240 -0
  304. package/src/client/reference/client/production/reference-labels.ts +29 -0
  305. package/src/client/reference/client/production/reply-link-bridge.ts +222 -0
  306. package/src/client/reference/client/production/reveal.ts +215 -0
  307. package/src/client/reference/client/production/runtime.ts +1101 -0
  308. package/src/client/reference/client/production/snapshot-adapter.ts +154 -0
  309. package/src/client/reference/client/production/source-marker.ts +63 -0
  310. package/src/client/reference/client/production/source-opener.ts +55 -0
  311. package/src/client/reference/client/production/styles.ts +104 -0
  312. package/src/client/reference/client/production/user-text-rule.ts +58 -0
  313. package/src/client/reference/client/reveal.ts +107 -0
  314. package/src/client/reference/client/scheme.ts +114 -0
  315. package/src/client/reference/client/types.ts +168 -0
  316. package/src/client/reference/css-modules.d.ts +4 -0
  317. package/src/client/reference/index.ts +11 -0
  318. package/src/client/reference-capture-owner.ts +162 -0
  319. package/src/client/reference-intents.ts +36 -0
  320. package/src/client/settings/index.ts +34 -0
  321. package/{client.js → src/client/settings/panel.ts} +2657 -2231
  322. package/src/client/shortcut-open.ts +30 -0
  323. package/src/client/startpage/binding.ts +99 -0
  324. package/src/client/startpage/controller.ts +303 -0
  325. package/src/client/startpage/model.ts +279 -0
  326. package/src/client/view/Browser.module.css +751 -0
  327. package/src/client/view/BrowserBody.tsx +314 -0
  328. package/src/client/view/BrowserPresentation.ts +9 -0
  329. package/src/client/view/BrowserTitle.tsx +17 -0
  330. package/src/client/view/IframePresentation.ts +344 -0
  331. package/src/client/view/StartPage.tsx +597 -0
  332. package/src/client/view/TakeoverBanner.tsx +21 -0
  333. package/src/index.ts +110 -73
  334. package/src/reference-owner.ts +5 -0
  335. package/src/reference-page.ts +9 -0
  336. package/src/reference-source.ts +3 -0
  337. package/src/reference-text.ts +197 -0
  338. package/src/startpage-settings.ts +103 -0
  339. package/src/startpage.ts +71 -0
  340. package/src/takeover-protocol.ts +19 -0
  341. package/src/tool-browser/code-tool.ts +401 -0
  342. package/src/tool-browser/code-worker.ts +639 -0
  343. package/src/tool-browser/index.ts +908 -77
  344. package/src/tool-browser/page-probe.ts +4 -4
  345. package/src/tool-browser/panel-page.ts +124 -0
  346. package/src/tool-browser/screenshot-image.ts +49 -0
  347. package/src/tool-browser/takeover.ts +198 -0
  348. package/src/types/electron-shim.d.ts +20 -0
  349. package/src/types.ts +85 -0
  350. package/src/web-guest.ts +34 -0
  351. package/tools/accept-desktop.mjs +148 -0
  352. package/lib/browser/runtime.d.ts +0 -175
  353. package/lib/browser/types.d.ts +0 -797
  354. package/lib/browser-electron/authenticated-route.d.ts +0 -27
  355. package/lib/browser-electron/automatic-maintenance.d.ts +0 -41
  356. package/lib/browser-electron/bridge-auto.d.ts +0 -93
  357. package/lib/browser-electron/bridge-connection.d.ts +0 -93
  358. package/lib/browser-electron/bridge-endpoint.d.ts +0 -30
  359. package/lib/browser-electron/bridge-install.d.ts +0 -85
  360. package/lib/browser-electron/bridge-maintenance.d.ts +0 -24
  361. package/lib/browser-electron/bridge-status.d.ts +0 -50
  362. package/lib/browser-electron/desktop-bridge-host.d.ts +0 -248
  363. package/lib/browser-electron/desktop-identity.d.ts +0 -58
  364. package/lib/browser-electron/electron-provision.d.ts +0 -92
  365. package/lib/browser-electron/entry.d.ts +0 -64
  366. package/lib/browser-electron/ephemeral-profile.d.ts +0 -37
  367. package/lib/browser-electron/file-write.d.ts +0 -2
  368. package/lib/browser-electron/history-store.d.ts +0 -98
  369. package/lib/browser-electron/host-main.d.ts +0 -26
  370. package/lib/browser-electron/http-body.d.ts +0 -24
  371. package/lib/browser-electron/json-reply.d.ts +0 -33
  372. package/lib/browser-electron/maintenance-broker.d.ts +0 -35
  373. package/lib/browser-electron/maintenance-lifecycle.d.ts +0 -32
  374. package/lib/browser-electron/maintenance-route.d.ts +0 -18
  375. package/lib/browser-electron/missing-system-browser.d.ts +0 -54
  376. package/lib/browser-electron/paths.d.ts +0 -4
  377. package/lib/browser-electron/preview-route.d.ts +0 -89
  378. package/lib/browser-electron/process.d.ts +0 -14
  379. package/lib/browser-electron/provider.d.ts +0 -959
  380. package/lib/browser-electron/remote-host.d.ts +0 -256
  381. package/lib/browser-electron/rpc-input.d.ts +0 -4
  382. package/lib/browser-electron/rpc-ops.d.ts +0 -18
  383. package/lib/browser-electron/runtime-diagnostics.d.ts +0 -12
  384. package/lib/browser-electron/runtime-route.d.ts +0 -55
  385. package/lib/browser-electron/runtime-status.d.ts +0 -116
  386. package/lib/browser-electron/settings-route.d.ts +0 -15
  387. package/lib/browser-electron/settings-store.d.ts +0 -224
  388. package/lib/browser-electron/sidebar-only-host.d.ts +0 -36
  389. package/lib/browser-electron/system-browser.d.ts +0 -367
  390. package/lib/browser-electron/timing.d.ts +0 -8
  391. package/lib/browser-electron/virtual-cursor.d.ts +0 -67
  392. package/lib/browser-electron/windows-system.d.ts +0 -3
  393. package/lib/index.d.ts +0 -30
  394. package/lib/tool-browser/element-fields.d.ts +0 -145
  395. package/lib/tool-browser/index.d.ts +0 -53
  396. package/lib/tool-browser/page-probe.d.ts +0 -86
  397. package/scripts/consumer-install-check.mjs +0 -72
  398. package/scripts/run-tests.mjs +0 -32
  399. package/scripts/verify-host-compat.mjs +0 -195
  400. package/scripts/verify-preview-route.mjs +0 -168
  401. package/scripts/verify-runtime-status.mjs +0 -179
@@ -0,0 +1,44 @@
1
+ # Browser extension and automatic CDP fallback
2
+
3
+ The plugin needs no token pairing or manual native-host configuration. On startup it registers the Edge and Chrome native hosts asynchronously for the current OS user. Registration results appear in `nativeHostRegistration` in runtime status, even in sidebar/plugin modes; failures are also shown in Settings and never prevent plugin loading.
4
+
5
+ ## Modes
6
+
7
+ - Defaults are unchanged. `systemProfile: plugin` uses DSH's separate, persistent managed browser profile.
8
+ - With channel `edge` or `chrome`, `systemProfile: user` means **prefer my browser if available**. The first operation of each new browser session waits at most 2.5 seconds for the extension. Otherwise it uses managed CDP with a **DSH-owned profile**, never personal-profile CDP.
9
+ - A live CDP session stays on CDP, including its additional tabs. If the extension connects later, the next new session can use it. Status reports the most recently selected carrier, controlled profile and fallback reason. The fallback is still the plugin profile even if the personal browser has different logins.
10
+ - Cleanup retains PID/creation/executable/exact-profile verification. Extension cleanup only detaches; only explicit close can close an agent-owned tab. Personal tabs/windows are never closed by cleanup.
11
+
12
+ ## Optional extension
13
+
14
+ Click **一键安装扩展 / Install extension** in Settings, next to the bridge reinstall button. Web and Desktop use the same authenticated, same-origin POST route: `/dsh-builtin-browser/extension/install`.
15
+
16
+ The button registers both native hosts immediately. If already connected, it reports **已连接** without opening anything. Otherwise it opens the chosen browser's extensions page and reveals the bundled folder in Explorer/Finder (or the Linux file manager): **点「加载解压缩的扩展」并选择已打开的文件夹**. Enable Developer mode if the browser requires it. Browser policies may prohibit unpacked extensions; CDP fallback still works. Loading an extension cannot legitimately be silently bypassed by a plugin. No terminal commands, copied IDs, tokens or configuration are needed.
17
+
18
+ The fixed manifest public key gives ID **`ljobhenplklfnkbmhamljjnpgalgcjgc`** independent of folder location. Only a public key is shipped. `assets/browser-extension-identity.mjs` exports the shared ID and the currently empty `EXTENSION_STORE_URL`; setting the latter makes the button open the store instead of the extensions page/folder.
19
+
20
+ The worker connects at installation, startup and boot, with reconnect alarms. Options is status + Disconnect only. Options Disconnect pauses reconnection without closing tabs; remove and add the extension again to clear that pause. Canceling the debugging infobar invalidates the affected tab lease and reports detachment, without automatically reattaching it. A new explicit acquisition is required. Native-host `--revoke` persists a disabled flag; automatic registration never clears it.
21
+
22
+ ## Debugger ownership and lifecycle
23
+
24
+ One controller serializes requests and holds at most one physical debugger attachment. Switching between tasks detaches the previous tab before attaching the requested tab; logical leases remain valid and resume on their next request. Screenshots and takeover use this same owner, not additional debugger clients. Suspended tabs do not receive debugger dialog/file-chooser interception until resumed.
25
+
26
+ After 30 seconds without a completed request, a browser alarm detaches the debugger while retaining logical leases. The named policy is `DEBUGGER_IDLE_TIMEOUT_MS` in `browser-extension/constants.mjs`. Session/task cleanup awaits scoped detach through both the direct and preferred carriers. Native/plugin transport disconnect releases every lease and detaches the physical debugger; cleanup never closes personal or agent tabs.
27
+
28
+ Leases, agent-tab ownership and the active tab are stored in `chrome.storage.session`. On worker restart, `chrome.debugger.getTargets()` reconciles surviving attachments: a still-live recorded attachment is reused, expired/unrecorded owned attachments are detached, and foreign debuggers are left alone. Ownership of an attached target is checked with a debugger command, because `getTargets().attached` alone does not identify the attaching extension. No tab is attached automatically during reconciliation.
29
+
30
+ This bounds this extension's attachments, not Edge's warning UI. Chromium groups warnings by extension ID rather than simply showing one per attached tab; Edge-specific behavior and duplicate installations require separate diagnosis. Do not treat these lifecycle guarantees as proof that the reported two-warning issue is resolved.
31
+
32
+ ## Native host and security
33
+
34
+ State lives at `DSH_HOME/dsh-builtin-browser-host/extension/<browser>` (default `~/.dsh`). Windows uses HKCU; macOS/Linux use per-user NativeMessagingHosts locations. Windows hardening writes and verifies only the DACL, not owner or SACL. Registration remains fail-closed on ACL errors.
35
+
36
+ Identical launchers are not rebuilt or overwritten while running. Windows launchers are source-versioned; changed versions are compiled to a temporary file and published atomically, then the manifest is swapped. A running older executable is never unlinked or killed. Old versions may remain in the private host directory.
37
+
38
+ For the bundled ID, the browser-enforced native-host `allowed_origins` plus the exact native caller origin replace pairing. Any profile where the bundled extension is enabled may connect; it is no longer pinned to a manually paired profile. Untrusted origins and disabled configurations are rejected. The plugin-to-host channel retains mutual challenge authentication, fresh epochs, authentication/request timeouts, bounded framing/chunks and no command replay. This does not protect against malware already executing as the same OS user. Legacy explicitly configured custom IDs retain their old token flow; automatic setup always migrates to the bundled ID.
39
+
40
+ ## Quiet mode and acceptance
41
+
42
+ DSH agent operations do not activate tabs/windows or move the OS mouse. Tabs are inactive; screenshots and input use `chrome.debugger` CDP. Opener-scoped popups, JS dialogs and permissions are contained where browser APIs permit. Debugging infobars, downloads and browser/site-owned UI remain exceptions. The explicit install button deliberately opens only the requested browser page and folder, outside an agent quiet-mode run.
43
+
44
+ On Windows test as a normal, non-admin user: install/start DSH with Edge open; verify both HKCU manifests use the fixed ID, then click the button and load the folder. Verify automatic connection without Options/token entry. Click again and require **已连接**, no opened page/folder. Restart while Edge's native launcher is running; require successful idempotent registration. Check extension snapshot/input/background screenshot/reference/takeover, then disconnect and start a new session: require `resolvedCarrier: cdp`, `controlledProfile: plugin`, and a fallback reason. Reconnect and start another session: require extension/user, with the older CDP session unchanged. Revoke and restart: disabled must persist. Throughout cleanup, original personal browser processes/windows/tabs must survive; measure foreground window and cursor before/after agent work (excluding the install button) and require no changes.
@@ -0,0 +1,64 @@
1
+ # Hardcoding audit
2
+
3
+ ## Shared ownership
4
+
5
+ - `assets/browser-policy.mjs`: profile directory, loopback endpoint construction,
6
+ URL parsing base, client/server HTTP routes, default operation and extension
7
+ setup budgets, extension pages and platform folder openers.
8
+ - `assets/browser-products.mjs`: browser detection catalog, native-messaging
9
+ registration product names, personal-profile roots and Windows command names.
10
+ Detection still checks the caller's environment and PATH before catalog paths.
11
+ - `browser-extension/constants.mjs`: host naming, frame/chunk/message bounds,
12
+ concurrency, authentication/operation budgets, legacy pairing expiry, reconnect
13
+ policy, file names and controller limits. Both extension and native host use it.
14
+ - `assets/browser-panel-locales.mjs`, `assets/browser-messages.mjs`, and
15
+ `browser-extension/locales.mjs`: settings, fallback, capture, guest error and
16
+ extension-page copy. English native status and Chinese/English panel fallback
17
+ descriptions share the same messages.
18
+ - Existing `paths.ts` remains the DSH_HOME/host-home authority. Removed the unused
19
+ machine-specific settings-path function in `entry.ts`; live settings discovery
20
+ already uses the settings store. Windows process inspection now uses the existing
21
+ system-directory resolver rather than assuming `C:\Windows`.
22
+ - Search shortcuts derive their initial search-engine entries from the existing
23
+ configurable engine catalog. Provider operation budgets have named policies.
24
+
25
+ ## Intentionally retained
26
+
27
+ - CDP methods, HTTP status codes, URL schemes, native-messaging wire fields,
28
+ cryptographic sizes and security address allowlists are protocol/security
29
+ constants, not deployment configuration.
30
+ - Existing named domain policies (`DEFAULTS`, store bounds, rendering styles,
31
+ algorithmic limits), editable start-page defaults, and browser catalog paths stay
32
+ with their owner. Making all equal numeric literals share a setting would couple
33
+ unrelated operations and change their meaning.
34
+ - The stable extension ID remains a single exported constant in
35
+ `assets/browser-extension-identity.mjs`; the derivation regression verifies it
36
+ against the manifest's public key. No private key is needed or shipped.
37
+ - Stderr is intentionally drained to `Stream.Null` with `CopyTo`; it is not a
38
+ framed relay. The Windows launcher's stdin and stdout both flush every chunk.
39
+
40
+ ## Remaining audit work
41
+
42
+ This pass does not claim every literal in the plugin has been eliminated. Remaining
43
+ inline policies include bridge install/restart deadlines, takeover/source polling
44
+ intervals, and guest/host UI timing and size thresholds. Some embedded toolbar and
45
+ page-script labels and technical error strings still live with their generators;
46
+ moving those safely requires preserving serialized-script scope and locale input.
47
+
48
+ ### `src/tool-browser/index.ts` — PR #66, deliberately not edited
49
+
50
+ - `localSettingsPath()` still adds `D:/dsh-home/dsh-builtin-browser-host/settings.json`.
51
+ - Tool help includes the example host `http://127.0.0.1:3080/`.
52
+ - Tool timeout default, wait-budget reserve/minimum, fill-field cap and per-tool
53
+ timeout/limit help remain inline; they should use the relevant domain policy.
54
+ - Tool descriptions and result annotations remain English literals.
55
+ - Settings/open-request/reference endpoint strings should import their canonical
56
+ contract rather than duplicate paths. Coordinate this with the PR #66 owner.
57
+
58
+ ## Windows launcher regression
59
+
60
+ `launcherSource()` generates the C# relay, and its complete source still determines
61
+ the published executable hash. A small hello can now reach the child and its status
62
+ can reach the extension without closing stdin. Tests assert the per-read
63
+ write/flush loop and both relay directions. A Windows-only test installs the real
64
+ launcher and requires a status within two seconds with stdin open; Linux skips it.
@@ -1,21 +1,29 @@
1
- # 已知限制
1
+ # 兼容性与边界
2
2
 
3
- 这些是本插件**有意接受**或**受宿主约束**的边界。它们不是待办事项:写在这里是因为"知道为什么"能省掉一次排查。
3
+ ## 宿主与安装
4
4
 
5
- ## 截图
5
+ - **Desktop:** Windows 和 macOS 提供设置内桥接维护。可用功能取决于宿主公开的接口及桥接状态。宿主补丁按 DSH **0.2.2-rc.3 / rc.5** 的受支持构建校验,不承诺同版本号的任意产物都能应用;rc.5 Desktop 的补丁基线来自源码构建,不代表已验证所有分发包。遇到无法识别的文件、备份或冲突修改时会拒绝,而不是强行安装。
6
+ - **Web:** 有手动浏览和引用,没有 Desktop CDP、原生视图及 opener 语义。Web 宿主补丁不把 iframe 升级成原生浏览器。
7
+ - **无独立回退:** 默认和旧的 `bundled` / `auto` 值都只使用侧栏。不存在自动下载 Electron 或自动选择外部浏览器的路径。
8
+ - **原生子标签:** 有协议支持的 Desktop 将真正的浏览器子页放在同一侧栏。Web 和仅有 URL 通知的旧宿主只支持不依赖 opener 的子标签;不伪造窗口句柄,也不会用覆盖原标签冒充新标签。见[子标签契约](child-tabs.md)。
9
+ - **安静模式:** 插件的操作不抢系统焦点或移动系统鼠标。浏览器的调试提示条、权限提示、下载提示等不受插件控制。
10
+
11
+ ## Web 隔离与站点兼容性
6
12
 
7
- - JPEG 在**自托管**与**本机 Chrome / Edge** 上可用;**桌面端侧栏**走外壳的 `webContents.debugger`,其 Electron 的 CDP JPEG 编码会挂起,因此该载体下请求 JPEG 会返回 PNG。
8
- - 降采样(`maxWidth`/`maxHeight`)**三种载体都支持**(经 CDP `clip.scale`,或自托管走原生 `capturePage`)。
9
- - 自托管截图优先走 Electron 原生 `capturePage`(CDP `captureScreenshot` 在多视图下会挂起);截图前自动把目标标签置顶 —— 除非开启**安静模式**,那时不碰窗口(见下)。
10
- - `fullPage` 在部分主机的**软件合成**下不稳定 —— 请求 `fullPage` 时**原生 `capturePage` 路径被整体跳过**(它没有捕获滚动区以外内容的能力),因此**三种载体都走 CDP 的 `captureBeyondViewport`**。也就是说 `fullPage` 的不稳定性与载体无关,任何载体都可能碰到;只有视口截图才优先走原生路径。
13
+ 网页和嵌套 iframe 是 opaque-origin guest,禁止访问 DSH 应用的存储、Cookie 或已认证 API。代理保留上游站点所需的会话状态,但这不能替代所有浏览器 API。依赖跨窗口登录、第三方存储、worker 或其它受限能力的页面可能需要 Desktop 原生侧栏或本机浏览器。
11
14
 
12
- ## 验证与登录
15
+ 嵌套文档仍受响应沙箱约束。由于 opaque-origin 祖先无法匹配 CSP 的同源条件,guest 路由不使用 `frame-ancestors` 来禁止所有外部嵌入;隔离边界不是防点击劫持保证。
13
16
 
14
- - 人机验证(CAPTCHA)无法自动解决:快照会标注检测到的挑战,此时应请用户在共享窗口中人工完成,而不是反复重试。
15
- - `dsh_browser_auth` 的 cookie 往返**不保留** `hostOnly`/`sameSite` 字段(host-only cookie 恢复后变成 domain cookie)。
16
- - `flush` **只导出当前页所属站点的 cookie**,不是整台机器的共享 cookie 罐 —— 范围按本会话所在页面的 URL 收敛;页面没有可用 URL 时**直接拒绝**,而不是扩大范围去读全部域(自托管侧栏载体报"无法确定 cookie 范围",CDP 载体报 `BROWSER_AUTH_SCOPE_UNKNOWN`)。
17
- - `dsh_browser_restrict` 的白名单**也管着 `dsh_browser_auth`**,因为 `restore` 是向任意域写 cookie 的动作,不是观察。
18
- - 自托管浏览器的 cookie 在磁盘上**以明文存储**(Electron 默认行为);需要加密落盘的部署应在宿主层接入系统钥匙串 / DPAPI。
17
+ ## 登录态与接管
18
+
19
+ - Desktop 原生侧栏和 Web 代理各自在 `DSH_HOME` 下保存站点登录状态。归同一个 DSH 实例的侧栏共享站点登录,不按任务分开;Desktop 和 Web 不互相导入。已保存的会话 Cookie 不人为添加过期时间,主动退出和到期仍生效。不要共享或上传状态目录。
20
+ - 本机 Chrome / Edge 的独立配置不等于用户的个人配置。只有可用的个人浏览器扩展可以复用后者;回退的 CDP 会话没有个人浏览器的登录态。
21
+ - 持久会话不是 `dsh_browser_auth` 的导入/导出;该工具还受独立的读写权限和当前站点范围限制。URL 不明时拒绝导出,不扩大范围。
22
+ - CAPTCHA、滑块、登录和其它敏感确认由人工接管。插件不会绕过站点验证或重新提交敏感动作。
23
+
24
+ ## 截图
25
+
26
+ 截图和尺寸设置取决于所选载体。桌面侧栏请求 JPEG 时可能得到 PNG;读取返回的媒体类型。整页截图在部分软件合成环境下可能失败,必要时改用视口截图。只读远程预览不是 Web guest 的 CDP 截图接口。
19
27
 
20
28
  ## 权限与门控
21
29
 
@@ -30,64 +38,6 @@
30
38
  - 单文件上限 **256MB**(流式限流,按 Content-Length 提前拒绝),文件由浏览器子进程直接落盘。下载与截图使用独占的随机临时文件,不会覆盖既有 `.part` 或最终文件;支持硬链接的文件系统原子提交,不支持时用独占复制提交,该回退在进程崩溃时可能留下未完成的新文件。
31
39
  - 准入还会解析路径的**真实归属**:`downloadDir` 里的符号链接无法把写入带出目录,悬空链接同样被拒(它读作"名字已被占用",而不是"路径空闲")。
32
40
 
33
- ## 载体行为
34
-
35
- - **本机 Chrome / Edge 载体**在无显示环境会自动改用 headless。`browser.headless` 仅作用于这个载体:默认 `auto` 是"有显示开窗口,没显示走 headless"。使用 systemd、容器或 SSH 服务器时,应选择已安装的 Chrome / Edge;默认内置 Electron 和桌面侧栏没有接入此设置,不能据此保证无显示启动。修改后重新选择载体或重启 DSH 生效。
36
-
37
- 想显式控制时:
38
-
39
- | 设置 | 行为 |
40
- | --- | --- |
41
- | `"auto"`(默认) | 有显示 → 窗口;无显示 → headless |
42
- | `"headless"` | 强制 headless(服务器 / 截图专用 / CI) |
43
- | `"windowed"` | 强制窗口;显示不可用时**直接报错**,而不是悄悄退化 |
44
-
45
- 手写 `true` / `false` 也接受,分别等价于 `headless` / `windowed`。运行中的部署可以用环境变量覆盖设置,不必改文件:`DSH_BROWSER_HEADLESS=1` 强制 headless,`=0` 强制窗口(环境变量优先于设置项)。
46
-
47
- headless 启动会自动带上 `--disable-gpu` 与 `--disable-dev-shm-usage`;`--no-sandbox` **只在必要时**加(以 root 运行,或在容器内),并且会在 stderr 明确写出——降低进程隔离这件事必须让人能看见并反对。
48
-
49
- - **侧栏载体有前置条件**,不是装上 bridge 就成立。官方侧栏浏览器面板只在**外壳同时满足**两个条件时才是 `<webview>`:
50
- 1. `preload` 暴露 `dshDesktop.browser`(而不只是 `protocolVersion`);
51
- 2. 外壳窗口开启 `webviewTag`。
52
-
53
- **两个条件缺任一个,面板就是 `<iframe>`** —— 没有 webContents、没有 `getWebContentsId()`、没有 CDP 端点,而本插件的全部工具都建立在 CDP 之上。**DSH Desktop 2.0.17 两者皆无**(`lib/preload.cjs` 只暴露 `protocolVersion`;窗口设置里 `webviewTag: false`),所以那个版本上的侧栏面板不可驱动。
54
-
55
- 插件从 0.4.10 起**在接管之前先读面板形态**(面板自己带的 `data-sidebar-browser-frame` 属性),判到 `iframe` 就不接管,直接用自托管载体,并在日志里说明原因。**结果是"能用但多一个窗口",而不是"装完就坏"。**
56
-
57
- 0.4.16 适配 rc.5 的嵌套会话标记和无 React fiber 的 webview。列页和关闭仍须能确认请求会话与 tab 身份;归属缺失、身份冲突或未知宿主结构会明确拒绝。**插件更新不会更新外壳或外壳内的 bridge**,使用侧栏需另行备份并重装新版 bridge。
58
-
59
- - **侧栏载体不上报"用户操作"事件**:人在那个页面里点击是外壳自己的事件,而 bridge 没有用于回报它的操作。因此依赖该事件的功能(如自定义的接管提示)在桌面端侧栏下不会触发;换到自托管载体则可以。
60
- - **本机 Chrome / Edge 载体使用插件自己的 profile**:插件用它自己的用户数据目录启动浏览器(`$DSH_HOME/dsh-builtin-browser-host/<chrome|edge>-profile`),所以你日常浏览器里的书签、扩展与登录态**不会自动继承** —— 这是刻意的,避免插件操作与你的个人会话混在一起;登录态是否跨重启保留由 `cookies.persist` 决定。
61
- - 页面弹窗(`window.open` / `target=_blank`)不再覆盖当前视图:HTTP(S) 弹窗会在同一会话窗口**新开一个标签页**并计入历史,原页面与 opener 上下文保留;非 HTTP(S) 弹窗(空 URL 弹窗承接、`mailto:`、自定义协议)仍**放行原生窗口**,交给系统处理 —— 这类弹窗不纳入会话模型。
62
- - 自托管浏览器子进程崩溃(或宿主 DSH 重启)后会自动重启;崩溃前已打开的会话在**下一次调用时自动重建** —— 仅页面状态丢失,无需手动 `dsh_browser_reset_session`。`dsh_browser_reset_session` 仍可用于主动重置。
63
- - 新视图创建前会先有界加载 `about:blank`(3 秒上限,保证视图一存在就有可响应的渲染进程),宿主侧命令另有 20s 有界超时。
64
- - 子进程 stderr 与退出码/信号落到 `$DSH_HOME/logs/dsh-builtin-browser-host.log`;写之前若该文件已超过 2 MiB,则**丢弃旧内容、只写入一行带时间戳的轮转记录**(形如 `<ISO 时间戳> log rotated: previous content exceeded 2097152 bytes and was discarded`)—— 旧内容就此消失不留副本,但那一行证明"曾发生过轮转",纯 `dsh web` 自托管可据此自助排查崩溃循环。
65
-
66
- ## 安静模式(`ui.quiet`)
67
-
68
- 默认关闭。默认契约是"人机共享同一个窗口":每次操作把窗口带到前面,用户能直接看见 agent 在做什么。开启后,自托管的 Electron 载体改成"能操作,但不接管屏幕":
69
-
70
- | 操作 | 默认 | 安静模式 |
71
- | --- | --- | --- |
72
- | 截图 | 显示 / 还原 / 聚焦窗口,再 `capturePage` | 不碰窗口;窗口不可见时直接走 CDP `Page.captureScreenshot` |
73
- | 输入(点击 / 输入 / 按键) | `show()` + `moveTop()` + 聚焦 | 最小化则 `restore()`,不可见则 `showInactive()`;不激活应用、不抢键盘焦点、不 `moveTop()` |
74
- | 标签切换 / 导航 | 同输入,把窗口置前 | 只换窗口内可见的标签,最小化的窗口保持最小化 |
75
-
76
- 它不是"不显示窗口"。合成输入(CDP `Input.*`)仍需要视图有**显示表面**,Chromium 对没有表面的视图会静默丢弃输入 —— 所以点击/输入可能把最小化的窗口恢复成可见,但不会成为 key window,也不会盖在用户正在用的窗口上。截图和导航没有这个约束,因此是安静模式下完全不动窗口的操作。
77
-
78
- 边界:
79
-
80
- - **只作用于自托管 Electron 载体**(插件的 `host-main` 子进程)。桌面端侧栏由外壳承载,`ui.quiet` 不改变外壳的展示策略;安装版 Chrome / Edge 载体各自管理自己的窗口。
81
- - 用户主动操作(点工具栏、切标签)不受影响 —— 它们本来就发生在那个窗口里。
82
- - 窗口完全不可见时,安静模式仍会让它出现在屏幕上(只是不聚焦)。要"连出现都不要",请在截图之外使用非视觉能力(snapshot / a11y / content),它们本来就不需要显示表面。
83
-
84
- ## 不提供的东西
85
-
86
- - **无痕模式(`privateMode`)未实现**:它需要 Electron 的 session 分区能力,属于宿主层,本插件不承诺。
87
- - **本插件不提供任何浏览器界面**:地址栏、标签条、侧栏面板都不是插件画的。桌面端的浏览器界面是**外壳自带的官方侧栏**,我们只是借它的页面来驱动;自托管载体下画窗口的是插件拉起的那个 Electron 子进程,那是载体本身而非插件 UI。别把"侧栏"或"浏览器列"当成插件能力。
88
-
89
- ## Electron 运行时
41
+ ## 本机浏览器窗口模式
90
42
 
91
- - Electron 包自身在 44+ 使用懒下载。0.4.16 通过**本插件的 `postinstall`**明确准备二进制(约 100MB,需网络);这要求宿主允许构建脚本且下载可用,不保证所有环境自动完成。DSH rc.5 的 pnpm 11.7 `strict-dep-builds` 首次可能需在原生插件管理器批准脚本,插件不会改写 `allowBuilds`。
92
- - `--ignore-scripts` 或显式跳过下载会保留未下载状态。可在正确 profile 目录运行 `npx --no dsh-browser-install-electron`,它也遵守 `ELECTRON_SKIP_BINARY_DOWNLOAD`;需要下载时先撤销跳过设置。运行时探测仍为纯文件系统操作,不自动下载。离线时可用 `ELECTRON_PATH` 指定预装二进制,详见[用户指南](user-guide.md#准备-electron-二进制)。
93
- - 0.4.16 的依赖为 `^44.10.0`,锁文件解析到 `44.10.0`,安全最低阈值为 `44.9.1`。**已有且有效的 `ELECTRON_PATH` 优先于这份依赖**,升级插件不会更改该覆盖;旧覆盖可能让实际使用的内核继续停在旧版。侧栏使用的是桌面外壳的内核,也不随插件升级。
43
+ `browser.headless` 只用于 DSH 启动的独立 Chrome / Edge 配置。默认 `auto` 根据显示环境选择窗口或无头;`headless` 强制无头,`windowed` 要求显示可用。它不会改变 Desktop 或 Web 侧栏,也不控制扩展连接中的个人浏览器。
@@ -0,0 +1,46 @@
1
+ # PR #64: Desktop extension status and profile repair (#36)
2
+
3
+ ## Maintenance boundary
4
+
5
+ Windows settings has one fixed-label **卸载并重装** control. The automatic route accepts `{ "action": "reinstall" }` and optional locale, not the former install/uninstall modes or renderer-supplied host status. Manual/Web `BridgeAction` remains `install | uninstall`; Web host-patch controls are unchanged.
6
+
7
+ Read-only preflight validates Desktop identity, authoritative archive bytes and restore baselines, and captures the dependency from `DSH_HOME/profiles/desktop/package.json`. A missing dependency returns `REINSTALL_DEPENDENCY_MISSING` before creating a lock, plan or staging directory, never selecting a replacement source. Local sources must remain readable outside the removed package. Packed preflight ignores stale `resources/app` extractions. The compiled coordinator, installer and host-patch runtime are copied outside the installed package before arming.
8
+
9
+ One locked transaction, after confirmed shutdown, removes the profile dependency using Desktop's cold CLI, runs installer `--revert`, applies the host patch, then re-adds the captured dependency. Relative `file:`/`link:` sources resolve against the original profile. Verified absence permits a no-op removal/restore; other errors stop the transaction. Repeated runs retain the exact original restore baselines. A nonzero package command remains a failed durable job even when Desktop is reopened for recovery.
10
+
11
+ The Windows coordinator retains the armed-response acknowledgement and official normal Quit flow. It waits for confirmed shutdown and refuses maintenance writes on cancellation; it never force-terminates Desktop. It restarts once with the captured `DSH_HOME`, including recovery after failure. Success requires a live endpoint owned by the new PID, matching home, extension version/build, host `loaded` status and applied host-patch status.
12
+
13
+ ## Host and runtime patch
14
+
15
+ - `0003-main-extension-status.patch` in each of `dsh-host-patch/sources/{rc3,rc5,main}` extends the loader and authenticated main/preload IPC. It adds no browser guest or debugger API.
16
+ - Status is resolved from direct profile dependencies and package contents, compared with the actual running entry. Same-version file replacement becomes `pending-restart`; startup failures are isolated and sanitized.
17
+ - Runtime revision 2 patches sidebar `lib/client.js` and Desktop `lib/main.js` plus `lib/preload-app.cjs`. The applier validates the complete selected plan before staging, commits by rename, rolls back failures and preserves original backups across revision-1 upgrades. Restore reproduces original bytes, including an original legacy-injected entry. Unrelated edits refuse writes.
18
+
19
+ ## Checks and acceptance scope
20
+
21
+ Commands run on the VM include focused Desktop loader/preload/startup tests for rc.3, rc.5 and main, touched Desktop typechecking, the release source-build artifact comparator, a fresh plugin client bundle and:
22
+
23
+ ```sh
24
+ TSX_TSCONFIG_PATH=/home/ubuntu/repos/deepseek-harness/tsconfig.base.json node tests/run.mjs
25
+ node tools/check-host-patch-source.mjs /home/ubuntu/research/artifacts
26
+ ```
27
+
28
+ Coverage includes loader single start and failure isolation, changed/same-version package status, traversal/escaping symlinks, missing profiles, independent homes and cleanup. Plugin tests cover profile CLI selection and failures, unchanged app/archive/launcher bytes, host status with a missing bridge endpoint, explicit unsupported/bootstrap controls, endpoint version/build/home/PID verification, stale crash-endpoint replacement, live socket/listener cleanup, multi-file mismatch/rollback, revision upgrades, legacy-original restore and unrelated-edit refusal. Existing maintenance, quit-confirmation and protocol-5 regressions remain in the full suite.
29
+
30
+ The source-build comparator checks actual rc.3 and rc.5 before/after bundles, not only the checked-in fixtures, for all three runtime targets. The published rc.5 Desktop artifact is still unavailable for pristine-hash verification; mismatches are refused.
31
+
32
+ ### Not established by VM unit tests
33
+
34
+ - No laptop access, real Windows reinstall/restart or visual settings verification was performed.
35
+ - Read-only package-manager failure and normal profile package operations are tested through the runner seam; this does not establish a real packaged Desktop/pnpm install on a read-only Windows profile.
36
+ - Pending-task cancellation uses the existing normal-quit coordinator regression tests; no real active-task Desktop shutdown was exercised for this change.
37
+ - Before merging the refreshed base, plugin host emit retained 27 existing Electron typing diagnostics (zero additions). The base's SDK declaration isolation and Electron shim updates remove those diagnostics: the merged `tsc -p tsconfig.build.json` exits zero. The client was built with the repository's current client-bundle preset because this older plugin's checked-in tsdown config imports a removed `@local/tsdown-plugin-cordis` package.
38
+ - #8 native child adoption and #30 native views are outside this change.
39
+
40
+ ## Base refresh
41
+
42
+ Merged `devin/1763597000-sidebar-browser-both-ends` at `e22c245acf99f7b2d042646dc2fade32ea9ea7c3`. Conflicts were limited to `desktop-bridge/main.mjs` (both branches introduced the same extension entry) and `desktop-bridge/plugin-browser-bridge.js` (`start(api)` initialization). Kept the shared API-aware entry plus #36 version/build metadata and idempotent startup/explicit reload. Preserved the base's remaining sidebar-only exports, pairing admission, profile leases, handle and SDK/typecheck changes. No host-authority or carrier-policy decision was needed.
43
+
44
+ The first merged-suite run found the new SDK-isolation fixture resolving the workspace's real `vendor/cordis/lib/types` path instead of an isolated published SDK. Installed the base's documented `.dsh-sdk-types` dependencies before rechecking; no test or compiler configuration was changed.
45
+
46
+ While review was running, the base advanced again to `3802d39`. The follow-up merge keeps its canonical-handle transport and adapts rendering holds/cancellation to derive the owner from the validated tab handle, while retaining extension status and cleanup. Conflicts were in `desktop-bridge/plugin-browser-bridge.js` and the ownership test's renderer stub. Rendering-hold fixtures now send canonical handles; none of their background, cancellation or disposal assertions were removed.
@@ -0,0 +1,25 @@
1
+ # Desktop reinstall recovery
2
+
3
+ Automatic reinstall checkpoints `package.json`, `pnpm-lock.yaml`, `node_modules/.modules.yaml`, the plugin entry, and a shallow inventory of top-level packages (including scoped package names) beside the staged worker. It does not snapshot unrelated package contents, virtual stores, executable shims or temporary package directories. Remove, revert, apply, add and package-resolution failures restore the saved manifests and plugin directly, recover missing orphan entries from `.ignored`, and verify plugin resolution without pnpm or network access. If package recovery or resolution still fails after the files are restored, the worker attempts the bundled `pnpm install --frozen-lockfile` using inherited network settings. Regardless of that attempt's outcome, it reinstates the saved manifests and plugin and checks resolution again. After a confirmed Desktop exit, recovery always attempts to restart Desktop, even if reconciliation, restoration or verification failed. Such failures remain prominently reported, and the checkpoint is retained; restart is not reported as successful maintenance.
4
+
5
+ The checkpoint never creates symbolic links or hardlinks and never traverses junctions or symbolic links. Link targets and directory/file types are recorded in `metadata.json`; external linked checkouts are not copied. Only the three profile files and a real-directory plugin entry are copied. Directory links are restored as junctions, which do not require Windows Developer Mode or administrator privileges. A denied file-link restore is reported explicitly while remaining files are restored and Desktop is restarted. A checkpoint preparation failure removes its partial checkpoint without changing the profile. Plugin resolution is checked in a fresh process. Arbitrary in-place modifications inside unrelated packages are outside this minimal checkpoint; a missing orphan not recoverable from `.ignored` is reported rather than claiming full recovery. Failure to restore one entry does not prevent attempts to recover the remaining entries.
6
+
7
+ Preflight records undeclared nested dependencies in `automatic.json`. After Desktop exits, a bounded Electron-node child removes contaminated, profile-owned nested `node_modules` with plain filesystem semantics before pnpm removal. External linked checkouts are never cleaned. Declared dependency links alone do not count as contamination.
8
+
9
+ Package operations and optional rollback reconciliation inherit DSH's network settings: they do not force offline mode or override fetch timeouts/retries. Both legacy `npm_config_*` and pnpm 11 `PNPM_CONFIG_*` prefixes disable scripts and automatic peer installation. Each CLI call has a five-minute bound and attempts to terminate its process tree on timeout. Unrelated top-level entry removals or retargeting fail the transaction rather than silently accepting pruning. Recovery restart is attempted even when process termination cannot be fully verified, with that uncertainty retained in the failure report.
10
+
11
+ Only the package-manager children this plugin starts get `ELECTRON_NO_ASAR=1`, in their own environment. The plugin never writes it into the host's `process.env`: every later child of an ASAR-packaged host (DSH Tauri's subprocess Job runner, for one) would inherit it and fail to load its own entry from the archive (issue #71). A packed cold CLI must first import from `app.asar` with archive support enabled, then passes no-ASAR mode to its pnpm child. Maintenance itself discovers the packed CLI through raw archive reads.
12
+
13
+ ## Sidebar tool readiness
14
+
15
+ `dsh_browser_open` requires a controllable session and a successful live snapshot. A missing bridge or manual-only iframe is refused with `BROWSER_NATIVE_SURFACE_UNAVAILABLE`; no iframe navigation is queued and no task session is recorded. A failed switch leaves an existing controllable session unchanged. Manual browsing in the Web panel remains available through the UI.
16
+
17
+ A responding legacy bridge with protocol below 4, or an absent/invalid protocol, fails discovery with `BROWSER_BRIDGE_OUTDATED`, `bridgeState: stale`, `repairAction: reinstall`, and the actual/required protocols. The error names “桥接版本过旧” and “卸载并重装”. This refusal precedes iframe fallback, so an old host copy cannot turn a tool open into manual-only navigation. The stable host loader installed by reinstall follows the profile package on subsequent updates.
18
+
19
+ ## Regression commands
20
+
21
+ Compile the host first with `tsc -p tsconfig.build.json`. Then run `TSX_TSCONFIG_PATH=<DSH tsconfig.base.json> node tests/run.mjs`.
22
+
23
+ Set `DSH_RC3_SOURCE` to a dependency-prepared rc.3 checkout, `DSH_PLUGIN_ARCHIVE` to the real plugin tgz and `DSH_ELECTRON_BINARY` to an installed Electron executable to enable the actual cold-CLI integration. It checks unchanged rc.3 dispatch sources, actual module execution, offline file remove/add, file/link siblings, an orphan, and removal of a real nested `default_app.asar` under Electron-node. The package must declare no installable Electron dependency and ship no nested dependencies. pnpm may generate a nested `.bin` directory for katex executable shims; the test permits those shims but no nested package or virtual store.
24
+
25
+ The Linux Electron negative control sees ASAR as a virtual directory but can still remove it. This is not a reproduction of Windows' reported hang or proof of a particular Windows file handle. The pre-existing copied development tree reported before the r8c2 job is not part of the r8c2 archive. No Windows execution or installed-shell visual verification is implied by these VM regressions.
@@ -0,0 +1,52 @@
1
+ # Native sidebar children
2
+
3
+ Desktop childTabs protocol 2 admits an opener only after its canonical tab and native slot are attached. Main issues the child handle, request and lease. `setWindowOpenHandler` returns `action: 'allow'`; its `createWindow` adopts Electron's `options.webContents` with `new WebContentsView(options)` and returns that same WebContents. There is no BrowserWindow creation or URL replay.
4
+
5
+ `registerOwner`, `onCreated`, `adopt` and `onClosed` share the owning Session lifetime. Both events carry the full child record. Adoption requires the original renderer, the parent's live admission and the child-specific slot. Same-slot retries are idempotent; another slot, renderer or ended request cannot create a guest. Unadopted children close after ten seconds. Parent disposal, owner reload, guest destruction and slot revocation revoke children. Closing a child removes its reserved tab without navigating the opener. Named-target reuse remains Chromium-owned.
6
+
7
+ The plugin feature-detects protocol 2 and the optional reserved-tab controller method against unpatched host declarations. The host event is recorded before opening the reserved tab, so the page factory sees the main-owned child before rendering its occurrence. It subscribes before adoption, reuses the supplied lease and acknowledges initialization without `Page.navigate`. Initial blank documents can become ready without converting `about:blank` to an HTTP URL. Unsupported native-opener requests report `BROWSER_NATIVE_CHILD_UNAVAILABLE`; explicit URL-only requests remain separate.
8
+
9
+ Revision 8 includes native children and opt-in persistent Sidebar storage, including session-cookie checkpoints restored before guest loading, retaining compressed revision-3/4/5/6/7 specs and revision-1/2 specs. Upgrade validates the complete previous output against original backups before writing any selected bundle. Restore retains the pre-bootstrap bytes; unrelated edits refuse upgrade. Source patches are supplied for rc.3, rc.5 and main.
10
+
11
+ Each release ships its entire 17-commit `git format-patch base..source` history, losslessly compressed. `sources/series.json` pins the base, ordered patch list, source-build commit and complete resulting Git tree; `sources/manifest.json` records uncompressed lengths and SHA-256. Decompress and apply the complete listed series from its exact base, not the superseded piecemeal patch files. Revision-8 source commits are main `ecc1469ffe9edeeb19d1a88c0909a915593adba9`, rc.3 `948d49ac3f9e48e511b71ecbef446745e59e1d05`, and rc.5 `c8f8d79aacc07d2f54dda634ff2cc041d165bcf5`. Regenerate with `DSH_SOURCE_ROOT=<git-checkout> node tools/generate-host-patch-sources.mjs`; `node tests/run.mjs tests/host-patch-source-series.test.mjs` checks every shipped patch with `git apply --cached --check` and verifies all three final source-tree hashes without an external checkout.
12
+
13
+ ## Persistent Sidebar sessions
14
+
15
+ The guest and native-view APIs advertise optional `persistentSession: true`. The plugin requests persistence only when advertised; older hosts retain their workspace-scoped memory partitions. Main derives one persistent partition from the resolved `DSH_HOME`, never from a workspace or renderer-supplied storage identity. All workspaces in that home share cookies and web storage across restarts; different homes remain isolated. Existing memory-only sessions have no durable data to migrate. No plugin storage keys, user IDs or provider hooks change.
16
+
17
+ Revision 8 retains session cookies without adding expiry dates. Main checkpoints only the Sidebar partition's session cookies at `<DSH_HOME>/dsh-builtin-browser-host/desktop-session-cookies.json` (0600, directory 0700, Windows owner ACL), after every cookie change and before completing normal quit. Serialized atomic replacement leaves the previous complete checkpoint intact on an interrupted write; it does not promise power-loss durability or recovery beyond the last completed checkpoint. One shared restore promise runs exactly once per partition, before native-view creation or webview reservation; direct persistent reservations are refused until it completes. Flush never restores, so logout cannot replay saved cookies. Invalid or Chromium-rejected entries are diagnosed and dropped independently while remaining entries continue. Checkpoint reads get three attempts with 25/50 ms backoff. Exhausted reads preserve the old checkpoint as `.bak` and complete restoration with a diagnostic; checkpointing then resumes from the live jar. If backup preservation itself fails, guests still proceed but writes wait for backup preservation to recover. Corrupt input is diagnosed and sanitized. Restore preserves host-only/domain, Secure, HttpOnly, SameSite and quoted-value scope, and never overwrites a persistent cookie with a stale session snapshot. Unsupported attributes are not weakened. Checkpoint failures are diagnostic-only for guest operations; failed permission setup is retried on a later flush. Host cookie mutations, script commands and scoped fetches await reconciliation; quit stops admission, drains checkpoints, flushes Chromium and disposes listeners. Persistent cookies remain Chromium-owned. The merged Web proxy has its own per-home JSON jar, retaining session cookies too; it does not initialize or replace Desktop Chromium storage, and there is no cross-carrier cookie migration.
18
+
19
+ Run `DSH_SOURCE_ROOT=<dsh-source> PERSISTENCE_EVIDENCE=<directory> node tools/check-sidebar-persistence.mjs` for real Electron launches under xvfb. The fixture checks expiring and HttpOnly session cookies on the first request, session/Secure/host-only/domain/SameSite scope, localStorage, tab close/reopen, cross-workspace sharing, different-home isolation, stale persistent replacement, expiry/deletion, native clear-site-data, HTTP Clear-Site-Data, and SIGKILL recovery after a completed checkpoint. It uses the emitted production partition policy, `webviewTag: false` and one BrowserWindow. It does not qualify real Windows ACL execution or packaged Desktop layout.
20
+
21
+ ## Reproduction
22
+
23
+ Run the ordinary Node behavior suite with `TSX_TSCONFIG_PATH=<dsh-source>/tsconfig.base.json node tests/run.mjs`. Source Vitest cases need source aliases rather than published `lib` exports because the plugin lives outside the DSH tsconfig root:
24
+
25
+ The same Vitest configuration runs `packaged-native-open.spec.ts` against the actual `dist/client.cjs` and the compressed rc.3 sidebar bundle. Build the plugin first. Set `DSH_BROWSER_TEST_ARCHIVE=<plugin.tgz>` to exercise an archive's client instead. It covers installed Browser/ReferenceDock stylesheets, native document acknowledgement, repeated opens, independent reserved views, empty identities and failed acquisition/retry without a webview. The Electron boundary is simulated; this does not replace real Desktop acceptance.
26
+
27
+ For rc.3/rc.5 archives, compile the client with `DSH_SOURCE_ROOT=<supported-release-source> node --import tsx tools/build-supported-client.mts` after the host TypeScript build. The revision-9 rc.3 source commit is `65791d4dcf`. Use that release's build preset, not main's newer deferred `meta.stylesheets` format: rc.3 installs styles at factory execution and does not consume stylesheet metadata. The build command rejects a metadata-only preset, and the actual-bundle regression checks that factory loading installs both stylesheets. Then `pnpm --ignore-scripts pack --out <new-file.tgz>` preserves those validated artifacts while applying publish manifest transformations.
28
+
29
+ Revision 9 samples native slot geometry on animation frames until revocation. A transform-only sidebar opening does not trigger ResizeObserver; revision 8 could leave an acknowledged native document attached at zero width, also blocking CDP screenshots. The frame sampler publishes only changed placement and is cancelled on release. Revisions 2–8 upgrade using their exact original backups.
30
+
31
+ Real Electron acceptance at device scale 1.25:
32
+
33
+ ```sh
34
+ DSH_SOURCE_ROOT=<DSH checkout with Electron and dependencies> \
35
+ DSH_RELEASE_SOURCE=<supported rc.3 source checkout> \
36
+ NATIVE_SLOT_HOST=<patched rc.3 desktop lib directory> \
37
+ DSH_BROWSER_TEST_ARCHIVE=<plugin.tgz> \
38
+ NATIVE_SLOT_EVIDENCE=<persistent output directory> \
39
+ node tools/check-native-slot.mjs
40
+ ```
41
+
42
+ This loads the archive's plugin and the revision-9 rc.3 client fixture through their factories, executes the patched main/preload native APIs in Electron, opens through `dsh_browser_open`, and captures through `dsh_browser_screenshot`. It checks native visibility, attachment, topmost ordering, nonzero bounds matching the animated DOM slot, document acknowledgement, and zero webviews. `display.png` captures the compositor and its native page pixels; `tool.png` is the browser-tool result. `window.png` captures only the shell webContents, not its native child views. The surrounding Cordis shell is a fixture, not a complete installed Desktop. For a negative control set `NATIVE_SLOT_CLIENT` to the revision-8 client; setting `NATIVE_SLOT_STATIC=1` opens without animation and distinguishes stale placement from scale/attachment faults.
43
+
44
+ ```sh
45
+ DSH_SOURCE_ROOT=<dsh-source> node <dsh-source>/node_modules/vitest/vitest.mjs run --config tools/native-child-vitest.config.mjs
46
+ DSH_SOURCE_ROOT=<dsh-source> NATIVE_CHILD_EVIDENCE=<existing-directory> xvfb-run -a <dsh-source>/apps/desktop/node_modules/electron/dist/electron --no-sandbox tools/fixtures/native-child-acceptance.cjs
47
+ node tools/check-host-patch-source.mjs <release-build-artifacts>
48
+ ```
49
+
50
+ The Electron fixture imports emitted production `DesktopNativeViews` and `DesktopBrowserGuests`. It tests same-origin scripting, cross-origin messaging and isolation, immediate scripts, named targets, form POST bodies, close/closed, unregistered/foreign/replayed/expired requests, Session disposal and one BrowserWindow. It does not validate shipped-shell visual layout or packaged Windows behavior.
51
+
52
+ Full client-entry typechecking against unpatched SDK declarations has 328 baseline diagnostics and 327 after this change, with no new diagnostics after normalizing worktree paths and line numbers. The removed diagnostic is `navigateTabIn`; the remaining baseline errors are not claimed fixed. Host plugin typechecking passes separately.
@@ -0,0 +1,60 @@
1
+ # PR #64: Native Sidebar views (#30)
2
+
3
+ ## Host boundary
4
+
5
+ The optional `browser.nativeViews` v1 API creates main-owned sandboxed WebContentsViews with context isolation, no Node integration, web security and `webviewTag:false`. Canonical owner/session/tab addresses identify views but do not grant access: primary-frame IPC authentication, Session admission, a matching admitted Sidebar slot and current lease are all checked. Sidebar-right owns composition geometry, clipping, visibility/background placement and lifetime. Slots revoke on root disposal; native leases revoke on renderer reload/crash, guest crash/close, Session close and explicit release. Release resolves after destruction and is idempotent.
6
+
7
+ Main extensions use scoped `browserGuests` snapshot/command/fetch/release capabilities, never WebContents ids. A command allowlist and navigation policy reject denied work before CDP dispatch. Document generations invalidate queued commands, and a bounded command/document deadline destroys an unresponsive guest. This presentation service is independent of the acquisition path so native-child adoption can reuse its composition/lifetime in #8; no child-adoption API is claimed here.
8
+
9
+ ## Plugin boundary
10
+
11
+ `NativeViewPage` is selected only for detected protocol 1; it never creates a DOM webview or chooses a replacement carrier. Existing explicitly selected Web/webview carriers remain. An unsupported native Sidebar operation reports `BROWSER_NATIVE_SURFACE_UNAVAILABLE`, not an automatically launched self-hosted browser.
12
+
13
+ Readiness requires attachment and a committed generation with frame and loader ids. The acknowledgement travels through the existing protocol-5 initialization journal and is checked against the main-owned native snapshot before binding a tool handle. Rendering holds, hidden-Session background markers, cancellation, remount and disposal remain part of admission. Native tool calls go through scoped host capabilities; renderer numeric ids cannot authorize them.
14
+
15
+ The native adapter also installs the existing reference overlay through scoped evaluation and forwards captured intents to the owning Session; navigation and disposal stop its document polling lifetime.
16
+
17
+ ## Runtime delivery
18
+
19
+ `0004-native-views.patch.gz` and `0005-native-client-errors.patch` supplement each rc.3/rc.5/main source series. Decompress the first patch before applying the series; its complete source bytes are pinned by `sources/manifest.json`. Revision-3 runtime specs cover Sidebar-right `lib/client.js`, Desktop `lib/main.js` and `lib/preload-app.cjs`. Sidebar-browser changes only types/Host references, not its client runtime. The source-built release outputs compare byte-for-byte with runtime-patched pristine outputs. Full output fixtures remain compressed with uncompressed length/SHA-256 checks.
20
+
21
+ Source commits: rc.3 `062adf7365` / `13705d30f0`; rc.5 `da20bebd9d` / `52511a6004`; main `aa0109aba9` / `f430580383`. Applying each new pair to its prior status-source commit reproduces the entire committed Git tree, not only selected files.
22
+
23
+ `0006-native-same-document.patch` adds main-frame fragment/History API acknowledgements while preserving the committed generation/frame/loader. Source commits: rc.3 `cbc141dd42`, rc.5 `6f3d4987f9`, main `550c755e81`. The plugin refreshes the address/history and restarts reference polling on those document notifications.
24
+
25
+ `0007-native-auth-cookies.patch` permits the existing `restoreAuth` request (`Storage.setCookies`) but dispatches `Network.setCookies` on the native guest's debugger session. Browser-context selectors and malformed envelopes are denied before dispatch; cookies cannot target another workspace partition. Empty batches remain valid. Failed native tabs also preserve their mounted presentation identity so reload or a fresh address can reacquire a lease without remounting.
26
+
27
+ Cookie-source commits: rc.3 `7fa9ced01b`, rc.5 `1b89543db9`, main `eeea47412d`. The two follow-up patches reproduce each release's complete committed tree from its preceding client-error commit.
28
+
29
+ Review follow-up verification: the native service suite passes 16 tests on each source branch; the full plugin suite passes 1,277 of 1,286 tests with 9 skipped. The real-Electron integration also verifies failed-tab reload and fresh navigation without remounting, fragment/History API address refresh with an unchanged document generation, and cookie restoration isolated from a second workspace partition. Runtime comparisons pass all six targets with Desktop main at 876,968 bytes.
30
+
31
+ Revision-1 and revision-2 upgrades validate the live prior revision against the original backup before computing any new bytes. All selected targets validate before staging. Mismatches/unrelated edits refuse the entire plan; atomic rename, rollback and exact original restore remain unchanged. Revision-2 regression tests include clean upgrade/restore and an unrelated preload edit with no writes.
32
+
33
+ ## Checks
34
+
35
+ Focused DSH native service, keyboard and Sidebar composition tests and touched Desktop/Sidebar typechecks run on rc.3/rc.5/main. The client purity gate tests the structured error import. Plugin tests include native readiness, missing/empty/error/late-acquire paths, remount cleanup, scoped transport and actual bridge TCP admission with matching/mismatched generation, foreign listing, rendering holds and extension stop cleanup. The full plugin suite retains legacy migration, maintenance, protocol-5 and explicit-carrier regressions.
36
+
37
+ ```sh
38
+ pnpm exec tsc -b apps/desktop/tsconfig.host.json packages/client/ui-sidebar-right packages/client/ui-sidebar-browser/tsconfig.host.json
39
+ pnpm exec vitest run apps/desktop/tests/native-views.spec.ts apps/desktop/tests/keyboard.spec.ts packages/client/ui-sidebar-right/tests/native-slots.client.spec.ts
40
+ node tools/check-host-patch-source.mjs /home/ubuntu/research/artifacts
41
+ node node_modules/typescript/bin/tsc -p tsconfig.build.json
42
+ TSX_TSCONFIG_PATH=/home/ubuntu/repos/deepseek-harness/tsconfig.base.json node tests/run.mjs
43
+ ```
44
+
45
+ Real Electron 44.7.0 qualification under xvfb runs the production native service and security policy. A second harness connects the production preload, SidebarNativeComposition and plugin NativeViewPage with `webviewTag:false`. OS mouse/keyboard input searches a local page; scoped CDP reads the same page and captures it. Both harnesses cover background/minimized generation changes, release and one-BrowserWindow lifetime. The integrated harness also disables requestAnimationFrame and remounts the plugin presentation.
46
+
47
+ A failure-mode run forcefully crashes a real guest, closes another and reloads the owner renderer. It observes plugin failure, destruction, stale-command refusal and fresh admission/leases after owner reload, with one BrowserWindow throughout. Source/runtime comparison and the full plugin suite remain passing after merging base `292e189` without conflicts: 1,283 tests, 1,274 passed, 9 skipped; plugin Host and native-presentation client typechecks exit zero.
48
+
49
+ Persistent VM evidence:
50
+
51
+ - `/home/ubuntu/research/native30-host/{main.cjs,results.json,run.log}`
52
+ - `/home/ubuntu/research/native30-integration/{main.cjs,renderer.ts,preload.ts,results.json,run.log,failure-results.json,failure-run.log,screen.png,guest.png}`
53
+ - `/home/ubuntu/research/native30-runtime-comparator.log`
54
+
55
+ ### Limits
56
+
57
+ - These are real Electron component integrations, not a complete packaged DSH profile/UI boot. Deadline and foreign/stale admission have focused service tests; not every branch is repeated through the real plugin UI.
58
+ - No real Windows installation/restart, full Desktop quit/relaunch, active-task shutdown or laptop access was performed. Restart persistence is not established by the component harness.
59
+ - The published rc.5 Desktop pristine artifact remains unavailable; source-build hashes are used and mismatches refuse patching.
60
+ - No full production Sidebar layout/visual acceptance is claimed. The integrated native surface screenshot is a qualification layout rather than the shipped DSH shell.