dsh-builtin-browser 1.0.0 → 1.0.3

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 (364) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +1 -1
  3. package/assets/browser-panel-locales.mjs +37 -5
  4. package/assets/browser-policy.d.mts +29 -0
  5. package/assets/browser-policy.mjs +40 -0
  6. package/desktop-bridge/desktop-discovery.d.mts +1 -1
  7. package/desktop-bridge/desktop-discovery.mjs +59 -9
  8. package/desktop-bridge/desktop-identity.json +12 -0
  9. package/desktop-bridge/install.mjs +14 -7
  10. package/desktop-bridge/plugin-browser-bridge.js +19 -7
  11. package/docs/acceptance-2026-11-27.md +67 -0
  12. package/docs/architecture.md +1 -1
  13. package/docs/development.md +33 -4
  14. package/docs/dsh-0.2.3-host-patch-task.md +34 -0
  15. package/docs/hardcoding-audit.md +28 -8
  16. package/docs/known-issues.md +26 -0
  17. package/docs/limitations.md +6 -2
  18. package/docs/pr64-maintenance.md +1 -1
  19. package/docs/tool-reference.md +1 -1
  20. package/docs/user-guide.md +1 -1
  21. package/docs/v1.1.0-bu-data-batching-task.md +66 -0
  22. package/docs/v1.1.0-compat-hardcoding-task.md +85 -0
  23. package/dsh-builtin-browser-1.0.3-publish.tgz +0 -0
  24. package/dsh-builtin-browser-1.0.3.tgz +0 -0
  25. package/dsh-host-patch/README.md +4 -0
  26. package/dsh-host-patch/apply.mjs +61 -13
  27. package/dsh-host-patch/rc3-revision9.json.gz +0 -0
  28. package/dsh-host-patch/rc5-revision9.json.gz +0 -0
  29. package/dsh-host-patch/sources/main/0001-feat-sidebar-right-add-session-rendering-holds.patch.gz +0 -0
  30. package/dsh-host-patch/sources/main/0002-feat-desktop-load-trusted-profile-main-extensions.patch.gz +0 -0
  31. package/dsh-host-patch/sources/main/0003-feat-desktop-report-resolved-and-running-main-extens.patch.gz +0 -0
  32. package/dsh-host-patch/sources/main/0004-feat-desktop-compose-admitted-native-sidebar-views.patch.gz +0 -0
  33. package/dsh-host-patch/sources/main/0005-fix-client-admit-coded-browser-errors-in-native-comp.patch.gz +0 -0
  34. package/dsh-host-patch/sources/main/0006-fix-desktop-acknowledge-native-same-document-navigat.patch.gz +0 -0
  35. package/dsh-host-patch/sources/main/0007-fix-desktop-restore-auth-in-the-native-lease-partiti.patch.gz +0 -0
  36. package/dsh-host-patch/sources/main/0008-feat-desktop-adopt-native-children-in-admitted-sideb.patch.gz +0 -0
  37. package/dsh-host-patch/sources/main/0009-fix-desktop-publish-complete-native-child-close-reco.patch.gz +0 -0
  38. package/dsh-host-patch/sources/main/0010-fix-desktop-bundle-structured-errors-in-sandboxed-pr.patch.gz +0 -0
  39. package/dsh-host-patch/sources/main/0011-feat-desktop-offer-persistent-Sidebar-sessions-per-D.patch.gz +0 -0
  40. package/dsh-host-patch/sources/main/0012-feat-desktop-retain-sidebar-session-cookies-across-r.patch.gz +0 -0
  41. package/dsh-host-patch/sources/main/0013-fix-desktop-honor-sidebar-session-cookie-sidecar-con.patch.gz +0 -0
  42. package/dsh-host-patch/sources/main/0014-fix-desktop-retry-cookie-protection-without-failing-.patch.gz +0 -0
  43. package/dsh-host-patch/sources/main/0015-fix-desktop-preserve-host-only-cookie-identity-in-se.patch.gz +0 -0
  44. package/dsh-host-patch/sources/main/0016-fix-desktop-restore-session-cookies-before-checkpoin.patch.gz +0 -0
  45. package/dsh-host-patch/sources/main/0017-fix-desktop-restore-sidebar-cookies-once-before-gues.patch.gz +0 -0
  46. package/dsh-host-patch/sources/main/0018-fix-sidebar-right-follow-animated-native-slot-placem.patch.gz +0 -0
  47. package/dsh-host-patch/sources/manifest.json +218 -0
  48. package/dsh-host-patch/sources/rc3/0001-feat-sidebar-right-add-session-rendering-holds.patch.gz +0 -0
  49. package/dsh-host-patch/sources/rc3/0002-feat-desktop-load-trusted-profile-main-extensions.patch.gz +0 -0
  50. package/dsh-host-patch/sources/rc3/0003-feat-desktop-report-resolved-and-running-main-extens.patch.gz +0 -0
  51. package/dsh-host-patch/sources/rc3/0004-feat-desktop-compose-admitted-native-sidebar-views.patch.gz +0 -0
  52. package/dsh-host-patch/sources/rc3/0005-fix-client-admit-coded-browser-errors-in-native-comp.patch.gz +0 -0
  53. package/dsh-host-patch/sources/rc3/0006-fix-desktop-acknowledge-native-same-document-navigat.patch.gz +0 -0
  54. package/dsh-host-patch/sources/rc3/0007-fix-desktop-restore-auth-in-the-native-lease-partiti.patch.gz +0 -0
  55. package/dsh-host-patch/sources/rc3/0008-feat-desktop-adopt-native-children-in-admitted-sideb.patch.gz +0 -0
  56. package/dsh-host-patch/sources/rc3/0009-fix-desktop-publish-complete-native-child-close-reco.patch.gz +0 -0
  57. package/dsh-host-patch/sources/rc3/0010-fix-desktop-bundle-structured-errors-in-sandboxed-pr.patch.gz +0 -0
  58. package/dsh-host-patch/sources/rc3/0011-feat-desktop-offer-persistent-Sidebar-sessions-per-D.patch.gz +0 -0
  59. package/dsh-host-patch/sources/rc3/0012-feat-desktop-retain-sidebar-session-cookies-across-r.patch.gz +0 -0
  60. package/dsh-host-patch/sources/rc3/0013-fix-desktop-honor-sidebar-session-cookie-sidecar-con.patch.gz +0 -0
  61. package/dsh-host-patch/sources/rc3/0014-fix-desktop-retry-cookie-protection-without-failing-.patch.gz +0 -0
  62. package/dsh-host-patch/sources/rc3/0015-fix-desktop-preserve-host-only-cookie-identity-in-se.patch.gz +0 -0
  63. package/dsh-host-patch/sources/rc3/0016-fix-desktop-restore-session-cookies-before-checkpoin.patch.gz +0 -0
  64. package/dsh-host-patch/sources/rc3/0017-fix-desktop-restore-sidebar-cookies-once-before-gues.patch.gz +0 -0
  65. package/dsh-host-patch/sources/rc3/0018-fix-sidebar-right-follow-animated-native-slot-placem.patch.gz +0 -0
  66. package/dsh-host-patch/sources/rc5/0001-feat-sidebar-right-add-session-rendering-holds.patch.gz +0 -0
  67. package/dsh-host-patch/sources/rc5/0002-feat-desktop-load-trusted-profile-main-extensions.patch.gz +0 -0
  68. package/dsh-host-patch/sources/rc5/0003-feat-desktop-report-resolved-and-running-main-extens.patch.gz +0 -0
  69. package/dsh-host-patch/sources/rc5/0004-feat-desktop-compose-admitted-native-sidebar-views.patch.gz +0 -0
  70. package/dsh-host-patch/sources/rc5/0005-fix-client-admit-coded-browser-errors-in-native-comp.patch.gz +0 -0
  71. package/dsh-host-patch/sources/rc5/0006-fix-desktop-acknowledge-native-same-document-navigat.patch.gz +0 -0
  72. package/dsh-host-patch/sources/rc5/0007-fix-desktop-restore-auth-in-the-native-lease-partiti.patch.gz +0 -0
  73. package/dsh-host-patch/sources/rc5/0008-feat-desktop-adopt-native-children-in-admitted-sideb.patch.gz +0 -0
  74. package/dsh-host-patch/sources/rc5/0009-fix-desktop-publish-complete-native-child-close-reco.patch.gz +0 -0
  75. package/dsh-host-patch/sources/rc5/0010-fix-desktop-bundle-structured-errors-in-sandboxed-pr.patch.gz +0 -0
  76. package/dsh-host-patch/sources/rc5/0011-feat-desktop-offer-persistent-Sidebar-sessions-per-D.patch.gz +0 -0
  77. package/dsh-host-patch/sources/rc5/0012-feat-desktop-retain-sidebar-session-cookies-across-r.patch.gz +0 -0
  78. package/dsh-host-patch/sources/rc5/0013-fix-desktop-honor-sidebar-session-cookie-sidecar-con.patch.gz +0 -0
  79. package/dsh-host-patch/sources/rc5/0014-fix-desktop-retry-cookie-protection-without-failing-.patch.gz +0 -0
  80. package/dsh-host-patch/sources/rc5/0015-fix-desktop-preserve-host-only-cookie-identity-in-se.patch.gz +0 -0
  81. package/dsh-host-patch/sources/rc5/0016-fix-desktop-restore-session-cookies-before-checkpoin.patch.gz +0 -0
  82. package/dsh-host-patch/sources/rc5/0017-fix-desktop-restore-sidebar-cookies-once-before-gues.patch.gz +0 -0
  83. package/dsh-host-patch/sources/rc5/0018-fix-sidebar-right-follow-animated-native-slot-placem.patch.gz +0 -0
  84. package/dsh-host-patch/sources/series.json +260 -0
  85. package/dsh-host-patch/tauri/desktop-main.cjs +62 -0
  86. package/dsh-host-patch/tauri/sidebar-session.cjs +104 -0
  87. package/dsh-host-patch/tauri-revision1.json +39 -0
  88. package/dsh-host-patch/tauri.json +43 -0
  89. package/dsh-host-patch/v023-alpha2.json +153 -0
  90. package/lib/browser/anti-bot.js +215 -0
  91. package/lib/browser/deep-dom.js +39 -0
  92. package/lib/browser/runtime.js +15 -0
  93. package/lib/browser/takeover-target.js +13 -6
  94. package/lib/browser/types.js +30 -1
  95. package/lib/browser-electron/authenticated-route.js +16 -2
  96. package/lib/browser-electron/automatic-maintenance.js +16 -10
  97. package/lib/browser-electron/bridge-connection.js +3 -8
  98. package/lib/browser-electron/bridge-install.js +2 -1
  99. package/lib/browser-electron/bridge-status.js +55 -26
  100. package/lib/browser-electron/desktop-bridge-host.js +7 -6
  101. package/lib/browser-electron/desktop-identity.js +28 -5
  102. package/lib/browser-electron/desktop-shell.js +64 -0
  103. package/lib/browser-electron/electron-provision.js +105 -18
  104. package/lib/browser-electron/entry.js +129 -46
  105. package/lib/browser-electron/extension-browser.js +4 -4
  106. package/lib/browser-electron/foreground-watch.js +134 -0
  107. package/lib/browser-electron/guest-cookie-jar.js +13 -13
  108. package/lib/browser-electron/guest-route.js +181 -32
  109. package/lib/browser-electron/guest-runtime.js +61 -10
  110. package/lib/browser-electron/guest-storage.js +2 -2
  111. package/lib/browser-electron/history-store.js +1 -5
  112. package/lib/browser-electron/host-main.js +8 -4
  113. package/lib/browser-electron/host-patch-maintenance.js +14 -8
  114. package/lib/browser-electron/maintenance-route.js +2 -1
  115. package/lib/browser-electron/missing-system-browser.js +5 -9
  116. package/lib/browser-electron/preferred-browser.js +7 -3
  117. package/lib/browser-electron/preview-route.js +9 -13
  118. package/lib/browser-electron/process-ownership.js +1 -1
  119. package/lib/browser-electron/profile-command.js +2 -1
  120. package/lib/browser-electron/profile-extension.js +5 -0
  121. package/lib/browser-electron/profile-lease.js +152 -47
  122. package/lib/browser-electron/provider-core.js +527 -0
  123. package/lib/browser-electron/provider-interaction.js +963 -0
  124. package/lib/browser-electron/provider-media.js +518 -0
  125. package/lib/browser-electron/provider-navigation.js +301 -0
  126. package/lib/browser-electron/provider-observation.js +623 -0
  127. package/lib/browser-electron/provider-tabs.js +372 -0
  128. package/lib/browser-electron/provider.js +150 -3301
  129. package/lib/browser-electron/reference-route.js +9 -18
  130. package/lib/browser-electron/remote-host.js +79 -34
  131. package/lib/browser-electron/runtime-status.js +56 -6
  132. package/lib/browser-electron/settings-store.js +3 -6
  133. package/lib/browser-electron/sidebar-only-host.js +1 -1
  134. package/lib/browser-electron/system-browser.js +539 -172
  135. package/lib/browser-electron/tauri-host.js +208 -0
  136. package/lib/browser-electron/virtual-cursor.js +23 -13
  137. package/lib/browser-reference/service.js +22 -4
  138. package/lib/browser-reference/web-sources.js +1 -1
  139. package/lib/client.js +43409 -0
  140. package/lib/compat/host-features.js +75 -0
  141. package/lib/reference-source.js +1 -1
  142. package/lib/reference-text.js +23 -1
  143. package/lib/takeover-protocol.js +1 -1
  144. package/lib/tool-browser/block-recovery.js +69 -0
  145. package/lib/tool-browser/code-tool.js +170 -19
  146. package/lib/tool-browser/code-worker.js +115 -20
  147. package/lib/tool-browser/errors.js +34 -0
  148. package/lib/tool-browser/index.js +66 -3593
  149. package/lib/tool-browser/page-probe.js +227 -28
  150. package/lib/tool-browser/panel-page.js +2 -1
  151. package/lib/tool-browser/probe-client.js +157 -0
  152. package/lib/tool-browser/screenshot-annotations.js +108 -0
  153. package/lib/tool-browser/state.js +337 -0
  154. package/lib/tool-browser/takeover.js +1 -1
  155. package/lib/tool-browser/tools-debug.js +862 -0
  156. package/lib/tool-browser/tools-interaction.js +993 -0
  157. package/lib/tool-browser/tools-navigation.js +807 -0
  158. package/lib/tool-browser/tools-observation.js +461 -0
  159. package/lib/tool-browser/tools-reference.js +293 -0
  160. package/lib/web-guest.js +1 -0
  161. package/package.json +16 -54
  162. package/README.en.md +0 -89
  163. package/browser-extension/constants.mjs +0 -20
  164. package/browser-extension/controller.mjs +0 -293
  165. package/browser-extension/locales.mjs +0 -15
  166. package/browser-extension/manifest.json +0 -12
  167. package/browser-extension/options.html +0 -14
  168. package/browser-extension/options.mjs +0 -9
  169. package/browser-extension/permission-guard.mjs +0 -13
  170. package/browser-extension/worker.mjs +0 -74
  171. package/dist/client.cjs +0 -43167
  172. package/lib/browser-electron/package-removal.js +0 -5
  173. package/lib/browser-reference/submission-receipts.js +0 -139
  174. package/scripts/build.mjs +0 -66
  175. package/scripts/bundle-host.mjs +0 -28
  176. package/scripts/fix-exports.mjs +0 -50
  177. package/scripts/install-electron.mjs +0 -51
  178. package/scripts/verify-exports.mjs +0 -47
  179. package/scripts/verify-preview-sdk.mjs +0 -93
  180. package/skills/dsh-builtin-browser/SKILL.md +0 -73
  181. package/skills/dsh-builtin-browser/references/batch.md +0 -53
  182. package/skills/dsh-builtin-browser/references/deliver.md +0 -31
  183. package/skills/dsh-builtin-browser/references/locate.md +0 -11
  184. package/skills/dsh-builtin-browser/references/recover.md +0 -11
  185. package/skills/dsh-builtin-browser/references/verify.md +0 -13
  186. package/skills/dsh-debug-host/SKILL.md +0 -56
  187. package/skills/dsh-debug-self/SKILL.md +0 -50
  188. package/src/bridge-compatibility.ts +0 -39
  189. package/src/browser/handles.ts +0 -89
  190. package/src/browser/runtime.ts +0 -560
  191. package/src/browser/takeover-target.ts +0 -36
  192. package/src/browser/types.ts +0 -817
  193. package/src/browser-electron/authenticated-route.ts +0 -84
  194. package/src/browser-electron/automatic-maintenance.ts +0 -726
  195. package/src/browser-electron/bridge-auto.ts +0 -159
  196. package/src/browser-electron/bridge-connection.ts +0 -385
  197. package/src/browser-electron/bridge-endpoint.ts +0 -129
  198. package/src/browser-electron/bridge-install.ts +0 -289
  199. package/src/browser-electron/bridge-maintenance.ts +0 -189
  200. package/src/browser-electron/bridge-status.ts +0 -347
  201. package/src/browser-electron/desktop-bridge-host.ts +0 -251
  202. package/src/browser-electron/desktop-identity.ts +0 -320
  203. package/src/browser-electron/document-readiness.ts +0 -45
  204. package/src/browser-electron/electron-provision.ts +0 -261
  205. package/src/browser-electron/entry.ts +0 -1301
  206. package/src/browser-electron/ephemeral-profile.ts +0 -189
  207. package/src/browser-electron/extension-browser.ts +0 -223
  208. package/src/browser-electron/extension-setup.ts +0 -67
  209. package/src/browser-electron/file-write.ts +0 -31
  210. package/src/browser-electron/guest-cookie-jar.ts +0 -176
  211. package/src/browser-electron/guest-cookie-store.ts +0 -59
  212. package/src/browser-electron/guest-css-runtime.ts +0 -76
  213. package/src/browser-electron/guest-css.ts +0 -68
  214. package/src/browser-electron/guest-route.ts +0 -568
  215. package/src/browser-electron/guest-runtime.ts +0 -357
  216. package/src/browser-electron/guest-storage-runtime.ts +0 -54
  217. package/src/browser-electron/guest-storage.ts +0 -117
  218. package/src/browser-electron/history-store.ts +0 -227
  219. package/src/browser-electron/host-main.ts +0 -1381
  220. package/src/browser-electron/host-patch-maintenance.ts +0 -112
  221. package/src/browser-electron/http-body.ts +0 -65
  222. package/src/browser-electron/json-reply.ts +0 -47
  223. package/src/browser-electron/maintenance-broker.ts +0 -166
  224. package/src/browser-electron/maintenance-lifecycle.ts +0 -91
  225. package/src/browser-electron/maintenance-route.ts +0 -67
  226. package/src/browser-electron/missing-system-browser.ts +0 -113
  227. package/src/browser-electron/open-slot.ts +0 -49
  228. package/src/browser-electron/package-removal.ts +0 -4
  229. package/src/browser-electron/paths.ts +0 -25
  230. package/src/browser-electron/preferred-browser.ts +0 -120
  231. package/src/browser-electron/preview-route.ts +0 -218
  232. package/src/browser-electron/process-ownership.ts +0 -168
  233. package/src/browser-electron/process.ts +0 -23
  234. package/src/browser-electron/profile-checkpoint.ts +0 -187
  235. package/src/browser-electron/profile-command.ts +0 -46
  236. package/src/browser-electron/profile-extension.ts +0 -124
  237. package/src/browser-electron/profile-lease.ts +0 -115
  238. package/src/browser-electron/profile-residue.ts +0 -49
  239. package/src/browser-electron/provider.ts +0 -4571
  240. package/src/browser-electron/reference-route.ts +0 -608
  241. package/src/browser-electron/remote-host.ts +0 -1462
  242. package/src/browser-electron/rpc-input.ts +0 -13
  243. package/src/browser-electron/rpc-ops.ts +0 -41
  244. package/src/browser-electron/runtime-diagnostics.ts +0 -38
  245. package/src/browser-electron/runtime-route.ts +0 -105
  246. package/src/browser-electron/runtime-status.ts +0 -242
  247. package/src/browser-electron/settings-route.ts +0 -64
  248. package/src/browser-electron/settings-store.ts +0 -589
  249. package/src/browser-electron/shortcuts-route.ts +0 -112
  250. package/src/browser-electron/sidebar-only-host.ts +0 -298
  251. package/src/browser-electron/startpage-shortcuts.ts +0 -213
  252. package/src/browser-electron/system-browser.ts +0 -1497
  253. package/src/browser-electron/timing.ts +0 -16
  254. package/src/browser-electron/virtual-cursor.ts +0 -152
  255. package/src/browser-electron/windows-system.ts +0 -24
  256. package/src/browser-reference/delivery.ts +0 -384
  257. package/src/browser-reference/entry.ts +0 -631
  258. package/src/browser-reference/export.ts +0 -339
  259. package/src/browser-reference/import.ts +0 -303
  260. package/src/browser-reference/page-script.ts +0 -1537
  261. package/src/browser-reference/service.ts +0 -1315
  262. package/src/browser-reference/store.ts +0 -172
  263. package/src/browser-reference/submission-receipts.ts +0 -122
  264. package/src/browser-reference/text-quote.ts +0 -219
  265. package/src/browser-reference/types.ts +0 -195
  266. package/src/browser-reference/visible.ts +0 -367
  267. package/src/browser-reference/web-sources.ts +0 -103
  268. package/src/client/browser/BrowserController.ts +0 -693
  269. package/src/client/browser/BrowserFrame.ts +0 -78
  270. package/src/client/browser/BrowserNavigation.ts +0 -169
  271. package/src/client/browser/BrowserPage.ts +0 -23
  272. package/src/client/browser/BrowserPersistence.ts +0 -44
  273. package/src/client/browser/IframeImpl.ts +0 -176
  274. package/src/client/browser/child-tabs.ts +0 -14
  275. package/src/client/browser/iframe-reference.ts +0 -67
  276. package/src/client/browser/initialization.ts +0 -262
  277. package/src/client/browser/omnibox.ts +0 -243
  278. package/src/client/browser/store.ts +0 -38
  279. package/src/client/browser/takeover-channel.ts +0 -72
  280. package/src/client/browser/url.ts +0 -46
  281. package/src/client/browser/web-reference-source.ts +0 -52
  282. package/src/client/css-modules.d.ts +0 -4
  283. package/src/client/definition.tsx +0 -30
  284. package/src/client/electron/ElectronWebViewImpl.ts +0 -364
  285. package/src/client/electron/ElectronWebviewPresentation.ts +0 -138
  286. package/src/client/electron/NativeChildPresentation.ts +0 -45
  287. package/src/client/electron/NativeViewPage.ts +0 -251
  288. package/src/client/electron/pages.ts +0 -23
  289. package/src/client/electron/reference-overlay.ts +0 -53
  290. package/src/client/electron/workspace.ts +0 -33
  291. package/src/client/index.ts +0 -293
  292. package/src/client/locales.ts +0 -857
  293. package/src/client/pages.ts +0 -28
  294. package/src/client/reference/client/BrowserRefLink.tsx +0 -142
  295. package/src/client/reference/client/draft-reference.ts +0 -167
  296. package/src/client/reference/client/index.ts +0 -7
  297. package/src/client/reference/client/ordered-submission.ts +0 -108
  298. package/src/client/reference/client/pending-delivery.ts +0 -216
  299. package/src/client/reference/client/plugin.ts +0 -189
  300. package/src/client/reference/client/production/ReferenceCapsules.tsx +0 -345
  301. package/src/client/reference/client/production/ReferenceDock.module.css +0 -193
  302. package/src/client/reference/client/production/ReferenceDock.tsx +0 -6
  303. package/src/client/reference/client/production/ReferenceFeedback.tsx +0 -15
  304. package/src/client/reference/client/production/ReferenceMath.tsx +0 -44
  305. package/src/client/reference/client/production/ReferenceText.tsx +0 -36
  306. package/src/client/reference/client/production/assembly.ts +0 -471
  307. package/src/client/reference/client/production/asset-store.ts +0 -144
  308. package/src/client/reference/client/production/availability.ts +0 -74
  309. package/src/client/reference/client/production/bytes.ts +0 -36
  310. package/src/client/reference/client/production/delivery-client.ts +0 -211
  311. package/src/client/reference/client/production/draft-adapter.ts +0 -508
  312. package/src/client/reference/client/production/http-transport.ts +0 -217
  313. package/src/client/reference/client/production/production-submission.ts +0 -310
  314. package/src/client/reference/client/production/protocol.ts +0 -231
  315. package/src/client/reference/client/production/reference-card.ts +0 -240
  316. package/src/client/reference/client/production/reference-labels.ts +0 -29
  317. package/src/client/reference/client/production/reply-link-bridge.ts +0 -222
  318. package/src/client/reference/client/production/reveal.ts +0 -215
  319. package/src/client/reference/client/production/runtime.ts +0 -1101
  320. package/src/client/reference/client/production/snapshot-adapter.ts +0 -154
  321. package/src/client/reference/client/production/source-marker.ts +0 -63
  322. package/src/client/reference/client/production/source-opener.ts +0 -55
  323. package/src/client/reference/client/production/styles.ts +0 -104
  324. package/src/client/reference/client/production/user-text-rule.ts +0 -58
  325. package/src/client/reference/client/reveal.ts +0 -107
  326. package/src/client/reference/client/scheme.ts +0 -114
  327. package/src/client/reference/client/types.ts +0 -168
  328. package/src/client/reference/css-modules.d.ts +0 -4
  329. package/src/client/reference/index.ts +0 -11
  330. package/src/client/reference-capture-owner.ts +0 -162
  331. package/src/client/reference-intents.ts +0 -36
  332. package/src/client/settings/index.ts +0 -34
  333. package/src/client/settings/panel.ts +0 -2657
  334. package/src/client/shortcut-open.ts +0 -30
  335. package/src/client/startpage/binding.ts +0 -99
  336. package/src/client/startpage/controller.ts +0 -303
  337. package/src/client/startpage/model.ts +0 -279
  338. package/src/client/view/Browser.module.css +0 -751
  339. package/src/client/view/BrowserBody.tsx +0 -314
  340. package/src/client/view/BrowserPresentation.ts +0 -9
  341. package/src/client/view/BrowserTitle.tsx +0 -17
  342. package/src/client/view/IframePresentation.ts +0 -344
  343. package/src/client/view/StartPage.tsx +0 -597
  344. package/src/client/view/TakeoverBanner.tsx +0 -21
  345. package/src/index.ts +0 -110
  346. package/src/reference-owner.ts +0 -5
  347. package/src/reference-page.ts +0 -9
  348. package/src/reference-source.ts +0 -3
  349. package/src/reference-text.ts +0 -197
  350. package/src/startpage-settings.ts +0 -103
  351. package/src/startpage.ts +0 -71
  352. package/src/takeover-protocol.ts +0 -19
  353. package/src/tool-browser/code-tool.ts +0 -401
  354. package/src/tool-browser/code-worker.ts +0 -639
  355. package/src/tool-browser/element-fields.ts +0 -167
  356. package/src/tool-browser/index.ts +0 -3733
  357. package/src/tool-browser/page-probe.ts +0 -474
  358. package/src/tool-browser/panel-page.ts +0 -124
  359. package/src/tool-browser/screenshot-image.ts +0 -49
  360. package/src/tool-browser/takeover.ts +0 -198
  361. package/src/types/electron-shim.d.ts +0 -144
  362. package/src/types.ts +0 -85
  363. package/src/web-guest.ts +0 -34
  364. package/tools/accept-desktop.mjs +0 -148
@@ -1,11 +0,0 @@
1
- # Recovering
2
-
3
- - Page stuck or a script half-applied: `dsh_browser_refresh`.
4
- - Session wedged after a carrier loss: `dsh_browser_reset_session` (this task only), then re-open
5
- and re-read the page. A lost carrier means the page context is gone — nothing you knew about it
6
- still holds.
7
- - A call fails with a reason you cannot place: `dsh_browser_doctor` (session, page state, probe
8
- buffers, which tools this task restricted away), then `dsh_browser_help` for the topic.
9
- - Everything is refused with "restricted": the task restricted its own tools. `dsh_browser_restrict`
10
- with the needed names lifts it; observation tools are never blocked.
11
- - Do not retry a state-changing call blindly after an error. Read first, decide second.
@@ -1,13 +0,0 @@
1
- # Verifying
2
-
3
- | Question | Tool |
4
- | --- | --- |
5
- | Is the element there / the text there / the URL changed? | `dsh_browser_assert` |
6
- | Did a request reach the server? | `dsh_browser_wait_for_response` |
7
- | What did the page log or fetch? | `dsh_browser_console`, `dsh_browser_network` |
8
- | Did a field take the value? | `dsh_browser_get_value` |
9
-
10
- A submit is the dangerous case. After clicking submit: wait for the response, assert the visible
11
- outcome, and if the call died before either answer arrived, **read the site's own record** (the
12
- list page, the order history) before acting again. "Result unknown" is an acceptable answer to
13
- report; a second submit is not.
@@ -1,56 +0,0 @@
1
- ---
2
- name: dsh-debug-host
3
- description: Use when the thing under test IS DSH itself - a client bundle, the settings panel, the sidebar UI - and the page has to be refreshed and inspected. Covers which surface to open DSH on, why the sidebar cannot host it, and how to read the result.
4
- ---
5
-
6
- # Debugging DSH itself
7
-
8
- Testing DSH is different from testing a page. The subject is the shell that is running your tools, so it
9
- must be opened on a surface you control directly.
10
-
11
- ## Which surface
12
-
13
- - **Built-in browser for DSH.** Open the DSH URL (the one carrying the token) in the plugin's own browser
14
- and work in that page: refresh it, inspect it, read its DOM. That window is yours to drive.
15
- - **Sidebar for everything else.** Ordinary pages belong in the DSH sidebar, where the reader can watch
16
- and take over. Do not open DSH there.
17
-
18
- ## Why the sidebar cannot host DSH
19
-
20
- The sidebar serves pages through the same-origin guest proxy. Pointing it at DSH makes the host fetch the
21
- very server that is serving the request; what comes back is a network-looking failure
22
- (`guest proxy: cannot reach 127.0.0.1:PORT: fetch failed`) that says nothing about the real mistake.
23
- The proxy now refuses loopback and private targets outright, so the answer is a plain refusal instead of a
24
- timeout - treat it as a routing reminder, not a bug in the page.
25
-
26
- ## Refresh, do not restart
27
-
28
- Client-side plugin code is fetched once per page load. A rebuilt `client.js`, a new settings row, a changed
29
- handler - none of that reaches a page that is already open. Refresh the DSH page. Restarting the host is a
30
- different, heavier action and does not fix a stale page.
31
-
32
- Tool handlers are registered when the host starts. A rebuilt tool body may therefore need a host restart,
33
- while a rebuilt client body needs only a page refresh. Know which of the two you changed.
34
-
35
- ## Reading the result
36
-
37
- 1. `dsh_browser_state` first: URL, title, load state, counts. A blank title with no elements is a signal,
38
- not an empty page - compare it against what that surface is expected to return.
39
- 2. Then `dsh_browser_execute` for the specific fact (`document.title`, a computed style, a dataset value).
40
- 3. Keep the DSH tab open between steps; reopening it each time loses the very state you were testing.
41
-
42
- ## Rule of thumb
43
-
44
- If the question is "does DSH behave correctly", the answer comes from a DSH page in the built-in browser,
45
- refreshed after every client change. If the question is "does this site work", the answer comes from the
46
- sidebar.
47
-
48
- ## panel 模式能做什么、不能做什么
49
-
50
- `surface: "panel"` 在创建浏览器会话之前就返回,所以:
51
-
52
- - 能做:把页面放进 DSH 侧栏、让读者看到(`open`)。
53
- - 不能做:`snapshot` / `execute` / `scrape` / `click` / `fill` 这些依赖会话的工具,会以“无会话”失败。
54
-
55
- 要读页面内容或操作页面,用 `surface: "builtin"`(仅本机地址允许),或改用侧栏的引用通道(划选 → 浮条 → 引用)。
56
- 不要把“panel 下读不到页面”当成 bug 反复排查:那是这一档的既定边界。
@@ -1,50 +0,0 @@
1
- ---
2
- name: dsh-debug-self
3
- description: Use when a browser or DSH behaviour has failed more than once, or when the obvious explanation is environmental (needs a restart, a cache, a stale build). Turns a repeated failure into one measurable check so the same cause is not re-guessed, and records the check next to the work.
4
- ---
5
-
6
- # Debugging without re-guessing
7
-
8
- A repeated failure is not a new situation. It is the same one arriving again, and the second arrival
9
- means the first explanation was never actually checked.
10
-
11
- ## The loop
12
-
13
- 1. **Write down what was observed, not what was concluded.** A tool returned `{title: "", elements: []}`;
14
- a file contains `surface: "builtin"`; a log line printed `surface=panel`. Inferences ("needs a
15
- restart", "the cache is stale") are hypotheses and belong in the next step, not this one.
16
- 2. **Move one variable per trial.** If two things changed between a working and a broken run, the result
17
- distinguishes nothing. Change one, re-run, note the outcome.
18
- 3. **Prefer a value the system prints over a value you compute.** A field in a response, a log line at
19
- registration, a file's own contents — these are facts. Reconstructing the same fact from behaviour
20
- ("it must be X because it did not do Y") is how the same wrong guess survives a whole session.
21
- 4. **Turn the conclusion into a check.** Something a later run can evaluate in one call: a field to read,
22
- a path to stat, a line to grep. If it cannot be written as a check, it is not a conclusion yet.
23
- 5. **Run the check first, every time after that.** Before touching code again, evaluate the check. That
24
- is what stops the loop.
25
-
26
- ## Signs the loop is happening
27
-
28
- - The same wording appears in two rounds of notes ("this needs a restart").
29
- - A change was made and its effect was never isolated from another change.
30
- - Behaviour is explained by the environment while a fact that would settle it is one call away.
31
- - The same file is edited repeatedly without any observation in between.
32
-
33
- ## What to record when closing one
34
-
35
- Next to the fix, in the repo rather than in chat: the observed fact, the check, and the one-line rule it
36
- implies. A note that cannot be re-evaluated by the next reader is a story, not a finding.
37
- ## 判据必须落在动作之前
38
-
39
- 事后报错等于没有预防:调用已经发生,代价已经付出,用户看到的是"你又犯了一次"。
40
-
41
- 因此每一条要留下的教训,最终形态必须是**动作前的一次判定**,而不是动作后的一条消息:
42
-
43
- 1. 把错误写成前置条件:「当 X 成立时,动作 A 不可执行」。
44
- 2. 这个判定要放在**最早能拦住 A 的位置**——能写进代码就写进代码(拒绝在发起之前),只能人工就写进调用前的检查清单。
45
- 3. 只在"事后"出现的提示不算完成。判据的验收标准是:**违规的那次调用根本没有发出去**。
46
- 4. 反例(不合格):代理返回 403 并附带说明。合格:代理在收到请求之前就拒绝,或工具在发起之前就不允许这次调用。
47
-
48
- 例:侧栏(同源代理)不能承载本机地址,因为那等于让代理去抓自己所在的服务器。
49
- 不合格做法——先发起,再由代理返回"不能到达 127.0.0.1";
50
- 合格做法——`panel` 面遇到 loopback 目标时,在 `open` 发起之前就拒绝,并指出应当改用 `builtin` 面。
@@ -1,39 +0,0 @@
1
- export const BRIDGE_VERSION_MESSAGE = '桥接版本过旧,请点击 卸载并重装'
2
- export const BRIDGE_PACKAGE_MESSAGE = '浏览器桥接不可用,请点击 卸载并重装'
3
- export const NATIVE_SURFACE_MESSAGE = '浏览器桥接不可用(原生侧栏未就绪),请打开 Desktop 浏览器侧栏后重试'
4
-
5
- export class BridgeVersionError extends Error {
6
- readonly code = 'BROWSER_BRIDGE_VERSION_MISMATCH'
7
- constructor(message = BRIDGE_VERSION_MESSAGE) {
8
- super(message)
9
- this.name = 'BridgeVersionError'
10
- }
11
- }
12
-
13
- export class NativeSurfaceUnavailableError extends Error {
14
- readonly code = 'BROWSER_NATIVE_SURFACE_UNAVAILABLE'
15
- constructor() {
16
- super(NATIVE_SURFACE_MESSAGE)
17
- this.name = 'NativeSurfaceUnavailableError'
18
- }
19
- }
20
-
21
- export function bridgePackageError(value: unknown): BridgeVersionError | NativeSurfaceUnavailableError | undefined {
22
- const fields = typeof value === 'object' && value !== null
23
- ? ['code', 'name', 'message', 'error', 'reason', 'note'].map(key => (value as Record<string, unknown>)[key])
24
- : [value]
25
- const hasCode = (code: string): boolean => fields.some(field => typeof field === 'string'
26
- && new RegExp(`(?:^|[^A-Z0-9_])${code}(?:$|[^A-Z0-9_])`).test(field))
27
- if (hasCode('BROWSER_BRIDGE_OUTDATED')) return new BridgeVersionError()
28
- if (hasCode('DSH_BRIDGE_PACKAGE_UNAVAILABLE')) return new BridgeVersionError(BRIDGE_PACKAGE_MESSAGE)
29
- if (hasCode('BROWSER_NATIVE_SURFACE_UNAVAILABLE')) return new NativeSurfaceUnavailableError()
30
- return undefined
31
- }
32
-
33
- export function isBridgeVersionMismatch(answer: Record<string, unknown>): boolean {
34
- return (typeof answer.protocol === 'number' && answer.protocol < 4)
35
- || answer.code === 'BROWSER_BRIDGE_OUTDATED'
36
- || (typeof answer.code === 'string' && /(?:protocol|version)[-_]mismatch|unsupported[-_]protocol/i.test(answer.code))
37
- || (typeof answer.error === 'string' && /\b(?:protocol|bridge version)\b.*\b(?:mismatch|unsupported|incompatible|too old|required)\b/i.test(answer.error))
38
- || (typeof answer.error === 'string' && /\b(?:unsupported|incompatible)\s+protocol\b/i.test(answer.error))
39
- }
@@ -1,89 +0,0 @@
1
- import type { BrowserTab } from './types.ts'
2
-
3
- export interface BrowserOwnerHandle {
4
- readonly owner: string
5
- }
6
-
7
- export interface BrowserSessionHandle extends BrowserOwnerHandle {
8
- readonly session: string
9
- }
10
-
11
- export interface BrowserTabHandle extends BrowserSessionHandle {
12
- readonly tab: string
13
- }
14
-
15
- export type BrowserSessionWireId = string & { readonly __browserSessionWireId: unique symbol }
16
- export type BrowserTabWireId = string & { readonly __browserTabWireId: unique symbol }
17
-
18
- function identity(value: unknown): asserts value is string {
19
- if (typeof value !== 'string' || value.length === 0) throw new Error('browser: handle identity must be a nonempty string')
20
- }
21
-
22
- export function browserSessionHandle(owner: string, session: string): BrowserSessionHandle {
23
- identity(owner)
24
- identity(session)
25
- if (session.startsWith('dsh-session:')) {
26
- const handle = resolveSessionHandle(session)
27
- if (handle.owner !== owner) throw new Error('browser: session handle belongs to another owner')
28
- return handle
29
- }
30
- return { owner, session }
31
- }
32
-
33
- export function resolveSessionHandle(wire: string): BrowserSessionHandle {
34
- let values: unknown
35
- try {
36
- if (!wire.startsWith('dsh-session:v1:')) throw new Error()
37
- values = JSON.parse(decodeURIComponent(wire.slice('dsh-session:v1:'.length)))
38
- if (!Array.isArray(values) || values.length !== 2) throw new Error()
39
- for (const value of values) identity(value)
40
- } catch {
41
- throw new Error('browser: invalid session handle')
42
- }
43
- const [owner, session] = values as [string, string]
44
- const handle = { owner, session }
45
- if (sessionWireId(handle) !== wire) throw new Error('browser: noncanonical session handle')
46
- return handle
47
- }
48
-
49
- export function sessionWireId(scope: BrowserSessionHandle): BrowserSessionWireId {
50
- identity(scope.owner)
51
- identity(scope.session)
52
- return `dsh-session:v1:${encodeURIComponent(JSON.stringify([scope.owner, scope.session]))}` as BrowserSessionWireId
53
- }
54
-
55
- export function tabWireId(handle: BrowserTabHandle): BrowserTabWireId {
56
- identity(handle.owner)
57
- identity(handle.session)
58
- identity(handle.tab)
59
- return `dsh-tab:v1:${encodeURIComponent(JSON.stringify([handle.owner, handle.session, handle.tab]))}` as BrowserTabWireId
60
- }
61
-
62
- export function scopedTabs(scope: BrowserSessionHandle, tabs: readonly BrowserTab[]): readonly (Omit<BrowserTab, 'id'> & { readonly id: BrowserTabWireId })[] {
63
- return tabs.map(tab => ({ ...tab, id: tab.id.startsWith('dsh-tab:')
64
- ? tabWireId(resolveTabHandle(scope, tab.id))
65
- : tabWireId({ ...scope, tab: tab.id }) }))
66
- }
67
-
68
- export function readTabHandle(wire: string): BrowserTabHandle {
69
- let values: unknown
70
- try {
71
- if (!wire.startsWith('dsh-tab:v1:')) throw new Error()
72
- values = JSON.parse(decodeURIComponent(wire.slice('dsh-tab:v1:'.length)))
73
- if (!Array.isArray(values) || values.length !== 3) throw new Error()
74
- for (const value of values) identity(value)
75
- } catch {
76
- throw new Error('browser: invalid tab handle; use the id returned by dsh_browser_list_tabs')
77
- }
78
- const [owner, session, tab] = values as [string, string, string]
79
- const handle = { owner, session, tab }
80
- if (tabWireId(handle) !== wire) throw new Error('browser: noncanonical tab handle')
81
- return handle
82
- }
83
-
84
- export function resolveTabHandle(scope: BrowserSessionHandle, wire: string): BrowserTabHandle {
85
- const handle = readTabHandle(wire)
86
- const { owner, session } = handle
87
- if (owner !== scope.owner || session !== scope.session) throw new Error('browser: tab handle is not open in this owner/session; list tabs again')
88
- return handle
89
- }