9remote 3.0.39 → 3.0.43
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.
- package/dist/cli.cjs +86 -86
- package/dist/extension/background.js +197 -81
- package/dist/extension/manifest.json +6 -5
- package/dist/extension/popup.html +7 -0
- package/dist/extension/popup.js +6 -0
- package/dist/extension/runner.js +606 -0
- package/dist/ptyDaemon.cjs +5 -5
- package/dist/server.cjs +254 -250
- package/dist/ui/assets/index-DQvkcQ8W.js +8 -0
- package/dist/ui/index.html +1 -1
- package/dist/web/404.html +1 -1
- package/dist/web/__next.__PAGE__.txt +4 -4
- package/dist/web/__next._full.txt +29 -23
- package/dist/web/__next._head.txt +4 -4
- package/dist/web/__next._index.txt +13 -10
- package/dist/web/__next._tree.txt +3 -3
- package/dist/web/_next/static/AhLhl9t958vI0woNHnp3P/_buildManifest.js +1 -0
- package/dist/web/_next/static/chunks/{0fb7b532.2e7a08a3edb2d789.js → 025762a4.c49f8207624e1667.js} +1 -1
- package/dist/web/_next/static/chunks/101.bfb3898573e4245d.js +1 -0
- package/dist/web/_next/static/chunks/1342.3d5707800ea67dcb.js +1 -0
- package/dist/web/_next/static/chunks/153.d7a869e0874f32e0.js +1 -0
- package/dist/web/_next/static/chunks/1561.8d395206716b3967.js +1 -0
- package/dist/web/_next/static/chunks/{4314.6bbd89507909cad1.js → 1599.ed9aa4b461112c1a.js} +1 -1
- package/dist/web/_next/static/chunks/1694.7c4e72f21d4ce34c.js +1 -0
- package/dist/web/_next/static/chunks/1772-ef73c166e83f5eff.js +1 -0
- package/dist/web/_next/static/chunks/1878.724a4af779f951aa.js +138 -0
- package/dist/web/_next/static/chunks/1879.0252e2bd9153348f.js +1 -0
- package/dist/web/_next/static/chunks/1920-5ead25286846df83.js +1 -0
- package/dist/web/_next/static/chunks/1968-4d2969f0b7112e0b.js +32 -0
- package/dist/web/_next/static/chunks/2004.f975891d8a569296.js +24 -0
- package/dist/web/_next/static/chunks/2094.05efbc3414828946.js +1 -0
- package/dist/web/_next/static/chunks/2209.2ee6023fed2ac7a5.js +1 -0
- package/dist/web/_next/static/chunks/236.88ef102773dd3a91.js +1 -0
- package/dist/web/_next/static/chunks/2369.22023f63f0eaf8db.js +1 -0
- package/dist/web/_next/static/chunks/{6420.bfa7bc86d03dcefc.js → 2401.73a0315a75c7b051.js} +1 -1
- package/dist/web/_next/static/chunks/2427.3a468cdfabd25124.js +1 -0
- package/dist/web/_next/static/chunks/2436.da0ef064f744b8af.js +115 -0
- package/dist/web/_next/static/chunks/{1222.16edfbb0beb9081f.js → 2488.87361126358794fd.js} +1 -1
- package/dist/web/_next/static/chunks/2561.6c8eb8cf71429d5d.js +36 -0
- package/dist/web/_next/static/chunks/2581.d09a7f19c64e4b97.js +1 -0
- package/dist/web/_next/static/chunks/{8044.5f87392585c9f3e4.js → 2615.86c58079ec7c597c.js} +1 -1
- package/dist/web/_next/static/chunks/2934.0caeb8b2d8b67139.js +1 -0
- package/dist/web/_next/static/chunks/{6274.a3795ca6dacb3d62.js → 3011.fc80a2aad3ef8778.js} +2 -2
- package/dist/web/_next/static/chunks/3255.3c96f02d5eb06783.js +23 -0
- package/dist/web/_next/static/chunks/3284.e56b0102fb9a3920.js +62 -0
- package/dist/web/_next/static/chunks/3301.1f7e2bd5ccb55064.js +1 -0
- package/dist/web/_next/static/chunks/3314.b5b5b3cca99d832e.js +1 -0
- package/dist/web/_next/static/chunks/{20154aaa.868648f838e03bf1.js → 33d0405b.71576a1f83124ecd.js} +1 -1
- package/dist/web/_next/static/chunks/3428.8818e0ef88c0e743.js +1 -0
- package/dist/web/_next/static/chunks/{3429.e69c6bd48e1207a9.js → 3443.8d771dadb470603c.js} +1 -1
- package/dist/web/_next/static/chunks/{6742.88fddf128fbeb43d.js → 3704.bf80aa0d55f950d0.js} +1 -1
- package/dist/web/_next/static/chunks/3916.141fb720bd1eee40.js +148 -0
- package/dist/web/_next/static/chunks/3973.e5c2013e2abeefd3.js +93 -0
- package/dist/web/_next/static/chunks/4065.7616cbd8f37a68e6.js +1 -0
- package/dist/web/_next/static/chunks/{9299.e37149b455be7e9d.js → 4129.a93c19870036f647.js} +1 -1
- package/dist/web/_next/static/chunks/{6730.88fc6f2ccc49496c.js → 4171.b0e5c6dc86bc8a5f.js} +1 -1
- package/dist/web/_next/static/chunks/4330.a8740b63075e6886.js +1 -0
- package/dist/web/_next/static/chunks/4378.a0629cfcbc20c406.js +1 -0
- package/dist/web/_next/static/chunks/4553.cad71717d538a2e5.js +1 -0
- package/dist/web/_next/static/chunks/4589.9bd287581ccd378b.js +1 -0
- package/dist/web/_next/static/chunks/4594.53636acacf285911.js +34 -0
- package/dist/web/_next/static/chunks/466.908e4592c2b93997.js +77 -0
- package/dist/web/_next/static/chunks/468.2e48222bf3517040.js +1 -0
- package/dist/web/_next/static/chunks/4712.b7062faa67f544b5.js +1 -0
- package/dist/web/_next/static/chunks/{9675.be4a175f92aa2f26.js → 4724.e0dffedb6972b738.js} +1 -1
- package/dist/web/_next/static/chunks/482.a0b5af31d7354a82.js +1 -0
- package/dist/web/_next/static/chunks/4929.fce0c23972476c66.js +1 -0
- package/dist/web/_next/static/chunks/4964.5a41b2d776aee556.js +1 -0
- package/dist/web/_next/static/chunks/499.cf81a39b9e6ce4a4.js +94 -0
- package/dist/web/_next/static/chunks/{0a7753a9.4cb02a98e2e453b9.js → 4ff7191e.d68cdd8504937de5.js} +1 -1
- package/dist/web/_next/static/chunks/5035.f7175d1037807b62.js +90 -0
- package/dist/web/_next/static/chunks/5198.b8e3a08cb60bc349.js +1 -0
- package/dist/web/_next/static/chunks/5421.430fa3a5488e15a9.js +21 -0
- package/dist/web/_next/static/chunks/{9871-c277aedb0437cb82.js → 556-a8f04c41c5663ee8.js} +1 -1
- package/dist/web/_next/static/chunks/5587-fc5af8c76df14222.js +1 -0
- package/dist/web/_next/static/chunks/5710.b055a101d6b51ff3.js +27 -0
- package/dist/web/_next/static/chunks/{2180.edcf5dc3d77ceee8.js → 5714.122f8cb7296bc9e1.js} +1 -1
- package/dist/web/_next/static/chunks/{1243.3f23d89283c156ea.js → 5757.2c157c0924cea1c2.js} +1 -1
- package/dist/web/_next/static/chunks/{3346-23aafd4add63869a.js → 5957-3d5d92b58dcc7d4e.js} +1 -1
- package/dist/web/_next/static/chunks/{565f33a6-fd3410bd29f39fdf.js → 5b8e7b36-a2678128cd5bdf5e.js} +1 -1
- package/dist/web/_next/static/chunks/6141-132d206408947c60.js +1 -0
- package/dist/web/_next/static/chunks/{7424.c8c9f85c8ea65885.js → 6181.6bdde6f59e3f2cea.js} +1 -1
- package/dist/web/_next/static/chunks/6221-cf883148bf8a4c1e.js +11 -0
- package/dist/web/_next/static/chunks/{3552.8dd9a3d2c3bcef65.js → 6372.51e578b15d566c0e.js} +2 -2
- package/dist/web/_next/static/chunks/6405.39e8b42a56b88bb5.js +1 -0
- package/dist/web/_next/static/chunks/641.7b1b12ccc56b3b3c.js +1 -0
- package/dist/web/_next/static/chunks/{6647.740ec32a32201eab.js → 6418.a86ca6012f0867ff.js} +1 -1
- package/dist/web/_next/static/chunks/{4924.3f5c77a103ac69a9.js → 6435.6aef0f9f1cc65be6.js} +1 -1
- package/dist/web/_next/static/chunks/6439.f02105d3687113e7.js +1 -0
- package/dist/web/_next/static/chunks/647.527b9a09373aab91.js +1 -0
- package/dist/web/_next/static/chunks/{8115.68d46fb961c724e0.js → 6470.7057ef6894a7f625.js} +16 -16
- package/dist/web/_next/static/chunks/{7507.77d9ac9eb03518f7.js → 6485.6ae2f3966cc25c9e.js} +1 -1
- package/dist/web/_next/static/chunks/{6987.743a63813c6288ce.js → 6512.cc81f46437639a0e.js} +2 -2
- package/dist/web/_next/static/chunks/6520.73f10855f9d4b5a8.js +1 -0
- package/dist/web/_next/static/chunks/668.1ddcf2e38071ae57.js +24 -0
- package/dist/web/_next/static/chunks/6815.8126ae5481c3bfd8.js +1 -0
- package/dist/web/_next/static/chunks/6925-af784cffb03dd330.js +1 -0
- package/dist/web/_next/static/chunks/6e6d0562.6ebb8f7db67bd943.js +122 -0
- package/dist/web/_next/static/chunks/7058.affbacca3457f5a7.js +41 -0
- package/dist/web/_next/static/chunks/7207.72d8a01e77112af2.js +1 -0
- package/dist/web/_next/static/chunks/{4090.441fa61655da9b38.js → 7359.b09680f38f75e105.js} +1 -1
- package/dist/web/_next/static/chunks/7369.a824cc623274cf63.js +1 -0
- package/dist/web/_next/static/chunks/7489.24938d89538cd03e.js +1 -0
- package/dist/web/_next/static/chunks/{9641.f6f2982fc4b4735f.js → 7576.273c3d0faf5c3d02.js} +1 -1
- package/dist/web/_next/static/chunks/7620.5c5935fd937c0e84.js +1 -0
- package/dist/web/_next/static/chunks/{1228.c4aa83586b3730b6.js → 7646.1c26e96ee36bc317.js} +1 -1
- package/dist/web/_next/static/chunks/7712.cd8c3dc2d794d714.js +1 -0
- package/dist/web/_next/static/chunks/{2038.b77e2c3d38385a76.js → 7812.aabc856212c93434.js} +1 -1
- package/dist/web/_next/static/chunks/804.38f05d79313a8dcc.js +104 -0
- package/dist/web/_next/static/chunks/8126-8e53bfff5a06af4e.js +1 -0
- package/dist/web/_next/static/chunks/820-99036fb63c5462c8.js +1 -0
- package/dist/web/_next/static/chunks/8304.936a74abe6f0a288.js +1 -0
- package/dist/web/_next/static/chunks/8314.7ff9d72cd8613f75.js +226 -0
- package/dist/web/_next/static/chunks/8390.5eda620e73ea6c5c.js +74 -0
- package/dist/web/_next/static/chunks/860.f7885efc630bcfd7.js +1 -0
- package/dist/web/_next/static/chunks/87c73c54-e11922cda838f8cc.js +1 -0
- package/dist/web/_next/static/chunks/887.15090f9a6a142a10.js +1 -0
- package/dist/web/_next/static/chunks/8977.1ab6ed8e2c098cf0.js +1 -0
- package/dist/web/_next/static/chunks/9121-897f98b646fc2ac0.js +1 -0
- package/dist/web/_next/static/chunks/9491-6dc334192080d071.js +86 -0
- package/dist/web/_next/static/chunks/951ed0e8.98070dce91103a63.js +1 -0
- package/dist/web/_next/static/chunks/9651.d199fbbbc3de43b8.js +215 -0
- package/dist/web/_next/static/chunks/9692.dd07a90166f5e6ff.js +1 -0
- package/dist/web/_next/static/chunks/{6075.a6b8434732056526.js → 9700.c47024f592537718.js} +1 -1
- package/dist/web/_next/static/chunks/9711.cf7aaa7fa6ec7dd7.js +287 -0
- package/dist/web/_next/static/chunks/9736.63b4a559c8a23186.js +1 -0
- package/dist/web/_next/static/chunks/{bbfbfb6c.069db3c4cc981ed3.js → 98f82933.0c4f9e5e83926351.js} +1 -1
- package/dist/web/_next/static/chunks/{da9a53d6.df25e193f1f5bcae.js → a36ae3fc.d666935373d1f579.js} +4 -4
- package/dist/web/_next/static/chunks/{adcd17ec-9a2791632136b67b.js → ab6c8a12-9dac45de556d8a8d.js} +1 -1
- package/dist/web/_next/static/chunks/app/_global-error/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/_not-found/page-9f829d2c4beb1840.js +1 -0
- package/dist/web/_next/static/chunks/app/admin/access/page-45f45ad529e5b691.js +5 -0
- package/dist/web/_next/static/chunks/app/admin/login/page-382072b5b43d3c29.js +1 -0
- package/dist/web/_next/static/chunks/app/admin/ota/page-293c0743bd60f454.js +5 -0
- package/dist/web/_next/static/chunks/app/admin/page-fc676dae451dd646.js +5 -0
- package/dist/web/_next/static/chunks/app/admin/turn/page-2ab33033fc7f0919.js +5 -0
- package/dist/web/_next/static/chunks/app/download/{page-2811ea822a1e586a.js → page-a65d1c7fcf6397af.js} +1 -1
- package/dist/web/_next/static/chunks/app/layout-f1429d22e935695f.js +1 -0
- package/dist/web/_next/static/chunks/app/login/page-a5dd37d1cbbb394e.js +1 -0
- package/dist/web/_next/static/chunks/app/{page-8387dba850541259.js → page-1e67d8a5f3775276.js} +3 -3
- package/dist/web/_next/static/chunks/app/workspace/browse/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/editor/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/files/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/git/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/layout-336820247249f65c.js +20 -0
- package/dist/web/_next/static/chunks/app/workspace/mobile/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/pair/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/remote/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/terminal/[sessionId]/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/welcome/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/app/workspace/workspaces/page-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/b2b4fb58.d2a067fe7df4a0d0.js +1 -0
- package/dist/web/_next/static/chunks/baeaa4ff-8eac34d2e07d1bb3.js +1 -0
- package/dist/web/_next/static/chunks/{7c89255b.f727562586fa21cc.js → c2d9a0c9.b4e0bb73c2ed317c.js} +1 -1
- package/dist/web/_next/static/chunks/{a012e9f0.7dbb2fe05ec0b816.js → ccfb6294.add4177b76c37868.js} +11 -11
- package/dist/web/_next/static/chunks/{c7ea4e13.6153499d4c2fb1f2.js → db261188.134a04dd616706a4.js} +1 -1
- package/dist/web/_next/static/chunks/framework-59d2d1720fc2b396.js +1 -0
- package/dist/web/_next/static/chunks/main-app-72391b47e9393c1b.js +1 -0
- package/dist/web/_next/static/chunks/main-e10b0dbebb4de0a8.js +5 -0
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/app-error-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/forbidden-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/global-error-48f06b4c48a1eef3.js +1 -0
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/not-found-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/unauthorized-2ece09c883187d82.js +1 -0
- package/dist/web/_next/static/chunks/webpack-dd1f7a5ae02e5d84.js +1 -0
- package/dist/web/_next/static/css/{b496025c9cd768cc.css → 15730e9f7c5c55ef.css} +1 -1
- package/dist/web/_next/static/css/7b03063e80720027.css +1 -0
- package/dist/web/_not-found/__next._full.txt +23 -19
- package/dist/web/_not-found/__next._head.txt +4 -4
- package/dist/web/_not-found/__next._index.txt +10 -10
- package/dist/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/web/_not-found/__next._not-found.txt +3 -3
- package/dist/web/_not-found/__next._tree.txt +3 -3
- package/dist/web/_not-found.html +1 -1
- package/dist/web/_not-found.txt +23 -19
- package/dist/web/admin/__next._full.txt +32 -25
- package/dist/web/admin/__next._head.txt +4 -4
- package/dist/web/admin/__next._index.txt +13 -10
- package/dist/web/admin/__next._tree.txt +3 -3
- package/dist/web/admin/__next.admin.__PAGE__.txt +4 -4
- package/dist/web/admin/__next.admin.txt +3 -3
- package/dist/web/admin/access/__next._full.txt +33 -25
- package/dist/web/admin/access/__next._head.txt +4 -4
- package/dist/web/admin/access/__next._index.txt +13 -10
- package/dist/web/admin/access/__next._tree.txt +3 -3
- package/dist/web/admin/access/__next.admin.access.__PAGE__.txt +4 -4
- package/dist/web/admin/access/__next.admin.access.txt +3 -3
- package/dist/web/admin/access/__next.admin.txt +3 -3
- package/dist/web/admin/access.html +1 -1
- package/dist/web/admin/access.txt +33 -25
- package/dist/web/admin/login/__next._full.txt +33 -25
- package/dist/web/admin/login/__next._head.txt +4 -4
- package/dist/web/admin/login/__next._index.txt +13 -10
- package/dist/web/admin/login/__next._tree.txt +3 -3
- package/dist/web/admin/login/__next.admin.login.__PAGE__.txt +4 -4
- package/dist/web/admin/login/__next.admin.login.txt +3 -3
- package/dist/web/admin/login/__next.admin.txt +3 -3
- package/dist/web/admin/login.html +1 -1
- package/dist/web/admin/login.txt +33 -25
- package/dist/web/admin/ota/__next._full.txt +33 -25
- package/dist/web/admin/ota/__next._head.txt +4 -4
- package/dist/web/admin/ota/__next._index.txt +13 -10
- package/dist/web/admin/ota/__next._tree.txt +3 -3
- package/dist/web/admin/ota/__next.admin.ota.__PAGE__.txt +4 -4
- package/dist/web/admin/ota/__next.admin.ota.txt +3 -3
- package/dist/web/admin/ota/__next.admin.txt +3 -3
- package/dist/web/admin/ota.html +1 -1
- package/dist/web/admin/ota.txt +33 -25
- package/dist/web/admin/turn/__next._full.txt +33 -25
- package/dist/web/admin/turn/__next._head.txt +4 -4
- package/dist/web/admin/turn/__next._index.txt +13 -10
- package/dist/web/admin/turn/__next._tree.txt +3 -3
- package/dist/web/admin/turn/__next.admin.turn.__PAGE__.txt +4 -4
- package/dist/web/admin/turn/__next.admin.turn.txt +3 -3
- package/dist/web/admin/turn/__next.admin.txt +3 -3
- package/dist/web/admin/turn.html +1 -1
- package/dist/web/admin/turn.txt +33 -25
- package/dist/web/admin.html +1 -1
- package/dist/web/admin.txt +32 -25
- package/dist/web/download/__next._full.txt +29 -22
- package/dist/web/download/__next._head.txt +4 -4
- package/dist/web/download/__next._index.txt +13 -10
- package/dist/web/download/__next._tree.txt +3 -3
- package/dist/web/download/__next.download.__PAGE__.txt +3 -3
- package/dist/web/download/__next.download.txt +3 -3
- package/dist/web/download.html +1 -1
- package/dist/web/download.txt +29 -22
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +29 -23
- package/dist/web/login/__next._full.txt +32 -25
- package/dist/web/login/__next._head.txt +4 -4
- package/dist/web/login/__next._index.txt +13 -10
- package/dist/web/login/__next._tree.txt +3 -3
- package/dist/web/login/__next.login.__PAGE__.txt +4 -4
- package/dist/web/login/__next.login.txt +3 -3
- package/dist/web/login.html +1 -1
- package/dist/web/login.txt +32 -25
- package/dist/web/workspace/__next._full.txt +29 -22
- package/dist/web/workspace/__next._head.txt +4 -4
- package/dist/web/workspace/__next._index.txt +13 -10
- package/dist/web/workspace/__next._tree.txt +3 -3
- package/dist/web/workspace/__next.workspace.__PAGE__.txt +2 -2
- package/dist/web/workspace/__next.workspace.txt +5 -5
- package/dist/web/workspace/browse/__next._full.txt +32 -24
- package/dist/web/workspace/browse/__next._head.txt +4 -4
- package/dist/web/workspace/browse/__next._index.txt +13 -10
- package/dist/web/workspace/browse/__next._tree.txt +3 -3
- package/dist/web/workspace/browse/__next.workspace.browse.__PAGE__.txt +2 -2
- package/dist/web/workspace/browse/__next.workspace.browse.txt +3 -3
- package/dist/web/workspace/browse/__next.workspace.txt +5 -5
- package/dist/web/workspace/browse.html +1 -1
- package/dist/web/workspace/browse.txt +32 -24
- package/dist/web/workspace/editor/__next._full.txt +32 -24
- package/dist/web/workspace/editor/__next._head.txt +4 -4
- package/dist/web/workspace/editor/__next._index.txt +13 -10
- package/dist/web/workspace/editor/__next._tree.txt +3 -3
- package/dist/web/workspace/editor/__next.workspace.editor.__PAGE__.txt +2 -2
- package/dist/web/workspace/editor/__next.workspace.editor.txt +3 -3
- package/dist/web/workspace/editor/__next.workspace.txt +5 -5
- package/dist/web/workspace/editor.html +1 -1
- package/dist/web/workspace/editor.txt +32 -24
- package/dist/web/workspace/files/__next._full.txt +32 -24
- package/dist/web/workspace/files/__next._head.txt +4 -4
- package/dist/web/workspace/files/__next._index.txt +13 -10
- package/dist/web/workspace/files/__next._tree.txt +3 -3
- package/dist/web/workspace/files/__next.workspace.files.__PAGE__.txt +2 -2
- package/dist/web/workspace/files/__next.workspace.files.txt +3 -3
- package/dist/web/workspace/files/__next.workspace.txt +5 -5
- package/dist/web/workspace/files.html +1 -1
- package/dist/web/workspace/files.txt +32 -24
- package/dist/web/workspace/git/__next._full.txt +32 -24
- package/dist/web/workspace/git/__next._head.txt +4 -4
- package/dist/web/workspace/git/__next._index.txt +13 -10
- package/dist/web/workspace/git/__next._tree.txt +3 -3
- package/dist/web/workspace/git/__next.workspace.git.__PAGE__.txt +2 -2
- package/dist/web/workspace/git/__next.workspace.git.txt +3 -3
- package/dist/web/workspace/git/__next.workspace.txt +5 -5
- package/dist/web/workspace/git.html +1 -1
- package/dist/web/workspace/git.txt +32 -24
- package/dist/web/workspace/mobile/__next._full.txt +32 -24
- package/dist/web/workspace/mobile/__next._head.txt +4 -4
- package/dist/web/workspace/mobile/__next._index.txt +13 -10
- package/dist/web/workspace/mobile/__next._tree.txt +3 -3
- package/dist/web/workspace/mobile/__next.workspace.mobile.__PAGE__.txt +2 -2
- package/dist/web/workspace/mobile/__next.workspace.mobile.txt +3 -3
- package/dist/web/workspace/mobile/__next.workspace.txt +5 -5
- package/dist/web/workspace/mobile.html +1 -1
- package/dist/web/workspace/mobile.txt +32 -24
- package/dist/web/workspace/pair/__next._full.txt +32 -24
- package/dist/web/workspace/pair/__next._head.txt +4 -4
- package/dist/web/workspace/pair/__next._index.txt +13 -10
- package/dist/web/workspace/pair/__next._tree.txt +3 -3
- package/dist/web/workspace/pair/__next.workspace.pair.__PAGE__.txt +2 -2
- package/dist/web/workspace/pair/__next.workspace.pair.txt +3 -3
- package/dist/web/workspace/pair/__next.workspace.txt +5 -5
- package/dist/web/workspace/pair.html +1 -1
- package/dist/web/workspace/pair.txt +32 -24
- package/dist/web/workspace/remote/__next._full.txt +32 -24
- package/dist/web/workspace/remote/__next._head.txt +4 -4
- package/dist/web/workspace/remote/__next._index.txt +13 -10
- package/dist/web/workspace/remote/__next._tree.txt +3 -3
- package/dist/web/workspace/remote/__next.workspace.remote.__PAGE__.txt +2 -2
- package/dist/web/workspace/remote/__next.workspace.remote.txt +3 -3
- package/dist/web/workspace/remote/__next.workspace.txt +5 -5
- package/dist/web/workspace/remote.html +1 -1
- package/dist/web/workspace/remote.txt +32 -24
- package/dist/web/workspace/terminal/default/__next._full.txt +33 -27
- package/dist/web/workspace/terminal/default/__next._head.txt +4 -4
- package/dist/web/workspace/terminal/default/__next._index.txt +13 -10
- package/dist/web/workspace/terminal/default/__next._tree.txt +3 -3
- package/dist/web/workspace/terminal/default/__next.workspace.terminal.$d$sessionId.__PAGE__.txt +2 -2
- package/dist/web/workspace/terminal/default/__next.workspace.terminal.$d$sessionId.txt +3 -3
- package/dist/web/workspace/terminal/default/__next.workspace.terminal.txt +3 -3
- package/dist/web/workspace/terminal/default/__next.workspace.txt +5 -5
- package/dist/web/workspace/terminal/default.html +1 -1
- package/dist/web/workspace/terminal/default.txt +33 -27
- package/dist/web/workspace/welcome/__next._full.txt +32 -24
- package/dist/web/workspace/welcome/__next._head.txt +4 -4
- package/dist/web/workspace/welcome/__next._index.txt +13 -10
- package/dist/web/workspace/welcome/__next._tree.txt +3 -3
- package/dist/web/workspace/welcome/__next.workspace.txt +5 -5
- package/dist/web/workspace/welcome/__next.workspace.welcome.__PAGE__.txt +2 -2
- package/dist/web/workspace/welcome/__next.workspace.welcome.txt +3 -3
- package/dist/web/workspace/welcome.html +1 -1
- package/dist/web/workspace/welcome.txt +32 -24
- package/dist/web/workspace/workspaces/__next._full.txt +32 -24
- package/dist/web/workspace/workspaces/__next._head.txt +4 -4
- package/dist/web/workspace/workspaces/__next._index.txt +13 -10
- package/dist/web/workspace/workspaces/__next._tree.txt +3 -3
- package/dist/web/workspace/workspaces/__next.workspace.txt +5 -5
- package/dist/web/workspace/workspaces/__next.workspace.workspaces.__PAGE__.txt +2 -2
- package/dist/web/workspace/workspaces/__next.workspace.workspaces.txt +3 -3
- package/dist/web/workspace/workspaces.html +1 -1
- package/dist/web/workspace/workspaces.txt +32 -24
- package/dist/web/workspace.html +1 -1
- package/dist/web/workspace.txt +29 -22
- package/package.json +5 -5
- package/dist/ui/assets/index-BKC13tXO.js +0 -8
- package/dist/web/_next/static/chunks/1050-b9af41e8856b58c0.js +0 -1
- package/dist/web/_next/static/chunks/132.71f657e5a607b7d3.js +0 -1
- package/dist/web/_next/static/chunks/133.1106654a28b5afda.js +0 -1
- package/dist/web/_next/static/chunks/1385.086b560acb0d7a68.js +0 -115
- package/dist/web/_next/static/chunks/1642.cac26d30ac331cb4.js +0 -1
- package/dist/web/_next/static/chunks/1733.f06c240b3ef8a428.js +0 -77
- package/dist/web/_next/static/chunks/1750.ea89a41e86ac2790.js +0 -1
- package/dist/web/_next/static/chunks/1763.28beedca593b5e19.js +0 -138
- package/dist/web/_next/static/chunks/179.b9e8f385bd414d1c.js +0 -62
- package/dist/web/_next/static/chunks/1838.7c8990f903e3524a.js +0 -215
- package/dist/web/_next/static/chunks/2112.d72eefbdf81659b3.js +0 -23
- package/dist/web/_next/static/chunks/2125.61c6e4a3541e30ad.js +0 -1
- package/dist/web/_next/static/chunks/2129.61afb2f4ff59e46a.js +0 -24
- package/dist/web/_next/static/chunks/213.ae43f03862ad9cc1.js +0 -1
- package/dist/web/_next/static/chunks/2179.3f55be0b79e3cca7.js +0 -1
- package/dist/web/_next/static/chunks/2264.0fc1474d26067a01.js +0 -1
- package/dist/web/_next/static/chunks/2376.ed6302a91a9de1ae.js +0 -36
- package/dist/web/_next/static/chunks/2545.3ff192a933baf11e.js +0 -1
- package/dist/web/_next/static/chunks/2620.d17f4fac0eec88a5.js +0 -1
- package/dist/web/_next/static/chunks/2847.d3124853ca727b78.js +0 -1
- package/dist/web/_next/static/chunks/2849.d810c3fdb2054b14.js +0 -1
- package/dist/web/_next/static/chunks/3189.64c6546d621eec0b.js +0 -1
- package/dist/web/_next/static/chunks/3348-9ef29f9cedf6c0df.js +0 -1
- package/dist/web/_next/static/chunks/3514.20bd03c8194dec25.js +0 -1
- package/dist/web/_next/static/chunks/3606.b59e695fd05b4eb3.js +0 -74
- package/dist/web/_next/static/chunks/3736.4a5662ceeecc6acb.js +0 -94
- package/dist/web/_next/static/chunks/392.842b338137824bb8.js +0 -1
- package/dist/web/_next/static/chunks/4136-d7c1ff2da0833b42.js +0 -86
- package/dist/web/_next/static/chunks/4300-a66b52c9e1a27db3.js +0 -1
- package/dist/web/_next/static/chunks/4303.54c4aa0b89834fc6.js +0 -1
- package/dist/web/_next/static/chunks/4551.d0d6723cacfb90b9.js +0 -226
- package/dist/web/_next/static/chunks/4566.d8e009823b8647d1.js +0 -90
- package/dist/web/_next/static/chunks/4643.1e356e007756e19d.js +0 -1
- package/dist/web/_next/static/chunks/4930.42e564644c94a93b.js +0 -1
- package/dist/web/_next/static/chunks/5155.d7e8db52ab4c95e0.js +0 -27
- package/dist/web/_next/static/chunks/5158-267908d069475cdc.js +0 -32
- package/dist/web/_next/static/chunks/543.5636e97aa68eb9c8.js +0 -41
- package/dist/web/_next/static/chunks/5506.98304a1821200439.js +0 -1
- package/dist/web/_next/static/chunks/5622.5ead5e748ecedbd1.js +0 -1
- package/dist/web/_next/static/chunks/5708.22b4531ceebf3eca.js +0 -1
- package/dist/web/_next/static/chunks/5788-f0c87f9c14fa0ff9.js +0 -1
- package/dist/web/_next/static/chunks/5804.ff72a927135eb74c.js +0 -93
- package/dist/web/_next/static/chunks/588.78e2528ff24df85c.js +0 -287
- package/dist/web/_next/static/chunks/6001.e5bcb28bb9ce6571.js +0 -1
- package/dist/web/_next/static/chunks/6180.82fa683aa16f21df.js +0 -1
- package/dist/web/_next/static/chunks/6276.aa48f74970f7ef3d.js +0 -1
- package/dist/web/_next/static/chunks/6419.34fdd4aa97c5cc5d.js +0 -1
- package/dist/web/_next/static/chunks/6552-cebe84e4399a184f.js +0 -1
- package/dist/web/_next/static/chunks/6739.22a05398bfd34922.js +0 -1
- package/dist/web/_next/static/chunks/674.b2f5d5fc3fb84c4a.js +0 -1
- package/dist/web/_next/static/chunks/7202.dad90ce4a1d78f67.js +0 -1
- package/dist/web/_next/static/chunks/7233.0f252f6c1cce8058.js +0 -1
- package/dist/web/_next/static/chunks/7248.d89bf328a0dc1b4c.js +0 -1
- package/dist/web/_next/static/chunks/7263.6f224c3924155294.js +0 -1
- package/dist/web/_next/static/chunks/7341.6958eac888a96823.js +0 -34
- package/dist/web/_next/static/chunks/7811.19082afa63eb73ba.js +0 -1
- package/dist/web/_next/static/chunks/7853.d01982fa0afc1ee2.js +0 -24
- package/dist/web/_next/static/chunks/7908.432ab9feeb9ae756.js +0 -1
- package/dist/web/_next/static/chunks/7960.2754ce9111bef59e.js +0 -1
- package/dist/web/_next/static/chunks/7967.6c62be01fad1603c.js +0 -1
- package/dist/web/_next/static/chunks/8054.feeb01b8acdb31d4.js +0 -1
- package/dist/web/_next/static/chunks/817.cd0f4d221eca4c8b.js +0 -104
- package/dist/web/_next/static/chunks/8207-45554e2570bc59e6.js +0 -1
- package/dist/web/_next/static/chunks/8467.c2c0273ac5e97e34.js +0 -1
- package/dist/web/_next/static/chunks/8495.d6cea1be03635fa8.js +0 -148
- package/dist/web/_next/static/chunks/8638.f44546e4532d76e8.js +0 -1
- package/dist/web/_next/static/chunks/8669-8d1fb8dce08c886d.js +0 -11
- package/dist/web/_next/static/chunks/8716.1ad6febb58e8560e.js +0 -1
- package/dist/web/_next/static/chunks/8762-e88a7f91d20d82bd.js +0 -1
- package/dist/web/_next/static/chunks/8839.1ad64faf06fb4a33.js +0 -1
- package/dist/web/_next/static/chunks/8922-4c589850b01d2e12.js +0 -1
- package/dist/web/_next/static/chunks/910.43be9c3be85c7fa0.js +0 -21
- package/dist/web/_next/static/chunks/925.7cfb725e605559a0.js +0 -1
- package/dist/web/_next/static/chunks/9259.97e2f3306fc149c7.js +0 -1
- package/dist/web/_next/static/chunks/9387.96263a2d1602a078.js +0 -1
- package/dist/web/_next/static/chunks/9568-0bfadca4fcb105aa.js +0 -1
- package/dist/web/_next/static/chunks/9860.05fa134ae44699e0.js +0 -1
- package/dist/web/_next/static/chunks/9b87412a.d2cfae4121762dec.js +0 -122
- package/dist/web/_next/static/chunks/a096f98a-5a93977f5f5de413.js +0 -1
- package/dist/web/_next/static/chunks/ab1da478.d051e56375dab6d8.js +0 -1
- package/dist/web/_next/static/chunks/app/_global-error/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/_not-found/page-877523282abd5a7c.js +0 -1
- package/dist/web/_next/static/chunks/app/admin/access/page-65febd13b3d1fc91.js +0 -5
- package/dist/web/_next/static/chunks/app/admin/login/page-8ff8150184b7ccaa.js +0 -1
- package/dist/web/_next/static/chunks/app/admin/ota/page-d8766baa3680522d.js +0 -5
- package/dist/web/_next/static/chunks/app/admin/page-6237b1487c05f33e.js +0 -5
- package/dist/web/_next/static/chunks/app/admin/turn/page-6a6b695b67d59451.js +0 -5
- package/dist/web/_next/static/chunks/app/dev/question/page-c7128ddf798789f1.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-a0e78c8427f97e4f.js +0 -1
- package/dist/web/_next/static/chunks/app/login/page-2a046d10af50c87a.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/browse/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/editor/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/files/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/git/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/layout-9b28454945238595.js +0 -20
- package/dist/web/_next/static/chunks/app/workspace/mobile/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/pair/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/remote/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/terminal/[sessionId]/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/welcome/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/app/workspace/workspaces/page-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/c7879cf7-0d16fce1674078f9.js +0 -1
- package/dist/web/_next/static/chunks/cdcce140.7a440644c3dd52b8.js +0 -1
- package/dist/web/_next/static/chunks/framework-42053c69543a55f9.js +0 -1
- package/dist/web/_next/static/chunks/main-255c95c36766ce86.js +0 -5
- package/dist/web/_next/static/chunks/main-app-1831d4f902c3fcb9.js +0 -1
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/app-error-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/forbidden-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/global-error-76800531999827bd.js +0 -1
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/not-found-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/next/dist/client/components/builtin/unauthorized-e656bb9bc0f3fd3d.js +0 -1
- package/dist/web/_next/static/chunks/webpack-beef15eb580fc66b.js +0 -1
- package/dist/web/_next/static/css/c48f9629be2a67b4.css +0 -1
- package/dist/web/_next/static/hFRLMLaLieW6POo9cLvLQ/_buildManifest.js +0 -1
- package/dist/web/dev/question/__next._full.txt +0 -29
- package/dist/web/dev/question/__next._head.txt +0 -6
- package/dist/web/dev/question/__next._index.txt +0 -12
- package/dist/web/dev/question/__next._tree.txt +0 -6
- package/dist/web/dev/question/__next.dev.question.__PAGE__.txt +0 -9
- package/dist/web/dev/question/__next.dev.question.txt +0 -5
- package/dist/web/dev/question/__next.dev.txt +0 -5
- package/dist/web/dev/question.html +0 -1
- package/dist/web/dev/question.txt +0 -29
- /package/dist/web/_next/static/{hFRLMLaLieW6POo9cLvLQ → AhLhl9t958vI0woNHnp3P}/_ssgManifest.js +0 -0
- /package/dist/web/_next/static/chunks/{1311.8c6b8930e22ceea0.js → 6153.8c6b8930e22ceea0.js} +0 -0
- /package/dist/web/_next/static/chunks/{3692.8c6b8930e22ceea0.js → 8534.8c6b8930e22ceea0.js} +0 -0
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
// 9remote in-page runner (AutoAgent pattern): a STATIC content script — no
|
|
2
|
+
// eval anywhere (MV3 extension CSP blocks it) — exposing the engine's page
|
|
3
|
+
// primitives as named ops. Bodies mirror host/features/browserUse/snapshot.js
|
|
4
|
+
// and the in-page expressions of engine.js: change either side, change both.
|
|
5
|
+
// The ISOLATED world keeps window.__9rFast caching coherent across calls.
|
|
6
|
+
if (!window.__9rRunner) {
|
|
7
|
+
window.__9rRunner = true;
|
|
8
|
+
|
|
9
|
+
// ---- constants mirrored from host/features/browserUse/constants.js ----
|
|
10
|
+
const MAX_ELEMENTS = 248;
|
|
11
|
+
const PAGE_TEXT_CAP = 12000;
|
|
12
|
+
const READ_TOTAL_CAP = 200000;
|
|
13
|
+
|
|
14
|
+
const boot = () => {
|
|
15
|
+
if (!window.__9rFast) window.__9rFast = { ids: new WeakMap(), nodes: new Map(), next: 1 };
|
|
16
|
+
return window.__9rFast;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// ---- snapshotBody (mirrors snapshot.js snapshotBody) ----
|
|
20
|
+
const numWin = (v, dflt) => {
|
|
21
|
+
const n = Math.floor(Number(v));
|
|
22
|
+
return Number.isFinite(n) && n >= 0 ? n : dflt;
|
|
23
|
+
};
|
|
24
|
+
function snapshotBody(win = {}) {
|
|
25
|
+
const cache = boot();
|
|
26
|
+
const WIN_FROM = numWin(win.from, 0), WIN_LEN = Math.max(1, numWin(win.len, MAX_ELEMENTS)), WIN_CAP = Math.max(1, numWin(win.cap, MAX_ELEMENTS));
|
|
27
|
+
const identity = e => {
|
|
28
|
+
if (!cache.ids.has(e)) cache.ids.set(e, cache.next++);
|
|
29
|
+
const id = cache.ids.get(e); cache.nodes.set(id, e); return id;
|
|
30
|
+
};
|
|
31
|
+
for (const [id, e] of cache.nodes) if (!e.isConnected) cache.nodes.delete(id);
|
|
32
|
+
const safe = e => !['hidden'].includes(e.type);
|
|
33
|
+
const visible = e => !e.closest('[aria-hidden="true"],[inert]') &&
|
|
34
|
+
e.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true });
|
|
35
|
+
const name = (e, seen = new Set()) => {
|
|
36
|
+
if (!e || seen.has(e)) return '';
|
|
37
|
+
seen.add(e);
|
|
38
|
+
const referenced = (e.getAttribute('aria-labelledby') || '').split(/\s+/)
|
|
39
|
+
.map(id => name(document.getElementById(id), seen)).filter(Boolean).join(' ');
|
|
40
|
+
const slotText = e => [...e.querySelectorAll('slot')]
|
|
41
|
+
.map(s => [...s.assignedNodes()].map(n => n.textContent || '').join('')).join(' ').trim();
|
|
42
|
+
return referenced || e.getAttribute('aria-label') ||
|
|
43
|
+
[...(e.labels || [])].map(l => name(l, seen)).filter(Boolean).join(' ') ||
|
|
44
|
+
(['button', 'submit', 'reset'].includes(e.type) ? e.value : '') || e.getAttribute('alt') ||
|
|
45
|
+
(e.tagName === 'INPUT' ? '' : [...e.childNodes].map(n => n.nodeType === 3 ? n.textContent :
|
|
46
|
+
n.nodeType === 1 && n.getAttribute('aria-hidden') !== 'true' ? name(n, seen) : '').join(' ').trim() || slotText(e)) ||
|
|
47
|
+
e.getAttribute('title') || e.getAttribute('placeholder') || (e.tagName === 'IFRAME' ? ((() => { try { return (e.src ? 'iframe: ' + (new URL(e.src).hostname || e.src) : 'iframe'); } catch { return 'iframe'; } })()) : '');
|
|
48
|
+
};
|
|
49
|
+
const roles = ['button', 'link', 'checkbox', 'radio', 'switch', 'tab', 'menuitem', 'menuitemradio',
|
|
50
|
+
'option', 'gridcell', 'combobox', 'textbox', 'searchbox', 'spinbutton'];
|
|
51
|
+
const selector = 'a[href],button,input,textarea,select,summary,iframe,[contenteditable="true"],[onclick],' +
|
|
52
|
+
roles.map(role => '[role="' + role + '"]').join(',');
|
|
53
|
+
const role = e => {
|
|
54
|
+
if (e.tagName === 'IFRAME') return 'iframe';
|
|
55
|
+
const explicit = e.getAttribute('role');
|
|
56
|
+
if (roles.includes(explicit)) return explicit;
|
|
57
|
+
if (e.tagName === 'BUTTON' || e.tagName === 'SUMMARY') return 'button';
|
|
58
|
+
if (e.tagName === 'A') return 'link';
|
|
59
|
+
if (e.tagName === 'SELECT') return 'combobox';
|
|
60
|
+
if (e.tagName === 'TEXTAREA' || e.isContentEditable) return 'textbox';
|
|
61
|
+
if (e.tagName === 'INPUT') {
|
|
62
|
+
if (['checkbox', 'radio'].includes(e.type)) return e.type;
|
|
63
|
+
if (['button', 'submit', 'reset', 'image'].includes(e.type)) return 'button';
|
|
64
|
+
if (e.type === 'search') return 'searchbox';
|
|
65
|
+
if (e.type === 'number') return 'spinbutton';
|
|
66
|
+
if (['text', 'email', 'url', 'tel', 'password'].includes(e.type)) return 'textbox';
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
};
|
|
70
|
+
cache.pageKey = () => [performance.timeOrigin, location.href, scrollX, scrollY, innerWidth, innerHeight,
|
|
71
|
+
[...document.querySelectorAll('input,textarea,select')].filter(e => safe(e) && e.type !== 'password')
|
|
72
|
+
.map(e => [identity(e), e.value, e.checked, e.selectedIndex, e.disabled, e.readOnly])];
|
|
73
|
+
const secCache = new WeakMap();
|
|
74
|
+
const ctxOf = e => {
|
|
75
|
+
const sec = e.closest('dialog,[role="dialog"],section,fieldset,form,nav,aside');
|
|
76
|
+
if (!sec) return null;
|
|
77
|
+
if (!secCache.has(sec)) {
|
|
78
|
+
const t = (sec.getAttribute('aria-label') || sec.querySelector('h1,h2,h3,h4,legend')?.textContent || '').trim();
|
|
79
|
+
secCache.set(sec, t.slice(0, 40));
|
|
80
|
+
}
|
|
81
|
+
const v = secCache.get(sec);
|
|
82
|
+
return v || null;
|
|
83
|
+
};
|
|
84
|
+
const SEG_SEL = 'section,nav,aside,main,article,dialog,form,fieldset,[role="dialog"],' +
|
|
85
|
+
'[role="region"],[role="group"],[role="tablist"],[role="tabpanel"],' +
|
|
86
|
+
'[role="navigation"],[role="complementary"],[role="banner"],' +
|
|
87
|
+
'[role="contentinfo"],[role="form"],[role="search"]';
|
|
88
|
+
const segName = s => {
|
|
89
|
+
const a = s.getAttribute('aria-label');
|
|
90
|
+
if (a) return a.slice(0, 40);
|
|
91
|
+
const h = s.querySelector('h1,h2,h3,h4,legend');
|
|
92
|
+
return h ? (h.textContent || '').trim().slice(0, 40) : null;
|
|
93
|
+
};
|
|
94
|
+
const pathCache = new WeakMap();
|
|
95
|
+
const pathOf = e => {
|
|
96
|
+
if (pathCache.has(e)) return pathCache.get(e);
|
|
97
|
+
const segs = []; let n = e.parentElement;
|
|
98
|
+
const doc = e.ownerDocument || document;
|
|
99
|
+
while (n && n !== doc.body && n !== doc.documentElement && segs.length < 4) {
|
|
100
|
+
if (n.matches(SEG_SEL)) { const s = segName(n); if (s) segs.unshift(s); }
|
|
101
|
+
n = n.parentElement;
|
|
102
|
+
}
|
|
103
|
+
if (doc !== document) segs.unshift('iframe');
|
|
104
|
+
const p = segs.length ? segs : null;
|
|
105
|
+
pathCache.set(e, p); return p;
|
|
106
|
+
};
|
|
107
|
+
const getRect = e => {
|
|
108
|
+
const r = e.getBoundingClientRect();
|
|
109
|
+
if (e.ownerDocument && e.ownerDocument !== document) {
|
|
110
|
+
try {
|
|
111
|
+
const fr = e.ownerDocument.defaultView?.frameElement?.getBoundingClientRect();
|
|
112
|
+
if (fr) return { x: fr.x + r.x, y: fr.y + r.y, width: r.width, height: r.height };
|
|
113
|
+
} catch { }
|
|
114
|
+
}
|
|
115
|
+
return { x: r.x, y: r.y, width: r.width, height: r.height };
|
|
116
|
+
};
|
|
117
|
+
const actions = [];
|
|
118
|
+
const deepQuery = (root, sel) => {
|
|
119
|
+
const found = [...root.querySelectorAll(sel)];
|
|
120
|
+
for (const e of root.querySelectorAll('*')) {
|
|
121
|
+
if (e.shadowRoot) found.push(...deepQuery(e.shadowRoot, sel));
|
|
122
|
+
if (e.tagName === 'IFRAME') {
|
|
123
|
+
try { if (e.contentDocument) found.push(...deepQuery(e.contentDocument, sel)); } catch { }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return found;
|
|
127
|
+
};
|
|
128
|
+
const pfxOf = e => {
|
|
129
|
+
const t = e.tagName ? e.tagName.toLowerCase() : '';
|
|
130
|
+
if (t === 'button' || t === 'summary') return 'btn';
|
|
131
|
+
if (t === 'a') return 'a';
|
|
132
|
+
if (t === 'input' || t === 'textarea') return 'inp';
|
|
133
|
+
if (t === 'select') return 'sel';
|
|
134
|
+
if (t === 'iframe') return 'ifr';
|
|
135
|
+
if (t === 'div') return 'div';
|
|
136
|
+
if (t === 'span') return 'span';
|
|
137
|
+
return t ? t.slice(0, 4) : 'e';
|
|
138
|
+
};
|
|
139
|
+
for (const e of deepQuery(document, selector)) {
|
|
140
|
+
if (!safe(e) || !visible(e) || e.matches(':disabled') || e.closest('[aria-disabled="true"]')) continue;
|
|
141
|
+
const r = getRect(e), x = r.x + r.width / 2, y = r.y + r.height / 2,
|
|
142
|
+
rname = role(e) || (e.hasAttribute('onclick') ? 'button' : null);
|
|
143
|
+
if (r.width <= 0 || r.height <= 0) continue;
|
|
144
|
+
if (e.type === 'file') {
|
|
145
|
+
actions.push({ node: identity(e), tag: 'input', pfx: 'inp', role: 'button', label: (name(e) || 'Choose file').replace(/\s+/g, ' ').trim(),
|
|
146
|
+
ctx: ctxOf(e), path: pathOf(e), rect: { x: r.x, y: r.y, w: r.width, h: r.height }, kind: 'upload', value: '' });
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (!rname) continue;
|
|
150
|
+
if (rname === 'gridcell' && e.querySelector('button,[role="button"]')) continue;
|
|
151
|
+
const base = { node: identity(e), tag: e.tagName.toLowerCase(), pfx: pfxOf(e), role: rname, label: (name(e) || rname).replace(/\s+/g, ' ').trim(),
|
|
152
|
+
ctx: ctxOf(e), path: pathOf(e), rect: { x: r.x, y: r.y, w: r.width, h: r.height },
|
|
153
|
+
href: (e.tagName === 'A' && e.href && !e.href.startsWith('javascript:')) ? e.href : undefined };
|
|
154
|
+
for (const key of ['checked', 'selected', 'expanded']) {
|
|
155
|
+
const value = e.getAttribute('aria-' + key);
|
|
156
|
+
if (value !== null) base[key] = value;
|
|
157
|
+
}
|
|
158
|
+
if (['checkbox', 'radio'].includes(e.type)) base.checked = String(e.checked);
|
|
159
|
+
if (e.tagName === 'SELECT') {
|
|
160
|
+
const selLabel = e.selectedOptions[0]?.label || 'Current';
|
|
161
|
+
for (const o of e.options) if (!o.selected && !o.disabled && !o.closest('optgroup[disabled]'))
|
|
162
|
+
actions.push({ ...base, kind: 'select', value: o.value,
|
|
163
|
+
current_value: [...e.selectedOptions].map(o => o.label).join(', '), label: selLabel + ' → ' + o.label });
|
|
164
|
+
} else {
|
|
165
|
+
const editable = !e.readOnly && e.getAttribute('aria-readonly') !== 'true' &&
|
|
166
|
+
(['textbox', 'searchbox', 'spinbutton'].includes(rname) ||
|
|
167
|
+
(rname === 'combobox' && ['INPUT', 'TEXTAREA'].includes(e.tagName)));
|
|
168
|
+
const value = e.type === 'password' ? (e.value ? '••••' : '') :
|
|
169
|
+
'value' in e ? String(e.value) :
|
|
170
|
+
e.isContentEditable || rname === 'combobox' ? e.innerText.trim() : '';
|
|
171
|
+
actions.push({ ...base, kind: editable ? 'fill' : 'click', value });
|
|
172
|
+
if (editable) actions.push({ ...base, kind: 'click', value, label: 'Open ' + base.label });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const picked = new Set(actions.map(a => cache.nodes.get(a.node)));
|
|
176
|
+
const isMarked = e => e.hasAttribute('data-testid') || e.hasAttribute('data-test') ||
|
|
177
|
+
e.hasAttribute('data-ui-name') || e.hasAttribute('data-automation-id') || e.hasAttribute('data-filters-item');
|
|
178
|
+
const pointerCandidates = [];
|
|
179
|
+
for (const e of deepQuery(document, 'div,span,li,label')) {
|
|
180
|
+
if (pointerCandidates.length >= WIN_CAP) break;
|
|
181
|
+
if (e.matches(selector)) continue;
|
|
182
|
+
if (!safe(e) || !visible(e) || e.matches(':disabled') || e.closest('[aria-disabled="true"]')) continue;
|
|
183
|
+
const inner = e.querySelector('button,a,input,select,textarea,summary,[contenteditable="true"],[onclick],[role="button"],[role="checkbox"],[role="switch"]');
|
|
184
|
+
if (inner) {
|
|
185
|
+
const ghost = inner.matches('input[type="checkbox"],input[type="radio"]') &&
|
|
186
|
+
!inner.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true });
|
|
187
|
+
if (!ghost) continue;
|
|
188
|
+
}
|
|
189
|
+
const st = getComputedStyle(e);
|
|
190
|
+
if (st.pointerEvents === 'none' || (st.cursor !== 'pointer' && !isMarked(e))) continue;
|
|
191
|
+
const label = name(e);
|
|
192
|
+
if (!label) continue;
|
|
193
|
+
const r = getRect(e);
|
|
194
|
+
if (r.width <= 0 || r.height <= 0) continue;
|
|
195
|
+
if ([...picked].some(p => p.contains(e))) continue;
|
|
196
|
+
pointerCandidates.push({ el: e, base: { node: identity(e), tag: e.tagName.toLowerCase(), pfx: pfxOf(e), role: 'button', label: label.slice(0, 80).replace(/\s+/g, ' ').trim(),
|
|
197
|
+
ctx: ctxOf(e), path: pathOf(e), rect: { x: r.x, y: r.y, w: r.width, h: r.height } } });
|
|
198
|
+
picked.add(e);
|
|
199
|
+
}
|
|
200
|
+
for (const c of pointerCandidates) actions.push({ ...c.base, kind: 'click', value: '' });
|
|
201
|
+
const height = document.documentElement.scrollHeight;
|
|
202
|
+
const words = []; let length = 0;
|
|
203
|
+
const NOISE = 'nav,header,aside,form,button,select,option,label,dialog,' +
|
|
204
|
+
'[role="banner"],[role="navigation"],[role="complementary"],' +
|
|
205
|
+
'.ad,.ads,.advert,.cookie,.cookies,[class*="cookie-"],[id*="cookie"],.popup,.modal,.sidebar,.breadcrumb';
|
|
206
|
+
const collectText = (doc) => {
|
|
207
|
+
if (!doc?.body) return;
|
|
208
|
+
const walker = doc.createTreeWalker(doc.body, NodeFilter.SHOW_TEXT);
|
|
209
|
+
const range = doc.createRange(); let node;
|
|
210
|
+
while ((node = walker.nextNode()) && length < PAGE_TEXT_CAP) {
|
|
211
|
+
const value = node.textContent.trim(), parent = node.parentElement;
|
|
212
|
+
if (!value || !parent || parent.closest('script,style,noscript,template') ||
|
|
213
|
+
parent.closest(NOISE) || !visible(parent)) continue;
|
|
214
|
+
range.selectNodeContents(node); const r = range.getBoundingClientRect();
|
|
215
|
+
if (r.width > 0 && r.height > 0) {
|
|
216
|
+
if (height <= innerHeight * 1.5 || (r.bottom >= -100 && r.top <= innerHeight + 400)) {
|
|
217
|
+
words.push(value); length += value.length;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
collectText(document);
|
|
223
|
+
for (const f of document.querySelectorAll('iframe')) {
|
|
224
|
+
try { if (f.contentDocument) collectText(f.contentDocument); } catch { }
|
|
225
|
+
}
|
|
226
|
+
const text = words.join('\n').slice(0, PAGE_TEXT_CAP);
|
|
227
|
+
const headings = [];
|
|
228
|
+
for (const h of document.querySelectorAll('h1,h2,h3,h4')) {
|
|
229
|
+
if (headings.length >= 12) break;
|
|
230
|
+
const t = h.textContent.trim().slice(0, 60);
|
|
231
|
+
if (t) headings.push(t);
|
|
232
|
+
}
|
|
233
|
+
const page_key = cache.pageKey();
|
|
234
|
+
const total = actions.length;
|
|
235
|
+
const shown = actions.slice(WIN_FROM, WIN_FROM + WIN_LEN);
|
|
236
|
+
const omitted_actions = Math.max(0, total - (WIN_FROM + shown.length));
|
|
237
|
+
const semantics = shown.map(({ rect, ctx, path, ...action }) => action);
|
|
238
|
+
const frameCount = document.querySelectorAll('iframe').length;
|
|
239
|
+
const marker = [performance.timeOrigin, location.href, scrollX, scrollY, innerWidth, innerHeight,
|
|
240
|
+
document.title, text, semantics, page_key[6], frameCount];
|
|
241
|
+
const contentMarker = [performance.timeOrigin, location.href, innerWidth, innerHeight,
|
|
242
|
+
document.title, text, semantics, frameCount];
|
|
243
|
+
const actions2 = shown;
|
|
244
|
+
{ const seq = new Map(); actions2.forEach(a => { const n = seq.get(a.node) || 0; seq.set(a.node, n + 1);
|
|
245
|
+
const p = a.pfx || 'e';
|
|
246
|
+
a.id = p + a.node + (n ? '-' + n : ''); }); }
|
|
247
|
+
const scrollStep = Math.max(400, Math.round(innerHeight * 0.85));
|
|
248
|
+
if (scrollY + innerHeight < height - 2) actions2.push({ id: 'scroll_down', kind: 'scroll', label: 'Scroll down', delta: scrollStep });
|
|
249
|
+
if (scrollY > 0) actions2.push({ id: 'scroll_up', kind: 'scroll', label: 'Scroll up', delta: -scrollStep });
|
|
250
|
+
actions2.push({ id: 'wait', kind: 'wait', label: 'Wait for the page to update' });
|
|
251
|
+
return { url: location.href, title: document.title, w: innerWidth, h: innerHeight, text, headings,
|
|
252
|
+
scroll: { y: scrollY, height }, actions: actions2, marker, contentMarker, page_key, omitted_actions,
|
|
253
|
+
total_elements: total, element_from: WIN_FROM };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// ---- ops ----
|
|
257
|
+
const OPS = {
|
|
258
|
+
snapshot: (win) => snapshotBody(win || {}),
|
|
259
|
+
marker: () => snapshotBody().marker,
|
|
260
|
+
readyState: () => document.readyState,
|
|
261
|
+
href: () => location.href,
|
|
262
|
+
iframeCount: () => document.querySelectorAll('iframe').length,
|
|
263
|
+
decorate: (p) => {
|
|
264
|
+
const c = window.__9rFast; if (!c) return;
|
|
265
|
+
const e = c.nodes.get(p.node);
|
|
266
|
+
const r = e?.getBoundingClientRect();
|
|
267
|
+
if (!r || !r.width) return;
|
|
268
|
+
document.getElementById('__9rFx')?.remove();
|
|
269
|
+
const box = document.createElement('div');
|
|
270
|
+
box.id = '__9rFx';
|
|
271
|
+
box.style.cssText = 'position:fixed;pointer-events:none;z-index:2147483647;' +
|
|
272
|
+
'left:' + (r.x - 3) + 'px;top:' + (r.y - 3) + 'px;width:' + (r.width + 6) + 'px;height:' + (r.height + 6) +
|
|
273
|
+
'px;border:2px solid #ff3b30;border-radius:4px;transition:opacity .3s';
|
|
274
|
+
const dot = document.createElement('div');
|
|
275
|
+
dot.style.cssText = 'position:fixed;pointer-events:none;z-index:2147483647;' +
|
|
276
|
+
'width:16px;height:16px;border-radius:50%;background:#ff3b30;opacity:.85;' +
|
|
277
|
+
'left:' + (p.x - 68) + 'px;top:' + (p.y - 68) + 'px;' +
|
|
278
|
+
'transition:left .12s ease-out,top .12s ease-out,opacity .3s';
|
|
279
|
+
box.appendChild(dot);
|
|
280
|
+
(document.body || document.documentElement).append(box);
|
|
281
|
+
requestAnimationFrame(() => {
|
|
282
|
+
dot.style.left = (p.x - 8) + 'px';
|
|
283
|
+
dot.style.top = (p.y - 8) + 'px';
|
|
284
|
+
});
|
|
285
|
+
setTimeout(() => {
|
|
286
|
+
box.style.opacity = '0'; dot.style.opacity = '0';
|
|
287
|
+
setTimeout(() => { box.remove(); }, 320);
|
|
288
|
+
}, 240);
|
|
289
|
+
return true;
|
|
290
|
+
},
|
|
291
|
+
// Occlusion/visibility gate — mirrors engine.js resolve()
|
|
292
|
+
resolve: (action) => {
|
|
293
|
+
const c = window.__9rFast; if (!c) return null;
|
|
294
|
+
const e = c.nodes.get(action.node);
|
|
295
|
+
if (!e?.isConnected || e.matches(':disabled') || e.closest('[aria-disabled="true"],[inert]') ||
|
|
296
|
+
!e.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true })) return null;
|
|
297
|
+
if (action.kind === 'fill' && (e.readOnly || e.getAttribute('aria-readonly') === 'true')) return null;
|
|
298
|
+
const frameEl = e.ownerDocument !== document ? e.ownerDocument.defaultView?.frameElement : null;
|
|
299
|
+
const center = (rect) => ({ x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 });
|
|
300
|
+
let r = e.getBoundingClientRect();
|
|
301
|
+
if (frameEl) {
|
|
302
|
+
const fr = frameEl.getBoundingClientRect();
|
|
303
|
+
r = { x: fr.x + r.x, y: fr.y + r.y, width: r.width, height: r.height };
|
|
304
|
+
}
|
|
305
|
+
if (!r.width || !r.height) return null;
|
|
306
|
+
let p = center(r);
|
|
307
|
+
if (p.x < 0 || p.y < 0 || p.x >= innerWidth || p.y >= innerHeight) {
|
|
308
|
+
e.scrollIntoView({ block: 'center', inline: 'center' });
|
|
309
|
+
r = e.getBoundingClientRect();
|
|
310
|
+
if (frameEl) {
|
|
311
|
+
const fr = frameEl.getBoundingClientRect();
|
|
312
|
+
r = { x: fr.x + r.x, y: fr.y + r.y, width: r.width, height: r.height };
|
|
313
|
+
}
|
|
314
|
+
p = center(r);
|
|
315
|
+
if (!r.width || !r.height || p.x < 0 || p.y < 0 || p.x >= innerWidth || p.y >= innerHeight) return null;
|
|
316
|
+
}
|
|
317
|
+
if (action.kind !== 'fill') {
|
|
318
|
+
const hit = document.elementFromPoint(p.x, p.y);
|
|
319
|
+
if (!hit) return null;
|
|
320
|
+
const up = (el) => { const chain = []; let n = el;
|
|
321
|
+
while (n) { chain.push(n); n = n.assignedSlot || n.parentElement || (n.getRootNode()?.host || null); }
|
|
322
|
+
return chain; };
|
|
323
|
+
const hitChain = up(hit);
|
|
324
|
+
const isHit = e.contains(hit) || up(e).some((a) => a === hit) || hitChain.some((n) => n === e || e.contains(n)) ||
|
|
325
|
+
(frameEl && (hit === frameEl || frameEl.contains(hit) || hit.contains(frameEl)));
|
|
326
|
+
if (!isHit) return null;
|
|
327
|
+
}
|
|
328
|
+
if (action.kind === 'select') {
|
|
329
|
+
if (e.tagName !== 'SELECT' || ![...e.options].some(o => o.value === action.value && !o.disabled)) return null;
|
|
330
|
+
e.value = action.value;
|
|
331
|
+
e.dispatchEvent(new Event('input', { bubbles: true }));
|
|
332
|
+
e.dispatchEvent(new Event('change', { bubbles: true }));
|
|
333
|
+
}
|
|
334
|
+
return { x: p.x, y: p.y };
|
|
335
|
+
},
|
|
336
|
+
focus: (node) => { const e = window.__9rFast?.nodes.get(node); if (e) e.focus(); return true; },
|
|
337
|
+
verifyText: (node, text) => {
|
|
338
|
+
const e = window.__9rFast?.nodes.get(node); if (!e) return true;
|
|
339
|
+
const v = 'value' in e ? String(e.value) : (e.innerText || '');
|
|
340
|
+
return v.includes(text);
|
|
341
|
+
},
|
|
342
|
+
focusInsert: (node, text) => {
|
|
343
|
+
const e = window.__9rFast?.nodes.get(node); if (e) e.focus();
|
|
344
|
+
document.execCommand('insertText', false, text);
|
|
345
|
+
return true;
|
|
346
|
+
},
|
|
347
|
+
insertText: (text) => { document.execCommand('insertText', false, String(text ?? '')); return true; },
|
|
348
|
+
selectAll: () => { document.execCommand('selectAll', false, null); return true; },
|
|
349
|
+
scrollBy: (dy, behavior) => { window.scrollBy({ top: Number(dy) || 0, left: 0, behavior: behavior || 'instant' }); return true; },
|
|
350
|
+
scrollByPct: (pct) => { window.scrollBy({ top: Math.round(window.innerHeight * Number(pct || 0)), left: 0, behavior: 'instant' }); return true; },
|
|
351
|
+
scrollToY: (target) => { window.scrollTo({ top: Math.max(0, Number(target) - Math.round(window.innerHeight / 2)), left: 0, behavior: 'instant' }); return true; },
|
|
352
|
+
scrollToEdge: (edge) => {
|
|
353
|
+
const height = document.documentElement.scrollHeight;
|
|
354
|
+
window.scrollTo({ top: edge === 'top' ? 0 : height, left: 0, behavior: 'instant' });
|
|
355
|
+
return true;
|
|
356
|
+
},
|
|
357
|
+
historyGo: (delta) => { history.go(Number(delta) || 0); return true; },
|
|
358
|
+
jsClick: (node) => {
|
|
359
|
+
const e = window.__9rFast?.nodes.get(node);
|
|
360
|
+
if (!e?.isConnected || !e.checkVisibility({ checkOpacity: true, checkVisibilityCSS: true })) return false;
|
|
361
|
+
e.scrollIntoView({ block: 'center' });
|
|
362
|
+
e.click();
|
|
363
|
+
return true;
|
|
364
|
+
},
|
|
365
|
+
scrollToAction: (node) => {
|
|
366
|
+
const e = window.__9rFast?.nodes.get(node);
|
|
367
|
+
if (!e?.isConnected) return false;
|
|
368
|
+
e.scrollIntoView({ block: 'center', inline: 'center', behavior: 'instant' });
|
|
369
|
+
return true;
|
|
370
|
+
},
|
|
371
|
+
scrollToText: (needle) => {
|
|
372
|
+
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
|
373
|
+
let node;
|
|
374
|
+
const lower = String(needle).toLowerCase();
|
|
375
|
+
while ((node = walker.nextNode())) {
|
|
376
|
+
if (node.textContent.toLowerCase().includes(lower)) {
|
|
377
|
+
const el = node.parentElement;
|
|
378
|
+
if (el && el.isConnected) {
|
|
379
|
+
el.scrollIntoView({ block: 'center', inline: 'center', behavior: 'instant' });
|
|
380
|
+
return true;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return false;
|
|
385
|
+
},
|
|
386
|
+
scrollBurstStep: (delta, needles) => {
|
|
387
|
+
window.scrollBy({ top: Number(delta) || 0, left: 0, behavior: 'instant' });
|
|
388
|
+
const vis = [];
|
|
389
|
+
const w = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
|
390
|
+
let node;
|
|
391
|
+
while ((node = w.nextNode()) && vis.length < 400) {
|
|
392
|
+
const range = document.createRange();
|
|
393
|
+
range.selectNodeContents(node);
|
|
394
|
+
const b = range.getBoundingClientRect();
|
|
395
|
+
if (b.bottom >= 0 && b.top <= window.innerHeight && b.width > 0) vis.push(node.textContent);
|
|
396
|
+
}
|
|
397
|
+
const t = vis.join('\n');
|
|
398
|
+
return { y: Math.round(window.scrollY), hit: needles.length > 0 && needles.every((s) => t.includes(s)) };
|
|
399
|
+
},
|
|
400
|
+
scrollBurstTo: (needles) => new Promise(resolve => {
|
|
401
|
+
const step = Math.max(400, Math.round(window.innerHeight * 0.85));
|
|
402
|
+
const t0 = performance.now();
|
|
403
|
+
const visibleText = () => {
|
|
404
|
+
const vis = [];
|
|
405
|
+
const w = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
|
406
|
+
let node;
|
|
407
|
+
while ((node = w.nextNode()) && vis.length < 400) {
|
|
408
|
+
const range = document.createRange();
|
|
409
|
+
range.selectNodeContents(node);
|
|
410
|
+
const b = range.getBoundingClientRect();
|
|
411
|
+
if (b.bottom >= 0 && b.top <= window.innerHeight && b.width > 0) vis.push(node.textContent);
|
|
412
|
+
}
|
|
413
|
+
return vis.join('\n');
|
|
414
|
+
};
|
|
415
|
+
let hops = 0;
|
|
416
|
+
const hop = () => {
|
|
417
|
+
if (hops >= 60 || performance.now() - t0 > 3000) return resolve({ found: false, hops, y: Math.round(window.scrollY) });
|
|
418
|
+
const before = Math.round(window.scrollY);
|
|
419
|
+
window.scrollBy({ top: step, left: 0, behavior: 'instant' });
|
|
420
|
+
hops++;
|
|
421
|
+
if (Math.round(window.scrollY) === before && hops > 1) return resolve({ found: false, hops, y: before, bottom: true });
|
|
422
|
+
const t = visibleText();
|
|
423
|
+
if (needles.length && needles.every((s) => t.includes(s))) return resolve({ found: true, hops, y: Math.round(window.scrollY) });
|
|
424
|
+
setTimeout(hop, 0);
|
|
425
|
+
};
|
|
426
|
+
hop();
|
|
427
|
+
}),
|
|
428
|
+
stableDom: (quiet, min, cap) => new Promise(resolve => {
|
|
429
|
+
let ob = null, t = null;
|
|
430
|
+
const t0 = performance.now();
|
|
431
|
+
let last = t0;
|
|
432
|
+
const done = () => { if (t) clearTimeout(t); try { ob && ob.disconnect(); } catch { } resolve(1); };
|
|
433
|
+
if (!document.body) { setTimeout(done, Math.min(Math.max(min, quiet), cap)); return; }
|
|
434
|
+
const check = () => {
|
|
435
|
+
const now = performance.now();
|
|
436
|
+
if ((now - last >= quiet && now - t0 >= min) || now - t0 >= cap) return done();
|
|
437
|
+
t = setTimeout(check, 30);
|
|
438
|
+
};
|
|
439
|
+
ob = new MutationObserver(() => { last = performance.now(); });
|
|
440
|
+
ob.observe(document.body, { childList: true, subtree: true, attributes: true });
|
|
441
|
+
check();
|
|
442
|
+
}),
|
|
443
|
+
// Synthetic input (AutoAgent executor pattern) — isTrusted=false
|
|
444
|
+
mouse: (type, x, y) => {
|
|
445
|
+
const el = document.elementFromPoint(x, y) || document.body;
|
|
446
|
+
const px = { bubbles: true, cancelable: true, clientX: x, clientY: y, pointerType: 'mouse', isPrimary: true, view: window };
|
|
447
|
+
const mo = { bubbles: true, cancelable: true, clientX: x, clientY: y, button: 0, view: window };
|
|
448
|
+
if (type === 'move') {
|
|
449
|
+
el.dispatchEvent(new PointerEvent('pointermove', px));
|
|
450
|
+
el.dispatchEvent(new MouseEvent('mousemove', mo));
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
if (type === 'down') {
|
|
454
|
+
el.dispatchEvent(new PointerEvent('pointerover', px));
|
|
455
|
+
el.dispatchEvent(new MouseEvent('mouseover', mo));
|
|
456
|
+
el.dispatchEvent(new PointerEvent('pointerdown', px));
|
|
457
|
+
el.dispatchEvent(new MouseEvent('mousedown', { ...mo, buttons: 1 }));
|
|
458
|
+
if (typeof el.focus === 'function') el.focus({ preventScroll: true });
|
|
459
|
+
return true;
|
|
460
|
+
}
|
|
461
|
+
el.dispatchEvent(new PointerEvent('pointerup', px));
|
|
462
|
+
el.dispatchEvent(new MouseEvent('mouseup', mo));
|
|
463
|
+
if (typeof el.click === 'function') el.click();
|
|
464
|
+
else el.dispatchEvent(new MouseEvent('click', mo));
|
|
465
|
+
return true;
|
|
466
|
+
},
|
|
467
|
+
key: (p) => {
|
|
468
|
+
const vkOf = { Enter: 13, Escape: 27, Tab: 9, Backspace: 8, ArrowDown: 40, ArrowUp: 38, ArrowLeft: 37, ArrowRight: 39 };
|
|
469
|
+
const t = document.activeElement || document.body;
|
|
470
|
+
if (typeof t.focus === 'function') t.focus({ preventScroll: true });
|
|
471
|
+
if (p.commands && p.commands.includes('selectAll')) { document.execCommand('selectAll', false, null); return true; }
|
|
472
|
+
const key = p.key || '';
|
|
473
|
+
const vk = p.vk ?? vkOf[key] ?? (key.length === 1 ? key.toUpperCase().charCodeAt(0) : 0);
|
|
474
|
+
const ev = { key, code: p.code || key, keyCode: vk, which: vk, bubbles: true, cancelable: true, view: window,
|
|
475
|
+
ctrlKey: !!(p.modifiers & 2), altKey: !!(p.modifiers & 1), metaKey: !!(p.modifiers & 4), shiftKey: !!(p.modifiers & 8) };
|
|
476
|
+
t.dispatchEvent(new KeyboardEvent(p.type === 'keyDown' ? 'keydown' : 'keyup', ev));
|
|
477
|
+
if (p.type === 'keyDown' && key === 'Enter') {
|
|
478
|
+
const form = t instanceof HTMLInputElement && t.form;
|
|
479
|
+
if (form) {
|
|
480
|
+
const btn = form.querySelector('button[type="submit"], input[type="submit"]');
|
|
481
|
+
if (btn) btn.click(); else if (form.requestSubmit) form.requestSubmit();
|
|
482
|
+
} else if (t instanceof HTMLTextAreaElement) document.execCommand('insertLineBreak');
|
|
483
|
+
}
|
|
484
|
+
return true;
|
|
485
|
+
},
|
|
486
|
+
read: (parent, from, len) => {
|
|
487
|
+
const needle = String(parent || '').toLowerCase().slice(0, 40);
|
|
488
|
+
const fromNum = Math.max(0, Math.floor(Number(from) || 0));
|
|
489
|
+
const lenNum = len == null ? PAGE_TEXT_CAP : Math.min(READ_TOTAL_CAP, Math.max(1, Math.floor(Number(len) || 1)));
|
|
490
|
+
const visible = e => !e.closest('[aria-hidden="true"],[inert],[hidden],details:not([open]),template');
|
|
491
|
+
const NOISE = 'nav,header,aside,form,button,select,option,label,dialog,' +
|
|
492
|
+
'[role="banner"],[role="navigation"],[role="complementary"],[role="menu"],[role="listbox"],' +
|
|
493
|
+
'.select-menu,.select-menu-modal,details-menu,' +
|
|
494
|
+
'.ad,.ads,.advert,.cookie,.cookies,[class*="cookie-"],[id*="cookie"],.popup,.modal,.sidebar,.breadcrumb';
|
|
495
|
+
const SEG_SEL = 'section,nav,aside,main,article,dialog,form,fieldset,[role="dialog"],' +
|
|
496
|
+
'[role="region"],[role="group"],[role="tablist"],[role="tabpanel"],' +
|
|
497
|
+
'[role="navigation"],[role="complementary"],[role="banner"],' +
|
|
498
|
+
'[role="contentinfo"],[role="form"],[role="search"]';
|
|
499
|
+
const segName = s => { const a = s.getAttribute('aria-label'); if (a) return a.slice(0, 40);
|
|
500
|
+
const h = s.querySelector('h1,h2,h3,h4,legend'); return h ? (h.textContent || '').trim().slice(0, 40) : null; };
|
|
501
|
+
const deep = (root, sel) => { const f = [...root.querySelectorAll(sel)];
|
|
502
|
+
for (const e of root.querySelectorAll('*')) if (e.shadowRoot) f.push(...deep(e.shadowRoot, sel)); return f; };
|
|
503
|
+
const named = deep(document, SEG_SEL).map(segName).filter(Boolean);
|
|
504
|
+
let root = document.body;
|
|
505
|
+
if (needle === '') {
|
|
506
|
+
const solo = sel => { const f = deep(document, sel); return f.length === 1 ? f[0] : null; };
|
|
507
|
+
root = solo('article') || solo('main,[role="main"]') || root;
|
|
508
|
+
} else {
|
|
509
|
+
const hit = deep(document, SEG_SEL).find(s => { const n = segName(s); return n && n.toLowerCase().includes(needle); });
|
|
510
|
+
if (!hit) return { error: 'no section matches', sections: [...new Set(named)] };
|
|
511
|
+
root = hit;
|
|
512
|
+
}
|
|
513
|
+
const noiseSkip = c => { const n = c.closest(NOISE); return Boolean(n) && n !== root && !n.contains(root); };
|
|
514
|
+
const BLOCK = 'p,h1,h2,h3,h4,h5,h6,li,blockquote,pre,dt,dd,figure,table';
|
|
515
|
+
const isBlock = e => e.nodeType === 1 && e.matches(BLOCK);
|
|
516
|
+
const shortUrl = u => { try {
|
|
517
|
+
const url = new URL(u, location.href);
|
|
518
|
+
if (url.origin !== location.origin) return url.host + url.pathname + url.search + url.hash;
|
|
519
|
+
if (url.pathname === location.pathname && url.search === location.search) return url.hash || url.pathname;
|
|
520
|
+
return url.pathname + url.search + url.hash;
|
|
521
|
+
} catch { return u; } };
|
|
522
|
+
const inlineText = e => [...e.childNodes].map(n => n.nodeType === 3 ? n.textContent :
|
|
523
|
+
(n.nodeType === 1 && !isBlock(n) && !n.matches('script,style,noscript,template') && visible(n) && !noiseSkip(n)) ?
|
|
524
|
+
(n.tagName === 'A' && n.href && !n.href.startsWith('javascript:') ?
|
|
525
|
+
'[' + inlineText(n) + '](' + shortUrl(n.href) + ')' : inlineText(n)) : '').join(' ');
|
|
526
|
+
const clean = s => String(s || '').replace(/\s+/g, ' ').replace(/\s+([.,;:!?])/g, '$1').trim();
|
|
527
|
+
const lines = []; let length = 0;
|
|
528
|
+
const push = (raw, indent) => { const t = clean(raw); if (!t) return false;
|
|
529
|
+
const out = (indent ? ' '.repeat(indent) : '') + t; lines.push(out); length += out.length + 1;
|
|
530
|
+
return length >= READ_TOTAL_CAP; };
|
|
531
|
+
const descend = (el, liDepth) => {
|
|
532
|
+
const children = [...el.children].filter(c => !c.matches('script,style,noscript,template') && !noiseSkip(c) && visible(c));
|
|
533
|
+
let i = 0;
|
|
534
|
+
while (i < children.length) {
|
|
535
|
+
const c = children[i];
|
|
536
|
+
if (isBlock(c)) { if (blockLine(c, liDepth)) return true; i++; continue; }
|
|
537
|
+
let j = i; while (j < children.length && !isBlock(children[j]) && children[j].tagName === c.tagName && !children[j].children.length) j++;
|
|
538
|
+
if (j - i >= 2) {
|
|
539
|
+
const cells = children.slice(i, j).map(k => clean(inlineText(k))).filter(Boolean);
|
|
540
|
+
if (cells.length >= 2) { if (push(cells.join(' · '), liDepth)) return true; i = j; continue; }
|
|
541
|
+
}
|
|
542
|
+
if (c.querySelector(BLOCK)) { if (descend(c, liDepth)) return true; }
|
|
543
|
+
else {
|
|
544
|
+
const ks = [...c.children];
|
|
545
|
+
if (ks.length >= 2 && ks.every(k => k.tagName === ks[0].tagName && !k.children.length)) {
|
|
546
|
+
const cells = ks.map(k => clean(inlineText(k))).filter(Boolean);
|
|
547
|
+
if (cells.length >= 2) { if (push(cells.join(' · '), liDepth)) return true; i++; continue; }
|
|
548
|
+
}
|
|
549
|
+
if (push(inlineText(c), liDepth)) return true;
|
|
550
|
+
}
|
|
551
|
+
i++;
|
|
552
|
+
}
|
|
553
|
+
return false;
|
|
554
|
+
};
|
|
555
|
+
const blockLine = (b, liDepth) => {
|
|
556
|
+
const tag = b.tagName;
|
|
557
|
+
if (/^H[1-6]$/.test(tag)) return push('#'.repeat(+tag[1]) + ' ' + clean(b.textContent), 0);
|
|
558
|
+
if (tag === 'LI') {
|
|
559
|
+
const d = liDepth || 0;
|
|
560
|
+
const t = inlineText(b); if (t && push('- ' + t, d)) return true;
|
|
561
|
+
return b.querySelector(BLOCK) ? descend(b, d + 1) : false;
|
|
562
|
+
}
|
|
563
|
+
if (tag === 'TABLE') {
|
|
564
|
+
for (const tr of b.querySelectorAll('tr')) {
|
|
565
|
+
const cells = [...tr.children].map(td => clean(td.textContent)).filter(Boolean);
|
|
566
|
+
if (cells.length && push('| ' + cells.join(' | ') + ' |', liDepth || 0)) return true;
|
|
567
|
+
}
|
|
568
|
+
return false;
|
|
569
|
+
}
|
|
570
|
+
const t = inlineText(b); if (t && push(t, liDepth)) return true;
|
|
571
|
+
return b.querySelector(BLOCK) ? descend(b, liDepth) : false;
|
|
572
|
+
};
|
|
573
|
+
const directText = e => [...e.childNodes].filter(n => n.nodeType === 3).map(n => n.textContent).join(' ');
|
|
574
|
+
const t = directText(root); if (t) push(t, 0);
|
|
575
|
+
descend(root, 0);
|
|
576
|
+
let total = 0; for (const l of lines) total += l.length + 1;
|
|
577
|
+
let cum = 0, out = [], taken = 0;
|
|
578
|
+
for (const l of lines) {
|
|
579
|
+
cum += l.length + 1;
|
|
580
|
+
if (cum <= fromNum) continue;
|
|
581
|
+
let pushLine = l;
|
|
582
|
+
if (taken + pushLine.length > lenNum) {
|
|
583
|
+
pushLine = pushLine.slice(0, Math.max(0, lenNum - taken));
|
|
584
|
+
}
|
|
585
|
+
out.push(pushLine); taken += pushLine.length + 1;
|
|
586
|
+
if (taken >= lenNum) break;
|
|
587
|
+
}
|
|
588
|
+
return { url: location.href, title: document.title, text: out.join('\n'), total, sections: [...new Set(named)] };
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
chrome.runtime.onMessage.addListener((msg, _sender, sendResponse) => {
|
|
593
|
+
if (msg?.t !== "op") return false;
|
|
594
|
+
(async () => {
|
|
595
|
+
try {
|
|
596
|
+
const fn = OPS[msg.op];
|
|
597
|
+
if (!fn) return sendResponse({ ok: false, err: `unknown op: ${msg.op}` });
|
|
598
|
+
const v = await fn(...(msg.args || []));
|
|
599
|
+
sendResponse({ ok: true, v: v ?? null });
|
|
600
|
+
} catch (e) {
|
|
601
|
+
sendResponse({ ok: false, err: String(e?.message || e) });
|
|
602
|
+
}
|
|
603
|
+
})();
|
|
604
|
+
return true; // async reply
|
|
605
|
+
});
|
|
606
|
+
}
|